@meshery/schemas 1.2.11 → 1.2.13

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 (303) 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 +34451 -89
  14. package/dist/index.d.ts +34451 -89
  15. package/dist/mesheryApi.d.mts +546 -546
  16. package/dist/mesheryApi.d.ts +546 -546
  17. package/package.json +1 -1
  18. package/dist/Core-CwYNKnjf.d.mts +0 -750
  19. package/dist/Core-CwYNKnjf.d.ts +0 -750
  20. package/dist/constructs/v1alpha1/capability/Capability.d.mts +0 -117
  21. package/dist/constructs/v1alpha1/capability/Capability.d.ts +0 -117
  22. package/dist/constructs/v1alpha1/capability/CapabilitySchema.d.mts +0 -7
  23. package/dist/constructs/v1alpha1/capability/CapabilitySchema.d.ts +0 -7
  24. package/dist/constructs/v1alpha1/core/Core.d.mts +0 -1
  25. package/dist/constructs/v1alpha1/core/Core.d.ts +0 -1
  26. package/dist/constructs/v1alpha1/core/CoreSchema.d.mts +0 -7
  27. package/dist/constructs/v1alpha1/core/CoreSchema.d.ts +0 -7
  28. package/dist/constructs/v1alpha2/catalog/Catalog.d.mts +0 -46
  29. package/dist/constructs/v1alpha2/catalog/Catalog.d.ts +0 -46
  30. package/dist/constructs/v1alpha2/catalog/CatalogSchema.d.mts +0 -7
  31. package/dist/constructs/v1alpha2/catalog/CatalogSchema.d.ts +0 -7
  32. package/dist/constructs/v1alpha3/relationship/Relationship.d.mts +0 -1742
  33. package/dist/constructs/v1alpha3/relationship/Relationship.d.ts +0 -1742
  34. package/dist/constructs/v1alpha3/relationship/RelationshipSchema.d.mts +0 -7
  35. package/dist/constructs/v1alpha3/relationship/RelationshipSchema.d.ts +0 -7
  36. package/dist/constructs/v1beta1/academy/Academy.d.mts +0 -6478
  37. package/dist/constructs/v1beta1/academy/Academy.d.ts +0 -6478
  38. package/dist/constructs/v1beta1/academy/AcademySchema.d.mts +0 -7
  39. package/dist/constructs/v1beta1/academy/AcademySchema.d.ts +0 -7
  40. package/dist/constructs/v1beta1/badge/Badge.d.mts +0 -547
  41. package/dist/constructs/v1beta1/badge/Badge.d.ts +0 -547
  42. package/dist/constructs/v1beta1/badge/BadgeSchema.d.mts +0 -7
  43. package/dist/constructs/v1beta1/badge/BadgeSchema.d.ts +0 -7
  44. package/dist/constructs/v1beta1/capability/Capability.d.mts +0 -117
  45. package/dist/constructs/v1beta1/capability/Capability.d.ts +0 -117
  46. package/dist/constructs/v1beta1/capability/CapabilitySchema.d.mts +0 -7
  47. package/dist/constructs/v1beta1/capability/CapabilitySchema.d.ts +0 -7
  48. package/dist/constructs/v1beta1/catalog/Catalog.d.mts +0 -46
  49. package/dist/constructs/v1beta1/catalog/Catalog.d.ts +0 -46
  50. package/dist/constructs/v1beta1/catalog/CatalogSchema.d.mts +0 -7
  51. package/dist/constructs/v1beta1/catalog/CatalogSchema.d.ts +0 -7
  52. package/dist/constructs/v1beta1/category/Category.d.mts +0 -34
  53. package/dist/constructs/v1beta1/category/Category.d.ts +0 -34
  54. package/dist/constructs/v1beta1/category/CategorySchema.d.mts +0 -7
  55. package/dist/constructs/v1beta1/category/CategorySchema.d.ts +0 -7
  56. package/dist/constructs/v1beta1/component/Component.d.mts +0 -773
  57. package/dist/constructs/v1beta1/component/Component.d.ts +0 -773
  58. package/dist/constructs/v1beta1/component/ComponentSchema.d.mts +0 -7
  59. package/dist/constructs/v1beta1/component/ComponentSchema.d.ts +0 -7
  60. package/dist/constructs/v1beta1/connection/Connection.d.mts +0 -1276
  61. package/dist/constructs/v1beta1/connection/Connection.d.ts +0 -1276
  62. package/dist/constructs/v1beta1/connection/ConnectionSchema.d.mts +0 -7
  63. package/dist/constructs/v1beta1/connection/ConnectionSchema.d.ts +0 -7
  64. package/dist/constructs/v1beta1/core/Core.d.mts +0 -742
  65. package/dist/constructs/v1beta1/core/Core.d.ts +0 -742
  66. package/dist/constructs/v1beta1/core/CoreSchema.d.mts +0 -7
  67. package/dist/constructs/v1beta1/core/CoreSchema.d.ts +0 -7
  68. package/dist/constructs/v1beta1/credential/Credential.d.mts +0 -545
  69. package/dist/constructs/v1beta1/credential/Credential.d.ts +0 -545
  70. package/dist/constructs/v1beta1/credential/CredentialSchema.d.mts +0 -7
  71. package/dist/constructs/v1beta1/credential/CredentialSchema.d.ts +0 -7
  72. package/dist/constructs/v1beta1/environment/Environment.d.mts +0 -774
  73. package/dist/constructs/v1beta1/environment/Environment.d.ts +0 -774
  74. package/dist/constructs/v1beta1/environment/EnvironmentSchema.d.mts +0 -7
  75. package/dist/constructs/v1beta1/environment/EnvironmentSchema.d.ts +0 -7
  76. package/dist/constructs/v1beta1/evaluation/Evaluation.d.mts +0 -5723
  77. package/dist/constructs/v1beta1/evaluation/Evaluation.d.ts +0 -5723
  78. package/dist/constructs/v1beta1/evaluation/EvaluationSchema.d.mts +0 -7
  79. package/dist/constructs/v1beta1/evaluation/EvaluationSchema.d.ts +0 -7
  80. package/dist/constructs/v1beta1/event/Event.d.mts +0 -581
  81. package/dist/constructs/v1beta1/event/Event.d.ts +0 -581
  82. package/dist/constructs/v1beta1/event/EventSchema.d.mts +0 -7
  83. package/dist/constructs/v1beta1/event/EventSchema.d.ts +0 -7
  84. package/dist/constructs/v1beta1/feature/Feature.d.mts +0 -277
  85. package/dist/constructs/v1beta1/feature/Feature.d.ts +0 -277
  86. package/dist/constructs/v1beta1/feature/FeatureSchema.d.mts +0 -7
  87. package/dist/constructs/v1beta1/feature/FeatureSchema.d.ts +0 -7
  88. package/dist/constructs/v1beta1/invitation/Invitation.d.mts +0 -1002
  89. package/dist/constructs/v1beta1/invitation/Invitation.d.ts +0 -1002
  90. package/dist/constructs/v1beta1/invitation/InvitationSchema.d.mts +0 -7
  91. package/dist/constructs/v1beta1/invitation/InvitationSchema.d.ts +0 -7
  92. package/dist/constructs/v1beta1/key/Key.d.mts +0 -513
  93. package/dist/constructs/v1beta1/key/Key.d.ts +0 -513
  94. package/dist/constructs/v1beta1/key/KeySchema.d.mts +0 -7
  95. package/dist/constructs/v1beta1/key/KeySchema.d.ts +0 -7
  96. package/dist/constructs/v1beta1/keychain/Keychain.d.mts +0 -641
  97. package/dist/constructs/v1beta1/keychain/Keychain.d.ts +0 -641
  98. package/dist/constructs/v1beta1/keychain/KeychainSchema.d.mts +0 -7
  99. package/dist/constructs/v1beta1/keychain/KeychainSchema.d.ts +0 -7
  100. package/dist/constructs/v1beta1/model/Model.d.mts +0 -566
  101. package/dist/constructs/v1beta1/model/Model.d.ts +0 -566
  102. package/dist/constructs/v1beta1/model/ModelSchema.d.mts +0 -7
  103. package/dist/constructs/v1beta1/model/ModelSchema.d.ts +0 -7
  104. package/dist/constructs/v1beta1/organization/Organization.d.mts +0 -1673
  105. package/dist/constructs/v1beta1/organization/Organization.d.ts +0 -1673
  106. package/dist/constructs/v1beta1/organization/OrganizationSchema.d.mts +0 -7
  107. package/dist/constructs/v1beta1/organization/OrganizationSchema.d.ts +0 -7
  108. package/dist/constructs/v1beta1/pattern/Pattern.d.mts +0 -16729
  109. package/dist/constructs/v1beta1/pattern/Pattern.d.ts +0 -16729
  110. package/dist/constructs/v1beta1/pattern/PatternSchema.d.mts +0 -7
  111. package/dist/constructs/v1beta1/pattern/PatternSchema.d.ts +0 -7
  112. package/dist/constructs/v1beta1/plan/Plan.d.mts +0 -148
  113. package/dist/constructs/v1beta1/plan/Plan.d.ts +0 -148
  114. package/dist/constructs/v1beta1/plan/PlanSchema.d.mts +0 -7
  115. package/dist/constructs/v1beta1/plan/PlanSchema.d.ts +0 -7
  116. package/dist/constructs/v1beta1/relationship/Relationship.d.mts +0 -1726
  117. package/dist/constructs/v1beta1/relationship/Relationship.d.ts +0 -1726
  118. package/dist/constructs/v1beta1/relationship/RelationshipSchema.d.mts +0 -7
  119. package/dist/constructs/v1beta1/relationship/RelationshipSchema.d.ts +0 -7
  120. package/dist/constructs/v1beta1/role/Role.d.mts +0 -744
  121. package/dist/constructs/v1beta1/role/Role.d.ts +0 -744
  122. package/dist/constructs/v1beta1/role/RoleSchema.d.mts +0 -7
  123. package/dist/constructs/v1beta1/role/RoleSchema.d.ts +0 -7
  124. package/dist/constructs/v1beta1/schedule/Schedule.d.mts +0 -373
  125. package/dist/constructs/v1beta1/schedule/Schedule.d.ts +0 -373
  126. package/dist/constructs/v1beta1/schedule/ScheduleSchema.d.mts +0 -7
  127. package/dist/constructs/v1beta1/schedule/ScheduleSchema.d.ts +0 -7
  128. package/dist/constructs/v1beta1/subcategory/Subcategory.d.mts +0 -23
  129. package/dist/constructs/v1beta1/subcategory/Subcategory.d.ts +0 -23
  130. package/dist/constructs/v1beta1/subcategory/SubcategorySchema.d.mts +0 -7
  131. package/dist/constructs/v1beta1/subcategory/SubcategorySchema.d.ts +0 -7
  132. package/dist/constructs/v1beta1/subscription/Subscription.d.mts +0 -715
  133. package/dist/constructs/v1beta1/subscription/Subscription.d.ts +0 -715
  134. package/dist/constructs/v1beta1/subscription/SubscriptionSchema.d.mts +0 -7
  135. package/dist/constructs/v1beta1/subscription/SubscriptionSchema.d.ts +0 -7
  136. package/dist/constructs/v1beta1/support/Support.d.mts +0 -90
  137. package/dist/constructs/v1beta1/support/Support.d.ts +0 -90
  138. package/dist/constructs/v1beta1/support/SupportSchema.d.mts +0 -7
  139. package/dist/constructs/v1beta1/support/SupportSchema.d.ts +0 -7
  140. package/dist/constructs/v1beta1/team/Team.d.mts +0 -863
  141. package/dist/constructs/v1beta1/team/Team.d.ts +0 -863
  142. package/dist/constructs/v1beta1/team/TeamSchema.d.mts +0 -7
  143. package/dist/constructs/v1beta1/team/TeamSchema.d.ts +0 -7
  144. package/dist/constructs/v1beta1/token/Token.d.mts +0 -538
  145. package/dist/constructs/v1beta1/token/Token.d.ts +0 -538
  146. package/dist/constructs/v1beta1/token/TokenSchema.d.mts +0 -7
  147. package/dist/constructs/v1beta1/token/TokenSchema.d.ts +0 -7
  148. package/dist/constructs/v1beta1/user/User.d.mts +0 -1831
  149. package/dist/constructs/v1beta1/user/User.d.ts +0 -1831
  150. package/dist/constructs/v1beta1/user/UserSchema.d.mts +0 -7
  151. package/dist/constructs/v1beta1/user/UserSchema.d.ts +0 -7
  152. package/dist/constructs/v1beta1/view/View.d.mts +0 -802
  153. package/dist/constructs/v1beta1/view/View.d.ts +0 -802
  154. package/dist/constructs/v1beta1/view/ViewSchema.d.mts +0 -7
  155. package/dist/constructs/v1beta1/view/ViewSchema.d.ts +0 -7
  156. package/dist/constructs/v1beta1/workspace/Workspace.d.mts +0 -4672
  157. package/dist/constructs/v1beta1/workspace/Workspace.d.ts +0 -4672
  158. package/dist/constructs/v1beta1/workspace/WorkspaceSchema.d.mts +0 -7
  159. package/dist/constructs/v1beta1/workspace/WorkspaceSchema.d.ts +0 -7
  160. package/dist/constructs/v1beta2/academy/Academy.d.mts +0 -7823
  161. package/dist/constructs/v1beta2/academy/Academy.d.ts +0 -7823
  162. package/dist/constructs/v1beta2/academy/AcademySchema.d.mts +0 -7
  163. package/dist/constructs/v1beta2/academy/AcademySchema.d.ts +0 -7
  164. package/dist/constructs/v1beta2/badge/Badge.d.mts +0 -564
  165. package/dist/constructs/v1beta2/badge/Badge.d.ts +0 -564
  166. package/dist/constructs/v1beta2/badge/BadgeSchema.d.mts +0 -7
  167. package/dist/constructs/v1beta2/badge/BadgeSchema.d.ts +0 -7
  168. package/dist/constructs/v1beta2/catalog/Catalog.d.mts +0 -46
  169. package/dist/constructs/v1beta2/catalog/Catalog.d.ts +0 -46
  170. package/dist/constructs/v1beta2/catalog/CatalogSchema.d.mts +0 -7
  171. package/dist/constructs/v1beta2/catalog/CatalogSchema.d.ts +0 -7
  172. package/dist/constructs/v1beta2/component/Component.d.mts +0 -791
  173. package/dist/constructs/v1beta2/component/Component.d.ts +0 -791
  174. package/dist/constructs/v1beta2/component/ComponentSchema.d.mts +0 -7
  175. package/dist/constructs/v1beta2/component/ComponentSchema.d.ts +0 -7
  176. package/dist/constructs/v1beta2/connection/Connection.d.mts +0 -1306
  177. package/dist/constructs/v1beta2/connection/Connection.d.ts +0 -1306
  178. package/dist/constructs/v1beta2/connection/ConnectionSchema.d.mts +0 -7
  179. package/dist/constructs/v1beta2/connection/ConnectionSchema.d.ts +0 -7
  180. package/dist/constructs/v1beta2/core/Core.d.mts +0 -776
  181. package/dist/constructs/v1beta2/core/Core.d.ts +0 -776
  182. package/dist/constructs/v1beta2/core/CoreSchema.d.mts +0 -7
  183. package/dist/constructs/v1beta2/core/CoreSchema.d.ts +0 -7
  184. package/dist/constructs/v1beta2/credential/Credential.d.mts +0 -536
  185. package/dist/constructs/v1beta2/credential/Credential.d.ts +0 -536
  186. package/dist/constructs/v1beta2/credential/CredentialSchema.d.mts +0 -7
  187. package/dist/constructs/v1beta2/credential/CredentialSchema.d.ts +0 -7
  188. package/dist/constructs/v1beta2/design/Design.d.mts +0 -17361
  189. package/dist/constructs/v1beta2/design/Design.d.ts +0 -17361
  190. package/dist/constructs/v1beta2/design/DesignSchema.d.mts +0 -7
  191. package/dist/constructs/v1beta2/design/DesignSchema.d.ts +0 -7
  192. package/dist/constructs/v1beta2/event/Event.d.mts +0 -637
  193. package/dist/constructs/v1beta2/event/Event.d.ts +0 -637
  194. package/dist/constructs/v1beta2/event/EventSchema.d.mts +0 -7
  195. package/dist/constructs/v1beta2/event/EventSchema.d.ts +0 -7
  196. package/dist/constructs/v1beta2/invitation/Invitation.d.mts +0 -1071
  197. package/dist/constructs/v1beta2/invitation/Invitation.d.ts +0 -1071
  198. package/dist/constructs/v1beta2/invitation/InvitationSchema.d.mts +0 -7
  199. package/dist/constructs/v1beta2/invitation/InvitationSchema.d.ts +0 -7
  200. package/dist/constructs/v1beta2/key/Key.d.mts +0 -523
  201. package/dist/constructs/v1beta2/key/Key.d.ts +0 -523
  202. package/dist/constructs/v1beta2/key/KeySchema.d.mts +0 -7
  203. package/dist/constructs/v1beta2/key/KeySchema.d.ts +0 -7
  204. package/dist/constructs/v1beta2/keychain/Keychain.d.mts +0 -651
  205. package/dist/constructs/v1beta2/keychain/Keychain.d.ts +0 -651
  206. package/dist/constructs/v1beta2/keychain/KeychainSchema.d.mts +0 -7
  207. package/dist/constructs/v1beta2/keychain/KeychainSchema.d.ts +0 -7
  208. package/dist/constructs/v1beta2/model/Model.d.mts +0 -604
  209. package/dist/constructs/v1beta2/model/Model.d.ts +0 -604
  210. package/dist/constructs/v1beta2/model/ModelSchema.d.mts +0 -7
  211. package/dist/constructs/v1beta2/model/ModelSchema.d.ts +0 -7
  212. package/dist/constructs/v1beta2/organization/Organization.d.mts +0 -1986
  213. package/dist/constructs/v1beta2/organization/Organization.d.ts +0 -1986
  214. package/dist/constructs/v1beta2/organization/OrganizationSchema.d.mts +0 -7
  215. package/dist/constructs/v1beta2/organization/OrganizationSchema.d.ts +0 -7
  216. package/dist/constructs/v1beta2/plan/Plan.d.mts +0 -161
  217. package/dist/constructs/v1beta2/plan/Plan.d.ts +0 -161
  218. package/dist/constructs/v1beta2/plan/PlanSchema.d.mts +0 -7
  219. package/dist/constructs/v1beta2/plan/PlanSchema.d.ts +0 -7
  220. package/dist/constructs/v1beta2/relationship/Relationship.d.mts +0 -1884
  221. package/dist/constructs/v1beta2/relationship/Relationship.d.ts +0 -1884
  222. package/dist/constructs/v1beta2/relationship/RelationshipSchema.d.mts +0 -7
  223. package/dist/constructs/v1beta2/relationship/RelationshipSchema.d.ts +0 -7
  224. package/dist/constructs/v1beta2/role/Role.d.mts +0 -751
  225. package/dist/constructs/v1beta2/role/Role.d.ts +0 -751
  226. package/dist/constructs/v1beta2/role/RoleSchema.d.mts +0 -7
  227. package/dist/constructs/v1beta2/role/RoleSchema.d.ts +0 -7
  228. package/dist/constructs/v1beta2/schedule/Schedule.d.mts +0 -430
  229. package/dist/constructs/v1beta2/schedule/Schedule.d.ts +0 -430
  230. package/dist/constructs/v1beta2/schedule/ScheduleSchema.d.mts +0 -7
  231. package/dist/constructs/v1beta2/schedule/ScheduleSchema.d.ts +0 -7
  232. package/dist/constructs/v1beta2/subscription/Subscription.d.mts +0 -748
  233. package/dist/constructs/v1beta2/subscription/Subscription.d.ts +0 -748
  234. package/dist/constructs/v1beta2/subscription/SubscriptionSchema.d.mts +0 -7
  235. package/dist/constructs/v1beta2/subscription/SubscriptionSchema.d.ts +0 -7
  236. package/dist/constructs/v1beta2/team/Team.d.mts +0 -977
  237. package/dist/constructs/v1beta2/team/Team.d.ts +0 -977
  238. package/dist/constructs/v1beta2/team/TeamSchema.d.mts +0 -7
  239. package/dist/constructs/v1beta2/team/TeamSchema.d.ts +0 -7
  240. package/dist/constructs/v1beta2/token/Token.d.mts +0 -543
  241. package/dist/constructs/v1beta2/token/Token.d.ts +0 -543
  242. package/dist/constructs/v1beta2/token/TokenSchema.d.mts +0 -7
  243. package/dist/constructs/v1beta2/token/TokenSchema.d.ts +0 -7
  244. package/dist/constructs/v1beta2/user/User.d.mts +0 -1831
  245. package/dist/constructs/v1beta2/user/User.d.ts +0 -1831
  246. package/dist/constructs/v1beta2/user/UserSchema.d.mts +0 -7
  247. package/dist/constructs/v1beta2/user/UserSchema.d.ts +0 -7
  248. package/dist/constructs/v1beta2/view/View.d.mts +0 -810
  249. package/dist/constructs/v1beta2/view/View.d.ts +0 -810
  250. package/dist/constructs/v1beta2/view/ViewSchema.d.mts +0 -7
  251. package/dist/constructs/v1beta2/view/ViewSchema.d.ts +0 -7
  252. package/dist/constructs/v1beta3/component/Component.d.mts +0 -796
  253. package/dist/constructs/v1beta3/component/Component.d.ts +0 -796
  254. package/dist/constructs/v1beta3/component/ComponentSchema.d.mts +0 -7
  255. package/dist/constructs/v1beta3/component/ComponentSchema.d.ts +0 -7
  256. package/dist/constructs/v1beta3/connection/Connection.d.mts +0 -1390
  257. package/dist/constructs/v1beta3/connection/Connection.d.ts +0 -1390
  258. package/dist/constructs/v1beta3/connection/ConnectionSchema.d.mts +0 -7
  259. package/dist/constructs/v1beta3/connection/ConnectionSchema.d.ts +0 -7
  260. package/dist/constructs/v1beta3/design/Design.d.mts +0 -5610
  261. package/dist/constructs/v1beta3/design/Design.d.ts +0 -5610
  262. package/dist/constructs/v1beta3/design/DesignSchema.d.mts +0 -7
  263. package/dist/constructs/v1beta3/design/DesignSchema.d.ts +0 -7
  264. package/dist/constructs/v1beta3/environment/Environment.d.mts +0 -800
  265. package/dist/constructs/v1beta3/environment/Environment.d.ts +0 -800
  266. package/dist/constructs/v1beta3/environment/EnvironmentSchema.d.mts +0 -7
  267. package/dist/constructs/v1beta3/environment/EnvironmentSchema.d.ts +0 -7
  268. package/dist/constructs/v1beta3/event/Event.d.mts +0 -733
  269. package/dist/constructs/v1beta3/event/Event.d.ts +0 -733
  270. package/dist/constructs/v1beta3/event/EventSchema.d.mts +0 -7
  271. package/dist/constructs/v1beta3/event/EventSchema.d.ts +0 -7
  272. package/dist/constructs/v1beta3/filter/Filter.d.mts +0 -1385
  273. package/dist/constructs/v1beta3/filter/Filter.d.ts +0 -1385
  274. package/dist/constructs/v1beta3/filter/FilterSchema.d.mts +0 -7
  275. package/dist/constructs/v1beta3/filter/FilterSchema.d.ts +0 -7
  276. package/dist/constructs/v1beta3/invitation/Invitation.d.mts +0 -1079
  277. package/dist/constructs/v1beta3/invitation/Invitation.d.ts +0 -1079
  278. package/dist/constructs/v1beta3/invitation/InvitationSchema.d.mts +0 -7
  279. package/dist/constructs/v1beta3/invitation/InvitationSchema.d.ts +0 -7
  280. package/dist/constructs/v1beta3/performance_profile/PerformanceProfile.d.mts +0 -832
  281. package/dist/constructs/v1beta3/performance_profile/PerformanceProfile.d.ts +0 -832
  282. package/dist/constructs/v1beta3/performance_profile/PerformanceProfileSchema.d.mts +0 -7
  283. package/dist/constructs/v1beta3/performance_profile/PerformanceProfileSchema.d.ts +0 -7
  284. package/dist/constructs/v1beta3/plan/Plan.d.mts +0 -198
  285. package/dist/constructs/v1beta3/plan/Plan.d.ts +0 -198
  286. package/dist/constructs/v1beta3/plan/PlanSchema.d.mts +0 -7
  287. package/dist/constructs/v1beta3/plan/PlanSchema.d.ts +0 -7
  288. package/dist/constructs/v1beta3/relationship/Relationship.d.mts +0 -1884
  289. package/dist/constructs/v1beta3/relationship/Relationship.d.ts +0 -1884
  290. package/dist/constructs/v1beta3/relationship/RelationshipSchema.d.mts +0 -7
  291. package/dist/constructs/v1beta3/relationship/RelationshipSchema.d.ts +0 -7
  292. package/dist/constructs/v1beta3/subscription/Subscription.d.mts +0 -876
  293. package/dist/constructs/v1beta3/subscription/Subscription.d.ts +0 -876
  294. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.d.mts +0 -7
  295. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.d.ts +0 -7
  296. package/dist/constructs/v1beta3/token/Token.d.mts +0 -543
  297. package/dist/constructs/v1beta3/token/Token.d.ts +0 -543
  298. package/dist/constructs/v1beta3/token/TokenSchema.d.mts +0 -7
  299. package/dist/constructs/v1beta3/token/TokenSchema.d.ts +0 -7
  300. package/dist/constructs/v1beta3/workspace/Workspace.d.mts +0 -4811
  301. package/dist/constructs/v1beta3/workspace/Workspace.d.ts +0 -4811
  302. package/dist/constructs/v1beta3/workspace/WorkspaceSchema.d.mts +0 -7
  303. 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};