mobx-tanstack-query-api 0.15.0 → 0.17.0
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/builtin/index.cjs +26 -0
- package/dist/builtin/index.d.cts +5 -0
- package/dist/builtin/index.d.cts.map +1 -0
- package/dist/builtin/index.d.ts +5 -0
- package/dist/builtin/index.d.ts.map +1 -0
- package/{builtin → dist/builtin}/index.js +2 -2
- package/dist/cli/bin.cjs +17 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/{cli → dist/cli}/bin.js +4 -4
- package/dist/cli/index.cjs +18 -0
- package/dist/cli/index.d.cts +3 -0
- package/dist/cli/index.d.cts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/utils/define-config.cjs +9 -0
- package/dist/cli/utils/define-config.d.cts +4 -0
- package/dist/cli/utils/define-config.d.cts.map +1 -0
- package/{cli → dist/cli}/utils/define-config.d.ts +1 -1
- package/{cli → dist/cli}/utils/define-config.d.ts.map +1 -1
- package/dist/cli/utils/exec-config-path.cjs +16 -0
- package/dist/cli/utils/exec-config-path.d.ts +2 -0
- package/dist/cli/utils/exec-config-path.d.ts.map +1 -0
- package/dist/cli/utils/resolve-config-path.cjs +65 -0
- package/dist/cli/utils/resolve-config-path.d.ts +3 -0
- package/dist/cli/utils/resolve-config-path.d.ts.map +1 -0
- package/dist/codegen/index.cjs +488 -0
- package/dist/codegen/index.d.cts +167 -0
- package/dist/codegen/index.d.cts.map +1 -0
- package/{codegen → dist/codegen}/index.d.ts +1 -1
- package/dist/codegen/index.d.ts.map +1 -0
- package/{codegen → dist/codegen}/index.js +9 -9
- package/dist/codegen/templates/all-endpoints-per-file.tmpl.cjs +99 -0
- package/dist/codegen/templates/all-endpoints-per-file.tmpl.d.cts +18 -0
- package/dist/codegen/templates/all-endpoints-per-file.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/all-endpoints-per-file.tmpl.d.ts +1 -1
- package/dist/codegen/templates/all-endpoints-per-file.tmpl.d.ts.map +1 -0
- package/{codegen → dist/codegen}/templates/all-endpoints-per-file.tmpl.js +4 -4
- package/dist/codegen/templates/all-exports.tmpl.cjs +14 -0
- package/dist/codegen/templates/all-exports.tmpl.d.cts +11 -0
- package/dist/codegen/templates/all-exports.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/all-exports.tmpl.d.ts +1 -1
- package/dist/codegen/templates/all-exports.tmpl.d.ts.map +1 -0
- package/{codegen → dist/codegen}/templates/all-exports.tmpl.js +1 -1
- package/dist/codegen/templates/constants.cjs +5 -0
- package/dist/codegen/templates/constants.d.ts +2 -0
- package/dist/codegen/templates/constants.d.ts.map +1 -0
- package/dist/codegen/templates/data-contract.tmpl.cjs +49 -0
- package/dist/codegen/templates/data-contract.tmpl.d.ts +8 -0
- package/dist/codegen/templates/data-contract.tmpl.d.ts.map +1 -0
- package/dist/codegen/templates/data-contracts-file.tmpl.cjs +27 -0
- package/dist/codegen/templates/data-contracts-file.tmpl.d.cts +10 -0
- package/dist/codegen/templates/data-contracts-file.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/data-contracts-file.tmpl.d.ts +1 -1
- package/dist/codegen/templates/data-contracts-file.tmpl.d.ts.map +1 -0
- package/{codegen → dist/codegen}/templates/data-contracts-file.tmpl.js +2 -2
- package/dist/codegen/templates/endpoint-jsdoc.tmpl.cjs +110 -0
- package/dist/codegen/templates/endpoint-jsdoc.tmpl.d.cts +10 -0
- package/dist/codegen/templates/endpoint-jsdoc.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/endpoint-jsdoc.tmpl.d.ts +1 -1
- package/dist/codegen/templates/endpoint-jsdoc.tmpl.d.ts.map +1 -0
- package/dist/codegen/templates/endpoint-per-file.tmpl.cjs +90 -0
- package/dist/codegen/templates/endpoint-per-file.tmpl.d.cts +18 -0
- package/dist/codegen/templates/endpoint-per-file.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/endpoint-per-file.tmpl.d.ts +1 -1
- package/dist/codegen/templates/endpoint-per-file.tmpl.d.ts.map +1 -0
- package/{codegen → dist/codegen}/templates/endpoint-per-file.tmpl.js +4 -4
- package/dist/codegen/templates/index-ts-for-endpoint-per-file.tmpl.cjs +10 -0
- package/dist/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts +10 -0
- package/dist/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/index-ts-for-endpoint-per-file.tmpl.d.ts +1 -1
- package/{codegen → dist/codegen}/templates/index-ts-for-endpoint-per-file.tmpl.d.ts.map +1 -1
- package/{codegen → dist/codegen}/templates/index-ts-for-endpoint-per-file.tmpl.js +1 -1
- package/dist/codegen/templates/meta-info.tmpl.cjs +48 -0
- package/dist/codegen/templates/meta-info.tmpl.d.cts +12 -0
- package/dist/codegen/templates/meta-info.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/meta-info.tmpl.d.ts +1 -1
- package/dist/codegen/templates/meta-info.tmpl.d.ts.map +1 -0
- package/{codegen → dist/codegen}/templates/meta-info.tmpl.js +1 -1
- package/dist/codegen/templates/new-endpoint.tmpl.cjs +178 -0
- package/dist/codegen/templates/new-endpoint.tmpl.d.cts +21 -0
- package/dist/codegen/templates/new-endpoint.tmpl.d.cts.map +1 -0
- package/{codegen → dist/codegen}/templates/new-endpoint.tmpl.d.ts +1 -1
- package/dist/codegen/templates/new-endpoint.tmpl.d.ts.map +1 -0
- package/{codegen → dist/codegen}/templates/new-endpoint.tmpl.js +1 -1
- package/dist/codegen/utils/remove-unused-types.cjs +117 -0
- package/dist/codegen/utils/remove-unused-types.d.cts +7 -0
- package/dist/codegen/utils/remove-unused-types.d.cts.map +1 -0
- package/{codegen → dist/codegen}/utils/remove-unused-types.d.ts +1 -1
- package/dist/codegen/utils/remove-unused-types.d.ts.map +1 -0
- package/{codegen → dist/codegen}/utils/remove-unused-types.js +1 -1
- package/dist/codegen/utils/unpack-filter-option.cjs +20 -0
- package/dist/codegen/utils/unpack-filter-option.d.cts +4 -0
- package/dist/codegen/utils/unpack-filter-option.d.cts.map +1 -0
- package/{codegen → dist/codegen}/utils/unpack-filter-option.d.ts +1 -1
- package/dist/codegen/utils/unpack-filter-option.d.ts.map +1 -0
- package/dist/index.cjs +18 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/{index.d.ts.map → dist/index.d.ts.map} +1 -1
- package/{index.js → dist/index.js} +1 -1
- package/dist/runtime/endpoint-infinite-query.cjs +101 -0
- package/dist/runtime/endpoint-infinite-query.d.cts +17 -0
- package/dist/runtime/endpoint-infinite-query.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-infinite-query.d.ts +3 -3
- package/dist/runtime/endpoint-infinite-query.d.ts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-infinite-query.js +1 -1
- package/dist/runtime/endpoint-infinite-query.types.cjs +2 -0
- package/dist/runtime/endpoint-infinite-query.types.d.cts +30 -0
- package/dist/runtime/endpoint-infinite-query.types.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-infinite-query.types.d.ts +2 -2
- package/dist/runtime/endpoint-infinite-query.types.d.ts.map +1 -0
- package/dist/runtime/endpoint-mutation.cjs +73 -0
- package/dist/runtime/endpoint-mutation.d.cts +13 -0
- package/dist/runtime/endpoint-mutation.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-mutation.d.ts +3 -3
- package/dist/runtime/endpoint-mutation.d.ts.map +1 -0
- package/dist/runtime/endpoint-mutation.types.cjs +2 -0
- package/dist/runtime/endpoint-mutation.types.d.cts +30 -0
- package/dist/runtime/endpoint-mutation.types.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-mutation.types.d.ts +2 -2
- package/dist/runtime/endpoint-mutation.types.d.ts.map +1 -0
- package/dist/runtime/endpoint-query-client.cjs +79 -0
- package/dist/runtime/endpoint-query-client.d.cts +13 -0
- package/dist/runtime/endpoint-query-client.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-query-client.d.ts +1 -1
- package/dist/runtime/endpoint-query-client.d.ts.map +1 -0
- package/dist/runtime/endpoint-query-client.types.cjs +2 -0
- package/dist/runtime/endpoint-query-client.types.d.cts +16 -0
- package/dist/runtime/endpoint-query-client.types.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-query-client.types.d.ts +2 -2
- package/dist/runtime/endpoint-query-client.types.d.ts.map +1 -0
- package/dist/runtime/endpoint-query.cjs +213 -0
- package/dist/runtime/endpoint-query.d.cts +29 -0
- package/dist/runtime/endpoint-query.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-query.d.ts +3 -3
- package/dist/runtime/endpoint-query.d.ts.map +1 -0
- package/dist/runtime/endpoint-query.types.cjs +2 -0
- package/dist/runtime/endpoint-query.types.d.cts +37 -0
- package/dist/runtime/endpoint-query.types.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint-query.types.d.ts +1 -1
- package/dist/runtime/endpoint-query.types.d.ts.map +1 -0
- package/dist/runtime/endpoint.cjs +128 -0
- package/dist/runtime/endpoint.d.cts +69 -0
- package/dist/runtime/endpoint.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint.d.ts +9 -9
- package/dist/runtime/endpoint.d.ts.map +1 -0
- package/{runtime → dist/runtime}/endpoint.js +3 -3
- package/dist/runtime/endpoint.types.cjs +2 -0
- package/dist/runtime/endpoint.types.d.cts +23 -0
- package/dist/runtime/endpoint.types.d.cts.map +1 -0
- package/{runtime → dist/runtime}/endpoint.types.d.ts +3 -3
- package/dist/runtime/endpoint.types.d.ts.map +1 -0
- package/dist/runtime/http-client.cjs +208 -0
- package/dist/runtime/http-client.d.ts +85 -0
- package/dist/runtime/http-client.d.ts.map +1 -0
- package/dist/runtime/index.cjs +25 -0
- package/dist/runtime/index.d.cts +10 -0
- package/dist/runtime/index.d.cts.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +9 -0
- package/package.json +41 -150
- package/assets/gh-repo-template.pxz +0 -0
- package/assets/logo.png +0 -0
- package/assets/logo.pxz +0 -0
- package/builtin/index.d.ts +0 -5
- package/builtin/index.d.ts.map +0 -1
- package/cli/bin.mjs +0 -15
- package/cli/index.d.ts +0 -2
- package/cli/index.d.ts.map +0 -1
- package/cli/index.js +0 -1
- package/codegen/index.d.ts.map +0 -1
- package/codegen/templates/all-endpoints-per-file.tmpl.d.ts.map +0 -1
- package/codegen/templates/all-exports.tmpl.d.ts.map +0 -1
- package/codegen/templates/data-contracts-file.tmpl.d.ts.map +0 -1
- package/codegen/templates/endpoint-jsdoc.tmpl.d.ts.map +0 -1
- package/codegen/templates/endpoint-per-file.tmpl.d.ts.map +0 -1
- package/codegen/templates/meta-info.tmpl.d.ts.map +0 -1
- package/codegen/templates/new-endpoint.tmpl.d.ts.map +0 -1
- package/codegen/utils/remove-unused-types.d.ts.map +0 -1
- package/codegen/utils/unpack-filter-option.d.ts.map +0 -1
- package/index.d.ts +0 -3
- package/runtime/endpoint-infinite-query.d.ts.map +0 -1
- package/runtime/endpoint-infinite-query.types.d.ts.map +0 -1
- package/runtime/endpoint-mutation.d.ts.map +0 -1
- package/runtime/endpoint-mutation.types.d.ts.map +0 -1
- package/runtime/endpoint-query-client.d.ts.map +0 -1
- package/runtime/endpoint-query-client.types.d.ts.map +0 -1
- package/runtime/endpoint-query.d.ts.map +0 -1
- package/runtime/endpoint-query.types.d.ts.map +0 -1
- package/runtime/endpoint.d.ts.map +0 -1
- package/runtime/endpoint.types.d.ts.map +0 -1
- package/runtime/index.d.ts +0 -10
- package/runtime/index.d.ts.map +0 -1
- package/runtime/index.js +0 -9
- /package/{cli/bin.d.ts → dist/cli/bin.d.cts} +0 -0
- /package/{cli/bin.d.ts.map → dist/cli/bin.d.cts.map} +0 -0
- /package/{cli → dist/cli}/utils/define-config.js +0 -0
- /package/{cli/utils/exec-config-path.d.ts → dist/cli/utils/exec-config-path.d.cts} +0 -0
- /package/{cli/utils/exec-config-path.d.ts.map → dist/cli/utils/exec-config-path.d.cts.map} +0 -0
- /package/{cli → dist/cli}/utils/exec-config-path.js +0 -0
- /package/{cli/utils/resolve-config-path.d.ts → dist/cli/utils/resolve-config-path.d.cts} +0 -0
- /package/{cli/utils/resolve-config-path.d.ts.map → dist/cli/utils/resolve-config-path.d.cts.map} +0 -0
- /package/{cli → dist/cli}/utils/resolve-config-path.js +0 -0
- /package/{codegen/templates/constants.d.ts → dist/codegen/templates/constants.d.cts} +0 -0
- /package/{codegen/templates/constants.d.ts.map → dist/codegen/templates/constants.d.cts.map} +0 -0
- /package/{codegen → dist/codegen}/templates/constants.js +0 -0
- /package/{codegen/templates/data-contract.tmpl.d.ts → dist/codegen/templates/data-contract.tmpl.d.cts} +0 -0
- /package/{codegen/templates/data-contract.tmpl.d.ts.map → dist/codegen/templates/data-contract.tmpl.d.cts.map} +0 -0
- /package/{codegen → dist/codegen}/templates/data-contract.tmpl.js +0 -0
- /package/{codegen → dist/codegen}/templates/endpoint-jsdoc.tmpl.js +0 -0
- /package/{codegen → dist/codegen}/utils/unpack-filter-option.js +0 -0
- /package/{runtime → dist/runtime}/endpoint-infinite-query.types.js +0 -0
- /package/{runtime → dist/runtime}/endpoint-mutation.js +0 -0
- /package/{runtime → dist/runtime}/endpoint-mutation.types.js +0 -0
- /package/{runtime → dist/runtime}/endpoint-query-client.js +0 -0
- /package/{runtime → dist/runtime}/endpoint-query-client.types.js +0 -0
- /package/{runtime → dist/runtime}/endpoint-query.js +0 -0
- /package/{runtime → dist/runtime}/endpoint-query.types.js +0 -0
- /package/{runtime → dist/runtime}/endpoint.types.js +0 -0
- /package/{runtime/http-client.d.ts → dist/runtime/http-client.d.cts} +0 -0
- /package/{runtime/http-client.d.ts.map → dist/runtime/http-client.d.cts.map} +0 -0
- /package/{runtime → dist/runtime}/http-client.js +0 -0
|
@@ -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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EndpointQueryClient } from "../runtime/endpoint-query-client.js";
|
|
2
|
+
import { HttpClient } from "../runtime/http-client.js";
|
|
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,4CAA4C;AAC1E,OAAO,EAAE,UAAU,EAAqB,kCAAkC;AAI1E,eAAO,MAAM,WAAW,qBAkBtB,CAAC;AAEH,eAAO,MAAM,IAAI,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EndpointQueryClient } from
|
|
2
|
-
import { HttpClient, isHttpBadResponse } from
|
|
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/dist/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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":""}
|
package/{cli → dist/cli}/bin.js
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cac } from 'cac';
|
|
2
|
-
import { generateApi } from
|
|
3
|
-
import { defineConfig } from
|
|
4
|
-
import { execConfigPath } from
|
|
5
|
-
import { resolveConfigPath } from
|
|
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();
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,qCAAoC;AACpC,0CAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,yCAAyC"}
|
|
@@ -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
|
|
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
|
|
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 @@
|
|
|
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 @@
|
|
|
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"}
|