@griddo/api-types 1.1.1 → 1.1.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.
@@ -1,5 +1,5 @@
1
- import type { PaginationRequest } from 'src/common';
2
- import type { ExportFormat } from 'src/common/export';
1
+ import type { PaginationRequest } from "src/common";
2
+ import type { ExportFormat } from "src/common/export";
3
3
  export declare const LogActivityEventEnum: Record<string, string>;
4
4
  export declare enum ContentType {
5
5
  TEMPLATE = "template",// page
@@ -32,8 +32,8 @@ export interface LogActivityRelation {
32
32
  internal_key?: string | null;
33
33
  }
34
34
  export type LogActivityUserDTO = LogActivityRelation & {
35
- ip?: BaseLogActivityDTO['ip'];
36
- country?: BaseLogActivityDTO['country'];
35
+ ip?: BaseLogActivityDTO["ip"];
36
+ country?: BaseLogActivityDTO["country"];
37
37
  action?: LogActivityEventEnumInterface;
38
38
  company?: string | null;
39
39
  image?: string | null;
@@ -46,7 +46,7 @@ export interface LogActivityFilterDTO {
46
46
  from?: Date;
47
47
  until?: Date;
48
48
  } | undefined;
49
- sites?: (number | 'global')[];
49
+ sites?: (number | "global")[];
50
50
  contentTypes?: string[];
51
51
  eventTypes?: number[];
52
52
  users?: number[];
@@ -66,22 +66,22 @@ export interface BaseLogActivityDTO {
66
66
  contentTypeLanguageId?: number | null;
67
67
  }
68
68
  export type LogContentTypeDTO = {
69
- id: BaseLogActivityDTO['contentTypeId'];
70
- title: BaseLogActivityDTO['contentTypeTitle'];
69
+ id: BaseLogActivityDTO["contentTypeId"];
70
+ title: BaseLogActivityDTO["contentTypeTitle"];
71
71
  content: {
72
72
  id: string;
73
73
  title: string;
74
74
  };
75
- type: BaseLogActivityDTO['contentType'];
76
- languageId: BaseLogActivityDTO['contentTypeLanguageId'];
75
+ type: BaseLogActivityDTO["contentType"];
76
+ languageId: BaseLogActivityDTO["contentTypeLanguageId"];
77
77
  };
78
78
  export type LogContentDTO = {
79
- id: BaseLogActivityDTO['contentTypeId'];
80
- title: BaseLogActivityDTO['contentTypeTitle'];
81
- type: BaseLogActivityDTO['contentTypePublic'];
82
- language: BaseLogActivityDTO['contentTypeLanguageId'];
79
+ id: BaseLogActivityDTO["contentTypeId"];
80
+ title: BaseLogActivityDTO["contentTypeTitle"];
81
+ type: BaseLogActivityDTO["contentTypePublic"];
82
+ language: BaseLogActivityDTO["contentTypeLanguageId"];
83
83
  };
84
- export type LogActivityDTO = Omit<BaseLogActivityDTO, 'contentType' | 'contentTypeId' | 'contentTypePublic' | 'contentTypeTitle' | 'userId' | 'siteId' | 'ip' | 'country'> & {
84
+ export type LogActivityDTO = Omit<BaseLogActivityDTO, "contentType" | "contentTypeId" | "contentTypePublic" | "contentTypeTitle" | "userId" | "siteId" | "ip" | "country"> & {
85
85
  user: LogActivityUserDTO;
86
86
  site: LogActivityRelation | null;
87
87
  eventType: LogActivityRelation | null;
@@ -92,11 +92,11 @@ export type LogActivityDTO = Omit<BaseLogActivityDTO, 'contentType' | 'contentTy
92
92
  contentType: LogContentTypeDTO | null;
93
93
  content: LogContentDTO | null;
94
94
  };
95
- export type LogActivityGroupedUserDTO<TLogActivity = LogActivityDTO[]> = Omit<BaseLogActivityDTO, 'createdAt' | 'contentType' | 'contentTypeId' | 'contentTypePublic' | 'contentTypeTitle' | 'userId' | 'siteId' | 'ip' | 'country' | 'eventTypeId'> & {
95
+ export type LogActivityGroupedUserDTO<TLogActivity = LogActivityDTO[]> = Omit<BaseLogActivityDTO, "createdAt" | "contentType" | "contentTypeId" | "contentTypePublic" | "contentTypeTitle" | "userId" | "siteId" | "ip" | "country" | "eventTypeId"> & {
96
96
  date: string;
97
97
  user: LogActivityUserGrouped<TLogActivity>[];
98
98
  };
99
- export type LogActivityGroupedDayDTO = Omit<BaseLogActivityDTO, 'createdAt' | 'contentType' | 'contentTypeId' | 'contentTypePublic' | 'contentTypeTitle' | 'userId' | 'siteId' | 'ip' | 'country' | 'eventTypeId'> & {
99
+ export type LogActivityGroupedDayDTO = Omit<BaseLogActivityDTO, "createdAt" | "contentType" | "contentTypeId" | "contentTypePublic" | "contentTypeTitle" | "userId" | "siteId" | "ip" | "country" | "eventTypeId"> & {
100
100
  date: string;
101
101
  totalItems: number;
102
102
  items: LogActivityDTO[];
@@ -110,11 +110,11 @@ export interface LogActivityExportRequest {
110
110
  startTime?: string | null;
111
111
  maxEvents?: number | null;
112
112
  }
113
- export type LogActivityPaginationRequest = Omit<PaginationRequest, 'filters'> & {
113
+ export type LogActivityPaginationRequest = Omit<PaginationRequest, "filters"> & {
114
114
  page?: number;
115
115
  itemsPerPage?: number;
116
116
  date?: string;
117
- sites?: (number | 'global')[];
117
+ sites?: (number | "global")[];
118
118
  contentTypes?: string[];
119
119
  eventTypes?: number[];
120
120
  users?: number[];
@@ -1 +1 @@
1
- export * from './activity';
1
+ export * from "./activity";
@@ -1,5 +1,5 @@
1
- import type { ContentBodyPosition, ContentPresence } from 'src/add-ons';
2
- export type PageIntegrationType = 'addon' | 'analytics' | 'datalayer';
1
+ import type { ContentBodyPosition, ContentPresence } from "src/add-ons";
2
+ export type PageIntegrationType = "addon" | "analytics" | "datalayer";
3
3
  export interface PageIntegration {
4
4
  id: number;
5
5
  name: string;
@@ -1,7 +1,10 @@
1
1
  export interface CleanCorruptedPagesResponse {
2
2
  deletedPages: number;
3
3
  deletedStructuredData: number;
4
+ duplicatePagesDelete: number;
5
+ unpublishingSitePages: number;
4
6
  liveStatusStructuredDataUpdate: number;
5
7
  unpublishedStructuredDataUpdate: number;
6
8
  orphanStructureDataDelete: number;
9
+ globalPagesWithMismatchedLiveStatus: number;
7
10
  }
@@ -1 +1,2 @@
1
- export * from './add-ons';
1
+ export * from "./clear_corrupted_pages";
2
+ export * from "./add-ons";
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./clear_corrupted_pages"), exports);
17
18
  __exportStar(require("./add-ons"), exports);
@@ -0,0 +1 @@
1
+ export * from "./status";
@@ -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("./status"), exports);
@@ -0,0 +1,63 @@
1
+ import type { PaginationRequest, PaginationResponse } from "src/common";
2
+ /**
3
+ * Represents the possible states of a job in the queue.
4
+ */
5
+ export declare enum JobStatusStateEnum {
6
+ PENDING = "pending",
7
+ PROCESSING = "processing",
8
+ COMPLETED = "completed",
9
+ FAILED = "failed"
10
+ }
11
+ export type JobStatusState = (typeof JobStatusStateEnum)[keyof typeof JobStatusStateEnum];
12
+ /**
13
+ * Data Transfer Object (DTO) representing the full status of a job.
14
+ */
15
+ export interface JobStatusDTO {
16
+ readonly id: number;
17
+ readonly dedupId: string;
18
+ readonly jobName: string;
19
+ readonly state: JobStatusState;
20
+ readonly attempts: number;
21
+ readonly output?: unknown | null;
22
+ readonly lastError?: string | null;
23
+ readonly createdAt: Date;
24
+ readonly updatedAt: Date;
25
+ }
26
+ /**
27
+ * DTO for the parameters required to fetch a job by its ID.
28
+ */
29
+ export type GetJobStatusParamsDTO = Pick<JobStatusDTO, "id">;
30
+ /**
31
+ * DTO for the response body when fetching a job by its ID.
32
+ */
33
+ export type GetJobStatusResponseDTO = JobStatusDTO;
34
+ /**
35
+ * DTO for the parameters required to fetch the latest job by its deduplication ID.
36
+ */
37
+ export type GetLatestJobStatusParamsDTO = Pick<JobStatusDTO, "dedupId">;
38
+ /**
39
+ * DTO for the response body when fetching the latest job by its deduplication ID.
40
+ */
41
+ export type GetLatestJobStatusResponseDTO = JobStatusDTO;
42
+ /**
43
+ * Defines the filter criteria that can be applied when querying for job statuses.
44
+ */
45
+ export interface PaginationFilterJobStatusDTO {
46
+ state?: JobStatusState;
47
+ }
48
+ /**
49
+ * Represents the parameters for a paginated request for job statuses.
50
+ * It extends the base `PaginationRequest` with specific filters and excludes the generic `search` field.
51
+ */
52
+ export type PaginationJobStatusDTO = Omit<PaginationRequest<PaginationFilterJobStatusDTO>, "search"> & {
53
+ status?: JobStatusState;
54
+ };
55
+ /**
56
+ * Type alias for the query parameters expected in the paginate endpoint request.
57
+ */
58
+ export type PaginationJobStatusParamsDTO = PaginationJobStatusDTO;
59
+ /**
60
+ * Represents the structure of the response for a paginated list of jobs.
61
+ * It contains an array of job data and pagination metadata.
62
+ */
63
+ export type PaginationJobStatusResponseDTO = PaginationResponse<JobStatusDTO>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JobStatusStateEnum = void 0;
4
+ /**
5
+ * Represents the possible states of a job in the queue.
6
+ */
7
+ var JobStatusStateEnum;
8
+ (function (JobStatusStateEnum) {
9
+ JobStatusStateEnum["PENDING"] = "pending";
10
+ JobStatusStateEnum["PROCESSING"] = "processing";
11
+ JobStatusStateEnum["COMPLETED"] = "completed";
12
+ JobStatusStateEnum["FAILED"] = "failed";
13
+ })(JobStatusStateEnum || (exports.JobStatusStateEnum = JobStatusStateEnum = {}));
@@ -1,2 +1,2 @@
1
- export * from './select';
2
- export * from './schemas';
1
+ export * from "./select";
2
+ export * from "./schemas";
@@ -110,8 +110,8 @@ export interface SchemaComponentDefault {
110
110
  [key: string]: any;
111
111
  }
112
112
  export interface SchemaThumbnails {
113
- '1x': string;
114
- '2x': string;
113
+ "1x": string;
114
+ "2x": string;
115
115
  }
116
116
  export interface SchemaModule extends SchemaComponent {
117
117
  category: string;
@@ -1 +1,2 @@
1
- export * from './languages';
1
+ export * from "./languages";
2
+ export * from "./site";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./languages"), exports);
18
+ __exportStar(require("./site"), exports);
@@ -1,8 +1,8 @@
1
1
  export interface LanguageSiteDTO {
2
2
  id?: number | null;
3
3
  languageId: number;
4
- siteId: number;
4
+ siteId: number | null;
5
5
  path?: string | null;
6
6
  defaultField?: 0 | 1;
7
- domainId: number;
7
+ domainId: number | null;
8
8
  }
@@ -0,0 +1,48 @@
1
+ export interface SiteRelation {
2
+ id?: number | null;
3
+ name?: string | null;
4
+ }
5
+ interface BaseSiteDTO {
6
+ name: string;
7
+ authorId?: number | null;
8
+ id?: number | null;
9
+ slug?: string | null;
10
+ theme?: string | null;
11
+ thumbnail?: string | null;
12
+ timezone?: string | null;
13
+ favicon?: string | null;
14
+ smallAvatar?: string | null;
15
+ bigAvatar?: string | null;
16
+ navigationModules?: string | null;
17
+ siteMetaDataId?: number | null;
18
+ published?: Date | null;
19
+ modified?: Date | null;
20
+ deleted?: number | null;
21
+ socials?: string | null;
22
+ hash?: string | null;
23
+ rendering?: Date | null;
24
+ isPublished?: number | null;
25
+ }
26
+ export type SiteDTO = BaseSiteDTO & {
27
+ authorRelation?: SiteRelation;
28
+ distributorPagesRelation?: SiteRelation[];
29
+ };
30
+ export type SitePostParamsDTO = Pick<BaseSiteDTO, "name"> & {
31
+ defaultLanguage: number;
32
+ domain: number;
33
+ path: string | null;
34
+ };
35
+ export type SitePutParamsDTO = Pick<BaseSiteDTO, "authorId" | "bigAvatar" | "deleted" | "favicon" | "hash" | "id" | "isPublished" | "name" | "published" | "navigationModules" | "siteMetaDataId" | "slug" | "smallAvatar" | "socials" | "thumbnail" | "timezone">;
36
+ export type SitePostResponseDTO = SiteDTO;
37
+ export type SitePutResponseDTO = SiteDTO;
38
+ export type SiteSyncActionsDTO = {
39
+ republishSitesIds: number[];
40
+ dispatchRelatedPageUpdates: {
41
+ id: number;
42
+ siteId: number;
43
+ languageId: number;
44
+ structuredDataId?: string | null;
45
+ }[];
46
+ };
47
+ export type SiteSyncActionsResponseDTO = SiteSyncActionsDTO;
48
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
- "name": "@griddo/api-types",
3
- "version": "1.1.1",
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
- }
2
+ "name": "@griddo/api-types",
3
+ "version": "1.1.3",
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
22
  }