@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
- let results = [];
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 parsedItems = zod_1.z.array(UserSchema).safeParse(response.data.users);
141
- if (parsedItems.success) {
142
- results = [...results, ...parsedItems.data];
143
- }
144
- else {
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.95",
3
+ "version": "0.1.96",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",