@hintergrund/worker 0.1.7 → 0.1.8
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.
- package/dist/api/cms/handlers/dashboard.handler.js +1 -1
- package/dist/api/cms/handlers/website-repo.handler.js +2 -2
- package/dist/api/emails/handlers/invoice.handler.d.ts +1 -1
- package/dist/api/emails/handlers/invoice.handler.d.ts.map +1 -1
- package/dist/api/emails/handlers/settings.handler.d.ts +1 -1
- package/dist/api/emails/handlers/settings.handler.d.ts.map +1 -1
- package/dist/api/shop/handlers/products.handler.d.ts +1 -1
- package/dist/api/shop/handlers/products.handler.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/config.d.ts +8 -10
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +8 -40
- package/dist/lib/github-app.d.ts +2 -0
- package/dist/lib/github-app.d.ts.map +1 -0
- package/dist/lib/github-app.js +49 -0
- package/dist/lib/github.d.ts +6 -3
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +19 -14
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ export async function getDashboard(c) {
|
|
|
9
9
|
}
|
|
10
10
|
catch (error) {
|
|
11
11
|
// Fallback to default config if parsing fails
|
|
12
|
-
const configParams = 'config=\'{"
|
|
12
|
+
const configParams = 'config=\'{"loginMethod":"password"}\'';
|
|
13
13
|
return c.html(getTemplate('admin', c.env.UI_BASE_URL, configParams));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -26,7 +26,7 @@ export function isAllowedWebsitePath(path) {
|
|
|
26
26
|
async function listRepoFiles(c) {
|
|
27
27
|
const client = createGitHubClient(getGitHubConfig(c.env));
|
|
28
28
|
const { owner, repo, branch } = client.getRepoInfo();
|
|
29
|
-
const octokit = client.getOctokit();
|
|
29
|
+
const octokit = await client.getOctokit();
|
|
30
30
|
const tree = await octokit.rest.git.getTree({ owner, repo, tree_sha: branch, recursive: 'true' });
|
|
31
31
|
const paths = tree.data.tree
|
|
32
32
|
.filter((item) => item.type === 'blob' && item.path && isAllowedWebsitePath(item.path))
|
|
@@ -43,7 +43,7 @@ async function listRepoFiles(c) {
|
|
|
43
43
|
async function listStaticAssets(c) {
|
|
44
44
|
const client = createGitHubClient(getGitHubConfig(c.env));
|
|
45
45
|
const { owner, repo, branch } = client.getRepoInfo();
|
|
46
|
-
const octokit = client.getOctokit();
|
|
46
|
+
const octokit = await client.getOctokit();
|
|
47
47
|
const tree = await octokit.rest.git.getTree({ owner, repo, tree_sha: branch, recursive: 'true' });
|
|
48
48
|
const assetPaths = tree.data.tree
|
|
49
49
|
.filter((item) => item.type === 'blob' &&
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* PDF generation for shop invoices. Invoice config is now read from D1 email_settings.
|
|
5
5
|
*/
|
|
6
|
-
import type { InvoiceConfig, InvoiceData } from '@hintergrund/
|
|
6
|
+
import type { InvoiceConfig, InvoiceData } from '@hintergrund/runtime-contracts';
|
|
7
7
|
/**
|
|
8
8
|
* Generate PDF invoice from InvoiceConfig + InvoiceData.
|
|
9
9
|
* Optionally provide logo (base64 data URL) and invoice company styling.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/invoice.handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"invoice.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/invoice.handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAsCjF;;;GAGG;AACH,wBAAsB,kBAAkB,CACvC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,WAAW,EACjB,QAAQ,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACvE,OAAO,CAAC,UAAU,CAAC,CA0JrB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { Context } from 'hono';
|
|
5
5
|
import type { Bindings } from '../../../index';
|
|
6
6
|
import { type GitHubClient } from '../../../lib/github';
|
|
7
|
-
import type { EmailSettings, InvoiceConfig } from '@hintergrund/
|
|
7
|
+
import type { EmailSettings, InvoiceConfig } from '@hintergrund/runtime-contracts';
|
|
8
8
|
import { type EmailTemplateConfig } from '../../../lib/email-template';
|
|
9
9
|
export declare const EMAIL_SETTINGS_PATH = "frontend/src/lib/emails/settings.json";
|
|
10
10
|
export declare const DEFAULT_INVOICE: InvoiceConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/settings.handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,KAAK,EACX,aAAa,EAEb,aAAa,EAGb,MAAM,
|
|
1
|
+
{"version":3,"file":"settings.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/emails/handlers/settings.handler.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,KAAK,EACX,aAAa,EAEb,aAAa,EAGb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAE/F,eAAO,MAAM,mBAAmB,0CAA0C,CAAC;AAE3E,eAAO,MAAM,eAAe,EAAE,aAiB7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,aAIsB,CAAC;AAgB5D,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAUxH;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAc9G;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,aAAa,GAAG;QAAE,aAAa,CAAC,EAAE,mBAAmB,CAAA;KAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAK/J;AAED,oCAAoC;AACpC,wBAAsB,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAYvF;AAED,oCAAoC;AACpC,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkCxF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Context } from 'hono';
|
|
2
2
|
import type { Bindings } from '../../../index';
|
|
3
|
-
import type { ShopCatalog, ShopSettings } from '@hintergrund/
|
|
3
|
+
import type { ShopCatalog, ShopSettings } from '@hintergrund/runtime-contracts';
|
|
4
4
|
export declare const SHOP_PRODUCTS_PATH = "frontend/src/lib/shop/products.json";
|
|
5
5
|
export declare const SHOP_SETTINGS_PATH = "frontend/src/lib/shop/settings.json";
|
|
6
6
|
export declare const DEFAULT_SHOP_SETTINGS: ShopSettings & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/shop/handlers/products.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,OAAO,KAAK,EAOX,WAAW,EAEX,YAAY,EAKZ,MAAM,
|
|
1
|
+
{"version":3,"file":"products.handler.d.ts","sourceRoot":"","sources":["../../../../src/api/shop/handlers/products.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,OAAO,KAAK,EAOX,WAAW,EAEX,YAAY,EAKZ,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,kBAAkB,wCAAwC,CAAC;AACxE,eAAO,MAAM,kBAAkB,wCAAwC,CAAC;AAExE,eAAO,MAAM,qBAAqB,EAAE,YAAY,GAAG;IAClD,cAAc,EAAE;QACf,QAAQ,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAChD,gBAAgB,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;KACxD,CAAC;CAyBF,CAAC;AA+BF,wBAAsB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAIzG;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,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;
|
|
7
6
|
HG_GIT_OWNER?: string;
|
|
8
7
|
HG_GIT_REPO?: string;
|
|
9
8
|
HG_GIT_BRANCH?: string;
|
|
9
|
+
HG_GITHUB_APP_ID?: string;
|
|
10
|
+
HG_GITHUB_INSTALLATION_ID?: string;
|
|
11
|
+
HG_GITHUB_APP_PRIVATE_KEY?: string;
|
|
10
12
|
HG_EMAILS_API_KEY?: string;
|
|
11
13
|
HG_EMAILS_PROVIDER?: string;
|
|
12
14
|
HG_EMAILS_FROM_EMAIL?: string;
|
|
@@ -14,8 +16,6 @@ export type Bindings = {
|
|
|
14
16
|
HG_EMAILS_REPLY_TO?: string;
|
|
15
17
|
HG_EMAILS_PLUNK_SECRET_KEY?: string;
|
|
16
18
|
HG_EMAILS_PLUNK_PUBLIC_KEY?: string;
|
|
17
|
-
/** Set to 'true' to hide campaigns and only allow transactional sends */
|
|
18
|
-
HG_EMAILS_TRANSACTIONAL_ONLY?: string;
|
|
19
19
|
HG_SHOP_STRIPE_SECRET_KEY?: string;
|
|
20
20
|
HG_SHOP_STRIPE_WEBHOOK_SECRET?: string;
|
|
21
21
|
HG_SHOP_STRIPE_PUBLISHABLE_KEY?: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAU5B,MAAM,MAAM,QAAQ,GAAG;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAU5B,MAAM,MAAM,QA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E,wBAAgB,SAAS,yDAmGxB;AAGD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -63,7 +63,7 @@ export function createApp() {
|
|
|
63
63
|
try {
|
|
64
64
|
const { loadConfig, getAdminConfig } = await import('./lib/config');
|
|
65
65
|
const appConfig = loadConfig(c.env);
|
|
66
|
-
const adminConfig = getAdminConfig(appConfig
|
|
66
|
+
const adminConfig = getAdminConfig(appConfig);
|
|
67
67
|
adminConfig.canManageAdminUsers = true;
|
|
68
68
|
adminConfig.integrations = {
|
|
69
69
|
stripePublishableKeySet: !!c.env.HG_SHOP_STRIPE_PUBLISHABLE_KEY,
|
|
@@ -77,7 +77,7 @@ export function createApp() {
|
|
|
77
77
|
}
|
|
78
78
|
catch (error) {
|
|
79
79
|
// Fallback to default config if parsing fails
|
|
80
|
-
const configParams = 'config=\'{"
|
|
80
|
+
const configParams = 'config=\'{"loginMethod":"password"}\'';
|
|
81
81
|
return c.html(getTemplate('admin', c.env.UI_BASE_URL, configParams));
|
|
82
82
|
}
|
|
83
83
|
});
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import type { AppConfig, AdminConfig,
|
|
1
|
+
import type { AppConfig, AdminConfig, EmailsModuleConfig, ShopModuleConfig } from '@hintergrund/runtime-contracts';
|
|
2
2
|
/**
|
|
3
3
|
* Load application configuration from environment variables
|
|
4
4
|
* Supports both new modular env vars and legacy HG_CONFIG format
|
|
5
5
|
*/
|
|
6
6
|
export declare function loadConfig(env: Record<string, string | undefined> | any): AppConfig;
|
|
7
7
|
/**
|
|
8
|
-
* Get admin UI configuration
|
|
8
|
+
* Get admin UI configuration.
|
|
9
|
+
* All product modules are always active; the newsletter is toggled in email settings.
|
|
9
10
|
*/
|
|
10
|
-
export declare function getAdminConfig(
|
|
11
|
-
/**
|
|
12
|
-
* Get CMS module configuration
|
|
13
|
-
* @throws Error if CMS module is not enabled
|
|
14
|
-
*/
|
|
15
|
-
export declare function getCmsConfig(env: Record<string, string | undefined> | any): CmsModuleConfig;
|
|
11
|
+
export declare function getAdminConfig(_appConfig: AppConfig): AdminConfig;
|
|
16
12
|
/**
|
|
17
13
|
* Get Emails module configuration
|
|
18
14
|
* @throws Error if Emails module is not enabled
|
|
@@ -29,9 +25,11 @@ export declare function getShopConfig(env: Record<string, string | undefined> |
|
|
|
29
25
|
* @throws Error if GitHub is not configured (required variables missing)
|
|
30
26
|
*/
|
|
31
27
|
export declare function getGitHubConfig(env: Record<string, string | undefined> | any): {
|
|
32
|
-
gitToken: string;
|
|
33
28
|
gitOwner: string;
|
|
34
29
|
gitRepo: string;
|
|
35
|
-
gitBranch:
|
|
30
|
+
gitBranch: any;
|
|
31
|
+
githubAppId: string;
|
|
32
|
+
githubInstallationId: string;
|
|
33
|
+
githubPrivateKey: string;
|
|
36
34
|
};
|
|
37
35
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAe,MAAM,gCAAgC,CAAC;AAEhI;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,GAAG,SAAS,CAOnF;AA4CD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,SAAS,GAAG,WAAW,CAIjE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,GAAG,kBAAkB,CAQjG;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,GAAG,gBAAgB,CAQ7F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG;cAI7C,MAAM;aACR,MAAM;;iBAEG,MAAM;0BACY,MAAM;sBACV,MAAM;EAE1D"}
|
package/dist/lib/config.js
CHANGED
|
@@ -23,31 +23,13 @@ function getMissingVars(env, requiredVars) {
|
|
|
23
23
|
* Check if any variable from a list is set (module is attempted)
|
|
24
24
|
* Treats empty strings and "NOT_CONFIGURED" placeholder as not set
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
return vars.some(varName => {
|
|
28
|
-
const value = env[varName];
|
|
29
|
-
return !!value && value !== 'NOT_CONFIGURED';
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
// Module required variables definitions
|
|
33
|
-
const GIT_REQUIRED_VARS = ['HG_GIT_TOKEN', 'HG_GIT_OWNER', 'HG_GIT_REPO'];
|
|
34
|
-
const CMS_REQUIRED_VARS = [...GIT_REQUIRED_VARS];
|
|
35
|
-
const EMAILS_REQUIRED_VARS = ['HG_EMAILS_API_KEY', 'HG_EMAILS_FROM_EMAIL'];
|
|
36
|
-
const SHOP_REQUIRED_VARS = [...GIT_REQUIRED_VARS];
|
|
26
|
+
const GIT_REQUIRED_VARS = ['HG_GIT_OWNER', 'HG_GIT_REPO', 'HG_GITHUB_APP_ID', 'HG_GITHUB_INSTALLATION_ID', 'HG_GITHUB_APP_PRIVATE_KEY'];
|
|
37
27
|
function loadFromEnvVars(env) {
|
|
38
28
|
const config = {
|
|
39
29
|
global: {
|
|
40
30
|
hgSecret: env.HG_SECRET || '',
|
|
41
31
|
},
|
|
42
32
|
};
|
|
43
|
-
config.cms = {
|
|
44
|
-
gitToken: env.HG_GIT_TOKEN || '',
|
|
45
|
-
gitOwner: env.HG_GIT_OWNER || '',
|
|
46
|
-
gitRepo: env.HG_GIT_REPO || '',
|
|
47
|
-
gitBranch: env.HG_GIT_BRANCH || 'main',
|
|
48
|
-
contentDir: 'frontend/src/lib/content',
|
|
49
|
-
assetDir: 'frontend/static/cms',
|
|
50
|
-
};
|
|
51
33
|
config.emails = {
|
|
52
34
|
emailProvider: 'plunk',
|
|
53
35
|
emailApiKey: env.HG_EMAILS_API_KEY || env.HG_EMAILS_PLUNK_SECRET_KEY || '',
|
|
@@ -64,29 +46,14 @@ function loadFromEnvVars(env) {
|
|
|
64
46
|
return config;
|
|
65
47
|
}
|
|
66
48
|
/**
|
|
67
|
-
* Get admin UI configuration
|
|
49
|
+
* Get admin UI configuration.
|
|
50
|
+
* All product modules are always active; the newsletter is toggled in email settings.
|
|
68
51
|
*/
|
|
69
|
-
export function getAdminConfig(
|
|
52
|
+
export function getAdminConfig(_appConfig) {
|
|
70
53
|
return {
|
|
71
|
-
builder: true,
|
|
72
|
-
cms: true,
|
|
73
|
-
emails: true,
|
|
74
|
-
shop: true,
|
|
75
54
|
loginMethod: 'password',
|
|
76
|
-
emailsTransactionalOnly: env?.HG_EMAILS_TRANSACTIONAL_ONLY === 'true' || undefined,
|
|
77
55
|
};
|
|
78
56
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Get CMS module configuration
|
|
81
|
-
* @throws Error if CMS module is not enabled
|
|
82
|
-
*/
|
|
83
|
-
export function getCmsConfig(env) {
|
|
84
|
-
const config = loadConfig(env);
|
|
85
|
-
if (!config.cms) {
|
|
86
|
-
throw new Error('CMS module is not enabled');
|
|
87
|
-
}
|
|
88
|
-
return config.cms;
|
|
89
|
-
}
|
|
90
57
|
/**
|
|
91
58
|
* Get Emails module configuration
|
|
92
59
|
* @throws Error if Emails module is not enabled
|
|
@@ -116,13 +83,14 @@ export function getShopConfig(env) {
|
|
|
116
83
|
*/
|
|
117
84
|
export function getGitHubConfig(env) {
|
|
118
85
|
const missing = getMissingVars(env, GIT_REQUIRED_VARS);
|
|
119
|
-
if (missing.length
|
|
86
|
+
if (missing.length)
|
|
120
87
|
throw new Error(`GitHub not configured. Missing: ${missing.join(', ')}`);
|
|
121
|
-
}
|
|
122
88
|
return {
|
|
123
|
-
gitToken: env.HG_GIT_TOKEN,
|
|
124
89
|
gitOwner: env.HG_GIT_OWNER,
|
|
125
90
|
gitRepo: env.HG_GIT_REPO,
|
|
126
91
|
gitBranch: env.HG_GIT_BRANCH || 'main',
|
|
92
|
+
githubAppId: env.HG_GITHUB_APP_ID,
|
|
93
|
+
githubInstallationId: env.HG_GITHUB_INSTALLATION_ID,
|
|
94
|
+
githubPrivateKey: env.HG_GITHUB_APP_PRIVATE_KEY,
|
|
127
95
|
};
|
|
128
96
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-app.d.ts","sourceRoot":"","sources":["../../src/lib/github-app.ts"],"names":[],"mappings":"AAiCA,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAa1H"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const encoder = new TextEncoder();
|
|
2
|
+
const cache = new Map();
|
|
3
|
+
function b64(value) {
|
|
4
|
+
const bytes = typeof value === 'string' ? encoder.encode(value) : value;
|
|
5
|
+
let binary = '';
|
|
6
|
+
for (const byte of bytes)
|
|
7
|
+
binary += String.fromCharCode(byte);
|
|
8
|
+
return btoa(binary).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
|
|
9
|
+
}
|
|
10
|
+
function length(value) {
|
|
11
|
+
if (value < 128)
|
|
12
|
+
return [value];
|
|
13
|
+
const bytes = [];
|
|
14
|
+
while (value) {
|
|
15
|
+
bytes.unshift(value & 255);
|
|
16
|
+
value >>= 8;
|
|
17
|
+
}
|
|
18
|
+
return [128 | bytes.length, ...bytes];
|
|
19
|
+
}
|
|
20
|
+
function pkcs8(rsa) {
|
|
21
|
+
const algorithm = [48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0];
|
|
22
|
+
const body = [2, 1, 0, ...algorithm, 4, ...length(rsa.length), ...rsa];
|
|
23
|
+
return Uint8Array.from([48, ...length(body.length), ...body]);
|
|
24
|
+
}
|
|
25
|
+
async function jwt(appId, pem) {
|
|
26
|
+
const now = Math.floor(Date.now() / 1000);
|
|
27
|
+
const unsigned = `${b64(JSON.stringify({ alg: 'RS256', typ: 'JWT' }))}.${b64(JSON.stringify({ iat: now - 30, exp: now + 540, iss: appId }))}`;
|
|
28
|
+
const rsa = /BEGIN RSA PRIVATE KEY/.test(pem);
|
|
29
|
+
const der = Uint8Array.from(atob(pem.replace(/\\n/g, '\n').replace(/-----[^-]+-----/g, '').replace(/\s/g, '')), (c) => c.charCodeAt(0));
|
|
30
|
+
const key = await crypto.subtle.importKey('pkcs8', rsa ? pkcs8(der) : der, { name: 'RSASSA-PKCS1-v1_5', hash: 'SHA-256' }, false, ['sign']);
|
|
31
|
+
const signature = await crypto.subtle.sign('RSASSA-PKCS1-v1_5', key, encoder.encode(unsigned));
|
|
32
|
+
return `${unsigned}.${b64(new Uint8Array(signature))}`;
|
|
33
|
+
}
|
|
34
|
+
export async function githubToken(appId, installationId, privateKey, repo) {
|
|
35
|
+
const key = `${appId}:${installationId}:${repo}`;
|
|
36
|
+
const cached = cache.get(key);
|
|
37
|
+
if (cached && cached.expires > Date.now() + 60_000)
|
|
38
|
+
return cached.token;
|
|
39
|
+
const response = await fetch(`https://api.github.com/app/installations/${installationId}/access_tokens`, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: { authorization: `Bearer ${await jwt(appId, privateKey)}`, accept: 'application/vnd.github+json', 'user-agent': 'hintergrund-project' },
|
|
42
|
+
body: JSON.stringify({ repositories: [repo], permissions: { contents: 'write' } })
|
|
43
|
+
});
|
|
44
|
+
if (!response.ok)
|
|
45
|
+
throw new Error('GitHub App authentication failed');
|
|
46
|
+
const result = await response.json();
|
|
47
|
+
cache.set(key, { token: result.token, expires: Date.parse(result.expires_at) });
|
|
48
|
+
return result.token;
|
|
49
|
+
}
|
package/dist/lib/github.d.ts
CHANGED
|
@@ -9,10 +9,12 @@ import { Octokit } from '@octokit/rest';
|
|
|
9
9
|
* GitHub configuration for a module
|
|
10
10
|
*/
|
|
11
11
|
export interface GitHubConfig {
|
|
12
|
-
gitToken: string;
|
|
13
12
|
gitOwner: string;
|
|
14
13
|
gitRepo: string;
|
|
15
14
|
gitBranch: string;
|
|
15
|
+
githubAppId: string;
|
|
16
|
+
githubInstallationId: string;
|
|
17
|
+
githubPrivateKey: string;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* File entry for tree operations
|
|
@@ -44,11 +46,12 @@ export declare function encodeUTF8Base64(str: string): string;
|
|
|
44
46
|
* GitHub client wrapper for common operations
|
|
45
47
|
*/
|
|
46
48
|
export declare class GitHubClient {
|
|
47
|
-
private
|
|
49
|
+
private octokitPromise;
|
|
48
50
|
private owner;
|
|
49
51
|
private repo;
|
|
50
52
|
private branch;
|
|
51
53
|
constructor(config: GitHubConfig);
|
|
54
|
+
private octokit;
|
|
52
55
|
/**
|
|
53
56
|
* Get the current commit SHA of the branch
|
|
54
57
|
*/
|
|
@@ -117,7 +120,7 @@ export declare class GitHubClient {
|
|
|
117
120
|
/**
|
|
118
121
|
* Get raw Octokit instance for advanced operations
|
|
119
122
|
*/
|
|
120
|
-
getOctokit(): Octokit
|
|
123
|
+
getOctokit(): Promise<Octokit>;
|
|
121
124
|
/**
|
|
122
125
|
* Get repository info
|
|
123
126
|
*/
|
package/dist/lib/github.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/lib/github.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/lib/github.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOpD;AAED;;GAEG;AACH,qBAAa,YAAY;IACxB,OAAO,CAAC,cAAc,CAAmB;IACzC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,YAAY;IAQhC,OAAO,CAAC,OAAO;IAIf;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IASrC;;;OAGG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,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AAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAyBpD;;;OAGG;IACG,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK5D;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B;;OAEG;IACH,WAAW;;;;;CAOX;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAErE"}
|
package/dist/lib/github.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses Octokit for GitHub API interactions with proper UTF-8 handling.
|
|
6
6
|
*/
|
|
7
7
|
import { Octokit } from '@octokit/rest';
|
|
8
|
+
import { githubToken } from './github-app';
|
|
8
9
|
/**
|
|
9
10
|
* Decode base64 content to UTF-8 string.
|
|
10
11
|
* atob() decodes to Latin-1, which corrupts multi-byte UTF-8 characters.
|
|
@@ -34,16 +35,20 @@ export function encodeUTF8Base64(str) {
|
|
|
34
35
|
*/
|
|
35
36
|
export class GitHubClient {
|
|
36
37
|
constructor(config) {
|
|
37
|
-
this.
|
|
38
|
+
this.octokitPromise = githubToken(config.githubAppId, config.githubInstallationId, config.githubPrivateKey, config.gitRepo)
|
|
39
|
+
.then((token) => new Octokit({ auth: token }));
|
|
38
40
|
this.owner = config.gitOwner;
|
|
39
41
|
this.repo = config.gitRepo;
|
|
40
42
|
this.branch = config.gitBranch;
|
|
41
43
|
}
|
|
44
|
+
octokit() {
|
|
45
|
+
return this.octokitPromise;
|
|
46
|
+
}
|
|
42
47
|
/**
|
|
43
48
|
* Get the current commit SHA of the branch
|
|
44
49
|
*/
|
|
45
50
|
async getCommitSha() {
|
|
46
|
-
const ref = await this.octokit.rest.git.getRef({
|
|
51
|
+
const ref = await (await this.octokit()).rest.git.getRef({
|
|
47
52
|
owner: this.owner,
|
|
48
53
|
repo: this.repo,
|
|
49
54
|
ref: `heads/${this.branch}`
|
|
@@ -56,7 +61,7 @@ export class GitHubClient {
|
|
|
56
61
|
*/
|
|
57
62
|
async readFile(path) {
|
|
58
63
|
try {
|
|
59
|
-
const response = await this.octokit.rest.repos.getContent({
|
|
64
|
+
const response = await (await this.octokit()).rest.repos.getContent({
|
|
60
65
|
owner: this.owner,
|
|
61
66
|
repo: this.repo,
|
|
62
67
|
path,
|
|
@@ -85,7 +90,7 @@ export class GitHubClient {
|
|
|
85
90
|
*/
|
|
86
91
|
async readFileBinary(path) {
|
|
87
92
|
try {
|
|
88
|
-
const response = await this.octokit.rest.repos.getContent({
|
|
93
|
+
const response = await (await this.octokit()).rest.repos.getContent({
|
|
89
94
|
owner: this.owner,
|
|
90
95
|
repo: this.repo,
|
|
91
96
|
path,
|
|
@@ -129,7 +134,7 @@ export class GitHubClient {
|
|
|
129
134
|
*/
|
|
130
135
|
async readJsonFileIfExists(path, commitSha) {
|
|
131
136
|
const treeSha = commitSha || await this.getCommitSha();
|
|
132
|
-
const tree = await this.octokit.rest.git.getTree({
|
|
137
|
+
const tree = await (await this.octokit()).rest.git.getTree({
|
|
133
138
|
owner: this.owner,
|
|
134
139
|
repo: this.repo,
|
|
135
140
|
tree_sha: treeSha,
|
|
@@ -157,7 +162,7 @@ export class GitHubClient {
|
|
|
157
162
|
async writeFile(path, content, message) {
|
|
158
163
|
// Get existing file SHA if it exists
|
|
159
164
|
const existing = await this.readFile(path);
|
|
160
|
-
const response = await this.octokit.rest.repos.createOrUpdateFileContents({
|
|
165
|
+
const response = await (await this.octokit()).rest.repos.createOrUpdateFileContents({
|
|
161
166
|
owner: this.owner,
|
|
162
167
|
repo: this.repo,
|
|
163
168
|
path,
|
|
@@ -183,7 +188,7 @@ export class GitHubClient {
|
|
|
183
188
|
// Get base commit SHA if not provided
|
|
184
189
|
const commitSha = baseCommitSha || await this.getCommitSha();
|
|
185
190
|
// Get the commit to find tree SHA
|
|
186
|
-
const commit = await this.octokit.rest.git.getCommit({
|
|
191
|
+
const commit = await (await this.octokit()).rest.git.getCommit({
|
|
187
192
|
owner: this.owner,
|
|
188
193
|
repo: this.repo,
|
|
189
194
|
commit_sha: commitSha
|
|
@@ -191,7 +196,7 @@ export class GitHubClient {
|
|
|
191
196
|
// Create blobs for all files
|
|
192
197
|
const blobs = await Promise.all(files.map(async (file) => {
|
|
193
198
|
const isBase64 = file.encoding === 'base64';
|
|
194
|
-
const blob = await this.octokit.rest.git.createBlob({
|
|
199
|
+
const blob = await (await this.octokit()).rest.git.createBlob({
|
|
195
200
|
owner: this.owner,
|
|
196
201
|
repo: this.repo,
|
|
197
202
|
content: isBase64 ? file.content : encodeUTF8Base64(file.content),
|
|
@@ -205,14 +210,14 @@ export class GitHubClient {
|
|
|
205
210
|
};
|
|
206
211
|
}));
|
|
207
212
|
// Create new tree
|
|
208
|
-
const newTree = await this.octokit.rest.git.createTree({
|
|
213
|
+
const newTree = await (await this.octokit()).rest.git.createTree({
|
|
209
214
|
owner: this.owner,
|
|
210
215
|
repo: this.repo,
|
|
211
216
|
tree: blobs,
|
|
212
217
|
base_tree: commit.data.tree.sha
|
|
213
218
|
});
|
|
214
219
|
// Create new commit
|
|
215
|
-
const newCommit = await this.octokit.rest.git.createCommit({
|
|
220
|
+
const newCommit = await (await this.octokit()).rest.git.createCommit({
|
|
216
221
|
owner: this.owner,
|
|
217
222
|
repo: this.repo,
|
|
218
223
|
message,
|
|
@@ -220,7 +225,7 @@ export class GitHubClient {
|
|
|
220
225
|
parents: [commit.data.sha]
|
|
221
226
|
});
|
|
222
227
|
// Update reference
|
|
223
|
-
await this.octokit.rest.git.updateRef({
|
|
228
|
+
await (await this.octokit()).rest.git.updateRef({
|
|
224
229
|
owner: this.owner,
|
|
225
230
|
repo: this.repo,
|
|
226
231
|
ref: `heads/${this.branch}`,
|
|
@@ -236,7 +241,7 @@ export class GitHubClient {
|
|
|
236
241
|
if (!existing) {
|
|
237
242
|
return; // File doesn't exist, nothing to delete
|
|
238
243
|
}
|
|
239
|
-
await this.octokit.rest.repos.deleteFile({
|
|
244
|
+
await (await this.octokit()).rest.repos.deleteFile({
|
|
240
245
|
owner: this.owner,
|
|
241
246
|
repo: this.repo,
|
|
242
247
|
path,
|
|
@@ -250,7 +255,7 @@ export class GitHubClient {
|
|
|
250
255
|
*/
|
|
251
256
|
async listDirectory(path) {
|
|
252
257
|
try {
|
|
253
|
-
const response = await this.octokit.rest.repos.getContent({
|
|
258
|
+
const response = await (await this.octokit()).rest.repos.getContent({
|
|
254
259
|
owner: this.owner,
|
|
255
260
|
repo: this.repo,
|
|
256
261
|
path,
|
|
@@ -283,7 +288,7 @@ export class GitHubClient {
|
|
|
283
288
|
* Get raw Octokit instance for advanced operations
|
|
284
289
|
*/
|
|
285
290
|
getOctokit() {
|
|
286
|
-
return this.octokit;
|
|
291
|
+
return this.octokit();
|
|
287
292
|
}
|
|
288
293
|
/**
|
|
289
294
|
* Get repository info
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hintergrund/worker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@hintergrund/auth": "^0.1.2",
|
|
27
|
-
"@hintergrund/
|
|
27
|
+
"@hintergrund/runtime-contracts": "workspace:*",
|
|
28
28
|
"@octokit/rest": "^22.0.0",
|
|
29
29
|
"cookie": "^1.0.2",
|
|
30
30
|
"hono": "^4.10.2",
|