@kosdev-code/kos-freestyle-sdk 0.1.0-dev.5164 → 0.1.0-dev.5167
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/{extension-utils-DABHO8qx.cjs → extension-utils-CIeLBxMW.cjs} +2 -2
- package/{extension-utils-DABHO8qx.cjs.map → extension-utils-CIeLBxMW.cjs.map} +1 -1
- package/{extension-utils-CARIyqNK.js → extension-utils-mrQ_wiPv.js} +11 -11
- package/{extension-utils-CARIyqNK.js.map → extension-utils-mrQ_wiPv.js.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +36 -33
- package/models/utils/openapi-index.d.ts +2 -2
- package/models/utils/services/freestyle/1.6.5/openapi.d.ts +1462 -0
- package/models/utils/services/freestyle/1.6.5/service.d.ts +118 -0
- package/models/utils/services/freestyle/1.6.5/service.d.ts.map +1 -0
- package/models/utils/services/freestyle/1.8.1/openapi.d.ts +1656 -0
- package/models/utils/services/freestyle/1.8.1/service.d.ts +118 -0
- package/models/utils/services/freestyle/1.8.1/service.d.ts.map +1 -0
- package/models/utils/services/handle/1.8.1/openapi.d.ts +237 -0
- package/models/utils/services/handle/1.8.1/service.d.ts +118 -0
- package/models/utils/services/handle/1.8.1/service.d.ts.map +1 -0
- package/models/utils/services-index.d.ts +3 -0
- package/models/utils/services-index.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +30 -27
- package/package.json +4 -4
- package/{service-VUszslQD.cjs → service-DrOwtgpN.cjs} +2 -2
- package/service-DrOwtgpN.cjs.map +1 -0
- package/{service-C0WOCTr1.js → service-Rmefh9Kc.js} +497 -467
- package/service-Rmefh9Kc.js.map +1 -0
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/{use-nutrition-info-BWyJAXF6.js → use-nutrition-info-Cb4qW_qq.js} +2 -2
- package/{use-nutrition-info-BWyJAXF6.js.map → use-nutrition-info-Cb4qW_qq.js.map} +1 -1
- package/{use-nutrition-info-BRX7H5o6.cjs → use-nutrition-info-DOOjBBqm.cjs} +2 -2
- package/{use-nutrition-info-BRX7H5o6.cjs.map → use-nutrition-info-DOOjBBqm.cjs.map} +1 -1
- package/service-C0WOCTr1.js.map +0 -1
- package/service-VUszslQD.cjs.map +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { paths } from './openapi';
|
|
2
|
+
import { ClientResponse, HttpMethod, IKosServiceRequestParams, KosExecutionContext, PathsByMethod } from '@kosdev-code/kos-ui-sdk';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Type aliases for freestyle API
|
|
6
|
+
*/
|
|
7
|
+
export type Api = paths;
|
|
8
|
+
export type ApiPath = keyof paths;
|
|
9
|
+
export type ValidPaths = PathsByMethod<paths>;
|
|
10
|
+
/**
|
|
11
|
+
* Get client response type for freestyle API
|
|
12
|
+
*/
|
|
13
|
+
export type ApiResponse<Path extends ApiPath, Method extends "get" | "post" | "put" | "delete" = "get"> = ClientResponse<paths, Path, Method>;
|
|
14
|
+
/**
|
|
15
|
+
* Get execution context type for freestyle API
|
|
16
|
+
*/
|
|
17
|
+
export type ExecutionContext<Path extends ApiPath = ApiPath, Method extends HttpMethod = "get"> = KosExecutionContext<paths, Path, Method>;
|
|
18
|
+
/**
|
|
19
|
+
* Typed decorator factory for @kosServiceRequest with freestyle API types
|
|
20
|
+
*
|
|
21
|
+
* Provides full IntelliSense and type safety for path, query params, and body
|
|
22
|
+
* based on the freestyle OpenAPI schema.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { kosServiceRequest } from '../../utils/services/freestyle/1.6.5/service';
|
|
27
|
+
* import { DependencyLifecycle } from '@kosdev-code/kos-ui-sdk';
|
|
28
|
+
*
|
|
29
|
+
* @kosServiceRequest({
|
|
30
|
+
* path: '/api/...',
|
|
31
|
+
* method: 'get',
|
|
32
|
+
* lifecycle: DependencyLifecycle.LOAD
|
|
33
|
+
* })
|
|
34
|
+
* private onDataLoaded(): void {
|
|
35
|
+
* // Fully typed based on freestyle API
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function kosServiceRequest<Path extends ApiPath, Method extends HttpMethod = "get", Response = any, TransformedResponse = Response>(params: IKosServiceRequestParams<paths, Path, Method, Response, TransformedResponse>): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
40
|
+
/**
|
|
41
|
+
* Create an API client for freestyle
|
|
42
|
+
*/
|
|
43
|
+
export declare const api: {
|
|
44
|
+
get: <K extends "/api/ext/freestyle/can/read/float/{boardPath}/{index}/{subIndex}" | "/api/ext/freestyle/can/read/int/{boardPath}/{index}/{subIndex}" | "/api/ext/freestyle/can/stats" | "/api/ext/freestyle/can/stats/raw" | "/api/ext/freestyle/microCalibration/report/{board}" | "/api/ext/freestyle/microCalibration/cal/{pump}" | "/api/ext/freestyle/brandset/nutrition/{bevId}" | "/api/ext/freestyle/brandset/grantProperties" | "/api/ext/freestyle/fcm/calibration/{pump}/baseline" | "/api/ext/freestyle/fuelGauges/{holder}" | "/api/ext/freestyle/cartridges" | "/api/ext/freestyle/cartridges/{id}" | "/api/ext/freestyle/ice/types">(endpoint: K, params?: (paths[K]["get"] extends {
|
|
45
|
+
parameters: infer P;
|
|
46
|
+
} ? P : never) | undefined, options?: {
|
|
47
|
+
ordered?: boolean | undefined;
|
|
48
|
+
tracker?: string | undefined;
|
|
49
|
+
timeout?: number | undefined;
|
|
50
|
+
headers?: Record<string, string> | undefined;
|
|
51
|
+
fos?: boolean | undefined;
|
|
52
|
+
bridge?: boolean | undefined;
|
|
53
|
+
destinationAddress?: string | undefined;
|
|
54
|
+
studio?: boolean | undefined;
|
|
55
|
+
signal?: AbortSignal | undefined;
|
|
56
|
+
stream?: boolean | undefined;
|
|
57
|
+
responseType?: "text" | "json" | "arraybuffer" | "blob" | undefined;
|
|
58
|
+
} | undefined) => Promise<import('@kosdev-code/kos-ui-sdk').ServiceResponse<ClientResponse<paths, K, "get">>>;
|
|
59
|
+
post: <K_1 extends "/api/ext/freestyle/can/stats" | "/api/ext/freestyle/can/write/byte/{boardPath}/{index}/{subIndex}/{val}" | "/api/ext/freestyle/can/write/short/{boardPath}/{index}/{subIndex}/{val}" | "/api/ext/freestyle/can/write/float/{boardPath}/{index}/{subIndex}/{val}" | "/api/ext/freestyle/can/write/int/{boardPath}/{index}/{subIndex}/{val}" | "/api/ext/freestyle/fcm/diagnostics/{pump}/pressureTest" | "/api/ext/freestyle/fcm/diagnostics/{pump}/opennessTest" | "/api/ext/freestyle/fcm/diagnostics/{pump}/flowTest" | "/api/ext/freestyle/fcm/diagnostics/{pump}/electricalTest" | "/api/ext/freestyle/microCalibration/cal/{pump}/running/{val}" | "/api/ext/freestyle/microCalibration/cal/{pump}/code/{code}" | "/api/ext/freestyle/microCalibration/cal/{pump}/baseline/{val}" | "/api/ext/freestyle/microCalibration/cal/{pump}/both/{val}" | "/api/ext/freestyle/brandset/grantProperties" | "/api/ext/freestyle/fcm/calibration/{pump}/calibrate" | "/api/ext/freestyle/fcm/calibration/{pump}/preCalibrate" | "/api/ext/freestyle/fcm/calibration/{pump}/verify/{calVolume}" | "/api/ext/freestyle/fcm/calibration/{pump}/baseline/{value}" | "/api/ext/freestyle/fcm/calibration/{pump}/complete/{calVolume}/{verifyVolume}" | "/api/ext/freestyle/fuelGauges/{holder}/{val}" | "/api/ext/freestyle/ice/type/{path}/{type}">(endpoint: K_1, params?: (paths[K_1]["post"] extends {
|
|
60
|
+
parameters: infer P_1;
|
|
61
|
+
} ? P_1 : never) | undefined, body?: (paths[K_1]["post"] extends {
|
|
62
|
+
requestBody: {
|
|
63
|
+
content: infer B;
|
|
64
|
+
};
|
|
65
|
+
} ? B[keyof B] : never) | undefined, options?: {
|
|
66
|
+
ordered?: boolean | undefined;
|
|
67
|
+
tracker?: string | undefined;
|
|
68
|
+
timeout?: number | undefined;
|
|
69
|
+
headers?: Record<string, string> | undefined;
|
|
70
|
+
fos?: boolean | undefined;
|
|
71
|
+
bridge?: boolean | undefined;
|
|
72
|
+
destinationAddress?: string | undefined;
|
|
73
|
+
studio?: boolean | undefined;
|
|
74
|
+
signal?: AbortSignal | undefined;
|
|
75
|
+
stream?: boolean | undefined;
|
|
76
|
+
responseType?: "text" | "json" | "arraybuffer" | "blob" | undefined;
|
|
77
|
+
} | undefined) => Promise<import('@kosdev-code/kos-ui-sdk').ServiceResponse<ClientResponse<paths, K_1, "post">>>;
|
|
78
|
+
put: <K_2 extends never>(endpoint: K_2, params?: (paths[K_2]["put"] extends {
|
|
79
|
+
parameters: infer P_2;
|
|
80
|
+
} ? P_2 : never) | undefined, body?: (paths[K_2]["put"] extends {
|
|
81
|
+
requestBody: {
|
|
82
|
+
content: infer B_1;
|
|
83
|
+
};
|
|
84
|
+
} ? B_1[keyof B_1] : never) | undefined, options?: {
|
|
85
|
+
ordered?: boolean | undefined;
|
|
86
|
+
tracker?: string | undefined;
|
|
87
|
+
timeout?: number | undefined;
|
|
88
|
+
headers?: Record<string, string> | undefined;
|
|
89
|
+
fos?: boolean | undefined;
|
|
90
|
+
bridge?: boolean | undefined;
|
|
91
|
+
destinationAddress?: string | undefined;
|
|
92
|
+
studio?: boolean | undefined;
|
|
93
|
+
signal?: AbortSignal | undefined;
|
|
94
|
+
stream?: boolean | undefined;
|
|
95
|
+
responseType?: "text" | "json" | "arraybuffer" | "blob" | undefined;
|
|
96
|
+
} | undefined) => Promise<import('@kosdev-code/kos-ui-sdk').ServiceResponse<ClientResponse<paths, K_2, "put">>>;
|
|
97
|
+
delete: <K_3 extends never>(endpoint: K_3, params?: (paths[K_3]["delete"] extends {
|
|
98
|
+
parameters: infer P_3;
|
|
99
|
+
} ? P_3 : never) | undefined, body?: (paths[K_3]["put"] extends {
|
|
100
|
+
requestBody: {
|
|
101
|
+
content: infer B_1;
|
|
102
|
+
};
|
|
103
|
+
} ? B_1[keyof B_1] : never) | undefined, options?: {
|
|
104
|
+
ordered?: boolean | undefined;
|
|
105
|
+
tracker?: string | undefined;
|
|
106
|
+
timeout?: number | undefined;
|
|
107
|
+
headers?: Record<string, string> | undefined;
|
|
108
|
+
fos?: boolean | undefined;
|
|
109
|
+
bridge?: boolean | undefined;
|
|
110
|
+
destinationAddress?: string | undefined;
|
|
111
|
+
studio?: boolean | undefined;
|
|
112
|
+
signal?: AbortSignal | undefined;
|
|
113
|
+
stream?: boolean | undefined;
|
|
114
|
+
responseType?: "text" | "json" | "arraybuffer" | "blob" | undefined;
|
|
115
|
+
} | undefined) => Promise<import('@kosdev-code/kos-ui-sdk').ServiceResponse<ClientResponse<paths, K_3, "delete">>>;
|
|
116
|
+
};
|
|
117
|
+
export default api;
|
|
118
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/services/freestyle/1.6.5/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC;AACxB,MAAM,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC;AAClC,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,WAAW,CACrB,IAAI,SAAS,OAAO,EACpB,MAAM,SAAS,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,IACtD,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC1B,IAAI,SAAS,OAAO,GAAG,OAAO,EAC9B,MAAM,SAAS,UAAU,GAAG,KAAK,IAC/B,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,SAAS,OAAO,EACpB,MAAM,SAAS,UAAU,GAAG,KAAK,EACjC,QAAQ,GAAG,GAAG,EACd,mBAAmB,GAAG,QAAQ,EAE9B,MAAM,EAAE,wBAAwB,CAC9B,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,mBAAmB,CACpB,4FASF;AAED;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwB,CAAC;AAEzC,eAAe,GAAG,CAAC"}
|