@appweaver/client 1.0.22 → 1.0.24

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.
Files changed (117) hide show
  1. package/cjs/angular/index.d.ts +1 -0
  2. package/cjs/angular/index.js +17 -0
  3. package/{clients → cjs/clients}/angular-client.d.ts +7 -1
  4. package/{clients → cjs/clients}/base-client-interface.d.ts +18 -3
  5. package/{clients → cjs/clients}/index.d.ts +0 -1
  6. package/{clients → cjs/clients}/index.js +0 -1
  7. package/{generators → cjs/generators}/generate-client.js +2 -1
  8. package/cjs/package.json +3 -0
  9. package/{weaver-client.js → cjs/weaver-client.js} +1 -1
  10. package/esm/angular/index.d.ts +1 -0
  11. package/esm/angular/index.js +1 -0
  12. package/esm/clients/angular-client.d.ts +26 -0
  13. package/esm/clients/angular-client.js +53 -0
  14. package/esm/clients/base-client-interface.d.ts +86 -0
  15. package/esm/clients/base-client-interface.js +1 -0
  16. package/esm/clients/base-client.d.ts +216 -0
  17. package/esm/clients/base-client.js +242 -0
  18. package/esm/clients/fetch-client.d.ts +6 -0
  19. package/esm/clients/fetch-client.js +6 -0
  20. package/esm/clients/index.d.ts +4 -0
  21. package/esm/clients/index.js +4 -0
  22. package/esm/clients/modules/account-client.d.ts +69 -0
  23. package/esm/clients/modules/account-client.js +107 -0
  24. package/esm/clients/modules/auth-client.d.ts +56 -0
  25. package/esm/clients/modules/auth-client.js +74 -0
  26. package/esm/clients/modules/base-module.d.ts +17 -0
  27. package/esm/clients/modules/base-module.js +49 -0
  28. package/esm/clients/modules/files-client.d.ts +27 -0
  29. package/esm/clients/modules/files-client.js +42 -0
  30. package/esm/clients/modules/health-client.d.ts +25 -0
  31. package/esm/clients/modules/health-client.js +30 -0
  32. package/esm/clients/modules/index.d.ts +6 -0
  33. package/esm/clients/modules/index.js +6 -0
  34. package/esm/clients/modules/resource-client.d.ts +90 -0
  35. package/esm/clients/modules/resource-client.js +173 -0
  36. package/esm/clients/responses/file-data-response.d.ts +78 -0
  37. package/esm/clients/responses/file-data-response.js +105 -0
  38. package/esm/clients/responses/index.d.ts +1 -0
  39. package/esm/clients/responses/index.js +1 -0
  40. package/esm/commands/generate-command.d.ts +3 -0
  41. package/esm/commands/generate-command.js +122 -0
  42. package/esm/commands/index.d.ts +1 -0
  43. package/esm/commands/index.js +1 -0
  44. package/esm/constants.d.ts +67 -0
  45. package/esm/constants.js +94 -0
  46. package/esm/errors/client-error.d.ts +6 -0
  47. package/esm/errors/client-error.js +11 -0
  48. package/esm/errors/index.d.ts +1 -0
  49. package/esm/errors/index.js +1 -0
  50. package/esm/generators/generate-client.d.ts +16 -0
  51. package/esm/generators/generate-client.js +399 -0
  52. package/esm/generators/generate-types.d.ts +9 -0
  53. package/esm/generators/generate-types.js +486 -0
  54. package/esm/generators/index.d.ts +2 -0
  55. package/esm/generators/index.js +2 -0
  56. package/esm/index.d.ts +2 -0
  57. package/esm/index.js +2 -0
  58. package/esm/package.json +3 -0
  59. package/esm/types/index.d.ts +1 -0
  60. package/esm/types/index.js +1 -0
  61. package/esm/types/routes.d.ts +15 -0
  62. package/esm/types/routes.js +1 -0
  63. package/esm/utils/index.d.ts +1 -0
  64. package/esm/utils/index.js +1 -0
  65. package/esm/utils/schema-util.d.ts +3 -0
  66. package/esm/utils/schema-util.js +39 -0
  67. package/package.json +39 -7
  68. /package/{clients → cjs/clients}/angular-client.js +0 -0
  69. /package/{clients → cjs/clients}/base-client-interface.js +0 -0
  70. /package/{clients → cjs/clients}/base-client.d.ts +0 -0
  71. /package/{clients → cjs/clients}/base-client.js +0 -0
  72. /package/{clients → cjs/clients}/fetch-client.d.ts +0 -0
  73. /package/{clients → cjs/clients}/fetch-client.js +0 -0
  74. /package/{clients → cjs/clients}/modules/account-client.d.ts +0 -0
  75. /package/{clients → cjs/clients}/modules/account-client.js +0 -0
  76. /package/{clients → cjs/clients}/modules/auth-client.d.ts +0 -0
  77. /package/{clients → cjs/clients}/modules/auth-client.js +0 -0
  78. /package/{clients → cjs/clients}/modules/base-module.d.ts +0 -0
  79. /package/{clients → cjs/clients}/modules/base-module.js +0 -0
  80. /package/{clients → cjs/clients}/modules/files-client.d.ts +0 -0
  81. /package/{clients → cjs/clients}/modules/files-client.js +0 -0
  82. /package/{clients → cjs/clients}/modules/health-client.d.ts +0 -0
  83. /package/{clients → cjs/clients}/modules/health-client.js +0 -0
  84. /package/{clients → cjs/clients}/modules/index.d.ts +0 -0
  85. /package/{clients → cjs/clients}/modules/index.js +0 -0
  86. /package/{clients → cjs/clients}/modules/resource-client.d.ts +0 -0
  87. /package/{clients → cjs/clients}/modules/resource-client.js +0 -0
  88. /package/{clients → cjs/clients}/responses/file-data-response.d.ts +0 -0
  89. /package/{clients → cjs/clients}/responses/file-data-response.js +0 -0
  90. /package/{clients → cjs/clients}/responses/index.d.ts +0 -0
  91. /package/{clients → cjs/clients}/responses/index.js +0 -0
  92. /package/{commands → cjs/commands}/generate-command.d.ts +0 -0
  93. /package/{commands → cjs/commands}/generate-command.js +0 -0
  94. /package/{commands → cjs/commands}/index.d.ts +0 -0
  95. /package/{commands → cjs/commands}/index.js +0 -0
  96. /package/{constants.d.ts → cjs/constants.d.ts} +0 -0
  97. /package/{constants.js → cjs/constants.js} +0 -0
  98. /package/{errors → cjs/errors}/client-error.d.ts +0 -0
  99. /package/{errors → cjs/errors}/client-error.js +0 -0
  100. /package/{errors → cjs/errors}/index.d.ts +0 -0
  101. /package/{errors → cjs/errors}/index.js +0 -0
  102. /package/{generators → cjs/generators}/generate-client.d.ts +0 -0
  103. /package/{generators → cjs/generators}/generate-types.d.ts +0 -0
  104. /package/{generators → cjs/generators}/generate-types.js +0 -0
  105. /package/{generators → cjs/generators}/index.d.ts +0 -0
  106. /package/{generators → cjs/generators}/index.js +0 -0
  107. /package/{index.d.ts → cjs/index.d.ts} +0 -0
  108. /package/{index.js → cjs/index.js} +0 -0
  109. /package/{types → cjs/types}/index.d.ts +0 -0
  110. /package/{types → cjs/types}/index.js +0 -0
  111. /package/{types → cjs/types}/routes.d.ts +0 -0
  112. /package/{types → cjs/types}/routes.js +0 -0
  113. /package/{utils → cjs/utils}/index.d.ts +0 -0
  114. /package/{utils → cjs/utils}/index.js +0 -0
  115. /package/{utils → cjs/utils}/schema-util.d.ts +0 -0
  116. /package/{utils → cjs/utils}/schema-util.js +0 -0
  117. /package/{weaver-client.d.ts → cjs/weaver-client.d.ts} +0 -0
