@hosterai/types 0.0.18 → 0.0.19

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 (63) hide show
  1. package/dist/decorators/all-or-none-validator.spec.d.ts +1 -0
  2. package/dist/decorators/all-or-none-validator.spec.js +91 -0
  3. package/dist/decorators/all-or-none.validator.d.ts +2 -0
  4. package/dist/decorators/all-or-none.validator.js +71 -0
  5. package/dist/decorators/min-less-or-equal-validator.spec.d.ts +1 -0
  6. package/dist/decorators/min-less-or-equal-validator.spec.js +60 -0
  7. package/dist/decorators/min-less-or-equal.validator.d.ts +2 -0
  8. package/dist/decorators/min-less-or-equal.validator.js +58 -0
  9. package/dist/dtos/action.dto.js +21 -0
  10. package/dist/dtos/admin-panel.dto.js +91 -0
  11. package/dist/dtos/client-panel.dto.js +30 -0
  12. package/dist/dtos/field-option.dto.js +16 -0
  13. package/dist/dtos/field.dto.d.ts +2 -0
  14. package/dist/dtos/field.dto.js +94 -16
  15. package/dist/dtos/info.dto.js +62 -0
  16. package/dist/dtos/menu.dto.d.ts +2 -2
  17. package/dist/dtos/menu.dto.js +35 -2
  18. package/dist/dtos/notification/notification-info.dto.js +17 -0
  19. package/dist/dtos/product/product-info.dto.js +27 -0
  20. package/dist/dtos/product/requests/product-downgradeable-request.dto.d.ts +18 -0
  21. package/dist/dtos/product/requests/product-downgradeable-request.dto.js +37 -0
  22. package/dist/dtos/product/requests/product-upgradeable-request.dto.d.ts +18 -0
  23. package/dist/dtos/product/requests/product-upgradeable-request.dto.js +37 -0
  24. package/dist/dtos/product/responses/product-downgradeable-response.dto.d.ts +22 -0
  25. package/dist/dtos/product/responses/product-downgradeable-response.dto.js +11 -0
  26. package/dist/dtos/product/responses/product-upgradeable-response.dto.d.ts +22 -0
  27. package/dist/dtos/product/responses/product-upgradeable-response.dto.js +11 -0
  28. package/dist/dtos/settings.dto.js +22 -0
  29. package/dist/dtos/tab.dto.js +12 -0
  30. package/dist/dtos/unit.dto.js +19 -0
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.js +4 -0
  33. package/dist/openapi/schemas/components.schemas.d.ts +991 -0
  34. package/dist/openapi/schemas/components.schemas.js +2552 -0
  35. package/dist/validators/field-validator.spec.js +26 -0
  36. package/dist/validators/product-downgradeable-request-validator.d.ts +8 -0
  37. package/dist/validators/product-downgradeable-request-validator.js +17 -0
  38. package/dist/validators/product-info-validator.spec.js +87 -0
  39. package/dist/validators/product-upgradeable-request-validator.d.ts +8 -0
  40. package/dist/validators/product-upgradeable-request-validator.js +17 -0
  41. package/package.json +4 -1
  42. package/dist/dtos/info/info-notification.dto.d.ts +0 -5
  43. package/dist/dtos/info/info-notification.dto.js +0 -7
  44. package/dist/dtos/info/info.dto.d.ts +0 -196
  45. package/dist/dtos/info/info.dto.js +0 -278
  46. package/dist/dtos/notification/notification-request.dto.d.ts +0 -20
  47. package/dist/dtos/notification/notification-request.dto.js +0 -31
  48. package/dist/dtos/receiver/receiver-email.dto.d.ts +0 -20
  49. package/dist/dtos/receiver/receiver-email.dto.js +0 -39
  50. package/dist/dtos/receiver/receiver-push.dto.d.ts +0 -15
  51. package/dist/dtos/receiver/receiver-push.dto.js +0 -31
  52. package/dist/dtos/receiver/receiver-sms.dto.d.ts +0 -11
  53. package/dist/dtos/receiver/receiver-sms.dto.js +0 -26
  54. package/dist/dtos/request.dto.d.ts +0 -20
  55. package/dist/dtos/request.dto.js +0 -31
  56. package/dist/dtos/sender/sender-email.dto.d.ts +0 -25
  57. package/dist/dtos/sender/sender-email.dto.js +0 -46
  58. package/dist/dtos/sender/sender-push.dto.d.ts +0 -31
  59. package/dist/dtos/sender/sender-push.dto.js +0 -50
  60. package/dist/dtos/sender/sender-sms.dto.d.ts +0 -15
  61. package/dist/dtos/sender/sender-sms.dto.js +0 -30
  62. package/dist/enums/message-type.enum.d.ts +0 -5
  63. package/dist/enums/message-type.enum.js +0 -9
