@enigmatry/entry-components 17.0.0-preview.5.1 → 17.0.0-preview.7

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.
Files changed (136) hide show
  1. package/README.md +32 -32
  2. package/assets/nswag-templates/Client.RequestBody.liquid +95 -95
  3. package/assets/nswag-templates/Client.RequestUrl.liquid +67 -67
  4. package/assets/nswag-templates/ConvertToClass.liquid +64 -64
  5. package/assets/nswag-templates/original/Client.RequestBody.liquid +89 -89
  6. package/assets/nswag-templates/original/Client.RequestUrl.liquid +59 -59
  7. package/assets/nswag-templates/original/ConvertToClass.liquid +65 -65
  8. package/assets/nswag-templates/original/File.FormatDate.liquid +4 -4
  9. package/assets/nswag-templates/original/File.ParseDateOnly.liquid +4 -4
  10. package/button/README.md +45 -45
  11. package/date-time-picker/README.md +69 -69
  12. package/dialog/README.md +73 -73
  13. package/esm2022/button/entry-button.directive.mjs +1 -1
  14. package/esm2022/button/entry-button.module.mjs +1 -1
  15. package/esm2022/button/public-api.mjs +1 -1
  16. package/esm2022/common/common.module.mjs +1 -1
  17. package/esm2022/common/date-time/entry-date-time-adapter.mjs +1 -1
  18. package/esm2022/common/date-time/entry-date-time-formats.mjs +1 -1
  19. package/esm2022/common/date-time/entry-time-adapter.mjs +1 -1
  20. package/esm2022/common/date-time/native-time-adapter.mjs +1 -1
  21. package/esm2022/common/directives/auto-disable-button.directive.mjs +1 -1
  22. package/esm2022/common/directives/ng-control-accessor.directive.mjs +1 -1
  23. package/esm2022/common/directives/noop-control-value-accessor.mjs +1 -1
  24. package/esm2022/common/interceptors/accept-language.interceptor.mjs +1 -1
  25. package/esm2022/common/public-api.mjs +1 -1
  26. package/esm2022/date-time-picker/date-time-picker.component.mjs +3 -3
  27. package/esm2022/date-time-picker/date-time-picker.module.mjs +1 -1
  28. package/esm2022/date-time-picker/public-api.mjs +1 -1
  29. package/esm2022/date-time-picker/time-picker.component.mjs +3 -3
  30. package/esm2022/dialog/dialogs/alert/entry-alert-dialog-data.interface.mjs +1 -1
  31. package/esm2022/dialog/dialogs/alert/entry-alert-dialog.component.mjs +3 -3
  32. package/esm2022/dialog/dialogs/confirm/entry-confirm-dialog-data.interface.mjs +1 -1
  33. package/esm2022/dialog/dialogs/confirm/entry-confirm-dialog.component.mjs +3 -3
  34. package/esm2022/dialog/dialogs/entry-dialog.component.mjs +3 -3
  35. package/esm2022/dialog/dialogs/error/entry-error-dialog-data.interface.mjs +1 -1
  36. package/esm2022/dialog/dialogs/error/entry-error-dialog.component.mjs +3 -3
  37. package/esm2022/dialog/entry-dialog-buttons-alignment.type.mjs +1 -1
  38. package/esm2022/dialog/entry-dialog-config.model.mjs +1 -1
  39. package/esm2022/dialog/entry-dialog.module.mjs +1 -1
  40. package/esm2022/dialog/entry-dialog.service.mjs +1 -1
  41. package/esm2022/dialog/public-api.mjs +1 -1
  42. package/esm2022/file-input/entry-file-input.component.mjs +1 -1
  43. package/esm2022/file-input/entry-file-input.module.mjs +1 -1
  44. package/esm2022/file-input/public-api.mjs +1 -1
  45. package/esm2022/permissions/permission-type.mjs +1 -1
  46. package/esm2022/permissions/permission.directive.mjs +1 -1
  47. package/esm2022/permissions/permission.module.mjs +1 -1
  48. package/esm2022/permissions/permission.pipe.mjs +1 -1
  49. package/esm2022/permissions/public-api.mjs +1 -1
  50. package/esm2022/public-api.mjs +1 -1
  51. package/esm2022/search-filter/autocomplete/autocomplete-search-filter.component.mjs +3 -3
  52. package/esm2022/search-filter/autocomplete/autocomplete-search-filter.model.mjs +1 -1
  53. package/esm2022/search-filter/control-type.mjs +1 -1
  54. package/esm2022/search-filter/date/date-search-filter.component.mjs +3 -3
  55. package/esm2022/search-filter/date/date-search-filter.model.mjs +1 -1
  56. package/esm2022/search-filter/date-time/date-time-search-filter.component.mjs +3 -3
  57. package/esm2022/search-filter/date-time/date-time-search-filter.model.mjs +1 -1
  58. package/esm2022/search-filter/public-api.mjs +1 -1
  59. package/esm2022/search-filter/search-filter-base.model.mjs +1 -1
  60. package/esm2022/search-filter/search-filter-config.model.mjs +1 -1
  61. package/esm2022/search-filter/search-filter-params.type.mjs +1 -1
  62. package/esm2022/search-filter/select/select-search-filter.component.mjs +3 -3
  63. package/esm2022/search-filter/select/select-search-filter.model.mjs +1 -1
  64. package/esm2022/search-filter/select-option.model.mjs +1 -1
  65. package/esm2022/search-filter/text/text-search-filter.component.mjs +3 -3
  66. package/esm2022/search-filter/text/text-search-filter.model.mjs +1 -1
  67. package/esm2022/spinner/entry-spinner/spinner.component.mjs +1 -1
  68. package/esm2022/spinner/public-api.mjs +1 -1
  69. package/esm2022/spinner/spinner.module.mjs +1 -1
  70. package/esm2022/table/components/entry-cell/entry-cell.component.mjs +1 -1
  71. package/esm2022/table/components/entry-cell-context-menu/entry-cell-context-menu.component.mjs +3 -3
  72. package/esm2022/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.mjs +3 -3
  73. package/esm2022/table/components/entry-table/entry-table.component.mjs +3 -3
  74. package/esm2022/table/entry-table.module.mjs +1 -1
  75. package/esm2022/table/interfaces/entry-table-config.mjs +1 -1
  76. package/esm2022/table/interfaces/paged-query.mjs +1 -1
  77. package/esm2022/table/interfaces/pagination.mjs +1 -1
  78. package/esm2022/table/public-api.mjs +1 -1
  79. package/esm2022/validation/entry-display-control-validation.directive.mjs +1 -1
  80. package/esm2022/validation/entry-form-errors.component.mjs +13 -13
  81. package/esm2022/validation/entry-validation-config.model.mjs +1 -1
  82. package/esm2022/validation/entry-validation.mjs +1 -1
  83. package/esm2022/validation/entry-validation.module.mjs +1 -1
  84. package/esm2022/validation/public-api.mjs +1 -1
  85. package/esm2022/validation/validation-problem-details.interface.mjs +1 -1
  86. package/fesm2022/enigmatry-entry-components-button.mjs.map +1 -1
  87. package/fesm2022/enigmatry-entry-components-common.mjs.map +1 -1
  88. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs +4 -4
  89. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs.map +1 -1
  90. package/fesm2022/enigmatry-entry-components-dialog.mjs +8 -8
  91. package/fesm2022/enigmatry-entry-components-dialog.mjs.map +1 -1
  92. package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -1
  93. package/fesm2022/enigmatry-entry-components-permissions.mjs.map +1 -1
  94. package/fesm2022/enigmatry-entry-components-search-filter.mjs +10 -10
  95. package/fesm2022/enigmatry-entry-components-search-filter.mjs.map +1 -1
  96. package/fesm2022/enigmatry-entry-components-spinner.mjs.map +1 -1
  97. package/fesm2022/enigmatry-entry-components-table.mjs +6 -6
  98. package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -1
  99. package/fesm2022/enigmatry-entry-components-validation.mjs +12 -12
  100. package/fesm2022/enigmatry-entry-components-validation.mjs.map +1 -1
  101. package/fesm2022/enigmatry-entry-components.mjs.map +1 -1
  102. package/file-input/README.md +70 -70
  103. package/package.json +4 -4
  104. package/permissions/README.md +67 -67
  105. package/search-filter/README.md +132 -132
  106. package/styles/_generator.scss +25 -25
  107. package/styles/modules/_default-theme.scss +91 -91
  108. package/styles/modules/components/buttons/_generator.scss +10 -10
  109. package/styles/modules/components/buttons/_radio.scss +18 -18
  110. package/styles/modules/components/checkboxes/_generator.scss +31 -31
  111. package/styles/modules/components/dialogs/_generator.scss +13 -13
  112. package/styles/modules/components/forms/_generator.scss +14 -14
  113. package/styles/modules/components/inputs/_generator.scss +14 -14
  114. package/styles/modules/components/search-filter/_generator.scss +14 -14
  115. package/styles/modules/components/tables/_cells.scss +25 -25
  116. package/styles/modules/components/tables/_generator.scss +6 -6
  117. package/styles/modules/components/tables/_header.scss +10 -10
  118. package/styles/modules/components/tables/_no-result.scss +9 -9
  119. package/styles/modules/components/tables/_rows.scss +39 -39
  120. package/styles/modules/components/tables/_sorting.scss +10 -10
  121. package/styles/modules/components/tables/_table-body.scss +12 -12
  122. package/styles/modules/components/toggle/_generator.scss +47 -47
  123. package/styles/modules/typography/_fonts.scss +64 -64
  124. package/styles/modules/vendors/angular-material/_generator.scss +46 -46
  125. package/styles/modules/vendors/angular-material/_palette-generator.scss +32 -32
  126. package/styles/modules/vendors/angular-material/_typography-generator.scss +107 -107
  127. package/styles/partials/core/components/_index.scss +4 -4
  128. package/styles/partials/core/components/date-time-picker/_general.scss +64 -64
  129. package/styles/partials/core/components/dialogs/_general.scss +23 -23
  130. package/styles/partials/core/components/forms/_general.scss +21 -21
  131. package/styles/partials/core/components/search-filter/_general.scss +8 -8
  132. package/styles/partials/core/components/tables/_general.scss +17 -17
  133. package/styles/partials/generator-test.scss +41 -41
  134. package/styles/partials/theming.scss +1 -1
  135. package/table/README.md +76 -76
  136. package/validation/README.md +108 -108