@@ -0,0 +1,122 @@
1
+ import fs from 'node:fs';
2
+ import fsp from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import prettier from 'prettier';
5
+ import { InvalidArgumentError, InvalidOptionArgumentError } from 'commander';
6
+ import { generateClient, generateTypes } from '../generators/index.js';
7
+ import { readSchemaContent, toSchemaObject } from '../utils/index.js';
8
+ import { FRAMEWORKS } from '../constants.js';
9
+ export function generateCommand(program) {
10
+ program
11
+ .command('generate')
12
+ .alias('g')
13
+ .description('Generates types and client class.')
14
+ .argument('<schemaPath>', 'The path to the OpenAPI schema (file or URL)', parseSchema)
15
+ .option('--outputPath [path]', 'Output path for both generated types and client class.', './generated/client.ts')
16
+ .option('--typesPath [path]', 'Output path for generated types. (default: output path)')
17
+ .option('--clientPath [path]', 'Output path for generated client class. (default: output path)')
18
+ .option('--clientName [name]', 'Name for generated client class. (default: OpenAPI schema title)')
19
+ .option('--framework [name]', `The framework for generated client class (${FRAMEWORKS.join(', ')})`, parseFramework, 'fetch')
20
+ .option('--typesOnly', 'Generate TypeScript types only (without client class).')
21
+ .option('--clientOnly', 'Generate only client class (without TypeScript types).')
22
+ .option('--noTypes', 'Generate client class without TypeScript type support.')
23
+ .action(async (schemaPath, _, command) => {
24
+ const outputPath = command.getOptionValue('outputPath');
25
+ const typesPath = command.getOptionValue('typesPath') || outputPath;
26
+ const clientPath = command.getOptionValue('clientPath') || outputPath;
27
+ const clientName = command.getOptionValue('clientName');
28
+ const framework = command.getOptionValue('framework');
29
+ const typesOnly = command.getOptionValue('typesOnly');
30
+ const clientOnly = command.getOptionValue('clientOnly');
31
+ const noTypes = command.getOptionValue('noTypes');
32
+ const cwd = process.cwd();
33
+ const schemaContent = await readSchemaContent(schemaPath);
34
+ const schemaObject = await toSchemaObject(schemaContent);
35
+ if (!clientOnly && !noTypes) {
36
+ const typesContent = await generateTypes(schemaObject);
37
+ await formatAndWriteFile(typesPath, typesContent, typesOnly || typesPath !== clientPath);
38
+ console.log(`Generated types to ${path.relative(cwd, typesPath)}`);
39
+ }
40
+ if (!typesOnly) {
41
+ const typesImportPath = typesPath === clientPath
42
+ ? undefined
43
+ : relativePathFrom(clientPath, typesPath);
44
+ const clientContent = await generateClient(schemaObject, clientName, framework, typesImportPath, noTypes);
45
+ await formatAndWriteFile(clientPath, clientContent, true, typesPath === clientPath);
46
+ console.log(`Generated client to ${path.relative(cwd, clientPath)}`);
47
+ }
48
+ });
49
+ }
50
+ async function formatAndWriteFile(filePath, content, addGeneratedComment = true, appendIfExists = false) {
51
+ const dirPath = path.resolve(path.dirname(filePath));
52
+ const dirExists = await pathExists(dirPath);
53
+ if (!dirExists) {
54
+ await fsp.mkdir(dirPath, { recursive: true });
55
+ }
56
+ const prettierConfig = await prettier.resolveConfig(filePath);
57
+ let formattedContent = await prettier.format(content, {
58
+ ...(prettierConfig ?? { singleQuote: true, trailingComma: 'none' }),
59
+ filepath: filePath
60
+ });
61
+ const fileExists = await pathExists(filePath);
62
+ if (appendIfExists && fileExists) {
63
+ const existingContent = await fsp.readFile(filePath, 'utf8');
64
+ formattedContent = formattedContent + '\n' + existingContent;
65
+ }
66
+ if (addGeneratedComment) {
67
+ formattedContent =
68
+ '// Generated by Appweaver. Please do not edit this file manually.\n\n' +
69
+ formattedContent;
70
+ }
71
+ await fsp.writeFile(filePath, formattedContent, 'utf8');
72
+ }
73
+ async function pathExists(filePath) {
74
+ try {
75
+ await fsp.access(filePath, fsp.constants.F_OK);
76
+ return true;
77
+ }
78
+ catch (e) {
79
+ return false;
80
+ }
81
+ }
82
+ export function relativePathFrom(firstPath, otherPath) {
83
+ const firstDir = path.dirname(path.resolve(firstPath));
84
+ const otherAbs = path.resolve(otherPath);
85
+ let rel = path.relative(firstDir, otherAbs);
86
+ if (!rel.startsWith('.') && rel !== '') {
87
+ rel = `.${path.sep}${rel}`;
88
+ }
89
+ else if (rel === '') {
90
+ rel = '.';
91
+ }
92
+ if (rel.endsWith('.ts')) {
93
+ rel = rel.replace('.d.ts', '.ts').replace('.ts', '');
94
+ }
95
+ return rel.replace(/\\/g, '/');
96
+ }
97
+ function parseSchema(value) {
98
+ let schemaUrl;
99
+ try {
100
+ schemaUrl = new URL(value);
101
+ }
102
+ catch {
103
+ // Schema path is not in URL format
104
+ }
105
+ if (schemaUrl) {
106
+ if (!['http:', 'https:', 'file:'].includes(schemaUrl.protocol)) {
107
+ throw new InvalidArgumentError(`Unsupported schema URL protocol: ${schemaUrl.protocol}`);
108
+ }
109
+ return value;
110
+ }
111
+ if (!fs.existsSync(value)) {
112
+ throw new InvalidArgumentError(`Schema path "${value}" does not exist or is not a valid URL.`);
113
+ }
114
+ return value;
115
+ }
116
+ function parseFramework(value) {
117
+ const lowerFramework = value.toLowerCase();
118
+ if (!FRAMEWORKS.includes(lowerFramework)) {
119
+ throw new InvalidOptionArgumentError(`Must be one of following: ${FRAMEWORKS.join(', ')}.`);
120
+ }
121
+ return lowerFramework;
122
+ }
@@ -0,0 +1 @@
1
+ export * from './generate-command.js';
@@ -0,0 +1 @@
1
+ export * from './generate-command.js';
@@ -0,0 +1,67 @@
1
+ /** Supported frameworks for generating the client class. */
2
+ export declare const FRAMEWORKS: readonly ["fetch", "angular"];
3
+ /** Custom OpenAPI extension key used for extracting route prefixes and base paths to their resources. */
4
+ export declare const CONFIG_FIELD = "x-appweaver-config";
5
+ /** Custom OpenAPI extension key used for extracting resources names from schema CRUD objects. */
6
+ export declare const CONFIG_RESOURCE_FIELD = "x-appweaver-resource";
7
+ /** Suffix used when generating the TypeScript module type name for a resource. */
8
+ export declare const RESOURCE_MODULE_TYPE = "ResourceModuleType";
9
+ /** Maps CRUD operation names to HTTP methods used for matching OpenAPI paths to `ResourceClient` methods. */
10
+ export declare const RESOURCE_OPERATIONS: {
11
+ readonly find: "get";
12
+ readonly query: "post";
13
+ readonly aggregate: "post";
14
+ readonly create: "post";
15
+ readonly update: "put";
16
+ readonly delete: "delete";
17
+ readonly export: "post";
18
+ readonly uploadFiles: "post";
19
+ readonly deleteFiles: "post";
20
+ };
21
+ /** Expected type keys for a resource used for type inference. */
22
+ export declare const RESOURCE_TYPES: readonly ["single", "multiple", "create", "update", "queryRequest", "queryResponse", "aggregateRequest", "aggregateResponse", "exportRequest", "files", "fileUpload", "fileDelete"];
23
+ /** Type name used when generating the TypeScript module type for the auth module. */
24
+ export declare const AUTH_MODULE_TYPE = "AuthModuleType";
25
+ /** Maps auth operation names to HTTP methods used for matchingOpenAPI paths to `AuthClient` methods.
26
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
27
+ export declare const AUTH_OPERATIONS: {
28
+ readonly login: "post";
29
+ readonly logout: "post";
30
+ readonly refresh: "post";
31
+ readonly changePassword: "post";
32
+ readonly exchangeToken: "post";
33
+ readonly me: "get";
34
+ };
35
+ /** Expected type keys for the auth module used for type safety. */
36
+ export declare const AUTH_TYPES: readonly ["loginRequest", "authenticationResponse", "logoutResponse", "changePasswordRequest", "exchangeTokenRequest", "identity"];
37
+ /** Type name used when generating the TypeScript module type for the account module. */
38
+ export declare const ACCOUNT_MODULE_TYPE = "AccountModuleType";
39
+ /** Maps account operation names to HTTP methods used for matching OpenAPI paths to `AccountClient` methods.
40
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
41
+ export declare const ACCOUNT_OPERATIONS: {
42
+ readonly sendVerifyEmail: "post";
43
+ readonly verifyEmail: "post";
44
+ readonly verifyEmailRedirect: "get";
45
+ readonly sendResetPassword: "post";
46
+ readonly resetPassword: "post";
47
+ readonly send2FACode: "post";
48
+ readonly verify2FACode: "post";
49
+ };
50
+ /** Expected type keys for the account module which covers email verification, password reset, and 2FA req/resp. */
51
+ export declare const ACCOUNT_TYPES: readonly ["sendEmailVerificationRequest", "statusResponse", "emailVerificationRequest", "sendResetPasswordRequest", "resetPasswordRequest", "send2FACodeRequest", "send2FAResponse", "verify2FARequest", "verify2FAResponse"];
52
+ /** Type name used when generating the TypeScript module type for the health module. */
53
+ export declare const HEALTH_MODULE_TYPE = "HealthModuleType";
54
+ /** Maps health check operations to HTTP GET methods used for matching OpenAPI paths to `HealthClient` methods.
55
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
56
+ export declare const HEALTH_OPERATIONS: {
57
+ readonly check: "get";
58
+ readonly ready: "get";
59
+ };
60
+ /** Expected type keys for the health module used for `HealthClient` response typing. */
61
+ export declare const HEALTH_TYPES: readonly ["checkResponse", "readyResponse"];
62
+ /** Maps file-serving operations to HTTP GET methods used for identifying public and protected file endpoints.
63
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
64
+ export declare const FILE_OPERATIONS: {
65
+ readonly public: "get";
66
+ readonly protected: "get";
67
+ };
@@ -0,0 +1,94 @@
1
+ // CAUTION: The constants in this file should not be changed without good reason.
2
+ // They are typically only modified when changes occur in other Appweaver packages
3
+ // (such as core and common) to reflect new route paths or methods.
4
+ /** Supported frameworks for generating the client class. */
5
+ export const FRAMEWORKS = ['fetch', 'angular'];
6
+ /** Custom OpenAPI extension key used for extracting route prefixes and base paths to their resources. */
7
+ export const CONFIG_FIELD = 'x-appweaver-config';
8
+ /** Custom OpenAPI extension key used for extracting resources names from schema CRUD objects. */
9
+ export const CONFIG_RESOURCE_FIELD = 'x-appweaver-resource';
10
+ /** Suffix used when generating the TypeScript module type name for a resource. */
11
+ export const RESOURCE_MODULE_TYPE = 'ResourceModuleType';
12
+ /** Maps CRUD operation names to HTTP methods used for matching OpenAPI paths to `ResourceClient` methods. */
13
+ export const RESOURCE_OPERATIONS = {
14
+ find: 'get',
15
+ query: 'post',
16
+ aggregate: 'post',
17
+ create: 'post',
18
+ update: 'put',
19
+ delete: 'delete',
20
+ export: 'post',
21
+ uploadFiles: 'post',
22
+ deleteFiles: 'post'
23
+ };
24
+ /** Expected type keys for a resource used for type inference. */
25
+ export const RESOURCE_TYPES = [
26
+ 'single',
27
+ 'multiple',
28
+ 'create',
29
+ 'update',
30
+ 'queryRequest',
31
+ 'queryResponse',
32
+ 'aggregateRequest',
33
+ 'aggregateResponse',
34
+ 'exportRequest',
35
+ 'files',
36
+ 'fileUpload',
37
+ 'fileDelete'
38
+ ];
39
+ /** Type name used when generating the TypeScript module type for the auth module. */
40
+ export const AUTH_MODULE_TYPE = 'AuthModuleType';
41
+ /** Maps auth operation names to HTTP methods used for matchingOpenAPI paths to `AuthClient` methods.
42
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
43
+ export const AUTH_OPERATIONS = {
44
+ login: 'post',
45
+ logout: 'post',
46
+ refresh: 'post',
47
+ changePassword: 'post',
48
+ exchangeToken: 'post',
49
+ me: 'get'
50
+ };
51
+ /** Expected type keys for the auth module used for type safety. */
52
+ export const AUTH_TYPES = [
53
+ 'loginRequest',
54
+ 'authenticationResponse',
55
+ 'logoutResponse',
56
+ 'changePasswordRequest',
57
+ 'exchangeTokenRequest',
58
+ 'identity'
59
+ ];
60
+ /** Type name used when generating the TypeScript module type for the account module. */
61
+ export const ACCOUNT_MODULE_TYPE = 'AccountModuleType';
62
+ /** Maps account operation names to HTTP methods used for matching OpenAPI paths to `AccountClient` methods.
63
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
64
+ export const ACCOUNT_OPERATIONS = {
65
+ sendVerifyEmail: 'post',
66
+ verifyEmail: 'post',
67
+ verifyEmailRedirect: 'get',
68
+ sendResetPassword: 'post',
69
+ resetPassword: 'post',
70
+ send2FACode: 'post',
71
+ verify2FACode: 'post'
72
+ };
73
+ /** Expected type keys for the account module which covers email verification, password reset, and 2FA req/resp. */
74
+ export const ACCOUNT_TYPES = [
75
+ 'sendEmailVerificationRequest',
76
+ 'statusResponse',
77
+ 'emailVerificationRequest',
78
+ 'sendResetPasswordRequest',
79
+ 'resetPasswordRequest',
80
+ 'send2FACodeRequest',
81
+ 'send2FAResponse',
82
+ 'verify2FARequest',
83
+ 'verify2FAResponse'
84
+ ];
85
+ /** Type name used when generating the TypeScript module type for the health module. */
86
+ export const HEALTH_MODULE_TYPE = 'HealthModuleType';
87
+ /** Maps health check operations to HTTP GET methods used for matching OpenAPI paths to `HealthClient` methods.
88
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
89
+ export const HEALTH_OPERATIONS = { check: 'get', ready: 'get' };
90
+ /** Expected type keys for the health module used for `HealthClient` response typing. */
91
+ export const HEALTH_TYPES = ['checkResponse', 'readyResponse'];
92
+ /** Maps file-serving operations to HTTP GET methods used for identifying public and protected file endpoints.
93
+ * The operation names are matching the real API paths (without a prefix and in camelCase format) from the OpenAPI. */
94
+ export const FILE_OPERATIONS = { public: 'get', protected: 'get' };
@@ -0,0 +1,6 @@
1
+ export declare class ClientError extends Error {
2
+ errorCode: number;
3
+ response?: Response | undefined;
4
+ data?: any | undefined;
5
+ constructor(text: string, errorCode: number, response?: Response | undefined, data?: any | undefined);
6
+ }
@@ -0,0 +1,11 @@
1
+ export class ClientError extends Error {
2
+ errorCode;
3
+ response;
4
+ data;
5
+ constructor(text, errorCode, response, data) {
6
+ super(text);
7
+ this.errorCode = errorCode;
8
+ this.response = response;
9
+ this.data = data;
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ export * from './client-error.js';
@@ -0,0 +1 @@
1
+ export * from './client-error.js';
@@ -0,0 +1,16 @@
1
+ import { OpenAPI3 } from 'openapi-typescript';
2
+ import { FRAMEWORKS } from '../constants.js';
3
+ /**
4
+ * Generates a client class based on the provided OpenAPI schema and already generated types.
5
+ *
6
+ * @param {string | OpenAPI3} schema - The OpenAPI schema used to generate the client. Can be a string
7
+ * (URL or JSON/YAML) or an object.
8
+ * @param {string} [clientName] - Optional name of the client class name to be generated. (default: derived from OpenAPI
9
+ * title or WeaverClient if title is missing)
10
+ * @param {string} [framework='fetch'] - Optional framework for which to generate the client class.
11
+ * @param {string} [typesPath] - Optional path to the types module, for importing related type definitions.
12
+ * @param {boolean} [noTypes=false] - Optional flag to disable client class generic types, useful for environments
13
+ * without type support.
14
+ * @return {Promise<string>} A Promise that resolves to the generated client class as a string.
15
+ */
16
+ export declare function generateClient(schema: string | OpenAPI3, clientName?: string, framework?: (typeof FRAMEWORKS)[number], typesPath?: string, noTypes?: boolean): Promise<string>;