@conectai/shared-contracts 1.0.5 → 1.0.8

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.
package/README.md CHANGED
@@ -1,35 +1,35 @@
1
- # @conectai/shared-contracts
2
-
3
- DTOs, validators e tipos compartilhados entre os projetos do Grupo AI.
4
-
5
- ## Instalação
6
-
7
- ```bash
8
- npm install @conectai/shared-contracts
9
- # ou
10
- yarn add @conectai/shared-contracts
11
- ```
12
-
13
- ## Uso
14
-
15
- ```typescript
16
- import { IUser, CreateUserValidator, QueryOptions } from '@conectai/shared-contracts'
17
- ```
18
-
19
- ## O que contém
20
-
21
- - **DTOs**: Interfaces para entidades (IUser, IHotspot, ITenant, etc.)
22
- - **Validators**: Validadores de entrada (CreateUserValidator, UpdateHotspotValidator, etc.)
23
- - **Types**: Tipos compartilhados (QueryOptions, ResourceError, Roles, etc.)
24
- - **HTTP Utils**: Helpers de resposta (resourceCreatedSuccess, exceptionRouter, etc.)
25
- - **Services**: Serviços externos (Email)
26
-
27
- ## Desenvolvimento
28
-
29
- ```bash
30
- # Build
31
- npm run build
32
-
33
- # Gerar exports
34
- node generate-index.js && npx tsc
35
- ```
1
+ # @conectai/shared-contracts
2
+
3
+ DTOs, validators e tipos compartilhados entre os projetos do Grupo AI.
4
+
5
+ ## Instalação
6
+
7
+ ```bash
8
+ npm install @conectai/shared-contracts
9
+ # ou
10
+ yarn add @conectai/shared-contracts
11
+ ```
12
+
13
+ ## Uso
14
+
15
+ ```typescript
16
+ import { IUser, CreateUserValidator, QueryOptions } from '@conectai/shared-contracts'
17
+ ```
18
+
19
+ ## O que contém
20
+
21
+ - **DTOs**: Interfaces para entidades (IUser, IHotspot, ITenant, etc.)
22
+ - **Validators**: Validadores de entrada (CreateUserValidator, UpdateHotspotValidator, etc.)
23
+ - **Types**: Tipos compartilhados (QueryOptions, ResourceError, Roles, etc.)
24
+ - **HTTP Utils**: Helpers de resposta (resourceCreatedSuccess, exceptionRouter, etc.)
25
+ - **Services**: Serviços externos (Email)
26
+
27
+ ## Desenvolvimento
28
+
29
+ ```bash
30
+ # Build
31
+ npm run build
32
+
33
+ # Gerar exports
34
+ node generate-index.js && npx tsc
35
+ ```
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from './useCases/Hotspot/IHotspot';
12
12
  export * from './useCases/HotspotConnection/HotspotConnectionValidator';
13
13
  export * from './useCases/HotspotConnection/IHotspotConnection';
14
14
  export * from './useCases/HotspotConnection/MqttMessage';
15
+ export * from './useCases/HotspotConnection/MqttSessionMessage';
15
16
  export * from './useCases/Invoice/InvoiceValidator';
16
17
  export * from './useCases/PortalBranding/PortalBrandingValidator';
17
18
  export * from './useCases/PortalFlowStep/PortalFlowStepValidator';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mDAAmD,CAAC;AAClE,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yDAAyD,CAAC;AACxE,cAAc,iDAAiD,CAAC;AAChE,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mDAAmD,CAAC;AAClE,cAAc,mDAAmD,CAAC;AAClE,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AACpE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,0CAA0C,CAAC;AACzD,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cA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mC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAE1D,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ __exportStar(require("./useCases/Hotspot/IHotspot"), exports);
28
28
  __exportStar(require("./useCases/HotspotConnection/HotspotConnectionValidator"), exports);
29
29
  __exportStar(require("./useCases/HotspotConnection/IHotspotConnection"), exports);
30
30
  __exportStar(require("./useCases/HotspotConnection/MqttMessage"), exports);
