@authenty/authapi-types 1.0.0 → 1.0.3
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/IncrementVersion.js +20 -0
- package/dist/cronjobs.d.ts +8 -0
- package/dist/cronjobs.js +2 -0
- package/dist/general.d.ts +208 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +3 -2
- package/src/cronjobs.ts +9 -0
- package/src/general.ts +225 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var fs = require('fs');
|
|
2
|
+
|
|
3
|
+
console.log('Incrementing build number...');
|
|
4
|
+
|
|
5
|
+
var packageFile = 'package.json';
|
|
6
|
+
|
|
7
|
+
// Incrementa a versão no package.json
|
|
8
|
+
fs.readFile(packageFile, function(err, content) {
|
|
9
|
+
if (err) throw err;
|
|
10
|
+
var packageData = JSON.parse(content);
|
|
11
|
+
|
|
12
|
+
var version = packageData.version.split('.');
|
|
13
|
+
var newVersion = `${version[0]}.${version[1]}.${Number(version[2]) + 1}`;
|
|
14
|
+
packageData.version = newVersion;
|
|
15
|
+
|
|
16
|
+
fs.writeFile(packageFile, JSON.stringify(packageData, null, 2), function(err) {
|
|
17
|
+
if (err) throw err;
|
|
18
|
+
console.log(`Package.json updated to version: ${newVersion}`);
|
|
19
|
+
});
|
|
20
|
+
});
|
package/dist/cronjobs.js
ADDED
package/dist/general.d.ts
CHANGED
|
@@ -1,6 +1,214 @@
|
|
|
1
|
+
import { PrivilegeTable } from "./admin";
|
|
2
|
+
import { PG_PurchaseLicenseStatus, PG_PurchasePaymentStatus, PG_PurchaseType } from "./payment-system";
|
|
1
3
|
export declare enum BundleType {
|
|
2
4
|
BUNDLE = 0,
|
|
3
5
|
SYMBOLIC_PRODUCT = 1,
|
|
4
6
|
SYMBOLIC_COURSE = 2,
|
|
5
7
|
SYMBOLIC_CONSULTANCY = 3
|
|
6
8
|
}
|
|
9
|
+
export type Product = {
|
|
10
|
+
id: number;
|
|
11
|
+
title: string;
|
|
12
|
+
short: string;
|
|
13
|
+
resume: string;
|
|
14
|
+
video?: string;
|
|
15
|
+
imgUrls?: string;
|
|
16
|
+
logo: string;
|
|
17
|
+
themeImage?: string;
|
|
18
|
+
themeColor?: string;
|
|
19
|
+
themeVideo?: string;
|
|
20
|
+
url: string;
|
|
21
|
+
type: number;
|
|
22
|
+
period_test: number;
|
|
23
|
+
created: string;
|
|
24
|
+
deletedAt?: string | null;
|
|
25
|
+
Levels?: ProductLevel[];
|
|
26
|
+
};
|
|
27
|
+
export type ProductLevel = {
|
|
28
|
+
id: number;
|
|
29
|
+
productID: number;
|
|
30
|
+
level: number;
|
|
31
|
+
short: string;
|
|
32
|
+
Product?: Product;
|
|
33
|
+
store_bundles_levels: {
|
|
34
|
+
id: number;
|
|
35
|
+
bundleID: number;
|
|
36
|
+
levelID: number;
|
|
37
|
+
quantity: number;
|
|
38
|
+
Bundle?: Bundle;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
export type Course = {
|
|
42
|
+
id: number;
|
|
43
|
+
type: number;
|
|
44
|
+
name: string;
|
|
45
|
+
short: string;
|
|
46
|
+
resume: string;
|
|
47
|
+
img_landscape: string;
|
|
48
|
+
img_square: string;
|
|
49
|
+
workload: number;
|
|
50
|
+
langID: number;
|
|
51
|
+
num_classes?: number;
|
|
52
|
+
seats: number;
|
|
53
|
+
url?: string;
|
|
54
|
+
dates: string;
|
|
55
|
+
local: string;
|
|
56
|
+
local_url: string;
|
|
57
|
+
date_mat_s?: string;
|
|
58
|
+
date_mat_e?: string;
|
|
59
|
+
date_ends?: string;
|
|
60
|
+
email_enrollment?: string;
|
|
61
|
+
email_before?: string;
|
|
62
|
+
email_after?: string;
|
|
63
|
+
date_c: string;
|
|
64
|
+
date_r?: string | null;
|
|
65
|
+
};
|
|
66
|
+
export type Consultancy = {
|
|
67
|
+
id: number;
|
|
68
|
+
teacherID: number;
|
|
69
|
+
type: number;
|
|
70
|
+
name: string;
|
|
71
|
+
short: string;
|
|
72
|
+
resume: string;
|
|
73
|
+
img_landscape: string;
|
|
74
|
+
img_square: string;
|
|
75
|
+
workload: number;
|
|
76
|
+
langID: number;
|
|
77
|
+
url?: string;
|
|
78
|
+
datetime: string;
|
|
79
|
+
date_mat_s?: string;
|
|
80
|
+
date_mat_e?: string;
|
|
81
|
+
date_ends?: string;
|
|
82
|
+
email_enrollment: string;
|
|
83
|
+
email_before: string;
|
|
84
|
+
email_after: string;
|
|
85
|
+
date_c: string;
|
|
86
|
+
date_r?: string | null;
|
|
87
|
+
};
|
|
88
|
+
export type Bundle = {
|
|
89
|
+
id: number;
|
|
90
|
+
type: BundleType;
|
|
91
|
+
title?: string;
|
|
92
|
+
short?: string;
|
|
93
|
+
resume?: string;
|
|
94
|
+
img: string;
|
|
95
|
+
themeImage: string;
|
|
96
|
+
themeColor: string;
|
|
97
|
+
shareLimit: number;
|
|
98
|
+
created: string;
|
|
99
|
+
active: boolean;
|
|
100
|
+
showInSite: boolean;
|
|
101
|
+
defaultMetaArray: string;
|
|
102
|
+
deletedAt?: string | null;
|
|
103
|
+
Levels?: Array<{
|
|
104
|
+
id: number;
|
|
105
|
+
bundleID: number;
|
|
106
|
+
levelID: number;
|
|
107
|
+
quantity: number;
|
|
108
|
+
Level: ProductLevel;
|
|
109
|
+
}>;
|
|
110
|
+
Courses?: Array<{
|
|
111
|
+
id: number;
|
|
112
|
+
bundleID: number;
|
|
113
|
+
courseID: number;
|
|
114
|
+
quantity: number;
|
|
115
|
+
Course: Course;
|
|
116
|
+
}>;
|
|
117
|
+
Consultancies?: Array<{
|
|
118
|
+
id: number;
|
|
119
|
+
bundleID: number;
|
|
120
|
+
consultancyID: number;
|
|
121
|
+
quantity: number;
|
|
122
|
+
Consultancy: Consultancy;
|
|
123
|
+
}>;
|
|
124
|
+
store_bundles_paymethod: PaymentMethod[];
|
|
125
|
+
};
|
|
126
|
+
export type PaymentMethod = {
|
|
127
|
+
id: number;
|
|
128
|
+
bundleID: number;
|
|
129
|
+
price: number;
|
|
130
|
+
fromprice: number;
|
|
131
|
+
period_renew: number;
|
|
132
|
+
period_grace: number;
|
|
133
|
+
gatewayHash: string;
|
|
134
|
+
allowBoleto: boolean;
|
|
135
|
+
gatewayID: number;
|
|
136
|
+
Bundle?: Bundle;
|
|
137
|
+
};
|
|
138
|
+
export type Purchase = {
|
|
139
|
+
paghash: string;
|
|
140
|
+
id: number;
|
|
141
|
+
price: number;
|
|
142
|
+
licenseStatus: PG_PurchaseLicenseStatus;
|
|
143
|
+
paymentStatus: PG_PurchasePaymentStatus;
|
|
144
|
+
type_step: PG_PurchaseType;
|
|
145
|
+
PaymentMethod: PaymentMethod;
|
|
146
|
+
Wallet?: Wallet;
|
|
147
|
+
walletID: number;
|
|
148
|
+
createdAt: string;
|
|
149
|
+
paymentDueAt: string | null;
|
|
150
|
+
owner: string;
|
|
151
|
+
invoiceUrl?: string;
|
|
152
|
+
nfUrl?: string;
|
|
153
|
+
isAdmin?: boolean;
|
|
154
|
+
meta_data?: Record<string, any>;
|
|
155
|
+
};
|
|
156
|
+
export type Wallet = {
|
|
157
|
+
id: number;
|
|
158
|
+
userID: number;
|
|
159
|
+
balance?: number;
|
|
160
|
+
Purchases?: Purchase[];
|
|
161
|
+
};
|
|
162
|
+
export type PurchaseShare = {
|
|
163
|
+
id: number;
|
|
164
|
+
purchaseID: number;
|
|
165
|
+
userID: number;
|
|
166
|
+
Purchase: Purchase;
|
|
167
|
+
};
|
|
168
|
+
export type LocalUser = {
|
|
169
|
+
id: number;
|
|
170
|
+
fullname: string;
|
|
171
|
+
email: string;
|
|
172
|
+
lang: number;
|
|
173
|
+
avatar: string;
|
|
174
|
+
end_city?: number;
|
|
175
|
+
end_comp?: string;
|
|
176
|
+
end_country: number;
|
|
177
|
+
end_district?: string;
|
|
178
|
+
end_n?: string;
|
|
179
|
+
end_state?: number;
|
|
180
|
+
end_street?: string;
|
|
181
|
+
end_zip?: string;
|
|
182
|
+
email_verif: boolean;
|
|
183
|
+
terms: boolean;
|
|
184
|
+
cpf?: string;
|
|
185
|
+
newslatter?: boolean;
|
|
186
|
+
allow_purchase?: boolean;
|
|
187
|
+
allow_license?: boolean;
|
|
188
|
+
date_c?: Date | string;
|
|
189
|
+
date_r?: Date | string | null;
|
|
190
|
+
Wallets?: Wallet[];
|
|
191
|
+
PurchasesShares?: PurchaseShare[];
|
|
192
|
+
Sys_admUser_config?: {
|
|
193
|
+
campaigns_blacklist: string;
|
|
194
|
+
deletedAt: Date | null;
|
|
195
|
+
userID: number;
|
|
196
|
+
};
|
|
197
|
+
Sys_adminUser?: PrivilegeTable;
|
|
198
|
+
};
|
|
199
|
+
export type LogEntry = {
|
|
200
|
+
appId: string;
|
|
201
|
+
logCode: number;
|
|
202
|
+
content: string;
|
|
203
|
+
timestamp?: string;
|
|
204
|
+
metadata?: {
|
|
205
|
+
requestId: string;
|
|
206
|
+
endpoint: string;
|
|
207
|
+
method: string;
|
|
208
|
+
userId?: number;
|
|
209
|
+
ip?: string;
|
|
210
|
+
browser?: string;
|
|
211
|
+
system?: string;
|
|
212
|
+
referer?: string;
|
|
213
|
+
};
|
|
214
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./admin"), exports);
|
|
18
|
+
__exportStar(require("./cronjobs"), exports);
|
|
18
19
|
__exportStar(require("./general"), exports);
|
|
19
20
|
__exportStar(require("./payment-system"), exports);
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authenty/authapi-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Shared types for Authenty API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
+
"prebuild": "node IncrementVersion.js",
|
|
8
9
|
"build": "tsc",
|
|
9
10
|
"dev": "tsc -w"
|
|
10
11
|
},
|
|
@@ -14,4 +15,4 @@
|
|
|
14
15
|
"devDependencies": {
|
|
15
16
|
"typescript": "^5.0.0"
|
|
16
17
|
}
|
|
17
|
-
}
|
|
18
|
+
}
|
package/src/cronjobs.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type CronJob = { //Também definido em ~/server/src/cronjobs.ts
|
|
2
|
+
startAt: Date|null //null se não está rodando
|
|
3
|
+
latestRunErrorCount: number //zero se não teve erro
|
|
4
|
+
latestCompletedAt: Date|null
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type CronjobsStatuses = {
|
|
8
|
+
purchasesStatusUpdate: CronJob
|
|
9
|
+
}
|
package/src/general.ts
CHANGED
|
@@ -1,6 +1,231 @@
|
|
|
1
|
+
import { PrivilegeTable } from "./admin";
|
|
2
|
+
import { PG_PurchaseLicenseStatus, PG_PurchasePaymentStatus, PG_PurchaseType } from "./payment-system";
|
|
3
|
+
|
|
1
4
|
export enum BundleType {
|
|
2
5
|
BUNDLE = 0,
|
|
3
6
|
SYMBOLIC_PRODUCT = 1,
|
|
4
7
|
SYMBOLIC_COURSE = 2,
|
|
5
8
|
SYMBOLIC_CONSULTANCY = 3,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type Product = {
|
|
12
|
+
id: number;
|
|
13
|
+
title: string;
|
|
14
|
+
short: string;
|
|
15
|
+
resume: string;
|
|
16
|
+
video?: string;
|
|
17
|
+
imgUrls?: string;
|
|
18
|
+
logo: string;
|
|
19
|
+
themeImage?: string;
|
|
20
|
+
themeColor?: string;
|
|
21
|
+
themeVideo?: string;
|
|
22
|
+
url: string;
|
|
23
|
+
type: number;
|
|
24
|
+
period_test: number;
|
|
25
|
+
created: string;
|
|
26
|
+
deletedAt?: string | null;
|
|
27
|
+
Levels?: ProductLevel[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type ProductLevel = {
|
|
31
|
+
id: number;
|
|
32
|
+
productID: number;
|
|
33
|
+
level: number;
|
|
34
|
+
short: string;
|
|
35
|
+
Product?: Product;
|
|
36
|
+
store_bundles_levels: {
|
|
37
|
+
id: number,
|
|
38
|
+
bundleID: number,
|
|
39
|
+
levelID: number,
|
|
40
|
+
quantity: number,
|
|
41
|
+
Bundle?: Bundle
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type Course = {
|
|
46
|
+
id: number;
|
|
47
|
+
type: number;
|
|
48
|
+
name: string;
|
|
49
|
+
short: string;
|
|
50
|
+
resume: string;
|
|
51
|
+
img_landscape: string;
|
|
52
|
+
img_square: string;
|
|
53
|
+
workload: number;
|
|
54
|
+
langID: number;
|
|
55
|
+
num_classes?: number;
|
|
56
|
+
seats: number;
|
|
57
|
+
url?: string;
|
|
58
|
+
dates: string;
|
|
59
|
+
local: string;
|
|
60
|
+
local_url: string;
|
|
61
|
+
date_mat_s?: string;
|
|
62
|
+
date_mat_e?: string;
|
|
63
|
+
date_ends?: string;
|
|
64
|
+
email_enrollment?: string;
|
|
65
|
+
email_before?: string;
|
|
66
|
+
email_after?: string;
|
|
67
|
+
date_c: string;
|
|
68
|
+
date_r?: string | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type Consultancy = {
|
|
72
|
+
id: number;
|
|
73
|
+
teacherID: number;
|
|
74
|
+
type: number;
|
|
75
|
+
name: string;
|
|
76
|
+
short: string;
|
|
77
|
+
resume: string;
|
|
78
|
+
img_landscape: string;
|
|
79
|
+
img_square: string;
|
|
80
|
+
workload: number;
|
|
81
|
+
langID: number;
|
|
82
|
+
url?: string;
|
|
83
|
+
datetime: string;
|
|
84
|
+
date_mat_s?: string;
|
|
85
|
+
date_mat_e?: string;
|
|
86
|
+
date_ends?: string;
|
|
87
|
+
email_enrollment: string;
|
|
88
|
+
email_before: string;
|
|
89
|
+
email_after: string;
|
|
90
|
+
date_c: string;
|
|
91
|
+
date_r?: string | null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type Bundle = {
|
|
95
|
+
id: number;
|
|
96
|
+
type: BundleType;
|
|
97
|
+
title?: string;
|
|
98
|
+
short?: string;
|
|
99
|
+
resume?: string;
|
|
100
|
+
img: string;
|
|
101
|
+
themeImage: string;
|
|
102
|
+
themeColor: string;
|
|
103
|
+
shareLimit: number;
|
|
104
|
+
created: string;
|
|
105
|
+
active: boolean;
|
|
106
|
+
showInSite: boolean;
|
|
107
|
+
defaultMetaArray: string;
|
|
108
|
+
deletedAt?: string | null;
|
|
109
|
+
Levels?: Array<{
|
|
110
|
+
id: number;
|
|
111
|
+
bundleID: number;
|
|
112
|
+
levelID: number;
|
|
113
|
+
quantity: number;
|
|
114
|
+
Level: ProductLevel;
|
|
115
|
+
}>;
|
|
116
|
+
Courses?: Array<{
|
|
117
|
+
id: number;
|
|
118
|
+
bundleID: number;
|
|
119
|
+
courseID: number;
|
|
120
|
+
quantity: number;
|
|
121
|
+
Course: Course;
|
|
122
|
+
}>;
|
|
123
|
+
Consultancies?: Array<{
|
|
124
|
+
id: number;
|
|
125
|
+
bundleID: number;
|
|
126
|
+
consultancyID: number;
|
|
127
|
+
quantity: number;
|
|
128
|
+
Consultancy: Consultancy;
|
|
129
|
+
}>;
|
|
130
|
+
store_bundles_paymethod: PaymentMethod[];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type PaymentMethod = {
|
|
134
|
+
id: number;
|
|
135
|
+
bundleID: number;
|
|
136
|
+
price: number;
|
|
137
|
+
fromprice: number;
|
|
138
|
+
period_renew: number;
|
|
139
|
+
period_grace: number;
|
|
140
|
+
gatewayHash: string;
|
|
141
|
+
allowBoleto: boolean;
|
|
142
|
+
gatewayID: number;
|
|
143
|
+
Bundle?: Bundle;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export type Purchase = {
|
|
147
|
+
paghash: string;
|
|
148
|
+
id: number;
|
|
149
|
+
price: number;
|
|
150
|
+
licenseStatus: PG_PurchaseLicenseStatus;
|
|
151
|
+
paymentStatus: PG_PurchasePaymentStatus,
|
|
152
|
+
type_step: PG_PurchaseType,
|
|
153
|
+
PaymentMethod: PaymentMethod;
|
|
154
|
+
Wallet?: Wallet;
|
|
155
|
+
walletID: number;
|
|
156
|
+
createdAt: string;
|
|
157
|
+
paymentDueAt: string | null;
|
|
158
|
+
owner: string;
|
|
159
|
+
invoiceUrl?: string;
|
|
160
|
+
nfUrl?: string;
|
|
161
|
+
isAdmin?: boolean;
|
|
162
|
+
meta_data?: Record<string, any>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export type Wallet = {
|
|
166
|
+
id: number;
|
|
167
|
+
userID: number;
|
|
168
|
+
balance?: number;
|
|
169
|
+
Purchases?: Purchase[];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type PurchaseShare = {
|
|
173
|
+
id: number;
|
|
174
|
+
purchaseID: number;
|
|
175
|
+
userID: number;
|
|
176
|
+
Purchase: Purchase;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type LocalUser = {
|
|
180
|
+
id: number,
|
|
181
|
+
fullname: string,
|
|
182
|
+
email: string,
|
|
183
|
+
lang: number,
|
|
184
|
+
avatar: string,
|
|
185
|
+
end_city?: number,
|
|
186
|
+
end_comp?: string,
|
|
187
|
+
end_country: number,
|
|
188
|
+
end_district?: string,
|
|
189
|
+
end_n?: string,
|
|
190
|
+
end_state?: number,
|
|
191
|
+
end_street?: string,
|
|
192
|
+
end_zip?: string,
|
|
193
|
+
|
|
194
|
+
email_verif: boolean,
|
|
195
|
+
terms: boolean,
|
|
196
|
+
|
|
197
|
+
cpf?: string,
|
|
198
|
+
newslatter?: boolean,
|
|
199
|
+
allow_purchase?: boolean,
|
|
200
|
+
allow_license?: boolean,
|
|
201
|
+
date_c?: Date | string,
|
|
202
|
+
date_r?: Date | string | null,
|
|
203
|
+
|
|
204
|
+
Wallets?: Wallet[];
|
|
205
|
+
PurchasesShares?: PurchaseShare[];
|
|
206
|
+
|
|
207
|
+
Sys_admUser_config?: {
|
|
208
|
+
campaigns_blacklist:string,
|
|
209
|
+
deletedAt: Date | null,
|
|
210
|
+
userID: number
|
|
211
|
+
},
|
|
212
|
+
Sys_adminUser?: PrivilegeTable
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Tipos para logs do sistema
|
|
216
|
+
export type LogEntry = {
|
|
217
|
+
appId: string;
|
|
218
|
+
logCode: number;
|
|
219
|
+
content: string;
|
|
220
|
+
timestamp?: string;
|
|
221
|
+
metadata?: {
|
|
222
|
+
requestId: string;
|
|
223
|
+
endpoint: string;
|
|
224
|
+
method: string;
|
|
225
|
+
userId?: number;
|
|
226
|
+
ip?: string;
|
|
227
|
+
browser?: string;
|
|
228
|
+
system?: string;
|
|
229
|
+
referer?: string;
|
|
230
|
+
};
|
|
6
231
|
}
|