unleash-server 4.14.2 → 4.14.3

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.
Files changed (256) hide show
  1. package/dist/lib/db/event-store.d.ts +2 -3
  2. package/dist/lib/db/event-store.js +26 -36
  3. package/dist/lib/db/event-store.js.map +1 -1
  4. package/dist/lib/db/event-store.test.js +1 -1
  5. package/dist/lib/db/event-store.test.js.map +1 -1
  6. package/dist/lib/db/feature-strategy-store.js +3 -3
  7. package/dist/lib/db/feature-strategy-store.js.map +1 -1
  8. package/dist/lib/db/feature-toggle-client-store.d.ts +1 -1
  9. package/dist/lib/db/feature-toggle-client-store.js +6 -6
  10. package/dist/lib/db/feature-toggle-client-store.js.map +1 -1
  11. package/dist/lib/db/group-store.d.ts +0 -1
  12. package/dist/lib/db/group-store.js +1 -14
  13. package/dist/lib/db/group-store.js.map +1 -1
  14. package/dist/lib/db/user-store.js +8 -1
  15. package/dist/lib/db/user-store.js.map +1 -1
  16. package/dist/lib/openapi/index.d.ts +2388 -952
  17. package/dist/lib/openapi/index.js +8 -4
  18. package/dist/lib/openapi/index.js.map +1 -1
  19. package/dist/lib/openapi/spec/client-feature-schema.d.ts +72 -7
  20. package/dist/lib/openapi/spec/client-feature-schema.js +5 -3
  21. package/dist/lib/openapi/spec/client-feature-schema.js.map +1 -1
  22. package/dist/lib/openapi/spec/client-features-schema.d.ts +138 -16
  23. package/dist/lib/openapi/spec/client-features-schema.js +2 -2
  24. package/dist/lib/openapi/spec/client-features-schema.js.map +1 -1
  25. package/dist/lib/openapi/spec/client-features-schema.test.js +10 -0
  26. package/dist/lib/openapi/spec/client-features-schema.test.js.map +1 -1
  27. package/dist/lib/openapi/spec/constraint-schema.d.ts +51 -2
  28. package/dist/lib/openapi/spec/constraint-schema.js +17 -4
  29. package/dist/lib/openapi/spec/constraint-schema.js.map +1 -1
  30. package/dist/lib/openapi/spec/context-field-schema.test.js +5 -1
  31. package/dist/lib/openapi/spec/context-field-schema.test.js.map +1 -1
  32. package/dist/lib/openapi/spec/create-feature-strategy-schema.d.ts +12 -2
  33. package/dist/lib/openapi/spec/feature-environment-schema.d.ts +12 -2
  34. package/dist/lib/openapi/spec/feature-events-schema.d.ts +1 -1
  35. package/dist/lib/openapi/spec/feature-events-schema.js +1 -1
  36. package/dist/lib/openapi/spec/feature-events-schema.js.map +1 -1
  37. package/dist/lib/openapi/spec/feature-schema.d.ts +25 -5
  38. package/dist/lib/openapi/spec/feature-schema.test.js +13 -1
  39. package/dist/lib/openapi/spec/feature-schema.test.js.map +1 -1
  40. package/dist/lib/openapi/spec/feature-strategy-schema.d.ts +12 -2
  41. package/dist/lib/openapi/spec/feature-variants-schema.d.ts +1 -1
  42. package/dist/lib/openapi/spec/features-schema.d.ts +50 -10
  43. package/dist/lib/openapi/spec/group-schema.d.ts +1 -4
  44. package/dist/lib/openapi/spec/group-user-model-schema.d.ts +1 -4
  45. package/dist/lib/openapi/spec/group-user-model-schema.js +1 -4
  46. package/dist/lib/openapi/spec/group-user-model-schema.js.map +1 -1
  47. package/dist/lib/openapi/spec/groups-schema.d.ts +2 -8
  48. package/dist/lib/openapi/spec/groups-schema.test.js +0 -1
  49. package/dist/lib/openapi/spec/groups-schema.test.js.map +1 -1
  50. package/dist/lib/openapi/spec/health-overview-schema.d.ts +50 -10
  51. package/dist/lib/openapi/spec/health-report-schema.d.ts +50 -10
  52. package/dist/lib/openapi/spec/playground-constraint-schema.d.ts +47 -0
  53. package/dist/lib/openapi/spec/playground-constraint-schema.js +18 -0
  54. package/dist/lib/openapi/spec/playground-constraint-schema.js.map +1 -0
  55. package/dist/lib/openapi/spec/playground-feature-schema.d.ts +388 -2
  56. package/dist/lib/openapi/spec/playground-feature-schema.js +95 -9
  57. package/dist/lib/openapi/spec/playground-feature-schema.js.map +1 -1
  58. package/dist/lib/openapi/spec/playground-feature-schema.test.js +64 -3
  59. package/dist/lib/openapi/spec/playground-feature-schema.test.js.map +1 -1
  60. package/dist/lib/openapi/spec/playground-request-schema.d.ts +2 -0
  61. package/dist/lib/openapi/spec/playground-request-schema.js +6 -1
  62. package/dist/lib/openapi/spec/playground-request-schema.js.map +1 -1
  63. package/dist/lib/openapi/spec/playground-response-schema.d.ts +774 -3
  64. package/dist/lib/openapi/spec/playground-response-schema.js +15 -1
  65. package/dist/lib/openapi/spec/playground-response-schema.js.map +1 -1
  66. package/dist/lib/openapi/spec/playground-segment-schema.d.ts +79 -0
  67. package/dist/lib/openapi/spec/playground-segment-schema.js +36 -0
  68. package/dist/lib/openapi/spec/playground-segment-schema.js.map +1 -0
  69. package/dist/lib/openapi/spec/playground-strategy-schema.d.ts +257 -0
  70. package/dist/lib/openapi/spec/playground-strategy-schema.js +102 -0
  71. package/dist/lib/openapi/spec/playground-strategy-schema.js.map +1 -0
  72. package/dist/lib/openapi/spec/{bootstrap-ui-schema.test.d.ts → project-schema.test.d.ts} +0 -0
  73. package/dist/lib/openapi/spec/project-schema.test.js +17 -0
  74. package/dist/lib/openapi/spec/project-schema.test.js.map +1 -0
  75. package/dist/lib/openapi/spec/search-events-schema.d.ts +37 -0
  76. package/dist/lib/openapi/spec/search-events-schema.js +47 -0
  77. package/dist/lib/openapi/spec/search-events-schema.js.map +1 -0
  78. package/dist/lib/openapi/spec/segment-schema.d.ts +12 -2
  79. package/dist/lib/openapi/spec/state-schema.d.ts +61 -11
  80. package/dist/lib/{routes/admin-api/bootstrap-ui.test.d.ts → openapi/spec/tag-types-schema.test.d.ts} +0 -0
  81. package/dist/lib/openapi/spec/tag-types-schema.test.js +23 -0
  82. package/dist/lib/openapi/spec/tag-types-schema.test.js.map +1 -0
  83. package/dist/lib/openapi/spec/ui-config-schema.d.ts +3 -0
  84. package/dist/lib/openapi/spec/ui-config-schema.js +3 -0
  85. package/dist/lib/openapi/spec/ui-config-schema.js.map +1 -1
  86. package/dist/lib/openapi/spec/update-feature-schema.d.ts +12 -2
  87. package/dist/lib/openapi/spec/update-feature-strategy-schema.d.ts +12 -2
  88. package/dist/{test/e2e/api/admin/bootstrap.test.d.ts → lib/openapi/spec/user-schema.test.d.ts} +0 -0
  89. package/dist/lib/openapi/spec/user-schema.test.js +17 -0
  90. package/dist/lib/openapi/spec/user-schema.test.js.map +1 -0
  91. package/dist/lib/openapi/spec/users-groups-base-schema.d.ts +2 -8
  92. package/dist/lib/openapi/spec/variant-schema.d.ts +1 -1
  93. package/dist/lib/openapi/spec/variant-schema.js +1 -1
  94. package/dist/lib/openapi/spec/variant-schema.js.map +1 -1
  95. package/dist/lib/openapi/spec/variants-schema.d.ts +1 -1
  96. package/dist/lib/openapi/util/standard-responses.d.ts +6 -0
  97. package/dist/lib/openapi/util/standard-responses.js +10 -2
  98. package/dist/lib/openapi/util/standard-responses.js.map +1 -1
  99. package/dist/lib/routes/admin-api/config.d.ts +2 -1
  100. package/dist/lib/routes/admin-api/config.js +3 -1
  101. package/dist/lib/routes/admin-api/config.js.map +1 -1
  102. package/dist/lib/routes/admin-api/event.d.ts +3 -1
  103. package/dist/lib/routes/admin-api/event.js +30 -7
  104. package/dist/lib/routes/admin-api/event.js.map +1 -1
  105. package/dist/lib/routes/admin-api/index.js +0 -2
  106. package/dist/lib/routes/admin-api/index.js.map +1 -1
  107. package/dist/lib/routes/admin-api/playground.js.map +1 -1
  108. package/dist/lib/services/event-service.d.ts +2 -2
  109. package/dist/lib/services/event-service.js +2 -5
  110. package/dist/lib/services/event-service.js.map +1 -1
  111. package/dist/lib/services/feature-toggle-service.d.ts +1 -1
  112. package/dist/lib/services/feature-toggle-service.js +2 -2
  113. package/dist/lib/services/feature-toggle-service.js.map +1 -1
  114. package/dist/lib/services/group-service.d.ts +1 -1
  115. package/dist/lib/services/group-service.js +1 -5
  116. package/dist/lib/services/group-service.js.map +1 -1
  117. package/dist/lib/services/index.js +1 -0
  118. package/dist/lib/services/index.js.map +1 -1
  119. package/dist/lib/services/openapi-service.js +1 -1
  120. package/dist/lib/services/openapi-service.js.map +1 -1
  121. package/dist/lib/services/playground-service.d.ts +2 -1
  122. package/dist/lib/services/playground-service.js +30 -11
  123. package/dist/lib/services/playground-service.js.map +1 -1
  124. package/dist/lib/types/group.d.ts +1 -2
  125. package/dist/lib/types/group.js.map +1 -1
  126. package/dist/lib/types/stores/event-store.d.ts +2 -3
  127. package/dist/lib/types/stores/feature-toggle-client-store.d.ts +1 -1
  128. package/dist/lib/types/stores/group-store.d.ts +0 -1
  129. package/dist/lib/util/feature-evaluator/client.d.ts +25 -0
  130. package/dist/lib/util/feature-evaluator/client.js +135 -0
  131. package/dist/lib/util/feature-evaluator/client.js.map +1 -0
  132. package/dist/lib/util/feature-evaluator/constraint.d.ts +28 -0
  133. package/dist/lib/util/feature-evaluator/constraint.js +129 -0
  134. package/dist/lib/util/feature-evaluator/constraint.js.map +1 -0
  135. package/dist/lib/util/feature-evaluator/context.d.ts +13 -0
  136. package/dist/lib/util/feature-evaluator/context.js +3 -0
  137. package/dist/lib/util/feature-evaluator/context.js.map +1 -0
  138. package/dist/lib/util/feature-evaluator/feature-evaluator.d.ts +36 -0
  139. package/dist/lib/util/feature-evaluator/feature-evaluator.js +55 -0
  140. package/dist/lib/util/feature-evaluator/feature-evaluator.js.map +1 -0
  141. package/dist/lib/util/feature-evaluator/feature.d.ts +19 -0
  142. package/dist/lib/util/feature-evaluator/feature.js +3 -0
  143. package/dist/lib/util/feature-evaluator/feature.js.map +1 -0
  144. package/dist/lib/util/feature-evaluator/helpers.d.ts +6 -0
  145. package/dist/lib/util/feature-evaluator/helpers.js +32 -0
  146. package/dist/lib/util/feature-evaluator/helpers.js.map +1 -0
  147. package/dist/lib/util/feature-evaluator/index.d.ts +8 -0
  148. package/dist/lib/util/feature-evaluator/index.js +14 -0
  149. package/dist/lib/util/feature-evaluator/index.js.map +1 -0
  150. package/dist/lib/util/feature-evaluator/repository/bootstrap-provider.d.ts +16 -0
  151. package/dist/lib/util/feature-evaluator/repository/bootstrap-provider.js +25 -0
  152. package/dist/lib/util/feature-evaluator/repository/bootstrap-provider.js.map +1 -0
  153. package/dist/lib/util/feature-evaluator/repository/index.d.ts +35 -0
  154. package/dist/lib/util/feature-evaluator/repository/index.js +63 -0
  155. package/dist/lib/util/feature-evaluator/repository/index.js.map +1 -0
  156. package/dist/lib/util/feature-evaluator/repository/storage-provider-in-mem.d.ts +6 -0
  157. package/dist/lib/util/feature-evaluator/repository/storage-provider-in-mem.js +16 -0
  158. package/dist/lib/util/feature-evaluator/repository/storage-provider-in-mem.js.map +1 -0
  159. package/dist/lib/util/feature-evaluator/repository/storage-provider.d.ts +14 -0
  160. package/dist/lib/util/feature-evaluator/repository/storage-provider.js +50 -0
  161. package/dist/lib/util/feature-evaluator/repository/storage-provider.js.map +1 -0
  162. package/dist/lib/util/feature-evaluator/strategy/application-hostname-strategy.d.ts +8 -0
  163. package/dist/lib/util/feature-evaluator/strategy/application-hostname-strategy.js +23 -0
  164. package/dist/lib/util/feature-evaluator/strategy/application-hostname-strategy.js.map +1 -0
  165. package/dist/lib/util/feature-evaluator/strategy/default-strategy.d.ts +5 -0
  166. package/dist/lib/util/feature-evaluator/strategy/default-strategy.js +13 -0
  167. package/dist/lib/util/feature-evaluator/strategy/default-strategy.js.map +1 -0
  168. package/dist/lib/util/feature-evaluator/strategy/flexible-rollout-strategy.d.ts +12 -0
  169. package/dist/lib/util/feature-evaluator/strategy/flexible-rollout-strategy.js +49 -0
  170. package/dist/lib/util/feature-evaluator/strategy/flexible-rollout-strategy.js.map +1 -0
  171. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-random.d.ts +9 -0
  172. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-random.js +19 -0
  173. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-random.js.map +1 -0
  174. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-session-id.d.ts +9 -0
  175. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-session-id.js +24 -0
  176. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-session-id.js.map +1 -0
  177. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-user-id.d.ts +9 -0
  178. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-user-id.js +24 -0
  179. package/dist/lib/util/feature-evaluator/strategy/gradual-rollout-user-id.js.map +1 -0
  180. package/dist/lib/util/feature-evaluator/strategy/index.d.ts +4 -0
  181. package/dist/lib/util/feature-evaluator/strategy/index.js +29 -0
  182. package/dist/lib/util/feature-evaluator/strategy/index.js.map +1 -0
  183. package/dist/lib/util/feature-evaluator/strategy/remote-address-strategy.d.ts +8 -0
  184. package/dist/lib/util/feature-evaluator/strategy/remote-address-strategy.js +35 -0
  185. package/dist/lib/util/feature-evaluator/strategy/remote-address-strategy.js.map +1 -0
  186. package/dist/lib/util/feature-evaluator/strategy/strategy.d.ts +41 -0
  187. package/dist/lib/util/feature-evaluator/strategy/strategy.js +75 -0
  188. package/dist/lib/util/feature-evaluator/strategy/strategy.js.map +1 -0
  189. package/dist/lib/util/feature-evaluator/strategy/unknown-strategy.d.ts +9 -0
  190. package/dist/lib/util/feature-evaluator/strategy/unknown-strategy.js +29 -0
  191. package/dist/lib/util/feature-evaluator/strategy/unknown-strategy.js.map +1 -0
  192. package/dist/lib/util/feature-evaluator/strategy/user-with-id-strategy.d.ts +8 -0
  193. package/dist/lib/util/feature-evaluator/strategy/user-with-id-strategy.js +16 -0
  194. package/dist/lib/util/feature-evaluator/strategy/user-with-id-strategy.js.map +1 -0
  195. package/dist/lib/util/feature-evaluator/strategy/util.d.ts +1 -0
  196. package/dist/lib/util/feature-evaluator/strategy/util.js +31 -0
  197. package/dist/lib/util/feature-evaluator/strategy/util.js.map +1 -0
  198. package/dist/lib/util/feature-evaluator/variant.d.ts +28 -0
  199. package/dist/lib/util/feature-evaluator/variant.js +73 -0
  200. package/dist/lib/util/feature-evaluator/variant.js.map +1 -0
  201. package/dist/lib/util/offline-unleash-client.d.ts +13 -2
  202. package/dist/lib/util/offline-unleash-client.js +20 -20
  203. package/dist/lib/util/offline-unleash-client.js.map +1 -1
  204. package/dist/lib/util/offline-unleash-client.test.d.ts +3 -1
  205. package/dist/lib/util/offline-unleash-client.test.js +349 -139
  206. package/dist/lib/util/offline-unleash-client.test.js.map +1 -1
  207. package/dist/migrations/20220808084524-add-group-permissions.d.ts +2 -0
  208. package/dist/migrations/20220808084524-add-group-permissions.js +12 -0
  209. package/dist/migrations/20220808084524-add-group-permissions.js.map +1 -0
  210. package/dist/migrations/20220808110415-add-projects-foreign-key.d.ts +2 -0
  211. package/dist/migrations/20220808110415-add-projects-foreign-key.js +14 -0
  212. package/dist/migrations/20220808110415-add-projects-foreign-key.js.map +1 -0
  213. package/dist/test/arbitraries.test.d.ts +12 -2
  214. package/dist/test/arbitraries.test.js +67 -9
  215. package/dist/test/arbitraries.test.js.map +1 -1
  216. package/dist/test/e2e/api/admin/config.e2e.test.js +2 -1
  217. package/dist/test/e2e/api/admin/config.e2e.test.js.map +1 -1
  218. package/dist/test/e2e/api/admin/event.e2e.test.js +57 -0
  219. package/dist/test/e2e/api/admin/event.e2e.test.js.map +1 -1
  220. package/dist/test/e2e/api/admin/feature.e2e.test.js +8 -7
  221. package/dist/test/e2e/api/admin/feature.e2e.test.js.map +1 -1
  222. package/dist/test/e2e/api/admin/playground.e2e.test.js +22 -0
  223. package/dist/test/e2e/api/admin/playground.e2e.test.js.map +1 -1
  224. package/dist/test/e2e/services/access-service.e2e.test.js +38 -20
  225. package/dist/test/e2e/services/access-service.e2e.test.js.map +1 -1
  226. package/dist/test/e2e/services/playground-service.test.d.ts +5 -1
  227. package/dist/test/e2e/services/playground-service.test.js +725 -37
  228. package/dist/test/e2e/services/playground-service.test.js.map +1 -1
  229. package/dist/test/e2e/services/project-service.e2e.test.js +12 -4
  230. package/dist/test/e2e/services/project-service.e2e.test.js.map +1 -1
  231. package/dist/test/e2e/services/setting-service.test.js +9 -3
  232. package/dist/test/e2e/services/setting-service.test.js.map +1 -1
  233. package/dist/test/e2e/stores/event-store.e2e.test.js +6 -2
  234. package/dist/test/e2e/stores/event-store.e2e.test.js.map +1 -1
  235. package/dist/test/fixtures/fake-event-store.d.ts +1 -3
  236. package/dist/test/fixtures/fake-event-store.js +2 -8
  237. package/dist/test/fixtures/fake-event-store.js.map +1 -1
  238. package/dist/test/fixtures/fake-group-store.d.ts +0 -1
  239. package/dist/test/fixtures/fake-group-store.js +0 -3
  240. package/dist/test/fixtures/fake-group-store.js.map +1 -1
  241. package/package.json +15 -13
  242. package/dist/lib/openapi/spec/bootstrap-ui-schema.d.ts +0 -491
  243. package/dist/lib/openapi/spec/bootstrap-ui-schema.js +0 -94
  244. package/dist/lib/openapi/spec/bootstrap-ui-schema.js.map +0 -1
  245. package/dist/lib/openapi/spec/bootstrap-ui-schema.test.js +0 -145
  246. package/dist/lib/openapi/spec/bootstrap-ui-schema.test.js.map +0 -1
  247. package/dist/lib/openapi/spec/client-variant-schema.d.ts +0 -35
  248. package/dist/lib/openapi/spec/client-variant-schema.js +0 -37
  249. package/dist/lib/openapi/spec/client-variant-schema.js.map +0 -1
  250. package/dist/lib/routes/admin-api/bootstrap-ui.d.ts +0 -25
  251. package/dist/lib/routes/admin-api/bootstrap-ui.js +0 -82
  252. package/dist/lib/routes/admin-api/bootstrap-ui.js.map +0 -1
  253. package/dist/lib/routes/admin-api/bootstrap-ui.test.js +0 -60
  254. package/dist/lib/routes/admin-api/bootstrap-ui.test.js.map +0 -1
  255. package/dist/test/e2e/api/admin/bootstrap.test.js +0 -43
  256. package/dist/test/e2e/api/admin/bootstrap.test.js.map +0 -1
