@new-project-media/client-frontends-shared-types 3.44.0 → 3.44.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@new-project-media/client-frontends-shared-types",
3
- "version": "3.44.0",
3
+ "version": "3.44.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/",
@@ -6,6 +6,35 @@ export type CommonItem = {
6
6
  id: string;
7
7
  parentId?: string;
8
8
  };
9
+ /**
10
+ * Runtime source of truth for the aggregation-bucket shape returned by the list
11
+ * endpoints. The `data-grid` API services (People Moves, Data Centers, Signals,
12
+ * Queues) validate their list responses against `AggregationItemSchema` instead
13
+ * of each redeclaring it.
14
+ *
15
+ * This mirrors the `AggregationItem` / `AggregationBucket` types below and must
16
+ * be kept in step with them — the schema is not `z.infer`-derived from the type
17
+ * because `AggregationBucket` is an open generic (`BaseAggregationBucket & T`)
18
+ * that downstream chart code indexes dynamically, a shape a flat `looseObject`
19
+ * inference does not reproduce.
20
+ *
21
+ * Loose rather than strict: a bucket carries whatever sub-aggregations the query
22
+ * asked for, keyed by name, and those are not worth enumerating here.
23
+ */
24
+ export declare const AggregationBucketSchema: z.ZodObject<{
25
+ key: z.ZodString;
26
+ doc_count: z.ZodNumber;
27
+ id: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$loose>;
29
+ export declare const AggregationItemSchema: z.ZodObject<{
30
+ doc_count_error_upper_bound: z.ZodNumber;
31
+ sum_other_doc_count: z.ZodNumber;
32
+ buckets: z.ZodArray<z.ZodObject<{
33
+ key: z.ZodString;
34
+ doc_count: z.ZodNumber;
35
+ id: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$loose>>;
37
+ }, z.core.$strip>;
9
38
  type BaseAggregationBucket = {
10
39
  key: string;
11
40
  id?: string;
@@ -1,8 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UNASSIGNED_SECTOR = exports.RegionLabel = exports.RegionType = exports.FilterOperator = exports.isBoundsAggregation = exports.isCentroidAggregation = exports.isAggregationItem = exports.RecordStatusSchema = void 0;
3
+ exports.UNASSIGNED_SECTOR = exports.RegionLabel = exports.RegionType = exports.FilterOperator = exports.isBoundsAggregation = exports.isCentroidAggregation = exports.isAggregationItem = exports.AggregationItemSchema = exports.AggregationBucketSchema = exports.RecordStatusSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.RecordStatusSchema = zod_1.z.string();
6
+ /**
7
+ * Runtime source of truth for the aggregation-bucket shape returned by the list
8
+ * endpoints. The `data-grid` API services (People Moves, Data Centers, Signals,
9
+ * Queues) validate their list responses against `AggregationItemSchema` instead
10
+ * of each redeclaring it.
11
+ *
12
+ * This mirrors the `AggregationItem` / `AggregationBucket` types below and must
13
+ * be kept in step with them — the schema is not `z.infer`-derived from the type
14
+ * because `AggregationBucket` is an open generic (`BaseAggregationBucket & T`)
15
+ * that downstream chart code indexes dynamically, a shape a flat `looseObject`
16
+ * inference does not reproduce.
17
+ *
18
+ * Loose rather than strict: a bucket carries whatever sub-aggregations the query
19
+ * asked for, keyed by name, and those are not worth enumerating here.
20
+ */
21
+ exports.AggregationBucketSchema = zod_1.z.looseObject({
22
+ key: zod_1.z.string(),
23
+ doc_count: zod_1.z.number(),
24
+ id: zod_1.z.string().optional(),
25
+ });
26
+ exports.AggregationItemSchema = zod_1.z.object({
27
+ doc_count_error_upper_bound: zod_1.z.number(),
28
+ sum_other_doc_count: zod_1.z.number(),
29
+ buckets: zod_1.z.array(exports.AggregationBucketSchema),
30
+ });
6
31
  const isAggregationItem = (item, columnId) => {
7
32
  return (!!item &&
8
33
  ('buckets' in item ||
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../packages/client-frontends-shared-types/src/lib/dataGrid/api/common.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAA;AAkFrC,MAAM,iBAAiB,GAAG,CAC/B,IAKa,EACb,QAAgB,EACS,EAAE;IAC3B,OAAO,CACL,CAAC,CAAC,IAAI;QACN,CAAC,SAAS,IAAI,IAAI;YAChB,CAAC,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC,IAAI,SAAS,IAAI,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,CAC/D,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,iBAAiB,qBAc7B;AAUM,MAAM,qBAAqB,GAAG,CACnC,IAKa,EACgB,EAAE;IAC/B,OAAO,CAAC,CAAC,IAAI,IAAI,UAAU,IAAI,IAAI,CAAA;AACrC,CAAC,CAAA;AATY,QAAA,qBAAqB,yBASjC;AASM,MAAM,mBAAmB,GAAG,CACjC,IAKa,EACc,EAAE;IAC7B,OAAO,CAAC,CAAC,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAA;AACnC,CAAC,CAAA;AATY,QAAA,mBAAmB,uBAS/B;AAaD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,kCAAgB,CAAA;AAClB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,uBAAS,CAAA;AACX,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAEY,QAAA,WAAW,GAAG;IACzB,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,QAAQ;IAC7B,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,eAAe;CACxB,CAAA;AAgGG,QAAA,iBAAiB,GAAG,YAAY,CAAA"}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../packages/client-frontends-shared-types/src/lib/dataGrid/api/common.ts"],"names":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