@apso/cli 0.4.0 → 0.4.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.
package/dist/lib/dto.js CHANGED
@@ -56,6 +56,7 @@ options) => {
56
56
  const addDefaultPKProperty = primaryKeyColumns.length === 0;
57
57
  const createdAt = entity.created_at;
58
58
  const updatedAt = entity.updated_at;
59
+ const primaryKeyType = entity.primaryKeyType || 'serial'; // Default to 'serial' if not specified
59
60
  // Filter columns: remove id, createdAt, updatedAt
60
61
  const dtoColumns = columns.filter((col) => !["id", "createdAt", "updatedAt"].includes(col.name));
61
62
  // Class names
@@ -64,6 +65,7 @@ options) => {
64
65
  const data = {
65
66
  entityName,
66
67
  addDefaultPKProperty,
68
+ primaryKeyType,
67
69
  createdAt,
68
70
  updatedAt,
69
71
  columns: dtoColumns,
@@ -36,7 +36,7 @@ export class <%= it.entityName %>Create {
36
36
  export class <%= it.entityName %> {
37
37
  <% if (it.addDefaultPKProperty) { %>
38
38
  @ApiProperty()
39
- id: number;
39
+ id: <%= it.primaryKeyType === 'uuid' ? 'string' : 'number' %>;
40
40
  <% } %>
41
41
  <% it.columns.forEach((field) => { %>
42
42
  @ApiProperty()
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.0",
2
+ "version": "0.4.1",
3
3
  "commands": {
4
4
  "server:new": {
5
5
  "id": "server:new",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apso/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Apso CLI",
5
5
  "author": "Apso by Mavric - @mavric",
6
6
  "bin": {