mobx-tanstack-query-api 0.0.78 → 0.0.79
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/codegen/index.js
CHANGED
|
@@ -309,7 +309,7 @@ export * as ${exportGroupName} from './endpoints';
|
|
|
309
309
|
}
|
|
310
310
|
// #endregion
|
|
311
311
|
}
|
|
312
|
-
const metaInfo = (namespace ?? nonEmptyGroups.size > 0)
|
|
312
|
+
const metaInfo = (namespace ?? (nonEmptyGroups.size > 0 || tagsSet.size > 0))
|
|
313
313
|
? {
|
|
314
314
|
namespace,
|
|
315
315
|
groupNames: [...nonEmptyGroups.values()],
|
|
@@ -8,5 +8,5 @@ export interface MetaInfoTmplParams {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const formatGroupNameEnumKey: (groupName: string, { _ }: CodegenDataUtils) => Capitalize<string>;
|
|
10
10
|
export declare const formatTagNameEnumKey: (tagName: string, utils: CodegenDataUtils) => Capitalize<string>;
|
|
11
|
-
export declare const metaInfoTmpl: ({ metaInfo, utils, formatTSContent, codegenParams, }: MetaInfoTmplParams) => Promise<string>;
|
|
11
|
+
export declare const metaInfoTmpl: ({ metaInfo, utils, formatTSContent, codegenParams, ...other }: MetaInfoTmplParams) => Promise<string>;
|
|
12
12
|
//# sourceMappingURL=meta-info.tmpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta-info.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/meta-info.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"meta-info.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/meta-info.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,QAAQ,EACT,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,aAAa,EAAE,sBAAsB,CAAC;IACtC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,eAAO,MAAM,sBAAsB,GACjC,WAAW,MAAM,EACjB,OAAO,gBAAgB,uBACgB,CAAC;AAE1C,eAAO,MAAM,oBAAoB,GAC/B,SAAS,MAAM,EACf,OAAO,gBAAgB,uBACkB,CAAC;AAE5C,eAAO,MAAM,YAAY,GAAU,+DAMhC,kBAAkB,oBAsCpB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { LINTERS_IGNORE } from './constants.js';
|
|
2
2
|
export const formatGroupNameEnumKey = (groupName, { _ }) => _.upperFirst(_.camelCase(groupName));
|
|
3
3
|
export const formatTagNameEnumKey = (tagName, utils) => formatGroupNameEnumKey(tagName, utils);
|
|
4
|
-
export const metaInfoTmpl = async ({ metaInfo, utils, formatTSContent, codegenParams, }) => {
|
|
4
|
+
export const metaInfoTmpl = async ({ metaInfo, utils, formatTSContent, codegenParams, ...other }) => {
|
|
5
|
+
const tagsMap = new Map(other.configuration?.apiConfig?.tags?.map((it) => [
|
|
6
|
+
it.name,
|
|
7
|
+
it,
|
|
8
|
+
]));
|
|
5
9
|
return await formatTSContent(`${LINTERS_IGNORE}
|
|
6
10
|
${[
|
|
7
11
|
metaInfo?.namespace && `export const namespace = "${metaInfo?.namespace}";`,
|
|
@@ -14,7 +18,17 @@ export const enum Group {
|
|
|
14
18
|
metaInfo?.tags?.length &&
|
|
15
19
|
`
|
|
16
20
|
export const enum Tag {
|
|
17
|
-
${metaInfo?.tags
|
|
21
|
+
${metaInfo?.tags
|
|
22
|
+
.map((tagName) => {
|
|
23
|
+
const tagData = tagsMap.get(tagName);
|
|
24
|
+
return [
|
|
25
|
+
tagData?.description && `/** ${tagData.description} */`,
|
|
26
|
+
`${formatTagNameEnumKey(tagName, utils)} = "${codegenParams.transforms?.tagEnumValue?.(tagName) ?? tagName}"`,
|
|
27
|
+
]
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.join('\n');
|
|
30
|
+
})
|
|
31
|
+
.join(',\n')}
|
|
18
32
|
}
|
|
19
33
|
`,
|
|
20
34
|
]
|