@merkaly/api 0.2.2-24 → 0.2.2-25

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.
@@ -2,7 +2,7 @@ import { Document } from 'mongoose';
2
2
  export declare abstract class AbstractEntity extends Document {
3
3
  static $index: string;
4
4
  readonly _id: string;
5
- readonly createdAt?: Date;
5
+ createdAt?: Date;
6
6
  readonly updatedAt?: Date;
7
7
  readonly deletedAt?: Date;
8
8
  }
@@ -0,0 +1,4 @@
1
+ export declare class SalesByRangeValdiator {
2
+ from: Date;
3
+ to: Date;
4
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SalesByRangeValdiator = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class SalesByRangeValdiator {
15
+ from;
16
+ to;
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsDateString)(),
20
+ __metadata("design:type", Date)
21
+ ], SalesByRangeValdiator.prototype, "from", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsDateString)(),
24
+ __metadata("design:type", Date)
25
+ ], SalesByRangeValdiator.prototype, "to", void 0);
26
+ exports.SalesByRangeValdiator = SalesByRangeValdiator;
@@ -0,0 +1,22 @@
1
+ import { MetaAddress } from '../../../types';
2
+ export declare class OrganizationMetadataInformation {
3
+ title: string;
4
+ description?: string;
5
+ keywords: string[];
6
+ }
7
+ export declare class OrganizationMetadataLocalization {
8
+ language: string;
9
+ currency: string;
10
+ }
11
+ export declare class OrganizationMetadataSocial {
12
+ name: string;
13
+ url: string;
14
+ }
15
+ export declare class OrganizationMetadataAddress implements Omit<MetaAddress, 'name'> {
16
+ country: string;
17
+ code: string;
18
+ line1: string;
19
+ line2?: string;
20
+ city: string;
21
+ state: string;
22
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrganizationMetadataAddress = exports.OrganizationMetadataSocial = exports.OrganizationMetadataLocalization = exports.OrganizationMetadataInformation = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class OrganizationMetadataInformation {
15
+ title;
16
+ description;
17
+ keywords = [];
18
+ }
19
+ __decorate([
20
+ (0, class_validator_1.IsOptional)(),
21
+ (0, class_validator_1.IsString)(),
22
+ __metadata("design:type", String)
23
+ ], OrganizationMetadataInformation.prototype, "title", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsOptional)(),
26
+ (0, class_validator_1.IsString)(),
27
+ __metadata("design:type", String)
28
+ ], OrganizationMetadataInformation.prototype, "description", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsOptional)(),
31
+ (0, class_validator_1.IsString)({ each: true }),
32
+ __metadata("design:type", Array)
33
+ ], OrganizationMetadataInformation.prototype, "keywords", void 0);
34
+ exports.OrganizationMetadataInformation = OrganizationMetadataInformation;
35
+ class OrganizationMetadataLocalization {
36
+ language;
37
+ currency;
38
+ }
39
+ __decorate([
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsString)(),
42
+ __metadata("design:type", String)
43
+ ], OrganizationMetadataLocalization.prototype, "language", void 0);
44
+ __decorate([
45
+ (0, class_validator_1.IsOptional)(),
46
+ (0, class_validator_1.IsString)(),
47
+ __metadata("design:type", String)
48
+ ], OrganizationMetadataLocalization.prototype, "currency", void 0);
49
+ exports.OrganizationMetadataLocalization = OrganizationMetadataLocalization;
50
+ class OrganizationMetadataSocial {
51
+ name;
52
+ url;
53
+ }
54
+ __decorate([
55
+ (0, class_validator_1.IsOptional)(),
56
+ (0, class_validator_1.IsString)(),
57
+ __metadata("design:type", String)
58
+ ], OrganizationMetadataSocial.prototype, "name", void 0);
59
+ __decorate([
60
+ (0, class_validator_1.IsOptional)(),
61
+ (0, class_validator_1.IsUrl)(),
62
+ __metadata("design:type", String)
63
+ ], OrganizationMetadataSocial.prototype, "url", void 0);
64
+ exports.OrganizationMetadataSocial = OrganizationMetadataSocial;
65
+ class OrganizationMetadataAddress {
66
+ country;
67
+ code;
68
+ line1;
69
+ line2;
70
+ city;
71
+ state;
72
+ }
73
+ __decorate([
74
+ (0, class_validator_1.IsOptional)(),
75
+ __metadata("design:type", String)
76
+ ], OrganizationMetadataAddress.prototype, "country", void 0);
77
+ __decorate([
78
+ (0, class_validator_1.IsString)(),
79
+ (0, class_validator_1.IsOptional)(),
80
+ __metadata("design:type", String)
81
+ ], OrganizationMetadataAddress.prototype, "code", void 0);
82
+ __decorate([
83
+ (0, class_validator_1.IsString)(),
84
+ (0, class_validator_1.IsOptional)(),
85
+ __metadata("design:type", String)
86
+ ], OrganizationMetadataAddress.prototype, "line1", void 0);
87
+ __decorate([
88
+ (0, class_validator_1.IsString)(),
89
+ (0, class_validator_1.IsOptional)(),
90
+ __metadata("design:type", String)
91
+ ], OrganizationMetadataAddress.prototype, "line2", void 0);
92
+ __decorate([
93
+ (0, class_validator_1.IsOptional)(),
94
+ (0, class_validator_1.IsString)(),
95
+ __metadata("design:type", String)
96
+ ], OrganizationMetadataAddress.prototype, "city", void 0);
97
+ __decorate([
98
+ (0, class_validator_1.IsString)(),
99
+ (0, class_validator_1.IsOptional)(),
100
+ __metadata("design:type", String)
101
+ ], OrganizationMetadataAddress.prototype, "state", void 0);
102
+ exports.OrganizationMetadataAddress = OrganizationMetadataAddress;
@@ -1,9 +1,10 @@
1
1
  import { CreateOrganization, UpdateOrganization } from 'auth0';
