@seamapi/nextlove-sdk-generator 1.19.7 → 1.19.9

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.
@@ -87,8 +87,8 @@ class SeamClient
87
87
  throw new HttpApiError($res_json->error, $status_code, $request_id);
88
88
  }
89
89
 
90
- throw \GuzzleHttp\Exception\RequestException::create(
91
- new \GuzzleHttp\Psr7\Request($method, $path),
90
+ throw \\GuzzleHttp\\Exception\\RequestException::create(
91
+ new \\GuzzleHttp\\Psr7\\Request($method, $path),
92
92
  $response
93
93
  );
94
94
  }
@@ -59,6 +59,41 @@ function processParameterSchema(schema) {
59
59
  deepFlattenOneOfAndAllOfSchema(param_value);
60
60
  }
61
61
  }
62
- return parameter_schema;
62
+ return stripUndocumentedProperties(parameter_schema);
63
+ }
64
+ function stripUndocumentedProperties(schema) {
65
+ const properties = Object.fromEntries(Object.entries(schema.properties).flatMap(([name, property_schema]) => {
66
+ const filtered_property = stripUndocumentedPropertySchema(property_schema);
67
+ return filtered_property ? [[name, filtered_property]] : [];
68
+ }));
69
+ return {
70
+ ...schema,
71
+ properties,
72
+ required: schema.required.filter((name) => name in properties),
73
+ };
74
+ }
75
+ function stripUndocumentedPropertySchema(property_schema) {
76
+ if (property_schema?.["x-undocumented"] != null) {
77
+ return undefined;
78
+ }
79
+ if (property_schema?.type === "object" && property_schema.properties) {
80
+ const properties = Object.fromEntries(Object.entries(property_schema.properties).flatMap(([name, nested_schema]) => {
81
+ const filtered_property = stripUndocumentedPropertySchema(nested_schema);
82
+ return filtered_property ? [[name, filtered_property]] : [];
83
+ }));
84
+ return {
85
+ ...property_schema,
86
+ properties,
87
+ required: (property_schema.required ?? []).filter((name) => name in properties),
88
+ };
89
+ }
90
+ if (property_schema?.type === "array" && property_schema.items) {
91
+ const items = stripUndocumentedPropertySchema(property_schema.items);
92
+ return {
93
+ ...property_schema,
94
+ items: items ?? property_schema.items,
95
+ };
96
+ }
97
+ return property_schema;
63
98
  }
64
99
  //# sourceMappingURL=get-parameter-and-response-schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-parameter-and-response-schema.js","sourceRoot":"","sources":["../../src/lib/openapi/get-parameter-and-response-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAA;AAE3F,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,KAAY,EAAE,EAAE;IAC5D,MAAM,eAAe,GACnB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAEpE,MAAM,QAAQ,GAAG,CAAC,CAChB,eAAe;QACf,UAAU,IAAI,eAAe;QAC7B,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CACvE,CAAA;IAED,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,EAAE,QAAQ,EAAE,CAAA;KACpB;IAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE;QAC3B,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG;YACvB,OAAO,EAAE;gBACP,kBAAkB,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE;aACnE;SACK,CAAA;KACT;IAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE;QACzD,OAAO,EAAE,QAAQ,EAAE,CAAA;KACpB;IAED,MAAM,gBAAgB,GAAG,sBAAsB,CAC7C,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAC1D,CAAA;IAED,MAAM,iBAAiB,GAAI,e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ACF;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
