Skip to content

Commit 429a853

Browse files
committed
chore: update dependencies and enhance cars resource template
1 parent 80a250f commit 429a853

File tree

4 files changed

+2036
-44
lines changed

4 files changed

+2036
-44
lines changed

dev-demo/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import cars_MyS_resource from './resources/cars_MyS.js';
1010
import cars_PG_resource from './resources/cars_PG.js';
1111
import cars_Mongo_resource from './resources/cars_mongo.js';
1212
import cars_Ch_resource from './resources/cars_Ch.js';
13-
1413
import auditLogsResource from "./resources/auditLogs.js"
1514
import { FICTIONAL_CAR_BRANDS, FICTIONAL_CAR_MODELS_BY_BRAND, ENGINE_TYPES, BODY_TYPES } from './custom/cars_data.js';
1615
import passkeysResource from './resources/passkeys.js';
@@ -200,7 +199,7 @@ if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
200199
for (let i = 0; i < 100; i++) {
201200
const engine_type = ENGINE_TYPES[Math.floor(Math.random() * ENGINE_TYPES.length)].value;
202201
await admin.resource('cars_sl').create({
203-
id: `${i}`,
202+
id: crypto.randomUUID(),
204203
model: `${FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]} ${FICTIONAL_CAR_MODELS_BY_BRAND[FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]][Math.floor(Math.random() * 4)]}`,
205204
price: Decimal(Math.random() * 10000).toFixed(2),
206205
engine_type: engine_type,
@@ -216,7 +215,7 @@ if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
216215
for (let i = 0; i < 100; i++) {
217216
const engine_type = ENGINE_TYPES[Math.floor(Math.random() * ENGINE_TYPES.length)].value;
218217
await admin.resource('cars_mongo').create({
219-
_id: `${i}`,
218+
_id: crypto.randomUUID(),
220219
model: `${FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]} ${FICTIONAL_CAR_MODELS_BY_BRAND[FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]][Math.floor(Math.random() * 4)]}`,
221220
price: Decimal(Math.random() * 10000).toFixed(2),
222221
engine_type: engine_type,
@@ -233,7 +232,7 @@ if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
233232
for (let i = 0; i < 100; i++) {
234233
const engine_type = ENGINE_TYPES[Math.floor(Math.random() * ENGINE_TYPES.length)].value;
235234
await admin.resource('cars_mysql').create({
236-
id: `${i}`,
235+
id: crypto.randomUUID(),
237236
model: `${FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]} ${FICTIONAL_CAR_MODELS_BY_BRAND[FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]][Math.floor(Math.random() * 4)]}`,
238237
price: Decimal(Math.random() * 10000).toFixed(2),
239238
engine_type: engine_type,
@@ -250,7 +249,7 @@ if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
250249
for (let i = 0; i < 100; i++) {
251250
const engine_type = ENGINE_TYPES[Math.floor(Math.random() * ENGINE_TYPES.length)].value;
252251
await admin.resource('cars_pg').create({
253-
id: `${i}`,
252+
id: crypto.randomUUID(),
254253
model: `${FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]} ${FICTIONAL_CAR_MODELS_BY_BRAND[FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]][Math.floor(Math.random() * 4)]}`,
255254
price: Decimal(Math.random() * 10000).toFixed(2),
256255
engine_type: engine_type,
@@ -267,7 +266,7 @@ if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
267266
for (let i = 0; i < 100; i++) {
268267
const engine_type = ENGINE_TYPES[Math.floor(Math.random() * ENGINE_TYPES.length)].value;
269268
await admin.resource('cars_ch').create({
270-
id: `${i}`,
269+
id: crypto.randomUUID(),
271270
model: `${FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]} ${FICTIONAL_CAR_MODELS_BY_BRAND[FICTIONAL_CAR_BRANDS[Math.floor(Math.random() * FICTIONAL_CAR_BRANDS.length)]][Math.floor(Math.random() * 4)]}`,
272271
price: Decimal(Math.random() * 10000).toFixed(2),
273272
engine_type: engine_type,

0 commit comments

Comments
 (0)