cecon-interfaces 1.9.11 → 1.9.14

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 (22) hide show
  1. package/dist/esm2022/payio/activation-batch/entities/activation-batch.entity.mjs +48 -6
  2. package/dist/esm2022/payio/activation-batch/interfaces/i-activation-batch.mjs +1 -1
  3. package/dist/esm2022/payio/activation-key/entities/activation-key.entity.mjs +36 -13
  4. package/dist/esm2022/payio/activation-key/enums/activation-key-status.enum.mjs +1 -4
  5. package/dist/esm2022/payio/activation-key/enums/index.mjs +3 -2
  6. package/dist/esm2022/payio/activation-key/enums/license-type.enum.mjs +8 -0
  7. package/dist/esm2022/payio/activation-key/interfaces/i-activation-key.mjs +1 -1
  8. package/dist/fesm2022/cecon-interfaces.mjs +90 -22
  9. package/dist/fesm2022/cecon-interfaces.mjs.map +1 -1
  10. package/dist/payio/activation-batch/entities/activation-batch.entity.d.ts +39 -5
  11. package/dist/payio/activation-batch/entities/activation-batch.entity.js +45 -5
  12. package/dist/payio/activation-batch/interfaces/i-activation-batch.d.ts +41 -30
  13. package/dist/payio/activation-key/entities/activation-key.entity.d.ts +9 -11
  14. package/dist/payio/activation-key/entities/activation-key.entity.js +35 -12
  15. package/dist/payio/activation-key/enums/activation-key-status.enum.d.ts +1 -4
  16. package/dist/payio/activation-key/enums/activation-key-status.enum.js +0 -3
  17. package/dist/payio/activation-key/enums/index.d.ts +2 -1
  18. package/dist/payio/activation-key/enums/index.js +16 -3
  19. package/dist/payio/activation-key/enums/license-type.enum.d.ts +6 -0
  20. package/dist/payio/activation-key/enums/license-type.enum.js +10 -0
  21. package/dist/payio/activation-key/interfaces/i-activation-key.d.ts +15 -17
  22. package/package.json +1 -1
@@ -1,29 +1,63 @@
1
+ import { EPayioLicenseType } from '../../activation-key/enums/license-type.enum';
1
2
  import { EPayioActivationBatchStatus } from '../enums/activation-batch-status.enum';
2
3
  import { IPayioActivationBatch } from '../interfaces/i-activation-batch';
3
4
  export declare class PayioActivationBatchEntity implements IPayioActivationBatch {
4
- activatedLicenses: number;
5
+ /** Prazo em dias para ativar as licenças (a partir da criação do lote) */
6
+ activationDeadlineDays: number;
7
+ /** ID do aplicativo que será ativado */
5
8
  appId: string;
9
+ /** Nome do aplicativo (para facilitar consultas) */
6
10
  appName: string;
11
+ /** Slug do aplicativo */
7
12
  appSlug: string;
13
+ /** Número sequencial do lote (ex: "2025/001", "2025/002") */
8
14
  batchNumber: string;
15
+ /** Data de criação do lote */
9
16
  createdAt: Date;
17
+ /** ID do admin que criou o lote */
10
18
  createdBy: string;
11
- createdByName: string;
19
+ /** ID do distribuidor que receberá as licenças */
12
20
  distributorId: string;
21
+ /** Nome do distribuidor (para facilitar consultas) */
13
22
  distributorName: string;
14
- generatedLicenses: number;
23
+ /** Dias de tolerância após expiração */
24
+ gracePeriodDays: number;
15
25
  id: string;
26
+ /** Período de validade da licença em meses (para definição comercial) */
27
+ validityPeriodMonths: number;
28
+ /** Tipo de licença que será gerada neste lote */
29
+ licenseType: EPayioLicenseType;
30
+ /** Logs de operações do lote */
16
31
  logs: string[];
17
- negotiatedPrice: number;
32
+ /** Observações ou notas sobre o lote */
18
33
  notes?: string;
34
+ /** Indica se é ambiente sandbox */
19
35
  sandbox: boolean;
36
+ /** Número sequencial dentro do ano */
20
37
  sequentialNumber: number;
38
+ /** Status atual do lote */
21
39
  status: EPayioActivationBatchStatus;
40
+ /** Tags para busca e indexação */
22
41
  tags: string[];
42
+ /** Quantidade total de licenças no lote */
23
43
  totalLicenses: number;
44
+ /** Quantidade de licenças ativadas */
45
+ availableLicenses: number;
46
+ /** Quantidade de licenças ativas */
47
+ activeLicenses: number;
48
+ /** Quantidade de licenças revogadas */
49
+ revokedLicenses: number;
50
+ /** Quantidade de licenças expiradas */
51
+ expiredLicenses: number;
52
+ /** Preço unitário por licença */
24
53
  unitPrice: number;
54
+ /** Preço total negociado com o distribuidor */
55
+ negotiatedPrice: number;
56
+ /** Data da última atualização */
25
57
  updatedAt: Date;
26
- validUntil: Date;
58
+ /** Versão ou intervalo de versões do software cobertas */
59
+ versionConstraint: string[];
60
+ /** Ano de referência do lote */
27
61
  year: number;
28
62
  constructor(data?: Partial<PayioActivationBatchEntity>);
29
63
  }
