@acorex-platform/extension-github-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,145 @@
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 { AXTranslationService } from '@acorex/core/translation';
5
+ import * as i0 from '@angular/core';
6
+ import { inject, Injectable } from '@angular/core';
7
+ import { trim, defaultTo } from 'lodash-es';
8
+ import { RootConfig } from '@acorex-platform/extension-github-client/contracts';
9
+
10
+ const GITHUB_INSTANCE_URL = 'https://github.com';
11
+ //#endregion
12
+ //#region ----- Command -----
13
+ /** GitHub connect: personal access token (fixed github.com instance). */
14
+ class ConnectGithubCommand {
15
+ constructor() {
16
+ //#region ----- Services & Dependencies -----
17
+ this.layoutBuilder = inject(AXPLayoutBuilderService);
18
+ this.connectionManager = inject(AXMIntegrationConnectionManager);
19
+ this.translationService = inject(AXTranslationService);
20
+ }
21
+ //#endregion
22
+ //#region ----- Execute -----
23
+ async execute(input = {}) {
24
+ try {
25
+ const providerId = input.providerId ?? 'github';
26
+ const connectionScope = input.connectionScope ?? 'tenant';
27
+ const existing = await this.connectionManager.findByUniqueKey({
28
+ providerId,
29
+ connectionScope,
30
+ connectionKey: 'default',
31
+ });
32
+ const isReconfigure = hasConfiguredIntegrationCredentials(existing);
33
+ const title = await this.translationService.translateAsync(isReconfigure
34
+ ? '@extensions-github:integration.connect.dialog.reconfigure-title'
35
+ : '@extensions-github:integration.connect.dialog.title');
36
+ const form = await this.openConnectDialog({
37
+ title: title ?? 'Connect GitHub',
38
+ context: {
39
+ displayName: existing?.displayName ?? 'GitHub',
40
+ token: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',
41
+ },
42
+ existing,
43
+ isReconfigure,
44
+ });
45
+ if (!form) {
46
+ return { success: true, kind: 'object', data: { outcome: 'cancelled' } };
47
+ }
48
+ let token = trim(form.token);
49
+ if (isMaskedIntegrationCredential(token) && existing) {
50
+ const config = (existing.config ?? {});
51
+ token = trim(config.token ?? '');
52
+ }
53
+ if (!token) {
54
+ const message = await this.translationService.translateAsync('@extensions-github:integration.connect.messages.token-required');
55
+ return { success: false, message: { text: message ?? 'Personal access token is required.' } };
56
+ }
57
+ const connection = await this.connectionManager.upsertConnection({
58
+ providerId,
59
+ authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,
60
+ connectionScope,
61
+ connectionKey: 'default',
62
+ displayName: defaultTo(trim(form.displayName), 'GitHub'),
63
+ instanceUrl: GITHUB_INSTANCE_URL,
64
+ externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,
65
+ config: { token },
66
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
67
+ isRevoked: false,
68
+ isDisabled: false,
69
+ });
70
+ return { success: true, kind: 'object',
71
+ data: { outcome: 'connected', connection: toSafeIntegrationConnectionDto(connection) },
72
+ };
73
+ }
74
+ catch (error) {
75
+ const message = error instanceof Error ? error.message : 'Failed to connect GitHub.';
76
+ return { success: false, message: { text: message } };
77
+ }
78
+ }
79
+ //#endregion
80
+ //#region ----- Dialog -----
81
+ async openConnectDialog(input) {
82
+ const I18N = `@${RootConfig.config.i18n}:integration.connect`;
83
+ const result = await this.layoutBuilder
84
+ .create()
85
+ .dialog((dialog) => {
86
+ dialog
87
+ .setTitle(input.title)
88
+ .setSize('md')
89
+ .setCloseButton(true)
90
+ .setContext({ ...input.context })
91
+ .content((flex) => {
92
+ flex
93
+ .setDirection('column')
94
+ .setGap('12px')
95
+ .customWidget('text-block-layout', { content: `${I18N}.instructions` })
96
+ .formField(`${I18N}.fields.display-name`, (field) => {
97
+ field.path('displayName');
98
+ field.textBox({ placeholder: `${I18N}.placeholders.display-name` });
99
+ })
100
+ .formField('@extensions-github:integration.auth.pat.token.label', (field) => {
101
+ field.path('token');
102
+ field.passwordBox({
103
+ placeholder: '@extensions-github:integration.auth.pat.token.placeholder',
104
+ revealToggle: true,
105
+ validations: input.isReconfigure ? [] : [{ rule: 'required' }],
106
+ });
107
+ });
108
+ })
109
+ .setActions((actions) => {
110
+ actions
111
+ .cancel('@general:actions.cancel.title')
112
+ .submit(`${I18N}.actions.save`);
113
+ })
114
+ .onAction(async (ref) => {
115
+ if (ref.action() === 'cancel') {
116
+ return null;
117
+ }
118
+ const ctx = ref.context();
119
+ let token = trim(ctx.token);
120
+ if (isMaskedIntegrationCredential(token) && input.existing) {
121
+ const config = (input.existing.config ?? {});
122
+ token = trim(config.token ?? '');
123
+ }
124
+ if (!token) {
125
+ throw new Error('Personal access token is required.');
126
+ }
127
+ return {
128
+ displayName: trim(ctx.displayName) || 'GitHub',
129
+ token,
130
+ };
131
+ });
132
+ })
133
+ .show();
134
+ return resolveLayoutBuilderDialogResult(result);
135
+ }
136
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectGithubCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
137
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectGithubCommand, providedIn: 'root' }); }
138
+ }
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ConnectGithubCommand, decorators: [{
140
+ type: Injectable,
141
+ args: [{ providedIn: 'root' }]
142
+ }] });
143
+
144
+ export { ConnectGithubCommand };
145
+ //# sourceMappingURL=acorex-platform-extension-github-client-connect-github.command-XMXwf81x.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-github-client-connect-github.command-XMXwf81x.mjs","sources":["../../../../libs/extensions/github/client/src/lib/features/connect/connect-github.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\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 type { AXMIntegrationManagementIntegrationConnectionEntityModel } from '@acorex-platform/module-integration-management-client/contracts';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n type IFormFieldBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, trim } from 'lodash-es';\nimport { RootConfig } from '@acorex-platform/extension-github-client/contracts';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface ConnectGithubCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\nconst GITHUB_INSTANCE_URL = 'https://github.com';\n\ninterface GithubConnectFormContext {\n displayName: string;\n token: string;\n}\n\ninterface GithubConnectFormResult {\n displayName: string;\n token: string;\n}\n\n//#endregion\n\n//#region ----- Command -----\n\n/** GitHub connect: personal access token (fixed github.com instance). */\n@Injectable({ providedIn: 'root' })\nexport class ConnectGithubCommand implements AXPCommand<ConnectGithubCommandInput, ConnectCommandResult> {\n //#region ----- Services & Dependencies -----\n\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ----- Execute -----\n\n async execute(input: ConnectGithubCommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? 'github';\n const connectionScope = input.connectionScope ?? 'tenant';\n const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n const isReconfigure = hasConfiguredIntegrationCredentials(existing);\n\n const title = await this.translationService.translateAsync(\n isReconfigure\n ? '@extensions-github:integration.connect.dialog.reconfigure-title'\n : '@extensions-github:integration.connect.dialog.title',\n );\n\n const form = await this.openConnectDialog({\n title: title ?? 'Connect GitHub',\n context: {\n displayName: existing?.displayName ?? 'GitHub',\n token: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n },\n existing,\n isReconfigure,\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n let token = trim(form.token);\n if (isMaskedIntegrationCredential(token) && existing) {\n const config = (existing.config ?? {}) as { token?: string };\n token = trim(config.token ?? '');\n }\n if (!token) {\n const message = await this.translationService.translateAsync(\n '@extensions-github:integration.connect.messages.token-required',\n );\n return { success: false, message: { text: message ?? 'Personal access token is required.' } };\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: defaultTo(trim(form.displayName), 'GitHub'),\n instanceUrl: GITHUB_INSTANCE_URL,\n externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,\n config: { token },\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 GitHub.';\n return { success: false, message: { text: message } };\n }\n }\n\n //#endregion\n\n //#region ----- Dialog -----\n\n private async openConnectDialog(input: {\n title: string;\n context: GithubConnectFormContext;\n existing: AXMIntegrationManagementIntegrationConnectionEntityModel | null;\n isReconfigure: boolean;\n }): Promise<GithubConnectFormResult | null> {\n const I18N = `@${RootConfig.config.i18n}:integration.connect`;\n\n const result = await this.layoutBuilder\n .create()\n .dialog<GithubConnectFormResult | null>((dialog: IDialogBuilder<GithubConnectFormResult | null>) => {\n dialog\n .setTitle(input.title)\n .setSize('md')\n .setCloseButton(true)\n .setContext({ ...input.context })\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', { content: `${I18N}.instructions` })\n .formField(`${I18N}.fields.display-name`, (field: IFormFieldBuilder) => {\n field.path('displayName');\n field.textBox({ placeholder: `${I18N}.placeholders.display-name` });\n })\n .formField('@extensions-github:integration.auth.pat.token.label', (field) => {\n field.path('token');\n field.passwordBox({\n placeholder: '@extensions-github:integration.auth.pat.token.placeholder',\n revealToggle: true,\n validations: input.isReconfigure ? [] : [{ rule: 'required' }],\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(`${I18N}.actions.save`);\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n\n const ctx = ref.context() as GithubConnectFormContext;\n let token = trim(ctx.token);\n if (isMaskedIntegrationCredential(token) && input.existing) {\n const config = (input.existing.config ?? {}) as { token?: string };\n token = trim(config.token ?? '');\n }\n if (!token) {\n throw new Error('Personal access token is required.');\n }\n\n return {\n displayName: trim(ctx.displayName) || 'GitHub',\n token,\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<GithubConnectFormResult>(result);\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAwCA,MAAM,mBAAmB,GAAG,oBAAoB;AAYhD;AAEA;AAEA;MAEa,oBAAoB,CAAA;AADjC,I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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,40 @@
1
+ //#region ---- Module Config ----
2
+ const config = {
3
+ i18n: 'extensions-github',
4
+ };
5
+ /** Logical module name (PascalCase) — matches command/query keys and edition feature lists. */
6
+ const MODULE_NAME = 'GithubExtension';
7
+ const RootConfig = {
8
+ config,
9
+ module: {
10
+ name: MODULE_NAME,
11
+ icon: 'fa-brands fa-github',
12
+ },
13
+ };
14
+ //#endregion
15
+
16
+ //#region ---- Settings Keys ----
17
+ const AXEGithubSettings = {
18
+ ConnectionPanel: 'Github:Setting:ConnectionPanel',
19
+ };
20
+ //#endregion
21
+
22
+ var AXEGithubCommandKeys;
23
+ (function (AXEGithubCommandKeys) {
24
+ AXEGithubCommandKeys["ConnectionConnect"] = "GithubExtension:Connection:Connect";
25
+ })(AXEGithubCommandKeys || (AXEGithubCommandKeys = {}));
26
+
27
+ //#region ----- GitHub query keys -----
28
+ const AXEGithubQueryKeys = {
29
+ RepoSearch: 'GithubExtension.Repo:Search',
30
+ ListBranches: 'GithubExtension.Repo:ListBranches',
31
+ ListCommits: 'GithubExtension.Repo:ListCommits',
32
+ };
33
+ //#endregion
34
+
35
+ /**
36
+ * Generated bundle index. Do not edit.
37
+ */
38
+
39
+ export { AXEGithubCommandKeys, AXEGithubQueryKeys, AXEGithubSettings, RootConfig };
40
+ //# sourceMappingURL=acorex-platform-extension-github-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-github-client-contracts.mjs","sources":["../../../../libs/extensions/github/contracts/src/root-config.ts","../../../../libs/extensions/github/contracts/src/github.settings.keys.ts","../../../../libs/extensions/github/contracts/src/commands.keys.ts","../../../../libs/extensions/github/contracts/src/queries.keys.ts","../../../../libs/extensions/github/contracts/src/acorex-platform-extension-github-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-github',\n};\n\n/** Logical module name (PascalCase) — matches command/query keys and edition feature lists. */\nconst MODULE_NAME = 'GithubExtension';\n\nexport const RootConfig = {\n config,\n module: {\n name: MODULE_NAME,\n icon: 'fa-brands fa-github',\n },\n};\n\n//#endregion\n","//#region ---- Settings Keys ----\n\nexport const AXEGithubSettings = {\n ConnectionPanel: 'Github:Setting:ConnectionPanel',\n} as const;\n\n//#endregion\n","export enum AXEGithubCommandKeys {\n ConnectionConnect = 'GithubExtension:Connection:Connect',\n}\n","//#region ----- GitHub query keys -----\n\nexport const AXEGithubQueryKeys = {\n RepoSearch: 'GithubExtension.Repo:Search',\n ListBranches: 'GithubExtension.Repo:ListBranches',\n ListCommits: 'GithubExtension.Repo:ListCommits',\n} as const;\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;CAC1B;AAED;AACA,MAAM,WAAW,GAAG,iBAAiB;AAE9B,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,IAAI,EAAE,qBAAqB;AAC5B,KAAA;;AAGH;;ACjBA;AAEO,MAAM,iBAAiB,GAAG;AAC/B,IAAA,eAAe,EAAE,gCAAgC;;AAGnD;;ICNY;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,mBAAA,CAAA,GAAA,oCAAwD;AAC1D,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;;ACAhC;AAEO,MAAM,kBAAkB,GAAG;AAChC,IAAA,UAAU,EAAE,6BAA6B;AACzC,IAAA,YAAY,EAAE,mCAAmC;AACjD,IAAA,WAAW,EAAE,kCAAkC;;AAGjD;;ACRA;;AAEG;;;;"}
@@ -0,0 +1,203 @@
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 { AXP_MODULE_MANIFEST_PROVIDER } from '@acorex-platform/framework-client/core';
4
+ import { provideCommandSetups } from '@acorex-platform/framework-client/runtime';
5
+ import { RootConfig, AXEGithubCommandKeys } from '@acorex-platform/extension-github-client/contracts';
6
+ import * as i0 from '@angular/core';
7
+ import { Injectable, inject, NgModule } from '@angular/core';
8
+ import { AXPWidgetsList, AXP_INTEGRATION_AUTH_METHOD_TYPE, AXP_INTEGRATION_CONNECTION_SCOPE, AXP_INTEGRATION_CAPABILITY, AXP_INTEGRATION_CATEGORY, AXP_INTEGRATION_CONNECTION_STATUS } from '@acorex-platform/framework-shared/core';
9
+ import { trim, defaultTo } from 'lodash-es';
10
+
11
+ //#region ---- Imports ----
12
+ //#endregion
13
+ //#region ---- Provider ----
14
+ class AXEGithubIntegrationProvider {
15
+ async provide(context) {
16
+ const I18N = `@${RootConfig.config.i18n}:integration`;
17
+ context.register({
18
+ domainId: AXP_INTEGRATION_CATEGORY.SourceControl,
19
+ id: 'github',
20
+ module: RootConfig.module.name,
21
+ displayName: `${I18N}.display-name`,
22
+ description: `${I18N}.description`,
23
+ icon: RootConfig.module.icon,
24
+ capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],
25
+ connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],
26
+ allowMultipleConnections: false,
27
+ defaultConnectionKey: 'default',
28
+ connectCommandKey: AXEGithubCommandKeys.ConnectionConnect,
29
+ authMethods: [
30
+ {
31
+ type: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,
32
+ label: `${I18N}.auth.pat.label`,
33
+ instructions: `${I18N}.auth.pat.instructions`,
34
+ supportsValidation: true,
35
+ fields: [
36
+ {
37
+ type: AXPWidgetsList.Editors.PasswordBox,
38
+ path: 'token',
39
+ options: { placeholder: `${I18N}.auth.pat.token.placeholder` },
40
+ },
41
+ ],
42
+ },
43
+ ],
44
+ });
45
+ }
46
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubIntegrationProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
47
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubIntegrationProvider }); }
48
+ }
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubIntegrationProvider, decorators: [{
50
+ type: Injectable
51
+ }] });
52
+
53
+ //#region ---- Imports ----
54
+ //#endregion
55
+ //#region ---- Runtime Provider ----
56
+ class AXEGithubIntegrationRuntimeProvider {
57
+ constructor() {
58
+ this.providerId = 'github';
59
+ this.secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });
60
+ }
61
+ async getHooks() {
62
+ return {
63
+ validateConnection: (ctx) => this.validateConnection(ctx),
64
+ createClient: (ctx) => this.createClient(ctx),
65
+ };
66
+ }
67
+ async validateConnection(ctx) {
68
+ if (!this.secretStore) {
69
+ return { valid: false, status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid, errorMessage: 'Secret store unavailable.' };
70
+ }
71
+ try {
72
+ const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);
73
+ const token = trim(defaultTo(credentials.token, ''));
74
+ if (!token) {
75
+ return {
76
+ valid: false,
77
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,
78
+ errorMessage: 'No personal access token available for GitHub connection.',
79
+ };
80
+ }
81
+ return {
82
+ valid: true,
83
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
84
+ externalAccountName: defaultTo(ctx.instanceUrl, 'GitHub'),
85
+ };
86
+ }
87
+ catch {
88
+ return {
89
+ valid: false,
90
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,
91
+ errorMessage: 'Failed to validate GitHub credentials.',
92
+ };
93
+ }
94
+ }
95
+ async createClient(ctx) {
96
+ if (!this.secretStore) {
97
+ throw new Error('Secret store unavailable.');
98
+ }
99
+ const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);
100
+ const token = trim(defaultTo(credentials.token, ''));
101
+ if (!token) {
102
+ throw new Error('GitHub connection has no usable personal access token.');
103
+ }
104
+ return { token };
105
+ }
106
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubIntegrationRuntimeProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
107
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubIntegrationRuntimeProvider }); }
108
+ }
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubIntegrationRuntimeProvider, decorators: [{
110
+ type: Injectable
111
+ }] });
112
+
113
+ const GithubExtensionManifest = {
114
+ name: RootConfig.module.name,
115
+ version: '1.0.0',
116
+ title: `@${RootConfig.config.i18n}:integration.display-name`,
117
+ icon: RootConfig.module.icon,
118
+ i18n: RootConfig.config.i18n,
119
+ type: 'integration',
120
+ domain: 'source-control',
121
+ dependencies: [],
122
+ };
123
+
124
+ //#endregion
125
+ //#region ----- Settings Provider -----
126
+ /** Tenant GitHub connections are managed on Administration → Integrations. */
127
+ class AXEGithubSettingsProvider {
128
+ async provide(_context) { }
129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubSettingsProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
130
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubSettingsProvider }); }
131
+ }
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubSettingsProvider, decorators: [{
133
+ type: Injectable
134
+ }] });
135
+
136
+ //#region ---- Imports ----
137
+ //#endregion
138
+ //#region ---- Module ----
139
+ class AXEGithubExtensionModule {
140
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
141
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubExtensionModule, imports: [AXMIntegrationManagementModule] }); }
142
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubExtensionModule, providers: [
143
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: GithubExtensionManifest, multi: true },
144
+ {
145
+ provide: AXP_INTEGRATION_PROVIDER,
146
+ useClass: AXEGithubIntegrationProvider,
147
+ multi: true,
148
+ },
149
+ {
150
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
151
+ useClass: AXEGithubIntegrationRuntimeProvider,
152
+ multi: true,
153
+ },
154
+ {
155
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
156
+ useClass: AXEGithubSettingsProvider,
157
+ multi: true,
158
+ },
159
+ provideCommandSetups([
160
+ {
161
+ key: AXEGithubCommandKeys.ConnectionConnect,
162
+ command: () => import('./acorex-platform-extension-github-client-connect-github.command-XMXwf81x.mjs').then((c) => c.ConnectGithubCommand),
163
+ },
164
+ ]),
165
+ ], imports: [AXMIntegrationManagementModule] }); }
166
+ }
167
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXEGithubExtensionModule, decorators: [{
168
+ type: NgModule,
169
+ args: [{
170
+ imports: [AXMIntegrationManagementModule],
171
+ providers: [
172
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: GithubExtensionManifest, multi: true },
173
+ {
174
+ provide: AXP_INTEGRATION_PROVIDER,
175
+ useClass: AXEGithubIntegrationProvider,
176
+ multi: true,
177
+ },
178
+ {
179
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
180
+ useClass: AXEGithubIntegrationRuntimeProvider,
181
+ multi: true,
182
+ },
183
+ {
184
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
185
+ useClass: AXEGithubSettingsProvider,
186
+ multi: true,
187
+ },
188
+ provideCommandSetups([
189
+ {
190
+ key: AXEGithubCommandKeys.ConnectionConnect,
191
+ command: () => import('./acorex-platform-extension-github-client-connect-github.command-XMXwf81x.mjs').then((c) => c.ConnectGithubCommand),
192
+ },
193
+ ]),
194
+ ],
195
+ }]
196
+ }] });
197
+
198
+ /**
199
+ * Generated bundle index. Do not edit.
200
+ */
201
+
202
+ export { AXEGithubExtensionModule };
203
+ //# sourceMappingURL=acorex-platform-extension-github-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-github-client.mjs","sources":["../../../../libs/extensions/github/client/src/lib/integration/github.integration.provider.ts","../../../../libs/extensions/github/client/src/lib/integration/github.integration-runtime.provider.ts","../../../../libs/extensions/github/client/src/lib/manifest.ts","../../../../libs/extensions/github/client/src/lib/settings/github.settings.provider.ts","../../../../libs/extensions/github/client/src/lib/github-extension.module.ts","../../../../libs/extensions/github/client/src/acorex-platform-extension-github-client.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CAPABILITY,\n AXP_INTEGRATION_CATEGORY,\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 { AXEGithubCommandKeys, RootConfig } from '@acorex-platform/extension-github-client/contracts';\n\n//#endregion\n\n//#region ---- Provider ----\n\n@Injectable()\nexport class AXEGithubIntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n domainId: AXP_INTEGRATION_CATEGORY.SourceControl,\n id: 'github',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n allowMultipleConnections: false,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEGithubCommandKeys.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\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXP_INTEGRATION_CONNECTION_STATUS, type AXPIntegrationProviderRuntimeHooks, type AXPIntegrationRuntimeContext, type AXPIntegrationValidationResult } from '@acorex-platform/framework-shared/core';\nimport { AXP_INTEGRATION_SECRET_STORE, type AXPIntegrationRuntimeProvider } 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 AXEGithubIntegrationClient {\n token: string;\n}\n\n//#endregion\n\n//#region ---- Runtime Provider ----\n\n@Injectable()\nexport class AXEGithubIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'github';\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 if (!this.secretStore) {\n return { valid: false, status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid, errorMessage: 'Secret store unavailable.' };\n }\n\n try {\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n const token = trim(defaultTo(credentials.token, ''));\n\n if (!token) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'No personal access token available for GitHub connection.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: defaultTo(ctx.instanceUrl, 'GitHub'),\n };\n } catch {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Failed to validate GitHub credentials.',\n };\n }\n }\n\n private async createClient(ctx: AXPIntegrationRuntimeContext): Promise<AXEGithubIntegrationClient> {\n if (!this.secretStore) {\n throw new Error('Secret store unavailable.');\n }\n\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n const token = trim(defaultTo(credentials.token, ''));\n\n if (!token) {\n throw new Error('GitHub connection has no usable personal access token.');\n }\n\n return { token };\n }\n}\n\n//#endregion\n","import { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-github-client/contracts';\n\nexport const GithubExtensionManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: `@${RootConfig.config.i18n}:integration.display-name`,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'integration',\n domain: 'source-control',\n dependencies: [],\n};\n","//#region ----- Imports -----\n\nimport {\n AXPSettingDefinitionProvider,\n AXPSettingDefinitionProviderContext,\n} from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ----- Settings Provider -----\n\n/** Tenant GitHub connections are managed on Administration → Integrations. */\n@Injectable()\nexport class AXEGithubSettingsProvider implements AXPSettingDefinitionProvider {\n async provide(_context: AXPSettingDefinitionProviderContext): Promise<void> {}\n}\n\n//#endregion\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 { AXP_MODULE_MANIFEST_PROVIDER } from '@acorex-platform/framework-client/core';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { AXEGithubCommandKeys } from '@acorex-platform/extension-github-client/contracts';\nimport { NgModule } from '@angular/core';\nimport { AXEGithubIntegrationProvider } from './integration/github.integration.provider';\nimport { AXEGithubIntegrationRuntimeProvider } from './integration/github.integration-runtime.provider';\nimport { GithubExtensionManifest } from './manifest';\nimport { AXEGithubSettingsProvider } from './settings/github.settings.provider';\n\n//#endregion\n\n//#region ---- Module ----\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: GithubExtensionManifest, multi: true },\n {\n provide: AXP_INTEGRATION_PROVIDER,\n useClass: AXEGithubIntegrationProvider,\n multi: true,\n },\n {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEGithubIntegrationRuntimeProvider,\n multi: true,\n },\n {\n provide: AXP_SETTING_DEFINITION_PROVIDER,\n useClass: AXEGithubSettingsProvider,\n multi: true,\n },\n provideCommandSetups([\n {\n key: AXEGithubCommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-github.command').then((c) => c.ConnectGithubCommand),\n },\n ]),\n ],\n})\nexport class AXEGithubExtensionModule {}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAaA;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;YACf,QAAQ,EAAE,wBAAwB,CAAC,aAAa;AAChD,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;YAC9B,WAAW,EAAE,CAAA,EAAG,IAAI,CAAA,aAAA,CAAe;YACnC,WAAW,EAAE,CAAA,EAAG,IAAI,CAAA,YAAA,CAAc;AAClC,YAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;YAC5B,YAAY,EAAE,CAAC,0BAA0B,CAAC,IAAI,EAAE,0BAA0B,CAAC,MAAM,CAAC;AAClF,YAAA,gBAAgB,EAAE,CAAC,gCAAgC,CAAC,MAAM,CAAC;AAC3D,YAAA,wBAAwB,EAAE,KAAK;AAC/B,YAAA,oBAAoB,EAAE,SAAS;YAC/B,iBAAiB,EAAE,oBAAoB,CAAC,iBAAiB;AACzD,YAAA,WAAW,EAAE;AACX,gBAAA;oBACE,IAAI,EAAE,gCAAgC,CAAC,GAAG;oBAC1C,KAAK,EAAE,CAAA,EAAG,IAAI,CAAA,eAAA,CAAiB;oBAC/B,YAAY,EAAE,CAAA,EAAG,IAAI,CAAA,sBAAA,CAAwB;AAC7C,oBAAA,kBAAkB,EAAE,IAAI;AACxB,oBAAA,MAAM,EAAE;AACN,wBAAA;AACE,4BAAA,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,WAAW;AACxC,4BAA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AI;AACZ,yBAAA;AACD,wBAAA,oBAAoB,CAAC;AACnB,4BAAA;gCACE,GAAG,EAAE,oBAAoB,CAAC,iBAAiB;AAC3C,gCAAA,OAAO,EAAE,MAAM,OAAO,+EAA2C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC;AACvG,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;AC/CD;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@acorex-platform/extension-github-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-github-client.mjs",
13
+ "typings": "types/acorex-platform-extension-github-client.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./types/acorex-platform-extension-github-client.d.ts",
20
+ "default": "./fesm2022/acorex-platform-extension-github-client.mjs"
21
+ },
22
+ "./contracts": {
23
+ "types": "./types/acorex-platform-extension-github-client-contracts.d.ts",
24
+ "default": "./fesm2022/acorex-platform-extension-github-client-contracts.mjs"
25
+ }
26
+ },
27
+ "type": "module"
28
+ }
@@ -0,0 +1,25 @@
1
+ declare const RootConfig: {
2
+ config: {
3
+ i18n: string;
4
+ };
5
+ module: {
6
+ name: string;
7
+ icon: string;
8
+ };
9
+ };
10
+
11
+ declare const AXEGithubSettings: {
12
+ readonly ConnectionPanel: "Github:Setting:ConnectionPanel";
13
+ };
14
+
15
+ declare enum AXEGithubCommandKeys {
16
+ ConnectionConnect = "GithubExtension:Connection:Connect"
17
+ }
18
+
19
+ declare const AXEGithubQueryKeys: {
20
+ readonly RepoSearch: "GithubExtension.Repo:Search";
21
+ readonly ListBranches: "GithubExtension.Repo:ListBranches";
22
+ readonly ListCommits: "GithubExtension.Repo:ListCommits";
23
+ };
24
+
25
+ export { AXEGithubCommandKeys, AXEGithubQueryKeys, AXEGithubSettings, RootConfig };
@@ -0,0 +1,10 @@
1
+ import * as i0 from '@angular/core';
2
+ import * as i1 from '@acorex-platform/module-integration-management-client';
3
+
4
+ declare class AXEGithubExtensionModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXEGithubExtensionModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AXEGithubExtensionModule, never, [typeof i1.AXMIntegrationManagementModule], never>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<AXEGithubExtensionModule>;
8
+ }
9
+
10
+ export { AXEGithubExtensionModule };