@bitstack/ng-query-codegen-openapi 0.0.32 → 0.0.34

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.
@@ -37,7 +37,7 @@ export function generateRtkQueryFile(
37
37
  /**
38
38
  * ${info.summary}
39
39
  */
40
- ${info.operationName}Query(args: IRestFulEndpointsQueryReturn<${info.argTypeName}>): QueryResponse<${info.responseTypeName}> {
40
+ ${info.operationName}Query(args: IRestFulEndpointsQueryReturn<${info.argTypeName}>): Observable<QueryState<${info.responseTypeName}>> {
41
41
  return this.ntkQuery.query<${info.responseTypeName}, ${!info.isVoidArg ? `IRestFulEndpointsQueryReturn<${info.argTypeName}>` : 'void'}>({
42
42
  queryKey: [ECacheTagTypes.${info.queryKeyName}${!info.isVoidArg ? ', args.variables' : ''}],
43
43
  queryFn: () => {
@@ -45,7 +45,7 @@ export function generateRtkQueryFile(
45
45
  },
46
46
  fetchOptions: args?.fetchOptions,
47
47
  config: args?.config,
48
- }, ${!info.isVoidArg ? 'args' : undefined});
48
+ })(${!info.isVoidArg ? 'args' : ''});
49
49
  }`
50
50
  )
51
51
  .join('');
@@ -103,7 +103,7 @@ export function generateRtkQueryFile(
103
103
  import {Injectable, inject} from '@angular/core';
104
104
  import {Observable} from 'rxjs';
105
105
  import {HttpErrorResponse} from '@angular/common/http';
106
- import {NtkQueryService, MutationState, QueryState, QueryResponse, MutationResponse} from '@core/ntk-query';
106
+ import {NtkQueryService, MutationState, QueryState, MutationResponse} from '@core/ntk-query';
107
107
  import {ECacheTagTypes} from '../tagTypes';
108
108
  import {${apiServiceName}} from './enhanceEndpoints';
109
109
  import {IRestFulEndpointsQueryReturn, RequestOptions} from '../common-types';
@@ -364,7 +364,10 @@ export class UnifiedCodeGenerator {
364
364
  * 生成主 index.ts 檔案
365
365
  */
366
366
  private generateMainIndex(generatedGroups: string[]): string {
367
- const exports = generatedGroups.map((groupKey) => `export * from "./${groupKey}";`).join('\n');
367
+ const exports = generatedGroups
368
+ .map((groupKey) => `export * from "./${groupKey}";`)
369
+ .concat('\nexport * from "./tagTypes";')
370
+ .join('\n');
368
371
 
369
372
  return `/* eslint-disable */
370
373
  // [Warning] Generated automatically - do not edit manually