···11+import type { IRContext } from '../../../ir/context';
22+import { camelCase } from '../../../utils/camelCase';
33+import { sanitizeNamespaceIdentifier } from '../../common/parser/sanitize';
44+55+/**
66+ * Returns an operation ID to use across the application. By default, we try
77+ * to use the provided ID. If it's not provided or the services are configured
88+ * to exclude it, we generate operation ID from its location.
99+ */
1010+export const operationToId = ({
1111+ context,
1212+ method,
1313+ id,
1414+ path,
1515+}: {
1616+ context: IRContext;
1717+ id: string | undefined;
1818+ method: string;
1919+ path: string;
2020+}): string => {
2121+ if (
2222+ id &&
2323+ (!context.config.plugins['@hey-api/services'] ||
2424+ context.config.plugins['@hey-api/services'].operationId)
2525+ ) {
2626+ return camelCase({
2727+ input: sanitizeNamespaceIdentifier(id),
2828+ });
2929+ }
3030+3131+ const urlWithoutPlaceholders = path
3232+ .replace(/{(.*?)}/g, 'by-$1')
3333+ // replace slashes with hyphens for camelcase method at the end
3434+ .replace(/[/:]/g, '-');
3535+3636+ return camelCase({
3737+ input: `${method}-${urlWithoutPlaceholders}`,
3838+ });
3939+};
···2828 * Generate a tree of types containing all operations? It will be named
2929 * $OpenApiTs.
3030 * @default false
3131+ *
3232+ * @deprecated
3133 */
3234 tree?: boolean;
3335}
···11// This file is auto-generated by @hey-api/openapi-ts
22-export * from './types.gen';
33-export * from './services.gen';22+export * from './types.gen';
···11// This file is auto-generated by @hey-api/openapi-ts
22-export * from './types.gen';
33-export * from './services.gen';22+export * from './types.gen';