@voyantjs/resources 0.3.0 → 0.3.1

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":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAyBjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAoFD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GAAG,OAAO,eAAe,CAAA"}
package/dist/routes.js CHANGED
@@ -17,10 +17,11 @@ const batchUpdateResourceRequirementSchema = createBatchUpdateSchema(updateResou
17
17
  const batchUpdateResourceSlotAssignmentSchema = createBatchUpdateSchema(updateResourceSlotAssignmentSchema);
18
18
  const batchUpdateResourceCloseoutSchema = createBatchUpdateSchema(updateResourceCloseoutSchema);
19
19
  async function handleBatchUpdate({ db, ids, patch, update, }) {
20
- const results = await Promise.all(ids.map(async (id) => {
20
+ const results = [];
21
+ for (const id of ids) {
21
22
  const row = await update(db, id, patch);
22
- return row ? { id, row } : { id, row: null };
23
- }));
23
+ results.push({ id, row });
24
+ }
24
25
  const data = results.flatMap((result) => (result.row ? [result.row] : []));
25
26
  const failed = results
26
27
  .filter((result) => result.row === null)
@@ -33,10 +34,11 @@ async function handleBatchUpdate({ db, ids, patch, update, }) {
33
34
  };
34
35
  }
35
36
  async function handleBatchDelete({ db, ids, remove, }) {
36
- const results = await Promise.all(ids.map(async (id) => {
37
+ const results = [];
38
+ for (const id of ids) {
37
39
  const row = await remove(db, id);
38
- return row ? { id } : { id, error: "Not found" };
39
- }));
40
+ results.push(row ? { id } : { id, error: "Not found" });
41
+ }
40
42
  const deletedIds = results.flatMap((result) => ("error" in result ? [] : [result.id]));
41
43
  const failed = results
42
44
  .filter((result) => "error" in result)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/resources",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "FSL-1.1-Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,12 +25,14 @@
25
25
  "drizzle-orm": "^0.45.2",
26
26
  "hono": "^4.12.10",
27
27
  "zod": "^4.3.6",
28
- "@voyantjs/core": "0.3.0",
29
- "@voyantjs/db": "0.3.0",
30
- "@voyantjs/hono": "0.3.0"
28
+ "@voyantjs/core": "0.3.1",
29
+ "@voyantjs/db": "0.3.1",
30
+ "@voyantjs/hono": "0.3.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "typescript": "^6.0.2",
34
+ "@voyantjs/availability": "0.3.1",
35
+ "@voyantjs/products": "0.3.1",
34
36
  "@voyantjs/voyant-typescript-config": "0.1.0"
35
37
  },
36
38
  "files": [
@@ -47,7 +49,7 @@
47
49
  "scripts": {
48
50
  "typecheck": "tsc --noEmit",
49
51
  "lint": "biome check src/",
50
- "test": "vitest run",
52
+ "test": "node scripts/run-tests.cjs",
51
53
  "build": "tsc -p tsconfig.json",
52
54
  "clean": "rm -rf dist"
53
55
  },