@@ -0,0 +1,22 @@
1
+ import { ResponseStatusEnum } from '../../../enums/response-status.enum';
2
+ import { BaseResponse } from '../../base-response.dto';
3
+ /**
4
+ * Represents the response for a product upgradeable check.
5
+ * It indicates whether a product item is upgradeable and may contain additional data.
6
+ */
7
+ export declare class ProductUpgradeableResponseDto extends BaseResponse {
8
+ /**
9
+ * The status of the response, indicating success or failure.
10
+ */
11
+ status: ResponseStatusEnum;
12
+ /**
13
+ * The unique identifier of the product item being checked.
14
+ */
15
+ itemId: string;
16
+ /**
17
+ * Optional data associated with the upgradeable check.
18
+ * Can contain details about available upgrades or reasons for failure.
19
+ * @optional
20
+ */
21
+ data?: Record<string, unknown>;
22
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductUpgradeableResponseDto = void 0;
4
+ const base_response_dto_1 = require("../../base-response.dto");
5
+ /**
6
+ * Represents the response for a product upgradeable check.
7
+ * It indicates whether a product item is upgradeable and may contain additional data.
8
+ */
9
+ class ProductUpgradeableResponseDto extends base_response_dto_1.BaseResponse {
10
+ }
11
+ exports.ProductUpgradeableResponseDto = ProductUpgradeableResponseDto;
@@ -15,6 +15,7 @@ const class_transformer_1 = require("class-transformer");
15
15
  const tab_dto_1 = require("./tab.dto");
16
16
  const class_validator_2 = require("class-validator");
17
17
  const is_property_forbidden_validator_1 = require("../decorators/is-property-forbidden.validator");
18
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
18
19
  class SettingsDto {
19
20
  }
20
21
  exports.SettingsDto = SettingsDto;
@@ -22,16 +23,31 @@ __decorate([
22
23
  (0, class_validator_1.IsString)(),
23
24
  (0, class_validator_2.IsDefined)(),
24
25
  (0, class_validator_1.IsNotEmpty)(),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Label',
28
+ description: 'Label of the settings page.',
29
+ type: 'string',
30
+ }),
25
31
  __metadata("design:type", String)
26
32
  ], SettingsDto.prototype, "label", void 0);
27
33
  __decorate([
28
34
  (0, class_validator_1.IsString)(),
29
35
  (0, class_validator_2.IsDefined)(),
36
+ (0, class_validator_jsonschema_1.JSONSchema)({
37
+ title: 'Icon',
38
+ description: 'Icon of the settings page.',
39
+ type: 'string',
40
+ }),
30
41
  __metadata("design:type", String)
31
42
  ], SettingsDto.prototype, "icon", void 0);
32
43
  __decorate([
33
44
  (0, class_validator_1.IsString)(),
34
45
  (0, class_validator_2.IsDefined)(),
46
+ (0, class_validator_jsonschema_1.JSONSchema)({
47
+ title: 'Description',
48
+ description: 'Description of the settings page.',
49
+ type: 'string',
50
+ }),
35
51
  __metadata("design:type", String)
36
52
  ], SettingsDto.prototype, "description", void 0);