package/README.md CHANGED
@@ -1,33 +1,33 @@
1
- # Entry Components
2
-
3
- Set of reusable components based on Angular material.
4
-
5
- Visit components demo application. [Website](https://entry-demo.enigmatry.com/)
6
-
7
- ## Installation
8
-
9
- ```ts
10
- npm install @enigmatry/entry-components
11
- ```
12
-
13
- ### Theming Guidelines
14
-
15
- These guides provides detailed steps for setting up and configuring theming within your project.
16
-
17
- [**Theming Setup Guide**](https://github.com/enigmatry/entry-angular-building-blocks/blob/master/libs/entry-components/theming-setup.md)
18
-
19
- [**Theming Configuration Guide**](https://github.com/enigmatry/entry-angular-building-blocks/blob/master/libs/entry-components/theming-configuration.md)
20
-
21
-
22
- ## Compatibility with Angular versions
23
-
24
- | @enigmatry/entry-components | Angular version
25
- |-|-|
26
- |14.x| = 14
27
- |15.x| = 15
28
- |16.x| = 16
29
- |17.x| = 17
30
-
31
- ## License
32
-
1
+ # Entry Components
2
+
3
+ Set of reusable components based on Angular material.
4
+
5
+ Visit components demo application. [Website](https://entry-demo.enigmatry.com/)
6
+
7
+ ## Installation
8
+
9
+ ```ts
10
+ npm install @enigmatry/entry-components
11
+ ```
12
+
13
+ ### Theming Guidelines
14
+
15
+ These guides provides detailed steps for setting up and configuring theming within your project.
16
+
17
+ [**Theming Setup Guide**](https://github.com/enigmatry/entry-angular-building-blocks/blob/master/libs/entry-components/theming-setup.md)
18
+
19
+ [**Theming Configuration Guide**](https://github.com/enigmatry/entry-angular-building-blocks/blob/master/libs/entry-components/theming-configuration.md)
20
+
21
+
22
+ ## Compatibility with Angular versions
23
+
24
+ | @enigmatry/entry-components | Angular version
25
+ |-|-|
26
+ |14.x| = 14
27
+ |15.x| = 15
28
+ |16.x| = 16
29
+ |17.x| = 17
30
+
31
+ ## License
32
+
33
33
  Apache-2 © Enigmatry
@@ -1,95 +1,95 @@
1
- {%- if operation.HasFormParameters -%}
2
- {%- if operation.ConsumesFormUrlEncoded -%}
3
- let content_ = "";
4
- {%- for parameter in operation.FormParameters -%}
5
- {%- if parameter.IsRequired -%}
6
- {%- if parameter.IsNullable -%}
7
- if ({{ parameter.VariableName }} === undefined)
8
- throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
9
- else
10
- {%- else -%}
11
- if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
12
- throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
13
- else
14
- {%- endif -%}
15
- {%- else -%}
16
- {%- if parameter.IsNullable -%}
17
- if ({{ parameter.VariableName }} !== undefined)
18
- {%- else -%}
19
- if ({{ parameter.VariableName }} === null)
20
- throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
21
- else if ({{ parameter.VariableName }} !== undefined)
22
- {%- endif -%}
23
- {%- endif -%}
24
- {%- if parameter.IsDateArray -%}
25
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent(item_ ? formatDate(item_) : "null") + "&"; });
26
- {%- elsif parameter.IsDateOrDateTimeArray -%}
27
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent(item_ ? "" + item_.toJSON() : "null") + "&"; });
28
- {%- elsif parameter.IsObjectArray -%}
29
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item_, index_) => {
30
- for (const attr_ in item_) {
31
- if (item_.hasOwnProperty(attr_)) {
32
- content_ += encodeURIComponent("{{ parameter.Name }}[" + index_ + "]." + attr_) + "=" + encodeURIComponent("" + (item_ as any)[attr_]) + "&";
33
- }
34
- }
35
- });
36
- {%- elsif parameter.IsDate -%}
37
- content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent({{ parameter.VariableName }} ? formatDate({{ parameter.VariableName }}) : "{{ QueryNullValue }}") + "&";
38
- {%- elsif parameter.IsDateOrDateTime -%}
39
- content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.toJSON() : "{{ QueryNullValue }}") + "&";
40
- {%- elsif parameter.IsArray -%}
41
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + item) + "&"; });
42
- {%- else -%}
43
- content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
44
- {%- endif -%}
45
- {%- endfor -%}
46
- content_ = content_.replace(/&$/, "");
47
-
48
- {%- else -%}
49
- const content_ = new FormData();
50
- {% for parameter in operation.FormParameters -%}
51
- {%- if parameter.IsNullable -%}
52
- if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
53
- {%- else -%}
54
- if ({{ parameter.VariableName }} === null || {{ parameter.VariableName }} === undefined)
55
- throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
56
- else
57
- {%- endif -%}
58
- {%- if parameter.IsFile -%}
59
- {%- if parameter.IsArray -%}
60
- {{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.data, item_.fileName ? item_.fileName : "{{ parameter.Name }}") );
61
- {%- else -%}
62
- content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.data, {{ parameter.VariableName }}.fileName ? {{ parameter.VariableName }}.fileName : "{{ parameter.Name }}");
63
- {%- endif -%}
64
- {%- elsif parameter.IsDate -%}
65
- content_.append("{{ parameter.Name }}", formatDate({{ parameter.VariableName }}));
66
- {%- elsif parameter.IsDateOrDateTime -%}
67
- content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toJSON());
68
- {%- elsif parameter.IsObject -%}
69
- content_.append("{{ parameter.Name }}", JSON.stringify({{ parameter.VariableName }}));
70
- {%- elsif parameter.IsArray -%}
71
- {{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.toString()));
72
- {%- else -%}
73
- content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toString());
74
- {%- endif -%}
75
- {%- endfor -%}
76
- {%- endif -%}
77
- {%- else -%}
78
- {%- if operation.HasContent -%}
79
- {%- if operation.HasBinaryBodyParameter -%}
80
- const content_ = {{ operation.ContentParameter.VariableName }};
81
- {%- elsif operation.HasXmlBodyParameter -%}
82
- const content_ = {{ operation.ContentParameter.VariableName }};
83
- {% elsif operation.Consumes == "application/x-www-form-urlencoded" -%}
84
- const content_ = Object.keys({{ operation.ContentParameter.VariableName }} as any).map((key) => {
85
- return encodeURIComponent(key) + '=' + encodeURIComponent(({{ operation.ContentParameter.VariableName }} as any)[key]);
86
- }).join('&')
87
- {%- elsif operation.HasPlainTextBodyParameter -%}
88
- const content_ = {{ operation.ContentParameter.VariableName }};
89
- {%- else -%}
90
- const content_ = JSON.stringify({{ operation.ContentParameter.VariableName }});
91
- {%- endif -%}
92
- {%- else -%}
93
- const content_ = undefined;
94
- {%- endif -%}
95
- {%- endif -%}
1
+ {%- if operation.HasFormParameters -%}
2
+ {%- if operation.ConsumesFormUrlEncoded -%}
3
+ let content_ = "";
4
+ {%- for parameter in operation.FormParameters -%}
5
+ {%- if parameter.IsRequired -%}
6
+ {%- if parameter.IsNullable -%}
7
+ if ({{ parameter.VariableName }} === undefined)
8
+ throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
9
+ else
10
+ {%- else -%}
11
+ if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
12
+ throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
13
+ else
14
+ {%- endif -%}
15
+ {%- else -%}
16
+ {%- if parameter.IsNullable -%}
17
+ if ({{ parameter.VariableName }} !== undefined)
18
+ {%- else -%}
19
+ if ({{ parameter.VariableName }} === null)
20
+ throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
21
+ else if ({{ parameter.VariableName }} !== undefined)
22
+ {%- endif -%}
23
+ {%- endif -%}
24
+ {%- if parameter.IsDateArray -%}
25
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent(item_ ? formatDate(item_) : "null") + "&"; });
26
+ {%- elsif parameter.IsDateOrDateTimeArray -%}
27
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent(item_ ? "" + item_.toJSON() : "null") + "&"; });
28
+ {%- elsif parameter.IsObjectArray -%}
29
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item_, index_) => {
30
+ for (const attr_ in item_) {
31
+ if (item_.hasOwnProperty(attr_)) {
32
+ content_ += encodeURIComponent("{{ parameter.Name }}[" + index_ + "]." + attr_) + "=" + encodeURIComponent("" + (item_ as any)[attr_]) + "&";
33
+ }
34
+ }
35
+ });
36
+ {%- elsif parameter.IsDate -%}
37
+ content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent({{ parameter.VariableName }} ? formatDate({{ parameter.VariableName }}) : "{{ QueryNullValue }}") + "&";
38
+ {%- elsif parameter.IsDateOrDateTime -%}
39
+ content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.toJSON() : "{{ QueryNullValue }}") + "&";
40
+ {%- elsif parameter.IsArray -%}
41
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + item) + "&"; });
42
+ {%- else -%}
43
+ content_ += encodeURIComponent("{{ parameter.Name }}") + "=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
44
+ {%- endif -%}
45
+ {%- endfor -%}
46
+ content_ = content_.replace(/&$/, "");
47
+
48
+ {%- else -%}
49
+ const content_ = new FormData();
50
+ {% for parameter in operation.FormParameters -%}
51
+ {%- if parameter.IsNullable -%}
52
+ if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
53
+ {%- else -%}
54
+ if ({{ parameter.VariableName }} === null || {{ parameter.VariableName }} === undefined)
55
+ throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
56
+ else
57
+ {%- endif -%}
58
+ {%- if parameter.IsFile -%}
59
+ {%- if parameter.IsArray -%}
60
+ {{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.data, item_.fileName ? item_.fileName : "{{ parameter.Name }}") );
61
+ {%- else -%}
62
+ content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.data, {{ parameter.VariableName }}.fileName ? {{ parameter.VariableName }}.fileName : "{{ parameter.Name }}");
63
+ {%- endif -%}
64
+ {%- elsif parameter.IsDate -%}
65
+ content_.append("{{ parameter.Name }}", formatDate({{ parameter.VariableName }}));
66
+ {%- elsif parameter.IsDateOrDateTime -%}
67
+ content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toJSON());
68
+ {%- elsif parameter.IsObject -%}
69
+ content_.append("{{ parameter.Name }}", JSON.stringify({{ parameter.VariableName }}));
70
+ {%- elsif parameter.IsArray -%}
71
+ {{ parameter.VariableName }}.forEach(item_ => content_.append("{{ parameter.Name }}", item_.toString()));
72
+ {%- else -%}
73
+ content_.append("{{ parameter.Name }}", {{ parameter.VariableName }}.toString());
74
+ {%- endif -%}
75
+ {%- endfor -%}
76
+ {%- endif -%}
77
+ {%- else -%}
78
+ {%- if operation.HasContent -%}
79
+ {%- if operation.HasBinaryBodyParameter -%}
80
+ const content_ = {{ operation.ContentParameter.VariableName }};
81
+ {%- elsif operation.HasXmlBodyParameter -%}
82
+ const content_ = {{ operation.ContentParameter.VariableName }};
83
+ {% elsif operation.Consumes == "application/x-www-form-urlencoded" -%}
84
+ const content_ = Object.keys({{ operation.ContentParameter.VariableName }} as any).map((key) => {
85
+ return encodeURIComponent(key) + '=' + encodeURIComponent(({{ operation.ContentParameter.VariableName }} as any)[key]);
86
+ }).join('&')
87
+ {%- elsif operation.HasPlainTextBodyParameter -%}
88
+ const content_ = {{ operation.ContentParameter.VariableName }};
89
+ {%- else -%}
90
+ const content_ = JSON.stringify({{ operation.ContentParameter.VariableName }});
91
+ {%- endif -%}
92
+ {%- else -%}
93
+ const content_ = undefined;
94
+ {%- endif -%}
95
+ {%- endif -%}
@@ -1,68 +1,68 @@
1
- let url_ = this.baseUrl + "/{{ operation.Path }}{% if operation.HasQueryParameters %}?{% endif %}";
2
- {% for parameter in operation.PathParameters -%}
3
- {% if parameter.IsRequired -%}
4
- if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
5
- throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
6
- {% else -%}
7
- if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
8
- {% endif -%}
9
- {% if parameter.IsDateArray -%}
10
- url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.map(s_ => s_ ? formatDate(s_) : "null").join()));
11
- {% elsif parameter.IsDateTimeArray -%}
12
- url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.map(s_ => s_ ? s_.{{ parameter.GetDateTimeToString }} : "null").join()));
13
- {% elsif parameter.IsDate -%}
14
- url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }} ? "" + formatDate({{ parameter.VariableName }}) : "null"));
15
- {% elsif parameter.IsDateTime -%}
16
- url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "null"));
17
- {% elsif parameter.IsArray -%}
18
- url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.join()));
19
- {% else -%}
20
- url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent("" + {{ parameter.VariableName }}));
21
- {% endif -%}
22
- {% if parameter.IsOptional -%}
23
- else
24
- url_ = url_.replace("/{{ "{" }}{{ parameter.Name }}}", "");
25
- {% endif -%}
26
- {% endfor -%}
27
- {% for parameter in operation.QueryParameters -%}
28
- {% if parameter.IsRequired -%}
29
- {% if parameter.IsNullable -%}
30
- if ({{ parameter.VariableName }} === undefined)
31
- throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
32
- else if({{ parameter.VariableName }} !== null)
33
- {% else -%}
34
- if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
35
- throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
36
- else
37
- {% endif -%}
38
- {% else -%}
39
- {% if parameter.IsNullable -%}
40
- if ({{ parameter.VariableName }} !== undefined && {{ parameter.VariableName }} !== null)
41
- {% else -%}
42
- if ({{ parameter.VariableName }} === null)
43
- throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
44
- else if ({{ parameter.VariableName }} !== undefined)
45
- {% endif -%}
46
- {% endif -%}
47
- {% if parameter.IsDateArray -%}
48
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + formatDate(item_) : "null") + "&"; });
49
- {% elsif parameter.IsDateTimeArray -%}
50
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + item_.{{ parameter.GetDateTimeToString }} : "null") + "&"; });
51
- {% elsif parameter.IsObjectArray -%}
52
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item, index) => {
53
- for (const attr in item)
54
- if (item.hasOwnProperty(attr)) {
55
- url_ += "{{ parameter.Name }}[" + index + "]." + attr + "=" + encodeURIComponent("" + (item as any)[attr]) + "&";
56
- }
57
- });
58
- {% elsif parameter.IsDate -%}
59
- url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + formatDate({{ parameter.VariableName }}) : "{{ QueryNullValue }}") + "&";
60
- {% elsif parameter.IsDateTime -%}
61
- url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "{{ QueryNullValue }}") + "&";
62
- {% elsif parameter.IsArray -%}
63
- {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + item) + "&"; });
64
- {% else -%}
65
- url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
66
- {% endif -%}
67
- {% endfor -%}
1
+ let url_ = this.baseUrl + "/{{ operation.Path }}{% if operation.HasQueryParameters %}?{% endif %}";
2
+ {% for parameter in operation.PathParameters -%}
3
+ {% if parameter.IsRequired -%}
4
+ if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
5
+ throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
6
+ {% else -%}
7
+ if ({{ parameter.VariableName }} !== null && {{ parameter.VariableName }} !== undefined)
8
+ {% endif -%}
9
+ {% if parameter.IsDateArray -%}
10
+ url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.map(s_ => s_ ? formatDate(s_) : "null").join()));
11
+ {% elsif parameter.IsDateTimeArray -%}
12
+ url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.map(s_ => s_ ? s_.{{ parameter.GetDateTimeToString }} : "null").join()));
13
+ {% elsif parameter.IsDate -%}
14
+ url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }} ? "" + formatDate({{ parameter.VariableName }}) : "null"));
15
+ {% elsif parameter.IsDateTime -%}
16
+ url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "null"));
17
+ {% elsif parameter.IsArray -%}
18
+ url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent({{ parameter.VariableName }}.join()));
19
+ {% else -%}
20
+ url_ = url_.replace("{{ "{" }}{{ parameter.Name }}}", encodeURIComponent("" + {{ parameter.VariableName }}));
21
+ {% endif -%}
22
+ {% if parameter.IsOptional -%}
23
+ else
24
+ url_ = url_.replace("/{{ "{" }}{{ parameter.Name }}}", "");
25
+ {% endif -%}
26
+ {% endfor -%}
27
+ {% for parameter in operation.QueryParameters -%}
28
+ {% if parameter.IsRequired -%}
29
+ {% if parameter.IsNullable -%}
30
+ if ({{ parameter.VariableName }} === undefined)
31
+ throw new Error("The parameter '{{ parameter.VariableName }}' must be defined.");
32
+ else if({{ parameter.VariableName }} !== null)
33
+ {% else -%}
34
+ if ({{ parameter.VariableName }} === undefined || {{ parameter.VariableName }} === null)
35
+ throw new Error("The parameter '{{ parameter.VariableName }}' must be defined and cannot be null.");
36
+ else
37
+ {% endif -%}
38
+ {% else -%}
39
+ {% if parameter.IsNullable -%}
40
+ if ({{ parameter.VariableName }} !== undefined && {{ parameter.VariableName }} !== null)
41
+ {% else -%}
42
+ if ({{ parameter.VariableName }} === null)
43
+ throw new Error("The parameter '{{ parameter.VariableName }}' cannot be null.");
44
+ else if ({{ parameter.VariableName }} !== undefined)
45
+ {% endif -%}
46
+ {% endif -%}
47
+ {% if parameter.IsDateArray -%}
48
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + formatDate(item_) : "null") + "&"; });
49
+ {% elsif parameter.IsDateTimeArray -%}
50
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item_ => { url_ += "{{ parameter.Name }}=" + encodeURIComponent(item_ ? "" + item_.{{ parameter.GetDateTimeToString }} : "null") + "&"; });
51
+ {% elsif parameter.IsObjectArray -%}
52
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach((item, index) => {
53
+ for (const attr in item)
54
+ if (item.hasOwnProperty(attr)) {
55
+ url_ += "{{ parameter.Name }}[" + index + "]." + attr + "=" + encodeURIComponent("" + (item as any)[attr]) + "&";
56
+ }
57
+ });
58
+ {% elsif parameter.IsDate -%}
59
+ url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + formatDate({{ parameter.VariableName }}) : "{{ QueryNullValue }}") + "&";
60
+ {% elsif parameter.IsDateTime -%}
61
+ url_ += "{{ parameter.Name }}=" + encodeURIComponent({{ parameter.VariableName }} ? "" + {{ parameter.VariableName }}.{{ parameter.GetDateTimeToString }} : "{{ QueryNullValue }}") + "&";
62
+ {% elsif parameter.IsArray -%}
63
+ {{ parameter.VariableName }} && {{ parameter.VariableName }}.forEach(item => { url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + item) + "&"; });
64
+ {% else -%}
65
+ url_ += "{{ parameter.Name }}=" + encodeURIComponent("" + {{ parameter.VariableName }}) + "&";
66
+ {% endif -%}
67
+ {% endfor -%}
68
68
  url_ = url_.replace(/[?&]$/, "");
