@stackql/provider-utils 0.5.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackql/provider-utils",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Utilities for building StackQL providers from OpenAPI specifications.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -361,8 +361,10 @@ export async function analyze(options) {
361
361
  methodName = formattedOpId;
362
362
  }
363
363
 
364
- // Check for explicit x-stackql-sqlVerb in operation
365
- if (operation['x-stackql-sqlVerb']) {
364
+ // Check for explicit x-stackql-verb or x-stackql-sqlVerb in operation
365
+ if (operation['x-stackql-verb']) {
366
+ sqlVerb = operation['x-stackql-verb'];
367
+ } else if (operation['x-stackql-sqlVerb']) {
366
368
  sqlVerb = operation['x-stackql-sqlVerb'];
367
369
  }
368
370
 
@@ -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.operationId}`;
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}::${operationId}`;
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`);