svelte-reflector 1.0.26 → 1.0.27

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/method.js CHANGED
@@ -55,7 +55,7 @@ export class Method {
55
55
  const paths = this.gee(this.paths);
56
56
  const cookies = this.gee(this.cookies);
57
57
  return `
58
- ${querys.length > 0 ? `const querys = this.querys.bundle()` : ""};
58
+ ${querys.length > 0 ? `const { ${querys} } = this.querys.bundle()` : ""};
59
59
  ${paths.length > 0 ? `const paths = this.paths.bundle()` : ""};
60
60
  ${cookies.length > 0 ? `const cookies = this.cookies.bundle()` : ""};
61
61
  `;
package/dist/module.js CHANGED
@@ -29,15 +29,6 @@ export class Module {
29
29
  moduleName: this.name,
30
30
  });
31
31
  });
32
- // // não vão entrar metodos que não tiverem uma resposta tipada
33
- // this.methods = methods.filter((op) => {
34
- // const responseTypeOk = op.request.responseType;
35
- // if (op.request.apiType === "delete") return true;
36
- // if (!responseTypeOk) {
37
- // createDangerMessage(`Método [ ${op.name} ] do módulo [ ${this.moduleName} ] sem tipagem na resposta.`);
38
- // }
39
- // return responseTypeOk;
40
- // });
41
32
  const { cookies, headers, paths, querys } = this.getParameters();
42
33
  const { moduleAttributes, moduleTypes, moduleInit, moduleClear, form } = this.creator({ cookies, headers, paths, querys });
43
34
  this.moduleConstructor = this.buildConstructor(form);
@@ -10,9 +10,10 @@ export class PrimitiveProp {
10
10
  const { example: rawExample, type: rawType } = schemaObject;
11
11
  const type = rawType ?? "string";
12
12
  const example = rawExample ?? this.getEmptyExample({ type, schemaObject });
13
+ const buildedType = required ? type : `${type} | undefined`;
13
14
  this.name = this.treatName(name);
14
15
  this.rawType = type ?? "any";
15
- this.type = `BuildedInput<${type}>`;
16
+ this.type = `BuildedInput<${buildedType}>`;
16
17
  this.required = required;
17
18
  this.buildedConst = this.buildConst({ example, name: this.name, required, type });
18
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-reflector",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Reflects zod types from openAPI schemas",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",