@credal/actions 0.1.95 → 0.1.96
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.
@@ -125,7 +125,8 @@ const GongResponseSchema = zod_1.z.object({
|
|
125
125
|
});
|
126
126
|
function getUsers(authToken) {
|
127
127
|
return __awaiter(this, void 0, void 0, function* () {
|
128
|
-
|
128
|
+
var _a;
|
129
|
+
const results = [];
|
129
130
|
let cursor = undefined;
|
130
131
|
do {
|
131
132
|
const response = yield axios_1.default.get(`https://api.gong.io/v2/users` + (cursor ? `?cursor=${cursor}` : ""), {
|
@@ -137,12 +138,11 @@ function getUsers(authToken) {
|
|
137
138
|
if (!response) {
|
138
139
|
return results;
|
139
140
|
}
|
140
|
-
const
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
return results;
|
141
|
+
for (const user of (_a = response.data.users) !== null && _a !== void 0 ? _a : []) {
|
142
|
+
const parsedUser = UserSchema.safeParse(user);
|
143
|
+
if (parsedUser.success) {
|
144
|
+
results.push(parsedUser.data);
|
145
|
+
}
|
146
146
|
}
|
147
147
|
cursor = response.data.cursor;
|
148
148
|
} while (cursor);
|