test-api-client 0.0.1 → 0.0.3

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/index.d.mts CHANGED
@@ -594,4 +594,101 @@ declare const fenceQueryApi: (req: Partial<FenceQueryRequest>) => Promise<FenceQ
594
594
  */
595
595
  declare const fenceUpdateApi: (req: Partial<FenceUpdateRequest>) => Promise<FenceUpdateResponse>;
596
596
 
597
- export { type ApiApiResponse, type ApiClientConfig, ApiError, type ApiErrorType, type ApiLogLevel, type ApiStructuredHttpLog, ErrorLevel, FunctionModule, airlineAddApi, airlineListApi, airlineQueryApi, airlineUpdateApi, fenceAddApi, fenceListApi, fenceQueryApi, fenceUpdateApi, getApiToken, initApiClient, loginApi, logoutApi, refreshTokenApi, setApiToken, simulateNext401 };
597
+ /**
598
+ * 天气接口参数
599
+ */
600
+ interface WeatherParams {
601
+ /** 地理位置,此字段只要和经纬度选一,如果都传了,优先选择此字段 */
602
+ location?: string;
603
+ /** 经度,经纬度需同时存在 */
604
+ longitude?: number;
605
+ /** 纬度,经纬度需同时存在 */
606
+ latitude?: number;
607
+ }
608
+ /**
609
+ * 天气接口响应
610
+ */
611
+ interface WeatherResponse {
612
+ code: string;
613
+ msg: string;
614
+ sub_code: number;
615
+ sub_msg: string;
616
+ updateTime: string;
617
+ fxLink: string;
618
+ data: {
619
+ obsTime: string;
620
+ temp: string;
621
+ feelsLike: string;
622
+ icon: string;
623
+ text: string;
624
+ wind360: string;
625
+ windDir: string;
626
+ windScale: string;
627
+ windSpeed: string;
628
+ humidity: string;
629
+ precip: string;
630
+ pressure: string;
631
+ vis: string;
632
+ cloud: string;
633
+ dew: string;
634
+ };
635
+ }
636
+
637
+ /**
638
+ * 获取天气信息
639
+ * @param params 天气查询参数
640
+ * @returns 天气信息响应
641
+ */
642
+ declare const weatherQueryApi: (params: WeatherParams) => Promise<WeatherResponse>;
643
+
644
+ /**
645
+ * 文件上传响应
646
+ */
647
+ interface UploadFileResponse {
648
+ code: number;
649
+ msg: string;
650
+ sub_code: number;
651
+ sub_msg: string;
652
+ fileName: string;
653
+ }
654
+ /**
655
+ * 获取文件响应
656
+ */
657
+ interface GetFileResponse {
658
+ code: number;
659
+ msg: string;
660
+ sub_code: number;
661
+ sub_msg: string;
662
+ fileName: string;
663
+ fileBytes: number[];
664
+ }
665
+ /**
666
+ * 获取文件列表响应
667
+ */
668
+ interface GetFileListResponse {
669
+ code: number;
670
+ msg: string;
671
+ sub_code: number;
672
+ sub_msg: string;
673
+ fileList: string[];
674
+ }
675
+
676
+ /**
677
+ * 上传文件
678
+ * @param file 文件对象
679
+ * @returns 上传响应
680
+ */
681
+ declare const fileUploadApi: (file: File) => Promise<UploadFileResponse>;
682
+ /**
683
+ * 获取文件
684
+ * @param fileName 存储桶中文件名
685
+ * @returns 文件响应
686
+ */
687
+ declare const fileGetApi: (fileName: string) => Promise<GetFileResponse>;
688
+ /**
689
+ * 获取文件列表
690
+ * @returns 文件列表响应
691
+ */
692
+ declare const fileListApi: () => Promise<GetFileListResponse>;
693
+
694
+ export { type AirlineAddRequest, type AirlineAddResponse, type AirlineItem, type AirlineListRequest, type AirlineListResponse, type AirlineQueryRequest, type AirlineQueryResponse, type AirlineRoutePoint, type AirlineUpdateRequest, type AirlineUpdateResponse, type ApiApiResponse, type ApiClientConfig, ApiError, type ApiErrorType, type ApiLogLevel, type ApiStructuredHttpLog, ErrorLevel, type FenceAddRequest, type FenceAddResponse, type FenceEffectiveTime, type FenceItem, type FenceListRequest, type FenceListResponse, type FencePolygonVertex, type FenceQueryRequest, type FenceQueryResponse, type FenceSectorInfo, type FenceUpdateRequest, type FenceUpdateResponse, FunctionModule, type GetFileListResponse, type GetFileResponse, type LoginRequest, type LoginResponse, type LogoutRequest, type LogoutResponse, type RefreshTokenRequest, type RefreshTokenResponse, type UploadFileResponse, type WeatherParams, type WeatherResponse, airlineAddApi, airlineListApi, airlineQueryApi, airlineUpdateApi, fenceAddApi, fenceListApi, fenceQueryApi, fenceUpdateApi, fileGetApi, fileListApi, fileUploadApi, getApiToken, initApiClient, loginApi, logoutApi, refreshTokenApi, setApiToken, simulateNext401, weatherQueryApi };
package/dist/index.d.ts CHANGED
@@ -594,4 +594,101 @@ declare const fenceQueryApi: (req: Partial<FenceQueryRequest>) => Promise<FenceQ
594
594
  */