1
+ {"version":3,"file":"get-parameter-and-response-schema.js","sourceRoot":"","sources":["../../src/lib/openapi/get-parameter-and-response-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAA;AAE3F,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,KAAY,EAAE,EAAE;IAC5D,MAAM,eAAe,GACnB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAEpE,MAAM,QAAQ,GAAG,CAAC,CAChB,eAAe;QACf,UAAU,IAAI,eAAe;QAC7B,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CACvE,CAAA;IAED,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,EAAE,QAAQ,EAAE,CAAA;KACpB;IAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE;QAC3B,KAAK,CAAC,IAAI,CAAC,WAAW,GAAG;YACvB,OAAO,EAAE;gBACP,kBAAkB,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE;aACnE;SACK,CAAA;KACT;IAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,kBAAkB,CAAC,EAAE;QACzD,OAAO,EAAE,QAAQ,EAAE,CAAA;KACpB;IAED,MAAM,gBAAgB,GAAG,sBAAsB,CAC7C,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAC1D,CAAA;IAED,MAAM,iBAAiB,GAAI,eAAuB,CAAC,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Q,EAAE,CAAC,eAAe,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAC/C,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,UAAU,CACrC;SACF,CAAA;KACF;IAED,IAAI,eAAe,EAAE,IAAI,KAAK,OAAO,IAAI,eAAe,CAAC,KAAK,EAAE;QAC9D,MAAM,KAAK,GAAG,+BAA+B,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;QAEpE,OAAO;YACL,GAAG,eAAe;YAClB,KAAK,EAAE,KAAK,IAAI,eAAe,CAAC,KAAK;SACtC,CAAA;KACF;IAED,OAAO,eAAe,CAAA;AACxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/nextlove-sdk-generator",
3
- "version": "1.19.7",
3
+ "version": "1.19.9",
4
4
  "description": "Utilities for building NextLove SDK Generators",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -100,8 +100,8 @@ class SeamClient
100
100
  throw new HttpApiError($res_json->error, $status_code, $request_id);
101
101
  }
102
102
 
103
- throw \GuzzleHttp\Exception\RequestException::create(
104
- new \GuzzleHttp\Psr7\Request($method, $path),
103
+ throw \\GuzzleHttp\\Exception\\RequestException::create(
104
+ new \\GuzzleHttp\\Psr7\\Request($method, $path),
105
105
  $response
106
106
  );
107
107
  }
@@ -88,5 +88,59 @@ function processParameterSchema(
88
88
  }
89
89
  }
90
90
 
91
- return parameter_schema
91
+ return stripUndocumentedProperties(parameter_schema)
92
+ }
93
+
94
+ function stripUndocumentedProperties(schema: ObjSchema): ObjSchema {
95
+ const properties = Object.fromEntries(
96
+ Object.entries(schema.properties).flatMap(([name, property_schema]) => {
97
+ const filtered_property = stripUndocumentedPropertySchema(property_schema)
98
+
99
+ return filtered_property ? [[name, filtered_property]] : []
100
+ })
101
+ )
102
+
103
+ return {
104
+ ...schema,
105
+ properties,
106
+ required: schema.required.filter((name) => name in properties),
107
+ }
108
+ }
109
+
110
+ function stripUndocumentedPropertySchema(property_schema: any): any {
111
+ if (property_schema?.["x-undocumented"] != null) {
112
+ return undefined
113
+ }
114
+
115
+ if (property_schema?.type === "object" && property_schema.properties) {
116
+ const properties = Object.fromEntries(
117
+ Object.entries(property_schema.properties).flatMap(
118
+ ([name, nested_schema]) => {
119
+ const filtered_property =
120
+ stripUndocumentedPropertySchema(nested_schema)
121
+
122
+ return filtered_property ? [[name, filtered_property]] : []
123
+ }
124
+ )
125
+ )
126
+
127
+ return {
128
+ ...property_schema,
129
+ properties,
130
+ required: (property_schema.required ?? []).filter(
131
+ (name: string) => name in properties
132
+ ),
133
+ }
134
+ }
135
+
136
+ if (property_schema?.type === "array" && property_schema.items) {
137
+ const items = stripUndocumentedPropertySchema(property_schema.items)
138
+
139
+ return {
140
+ ...property_schema,
141
+ items: items ?? property_schema.items,
142
+ }
143
+ }
144
+
145
+ return property_schema
92
146
  }