autosync_backend2 1.1.35 → 1.1.36
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/index.d.ts +46 -0
- package/dist/index.js +14 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5134,6 +5134,52 @@ export declare const app: Elysia<"", {
|
|
|
5134
5134
|
};
|
|
5135
5135
|
};
|
|
5136
5136
|
};
|
|
5137
|
+
} & {
|
|
5138
|
+
vehicleKind: {
|
|
5139
|
+
":id": {
|
|
5140
|
+
put: {
|
|
5141
|
+
body: {
|
|
5142
|
+
name?: string | undefined;
|
|
5143
|
+
description?: string | null | undefined;
|
|
5144
|
+
vehicleKindEnum?: "MAKE" | "MODEL_GROUP" | "MODEL" | undefined;
|
|
5145
|
+
parentId?: string | null | undefined;
|
|
5146
|
+
yearStart?: number | null | undefined;
|
|
5147
|
+
yearEnd?: number | null | undefined;
|
|
5148
|
+
imagePath?: string | null | undefined;
|
|
5149
|
+
};
|
|
5150
|
+
params: {
|
|
5151
|
+
id: string;
|
|
5152
|
+
};
|
|
5153
|
+
query: unknown;
|
|
5154
|
+
headers: unknown;
|
|
5155
|
+
response: {
|
|
5156
|
+
200: {
|
|
5157
|
+
vehicleKindEnum: "MAKE" | "MODEL_GROUP" | "MODEL";
|
|
5158
|
+
parentId: string | null;
|
|
5159
|
+
name: string;
|
|
5160
|
+
description: string | null;
|
|
5161
|
+
yearStart: number | null;
|
|
5162
|
+
yearEnd: number | null;
|
|
5163
|
+
imagePath: string | null;
|
|
5164
|
+
id: string;
|
|
5165
|
+
createdAt: string;
|
|
5166
|
+
updatedAt: string;
|
|
5167
|
+
deletedAt: string | null;
|
|
5168
|
+
};
|
|
5169
|
+
404: "Vehicle kind not found";
|
|
5170
|
+
422: {
|
|
5171
|
+
type: "validation";
|
|
5172
|
+
on: string;
|
|
5173
|
+
summary?: string;
|
|
5174
|
+
message?: string;
|
|
5175
|
+
found?: unknown;
|
|
5176
|
+
property?: string;
|
|
5177
|
+
expected?: string;
|
|
5178
|
+
};
|
|
5179
|
+
};
|
|
5180
|
+
};
|
|
5181
|
+
};
|
|
5182
|
+
};
|
|
5137
5183
|
};
|
|
5138
5184
|
};
|
|
5139
5185
|
}, {
|
package/dist/index.js
CHANGED
|
@@ -141319,8 +141319,7 @@ var IdSchema = t.Object({
|
|
|
141319
141319
|
id: t.String({ format: "uuid" })
|
|
141320
141320
|
});
|
|
141321
141321
|
var UuidSchema = t.String({
|
|
141322
|
-
format: "uuid"
|
|
141323
|
-
default: "00000000-0000-0000-0000-000000000000"
|
|
141322
|
+
format: "uuid"
|
|
141324
141323
|
});
|
|
141325
141324
|
var PaginationSchema = t.Object({
|
|
141326
141325
|
pagination: t.Object({
|
|
@@ -143405,6 +143404,13 @@ var TechdocVehicleKindLogic;
|
|
|
143405
143404
|
const result = await pagination_helper_default(baseQuery, query.pagination);
|
|
143406
143405
|
return getPaginationContent(result, query.pagination.size);
|
|
143407
143406
|
};
|
|
143407
|
+
TechdocVehicleKindLogic.update = async (id, body) => {
|
|
143408
|
+
const [result] = await db_default.update(techdocVehicleKindTable).set(body).where(eq(techdocVehicleKindTable.id, id)).returning();
|
|
143409
|
+
if (!result) {
|
|
143410
|
+
return status("Not Found", "Vehicle kind not found");
|
|
143411
|
+
}
|
|
143412
|
+
return result;
|
|
143413
|
+
};
|
|
143408
143414
|
TechdocVehicleKindLogic.findOrCreate = async (body, tdb = db_default) => {
|
|
143409
143415
|
const cacheKey = `techdoc_vehicle_kind:${body.vehicleKindEnum}:${body.parentId ?? ""}:${body.name}`;
|
|
143410
143416
|
const cached = await redis_client_default.get(cacheKey);
|
|
@@ -146033,6 +146039,8 @@ var TechdocVehicleKindModel;
|
|
|
146033
146039
|
t.Partial(t.Pick(selectSchema, ["vehicleKindEnum", "parentId", "name"])),
|
|
146034
146040
|
PaginationSchema
|
|
146035
146041
|
]);
|
|
146042
|
+
const updateSchema = createUpdateSchema(techdocVehicleKindTable);
|
|
146043
|
+
TechdocVehicleKindModel.update = OmitBaseSchema(updateSchema);
|
|
146036
146044
|
})(TechdocVehicleKindModel ||= {});
|
|
146037
146045
|
var model_default14 = TechdocVehicleKindModel;
|
|
146038
146046
|
|
|
@@ -146044,6 +146052,10 @@ var vehicleKindRoutes = new Elysia({
|
|
|
146044
146052
|
auth: true
|
|
146045
146053
|
}).get("/", async ({ query }) => logic_default5.select(query), {
|
|
146046
146054
|
query: model_default14.select
|
|
146055
|
+
}).put("/:id", async ({ body, params: { id } }) => logic_default5.update(id, body), {
|
|
146056
|
+
body: model_default14.update,
|
|
146057
|
+
params: IdSchema,
|
|
146058
|
+
userKind: "ADMIN"
|
|
146047
146059
|
});
|
|
146048
146060
|
var vehicleKind_default = vehicleKindRoutes;
|
|
146049
146061
|
|