@arcadia-eternity/content-sdk 4.14.0 → 4.15.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.
@@ -121,12 +121,15 @@ export async function buildPresentation(root, sources, { includeLocales = true }
121
121
  typeof kind !== 'string' ||
122
122
  !['image', 'audio', 'swf'].includes(kind) ||
123
123
  typeof location !== 'string' ||
124
- Object.keys(record).some(key => !['id', 'source', 'kind', 'name', 'tags'].includes(key)) ||
124
+ Object.keys(record).some(key => !['id', 'source', 'kind', 'name', 'tags', 'sha256'].includes(key)) ||
125
125
  (record.name !== undefined && typeof record.name !== 'string') ||
126
126
  (record.tags !== undefined &&
127
127
  (!Array.isArray(record.tags) || record.tags.some((tag) => typeof tag !== 'string'))))
128
128
  throw new Error(`${relative(root, source.file)}: Invalid resource definition ${id}`);
129
129
  const url = remote(location) ? new URL(location) : undefined;
130
+ if (record.sha256 !== undefined &&
131
+ (!url || typeof record.sha256 !== 'string' || !/^[a-f0-9]{64}$/.test(record.sha256)))
132
+ throw new Error(`Invalid HTTP resource SHA-256: ${id}`);
130
133
  if (url && (url.username || url.password))
131
134
  throw new Error(`Resource URL must not contain credentials: ${id}`);
132
135
  const mime = mimeTypes[extname(url ? url.pathname : location).toLowerCase()];
@@ -138,7 +141,14 @@ export async function buildPresentation(root, sources, { includeLocales = true }
138
141
  : mime !== 'application/x-shockwave-flash'))
139
142
  throw new Error(`Resource type does not match source: ${id}`);
140
143
  if (url) {
141
- resources.push({ kind: 'http', id, source: location, mime, ...(record.tags ? { tags: record.tags } : {}) });
144
+ resources.push({
145
+ kind: 'http',
146
+ id,
147
+ source: location,
148
+ mime,
149
+ ...(typeof record.sha256 === 'string' && { sha256: record.sha256 }),
150
+ ...(record.tags ? { tags: record.tags } : {}),
151
+ });
142
152
  continue;
143
153
  }
144
154
  if (!validAssetPath(location))
@@ -21,7 +21,7 @@
21
21
  "devDependencies": {
22
22
  "@types/node": "26.6.6",
23
23
  "typescript": "6.0.3",
24
- "@arcadia-eternity/content-sdk": "4.14.0",
24
+ "@arcadia-eternity/content-sdk": "4.15.0",
25
25
  "fflate": "0.8.3"
26
26
  },
27
27
  "arcadia": {
@@ -38,6 +38,6 @@
38
38
  "license": "MIT",
39
39
  "engines": {
40
40
  "node": ">=24 <25",
41
- "arcadia": "^4.14.0"
41
+ "arcadia": "^4.15.0"
42
42
  }
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcadia-eternity/content-sdk",
3
- "version": "4.14.0",
3
+ "version": "4.15.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -68,10 +68,10 @@
68
68
  "zod": "4.6.7",
69
69
  "fflate": "0.8.3",
70
70
  "simple-git": "4.1.0",
71
- "@arcadia-eternity/battle": "4.14.0",
72
- "@arcadia-eternity/pack-loader": "4.14.0",
73
- "@arcadia-eternity/const": "4.14.0",
74
- "@arcadia-eternity/schema": "4.14.0"
71
+ "@arcadia-eternity/const": "4.15.0",
72
+ "@arcadia-eternity/pack-loader": "4.15.0",
73
+ "@arcadia-eternity/schema": "4.15.0",
74
+ "@arcadia-eternity/battle": "4.15.0"
75
75
  },
76
76
  "repository": {
77
77
  "type": "git",