@@ -1,65 +1,65 @@
1
- {% if IsNewableObject -%}
2
- {% if CheckNewableObject -%}
3
- {{ Variable }} = {{ Value }} ? {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %}) : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
4
- {% else -%}
5
- {{ Variable }} = {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %});
6
- {% endif -%}
7
- {% elsif IsArray -%}
8
- if (Array.isArray({{ Value }})) {
9
- {{ Variable }} = [] as any;
10
- for (let item of {{ Value }})
11
- {% if IsArrayItemNewableObject -%}
12
- {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ ArrayItemType }}.fromJS(item{% if HandleReferences %}, _mappings{% endif %}));
13
- {% else -%}
14
- {% if IsArrayItemDate -%}
15
- {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ "parseDateOnly" }}(item));
16
- {% elsif IsArrayItemDateTime -%}
17
- {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ StringToDateCode }}(item));
18
- {% else -%}
19
- {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push(item);
20
- {% endif -%}
21
- {% endif -%}
22
- }
23
- {% if NullValue != "undefined" %}else {
24
- {{ Variable }} = <any>{{ NullValue }};
25
- }
26
- {% endif -%}
27
- {% elsif IsDictionary -%}
28
- if ({{ Value }}) {
29
- {{ Variable }} = {} as any;
30
- for (let key in {{ Value }}) {
31
- if ({{ Value }}.hasOwnProperty(key))
32
- {% if IsDictionaryValueNewableObject -%}
33
- (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ DictionaryValueType }}.fromJS({{ Value }}[key]{% if HandleReferences %}, _mappings{% endif %}) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
34
- {% elsif IsDictionaryValueNewableArray -%}
35
- (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ Value }}[key].map((i: any) => {{ DictionaryValueArrayItemType }}.fromJS(i{% if HandleReferences %}, _mappings{% endif %})) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
36
- {% elsif IsDictionaryValueDate -%}
37
- (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ "parseDateOnly" }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
38
- {% elsif IsDictionaryValueDateTime -%}
39
- (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ StringToDateCode }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
40
- {% else -%}
41
- {% if HasDictionaryValueDefaultValue or NullValue != "undefined" -%}
42
- (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] !== undefined ? {{ Value }}[key] : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
43
- {% else -%}
44
- (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key];
45
- {% endif -%}
46
- {% endif -%}
47
- }
48
- }
49
- {% if NullValue != "undefined" %}else {
50
- {{ Variable }} = <any>{{ NullValue }};
51
- }
52
- {% endif -%}
53
- {% else -%}
54
- {% if IsDate -%}
55
- {{ Variable }} = {{ Value }} ? {{ "parseDateOnly" }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ "parseDateOnly" }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
56
- {% elsif IsDateTime -%}
57
- {{ Variable }} = {{ Value }} ? {{ StringToDateCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateCode }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
58
- {% else -%}
59
- {% if HasDefaultValue or NullValue != "undefined" -%}
60
- {{ Variable }} = {{ Value }} !== undefined ? {{ Value }} : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
61
- {% else -%}
62
- {{ Variable }} = {{ Value }};
63
- {% endif -%}
64
- {% endif -%}
1
+ {% if IsNewableObject -%}
2
+ {% if CheckNewableObject -%}
3
+ {{ Variable }} = {{ Value }} ? {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %}) : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
4
+ {% else -%}
5
+ {{ Variable }} = {{ Type }}.fromJS({{ Value }}{% if HandleReferences -%}, _mappings{% endif %});
6
+ {% endif -%}
7
+ {% elsif IsArray -%}
8
+ if (Array.isArray({{ Value }})) {
9
+ {{ Variable }} = [] as any;
10
+ for (let item of {{ Value }})
11
+ {% if IsArrayItemNewableObject -%}
12
+ {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ ArrayItemType }}.fromJS(item{% if HandleReferences %}, _mappings{% endif %}));
13
+ {% else -%}
14
+ {% if IsArrayItemDate -%}
15
+ {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ "parseDateOnly" }}(item));
16
+ {% elsif IsArrayItemDateTime -%}
17
+ {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push({{ StringToDateCode }}(item));
18
+ {% else -%}
19
+ {{ Variable }}{% if RequiresStrictPropertyInitialization %}!{% endif %}.push(item);
20
+ {% endif -%}
21
+ {% endif -%}
22
+ }
23
+ {% if NullValue != "undefined" %}else {
24
+ {{ Variable }} = <any>{{ NullValue }};
25
+ }
26
+ {% endif -%}
27
+ {% elsif IsDictionary -%}
28
+ if ({{ Value }}) {
29
+ {{ Variable }} = {} as any;
30
+ for (let key in {{ Value }}) {
31
+ if ({{ Value }}.hasOwnProperty(key))
32
+ {% if IsDictionaryValueNewableObject -%}
33
+ (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ DictionaryValueType }}.fromJS({{ Value }}[key]{% if HandleReferences %}, _mappings{% endif %}) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
34
+ {% elsif IsDictionaryValueNewableArray -%}
35
+ (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ Value }}[key].map((i: any) => {{ DictionaryValueArrayItemType }}.fromJS(i{% if HandleReferences %}, _mappings{% endif %})) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
36
+ {% elsif IsDictionaryValueDate -%}
37
+ (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ "parseDateOnly" }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
38
+ {% elsif IsDictionaryValueDateTime -%}
39
+ (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] ? {{ StringToDateCode }}({{ Value }}[key].toString()) : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
40
+ {% else -%}
41
+ {% if HasDictionaryValueDefaultValue or NullValue != "undefined" -%}
42
+ (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key] !== undefined ? {{ Value }}[key] : {% if HasDictionaryValueDefaultValue %}{{ DictionaryValueDefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
43
+ {% else -%}
44
+ (<any>{{ Variable }}){% if RequiresStrictPropertyInitialization %}!{% endif %}[key] = {{ Value }}[key];
45
+ {% endif -%}
46
+ {% endif -%}
47
+ }
48
+ }
49
+ {% if NullValue != "undefined" %}else {
50
+ {{ Variable }} = <any>{{ NullValue }};
51
+ }
52
+ {% endif -%}
53
+ {% else -%}
54
+ {% if IsDate -%}
55
+ {{ Variable }} = {{ Value }} ? {{ "parseDateOnly" }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ "parseDateOnly" }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
56
+ {% elsif IsDateTime -%}
57
+ {{ Variable }} = {{ Value }} ? {{ StringToDateCode }}({{ Value }}.toString()) : {% if HasDefaultValue %}{{ StringToDateCode }}({{ DefaultValue }}){% else %}<any>{{ NullValue }}{% endif %};
58
+ {% else -%}
59
+ {% if HasDefaultValue or NullValue != "undefined" -%}
60
+ {{ Variable }} = {{ Value }} !== undefined ? {{ Value }} : {% if HasDefaultValue %}{{ DefaultValue }}{% else %}<any>{{ NullValue }}{% endif %};
61
+ {% else -%}
62
+ {{ Variable }} = {{ Value }};
63
+ {% endif -%}
64
+ {% endif -%}
65
65
  {% endif -%}