New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@platformatic/client

Package Overview
Dependencies
Maintainers
6
Versions
306
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platformatic/client - npm Package Compare versions

Comparing version 0.37.3 to 0.37.4

test/generateOperationId.test.js

2

index.d.ts

@@ -59,3 +59,3 @@ import { FastifyPluginAsync, FastifyReply, FastifyRequest } from 'fastify'

export function generateOperationId(path: string, method: string, methodMeta: MethodMetaInterface): string
export function generateOperationId(path: string, method: string, methodMeta: MethodMetaInterface, all: string[]): string
export function buildOpenAPIClient<T>(options: BuildOpenAPIClientOptions, openTelemetry: OpenTelemetry): Promise<T>

@@ -62,0 +62,0 @@ export function buildGraphQLClient(options: BuildGraphQLClientOptions, openTelemetry: OpenTelemetry, logger: AbstractLogger): Promise<BuildGraphQLClientOutput>

@@ -11,3 +11,3 @@ 'use strict'

function generateOperationId (path, method, methodMeta) {
function generateOperationId (path, method, methodMeta, all) {
let operationId = methodMeta.operationId

@@ -21,3 +21,17 @@ if (!operationId) {

operationId = method.toLowerCase() + stringToUpdate.split(/[/-]+/).map(capitalize).join('')
} else {
let count = 0
let candidate = operationId
while (all.includes(candidate)) {
if (count === 0) {
// first try with method name
candidate = `${method}${capitalize(operationId)}`
} else {
candidate = `${method}${capitalize(operationId)}${count}`
}
count++
}
operationId = candidate
}
all.push(operationId)
return operationId

@@ -46,3 +60,3 @@ }

let { fullResponse, throwOnError } = options
const generatedOperationIds = []
for (const path of Object.keys(spec.paths)) {

@@ -53,3 +67,3 @@ const pathMeta = spec.paths[path]

const methodMeta = pathMeta[method]
const operationId = generateOperationId(path, method, methodMeta)
const operationId = generateOperationId(path, method, methodMeta, generatedOperationIds)
const responses = pathMeta[method].responses

@@ -56,0 +70,0 @@ const successResponses = Object.entries(responses).filter(([s]) => s.startsWith('2'))

{
"name": "@platformatic/client",
"version": "0.37.3",
"version": "0.37.4",
"description": "A client for all platformatic backends",

@@ -26,3 +26,3 @@ "main": "index.js",

"tsd": "^0.28.1",
"@platformatic/telemetry": "0.37.3"
"@platformatic/telemetry": "0.37.4"
},

@@ -29,0 +29,0 @@ "dependencies": {

@@ -392,3 +392,3 @@ 'use strict'

const updatedMovie = await client.updateMovie({
const updatedMovie = await client.putUpdateMovie({
id: 1,

@@ -395,0 +395,0 @@ title: 'The Matrix Reloaded'

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc