@authenty/authapi-types 1.0.0

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 ADDED
@@ -0,0 +1,34 @@
1
+ # @authenty/authapi-types
2
+
3
+ Pacote de tipos compartilhados da Authenty API.
4
+
5
+ ## Como Publicar
6
+
7
+ 1. Certifique-se de estar logado no npm:
8
+ ```bash
9
+ npm login
10
+ ```
11
+
12
+ 2. Faça o build do pacote:
13
+ ```bash
14
+ npm run build
15
+ ```
16
+
17
+ 3. Publique o pacote (acesso público):
18
+ ```bash
19
+ npm publish --access public
20
+ ```
21
+
22
+ ## Como Usar
23
+
24
+ Instale o pacote em seu projeto:
25
+
26
+ ```bash
27
+ npm install @authenty/authapi-types
28
+ ```
29
+
30
+ Importe os tipos:
31
+
32
+ ```typescript
33
+ import { ExampleType } from '@authenty/authapi-types';
34
+ ```
@@ -0,0 +1,19 @@
1
+ export declare enum Privilege {
2
+ NONE = 0,
3
+ READ = 1,
4
+ WRITE = 2
5
+ }
6
+ export type PrivilegeTable = {
7
+ users: Privilege;
8
+ products: Privilege;
9
+ courses: Privilege;
10
+ consultancies: Privilege;
11
+ bundles: Privilege;
12
+ logs: Privilege;
13
+ support: Privilege;
14
+ leads: Privilege;
15
+ paymentSystem: Privilege;
16
+ adminMaster: Privilege;
17
+ activityTrakking: Privilege;
18
+ financial: Privilege;
19
+ };
package/dist/admin.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Privilege = void 0;
4
+ var Privilege;
5
+ (function (Privilege) {
6
+ Privilege[Privilege["NONE"] = 0] = "NONE";
7
+ Privilege[Privilege["READ"] = 1] = "READ";
8
+ Privilege[Privilege["WRITE"] = 2] = "WRITE";
9
+ })(Privilege || (exports.Privilege = Privilege = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum BundleType {
2
+ BUNDLE = 0,
3
+ SYMBOLIC_PRODUCT = 1,
4
+ SYMBOLIC_COURSE = 2,
5
+ SYMBOLIC_CONSULTANCY = 3
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BundleType = void 0;
4
+ var BundleType;
5
+ (function (BundleType) {
6
+ BundleType[BundleType["BUNDLE"] = 0] = "BUNDLE";
7
+ BundleType[BundleType["SYMBOLIC_PRODUCT"] = 1] = "SYMBOLIC_PRODUCT";
8
+ BundleType[BundleType["SYMBOLIC_COURSE"] = 2] = "SYMBOLIC_COURSE";
9
+ BundleType[BundleType["SYMBOLIC_CONSULTANCY"] = 3] = "SYMBOLIC_CONSULTANCY";
10
+ })(BundleType || (exports.BundleType = BundleType = {}));
@@ -0,0 +1,3 @@
1
+ export * from './admin';
2
+ export * from './general';
3
+ export * from './payment-system';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
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
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./admin"), exports);
18
+ __exportStar(require("./general"), exports);
19
+ __exportStar(require("./payment-system"), exports);
@@ -0,0 +1,44 @@
1
+ export type PG_Customer = {
2
+ id: string;
3
+ email: string;
4
+ name: string;
5
+ };
6
+ export declare enum PG_PurchaseLicenseStatus {
7
+ UNKNOWN = 0,//Nunca será atualizado automaticamente!!
8
+ OPEN = 3,//ABERTA - Aguardando pagamento
9
+ EXPIRED = 1,//VENCEU - Era PAGAMENTO, e acabou prazo pra uso acabou
10
+ PAID = 5,//PAGA - Pagamento realizado com sucesso - é pagamento único
11
+ ACTIVE = 6,//ATIVO - Assinatura ativa e em dia
12
+ RECYCLING = 4,//RETENTANDO - Tentativa de renovação automática falhou, mas ainda está no prazo para pagar manualmente
13
+ CANCELED = 2
14
+ }
15
+ export declare const PG_PurchaseLicenseStatus_GroupActive: PG_PurchaseLicenseStatus[];
16
+ export declare enum PG_PurchasePaymentStatus {
17
+ UNKNOWN = 0,//pendent or unknown
18
+ ACTIVE = 1,
19
+ CANCELED = 2,
20
+ REFUNDED = 3,
21
+ REMOVED = 4,// REMOVIDO DO GATEWAY - Não há mais registro do pagamento no gateway
22
+ PENDING = 5
23
+ }
24
+ export declare enum PG_PurchaseType {
25
+ SESSION = 0,//o registro se trata de uma sessão de compra (ex: intenção de compra preparada para redirecionar o usuário ao gateway. Ainda não é um pagamento nem uma assinatura ativa)
26
+ STANDARD = 1,//Pagamento único
27
+ RECURRENT = 2
28
+ }
29
+ export type PG_Purchase = {
30
+ id: string;
31
+ amount: number;
32
+ recurrent: boolean;
33
+ type: PG_PurchaseType;
34
+ paymentStatus: PG_PurchasePaymentStatus;
35
+ url: string | null;
36
+ dueTime: Date | null;
37
+ };
38
+ export declare enum PG_RecurrenceType {
39
+ NONE = 0,
40
+ DAILY = 1,
41
+ WEEKLY = 2,
42
+ MONTHLY = 3,
43
+ YEARLY = 4
44
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PG_RecurrenceType = exports.PG_PurchaseType = exports.PG_PurchasePaymentStatus = exports.PG_PurchaseLicenseStatus_GroupActive = exports.PG_PurchaseLicenseStatus = void 0;
4
+ var PG_PurchaseLicenseStatus;
5
+ (function (PG_PurchaseLicenseStatus) {
6
+ // Pagamentos ou Assinaturas
7
+ PG_PurchaseLicenseStatus[PG_PurchaseLicenseStatus["UNKNOWN"] = 0] = "UNKNOWN";
8
+ PG_PurchaseLicenseStatus[PG_PurchaseLicenseStatus["OPEN"] = 3] = "OPEN";
9
+ // Pagamentos
10
+ PG_PurchaseLicenseStatus[PG_PurchaseLicenseStatus["EXPIRED"] = 1] = "EXPIRED";
11
+ PG_PurchaseLicenseStatus[PG_PurchaseLicenseStatus["PAID"] = 5] = "PAID";
12
+ // Assinaturas
13
+ PG_PurchaseLicenseStatus[PG_PurchaseLicenseStatus["ACTIVE"] = 6] = "ACTIVE";
14
+ PG_PurchaseLicenseStatus[PG_PurchaseLicenseStatus["RECYCLING"] = 4] = "RECYCLING";
15
+ PG_PurchaseLicenseStatus[PG_PurchaseLicenseStatus["CANCELED"] = 2] = "CANCELED";
16
+ })(PG_PurchaseLicenseStatus || (exports.PG_PurchaseLicenseStatus = PG_PurchaseLicenseStatus = {}));
17
+ exports.PG_PurchaseLicenseStatus_GroupActive = [
18
+ PG_PurchaseLicenseStatus.PAID,
19
+ PG_PurchaseLicenseStatus.ACTIVE,
20
+ PG_PurchaseLicenseStatus.RECYCLING,
21
+ ];
22
+ var PG_PurchasePaymentStatus;
23
+ (function (PG_PurchasePaymentStatus) {
24
+ PG_PurchasePaymentStatus[PG_PurchasePaymentStatus["UNKNOWN"] = 0] = "UNKNOWN";
25
+ PG_PurchasePaymentStatus[PG_PurchasePaymentStatus["ACTIVE"] = 1] = "ACTIVE";
26
+ PG_PurchasePaymentStatus[PG_PurchasePaymentStatus["CANCELED"] = 2] = "CANCELED";
27
+ PG_PurchasePaymentStatus[PG_PurchasePaymentStatus["REFUNDED"] = 3] = "REFUNDED";
28
+ PG_PurchasePaymentStatus[PG_PurchasePaymentStatus["REMOVED"] = 4] = "REMOVED";
29
+ PG_PurchasePaymentStatus[PG_PurchasePaymentStatus["PENDING"] = 5] = "PENDING";
30
+ })(PG_PurchasePaymentStatus || (exports.PG_PurchasePaymentStatus = PG_PurchasePaymentStatus = {}));
31
+ var PG_PurchaseType;
32
+ (function (PG_PurchaseType) {
33
+ PG_PurchaseType[PG_PurchaseType["SESSION"] = 0] = "SESSION";
34
+ PG_PurchaseType[PG_PurchaseType["STANDARD"] = 1] = "STANDARD";
35
+ PG_PurchaseType[PG_PurchaseType["RECURRENT"] = 2] = "RECURRENT";
36
+ })(PG_PurchaseType || (exports.PG_PurchaseType = PG_PurchaseType = {}));
37
+ var PG_RecurrenceType;
38
+ (function (PG_RecurrenceType) {
39
+ PG_RecurrenceType[PG_RecurrenceType["NONE"] = 0] = "NONE";
40
+ PG_RecurrenceType[PG_RecurrenceType["DAILY"] = 1] = "DAILY";
41
+ PG_RecurrenceType[PG_RecurrenceType["WEEKLY"] = 2] = "WEEKLY";
42
+ PG_RecurrenceType[PG_RecurrenceType["MONTHLY"] = 3] = "MONTHLY";
43
+ PG_RecurrenceType[PG_RecurrenceType["YEARLY"] = 4] = "YEARLY";
44
+ })(PG_RecurrenceType || (exports.PG_RecurrenceType = PG_RecurrenceType = {}));
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@authenty/authapi-types",
3
+ "version": "1.0.0",
4
+ "description": "Shared types for Authenty API",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "dev": "tsc -w"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "devDependencies": {
15
+ "typescript": "^5.0.0"
16
+ }
17
+ }
package/src/admin.ts ADDED
@@ -0,0 +1,20 @@
1
+ export enum Privilege {
2
+ NONE = 0,
3
+ READ = 1,
4
+ WRITE = 2
5
+ }
6
+
7
+ export type PrivilegeTable = {// ESTES PRIVILÉGIOS JÁ SÃO CONVERTIDOS NO `server.ts` para que quando é externo tenha que ter maior nível de acesso...
8
+ users: Privilege;
9
+ products: Privilege;
10
+ courses: Privilege;
11
+ consultancies: Privilege;
12
+ bundles: Privilege;
13
+ logs: Privilege;
14
+ support: Privilege;
15
+ leads: Privilege;
16
+ paymentSystem: Privilege;
17
+ adminMaster: Privilege;
18
+ activityTrakking: Privilege;
19
+ financial: Privilege;
20
+ }
package/src/general.ts ADDED
@@ -0,0 +1,6 @@
1
+ export enum BundleType {
2
+ BUNDLE = 0,
3
+ SYMBOLIC_PRODUCT = 1,
4
+ SYMBOLIC_COURSE = 2,
5
+ SYMBOLIC_CONSULTANCY = 3,
6
+ }
package/src/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from './admin';
2
+ export * from './general';
3
+ export * from './payment-system';
4
+
5
+
6
+
@@ -0,0 +1,61 @@
1
+ export type PG_Customer = {
2
+ id: string,
3
+ email: string,
4
+ name: string
5
+ }
6
+
7
+ export enum PG_PurchaseLicenseStatus {
8
+
9
+ // Pagamentos ou Assinaturas
10
+ UNKNOWN = 0,//Nunca será atualizado automaticamente!!
11
+ OPEN = 3, //ABERTA - Aguardando pagamento
12
+
13
+ // Pagamentos
14
+ EXPIRED = 1, //VENCEU - Era PAGAMENTO, e acabou prazo pra uso acabou
15
+ PAID = 5, //PAGA - Pagamento realizado com sucesso - é pagamento único
16
+
17
+ // Assinaturas
18
+ ACTIVE = 6, //ATIVO - Assinatura ativa e em dia
19
+ RECYCLING = 4, //RETENTANDO - Tentativa de renovação automática falhou, mas ainda está no prazo para pagar manualmente
20
+ CANCELED = 2, //CANCELADA - Foi cancelada pelo usuário ou admin
21
+ }
22
+
23
+ export const PG_PurchaseLicenseStatus_GroupActive = [//quais são os Status que são considerados ATIVOS (aptos a usar a licença)
24
+ PG_PurchaseLicenseStatus.PAID,
25
+ PG_PurchaseLicenseStatus.ACTIVE,
26
+ PG_PurchaseLicenseStatus.RECYCLING,
27
+ ]
28
+
29
+ export enum PG_PurchasePaymentStatus {
30
+ UNKNOWN = 0,//pendent or unknown
31
+ ACTIVE = 1,
32
+ CANCELED = 2,
33
+ REFUNDED = 3,
34
+ REMOVED = 4,// REMOVIDO DO GATEWAY - Não há mais registro do pagamento no gateway
35
+ PENDING = 5, //não paga ainda
36
+ }
37
+
38
+ export enum PG_PurchaseType {
39
+ SESSION = 0, //o registro se trata de uma sessão de compra (ex: intenção de compra preparada para redirecionar o usuário ao gateway. Ainda não é um pagamento nem uma assinatura ativa)
40
+ STANDARD = 1, //Pagamento único
41
+ RECURRENT = 2, //Assinatura recorrente
42
+ }
43
+
44
+ export type PG_Purchase = {
45
+ id: string,
46
+ amount: number,
47
+ recurrent: boolean,
48
+ type: PG_PurchaseType,
49
+ // licenseStatus: PG_PurchaseLicenseStatus,
50
+ paymentStatus: PG_PurchasePaymentStatus,
51
+ url: string | null,
52
+ dueTime: Date|null
53
+ }
54
+
55
+ export enum PG_RecurrenceType {
56
+ NONE = 0,
57
+ DAILY = 1,
58
+ WEEKLY = 2,
59
+ MONTHLY = 3,
60
+ YEARLY = 4
61
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "declaration": true,
6
+ "outDir": "./dist",
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true
11
+ },
12
+ "include": ["src"]
13
+ }