@acorex-platform/extension-weather-core-gateway 0.0.24 → 0.0.28

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.
@@ -0,0 +1,59 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, inject } from '@angular/core';
3
+ import { getWeatherCondition, resolveWeatherConditionIcon, AXEWeatherQueryKeys } from '@acorex-platform/extension-weather-core-client/contracts';
4
+ import { AXPQueryService } from '@acorex-platform/framework-client/runtime';
5
+ import { runtimeQueryPayloadData } from '@acorex-platform/framework-shared/core';
6
+ import { from, switchMap, throwError, of, catchError } from 'rxjs';
7
+
8
+ //#region ---- Client weather API abstract ----
9
+ class AXPWeatherApiAbstract {
10
+ getCondition(id) {
11
+ return getWeatherCondition(id);
12
+ }
13
+ resolveConditionIcon(conditionId) {
14
+ return resolveWeatherConditionIcon(conditionId);
15
+ }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPWeatherApiAbstract, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
17
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPWeatherApiAbstract }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXPWeatherApiAbstract, decorators: [{
20
+ type: Injectable
21
+ }] });
22
+
23
+ //#region ---- Gateway weather API service ----
24
+ class AXEWeatherGatewayService extends AXPWeatherApiAbstract {
25
+ constructor() {
26
+ super(...arguments);
27
+ this.queryService = inject(AXPQueryService);
28
+ }
29
+ setApiKey(_key) {
30
+ // API keys are managed via Integrations settings on the server.
31
+ }
32
+ getWeather(options) {
33
+ return this.getForecast({ ...options, days: 1 });
34
+ }
35
+ getForecast(options) {
36
+ return from(this.queryService.fetch(AXEWeatherQueryKeys.GetForecast, options)).pipe(switchMap((result) => {
37
+ const data = runtimeQueryPayloadData(result);
38
+ if (!data) {
39
+ return throwError(() => new Error('Failed to fetch weather data'));
40
+ }
41
+ return of(data);
42
+ }), catchError((error) => {
43
+ const message = error?.message || 'Failed to fetch weather data';
44
+ return throwError(() => new Error(message));
45
+ }));
46
+ }
47
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherGatewayService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
48
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherGatewayService }); }
49
+ }
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherGatewayService, decorators: [{
51
+ type: Injectable
52
+ }] });
53
+
54
+ /**
55
+ * Generated bundle index. Do not edit.
56
+ */
57
+
58
+ export { AXEWeatherGatewayService, AXPWeatherApiAbstract };
59
+ //# sourceMappingURL=acorex-platform-extension-weather-core-gateway.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-weather-core-gateway.mjs","sources":["../../../../libs/extensions/weather/core/gateway/src/lib/weather-api.abstract.ts","../../../../libs/extensions/weather/core/gateway/src/lib/weather-gateway.service.ts","../../../../libs/extensions/weather/core/gateway/src/acorex-platform-extension-weather-core-gateway.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport {\n getWeatherCondition,\n resolveWeatherConditionIcon,\n type AXPWeatherData,\n type AXPWeatherForecastRequest,\n type AXPWeatherRequestOptions,\n} from '@acorex-platform/extension-weather-core-client/contracts';\n\n//#region ---- Client weather API abstract ----\n\n@Injectable()\nexport abstract class AXPWeatherApiAbstract {\n getCondition(id: string) {\n return getWeatherCondition(id);\n }\n\n resolveConditionIcon(conditionId: string): string {\n return resolveWeatherConditionIcon(conditionId);\n }\n\n abstract getWeather(options: AXPWeatherRequestOptions): Observable<AXPWeatherData>;\n\n abstract getForecast(options: AXPWeatherForecastRequest): Observable<AXPWeatherData>;\n\n abstract setApiKey(key: string): void;\n}\n\n//#endregion\n","import { AXPQueryService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXEWeatherQueryKeys,\n type AXPWeatherData,\n type AXPWeatherForecastRequest,\n type AXPWeatherRequestOptions,\n} from '@acorex-platform/extension-weather-core-client/contracts';\nimport { runtimeQueryPayloadData } from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, from, catchError, switchMap, of, throwError } from 'rxjs';\nimport { AXPWeatherApiAbstract } from './weather-api.abstract';\n\n//#region ---- Gateway weather API service ----\n\n@Injectable()\nexport class AXEWeatherGatewayService extends AXPWeatherApiAbstract {\n private readonly queryService = inject(AXPQueryService);\n\n override setApiKey(_key: string): void {\n // API keys are managed via Integrations settings on the server.\n }\n\n override getWeather(options: AXPWeatherRequestOptions): Observable<AXPWeatherData> {\n return this.getForecast({ ...options, days: 1 });\n }\n\n override getForecast(options: AXPWeatherForecastRequest): Observable<AXPWeatherData> {\n return from(\n this.queryService.fetch<AXPWeatherForecastRequest, AXPWeatherData>(AXEWeatherQueryKeys.GetForecast, options),\n ).pipe(\n switchMap((result) => {\n const data = runtimeQueryPayloadData(result);\n if (!data) {\n return throwError(() => new Error('Failed to fetch weather data'));\n }\n return of(data);\n }),\n catchError((error) => {\n const message = error?.message || 'Failed to fetch weather data';\n return throwError(() => new Error(message));\n }),\n );\n }\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;MAGsB,qBAAqB,CAAA;AACzC,IAAA,YAAY,CAAC,EAAU,EAAA;AACrB,QAAA,OAAO,mBAAmB,CAAC,EAAE,CAAC;IAChC;AAEA,IAAA,oBAAoB,CAAC,WAAmB,EAAA;AACtC,QAAA,OAAO,2BAA2B,CAAC,WAAW,CAAC;IACjD;8GAPoB,qBAAqB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xB,wBAAwB,EAAA,CAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;ACdD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,26 +1,27 @@
1
1
  {
2
2
  "name": "@acorex-platform/extension-weather-core-gateway",
3
- "version": "0.0.24",
3
+ "version": "0.0.28",
4
4
  "sideEffects": false,
5
- "type": "module",
6
- "main": "./src/index.js",
7
- "types": "./src/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./src/index.d.ts",
11
- "import": "./src/index.js",
12
- "default": "./src/index.js"
13
- }
14
- },
15
5
  "peerDependencies": {
16
- "@acorex-platform/extension-weather-core-client": "0.0.24",
17
- "@acorex-platform/framework-client": "0.0.24",
18
- "@acorex-platform/framework-shared": "0.0.24",
19
- "@angular/core": "^21.0.0",
6
+ "@acorex-platform/extension-weather-core-client": "0.0.28",
7
+ "@acorex-platform/framework-client": "0.0.28",
8
+ "@acorex-platform/framework-shared": "0.0.28",
9
+ "@angular/core": "^21.0.0 || ^22.0.0",
20
10
  "rxjs": "^7.8.0"
21
11
  },
