@ruiapp/rapid-core 0.5.4 → 0.5.6

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.
@@ -338,45 +338,6 @@ declare const _default: {
338
338
  defaultValue?: undefined;
339
339
  })[];
340
340
  indexes?: undefined;
341
- } | {
342
- maintainedBy: string;
343
- namespace: string;
344
- name: string;
345
- code: string;
346
- singularCode: string;
347
- pluralCode: string;
348
- schema: string;
349
- tableName: string;
350
- properties: ({
351
- name: string;
352
- code: string;
353
- columnName: string;
354
- type: "integer";
355
- required: true;
356
- autoIncrement: true;
357
- } | {
358
- name: string;
359
- code: string;
360
- columnName: string;
361
- type: "text";
362
- required: true;
363
- autoIncrement?: undefined;
364
- } | {
365
- name: string;
366
- code: string;
367
- columnName: string;
368
- type: "text";
369
- required: false;
370
- autoIncrement?: undefined;
371
- } | {
372
- name: string;
373
- code: string;
374
- columnName: string;
375
- type: "json";
376
- required: true;
377
- autoIncrement?: undefined;
378
- })[];
379
- indexes?: undefined;
380
341
  })[];
381
342
  dataDictionaries: any[];
382
343
  routes: {
package/dist/index.js CHANGED
@@ -2063,7 +2063,7 @@ var bootstrapApplicationConfig = {
2063
2063
  code: "actions",
2064
2064
  columnName: "actions",
2065
2065
  type: "json",
2066
- required: true,
2066
+ required: false,
2067
2067
  },
2068
2068
  ],
2069
2069
  },
@@ -4840,6 +4840,7 @@ async function syncDatabaseSchema(server, applicationConfig) {
4840
4840
  autoIncrement: false,
4841
4841
  notNull: property.required,
4842
4842
  });
4843
+ await server.tryQueryDatabaseObject(columnDDL);
4843
4844
  }
4844
4845
  if (!columnInDb || columnInDb.description != property.name) {
4845
4846
  await server.queryDatabaseObject(`COMMENT ON COLUMN ${queryBuilder.quoteTable(model)}.${queryBuilder.quoteObject(property.targetIdColumnName)} IS ${queryBuilder.formatValueToSqlLiteral(property.name)};`, []);
@@ -4864,6 +4865,7 @@ async function syncDatabaseSchema(server, applicationConfig) {
4864
4865
  schema: property.linkSchema,
4865
4866
  tableName: property.linkTableName,
4866
4867
  })} ADD CONSTRAINT ${queryBuilder.quoteObject(contraintName)} PRIMARY KEY (id);`;
4868
+ await server.tryQueryDatabaseObject(columnDDL);
4867
4869
  }
4868
4870
  else {
4869
4871
  const targetModel = applicationConfig.models.find((item) => item.singularCode === property.targetSingularCode);
@@ -4885,15 +4887,13 @@ async function syncDatabaseSchema(server, applicationConfig) {
4885
4887
  autoIncrement: false,
4886
4888
  notNull: property.required,
4887
4889
  });
4890
+ await server.tryQueryDatabaseObject(columnDDL);
4888
4891
  }
4889
4892
  }
4890
4893
  }
4891
4894
  else {
4892
4895
  continue;
4893
4896
  }
4894
- if (columnDDL) {
4895
- await server.tryQueryDatabaseObject(columnDDL);
4896
- }
4897
4897
  }
4898
4898
  else {
4899
4899
  const columnName = property.columnName || property.code;
@@ -6903,6 +6903,10 @@ class LicenseService {
6903
6903
  const licenseSettings = await settingService.getSystemSettingValues("license");
6904
6904
  const { deployId } = licenseSettings;
6905
6905
  const certText = licenseSettings.cert;
6906
+ if (!deployId || !certText) {
6907
+ this.#server.getLogger().warn("License was not loaded properly.");
6908
+ return;
6909
+ }
6906
6910
  const certJSON = Buffer.from(certText, "base64").toString();
6907
6911
  const cert = JSON.parse(certJSON);
6908
6912
  try {
package/dist/types.d.ts CHANGED
@@ -382,7 +382,7 @@ export interface RpdRoute {
382
382
  type: "RESTful";
383
383
  method: RpdHttpMethod;
384
384
  endpoint: string;
385
- actions: RpdRouteActionConfig[];
385
+ actions?: RpdRouteActionConfig[];
386
386
  }
387
387
  export type RpdHttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
388
388
  export interface RpdRouteActionConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-core",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -588,7 +588,7 @@ export default {
588
588
  code: "actions",
589
589
  columnName: "actions",
590
590
  type: "json",
591
- required: true,
591
+ required: false,
592
592
  },
593
593
  ],
594
594
  },
@@ -39,6 +39,12 @@ export default class LicenseService {
39
39
  const licenseSettings = await settingService.getSystemSettingValues("license");
40
40
  const { deployId } = licenseSettings as LicenseSettings;
41
41
  const certText = licenseSettings.cert;
42
+
43
+ if (!deployId || !certText) {
44
+ this.#server.getLogger().warn("License was not loaded properly.");
45
+ return;
46
+ }
47
+
42
48
  const certJSON = Buffer.from(certText, "base64").toString();
43
49
  const cert: RpdCert = JSON.parse(certJSON);
44
50
 
@@ -260,6 +260,7 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
260
260
  autoIncrement: false,
261
261
  notNull: property.required,
262
262
  });
263
+ await server.tryQueryDatabaseObject(columnDDL);
263
264
  }
264
265
 
265
266
  if (!columnInDb || columnInDb.description != property.name) {
@@ -290,6 +291,7 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
290
291
  schema: property.linkSchema,
291
292
  tableName: property.linkTableName,
292
293
  })} ADD CONSTRAINT ${queryBuilder.quoteObject(contraintName)} PRIMARY KEY (id);`;
294
+ await server.tryQueryDatabaseObject(columnDDL);
293
295
  } else {
294
296
  const targetModel = applicationConfig.models.find((item) => item.singularCode === property.targetSingularCode);
295
297
  if (!targetModel) {
@@ -312,15 +314,12 @@ async function syncDatabaseSchema(server: IRpdServer, applicationConfig: RpdAppl
312
314
  autoIncrement: false,
313
315
  notNull: property.required,
314
316
  });
317
+ await server.tryQueryDatabaseObject(columnDDL);
315
318
  }
316
319
  }
317
320
  } else {
318
321
  continue;
319
322
  }
320
-
321
- if (columnDDL) {
322
- await server.tryQueryDatabaseObject(columnDDL);
323
- }
324
323
  } else {
325
324
  const columnName = property.columnName || property.code;
326
325
  const columnInDb: ColumnInformation | undefined = find(columnsInDb, {
package/src/types.ts CHANGED
@@ -462,7 +462,7 @@ export interface RpdRoute {
462
462
  type: "RESTful";
463
463
  method: RpdHttpMethod;
464
464
  endpoint: string;
465
- actions: RpdRouteActionConfig[];
465
+ actions?: RpdRouteActionConfig[];
466
466
  }
467
467
 
468
468
  export type RpdHttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";