@@ -1,31 +1,71 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PayioActivationBatchEntity = void 0;
4
+ var license_type_enum_1 = require("../../activation-key/enums/license-type.enum");
4
5
  var activation_batch_status_enum_1 = require("../enums/activation-batch-status.enum");
5
6
  var PayioActivationBatchEntity = /** @class */ (function () {
6
7
  function PayioActivationBatchEntity(data) {
7
- this.activatedLicenses = 0;
8
+ /** Prazo em dias para ativar as licenças (a partir da criação do lote) */
9
+ this.activationDeadlineDays = 180; // 6 meses;
10
+ // === INFORMAÇÕES DO APLICATIVO ===
11
+ /** ID do aplicativo que será ativado */
8
12
  this.appId = '';
13
+ /** Nome do aplicativo (para facilitar consultas) */
9
14
  this.appName = '';
15
+ /** Slug do aplicativo */
10
16
  this.appSlug = '';
17
+ /** Número sequencial do lote (ex: "2025/001", "2025/002") */
11
18
  this.batchNumber = '';
19
+ // === CONTROLE DE TEMPO ===
20
+ /** Data de criação do lote */
12
21
  this.createdAt = new Date();
22
+ // === AUDITORIA ===
23
+ /** ID do admin que criou o lote */
13
24
  this.createdBy = '';
14
- this.createdByName = '';
25
+ // === INFORMAÇÕES DO DISTRIBUIDOR ===
26
+ /** ID do distribuidor que receberá as licenças */
15
27
  this.distributorId = '';
28
+ /** Nome do distribuidor (para facilitar consultas) */
16
29
  this.distributorName = '';
17
- this.generatedLicenses = 0;
30
+ /** Dias de tolerância após expiração */
31
+ this.gracePeriodDays = 0;
18
32
  this.id = '';
33
+ /** Período de validade da licença em meses (para definição comercial) */
34
+ this.validityPeriodMonths = 12;
35
+ // === CONFIGURAÇÕES DE LICENÇA ===
36
+ /** Tipo de licença que será gerada neste lote */
37
+ this.licenseType = license_type_enum_1.EPayioLicenseType.SUBSCRIPTION;
38
+ /** Logs de operações do lote */
19
39
  this.logs = [];
20
- this.negotiatedPrice = 0;
40
+ /** Indica se é ambiente sandbox */
21
41
  this.sandbox = false;
42
+ /** Número sequencial dentro do ano */
22
43
  this.sequentialNumber = 0;
44
+ /** Status atual do lote */
23
45
  this.status = activation_batch_status_enum_1.EPayioActivationBatchStatus.PROCESSING;
46
+ /** Tags para busca e indexação */
24
47
  this.tags = [];
48
+ // === CONTROLE E ESTOQUE DE LICENÇAS ===
49
+ /** Quantidade total de licenças no lote */
25
50
  this.totalLicenses = 0;
51
+ /** Quantidade de licenças ativadas */
52
+ this.availableLicenses = 0;
53
+ /** Quantidade de licenças ativas */
54
+ this.activeLicenses = 0;
55
+ /** Quantidade de licenças revogadas */
56
+ this.revokedLicenses = 0;
57
+ /** Quantidade de licenças expiradas */
58
+ this.expiredLicenses = 0;
59
+ // === INFORMAÇÕES COMERCIAIS ===
60
+ /** Preço unitário por licença */
26
61
  this.unitPrice = 0;
62
+ /** Preço total negociado com o distribuidor */
63
+ this.negotiatedPrice = 0;
64
+ /** Data da última atualização */
27
65
  this.updatedAt = new Date();
28
- this.validUntil = new Date();
66
+ /** Versão ou intervalo de versões do software cobertas */
67
+ this.versionConstraint = [];
68
+ /** Ano de referência do lote */
29
69
  this.year = new Date().getFullYear();
30
70
  if (data) {
31
71
  for (var key in data) {
@@ -1,51 +1,62 @@
1
+ import { EPayioLicenseType } from '../../activation-key/enums/license-type.enum';
1
2
  import { EPayioActivationBatchStatus } from '../enums/activation-batch-status.enum';
2
3
  export interface IPayioActivationBatch {
3
- /** Quantidade de licenças ativadas */
4
- activatedLicenses: number;
4
+ /** Identificador único do lote (UUID) */
5
+ id: string;
6
+ /** Número sequencial do lote (ex: "2025/001", "2025/002") */
7
+ batchNumber: string;
8
+ /** Ano de referência do lote */
9
+ year: number;
10
+ /** Número sequencial dentro do ano */
11
+ sequentialNumber: number;
12
+ /** Status atual do lote */
13
+ status: EPayioActivationBatchStatus;
14
+ /** Tipo de licença que será gerada neste lote */
15
+ licenseType: EPayioLicenseType;
16
+ /** Período de validade da licença em meses (para definição comercial) */
17
+ validityPeriodMonths: number;
18
+ /** Prazo em dias para ativar as licenças (a partir da criação do lote) */
19
+ activationDeadlineDays: number;
20
+ /** Dias de tolerância após expiração */
21
+ gracePeriodDays: number;
22
+ /** Versão ou intervalo de versões do software cobertas */
23
+ versionConstraint: string[];
5
24
  /** ID do aplicativo que será ativado */
6
25
  appId: string;
7
26
  /** Nome do aplicativo (para facilitar consultas) */
8
27
  appName: string;
9
28
  /** Slug do aplicativo */
10
29
  appSlug: string;
11
- /** Número sequencial do lote (ex: "2025/001", "2025/002") */
12
- batchNumber: string;
13
- /** Data de criação do lote */
14
- createdAt: Date;
15
- /** ID do admin que criou o lote */
16
- createdBy: string;
17
- /** Nome do admin que criou */
18
- createdByName: string;
19
30
  /** ID do distribuidor que receberá as licenças */
20
31
  distributorId: string;
21
32
  /** Nome do distribuidor (para facilitar consultas) */
22
33
  distributorName: string;
23
- /** Quantidade de licenças geradas */
24
- generatedLicenses: number;
25
- /** Identificador único do lote (UUID) */
26
- id: string;
27
- /** Logs de operações do lote */
28
- logs: string[];
34
+ /** Quantidade de licenças ativadas */
35
+ availableLicenses: number;
36
+ /** Quantidade de licenças ativas */
37
+ activeLicenses: number;
38
+ /** Quantidade de licenças expiradas */
39
+ expiredLicenses: number;
40
+ /** Quantidade de licenças revogadas */
41
+ revokedLicenses: number;
42
+ /** Quantidade total de licenças no lote */
43
+ totalLicenses: number;
44
+ /** Preço unitário por licença */
45
+ unitPrice: number;
29
46
  /** Preço total negociado com o distribuidor */
30
47
  negotiatedPrice: number;
48
+ /** Data de criação do lote */
49
+ createdAt: Date;
50
+ /** Data da última atualização */
51
+ updatedAt: Date;
52
+ /** ID do admin que criou o lote */
53
+ createdBy: string;
54
+ /** Logs de operações do lote */
55
+ logs: string[];
31
56
  /** Observações ou notas sobre o lote */
32
57
  notes?: string;
33
58
  /** Indica se é ambiente sandbox */
34
59
  sandbox: boolean;
35
- /** Número sequencial dentro do ano */
36
- sequentialNumber: number;
37
- /** Status atual do lote */
38
- status: EPayioActivationBatchStatus;
39
60
  /** Tags para busca e indexação */
40
61
  tags: string[];
41
- /** Quantidade total de licenças no lote */
42
- totalLicenses: number;
43
- /** Preço unitário por licença */
44
- unitPrice: number;
45
- /** Data da última atualização */
46
- updatedAt: Date;
47
- /** Data limite para ativação das licenças */
48
- validUntil: Date;
49
- /** Ano de referência do lote */
50
- year: number;
51
62
  }
@@ -1,4 +1,5 @@
1
1
  import { EPayioActivationKeyStatus } from '../enums/activation-key-status.enum';
2
+ import { EPayioLicenseType } from '../enums/license-type.enum';
2
3
  import { IPayioActivationKey } from '../interfaces/i-activation-key';
3
4
  export declare class PayioActivationKeyEntity implements IPayioActivationKey {
4
5
  activationDate: Date | null;
@@ -6,23 +7,20 @@ export declare class PayioActivationKeyEntity implements IPayioActivationKey {
6
7
  appSlug: string | null;
7
8
  batchId: string;
8
9
  companyId: string | null;
9
- companyName: string | null;
10
10
  createdAt: Date;
11
- createdBy: string | null;
12
11
  deviceId: string | null;
13
- distributedBy: string | null;
14
- distributionDate: Date | null;
15
- distributorId: string | null;
16
- distributorKey: string | null;
17
- distributorName: string | null;
18
- expirationDate: Date | null;
12
+ distributionDate: Date;
13
+ distributorId: string;
14
+ gracePeriodDays: number;
15
+ hardwareFingerprint: string | null;
19
16
  id: string;
20
17
  key: string | null;
18
+ licenseType: EPayioLicenseType;
21
19
  logs: string[];
22
- partnerName: string | null;
23
- partnerReference: string | null;
24
- sandbox: boolean;
20
+ notes: string | null;
25
21
  status: EPayioActivationKeyStatus;
26
22
  tags: string[];
23
+ validityPeriodMonths: number;
24
+ versionConstraint: string[];
27
25
  constructor(data?: Partial<PayioActivationKeyEntity>);
28
26
  }
@@ -2,31 +2,54 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PayioActivationKeyEntity = void 0;
4
4
  var activation_key_status_enum_1 = require("../enums/activation-key-status.enum");
5
+ var license_type_enum_1 = require("../enums/license-type.enum");
5
6
  var PayioActivationKeyEntity = /** @class */ (function () {
6
7
  function PayioActivationKeyEntity(data) {
8
+ // === CAMPOS PREENCHIDOS NA ATIVAÇÃO ===
9
+ // Data em que a chave foi ativada (null = não ativada)
7
10
  this.activationDate = null;
11
+ // === REFERÊNCIAS DO SISTEMA ===
12
+ // ID do aplicativo (copiado do batch)
8
13
  this.appId = null;
14
+ // Slug do aplicativo (copiado do batch)
9
15
  this.appSlug = null;
16
+ // === REFERÊNCIA AO LOTE (fonte das configurações) ===
17
+ // ID do lote que gerou esta licença
10
18
  this.batchId = '';
19
+ // ID da empresa (preenchido na ativação)
11
20
  this.companyId = null;
12
- this.companyName = null;
21
+ // === AUDITORIA ===
22
+ // Data de criação da chave
13
23
  this.createdAt = new Date();
14
- this.createdBy = null;
24
+ // ID do dispositivo (preenchido na ativação)
15
25
  this.deviceId = null;
16
- this.distributedBy = null;
17
- this.distributionDate = null;
18
- this.distributorId = null;
19
- this.distributorKey = null;
20
- this.distributorName = null;
21
- this.expirationDate = null;
26
+ // Data em que o lote foi entregue
27
+ this.distributionDate = new Date();
28
+ // === DADOS DE DISTRIBUIÇÃO (copiados do batch) ===
29
+ // ID do distribuidor
30
+ this.distributorId = '';
31
+ // Dias de tolerância (copiado do batch)
32
+ this.gracePeriodDays = 0;
33
+ // Hash da máquina que consumiu a licença
34
+ this.hardwareFingerprint = null;
35
+ // Identificador único da chave (UUID)
22
36
  this.id = '';
37
+ // A chave de ativação em si (ex.: "PAYIO-XXXXX-XXXXX-XXXXX")
23
38
  this.key = null;
39
+ // === DADOS COPIADOS DO LOTE (para performance) ===
40
+ // Tipo de licença (copiado do batch)
41
+ this.licenseType = license_type_enum_1.EPayioLicenseType.TRIAL;
24
42
  this.logs = [];
25
- this.partnerName = null;
26
- this.partnerReference = null;
27
- this.sandbox = false;
28
- this.status = activation_key_status_enum_1.EPayioActivationKeyStatus.PENDING;
43
+ // Metadados livres para suporte
44
+ this.notes = null;
45
+ // Status da chave
46
+ this.status = activation_key_status_enum_1.EPayioActivationKeyStatus.AVAILABLE;
47
+ // Tags para categorização
29
48
  this.tags = [];
49
+ // Período de validade em meses (copiado do batch)
50
+ this.validityPeriodMonths = 12; // 1 ano;
51
+ // Versão do software (copiado do batch)
52
+ this.versionConstraint = [];
30
53
  if (data) {
31
54
  for (var key in data) {
32
55
  if (data.hasOwnProperty(key) && key in this) {
@@ -4,8 +4,5 @@ export declare enum EPayioActivationKeyStatus {
4
4
  ACTIVE = "ACTIVE",
5
5
  EXPIRED = "EXPIRED",
6
6
  REVOKED = "REVOKED",
7
- NONE = "NONE",
8
- TRIAL_7 = "TRIAL_7",
9
- TRIAL_15 = "TRIAL_15",
10
- TRIAL_30 = "TRIAL_30"
7
+ NONE = "NONE"
11
8
  }
@@ -9,7 +9,4 @@ var EPayioActivationKeyStatus;
9
9
  EPayioActivationKeyStatus["EXPIRED"] = "EXPIRED";
10
10
  EPayioActivationKeyStatus["REVOKED"] = "REVOKED";
11
11
  EPayioActivationKeyStatus["NONE"] = "NONE";
12
- EPayioActivationKeyStatus["TRIAL_7"] = "TRIAL_7";
13
- EPayioActivationKeyStatus["TRIAL_15"] = "TRIAL_15";
14
- EPayioActivationKeyStatus["TRIAL_30"] = "TRIAL_30";
15
12
  })(EPayioActivationKeyStatus || (exports.EPayioActivationKeyStatus = EPayioActivationKeyStatus = {}));
@@ -1 +1,2 @@
1
- export { EPayioActivationKeyStatus } from './activation-key-status.enum';
1
+ export * from './activation-key-status.enum';
2
+ export * from './license-type.enum';
@@ -1,5 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EPayioActivationKeyStatus = void 0;
4
- var activation_key_status_enum_1 = require("./activation-key-status.enum");
5
- Object.defineProperty(exports, "EPayioActivationKeyStatus", { enumerable: true, get: function () { return activation_key_status_enum_1.EPayioActivationKeyStatus; } });
17
+ __exportStar(require("./activation-key-status.enum"), exports);
18
+ __exportStar(require("./license-type.enum"), exports);
@@ -0,0 +1,6 @@
1
+ export declare enum EPayioLicenseType {
2
+ TRIAL = "TRIAL",
3
+ SUBSCRIPTION = "SUBSCRIPTION",
4
+ PERPETUAL = "PERPETUAL",
5
+ SANDBOX = "SANDBOX"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EPayioLicenseType = void 0;
4
+ var EPayioLicenseType;
5
+ (function (EPayioLicenseType) {
6
+ EPayioLicenseType["TRIAL"] = "TRIAL";
7
+ EPayioLicenseType["SUBSCRIPTION"] = "SUBSCRIPTION";
8
+ EPayioLicenseType["PERPETUAL"] = "PERPETUAL";
9
+ EPayioLicenseType["SANDBOX"] = "SANDBOX";
10
+ })(EPayioLicenseType || (exports.EPayioLicenseType = EPayioLicenseType = {}));
@@ -1,26 +1,24 @@
1
1
  import { EPayioActivationKeyStatus } from '../enums/activation-key-status.enum';
2
+ import { EPayioLicenseType } from '../enums/license-type.enum';
2
3
  export interface IPayioActivationKey {
4
+ id: string;
5
+ key: string | null;
6
+ status: EPayioActivationKeyStatus;
7
+ batchId: string;
8
+ licenseType: EPayioLicenseType;
9
+ validityPeriodMonths: number;
10
+ gracePeriodDays: number;
11
+ versionConstraint: string[];
3
12
  activationDate: Date | null;
13
+ hardwareFingerprint: string | null;
4
14
  appId: string | null;
5
15
  appSlug: string | null;
6
- batchId: string;
7
16
  companyId: string | null;
8
- companyName: string | null;
9
- createdAt: Date;
10
- createdBy: string | null;
11
17
  deviceId: string | null;
12
- distributedBy: string | null;
13
- distributionDate: Date | null;
14
- distributorId: string | null;
15
- distributorKey: string | null;
16
- distributorName: string | null;
17
- expirationDate: Date | null;
18
- id: string;
19
- key: string | null;
20
- logs: string[];
21
- partnerName: string | null;
22
- partnerReference: string | null;
23
- sandbox: boolean;
24
- status: EPayioActivationKeyStatus;
18
+ distributorId: string;
19
+ distributionDate: Date;
20
+ createdAt: Date;
21
+ notes: string | null;
25
22
  tags: string[];
23
+ logs: string[];
26
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cecon-interfaces",
3
- "version": "1.9.11",
3
+ "version": "1.9.14",
4
4
  "description": "Interfaces de Projetos Cecon",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",