@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.js CHANGED
@@ -1066,7 +1066,9 @@ var TsSchemaGenerator = class {
1066
1066
  }
1067
1067
  const defaultValue = this.getFieldMappedDefault(field);
1068
1068
  if (defaultValue !== void 0) {
1069
- if (typeof defaultValue === "object" && !Array.isArray(defaultValue)) {
1069
+ if (defaultValue === null) {
1070
+ objectFields.push(ts.factory.createPropertyAssignment("default", this.createExpressionUtilsCall("_null")));
1071
+ } else if (typeof defaultValue === "object" && !Array.isArray(defaultValue)) {
1070
1072
  if ("call" in defaultValue) {
1071
1073
  objectFields.push(ts.factory.createPropertyAssignment("default", this.createExpressionUtilsCall("call", [
1072
1074
  ts.factory.createStringLiteral(defaultValue.call),
@@ -1158,8 +1160,10 @@ var TsSchemaGenerator = class {
1158
1160
  return {
1159
1161
  authMember: this.getMemberAccessChain(expr)
1160
1162
  };
1163
+ } else if (isNullExpr2(expr)) {
1164
+ return null;
1161
1165
  } else {
1162
- throw new Error(`Unsupported default value type for ${expr.$type}`);
1166
+ throw new Error(`Unsupported expression type: ${expr.$type}`);
1163
1167
  }
1164
1168
  }
1165
1169
  getMemberAccessChain(expr) {