37
53
  class SettingsWithUrlDto extends SettingsDto {
@@ -51,6 +67,12 @@ exports.SettingsWithTabsDto = SettingsWithTabsDto;
51
67
  __decorate([
52
68
  (0, class_validator_1.ValidateNested)({ each: true }),
53
69
  (0, class_transformer_1.Type)(() => tab_dto_1.TabDto),
70
+ (0, class_validator_jsonschema_1.JSONSchema)({
71
+ title: 'Tabs',
72
+ description: 'Tabs shown on the settings page.',
73
+ type: 'array',
74
+ items: { $ref: '#/components/schemas/TabDto' }
75
+ }),
54
76
  __metadata("design:type", Array)
55
77
  ], SettingsWithTabsDto.prototype, "tabs", void 0);
56
78
  __decorate([
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TabDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  /**
15
16
  * DTO for tabs
16
17
  * Used for defining tabs in the user interface
@@ -21,10 +22,21 @@ exports.TabDto = TabDto;
21
22
  __decorate([
22
23
  (0, class_validator_1.IsString)(),
23
24
  (0, class_validator_1.IsNotEmpty)(),
25
+ (0, class_validator_jsonschema_1.JSONSchema)({
26
+ title: 'Label',
27
+ description: 'Text label for the tab.',
28
+ type: 'string'
29
+ }),
24
30
  __metadata("design:type", String)
25
31
  ], TabDto.prototype, "label", void 0);
26
32
  __decorate([
27
33
  (0, class_validator_1.IsUrl)({ protocols: ['https'], require_protocol: true }),
28
34
  (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_jsonschema_1.JSONSchema)({
36
+ title: 'URL',
37
+ description: 'URL associated with the tab.',
38
+ type: 'string',
39
+ format: 'uri'
40
+ }),
29
41
  __metadata("design:type", String)
30
42
  ], TabDto.prototype, "url", void 0);
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.UnitDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const class_validator_jsonschema_1 = require("class-validator-jsonschema");
14
15
  /**
15
16
  * DTO for billing units.
16
17
  * Used for defining units for pay-per-use billing.
@@ -22,17 +23,35 @@ __decorate([
22
23
  (0, class_validator_1.IsString)(),
23
24
  (0, class_validator_1.IsDefined)(),
24
25
  (0, class_validator_1.IsNotEmpty)(),
26
+ (0, class_validator_jsonschema_1.JSONSchema)({
27
+ title: 'Unit ID',
28
+ description: 'Unit identifier.',
29
+ type: 'string',
30
+ example: 'messages'
31
+ }),
25
32
  __metadata("design:type", String)
26
33
  ], UnitDto.prototype, "id", void 0);
27
34
  __decorate([
28
35
  (0, class_validator_1.IsString)(),
29
36
  (0, class_validator_1.IsDefined)(),
30
37
  (0, class_validator_1.IsNotEmpty)(),
38
+ (0, class_validator_jsonschema_1.JSONSchema)({
39
+ title: 'Unit Description',
40
+ description: 'What is measured.',
41
+ type: 'string',
42
+ example: 'Message sent'
43
+ }),
31
44
  __metadata("design:type", String)
32
45
  ], UnitDto.prototype, "unitDescription", void 0);
33
46
  __decorate([
34
47
  (0, class_validator_1.IsString)(),
35
48
  (0, class_validator_1.IsDefined)(),
36
49
  (0, class_validator_1.IsNotEmpty)(),
50
+ (0, class_validator_jsonschema_1.JSONSchema)({
51
+ title: 'Interval Description',
52
+ description: 'Billing interval.',
53
+ type: 'string',
54
+ example: 'Per month'
55
+ }),
37
56
  __metadata("design:type", String)
38
57
  ], UnitDto.prototype, "intervalDescription", void 0);
package/dist/index.d.ts CHANGED
@@ -101,3 +101,4 @@ export * from './validators/sender-push-validator';
101
101
  export * from './validators/sender-sms-validator';
102
102
  export * from './validators/unit.validator';
103
103
  export * from './dtos/product/product.interface';
104
+ export { ComponentsSchemas } from './openapi/schemas/components.schemas';
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ComponentsSchemas = void 0;
17
18
  require("reflect-metadata");
18
19
  // Base DTOs
19
20
  __exportStar(require("./dtos/action.dto"), exports);
@@ -125,3 +126,6 @@ __exportStar(require("./validators/sender-sms-validator"), exports);
125
126
  __exportStar(require("./validators/unit.validator"), exports);
126
127
  // Interfaces
127
128
  __exportStar(require("./dtos/product/product.interface"), exports);
129
+ // OpenApi schemas
130
+ var components_schemas_1 = require("./openapi/schemas/components.schemas");
131
+ Object.defineProperty(exports, "ComponentsSchemas", { enumerable: true, get: function () { return components_schemas_1.ComponentsSchemas; } });