@povio/openapi-codegen-cli 2.0.8-rc.36 → 2.0.8-rc.38
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/dist/{generate.runner-52viWKLA.mjs → generate.runner-BNSPwk_e.mjs} +1 -1
- package/dist/{generateCodeFromOpenAPIDoc-WP1lRhb0.mjs → generateCodeFromOpenAPIDoc-CeqvxYG3.mjs} +102 -10
- package/dist/generator.mjs +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -1
- package/dist/sh.mjs +3 -3
- package/dist/vite.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Profiler, i as writeGenerateFileData, m as DEFAULT_GENERATE_OPTIONS, o as deepMerge, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-
|
|
1
|
+
import { S as Profiler, i as writeGenerateFileData, m as DEFAULT_GENERATE_OPTIONS, o as deepMerge, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-CeqvxYG3.mjs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
4
4
|
|
package/dist/{generateCodeFromOpenAPIDoc-WP1lRhb0.mjs → generateCodeFromOpenAPIDoc-CeqvxYG3.mjs}
RENAMED
|
@@ -3134,13 +3134,19 @@ function generateAcl({ resolver, data, tag }) {
|
|
|
3134
3134
|
});
|
|
3135
3135
|
if (!aclData) return;
|
|
3136
3136
|
const { hasAdditionalAbilityImports, modelsImports, endpoints } = aclData;
|
|
3137
|
+
const hasWorkspaceContext = endpoints.some((endpoint) => getWorkspaceConditionNames(resolver, endpoint).length > 0);
|
|
3137
3138
|
const caslAbilityTupleImport = {
|
|
3138
3139
|
bindings: [...hasAdditionalAbilityImports ? [CASL_ABILITY_BINDING.forcedSubject, CASL_ABILITY_BINDING.subject] : []],
|
|
3139
3140
|
typeBindings: [CASL_ABILITY_BINDING.abilityTuple],
|
|
3140
3141
|
from: CASL_ABILITY_IMPORT.from
|
|
3141
3142
|
};
|
|
3143
|
+
const workspaceContextImport = {
|
|
3144
|
+
bindings: ["useWorkspaceContext"],
|
|
3145
|
+
from: PACKAGE_IMPORT_PATH
|
|
3146
|
+
};
|
|
3142
3147
|
const lines = [];
|
|
3143
3148
|
lines.push(renderImport$4(caslAbilityTupleImport));
|
|
3149
|
+
if (hasWorkspaceContext) lines.push(renderImport$4(workspaceContextImport));
|
|
3144
3150
|
for (const modelsImport of modelsImports) lines.push(renderImport$4(modelsImport));
|
|
3145
3151
|
lines.push("");
|
|
3146
3152
|
if (resolver.options.tsNamespaces) lines.push(`export namespace ${getNamespaceName({
|
|
@@ -3149,7 +3155,10 @@ function generateAcl({ resolver, data, tag }) {
|
|
|
3149
3155
|
options: resolver.options
|
|
3150
3156
|
})} {`);
|
|
3151
3157
|
for (const endpoint of endpoints) {
|
|
3152
|
-
lines.push(renderAbilityFunction(
|
|
3158
|
+
lines.push(renderAbilityFunction({
|
|
3159
|
+
resolver,
|
|
3160
|
+
endpoint
|
|
3161
|
+
}));
|
|
3153
3162
|
lines.push("");
|
|
3154
3163
|
}
|
|
3155
3164
|
if (resolver.options.tsNamespaces) lines.push("}");
|
|
@@ -3188,7 +3197,42 @@ function renderImport$4(importData) {
|
|
|
3188
3197
|
const names = [...importData.defaultImport ? [importData.defaultImport] : [], ...namedImports.length > 0 ? [`{ ${namedImports.join(", ")} }`] : []].join(", ");
|
|
3189
3198
|
return `import${importData.typeOnly ? " type" : ""} ${names} from "${importData.from}";`;
|
|
3190
3199
|
}
|
|
3191
|
-
function
|
|
3200
|
+
function getWorkspaceContextAllowList$1(workspaceContext) {
|
|
3201
|
+
return new Set(workspaceContext);
|
|
3202
|
+
}
|
|
3203
|
+
function getWorkspaceConditionNames(resolver, endpoint) {
|
|
3204
|
+
const allowList = getWorkspaceContextAllowList$1(resolver.options.workspaceContext);
|
|
3205
|
+
return (getAbilityConditionsTypes(endpoint) ?? []).map((condition) => condition.name).filter((name) => allowList.has(name));
|
|
3206
|
+
}
|
|
3207
|
+
function renderWorkspaceAclHook({ resolver, endpoint }) {
|
|
3208
|
+
const abilityConditionsTypes = getAbilityConditionsTypes(endpoint) ?? [];
|
|
3209
|
+
const workspaceConditionNames = getWorkspaceConditionNames(resolver, endpoint);
|
|
3210
|
+
if (workspaceConditionNames.length === 0) return;
|
|
3211
|
+
const workspaceConditionNameSet = new Set(workspaceConditionNames);
|
|
3212
|
+
const objectRequired = abilityConditionsTypes.some((propertyType) => propertyType.required && !workspaceConditionNameSet.has(propertyType.name));
|
|
3213
|
+
const objectParams = abilityConditionsTypes.map((propertyType) => {
|
|
3214
|
+
const isWorkspaceCondition = workspaceConditionNameSet.has(propertyType.name);
|
|
3215
|
+
return `${propertyType.name}${propertyType.required && !isWorkspaceCondition ? "" : "?"}: ${(propertyType.type ?? "") + (propertyType.zodSchemaName ?? "")}, `;
|
|
3216
|
+
}).join("");
|
|
3217
|
+
const contextType = abilityConditionsTypes.filter((propertyType) => workspaceConditionNameSet.has(propertyType.name)).map((propertyType) => `${propertyType.name}?: ${(propertyType.type ?? "") + (propertyType.zodSchemaName ?? "")}`).join("; ");
|
|
3218
|
+
const contextBindings = workspaceConditionNames.map((name) => `${name}: ${name}Workspace`).join(", ");
|
|
3219
|
+
const lines = [];
|
|
3220
|
+
lines.push(`export const use${capitalize(getAbilityFunctionName(endpoint))} = (`);
|
|
3221
|
+
lines.push(` object${objectRequired ? "" : "?"}: { ${objectParams} } `);
|
|
3222
|
+
lines.push(") => {");
|
|
3223
|
+
lines.push(` const { ${contextBindings} } = useWorkspaceContext<{ ${contextType} }>();`);
|
|
3224
|
+
for (const conditionName of workspaceConditionNames) {
|
|
3225
|
+
const resolvedName = `normalize${capitalize(conditionName)}`;
|
|
3226
|
+
lines.push(` const ${resolvedName} = object?.${conditionName} ?? ${conditionName}Workspace;`);
|
|
3227
|
+
lines.push(` if (!${resolvedName}) {`);
|
|
3228
|
+
lines.push(` throw Error(\`${capitalize(conditionName)} not provided\`);`);
|
|
3229
|
+
lines.push(" }");
|
|
3230
|
+
}
|
|
3231
|
+
lines.push(` return ${getAbilityFunctionName(endpoint)}({ ...object, ${workspaceConditionNames.map((conditionName) => `${conditionName}: normalize${capitalize(conditionName)}`).join(", ")} });`);
|
|
3232
|
+
lines.push("};");
|
|
3233
|
+
return lines.join("\n");
|
|
3234
|
+
}
|
|
3235
|
+
function renderAbilityFunction({ resolver, endpoint }) {
|
|
3192
3236
|
const abilityConditionsTypes = getAbilityConditionsTypes(endpoint) ?? [];
|
|
3193
3237
|
const hasConditions = hasAbilityConditions(endpoint);
|
|
3194
3238
|
const lines = [];
|
|
@@ -3205,6 +3249,14 @@ function renderAbilityFunction(endpoint) {
|
|
|
3205
3249
|
lines.push(` "${getAbilityAction(endpoint)}",`);
|
|
3206
3250
|
lines.push(` ${hasConditions ? `object ? subject("${getAbilitySubject(endpoint)}", object) : "${getAbilitySubject(endpoint)}"` : `"${getAbilitySubject(endpoint)}"`}`);
|
|
3207
3251
|
lines.push(`] as ${CASL_ABILITY_BINDING.abilityTuple}<"${getAbilityAction(endpoint)}", ${getAbilitySubjectTypes(endpoint).join(" | ")}>;`);
|
|
3252
|
+
const workspaceAclHook = renderWorkspaceAclHook({
|
|
3253
|
+
resolver,
|
|
3254
|
+
endpoint
|
|
3255
|
+
});
|
|
3256
|
+
if (workspaceAclHook) {
|
|
3257
|
+
lines.push("");
|
|
3258
|
+
lines.push(workspaceAclHook);
|
|
3259
|
+
}
|
|
3208
3260
|
return lines.join("\n");
|
|
3209
3261
|
}
|
|
3210
3262
|
|
|
@@ -3979,7 +4031,7 @@ function generateQueries(params) {
|
|
|
3979
4031
|
};
|
|
3980
4032
|
const hasWorkspaceContext = resolver.options.workspaceContext && endpoints.some((endpoint) => getWorkspaceParamNames(resolver, endpoint).length > 0);
|
|
3981
4033
|
const workspaceContextImport = {
|
|
3982
|
-
bindings: ["
|
|
4034
|
+
bindings: ["useWorkspaceContext"],
|
|
3983
4035
|
from: PACKAGE_IMPORT_PATH
|
|
3984
4036
|
};
|
|
3985
4037
|
const endpointParams = endpoints.flatMap((endpoint) => endpoint.parameters);
|
|
@@ -4174,15 +4226,40 @@ function getWorkspaceParamNames(resolver, endpoint) {
|
|
|
4174
4226
|
return getUniqueArray([...workspaceParamNames, ...aclParamNames]).filter((name) => allowList.has(name));
|
|
4175
4227
|
}
|
|
4176
4228
|
function getWorkspaceParamReplacements(resolver, endpoint) {
|
|
4177
|
-
return Object.fromEntries(getWorkspaceParamNames(resolver, endpoint).map((name) => [name,
|
|
4229
|
+
return Object.fromEntries(getWorkspaceParamNames(resolver, endpoint).map((name) => [name, `normalize${capitalize(name)}`]));
|
|
4230
|
+
}
|
|
4231
|
+
function getWorkspaceParamTypes(resolver, endpoint, modelNamespaceTag) {
|
|
4232
|
+
const workspaceParamNames = new Set(getWorkspaceParamNames(resolver, endpoint));
|
|
4233
|
+
return Object.fromEntries(getEndpointParamMapping(resolver, endpoint, { modelNamespaceTag }).filter((param) => workspaceParamNames.has(param.name)).map((param) => [param.name, param.type]));
|
|
4178
4234
|
}
|
|
4179
|
-
function
|
|
4235
|
+
function renderWorkspaceContextDestructure({ replacements, paramTypes, indent }) {
|
|
4180
4236
|
const workspaceParamNames = Object.keys(replacements);
|
|
4181
4237
|
if (workspaceParamNames.length === 0) return [];
|
|
4182
|
-
const
|
|
4183
|
-
|
|
4238
|
+
const workspaceParamBindings = workspaceParamNames.map((paramName) => `${paramName}: ${paramName}Workspace`);
|
|
4239
|
+
const workspaceContextType = workspaceParamNames.map((paramName) => `${paramName}?: ${paramTypes[paramName] ?? "unknown"}`).join("; ");
|
|
4240
|
+
return [`${indent}const { ${workspaceParamBindings.join(", ")} } = useWorkspaceContext<{ ${workspaceContextType} }>();`];
|
|
4241
|
+
}
|
|
4242
|
+
function renderWorkspaceParamCoalescing({ replacements, indent }) {
|
|
4243
|
+
const workspaceParamNames = Object.keys(replacements);
|
|
4244
|
+
const lines = [];
|
|
4245
|
+
for (const paramName of workspaceParamNames) {
|
|
4246
|
+
lines.push(`${indent}const ${replacements[paramName]} = ${paramName} ?? ${paramName}Workspace;`);
|
|
4247
|
+
lines.push(`${indent}if (!${replacements[paramName]}) {`);
|
|
4248
|
+
lines.push(`${indent} throw Error(\`${capitalize(paramName)} not provided\`);`);
|
|
4249
|
+
lines.push(`${indent}}`);
|
|
4250
|
+
}
|
|
4184
4251
|
return lines;
|
|
4185
4252
|
}
|
|
4253
|
+
function renderWorkspaceParamResolutions({ replacements, paramTypes, indent }) {
|
|
4254
|
+
return [...renderWorkspaceContextDestructure({
|
|
4255
|
+
replacements,
|
|
4256
|
+
paramTypes,
|
|
4257
|
+
indent
|
|
4258
|
+
}), ...renderWorkspaceParamCoalescing({
|
|
4259
|
+
replacements,
|
|
4260
|
+
indent
|
|
4261
|
+
})];
|
|
4262
|
+
}
|
|
4186
4263
|
function renderAclCheckCall(resolver, endpoint, replacements, indent = "") {
|
|
4187
4264
|
const checkParams = getAbilityConditionsTypes(endpoint)?.map((condition) => invalidVariableNameCharactersToCamel(condition.name));
|
|
4188
4265
|
const paramNames = new Set(endpoint.parameters.map((param) => invalidVariableNameCharactersToCamel(param.name)));
|
|
@@ -4352,6 +4429,7 @@ function renderQuery({ resolver, endpoint, inlineEndpoints }) {
|
|
|
4352
4429
|
const hasAclCheck = resolver.options.checkAcl && endpoint.acl;
|
|
4353
4430
|
const tag = getEndpointTag(endpoint, resolver.options);
|
|
4354
4431
|
const workspaceParamReplacements = resolver.options.workspaceContext ? getWorkspaceParamReplacements(resolver, endpoint) : {};
|
|
4432
|
+
const workspaceParamTypes = getWorkspaceParamTypes(resolver, endpoint, tag);
|
|
4355
4433
|
const endpointArgs = renderEndpointArgs(resolver, endpoint, {});
|
|
4356
4434
|
const resolvedEndpointArgs = renderEndpointObjectArgs(resolver, endpoint, {}, workspaceParamReplacements);
|
|
4357
4435
|
const endpointParams = renderEndpointParams(resolver, endpoint, {
|
|
@@ -4372,6 +4450,7 @@ function renderQuery({ resolver, endpoint, inlineEndpoints }) {
|
|
|
4372
4450
|
if (hasAclCheck) lines.push(` const { checkAcl } = ${ACL_CHECK_HOOK}();`);
|
|
4373
4451
|
lines.push(...renderWorkspaceParamResolutions({
|
|
4374
4452
|
replacements: workspaceParamReplacements,
|
|
4453
|
+
paramTypes: workspaceParamTypes,
|
|
4375
4454
|
indent: " "
|
|
4376
4455
|
}));
|
|
4377
4456
|
lines.push(" ");
|
|
@@ -4395,6 +4474,7 @@ function renderMutation({ resolver, endpoint, inlineEndpoints, precomputed }) {
|
|
|
4395
4474
|
const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
|
|
4396
4475
|
const tag = getEndpointTag(endpoint, resolver.options);
|
|
4397
4476
|
const workspaceParamReplacements = resolver.options.workspaceContext ? getWorkspaceParamReplacements(resolver, endpoint) : {};
|
|
4477
|
+
const workspaceParamTypes = getWorkspaceParamTypes(resolver, endpoint, tag);
|
|
4398
4478
|
const endpointParams = renderEndpointParams(resolver, endpoint, {
|
|
4399
4479
|
includeFileParam: true,
|
|
4400
4480
|
optionalPathParams: resolver.options.workspaceContext,
|
|
@@ -4417,13 +4497,20 @@ function renderMutation({ resolver, endpoint, inlineEndpoints, precomputed }) {
|
|
|
4417
4497
|
lines.push(`export const ${getQueryName(endpoint, true)} = (options?: AppMutationOptions<typeof ${endpointFunction}, { ${mutationVariablesType} }>${hasMutationEffects ? ` & ${MUTATION_EFFECTS.optionsType}` : ""}${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => {`);
|
|
4418
4498
|
if (hasMutationDefaultOnError) lines.push(" const queryConfig = OpenApiQueryConfig.useConfig();");
|
|
4419
4499
|
if (hasAclCheck) lines.push(` const { checkAcl } = ${ACL_CHECK_HOOK}();`);
|
|
4420
|
-
|
|
4500
|
+
lines.push(...renderWorkspaceContextDestructure({
|
|
4501
|
+
replacements: workspaceParamReplacements,
|
|
4502
|
+
paramTypes: workspaceParamTypes,
|
|
4503
|
+
indent: " "
|
|
4504
|
+
}));
|
|
4421
4505
|
if (hasMutationEffects) lines.push(` const { runMutationEffects } = useMutationEffects<typeof ${QUERY_MODULE_ENUM}.${tag}>({ currentModule: ${QUERIES_MODULE_NAME} });`);
|
|
4422
4506
|
lines.push("");
|
|
4423
4507
|
lines.push(` return ${QUERY_HOOKS.mutation}({`);
|
|
4424
4508
|
const mutationFnArg = endpointParams ? `{ ${destructuredMutationArgs}${endpoint.mediaUpload ? `${destructuredMutationArgs ? ", " : ""}abortController, onUploadProgress` : ""} }` : "";
|
|
4425
4509
|
lines.push(` mutationFn: ${endpoint.mediaUpload ? "async " : ""}(${mutationFnArg}) => ${hasMutationFnBody ? "{ " : ""}`);
|
|
4426
|
-
|
|
4510
|
+
lines.push(...renderWorkspaceParamCoalescing({
|
|
4511
|
+
replacements: workspaceParamReplacements,
|
|
4512
|
+
indent: " "
|
|
4513
|
+
}));
|
|
4427
4514
|
if (hasAclCheck) lines.push(renderAclCheckCall(resolver, endpoint, workspaceParamReplacements, " "));
|
|
4428
4515
|
if (endpoint.mediaUpload) {
|
|
4429
4516
|
lines.push(` const uploadInstructions = await ${endpointFunction}(${resolvedEndpointArgs}${hasAxiosRequestConfig ? `${resolvedEndpointArgs ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""});`);
|
|
@@ -4461,7 +4548,10 @@ function renderMutation({ resolver, endpoint, inlineEndpoints, precomputed }) {
|
|
|
4461
4548
|
lines.push(" onSuccess: async (resData, variables, onMutateResult, context) => {");
|
|
4462
4549
|
if (updateQueryEndpoints.length > 0) {
|
|
4463
4550
|
if (destructuredVariables.length > 0) lines.push(` const { ${destructuredVariables.join(", ")} } = variables;`);
|
|
4464
|
-
|
|
4551
|
+
lines.push(...renderWorkspaceParamCoalescing({
|
|
4552
|
+
replacements: workspaceParamReplacements,
|
|
4553
|
+
indent: " "
|
|
4554
|
+
}));
|
|
4465
4555
|
lines.push(` const updateKeys = [${updateQueryEndpoints.map((e) => `keys.${getEndpointName(e)}(${renderEndpointArgs(resolver, e, { includeOnlyRequiredParams: true }, workspaceParamReplacements)})`).join(", ")}];`);
|
|
4466
4556
|
lines.push(` await runMutationEffects(resData, variables, options, updateKeys);`);
|
|
4467
4557
|
} else lines.push(" await runMutationEffects(resData, variables, options);");
|
|
@@ -4514,6 +4604,7 @@ function renderInfiniteQuery({ resolver, endpoint, inlineEndpoints }) {
|
|
|
4514
4604
|
const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
|
|
4515
4605
|
const tag = getEndpointTag(endpoint, resolver.options);
|
|
4516
4606
|
const workspaceParamReplacements = resolver.options.workspaceContext ? getWorkspaceParamReplacements(resolver, endpoint) : {};
|
|
4607
|
+
const workspaceParamTypes = getWorkspaceParamTypes(resolver, endpoint, tag);
|
|
4517
4608
|
const endpointParams = renderEndpointParams(resolver, endpoint, {
|
|
4518
4609
|
excludePageParam: true,
|
|
4519
4610
|
optionalPathParams: resolver.options.workspaceContext,
|
|
@@ -4535,6 +4626,7 @@ function renderInfiniteQuery({ resolver, endpoint, inlineEndpoints }) {
|
|
|
4535
4626
|
if (hasAclCheck) lines.push(` const { checkAcl } = ${ACL_CHECK_HOOK}();`);
|
|
4536
4627
|
lines.push(...renderWorkspaceParamResolutions({
|
|
4537
4628
|
replacements: workspaceParamReplacements,
|
|
4629
|
+
paramTypes: workspaceParamTypes,
|
|
4538
4630
|
indent: " "
|
|
4539
4631
|
}));
|
|
4540
4632
|
lines.push("");
|
package/dist/generator.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDataFromOpenAPIDoc, b as invalidVariableNameCharactersToCamel, c as isQuery, f as getTagImportPath, g as GenerateType, h as getNamespaceName, l as getSchemaTsMetaType, m as DEFAULT_GENERATE_OPTIONS, p as getQueryName, s as isMutation, t as generateCodeFromOpenAPIDoc, u as getTsTypeBase, v as isMediaTypeAllowed, x as formatTag, y as isParamMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-
|
|
1
|
+
import { a as getDataFromOpenAPIDoc, b as invalidVariableNameCharactersToCamel, c as isQuery, f as getTagImportPath, g as GenerateType, h as getNamespaceName, l as getSchemaTsMetaType, m as DEFAULT_GENERATE_OPTIONS, p as getQueryName, s as isMutation, t as generateCodeFromOpenAPIDoc, u as getTsTypeBase, v as isMediaTypeAllowed, x as formatTag, y as isParamMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-CeqvxYG3.mjs";
|
|
2
2
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/core/getMetadataFromOpenAPIDoc.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -145,9 +145,10 @@ declare namespace OpenApiWorkspaceContext {
|
|
|
145
145
|
values,
|
|
146
146
|
children
|
|
147
147
|
}: PropsWithChildren<WorkspaceProviderProps>) => react_jsx_runtime0.JSX.Element;
|
|
148
|
-
const useContext: () =>
|
|
148
|
+
const useContext: <TValues extends WorkspaceValues = WorkspaceValues>() => TValues;
|
|
149
149
|
const resolveParam: <T>(context: WorkspaceValues, name: string, value: T | null | undefined) => T;
|
|
150
150
|
}
|
|
151
|
+
declare const useWorkspaceContext: <TValues extends WorkspaceValues = WorkspaceValues>() => TValues;
|
|
151
152
|
//#endregion
|
|
152
153
|
//#region src/lib/config/i18n.d.ts
|
|
153
154
|
declare const ns = "openapi";
|
|
@@ -227,4 +228,4 @@ declare const AuthGuard: ({
|
|
|
227
228
|
children
|
|
228
229
|
}: PropsWithChildren<AuthGuardProps>) => react.ReactNode;
|
|
229
230
|
//#endregion
|
|
230
|
-
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, ApplicationException, AuthContext, AuthGuard, type AuthGuardProps, type ErrorEntry, ErrorHandler, type ErrorHandlerOptions, type GeneralErrorCodes, type RestClient as IRestClient, type InvalidationMap, type InvalidationMapFunc, type MutationEffectsOptions, OpenAPICodegenConfig, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, type QueryModule, type RequestConfig, type RequestInfo, type Response, RestClient$1 as RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects };
|
|
231
|
+
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, ApplicationException, AuthContext, AuthGuard, type AuthGuardProps, type ErrorEntry, ErrorHandler, type ErrorHandlerOptions, type GeneralErrorCodes, type RestClient as IRestClient, type InvalidationMap, type InvalidationMapFunc, type MutationEffectsOptions, OpenAPICodegenConfig, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, type QueryModule, type RequestConfig, type RequestInfo, type Response, RestClient$1 as RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects, useWorkspaceContext };
|
package/dist/index.mjs
CHANGED
|
@@ -226,6 +226,7 @@ let OpenApiWorkspaceContext;
|
|
|
226
226
|
return workspaceValue;
|
|
227
227
|
};
|
|
228
228
|
})(OpenApiWorkspaceContext || (OpenApiWorkspaceContext = {}));
|
|
229
|
+
const useWorkspaceContext = () => OpenApiWorkspaceContext.useContext();
|
|
229
230
|
|
|
230
231
|
//#endregion
|
|
231
232
|
//#region src/lib/auth/AuthGuard.tsx
|
|
@@ -249,4 +250,4 @@ const AuthGuard = ({ type, redirectTo, children }) => {
|
|
|
249
250
|
};
|
|
250
251
|
|
|
251
252
|
//#endregion
|
|
252
|
-
export { ApplicationException, AuthContext, AuthGuard, ErrorHandler, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects };
|
|
253
|
+
export { ApplicationException, AuthContext, AuthGuard, ErrorHandler, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects, useWorkspaceContext };
|
package/dist/sh.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as VALIDATION_ERROR_TYPE_TITLE, S as Profiler, _ as groupByType, a as getDataFromOpenAPIDoc, d as getTagFileName, g as GenerateType, n as getOutputFileName } from "./generateCodeFromOpenAPIDoc-
|
|
3
|
-
import { n as resolveConfig, t as runGenerate } from "./generate.runner-
|
|
2
|
+
import { C as VALIDATION_ERROR_TYPE_TITLE, S as Profiler, _ as groupByType, a as getDataFromOpenAPIDoc, d as getTagFileName, g as GenerateType, n as getOutputFileName } from "./generateCodeFromOpenAPIDoc-CeqvxYG3.mjs";
|
|
3
|
+
import { n as resolveConfig, t as runGenerate } from "./generate.runner-BNSPwk_e.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import yargs from "yargs";
|
|
6
6
|
import { hideBin } from "yargs/helpers";
|
|
@@ -39,7 +39,7 @@ function logBanner(message) {
|
|
|
39
39
|
* Fetch the version from package.json
|
|
40
40
|
*/
|
|
41
41
|
function getVersion() {
|
|
42
|
-
return "2.0.8-rc.
|
|
42
|
+
return "2.0.8-rc.38";
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
//#endregion
|
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Profiler } from "./generateCodeFromOpenAPIDoc-
|
|
2
|
-
import { t as runGenerate } from "./generate.runner-
|
|
1
|
+
import { S as Profiler } from "./generateCodeFromOpenAPIDoc-CeqvxYG3.mjs";
|
|
2
|
+
import { t as runGenerate } from "./generate.runner-BNSPwk_e.mjs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
|
|
5
5
|
//#region src/vite/openapi-codegen.plugin.ts
|