595
595
  declare const fenceUpdateApi: (req: Partial<FenceUpdateRequest>) => Promise<FenceUpdateResponse>;
596
596
 
597
- export { type ApiApiResponse, type ApiClientConfig, ApiError, type ApiErrorType, type ApiLogLevel, type ApiStructuredHttpLog, ErrorLevel, FunctionModule, airlineAddApi, airlineListApi, airlineQueryApi, airlineUpdateApi, fenceAddApi, fenceListApi, fenceQueryApi, fenceUpdateApi, getApiToken, initApiClient, loginApi, logoutApi, refreshTokenApi, setApiToken, simulateNext401 };
597
+ /**
598
+ * 天气接口参数
599
+ */
600
+ interface WeatherParams {
601
+ /** 地理位置,此字段只要和经纬度选一,如果都传了,优先选择此字段 */
602
+ location?: string;
603
+ /** 经度,经纬度需同时存在 */
604
+ longitude?: number;
605
+ /** 纬度,经纬度需同时存在 */
606
+ latitude?: number;
607
+ }
608
+ /**
609
+ * 天气接口响应
610
+ */
611
+ interface WeatherResponse {
612
+ code: string;
613
+ msg: string;
614
+ sub_code: number;
615
+ sub_msg: string;
616
+ updateTime: string;
617
+ fxLink: string;
618
+ data: {
619
+ obsTime: string;
620
+ temp: string;
621
+ feelsLike: string;
622
+ icon: string;
623
+ text: string;
624
+ wind360: string;
625
+ windDir: string;
626
+ windScale: string;
627
+ windSpeed: string;
628
+ humidity: string;
629
+ precip: string;
630
+ pressure: string;
631
+ vis: string;
632
+ cloud: string;
633
+ dew: string;
634
+ };
635
+ }
636
+
637
+ /**
638
+ * 获取天气信息
639
+ * @param params 天气查询参数
640
+ * @returns 天气信息响应
641
+ */
642
+ declare const weatherQueryApi: (params: WeatherParams) => Promise<WeatherResponse>;
643
+
644
+ /**
645
+ * 文件上传响应
646
+ */
647
+ interface UploadFileResponse {
648
+ code: number;
649
+ msg: string;
650
+ sub_code: number;
651
+ sub_msg: string;
652
+ fileName: string;
653
+ }
654
+ /**
655
+ * 获取文件响应
656
+ */
657
+ interface GetFileResponse {
658
+ code: number;
659
+ msg: string;
660
+ sub_code: number;
661
+ sub_msg: string;
662
+ fileName: string;
663
+ fileBytes: number[];
664
+ }
665
+ /**
666
+ * 获取文件列表响应
667
+ */
668
+ interface GetFileListResponse {
669
+ code: number;
670
+ msg: string;
671
+ sub_code: number;
672
+ sub_msg: string;
673
+ fileList: string[];
674
+ }
675
+
676
+ /**
677
+ * 上传文件
678
+ * @param file 文件对象
679
+ * @returns 上传响应
680
+ */
681
+ declare const fileUploadApi: (file: File) => Promise<UploadFileResponse>;
682
+ /**
683
+ * 获取文件
684
+ * @param fileName 存储桶中文件名
685
+ * @returns 文件响应
686
+ */
687
+ declare const fileGetApi: (fileName: string) => Promise<GetFileResponse>;
688
+ /**
689
+ * 获取文件列表
690
+ * @returns 文件列表响应
691
+ */
692
+ declare const fileListApi: () => Promise<GetFileListResponse>;
693
+
694
+ export { type AirlineAddRequest, type AirlineAddResponse, type AirlineItem, type AirlineListRequest, type AirlineListResponse, type AirlineQueryRequest, type AirlineQueryResponse, type AirlineRoutePoint, type AirlineUpdateRequest, type AirlineUpdateResponse, type ApiApiResponse, type ApiClientConfig, ApiError, type ApiErrorType, type ApiLogLevel, type ApiStructuredHttpLog, ErrorLevel, type FenceAddRequest, type FenceAddResponse, type FenceEffectiveTime, type FenceItem, type FenceListRequest, type FenceListResponse, type FencePolygonVertex, type FenceQueryRequest, type FenceQueryResponse, type FenceSectorInfo, type FenceUpdateRequest, type FenceUpdateResponse, FunctionModule, type GetFileListResponse, type GetFileResponse, type LoginRequest, type LoginResponse, type LogoutRequest, type LogoutResponse, type RefreshTokenRequest, type RefreshTokenResponse, type UploadFileResponse, type WeatherParams, type WeatherResponse, airlineAddApi, airlineListApi, airlineQueryApi, airlineUpdateApi, fenceAddApi, fenceListApi, fenceQueryApi, fenceUpdateApi, fileGetApi, fileListApi, fileUploadApi, getApiToken, initApiClient, loginApi, logoutApi, refreshTokenApi, setApiToken, simulateNext401, weatherQueryApi };
package/dist/index.js CHANGED
@@ -1070,6 +1070,43 @@ var fenceUpdateApi = async (req) => {
1070
1070
  }, "fenceUpdate");
