@mxpicture/gcp-functions-common 0.1.70 → 0.1.71

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.
@@ -5,11 +5,13 @@ export interface AnnotationsRoute {
5
5
  responseType: string;
6
6
  }
7
7
  export declare const stripAnnotationsRoute: (route: AnnotationsRoute) => AnnotationsRoute;
8
- export type AnnotationsProperty = MetaPropertyDataWoType;
8
+ export interface AnnotationsProperty extends MetaPropertyDataWoType {
9
+ propertyRef: keyof MetaPropertyDataWoType;
10
+ }
9
11
  export declare const stripAnnotationsProperty: (prop: AnnotationsProperty) => AnnotationsProperty;
10
12
  export interface AnnotationsHeader {
11
13
  title: string;
12
14
  properties: AnnotationsProperty[];
13
15
  routes: AnnotationsRoute[];
14
16
  }
15
- export declare const stripAnnotationsHeader: (header: AnnotationsHeader) => AnnotationsHeader;
17
+ export declare const stripAnnotationsHeader: (header: AnnotationsHeader, deepStrip?: boolean) => AnnotationsHeader;
@@ -10,7 +10,10 @@ const annotationsRouteKeys = Object.keys(annotationsRoute);
10
10
  export const stripAnnotationsRoute = (route) => stripObject(route, annotationsRouteKeys);
11
11
  export const stripAnnotationsProperty = (prop) => {
12
12
  const decorators = Object.values(MetaPropertyDecorator);
13
- const result = { ...stripMetaPropertyDataWoType(prop) };
13
+ const result = {
14
+ ...stripMetaPropertyDataWoType(prop),
15
+ propertyRef: prop.propertyRef,
16
+ };
14
17
  const ignores = [...withoutBaseIgnoreValues, ...withoutTypeIgnoreValues];
15
18
  for (const [key, params] of Object.entries(result))
16
19
  if (decorators.find((d) => d === key))
@@ -25,8 +28,10 @@ const annotationsHeader = {
25
28
  routes: undefined,
26
29
  };
27
30
  const annotationsHeaderKeys = Object.keys(annotationsHeader);
28
- export const stripAnnotationsHeader = (header) => {
29
- header.routes = header.routes.map(stripAnnotationsRoute);
30
- header.properties = header.properties.map(stripAnnotationsProperty);
31
+ export const stripAnnotationsHeader = (header, deepStrip = false) => {
32
+ if (deepStrip) {
33
+ header.routes = header.routes.map(stripAnnotationsRoute);
34
+ header.properties = header.properties.map(stripAnnotationsProperty);
35
+ }
31
36
  return stripObject(header, annotationsHeaderKeys);
32
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxpicture/gcp-functions-common",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "description": "Utils for google cloud functions, publishing both CommonJS and ESM builds",
5
5
  "type": "module",
6
6
  "author": "MXPicture",