@@ -62,35 +62,45 @@ export declare const featureEnvironmentSchema: {
62
62
  readonly components: {
63
63
  readonly schemas: {
64
64
  readonly constraintSchema: {
65
- readonly $id: "#/components/schemas/constraintSchema";
66
65
  readonly type: "object";
67
- readonly additionalProperties: false;
68
66
  readonly required: readonly ["contextName", "operator"];
67
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
69
68
  readonly properties: {
70
69
  readonly contextName: {
70
+ readonly description: "The name of the context field that this constraint should apply to.";
71
+ readonly example: "appName";
71
72
  readonly type: "string";
72
73
  };
73
74
  readonly operator: {
75
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
74
76
  readonly type: "string";
75
77
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
76
78
  };
77
79
  readonly caseInsensitive: {
80
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
78
81
  readonly type: "boolean";
82
+ readonly default: false;
79
83
  };
80
84
  readonly inverted: {
85
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
81
86
  readonly type: "boolean";
87
+ readonly default: false;
82
88
  };
83
89
  readonly values: {
84
90
  readonly type: "array";
91
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
85
92
  readonly items: {
86
93
  readonly type: "string";
87
94
  };
88
95
  };
89
96
  readonly value: {
97
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
90
98
  readonly type: "string";
91
99
  };
92
100
  };
93
101
  readonly components: {};
102
+ readonly $id: "#/components/schemas/constraintSchema";
103
+ readonly additionalProperties: false;
94
104
  };
95
105
  readonly parametersSchema: {
96
106
  readonly $id: "#/components/schemas/parametersSchema";
@@ -3,7 +3,7 @@ export declare const featureEventsSchema: {
3
3
  readonly $id: "#/components/schemas/featureEventsSchema";
4
4
  readonly type: "object";
5
5
  readonly additionalProperties: false;
6
- readonly required: readonly ["toggleName", "events"];
6
+ readonly required: readonly ["events"];
7
7
  readonly properties: {
8
8
  readonly version: {
9
9
  readonly type: "number";
@@ -7,7 +7,7 @@ exports.featureEventsSchema = {
7
7
  $id: '#/components/schemas/featureEventsSchema',
8
8
  type: 'object',
9
9
  additionalProperties: false,
10
- required: ['toggleName', 'events'],
10
+ required: ['events'],
11
11
  properties: {
12
12
  version: { type: 'number' },
13
13
  toggleName: {
@@ -1 +1 @@
1
- {"version":3,"file":"feature-events-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/feature-events-schema.ts"],"names":[],"mappings":";;;AACA,iDAA6C;AAC7C,6CAAyC;AAE5B,QAAA,mBAAmB,GAAG;IAC/B,GAAG,EAAE,0CAA0C;IAC/C,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC;IAClC,UAAU,EAAE;QACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,0BAAW,CAAC,GAAG,EAAE;SACnC;KACJ;IACD,UAAU,EAAE;QACR,OAAO,EAAE;YACL,WAAW,EAAX,0BAAW;YACX,SAAS,EAAT,sBAAS;SACZ;KACJ;CACK,CAAC"}
1
+ {"version":3,"file":"feature-events-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/feature-events-schema.ts"],"names":[],"mappings":";;;AACA,iDAA6C;AAC7C,6CAAyC;AAE5B,QAAA,mBAAmB,GAAG;IAC/B,GAAG,EAAE,0CAA0C;IAC/C,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,UAAU,EAAE;QACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC3B,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;SACjB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,0BAAW,CAAC,GAAG,EAAE;SACnC;KACJ;IACD,UAAU,EAAE;QACR,OAAO,EAAE;YACL,WAAW,EAAX,0BAAW;YACX,SAAS,EAAT,sBAAS;SACZ;KACJ;CACK,CAAC"}
@@ -66,35 +66,45 @@ export declare const featureSchema: {
66
66
  readonly components: {
67
67
  readonly schemas: {
68
68
  readonly constraintSchema: {
69
- readonly $id: "#/components/schemas/constraintSchema";
70
69
  readonly type: "object";
71
- readonly additionalProperties: false;
72
70
  readonly required: readonly ["contextName", "operator"];
71
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
73
72
  readonly properties: {
74
73
  readonly contextName: {
74
+ readonly description: "The name of the context field that this constraint should apply to.";
75
+ readonly example: "appName";
75
76
  readonly type: "string";
76
77
  };
77
78
  readonly operator: {
79
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
78
80
  readonly type: "string";
79
81
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
80
82
  };
81
83
  readonly caseInsensitive: {
84
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
82
85
  readonly type: "boolean";
86
+ readonly default: false;
83
87
  };
84
88
  readonly inverted: {
89
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
85
90
  readonly type: "boolean";
91
+ readonly default: false;
86
92
  };
87
93
  readonly values: {
88
94
  readonly type: "array";
95
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
89
96
  readonly items: {
90
97
  readonly type: "string";
91
98
  };
92
99
  };
93
100
  readonly value: {
101
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
94
102
  readonly type: "string";
95
103
  };
96
104
  };
97
105
  readonly components: {};
106
+ readonly $id: "#/components/schemas/constraintSchema";
107
+ readonly additionalProperties: false;
98
108
  };
99
109
  readonly environmentSchema: {
100
110
  readonly $id: "#/components/schemas/environmentSchema";
@@ -180,35 +190,45 @@ export declare const featureSchema: {
180
190
  readonly components: {
181
191
  readonly schemas: {
182
192
  readonly constraintSchema: {
183
- readonly $id: "#/components/schemas/constraintSchema";
184
193
  readonly type: "object";
185
- readonly additionalProperties: false;
186
194
  readonly required: readonly ["contextName", "operator"];
195
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
187
196
  readonly properties: {
188
197
  readonly contextName: {
198
+ readonly description: "The name of the context field that this constraint should apply to.";
199
+ readonly example: "appName";
189
200
  readonly type: "string";
190
201
  };
191
202
  readonly operator: {
203
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
192
204
  readonly type: "string";
193
205
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
194
206
  };
195
207
  readonly caseInsensitive: {
208
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
196
209
  readonly type: "boolean";
210
+ readonly default: false;
197
211
  };
198
212
  readonly inverted: {
213
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
199
214
  readonly type: "boolean";
215
+ readonly default: false;
200
216
  };
201
217
  readonly values: {
202
218
  readonly type: "array";
219
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
203
220
  readonly items: {
204
221
  readonly type: "string";
205
222
  };
206
223
  };
207
224
  readonly value: {
225
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
208
226
  readonly type: "string";
209
227
  };
210
228
  };
211
229
  readonly components: {};
230
+ readonly $id: "#/components/schemas/constraintSchema";
231
+ readonly additionalProperties: false;
212
232
  };
213
233
  readonly parametersSchema: {
214
234
  readonly $id: "#/components/schemas/parametersSchema";
@@ -225,7 +245,7 @@ export declare const featureSchema: {
225
245
  readonly $id: "#/components/schemas/variantSchema";
226
246
  readonly type: "object";
227
247
  readonly additionalProperties: false;
228
- readonly required: readonly ["name", "weight", "weightType", "stickiness"];
248
+ readonly required: readonly ["name", "weight"];
229
249
  readonly properties: {
230
250
  readonly name: {
231
251
  readonly type: "string";
@@ -44,7 +44,19 @@ test('featureSchema constraints', () => {
44
44
  };
45
45
  expect((0, validate_1.validateSchema)('#/components/schemas/featureSchema', data)).toMatchSnapshot();
46
46
  });
47
- test('featureSchema overrides', () => {
47
+ test('featureSchema variants should only have a few required fields', () => {
48
+ const data = {
49
+ name: 'a',
50
+ variants: [
51
+ {
52
+ name: 'a',
53
+ weight: 1,
54
+ },
55
+ ],
56
+ };
57
+ expect((0, validate_1.validateSchema)('#/components/schemas/featureSchema', data)).toBeUndefined();
58
+ });
59
+ test('featureSchema variant override values must be an array', () => {
48
60
  const data = {
49
61
  name: 'a',
50
62
  variants: [
@@ -1 +1 @@
1
- {"version":3,"file":"feature-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/feature-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE;IACvB,MAAM,IAAI,GAAkB;QACxB,IAAI,EAAE,GAAG;QACT,UAAU,EAAE;YACR;gBACI,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE;oBACT;wBACI,WAAW,EAAE,GAAG;wBAChB,QAAQ,EAAE,IAAI;qBACjB;iBACJ;gBACD,QAAQ,EAAE,CAAC,CAAC,CAAC;aAChB;SACJ;QACD,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,GAAG;gBACf,UAAU,EAAE,GAAG;gBACf,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChD,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;aACrC;SACJ;QACD,YAAY,EAAE;YACV;gBACI,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,GAAG;gBACT,OAAO,EAAE,IAAI;aAChB;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAC7D,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACnC,MAAM,IAAI,GAAG;QACT,IAAI,EAAE,GAAG;QACT,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;KACnE,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAC7D,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACjC,MAAM,IAAI,GAAG;QACT,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,GAAG;gBACf,UAAU,EAAE,GAAG;gBACf,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;gBAC9C,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;aACrC;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAC7D,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"feature-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/feature-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE;IACvB,MAAM,IAAI,GAAkB;QACxB,IAAI,EAAE,GAAG;QACT,UAAU,EAAE;YACR;gBACI,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE;oBACT;wBACI,WAAW,EAAE,GAAG;wBAChB,QAAQ,EAAE,IAAI;qBACjB;iBACJ;gBACD,QAAQ,EAAE,CAAC,CAAC,CAAC;aAChB;SACJ;QACD,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,GAAG;gBACf,UAAU,EAAE,GAAG;gBACf,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChD,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;aACrC;SACJ;QACD,YAAY,EAAE;YACV;gBACI,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,GAAG;gBACT,OAAO,EAAE,IAAI;aAChB;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAC7D,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACnC,MAAM,IAAI,GAAG;QACT,IAAI,EAAE,GAAG;QACT,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;KACnE,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAC7D,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,+DAA+D,EAAE,GAAG,EAAE;IACvE,MAAM,IAAI,GAAG;QACT,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,CAAC;aACZ;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAC7D,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,wDAAwD,EAAE,GAAG,EAAE;IAChE,MAAM,IAAI,GAAG;QACT,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,GAAG;gBACf,UAAU,EAAE,GAAG;gBACf,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;gBAC9C,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;aACrC;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,oCAAoC,EAAE,IAAI,CAAC,CAC7D,CAAC,eAAe,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC"}
@@ -33,35 +33,45 @@ export declare const featureStrategySchema: {
33
33
  readonly components: {
34
34
  readonly schemas: {
35
35
  readonly constraintSchema: {
36
- readonly $id: "#/components/schemas/constraintSchema";
37
36
  readonly type: "object";
38
- readonly additionalProperties: false;
39
37
  readonly required: readonly ["contextName", "operator"];
38
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
40
39
  readonly properties: {
41
40
  readonly contextName: {
41
+ readonly description: "The name of the context field that this constraint should apply to.";
42
+ readonly example: "appName";
42
43
  readonly type: "string";
43
44
  };
44
45
  readonly operator: {
46
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
45
47
  readonly type: "string";
46
48
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
47
49
  };
48
50
  readonly caseInsensitive: {
51
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
49
52
  readonly type: "boolean";
53
+ readonly default: false;
50
54
  };
51
55
  readonly inverted: {
56
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
52
57
  readonly type: "boolean";
58
+ readonly default: false;
53
59
  };
54
60
  readonly values: {
55
61
  readonly type: "array";
62
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
56
63
  readonly items: {
57
64
  readonly type: "string";
58
65
  };
59
66
  };
60
67
  readonly value: {
68
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
61
69
  readonly type: "string";
62
70
  };
63
71
  };
64
72
  readonly components: {};
73
+ readonly $id: "#/components/schemas/constraintSchema";
74
+ readonly additionalProperties: false;
65
75
  };
66
76
  readonly parametersSchema: {
67
77
  readonly $id: "#/components/schemas/parametersSchema";
@@ -21,7 +21,7 @@ export declare const featureVariantsSchema: {
21
21
  readonly $id: "#/components/schemas/variantSchema";
22
22
  readonly type: "object";
23
23
  readonly additionalProperties: false;
24
- readonly required: readonly ["name", "weight", "weightType", "stickiness"];
24
+ readonly required: readonly ["name", "weight"];
25
25
  readonly properties: {
26
26
  readonly name: {
27
27
  readonly type: "string";
@@ -18,35 +18,45 @@ export declare const featuresSchema: {
18
18
  readonly components: {
19
19
  readonly schemas: {
20
20
  readonly constraintSchema: {
21
- readonly $id: "#/components/schemas/constraintSchema";
22
21
  readonly type: "object";
23
- readonly additionalProperties: false;
24
22
  readonly required: readonly ["contextName", "operator"];
23
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
25
24
  readonly properties: {
26
25
  readonly contextName: {
26
+ readonly description: "The name of the context field that this constraint should apply to.";
27
+ readonly example: "appName";
27
28
  readonly type: "string";
28
29
  };
29
30
  readonly operator: {
31
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
30
32
  readonly type: "string";
31
33
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
32
34
  };
33
35
  readonly caseInsensitive: {
36
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
34
37
  readonly type: "boolean";
38
+ readonly default: false;
35
39
  };
36
40
  readonly inverted: {
41
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
37
42
  readonly type: "boolean";
43
+ readonly default: false;
38
44
  };
39
45
  readonly values: {
40
46
  readonly type: "array";
47
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
41
48
  readonly items: {
42
49
  readonly type: "string";
43
50
  };
44
51
  };
45
52
  readonly value: {
53
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
46
54
  readonly type: "string";
47
55
  };
48
56
  };
49
57
  readonly components: {};
58
+ readonly $id: "#/components/schemas/constraintSchema";
59
+ readonly additionalProperties: false;
50
60
  };
51
61
  readonly environmentSchema: {
52
62
  readonly $id: "#/components/schemas/environmentSchema";
@@ -139,35 +149,45 @@ export declare const featuresSchema: {
139
149
  readonly components: {
140
150
  readonly schemas: {
141
151
  readonly constraintSchema: {
142
- readonly $id: "#/components/schemas/constraintSchema";
143
152
  readonly type: "object";
144
- readonly additionalProperties: false;
145
153
  readonly required: readonly ["contextName", "operator"];
154
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
146
155
  readonly properties: {
147
156
  readonly contextName: {
157
+ readonly description: "The name of the context field that this constraint should apply to.";
158
+ readonly example: "appName";
148
159
  readonly type: "string";
149
160
  };
150
161
  readonly operator: {
162
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
151
163
  readonly type: "string";
152
164
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
153
165
  };
154
166
  readonly caseInsensitive: {
167
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
155
168
  readonly type: "boolean";
169
+ readonly default: false;
156
170
  };
157
171
  readonly inverted: {
172
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
158
173
  readonly type: "boolean";
174
+ readonly default: false;
159
175
  };
160
176
  readonly values: {
161
177
  readonly type: "array";
178
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
162
179
  readonly items: {
163
180
  readonly type: "string";
164
181
  };
165
182
  };
166
183
  readonly value: {
184
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
167
185
  readonly type: "string";
168
186
  };
169
187
  };
170
188
  readonly components: {};
189
+ readonly $id: "#/components/schemas/constraintSchema";
190
+ readonly additionalProperties: false;
171
191
  };
172
192
  readonly environmentSchema: {
173
193
  readonly $id: "#/components/schemas/environmentSchema";
@@ -253,35 +273,45 @@ export declare const featuresSchema: {
253
273
  readonly components: {
254
274
  readonly schemas: {
255
275
  readonly constraintSchema: {
256
- readonly $id: "#/components/schemas/constraintSchema";
257
276
  readonly type: "object";
258
- readonly additionalProperties: false;
259
277
  readonly required: readonly ["contextName", "operator"];
278
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
260
279
  readonly properties: {
261
280
  readonly contextName: {
281
+ readonly description: "The name of the context field that this constraint should apply to.";
282
+ readonly example: "appName";
262
283
  readonly type: "string";
263
284
  };
264
285
  readonly operator: {
286
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
265
287
  readonly type: "string";
266
288
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
267
289
  };
268
290
  readonly caseInsensitive: {
291
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
269
292
  readonly type: "boolean";
293
+ readonly default: false;
270
294
  };
271
295
  readonly inverted: {
296
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
272
297
  readonly type: "boolean";
298
+ readonly default: false;
273
299
  };
274
300
  readonly values: {
275
301
  readonly type: "array";
302
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
276
303
  readonly items: {
277
304
  readonly type: "string";
278
305
  };
279
306
  };
280
307
  readonly value: {
308
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
281
309
  readonly type: "string";
282
310
  };
283
311
  };
284
312
  readonly components: {};
313
+ readonly $id: "#/components/schemas/constraintSchema";
314
+ readonly additionalProperties: false;
285
315
  };
286
316
  readonly parametersSchema: {
287
317
  readonly $id: "#/components/schemas/parametersSchema";
@@ -298,7 +328,7 @@ export declare const featuresSchema: {
298
328
  readonly $id: "#/components/schemas/variantSchema";
299
329
  readonly type: "object";
300
330
  readonly additionalProperties: false;
301
- readonly required: readonly ["name", "weight", "weightType", "stickiness"];
331
+ readonly required: readonly ["name", "weight"];
302
332
  readonly properties: {
303
333
  readonly name: {
304
334
  readonly type: "string";
@@ -417,35 +447,45 @@ export declare const featuresSchema: {
417
447
  readonly components: {
418
448
  readonly schemas: {
419
449
  readonly constraintSchema: {
420
- readonly $id: "#/components/schemas/constraintSchema";
421
450
  readonly type: "object";
422
- readonly additionalProperties: false;
423
451
  readonly required: readonly ["contextName", "operator"];
452
+ readonly description: "A strategy constraint. For more information, refer to [the strategy constraint reference documentation](https://docs.getunleash.io/advanced/strategy_constraints)";
424
453
  readonly properties: {
425
454
  readonly contextName: {
455
+ readonly description: "The name of the context field that this constraint should apply to.";
456
+ readonly example: "appName";
426
457
  readonly type: "string";
427
458
  };
428
459
  readonly operator: {
460
+ readonly description: "The operator to use when evaluating this constraint. For more information about the various operators, refer to [the strategy constraint operator documentation](https://docs.getunleash.io/advanced/strategy_constraints#strategy-constraint-operators).";
429
461
  readonly type: "string";
430
462
  readonly enum: readonly ["NOT_IN", "IN", "STR_ENDS_WITH", "STR_STARTS_WITH", "STR_CONTAINS", "NUM_EQ", "NUM_GT", "NUM_GTE", "NUM_LT", "NUM_LTE", "DATE_AFTER", "DATE_BEFORE", "SEMVER_EQ", "SEMVER_GT", "SEMVER_LT"];
431
463
  };
432
464
  readonly caseInsensitive: {
465
+ readonly description: "Whether the operator should be case sensitive or not. Defaults to `false` (being case sensitive).";
433
466
  readonly type: "boolean";
467
+ readonly default: false;
434
468
  };
435
469
  readonly inverted: {
470
+ readonly description: "Whether the result should be negated or not. If `true`, will turn a `true` result into a `false` result and vice versa.";
436
471
  readonly type: "boolean";
472
+ readonly default: false;
437
473
  };
438
474
  readonly values: {
439
475
  readonly type: "array";
476
+ readonly description: "The context values that should be used for constraint evaluation. Use this property instead of `value` for properties that accept multiple values.";
440
477
  readonly items: {
441
478
  readonly type: "string";
442
479
  };
443
480
  };
444
481
  readonly value: {
482
+ readonly description: "The context value that should be used for constraint evaluation. Use this property instead of `values` for properties that only accept single values.";
445
483
  readonly type: "string";
446
484
  };
447
485
  };
448
486
  readonly components: {};
487
+ readonly $id: "#/components/schemas/constraintSchema";
488
+ readonly additionalProperties: false;
449
489
  };
450
490
  readonly parametersSchema: {
451
491
  readonly $id: "#/components/schemas/parametersSchema";
@@ -462,7 +502,7 @@ export declare const featuresSchema: {
462
502
  readonly $id: "#/components/schemas/variantSchema";
463
503
  readonly type: "object";
464
504
  readonly additionalProperties: false;
465
- readonly required: readonly ["name", "weight", "weightType", "stickiness"];
505
+ readonly required: readonly ["name", "weight"];
466
506
  readonly properties: {
467
507
  readonly name: {
468
508
  readonly type: "string";
@@ -42,15 +42,12 @@ export declare const groupSchema: {
42
42
  readonly $id: "#/components/schemas/groupUserModelSchema";
43
43
  readonly type: "object";
44
44
  readonly additionalProperties: false;
45
- readonly required: readonly ["role", "user"];
45
+ readonly required: readonly ["user"];
46
46
  readonly properties: {
47
47
  readonly joinedAt: {
48
48
  readonly type: "string";
49
49
  readonly format: "date-time";
50
50
  };
51
- readonly role: {
52
- readonly type: "string";
53
- };
54
51
  readonly user: {
55
52
  readonly $ref: "#/components/schemas/userSchema";
56
53
  };
@@ -3,15 +3,12 @@ export declare const groupUserModelSchema: {
3
3
  readonly $id: "#/components/schemas/groupUserModelSchema";
4
4
  readonly type: "object";
5
5
  readonly additionalProperties: false;
6
- readonly required: readonly ["role", "user"];
6
+ readonly required: readonly ["user"];
7
7
  readonly properties: {
8
8
  readonly joinedAt: {
9
9
  readonly type: "string";
10
10
  readonly format: "date-time";
11
11
  };
12
- readonly role: {
13
- readonly type: "string";
14
- };
15
12
  readonly user: {
16
13
  readonly $ref: "#/components/schemas/userSchema";
17
14
  };
@@ -6,15 +6,12 @@ exports.groupUserModelSchema = {
6
6
  $id: '#/components/schemas/groupUserModelSchema',
7
7
  type: 'object',
8
8
  additionalProperties: false,
9
- required: ['role', 'user'],
9
+ required: ['user'],
10
10
  properties: {
11
11
  joinedAt: {
12
12
  type: 'string',
13
13
  format: 'date-time',
14
14
  },
15
- role: {
16
- type: 'string',
17
- },
18
15
  user: {
19
16
  $ref: '#/components/schemas/userSchema',
20
17
  },
@@ -1 +1 @@
1
- {"version":3,"file":"group-user-model-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/group-user-model-schema.ts"],"names":[],"mappings":";;;AACA,+CAA2C;AAE9B,QAAA,oBAAoB,GAAG;IAChC,GAAG,EAAE,2CAA2C;IAChD,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE;QACR,QAAQ,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,WAAW;SACtB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;SACjB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,iCAAiC;SAC1C;KACJ;IACD,UAAU,EAAE;QACR,OAAO,EAAE;YACL,UAAU,EAAV,wBAAU;SACb;KACJ;CACK,CAAC"}
1
+ {"version":3,"file":"group-user-model-schema.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/group-user-model-schema.ts"],"names":[],"mappings":";;;AACA,+CAA2C;AAE9B,QAAA,oBAAoB,GAAG;IAChC,GAAG,EAAE,2CAA2C;IAChD,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QACR,QAAQ,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,WAAW;SACtB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,iCAAiC;SAC1C;KACJ;IACD,UAAU,EAAE;QACR,OAAO,EAAE;YACL,UAAU,EAAV,wBAAU;SACb;KACJ;CACK,CAAC"}
@@ -56,15 +56,12 @@ export declare const groupsSchema: {
56
56
  readonly $id: "#/components/schemas/groupUserModelSchema";
57
57
  readonly type: "object";
58
58
  readonly additionalProperties: false;
59
- readonly required: readonly ["role", "user"];
59
+ readonly required: readonly ["user"];
60
60
  readonly properties: {
61
61
  readonly joinedAt: {
62
62
  readonly type: "string";
63
63
  readonly format: "date-time";
64
64
  };
65
- readonly role: {
66
- readonly type: "string";
67
- };
68
65
  readonly user: {
69
66
  readonly $ref: "#/components/schemas/userSchema";
70
67
  };
@@ -177,15 +174,12 @@ export declare const groupsSchema: {
177
174
  readonly $id: "#/components/schemas/groupUserModelSchema";
178
175
  readonly type: "object";
179
176
  readonly additionalProperties: false;
180
- readonly required: readonly ["role", "user"];
177
+ readonly required: readonly ["user"];
181
178
  readonly properties: {
182
179
  readonly joinedAt: {
183
180
  readonly type: "string";
184
181
  readonly format: "date-time";
185
182
  };
186
- readonly role: {
187
- readonly type: "string";
188
- };
189
183
  readonly user: {
190
184
  readonly $ref: "#/components/schemas/userSchema";
191
185
  };
@@ -9,7 +9,6 @@ test('groupsSchema', () => {
9
9
  name: 'Group',
10
10
  users: [
11
11
  {
12
- role: 'Owner',
13
12
  user: {
14
13
  id: 3,
15
14
  },
@@ -1 +1 @@
1
- {"version":3,"file":"groups-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/groups-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;IACtB,MAAM,IAAI,GAAiB;QACvB,MAAM,EAAE;YACJ;gBACI,EAAE,EAAE,CAAC;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE;4BACF,EAAE,EAAE,CAAC;yBACR;qBACJ;iBACJ;aACJ;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,mCAAmC,EAAE,IAAI,CAAC,CAC5D,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"groups-schema.test.js","sourceRoot":"","sources":["../../../../src/lib/openapi/spec/groups-schema.test.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAG7C,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE;IACtB,MAAM,IAAI,GAAiB;QACvB,MAAM,EAAE;YACJ;gBACI,EAAE,EAAE,CAAC;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE;4BACF,EAAE,EAAE,CAAC;yBACR;qBACJ;iBACJ;aACJ;SACJ;KACJ,CAAC;IAEF,MAAM,CACF,IAAA,yBAAc,EAAC,mCAAmC,EAAE,IAAI,CAAC,CAC5D,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC"}