1071
1071
  };
1072
1072
 
1073
+ // src/api/v1/weather.ts
1074
+ var weatherQueryApi = async (params) => {
1075
+ return requestData({
1076
+ url: "/api/v1/other/queryWeather",
1077
+ method: "POST",
1078
+ data: params
1079
+ }, "weatherQuery");
1080
+ };
1081
+
1082
+ // src/api/v1/file.ts
1083
+ var fileUploadApi = async (file) => {
1084
+ const formData = new FormData();
1085
+ formData.append("file", file);
1086
+ return requestData({
1087
+ url: "/api/v1/file/upload",
1088
+ method: "POST",
1089
+ data: formData,
1090
+ headers: {
1091
+ "Content-Type": "multipart/form-data"
1092
+ }
1093
+ }, "fileUpload");
1094
+ };
1095
+ var fileGetApi = async (fileName) => {
1096
+ return requestData({
1097
+ url: "/api/v1/file/bytes",
1098
+ method: "POST",
1099
+ data: { fileName }
1100
+ }, "fileGet");
1101
+ };
1102
+ var fileListApi = async () => {
1103
+ return requestData({
1104
+ url: "/api/v1/file/list",
1105
+ method: "POST",
1106
+ data: {}
1107
+ }, "fileList");
1108
+ };
1109
+
1073
1110
  exports.ApiError = ApiError;
1074
1111
  exports.ErrorLevel = ErrorLevel;
1075
1112
  exports.FunctionModule = FunctionModule;
@@ -1081,6 +1118,9 @@ exports.fenceAddApi = fenceAddApi;
1081
1118
  exports.fenceListApi = fenceListApi;
1082
1119
  exports.fenceQueryApi = fenceQueryApi;
1083
1120
  exports.fenceUpdateApi = fenceUpdateApi;
1121
+ exports.fileGetApi = fileGetApi;
1122
+ exports.fileListApi = fileListApi;
1123
+ exports.fileUploadApi = fileUploadApi;
1084
1124
  exports.getApiToken = getApiToken;
1085
1125
  exports.initApiClient = initApiClient;
1086
1126
  exports.loginApi = loginApi;
@@ -1088,5 +1128,6 @@ exports.logoutApi = logoutApi;
1088
1128
  exports.refreshTokenApi = refreshTokenApi;
1089
1129
  exports.setApiToken = setApiToken;
1090
1130
  exports.simulateNext401 = simulateNext401;
1131
+ exports.weatherQueryApi = weatherQueryApi;
1091
1132
  //# sourceMappingURL=index.js.map
1092
1133
  //# sourceMappingURL=index.js.map