@new-project-media/client-frontends-shared-types 1.1.23 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@new-project-media/client-frontends-shared-types",
3
- "version": "1.1.23",
3
+ "version": "1.2.0",
4
4
  "scripts": {
5
5
  "build": "tsc -p tsconfig.json",
6
6
  "postbuild": "mkdir -p ../../dist/packages/client-frontends-shared-types/ && cp package.json ../../dist/packages/client-frontends-shared-types/",
@@ -55,8 +55,9 @@ export type NestedFilteredAggregation = {
55
55
  nested: AggregationItem;
56
56
  };
57
57
  export type AggregationBuckets = Record<string, AggregationItem | FilteredAggregation | NestedFilteredAggregation>;
58
- export interface ChartAggregationBucket extends AggregationBucket {
59
- [key: string]: number | string;
58
+ export interface ChartAggregationBucket extends Omit<AggregationBucket, 'id'> {
59
+ id?: string;
60
+ [key: string]: number | string | undefined;
60
61
  }
61
62
  export declare const isAggregationItem: (item: AggregationItem | FilteredAggregation | undefined) => item is AggregationItem;
62
63
  type AggregationParam = {
@@ -103,7 +104,15 @@ export type ClientApiListResponse<T> = {
103
104
  data: T[];
104
105
  aggregations?: Record<string, AggregationItem | FilteredAggregation>;
105
106
  };
107
+ export type ClientApiSingleItemResponse<T> = {
108
+ paging: {
109
+ page: number;
110
+ total: number;
111
+ };
112
+ data: T[];
113
+ };
106
114
  export type ClientApiLocationRequestQueryParams = {
115
+ pageSize?: number;
107
116
  geo: {
108
117
  lat: number;
109
118
  lon: number;
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../packages/client-frontends-shared-types/src/lib/dataGrid/api/common.ts"],"names":[],"mappings":";;;AA8EO,MAAM,iBAAiB,GAAG,CAC/B,IAAuD,EAC9B,EAAE;IAC3B,OAAO,CAAC,CAAC,IAAI,IAAI,SAAS,IAAI,IAAI,CAAA;AACpC,CAAC,CAAA;AAJY,QAAA,iBAAiB,qBAI7B"}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../packages/client-frontends-shared-types/src/lib/dataGrid/api/common.ts"],"names":[],"mappings":";;;AA+EO,MAAM,iBAAiB,GAAG,CAC/B,IAAuD,EAC9B,EAAE;IAC3B,OAAO,CAAC,CAAC,IAAI,IAAI,SAAS,IAAI,IAAI,CAAA;AACpC,CAAC,CAAA;AAJY,QAAA,iBAAiB,qBAI7B"}
@@ -1,13 +1,13 @@
1
1
  import { z } from 'zod';
2
- declare const queue: z.ZodObject<{
2
+ export declare const QueueSchema: z.ZodObject<{
3
3
  actualOperationalDate: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
4
4
  address: z.ZodOptional<z.ZodString>;
5
- allSectors: z.ZodString;
5
+ allSectors: z.ZodOptional<z.ZodString>;
6
6
  applicationId: z.ZodString;
7
7
  constructionDate: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
8
8
  country: z.ZodOptional<z.ZodString>;
9
9
  developmentStatus: z.ZodOptional<z.ZodString>;
10
- geo: z.ZodObject<{
10
+ geo: z.ZodOptional<z.ZodObject<{
11
11
  project: z.ZodObject<{
12
12
  lon: z.ZodNumber;
13
13
  lat: z.ZodNumber;
@@ -28,9 +28,9 @@ declare const queue: z.ZodObject<{
28
28
  lat?: number;
29
29
  lon?: number;
30
30
  };
31
- }>;
31
+ }>>;
32
32
  id: z.ZodString;
33
- indexed_at: z.ZodEffects<z.ZodString, string, string>;
33
+ indexed_at: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
34
34
  localCounty: z.ZodOptional<z.ZodString>;
35
35
  localRegion: z.ZodOptional<z.ZodString>;
36
36
  localState: z.ZodOptional<z.ZodString>;
@@ -58,7 +58,7 @@ declare const queue: z.ZodObject<{
58
58
  projectName: z.ZodOptional<z.ZodString>;
59
59
  queueDataset: z.ZodOptional<z.ZodString>;
60
60
  queueDate: z.ZodEffects<z.ZodString, string, string>;
61
- refId: z.ZodOptional<z.ZodNumber>;
61
+ refId: z.ZodOptional<z.ZodString>;
62
62
  reportDate: z.ZodEffects<z.ZodString, string, string>;
63
63
  sectorDetail: z.ZodOptional<z.ZodString>;
64
64
  sectors: z.ZodArray<z.ZodObject<{
@@ -118,7 +118,7 @@ declare const queue: z.ZodObject<{
118
118
  postalCode?: string;
119
119
  projectName?: string;
120
120
  queueDate?: string;
121
- refId?: number;
121
+ refId?: string;
122
122
  reportDate?: string;
123
123
  sectorDetail?: string;
124
124
  sourceUpdate?: string;
@@ -167,7 +167,7 @@ declare const queue: z.ZodObject<{
167
167
  postalCode?: string;
168
168
  projectName?: string;
169
169
  queueDate?: string;
170
- refId?: number;
170
+ refId?: string;
171
171
  reportDate?: string;
172
172
  sectorDetail?: string;
173
173
  sourceUpdate?: string;
@@ -178,5 +178,4 @@ declare const queue: z.ZodObject<{
178
178
  windFarmName?: string;
179
179
  withdrawnDate?: string;
180
180
  }>;
181
- export type Queue = z.infer<typeof queue>;
182
- export {};
181
+ export type QueueType = z.infer<typeof QueueSchema>;
@@ -1,18 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueueSchema = void 0;
3
4
  const zod_1 = require("zod");
4
5
  const entity_1 = require("./entity");
5
- const queue = zod_1.z.object({
6
+ exports.QueueSchema = zod_1.z.object({
6
7
  actualOperationalDate: entity_1.YYYYMMDDRegexOptionalSchema,
7
8
  address: entity_1.OptionalStringSchema,
8
- allSectors: zod_1.z.string(),
9
+ allSectors: entity_1.OptionalStringSchema,
9
10
  applicationId: zod_1.z.string(),
10
11
  constructionDate: entity_1.YYYYMMDDRegexOptionalSchema,
11
12
  country: zod_1.z.string().optional(),
12
13
  developmentStatus: entity_1.OptionalStringSchema,
13
- geo: entity_1.GeoSchema,
14
+ geo: entity_1.GeoSchema.optional(),
14
15
  id: zod_1.z.string(),
15
- indexed_at: entity_1.YYYYMMDDRegexSchema,
16
+ indexed_at: entity_1.YYYYMMDDRegexOptionalSchema,
16
17
  localCounty: entity_1.OptionalStringSchema,
17
18
  localRegion: entity_1.OptionalStringSchema,
18
19
  localState: entity_1.OptionalStringSchema,
@@ -27,7 +28,7 @@ const queue = zod_1.z.object({
27
28
  projectName: entity_1.OptionalStringSchema,
28
29
  queueDataset: entity_1.OptionalStringSchema,
29
30
  queueDate: entity_1.YYYYMMDDRegexSchema,
30
- refId: entity_1.OptionalNumberSchema,
31
+ refId: entity_1.OptionalStringSchema,
31
32
  reportDate: entity_1.YYYYMMDDRegexSchema,
32
33
  sectorDetail: entity_1.OptionalStringSchema,
33
34
  sectors: entity_1.EntityItemArraySchema,
@@ -1 +1 @@
1
- {"version":3,"file":"queues.js","sourceRoot":"","sources":["../../../../../../../packages/client-frontends-shared-types/src/lib/dataGrid/api/queues.ts"],"names":[],"mappings":";;AAAA,6BAAuB;AACvB,qCAQiB;AAEjB,MAAM,KAAK,GAAG,OAAC,CAAC,MAAM,CAAC;IACrB,qBAAqB,EAAE,oCAA2B;IAClD,OAAO,EAAE,6BAAoB;IAC7B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,gBAAgB,EAAE,oCAA2B;IAC7C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,iBAAiB,EAAE,6BAAoB;IACvC,GAAG,EAAE,kBAAS;IACd,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,4BAAmB;IAC/B,WAAW,EAAE,6BAAoB;IACjC,WAAW,EAAE,6BAAoB;IACjC,UAAU,EAAE,6BAAoB;IAChC,SAAS,EAAE,6BAAoB;IAC/B,OAAO,EAAE,6BAAoB;IAC7B,KAAK,EAAE,6BAAoB;IAC3B,aAAa,EAAE,2BAAkB;IACjC,sBAAsB,EAAE,oCAA2B;IACnD,iBAAiB,EAAE,6BAAoB;IACvC,eAAe,EAAE,oCAA2B;IAC5C,UAAU,EAAE,6BAAoB;IAChC,WAAW,EAAE,6BAAoB;IACjC,YAAY,EAAE,6BAAoB;IAClC,SAAS,EAAE,4BAAmB;IAC9B,KAAK,EAAE,6BAAoB;IAC3B,UAAU,EAAE,4BAAmB;IAC/B,YAAY,EAAE,6BAAoB;IAClC,OAAO,EAAE,8BAAqB;IAC9B,YAAY,EAAE,4BAAmB;IACjC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,eAAe,EAAE,6BAAoB;IACrC,WAAW,EAAE,6BAAoB;IACjC,UAAU,EAAE,6BAAoB;IAChC,OAAO,EAAE,6BAAoB;IAC7B,YAAY,EAAE,6BAAoB;IAClC,aAAa,EAAE,oCAA2B;CAC3C,CAAC,CAAA"}
1
+ {"version":3,"file":"queues.js","sourceRoot":"","sources":["../../../../../../../packages/client-frontends-shared-types/src/lib/dataGrid/api/queues.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,qCAQiB;AAEJ,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,qBAAqB,EAAE,oCAA2B;IAClD,OAAO,EAAE,6BAAoB;IAC7B,UAAU,EAAE,6BAAoB;IAChC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,gBAAgB,EAAE,oCAA2B;IAC7C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,iBAAiB,EAAE,6BAAoB;IACvC,GAAG,EAAE,kBAAS,CAAC,QAAQ,EAAE;IACzB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,oCAA2B;IACvC,WAAW,EAAE,6BAAoB;IACjC,WAAW,EAAE,6BAAoB;IACjC,UAAU,EAAE,6BAAoB;IAChC,SAAS,EAAE,6BAAoB;IAC/B,OAAO,EAAE,6BAAoB;IAC7B,KAAK,EAAE,6BAAoB;IAC3B,aAAa,EAAE,2BAAkB;IACjC,sBAAsB,EAAE,oCAA2B;IACnD,iBAAiB,EAAE,6BAAoB;IACvC,eAAe,EAAE,oCAA2B;IAC5C,UAAU,EAAE,6BAAoB;IAChC,WAAW,EAAE,6BAAoB;IACjC,YAAY,EAAE,6BAAoB;IAClC,SAAS,EAAE,4BAAmB;IAC9B,KAAK,EAAE,6BAAoB;IAC3B,UAAU,EAAE,4BAAmB;IAC/B,YAAY,EAAE,6BAAoB;IAClC,OAAO,EAAE,8BAAqB;IAC9B,YAAY,EAAE,4BAAmB;IACjC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,eAAe,EAAE,6BAAoB;IACrC,WAAW,EAAE,6BAAoB;IACjC,UAAU,EAAE,6BAAoB;IAChC,OAAO,EAAE,6BAAoB;IAC7B,YAAY,EAAE,6BAAoB;IAClC,aAAa,EAAE,oCAA2B;CAC3C,CAAC,CAAA"}
@@ -800,5 +800,5 @@ export type OrganizationItem = z.infer<typeof OrganizationItemSchema>;
800
800
  export type DocumentRecord = z.infer<typeof DocumentRecordSchema>;
801
801
  export type LinkedPersonItem = z.infer<typeof LinkedPeopleSchema>[number];
802
802
  export type QueueJoinItem = z.infer<typeof QueueJoinSchema>[number];
803
- export type ProjectItem = z.infer<typeof EntityItemArrayOptionalSchema>[number];
803
+ export type ProjectItem = z.infer<typeof EntityItemArrayOptionalSchema> extends Array<infer T> ? T : never;
804
804
  export {};
@@ -1,6 +1,6 @@
1
1
  import { InfiniteData, QueryObserverResult, UseInfiniteQueryResult } from '@tanstack/react-query';
2
- import { ClientApiListRequestQueryParams, ClientApiListResponse, Queue, Signal } from './api';
3
- export type Entity = Signal | Queue;
2
+ import { ClientApiListRequestQueryParams, ClientApiListResponse, QueueType, Signal } from './api';
3
+ export type Entity = Signal | QueueType;
4
4
  export type InfiniteQueryHook = (queryParams: ClientApiListRequestQueryParams, isEnabled?: boolean) => UseInfiniteQueryResult<InfiniteData<ClientApiListResponse<Entity>, unknown>, Error>;
5
5
  export type RefetchResult = Promise<QueryObserverResult<InfiniteData<ClientApiListResponse<Entity>, unknown>, Error>>;
6
6
  export type ExtendedColumnFilter = {