@new-project-media/client-frontends-shared-types 1.1.24 → 1.2.1
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 +1 -1
- package/src/lib/dataGrid/api/common.d.ts +10 -2
- package/src/lib/dataGrid/api/common.js.map +1 -1
- package/src/lib/dataGrid/api/queues.d.ts +10 -11
- package/src/lib/dataGrid/api/queues.js +11 -6
- package/src/lib/dataGrid/api/queues.js.map +1 -1
- package/src/lib/dataGrid/api/signals.d.ts +1 -1
- package/src/lib/dataGrid/dataGrid.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@new-project-media/client-frontends-shared-types",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
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
|
-
|
|
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,6 +104,13 @@ 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 = {
|
|
107
115
|
pageSize?: number;
|
|
108
116
|
geo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../packages/client-frontends-shared-types/src/lib/dataGrid/api/common.ts"],"names":[],"mappings":";;;
|
|
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
|
|
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>;
|
|
@@ -57,8 +57,8 @@ declare const queue: z.ZodObject<{
|
|
|
57
57
|
postalCode: z.ZodOptional<z.ZodString>;
|
|
58
58
|
projectName: z.ZodOptional<z.ZodString>;
|
|
59
59
|
queueDataset: z.ZodOptional<z.ZodString>;
|
|
60
|
-
queueDate: z.ZodEffects<z.ZodString, string, string
|
|
61
|
-
refId: z.ZodOptional<z.
|
|
60
|
+
queueDate: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
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?:
|
|
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?:
|
|
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
|
|
182
|
-
export {};
|
|
181
|
+
export type QueueType = z.infer<typeof QueueSchema>;
|
|
@@ -1,18 +1,23 @@
|
|
|
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
|
|
6
|
+
const getDefaultDate = () => {
|
|
7
|
+
const today = new Date();
|
|
8
|
+
return today.toISOString().split('T')[0];
|
|
9
|
+
};
|
|
10
|
+
exports.QueueSchema = zod_1.z.object({
|
|
6
11
|
actualOperationalDate: entity_1.YYYYMMDDRegexOptionalSchema,
|
|
7
12
|
address: entity_1.OptionalStringSchema,
|
|
8
|
-
allSectors:
|
|
13
|
+
allSectors: entity_1.OptionalStringSchema,
|
|
9
14
|
applicationId: zod_1.z.string(),
|
|
10
15
|
constructionDate: entity_1.YYYYMMDDRegexOptionalSchema,
|
|
11
16
|
country: zod_1.z.string().optional(),
|
|
12
17
|
developmentStatus: entity_1.OptionalStringSchema,
|
|
13
|
-
geo: entity_1.GeoSchema,
|
|
18
|
+
geo: entity_1.GeoSchema.optional(),
|
|
14
19
|
id: zod_1.z.string(),
|
|
15
|
-
indexed_at: entity_1.
|
|
20
|
+
indexed_at: entity_1.YYYYMMDDRegexOptionalSchema,
|
|
16
21
|
localCounty: entity_1.OptionalStringSchema,
|
|
17
22
|
localRegion: entity_1.OptionalStringSchema,
|
|
18
23
|
localState: entity_1.OptionalStringSchema,
|
|
@@ -26,8 +31,8 @@ const queue = zod_1.z.object({
|
|
|
26
31
|
postalCode: entity_1.OptionalStringSchema,
|
|
27
32
|
projectName: entity_1.OptionalStringSchema,
|
|
28
33
|
queueDataset: entity_1.OptionalStringSchema,
|
|
29
|
-
queueDate: entity_1.YYYYMMDDRegexSchema,
|
|
30
|
-
refId: entity_1.
|
|
34
|
+
queueDate: entity_1.YYYYMMDDRegexSchema.default(getDefaultDate),
|
|
35
|
+
refId: entity_1.OptionalStringSchema,
|
|
31
36
|
reportDate: entity_1.YYYYMMDDRegexSchema,
|
|
32
37
|
sectorDetail: entity_1.OptionalStringSchema,
|
|
33
38
|
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":"
|
|
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,cAAc,GAAG,GAAW,EAAE;IAClC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAA;IACxB,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1C,CAAC,CAAA;AAEY,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,CAAC,OAAO,CAAC,cAAc,CAAC;IACtD,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>
|
|
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,
|
|
3
|
-
export type Entity = Signal |
|
|
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 = {
|