@friggframework/api-module-frigg-scale-test 0.2.0-next.1 → 0.2.0-next.3
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.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/defintion.js +38 -1
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
package/dist/api.js
CHANGED
package/dist/defintion.js
CHANGED
|
@@ -6,14 +6,51 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const api_1 = __importDefault(require("./api"));
|
|
7
7
|
const definition = {
|
|
8
8
|
API: api_1.default,
|
|
9
|
-
getName: () => "
|
|
9
|
+
getName: () => "scale-test",
|
|
10
10
|
moduleName: "scale-test",
|
|
11
11
|
requiredAuthMethods: {
|
|
12
|
+
getAuthorizationRequirements: (api) => {
|
|
13
|
+
return {
|
|
14
|
+
type: "apiKey",
|
|
15
|
+
data: {
|
|
16
|
+
jsonSchema: {
|
|
17
|
+
title: "Scale Test API Authorization",
|
|
18
|
+
type: "object",
|
|
19
|
+
required: ["apiKey"],
|
|
20
|
+
properties: {
|
|
21
|
+
apiKey: {
|
|
22
|
+
type: "string",
|
|
23
|
+
title: "API Key",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
uiSchema: {
|
|
28
|
+
apiKey: {
|
|
29
|
+
"ui:widget": "password",
|
|
30
|
+
"ui:help": "Your Scale Test API key",
|
|
31
|
+
"ui:placeholder": "Enter your API key...",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
},
|
|
12
37
|
getToken: async (api, params) => {
|
|
13
38
|
// For scale test API, use API key authentication
|
|
14
39
|
const apiKey = params.data?.apiKey || params.data?.access_token;
|
|
15
40
|
return { access_token: apiKey };
|
|
16
41
|
},
|
|
42
|
+
setAuthParams: async (api, params) => {
|
|
43
|
+
// For API key authentication, set the key on the API instance
|
|
44
|
+
// params IS the data object, so access apiKey directly
|
|
45
|
+
const apiKey = params.apiKey || params.access_token;
|
|
46
|
+
if (!apiKey) {
|
|
47
|
+
throw new Error("API key is required for Scale Test authentication");
|
|
48
|
+
}
|
|
49
|
+
// Set the apiKey on the API instance (assuming it has an opts property)
|
|
50
|
+
api.opts = { ...api.opts, apiKey };
|
|
51
|
+
api.access_token = apiKey;
|
|
52
|
+
return { access_token: apiKey };
|
|
53
|
+
},
|
|
17
54
|
getEntityDetails: async (api, callbackParams, tokenResponse, userId) => {
|
|
18
55
|
const healthCheck = await api.health();
|
|
19
56
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/api-module-frigg-scale-test",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "30c24c3bedf5142d807ccbc7256787cbaa64aa66"
|
|
32
32
|
}
|