@approvio/api 0.0.31 → 0.0.33
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/mocks/index.d.cts +1 -1
- package/dist/mocks/index.d.mts +1 -1
- package/dist/src/index.cjs +96 -47
- package/dist/src/index.d.cts +154 -53
- package/dist/src/index.d.mts +154 -53
- package/dist/src/index.mjs +69 -48
- package/dist/{workflow-create-DVgNnx0X.d.mts → workflow-create-B9_eIGcu.d.mts} +11 -11
- package/dist/{workflow-create-Dgj7wWZs.d.cts → workflow-create-Bmi0J-Dc.d.cts} +11 -11
- package/package.json +1 -1
package/dist/mocks/index.d.cts
CHANGED
|
@@ -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-
|
|
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";
|
package/dist/mocks/index.d.mts
CHANGED
|
@@ -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-
|
|
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";
|
package/dist/src/index.cjs
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
2
24
|
let fp_ts_Either = require("fp-ts/Either");
|
|
25
|
+
fp_ts_Either = __toESM(fp_ts_Either);
|
|
26
|
+
let fp_ts_function = require("fp-ts/function");
|
|
27
|
+
let fp_ts_Array = require("fp-ts/Array");
|
|
28
|
+
fp_ts_Array = __toESM(fp_ts_Array);
|
|
3
29
|
//#region generated/openapi/model/agent-token-request.ts
|
|
4
30
|
let AgentTokenRequest;
|
|
5
31
|
(function(_AgentTokenRequest) {
|
|
@@ -253,6 +279,9 @@ function validateGroupScope(object) {
|
|
|
253
279
|
groupId: object.groupId
|
|
254
280
|
});
|
|
255
281
|
}
|
|
282
|
+
function validateListGroupsParams(object) {
|
|
283
|
+
return validateSharedListParams(object);
|
|
284
|
+
}
|
|
256
285
|
function validateGroupInfo(object) {
|
|
257
286
|
if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
|
|
258
287
|
if (!hasOwnProperty(object, "groupId") || !isNonEmptyString(object.groupId)) return (0, fp_ts_Either.left)(hasOwnProperty(object, "groupId") ? "invalid_group_id" : "missing_group_id");
|
|
@@ -337,6 +366,23 @@ function validateListGroupEntities200Response(object) {
|
|
|
337
366
|
}
|
|
338
367
|
//#endregion
|
|
339
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
|
+
if (typeof object.page !== "number" || object.page < 1) return (0, fp_ts_Either.left)("invalid_page");
|
|
374
|
+
result.page = object.page;
|
|
375
|
+
}
|
|
376
|
+
if (hasOwnProperty(object, "limit") && object.limit !== void 0) {
|
|
377
|
+
if (typeof object.limit !== "number" || object.limit < 1) return (0, fp_ts_Either.left)("invalid_limit");
|
|
378
|
+
result.limit = object.limit;
|
|
379
|
+
}
|
|
380
|
+
if (hasOwnProperty(object, "search") && object.search !== void 0) {
|
|
381
|
+
if (typeof object.search !== "string" || object.search.trim() === "") return (0, fp_ts_Either.left)("invalid_search");
|
|
382
|
+
result.search = object.search;
|
|
383
|
+
}
|
|
384
|
+
return (0, fp_ts_Either.right)(result);
|
|
385
|
+
}
|
|
340
386
|
function validatePagination(object) {
|
|
341
387
|
if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
|
|
342
388
|
if (!hasOwnProperty(object, "total")) return (0, fp_ts_Either.left)("missing_total");
|
|
@@ -351,42 +397,6 @@ function validatePagination(object) {
|
|
|
351
397
|
limit: object.limit
|
|
352
398
|
});
|
|
353
399
|
}
|
|
354
|
-
function validateAPIErrorDetailsInner(object) {
|
|
355
|
-
if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
|
|
356
|
-
const result = {};
|
|
357
|
-
if (hasOwnProperty(object, "field") && object.field !== void 0) {
|
|
358
|
-
if (typeof object.field !== "string") return (0, fp_ts_Either.left)("invalid_field");
|
|
359
|
-
result.field = object.field;
|
|
360
|
-
}
|
|
361
|
-
if (hasOwnProperty(object, "message") && object.message !== void 0) {
|
|
362
|
-
if (typeof object.message !== "string") return (0, fp_ts_Either.left)("invalid_message");
|
|
363
|
-
result.message = object.message;
|
|
364
|
-
}
|
|
365
|
-
return (0, fp_ts_Either.right)(result);
|
|
366
|
-
}
|
|
367
|
-
function validateAPIError(object) {
|
|
368
|
-
if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
|
|
369
|
-
const result = {};
|
|
370
|
-
if (hasOwnProperty(object, "code") && object.code !== void 0) {
|
|
371
|
-
if (typeof object.code !== "string") return (0, fp_ts_Either.left)("invalid_code");
|
|
372
|
-
result.code = object.code;
|
|
373
|
-
}
|
|
374
|
-
if (hasOwnProperty(object, "message") && object.message !== void 0) {
|
|
375
|
-
if (typeof object.message !== "string") return (0, fp_ts_Either.left)("invalid_message");
|
|
376
|
-
result.message = object.message;
|
|
377
|
-
}
|
|
378
|
-
if (hasOwnProperty(object, "details") && object.details !== void 0) {
|
|
379
|
-
if (!isArray(object.details)) return (0, fp_ts_Either.left)("invalid_details");
|
|
380
|
-
const details = [];
|
|
381
|
-
for (const item of object.details) {
|
|
382
|
-
const validatedItem = validateAPIErrorDetailsInner(item);
|
|
383
|
-
if ((0, fp_ts_Either.isLeft)(validatedItem)) return (0, fp_ts_Either.left)("invalid_details");
|
|
384
|
-
details.push(validatedItem.right);
|
|
385
|
-
}
|
|
386
|
-
result.details = details;
|
|
387
|
-
}
|
|
388
|
-
return (0, fp_ts_Either.right)(result);
|
|
389
|
-
}
|
|
390
400
|
function validateHealthResponse(object) {
|
|
391
401
|
if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
|
|
392
402
|
if (!hasOwnProperty(object, "status") || !isNonEmptyString(object.status)) return (0, fp_ts_Either.left)(hasOwnProperty(object, "status") ? "invalid_status" : "missing_status");
|
|
@@ -711,17 +721,10 @@ function validateListWorkflowTemplates200Response(object) {
|
|
|
711
721
|
});
|
|
712
722
|
}
|
|
713
723
|
function validateListWorkflowTemplatesParams(object) {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
result.page = object.page;
|
|
719
|
-
}
|
|
720
|
-
if (hasOwnProperty(object, "limit") && object.limit !== void 0) {
|
|
721
|
-
if (typeof object.limit !== "number") return (0, fp_ts_Either.left)("invalid_limit");
|
|
722
|
-
result.limit = object.limit;
|
|
723
|
-
}
|
|
724
|
-
if (hasOwnProperty(object, "spaceIdentifier") && object.spaceIdentifier !== void 0) {
|
|
724
|
+
const sharedValidation = validateSharedListParams(object);
|
|
725
|
+
if ((0, fp_ts_Either.isLeft)(sharedValidation)) return (0, fp_ts_Either.left)(sharedValidation.left);
|
|
726
|
+
const result = sharedValidation.right;
|
|
727
|
+
if (typeof object === "object" && object !== null && hasOwnProperty(object, "spaceIdentifier") && object.spaceIdentifier !== void 0) {
|
|
725
728
|
if (!isNonEmptyString(object.spaceIdentifier)) return (0, fp_ts_Either.left)("invalid_space_identifier");
|
|
726
729
|
result.spaceIdentifier = object.spaceIdentifier;
|
|
727
730
|
}
|
|
@@ -1121,6 +1124,9 @@ function validateRoleAssignmentRequest(object) {
|
|
|
1121
1124
|
function validateRoleRemovalRequest(object) {
|
|
1122
1125
|
return validateRoleAssignmentRequest(object);
|
|
1123
1126
|
}
|
|
1127
|
+
function validateListUsersParams(object) {
|
|
1128
|
+
return validateSharedListParams(object);
|
|
1129
|
+
}
|
|
1124
1130
|
//#endregion
|
|
1125
1131
|
//#region src/validators/spaces.validators.ts
|
|
1126
1132
|
function validateSpace(object) {
|
|
@@ -1185,6 +1191,9 @@ function validateSpaceScope(object) {
|
|
|
1185
1191
|
spaceId: object.spaceId
|
|
1186
1192
|
});
|
|
1187
1193
|
}
|
|
1194
|
+
function validateListSpacesParams(object) {
|
|
1195
|
+
return validateSharedListParams(object);
|
|
1196
|
+
}
|
|
1188
1197
|
//#endregion
|
|
1189
1198
|
//#region src/validators/agents.validators.ts
|
|
1190
1199
|
function validateAgentSummary(object) {
|
|
@@ -1354,6 +1363,41 @@ function validateListRoleTemplates200Response(object) {
|
|
|
1354
1363
|
return (0, fp_ts_Either.right)({ roles });
|
|
1355
1364
|
}
|
|
1356
1365
|
//#endregion
|
|
1366
|
+
//#region src/validators/api-error.validators.ts
|
|
1367
|
+
function validateAPIErrorDetailsInner(object) {
|
|
1368
|
+
if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_details");
|
|
1369
|
+
if (!hasOwnProperty(object, "field")) return (0, fp_ts_Either.left)("missing_code");
|
|
1370
|
+
if (!isNonEmptyString(object.field)) return (0, fp_ts_Either.left)("invalid_code");
|
|
1371
|
+
if (!hasOwnProperty(object, "message")) return (0, fp_ts_Either.left)("missing_message");
|
|
1372
|
+
if (!isNonEmptyString(object.message)) return (0, fp_ts_Either.left)("invalid_message");
|
|
1373
|
+
return (0, fp_ts_Either.right)({
|
|
1374
|
+
field: object.field,
|
|
1375
|
+
message: object.message
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
function validateAPIError(object) {
|
|
1379
|
+
if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
|
|
1380
|
+
if (!hasOwnProperty(object, "code")) return (0, fp_ts_Either.left)("missing_code");
|
|
1381
|
+
if (!isNonEmptyString(object.code)) return (0, fp_ts_Either.left)("invalid_code");
|
|
1382
|
+
if (!hasOwnProperty(object, "message")) return (0, fp_ts_Either.left)("missing_message");
|
|
1383
|
+
if (!isNonEmptyString(object.message)) return (0, fp_ts_Either.left)("invalid_message");
|
|
1384
|
+
let details = void 0;
|
|
1385
|
+
if (hasOwnProperty(object, "details")) {
|
|
1386
|
+
if (!Array.isArray(object.details)) return (0, fp_ts_Either.left)("malformed_object");
|
|
1387
|
+
const eitherDetails = (0, fp_ts_function.pipe)(object.details, fp_ts_Array.map(validateAPIErrorDetailsInner), fp_ts_Array.sequence(fp_ts_Either.Applicative));
|
|
1388
|
+
if (fp_ts_Either.isLeft(eitherDetails)) return eitherDetails;
|
|
1389
|
+
details = eitherDetails.right;
|
|
1390
|
+
}
|
|
1391
|
+
return (0, fp_ts_Either.right)({
|
|
1392
|
+
code: object.code,
|
|
1393
|
+
message: object.message,
|
|
1394
|
+
details
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
function isAPIError(object) {
|
|
1398
|
+
return fp_ts_Either.isRight(validateAPIError(object));
|
|
1399
|
+
}
|
|
1400
|
+
//#endregion
|
|
1357
1401
|
Object.defineProperty(exports, "AgentTokenRequest", {
|
|
1358
1402
|
enumerable: true,
|
|
1359
1403
|
get: function() {
|
|
@@ -1438,6 +1482,7 @@ Object.defineProperty(exports, "WorkflowTemplateScope", {
|
|
|
1438
1482
|
return WorkflowTemplateScope;
|
|
1439
1483
|
}
|
|
1440
1484
|
});
|
|
1485
|
+
exports.isAPIError = isAPIError;
|
|
1441
1486
|
exports.validateAPIError = validateAPIError;
|
|
1442
1487
|
exports.validateAddGroupEntitiesRequest = validateAddGroupEntitiesRequest;
|
|
1443
1488
|
exports.validateAgentChallengeRequest = validateAgentChallengeRequest;
|
|
@@ -1461,10 +1506,13 @@ exports.validateListAgents200Response = validateListAgents200Response;
|
|
|
1461
1506
|
exports.validateListAgentsParams = validateListAgentsParams;
|
|
1462
1507
|
exports.validateListGroupEntities200Response = validateListGroupEntities200Response;
|
|
1463
1508
|
exports.validateListGroups200Response = validateListGroups200Response;
|
|
1509
|
+
exports.validateListGroupsParams = validateListGroupsParams;
|
|
1464
1510
|
exports.validateListOrganizationAdminsForOrg200Response = validateListOrganizationAdminsForOrg200Response;
|
|
1465
1511
|
exports.validateListRoleTemplates200Response = validateListRoleTemplates200Response;
|
|
1466
1512
|
exports.validateListSpaces200Response = validateListSpaces200Response;
|
|
1513
|
+
exports.validateListSpacesParams = validateListSpacesParams;
|
|
1467
1514
|
exports.validateListUsers200Response = validateListUsers200Response;
|
|
1515
|
+
exports.validateListUsersParams = validateListUsersParams;
|
|
1468
1516
|
exports.validateListWorkflowTemplates200Response = validateListWorkflowTemplates200Response;
|
|
1469
1517
|
exports.validateListWorkflowTemplatesParams = validateListWorkflowTemplatesParams;
|
|
1470
1518
|
exports.validateListWorkflows200Response = validateListWorkflows200Response;
|
|
@@ -1479,6 +1527,7 @@ exports.validateRefreshTokenRequest = validateRefreshTokenRequest;
|
|
|
1479
1527
|
exports.validateRemoveGroupEntitiesRequest = validateRemoveGroupEntitiesRequest;
|
|
1480
1528
|
exports.validateRoleAssignmentRequest = validateRoleAssignmentRequest;
|
|
1481
1529
|
exports.validateRoleRemovalRequest = validateRoleRemovalRequest;
|
|
1530
|
+
exports.validateSharedListParams = validateSharedListParams;
|
|
1482
1531
|
exports.validateSpaceCreate = validateSpaceCreate;
|
|
1483
1532
|
exports.validateSpaceScope = validateSpaceScope;
|
|
1484
1533
|
exports.validateTokenRequest = validateTokenRequest;
|