31
+ __exportStar(require("./useCases/HotspotConnection/MqttSessionMessage"), exports);
31
32
  __exportStar(require("./useCases/Invoice/InvoiceValidator"), exports);
32
33
  __exportStar(require("./useCases/PortalBranding/PortalBrandingValidator"), exports);
33
34
  __exportStar(require("./useCases/PortalFlowStep/PortalFlowStepValidator"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAE1C,sEAAoD;AACpD,8DAA4C;AAC5C,gFAA8D;AAC9D,8EAA4D;AAC5D,sEAAoD;AACpD,8DAA4C;AAC5C,oFAAkE;AAClE,0DAAwC;AACxC,sEAAoD;AACpD,8DAA4C;AAC5C,0FAAwE;AACxE,kFAAgE;AAChE,2EAAyD;AACzD,sEAAoD;AACpD,oFAAkE;AAClE,oFAAkE;AAClE,wFAAsE;AACtE,sFAAoE;AACpE,gGAA8E;AAC9E,4FAA0E;AAC1E,2EAAyD;AACzD,kFAAgE;AAChE,gFAA8D;AAC9D,kFAAgE;AAChE,gFAA8D;AAC9D,4DAA0C;AAC1C,oEAAkD;AAClD,wDAAsC;AACtC,gEAA8C;AAC9C,oEAAkD;AAClD,4EAA0D;AAE1D,sDAAoC;AACpC,0DAAwC;AACxC,mDAAiC;AACjC,wDAAsC;AACtC,sDAAoC;AACpC,uDAAqC;AACrC,uDAAqC;AACrC,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAE1C,sEAAoD;AACpD,8DAA4C;AAC5C,gFAA8D;AAC9D,8EAA4D;AAC5D,sEAAoD;AACpD,8DAA4C;AAC5C,oFAAkE;AAClE,0DAAwC;AACxC,sEAAoD;AACpD,8DAA4C;AAC5C,0FAAwE;AACxE,kFAAgE;AAChE,2EAAyD;AACzD,kFAAgE;AAChE,sEAAoD;AACpD,oFAAkE;AAClE,oFAAkE;AAClE,wFAAsE;AACtE,sFAAoE;AACpE,gGAA8E;AAC9E,4FAA0E;AAC1E,2EAAyD;AACzD,kFAAgE;AAChE,gFAA8D;AAC9D,kFAAgE;AAChE,gFAA8D;AAC9D,4DAA0C;AAC1C,oEAAkD;AAClD,wDAAsC;AACtC,gEAA8C;AAC9C,oEAAkD;AAClD,4EAA0D;AAE1D,sDAAoC;AACpC,0DAAwC;AACxC,mDAAiC;AACjC,wDAAsC;AACtC,sDAAoC;AACpC,uDAAqC;AACrC,uDAAqC;AACrC,yDAAuC"}
@@ -0,0 +1,35 @@
1
+ export type MqttSessionCommandType = 'connect' | 'disconnect';
2
+ export declare const MQTT_SESSION_COMMANDS: MqttSessionCommandType[];
3
+ export interface IMqttConnectCommand {
4
+ version: number;
5
+ command_id: string;
6
+ command: 'connect';
7
+ timestamp: string;
8
+ payload: {
9
+ mac: string;
10
+ message?: string;
11
+ };
12
+ }
13
+ export interface IMqttDisconnectCommand {
14
+ version: number;
15
+ command_id: string;
16
+ command: 'disconnect';
17
+ timestamp: string;
18
+ payload: {
19
+ mac: string;
20
+ message?: string;
21
+ };
22
+ }
23
+ export interface IMqttSessionResponse {
24
+ version: number;
25
+ client_id: string;
26
+ command_id: string;
27
+ status: 'success' | 'error';
28
+ command: 'connect' | 'disconnect';
29
+ timestamp: string;
30
+ payload: {
31
+ mac: string;
32
+ message?: string;
33
+ };
34
+ }
35
+ //# sourceMappingURL=MqttSessionMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MqttSessionMessage.d.ts","sourceRoot":"","sources":["../../../src/useCases/HotspotConnection/MqttSessionMessage.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,YAAY,CAAA;AAE7D,eAAO,MAAM,qBAAqB,EAAE,sBAAsB,EAA8B,CAAA;AAExF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,SAAS,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,YAAY,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,SAAS,GAAG,OAAO,CAAA;IAC3B,OAAO,EAAE,SAAS,GAAG,YAAY,CAAA;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MQTT_SESSION_COMMANDS = void 0;
4
+ exports.MQTT_SESSION_COMMANDS = ['connect', 'disconnect'];
5
+ //# sourceMappingURL=MqttSessionMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MqttSessionMessage.js","sourceRoot":"","sources":["../../../src/useCases/HotspotConnection/MqttSessionMessage.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAA6B,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA"}
@@ -10,6 +10,7 @@ interface ITenant {
10
10
  interface ICreateTenantDTO {
11
11
  applicationId: string;
12
12
  name: string;
13
+ slug: string;
13
14
  }
14
15
  export { ITenant, ICreateTenantDTO };
15
16
  //# sourceMappingURL=ITenant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ITenant.d.ts","sourceRoot":"","sources":["../../../src/useCases/Tenant/ITenant.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,IAAI,CAAA;CAClB;AAED,UAAU,gBAAgB;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
1
+ {"version":3,"file":"ITenant.d.ts","sourceRoot":"","sources":["../../../src/useCases/Tenant/ITenant.ts"],"names":[],"mappings":"AAAA,UAAU,OAAO;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,IAAI,CAAA;CAClB;AAED,UAAU,gBAAgB;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -2,6 +2,7 @@ import { ICreateTenantDTO } from "./ITenant";
2
2
  declare class CreateTenantValidator implements ICreateTenantDTO {
3
3
  applicationId: string;
4
4
  name: string;
5
+ slug: string;
5
6
  }
6
7
  export { CreateTenantValidator };
7
8
  //# sourceMappingURL=TenantValidator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TenantValidator.d.ts","sourceRoot":"","sources":["../../../src/useCases/Tenant/TenantValidator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,cAAM,qBAAsB,YAAW,gBAAgB;IAGrD,aAAa,EAAE,MAAM,CAAA;IAKrB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
1
+ {"version":3,"file":"TenantValidator.d.ts","sourceRoot":"","sources":["../../../src/useCases/Tenant/TenantValidator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,cAAM,qBAAsB,YAAW,gBAAgB;IAGrD,aAAa,EAAE,MAAM,CAAA;IAKrB,IAAI,EAAE,MAAM,CAAA;IAKZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -25,4 +25,10 @@ __decorate([
25
25
  (0, class_validator_1.MaxLength)(255, { message: 'name' }),
26
26
  __metadata("design:type", String)
27
27
  ], CreateTenantValidator.prototype, "name", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsNotEmpty)({ message: 'slug' }),
30
+ (0, class_validator_1.IsString)({ message: 'slug' }),
31
+ (0, class_validator_1.MaxLength)(255, { message: 'slug' }),
32
+ __metadata("design:type", String)
33
+ ], CreateTenantValidator.prototype, "slug", void 0);
28
34
  //# sourceMappingURL=TenantValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TenantValidator.js","sourceRoot":"","sources":["../../../src/useCases/Tenant/TenantValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AAGjE,MAAM,qBAAqB;CAS1B;QAEQ,qBAAqB;AAR5B;IAFC,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IACxC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;;4DAClB;AAKrB;IAHC,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/B,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC7B,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;mDACxB"}
1
+ {"version":3,"file":"TenantValidator.js","sourceRoot":"","sources":["../../../src/useCases/Tenant/TenantValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AAGjE,MAAM,qBAAqB;CAc1B;QAEQ,qBAAqB;AAb5B;IAFC,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IACxC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;;4DAClB;AAKrB;IAHC,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/B,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC7B,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;mDACxB;AAKZ;IAHC,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/B,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC7B,IAAA,2BAAS,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;mDACxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conectai/shared-contracts",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "description": "DTOs, validators e tipos compartilhados entre os projetos do Grupo AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",