@stackql/provider-utils 0.5.2 → 0.5.3
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/providerdev/generate.js +10 -2
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ async function loadManifest(configPath) {
|
|
|
17
17
|
createReadStream(configPath)
|
|
18
18
|
.pipe(csv())
|
|
19
19
|
.on('data', (row) => {
|
|
20
|
-
const key = `${row.filename}::${row.
|
|
20
|
+
const key = `${row.filename}::${row.path}::${row.verb}`;
|
|
21
21
|
manifest[key] = row;
|
|
22
22
|
})
|
|
23
23
|
.on('end', () => {
|
|
@@ -251,9 +251,17 @@ export async function generate(options) {
|
|
|
251
251
|
|
|
252
252
|
// Initialize resources object with defaultdict-like behavior
|
|
253
253
|
const resources = {};
|
|
254
|
+
|
|
255
|
+
// Define valid HTTP verbs to process
|
|
256
|
+
const validVerbs = ['get', 'post', 'put', 'patch', 'delete'];
|
|
254
257
|
|
|
255
258
|
for (const [pathKey, pathItem] of Object.entries(spec.paths || {})) {
|
|
256
259
|
for (const [verb, operation] of Object.entries(pathItem)) {
|
|
260
|
+
// Only process valid HTTP verbs
|
|
261
|
+
if (!validVerbs.includes(verb)) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
|
|
257
265
|
if (typeof operation !== 'object' || operation === null) {
|
|
258
266
|
continue;
|
|
259
267
|
}
|
|
@@ -263,7 +271,7 @@ export async function generate(options) {
|
|
|
263
271
|
continue;
|
|
264
272
|
}
|
|
265
273
|
|
|
266
|
-
const manifestKey = `${filename}::${
|
|
274
|
+
const manifestKey = `${filename}::${pathKey}::${verb}`;
|
|
267
275
|
const entry = manifest[manifestKey];
|
|
268
276
|
if (!entry) {
|
|
269
277
|
logger.error(`❌ ERROR: ${filename} → ${operationId} not found in manifest`);
|