@voyantjs/suppliers 0.111.1 → 0.111.3
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/dist/routes.d.ts +4 -4
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +12 -3
- package/dist/service-core.d.ts +2 -2
- package/dist/service-operations.d.ts +2 -2
- package/package.json +6 -6
package/dist/routes.d.ts
CHANGED
|
@@ -338,11 +338,11 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
338
338
|
contactEmail: string | null;
|
|
339
339
|
contactPhone: string | null;
|
|
340
340
|
name: string;
|
|
341
|
+
type: "other" | "hotel" | "restaurant" | "transfer" | "guide" | "experience" | "airline";
|
|
341
342
|
id: string;
|
|
343
|
+
status: "pending" | "active" | "inactive";
|
|
342
344
|
createdAt: string;
|
|
343
345
|
updatedAt: string;
|
|
344
|
-
status: "pending" | "active" | "inactive";
|
|
345
|
-
type: "other" | "hotel" | "restaurant" | "transfer" | "guide" | "experience" | "airline";
|
|
346
346
|
description: string | null;
|
|
347
347
|
tags: string[] | null;
|
|
348
348
|
defaultCurrency: string | null;
|
|
@@ -709,8 +709,8 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
709
709
|
};
|
|
710
710
|
output: {
|
|
711
711
|
data: {
|
|
712
|
-
name: string;
|
|
713
712
|
duration: string | null;
|
|
713
|
+
name: string;
|
|
714
714
|
id: string;
|
|
715
715
|
createdAt: string;
|
|
716
716
|
updatedAt: string;
|
|
@@ -1110,9 +1110,9 @@ export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
|
1110
1110
|
output: {
|
|
1111
1111
|
data: {
|
|
1112
1112
|
id: string;
|
|
1113
|
+
status: "pending" | "active" | "expired" | "terminated";
|
|
1113
1114
|
createdAt: string;
|
|
1114
1115
|
updatedAt: string;
|
|
1115
|
-
status: "pending" | "active" | "expired" | "terminated";
|
|
1116
1116
|
startDate: string;
|
|
1117
1117
|
endDate: string | null;
|
|
1118
1118
|
supplierId: string;
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAqBjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAmBD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAsavB,CAAA;AAEJ,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAA"}
|
package/dist/routes.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { aggregateSnapshotKey, readThroughAggregateSnapshot, } from "@voyantjs/db/aggregate-snapshots";
|
|
1
2
|
import { parseJsonBody, parseQuery, requireUserId } from "@voyantjs/hono";
|
|
2
3
|
import { insertAddressForEntitySchema, insertContactPointForEntitySchema, insertNamedContactForEntitySchema, updateAddressSchema as updateIdentityAddressSchema, updateContactPointSchema as updateIdentityContactPointSchema, updateNamedContactSchema as updateIdentityNamedContactSchema, } from "@voyantjs/identity/validation";
|
|
3
4
|
import { Hono } from "hono";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
import { suppliersService } from "./service.js";
|
|
6
7
|
import { availabilityQuerySchema, insertAvailabilitySchema, insertContractSchema, insertRateSchema, insertServiceSchema, insertSupplierNoteSchema, insertSupplierSchema, supplierAggregatesQuerySchema, supplierListQuerySchema, updateContractSchema, updateRateSchema, updateServiceSchema, updateSupplierSchema, } from "./validation.js";
|
|
7
|
-
const DASHBOARD_AGGREGATES_CACHE_CONTROL = "private, max-age=
|
|
8
|
+
const DASHBOARD_AGGREGATES_CACHE_CONTROL = "private, max-age=30";
|
|
9
|
+
/** Server-side snapshot TTL — see readThroughAggregateSnapshot (#1629). */
|
|
10
|
+
const DASHBOARD_AGGREGATES_TTL_SECONDS = 60;
|
|
8
11
|
function cacheDashboardAggregates(c) {
|
|
9
12
|
c.header("Cache-Control", DASHBOARD_AGGREGATES_CACHE_CONTROL);
|
|
10
13
|
c.header("Vary", "Authorization", { append: true });
|
|
@@ -17,11 +20,17 @@ export const supplierRoutes = new Hono()
|
|
|
17
20
|
// ========================================================================
|
|
18
21
|
// Dashboard aggregates
|
|
19
22
|
// ========================================================================
|
|
20
|
-
// GET /aggregates — dashboard KPIs (before /:id so the matcher doesn't
|
|
23
|
+
// GET /aggregates — dashboard KPIs (before /:id so the matcher doesn't
|
|
24
|
+
// swallow it). Served from a read-through TTL snapshot (#1629).
|
|
21
25
|
.get("/aggregates", async (c) => {
|
|
22
26
|
const query = parseQuery(c, supplierAggregatesQuerySchema);
|
|
23
27
|
cacheDashboardAggregates(c);
|
|
24
|
-
|
|
28
|
+
const snapshot = await readThroughAggregateSnapshot(c.get("db"), {
|
|
29
|
+
key: aggregateSnapshotKey("suppliers", "aggregates", query),
|
|
30
|
+
ttlSeconds: DASHBOARD_AGGREGATES_TTL_SECONDS,
|
|
31
|
+
compute: () => suppliersService.getSupplierAggregates(c.get("db"), query),
|
|
32
|
+
});
|
|
33
|
+
return c.json({ data: snapshot.data });
|
|
25
34
|
})
|
|
26
35
|
// ========================================================================
|
|
27
36
|
// Suppliers CRUD
|
package/dist/service-core.d.ts
CHANGED
|
@@ -46,11 +46,11 @@ export declare function createSupplier(db: PostgresJsDatabase, data: CreateSuppl
|
|
|
46
46
|
contactEmail: string | null;
|
|
47
47
|
contactPhone: string | null;
|
|
48
48
|
name: string;
|
|
49
|
+
type: "other" | "hotel" | "restaurant" | "transfer" | "guide" | "experience" | "airline";
|
|
49
50
|
id: string;
|
|
51
|
+
status: "pending" | "active" | "inactive";
|
|
50
52
|
createdAt: Date;
|
|
51
53
|
updatedAt: Date;
|
|
52
|
-
status: "pending" | "active" | "inactive";
|
|
53
|
-
type: "other" | "hotel" | "restaurant" | "transfer" | "guide" | "experience" | "airline";
|
|
54
54
|
description: string | null;
|
|
55
55
|
tags: string[] | null;
|
|
56
56
|
defaultCurrency: string | null;
|
|
@@ -429,8 +429,8 @@ export declare function listServices(db: PostgresJsDatabase, supplierId: string)
|
|
|
429
429
|
}, {}, {}>;
|
|
430
430
|
}>, "where" | "orderBy">;
|
|
431
431
|
export declare function createService(db: PostgresJsDatabase, supplierId: string, data: CreateServiceInput): Promise<{
|
|
432
|
-
name: string;
|
|
433
432
|
duration: string | null;
|
|
433
|
+
name: string;
|
|
434
434
|
id: string;
|
|
435
435
|
createdAt: Date;
|
|
436
436
|
updatedAt: Date;
|
|
@@ -1472,9 +1472,9 @@ export declare function listContracts(db: PostgresJsDatabase, supplierId: string
|
|
|
1472
1472
|
}>, "where" | "orderBy">;
|
|
1473
1473
|
export declare function createContract(db: PostgresJsDatabase, supplierId: string, data: CreateContractInput): Promise<{
|
|
1474
1474
|
id: string;
|
|
1475
|
+
status: "pending" | "active" | "expired" | "terminated";
|
|
1475
1476
|
createdAt: Date;
|
|
1476
1477
|
updatedAt: Date;
|
|
1477
|
-
status: "pending" | "active" | "expired" | "terminated";
|
|
1478
1478
|
startDate: string;
|
|
1479
1479
|
endDate: string | null;
|
|
1480
1480
|
supplierId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/suppliers",
|
|
3
|
-
"version": "0.111.
|
|
3
|
+
"version": "0.111.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"drizzle-orm": "^0.45.2",
|
|
30
30
|
"hono": "^4.12.10",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@voyantjs/core": "^0.
|
|
33
|
-
"@voyantjs/db": "^0.
|
|
34
|
-
"@voyantjs/facilities": "^0.107.
|
|
35
|
-
"@voyantjs/hono": "^0.
|
|
36
|
-
"@voyantjs/identity": "^0.
|
|
32
|
+
"@voyantjs/core": "^0.109.0",
|
|
33
|
+
"@voyantjs/db": "^0.107.0",
|
|
34
|
+
"@voyantjs/facilities": "^0.107.8",
|
|
35
|
+
"@voyantjs/hono": "^0.108.0",
|
|
36
|
+
"@voyantjs/identity": "^0.117.1",
|
|
37
37
|
"@voyantjs/suppliers-contracts": "^0.104.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|