batteryincluded 1.0.3 → 1.0.5
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 +8 -8
- package/package.json +32 -21
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
|
@@ -109,7 +109,7 @@ type Presets = components['schemas']['GetApiV1CollectionsDocumentsPresets'];
|
|
|
109
109
|
/**
|
|
110
110
|
* Configuration interface for the BatteryIncluded client.
|
|
111
111
|
*/
|
|
112
|
-
interface BatteryIncludedClientConfig {
|
|
112
|
+
export interface BatteryIncludedClientConfig {
|
|
113
113
|
collection: string;
|
|
114
114
|
apiKey: string;
|
|
115
115
|
}
|
|
@@ -120,7 +120,7 @@ interface BatteryIncludedClientConfig {
|
|
|
120
120
|
*
|
|
121
121
|
* @returns The base URL for the API endpoint.
|
|
122
122
|
*/
|
|
123
|
-
declare const buildBaseUrl: (collection: string) => string;
|
|
123
|
+
export declare const buildBaseUrl: (collection: string) => string;
|
|
124
124
|
/**
|
|
125
125
|
* Builds the headers for the API request.
|
|
126
126
|
*
|
|
@@ -128,7 +128,7 @@ declare const buildBaseUrl: (collection: string) => string;
|
|
|
128
128
|
*
|
|
129
129
|
* @returns An object containing the headers for the API request.
|
|
130
130
|
*/
|
|
131
|
-
declare const buildHeaders: (apiKey: string) => {
|
|
131
|
+
export declare const buildHeaders: (apiKey: string) => {
|
|
132
132
|
'X-BI-API-KEY': string;
|
|
133
133
|
};
|
|
134
134
|
/**
|
|
@@ -138,7 +138,7 @@ declare const buildHeaders: (apiKey: string) => {
|
|
|
138
138
|
*
|
|
139
139
|
* @returns A typed OpenAPI client instance for making API requests.
|
|
140
140
|
*/
|
|
141
|
-
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}`>;
|
|
142
142
|
/**
|
|
143
143
|
* Defines the code generation configuration for the project.
|
|
144
144
|
*
|
|
@@ -165,7 +165,7 @@ declare function createClient<customPaths extends object = paths>(config: Batter
|
|
|
165
165
|
* })
|
|
166
166
|
* ```
|
|
167
167
|
*/
|
|
168
|
-
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[]>;
|
|
169
169
|
/**
|
|
170
170
|
* Transforms a given filter object into URLSearchParams format.
|
|
171
171
|
*
|
|
@@ -173,7 +173,7 @@ declare function defineCodegenConfig(config: Record<string, ProbeConfig | ProbeC
|
|
|
173
173
|
*
|
|
174
174
|
* @returns URLSearchParams object containing the filter parameters.
|
|
175
175
|
*/
|
|
176
|
-
declare function filterToSearchParams(filter: Filter): URLSearchParams;
|
|
176
|
+
export declare function filterToSearchParams(filter: Filter): URLSearchParams;
|
|
177
177
|
/**
|
|
178
178
|
* Transforms given URLSearchParams into a filter object.
|
|
179
179
|
*
|
|
@@ -181,5 +181,5 @@ declare function filterToSearchParams(filter: Filter): URLSearchParams;
|
|
|
181
181
|
*
|
|
182
182
|
* @returns BatteryIncluded filter object.
|
|
183
183
|
*/
|
|
184
|
-
declare function searchParamsToFilter(searchParams: URLSearchParams): Filter;
|
|
185
|
-
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.5",
|
|
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,29 +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
|
-
"typecheck": "tsc --noEmit",
|
|
26
|
-
"test": "vitest run"
|
|
27
|
-
},
|
|
28
31
|
"dependencies": {
|
|
29
|
-
"autodisco": "^2.
|
|
30
|
-
"c12": "^
|
|
32
|
+
"autodisco": "^2.1.1",
|
|
33
|
+
"c12": "^4.0.0-rc.4",
|
|
31
34
|
"citty": "^0.2.2",
|
|
32
35
|
"defu": "^6.1.7",
|
|
33
|
-
"dotenv": "^
|
|
36
|
+
"dotenv": "^18.0.9",
|
|
37
|
+
"jiti": "^2.7.0",
|
|
34
38
|
"openapi-fetch": "^0.17.0"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
|
-
"@antfu/eslint-config": "^9.1
|
|
38
|
-
"@types/node": "^24.
|
|
39
|
-
"eslint": "^10.
|
|
40
|
-
"msw": "^
|
|
41
|
-
"obuild": "^0.4.
|
|
41
|
+
"@antfu/eslint-config": "^9.5.1",
|
|
42
|
+
"@types/node": "^24.19.2",
|
|
43
|
+
"eslint": "^10.13.0",
|
|
44
|
+
"msw": "^3.0.3",
|
|
45
|
+
"obuild": "^0.4.45",
|
|
42
46
|
"typescript": "^6.0.3",
|
|
43
|
-
"vitest": "^
|
|
47
|
+
"vitest": "^5.0.5"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "obuild",
|
|
51
|
+
"lint": "eslint .",
|
|
52
|
+
"lint:fix": "eslint . --fix",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"test": "vitest run"
|
|
44
55
|
}
|
|
45
|
-
}
|
|
56
|
+
}
|