@skillful-ai/piece-web 0.1.0 → 0.1.2
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/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillful-ai/piece-web",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
|
-
"main": "./src/index.js",
|
|
6
|
-
"types": "./src/index.d.ts",
|
|
5
|
+
"main": "./dist/src/index.js",
|
|
6
|
+
"types": "./dist/src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@activepieces/pieces-framework": "0.25.6",
|
|
9
9
|
"tslib": "^2.3.0",
|
|
Binary file
|
|
Binary file
|
package/src/lib/common.js
CHANGED
|
@@ -5,16 +5,24 @@ exports.getGoogleApiKey = getGoogleApiKey;
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
function getApiKey(context, config) {
|
|
7
7
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
-
var _a, _b, _c;
|
|
9
|
-
// Priority 1: User-provided API key from connection
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9
|
+
// Priority 1: User-provided API key from connection (V0: auth = props directly)
|
|
10
|
+
const authDirect = (_c = (_b = (_a = context.auth) === null || _a === void 0 ? void 0 : _a[config.authKey]) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
11
|
+
if (authDirect) {
|
|
12
|
+
return authDirect;
|
|
13
|
+
}
|
|
14
|
+
// Also check nested props for V1 compatibility
|
|
15
|
+
const authNested = (_g = (_f = (_e = (_d = context.auth) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e[config.authKey]) === null || _f === void 0 ? void 0 : _f.trim) === null || _g === void 0 ? void 0 : _g.call(_f);
|
|
16
|
+
if (authNested) {
|
|
17
|
+
return authNested;
|
|
12
18
|
}
|
|
13
19
|
// Priority 2: Try to get from platform connection
|
|
14
20
|
try {
|
|
15
21
|
const connection = yield context.connections.get(config.platformConnectionId);
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
// V0 returns props directly, V1 returns { type, props }
|
|
23
|
+
const key = (connection === null || connection === void 0 ? void 0 : connection[config.platformKey]) || ((_h = connection === null || connection === void 0 ? void 0 : connection.props) === null || _h === void 0 ? void 0 : _h[config.platformKey]);
|
|
24
|
+
if (key) {
|
|
25
|
+
return key;
|
|
18
26
|
}
|
|
19
27
|
}
|
|
20
28
|
catch (error) {
|
package/src/lib/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":";;AAkDA,sCAEC;AAED,0CAEC;;AAlDD,SAAe,SAAS,CACpB,OAAY,EACZ,MAAoB;;;QAEpB,gFAAgF;QAChF,MAAM,UAAU,GAAG,MAAA,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAG,MAAM,CAAC,OAAO,CAAC,0CAAE,IAAI,kDAAI,CAAA;QAC3D,IAAI,UAAU,EAAE,CAAC;YACb,OAAO,UAAU,CAAA;QACrB,CAAC;QACD,+CAA+C;QAC/C,MAAM,UAAU,GAAG,MAAA,MAAA,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,KAAK,0CAAG,MAAM,CAAC,OAAO,CAAC,0CAAE,IAAI,kDAAI,CAAA;QAClE,IAAI,UAAU,EAAE,CAAC;YACb,OAAO,UAAU,CAAA;QACrB,CAAC;QAED,kDAAkD;QAClD,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,oBAAoB,CAAC,C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