svelte-reflector 1.1.40 → 1.2.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.
@@ -16,7 +16,7 @@ export class MethodGenerator {
16
16
  const paramsType = this.buildParamsType(method, pathsInfo);
17
17
  return `
18
18
  ${description}
19
- async ${method.name}(params?: ${paramsType}) {
19
+ protected async _${method.name}(params?: ${paramsType}) {
20
20
 
21
21
  const behavior = params?.behavior ?? new Behavior();
22
22
  const { onError, onSuccess } = behavior;
@@ -30,12 +30,12 @@ export class ModuleFileBuilder {
30
30
  buildClass(params) {
31
31
  const { moduleInit, moduleAttributes, moduleClear, buildedMethods, moduleConstructor, moduleName } = params;
32
32
  const reset = moduleAttributes.length > 1
33
- ? `reset() {
33
+ ? `protected reset() {
34
34
  ${moduleInit.join(";")}
35
35
  }`
36
36
  : "";
37
37
  return `
38
- export class ${moduleName}Module {
38
+ export abstract class ${moduleName}Module {
39
39
  ${moduleAttributes.join(";")}
40
40
 
41
41
  ${moduleConstructor}
@@ -61,7 +61,7 @@ export class ModuleMethodProcessor {
61
61
  const entityName = treatByUppercase(method.request.responseType ?? "");
62
62
  methodsAttributes.add(`${entityName} = $state<${responseType} | undefined>()`);
63
63
  methodsInit.add(`this.clear${capitalizeFirstLetter(entityName)}()`);
64
- methodsClear.add(`clear${capitalizeFirstLetter(entityName)}() { this.${entityName} = undefined }`);
64
+ methodsClear.add(`protected clear${capitalizeFirstLetter(entityName)}() { this.${entityName} = undefined }`);
65
65
  }
66
66
  else if (attributeType === "list") {
67
67
  methodsAttributes.add("totalPages = $state<number>(1)");
@@ -69,7 +69,7 @@ export class ModuleMethodProcessor {
69
69
  this.imports.addReflectorImport("genericArrayBundler");
70
70
  methodsAttributes.add(`bundledList = $derived(genericArrayBundler(this.list))`);
71
71
  methodsInit.add("this.clearList()");
72
- methodsClear.add(`clearList() { this.list = [] }`);
72
+ methodsClear.add(`protected clearList() { this.list = [] }`);
73
73
  }
74
74
  if (bodyType) {
75
75
  entries.add(bodyType);
@@ -19,7 +19,7 @@ export class ModuleParamProcessor {
19
19
  buildedParamsTypes.push(this.classBuilder.buildClassProps({ props, name: capitalizedName }));
20
20
  paramAttributes.add(`${name} = new ${capitalizedName}()`);
21
21
  paramInit.add(`this.clear${capitalizeFirstLetter(capitalizedName)}()`);
22
- paramClear.add(`clear${capitalizedName}() { this.${name} = new ${capitalizedName}() }`);
22
+ paramClear.add(`protected clear${capitalizedName}() { this.${name} = new ${capitalizedName}() }`);
23
23
  };
24
24
  const argEntries = [
25
25
  { name: "querys", props: querys },
package/dist/module.js CHANGED
@@ -89,7 +89,7 @@ export class Module {
89
89
  `);
90
90
  moduleInit.add("this.clearForms()");
91
91
  moduleClear.add(`
92
- clearForms() { this.forms = this.buildForms(true) }
92
+ protected clearForms() { this.forms = this.buildForms(true) }
93
93
  `);
94
94
  }
95
95
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-reflector",
3
- "version": "1.1.40",
3
+ "version": "1.2.0",
4
4
  "description": "Reflects zod types from openAPI schemas",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",