@acorex-platform/extension-weather-weatherapi-client 0.0.21

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,123 @@
1
+ import { AXP_INTEGRATION_CONNECTION_STATUS, AXP_INTEGRATION_AUTH_METHOD_TYPE } from '@acorex-platform/framework-shared/core';
2
+ import { AXMIntegrationConnectionManager, hasConfiguredIntegrationCredentials, AXP_INTEGRATION_CREDENTIAL_MASK, isMaskedIntegrationCredential, toSafeIntegrationConnectionDto } from '@acorex-platform/module-integration-management-client';
3
+ import { AXPLayoutBuilderService, resolveLayoutBuilderDialogResult } from '@acorex-platform/framework-client/layout/builder';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Injectable } from '@angular/core';
6
+ import { trim } from 'lodash-es';
7
+ import { RootConfig } from '@acorex-platform/extension-weather-weatherapi-client/contracts';
8
+
9
+ //#region ----- Connect WeatherAPI -----
10
+ class ConnectWeatherApiCommand {
11
+ constructor() {
12
+ this.layoutBuilder = inject(AXPLayoutBuilderService);
13
+ this.connectionManager = inject(AXMIntegrationConnectionManager);
14
+ }
15
+ async execute(input = {}) {
16
+ try {
17
+ const providerId = input.providerId ?? RootConfig.integration.providerId;
18
+ const connectionScope = input.connectionScope ?? 'tenant';
19
+ const I18N = `@${RootConfig.config.i18n}:integration.connect`;
20
+ const existing = await this.connectionManager.findByUniqueKey({
21
+ providerId,
22
+ connectionScope,
23
+ connectionKey: 'default',
24
+ });
25
+ const isReconfigure = hasConfiguredIntegrationCredentials(existing);
26
+ const form = await this.openConnectDialog({
27
+ i18nPrefix: I18N,
28
+ isReconfigure,
29
+ apiKey: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',
30
+ });
31
+ if (!form) {
32
+ return { success: true, kind: 'object', data: { outcome: 'cancelled' } };
33
+ }
34
+ let apiKey = trim(form.apiKey);
35
+ if (isMaskedIntegrationCredential(apiKey) && existing) {
36
+ const config = (existing.config ?? {});
37
+ apiKey = trim(config.apiKey ?? '');
38
+ }
39
+ if (!apiKey) {
40
+ return {
41
+ success: false,
42
+ message: { text: `${I18N}.pat-dialog.messages.api-key-required` },
43
+ };
44
+ }
45
+ const connection = await this.connectionManager.upsertConnection({
46
+ providerId,
47
+ authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,
48
+ connectionScope,
49
+ connectionKey: 'default',
50
+ displayName: existing?.displayName ?? 'WeatherAPI.com',
51
+ instanceUrl: existing?.instanceUrl ?? null,
52
+ externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,
53
+ config: { apiKey },
54
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
55
+ isRevoked: false,
56
+ isDisabled: false,
57
+ });
58
+ return { success: true, kind: 'object',
59
+ data: { outcome: 'connected', connection: toSafeIntegrationConnectionDto(connection) },
60
+ };
61
+ }
62
+ catch (error) {
63
+ const message = error instanceof Error ? error.message : 'Failed to connect WeatherAPI.';
64
+ return { success: false, message: { text: message } };
65
+ }
66
+ }
67
+ async openConnectDialog(input) {
68
+ const result = await this.layoutBuilder
69
+ .create()
70
+ .dialog((dialog) => {
71
+ dialog
72
+ .setTitle(input.isReconfigure
73
+ ? `${input.i18nPrefix}.pat-dialog.configure-title`
74
+ : `${input.i18nPrefix}.pat-dialog.title`)
75
+ .setSize('md')
76
+ .setCloseButton(true)
77
+ .setContext({ apiKey: input.apiKey })
78
+ .content((flex) => {
79
+ flex
80
+ .setDirection('column')
81
+ .setGap('12px')
82
+ .customWidget('text-block-layout', {
83
+ content: `${input.i18nPrefix}.pat-dialog.instructions`,
84
+ })
85
+ .formField(`${input.i18nPrefix}.pat-dialog.fields.api-key`, (field) => {
86
+ field.path('apiKey');
87
+ field.passwordBox({
88
+ placeholder: `${input.i18nPrefix}.pat-dialog.placeholders.api-key`,
89
+ revealToggle: true,
90
+ validations: [{ rule: 'required' }],
91
+ });
92
+ });
93
+ })
94
+ .setActions((actions) => {
95
+ actions
96
+ .cancel('@general:actions.cancel.title')
97
+ .submit(`${input.i18nPrefix}.pat-dialog.actions.save`);
98
+ })
99
+ .onAction(async (ref) => {
100
+ if (ref.action() === 'cancel') {
101
+ return null;
102
+ }
103
+ const ctx = ref.context();
104
+ const apiKey = trim(ctx.apiKey ?? '');
105
+ if (!apiKey) {
106
+ throw new Error(`${input.i18nPrefix}.pat-dialog.messages.api-key-required`);
107
+ }
108
+ return { apiKey };
109
+ });
110
+ })
111
+ .show();
112
+ return resolveLayoutBuilderDialogResult(result);
113
+ }
114
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectWeatherApiCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
115
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectWeatherApiCommand, providedIn: 'root' }); }
116
+ }
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectWeatherApiCommand, decorators: [{
118
+ type: Injectable,
119
+ args: [{ providedIn: 'root' }]
120
+ }] });
121
+
122
+ export { ConnectWeatherApiCommand };
123
+ //# sourceMappingURL=acorex-platform-extension-weather-weatherapi-client-connect-weatherapi.command-DoA8637T.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-weather-weatherapi-client-connect-weatherapi.command-DoA8637T.mjs","sources":["../../../../libs/extensions/weather/weatherapi/client/src/lib/features/connect/connect-weatherapi.command.ts"],"sourcesContent":["import { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\n type AXPRuntimeCommandResult,\n type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXMIntegrationConnectionManager,\n AXP_INTEGRATION_CREDENTIAL_MASK,\n hasConfiguredIntegrationCredentials,\n isMaskedIntegrationCredential,\n toSafeIntegrationConnectionDto,\n type ConnectCommandResult,\n} from '@acorex-platform/module-integration-management-client';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { Injectable, inject } from '@angular/core';\nimport { trim } from 'lodash-es';\nimport { RootConfig } from '@acorex-platform/extension-weather-weatherapi-client/contracts';\n\nexport interface ConnectWeatherApiCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface WeatherApiConnectFormResult {\n apiKey: string;\n}\n\n//#region ----- Connect WeatherAPI -----\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectWeatherApiCommand implements AXPCommand<ConnectWeatherApiCommandInput, ConnectCommandResult> {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n\n async execute(input: ConnectWeatherApiCommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? RootConfig.integration.providerId;\n const connectionScope = input.connectionScope ?? 'tenant';\n const I18N = `@${RootConfig.config.i18n}:integration.connect`;\n const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n const isReconfigure = hasConfiguredIntegrationCredentials(existing);\n\n const form = await this.openConnectDialog({\n i18nPrefix: I18N,\n isReconfigure,\n apiKey: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n let apiKey = trim(form.apiKey);\n if (isMaskedIntegrationCredential(apiKey) && existing) {\n const config = (existing.config ?? {}) as { apiKey?: string };\n apiKey = trim(config.apiKey ?? '');\n }\n if (!apiKey) {\n return {\n success: false,\n message: { text: `${I18N}.pat-dialog.messages.api-key-required` },\n };\n }\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,\n connectionScope,\n connectionKey: 'default',\n displayName: existing?.displayName ?? 'WeatherAPI.com',\n instanceUrl: existing?.instanceUrl ?? null,\n externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,\n config: { apiKey },\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n return { success: true, kind: 'object',\n data: { outcome: 'connected', connection: toSafeIntegrationConnectionDto(connection) },\n };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to connect WeatherAPI.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async openConnectDialog(input: {\n i18nPrefix: string;\n isReconfigure: boolean;\n apiKey: string;\n }): Promise<WeatherApiConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<WeatherApiConnectFormResult | null>((dialog: IDialogBuilder<WeatherApiConnectFormResult | null>) => {\n dialog\n .setTitle(\n input.isReconfigure\n ? `${input.i18nPrefix}.pat-dialog.configure-title`\n : `${input.i18nPrefix}.pat-dialog.title`,\n )\n .setSize('md')\n .setCloseButton(true)\n .setContext({ apiKey: input.apiKey })\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: `${input.i18nPrefix}.pat-dialog.instructions`,\n })\n .formField(`${input.i18nPrefix}.pat-dialog.fields.api-key`, (field) => {\n field.path('apiKey');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.pat-dialog.placeholders.api-key`,\n revealToggle: true,\n validations: [{ rule: 'required' }],\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(`${input.i18nPrefix}.pat-dialog.actions.save`);\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n const ctx = ref.context() as { apiKey?: string };\n const apiKey = trim(ctx.apiKey ?? '');\n if (!apiKey) {\n throw new Error(`${input.i18nPrefix}.pat-dialog.messages.api-key-required`);\n }\n return { apiKey };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<WeatherApiConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAoCA;MAGa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;AAiH7E,IAAA;AA/GC,IAAA,MAAM,OAAO,CAAC,KAAA,GAAuC,EAAE,EAAA;AACrD,QAAA,IAAI;YACF,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,UAAU,CAAC,WAAW,CAAC,UAAU;AACxE,YAAA,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,QAAQ;YACzD,MAAM,IAAI,GAAG,CAAA,CAAA,EAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAA,CAAsB;YAC7D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC;gBAC5D,UAAU;gBACV,eAAe;AACf,gBAAA,aAAa,EAAE,SAAS;AACzB,aAAA,CAAC;AACF,YAAA,MAAM,aAAa,GAAG,mCAAmC,CAAC,QAAQ,CAAC;AAEnE,YAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC;AACxC,gBAAA,UAAU,EAAE,IAAI;gBAChB,aAAa;gBACb,MAAM,EAAE,aAAa,GAAG,+BAA+B,GAAG,EAAE;AAC7D,aAAA,CAAC;YAEF,IAAI,CAAC,IAAI,EAAE;AACT,gBAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,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AAU,CAAA,wBAAA,CAA0B,CAAC;AAC1D,YAAA,CAAC;AACA,iBAAA,QAAQ,CAAC,OAAO,GAAiB,KAAI;AACpC,gBAAA,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,QAAQ,EAAE;AAC7B,oBAAA,OAAO,IAAI;gBACb;AACA,gBAAA,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,EAAyB;gBAChD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;gBACrC,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,IAAI,KAAK,CAAC,CAAA,EAAG,KAAK,CAAC,UAAU,CAAA,qCAAA,CAAuC,CAAC;gBAC7E;gBACA,OAAO,EAAE,MAAM,EAAE;AACnB,YAAA,CAAC,CAAC;AACN,QAAA,CAAC;AACA,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAA8B,MAAM,CAAC;IAC9E;8GAlHW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cADX,MAAM,EAAA,CAAA,CAAA;;2FACnB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,39 @@
1
+ //#region ---- WeatherAPI extension config ----
2
+ const config = {
3
+ i18n: 'extensions-weatherapi',
4
+ };
5
+ const MODULE_NAME = 'WeatherApiExtension';
6
+ const RootConfig = {
7
+ config,
8
+ module: {
9
+ name: MODULE_NAME,
10
+ title: `@${config.i18n}:integration.display-name`,
11
+ icon: 'fa-light fa-cloud-sun-rain',
12
+ },
13
+ integration: {
14
+ providerId: 'weatherapi',
15
+ },
16
+ };
17
+ //#endregion
18
+
19
+ var AXEWeatherApiCommandKeys;
20
+ (function (AXEWeatherApiCommandKeys) {
21
+ AXEWeatherApiCommandKeys["ConnectionConnect"] = "WeatherApiExtension:Command:Connection.Connect";
22
+ })(AXEWeatherApiCommandKeys || (AXEWeatherApiCommandKeys = {}));
23
+
24
+ //#region ---- WeatherAPI tenant connection config ----
25
+ //#endregion
26
+
27
+ //#region ---- WeatherAPI extension settings ----
28
+ var AXEWeatherApiSettingKeys;
29
+ (function (AXEWeatherApiSettingKeys) {
30
+ AXEWeatherApiSettingKeys["ApiKey"] = "WeatherApiExtension:Setting:ApiKey";
31
+ })(AXEWeatherApiSettingKeys || (AXEWeatherApiSettingKeys = {}));
32
+ //#endregion
33
+
34
+ /**
35
+ * Generated bundle index. Do not edit.
36
+ */
37
+
38
+ export { AXEWeatherApiCommandKeys, AXEWeatherApiSettingKeys, RootConfig };
39
+ //# sourceMappingURL=acorex-platform-extension-weather-weatherapi-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-weather-weatherapi-client-contracts.mjs","sources":["../../../../libs/extensions/weather/weatherapi/contracts/src/root-config.ts","../../../../libs/extensions/weather/weatherapi/contracts/src/commands.keys.ts","../../../../libs/extensions/weather/weatherapi/contracts/src/connection.types.ts","../../../../libs/extensions/weather/weatherapi/contracts/src/settings.keys.ts","../../../../libs/extensions/weather/weatherapi/contracts/src/acorex-platform-extension-weather-weatherapi-client-contracts.ts"],"sourcesContent":["//#region ---- WeatherAPI extension config ----\n\nconst config = {\n i18n: 'extensions-weatherapi',\n};\n\nconst MODULE_NAME = 'WeatherApiExtension';\n\nexport const RootConfig = {\n config,\n module: {\n name: MODULE_NAME,\n title: `@${config.i18n}:integration.display-name`,\n icon: 'fa-light fa-cloud-sun-rain',\n },\n integration: {\n providerId: 'weatherapi',\n },\n};\n\n//#endregion\n","export enum AXEWeatherApiCommandKeys {\n ConnectionConnect = 'WeatherApiExtension:Command:Connection.Connect',\n}\n","//#region ---- WeatherAPI tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for server-side weather calls. */\nexport interface AXEWeatherApiConnectionConfig {\n apiKey?: string;\n}\n\n//#endregion\n","//#region ---- WeatherAPI extension settings ----\n\nexport enum AXEWeatherApiSettingKeys {\n ApiKey = 'WeatherApiExtension:Setting:ApiKey',\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;AAEA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,uBAAuB;CAC9B;AAED,MAAM,WAAW,GAAG,qBAAqB;AAElC,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAA,yBAAA,CAA2B;AACjD,QAAA,IAAI,EAAE,4BAA4B;AACnC,KAAA;AACD,IAAA,WAAW,EAAE;AACX,QAAA,UAAU,EAAE,YAAY;AACzB,KAAA;;AAGH;;ICpBY;AAAZ,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,mBAAA,CAAA,GAAA,gDAAoE;AACtE,CAAC,EAFW,wBAAwB,KAAxB,wBAAwB,GAAA,EAAA,CAAA,CAAA;;ACApC;AAOA;;ACPA;IAEY;AAAZ,CAAA,UAAY,wBAAwB,EAAA;AAClC,IAAA,wBAAA,CAAA,QAAA,CAAA,GAAA,oCAA6C;AAC/C,CAAC,EAFW,wBAAwB,KAAxB,wBAAwB,GAAA,EAAA,CAAA,CAAA;AAIpC;;ACNA;;AAEG;;;;"}
@@ -0,0 +1,173 @@
1
+ import { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';
2
+ import { AXP_INTEGRATION_SECRET_STORE, AXP_INTEGRATION_RUNTIME_PROVIDER, AXP_INTEGRATION_PROVIDER } from '@acorex-platform/framework-client/common';
3
+ import { AXP_LOGO_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER } from '@acorex-platform/framework-client/core';
4
+ import { provideCommandSetups } from '@acorex-platform/framework-client/runtime';
5
+ import * as i0 from '@angular/core';
6
+ import { Injectable, inject, NgModule } from '@angular/core';
7
+ import { RootConfig, AXEWeatherApiCommandKeys } from '@acorex-platform/extension-weather-weatherapi-client/contracts';
8
+ import { AXPWidgetsList, AXP_INTEGRATION_AUTH_METHOD_TYPE, AXP_INTEGRATION_CONNECTION_SCOPE, AXP_INTEGRATION_CONNECTION_STATUS } from '@acorex-platform/framework-shared/core';
9
+ import { AXE_WEATHER_DOMAIN_ID } from '@acorex-platform/extension-weather-core-client/contracts';
10
+ import { trim, defaultTo } from 'lodash-es';
11
+
12
+ //#region ---- WeatherAPI logo registry key ----
13
+ const axpWeatherApiLogoKey = 'weatherapi';
14
+ /** Mark artwork (739×1024); consuming apps copy to `assets/images/brand/integrations/`. */
15
+ const AXE_WEATHERAPI_MARK_SRC = 'assets/images/brand/integrations/weatherapi-mark.svg';
16
+ /** Source mark dimensions (739×1024). */
17
+ const AXE_WEATHERAPI_MARK_ASPECT = 739 / 1024;
18
+ //#endregion
19
+
20
+ const weatherApiLogoProvider = {
21
+ key: axpWeatherApiLogoKey,
22
+ resolve: async (request) => ({
23
+ kind: 'image',
24
+ src: AXE_WEATHERAPI_MARK_SRC,
25
+ height: request.size,
26
+ width: Math.round(request.size * AXE_WEATHERAPI_MARK_ASPECT),
27
+ }),
28
+ };
29
+ const AXE_WEATHERAPI_LOGO_PROVIDER = {
30
+ provide: AXP_LOGO_PROVIDER,
31
+ useValue: weatherApiLogoProvider,
32
+ multi: true,
33
+ };
34
+
35
+ class AXEWeatherApiIntegrationProvider {
36
+ async provide(context) {
37
+ const I18N = `@${RootConfig.config.i18n}:integration`;
38
+ context.register({
39
+ id: RootConfig.integration.providerId,
40
+ domainId: AXE_WEATHER_DOMAIN_ID,
41
+ module: RootConfig.module.name,
42
+ displayName: `${I18N}.display-name`,
43
+ description: `${I18N}.description`,
44
+ icon: RootConfig.module.icon,
45
+ logoKey: axpWeatherApiLogoKey,
46
+ connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],
47
+ allowMultipleConnections: false,
48
+ defaultConnectionKey: 'default',
49
+ connectCommandKey: AXEWeatherApiCommandKeys.ConnectionConnect,
50
+ authMethods: [
51
+ {
52
+ type: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,
53
+ label: `${I18N}.auth.pat.label`,
54
+ instructions: `${I18N}.auth.pat.instructions`,
55
+ supportsValidation: true,
56
+ fields: [
57
+ {
58
+ type: AXPWidgetsList.Editors.PasswordBox,
59
+ path: 'token',
60
+ options: { placeholder: `${I18N}.auth.pat.token.placeholder` },
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ });
66
+ }
67
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiIntegrationProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiIntegrationProvider }); }
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiIntegrationProvider, decorators: [{
71
+ type: Injectable
72
+ }] });
73
+
74
+ class AXEWeatherApiIntegrationRuntimeProvider {
75
+ constructor() {
76
+ this.providerId = RootConfig.integration.providerId;
77
+ this.secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });
78
+ }
79
+ async getHooks() {
80
+ return {
81
+ validateConnection: (ctx) => this.validateConnection(ctx),
82
+ };
83
+ }
84
+ async validateConnection(ctx) {
85
+ const apiKey = await this.resolveApiKey(ctx);
86
+ if (!trim(defaultTo(apiKey, ''))) {
87
+ return {
88
+ valid: false,
89
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,
90
+ errorMessage: 'No API key available for WeatherAPI connection.',
91
+ };
92
+ }
93
+ return {
94
+ valid: true,
95
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
96
+ externalAccountName: 'WeatherAPI.com',
97
+ };
98
+ }
99
+ async resolveApiKey(ctx) {
100
+ const configKey = ctx.config?.apiKey;
101
+ if (trim(defaultTo(configKey, ''))) {
102
+ return configKey;
103
+ }
104
+ if (!this.secretStore) {
105
+ return undefined;
106
+ }
107
+ const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);
108
+ return credentials.token;
109
+ }
110
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiIntegrationRuntimeProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
111
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiIntegrationRuntimeProvider }); }
112
+ }
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiIntegrationRuntimeProvider, decorators: [{
114
+ type: Injectable
115
+ }] });
116
+ const provideWeatherApiIntegrationRuntimeProvider = {
117
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
118
+ useClass: AXEWeatherApiIntegrationRuntimeProvider,
119
+ multi: true,
120
+ };
121
+
122
+ const WeatherApiExtensionManifest = {
123
+ name: RootConfig.module.name,
124
+ version: '1.0.0',
125
+ title: RootConfig.module.title,
126
+ icon: RootConfig.module.icon,
127
+ i18n: RootConfig.config.i18n,
128
+ type: 'integration',
129
+ domain: 'weather',
130
+ dependencies: [],
131
+ };
132
+
133
+ class AXEWeatherApiExtensionModule {
134
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
135
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiExtensionModule, imports: [AXMIntegrationManagementModule] }); }
136
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiExtensionModule, providers: [
137
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: WeatherApiExtensionManifest, multi: true },
138
+ AXE_WEATHERAPI_LOGO_PROVIDER,
139
+ { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEWeatherApiIntegrationProvider, multi: true },
140
+ provideWeatherApiIntegrationRuntimeProvider,
141
+ provideCommandSetups([
142
+ {
143
+ key: AXEWeatherApiCommandKeys.ConnectionConnect,
144
+ command: () => import('./acorex-platform-extension-weather-weatherapi-client-connect-weatherapi.command-DoA8637T.mjs').then((c) => c.ConnectWeatherApiCommand),
145
+ },
146
+ ]),
147
+ ], imports: [AXMIntegrationManagementModule] }); }
148
+ }
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEWeatherApiExtensionModule, decorators: [{
150
+ type: NgModule,
151
+ args: [{
152
+ imports: [AXMIntegrationManagementModule],
153
+ providers: [
154
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: WeatherApiExtensionManifest, multi: true },
155
+ AXE_WEATHERAPI_LOGO_PROVIDER,
156
+ { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEWeatherApiIntegrationProvider, multi: true },
157
+ provideWeatherApiIntegrationRuntimeProvider,
158
+ provideCommandSetups([
159
+ {
160
+ key: AXEWeatherApiCommandKeys.ConnectionConnect,
161
+ command: () => import('./acorex-platform-extension-weather-weatherapi-client-connect-weatherapi.command-DoA8637T.mjs').then((c) => c.ConnectWeatherApiCommand),
162
+ },
163
+ ]),
164
+ ],
165
+ }]
166
+ }] });
167
+
168
+ /**
169
+ * Generated bundle index. Do not edit.
170
+ */
171
+
172
+ export { AXEWeatherApiExtensionModule, AXE_WEATHERAPI_LOGO_PROVIDER, AXE_WEATHERAPI_MARK_ASPECT, AXE_WEATHERAPI_MARK_SRC, axpWeatherApiLogoKey };
173
+ //# sourceMappingURL=acorex-platform-extension-weather-weatherapi-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-weather-weatherapi-client.mjs","sources":["../../../../libs/extensions/weather/weatherapi/client/src/lib/brand/weatherapi-logo-key.ts","../../../../libs/extensions/weather/weatherapi/client/src/lib/brand/weatherapi-logo.provider.ts","../../../../libs/extensions/weather/weatherapi/client/src/lib/integration/weatherapi.integration.provider.ts","../../../../libs/extensions/weather/weatherapi/client/src/lib/integration/weatherapi.integration-runtime.provider.ts","../../../../libs/extensions/weather/weatherapi/client/src/lib/manifest.ts","../../../../libs/extensions/weather/weatherapi/client/src/lib/weatherapi-extension.module.ts","../../../../libs/extensions/weather/weatherapi/client/src/acorex-platform-extension-weather-weatherapi-client.ts"],"sourcesContent":["//#region ---- WeatherAPI logo registry key ----\n\nexport const axpWeatherApiLogoKey = 'weatherapi' as const;\n\n/** Mark artwork (739×1024); consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_WEATHERAPI_MARK_SRC = 'assets/images/brand/integrations/weatherapi-mark.svg';\n\n/** Source mark dimensions (739×1024). */\nexport const AXE_WEATHERAPI_MARK_ASPECT = 739 / 1024;\n\n//#endregion\n","import {\n AXP_LOGO_PROVIDER,\n type AXPLogoProvider,\n type AXPLogoRequest,\n type AXPLogoView,\n} from '@acorex-platform/framework-client/core';\nimport {\n AXE_WEATHERAPI_MARK_ASPECT,\n AXE_WEATHERAPI_MARK_SRC,\n axpWeatherApiLogoKey,\n} from './weatherapi-logo-key';\n\nconst weatherApiLogoProvider: AXPLogoProvider = {\n key: axpWeatherApiLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_WEATHERAPI_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_WEATHERAPI_MARK_ASPECT),\n }),\n};\n\nexport const AXE_WEATHERAPI_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: weatherApiLogoProvider,\n multi: true,\n} as const;\n","import {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXPWidgetsList,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationProvider, AXPIntegrationProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport { AXE_WEATHER_DOMAIN_ID } from '@acorex-platform/extension-weather-core-client/contracts';\nimport { AXEWeatherApiCommandKeys, RootConfig } from '@acorex-platform/extension-weather-weatherapi-client/contracts';\nimport { axpWeatherApiLogoKey } from '../brand/weatherapi-logo-key';\n\n@Injectable()\nexport class AXEWeatherApiIntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n id: RootConfig.integration.providerId,\n domainId: AXE_WEATHER_DOMAIN_ID,\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpWeatherApiLogoKey,\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n allowMultipleConnections: false,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEWeatherApiCommandKeys.ConnectionConnect,\n authMethods: [\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,\n label: `${I18N}.auth.pat.label`,\n instructions: `${I18N}.auth.pat.instructions`,\n supportsValidation: true,\n fields: [\n {\n type: AXPWidgetsList.Editors.PasswordBox,\n path: 'token',\n options: { placeholder: `${I18N}.auth.pat.token.placeholder` },\n },\n ],\n },\n ],\n });\n }\n}\n","import {\n AXP_INTEGRATION_CONNECTION_STATUS,\n type AXPIntegrationProviderRuntimeHooks,\n type AXPIntegrationRuntimeContext,\n type AXPIntegrationValidationResult,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXP_INTEGRATION_RUNTIME_PROVIDER,\n AXP_INTEGRATION_SECRET_STORE,\n type AXPIntegrationRuntimeProvider,\n} from '@acorex-platform/framework-client/common';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, trim } from 'lodash-es';\nimport { RootConfig } from '@acorex-platform/extension-weather-weatherapi-client/contracts';\n\n@Injectable()\nexport class AXEWeatherApiIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = RootConfig.integration.providerId;\n\n private readonly secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });\n\n async getHooks(): Promise<AXPIntegrationProviderRuntimeHooks> {\n return {\n validateConnection: (ctx) => this.validateConnection(ctx),\n };\n }\n\n private async validateConnection(ctx: AXPIntegrationRuntimeContext): Promise<AXPIntegrationValidationResult> {\n const apiKey = await this.resolveApiKey(ctx);\n if (!trim(defaultTo(apiKey, ''))) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'No API key available for WeatherAPI connection.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: 'WeatherAPI.com',\n };\n }\n\n private async resolveApiKey(ctx: AXPIntegrationRuntimeContext): Promise<string | undefined> {\n const configKey = (ctx.config as { apiKey?: string } | null)?.apiKey;\n if (trim(defaultTo(configKey, ''))) {\n return configKey;\n }\n\n if (!this.secretStore) {\n return undefined;\n }\n\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n return credentials.token;\n }\n}\n\nexport const provideWeatherApiIntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEWeatherApiIntegrationRuntimeProvider,\n multi: true,\n};\n","import { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-weather-weatherapi-client/contracts';\n\nexport const WeatherApiExtensionManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'integration',\n domain: 'weather',\n dependencies: [],\n};\n","import { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';\nimport { AXP_INTEGRATION_PROVIDER } from '@acorex-platform/framework-client/common';\nimport { AXP_MODULE_MANIFEST_PROVIDER } from '@acorex-platform/framework-client/core';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { NgModule } from '@angular/core';\nimport { AXEWeatherApiCommandKeys } from '@acorex-platform/extension-weather-weatherapi-client/contracts';\nimport { AXE_WEATHERAPI_LOGO_PROVIDER } from './brand/weatherapi-logo.provider';\nimport { AXEWeatherApiIntegrationProvider } from './integration/weatherapi.integration.provider';\nimport { provideWeatherApiIntegrationRuntimeProvider } from './integration/weatherapi.integration-runtime.provider';\nimport { WeatherApiExtensionManifest } from './manifest';\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: WeatherApiExtensionManifest, multi: true },\n AXE_WEATHERAPI_LOGO_PROVIDER,\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEWeatherApiIntegrationProvider, multi: true },\n provideWeatherApiIntegrationRuntimeProvider,\n provideCommandSetups([\n {\n key: AXEWeatherApiCommandKeys.ConnectionConnect,\n command: () =>\n import('./features/connect/connect-weatherapi.command').then((c) => c.ConnectWeatherApiCommand),\n },\n ]),\n ],\n})\nexport class AXEWeatherApiExtensionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAEO,MAAM,oBAAoB,GAAG;AAEpC;AACO,MAAM,uBAAuB,GAAG;AAEvC;AACO,MAAM,0BAA0B,GAAG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BACT,EAAE,OAAO,EAAE,4BAA4B,EAAE,QAAQ,EAAE,2BAA2B,EAAE,KAAK,EAAE,IAAI,EAAE;wBAC7F,4BAA4B;wBAC5B,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,gCAAgC,EAAE,KAAK,EAAE,IAAI,EAAE;wBAC9F,2CAA2C;AAC3C,wBAAA,oBAAoB,CAAC;AACnB,4BAAA;gCACE,GAAG,EAAE,wBAAwB,CAAC,iBAAiB;AAC/C,gCAAA,OAAO,EAAE,MACP,OAAO,+FAA+C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,wBAAwB,CAAC;AAClG,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;AC1BD;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@acorex-platform/extension-weather-weatherapi-client",
3
+ "version": "0.0.21",
4
+ "sideEffects": false,
5
+ "peerDependencies": {
6
+ "@angular/common": "^21.0.0",
7
+ "@angular/core": "^21.0.0"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "^2.3.0"
11
+ },
12
+ "module": "fesm2022/acorex-platform-extension-weather-weatherapi-client.mjs",
13
+ "typings": "types/acorex-platform-extension-weather-weatherapi-client.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/acorex-platform-extension-weather-weatherapi-client.d.ts",
20
+ "default": "./fesm2022/acorex-platform-extension-weather-weatherapi-client.mjs"
21
+ },
22
+ "./contracts": {
23
+ "types": "./types/acorex-platform-extension-weather-weatherapi-client-contracts.d.ts",
24
+ "default": "./fesm2022/acorex-platform-extension-weather-weatherapi-client-contracts.mjs"
25
+ }
26
+ },
27
+ "type": "module"
28
+ }
@@ -0,0 +1,29 @@
1
+ declare const RootConfig: {
2
+ config: {
3
+ i18n: string;
4
+ };
5
+ module: {
6
+ name: string;
7
+ title: string;
8
+ icon: string;
9
+ };
10
+ integration: {
11
+ providerId: string;
12
+ };
13
+ };
14
+
15
+ declare enum AXEWeatherApiCommandKeys {
16
+ ConnectionConnect = "WeatherApiExtension:Command:Connection.Connect"
17
+ }
18
+
19
+ /** Stored on IntegrationManagement connection `config` for server-side weather calls. */
20
+ interface AXEWeatherApiConnectionConfig {
21
+ apiKey?: string;
22
+ }
23
+
24
+ declare enum AXEWeatherApiSettingKeys {
25
+ ApiKey = "WeatherApiExtension:Setting:ApiKey"
26
+ }
27
+
28
+ export { AXEWeatherApiCommandKeys, AXEWeatherApiSettingKeys, RootConfig };
29
+ export type { AXEWeatherApiConnectionConfig };
@@ -0,0 +1,23 @@
1
+ import * as i0 from '@angular/core';
2
+ import * as i1 from '@acorex-platform/module-integration-management-client';
3
+ import { AXPLogoProvider } from '@acorex-platform/framework-client/core';
4
+
5
+ declare class AXEWeatherApiExtensionModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEWeatherApiExtensionModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AXEWeatherApiExtensionModule, never, [typeof i1.AXMIntegrationManagementModule], never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<AXEWeatherApiExtensionModule>;
9
+ }
10
+
11
+ declare const axpWeatherApiLogoKey: "weatherapi";
12
+ /** Mark artwork (739×1024); consuming apps copy to `assets/images/brand/integrations/`. */
13
+ declare const AXE_WEATHERAPI_MARK_SRC = "assets/images/brand/integrations/weatherapi-mark.svg";
14
+ /** Source mark dimensions (739×1024). */
15
+ declare const AXE_WEATHERAPI_MARK_ASPECT: number;
16
+
17
+ declare const AXE_WEATHERAPI_LOGO_PROVIDER: {
18
+ readonly provide: i0.InjectionToken<AXPLogoProvider[]>;
19
+ readonly useValue: AXPLogoProvider;
20
+ readonly multi: true;
21
+ };
22
+
23
+ export { AXEWeatherApiExtensionModule, AXE_WEATHERAPI_LOGO_PROVIDER, AXE_WEATHERAPI_MARK_ASPECT, AXE_WEATHERAPI_MARK_SRC, axpWeatherApiLogoKey };