@meshery/schemas 1.2.10 → 1.2.12

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 (305) hide show
  1. package/dist/cloudApi.d.mts +9517 -9515
  2. package/dist/cloudApi.d.ts +9517 -9515
  3. package/dist/cloudApi.js +1 -1
  4. package/dist/cloudApi.mjs +1 -1
  5. package/dist/constructs/v1beta2/academy/AcademySchema.js +1 -1
  6. package/dist/constructs/v1beta2/academy/AcademySchema.mjs +1 -1
  7. package/dist/constructs/v1beta3/academy/Academy.js +1 -0
  8. package/dist/constructs/v1beta3/academy/Academy.mjs +0 -0
  9. package/dist/constructs/v1beta3/academy/AcademySchema.js +2 -0
  10. package/dist/constructs/v1beta3/academy/AcademySchema.mjs +2 -0
  11. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.js +1 -1
  12. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.mjs +1 -1
  13. package/dist/index.d.mts +34453 -89
  14. package/dist/index.d.ts +34453 -89
  15. package/dist/index.js +10 -10
  16. package/dist/index.mjs +10 -10
  17. package/dist/mesheryApi.d.mts +546 -546
  18. package/dist/mesheryApi.d.ts +546 -546
  19. package/package.json +1 -1
  20. package/dist/Core-CwYNKnjf.d.mts +0 -750
  21. package/dist/Core-CwYNKnjf.d.ts +0 -750
  22. package/dist/constructs/v1alpha1/capability/Capability.d.mts +0 -117
  23. package/dist/constructs/v1alpha1/capability/Capability.d.ts +0 -117
  24. package/dist/constructs/v1alpha1/capability/CapabilitySchema.d.mts +0 -7
  25. package/dist/constructs/v1alpha1/capability/CapabilitySchema.d.ts +0 -7
  26. package/dist/constructs/v1alpha1/core/Core.d.mts +0 -1
  27. package/dist/constructs/v1alpha1/core/Core.d.ts +0 -1
  28. package/dist/constructs/v1alpha1/core/CoreSchema.d.mts +0 -7
  29. package/dist/constructs/v1alpha1/core/CoreSchema.d.ts +0 -7
  30. package/dist/constructs/v1alpha2/catalog/Catalog.d.mts +0 -46
  31. package/dist/constructs/v1alpha2/catalog/Catalog.d.ts +0 -46
  32. package/dist/constructs/v1alpha2/catalog/CatalogSchema.d.mts +0 -7
  33. package/dist/constructs/v1alpha2/catalog/CatalogSchema.d.ts +0 -7
  34. package/dist/constructs/v1alpha3/relationship/Relationship.d.mts +0 -1742
  35. package/dist/constructs/v1alpha3/relationship/Relationship.d.ts +0 -1742
  36. package/dist/constructs/v1alpha3/relationship/RelationshipSchema.d.mts +0 -7
  37. package/dist/constructs/v1alpha3/relationship/RelationshipSchema.d.ts +0 -7
  38. package/dist/constructs/v1beta1/academy/Academy.d.mts +0 -6478
  39. package/dist/constructs/v1beta1/academy/Academy.d.ts +0 -6478
  40. package/dist/constructs/v1beta1/academy/AcademySchema.d.mts +0 -7
  41. package/dist/constructs/v1beta1/academy/AcademySchema.d.ts +0 -7
  42. package/dist/constructs/v1beta1/badge/Badge.d.mts +0 -547
  43. package/dist/constructs/v1beta1/badge/Badge.d.ts +0 -547
  44. package/dist/constructs/v1beta1/badge/BadgeSchema.d.mts +0 -7
  45. package/dist/constructs/v1beta1/badge/BadgeSchema.d.ts +0 -7
  46. package/dist/constructs/v1beta1/capability/Capability.d.mts +0 -117
  47. package/dist/constructs/v1beta1/capability/Capability.d.ts +0 -117
  48. package/dist/constructs/v1beta1/capability/CapabilitySchema.d.mts +0 -7
  49. package/dist/constructs/v1beta1/capability/CapabilitySchema.d.ts +0 -7
  50. package/dist/constructs/v1beta1/catalog/Catalog.d.mts +0 -46
  51. package/dist/constructs/v1beta1/catalog/Catalog.d.ts +0 -46
  52. package/dist/constructs/v1beta1/catalog/CatalogSchema.d.mts +0 -7
  53. package/dist/constructs/v1beta1/catalog/CatalogSchema.d.ts +0 -7
  54. package/dist/constructs/v1beta1/category/Category.d.mts +0 -34
  55. package/dist/constructs/v1beta1/category/Category.d.ts +0 -34
  56. package/dist/constructs/v1beta1/category/CategorySchema.d.mts +0 -7
  57. package/dist/constructs/v1beta1/category/CategorySchema.d.ts +0 -7
  58. package/dist/constructs/v1beta1/component/Component.d.mts +0 -773
  59. package/dist/constructs/v1beta1/component/Component.d.ts +0 -773
  60. package/dist/constructs/v1beta1/component/ComponentSchema.d.mts +0 -7
  61. package/dist/constructs/v1beta1/component/ComponentSchema.d.ts +0 -7
  62. package/dist/constructs/v1beta1/connection/Connection.d.mts +0 -1276
  63. package/dist/constructs/v1beta1/connection/Connection.d.ts +0 -1276
  64. package/dist/constructs/v1beta1/connection/ConnectionSchema.d.mts +0 -7
  65. package/dist/constructs/v1beta1/connection/ConnectionSchema.d.ts +0 -7
  66. package/dist/constructs/v1beta1/core/Core.d.mts +0 -742
  67. package/dist/constructs/v1beta1/core/Core.d.ts +0 -742
  68. package/dist/constructs/v1beta1/core/CoreSchema.d.mts +0 -7
  69. package/dist/constructs/v1beta1/core/CoreSchema.d.ts +0 -7
  70. package/dist/constructs/v1beta1/credential/Credential.d.mts +0 -545
  71. package/dist/constructs/v1beta1/credential/Credential.d.ts +0 -545
  72. package/dist/constructs/v1beta1/credential/CredentialSchema.d.mts +0 -7
  73. package/dist/constructs/v1beta1/credential/CredentialSchema.d.ts +0 -7
  74. package/dist/constructs/v1beta1/environment/Environment.d.mts +0 -774
  75. package/dist/constructs/v1beta1/environment/Environment.d.ts +0 -774
  76. package/dist/constructs/v1beta1/environment/EnvironmentSchema.d.mts +0 -7
  77. package/dist/constructs/v1beta1/environment/EnvironmentSchema.d.ts +0 -7
  78. package/dist/constructs/v1beta1/evaluation/Evaluation.d.mts +0 -5723
  79. package/dist/constructs/v1beta1/evaluation/Evaluation.d.ts +0 -5723
  80. package/dist/constructs/v1beta1/evaluation/EvaluationSchema.d.mts +0 -7
  81. package/dist/constructs/v1beta1/evaluation/EvaluationSchema.d.ts +0 -7
  82. package/dist/constructs/v1beta1/event/Event.d.mts +0 -581
  83. package/dist/constructs/v1beta1/event/Event.d.ts +0 -581
  84. package/dist/constructs/v1beta1/event/EventSchema.d.mts +0 -7
  85. package/dist/constructs/v1beta1/event/EventSchema.d.ts +0 -7
  86. package/dist/constructs/v1beta1/feature/Feature.d.mts +0 -277
  87. package/dist/constructs/v1beta1/feature/Feature.d.ts +0 -277
  88. package/dist/constructs/v1beta1/feature/FeatureSchema.d.mts +0 -7
  89. package/dist/constructs/v1beta1/feature/FeatureSchema.d.ts +0 -7
  90. package/dist/constructs/v1beta1/invitation/Invitation.d.mts +0 -1002
  91. package/dist/constructs/v1beta1/invitation/Invitation.d.ts +0 -1002
  92. package/dist/constructs/v1beta1/invitation/InvitationSchema.d.mts +0 -7
  93. package/dist/constructs/v1beta1/invitation/InvitationSchema.d.ts +0 -7
  94. package/dist/constructs/v1beta1/key/Key.d.mts +0 -513
  95. package/dist/constructs/v1beta1/key/Key.d.ts +0 -513
  96. package/dist/constructs/v1beta1/key/KeySchema.d.mts +0 -7
  97. package/dist/constructs/v1beta1/key/KeySchema.d.ts +0 -7
  98. package/dist/constructs/v1beta1/keychain/Keychain.d.mts +0 -641
  99. package/dist/constructs/v1beta1/keychain/Keychain.d.ts +0 -641
  100. package/dist/constructs/v1beta1/keychain/KeychainSchema.d.mts +0 -7
  101. package/dist/constructs/v1beta1/keychain/KeychainSchema.d.ts +0 -7
  102. package/dist/constructs/v1beta1/model/Model.d.mts +0 -566
  103. package/dist/constructs/v1beta1/model/Model.d.ts +0 -566
  104. package/dist/constructs/v1beta1/model/ModelSchema.d.mts +0 -7
  105. package/dist/constructs/v1beta1/model/ModelSchema.d.ts +0 -7
  106. package/dist/constructs/v1beta1/organization/Organization.d.mts +0 -1673
  107. package/dist/constructs/v1beta1/organization/Organization.d.ts +0 -1673
  108. package/dist/constructs/v1beta1/organization/OrganizationSchema.d.mts +0 -7
  109. package/dist/constructs/v1beta1/organization/OrganizationSchema.d.ts +0 -7
  110. package/dist/constructs/v1beta1/pattern/Pattern.d.mts +0 -16729
  111. package/dist/constructs/v1beta1/pattern/Pattern.d.ts +0 -16729
  112. package/dist/constructs/v1beta1/pattern/PatternSchema.d.mts +0 -7
  113. package/dist/constructs/v1beta1/pattern/PatternSchema.d.ts +0 -7
  114. package/dist/constructs/v1beta1/plan/Plan.d.mts +0 -148
  115. package/dist/constructs/v1beta1/plan/Plan.d.ts +0 -148
  116. package/dist/constructs/v1beta1/plan/PlanSchema.d.mts +0 -7
  117. package/dist/constructs/v1beta1/plan/PlanSchema.d.ts +0 -7
  118. package/dist/constructs/v1beta1/relationship/Relationship.d.mts +0 -1726
  119. package/dist/constructs/v1beta1/relationship/Relationship.d.ts +0 -1726
  120. package/dist/constructs/v1beta1/relationship/RelationshipSchema.d.mts +0 -7
  121. package/dist/constructs/v1beta1/relationship/RelationshipSchema.d.ts +0 -7
  122. package/dist/constructs/v1beta1/role/Role.d.mts +0 -744
  123. package/dist/constructs/v1beta1/role/Role.d.ts +0 -744
  124. package/dist/constructs/v1beta1/role/RoleSchema.d.mts +0 -7
  125. package/dist/constructs/v1beta1/role/RoleSchema.d.ts +0 -7
  126. package/dist/constructs/v1beta1/schedule/Schedule.d.mts +0 -373
  127. package/dist/constructs/v1beta1/schedule/Schedule.d.ts +0 -373
  128. package/dist/constructs/v1beta1/schedule/ScheduleSchema.d.mts +0 -7
  129. package/dist/constructs/v1beta1/schedule/ScheduleSchema.d.ts +0 -7
  130. package/dist/constructs/v1beta1/subcategory/Subcategory.d.mts +0 -23
  131. package/dist/constructs/v1beta1/subcategory/Subcategory.d.ts +0 -23
  132. package/dist/constructs/v1beta1/subcategory/SubcategorySchema.d.mts +0 -7
  133. package/dist/constructs/v1beta1/subcategory/SubcategorySchema.d.ts +0 -7
  134. package/dist/constructs/v1beta1/subscription/Subscription.d.mts +0 -715
  135. package/dist/constructs/v1beta1/subscription/Subscription.d.ts +0 -715
  136. package/dist/constructs/v1beta1/subscription/SubscriptionSchema.d.mts +0 -7
  137. package/dist/constructs/v1beta1/subscription/SubscriptionSchema.d.ts +0 -7
  138. package/dist/constructs/v1beta1/support/Support.d.mts +0 -90
  139. package/dist/constructs/v1beta1/support/Support.d.ts +0 -90
  140. package/dist/constructs/v1beta1/support/SupportSchema.d.mts +0 -7
  141. package/dist/constructs/v1beta1/support/SupportSchema.d.ts +0 -7
  142. package/dist/constructs/v1beta1/team/Team.d.mts +0 -863
  143. package/dist/constructs/v1beta1/team/Team.d.ts +0 -863
  144. package/dist/constructs/v1beta1/team/TeamSchema.d.mts +0 -7
  145. package/dist/constructs/v1beta1/team/TeamSchema.d.ts +0 -7
  146. package/dist/constructs/v1beta1/token/Token.d.mts +0 -538
  147. package/dist/constructs/v1beta1/token/Token.d.ts +0 -538
  148. package/dist/constructs/v1beta1/token/TokenSchema.d.mts +0 -7
  149. package/dist/constructs/v1beta1/token/TokenSchema.d.ts +0 -7
  150. package/dist/constructs/v1beta1/user/User.d.mts +0 -1831
  151. package/dist/constructs/v1beta1/user/User.d.ts +0 -1831
  152. package/dist/constructs/v1beta1/user/UserSchema.d.mts +0 -7
  153. package/dist/constructs/v1beta1/user/UserSchema.d.ts +0 -7
  154. package/dist/constructs/v1beta1/view/View.d.mts +0 -802
  155. package/dist/constructs/v1beta1/view/View.d.ts +0 -802
  156. package/dist/constructs/v1beta1/view/ViewSchema.d.mts +0 -7
  157. package/dist/constructs/v1beta1/view/ViewSchema.d.ts +0 -7
  158. package/dist/constructs/v1beta1/workspace/Workspace.d.mts +0 -4672
  159. package/dist/constructs/v1beta1/workspace/Workspace.d.ts +0 -4672
  160. package/dist/constructs/v1beta1/workspace/WorkspaceSchema.d.mts +0 -7
  161. package/dist/constructs/v1beta1/workspace/WorkspaceSchema.d.ts +0 -7
  162. package/dist/constructs/v1beta2/academy/Academy.d.mts +0 -7823
  163. package/dist/constructs/v1beta2/academy/Academy.d.ts +0 -7823
  164. package/dist/constructs/v1beta2/academy/AcademySchema.d.mts +0 -7
  165. package/dist/constructs/v1beta2/academy/AcademySchema.d.ts +0 -7
  166. package/dist/constructs/v1beta2/badge/Badge.d.mts +0 -564
  167. package/dist/constructs/v1beta2/badge/Badge.d.ts +0 -564
  168. package/dist/constructs/v1beta2/badge/BadgeSchema.d.mts +0 -7
  169. package/dist/constructs/v1beta2/badge/BadgeSchema.d.ts +0 -7
  170. package/dist/constructs/v1beta2/catalog/Catalog.d.mts +0 -46
  171. package/dist/constructs/v1beta2/catalog/Catalog.d.ts +0 -46
  172. package/dist/constructs/v1beta2/catalog/CatalogSchema.d.mts +0 -7
  173. package/dist/constructs/v1beta2/catalog/CatalogSchema.d.ts +0 -7
  174. package/dist/constructs/v1beta2/component/Component.d.mts +0 -791
  175. package/dist/constructs/v1beta2/component/Component.d.ts +0 -791
  176. package/dist/constructs/v1beta2/component/ComponentSchema.d.mts +0 -7
  177. package/dist/constructs/v1beta2/component/ComponentSchema.d.ts +0 -7
  178. package/dist/constructs/v1beta2/connection/Connection.d.mts +0 -1306
  179. package/dist/constructs/v1beta2/connection/Connection.d.ts +0 -1306
  180. package/dist/constructs/v1beta2/connection/ConnectionSchema.d.mts +0 -7
  181. package/dist/constructs/v1beta2/connection/ConnectionSchema.d.ts +0 -7
  182. package/dist/constructs/v1beta2/core/Core.d.mts +0 -776
  183. package/dist/constructs/v1beta2/core/Core.d.ts +0 -776
  184. package/dist/constructs/v1beta2/core/CoreSchema.d.mts +0 -7
  185. package/dist/constructs/v1beta2/core/CoreSchema.d.ts +0 -7
  186. package/dist/constructs/v1beta2/credential/Credential.d.mts +0 -536
  187. package/dist/constructs/v1beta2/credential/Credential.d.ts +0 -536
  188. package/dist/constructs/v1beta2/credential/CredentialSchema.d.mts +0 -7
  189. package/dist/constructs/v1beta2/credential/CredentialSchema.d.ts +0 -7
  190. package/dist/constructs/v1beta2/design/Design.d.mts +0 -17361
  191. package/dist/constructs/v1beta2/design/Design.d.ts +0 -17361
  192. package/dist/constructs/v1beta2/design/DesignSchema.d.mts +0 -7
  193. package/dist/constructs/v1beta2/design/DesignSchema.d.ts +0 -7
  194. package/dist/constructs/v1beta2/event/Event.d.mts +0 -637
  195. package/dist/constructs/v1beta2/event/Event.d.ts +0 -637
  196. package/dist/constructs/v1beta2/event/EventSchema.d.mts +0 -7
  197. package/dist/constructs/v1beta2/event/EventSchema.d.ts +0 -7
  198. package/dist/constructs/v1beta2/invitation/Invitation.d.mts +0 -1071
  199. package/dist/constructs/v1beta2/invitation/Invitation.d.ts +0 -1071
  200. package/dist/constructs/v1beta2/invitation/InvitationSchema.d.mts +0 -7
  201. package/dist/constructs/v1beta2/invitation/InvitationSchema.d.ts +0 -7
  202. package/dist/constructs/v1beta2/key/Key.d.mts +0 -523
  203. package/dist/constructs/v1beta2/key/Key.d.ts +0 -523
  204. package/dist/constructs/v1beta2/key/KeySchema.d.mts +0 -7
  205. package/dist/constructs/v1beta2/key/KeySchema.d.ts +0 -7
  206. package/dist/constructs/v1beta2/keychain/Keychain.d.mts +0 -651
  207. package/dist/constructs/v1beta2/keychain/Keychain.d.ts +0 -651
  208. package/dist/constructs/v1beta2/keychain/KeychainSchema.d.mts +0 -7
  209. package/dist/constructs/v1beta2/keychain/KeychainSchema.d.ts +0 -7
  210. package/dist/constructs/v1beta2/model/Model.d.mts +0 -604
  211. package/dist/constructs/v1beta2/model/Model.d.ts +0 -604
  212. package/dist/constructs/v1beta2/model/ModelSchema.d.mts +0 -7
  213. package/dist/constructs/v1beta2/model/ModelSchema.d.ts +0 -7
  214. package/dist/constructs/v1beta2/organization/Organization.d.mts +0 -1986
  215. package/dist/constructs/v1beta2/organization/Organization.d.ts +0 -1986
  216. package/dist/constructs/v1beta2/organization/OrganizationSchema.d.mts +0 -7
  217. package/dist/constructs/v1beta2/organization/OrganizationSchema.d.ts +0 -7
  218. package/dist/constructs/v1beta2/plan/Plan.d.mts +0 -161
  219. package/dist/constructs/v1beta2/plan/Plan.d.ts +0 -161
  220. package/dist/constructs/v1beta2/plan/PlanSchema.d.mts +0 -7
  221. package/dist/constructs/v1beta2/plan/PlanSchema.d.ts +0 -7
  222. package/dist/constructs/v1beta2/relationship/Relationship.d.mts +0 -1884
  223. package/dist/constructs/v1beta2/relationship/Relationship.d.ts +0 -1884
  224. package/dist/constructs/v1beta2/relationship/RelationshipSchema.d.mts +0 -7
  225. package/dist/constructs/v1beta2/relationship/RelationshipSchema.d.ts +0 -7
  226. package/dist/constructs/v1beta2/role/Role.d.mts +0 -751
  227. package/dist/constructs/v1beta2/role/Role.d.ts +0 -751
  228. package/dist/constructs/v1beta2/role/RoleSchema.d.mts +0 -7
  229. package/dist/constructs/v1beta2/role/RoleSchema.d.ts +0 -7
  230. package/dist/constructs/v1beta2/schedule/Schedule.d.mts +0 -430
  231. package/dist/constructs/v1beta2/schedule/Schedule.d.ts +0 -430
  232. package/dist/constructs/v1beta2/schedule/ScheduleSchema.d.mts +0 -7
  233. package/dist/constructs/v1beta2/schedule/ScheduleSchema.d.ts +0 -7
  234. package/dist/constructs/v1beta2/subscription/Subscription.d.mts +0 -748
  235. package/dist/constructs/v1beta2/subscription/Subscription.d.ts +0 -748
  236. package/dist/constructs/v1beta2/subscription/SubscriptionSchema.d.mts +0 -7
  237. package/dist/constructs/v1beta2/subscription/SubscriptionSchema.d.ts +0 -7
  238. package/dist/constructs/v1beta2/team/Team.d.mts +0 -977
  239. package/dist/constructs/v1beta2/team/Team.d.ts +0 -977
  240. package/dist/constructs/v1beta2/team/TeamSchema.d.mts +0 -7
  241. package/dist/constructs/v1beta2/team/TeamSchema.d.ts +0 -7
  242. package/dist/constructs/v1beta2/token/Token.d.mts +0 -543
  243. package/dist/constructs/v1beta2/token/Token.d.ts +0 -543
  244. package/dist/constructs/v1beta2/token/TokenSchema.d.mts +0 -7
  245. package/dist/constructs/v1beta2/token/TokenSchema.d.ts +0 -7
  246. package/dist/constructs/v1beta2/user/User.d.mts +0 -1831
  247. package/dist/constructs/v1beta2/user/User.d.ts +0 -1831
  248. package/dist/constructs/v1beta2/user/UserSchema.d.mts +0 -7
  249. package/dist/constructs/v1beta2/user/UserSchema.d.ts +0 -7
  250. package/dist/constructs/v1beta2/view/View.d.mts +0 -810
  251. package/dist/constructs/v1beta2/view/View.d.ts +0 -810
  252. package/dist/constructs/v1beta2/view/ViewSchema.d.mts +0 -7
  253. package/dist/constructs/v1beta2/view/ViewSchema.d.ts +0 -7
  254. package/dist/constructs/v1beta3/component/Component.d.mts +0 -796
  255. package/dist/constructs/v1beta3/component/Component.d.ts +0 -796
  256. package/dist/constructs/v1beta3/component/ComponentSchema.d.mts +0 -7
  257. package/dist/constructs/v1beta3/component/ComponentSchema.d.ts +0 -7
  258. package/dist/constructs/v1beta3/connection/Connection.d.mts +0 -1390
  259. package/dist/constructs/v1beta3/connection/Connection.d.ts +0 -1390
  260. package/dist/constructs/v1beta3/connection/ConnectionSchema.d.mts +0 -7
  261. package/dist/constructs/v1beta3/connection/ConnectionSchema.d.ts +0 -7
  262. package/dist/constructs/v1beta3/design/Design.d.mts +0 -5610
  263. package/dist/constructs/v1beta3/design/Design.d.ts +0 -5610
  264. package/dist/constructs/v1beta3/design/DesignSchema.d.mts +0 -7
  265. package/dist/constructs/v1beta3/design/DesignSchema.d.ts +0 -7
  266. package/dist/constructs/v1beta3/environment/Environment.d.mts +0 -800
  267. package/dist/constructs/v1beta3/environment/Environment.d.ts +0 -800
  268. package/dist/constructs/v1beta3/environment/EnvironmentSchema.d.mts +0 -7
  269. package/dist/constructs/v1beta3/environment/EnvironmentSchema.d.ts +0 -7
  270. package/dist/constructs/v1beta3/event/Event.d.mts +0 -733
  271. package/dist/constructs/v1beta3/event/Event.d.ts +0 -733
  272. package/dist/constructs/v1beta3/event/EventSchema.d.mts +0 -7
  273. package/dist/constructs/v1beta3/event/EventSchema.d.ts +0 -7
  274. package/dist/constructs/v1beta3/filter/Filter.d.mts +0 -1385
  275. package/dist/constructs/v1beta3/filter/Filter.d.ts +0 -1385
  276. package/dist/constructs/v1beta3/filter/FilterSchema.d.mts +0 -7
  277. package/dist/constructs/v1beta3/filter/FilterSchema.d.ts +0 -7
  278. package/dist/constructs/v1beta3/invitation/Invitation.d.mts +0 -1079
  279. package/dist/constructs/v1beta3/invitation/Invitation.d.ts +0 -1079
  280. package/dist/constructs/v1beta3/invitation/InvitationSchema.d.mts +0 -7
  281. package/dist/constructs/v1beta3/invitation/InvitationSchema.d.ts +0 -7
  282. package/dist/constructs/v1beta3/performance_profile/PerformanceProfile.d.mts +0 -832
  283. package/dist/constructs/v1beta3/performance_profile/PerformanceProfile.d.ts +0 -832
  284. package/dist/constructs/v1beta3/performance_profile/PerformanceProfileSchema.d.mts +0 -7
  285. package/dist/constructs/v1beta3/performance_profile/PerformanceProfileSchema.d.ts +0 -7
  286. package/dist/constructs/v1beta3/plan/Plan.d.mts +0 -198
  287. package/dist/constructs/v1beta3/plan/Plan.d.ts +0 -198
  288. package/dist/constructs/v1beta3/plan/PlanSchema.d.mts +0 -7
  289. package/dist/constructs/v1beta3/plan/PlanSchema.d.ts +0 -7
  290. package/dist/constructs/v1beta3/relationship/Relationship.d.mts +0 -1884
  291. package/dist/constructs/v1beta3/relationship/Relationship.d.ts +0 -1884
  292. package/dist/constructs/v1beta3/relationship/RelationshipSchema.d.mts +0 -7
  293. package/dist/constructs/v1beta3/relationship/RelationshipSchema.d.ts +0 -7
  294. package/dist/constructs/v1beta3/subscription/Subscription.d.mts +0 -876
  295. package/dist/constructs/v1beta3/subscription/Subscription.d.ts +0 -876
  296. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.d.mts +0 -7
  297. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.d.ts +0 -7
  298. package/dist/constructs/v1beta3/token/Token.d.mts +0 -543
  299. package/dist/constructs/v1beta3/token/Token.d.ts +0 -543
  300. package/dist/constructs/v1beta3/token/TokenSchema.d.mts +0 -7
  301. package/dist/constructs/v1beta3/token/TokenSchema.d.ts +0 -7
  302. package/dist/constructs/v1beta3/workspace/Workspace.d.mts +0 -4811
  303. package/dist/constructs/v1beta3/workspace/Workspace.d.ts +0 -4811
  304. package/dist/constructs/v1beta3/workspace/WorkspaceSchema.d.mts +0 -7
  305. package/dist/constructs/v1beta3/workspace/WorkspaceSchema.d.ts +0 -7
