@credal/actions 0.1.92 → 0.1.94
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.
@@ -472,6 +472,7 @@ exports.asanaGetTasksDetailsDefinition = {
|
|
472
472
|
},
|
473
473
|
due_at: {
|
474
474
|
type: "string",
|
475
|
+
nullable: true,
|
475
476
|
},
|
476
477
|
assignee_name: {
|
477
478
|
type: "string",
|
@@ -1026,11 +1027,11 @@ exports.kandjiGetFVRecoveryKeyForDeviceDefinition = {
|
|
1026
1027
|
scopes: [],
|
1027
1028
|
parameters: {
|
1028
1029
|
type: "object",
|
1029
|
-
required: ["
|
1030
|
+
required: ["userEmail", "subdomain"],
|
1030
1031
|
properties: {
|
1031
|
-
|
1032
|
+
userEmail: {
|
1032
1033
|
type: "string",
|
1033
|
-
description: "The
|
1034
|
+
description: "The email of the user requesting the recovery key",
|
1034
1035
|
},
|
1035
1036
|
subdomain: {
|
1036
1037
|
type: "string",
|
@@ -573,7 +573,7 @@ export declare const asanaGetTasksDetailsOutputSchema: z.ZodObject<{
|
|
573
573
|
approval_status: z.ZodString;
|
574
574
|
completed: z.ZodBoolean;
|
575
575
|
created_at: z.ZodString;
|
576
|
-
due_at: z.ZodOptional<z.ZodString
|
576
|
+
due_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
577
577
|
assignee_name: z.ZodString;
|
578
578
|
notes: z.ZodString;
|
579
579
|
comments: z.ZodArray<z.ZodObject<{
|
@@ -602,7 +602,7 @@ export declare const asanaGetTasksDetailsOutputSchema: z.ZodObject<{
|
|
602
602
|
text: string;
|
603
603
|
creator_name: string;
|
604
604
|
}[];
|
605
|
-
due_at?: string | undefined;
|
605
|
+
due_at?: string | null | undefined;
|
606
606
|
}, {
|
607
607
|
name: string;
|
608
608
|
completed: boolean;
|
@@ -616,7 +616,7 @@ export declare const asanaGetTasksDetailsOutputSchema: z.ZodObject<{
|
|
616
616
|
text: string;
|
617
617
|
creator_name: string;
|
618
618
|
}[];
|
619
|
-
due_at?: string | undefined;
|
619
|
+
due_at?: string | null | undefined;
|
620
620
|
}>, "many">>;
|
621
621
|
}, "strip", z.ZodTypeAny, {
|
622
622
|
success: boolean;
|
@@ -633,7 +633,7 @@ export declare const asanaGetTasksDetailsOutputSchema: z.ZodObject<{
|
|
633
633
|
text: string;
|
634
634
|
creator_name: string;
|
635
635
|
}[];
|
636
|
-
due_at?: string | undefined;
|
636
|
+
due_at?: string | null | undefined;
|
637
637
|
}[] | undefined;
|
638
638
|
errors?: string[] | undefined;
|
639
639
|
}, {
|
@@ -651,7 +651,7 @@ export declare const asanaGetTasksDetailsOutputSchema: z.ZodObject<{
|
|
651
651
|
text: string;
|
652
652
|
creator_name: string;
|
653
653
|
}[];
|
654
|
-
due_at?: string | undefined;
|
654
|
+
due_at?: string | null | undefined;
|
655
655
|
}[] | undefined;
|
656
656
|
errors?: string[] | undefined;
|
657
657
|
}>;
|
@@ -1013,13 +1013,13 @@ export declare const jiraGetJiraIssuesByQueryOutputSchema: z.ZodObject<{
|
|
1013
1013
|
export type jiraGetJiraIssuesByQueryOutputType = z.infer<typeof jiraGetJiraIssuesByQueryOutputSchema>;
|
1014
1014
|
export type jiraGetJiraIssuesByQueryFunction = ActionFunction<jiraGetJiraIssuesByQueryParamsType, AuthParamsType, jiraGetJiraIssuesByQueryOutputType>;
|
1015
1015
|
export declare const kandjiGetFVRecoveryKeyForDeviceParamsSchema: z.ZodObject<{
|
1016
|
-
|
1016
|
+
userEmail: z.ZodString;
|
1017
1017
|
subdomain: z.ZodString;
|
1018
1018
|
}, "strip", z.ZodTypeAny, {
|
1019
|
-
|
1019
|
+
userEmail: string;
|
1020
1020
|
subdomain: string;
|
1021
1021
|
}, {
|
1022
|
-
|
1022
|
+
userEmail: string;
|
1023
1023
|
subdomain: string;
|
1024
1024
|
}>;
|
1025
1025
|
export type kandjiGetFVRecoveryKeyForDeviceParamsType = z.infer<typeof kandjiGetFVRecoveryKeyForDeviceParamsSchema>;
|
@@ -1369,12 +1369,12 @@ export declare const credalCallCopilotParamsSchema: z.ZodObject<{
|
|
1369
1369
|
userEmail: z.ZodString;
|
1370
1370
|
}, "strip", z.ZodTypeAny, {
|
1371
1371
|
query: string;
|
1372
|
-
agentId: string;
|
1373
1372
|
userEmail: string;
|
1373
|
+
agentId: string;
|
1374
1374
|
}, {
|
1375
1375
|
query: string;
|
1376
|
-
agentId: string;
|
1377
1376
|
userEmail: string;
|
1377
|
+
agentId: string;
|
1378
1378
|
}>;
|
1379
1379
|
export type credalCallCopilotParamsType = z.infer<typeof credalCallCopilotParamsSchema>;
|
1380
1380
|
export declare const credalCallCopilotOutputSchema: z.ZodObject<{
|
@@ -166,7 +166,7 @@ exports.asanaGetTasksDetailsOutputSchema = zod_1.z.object({
|
|
166
166
|
approval_status: zod_1.z.string(),
|
167
167
|
completed: zod_1.z.boolean(),
|
168
168
|
created_at: zod_1.z.string(),
|
169
|
-
due_at: zod_1.z.string().optional(),
|
169
|
+
due_at: zod_1.z.string().nullable().optional(),
|
170
170
|
assignee_name: zod_1.z.string(),
|
171
171
|
notes: zod_1.z.string(),
|
172
172
|
comments: zod_1.z.array(zod_1.z.object({ text: zod_1.z.string(), created_at: zod_1.z.string(), creator_name: zod_1.z.string() })),
|
@@ -309,7 +309,7 @@ exports.jiraGetJiraIssuesByQueryOutputSchema = zod_1.z.object({
|
|
309
309
|
error: zod_1.z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
|
310
310
|
});
|
311
311
|
exports.kandjiGetFVRecoveryKeyForDeviceParamsSchema = zod_1.z.object({
|
312
|
-
|
312
|
+
userEmail: zod_1.z.string().describe("The email of the user requesting the recovery key"),
|
313
313
|
subdomain: zod_1.z.string().describe("The subdomain of the Kandji account"),
|
314
314
|
});
|
315
315
|
exports.kandjiGetFVRecoveryKeyForDeviceOutputSchema = zod_1.z.object({
|
@@ -11,16 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const axiosClient_1 = require("../../util/axiosClient");
|
13
13
|
const getFVRecoveryKeyForDevice = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
-
const {
|
14
|
+
const { userEmail, subdomain } = params;
|
15
15
|
const { apiKey } = authParams;
|
16
16
|
if (!apiKey) {
|
17
17
|
throw new Error("Missing API key in auth parameters");
|
18
18
|
}
|
19
19
|
try {
|
20
20
|
// First list all devices to get the device for the specific device
|
21
|
-
const device = yield
|
21
|
+
const device = yield getDeviceByEmail({
|
22
22
|
apiKey,
|
23
|
-
|
23
|
+
userEmail,
|
24
24
|
subdomain,
|
25
25
|
});
|
26
26
|
if (!device) {
|
@@ -54,16 +54,15 @@ const getFVRecoveryKeyForDevice = (_a) => __awaiter(void 0, [_a], void 0, functi
|
|
54
54
|
};
|
55
55
|
}
|
56
56
|
});
|
57
|
-
function
|
57
|
+
function getDeviceByEmail(input) {
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
59
59
|
const limit = 300;
|
60
60
|
let offset = 0;
|
61
|
-
const { apiKey,
|
61
|
+
const { apiKey, userEmail, subdomain } = input;
|
62
62
|
while (true) {
|
63
63
|
// Update params
|
64
64
|
const params = { limit, offset };
|
65
65
|
const endpoint = `https://${subdomain}.api.kandji.io/api/v1/devices`;
|
66
|
-
// Check to see if a platform was specified
|
67
66
|
const response = yield axiosClient_1.axiosClient.get(endpoint, {
|
68
67
|
params: Object.assign({}, params),
|
69
68
|
headers: {
|
@@ -72,8 +71,8 @@ function getDeviceBySerialNumber(input) {
|
|
72
71
|
},
|
73
72
|
});
|
74
73
|
for (const device of response.data) {
|
75
|
-
if (device.
|
76
|
-
// If the device
|
74
|
+
if (device.user && device.user.email === userEmail) {
|
75
|
+
// If the device user email matches, return the device
|
77
76
|
return device;
|
78
77
|
}
|
79
78
|
}
|