batteryincluded 1.0.2 → 1.0.4
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/README.md +2 -2
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +5 -3
- package/dist/index.d.mts +20 -8
- package/package.json +33 -20
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<img src="https://batteryincluded.ai/
|
|
3
|
+
<img src="https://batteryincluded.ai/images/logo-header.webp" alt="BatteryIncluded" width="290">
|
|
4
4
|
</picture>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
@@ -105,7 +105,7 @@ export default defineCodegenConfig({
|
|
|
105
105
|
})
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
For more information on the code generator and how to customize the probe configuration, see the [AutoDisco](https://github.com/
|
|
108
|
+
For more information on the code generator and how to customize the probe configuration, see the [AutoDisco](https://github.com/bussmann-io/autodisco) documentation.
|
|
109
109
|
|
|
110
110
|
## License
|
|
111
111
|
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -24,9 +24,10 @@ function buildAugmentationFile() {
|
|
|
24
24
|
async function codegen(args) {
|
|
25
25
|
if (!args.collection) throw new Error("Collection name is required. Please specify it using the --collection flag or set the BATTERYINCLUDED_COLLECTION environment variable.");
|
|
26
26
|
if (!args.apiKey) throw new Error("API key is required. Please specify it using the --api-key flag or set the BATTERYINCLUDED_API_KEY environment variable.");
|
|
27
|
+
const cwd = process.cwd();
|
|
27
28
|
const { config: resolved } = await loadConfig({
|
|
28
29
|
name: "batteryincluded",
|
|
29
|
-
cwd
|
|
30
|
+
cwd,
|
|
30
31
|
rcFile: "batteryincluded-rc",
|
|
31
32
|
globalRc: false,
|
|
32
33
|
dotenv: false
|
|
@@ -66,7 +67,7 @@ const { parsed } = config({ quiet: true });
|
|
|
66
67
|
const env = parsed ?? process.env;
|
|
67
68
|
const COLLECTION = Object.entries(env).find(([key]) => key.endsWith("BATTERYINCLUDED_COLLECTION"))?.[1];
|
|
68
69
|
const API_KEY = Object.entries(env).find(([key]) => key.endsWith("BATTERYINCLUDED_API_KEY"))?.[1];
|
|
69
|
-
|
|
70
|
+
const command = defineCommand({
|
|
70
71
|
meta: {
|
|
71
72
|
name: "codegen",
|
|
72
73
|
description: "Generate OpenAPI Schema and TypeScript types for a BatteryIncluded collection."
|
|
@@ -102,5 +103,6 @@ runMain(defineCommand({
|
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
105
|
run: async ({ args }) => await codegen(args)
|
|
105
|
-
})
|
|
106
|
+
});
|
|
107
|
+
runMain(command);
|
|
106
108
|
export {};
|
package/dist/index.d.mts
CHANGED
|
@@ -94,10 +94,22 @@ type Highlights = components['schemas']['GetApiV1CollectionsDocumentsHighlights'
|
|
|
94
94
|
* @see https://www.postman.com/batteryincluded/core/request/21t4zy8/recommendations
|
|
95
95
|
*/
|
|
96
96
|
type Recommendations = components['schemas']['GetApiV1CollectionsDocumentsRecommendations'];
|
|
97
|
+
/**
|
|
98
|
+
* Similar search query response type, representing the shape of the response returned by the API when performing a similar search query.
|
|
99
|
+
*
|
|
100
|
+
* @see https://www.postman.com/batteryincluded/core/request/mjujfc7/similar-search
|
|
101
|
+
*/
|
|
102
|
+
type SimilarSearch = components['schemas']['GetApiV1CollectionsDocumentsSimilarSearch'];
|
|
103
|
+
/**
|
|
104
|
+
* Presets query response type, representing the shape of the response returned by the API when performing a presets query.
|
|
105
|
+
*
|
|
106
|
+
* @see https://www.postman.com/batteryincluded/core/request/dkv351x/presets
|
|
107
|
+
*/
|
|
108
|
+
type Presets = components['schemas']['GetApiV1CollectionsDocumentsPresets'];
|
|
97
109
|
/**
|
|
98
110
|
* Configuration interface for the BatteryIncluded client.
|
|
99
111
|
*/
|
|
100
|
-
interface BatteryIncludedClientConfig {
|
|
112
|
+
export interface BatteryIncludedClientConfig {
|
|
101
113
|
collection: string;
|
|
102
114
|
apiKey: string;
|
|
103
115
|
}
|
|
@@ -108,7 +120,7 @@ interface BatteryIncludedClientConfig {
|
|
|
108
120
|
*
|
|
109
121
|
* @returns The base URL for the API endpoint.
|
|
110
122
|
*/
|
|
111
|
-
declare const buildBaseUrl: (collection: string) => string;
|
|
123
|
+
export declare const buildBaseUrl: (collection: string) => string;
|
|
112
124
|
/**
|
|
113
125
|
* Builds the headers for the API request.
|
|
114
126
|
*
|
|
@@ -116,7 +128,7 @@ declare const buildBaseUrl: (collection: string) => string;
|
|
|
116
128
|
*
|
|
117
129
|
* @returns An object containing the headers for the API request.
|
|
118
130
|
*/
|
|
119
|
-
declare const buildHeaders: (apiKey: string) => {
|
|
131
|
+
export declare const buildHeaders: (apiKey: string) => {
|
|
120
132
|
'X-BI-API-KEY': string;
|
|
121
133
|
};
|
|
122
134
|
/**
|
|
@@ -126,7 +138,7 @@ declare const buildHeaders: (apiKey: string) => {
|
|
|
126
138
|
*
|
|
127
139
|
* @returns A typed OpenAPI client instance for making API requests.
|
|
128
140
|
*/
|
|
129
|
-
declare function createClient<customPaths extends object = paths>(config: BatteryIncludedClientConfig): import("openapi-fetch").Client<customPaths, `${string}/${string}`>;
|
|
141
|
+
export declare function createClient<customPaths extends object = paths>(config: BatteryIncludedClientConfig): import("openapi-fetch").Client<customPaths, `${string}/${string}`>;
|
|
130
142
|
/**
|
|
131
143
|
* Defines the code generation configuration for the project.
|
|
132
144
|
*
|
|
@@ -153,7 +165,7 @@ declare function createClient<customPaths extends object = paths>(config: Batter
|
|
|
153
165
|
* })
|
|
154
166
|
* ```
|
|
155
167
|
*/
|
|
156
|
-
declare function defineCodegenConfig(config: Record<string, ProbeConfig | ProbeConfig[]>): Record<string, ProbeConfig | ProbeConfig[]>;
|
|
168
|
+
export declare function defineCodegenConfig(config: Record<string, ProbeConfig | ProbeConfig[]>): Record<string, ProbeConfig | ProbeConfig[]>;
|
|
157
169
|
/**
|
|
158
170
|
* Transforms a given filter object into URLSearchParams format.
|
|
159
171
|
*
|
|
@@ -161,7 +173,7 @@ declare function defineCodegenConfig(config: Record<string, ProbeConfig | ProbeC
|
|
|
161
173
|
*
|
|
162
174
|
* @returns URLSearchParams object containing the filter parameters.
|
|
163
175
|
*/
|
|
164
|
-
declare function filterToSearchParams(filter: Filter): URLSearchParams;
|
|
176
|
+
export declare function filterToSearchParams(filter: Filter): URLSearchParams;
|
|
165
177
|
/**
|
|
166
178
|
* Transforms given URLSearchParams into a filter object.
|
|
167
179
|
*
|
|
@@ -169,5 +181,5 @@ declare function filterToSearchParams(filter: Filter): URLSearchParams;
|
|
|
169
181
|
*
|
|
170
182
|
* @returns BatteryIncluded filter object.
|
|
171
183
|
*/
|
|
172
|
-
declare function searchParamsToFilter(searchParams: URLSearchParams): Filter;
|
|
173
|
-
export {
|
|
184
|
+
export declare function searchParamsToFilter(searchParams: URLSearchParams): Filter;
|
|
185
|
+
export type { Browse, Facet, Filter, Highlights, Presets, RangeFacet, Recommendations, SelectFacet, SimilarSearch, Suggest, components, paths };
|
package/package.json
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "batteryincluded",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"description": "A TypeScript client for the BatteryIncluded API",
|
|
6
6
|
"author": "Frederik Bußmann <frederik@bussmann.io>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"repository":
|
|
9
|
-
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "bussmann-io/batteryincluded-ts"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"batteryincluded",
|
|
14
|
+
"api",
|
|
15
|
+
"sdk",
|
|
16
|
+
"typescript",
|
|
17
|
+
"e-commerce",
|
|
18
|
+
"ai",
|
|
19
|
+
"search"
|
|
20
|
+
],
|
|
10
21
|
"exports": {
|
|
11
22
|
".": "./dist/index.mjs"
|
|
12
23
|
},
|
|
@@ -17,27 +28,29 @@
|
|
|
17
28
|
"files": [
|
|
18
29
|
"dist"
|
|
19
30
|
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "obuild",
|
|
22
|
-
"lint": "eslint .",
|
|
23
|
-
"lint:fix": "eslint . --fix",
|
|
24
|
-
"prepack": "bun run build",
|
|
25
|
-
"release": "bun test && npm publish && git push --follow-tags",
|
|
26
|
-
"typecheck": "tsc --noEmit"
|
|
27
|
-
},
|
|
28
31
|
"dependencies": {
|
|
29
|
-
"autodisco": "^2.0
|
|
30
|
-
"c12": "^
|
|
32
|
+
"autodisco": "^2.1.0",
|
|
33
|
+
"c12": "^4.0.0-rc.2",
|
|
31
34
|
"citty": "^0.2.2",
|
|
32
35
|
"defu": "^6.1.7",
|
|
33
|
-
"dotenv": "^
|
|
36
|
+
"dotenv": "^18.0.4",
|
|
37
|
+
"jiti": "^2.7.0",
|
|
34
38
|
"openapi-fetch": "^0.17.0"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@antfu/eslint-config": "^9.
|
|
38
|
-
"@types/node": "^24",
|
|
39
|
-
"eslint": "^10.
|
|
40
|
-
"
|
|
41
|
-
"
|
|
41
|
+
"@antfu/eslint-config": "^9.5.1",
|
|
42
|
+
"@types/node": "^24.19.0",
|
|
43
|
+
"eslint": "^10.11.0",
|
|
44
|
+
"msw": "^2.15.0",
|
|
45
|
+
"obuild": "^0.4.40",
|
|
46
|
+
"typescript": "^6.0.3",
|
|
47
|
+
"vitest": "^5.0.2"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "obuild",
|
|
51
|
+
"lint": "eslint .",
|
|
52
|
+
"lint:fix": "eslint . --fix",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"test": "vitest run"
|
|
42
55
|
}
|
|
43
|
-
}
|
|
56
|
+
}
|