mobx-tanstack-query-api 0.16.0 → 0.17.1

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 (169) hide show
  1. package/builtin/index.cjs +26 -0
  2. package/builtin/index.d.cts +5 -0
  3. package/builtin/index.d.cts.map +1 -0
  4. package/builtin/index.d.ts +2 -2
  5. package/builtin/index.d.ts.map +1 -1
  6. package/builtin/index.js +2 -2
  7. package/cli/bin.cjs +17 -0
  8. package/cli/bin.d.cts +2 -0
  9. package/cli/bin.d.cts.map +1 -0
  10. package/cli/bin.js +4 -4
  11. package/cli/index.cjs +18 -0
  12. package/cli/index.d.cts +3 -0
  13. package/cli/index.d.cts.map +1 -0
  14. package/cli/index.d.ts +2 -1
  15. package/cli/index.d.ts.map +1 -1
  16. package/cli/index.js +2 -1
  17. package/cli/utils/define-config.cjs +9 -0
  18. package/cli/utils/define-config.d.cts +4 -0
  19. package/cli/utils/define-config.d.cts.map +1 -0
  20. package/cli/utils/define-config.d.ts +1 -1
  21. package/cli/utils/define-config.d.ts.map +1 -1
  22. package/cli/utils/exec-config-path.cjs +16 -0
  23. package/cli/utils/exec-config-path.d.cts +2 -0
  24. package/cli/utils/exec-config-path.d.cts.map +1 -0
  25. package/cli/utils/resolve-config-path.cjs +65 -0
  26. package/cli/utils/resolve-config-path.d.cts +3 -0
  27. package/cli/utils/resolve-config-path.d.cts.map +1 -0
  28. package/codegen/index.cjs +488 -0
  29. package/codegen/index.d.cts +167 -0
  30. package/codegen/index.d.cts.map +1 -0
  31. package/codegen/index.d.ts +1 -1
  32. package/codegen/index.d.ts.map +1 -1
  33. package/codegen/index.js +9 -9
  34. package/codegen/templates/all-endpoints-per-file.tmpl.cjs +99 -0
  35. package/codegen/templates/all-endpoints-per-file.tmpl.d.cts +18 -0
  36. package/codegen/templates/all-endpoints-per-file.tmpl.d.cts.map +1 -0
  37. package/codegen/templates/all-endpoints-per-file.tmpl.d.ts +1 -1
  38. package/codegen/templates/all-endpoints-per-file.tmpl.d.ts.map +1 -1
  39. package/codegen/templates/all-endpoints-per-file.tmpl.js +4 -4
  40. package/codegen/templates/all-exports.tmpl.cjs +14 -0
  41. package/codegen/templates/all-exports.tmpl.d.cts +11 -0
  42. package/codegen/templates/all-exports.tmpl.d.cts.map +1 -0
  43. package/codegen/templates/all-exports.tmpl.d.ts +1 -1
  44. package/codegen/templates/all-exports.tmpl.d.ts.map +1 -1
  45. package/codegen/templates/all-exports.tmpl.js +1 -1
  46. package/codegen/templates/constants.cjs +5 -0
  47. package/codegen/templates/constants.d.cts +2 -0
  48. package/codegen/templates/constants.d.cts.map +1 -0
  49. package/codegen/templates/data-contract.tmpl.cjs +49 -0
  50. package/codegen/templates/data-contract.tmpl.d.cts +8 -0
  51. package/codegen/templates/data-contract.tmpl.d.cts.map +1 -0
  52. package/codegen/templates/data-contracts-file.tmpl.cjs +27 -0
  53. package/codegen/templates/data-contracts-file.tmpl.d.cts +10 -0
  54. package/codegen/templates/data-contracts-file.tmpl.d.cts.map +1 -0
  55. package/codegen/templates/data-contracts-file.tmpl.d.ts +1 -1
  56. package/codegen/templates/data-contracts-file.tmpl.d.ts.map +1 -1
  57. package/codegen/templates/data-contracts-file.tmpl.js +2 -2
  58. package/codegen/templates/endpoint-jsdoc.tmpl.cjs +110 -0
  59. package/codegen/templates/endpoint-jsdoc.tmpl.d.cts +10 -0
  60. package/codegen/templates/endpoint-jsdoc.tmpl.d.cts.map +1 -0
  61. package/codegen/templates/endpoint-jsdoc.tmpl.d.ts +1 -1
  62. package/codegen/templates/endpoint-jsdoc.tmpl.d.ts.map +1 -1
  63. package/codegen/templates/endpoint-per-file.tmpl.cjs +90 -0
  64. package/codegen/templates/endpoint-per-file.tmpl.d.cts +18 -0
  65. package/codegen/templates/endpoint-per-file.tmpl.d.cts.map +1 -0
  66. package/codegen/templates/endpoint-per-file.tmpl.d.ts +1 -1
  67. package/codegen/templates/endpoint-per-file.tmpl.d.ts.map +1 -1
  68. package/codegen/templates/endpoint-per-file.tmpl.js +4 -4
  69. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.cjs +10 -0
  70. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts +10 -0
  71. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts.map +1 -0
  72. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts +1 -1
  73. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts.map +1 -1
  74. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.js +1 -1
  75. package/codegen/templates/meta-info.tmpl.cjs +48 -0
  76. package/codegen/templates/meta-info.tmpl.d.cts +12 -0
  77. package/codegen/templates/meta-info.tmpl.d.cts.map +1 -0
  78. package/codegen/templates/meta-info.tmpl.d.ts +1 -1
  79. package/codegen/templates/meta-info.tmpl.d.ts.map +1 -1
  80. package/codegen/templates/meta-info.tmpl.js +1 -1
  81. package/codegen/templates/new-endpoint.tmpl.cjs +178 -0
  82. package/codegen/templates/new-endpoint.tmpl.d.cts +21 -0
  83. package/codegen/templates/new-endpoint.tmpl.d.cts.map +1 -0
  84. package/codegen/templates/new-endpoint.tmpl.d.ts +1 -1
  85. package/codegen/templates/new-endpoint.tmpl.d.ts.map +1 -1
  86. package/codegen/templates/new-endpoint.tmpl.js +1 -1
  87. package/codegen/utils/remove-unused-types.cjs +117 -0
  88. package/codegen/utils/remove-unused-types.d.cts +7 -0
  89. package/codegen/utils/remove-unused-types.d.cts.map +1 -0
  90. package/codegen/utils/remove-unused-types.d.ts +1 -1
  91. package/codegen/utils/remove-unused-types.d.ts.map +1 -1
  92. package/codegen/utils/remove-unused-types.js +1 -1
  93. package/codegen/utils/unpack-filter-option.cjs +20 -0
  94. package/codegen/utils/unpack-filter-option.d.cts +4 -0
  95. package/codegen/utils/unpack-filter-option.d.cts.map +1 -0
  96. package/codegen/utils/unpack-filter-option.d.ts +1 -1
  97. package/codegen/utils/unpack-filter-option.d.ts.map +1 -1
  98. package/index.cjs +18 -0
  99. package/index.d.cts +3 -0
  100. package/index.d.cts.map +1 -0
  101. package/index.d.ts +1 -1
  102. package/index.d.ts.map +1 -1
  103. package/index.js +1 -1
  104. package/package.json +29 -147
  105. package/runtime/endpoint-infinite-query.cjs +101 -0
  106. package/runtime/endpoint-infinite-query.d.cts +17 -0
  107. package/runtime/endpoint-infinite-query.d.cts.map +1 -0
  108. package/runtime/endpoint-infinite-query.d.ts +3 -3
  109. package/runtime/endpoint-infinite-query.d.ts.map +1 -1
  110. package/runtime/endpoint-infinite-query.js +1 -1
  111. package/runtime/endpoint-infinite-query.types.cjs +2 -0
  112. package/runtime/endpoint-infinite-query.types.d.cts +30 -0
  113. package/runtime/endpoint-infinite-query.types.d.cts.map +1 -0
  114. package/runtime/endpoint-infinite-query.types.d.ts +2 -2
  115. package/runtime/endpoint-infinite-query.types.d.ts.map +1 -1
  116. package/runtime/endpoint-mutation.cjs +73 -0
  117. package/runtime/endpoint-mutation.d.cts +13 -0
  118. package/runtime/endpoint-mutation.d.cts.map +1 -0
  119. package/runtime/endpoint-mutation.d.ts +3 -3
  120. package/runtime/endpoint-mutation.d.ts.map +1 -1
  121. package/runtime/endpoint-mutation.types.cjs +2 -0
  122. package/runtime/endpoint-mutation.types.d.cts +30 -0
  123. package/runtime/endpoint-mutation.types.d.cts.map +1 -0
  124. package/runtime/endpoint-mutation.types.d.ts +2 -2
  125. package/runtime/endpoint-mutation.types.d.ts.map +1 -1
  126. package/runtime/endpoint-query-client.cjs +79 -0
  127. package/runtime/endpoint-query-client.d.cts +13 -0
  128. package/runtime/endpoint-query-client.d.cts.map +1 -0
  129. package/runtime/endpoint-query-client.d.ts +1 -1
  130. package/runtime/endpoint-query-client.d.ts.map +1 -1
  131. package/runtime/endpoint-query-client.types.cjs +2 -0
  132. package/runtime/endpoint-query-client.types.d.cts +16 -0
  133. package/runtime/endpoint-query-client.types.d.cts.map +1 -0
  134. package/runtime/endpoint-query-client.types.d.ts +2 -2
  135. package/runtime/endpoint-query-client.types.d.ts.map +1 -1
  136. package/runtime/endpoint-query.cjs +213 -0
  137. package/runtime/endpoint-query.d.cts +29 -0
  138. package/runtime/endpoint-query.d.cts.map +1 -0
  139. package/runtime/endpoint-query.d.ts +3 -3
  140. package/runtime/endpoint-query.d.ts.map +1 -1
  141. package/runtime/endpoint-query.types.cjs +2 -0
  142. package/runtime/endpoint-query.types.d.cts +37 -0
  143. package/runtime/endpoint-query.types.d.cts.map +1 -0
  144. package/runtime/endpoint-query.types.d.ts +1 -1
  145. package/runtime/endpoint-query.types.d.ts.map +1 -1
  146. package/runtime/endpoint.cjs +128 -0
  147. package/runtime/endpoint.d.cts +69 -0
  148. package/runtime/endpoint.d.cts.map +1 -0
  149. package/runtime/endpoint.d.ts +9 -9
  150. package/runtime/endpoint.d.ts.map +1 -1
  151. package/runtime/endpoint.js +3 -3
  152. package/runtime/endpoint.types.cjs +2 -0
  153. package/runtime/endpoint.types.d.cts +23 -0
  154. package/runtime/endpoint.types.d.cts.map +1 -0
  155. package/runtime/endpoint.types.d.ts +3 -3
  156. package/runtime/endpoint.types.d.ts.map +1 -1
  157. package/runtime/http-client.cjs +208 -0
  158. package/runtime/http-client.d.cts +85 -0
  159. package/runtime/http-client.d.cts.map +1 -0
  160. package/runtime/index.cjs +25 -0
  161. package/runtime/index.d.cts +10 -0
  162. package/runtime/index.d.cts.map +1 -0
  163. package/runtime/index.d.ts +9 -9
  164. package/runtime/index.d.ts.map +1 -1
  165. package/runtime/index.js +9 -9
  166. package/assets/gh-repo-template.pxz +0 -0
  167. package/assets/logo.png +0 -0
  168. package/assets/logo.pxz +0 -0
  169. package/cli/bin.mjs +0 -15
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.http = exports.queryClient = void 0;
4
+ const endpoint_query_client_js_1 = require("../runtime/endpoint-query-client.cjs");
5
+ const http_client_js_1 = require("../runtime/http-client.cjs");
6
+ const MAX_FAILURE_COUNT = 3;
7
+ exports.queryClient = new endpoint_query_client_js_1.EndpointQueryClient({
8
+ defaultOptions: {
9
+ queries: {
10
+ throwOnError: true,
11
+ refetchOnWindowFocus: true,
12
+ refetchOnReconnect: true,
13
+ staleTime: 5 * 60 * 1000,
14
+ retry: (failureCount, error) => {
15
+ if ((0, http_client_js_1.isHttpBadResponse)(error) && error.status >= 500) {
16
+ return MAX_FAILURE_COUNT - failureCount > 0;
17
+ }
18
+ return false;
19
+ },
20
+ },
21
+ mutations: {
22
+ throwOnError: true,
23
+ },
24
+ },
25
+ });
26
+ exports.http = new http_client_js_1.HttpClient({});
@@ -0,0 +1,5 @@
1
+ import { EndpointQueryClient } from "../runtime/endpoint-query-client.cjs";
2
+ import { HttpClient } from "../runtime/http-client.cjs";
3
+ export declare const queryClient: EndpointQueryClient;
4
+ export declare const http: HttpClient<unknown>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,6CAA4C;AAC1E,OAAO,EAAE,UAAU,EAAqB,mCAAkC;AAI1E,eAAO,MAAM,WAAW,qBAkBtB,CAAC;AAEH,eAAO,MAAM,IAAI,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { EndpointQueryClient } from '../runtime/endpoint-query-client.js';
2
- import { HttpClient } from '../runtime/http-client.js';
1
+ import { EndpointQueryClient } from "../runtime/endpoint-query-client.js";
2
+ import { HttpClient } from "../runtime/http-client.js";
3
3
  export declare const queryClient: EndpointQueryClient;
