@acorex-platform/extension-google-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,50 @@
1
+ import { AXP_INTEGRATION_CONNECTION_ESTABLISHED } from '@acorex-platform/framework-client/common';
2
+ import { AXMIntegrationConnectionManager, toSafeIntegrationConnectionDto } from '@acorex-platform/module-integration-management-client';
3
+ import { A as AXEGoogleOAuthHttpClient } from './acorex-platform-extension-google-client-google-oauth-http.client-BygIfysu.mjs';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Injectable } from '@angular/core';
6
+
7
+ class CompleteGoogleOAuthCommand {
8
+ constructor() {
9
+ this.http = inject(AXEGoogleOAuthHttpClient);
10
+ this.connectionManager = inject(AXMIntegrationConnectionManager);
11
+ this.establishedHandlers = inject(AXP_INTEGRATION_CONNECTION_ESTABLISHED, { optional: true });
12
+ }
13
+ async execute(input) {
14
+ try {
15
+ const { connectionId } = await this.http.completeOAuth({
16
+ state: input.state,
17
+ code: input.code,
18
+ });
19
+ const connection = await this.connectionManager.getByIdForCurrentUser(connectionId);
20
+ if (!connection) {
21
+ return { success: false, message: { text: 'Connection not found after Google OAuth callback.' } };
22
+ }
23
+ const safe = toSafeIntegrationConnectionDto(connection);
24
+ await this.dispatchEstablished(safe);
25
+ return { success: true, kind: 'object', data: safe };
26
+ }
27
+ catch (error) {
28
+ const message = error instanceof Error ? error.message : 'Google OAuth callback failed.';
29
+ return { success: false, message: { text: message } };
30
+ }
31
+ }
32
+ async dispatchEstablished(connection) {
33
+ const list = this.establishedHandlers ?? [];
34
+ for (const handler of list) {
35
+ const resolved = handler instanceof Promise ? await handler : handler;
36
+ if (resolved.providerId === connection.providerId) {
37
+ await resolved.onEstablished(connection);
38
+ }
39
+ }
40
+ }
41
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CompleteGoogleOAuthCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
42
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CompleteGoogleOAuthCommand, providedIn: 'root' }); }
43
+ }
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CompleteGoogleOAuthCommand, decorators: [{
45
+ type: Injectable,
46
+ args: [{ providedIn: 'root' }]
47
+ }] });
48
+
49
+ export { CompleteGoogleOAuthCommand };
50
+ //# sourceMappingURL=acorex-platform-extension-google-client-complete-google-oauth.command-BE9n_4Yn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-google-client-complete-google-oauth.command-BE9n_4Yn.mjs","sources":["../../../../libs/extensions/google/client/src/lib/features/connect/complete-google-oauth.command.ts"],"sourcesContent":["//#region ---- Complete Google OAuth callback ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPRuntimeCommandResult, AXPSafeIntegrationConnectionDto } from '@acorex-platform/framework-shared/core';\nimport { AXP_INTEGRATION_CONNECTION_ESTABLISHED } from '@acorex-platform/framework-client/common';\nimport {\n AXMIntegrationConnectionManager,\n toSafeIntegrationConnectionDto,\n} from '@acorex-platform/module-integration-management-client';\nimport { AXEGoogleOAuthHttpClient } from '../../api/google-oauth-http.client';\nimport { Injectable, inject } from '@angular/core';\n\nexport interface CompleteGoogleOAuthCommandInput {\n state: string;\n code: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class CompleteGoogleOAuthCommand\n implements AXPCommand<CompleteGoogleOAuthCommandInput, AXPSafeIntegrationConnectionDto>\n{\n private readonly http = inject(AXEGoogleOAuthHttpClient);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly establishedHandlers = inject(AXP_INTEGRATION_CONNECTION_ESTABLISHED, { optional: true });\n\n async execute(\n input: CompleteGoogleOAuthCommandInput,\n ): AXPCommandExecuteResultPromise<AXPSafeIntegrationConnectionDto> {\n try {\n const { connectionId } = await this.http.completeOAuth({\n state: input.state,\n code: input.code,\n });\n\n const connection = await this.connectionManager.getByIdForCurrentUser(connectionId);\n if (!connection) {\n return { success: false, message: { text: 'Connection not found after Google OAuth callback.' } };\n }\n\n const safe = toSafeIntegrationConnectionDto(connection);\n await this.dispatchEstablished(safe);\n return { success: true, kind: 'object', data: safe };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Google OAuth callback failed.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async dispatchEstablished(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n const list = this.establishedHandlers ?? [];\n for (const handler of list) {\n const resolved = handler instanceof Promise ? await handler : handler;\n if (resolved.providerId === connection.providerId) {\n await resolved.onEstablished(connection);\n }\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;MAkBa,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC;AACvC,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;QAC3D,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,sCAAsC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAkC1G,IAAA;IAhCC,MAAM,OAAO,CACX,KAAsC,EAAA;AAEtC,QAAA,IAAI;YACF,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;gBACrD,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,KAAK,CAAC,IAAI;AACjB,aAAA,CAAC;YAEF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,YAAY,CAAC;YACnF,IAAI,CAAC,UAAU,EAAE;AACf,gBAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EA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M,EAAE;;;;;"}
@@ -0,0 +1,44 @@
1
+ import { AXPSessionService } from '@acorex-platform/framework-client/auth';
2
+ import { A as AXEGoogleOAuthHttpClient } from './acorex-platform-extension-google-client-google-oauth-http.client-BygIfysu.mjs';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, Injectable } from '@angular/core';
5
+
6
+ class ConnectGoogleCommand {
7
+ constructor() {
8
+ this.oauthHttp = inject(AXEGoogleOAuthHttpClient);
9
+ this.sessionService = inject(AXPSessionService);
10
+ }
11
+ async execute(input = {}) {
12
+ try {
13
+ const providerId = input.providerId ?? 'google';
14
+ const connectionScope = input.connectionScope ?? 'user';
15
+ const appName = this.sessionService.application?.name ?? 'demo';
16
+ const redirectUri = `${window.location.origin}/${appName}/integrations/oauth/callback/${providerId}`;
17
+ const result = await this.oauthHttp.startOAuth({
18
+ redirectUri,
19
+ connectionScope,
20
+ displayName: providerId,
21
+ });
22
+ if (!result.redirectUrl) {
23
+ return {
24
+ success: false,
25
+ message: { text: 'OAuth redirect URL was not returned.' },
26
+ };
27
+ }
28
+ return { success: true, kind: 'object', data: { outcome: 'redirect', redirectUrl: result.redirectUrl } };
29
+ }
30
+ catch (error) {
31
+ const message = error instanceof Error ? error.message : 'Failed to connect Google.';
32
+ return { success: false, message: { text: message } };
33
+ }
34
+ }
35
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectGoogleCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
36
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectGoogleCommand, providedIn: 'root' }); }
37
+ }
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectGoogleCommand, decorators: [{
39
+ type: Injectable,
40
+ args: [{ providedIn: 'root' }]
41
+ }] });
42
+
43
+ export { ConnectGoogleCommand };
44
+ //# sourceMappingURL=acorex-platform-extension-google-client-connect-google.command-DZ1pU8xZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-google-client-connect-google.command-DZ1pU8xZ.mjs","sources":["../../../../libs/extensions/google/client/src/lib/features/connect/connect-google.command.ts"],"sourcesContent":["//#region ---- Connect Google (OAuth 2.0) ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n type AXPRuntimeCommandResult,\n type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { type ConnectCommandResult } from '@acorex-platform/module-integration-management-client';\nimport { AXEGoogleOAuthHttpClient } from '../../api/google-oauth-http.client';\nimport { Injectable, inject } from '@angular/core';\n\nexport interface ConnectGoogleCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectGoogleCommand implements AXPCommand<ConnectGoogleCommandInput, ConnectCommandResult> {\n private readonly oauthHttp = inject(AXEGoogleOAuthHttpClient);\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(input: ConnectGoogleCommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? 'google';\n const connectionScope = input.connectionScope ?? 'user';\n\n const appName = this.sessionService.application?.name ?? 'demo';\n const redirectUri = `${window.location.origin}/${appName}/integrations/oauth/callback/${providerId}`;\n const result = await this.oauthHttp.startOAuth({\n redirectUri,\n connectionScope,\n displayName: providerId,\n });\n\n if (!result.redirectUrl) {\n return {\n success: false,\n message: { text: 'OAuth redirect URL was not returned.' },\n };\n }\n\n return { success: true, kind: 'object', data: { outcome: 'redirect', redirectUrl: result.redirectUrl } };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to connect Google.';\n return { success: false, message: { text: message } };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;MAkB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,EAAE,OAAO,EAAE,EAAE;QACvD;IACF;8GA7BW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,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,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -0,0 +1,44 @@
1
+ //#region ---- Module Config ----
2
+ const config = {
3
+ i18n: 'extensions-google',
4
+ module: 'google-extension',
5
+ };
6
+ const RootConfig = {
7
+ config,
8
+ module: {
9
+ name: config.module,
10
+ icon: 'fa-brands fa-google',
11
+ },
12
+ };
13
+ //#endregion
14
+
15
+ /**
16
+ * User-scoped settings for Google sync preferences (Google extension).
17
+ */
18
+ var AXEGoogleSettings;
19
+ (function (AXEGoogleSettings) {
20
+ /** When true, Gmail sync is enabled for the connected Google account. */
21
+ AXEGoogleSettings["GmailSyncEnabled"] = "Google:Setting:Sync.GmailEnabled";
22
+ /** When true, Google Calendar sync is enabled for the connected Google account. */
23
+ AXEGoogleSettings["CalendarSyncEnabled"] = "Google:Setting:Sync.CalendarEnabled";
24
+ })(AXEGoogleSettings || (AXEGoogleSettings = {}));
25
+
26
+ var AXEGoogleCommandKeys;
27
+ (function (AXEGoogleCommandKeys) {
28
+ AXEGoogleCommandKeys["ConnectionConnect"] = "GoogleExtension:Connection:Connect";
29
+ AXEGoogleCommandKeys["ConnectionCompleteOAuth"] = "GoogleExtension:Connection:CompleteOAuth";
30
+ /** Server runtime: start OAuth authorization (not the client connect UI command). */
31
+ AXEGoogleCommandKeys["OAuthStart"] = "GoogleExtension:OAuth:Start";
32
+ /** Server runtime: complete OAuth after redirect callback. */
33
+ AXEGoogleCommandKeys["OAuthComplete"] = "GoogleExtension:OAuth:Complete";
34
+ })(AXEGoogleCommandKeys || (AXEGoogleCommandKeys = {}));
35
+
36
+ //#region ---- Google OAuth API (client ↔ server) ----
37
+ //#endregion
38
+
39
+ /**
40
+ * Generated bundle index. Do not edit.
41
+ */
42
+
43
+ export { AXEGoogleCommandKeys, AXEGoogleSettings, RootConfig };
44
+ //# sourceMappingURL=acorex-platform-extension-google-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-google-client-contracts.mjs","sources":["../../../../libs/extensions/google/contracts/src/root-config.ts","../../../../libs/extensions/google/contracts/src/google.settings.keys.ts","../../../../libs/extensions/google/contracts/src/commands.keys.ts","../../../../libs/extensions/google/contracts/src/oauth.api.types.ts","../../../../libs/extensions/google/contracts/src/acorex-platform-extension-google-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-google',\n module: 'google-extension',\n};\n\nexport const RootConfig = {\n config,\n module: {\n name: config.module,\n icon: 'fa-brands fa-google',\n },\n};\n\n//#endregion\n","/**\n * User-scoped settings for Google sync preferences (Google extension).\n */\nexport enum AXEGoogleSettings {\n /** When true, Gmail sync is enabled for the connected Google account. */\n GmailSyncEnabled = 'Google:Setting:Sync.GmailEnabled',\n\n /** When true, Google Calendar sync is enabled for the connected Google account. */\n CalendarSyncEnabled = 'Google:Setting:Sync.CalendarEnabled',\n}\n","export enum AXEGoogleCommandKeys {\n ConnectionConnect = 'GoogleExtension:Connection:Connect',\n ConnectionCompleteOAuth = 'GoogleExtension:Connection:CompleteOAuth',\n /** Server runtime: start OAuth authorization (not the client connect UI command). */\n OAuthStart = 'GoogleExtension:OAuth:Start',\n /** Server runtime: complete OAuth after redirect callback. */\n OAuthComplete = 'GoogleExtension:OAuth:Complete',\n}\n","//#region ---- Google OAuth API (client ↔ server) ----\n\nexport interface AXEGoogleOAuthStartRequest {\n redirectUri: string;\n connectionScope?: 'user' | 'tenant';\n connectionKey?: string;\n displayName?: string;\n scopes?: string[];\n}\n\nexport interface AXEGoogleOAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXEGoogleOAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXEGoogleOAuthCompleteResponse {\n connectionId: string;\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,mBAAmB;AACzB,IAAA,MAAM,EAAE,kBAAkB;CAC3B;AAEM,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,MAAM;AACnB,QAAA,IAAI,EAAE,qBAAqB;AAC5B,KAAA;;AAGH;;ACfA;;AAEG;IACS;AAAZ,CAAA,UAAY,iBAAiB,EAAA;;AAE3B,IAAA,iBAAA,CAAA,kBAAA,CAAA,GAAA,kCAAqD;;AAGrD,IAAA,iBAAA,CAAA,qBAAA,CAAA,GAAA,qCAA2D;AAC7D,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,GAAA,EAAA,CAAA,CAAA;;ICHjB;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,mBAAA,CAAA,GAAA,oCAAwD;AACxD,IAAA,oBAAA,CAAA,yBAAA,CAAA,GAAA,0CAAoE;;AAEpE,IAAA,oBAAA,CAAA,YAAA,CAAA,GAAA,6BAA0C;;AAE1C,IAAA,oBAAA,CAAA,eAAA,CAAA,GAAA,gCAAgD;AAClD,CAAC,EAPW,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;;ACAhC;AAwBA;;ACxBA;;AAEG;;;;"}
@@ -0,0 +1,33 @@
1
+ import { commandMessageTextForError } from '@acorex-platform/framework-client/common';
2
+ import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
3
+ import { AXEGoogleCommandKeys } from '@acorex-platform/extension-google-client/contracts';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Injectable } from '@angular/core';
6
+
7
+ class AXEGoogleOAuthHttpClient {
8
+ constructor() {
9
+ this.commandService = inject(AXPCommandService);
10
+ }
11
+ startOAuth(body) {
12
+ return this.runCommand(AXEGoogleCommandKeys.OAuthStart, body);
13
+ }
14
+ completeOAuth(body) {
15
+ return this.runCommand(AXEGoogleCommandKeys.OAuthComplete, body);
16
+ }
17
+ async runCommand(key, input) {
18
+ const result = await this.commandService.execute(key, input);
19
+ if (!result?.success) {
20
+ throw new Error(commandMessageTextForError(result?.message?.text) || `Google OAuth command failed: ${key}`);
21
+ }
22
+ return result.data;
23
+ }
24
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleOAuthHttpClient, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
25
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleOAuthHttpClient, providedIn: 'root' }); }
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleOAuthHttpClient, decorators: [{
28
+ type: Injectable,
29
+ args: [{ providedIn: 'root' }]
30
+ }] });
31
+
32
+ export { AXEGoogleOAuthHttpClient as A };
33
+ //# sourceMappingURL=acorex-platform-extension-google-client-google-oauth-http.client-BygIfysu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-google-client-google-oauth-http.client-BygIfysu.mjs","sources":["../../../../libs/extensions/google/client/src/lib/api/google-oauth-http.client.ts"],"sourcesContent":["import { commandMessageTextForError } from '@acorex-platform/framework-client/common';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXEGoogleCommandKeys,\n type AXEGoogleOAuthCompleteRequest,\n type AXEGoogleOAuthCompleteResponse,\n type AXEGoogleOAuthStartRequest,\n type AXEGoogleOAuthStartResponse,\n} from '@acorex-platform/extension-google-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class AXEGoogleOAuthHttpClient {\n private readonly commandService = inject(AXPCommandService);\n\n startOAuth(body: AXEGoogleOAuthStartRequest): Promise<AXEGoogleOAuthStartResponse> {\n return this.runCommand(AXEGoogleCommandKeys.OAuthStart, body);\n }\n\n completeOAuth(body: AXEGoogleOAuthCompleteRequest): Promise<AXEGoogleOAuthCompleteResponse> {\n return this.runCommand(AXEGoogleCommandKeys.OAuthComplete, body);\n }\n\n private async runCommand<TInput, TResult>(key: string, input: TInput): Promise<TResult> {\n const result = await this.commandService.execute<TInput, TResult>(key, input);\n if (!result?.success) {\n throw new Error(commandMessageTextForError(result?.message?.text) || `Google OAuth command failed: ${key}`);\n }\n return result.data as TResult;\n }\n}\n"],"names":[],"mappings":";;;;;;MAYa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAiB5D,IAAA;AAfC,IAAA,UAAU,CAAC,IAAgC,EAAA;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,UAAU,EAAE,IAAI,CAAC;IAC/D;AAEA,IAAA,aAAa,CAAC,IAAmC,EAAA;QAC/C,OAAO,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,aAAa,EAAE,IAAI,CAAC;IAClE;AAEQ,IAAA,MAAM,UAAU,CAAkB,GAAW,EAAE,KAAa,EAAA;AAClE,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAkB,GAAG,EAAE,KAAK,CAAC;AAC7E,QAAA,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE;AACpB,YAAA,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAA,6BAAA,EAAgC,GAAG,CAAA,CAAE,CAAC;QAC7G;QACA,OAAO,MAAM,CAAC,IAAe;IAC/B;8GAjBW,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,54 @@
1
+ import * as i1 from '@acorex/components/button';
2
+ import { AXButtonModule } from '@acorex/components/button';
3
+ import * as i2 from '@acorex/components/decorators';
4
+ import { AXDecoratorModule } from '@acorex/components/decorators';
5
+ import * as i3 from '@acorex/components/loading';
6
+ import { AXLoadingModule } from '@acorex/components/loading';
7
+ import * as i5 from '@acorex/core/translation';
8
+ import { AXTranslationModule } from '@acorex/core/translation';
9
+ import { AXToastService } from '@acorex/components/toast';
10
+ import { AXPSessionService } from '@acorex-platform/framework-client/auth';
11
+ import { AXPLogoComponent } from '@acorex-platform/framework-client/core';
12
+ import * as i4 from '@angular/common';
13
+ import { CommonModule } from '@angular/common';
14
+ import * as i0 from '@angular/core';
15
+ import { inject, signal, ChangeDetectionStrategy, Component } from '@angular/core';
16
+ import { axpGoogleLogoKey } from './acorex-platform-extension-google-client.mjs';
17
+
18
+ //#region ---- Google platform login slot ----
19
+ class AXEGooglePlatformLoginSlotComponent {
20
+ constructor() {
21
+ this.logoKey = axpGoogleLogoKey;
22
+ this.sessionService = inject(AXPSessionService);
23
+ this.toastService = inject(AXToastService);
24
+ this.isLoading = signal(false, /* @ts-ignore */
25
+ ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
26
+ }
27
+ async handleGoogleSignIn() {
28
+ this.isLoading.set(true);
29
+ try {
30
+ this.sessionService.setStrategy('google');
31
+ await this.sessionService.signin({ strategy: 'google' });
32
+ }
33
+ catch (error) {
34
+ const message = error instanceof Error ? error.message : 'Google sign-in failed.';
35
+ this.toastService.show({
36
+ color: 'danger',
37
+ content: message,
38
+ timeOut: 6000,
39
+ });
40
+ }
41
+ finally {
42
+ this.isLoading.set(false);
43
+ }
44
+ }
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformLoginSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
46
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXEGooglePlatformLoginSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button\n class=\"w-full mt-2\"\n text=\"{{ '@auth:authentication.with-google' | translate | async }}\"\n [color]=\"'default'\"\n id=\"google-platform-login\"\n (onClick)=\"handleGoogleSignIn()\"\n [disabled]=\"isLoading()\"\n>\n <ax-prefix>\n <axp-logo [logoKey]=\"logoKey\" appearance=\"colored\" [size]=\"20\" />\n </ax-prefix>\n @if (isLoading()) {\n <ax-loading></ax-loading>\n }\n</ax-button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i3.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "component", type: AXPLogoComponent, selector: "axp-logo", inputs: ["logoKey", "appearance", "size", "format"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
47
+ }
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformLoginSlotComponent, decorators: [{
49
+ type: Component,
50
+ args: [{ changeDetection: ChangeDetectionStrategy.Eager, imports: [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, AXTranslationModule, AXPLogoComponent], template: "<ax-button\n class=\"w-full mt-2\"\n text=\"{{ '@auth:authentication.with-google' | translate | async }}\"\n [color]=\"'default'\"\n id=\"google-platform-login\"\n (onClick)=\"handleGoogleSignIn()\"\n [disabled]=\"isLoading()\"\n>\n <ax-prefix>\n <axp-logo [logoKey]=\"logoKey\" appearance=\"colored\" [size]=\"20\" />\n </ax-prefix>\n @if (isLoading()) {\n <ax-loading></ax-loading>\n }\n</ax-button>\n" }]
51
+ }] });
52
+
53
+ export { AXEGooglePlatformLoginSlotComponent };
54
+ //# sourceMappingURL=acorex-platform-extension-google-client-google-platform-login-slot.component-WO8_R8Zh.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-google-client-google-platform-login-slot.component-WO8_R8Zh.mjs","sources":["../../../../libs/extensions/google/client/src/lib/platform-auth/google-platform-login-slot.component.ts","../../../../libs/extensions/google/client/src/lib/platform-auth/google-platform-login-slot.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPLogoComponent } from '@acorex-platform/framework-client/core';\nimport { CommonModule } from '@angular/common';\nimport { Component, inject, signal, ChangeDetectionStrategy } from '@angular/core';\nimport { axpGoogleLogoKey } from '../brand/google-logo-key';\n\n//#region ---- Google platform login slot ----\n\n@Component({\n templateUrl: './google-platform-login-slot.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n imports: [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, AXTranslationModule, AXPLogoComponent],\n})\nexport class AXEGooglePlatformLoginSlotComponent {\n protected readonly logoKey = axpGoogleLogoKey;\n\n private readonly sessionService = inject(AXPSessionService);\n private readonly toastService = inject(AXToastService);\n protected isLoading = signal(false);\n\n protected async handleGoogleSignIn(): Promise<void> {\n this.isLoading.set(true);\n try {\n this.sessionService.setStrategy('google');\n await this.sessionService.signin({ strategy: 'google' });\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Google sign-in failed.';\n this.toastService.show({\n color: 'danger',\n content: message,\n timeOut: 6000,\n });\n } finally {\n this.isLoading.set(false);\n }\n }\n}\n\n//#endregion\n","<ax-button\n class=\"w-full mt-2\"\n text=\"{{ '@auth:authentication.with-google' | translate | async }}\"\n [color]=\"'default'\"\n id=\"google-platform-login\"\n (onClick)=\"handleGoogleSignIn()\"\n [disabled]=\"isLoading()\"\n>\n <ax-prefix>\n <axp-logo [logoKey]=\"logoKey\" appearance=\"colored\" [size]=\"20\" />\n </ax-prefix>\n @if (isLoading()) {\n <ax-loading></ax-loading>\n }\n</ax-button>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAWA;MAOa,mCAAmC,CAAA;AALhD,IAAA,WAAA,GAAA;QAMqB,IAAA,CAAA,OAAO,GAAG,gBAAgB;AAE5B,QAAA,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AAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;;2FAEtG,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAL/C,SAAS;AAES,YAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,uBAAuB,CAAC,KAAK,EAAA,OAAA,EACrC,CAAC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,qaAAA,EAAA;;;;;"}
@@ -0,0 +1,639 @@
1
+ import { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';
2
+ import { AXP_INTEGRATION_SECRET_STORE, AXP_INTEGRATION_PROVIDER, AXP_INTEGRATION_RUNTIME_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/common';
3
+ import * as i3 from '@acorex-platform/framework-client/auth';
4
+ import { AXPAuthStrategy, AXPSessionService, AXPPlatformAuthRuntimeService, resolvePlatformOAuthIssuer, resolvePlatformOAuthClientConfig, PkceUtil, toPlatformOAuthSignInResult, shouldPlatformOAuthBindSession, platformOAuthSessionUpdateParams, resolvePlatformOAuthTokenEndpoint, JwtUtil, TimeUtil, resolvePlatformOAuthAuthorizeEndpoint, AXPAuthModule } from '@acorex-platform/framework-client/auth';
5
+ import { provideCommandSetups } from '@acorex-platform/framework-client/runtime';
6
+ import { RootConfig, AXEGoogleCommandKeys, AXEGoogleSettings } from '@acorex-platform/extension-google-client/contracts';
7
+ import * as i1 from '@acorex-platform/framework-client/core';
8
+ import { AXP_LOGO_PROVIDER } from '@acorex-platform/framework-client/core';
9
+ import { AXM_AUTH_CONFIG_TOKEN, AUTH_LOGIN_EXTERNAL_PROVIDERS_SLOT } from '@acorex-platform/module-auth-client';
10
+ import * as i0 from '@angular/core';
11
+ import { Injectable, inject, NgModule, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
12
+ import { AXP_INTEGRATION_AUTH_METHOD_TYPE, AXP_INTEGRATION_CONNECTION_SCOPE, AXP_INTEGRATION_CAPABILITY, AXP_INTEGRATION_CONNECTION_STATUS, AXPWidgetsList } from '@acorex-platform/framework-shared/core';
13
+ import { defaultTo, trim } from 'lodash-es';
14
+
15
+ //#region ---- Google logo registry key ----
16
+ const axpGoogleLogoKey = 'google';
17
+ //#endregion
18
+
19
+ //#region ---- Google OAuth scopes ----
20
+ /** Default OAuth scopes requested when connecting a Google account. */
21
+ const AXE_GOOGLE_OAUTH_DEFAULT_SCOPES = [
22
+ 'openid',
23
+ 'email',
24
+ 'profile',
25
+ 'https://www.googleapis.com/auth/gmail.readonly',
26
+ 'https://www.googleapis.com/auth/calendar',
27
+ ];
28
+ //#endregion
29
+
30
+ //#region ---- Imports ----
31
+ //#endregion
32
+ //#region ---- Provider ----
33
+ class AXEGoogleIntegrationProvider {
34
+ async provide(context) {
35
+ const I18N = `@${RootConfig.config.i18n}:integration`;
36
+ context.register({
37
+ domainId: 'other',
38
+ id: 'google',
39
+ module: RootConfig.module.name,
40
+ displayName: `${I18N}.display-name`,
41
+ description: `${I18N}.description`,
42
+ icon: RootConfig.module.icon,
43
+ logoKey: axpGoogleLogoKey,
44
+ capabilities: [
45
+ AXP_INTEGRATION_CAPABILITY.Messaging,
46
+ AXP_INTEGRATION_CAPABILITY.Calendar,
47
+ AXP_INTEGRATION_CAPABILITY.Sync,
48
+ AXP_INTEGRATION_CAPABILITY.Identity,
49
+ ],
50
+ connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.User],
51
+ allowMultipleConnections: false,
52
+ defaultConnectionKey: 'default',
53
+ connectCommandKey: AXEGoogleCommandKeys.ConnectionConnect,
54
+ completeOAuthCommandKey: AXEGoogleCommandKeys.ConnectionCompleteOAuth,
55
+ authMethods: [
56
+ {
57
+ type: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,
58
+ label: `${I18N}.auth.oauth.label`,
59
+ instructions: `${I18N}.auth.oauth.instructions`,
60
+ usesRedirect: true,
61
+ supportsRefresh: true,
62
+ supportsRevoke: true,
63
+ supportsValidation: true,
64
+ defaultScopes: [...AXE_GOOGLE_OAUTH_DEFAULT_SCOPES],
65
+ fields: [],
66
+ },
67
+ ],
68
+ });
69
+ }
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleIntegrationProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
71
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleIntegrationProvider }); }
72
+ }
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleIntegrationProvider, decorators: [{
74
+ type: Injectable
75
+ }] });
76
+
77
+ //#region ---- Imports ----
78
+ //#endregion
79
+ //#region ---- Runtime Provider ----
80
+ class AXEGoogleIntegrationRuntimeProvider {
81
+ constructor() {
82
+ this.providerId = 'google';
83
+ this.secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });
84
+ }
85
+ async getHooks() {
86
+ return {
87
+ validateConnection: (ctx) => this.validateConnection(ctx),
88
+ createClient: (ctx) => this.createClient(ctx),
89
+ };
90
+ }
91
+ async validateConnection(ctx) {
92
+ try {
93
+ const credentials = await this.resolveCredentials(ctx);
94
+ if (!credentials.accessToken) {
95
+ return {
96
+ valid: false,
97
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,
98
+ errorMessage: 'No access token available for Google connection.',
99
+ };
100
+ }
101
+ return {
102
+ valid: true,
103
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
104
+ externalAccountName: defaultTo(credentials.email, 'Google'),
105
+ externalAccountId: defaultTo(credentials.email, undefined),
106
+ };
107
+ }
108
+ catch {
109
+ return {
110
+ valid: false,
111
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,
112
+ errorMessage: 'Failed to validate Google credentials.',
113
+ };
114
+ }
115
+ }
116
+ async createClient(ctx) {
117
+ const credentials = await this.resolveCredentials(ctx);
118
+ if (!credentials.accessToken) {
119
+ throw new Error('Google connection has no usable access token.');
120
+ }
121
+ return {
122
+ accessToken: credentials.accessToken,
123
+ refreshToken: credentials.refreshToken,
124
+ email: credentials.email,
125
+ };
126
+ }
127
+ async resolveCredentials(ctx) {
128
+ const config = (ctx.config ?? {});
129
+ const configAccessToken = trim(String(config['accessToken'] ?? ''));
130
+ if (configAccessToken) {
131
+ return {
132
+ accessToken: configAccessToken,
133
+ refreshToken: trim(String(config['refreshToken'] ?? '')) || undefined,
134
+ email: trim(String(config['email'] ?? '')) || undefined,
135
+ };
136
+ }
137
+ if (!this.secretStore || !ctx.secretRef || ctx.secretRef === 'config') {
138
+ throw new Error('Google connection credentials are not available.');
139
+ }
140
+ const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);
141
+ return {
142
+ accessToken: trim(defaultTo(credentials.accessToken, '')),
143
+ refreshToken: trim(defaultTo(credentials.refreshToken, '')) || undefined,
144
+ email: trim(defaultTo(credentials.email, '')) || undefined,
145
+ };
146
+ }
147
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleIntegrationRuntimeProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
148
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleIntegrationRuntimeProvider }); }
149
+ }
150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleIntegrationRuntimeProvider, decorators: [{
151
+ type: Injectable
152
+ }] });
153
+
154
+ //#region ---- Google platform auth strategy ----
155
+ class AXEGooglePlatformAuthStrategy extends AXPAuthStrategy {
156
+ constructor() {
157
+ super(...arguments);
158
+ this.authConfigs = inject(AXM_AUTH_CONFIG_TOKEN);
159
+ this.sessionService = inject(AXPSessionService);
160
+ this.platformAuthRuntime = inject(AXPPlatformAuthRuntimeService);
161
+ }
162
+ get name() {
163
+ return 'google';
164
+ }
165
+ resolveIssuer() {
166
+ return resolvePlatformOAuthIssuer(this.authConfigs.baseUrl);
167
+ }
168
+ resolveClientConfig() {
169
+ return resolvePlatformOAuthClientConfig(this.authConfigs.authConfig);
170
+ }
171
+ async signin(_credentials) {
172
+ await this.redirectToGooglePlatformAuthorize();
173
+ }
174
+ async redirectToGooglePlatformAuthorize() {
175
+ const issuer = this.resolveIssuer();
176
+ const { clientId, redirectUri, scope } = this.resolveClientConfig();
177
+ const codeVerifier = PkceUtil.generateRandomString(128);
178
+ localStorage.setItem('pkce_code_verifier', codeVerifier);
179
+ const codeChallenge = await PkceUtil.generateCodeChallenge(codeVerifier);
180
+ // Ensure callback can resolve strategy even if restoreSession cleared AXP_SESSION.
181
+ this.sessionService.setStrategy('google');
182
+ const params = new URLSearchParams({
183
+ response_type: 'code',
184
+ client_id: clientId,
185
+ redirect_uri: redirectUri,
186
+ scope,
187
+ code_challenge: codeChallenge,
188
+ code_challenge_method: 'S256',
189
+ prompt: 'login',
190
+ acr_values: 'google',
191
+ });
192
+ window.location.assign(`${issuer}/connect/authorize?${params.toString()}`);
193
+ await this.waitForOAuthRedirect();
194
+ }
195
+ async signout() {
196
+ localStorage.removeItem('pkce_code_verifier');
197
+ localStorage.removeItem('oauth_provider');
198
+ await this.platformAuthRuntime.logout();
199
+ }
200
+ async refreshToken(_context) {
201
+ try {
202
+ const authData = this.loadAuthData();
203
+ const tokenData = await this.platformAuthRuntime.refresh();
204
+ return toPlatformOAuthSignInResult(tokenData, {
205
+ user: tokenData.user,
206
+ tenant: authData?.tenant ?? null,
207
+ application: authData?.application ?? null,
208
+ });
209
+ }
210
+ catch (error) {
211
+ console.error('Error refreshing token', error);
212
+ return { succeed: false };
213
+ }
214
+ }
215
+ async updateToken(params) {
216
+ try {
217
+ if (params['code']) {
218
+ return this.exchangeAuthorizationCode(params);
219
+ }
220
+ if (shouldPlatformOAuthBindSession(this.sessionService.hasSessionCredentials(), params)) {
221
+ const { tenant, application, tenantId, applicationId } = platformOAuthSessionUpdateParams(params);
222
+ const result = await this.platformAuthRuntime.updateSession({
223
+ tenantId,
224
+ applicationId,
225
+ tenant,
226
+ application,
227
+ });
228
+ return toPlatformOAuthSignInResult(result, {
229
+ user: params['user'] ?? null,
230
+ tenant: tenant ?? null,
231
+ application: application ?? null,
232
+ });
233
+ }
234
+ return this.beginAuthorizationCodeFlow(params);
235
+ }
236
+ catch (error) {
237
+ console.error('Error in updateToken:', error);
238
+ throw error;
239
+ }
240
+ }
241
+ async exchangeAuthorizationCode(params) {
242
+ const code = params['code'];
243
+ const issuer = this.resolveIssuer();
244
+ const { clientId, redirectUri } = this.resolveClientConfig();
245
+ const resolvedRedirectUri = params['redirectUri'] || redirectUri;
246
+ const resolvedClientId = params['clientId'] || clientId;
247
+ const tokenEndpoint = resolvePlatformOAuthTokenEndpoint(issuer);
248
+ const codeVerifier = localStorage.getItem('pkce_code_verifier');
249
+ if (!codeVerifier) {
250
+ throw new Error('Code verifier not found. Please try signing in again.');
251
+ }
252
+ const body = new URLSearchParams({
253
+ grant_type: 'authorization_code',
254
+ client_id: resolvedClientId,
255
+ code_verifier: codeVerifier,
256
+ code,
257
+ redirect_uri: resolvedRedirectUri,
258
+ });
259
+ const response = await fetch(tokenEndpoint, {
260
+ method: 'POST',
261
+ credentials: 'include',
262
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
263
+ body: body.toString(),
264
+ });
265
+ if (!response.ok) {
266
+ const detail = await response.text().catch(() => '');
267
+ throw new Error(`Token exchange failed: ${response.status} ${response.statusText}${detail ? ` — ${detail}` : ''}`);
268
+ }
269
+ localStorage.removeItem('pkce_code_verifier');
270
+ const tokenData = await response.json();
271
+ const payload = JwtUtil.parseJwt(tokenData.id_token);
272
+ if (!payload) {
273
+ throw new Error('Payload not found');
274
+ }
275
+ const user = {
276
+ id: payload['sub'] || '',
277
+ title: payload['name'] || payload['email'] || '',
278
+ name: payload['name'] || payload['email'] || '',
279
+ avatar: payload['picture'] || '',
280
+ };
281
+ return {
282
+ succeed: true,
283
+ data: {
284
+ accessToken: tokenData.access_token ?? tokenData.accessToken,
285
+ refreshToken: tokenData.refresh_token ?? tokenData.refreshToken,
286
+ idToken: tokenData.id_token ?? null,
287
+ expiresIn: TimeUtil.calculateExpireInDate(tokenData.expires_in || 0),
288
+ user,
289
+ tenant: null,
290
+ application: null,
291
+ },
292
+ };
293
+ }
294
+ async beginAuthorizationCodeFlow(params) {
295
+ const issuer = this.resolveIssuer();
296
+ const tenantId = params['tenantId'] ?? params['tenant']?.id ?? null;
297
+ const applicationId = params['applicationId'] ?? params['application']?.id ?? null;
298
+ const { clientId, redirectUri, scope } = this.resolveClientConfig();
299
+ const resolvedRedirectUri = params['redirectUri'] || redirectUri;
300
+ const resolvedScope = params['scope'] || scope;
301
+ const codeVerifier = PkceUtil.generateRandomString(128);
302
+ localStorage.setItem('pkce_code_verifier', codeVerifier);
303
+ const codeChallenge = await PkceUtil.generateCodeChallenge(codeVerifier);
304
+ const authorizeEndpoint = resolvePlatformOAuthAuthorizeEndpoint(issuer);
305
+ const state = Math.random().toString(36).substring(2);
306
+ const queryParams = [
307
+ `response_type=code`,
308
+ `client_id=${encodeURIComponent(clientId)}`,
309
+ `redirect_uri=${encodeURIComponent(resolvedRedirectUri)}`,
310
+ `scope=${encodeURIComponent(resolvedScope)}`,
311
+ `state=${encodeURIComponent(state)}`,
312
+ tenantId ? `tenant_id=${encodeURIComponent(tenantId)}` : null,
313
+ applicationId ? `application_id=${encodeURIComponent(applicationId)}` : null,
314
+ `code_challenge=${encodeURIComponent(codeChallenge)}`,
315
+ `code_challenge_method=S256`,
316
+ `acr_values=google`,
317
+ ]
318
+ .filter(Boolean)
319
+ .join('&');
320
+ window.location.href = `${authorizeEndpoint}?${queryParams}`;
321
+ await this.waitForOAuthRedirect();
322
+ return undefined;
323
+ }
324
+ waitForOAuthRedirect() {
325
+ return new Promise(() => { });
326
+ }
327
+ loadAuthData() {
328
+ return this.sessionService.getSessionData() || undefined;
329
+ }
330
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformAuthStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
331
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformAuthStrategy }); }
332
+ }
333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformAuthStrategy, decorators: [{
334
+ type: Injectable
335
+ }] });
336
+
337
+ //#region ---- Google platform login availability ----
338
+ class AXEGooglePlatformLoginAvailabilityService {
339
+ constructor() {
340
+ this.platformAuthRuntime = inject(AXPPlatformAuthRuntimeService);
341
+ this.cachedEnabled = null;
342
+ }
343
+ async isEnabled() {
344
+ if (this.cachedEnabled !== null) {
345
+ return this.cachedEnabled;
346
+ }
347
+ try {
348
+ const providers = await this.platformAuthRuntime.listProviders();
349
+ this.cachedEnabled = providers.identityProviders.some((p) => p.id === 'google');
350
+ return this.cachedEnabled;
351
+ }
352
+ catch {
353
+ this.cachedEnabled = false;
354
+ return false;
355
+ }
356
+ }
357
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformLoginAvailabilityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
358
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformLoginAvailabilityService }); }
359
+ }
360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGooglePlatformLoginAvailabilityService, decorators: [{
361
+ type: Injectable
362
+ }] });
363
+
364
+ //#region ---- Imports ----
365
+ //#endregion
366
+ //#region ---- Constants ----
367
+ /** Must match the settings group `name` from integration-management (`AXMIntegrationManagementSettingProvider`). */
368
+ const INTEGRATIONS_SETTINGS_GROUP = 'integrations';
369
+ const GOOGLE_I18N = '@extensions-google:settings.google';
370
+ //#endregion
371
+ //#region ---- Settings Provider ----
372
+ class AXEGoogleSettingsProvider {
373
+ constructor() {
374
+ this.sessionService = inject(AXPSessionService);
375
+ }
376
+ async provide(context) {
377
+ // Only register when the edition entitles Google (same gate as Integrations provider list).
378
+ if (!this.sessionService.isModuleEnabled(RootConfig.module.name)) {
379
+ return;
380
+ }
381
+ if (!context.hasGroup(INTEGRATIONS_SETTINGS_GROUP)) {
382
+ return;
383
+ }
384
+ const integrations = context.group(INTEGRATIONS_SETTINGS_GROUP);
385
+ if (!integrations) {
386
+ return;
387
+ }
388
+ integrations
389
+ .addSection('google', `${GOOGLE_I18N}.section-title`, `${GOOGLE_I18N}.section-description`)
390
+ .addSetting({
391
+ key: 'Google:Setting:ConnectionPanel',
392
+ title: `${GOOGLE_I18N}.connection-title`,
393
+ scope: 'U',
394
+ overridableAt: [],
395
+ isInherited: false,
396
+ widget: {
397
+ type: AXPWidgetsList.Advanced.IntegrationConnectionsPanel,
398
+ layout: { stacked: true },
399
+ options: { providerId: 'google' },
400
+ },
401
+ description: `${GOOGLE_I18N}.connection-description`,
402
+ })
403
+ .addSetting({
404
+ key: AXEGoogleSettings.GmailSyncEnabled,
405
+ title: `${GOOGLE_I18N}.gmail-enabled-title`,
406
+ scope: 'U',
407
+ overridableAt: [],
408
+ isInherited: false,
409
+ defaultValue: false,
410
+ widget: {
411
+ type: AXPWidgetsList.Editors.ToggleSwitch,
412
+ },
413
+ description: `${GOOGLE_I18N}.gmail-enabled-description`,
414
+ })
415
+ .addSetting({
416
+ key: AXEGoogleSettings.CalendarSyncEnabled,
417
+ title: `${GOOGLE_I18N}.calendar-enabled-title`,
418
+ scope: 'U',
419
+ overridableAt: [],
420
+ isInherited: false,
421
+ defaultValue: false,
422
+ widget: {
423
+ type: AXPWidgetsList.Editors.ToggleSwitch,
424
+ },
425
+ description: `${GOOGLE_I18N}.calendar-enabled-description`,
426
+ })
427
+ .endSection();
428
+ }
429
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleSettingsProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
430
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleSettingsProvider }); }
431
+ }
432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleSettingsProvider, decorators: [{
433
+ type: Injectable
434
+ }] });
435
+
436
+ const googleLogoProvider = {
437
+ key: axpGoogleLogoKey,
438
+ resolve: async (request) => ({
439
+ kind: 'component',
440
+ load: () => Promise.resolve().then(function () { return googleLogo_component; }).then((module) => module.AXEGoogleLogoComponent),
441
+ inputs: {
442
+ appearance: request.appearance,
443
+ size: request.size,
444
+ },
445
+ }),
446
+ };
447
+ const AXE_GOOGLE_LOGO_PROVIDER = {
448
+ provide: AXP_LOGO_PROVIDER,
449
+ useValue: googleLogoProvider,
450
+ multi: true,
451
+ };
452
+
453
+ //#region ---- Imports ----
454
+ //#endregion
455
+ //#region ---- Module ----
456
+ /**
457
+ * Google Workspace integration (Gmail, Calendar) and platform login via Google OAuth.
458
+ * Register in the app after {@link AXMIntegrationManagementModule}.
459
+ */
460
+ class AXEGoogleExtensionModule {
461
+ constructor(registry, googlePlatformLogin) {
462
+ registry.register(AUTH_LOGIN_EXTERNAL_PROVIDERS_SLOT, {
463
+ name: 'google-platform-login',
464
+ priority: 10,
465
+ loadComponent: () => import('./acorex-platform-extension-google-client-google-platform-login-slot.component-WO8_R8Zh.mjs').then((component) => component.AXEGooglePlatformLoginSlotComponent),
466
+ condition: () => googlePlatformLogin.isEnabled(),
467
+ });
468
+ }
469
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleExtensionModule, deps: [{ token: i1.AXPComponentSlotRegistryService }, { token: AXEGooglePlatformLoginAvailabilityService }], target: i0.ɵɵFactoryTarget.NgModule }); }
470
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleExtensionModule, imports: [AXMIntegrationManagementModule, i3.AXPAuthModule] }); }
471
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleExtensionModule, providers: [
472
+ AXEGooglePlatformLoginAvailabilityService,
473
+ AXE_GOOGLE_LOGO_PROVIDER,
474
+ {
475
+ provide: AXP_INTEGRATION_PROVIDER,
476
+ useClass: AXEGoogleIntegrationProvider,
477
+ multi: true,
478
+ },
479
+ {
480
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
481
+ useClass: AXEGoogleIntegrationRuntimeProvider,
482
+ multi: true,
483
+ },
484
+ {
485
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
486
+ useClass: AXEGoogleSettingsProvider,
487
+ multi: true,
488
+ },
489
+ provideCommandSetups([
490
+ {
491
+ key: AXEGoogleCommandKeys.ConnectionConnect,
492
+ command: () => import('./acorex-platform-extension-google-client-connect-google.command-DZ1pU8xZ.mjs').then((c) => c.ConnectGoogleCommand),
493
+ },
494
+ {
495
+ key: AXEGoogleCommandKeys.ConnectionCompleteOAuth,
496
+ command: () => import('./acorex-platform-extension-google-client-complete-google-oauth.command-BE9n_4Yn.mjs').then((c) => c.CompleteGoogleOAuthCommand),
497
+ },
498
+ ]),
499
+ ], imports: [AXMIntegrationManagementModule,
500
+ AXPAuthModule.forChild({ strategies: [AXEGooglePlatformAuthStrategy] })] }); }
501
+ }
502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleExtensionModule, decorators: [{
503
+ type: NgModule,
504
+ args: [{
505
+ imports: [
506
+ AXMIntegrationManagementModule,
507
+ AXPAuthModule.forChild({ strategies: [AXEGooglePlatformAuthStrategy] }),
508
+ ],
509
+ providers: [
510
+ AXEGooglePlatformLoginAvailabilityService,
511
+ AXE_GOOGLE_LOGO_PROVIDER,
512
+ {
513
+ provide: AXP_INTEGRATION_PROVIDER,
514
+ useClass: AXEGoogleIntegrationProvider,
515
+ multi: true,
516
+ },
517
+ {
518
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
519
+ useClass: AXEGoogleIntegrationRuntimeProvider,
520
+ multi: true,
521
+ },
522
+ {
523
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
524
+ useClass: AXEGoogleSettingsProvider,
525
+ multi: true,
526
+ },
527
+ provideCommandSetups([
528
+ {
529
+ key: AXEGoogleCommandKeys.ConnectionConnect,
530
+ command: () => import('./acorex-platform-extension-google-client-connect-google.command-DZ1pU8xZ.mjs').then((c) => c.ConnectGoogleCommand),
531
+ },
532
+ {
533
+ key: AXEGoogleCommandKeys.ConnectionCompleteOAuth,
534
+ command: () => import('./acorex-platform-extension-google-client-complete-google-oauth.command-BE9n_4Yn.mjs').then((c) => c.CompleteGoogleOAuthCommand),
535
+ },
536
+ ]),
537
+ ],
538
+ }]
539
+ }], ctorParameters: () => [{ type: i1.AXPComponentSlotRegistryService }, { type: AXEGooglePlatformLoginAvailabilityService }] });
540
+
541
+ //#region ---- Google brand logo (owned by Google extension) ----
542
+ class AXEGoogleLogoComponent {
543
+ constructor() {
544
+ this.appearance = input('colored', /* @ts-ignore */
545
+ ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
546
+ this.size = input(20, /* @ts-ignore */
547
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
548
+ this.resolvedAppearance = computed(() => {
549
+ const value = this.appearance();
550
+ return value === 'monochrome' ? 'monochrome' : 'colored';
551
+ }, /* @ts-ignore */
552
+ ...(ngDevMode ? [{ debugName: "resolvedAppearance" }] : /* istanbul ignore next */ []));
553
+ }
554
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleLogoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
555
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXEGoogleLogoComponent, isStandalone: true, selector: "axe-google-logo", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex items-center justify-center" }, ngImport: i0, template: `
556
+ @switch (resolvedAppearance()) {
557
+ @case ('monochrome') {
558
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
559
+ <path
560
+ fill="currentColor"
561
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
562
+ />
563
+ </svg>
564
+ }
565
+ @default {
566
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
567
+ <path
568
+ fill="#4285F4"
569
+ d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
570
+ />
571
+ <path
572
+ fill="#34A853"
573
+ d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
574
+ />
575
+ <path
576
+ fill="#FBBC05"
577
+ d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
578
+ />
579
+ <path
580
+ fill="#EA4335"
581
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
582
+ />
583
+ </svg>
584
+ }
585
+ }
586
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.Eager }); }
587
+ }
588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGoogleLogoComponent, decorators: [{
589
+ type: Component,
590
+ args: [{
591
+ selector: 'axe-google-logo',
592
+ host: { class: 'inline-flex items-center justify-center' },
593
+ changeDetection: ChangeDetectionStrategy.Eager,
594
+ template: `
595
+ @switch (resolvedAppearance()) {
596
+ @case ('monochrome') {
597
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
598
+ <path
599
+ fill="currentColor"
600
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
601
+ />
602
+ </svg>
603
+ }
604
+ @default {
605
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
606
+ <path
607
+ fill="#4285F4"
608
+ d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
609
+ />
610
+ <path
611
+ fill="#34A853"
612
+ d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
613
+ />
614
+ <path
615
+ fill="#FBBC05"
616
+ d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
617
+ />
618
+ <path
619
+ fill="#EA4335"
620
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
621
+ />
622
+ </svg>
623
+ }
624
+ }
625
+ `,
626
+ }]
627
+ }], propDecorators: { appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
628
+
629
+ var googleLogo_component = /*#__PURE__*/Object.freeze({
630
+ __proto__: null,
631
+ AXEGoogleLogoComponent: AXEGoogleLogoComponent
632
+ });
633
+
634
+ /**
635
+ * Generated bundle index. Do not edit.
636
+ */
637
+
638
+ export { AXEGoogleExtensionModule, AXEGoogleIntegrationRuntimeProvider, AXEGoogleLogoComponent, AXEGooglePlatformAuthStrategy, AXE_GOOGLE_LOGO_PROVIDER, AXE_GOOGLE_OAUTH_DEFAULT_SCOPES, axpGoogleLogoKey };
639
+ //# sourceMappingURL=acorex-platform-extension-google-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-google-client.mjs","sources":["../../../../libs/extensions/google/client/src/lib/brand/google-logo-key.ts","../../../../libs/extensions/google/client/src/lib/integration/google.integration.constants.ts","../../../../libs/extensions/google/client/src/lib/integration/google.integration.provider.ts","../../../../libs/extensions/google/client/src/lib/integration/google.integration-runtime.provider.ts","../../../../libs/extensions/google/client/src/lib/platform-auth/google-platform-auth.strategy.ts","../../../../libs/extensions/google/client/src/lib/platform-auth/google-platform-login-availability.service.ts","../../../../libs/extensions/google/client/src/lib/settings/google.settings.provider.ts","../../../../libs/extensions/google/client/src/lib/brand/google-logo.provider.ts","../../../../libs/extensions/google/client/src/lib/google-extension.module.ts","../../../../libs/extensions/google/client/src/lib/brand/google-logo.component.ts","../../../../libs/extensions/google/client/src/acorex-platform-extension-google-client.ts"],"sourcesContent":["//#region ---- Google logo registry key ----\n\nexport const axpGoogleLogoKey = 'google' as const;\n\n//#endregion\n","//#region ---- Google OAuth scopes ----\n\n/** Default OAuth scopes requested when connecting a Google account. */\nexport const AXE_GOOGLE_OAUTH_DEFAULT_SCOPES = [\n 'openid',\n 'email',\n 'profile',\n 'https://www.googleapis.com/auth/gmail.readonly',\n 'https://www.googleapis.com/auth/calendar',\n] as const;\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXP_INTEGRATION_AUTH_METHOD_TYPE, AXP_INTEGRATION_CAPABILITY, AXP_INTEGRATION_CONNECTION_SCOPE } from '@acorex-platform/framework-shared/core';\nimport {\n AXPIntegrationProvider,\n AXPIntegrationProviderContext,\n} from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport { AXEGoogleCommandKeys, RootConfig } from '@acorex-platform/extension-google-client/contracts';\nimport { axpGoogleLogoKey } from '../brand/google-logo-key';\nimport { AXE_GOOGLE_OAUTH_DEFAULT_SCOPES } from './google.integration.constants';\n\n//#endregion\n\n//#region ---- Provider ----\n\n@Injectable()\nexport class AXEGoogleIntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n domainId: 'other',\n id: 'google',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpGoogleLogoKey,\n capabilities: [\n AXP_INTEGRATION_CAPABILITY.Messaging,\n AXP_INTEGRATION_CAPABILITY.Calendar,\n AXP_INTEGRATION_CAPABILITY.Sync,\n AXP_INTEGRATION_CAPABILITY.Identity,\n ],\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.User],\n allowMultipleConnections: false,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEGoogleCommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXEGoogleCommandKeys.ConnectionCompleteOAuth,\n authMethods: [\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,\n label: `${I18N}.auth.oauth.label`,\n instructions: `${I18N}.auth.oauth.instructions`,\n usesRedirect: true,\n supportsRefresh: true,\n supportsRevoke: true,\n supportsValidation: true,\n defaultScopes: [...AXE_GOOGLE_OAUTH_DEFAULT_SCOPES],\n fields: [],\n },\n ],\n });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXP_INTEGRATION_CONNECTION_STATUS, type AXPIntegrationProviderRuntimeHooks, type AXPIntegrationRuntimeContext, type AXPIntegrationValidationResult } from '@acorex-platform/framework-shared/core';\nimport {\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';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXEGoogleIntegrationClient {\n accessToken: string;\n refreshToken?: string;\n email?: string;\n}\n\ninterface GoogleConnectionCredentials {\n accessToken: string;\n refreshToken?: string;\n email?: string;\n}\n\n//#endregion\n\n//#region ---- Runtime Provider ----\n\n@Injectable()\nexport class AXEGoogleIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'google';\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 createClient: (ctx) => this.createClient(ctx),\n };\n }\n\n private async validateConnection(ctx: AXPIntegrationRuntimeContext): Promise<AXPIntegrationValidationResult> {\n try {\n const credentials = await this.resolveCredentials(ctx);\n if (!credentials.accessToken) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'No access token available for Google connection.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: defaultTo(credentials.email, 'Google'),\n externalAccountId: defaultTo(credentials.email, undefined),\n };\n } catch {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Failed to validate Google credentials.',\n };\n }\n }\n\n private async createClient(ctx: AXPIntegrationRuntimeContext): Promise<AXEGoogleIntegrationClient> {\n const credentials = await this.resolveCredentials(ctx);\n if (!credentials.accessToken) {\n throw new Error('Google connection has no usable access token.');\n }\n\n return {\n accessToken: credentials.accessToken,\n refreshToken: credentials.refreshToken,\n email: credentials.email,\n };\n }\n\n private async resolveCredentials(ctx: AXPIntegrationRuntimeContext): Promise<GoogleConnectionCredentials> {\n const config = (ctx.config ?? {}) as Record<string, unknown>;\n const configAccessToken = trim(String(config['accessToken'] ?? ''));\n if (configAccessToken) {\n return {\n accessToken: configAccessToken,\n refreshToken: trim(String(config['refreshToken'] ?? '')) || undefined,\n email: trim(String(config['email'] ?? '')) || undefined,\n };\n }\n\n if (!this.secretStore || !ctx.secretRef || ctx.secretRef === 'config') {\n throw new Error('Google connection credentials are not available.');\n }\n\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n return {\n accessToken: trim(defaultTo(credentials.accessToken, '')),\n refreshToken: trim(defaultTo(credentials.refreshToken, '')) || undefined,\n email: trim(defaultTo(credentials.email, '')) || undefined,\n };\n }\n}\n\n//#endregion\n","import { AXM_AUTH_CONFIG_TOKEN, AXMAuthConfigs } from '@acorex-platform/module-auth-client';\nimport {\n AXPAuthStrategy,\n AXPBaseCredentials,\n AXPPlatformAuthRuntimeService,\n AXPSessionContext,\n AXPSessionData,\n AXPSessionService,\n AXPSignInResult,\n AXPUser,\n JwtUtil,\n PkceUtil,\n platformOAuthSessionUpdateParams,\n resolvePlatformOAuthAuthorizeEndpoint,\n resolvePlatformOAuthClientConfig,\n resolvePlatformOAuthIssuer,\n resolvePlatformOAuthTokenEndpoint,\n shouldPlatformOAuthBindSession,\n TimeUtil,\n toPlatformOAuthSignInResult,\n} from '@acorex-platform/framework-client/auth';\nimport { inject, Injectable } from '@angular/core';\n\n//#region ---- Google platform auth strategy ----\n\n@Injectable()\nexport class AXEGooglePlatformAuthStrategy extends AXPAuthStrategy {\n private readonly authConfigs: AXMAuthConfigs = inject(AXM_AUTH_CONFIG_TOKEN);\n private readonly sessionService = inject(AXPSessionService);\n private readonly platformAuthRuntime = inject(AXPPlatformAuthRuntimeService);\n\n get name(): string {\n return 'google';\n }\n\n private resolveIssuer(): string {\n return resolvePlatformOAuthIssuer(this.authConfigs.baseUrl);\n }\n\n private resolveClientConfig() {\n return resolvePlatformOAuthClientConfig(this.authConfigs.authConfig);\n }\n\n override async signin(_credentials: AXPBaseCredentials): Promise<void> {\n await this.redirectToGooglePlatformAuthorize();\n }\n\n private async redirectToGooglePlatformAuthorize(): Promise<void> {\n const issuer = this.resolveIssuer();\n const { clientId, redirectUri, scope } = this.resolveClientConfig();\n\n const codeVerifier = PkceUtil.generateRandomString(128);\n localStorage.setItem('pkce_code_verifier', codeVerifier);\n const codeChallenge = await PkceUtil.generateCodeChallenge(codeVerifier);\n\n // Ensure callback can resolve strategy even if restoreSession cleared AXP_SESSION.\n this.sessionService.setStrategy('google');\n\n const params = new URLSearchParams({\n response_type: 'code',\n client_id: clientId,\n redirect_uri: redirectUri,\n scope,\n code_challenge: codeChallenge,\n code_challenge_method: 'S256',\n prompt: 'login',\n acr_values: 'google',\n });\n\n window.location.assign(`${issuer}/connect/authorize?${params.toString()}`);\n await this.waitForOAuthRedirect();\n }\n\n async signout(): Promise<void> {\n localStorage.removeItem('pkce_code_verifier');\n localStorage.removeItem('oauth_provider');\n await this.platformAuthRuntime.logout();\n }\n\n async refreshToken(_context: AXPSessionContext): Promise<AXPSignInResult> {\n try {\n const authData = this.loadAuthData();\n const tokenData = await this.platformAuthRuntime.refresh();\n return toPlatformOAuthSignInResult(tokenData, {\n user: tokenData.user,\n tenant: authData?.tenant ?? null,\n application: authData?.application ?? null,\n });\n } catch (error) {\n console.error('Error refreshing token', error);\n return { succeed: false };\n }\n }\n\n override async updateToken(params: { [key: string]: any }): Promise<AXPSignInResult | undefined> {\n try {\n if (params['code']) {\n return this.exchangeAuthorizationCode(params);\n }\n\n if (shouldPlatformOAuthBindSession(this.sessionService.hasSessionCredentials(), params)) {\n const { tenant, application, tenantId, applicationId } = platformOAuthSessionUpdateParams(params);\n const result = await this.platformAuthRuntime.updateSession({\n tenantId,\n applicationId,\n tenant,\n application,\n });\n return toPlatformOAuthSignInResult(result, {\n user: (params['user'] as AXPUser) ?? null,\n tenant: tenant ?? null,\n application: application ?? null,\n });\n }\n\n return this.beginAuthorizationCodeFlow(params);\n } catch (error) {\n console.error('Error in updateToken:', error);\n throw error;\n }\n }\n\n private async exchangeAuthorizationCode(params: { [key: string]: any }): Promise<AXPSignInResult> {\n const code = params['code'];\n const issuer = this.resolveIssuer();\n const { clientId, redirectUri } = this.resolveClientConfig();\n const resolvedRedirectUri = params['redirectUri'] || redirectUri;\n const resolvedClientId = params['clientId'] || clientId;\n const tokenEndpoint = resolvePlatformOAuthTokenEndpoint(issuer);\n\n const codeVerifier = localStorage.getItem('pkce_code_verifier');\n if (!codeVerifier) {\n throw new Error('Code verifier not found. Please try signing in again.');\n }\n\n const body = new URLSearchParams({\n grant_type: 'authorization_code',\n client_id: resolvedClientId,\n code_verifier: codeVerifier,\n code,\n redirect_uri: resolvedRedirectUri,\n });\n\n const response = await fetch(tokenEndpoint, {\n method: 'POST',\n credentials: 'include',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body: body.toString(),\n });\n\n if (!response.ok) {\n const detail = await response.text().catch(() => '');\n throw new Error(\n `Token exchange failed: ${response.status} ${response.statusText}${detail ? ` — ${detail}` : ''}`,\n );\n }\n\n localStorage.removeItem('pkce_code_verifier');\n\n const tokenData = await response.json();\n const payload = JwtUtil.parseJwt(tokenData.id_token);\n if (!payload) {\n throw new Error('Payload not found');\n }\n\n const user = {\n id: payload['sub'] || '',\n title: payload['name'] || payload['email'] || '',\n name: payload['name'] || payload['email'] || '',\n avatar: payload['picture'] || '',\n } as AXPUser;\n\n return {\n succeed: true,\n data: {\n accessToken: tokenData.access_token ?? tokenData.accessToken,\n refreshToken: tokenData.refresh_token ?? tokenData.refreshToken,\n idToken: tokenData.id_token ?? null,\n expiresIn: TimeUtil.calculateExpireInDate(tokenData.expires_in || 0),\n user,\n tenant: null,\n application: null,\n },\n };\n }\n\n private async beginAuthorizationCodeFlow(params: { [key: string]: any }): Promise<undefined> {\n const issuer = this.resolveIssuer();\n const tenantId = params['tenantId'] ?? params['tenant']?.id ?? null;\n const applicationId = params['applicationId'] ?? params['application']?.id ?? null;\n const { clientId, redirectUri, scope } = this.resolveClientConfig();\n const resolvedRedirectUri = params['redirectUri'] || redirectUri;\n const resolvedScope = params['scope'] || scope;\n\n const codeVerifier = PkceUtil.generateRandomString(128);\n localStorage.setItem('pkce_code_verifier', codeVerifier);\n const codeChallenge = await PkceUtil.generateCodeChallenge(codeVerifier);\n\n const authorizeEndpoint = resolvePlatformOAuthAuthorizeEndpoint(issuer);\n const state = Math.random().toString(36).substring(2);\n\n const queryParams = [\n `response_type=code`,\n `client_id=${encodeURIComponent(clientId)}`,\n `redirect_uri=${encodeURIComponent(resolvedRedirectUri)}`,\n `scope=${encodeURIComponent(resolvedScope)}`,\n `state=${encodeURIComponent(state)}`,\n tenantId ? `tenant_id=${encodeURIComponent(tenantId)}` : null,\n applicationId ? `application_id=${encodeURIComponent(applicationId)}` : null,\n `code_challenge=${encodeURIComponent(codeChallenge)}`,\n `code_challenge_method=S256`,\n `acr_values=google`,\n ]\n .filter(Boolean)\n .join('&');\n\n window.location.href = `${authorizeEndpoint}?${queryParams}`;\n await this.waitForOAuthRedirect();\n\n return undefined;\n }\n\n private waitForOAuthRedirect(): Promise<void> {\n return new Promise<void>(() => {});\n }\n\n private loadAuthData(): AXPSessionData | undefined {\n return this.sessionService.getSessionData() || undefined;\n }\n}\n\n//#endregion\n","import { AXPPlatformAuthRuntimeService } from '@acorex-platform/framework-client/auth';\nimport { Injectable, inject } from '@angular/core';\n\n//#region ---- Google platform login availability ----\n\n@Injectable()\nexport class AXEGooglePlatformLoginAvailabilityService {\n private readonly platformAuthRuntime = inject(AXPPlatformAuthRuntimeService);\n private cachedEnabled: boolean | null = null;\n\n async isEnabled(): Promise<boolean> {\n if (this.cachedEnabled !== null) {\n return this.cachedEnabled;\n }\n\n try {\n const providers = await this.platformAuthRuntime.listProviders();\n this.cachedEnabled = providers.identityProviders.some((p) => p.id === 'google');\n return this.cachedEnabled;\n } catch {\n this.cachedEnabled = false;\n return false;\n }\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPSettingDefinitionProvider, AXPSettingDefinitionProviderContext } from '@acorex-platform/framework-client/common';\nimport { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport { Injectable, inject } from '@angular/core';\nimport { AXEGoogleSettings, RootConfig } from '@acorex-platform/extension-google-client/contracts';\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Must match the settings group `name` from integration-management (`AXMIntegrationManagementSettingProvider`). */\nconst INTEGRATIONS_SETTINGS_GROUP = 'integrations';\n\nconst GOOGLE_I18N = '@extensions-google:settings.google';\n\n//#endregion\n\n//#region ---- Settings Provider ----\n\n@Injectable()\nexport class AXEGoogleSettingsProvider implements AXPSettingDefinitionProvider {\n private readonly sessionService = inject(AXPSessionService);\n\n async provide(context: AXPSettingDefinitionProviderContext): Promise<void> {\n // Only register when the edition entitles Google (same gate as Integrations provider list).\n if (!this.sessionService.isModuleEnabled(RootConfig.module.name)) {\n return;\n }\n\n if (!context.hasGroup(INTEGRATIONS_SETTINGS_GROUP)) {\n return;\n }\n\n const integrations = context.group(INTEGRATIONS_SETTINGS_GROUP);\n if (!integrations) {\n return;\n }\n\n integrations\n .addSection('google', `${GOOGLE_I18N}.section-title`, `${GOOGLE_I18N}.section-description`)\n .addSetting({\n key: 'Google:Setting:ConnectionPanel',\n title: `${GOOGLE_I18N}.connection-title`,\n scope: 'U',\n overridableAt: [],\n isInherited: false,\n widget: {\n type: AXPWidgetsList.Advanced.IntegrationConnectionsPanel,\n layout: { stacked: true },\n options: { providerId: 'google' },\n },\n description: `${GOOGLE_I18N}.connection-description`,\n })\n .addSetting({\n key: AXEGoogleSettings.GmailSyncEnabled,\n title: `${GOOGLE_I18N}.gmail-enabled-title`,\n scope: 'U',\n overridableAt: [],\n isInherited: false,\n defaultValue: false,\n widget: {\n type: AXPWidgetsList.Editors.ToggleSwitch,\n },\n description: `${GOOGLE_I18N}.gmail-enabled-description`,\n })\n .addSetting({\n key: AXEGoogleSettings.CalendarSyncEnabled,\n title: `${GOOGLE_I18N}.calendar-enabled-title`,\n scope: 'U',\n overridableAt: [],\n isInherited: false,\n defaultValue: false,\n widget: {\n type: AXPWidgetsList.Editors.ToggleSwitch,\n },\n description: `${GOOGLE_I18N}.calendar-enabled-description`,\n })\n .endSection();\n }\n}\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 { axpGoogleLogoKey } from './google-logo-key';\n\nconst googleLogoProvider: AXPLogoProvider = {\n key: axpGoogleLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'component',\n load: () => import('./google-logo.component').then((module) => module.AXEGoogleLogoComponent),\n inputs: {\n appearance: request.appearance,\n size: request.size,\n },\n }),\n};\n\nexport const AXE_GOOGLE_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: googleLogoProvider,\n multi: true,\n} as const;\n","//#region ---- Imports ----\n\nimport { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';\nimport {\n AXP_INTEGRATION_PROVIDER,\n AXP_INTEGRATION_RUNTIME_PROVIDER,\n AXP_SETTING_DEFINITION_PROVIDER,\n} from '@acorex-platform/framework-client/common';\nimport { AXPAuthModule } from '@acorex-platform/framework-client/auth';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { AXEGoogleCommandKeys } from '@acorex-platform/extension-google-client/contracts';\nimport { AXPComponentSlotRegistryService } from '@acorex-platform/framework-client/core';\nimport { AUTH_LOGIN_EXTERNAL_PROVIDERS_SLOT } from '@acorex-platform/module-auth-client';\nimport { NgModule } from '@angular/core';\nimport { AXEGoogleIntegrationProvider } from './integration/google.integration.provider';\nimport { AXEGoogleIntegrationRuntimeProvider } from './integration/google.integration-runtime.provider';\nimport { AXEGooglePlatformAuthStrategy } from './platform-auth/google-platform-auth.strategy';\nimport { AXEGooglePlatformLoginAvailabilityService } from './platform-auth/google-platform-login-availability.service';\nimport { AXEGoogleSettingsProvider } from './settings/google.settings.provider';\nimport { AXE_GOOGLE_LOGO_PROVIDER } from './brand/google-logo.provider';\n\n//#endregion\n\n//#region ---- Module ----\n\n/**\n * Google Workspace integration (Gmail, Calendar) and platform login via Google OAuth.\n * Register in the app after {@link AXMIntegrationManagementModule}.\n */\n@NgModule({\n imports: [\n AXMIntegrationManagementModule,\n AXPAuthModule.forChild({ strategies: [AXEGooglePlatformAuthStrategy] }),\n ],\n providers: [\n AXEGooglePlatformLoginAvailabilityService,\n AXE_GOOGLE_LOGO_PROVIDER,\n {\n provide: AXP_INTEGRATION_PROVIDER,\n useClass: AXEGoogleIntegrationProvider,\n multi: true,\n },\n {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEGoogleIntegrationRuntimeProvider,\n multi: true,\n },\n {\n provide: AXP_SETTING_DEFINITION_PROVIDER,\n useClass: AXEGoogleSettingsProvider,\n multi: true,\n },\n provideCommandSetups([\n {\n key: AXEGoogleCommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-google.command').then((c) => c.ConnectGoogleCommand),\n },\n {\n key: AXEGoogleCommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-google-oauth.command').then((c) => c.CompleteGoogleOAuthCommand),\n },\n ]),\n ],\n})\nexport class AXEGoogleExtensionModule {\n constructor(\n registry: AXPComponentSlotRegistryService,\n googlePlatformLogin: AXEGooglePlatformLoginAvailabilityService,\n ) {\n registry.register(AUTH_LOGIN_EXTERNAL_PROVIDERS_SLOT, {\n name: 'google-platform-login',\n priority: 10,\n loadComponent: () =>\n import('./platform-auth/google-platform-login-slot.component').then(\n (component) => component.AXEGooglePlatformLoginSlotComponent,\n ),\n condition: () => googlePlatformLogin.isEnabled(),\n });\n }\n}\n\n//#endregion\n","import type { AXPLogoAppearance } from '@acorex-platform/framework-client/core';\nimport { Component, computed, input, ChangeDetectionStrategy } from '@angular/core';\n\n//#region ---- Google brand logo (owned by Google extension) ----\n\n@Component({\n selector: 'axe-google-logo',\n host: { class: 'inline-flex items-center justify-center' },\n changeDetection: ChangeDetectionStrategy.Eager,\n template: `\n @switch (resolvedAppearance()) {\n @case ('monochrome') {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"currentColor\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n }\n @default {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n }\n }\n `,\n})\nexport class AXEGoogleLogoComponent {\n appearance = input<AXPLogoAppearance>('colored');\n size = input(20);\n\n protected readonly resolvedAppearance = computed(() => {\n const value = this.appearance();\n return value === 'monochrome' ? 'monochrome' : 'colored';\n });\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.AXEGooglePlatformLoginAvailabilityService"],"mappings":";;;;;;;;;;;;;;AAAA;AAEO,MAAM,gBAAgB,GAAG;AAEhC;;ACJA;AAEA;AACO,MAAM,+BAA+B,GAAG;IAC7C,QAAQ;IACR,OAAO;IACP,SAAS;IACT,gDAAgD;IAChD,0CAA0C;;AAG5C;;ACXA;AAYA;AAEA;MAGa,4BAA4B,CAAA;IACvC,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,QAAQ,EAAE,OAAO;AACjB,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;YAC9B,WAAW,EAAE,CAAA,EAAG,IAAI,CAAA,aAAA,CAAe;Y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1,28 @@
1
+ {
2
+ "name": "@acorex-platform/extension-google-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-google-client.mjs",
13
+ "typings": "types/acorex-platform-extension-google-client.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/acorex-platform-extension-google-client.d.ts",
20
+ "default": "./fesm2022/acorex-platform-extension-google-client.mjs"
21
+ },
22
+ "./contracts": {
23
+ "types": "./types/acorex-platform-extension-google-client-contracts.d.ts",
24
+ "default": "./fesm2022/acorex-platform-extension-google-client-contracts.mjs"
25
+ }
26
+ },
27
+ "type": "module"
28
+ }
@@ -0,0 +1,51 @@
1
+ declare const RootConfig: {
2
+ config: {
3
+ i18n: string;
4
+ module: string;
5
+ };
6
+ module: {
7
+ name: string;
8
+ icon: string;
9
+ };
10
+ };
11
+
12
+ /**
13
+ * User-scoped settings for Google sync preferences (Google extension).
14
+ */
15
+ declare enum AXEGoogleSettings {
16
+ /** When true, Gmail sync is enabled for the connected Google account. */
17
+ GmailSyncEnabled = "Google:Setting:Sync.GmailEnabled",
18
+ /** When true, Google Calendar sync is enabled for the connected Google account. */
19
+ CalendarSyncEnabled = "Google:Setting:Sync.CalendarEnabled"
20
+ }
21
+
22
+ declare enum AXEGoogleCommandKeys {
23
+ ConnectionConnect = "GoogleExtension:Connection:Connect",
24
+ ConnectionCompleteOAuth = "GoogleExtension:Connection:CompleteOAuth",
25
+ /** Server runtime: start OAuth authorization (not the client connect UI command). */
26
+ OAuthStart = "GoogleExtension:OAuth:Start",
27
+ /** Server runtime: complete OAuth after redirect callback. */
28
+ OAuthComplete = "GoogleExtension:OAuth:Complete"
29
+ }
30
+
31
+ interface AXEGoogleOAuthStartRequest {
32
+ redirectUri: string;
33
+ connectionScope?: 'user' | 'tenant';
34
+ connectionKey?: string;
35
+ displayName?: string;
36
+ scopes?: string[];
37
+ }
38
+ interface AXEGoogleOAuthStartResponse {
39
+ redirectUrl: string;
40
+ state: string;
41
+ }
42
+ interface AXEGoogleOAuthCompleteRequest {
43
+ state: string;
44
+ code: string;
45
+ }
46
+ interface AXEGoogleOAuthCompleteResponse {
47
+ connectionId: string;
48
+ }
49
+
50
+ export { AXEGoogleCommandKeys, AXEGoogleSettings, RootConfig };
51
+ export type { AXEGoogleOAuthCompleteRequest, AXEGoogleOAuthCompleteResponse, AXEGoogleOAuthStartRequest, AXEGoogleOAuthStartResponse };
@@ -0,0 +1,86 @@
1
+ import { AXPComponentSlotRegistryService, AXPLogoAppearance, AXPLogoProvider } from '@acorex-platform/framework-client/core';
2
+ import * as i0 from '@angular/core';
3
+ import * as i1 from '@acorex-platform/module-integration-management-client';
4
+ import * as i2 from '@acorex-platform/framework-client/auth';
5
+ import { AXPAuthStrategy, AXPBaseCredentials, AXPSessionContext, AXPSignInResult } from '@acorex-platform/framework-client/auth';
6
+ import { AXPIntegrationProviderRuntimeHooks } from '@acorex-platform/framework-shared/core';
7
+ import { AXPIntegrationRuntimeProvider } from '@acorex-platform/framework-client/common';
8
+
9
+ declare class AXEGooglePlatformLoginAvailabilityService {
10
+ private readonly platformAuthRuntime;
11
+ private cachedEnabled;
12
+ isEnabled(): Promise<boolean>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEGooglePlatformLoginAvailabilityService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXEGooglePlatformLoginAvailabilityService>;
15
+ }
16
+
17
+ /**
18
+ * Google Workspace integration (Gmail, Calendar) and platform login via Google OAuth.
19
+ * Register in the app after {@link AXMIntegrationManagementModule}.
20
+ */
21
+ declare class AXEGoogleExtensionModule {
22
+ constructor(registry: AXPComponentSlotRegistryService, googlePlatformLogin: AXEGooglePlatformLoginAvailabilityService);
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEGoogleExtensionModule, never>;
24
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AXEGoogleExtensionModule, never, [typeof i1.AXMIntegrationManagementModule, typeof i2.AXPAuthModule], never>;
25
+ static ɵinj: i0.ɵɵInjectorDeclaration<AXEGoogleExtensionModule>;
26
+ }
27
+
28
+ /** Default OAuth scopes requested when connecting a Google account. */
29
+ declare const AXE_GOOGLE_OAUTH_DEFAULT_SCOPES: readonly ["openid", "email", "profile", "https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/calendar"];
30
+
31
+ interface AXEGoogleIntegrationClient {
32
+ accessToken: string;
33
+ refreshToken?: string;
34
+ email?: string;
35
+ }
36
+ declare class AXEGoogleIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {
37
+ readonly providerId = "google";
38
+ private readonly secretStore;
39
+ getHooks(): Promise<AXPIntegrationProviderRuntimeHooks>;
40
+ private validateConnection;
41
+ private createClient;
42
+ private resolveCredentials;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEGoogleIntegrationRuntimeProvider, never>;
44
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXEGoogleIntegrationRuntimeProvider>;
45
+ }
46
+
47
+ declare class AXEGooglePlatformAuthStrategy extends AXPAuthStrategy {
48
+ private readonly authConfigs;
49
+ private readonly sessionService;
50
+ private readonly platformAuthRuntime;
51
+ get name(): string;
52
+ private resolveIssuer;
53
+ private resolveClientConfig;
54
+ signin(_credentials: AXPBaseCredentials): Promise<void>;
55
+ private redirectToGooglePlatformAuthorize;
56
+ signout(): Promise<void>;
57
+ refreshToken(_context: AXPSessionContext): Promise<AXPSignInResult>;
58
+ updateToken(params: {
59
+ [key: string]: any;
60
+ }): Promise<AXPSignInResult | undefined>;
61
+ private exchangeAuthorizationCode;
62
+ private beginAuthorizationCodeFlow;
63
+ private waitForOAuthRedirect;
64
+ private loadAuthData;
65
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEGooglePlatformAuthStrategy, never>;
66
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXEGooglePlatformAuthStrategy>;
67
+ }
68
+
69
+ declare class AXEGoogleLogoComponent {
70
+ appearance: i0.InputSignal<AXPLogoAppearance>;
71
+ size: i0.InputSignal<number>;
72
+ protected readonly resolvedAppearance: i0.Signal<"colored" | "monochrome">;
73
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEGoogleLogoComponent, never>;
74
+ static ɵcmp: i0.ɵɵComponentDeclaration<AXEGoogleLogoComponent, "axe-google-logo", never, { "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
75
+ }
76
+
77
+ declare const axpGoogleLogoKey: "google";
78
+
79
+ declare const AXE_GOOGLE_LOGO_PROVIDER: {
80
+ readonly provide: i0.InjectionToken<AXPLogoProvider[]>;
81
+ readonly useValue: AXPLogoProvider;
82
+ readonly multi: true;
83
+ };
84
+
85
+ export { AXEGoogleExtensionModule, AXEGoogleIntegrationRuntimeProvider, AXEGoogleLogoComponent, AXEGooglePlatformAuthStrategy, AXE_GOOGLE_LOGO_PROVIDER, AXE_GOOGLE_OAUTH_DEFAULT_SCOPES, axpGoogleLogoKey };
86
+ export type { AXEGoogleIntegrationClient };