@approvio/api 0.0.41 → 0.0.43

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 UserSummary, f as ListGroups200Response, h as GroupInfo, i as ListWorkflows200Response, m as Group, n as User, p as Pagination, r as TokenResponse, t as WorkflowCreate } from "../workflow-create-CSCUMfYW.cjs";
1
+ import { a as Workflow, d as UserSummary, f as ListGroups200Response, h as GroupInfo, i as ListWorkflows200Response, m as Group, n as User, p as Pagination, r as TokenResponse, t as WorkflowCreate } from "../workflow-create-DJP5QYfz.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 UserSummary, f as ListGroups200Response, h as GroupInfo, i as ListWorkflows200Response, m as Group, n as User, p as Pagination, r as TokenResponse, t as WorkflowCreate } from "../workflow-create-DyEyaGqO.mjs";
1
+ import { a as Workflow, d as UserSummary, f as ListGroups200Response, h as GroupInfo, i as ListWorkflows200Response, m as Group, n as User, p as Pagination, r as TokenResponse, t as WorkflowCreate } from "../workflow-create-uX4n87mS.mjs";
2
2
 
3
3
  //#region mocks/user.fixtures.d.ts
4
4
  declare const MOCK_USER_ID = "e6e08687-2189-4710-91b5-479cd25a9119";
@@ -45,6 +45,69 @@ let EmailAction;
45
45
  _EmailAction.TypeEnum = { Email: "EMAIL" };
46
46
  })(EmailAction || (EmailAction = {}));
47
47
  //#endregion