4
4
  export declare const http: HttpClient<unknown>;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAqB,MAAM,2BAA2B,CAAC;AAI1E,eAAO,MAAM,WAAW,qBAkBtB,CAAC;AAEH,eAAO,MAAM,IAAI,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,4CAA4C;AAC1E,OAAO,EAAE,UAAU,EAAqB,kCAAkC;AAI1E,eAAO,MAAM,WAAW,qBAkBtB,CAAC;AAEH,eAAO,MAAM,IAAI,qBAAqB,CAAC"}
package/builtin/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { EndpointQueryClient } from '../runtime/endpoint-query-client.js';
2
- import { HttpClient, isHttpBadResponse } from '../runtime/http-client.js';
1
+ import { EndpointQueryClient } from "../runtime/endpoint-query-client.js";
2
+ import { HttpClient, isHttpBadResponse } from "../runtime/http-client.js";
3
3
  const MAX_FAILURE_COUNT = 3;
4
4
  export const queryClient = new EndpointQueryClient({
5
5
  defaultOptions: {
package/cli/bin.cjs ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cac_1 = require("cac");
4
+ const index_js_1 = require("../codegen/index.cjs");
5
+ const define_config_js_1 = require("./utils/define-config.cjs");
6
+ const exec_config_path_js_1 = require("./utils/exec-config-path.cjs");
7
+ const resolve_config_path_js_1 = require("./utils/resolve-config-path.cjs");
8
+ let cli = (0, cac_1.cac)('mobx-tanstack-query-api');
9
+ cli = cli.option('-c, --config <file>', `[string] use specified config file`);
10
+ cli.help();
11
+ const parsed = cli.parse();
12
+ if (!parsed.options.help) {
13
+ const configPath = (0, resolve_config_path_js_1.resolveConfigPath)(typeof parsed.options.config === 'string' ? parsed.options.config : null);
14
+ (0, exec_config_path_js_1.execConfigPath)(configPath).then((generateApiParams) => {
15
+ (0, define_config_js_1.defineConfig)(generateApiParams).forEach(index_js_1.generateApi);
16
+ });
17
+ }
package/cli/bin.d.cts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":""}
package/cli/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { cac } from 'cac';
2
- import { generateApi } from '../codegen/index.js';
3
- import { defineConfig } from './utils/define-config.js';
4
- import { execConfigPath } from './utils/exec-config-path.js';
5
- import { resolveConfigPath } from './utils/resolve-config-path.js';
2
+ import { generateApi } from "../codegen/index.js";
3
+ import { defineConfig } from "./utils/define-config.js";
4
+ import { execConfigPath } from "./utils/exec-config-path.js";
5
+ import { resolveConfigPath } from "./utils/resolve-config-path.js";
6
6
  let cli = cac('mobx-tanstack-query-api');
7
7
  cli = cli.option('-c, --config <file>', `[string] use specified config file`);
8
8
  cli.help();
package/cli/index.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("../codegen/index.cjs"), exports);
18
+ __exportStar(require("./utils/define-config.cjs"), exports);
@@ -0,0 +1,3 @@
1
+ export * from "../codegen/index.cjs";
2
+ export * from "./utils/define-config.cjs";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,qCAAoC;AACpC,0CAAyC"}
package/cli/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from './utils/define-config.js';
1
+ export * from "../codegen/index.js";
2
+ export * from "./utils/define-config.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,yCAAyC"}
package/cli/index.js CHANGED
@@ -1 +1,2 @@
1
- export * from './utils/define-config.js';
1
+ export * from "../codegen/index.js";
2
+ export * from "./utils/define-config.js";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineConfig = void 0;
4
+ const defineConfig = (...configs) => {
5
+ return configs
6
+ .flat()
7
+ .filter((config) => !!config);
8
+ };
9
+ exports.defineConfig = defineConfig;
@@ -0,0 +1,4 @@
1
+ import type { Maybe } from 'yummies/utils/types';
2
+ import type { GenerateQueryApiParams } from "../../codegen/index.cjs";
3
+ export declare const defineConfig: (...configs: Maybe<GenerateQueryApiParams | GenerateQueryApiParams[]>[]) => GenerateQueryApiParams[];
4
+ //# sourceMappingURL=define-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,gCAA+B;AAErE,eAAO,MAAM,YAAY,GACvB,GAAG,SAAS,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,EAAE,CAAC,EAAE,KACrE,sBAAsB,EAIxB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import type { Maybe } from 'yummies/utils/types';
2
- import type { GenerateQueryApiParams } from '../../codegen/index.js';
2
+ import type { GenerateQueryApiParams } from "../../codegen/index.js";
3
3
  export declare const defineConfig: (...configs: Maybe<GenerateQueryApiParams | GenerateQueryApiParams[]>[]) => GenerateQueryApiParams[];
4
4
  //# sourceMappingURL=define-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,eAAO,MAAM,YAAY,GACvB,GAAG,SAAS,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,EAAE,CAAC,EAAE,KACrE,sBAAsB,EAIxB,CAAC"}
1
+ {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,+BAA+B;AAErE,eAAO,MAAM,YAAY,GACvB,GAAG,SAAS,KAAK,CAAC,sBAAsB,GAAG,sBAAsB,EAAE,CAAC,EAAE,KACrE,sBAAsB,EAIxB,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execConfigPath = void 0;
4
+ const jiti_1 = require("jiti");
5
+ const execConfigPath = async (configPath) => {
6
+ const jiti = (0, jiti_1.createJiti)(require("url").pathToFileURL(__filename));
7
+ try {
8
+ const config = await jiti.import(configPath, { default: true });
9
+ return config;
10
+ }
11
+ catch (error) {
12
+ console.error(error);
13
+ }
14
+ throw new Error(`${configPath} is not valid, This file should return object - result of the defineConfig function`);
15
+ };
16
+ exports.execConfigPath = execConfigPath;
@@ -0,0 +1,2 @@
1
+ export declare const execConfigPath: (configPath: string) => Promise<unknown>;
2
+ //# sourceMappingURL=exec-config-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec-config-path.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/exec-config-path.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,GAAU,YAAY,MAAM,qBAatD,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.resolveConfigPath = void 0;
40
+ const node_fs_1 = __importStar(require("node:fs"));
41
+ const node_path_1 = __importDefault(require("node:path"));
42
+ const projectDir = process.cwd();
43
+ const resolveConfigPath = (userSpefiedPath) => {
44
+ if (userSpefiedPath) {
45
+ const fullUserSpecifiedPath = node_path_1.default.resolve(projectDir, userSpefiedPath);
46
+ if (!node_fs_1.default.existsSync(fullUserSpecifiedPath)) {
47
+ throw `Config file not found by path - ${userSpefiedPath}`;
48
+ }
49
+ return node_path_1.default.resolve(projectDir, userSpefiedPath);
50
+ }
51
+ if ((0, node_fs_1.existsSync)(node_path_1.default.resolve(projectDir, 'api-codegen.config.js'))) {
52
+ return node_path_1.default.resolve(projectDir, 'api-codegen.config.js');
53
+ }
54
+ else if ((0, node_fs_1.existsSync)(node_path_1.default.resolve(projectDir, 'api-codegen.config.mjs'))) {
55
+ return node_path_1.default.resolve(projectDir, 'api-codegen.config.mjs');
56
+ }
57
+ else if ((0, node_fs_1.existsSync)(node_path_1.default.resolve(projectDir, 'api-codegen.config.json'))) {
58
+ return node_path_1.default.resolve(projectDir, 'api-codegen.config.json');
59
+ }
60
+ else if ((0, node_fs_1.existsSync)(node_path_1.default.resolve(projectDir, 'api-codegen.config.ts'))) {
61
+ return node_path_1.default.resolve(projectDir, 'api-codegen.config.ts');
62
+ }
63
+ throw new Error('api-codegen.config.(js|mjs|json|ts) not found');
64
+ };
65
+ exports.resolveConfigPath = resolveConfigPath;
@@ -0,0 +1,3 @@
1
+ import type { Maybe } from 'yummies/utils/types';
2
+ export declare const resolveConfigPath: (userSpefiedPath?: Maybe<string>) => string;
3
+ //# sourceMappingURL=resolve-config-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-config-path.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/resolve-config-path.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAIjD,eAAO,MAAM,iBAAiB,GAAI,kBAAkB,KAAK,CAAC,MAAM,CAAC,WAsBhE,CAAC"}