@zenstackhq/sdk 3.2.0 → 3.2.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/index.cjs CHANGED
@@ -1098,7 +1098,9 @@ var TsSchemaGenerator = class {
1098
1098
  }
1099
1099
  const defaultValue = this.getFieldMappedDefault(field);
1100
1100
  if (defaultValue !== void 0) {
1101
- if (typeof defaultValue === "object" && !Array.isArray(defaultValue)) {
1101
+ if (defaultValue === null) {
1102
+ objectFields.push(ts.factory.createPropertyAssignment("default", this.createExpressionUtilsCall("_null")));
1103
+ } else if (typeof defaultValue === "object" && !Array.isArray(defaultValue)) {
1102
1104
  if ("call" in defaultValue) {
1103
1105
  objectFields.push(ts.factory.createPropertyAssignment("default", this.createExpressionUtilsCall("call", [
1104
1106
  ts.factory.createStringLiteral(defaultValue.call),
@@ -1190,8 +1192,10 @@ var TsSchemaGenerator = class {
1190
1192
  return {
1191
1193
  authMember: this.getMemberAccessChain(expr)
1192
1194
  };
1195
+ } else if ((0, import_ast3.isNullExpr)(expr)) {
1196
+ return null;
1193
1197
  } else {
1194
- throw new Error(`Unsupported default value type for ${expr.$type}`);
1198
+ throw new Error(`Unsupported expression type: ${expr.$type}`);
1195
1199
  }
1196
1200
  }
1197
1201
  getMemberAccessChain(expr) {