@apso/cli 0.15.3 → 0.16.0

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.
@@ -851,8 +851,8 @@ function validateSchemaObject(schema) {
851
851
  }
852
852
  const validFieldTypes = [
853
853
  "text", "string", "varchar", "integer", "float", "decimal", "numeric",
854
- "boolean", "date", "timestamp", "datetime", "uuid", "enum", "json",
855
- "json-plain", "array",
854
+ "boolean", "date", "timestamptz", "timestamp", "datetime", "uuid", "enum",
855
+ "json", "json-plain", "array",
856
856
  ];
857
857
  const validRelTypes = ["OneToMany", "ManyToOne", "ManyToMany", "OneToOne"];
858
858
  const entityNames = new Set();
@@ -133,7 +133,7 @@ function checkFieldTypeMismatch(ctx) {
133
133
  severity: "error",
134
134
  message: `Entity "${entity.name}", field "${field.name}": type "${field.type}" is not recognized by the generator`,
135
135
  entity: entity.name,
136
- suggestion: `Valid types: text, integer, float, decimal, numeric, boolean, date, enum, json, json-plain, array, uuid`,
136
+ suggestion: `Valid types: text, integer, float, decimal, numeric, boolean, date, timestamptz, timestamp, datetime, enum, json, json-plain, array, uuid`,
137
137
  });
138
138
  }
139
139
  // Enum fields must have values
@@ -1,4 +1,4 @@
1
- export type FieldType = "text" | "boolean" | "array" | "enum" | "integer" | "float" | "decimal" | "numeric" | "date" | "json" | "json-plain";
1
+ export type FieldType = "text" | "boolean" | "array" | "enum" | "integer" | "float" | "decimal" | "numeric" | "date" | "timestamptz" | "timestamp" | "datetime" | "json" | "json-plain";
2
2
  export interface Field {
3
3
  name: string;
4
4
  type: FieldType;
@@ -28,6 +28,7 @@ exports.fieldTypeToColumnType = {
28
28
  date: "date",
29
29
  timestamp: "timestamp",
30
30
  timestamptz: "timestamptz",
31
+ datetime: "timestamp",
31
32
  time: "time",
32
33
  timetz: "timetz",
33
34
  json: "json",
@@ -66,6 +67,8 @@ const fieldTypeNormalizationMap = {
66
67
  "time with time zone": "timetz",
67
68
  "timestamp without time zone": "timestamp",
68
69
  "timestamp with time zone": "timestamptz",
70
+ // `datetime` is a user-facing alias for a naive timestamp (instant-in-time).
71
+ datetime: "timestamp",
69
72
  };
70
73
  /**
71
74
  * Normalize a field type to its template-compatible name.
@@ -102,6 +105,7 @@ const typeToJsType = {
102
105
  date: "string",
103
106
  timestamp: "string",
104
107
  timestamptz: "string",
108
+ datetime: "string",
105
109
  timetz: "string",
106
110
  tsvector: "string",
107
111
  string: "string",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@apso/cli",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@apso/cli",
9
- "version": "0.15.3",
9
+ "version": "0.16.0",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@electric-sql/pglite": "^0.2.17",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.15.3",
2
+ "version": "0.16.0",
3
3
  "commands": {
4
4
  "config": {
5
5
  "id": "config",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apso/cli",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "mcpName": "io.github.apsoai/apso",
5
5
  "description": "Apso CLI",
6
6
  "author": "Apso by Mavric - @mavric",