48
+ //#region generated/openapi/model/global-quota.ts
49
+ let GlobalQuota;
50
+ (function(_GlobalQuota) {
51
+ _GlobalQuota.QuotaTypeEnum = {
52
+ MaxGroups: "MAX_GROUPS",
53
+ MaxSpaces: "MAX_SPACES",
54
+ MaxRolesPerUser: "MAX_ROLES_PER_USER",
55
+ MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP",
56
+ MaxTemplates: "MAX_TEMPLATES",
57
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS"
58
+ };
59
+ _GlobalQuota.ScopeEnum = { Global: "GLOBAL" };
60
+ })(GlobalQuota || (GlobalQuota = {}));
61
+ //#endregion
62
+ //#region generated/openapi/model/global-quota-base.ts
63
+ let GlobalQuotaBase;
64
+ (function(_GlobalQuotaBase) {
65
+ _GlobalQuotaBase.ScopeEnum = { Global: "GLOBAL" };
66
+ _GlobalQuotaBase.QuotaTypeEnum = {
67
+ MaxGroups: "MAX_GROUPS",
68
+ MaxSpaces: "MAX_SPACES",
69
+ MaxRolesPerUser: "MAX_ROLES_PER_USER",
70
+ MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP",
71
+ MaxTemplates: "MAX_TEMPLATES",
72
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS"
73
+ };
74
+ })(GlobalQuotaBase || (GlobalQuotaBase = {}));
75
+ //#endregion
76
+ //#region generated/openapi/model/global-quota-create.ts
77
+ let GlobalQuotaCreate;
78
+ (function(_GlobalQuotaCreate) {
79
+ _GlobalQuotaCreate.QuotaTypeEnum = {
80
+ MaxGroups: "MAX_GROUPS",
81
+ MaxSpaces: "MAX_SPACES",
82
+ MaxRolesPerUser: "MAX_ROLES_PER_USER",
83
+ MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP",
84
+ MaxTemplates: "MAX_TEMPLATES",
85
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS"
86
+ };
87
+ _GlobalQuotaCreate.ScopeEnum = { Global: "GLOBAL" };
88
+ })(GlobalQuotaCreate || (GlobalQuotaCreate = {}));
89
+ //#endregion
90
+ //#region generated/openapi/model/group-quota.ts
91
+ let GroupQuota;
92
+ (function(_GroupQuota) {
93
+ _GroupQuota.QuotaTypeEnum = { MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP" };
94
+ _GroupQuota.ScopeEnum = { Group: "GROUP" };
95
+ })(GroupQuota || (GroupQuota = {}));
96
+ //#endregion
97
+ //#region generated/openapi/model/group-quota-base.ts
98
+ let GroupQuotaBase;
99
+ (function(_GroupQuotaBase) {
100
+ _GroupQuotaBase.ScopeEnum = { Group: "GROUP" };
101
+ _GroupQuotaBase.QuotaTypeEnum = { MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP" };
102
+ })(GroupQuotaBase || (GroupQuotaBase = {}));
103
+ //#endregion
104
+ //#region generated/openapi/model/group-quota-create.ts
105
+ let GroupQuotaCreate;
106
+ (function(_GroupQuotaCreate) {
107
+ _GroupQuotaCreate.QuotaTypeEnum = { MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP" };
108
+ _GroupQuotaCreate.ScopeEnum = { Group: "GROUP" };
109
+ })(GroupQuotaCreate || (GroupQuotaCreate = {}));
110
+ //#endregion
48
111
  //#region generated/openapi/model/group-requirement-rule.ts
49
112
  let GroupRequirementRule;
50
113
  (function(_GroupRequirementRule) {
@@ -89,12 +152,81 @@ let OrgScope;
89
152
  _OrgScope.TypeEnum = { Org: "org" };
90
153
  })(OrgScope || (OrgScope = {}));
91
154
  //#endregion
155
+ //#region generated/openapi/model/quota-scope.ts
156
+ const QuotaScope = {
157
+ Global: "GLOBAL",
158
+ Space: "SPACE",
159
+ Group: "GROUP",
160
+ Template: "TEMPLATE"
161
+ };
162
+ //#endregion
163
+ //#region generated/openapi/model/quota-type.ts
164
+ const QuotaType = {
165
+ MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP",
166
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS",
167
+ MaxRolesPerUser: "MAX_ROLES_PER_USER",
168
+ MaxGroups: "MAX_GROUPS",
169
+ MaxSpaces: "MAX_SPACES",
170
+ MaxTemplates: "MAX_TEMPLATES"
171
+ };
172
+ //#endregion
173
+ //#region generated/openapi/model/space-quota.ts
174
+ let SpaceQuota;
175
+ (function(_SpaceQuota) {
176
+ _SpaceQuota.QuotaTypeEnum = {
177
+ MaxTemplates: "MAX_TEMPLATES",
178
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS"
179
+ };
180
+ _SpaceQuota.ScopeEnum = { Space: "SPACE" };
181
+ })(SpaceQuota || (SpaceQuota = {}));
182
+ //#endregion
183
+ //#region generated/openapi/model/space-quota-base.ts
184
+ let SpaceQuotaBase;
185
+ (function(_SpaceQuotaBase) {
186
+ _SpaceQuotaBase.ScopeEnum = { Space: "SPACE" };
187
+ _SpaceQuotaBase.QuotaTypeEnum = {
188
+ MaxTemplates: "MAX_TEMPLATES",
189
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS"
190
+ };
191
+ })(SpaceQuotaBase || (SpaceQuotaBase = {}));
192
+ //#endregion
193
+ //#region generated/openapi/model/space-quota-create.ts
194
+ let SpaceQuotaCreate;
195
+ (function(_SpaceQuotaCreate) {
196
+ _SpaceQuotaCreate.QuotaTypeEnum = {
197
+ MaxTemplates: "MAX_TEMPLATES",
198
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS"
199
+ };
200
+ _SpaceQuotaCreate.ScopeEnum = { Space: "SPACE" };
201
+ })(SpaceQuotaCreate || (SpaceQuotaCreate = {}));
202
+ //#endregion
92
203
  //#region generated/openapi/model/space-scope.ts
93
204
  let SpaceScope;
94
205
  (function(_SpaceScope) {
95
206
  _SpaceScope.TypeEnum = { Space: "space" };
96
207
  })(SpaceScope || (SpaceScope = {}));
97
208
  //#endregion
209
+ //#region generated/openapi/model/template-quota.ts
210
+ let TemplateQuota;
211
+ (function(_TemplateQuota) {
212
+ _TemplateQuota.QuotaTypeEnum = { MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS" };
213
+ _TemplateQuota.ScopeEnum = { Template: "TEMPLATE" };
214
+ })(TemplateQuota || (TemplateQuota = {}));
215
+ //#endregion
216
+ //#region generated/openapi/model/template-quota-base.ts
217
+ let TemplateQuotaBase;
218
+ (function(_TemplateQuotaBase) {
219
+ _TemplateQuotaBase.ScopeEnum = { Template: "TEMPLATE" };
220
+ _TemplateQuotaBase.QuotaTypeEnum = { MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS" };
221
+ })(TemplateQuotaBase || (TemplateQuotaBase = {}));
222
+ //#endregion
223
+ //#region generated/openapi/model/template-quota-create.ts
224
+ let TemplateQuotaCreate;
225
+ (function(_TemplateQuotaCreate) {
226
+ _TemplateQuotaCreate.QuotaTypeEnum = { MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS" };
227
+ _TemplateQuotaCreate.ScopeEnum = { Template: "TEMPLATE" };
228
+ })(TemplateQuotaCreate || (TemplateQuotaCreate = {}));
229
+ //#endregion
98
230
  //#region generated/openapi/model/vote-approve.ts
99
231
  let VoteApprove;
100
232
  (function(_VoteApprove) {
@@ -1565,6 +1697,71 @@ function isAPIError(object) {
1565
1697
  return fp_ts_Either.isRight(validateAPIError(object));
1566
1698
  }
1567
1699
  //#endregion
1700
+ //#region src/validators/quota.validator.ts
1701
+ function validateQuotaCreate(object) {
1702
+ if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
1703
+ if (!hasOwnProperty(object, "limit")) return (0, fp_ts_Either.left)("missing_limit");
1704
+ if (!isNumber(object.limit) || !Number.isInteger(object.limit) || object.limit < 0) return (0, fp_ts_Either.left)("invalid_limit");
1705
+ if (!hasOwnProperty(object, "scope")) return (0, fp_ts_Either.left)("missing_scope");
1706
+ if (!isNonEmptyString(object.scope)) return (0, fp_ts_Either.left)("invalid_scope");
1707
+ if (!hasOwnProperty(object, "quotaType")) return (0, fp_ts_Either.left)("missing_quotaType");
1708
+ if (!isNonEmptyString(object.quotaType)) return (0, fp_ts_Either.left)("invalid_quotaType");
1709
+ const limit = object.limit;
1710
+ const scopeStr = object.scope;
1711
+ if (typeof scopeStr !== "string") return (0, fp_ts_Either.left)("invalid_scope");
1712
+ const scope = getStringAsEnum(scopeStr, QuotaScope);
1713
+ if (!scope) return (0, fp_ts_Either.left)("invalid_scope");
1714
+ const quotaTypeStr = object.quotaType;
1715
+ if (typeof quotaTypeStr !== "string") return (0, fp_ts_Either.left)("invalid_quotaType");
1716
+ const quotaType = getStringAsEnum(quotaTypeStr, QuotaType);
1717
+ if (!quotaType) return (0, fp_ts_Either.left)("invalid_quotaType");
1718
+ if (scope === "GLOBAL") {
1719
+ if (quotaType !== "MAX_GROUPS" && quotaType !== "MAX_SPACES" && quotaType !== "MAX_ROLES_PER_USER" && quotaType !== "MAX_ENTITIES_PER_GROUP" && quotaType !== "MAX_TEMPLATES" && quotaType !== "MAX_CONCURRENT_WORKFLOWS") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1720
+ if (hasOwnProperty(object, "targetId") && object.targetId !== void 0) return (0, fp_ts_Either.left)("invalid_scope_targetId_combination");
1721
+ return (0, fp_ts_Either.right)({
1722
+ limit,
1723
+ scope,
1724
+ quotaType
1725
+ });
1726
+ }
1727
+ if (!hasOwnProperty(object, "targetId")) return (0, fp_ts_Either.left)("missing_targetId");
1728
+ if (!isNonEmptyString(object.targetId) || !isUUIDv4(object.targetId)) return (0, fp_ts_Either.left)("invalid_targetId");
1729
+ if (scope === "GROUP") {
1730
+ if (quotaType !== "MAX_ENTITIES_PER_GROUP") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1731
+ return (0, fp_ts_Either.right)({
1732
+ limit,
1733
+ scope,
1734
+ quotaType,
1735
+ targetId: object.targetId
1736
+ });
1737
+ }
1738
+ if (scope === "TEMPLATE") {
1739
+ if (quotaType !== "MAX_CONCURRENT_WORKFLOWS") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1740
+ return (0, fp_ts_Either.right)({
1741
+ limit,
1742
+ scope,
1743
+ quotaType,
1744
+ targetId: object.targetId
1745
+ });
1746
+ }
1747
+ if (scope === "SPACE") {
1748
+ if (quotaType !== "MAX_TEMPLATES" && quotaType !== "MAX_CONCURRENT_WORKFLOWS") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1749
+ return (0, fp_ts_Either.right)({
1750
+ limit,
1751
+ scope,
1752
+ quotaType,
1753
+ targetId: object.targetId
1754
+ });
1755
+ }
1756
+ return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1757
+ }
1758
+ function validateQuotaUpdate(object) {
1759
+ if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
1760
+ if (!hasOwnProperty(object, "limit") || object.limit === void 0) return (0, fp_ts_Either.right)({});
1761
+ if (!isNumber(object.limit) || !Number.isInteger(object.limit) || object.limit < 0) return (0, fp_ts_Either.left)("invalid_limit");
1762
+ return (0, fp_ts_Either.right)({ limit: object.limit });
1763
+ }
1764
+ //#endregion
1568
1765
  Object.defineProperty(exports, "AgentTokenRequest", {
1569
1766
  enumerable: true,
1570
1767
  get: function() {
@@ -1583,6 +1780,42 @@ Object.defineProperty(exports, "EmailAction", {
1583
1780
  return EmailAction;
1584
1781
  }
1585
1782
  });
1783
+ Object.defineProperty(exports, "GlobalQuota", {
1784
+ enumerable: true,
1785
+ get: function() {
1786
+ return GlobalQuota;
1787
+ }
1788
+ });
1789
+ Object.defineProperty(exports, "GlobalQuotaBase", {
1790
+ enumerable: true,
1791
+ get: function() {
1792
+ return GlobalQuotaBase;
1793
+ }
1794
+ });
1795
+ Object.defineProperty(exports, "GlobalQuotaCreate", {
1796
+ enumerable: true,
1797
+ get: function() {
1798
+ return GlobalQuotaCreate;
1799
+ }
1800
+ });
1801
+ Object.defineProperty(exports, "GroupQuota", {
1802
+ enumerable: true,
1803
+ get: function() {
1804
+ return GroupQuota;
1805
+ }
1806
+ });
1807
+ Object.defineProperty(exports, "GroupQuotaBase", {
1808
+ enumerable: true,
1809
+ get: function() {
1810
+ return GroupQuotaBase;
1811
+ }
1812
+ });
1813
+ Object.defineProperty(exports, "GroupQuotaCreate", {
1814
+ enumerable: true,
1815
+ get: function() {
1816
+ return GroupQuotaCreate;
1817
+ }
1818
+ });
1586
1819
  Object.defineProperty(exports, "GroupRequirementRule", {
1587
1820
  enumerable: true,
1588
1821
  get: function() {
@@ -1619,14 +1852,52 @@ Object.defineProperty(exports, "OrgScope", {
1619
1852
  return OrgScope;
1620
1853
  }
1621
1854
  });
1855
+ exports.QuotaScope = QuotaScope;
1856
+ exports.QuotaType = QuotaType;
1622
1857
  exports.SortBy = SortBy;
1623
1858
  exports.SortDirection = SortDirection;
1859
+ Object.defineProperty(exports, "SpaceQuota", {
1860
+ enumerable: true,
1861
+ get: function() {
1862
+ return SpaceQuota;
1863
+ }
1864
+ });
1865
+ Object.defineProperty(exports, "SpaceQuotaBase", {
1866
+ enumerable: true,
1867
+ get: function() {
1868
+ return SpaceQuotaBase;
1869
+ }
1870
+ });
1871
+ Object.defineProperty(exports, "SpaceQuotaCreate", {
1872
+ enumerable: true,
1873
+ get: function() {
1874
+ return SpaceQuotaCreate;
1875
+ }
1876
+ });
1624
1877
  Object.defineProperty(exports, "SpaceScope", {
1625
1878
  enumerable: true,
1626
1879
  get: function() {
1627
1880
  return SpaceScope;
1628
1881
  }
1629
1882
  });
1883
+ Object.defineProperty(exports, "TemplateQuota", {
1884
+ enumerable: true,
1885
+ get: function() {
1886
+ return TemplateQuota;
1887
+ }
1888
+ });
1889
+ Object.defineProperty(exports, "TemplateQuotaBase", {
1890
+ enumerable: true,
1891
+ get: function() {
1892
+ return TemplateQuotaBase;
1893
+ }
1894
+ });
1895
+ Object.defineProperty(exports, "TemplateQuotaCreate", {
1896
+ enumerable: true,
1897
+ get: function() {
1898
+ return TemplateQuotaCreate;
1899
+ }
1900
+ });
1630
1901
  Object.defineProperty(exports, "VoteApprove", {
1631
1902
  enumerable: true,
1632
1903
  get: function() {
@@ -1701,6 +1972,8 @@ exports.validateOrganizationAdminRemove = validateOrganizationAdminRemove;
1701
1972
  exports.validatePagination = validatePagination;
1702
1973
  exports.validatePrivilegedTokenExchangeRequest = validatePrivilegedTokenExchangeRequest;
1703
1974
  exports.validatePrivilegedTokenResponse = validatePrivilegedTokenResponse;
1975
+ exports.validateQuotaCreate = validateQuotaCreate;
1976
+ exports.validateQuotaUpdate = validateQuotaUpdate;
1704
1977
  exports.validateRefreshTokenRequest = validateRefreshTokenRequest;
1705
1978
  exports.validateRemoveGroupEntitiesRequest = validateRemoveGroupEntitiesRequest;
1706
1979
  exports.validateRoleAssignmentRequest = validateRoleAssignmentRequest;