@approvio/api 0.0.32 → 0.0.34

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.
@@ -1,4 +1,4 @@
1
- import { a as Workflow, d as ListGroups200Response, f as Pagination, i as ListWorkflows200Response, m as GroupInfo, n as User, p as Group, r as TokenResponse, t as WorkflowCreate, u as UserSummary } from "../workflow-create-c9jqkg6v.cjs";
1
+ import { a as Workflow, d as ListGroups200Response, f as Pagination, i as ListWorkflows200Response, m as GroupInfo, n as User, p as Group, r as TokenResponse, t as WorkflowCreate, u as UserSummary } from "../workflow-create-Bmi0J-Dc.cjs";
2
2
 
3
3
  //#region mocks/user.fixtures.d.ts
4
4
  declare const MOCK_USER_ID = "e6e08687-2189-4710-91b5-479cd25a9119";
@@ -1,4 +1,4 @@
1
- import { a as Workflow, d as ListGroups200Response, f as Pagination, i as ListWorkflows200Response, m as GroupInfo, n as User, p as Group, r as TokenResponse, t as WorkflowCreate, u as UserSummary } from "../workflow-create-CtzZubWu.mjs";
1
+ import { a as Workflow, d as ListGroups200Response, f as Pagination, i as ListWorkflows200Response, m as GroupInfo, n as User, p as Group, r as TokenResponse, t as WorkflowCreate, u as UserSummary } from "../workflow-create-B9_eIGcu.mjs";
2
2
 
3
3
  //#region mocks/user.fixtures.d.ts
4
4
  declare const MOCK_USER_ID = "e6e08687-2189-4710-91b5-479cd25a9119";
@@ -279,6 +279,9 @@ function validateGroupScope(object) {
279
279
  groupId: object.groupId
280
280
  });
281
281
  }
282
+ function validateListGroupsParams(object) {
283
+ return validateSharedListParams(object);
284
+ }
282
285
  function validateGroupInfo(object) {
283
286
  if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
284
287
  if (!hasOwnProperty(object, "groupId") || !isNonEmptyString(object.groupId)) return (0, fp_ts_Either.left)(hasOwnProperty(object, "groupId") ? "invalid_group_id" : "missing_group_id");
@@ -363,6 +366,33 @@ function validateListGroupEntities200Response(object) {
363
366
  }
364
367
  //#endregion
365
368
  //#region src/validators/common.validators.ts
369
+ function validateSharedListParams(object) {
370
+ if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
371
+ const result = {};
372
+ if (hasOwnProperty(object, "page") && object.page !== void 0) {
373
+ let page = object.page;
374
+ if (typeof page === "string" && page.trim() !== "") {
375
+ const parsed = Number(page);
376
+ if (!isNaN(parsed)) page = parsed;
377
+ }
378
+ if (typeof page !== "number" || !Number.isInteger(page) || page < 1) return (0, fp_ts_Either.left)("invalid_page");
379
+ result.page = page;
380
+ }
381
+ if (hasOwnProperty(object, "limit") && object.limit !== void 0) {
382
+ let limit = object.limit;
383
+ if (typeof limit === "string" && limit.trim() !== "") {
384
+ const parsed = Number(limit);
385
+ if (!isNaN(parsed)) limit = parsed;
386
+ }
387
+ if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1) return (0, fp_ts_Either.left)("invalid_limit");
388
+ result.limit = limit;
389
+ }
390
+ if (hasOwnProperty(object, "search") && object.search !== void 0) {
391
+ if (typeof object.search !== "string" || object.search.trim() === "") return (0, fp_ts_Either.left)("invalid_search");
392
+ result.search = object.search;
393
+ }
394
+ return (0, fp_ts_Either.right)(result);
395
+ }
366
396
  function validatePagination(object) {
367
397
  if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
368
398
  if (!hasOwnProperty(object, "total")) return (0, fp_ts_Either.left)("missing_total");
@@ -701,17 +731,10 @@ function validateListWorkflowTemplates200Response(object) {
701
731
  });