2
+ import { OrganizationMetadataAddress, OrganizationMetadataInformation, OrganizationMetadataLocalization, OrganizationMetadataSocial } from './organization.types';
2
3
  export declare class OrganizationMetadataValidator {
3
- address: string;
4
- publicName: string;
5
- legalName: string;
6
- industry: string;
4
+ information?: OrganizationMetadataInformation;
5
+ localization?: OrganizationMetadataLocalization;
6
+ address?: OrganizationMetadataAddress;
7
+ social?: OrganizationMetadataSocial[];
7
8
  }
8
9
  export declare class CreateOrganizationValidator implements CreateOrganization {
9
10
  name: string;
@@ -11,6 +12,6 @@ export declare class CreateOrganizationValidator implements CreateOrganization {
11
12
  password?: string;
12
13
  }
13
14
  export declare class UpdateOrganizationValidator implements UpdateOrganization {
14
- display_name: string;
15
+ display_name?: string;
15
16
  metadata: OrganizationMetadataValidator;
16
17
  }
@@ -12,32 +12,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.UpdateOrganizationValidator = exports.CreateOrganizationValidator = exports.OrganizationMetadataValidator = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
+ const organization_types_1 = require("./organization.types");
15
16
  class OrganizationMetadataValidator {
17
+ information;
18
+ localization;
16
19
  address;
17
- publicName;
18
- legalName;
19
- industry;
20
+ social;
20
21
  }
21
22
  __decorate([
22
- (0, class_validator_1.IsString)(),
23
23
  (0, class_validator_1.IsOptional)(),
24
- __metadata("design:type", String)
25
- ], OrganizationMetadataValidator.prototype, "address", void 0);
24
+ (0, class_validator_1.ValidateNested)(),
25
+ (0, class_transformer_1.Type)(() => organization_types_1.OrganizationMetadataInformation),
26
+ __metadata("design:type", organization_types_1.OrganizationMetadataInformation)
27
+ ], OrganizationMetadataValidator.prototype, "information", void 0);
26
28
  __decorate([
27
- (0, class_validator_1.IsString)(),
28
29
  (0, class_validator_1.IsOptional)(),
29
- __metadata("design:type", String)
30
- ], OrganizationMetadataValidator.prototype, "publicName", void 0);
30
+ (0, class_validator_1.ValidateNested)(),
31
+ (0, class_transformer_1.Type)(() => organization_types_1.OrganizationMetadataLocalization),
32
+ __metadata("design:type", organization_types_1.OrganizationMetadataLocalization)
33
+ ], OrganizationMetadataValidator.prototype, "localization", void 0);
31
34
  __decorate([
32
- (0, class_validator_1.IsString)(),
33
35
  (0, class_validator_1.IsOptional)(),
34
- __metadata("design:type", String)
35
- ], OrganizationMetadataValidator.prototype, "legalName", void 0);
36
+ (0, class_validator_1.ValidateNested)(),
37
+ (0, class_transformer_1.Type)(() => organization_types_1.OrganizationMetadataAddress),
38
+ __metadata("design:type", organization_types_1.OrganizationMetadataAddress)
39
+ ], OrganizationMetadataValidator.prototype, "address", void 0);
36
40
  __decorate([
37
- (0, class_validator_1.IsString)(),
38
41
  (0, class_validator_1.IsOptional)(),
39
- __metadata("design:type", String)
40
- ], OrganizationMetadataValidator.prototype, "industry", void 0);
42
+ (0, class_validator_1.ValidateNested)({ each: true }),
43
+ (0, class_transformer_1.Type)(() => organization_types_1.OrganizationMetadataSocial),
44
+ __metadata("design:type", Array)
45
+ ], OrganizationMetadataValidator.prototype, "social", void 0);
41
46
  exports.OrganizationMetadataValidator = OrganizationMetadataValidator;
