@approvio/api 0.0.41 → 0.0.42

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-COE72Khd.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-D4c1cIa_.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,57 @@ 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
+ };
55
+ _GlobalQuota.ScopeEnum = { Global: "GLOBAL" };
56
+ })(GlobalQuota || (GlobalQuota = {}));
57
+ //#endregion
58
+ //#region generated/openapi/model/global-quota-base.ts
59
+ let GlobalQuotaBase;
60
+ (function(_GlobalQuotaBase) {
61
+ _GlobalQuotaBase.ScopeEnum = { Global: "GLOBAL" };
62
+ _GlobalQuotaBase.QuotaTypeEnum = {
63
+ MaxGroups: "MAX_GROUPS",
64
+ MaxSpaces: "MAX_SPACES"
65
+ };
66
+ })(GlobalQuotaBase || (GlobalQuotaBase = {}));
67
+ //#endregion
68
+ //#region generated/openapi/model/global-quota-create.ts
69
+ let GlobalQuotaCreate;
70
+ (function(_GlobalQuotaCreate) {
71
+ _GlobalQuotaCreate.QuotaTypeEnum = {
72
+ MaxGroups: "MAX_GROUPS",
73
+ MaxSpaces: "MAX_SPACES"
74
+ };
75
+ _GlobalQuotaCreate.ScopeEnum = { Global: "GLOBAL" };
76
+ })(GlobalQuotaCreate || (GlobalQuotaCreate = {}));
77
+ //#endregion
78
+ //#region generated/openapi/model/group-quota.ts
79
+ let GroupQuota;
80
+ (function(_GroupQuota) {
81
+ _GroupQuota.QuotaTypeEnum = { MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP" };
82
+ _GroupQuota.ScopeEnum = { Group: "GROUP" };
83
+ })(GroupQuota || (GroupQuota = {}));
84
+ //#endregion
85
+ //#region generated/openapi/model/group-quota-base.ts
86
+ let GroupQuotaBase;
87
+ (function(_GroupQuotaBase) {
88
+ _GroupQuotaBase.ScopeEnum = { Group: "GROUP" };
89
+ _GroupQuotaBase.QuotaTypeEnum = { MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP" };
90
+ })(GroupQuotaBase || (GroupQuotaBase = {}));
91
+ //#endregion
92
+ //#region generated/openapi/model/group-quota-create.ts
93
+ let GroupQuotaCreate;
94
+ (function(_GroupQuotaCreate) {
95
+ _GroupQuotaCreate.QuotaTypeEnum = { MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP" };
96
+ _GroupQuotaCreate.ScopeEnum = { Group: "GROUP" };
97
+ })(GroupQuotaCreate || (GroupQuotaCreate = {}));
98
+ //#endregion
48
99
  //#region generated/openapi/model/group-requirement-rule.ts
49
100
  let GroupRequirementRule;
50
101
  (function(_GroupRequirementRule) {
@@ -89,12 +140,94 @@ let OrgScope;
89
140
  _OrgScope.TypeEnum = { Org: "org" };
90
141
  })(OrgScope || (OrgScope = {}));
91
142
  //#endregion
143
+ //#region generated/openapi/model/quota-scope.ts
144
+ const QuotaScope = {
145
+ Global: "GLOBAL",
146
+ Space: "SPACE",
147
+ User: "USER",
148
+ Group: "GROUP",
149
+ Template: "TEMPLATE"
150
+ };
151
+ //#endregion
152
+ //#region generated/openapi/model/quota-type.ts
153
+ const QuotaType = {
154
+ MaxEntitiesPerGroup: "MAX_ENTITIES_PER_GROUP",
155
+ MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS",
156
+ MaxRolesPerUser: "MAX_ROLES_PER_USER",
157
+ MaxGroups: "MAX_GROUPS",
158
+ MaxSpaces: "MAX_SPACES",
159
+ MaxTemplates: "MAX_TEMPLATES"
160
+ };
161
+ //#endregion
162
+ //#region generated/openapi/model/space-quota.ts
163
+ let SpaceQuota;
164
+ (function(_SpaceQuota) {
165
+ _SpaceQuota.QuotaTypeEnum = { MaxTemplates: "MAX_TEMPLATES" };
166
+ _SpaceQuota.ScopeEnum = { Space: "SPACE" };
167
+ })(SpaceQuota || (SpaceQuota = {}));
168
+ //#endregion
169
+ //#region generated/openapi/model/space-quota-base.ts
170
+ let SpaceQuotaBase;
171
+ (function(_SpaceQuotaBase) {
172
+ _SpaceQuotaBase.ScopeEnum = { Space: "SPACE" };
173
+ _SpaceQuotaBase.QuotaTypeEnum = { MaxTemplates: "MAX_TEMPLATES" };
174
+ })(SpaceQuotaBase || (SpaceQuotaBase = {}));
175
+ //#endregion
176
+ //#region generated/openapi/model/space-quota-create.ts
177
+ let SpaceQuotaCreate;
178
+ (function(_SpaceQuotaCreate) {
179
+ _SpaceQuotaCreate.QuotaTypeEnum = { MaxTemplates: "MAX_TEMPLATES" };
180
+ _SpaceQuotaCreate.ScopeEnum = { Space: "SPACE" };
181
+ })(SpaceQuotaCreate || (SpaceQuotaCreate = {}));
182
+ //#endregion
92
183
  //#region generated/openapi/model/space-scope.ts
93
184
  let SpaceScope;
94
185
  (function(_SpaceScope) {
95
186
  _SpaceScope.TypeEnum = { Space: "space" };
96
187
  })(SpaceScope || (SpaceScope = {}));
97
188
  //#endregion
189
+ //#region generated/openapi/model/template-quota.ts
190
+ let TemplateQuota;
191
+ (function(_TemplateQuota) {
192
+ _TemplateQuota.QuotaTypeEnum = { MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS" };
193
+ _TemplateQuota.ScopeEnum = { Template: "TEMPLATE" };
194
+ })(TemplateQuota || (TemplateQuota = {}));
195
+ //#endregion
196
+ //#region generated/openapi/model/template-quota-base.ts
197
+ let TemplateQuotaBase;
198
+ (function(_TemplateQuotaBase) {
199
+ _TemplateQuotaBase.ScopeEnum = { Template: "TEMPLATE" };
200
+ _TemplateQuotaBase.QuotaTypeEnum = { MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS" };
201
+ })(TemplateQuotaBase || (TemplateQuotaBase = {}));
202
+ //#endregion
203
+ //#region generated/openapi/model/template-quota-create.ts
204
+ let TemplateQuotaCreate;
205
+ (function(_TemplateQuotaCreate) {
206
+ _TemplateQuotaCreate.QuotaTypeEnum = { MaxConcurrentWorkflows: "MAX_CONCURRENT_WORKFLOWS" };
207
+ _TemplateQuotaCreate.ScopeEnum = { Template: "TEMPLATE" };
208
+ })(TemplateQuotaCreate || (TemplateQuotaCreate = {}));
209
+ //#endregion
210
+ //#region generated/openapi/model/user-quota.ts
211
+ let UserQuota;
212
+ (function(_UserQuota) {
213
+ _UserQuota.QuotaTypeEnum = { MaxRolesPerUser: "MAX_ROLES_PER_USER" };
214
+ _UserQuota.ScopeEnum = { User: "USER" };
215
+ })(UserQuota || (UserQuota = {}));
216
+ //#endregion
217
+ //#region generated/openapi/model/user-quota-base.ts
218
+ let UserQuotaBase;
219
+ (function(_UserQuotaBase) {
220
+ _UserQuotaBase.ScopeEnum = { User: "USER" };
221
+ _UserQuotaBase.QuotaTypeEnum = { MaxRolesPerUser: "MAX_ROLES_PER_USER" };
222
+ })(UserQuotaBase || (UserQuotaBase = {}));
223
+ //#endregion
224
+ //#region generated/openapi/model/user-quota-create.ts
225
+ let UserQuotaCreate;
226
+ (function(_UserQuotaCreate) {
227
+ _UserQuotaCreate.QuotaTypeEnum = { MaxRolesPerUser: "MAX_ROLES_PER_USER" };
228
+ _UserQuotaCreate.ScopeEnum = { User: "USER" };
229
+ })(UserQuotaCreate || (UserQuotaCreate = {}));
230
+ //#endregion
98
231
  //#region generated/openapi/model/vote-approve.ts
99
232
  let VoteApprove;
100
233
  (function(_VoteApprove) {
@@ -1565,6 +1698,80 @@ function isAPIError(object) {
1565
1698
  return fp_ts_Either.isRight(validateAPIError(object));
1566
1699
  }
1567
1700
  //#endregion
1701
+ //#region src/validators/quota.validator.ts
1702
+ function validateQuotaCreate(object) {
1703
+ if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
1704
+ if (!hasOwnProperty(object, "limit")) return (0, fp_ts_Either.left)("missing_limit");
1705
+ if (!isNumber(object.limit) || !Number.isInteger(object.limit) || object.limit < 0) return (0, fp_ts_Either.left)("invalid_limit");
1706
+ if (!hasOwnProperty(object, "scope")) return (0, fp_ts_Either.left)("missing_scope");
1707
+ if (!isNonEmptyString(object.scope)) return (0, fp_ts_Either.left)("invalid_scope");
1708
+ if (!hasOwnProperty(object, "quotaType")) return (0, fp_ts_Either.left)("missing_quotaType");
1709
+ if (!isNonEmptyString(object.quotaType)) return (0, fp_ts_Either.left)("invalid_quotaType");
1710
+ const limit = object.limit;
1711
+ const scopeStr = object.scope;
1712
+ if (typeof scopeStr !== "string") return (0, fp_ts_Either.left)("invalid_scope");
1713
+ const scope = getStringAsEnum(scopeStr, QuotaScope);
1714
+ if (!scope) return (0, fp_ts_Either.left)("invalid_scope");
1715
+ const quotaTypeStr = object.quotaType;
1716
+ if (typeof quotaTypeStr !== "string") return (0, fp_ts_Either.left)("invalid_quotaType");
1717
+ const quotaType = getStringAsEnum(quotaTypeStr, QuotaType);
1718
+ if (!quotaType) return (0, fp_ts_Either.left)("invalid_quotaType");
1719
+ if (scope === "GLOBAL") {
1720
+ if (quotaType !== "MAX_GROUPS" && quotaType !== "MAX_SPACES") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1721
+ if (hasOwnProperty(object, "targetId") && object.targetId !== void 0) return (0, fp_ts_Either.left)("invalid_scope_targetId_combination");
1722
+ return (0, fp_ts_Either.right)({
1723
+ limit,
1724
+ scope,
1725
+ quotaType
1726
+ });
1727
+ }
1728
+ if (!hasOwnProperty(object, "targetId")) return (0, fp_ts_Either.left)("missing_targetId");
1729
+ if (!isNonEmptyString(object.targetId) || !isUUIDv4(object.targetId)) return (0, fp_ts_Either.left)("invalid_targetId");
1730
+ if (scope === "GROUP") {
1731
+ if (quotaType !== "MAX_ENTITIES_PER_GROUP") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1732
+ return (0, fp_ts_Either.right)({
1733
+ limit,
1734
+ scope,
1735
+ quotaType,
1736
+ targetId: object.targetId
1737
+ });
1738
+ }
1739
+ if (scope === "TEMPLATE") {
1740
+ if (quotaType !== "MAX_CONCURRENT_WORKFLOWS") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1741
+ return (0, fp_ts_Either.right)({
1742
+ limit,
1743
+ scope,
1744
+ quotaType,
1745
+ targetId: object.targetId
1746
+ });
1747
+ }
1748
+ if (scope === "USER") {
1749
+ if (quotaType !== "MAX_ROLES_PER_USER") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1750
+ return (0, fp_ts_Either.right)({
1751
+ limit,
1752
+ scope,
1753
+ quotaType,
1754
+ targetId: object.targetId
1755
+ });
1756
+ }
1757
+ if (scope === "SPACE") {
1758
+ if (quotaType !== "MAX_TEMPLATES") return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1759
+ return (0, fp_ts_Either.right)({
1760
+ limit,
1761
+ scope,
1762
+ quotaType,
1763
+ targetId: object.targetId
1764
+ });
1765
+ }
1766
+ return (0, fp_ts_Either.left)("invalid_scope_quotaType_combination");
1767
+ }
1768
+ function validateQuotaUpdate(object) {
1769
+ if (typeof object !== "object" || object === null) return (0, fp_ts_Either.left)("malformed_object");
1770
+ if (!hasOwnProperty(object, "limit") || object.limit === void 0) return (0, fp_ts_Either.right)({});
1771
+ if (!isNumber(object.limit) || !Number.isInteger(object.limit) || object.limit < 0) return (0, fp_ts_Either.left)("invalid_limit");
1772
+ return (0, fp_ts_Either.right)({ limit: object.limit });
1773
+ }
1774
+ //#endregion
1568
1775
  Object.defineProperty(exports, "AgentTokenRequest", {
1569
1776
  enumerable: true,
1570
1777
  get: function() {
@@ -1583,6 +1790,42 @@ Object.defineProperty(exports, "EmailAction", {
1583
1790
  return EmailAction;
1584
1791
  }
1585
1792
  });
1793
+ Object.defineProperty(exports, "GlobalQuota", {
1794
+ enumerable: true,
1795
+ get: function() {
1796
+ return GlobalQuota;
1797
+ }
1798
+ });
1799
+ Object.defineProperty(exports, "GlobalQuotaBase", {
1800
+ enumerable: true,
1801
+ get: function() {
1802
+ return GlobalQuotaBase;
1803
+ }
1804
+ });
1805
+ Object.defineProperty(exports, "GlobalQuotaCreate", {
1806
+ enumerable: true,
1807
+ get: function() {
1808
+ return GlobalQuotaCreate;
1809
+ }
1810
+ });
1811
+ Object.defineProperty(exports, "GroupQuota", {
1812
+ enumerable: true,
1813
+ get: function() {
1814
+ return GroupQuota;
1815
+ }
1816
+ });
1817
+ Object.defineProperty(exports, "GroupQuotaBase", {
1818
+ enumerable: true,
1819
+ get: function() {
1820
+ return GroupQuotaBase;
1821
+ }
1822
+ });
1823
+ Object.defineProperty(exports, "GroupQuotaCreate", {
1824
+ enumerable: true,
1825
+ get: function() {
1826
+ return GroupQuotaCreate;
1827
+ }
1828
+ });
1586
1829
  Object.defineProperty(exports, "GroupRequirementRule", {
1587
1830
  enumerable: true,
1588
1831
  get: function() {
@@ -1619,14 +1862,70 @@ Object.defineProperty(exports, "OrgScope", {
1619
1862
  return OrgScope;
1620
1863
  }
1621
1864
  });
1865
+ exports.QuotaScope = QuotaScope;
1866
+ exports.QuotaType = QuotaType;
1622
1867
  exports.SortBy = SortBy;
1623
1868
  exports.SortDirection = SortDirection;
1869
+ Object.defineProperty(exports, "SpaceQuota", {
1870
+ enumerable: true,
1871
+ get: function() {
1872
+ return SpaceQuota;
1873
+ }
1874
+ });
1875
+ Object.defineProperty(exports, "SpaceQuotaBase", {
1876
+ enumerable: true,
1877
+ get: function() {
1878
+ return SpaceQuotaBase;
1879
+ }
1880
+ });
1881
+ Object.defineProperty(exports, "SpaceQuotaCreate", {
1882
+ enumerable: true,
1883
+ get: function() {
1884
+ return SpaceQuotaCreate;
1885
+ }
1886
+ });
1624
1887
  Object.defineProperty(exports, "SpaceScope", {
1625
1888
  enumerable: true,
1626
1889
  get: function() {
1627
1890
  return SpaceScope;
1628
1891
  }
1629
1892
  });
1893
+ Object.defineProperty(exports, "TemplateQuota", {
1894
+ enumerable: true,
1895
+ get: function() {
1896
+ return TemplateQuota;
1897
+ }
1898
+ });
1899
+ Object.defineProperty(exports, "TemplateQuotaBase", {
1900
+ enumerable: true,
1901
+ get: function() {
1902
+ return TemplateQuotaBase;
1903
+ }
1904
+ });
1905
+ Object.defineProperty(exports, "TemplateQuotaCreate", {
1906
+ enumerable: true,
1907
+ get: function() {
1908
+ return TemplateQuotaCreate;
1909
+ }
1910
+ });
1911
+ Object.defineProperty(exports, "UserQuota", {
1912
+ enumerable: true,
1913
+ get: function() {
1914
+ return UserQuota;
1915
+ }
1916
+ });
1917
+ Object.defineProperty(exports, "UserQuotaBase", {
1918
+ enumerable: true,
1919
+ get: function() {
1920
+ return UserQuotaBase;
1921
+ }
1922
+ });
1923
+ Object.defineProperty(exports, "UserQuotaCreate", {
1924
+ enumerable: true,
1925
+ get: function() {
1926
+ return UserQuotaCreate;
1927
+ }
1928
+ });
1630
1929
  Object.defineProperty(exports, "VoteApprove", {
1631
1930
  enumerable: true,
1632
1931
  get: function() {
@@ -1701,6 +2000,8 @@ exports.validateOrganizationAdminRemove = validateOrganizationAdminRemove;
1701
2000
  exports.validatePagination = validatePagination;
1702
2001
  exports.validatePrivilegedTokenExchangeRequest = validatePrivilegedTokenExchangeRequest;
1703
2002
  exports.validatePrivilegedTokenResponse = validatePrivilegedTokenResponse;
2003
+ exports.validateQuotaCreate = validateQuotaCreate;
2004
+ exports.validateQuotaUpdate = validateQuotaUpdate;
1704
2005
  exports.validateRefreshTokenRequest = validateRefreshTokenRequest;
1705
2006
  exports.validateRemoveGroupEntitiesRequest = validateRemoveGroupEntitiesRequest;
1706
2007
  exports.validateRoleAssignmentRequest = validateRoleAssignmentRequest;