@acorex-platform/extension-weather-openweathermap-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-openweathermap-client/contracts';
8
+
9
+ //#region ----- Connect OpenWeatherMap -----
10
+ class ConnectOpenWeatherMapCommand {
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 ?? 'OpenWeatherMap',
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 OpenWeatherMap.';
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: ConnectOpenWeatherMapCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
115
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectOpenWeatherMapCommand, providedIn: 'root' }); }
116
+ }
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectOpenWeatherMapCommand, decorators: [{
118
+ type: Injectable,
119
+ args: [{ providedIn: 'root' }]
120
+ }] });
121
+
122
+ export { ConnectOpenWeatherMapCommand };
123
+ //# sourceMappingURL=acorex-platform-extension-weather-openweathermap-client-connect-openweathermap.command-V6yqCW6m.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-weather-openweathermap-client-connect-openweathermap.command-V6yqCW6m.mjs","sources":["../../../../libs/extensions/weather/openweathermap/client/src/lib/features/connect/connect-openweathermap.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-openweathermap-client/contracts';\n\nexport interface ConnectOpenWeatherMapCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface OpenWeatherMapConnectFormResult {\n apiKey: string;\n}\n\n//#region ----- Connect OpenWeatherMap -----\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectOpenWeatherMapCommand implements AXPCommand<ConnectOpenWeatherMapCommandInput, ConnectCommandResult> {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n\n async execute(input: ConnectOpenWeatherMapCommandInput = {}): 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 ?? 'OpenWeatherMap',\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 OpenWeatherMap.';\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<OpenWeatherMapConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<OpenWeatherMapConnectFormResult | null>((dialog: IDialogBuilder<OpenWeatherMapConnectFormResult | 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<OpenWeatherMapConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAoCA;MAGa,4BAA4B,CAAA;AADzC,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,GAA2C,EAAE,EAAA;AACzD,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,EA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,CAAC,+BAA+B;AACtC,qBAAA,MAAM,CAAC,CAAA,EAAG,KAAK,CAAC,UAAU,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,CAAkC,MAAM,CAAC;IAClF;8GAlHW,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,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,4BAA4B,cADf,MAAM,EAAA,CAAA,CAAA;;2FACnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,39 @@
1
+ //#region ---- OpenWeatherMap extension config ----
2
+ const config = {
3
+ i18n: 'extensions-openweathermap',
4
+ };
5
+ const MODULE_NAME = 'OpenWeatherMapExtension';
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',
12
+ },
13
+ integration: {
14
+ providerId: 'openweathermap',
15
+ },
16
+ };
17
+ //#endregion
18
+
19
+ var AXEOpenWeatherMapCommandKeys;
20
+ (function (AXEOpenWeatherMapCommandKeys) {
21
+ AXEOpenWeatherMapCommandKeys["ConnectionConnect"] = "OpenWeatherMapExtension:Command:Connection.Connect";
22
+ })(AXEOpenWeatherMapCommandKeys || (AXEOpenWeatherMapCommandKeys = {}));
23
+
24
+ //#region ---- OpenWeatherMap tenant connection config ----
25
+ //#endregion
26
+
27
+ //#region ---- OpenWeatherMap extension settings ----
28
+ var AXEOpenWeatherMapSettingKeys;
29
+ (function (AXEOpenWeatherMapSettingKeys) {
30
+ AXEOpenWeatherMapSettingKeys["ApiKey"] = "OpenWeatherMapExtension:Setting:ApiKey";
31
+ })(AXEOpenWeatherMapSettingKeys || (AXEOpenWeatherMapSettingKeys = {}));
32
+ //#endregion
33
+
34
+ /**
35
+ * Generated bundle index. Do not edit.
36
+ */
37
+
38
+ export { AXEOpenWeatherMapCommandKeys, AXEOpenWeatherMapSettingKeys, RootConfig };
39
+ //# sourceMappingURL=acorex-platform-extension-weather-openweathermap-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-weather-openweathermap-client-contracts.mjs","sources":["../../../../libs/extensions/weather/openweathermap/contracts/src/root-config.ts","../../../../libs/extensions/weather/openweathermap/contracts/src/commands.keys.ts","../../../../libs/extensions/weather/openweathermap/contracts/src/connection.types.ts","../../../../libs/extensions/weather/openweathermap/contracts/src/settings.keys.ts","../../../../libs/extensions/weather/openweathermap/contracts/src/acorex-platform-extension-weather-openweathermap-client-contracts.ts"],"sourcesContent":["//#region ---- OpenWeatherMap extension config ----\n\nconst config = {\n i18n: 'extensions-openweathermap',\n};\n\nconst MODULE_NAME = 'OpenWeatherMapExtension';\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',\n },\n integration: {\n providerId: 'openweathermap',\n },\n};\n\n//#endregion\n","export enum AXEOpenWeatherMapCommandKeys {\n ConnectionConnect = 'OpenWeatherMapExtension:Command:Connection.Connect',\n}\n","//#region ---- OpenWeatherMap tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for server-side weather calls. */\nexport interface AXEOpenWeatherMapConnectionConfig {\n apiKey?: string;\n}\n\n//#endregion\n","//#region ---- OpenWeatherMap extension settings ----\n\nexport enum AXEOpenWeatherMapSettingKeys {\n ApiKey = 'OpenWeatherMapExtension: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,2BAA2B;CAClC;AAED,MAAM,WAAW,GAAG,yBAAyB;AAEtC,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,uBAAuB;AAC9B,KAAA;AACD,IAAA,WAAW,EAAE;AACX,QAAA,UAAU,EAAE,gBAAgB;AAC7B,KAAA;;AAGH;;ICpBY;AAAZ,CAAA,UAAY,4BAA4B,EAAA;AACtC,IAAA,4BAAA,CAAA,mBAAA,CAAA,GAAA,oDAAwE;AAC1E,CAAC,EAFW,4BAA4B,KAA5B,4BAA4B,GAAA,EAAA,CAAA,CAAA;;ACAxC;AAOA;;ACPA;IAEY;AAAZ,CAAA,UAAY,4BAA4B,EAAA;AACtC,IAAA,4BAAA,CAAA,QAAA,CAAA,GAAA,wCAAiD;AACnD,CAAC,EAFW,4BAA4B,KAA5B,4BAA4B,GAAA,EAAA,CAAA,CAAA;AAIxC;;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, AXEOpenWeatherMapCommandKeys } from '@acorex-platform/extension-weather-openweathermap-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 ---- OpenWeatherMap logo registry key ----
13
+ const axpOpenWeatherMapLogoKey = 'openweathermap';
14
+ /** Mark artwork (89×71); consuming apps copy to `assets/images/brand/integrations/`. */
15
+ const AXE_OPENWEATHERMAP_MARK_SRC = 'assets/images/brand/integrations/openweathermap-mark.svg';
16
+ /** Source mark dimensions (89×71). */
17
+ const AXE_OPENWEATHERMAP_MARK_ASPECT = 89 / 71;
18
+ //#endregion
19
+
20
+ const openWeatherMapLogoProvider = {
21
+ key: axpOpenWeatherMapLogoKey,
22
+ resolve: async (request) => ({
23
+ kind: 'image',
24
+ src: AXE_OPENWEATHERMAP_MARK_SRC,
25
+ height: request.size,
26
+ width: Math.round(request.size * AXE_OPENWEATHERMAP_MARK_ASPECT),
27
+ }),
28
+ };
29
+ const AXE_OPENWEATHERMAP_LOGO_PROVIDER = {
30
+ provide: AXP_LOGO_PROVIDER,
31
+ useValue: openWeatherMapLogoProvider,
32
+ multi: true,
33
+ };
34
+
35
+ class AXEOpenWeatherMapIntegrationProvider {
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: axpOpenWeatherMapLogoKey,
46
+ connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],
47
+ allowMultipleConnections: false,
48
+ defaultConnectionKey: 'default',
49
+ connectCommandKey: AXEOpenWeatherMapCommandKeys.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: AXEOpenWeatherMapIntegrationProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
68
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapIntegrationProvider }); }
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapIntegrationProvider, decorators: [{
71
+ type: Injectable
72
+ }] });
73
+
74
+ class AXEOpenWeatherMapIntegrationRuntimeProvider {
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 OpenWeatherMap connection.',
91
+ };
92
+ }
93
+ return {
94
+ valid: true,
95
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
96
+ externalAccountName: 'OpenWeatherMap',
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: AXEOpenWeatherMapIntegrationRuntimeProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
111
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapIntegrationRuntimeProvider }); }
112
+ }
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapIntegrationRuntimeProvider, decorators: [{
114
+ type: Injectable
115
+ }] });
116
+ const provideOpenWeatherMapIntegrationRuntimeProvider = {
117
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
118
+ useClass: AXEOpenWeatherMapIntegrationRuntimeProvider,
119
+ multi: true,
120
+ };
121
+
122
+ const OpenWeatherMapExtensionManifest = {
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 AXEOpenWeatherMapExtensionModule {
134
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
135
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapExtensionModule, imports: [AXMIntegrationManagementModule] }); }
136
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapExtensionModule, providers: [
137
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: OpenWeatherMapExtensionManifest, multi: true },
138
+ AXE_OPENWEATHERMAP_LOGO_PROVIDER,
139
+ { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEOpenWeatherMapIntegrationProvider, multi: true },
140
+ provideOpenWeatherMapIntegrationRuntimeProvider,
141
+ provideCommandSetups([
142
+ {
143
+ key: AXEOpenWeatherMapCommandKeys.ConnectionConnect,
144
+ command: () => import('./acorex-platform-extension-weather-openweathermap-client-connect-openweathermap.command-V6yqCW6m.mjs').then((c) => c.ConnectOpenWeatherMapCommand),
145
+ },
146
+ ]),
147
+ ], imports: [AXMIntegrationManagementModule] }); }
148
+ }
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEOpenWeatherMapExtensionModule, decorators: [{
150
+ type: NgModule,
151
+ args: [{
152
+ imports: [AXMIntegrationManagementModule],
153
+ providers: [
154
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: OpenWeatherMapExtensionManifest, multi: true },
155
+ AXE_OPENWEATHERMAP_LOGO_PROVIDER,
156
+ { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEOpenWeatherMapIntegrationProvider, multi: true },
157
+ provideOpenWeatherMapIntegrationRuntimeProvider,
158
+ provideCommandSetups([
159
+ {
160
+ key: AXEOpenWeatherMapCommandKeys.ConnectionConnect,
161
+ command: () => import('./acorex-platform-extension-weather-openweathermap-client-connect-openweathermap.command-V6yqCW6m.mjs').then((c) => c.ConnectOpenWeatherMapCommand),
162
+ },
163
+ ]),
164
+ ],
165
+ }]
166
+ }] });
167
+
168
+ /**
169
+ * Generated bundle index. Do not edit.
170
+ */
171
+
172
+ export { AXEOpenWeatherMapExtensionModule, AXE_OPENWEATHERMAP_LOGO_PROVIDER, AXE_OPENWEATHERMAP_MARK_ASPECT, AXE_OPENWEATHERMAP_MARK_SRC, axpOpenWeatherMapLogoKey };
173
+ //# sourceMappingURL=acorex-platform-extension-weather-openweathermap-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-weather-openweathermap-client.mjs","sources":["../../../../libs/extensions/weather/openweathermap/client/src/lib/brand/openweathermap-logo-key.ts","../../../../libs/extensions/weather/openweathermap/client/src/lib/brand/openweathermap-logo.provider.ts","../../../../libs/extensions/weather/openweathermap/client/src/lib/integration/openweathermap.integration.provider.ts","../../../../libs/extensions/weather/openweathermap/client/src/lib/integration/openweathermap.integration-runtime.provider.ts","../../../../libs/extensions/weather/openweathermap/client/src/lib/manifest.ts","../../../../libs/extensions/weather/openweathermap/client/src/lib/openweathermap-extension.module.ts","../../../../libs/extensions/weather/openweathermap/client/src/acorex-platform-extension-weather-openweathermap-client.ts"],"sourcesContent":["//#region ---- OpenWeatherMap logo registry key ----\n\nexport const axpOpenWeatherMapLogoKey = 'openweathermap' as const;\n\n/** Mark artwork (89×71); consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_OPENWEATHERMAP_MARK_SRC = 'assets/images/brand/integrations/openweathermap-mark.svg';\n\n/** Source mark dimensions (89×71). */\nexport const AXE_OPENWEATHERMAP_MARK_ASPECT = 89 / 71;\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_OPENWEATHERMAP_MARK_ASPECT,\n AXE_OPENWEATHERMAP_MARK_SRC,\n axpOpenWeatherMapLogoKey,\n} from './openweathermap-logo-key';\n\nconst openWeatherMapLogoProvider: AXPLogoProvider = {\n key: axpOpenWeatherMapLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_OPENWEATHERMAP_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_OPENWEATHERMAP_MARK_ASPECT),\n }),\n};\n\nexport const AXE_OPENWEATHERMAP_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: openWeatherMapLogoProvider,\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 { AXEOpenWeatherMapCommandKeys, RootConfig } from '@acorex-platform/extension-weather-openweathermap-client/contracts';\nimport { axpOpenWeatherMapLogoKey } from '../brand/openweathermap-logo-key';\n\n@Injectable()\nexport class AXEOpenWeatherMapIntegrationProvider 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: axpOpenWeatherMapLogoKey,\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n allowMultipleConnections: false,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEOpenWeatherMapCommandKeys.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-openweathermap-client/contracts';\n\n@Injectable()\nexport class AXEOpenWeatherMapIntegrationRuntimeProvider 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 OpenWeatherMap connection.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: 'OpenWeatherMap',\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 provideOpenWeatherMapIntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEOpenWeatherMapIntegrationRuntimeProvider,\n multi: true,\n};\n","import { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-weather-openweathermap-client/contracts';\n\nexport const OpenWeatherMapExtensionManifest: 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 { AXEOpenWeatherMapCommandKeys } from '@acorex-platform/extension-weather-openweathermap-client/contracts';\nimport { AXE_OPENWEATHERMAP_LOGO_PROVIDER } from './brand/openweathermap-logo.provider';\nimport { AXEOpenWeatherMapIntegrationProvider } from './integration/openweathermap.integration.provider';\nimport { provideOpenWeatherMapIntegrationRuntimeProvider } from './integration/openweathermap.integration-runtime.provider';\nimport { OpenWeatherMapExtensionManifest } from './manifest';\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: OpenWeatherMapExtensionManifest, multi: true },\n AXE_OPENWEATHERMAP_LOGO_PROVIDER,\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEOpenWeatherMapIntegrationProvider, multi: true },\n provideOpenWeatherMapIntegrationRuntimeProvider,\n provideCommandSetups([\n {\n key: AXEOpenWeatherMapCommandKeys.ConnectionConnect,\n command: () =>\n import('./features/connect/connect-openweathermap.command').then((c) => c.ConnectOpenWeatherMapCommand),\n },\n ]),\n ],\n})\nexport class AXEOpenWeatherMapExtensionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAEO,MAAM,wBAAwB,GAAG;AAExC;AACO,MAAM,2BAA2B,GAAG;AAE3C;AACO,MAAM,8BAA8B,GAAG,EAAE,GAAG;AAEnD;;ACEA,MAAM,0BAA0B,GAAoB;AAClD,IAAA,GAAG,EAAE,wBAAwB;AAC7B,IAAA,OAAO,EAAE,OAAO,OAAuB,MAA4B;AACjE,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,GAAG,EAAE,2BAA2B;QAChC,MAAM,EAAE,OAAO,CAAC,IAAI;QACpB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,8BAA8B,CAAC;KACjE,CAAC;CACH;AAEM,MAAM,gCAAgC,GAAG;AAC9C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,KAAK,EAAE,IAAI;;;MCbA,oCAAoC,CAAA;IAC/C,MAAM,OAAO,CAAC,OAAsC,EAAA;QAClD,MAAM,IAAI,GAAG,CAAA,CAAA,EAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,YAAA,CAAc;QAErD,OAAO,CAAC,QAAQ,CAAC;AACf,YAAA,EAAE,EAAE,UAAU,CAAC,WAAW,CAAC,UAAU;AACrC,YAAA,QAAQ,EAAE,qBAAqB;AAC/B,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;YAC9B,WAAW,EAAE,CAA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AoB,CAAC;AACnB,gBAAA;oBACE,GAAG,EAAE,4BAA4B,CAAC,iBAAiB;AACnD,oBAAA,OAAO,EAAE,MACP,OAAO,uGAAmD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,4BAA4B,CAAC;AAC1G,iBAAA;aACF,CAAC;AACH,SAAA,EAAA,OAAA,EAAA,CAbS,8BAA8B,CAAA,EAAA,CAAA,CAAA;;2FAe7B,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAhB5C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,8BAA8B,CAAC;AACzC,oBAAA,SAAS,EAAE;wBACT,EAAE,OAAO,EAAE,4BAA4B,EAAE,QAAQ,EAAE,+BAA+B,EAAE,KAAK,EAAE,IAAI,EAAE;wBACjG,gCAAgC;wBAChC,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,oCAAoC,EAAE,KAAK,EAAE,IAAI,EAAE;wBAClG,+CAA+C;AAC/C,wBAAA,oBAAoB,CAAC;AACnB,4BAAA;gCACE,GAAG,EAAE,4BAA4B,CAAC,iBAAiB;AACnD,gCAAA,OAAO,EAAE,MACP,OAAO,uGAAmD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,4BAA4B,CAAC;AAC1G,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;AC1BD;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@acorex-platform/extension-weather-openweathermap-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-openweathermap-client.mjs",
13
+ "typings": "types/acorex-platform-extension-weather-openweathermap-client.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/acorex-platform-extension-weather-openweathermap-client.d.ts",
20
+ "default": "./fesm2022/acorex-platform-extension-weather-openweathermap-client.mjs"
21
+ },
22
+ "./contracts": {
23
+ "types": "./types/acorex-platform-extension-weather-openweathermap-client-contracts.d.ts",
24
+ "default": "./fesm2022/acorex-platform-extension-weather-openweathermap-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 AXEOpenWeatherMapCommandKeys {
16
+ ConnectionConnect = "OpenWeatherMapExtension:Command:Connection.Connect"
17
+ }
18
+
19
+ /** Stored on IntegrationManagement connection `config` for server-side weather calls. */
20
+ interface AXEOpenWeatherMapConnectionConfig {
21
+ apiKey?: string;
22
+ }
23
+
24
+ declare enum AXEOpenWeatherMapSettingKeys {
25
+ ApiKey = "OpenWeatherMapExtension:Setting:ApiKey"
26
+ }
27
+
28
+ export { AXEOpenWeatherMapCommandKeys, AXEOpenWeatherMapSettingKeys, RootConfig };
29
+ export type { AXEOpenWeatherMapConnectionConfig };
@@ -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 AXEOpenWeatherMapExtensionModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEOpenWeatherMapExtensionModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AXEOpenWeatherMapExtensionModule, never, [typeof i1.AXMIntegrationManagementModule], never>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<AXEOpenWeatherMapExtensionModule>;
9
+ }
10
+
11
+ declare const axpOpenWeatherMapLogoKey: "openweathermap";
12
+ /** Mark artwork (89×71); consuming apps copy to `assets/images/brand/integrations/`. */
13
+ declare const AXE_OPENWEATHERMAP_MARK_SRC = "assets/images/brand/integrations/openweathermap-mark.svg";
14
+ /** Source mark dimensions (89×71). */
15
+ declare const AXE_OPENWEATHERMAP_MARK_ASPECT: number;
16
+
17
+ declare const AXE_OPENWEATHERMAP_LOGO_PROVIDER: {
18
+ readonly provide: i0.InjectionToken<AXPLogoProvider[]>;
19
+ readonly useValue: AXPLogoProvider;
20
+ readonly multi: true;
21
+ };
22
+
23
+ export { AXEOpenWeatherMapExtensionModule, AXE_OPENWEATHERMAP_LOGO_PROVIDER, AXE_OPENWEATHERMAP_MARK_ASPECT, AXE_OPENWEATHERMAP_MARK_SRC, axpOpenWeatherMapLogoKey };