42
47
  class CreateOrganizationValidator {
43
48
  name;
@@ -70,6 +75,7 @@ __decorate([
70
75
  __metadata("design:type", String)
71
76
  ], UpdateOrganizationValidator.prototype, "display_name", void 0);
72
77
  __decorate([
78
+ (0, class_validator_1.IsOptional)(),
73
79
  (0, class_validator_1.ValidateNested)(),
74
80
  (0, class_transformer_1.Type)(() => OrganizationMetadataValidator),
75
81
  __metadata("design:type", OrganizationMetadataValidator)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.2-24",
3
+ "version": "0.2.2-25",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,8 +0,0 @@
1
- import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- import { SocialType } from './social.validator';
3
- export declare class SocialEntity extends AbstractEntity {
4
- static readonly $index = "settings_social";
5
- name: SocialType;
6
- url: SocialType;
7
- active: boolean;
8
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SocialEntity = void 0;
13
- const mongoose_1 = require("@nestjs/mongoose");
14
- const mongoose_2 = require("mongoose");
15
- const abstract_entity_1 = require("../../../abstract/abstract.entity");
16
- const social_validator_1 = require("./social.validator");
17
- let SocialEntity = class SocialEntity extends abstract_entity_1.AbstractEntity {
18
- static $index = 'settings_social';
19
- name;
20
- url;
21
- active = true;
22
- };
23
- __decorate([
24
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, enum: social_validator_1.SocialType, required: true, unique: true }),
25
- __metadata("design:type", String)
26
- ], SocialEntity.prototype, "name", void 0);
27
- __decorate([
28
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true }),
29
- __metadata("design:type", String)
30
- ], SocialEntity.prototype, "url", void 0);
31
- __decorate([
32
- (0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: true }),
33
- __metadata("design:type", Object)
34
- ], SocialEntity.prototype, "active", void 0);
35
- SocialEntity = __decorate([
36
- (0, mongoose_1.Schema)({ timestamps: true })
37
- ], SocialEntity);
38
- exports.SocialEntity = SocialEntity;