@apteva/integrations 0.1.0 → 0.1.1
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/apps/index.d.ts +1 -1
- package/dist/apps/index.d.ts.map +1 -1
- package/dist/apps/index.js +19 -5
- package/dist/apps/index.js.map +1 -1
- package/package.json +1 -1
package/dist/apps/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppTemplate } from "../types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Load all app templates from the JSON files in
|
|
3
|
+
* Load all app templates from the JSON files in the apps directory.
|
|
4
4
|
* Results are cached after first load.
|
|
5
5
|
*/
|
|
6
6
|
export declare function loadAppTemplates(): Map<string, AppTemplate>;
|
package/dist/apps/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apps/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apps/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkB/C;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAkB3D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEpE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,KAAK,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC,CAQD"}
|
package/dist/apps/index.js
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import { readFileSync, readdirSync } from "fs";
|
|
2
|
-
import { join, dirname } from "path";
|
|
1
|
+
import { readFileSync, readdirSync, existsSync } from "fs";
|
|
2
|
+
import { join, dirname, resolve } from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
// JSON files are in src/apps/ but compiled JS runs from dist/apps/
|
|
6
|
+
// Try multiple locations to find them
|
|
7
|
+
function getAppsDir() {
|
|
8
|
+
// 1. Check current directory (works in dev / ts-node)
|
|
9
|
+
if (existsSync(join(__dirname, "github.json")))
|
|
10
|
+
return __dirname;
|
|
11
|
+
// 2. Check src/apps/ relative to package root (dist/apps/ -> ../../src/apps/)
|
|
12
|
+
const srcApps = resolve(__dirname, "../../src/apps");
|
|
13
|
+
if (existsSync(join(srcApps, "github.json")))
|
|
14
|
+
return srcApps;
|
|
15
|
+
// 3. Fallback
|
|
16
|
+
return __dirname;
|
|
17
|
+
}
|
|
5
18
|
let cachedApps = null;
|
|
6
19
|
/**
|
|
7
|
-
* Load all app templates from the JSON files in
|
|
20
|
+
* Load all app templates from the JSON files in the apps directory.
|
|
8
21
|
* Results are cached after first load.
|
|
9
22
|
*/
|
|
10
23
|
export function loadAppTemplates() {
|
|
11
24
|
if (cachedApps)
|
|
12
25
|
return cachedApps;
|
|
13
26
|
cachedApps = new Map();
|
|
14
|
-
const
|
|
27
|
+
const appsDir = getAppsDir();
|
|
28
|
+
const files = readdirSync(appsDir).filter((f) => f.endsWith(".json"));
|
|
15
29
|
for (const file of files) {
|
|
16
30
|
try {
|
|
17
|
-
const raw = readFileSync(join(
|
|
31
|
+
const raw = readFileSync(join(appsDir, file), "utf-8");
|
|
18
32
|
const app = JSON.parse(raw);
|
|
19
33
|
cachedApps.set(app.slug, app);
|
|
20
34
|
}
|
package/dist/apps/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,mEAAmE;AACnE,sCAAsC;AACtC,SAAS,UAAU;IACjB,sDAAsD;IACtD,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACjE,8EAA8E;IAC9E,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IACrD,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC;IAC7D,cAAc;IACd,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,IAAI,UAAU,GAAoC,IAAI,CAAC;AAEvD;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAElC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,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
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Local integrations, connections, and webhooks for Apteva. Self-contained app templates, OAuth engine, and trigger provider.",
|
|
5
5
|
"author": "Apteva <hello@apteva.com>",
|
|
6
6
|
"license": "Elastic-2.0",
|