702
732
  }
703
733
  function validateListWorkflowTemplatesParams(object) {
704
- if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
705
- const result = {};
706
- if (hasOwnProperty(object, "page") && object.page !== void 0) {
707
- if (typeof object.page !== "number") return (0, fp_ts_Either.left)("invalid_page");
708
- result.page = object.page;
709
- }
710
- if (hasOwnProperty(object, "limit") && object.limit !== void 0) {
711
- if (typeof object.limit !== "number") return (0, fp_ts_Either.left)("invalid_limit");
712
- result.limit = object.limit;
713
- }
714
- if (hasOwnProperty(object, "spaceIdentifier") && object.spaceIdentifier !== void 0) {
734
+ const sharedValidation = validateSharedListParams(object);
735
+ if ((0, fp_ts_Either.isLeft)(sharedValidation)) return (0, fp_ts_Either.left)(sharedValidation.left);
736
+ const result = sharedValidation.right;
737
+ if (typeof object === "object" && object !== null && hasOwnProperty(object, "spaceIdentifier") && object.spaceIdentifier !== void 0) {
715
738
  if (!isNonEmptyString(object.spaceIdentifier)) return (0, fp_ts_Either.left)("invalid_space_identifier");
716
739
  result.spaceIdentifier = object.spaceIdentifier;
717
740
  }
@@ -804,19 +827,10 @@ function validateGetWorkflowParams(object) {
804
827
  return (0, fp_ts_Either.right)({ include });
805
828
  }
806
829
  function validateListWorkflowsParams(object) {
830
+ const sharedValidation = (0, fp_ts_function.pipe)(validateSharedListParams(object), (0, fp_ts_Either.mapLeft)((error) => error === "invalid_search" ? "malformed_object" : error));
831
+ if ((0, fp_ts_Either.isLeft)(sharedValidation)) return (0, fp_ts_Either.left)(sharedValidation.left);
832
+ const result = sharedValidation.right;
807
833
  if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
808
- let page = void 0;
809
- if (hasOwnProperty(object, "page")) {
810
- const val = object["page"];
811
- if (typeof val !== "number") return (0, fp_ts_Either.left)("invalid_page");
812
- page = val;
813
- }
814
- let limit = void 0;
815
- if (hasOwnProperty(object, "limit")) {
816
- const val = object["limit"];
817
- if (typeof val !== "number") return (0, fp_ts_Either.left)("invalid_limit");
818
- limit = val;
819
- }
820
834
  let include = void 0;
821
835
  if (hasOwnProperty(object, "include")) {
822
836
  const includeVal = object["include"];
@@ -840,13 +854,10 @@ function validateListWorkflowsParams(object) {
840
854
  if (typeof val !== "string") return (0, fp_ts_Either.left)("invalid_workflow_template_identifier");
841
855
  workflowTemplateIdentifier = val;
842
856
  }
843
- return (0, fp_ts_Either.right)({
844
- page,
845
- limit,
846
- include,
847
- includeOnlyNonTerminalState,
848
- workflowTemplateIdentifier
849
- });
857
+ if (include !== void 0) result.include = include;
858
+ if (includeOnlyNonTerminalState !== void 0) result.includeOnlyNonTerminalState = includeOnlyNonTerminalState;
859
+ if (workflowTemplateIdentifier !== void 0) result.workflowTemplateIdentifier = workflowTemplateIdentifier;
860
+ return (0, fp_ts_Either.right)(result);
850
861
  }
851
862
  function validateListWorkflows200Response(object) {
852
863
  if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
@@ -1111,6 +1122,9 @@ function validateRoleAssignmentRequest(object) {
1111
1122
  function validateRoleRemovalRequest(object) {
1112
1123
  return validateRoleAssignmentRequest(object);
1113
1124
  }
1125
+ function validateListUsersParams(object) {
1126
+ return validateSharedListParams(object);
1127
+ }
1114
1128
  //#endregion
1115
1129
  //#region src/validators/spaces.validators.ts
1116
1130
  function validateSpace(object) {
@@ -1175,6 +1189,9 @@ function validateSpaceScope(object) {
1175
1189
  spaceId: object.spaceId
1176
1190
  });
1177
1191
  }
1192
+ function validateListSpacesParams(object) {
1193
+ return validateSharedListParams(object);
1194
+ }
1178
1195
  //#endregion
1179
1196
  //#region src/validators/agents.validators.ts
1180
1197
  function validateAgentSummary(object) {
@@ -1228,21 +1245,10 @@ function validateAgentTokenResponse(object) {
1228
1245
  });
1229
1246
  }
1230
1247
  function validateListAgentsParams(object) {
1231
- if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
1232
- let page = void 0;
1233
- if (hasOwnProperty(object, "page") && object.page !== void 0) {
1234
- if (typeof object.page !== "number") return (0, fp_ts_Either.left)("invalid_page");
1235
- page = object.page;
1236
- }
1237
- let limit = void 0;
1238
- if (hasOwnProperty(object, "limit") && object.limit !== void 0) {
1239
- if (typeof object.limit !== "number") return (0, fp_ts_Either.left)("invalid_limit");
1240
- limit = object.limit;
1241
- }
1242
- return (0, fp_ts_Either.right)({
1243
- page,
1244
- limit
1245
- });
1248
+ const sharedValidation = (0, fp_ts_function.pipe)(validateSharedListParams(object), (0, fp_ts_Either.mapLeft)((error) => error === "invalid_search" ? "malformed_object" : error));
1249
+ if ((0, fp_ts_Either.isLeft)(sharedValidation)) return (0, fp_ts_Either.left)(sharedValidation.left);
1250
+ const result = sharedValidation.right;
1251
+ return (0, fp_ts_Either.right)(result);
1246
1252
  }
1247
1253
  function validateListAgents200Response(object) {
1248
1254
  if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
@@ -1487,10 +1493,13 @@ exports.validateListAgents200Response = validateListAgents200Response;
1487
1493
  exports.validateListAgentsParams = validateListAgentsParams;
1488
1494
  exports.validateListGroupEntities200Response = validateListGroupEntities200Response;
1489
1495
  exports.validateListGroups200Response = validateListGroups200Response;
1496
+ exports.validateListGroupsParams = validateListGroupsParams;
1490
1497
  exports.validateListOrganizationAdminsForOrg200Response = validateListOrganizationAdminsForOrg200Response;
1491
1498
  exports.validateListRoleTemplates200Response = validateListRoleTemplates200Response;
1492
1499
  exports.validateListSpaces200Response = validateListSpaces200Response;
1500
+ exports.validateListSpacesParams = validateListSpacesParams;
1493
1501
  exports.validateListUsers200Response = validateListUsers200Response;
1502
+ exports.validateListUsersParams = validateListUsersParams;
1494
1503
  exports.validateListWorkflowTemplates200Response = validateListWorkflowTemplates200Response;
1495
1504
  exports.validateListWorkflowTemplatesParams = validateListWorkflowTemplatesParams;
1496
1505
  exports.validateListWorkflows200Response = validateListWorkflows200Response;
@@ -1505,6 +1514,7 @@ exports.validateRefreshTokenRequest = validateRefreshTokenRequest;
1505
1514
  exports.validateRemoveGroupEntitiesRequest = validateRemoveGroupEntitiesRequest;
1506
1515
  exports.validateRoleAssignmentRequest = validateRoleAssignmentRequest;
1507
1516
  exports.validateRoleRemovalRequest = validateRoleRemovalRequest;
1517
+ exports.validateSharedListParams = validateSharedListParams;
1508
1518
  exports.validateSpaceCreate = validateSpaceCreate;
1509
1519
  exports.validateSpaceScope = validateSpaceScope;
1510
1520
  exports.validateTokenRequest = validateTokenRequest;