@@ -1,2 +1,2 @@
1
- 'use strict';var e={openapi:"3.0.0",info:{title:"Subscription",description:"API for managing subscriptions using various payment processors in a SaaS application.",version:"v1beta3",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},servers:[{url:"http://localhost:8080",description:"Local development server"}],tags:[{name:"Subscriptions",description:"Operations related to subscriptions"},{name:"Plans",description:"Operations related to plans"},{name:"Payment Processors",description:"Operations related to payment processors"}],paths:{"/api/entitlement/subscriptions":{get:{"x-internal":["cloud"],tags:["Subscriptions"],description:"Returns all subscriptions for the organization",operationId:"getSubscriptions",summary:"Read subscriptions",security:[{jwt:[]}],parameters:[{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},{name:"status",in:"query",description:"Filter subscriptions by status",required:false,schema:{type:"array",items:{type:"string"}},style:"form",explode:true}],responses:{200:{description:"Subscriptions response",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/cancel":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"cancelSubscription",summary:"Cancel an existing subscription. The subscription will remain active until the end of the billing period and then it will be canceled.",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],responses:{200:{description:"Subscription cancellation scheduled",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/create":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"createSubscription",summary:"Create a new subscription for an organization",security:[{jwt:[]}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{description:"ID of the organization subscribing.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}}}}},responses:{201:{description:"A new subscription has been created",content:{"application/json":{schema:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"upgradeSubscription",summary:"Upgrade or downgrade an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{description:"Plan ID that is being replaced.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{description:"Plan ID that replaces the old plan.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Subscription upgraded",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade-preview":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"previewSubscriptionUpgrade",summary:"Preview the invoice for upgrading or downgrading an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{description:"Plan ID that is being replaced.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{description:"Plan ID that replaces the old plan.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Preview of the upgraded subscription invoice",content:{"application/json":{schema:{type:"object"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/webhooks":{post:{"x-internal":["cloud"],tags:["Payment Processors"],operationId:"handleSubscriptionWebhook",summary:"Handle webhook events from payment processors",security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for webhook events from payment processors."}}}},responses:{200:{description:"Webhook processed"},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},parameters:{subscriptionId:{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}},page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},pagesize:{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},pagesizeWithAll:{name:"pagesize",in:"query",description:"Get responses by pagesize (pass all to get all responses)",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}}},schemas:{PaymentProcessor:{type:"string",description:"Payment processor used to charge the subscription.",enum:["stripe","paypal","braintree"]},CreateSubscriptionRequest:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{description:"ID of the organization subscribing.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}},UpgradeSubscriptionRequest:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{description:"Plan ID that is being replaced.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{description:"Plan ID that replaces the old plan.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}},CreateSubscriptionResponse:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}},UpdateUsersRequest:{type:"object",description:"Payload for synchronizing the current user count with the payment processor.",properties:{paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},CancelSubscriptionRequest:{type:"object",description:"Payload for cancelling a subscription in an external processor.",properties:{subscriptionId:{type:"string",description:"Subscription ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},WebhookEvent:{type:"object",description:"Payload for webhook events from payment processors."},SubscriptionPage:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}},Subscription:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},SubscriptionStatus:{type:"string",description:"Possible statuses of a Stripe subscription.",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}}}}},t=e;
1
+ 'use strict';var e={openapi:"3.0.0",info:{title:"Subscription",description:"API for managing subscriptions using various payment processors in a SaaS application.",version:"v1beta3",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},servers:[{url:"http://localhost:8080",description:"Local development server"}],tags:[{name:"Subscriptions",description:"Operations related to subscriptions"},{name:"Plans",description:"Operations related to plans"},{name:"Payment Processors",description:"Operations related to payment processors"}],paths:{"/api/entitlement/subscriptions":{get:{"x-internal":["cloud"],tags:["Subscriptions"],description:"Returns all subscriptions for the organization",operationId:"getSubscriptions",summary:"Read subscriptions",security:[{jwt:[]}],parameters:[{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},{name:"status",in:"query",description:"Filter subscriptions by status",required:false,schema:{type:"array",items:{type:"string"}},style:"form",explode:true},{name:"planId",in:"query",description:"Filter subscriptions by plan UUID. Repeat for multiple values.",required:false,schema:{type:"array",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},style:"form",explode:true}],responses:{200:{description:"Subscriptions response",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/cancel":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"cancelSubscription",summary:"Cancel an existing subscription. The subscription will remain active until the end of the billing period and then it will be canceled.",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],responses:{200:{description:"Subscription cancellation scheduled",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/create":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"createSubscription",summary:"Create a new subscription for an organization",security:[{jwt:[]}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}}}}},responses:{201:{description:"A new subscription has been created",content:{"application/json":{schema:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"upgradeSubscription",summary:"Upgrade or downgrade an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Subscription upgraded",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade-preview":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"previewSubscriptionUpgrade",summary:"Preview the invoice for upgrading or downgrading an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Preview of the upgraded subscription invoice",content:{"application/json":{schema:{type:"object"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/webhooks":{post:{"x-internal":["cloud"],tags:["Payment Processors"],operationId:"handleSubscriptionWebhook",summary:"Handle webhook events from payment processors",security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for webhook events from payment processors."}}}},responses:{200:{description:"Webhook processed"},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},parameters:{subscriptionId:{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}},page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},pagesize:{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},pagesizeWithAll:{name:"pagesize",in:"query",description:"Get responses by pagesize (pass all to get all responses)",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}}},schemas:{PaymentProcessor:{type:"string",description:"Payment processor used to charge the subscription.",enum:["stripe","paypal","braintree"]},CreateSubscriptionRequest:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}},UpgradeSubscriptionRequest:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}},CreateSubscriptionResponse:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}},UpdateUsersRequest:{type:"object",description:"Payload for synchronizing the current user count with the payment processor.",properties:{paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},CancelSubscriptionRequest:{type:"object",description:"Payload for cancelling a subscription in an external processor.",properties:{subscriptionId:{type:"string",description:"Subscription ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},WebhookEvent:{type:"object",description:"Payload for webhook events from payment processors."},SubscriptionPage:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}},Subscription:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},SubscriptionStatus:{type:"string",description:"Possible statuses of a Stripe subscription.",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}}}}},t=e;
2
2
  module.exports=t;
@@ -1,2 +1,2 @@
1
- var e={openapi:"3.0.0",info:{title:"Subscription",description:"API for managing subscriptions using various payment processors in a SaaS application.",version:"v1beta3",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},servers:[{url:"http://localhost:8080",description:"Local development server"}],tags:[{name:"Subscriptions",description:"Operations related to subscriptions"},{name:"Plans",description:"Operations related to plans"},{name:"Payment Processors",description:"Operations related to payment processors"}],paths:{"/api/entitlement/subscriptions":{get:{"x-internal":["cloud"],tags:["Subscriptions"],description:"Returns all subscriptions for the organization",operationId:"getSubscriptions",summary:"Read subscriptions",security:[{jwt:[]}],parameters:[{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},{name:"status",in:"query",description:"Filter subscriptions by status",required:false,schema:{type:"array",items:{type:"string"}},style:"form",explode:true}],responses:{200:{description:"Subscriptions response",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/cancel":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"cancelSubscription",summary:"Cancel an existing subscription. The subscription will remain active until the end of the billing period and then it will be canceled.",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],responses:{200:{description:"Subscription cancellation scheduled",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/create":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"createSubscription",summary:"Create a new subscription for an organization",security:[{jwt:[]}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{description:"ID of the organization subscribing.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}}}}},responses:{201:{description:"A new subscription has been created",content:{"application/json":{schema:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"upgradeSubscription",summary:"Upgrade or downgrade an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{description:"Plan ID that is being replaced.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{description:"Plan ID that replaces the old plan.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Subscription upgraded",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade-preview":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"previewSubscriptionUpgrade",summary:"Preview the invoice for upgrading or downgrading an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{description:"Plan ID that is being replaced.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{description:"Plan ID that replaces the old plan.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Preview of the upgraded subscription invoice",content:{"application/json":{schema:{type:"object"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/webhooks":{post:{"x-internal":["cloud"],tags:["Payment Processors"],operationId:"handleSubscriptionWebhook",summary:"Handle webhook events from payment processors",security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for webhook events from payment processors."}}}},responses:{200:{description:"Webhook processed"},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},parameters:{subscriptionId:{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}},page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},pagesize:{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},pagesizeWithAll:{name:"pagesize",in:"query",description:"Get responses by pagesize (pass all to get all responses)",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}}},schemas:{PaymentProcessor:{type:"string",description:"Payment processor used to charge the subscription.",enum:["stripe","paypal","braintree"]},CreateSubscriptionRequest:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{description:"ID of the organization subscribing.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}},UpgradeSubscriptionRequest:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{description:"Plan ID that is being replaced.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{description:"Plan ID that replaces the old plan.",type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}},CreateSubscriptionResponse:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}},UpdateUsersRequest:{type:"object",description:"Payload for synchronizing the current user count with the payment processor.",properties:{paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},CancelSubscriptionRequest:{type:"object",description:"Payload for cancelling a subscription in an external processor.",properties:{subscriptionId:{type:"string",description:"Subscription ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},WebhookEvent:{type:"object",description:"Payload for webhook events from payment processors."},SubscriptionPage:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}},Subscription:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{description:"Unique identifier for the subscription.","x-oapi-codegen-extra-tags":{db:"id",json:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},orgId:{description:"ID of the organization that owns this subscription.","x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{description:"ID of the plan this subscription is for.","x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{description:"Unique identifier for the plan.","x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"},type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},SubscriptionStatus:{type:"string",description:"Possible statuses of a Stripe subscription.",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}}}}},t=e;
1
+ var e={openapi:"3.0.0",info:{title:"Subscription",description:"API for managing subscriptions using various payment processors in a SaaS application.",version:"v1beta3",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},servers:[{url:"http://localhost:8080",description:"Local development server"}],tags:[{name:"Subscriptions",description:"Operations related to subscriptions"},{name:"Plans",description:"Operations related to plans"},{name:"Payment Processors",description:"Operations related to payment processors"}],paths:{"/api/entitlement/subscriptions":{get:{"x-internal":["cloud"],tags:["Subscriptions"],description:"Returns all subscriptions for the organization",operationId:"getSubscriptions",summary:"Read subscriptions",security:[{jwt:[]}],parameters:[{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},{name:"status",in:"query",description:"Filter subscriptions by status",required:false,schema:{type:"array",items:{type:"string"}},style:"form",explode:true},{name:"planId",in:"query",description:"Filter subscriptions by plan UUID. Repeat for multiple values.",required:false,schema:{type:"array",items:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}},style:"form",explode:true}],responses:{200:{description:"Subscriptions response",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/cancel":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"cancelSubscription",summary:"Cancel an existing subscription. The subscription will remain active until the end of the billing period and then it will be canceled.",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],responses:{200:{description:"Subscription cancellation scheduled",content:{"application/json":{schema:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/create":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"createSubscription",summary:"Create a new subscription for an organization",security:[{jwt:[]}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}}}}},responses:{201:{description:"A new subscription has been created",content:{"application/json":{schema:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"upgradeSubscription",summary:"Upgrade or downgrade an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Subscription upgraded",content:{"application/json":{schema:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/{subscriptionId}/upgrade-preview":{post:{"x-internal":["cloud"],tags:["Subscriptions"],operationId:"previewSubscriptionUpgrade",summary:"Preview the invoice for upgrading or downgrading an existing subscription by changing one of the plans in the subscription",security:[{jwt:[]}],parameters:[{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}}}}},responses:{200:{description:"Preview of the upgraded subscription invoice",content:{"application/json":{schema:{type:"object"}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/entitlement/subscriptions/webhooks":{post:{"x-internal":["cloud"],tags:["Payment Processors"],operationId:"handleSubscriptionWebhook",summary:"Handle webhook events from payment processors",security:[],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Payload for webhook events from payment processors."}}}},responses:{200:{description:"Webhook processed"},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},parameters:{subscriptionId:{name:"subscriptionId",in:"path",required:true,description:"Subscription ID",schema:{type:"string",format:"uuid"}},page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"string"}},pagesize:{name:"pagesize",in:"query",description:"Get responses by pagesize",schema:{type:"string"}},pagesizeWithAll:{name:"pagesize",in:"query",description:"Get responses by pagesize (pass all to get all responses)",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}}},schemas:{PaymentProcessor:{type:"string",description:"Payment processor used to charge the subscription.",enum:["stripe","paypal","braintree"]},CreateSubscriptionRequest:{type:"object",description:"Payload for creating a new subscription through a payment processor.",properties:{orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},planId:{type:"string",description:"Price ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},couponId:{type:"string",description:"Coupon ID to apply.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},userCount:{type:"integer",description:"Number of users in the organization.",minimum:0},email:{type:"string",format:"email",description:"Email of the customer.",maxLength:500},paymentProcessor:{description:"Payment processor used to complete the subscription checkout.",type:"string",enum:["stripe","paypal","braintree"]}}},UpgradeSubscriptionRequest:{type:"object",description:"Payload for upgrading or downgrading a subscription by changing one of its plans.",properties:{oldPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},newPlanId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}}}},CreateSubscriptionResponse:{type:"object",description:"Response body returned after a subscription is created.",properties:{subscriptionId:{type:"string",description:"ID of the associated subscription in the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},clientSecret:{type:"string",description:"Client secret returned by the payment processor for the subscription checkout flow.",maxLength:500}}},UpdateUsersRequest:{type:"object",description:"Payload for synchronizing the current user count with the payment processor.",properties:{paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},CancelSubscriptionRequest:{type:"object",description:"Payload for cancelling a subscription in an external processor.",properties:{subscriptionId:{type:"string",description:"Subscription ID from the payment processor.","x-id-format":"external",maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"},paymentProcessor:{description:"Payment processor currently billing the subscription.",type:"string",enum:["stripe","paypal","braintree"]}}},WebhookEvent:{type:"object",description:"Payload for webhook events from payment processors."},SubscriptionPage:{type:"object",description:"Paginated list of subscriptions.",required:["page","pageSize","totalCount","subscriptions"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0,"x-go-type-skip-optional-pointer":true},pageSize:{type:"integer",description:"Number of items per page.",minimum:1,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"pageSize"}},totalCount:{type:"integer",description:"Total number of items available.",minimum:0,"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{json:"totalCount"}},subscriptions:{type:"array",items:{"x-go-type":"Subscription",type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},description:"Subscriptions returned on the current page."}}},Subscription:{type:"object",additionalProperties:false,description:"Subscription entity schema.",required:["id","orgId","planId","billingId","status","quantity"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id"}},orgId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"OrgID","x-oapi-codegen-extra-tags":{db:"org_id",json:"orgId"}},planId:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-go-name":"PlanID","x-oapi-codegen-extra-tags":{db:"plan_id",json:"planId"}},plan:{description:"Eager-loaded plan associated with this subscription.","x-go-type":"planv1beta3.Plan","x-go-type-import":{path:"github.com/meshery/schemas/models/v1beta3/plan",name:"planv1beta3"},"x-oapi-codegen-extra-tags":{belongs_to:"plans",fk_id:"PlanID",json:"plan,omitempty"},type:"object",additionalProperties:false,required:["id","name","cadence","unit","pricePerUnit","minimumUnits","currency"],properties:{id:{type:"string",format:"uuid",description:"A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"},"x-oapi-codegen-extra-tags":{db:"id",json:"id",csv:"id"}},name:{description:"Display name of the plan.","x-go-type":"PlanName","x-oapi-codegen-extra-tags":{db:"name",json:"name",csv:"name"},type:"string","x-enum-casing-exempt":true,enum:["Free","Team Designer","Team Operator","Enterprise"]},cadence:{description:"Billing cadence for the plan (monthly, annually, or none).","x-go-type":"PlanCadence","x-oapi-codegen-extra-tags":{db:"cadence",json:"cadence",csv:"cadence"},type:"string",enum:["none","monthly","annually"]},unit:{description:"Unit of consumption this plan charges against (e.g. user).","x-go-type":"PlanUnit","x-oapi-codegen-extra-tags":{db:"unit",json:"unit",csv:"unit"},type:"string",enum:["user","free"]},minimumUnits:{type:"integer",description:"Minimum number of units required for the plan.","x-oapi-codegen-extra-tags":{db:"minimum_units",json:"minimumUnits",csv:"minimum_units"},minimum:0},pricePerUnit:{type:"number",description:"Price per unit of the plan.","x-oapi-codegen-extra-tags":{db:"price_per_unit",json:"pricePerUnit",csv:"price_per_unit"},minimum:0},currency:{description:"Currency in which the plan is priced.","x-go-type":"Currency","x-oapi-codegen-extra-tags":{db:"currency",json:"currency",csv:"currency"},type:"string",enum:["usd"]}}},quantity:{type:"integer",description:"Number of units subscribed (eg number of users).","x-oapi-codegen-extra-tags":{db:"quantity",json:"quantity"},minimum:0},startDate:{type:"string",format:"date-time",description:"Timestamp when the subscription period started.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"start_date",json:"startDate"}},endDate:{type:"string",format:"date-time",description:"Timestamp when the current subscription period ends.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"end_date",json:"endDate"}},status:{description:"Current status of the subscription (e.g. active, past_due, canceled).","x-go-type":"SubscriptionStatus","x-oapi-codegen-extra-tags":{db:"status",json:"status"},type:"string",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}},createdAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was created.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"created_at",json:"createdAt"}},updatedAt:{type:"string",format:"date-time",description:"Timestamp when the subscription was last updated.","x-go-type":"time.Time","x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"updated_at",json:"updatedAt"}},deletedAt:{description:"Timestamp when the subscription was soft-deleted, if applicable.","x-oapi-codegen-extra-tags":{db:"deleted_at",json:"deletedAt,omitempty"},type:"string",format:"date-time","x-go-type":"sql.NullTime","x-go-type-import":{path:"database/sql"},"x-go-type-skip-optional-pointer":true},billingId:{type:"string",description:"Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe).","x-id-format":"external","x-go-name":"BillingID","x-oapi-codegen-extra-tags":{db:"billing_id",json:"billingId"},maxLength:500,pattern:"^[A-Za-z0-9_\\-]+$"}}},SubscriptionStatus:{type:"string",description:"Possible statuses of a Stripe subscription.",enum:["incomplete","incomplete_expired","trialing","active","past_due","canceled","unpaid"],"x-enumDescriptions":{incomplete:"The subscription has been created, but the initial payment is pending. It may transition to 'active' or 'incomplete_expired'.",incomplete_expired:"The subscription was created but never activated due to failed initial payment. It is now expired.",trialing:"The subscription is currently in a trial period before the first payment is due.",active:"The subscription is active, and billing is functioning normally.",past_due:"The latest payment attempt failed, but the subscription remains active. Stripe may retry the charge.",canceled:"The subscription has been canceled and will no longer generate invoices.",unpaid:"The subscription is still technically active but has unpaid invoices and is no longer generating new invoices."}}}}},t=e;
2
2
  export{t as default};