22
12
  "dependencies": {
23
13
  "tslib": "^2.3.0"
24
14
  },
25
- "module": "./src/index.js"
15
+ "module": "fesm2022/acorex-platform-extension-weather-core-gateway.mjs",
16
+ "typings": "types/acorex-platform-extension-weather-core-gateway.d.ts",
17
+ "exports": {
18
+ "./package.json": {
19
+ "default": "./package.json"
20
+ },
21
+ ".": {
22
+ "types": "./types/acorex-platform-extension-weather-core-gateway.d.ts",
23
+ "default": "./fesm2022/acorex-platform-extension-weather-core-gateway.mjs"
24
+ }
25
+ },
26
+ "type": "module"
26
27
  }
@@ -0,0 +1,25 @@
1
+ import * as _acorex_platform_extension_weather_core_contracts from '@acorex-platform/extension-weather-core-client/contracts';
2
+ import { AXPWeatherRequestOptions, AXPWeatherData, AXPWeatherForecastRequest } from '@acorex-platform/extension-weather-core-client/contracts';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from '@angular/core';
5
+
6
+ declare abstract class AXPWeatherApiAbstract {
7
+ getCondition(id: string): _acorex_platform_extension_weather_core_contracts.AXPWeatherConditionDisplay;
8
+ resolveConditionIcon(conditionId: string): string;
9
+ abstract getWeather(options: AXPWeatherRequestOptions): Observable<AXPWeatherData>;
10
+ abstract getForecast(options: AXPWeatherForecastRequest): Observable<AXPWeatherData>;
11
+ abstract setApiKey(key: string): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPWeatherApiAbstract, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPWeatherApiAbstract>;
14
+ }
15
+
16
+ declare class AXEWeatherGatewayService extends AXPWeatherApiAbstract {
17
+ private readonly queryService;
18
+ setApiKey(_key: string): void;
19
+ getWeather(options: AXPWeatherRequestOptions): Observable<AXPWeatherData>;
20
+ getForecast(options: AXPWeatherForecastRequest): Observable<AXPWeatherData>;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEWeatherGatewayService, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXEWeatherGatewayService>;
23
+ }
24
+
25
+ export { AXEWeatherGatewayService, AXPWeatherApiAbstract };
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './lib/weather-api.abstract';
2
- export * from './lib/weather-gateway.service';
package/src/index.js DELETED
@@ -1,3 +0,0 @@
1
- export * from './lib/weather-api.abstract';
2
- export * from './lib/weather-gateway.service';
3
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/extensions/weather/core/gateway/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { type AXPWeatherData, type AXPWeatherForecastRequest, type AXPWeatherRequestOptions } from '@acorex-platform/extension-weather-core-client/contracts';
3
- export declare abstract class AXPWeatherApiAbstract {
4
- getCondition(id: string): import("@acorex-platform/extension-weather-core-client/contracts").AXPWeatherConditionDisplay;
5
- resolveConditionIcon(conditionId: string): string;
6
- abstract getWeather(options: AXPWeatherRequestOptions): Observable<AXPWeatherData>;
7
- abstract getForecast(options: AXPWeatherForecastRequest): Observable<AXPWeatherData>;
8
- abstract setApiKey(key: string): void;
9
- }
@@ -1,18 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { Injectable } from '@angular/core';
3
- import { getWeatherCondition, resolveWeatherConditionIcon, } from '@acorex-platform/extension-weather-core-client/contracts';
4
- //#region ---- Client weather API abstract ----
5
- let AXPWeatherApiAbstract = class AXPWeatherApiAbstract {
6
- getCondition(id) {
7
- return getWeatherCondition(id);
8
- }
9
- resolveConditionIcon(conditionId) {
10
- return resolveWeatherConditionIcon(conditionId);
11
- }
12
- };
13
- AXPWeatherApiAbstract = __decorate([
14
- Injectable()
15
- ], AXPWeatherApiAbstract);
16
- export { AXPWeatherApiAbstract };
17
- //#endregion
18
- //# sourceMappingURL=weather-api.abstract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"weather-api.abstract.js","sourceRoot":"","sources":["../../../../../../../../libs/extensions/weather/core/gateway/src/lib/weather-api.abstract.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,mBAAmB,EACnB,2BAA2B,GAI5B,MAAM,mDAAmD,CAAC;AAE3D,+CAA+C;AAGxC,IAAe,qBAAqB,GAApC,MAAe,qBAAqB;IACzC,YAAY,CAAC,EAAU;QACrB,OAAO,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,oBAAoB,CAAC,WAAmB;QACtC,OAAO,2BAA2B,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;CAOF,CAAA;AAdqB,qBAAqB;IAD1C,UAAU,EAAE;GACS,qBAAqB,CAc1C;;AAED,YAAY"}
@@ -1,9 +0,0 @@
1
- import { type AXPWeatherData, type AXPWeatherForecastRequest, type AXPWeatherRequestOptions } from '@acorex-platform/extension-weather-core-client/contracts';
2
- import { Observable } from 'rxjs';
3
- import { AXPWeatherApiAbstract } from './weather-api.abstract';
4
- export declare class AXEWeatherGatewayService extends AXPWeatherApiAbstract {
5
- private readonly queryService;
6
- setApiKey(_key: string): void;
7
- getWeather(options: AXPWeatherRequestOptions): Observable<AXPWeatherData>;
8
- getForecast(options: AXPWeatherForecastRequest): Observable<AXPWeatherData>;
9
- }
@@ -1,38 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { AXPQueryService } from '@acorex-platform/framework-client/runtime';
3
- import { AXEWeatherQueryKeys, } from '@acorex-platform/extension-weather-core-client/contracts';
4
- import { runtimeQueryPayloadData } from '@acorex-platform/framework-shared/core';
5
- import { inject, Injectable } from '@angular/core';
6
- import { from, catchError, switchMap, of, throwError } from 'rxjs';
7
- import { AXPWeatherApiAbstract } from './weather-api.abstract';
8
- //#region ---- Gateway weather API service ----
9
- let AXEWeatherGatewayService = class AXEWeatherGatewayService extends AXPWeatherApiAbstract {
10
- constructor() {
11
- super(...arguments);
12
- this.queryService = inject(AXPQueryService);
13
- }
14
- setApiKey(_key) {
15
- // API keys are managed via Integrations settings on the server.
16
- }
17
- getWeather(options) {
18
- return this.getForecast(Object.assign(Object.assign({}, options), { days: 1 }));
19
- }
20
- getForecast(options) {
21
- return from(this.queryService.fetch(AXEWeatherQueryKeys.GetForecast, options)).pipe(switchMap((result) => {
22
- const data = runtimeQueryPayloadData(result);
23
- if (!data) {
24
- return throwError(() => new Error('Failed to fetch weather data'));
25
- }
26
- return of(data);
27
- }), catchError((error) => {
28
- const message = (error === null || error === void 0 ? void 0 : error.message) || 'Failed to fetch weather data';
29
- return throwError(() => new Error(message));
30
- }));
31
- }
32
- };
33
- AXEWeatherGatewayService = __decorate([
34
- Injectable()
35
- ], AXEWeatherGatewayService);
36
- export { AXEWeatherGatewayService };
37
- //#endregion
38
- //# sourceMappingURL=weather-gateway.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"weather-gateway.service.js","sourceRoot":"","sources":["../../../../../../../../libs/extensions/weather/core/gateway/src/lib/weather-gateway.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EACL,mBAAmB,GAIpB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAc,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,+CAA+C;AAGxC,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,qBAAqB;IAA5D;;QACY,iBAAY,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;IA2B1D,CAAC;IAzBU,SAAS,CAAC,IAAY;QAC7B,gEAAgE;IAClE,CAAC;IAEQ,UAAU,CAAC,OAAiC;QACnD,OAAO,IAAI,CAAC,WAAW,iCAAM,OAAO,KAAE,IAAI,EAAE,CAAC,IAAG,CAAC;IACnD,CAAC;IAEQ,WAAW,CAAC,OAAkC;QACrD,OAAO,IAAI,CACT,IAAI,CAAC,YAAY,CAAC,KAAK,CAA4C,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAC7G,CAAC,IAAI,CACJ,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACnB,MAAM,IAAI,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;YAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QA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