mobx-tanstack-query-api 0.0.35 → 0.0.36
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.d.ts +9 -12
- package/codegen/index.d.ts.map +1 -1
- package/codegen/index.js +1 -1
- package/codegen/templates/data-contract.tmpl.d.ts +3 -3
- package/codegen/templates/data-contract.tmpl.d.ts.map +1 -1
- package/codegen/templates/data-contracts-file.tmpl.d.ts +4 -4
- package/codegen/templates/data-contracts-file.tmpl.d.ts.map +1 -1
- package/codegen/templates/index-ts-for-request-per-file.tmpl.d.ts +3 -3
- package/codegen/templates/index-ts-for-request-per-file.tmpl.d.ts.map +1 -1
- package/codegen/templates/new-request-info.tmpl.d.ts +3 -3
- package/codegen/templates/new-request-info.tmpl.d.ts.map +1 -1
- package/codegen/templates/request-info-jsdoc.tmpl.d.ts +3 -3
- package/codegen/templates/request-info-jsdoc.tmpl.d.ts.map +1 -1
- package/codegen/templates/request-info-per-file.tmpl.d.ts +5 -5
- package/codegen/templates/request-info-per-file.tmpl.d.ts.map +1 -1
- package/package.json +3 -3
package/codegen/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { GenerateApiParams as GenerateApiParamsFromSwagger, ParsedRoute } from 'swagger-typescript-api';
|
|
2
1
|
import { AnyObject, KeyOfByValue } from 'yummies/utils/types';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
}>['hooks']>, undefined>['onInit']>[1];
|
|
6
|
-
export type CodegenDataUtils = ReturnType<CodegenProcess['getRenderTemplateData']>['utils'];
|
|
2
|
+
export type CodegenDataUtils = AnyObject;
|
|
3
|
+
export type CodegenProcess = AnyObject;
|
|
7
4
|
export interface ImportFileParams {
|
|
8
5
|
path: string;
|
|
9
6
|
exportName: string;
|
|
@@ -14,11 +11,11 @@ export interface GenerateQueryApiParams {
|
|
|
14
11
|
requestPathPrefix?: string;
|
|
15
12
|
requestPathSuffix?: string;
|
|
16
13
|
requestInfoPrefix?: string;
|
|
17
|
-
formatExportGroupName?: (groupName: string, utils:
|
|
14
|
+
formatExportGroupName?: (groupName: string, utils: AnyObject) => string;
|
|
18
15
|
/**
|
|
19
16
|
* Group endpoints and collect it into object
|
|
20
17
|
*/
|
|
21
|
-
groupBy?: ((route:
|
|
18
|
+
groupBy?: ((route: AnyObject) => string) | `path-segment` | `path-segment-${number}` | `tag` | `tag-${number}`;
|
|
22
19
|
/**
|
|
23
20
|
* Collect all exports into single namespace
|
|
24
21
|
*
|
|
@@ -35,7 +32,7 @@ export interface GenerateQueryApiParams {
|
|
|
35
32
|
*
|
|
36
33
|
* namespaceName.login.toMutation()
|
|
37
34
|
*/
|
|
38
|
-
namespace?: string | ((utils:
|
|
35
|
+
namespace?: string | ((utils: AnyObject) => string);
|
|
39
36
|
/**
|
|
40
37
|
* Example:
|
|
41
38
|
* operationId: 'getById'
|
|
@@ -49,16 +46,16 @@ export interface GenerateQueryApiParams {
|
|
|
49
46
|
queryClient?: 'builtin' | ImportFileParams;
|
|
50
47
|
endpoint?: 'builtin' | ImportFileParams;
|
|
51
48
|
httpClient?: 'builtin' | ImportFileParams;
|
|
52
|
-
getEndpointMeta?: (route:
|
|
49
|
+
getEndpointMeta?: (route: AnyObject, utils: AnyObject) => {
|
|
53
50
|
typeName: string;
|
|
54
51
|
importTypePath: string;
|
|
55
52
|
tmplData: string;
|
|
56
53
|
};
|
|
57
|
-
getRequestMeta?: (route:
|
|
54
|
+
getRequestMeta?: (route: AnyObject, utils: AnyObject) => {
|
|
58
55
|
tmplData: string;
|
|
59
56
|
};
|
|
60
|
-
requestOptions?:
|
|
61
|
-
otherCodegenParams?:
|
|
57
|
+
requestOptions?: AnyObject;
|
|
58
|
+
otherCodegenParams?: AnyObject;
|
|
62
59
|
}
|
|
63
60
|
export type AllImportFileParams = Record<KeyOfByValue<Required<GenerateQueryApiParams>, 'builtin' | ImportFileParams>, ImportFileParams>;
|
|
64
61
|
export declare const generateApi: (params: GenerateQueryApiParams | GenerateQueryApiParams[]) => Promise<void>;
|
package/codegen/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codegen/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAc9D,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACzC,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;IAExE;;OAEG;IACH,OAAO,CAAC,EACJ,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,GAC9B,cAAc,GACd,gBAAgB,MAAM,EAAE,GACxB,KAAK,GACL,OAAO,MAAM,EAAE,CAAC;IAEpB;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC;IAEpD;;;;;;;;OAQG;IACH,yBAAyB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE7C,WAAW,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAC3C,QAAQ,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC;IACxC,UAAU,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC;IAE1C,eAAe,CAAC,EAAE,CAChB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,SAAS,KACb;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,SAAS,KACb;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF,cAAc,CAAC,EAAE,SAAS,CAAC;IAE3B,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAChC;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC,YAAY,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAC5E,gBAAgB,CACjB,CAAC;AAEF,eAAO,MAAM,WAAW,WACd,sBAAsB,GAAG,sBAAsB,EAAE,KACxD,OAAO,CAAC,IAAI,CAgXd,CAAC"}
|
package/codegen/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateApi as generateApiFromSwagger
|
|
1
|
+
import { generateApi as generateApiFromSwagger } from 'swagger-typescript-api';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { LINTERS_IGNORE } from './templates/constants.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from 'yummies/utils/types';
|
|
2
2
|
export interface DataContractTmplParams {
|
|
3
|
-
configuration:
|
|
4
|
-
contract:
|
|
3
|
+
configuration: AnyObject;
|
|
4
|
+
contract: AnyObject;
|
|
5
5
|
addExportKeyword?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare const dataContractTmpl: ({ contract, configuration, addExportKeyword, }: DataContractTmplParams) => Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-contract.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/data-contract.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"data-contract.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/data-contract.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,SAAS,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAuBD,eAAO,MAAM,gBAAgB,mDAI1B,sBAAsB,oBAmCxB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from 'yummies/utils/types';
|
|
2
2
|
import type { CodegenProcess, GenerateQueryApiParams } from '../index.js';
|
|
3
|
-
export interface DataContractsTmplParams extends
|
|
4
|
-
configuration:
|
|
3
|
+
export interface DataContractsTmplParams extends AnyObject {
|
|
4
|
+
configuration: AnyObject;
|
|
5
5
|
apiParams: GenerateQueryApiParams;
|
|
6
6
|
codegenProcess: CodegenProcess;
|
|
7
7
|
excludedDataContractNames?: string[];
|
|
8
8
|
}
|
|
9
|
-
export declare const dataContractsFileTmpl: ({ configuration, formatTSContent, excludedDataContractNames, }: DataContractsTmplParams) => Promise<
|
|
9
|
+
export declare const dataContractsFileTmpl: ({ configuration, formatTSContent, excludedDataContractNames, }: DataContractsTmplParams) => Promise<any>;
|
|
10
10
|
//# sourceMappingURL=data-contracts-file.tmpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-contracts-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/data-contracts-file.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"data-contracts-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/data-contracts-file.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAK1E,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,aAAa,EAAE,SAAS,CAAC;IACzB,SAAS,EAAE,sBAAsB,CAAC;IAClC,cAAc,EAAE,cAAc,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,qBAAqB,mEAI/B,uBAAuB,iBA6BzB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from 'yummies/utils/types';
|
|
2
2
|
import { CodegenProcess, GenerateQueryApiParams } from '../index.js';
|
|
3
|
-
export interface IndexTsForRequestPerFileTmplParams extends
|
|
4
|
-
configuration:
|
|
3
|
+
export interface IndexTsForRequestPerFileTmplParams extends AnyObject {
|
|
4
|
+
configuration: AnyObject;
|
|
5
5
|
apiParams: GenerateQueryApiParams;
|
|
6
6
|
codegenProcess: CodegenProcess;
|
|
7
7
|
generatedRequestFileNames: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-ts-for-request-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/index-ts-for-request-per-file.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index-ts-for-request-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/index-ts-for-request-per-file.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAIrE,MAAM,WAAW,kCAAmC,SAAQ,SAAS;IACnE,aAAa,EAAE,SAAS,CAAC;IACzB,SAAS,EAAE,sBAAsB,CAAC;IAClC,cAAc,EAAE,cAAc,CAAC;IAC/B,yBAAyB,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,4BAA4B,mCAEtC,kCAAkC,oBAIpC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from 'yummies/utils/types';
|
|
2
2
|
import type { AllImportFileParams, CodegenDataUtils, GenerateQueryApiParams } from '../index.js';
|
|
3
3
|
export interface NewRequestInfoTmplParams {
|
|
4
|
-
route:
|
|
5
|
-
configuration:
|
|
4
|
+
route: AnyObject;
|
|
5
|
+
configuration: AnyObject;
|
|
6
6
|
apiParams: GenerateQueryApiParams;
|
|
7
7
|
importFileParams: AllImportFileParams;
|
|
8
8
|
utils: CodegenDataUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-request-info.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/new-request-info.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"new-request-info.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/new-request-info.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,SAAS,CAAC;IACzB,SAAS,EAAE,sBAAsB,CAAC;IAClC,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAiBD,eAAO,MAAM,kBAAkB,mDAK5B,wBAAwB;;;CAuO1B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from 'yummies/utils/types';
|
|
2
2
|
import { GenerateQueryApiParams } from '../index.js';
|
|
3
3
|
export interface RequestInfoJSDocTmplParams {
|
|
4
|
-
route:
|
|
5
|
-
configuration:
|
|
4
|
+
route: AnyObject;
|
|
5
|
+
configuration: AnyObject;
|
|
6
6
|
apiParams: GenerateQueryApiParams;
|
|
7
7
|
offset?: number;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-info-jsdoc.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-jsdoc.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"request-info-jsdoc.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-jsdoc.tmpl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,SAAS,CAAC;IACzB,SAAS,EAAE,sBAAsB,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,sCAI9B,0BAA0B,WAkH5B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AnyObject } from 'yummies/utils/types';
|
|
2
2
|
import type { AllImportFileParams, CodegenDataUtils, CodegenProcess, GenerateQueryApiParams } from '../index.js';
|
|
3
|
-
export interface RequestInfoPerFileTmplParams extends
|
|
4
|
-
route:
|
|
5
|
-
configuration:
|
|
3
|
+
export interface RequestInfoPerFileTmplParams extends AnyObject {
|
|
4
|
+
route: AnyObject;
|
|
5
|
+
configuration: AnyObject;
|
|
6
6
|
apiParams: GenerateQueryApiParams;
|
|
7
7
|
codegenProcess: CodegenProcess;
|
|
8
8
|
importFileParams: AllImportFileParams;
|
|
@@ -11,6 +11,6 @@ export interface RequestInfoPerFileTmplParams extends GenerateApiOutput {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const requestInfoPerFileTmpl: ({ route, configuration, apiParams, formatTSContent, importFileParams, utils, relativePathDataContracts, }: RequestInfoPerFileTmplParams) => Promise<{
|
|
13
13
|
reservedDataContractNames: string[];
|
|
14
|
-
content:
|
|
14
|
+
content: any;
|
|
15
15
|
}>;
|
|
16
16
|
//# sourceMappingURL=request-info-per-file.tmpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-info-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-per-file.tmpl.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"request-info-per-file.tmpl.d.ts","sourceRoot":"","sources":["../../../src/codegen/templates/request-info-per-file.tmpl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAOrB,MAAM,WAAW,4BAA6B,SAAQ,SAAS;IAC7D,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,SAAS,CAAC;IACzB,SAAS,EAAE,sBAAsB,CAAC;IAClC,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,KAAK,EAAE,gBAAgB,CAAC;IACxB,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAED,eAAO,MAAM,sBAAsB,8GAQhC,4BAA4B;;;EA6E9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-tanstack-query-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "js2me",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"mobx-tanstack-query": "^4.2.5"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"swagger-typescript-api": "13.
|
|
24
|
+
"swagger-typescript-api": "13.1.3",
|
|
25
25
|
"yummies": "^3.0.37"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"ts:check": "tsc --noEmit",
|
|
141
141
|
"check": "npm run lint:check && npm run ts:check",
|
|
142
142
|
"prebuild": "npm run clean && npm run check",
|
|
143
|
-
"build:watch": "
|
|
143
|
+
"build:watch": "pnpm build && nodemon --delay 0.5 --watch src --ext ts,tsx --exec \"pnpm build\"",
|
|
144
144
|
"build": "tsc && node ./post-build.mjs",
|
|
145
145
|
"pub": "PUBLISH=true pnpm run build",
|
|
146
146
|
"pub:patch": "PUBLISH=true PUBLISH_VERSION=patch pnpm run build",
|