@griddo/api-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.
@@ -0,0 +1,85 @@
1
+ export declare const LogActivityEventEnum: Record<string, string>;
2
+ export declare enum ContentType {
3
+ TEMPLATE = "template",// page
4
+ STRUCTURED_DATA = "structuredData",
5
+ CATEGORY = "category",// ¿structuredData?
6
+ MENU = "menu",// menu
7
+ NAVIGATION = "navigation",// navigation
8
+ FILE = "file",// files
9
+ IMAGE = "image",// ????
10
+ USER = "user",// user
11
+ ROL = "rol",// role
12
+ ROBOTS = "robots",// ????
13
+ REDIRECTS = "redirects",// redirect
14
+ ANALYTICS = "analytics",// ????
15
+ SETTINGS = "settings",// settings
16
+ LANGUAGES = "languages",// language
17
+ SOCIALS = "socials",// social
18
+ DATA_PACK = "data_pack",// ????
19
+ INTEGRATIONS = "integrations",// integration
20
+ SITE = "site",// site
21
+ FORM = "form",// Form
22
+ FORM_CATEGORY = "form_categories",// Form
23
+ LOG_ACTIVITY = "log_activity"
24
+ }
25
+ export type LogActivityEventEnumInterface = keyof typeof LogActivityEventEnum;
26
+ export interface LogActivityRelation {
27
+ id?: number | null;
28
+ name?: string | null;
29
+ title?: string | null;
30
+ }
31
+ export type LogActivityUserDTO = LogActivityRelation & {
32
+ ip?: BaseLogActivityDTO['ip'];
33
+ country?: BaseLogActivityDTO['country'];
34
+ action?: LogActivityEventEnumInterface;
35
+ company?: string | null;
36
+ };
37
+ export interface LogActivityFilterDTO {
38
+ date?: {
39
+ from?: Date;
40
+ until?: Date;
41
+ } | undefined;
42
+ sites?: (number | 'global')[];
43
+ contentTypes?: string[];
44
+ eventTypes?: number[];
45
+ authors?: number[];
46
+ }
47
+ export interface BaseLogActivityDTO {
48
+ id?: number;
49
+ userId: number;
50
+ siteId?: number | null;
51
+ contentType: string;
52
+ contentTypeId: number;
53
+ eventTypeId: number;
54
+ createdAt?: string;
55
+ ip: string;
56
+ country: string;
57
+ contentTypePublic?: string;
58
+ contentTypeTitle?: string;
59
+ }
60
+ type LogActivityUserGrouped<TLogActivity> = LogActivityUserDTO & {
61
+ logActivity: TLogActivity;
62
+ };
63
+ export type LogActivityDTO = Omit<BaseLogActivityDTO, 'createdAt' | 'contentType' | 'contentTypeId' | 'contentTypePublic' | 'contentTypeTitle' | 'userId' | 'siteId' | 'ip' | 'country'> & {
64
+ user: LogActivityUserDTO;
65
+ site: LogActivityRelation;
66
+ eventType: LogActivityRelation;
67
+ created: {
68
+ date: string;
69
+ hour: string;
70
+ };
71
+ content: {
72
+ id: BaseLogActivityDTO['contentTypeId'];
73
+ title: BaseLogActivityDTO['contentTypeTitle'];
74
+ contentType: BaseLogActivityDTO['contentTypePublic'];
75
+ type: BaseLogActivityDTO['contentType'];
76
+ };
77
+ };
78
+ export type LogActivityGroupedUserDTO<TLogActivity = LogActivityDTO[]> = Omit<BaseLogActivityDTO, 'createdAt' | 'contentType' | 'contentTypeId' | 'contentTypePublic' | 'contentTypeTitle' | 'userId' | 'siteId' | 'ip' | 'country' | 'eventTypeId'> & {
79
+ date: string;
80
+ user: LogActivityUserGrouped<TLogActivity>[];
81
+ };
82
+ export type LogActivityUserGroupedLogDTO = LogActivityUserDTO & {
83
+ LogActivityFormatDTO: Omit<LogActivityDTO, 'user'>[];
84
+ };
85
+ export {};
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContentType = exports.LogActivityEventEnum = void 0;
4
+ const LogActivityEvents_1 = require("src/logs/LogActivityEvents");
5
+ exports.LogActivityEventEnum = Object.keys(LogActivityEvents_1.LogActivityEvent).reduce((acc, key) => {
6
+ acc[key] = key;
7
+ return acc;
8
+ }, {});
9
+ var ContentType;
10
+ (function (ContentType) {
11
+ ContentType["TEMPLATE"] = "template";
12
+ ContentType["STRUCTURED_DATA"] = "structuredData";
13
+ ContentType["CATEGORY"] = "category";
14
+ ContentType["MENU"] = "menu";
15
+ ContentType["NAVIGATION"] = "navigation";
16
+ ContentType["FILE"] = "file";
17
+ ContentType["IMAGE"] = "image";
18
+ ContentType["USER"] = "user";
19
+ ContentType["ROL"] = "rol";
20
+ ContentType["ROBOTS"] = "robots";
21
+ ContentType["REDIRECTS"] = "redirects";
22
+ ContentType["ANALYTICS"] = "analytics";
23
+ ContentType["SETTINGS"] = "settings";
24
+ ContentType["LANGUAGES"] = "languages";
25
+ ContentType["SOCIALS"] = "socials";
26
+ ContentType["DATA_PACK"] = "data_pack";
27
+ ContentType["INTEGRATIONS"] = "integrations";
28
+ ContentType["SITE"] = "site";
29
+ ContentType["FORM"] = "form";
30
+ ContentType["FORM_CATEGORY"] = "form_categories";
31
+ ContentType["LOG_ACTIVITY"] = "log_activity";
32
+ })(ContentType || (exports.ContentType = ContentType = {}));
@@ -0,0 +1 @@
1
+ export * from './activity';
@@ -0,0 +1,17 @@
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("./activity"), exports);
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@griddo/api-types",
3
+ "version": "1.0.0",
4
+ "description": "Tipos públicos de la API de Griddo",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.json",
15
+ "clean": "rm -rf dist",
16
+ "prepare": "npm run build"
17
+ },
18
+ "license": "MIT",
19
+ "devDependencies": {
20
+ "@types/minimatch": "^6.0.0"
21
+ }
22
+ }