@meshery/schemas 1.3.44 → 1.3.46

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 (35) hide show
  1. package/dist/cloudApi.d.mts +882 -4
  2. package/dist/cloudApi.d.ts +882 -4
  3. package/dist/cloudApi.js +1 -1
  4. package/dist/cloudApi.mjs +1 -1
  5. package/dist/constructs/v1beta1/pattern/Pattern.d.ts +1424 -3
  6. package/dist/constructs/v1beta1/pattern/PatternSchema.js +49 -1
  7. package/dist/constructs/v1beta1/pattern/PatternSchema.mjs +49 -1
  8. package/dist/constructs/v1beta2/design/Design.d.ts +1557 -47
  9. package/dist/constructs/v1beta2/design/DesignSchema.js +137 -45
  10. package/dist/constructs/v1beta2/design/DesignSchema.mjs +137 -45
  11. package/dist/constructs/v1beta2/relationship/Relationship.d.ts +34 -17
  12. package/dist/constructs/v1beta2/relationship/RelationshipSchema.js +34 -17
  13. package/dist/constructs/v1beta2/relationship/RelationshipSchema.mjs +34 -17
  14. package/dist/constructs/v1beta3/design/Design.d.ts +371 -7
  15. package/dist/constructs/v1beta3/design/DesignSchema.js +14 -5
  16. package/dist/constructs/v1beta3/design/DesignSchema.mjs +14 -5
  17. package/dist/constructs/v1beta3/relationship/Relationship.d.ts +685 -100
  18. package/dist/constructs/v1beta3/relationship/RelationshipSchema.js +468 -18
  19. package/dist/constructs/v1beta3/relationship/RelationshipSchema.mjs +468 -18
  20. package/dist/constructs/v1beta3/subscription/Subscription.d.ts +436 -0
  21. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.js +1 -1
  22. package/dist/constructs/v1beta3/subscription/SubscriptionSchema.mjs +1 -1
  23. package/dist/index.d.mts +74 -37
  24. package/dist/index.d.ts +74 -37
  25. package/dist/index.js +226 -69
  26. package/dist/index.mjs +226 -69
  27. package/dist/mesheryApi.d.mts +235 -3
  28. package/dist/mesheryApi.d.ts +235 -3
  29. package/dist/mesheryApi.js +1 -1
  30. package/dist/mesheryApi.mjs +1 -1
  31. package/dist/permissions.d.mts +71 -1
  32. package/dist/permissions.d.ts +71 -1
  33. package/dist/permissions.js +1 -1
  34. package/dist/permissions.mjs +1 -1
  35. package/package.json +2 -2
@@ -17,6 +17,44 @@ export interface paths {
17
17
  */
18
18
  get: operations["getSubscriptions"];
19
19
  put?: never;
20
+ /**
21
+ * Update an existing subscription
22
+ * @description Updates the subscription named by `id` in the request body. Despite the historical "upsert" name, this route does not create: a body carrying no `id` is refused with 400. Subscriptions are minted from the payment processor's own response, either by the checkout flow (`POST /api/entitlement/subscriptions/create`) or by the payment-processor webhook, and neither of those reaches this route.
23
+ *
24
+ * Two independent authorization gates guard this route and they answer differently. The route's own middleware runs first. It authorizes against the organization named by the route's `orgId` path parameter when the route has one, and otherwise against whichever organization the caller currently has *selected* - and this route has no `orgId` parameter, so here it is the selected one. A caller who is not a provider admin, an Organization Admin or an Organization Owner of that organization is refused with 403 before the body is read at all. The handler then re-checks against the *stored* subscription's own organization, which need not be the selected one: the caller must be a provider admin, or an Organization Admin or Organization Owner of that organization, and a caller who is not receives 404 - the same answer an absent subscription gives, and deliberately indistinguishable from it, so that the route cannot be used to discover which subscription IDs exist.
25
+ *
26
+ * The fields the payment processor and the webhook own are pinned to the stored row before the write, and any client-supplied value for them is ignored rather than honoured: `orgId`, `billingId`, `status`, `startDate` and `endDate`. The writable surface is `planId` and `quantity`, and the write replaces both - a body that omits one stores that field's zero value rather than preserving the stored one, so send both on every call.
27
+ *
28
+ * The 200 body is a `SubscriptionPage` carrying the single updated subscription (`page` 0, `pageSize` 1, `totalCount` 1), not a bare subscription object.
29
+ */
30
+ post: operations["upsertSubscription"];
31
+ delete?: never;
32
+ options?: never;
33
+ head?: never;
34
+ patch?: never;
35
+ trace?: never;
36
+ };
37
+ "/api/entitlement/subscriptions/{subscriptionId}": {
38
+ parameters: {
39
+ query?: never;
40
+ header?: never;
41
+ path?: never;
42
+ cookie?: never;
43
+ };
44
+ /**
45
+ * Read a single subscription
46
+ * @description Returns the subscription named by `subscriptionId`.
47
+ *
48
+ * Authorization is evaluated against the subscription's own organization, the same bar the org-scoped list route (`GET /api/entitlement/subscriptions`) enforces over the same data: the caller must be a provider admin, or an Organization Admin or Organization Owner of that organization. A caller who is not receives 404, deliberately indistinguishable from an absent subscription, so that the route cannot be used to enumerate subscription IDs.
49
+ *
50
+ * Unlike the update route, this one is registered without any organization-scoped middleware, so it never answers 403: every authorization denial, whether "not yours" or "not there", is that same 404. A malformed request still answers 400 and an unauthenticated one 401, as below.
51
+ *
52
+ * A `subscriptionId` that is not a UUID is refused with 400, and an unauthenticated caller with 401.
53
+ *
54
+ * The 200 body is a `SubscriptionPage` carrying the single subscription (`page` 0, `pageSize` 1, `totalCount` 1), not a bare subscription object.
55
+ */
56
+ get: operations["getSubscriptionById"];
57
+ put?: never;
20
58
  post?: never;
21
59
  delete?: never;
22
60
  options?: never;
@@ -142,6 +180,27 @@ export interface components {
142
180
  */
143
181
  paymentProcessor?: "stripe" | "paypal" | "braintree";
144
182
  };
183
+ /**
184
+ * @description Body of an update to an existing subscription (`POST /api/entitlement/subscriptions`).
185
+ *
186
+ * This is an update payload, never a create payload: `id` names the subscription to update and the server refuses a body without one. It is also a full replacement of the writable surface rather than a partial merge, which is why `planId` and `quantity` are both required - omitting either stores its zero value.
187
+ *
188
+ * The fields the payment processor and the webhook own - `orgId`, `billingId`, `status`, `startDate` and `endDate` - are deliberately absent: the server pins each of them to the stored row and ignores any value supplied for them.
189
+ */
190
+ SubscriptionUpdatePayload: {
191
+ /**
192
+ * Format: uuid
193
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
194
+ */
195
+ id?: string;
196
+ /**
197
+ * Format: uuid
198
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
199
+ */
200
+ planId: string;
201
+ /** @description Number of units subscribed (eg number of users). */
202
+ quantity: number;
203
+ };
145
204
  /** @description Payload for upgrading or downgrading a subscription by changing one of its plans. */
146
205
  UpgradeSubscriptionRequest: {
147
206
  /**
@@ -384,6 +443,15 @@ export interface components {
384
443
  "text/plain": string;
385
444
  };
386
445
  };
446
+ /** @description Forbidden */
447
+ 403: {
448
+ headers: {
449
+ [name: string]: unknown;
450
+ };
451
+ content: {
452
+ "text/plain": string;
453
+ };
454
+ };
387
455
  /** @description Result not found */
388
456
  404: {
389
457
  headers: {
@@ -559,6 +627,338 @@ export interface operations {
559
627
  "text/plain": string;
560
628
  };
561
629
  };
630
+ /** @description Forbidden */
631
+ 403: {
632
+ headers: {
633
+ [name: string]: unknown;
634
+ };
635
+ content: {
636
+ "text/plain": string;
637
+ };
638
+ };
639
+ /** @description Internal server error */
640
+ 500: {
641
+ headers: {
642
+ [name: string]: unknown;
643
+ };
644
+ content: {
645
+ "text/plain": string;
646
+ };
647
+ };
648
+ };
649
+ };
650
+ upsertSubscription: {
651
+ parameters: {
652
+ query?: never;
653
+ header?: never;
654
+ path?: never;
655
+ cookie?: never;
656
+ };
657
+ requestBody: {
658
+ content: {
659
+ "application/json": {
660
+ /**
661
+ * Format: uuid
662
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
663
+ */
664
+ id?: string;
665
+ /**
666
+ * Format: uuid
667
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
668
+ */
669
+ planId: string;
670
+ /** @description Number of units subscribed (eg number of users). */
671
+ quantity: number;
672
+ };
673
+ };
674
+ };
675
+ responses: {
676
+ /** @description Subscription updated */
677
+ 200: {
678
+ headers: {
679
+ [name: string]: unknown;
680
+ };
681
+ content: {
682
+ "application/json": {
683
+ /** @description Current page number of the result set. */
684
+ page: number;
685
+ /** @description Number of items per page. */
686
+ pageSize: number;
687
+ /** @description Total number of items available. */
688
+ totalCount: number;
689
+ /** @description Subscriptions returned on the current page. */
690
+ subscriptions: {
691
+ /**
692
+ * Format: uuid
693
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
694
+ */
695
+ id: string;
696
+ /**
697
+ * Format: uuid
698
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
699
+ */
700
+ orgId: string;
701
+ /**
702
+ * Format: uuid
703
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
704
+ */
705
+ planId: string;
706
+ /** @description Eager-loaded plan associated with this subscription. */
707
+ plan?: {
708
+ /**
709
+ * Format: uuid
710
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
711
+ */
712
+ id: string;
713
+ /**
714
+ * @description Display name of the plan.
715
+ * @enum {string}
716
+ */
717
+ name: "Free" | "Team Designer" | "Team Operator" | "Enterprise";
718
+ /**
719
+ * @description Billing cadence for the plan (monthly, annually, or none).
720
+ * @enum {string}
721
+ */
722
+ cadence: "none" | "monthly" | "annually";
723
+ /**
724
+ * @description Unit of consumption this plan charges against (e.g. user).
725
+ * @enum {string}
726
+ */
727
+ unit: "user" | "free";
728
+ /** @description Minimum number of units required for the plan. */
729
+ minimumUnits: number;
730
+ /** @description Price per unit of the plan. */
731
+ pricePerUnit: number;
732
+ /**
733
+ * @description Currency in which the plan is priced.
734
+ * @enum {string}
735
+ */
736
+ currency: "usd";
737
+ };
738
+ /** @description Number of units subscribed (eg number of users). */
739
+ quantity: number;
740
+ /**
741
+ * Format: date-time
742
+ * @description Timestamp when the subscription period started.
743
+ */
744
+ startDate?: string;
745
+ /**
746
+ * Format: date-time
747
+ * @description Timestamp when the current subscription period ends.
748
+ */
749
+ endDate?: string;
750
+ /**
751
+ * @description Current status of the subscription (e.g. active, past_due, canceled).
752
+ * @enum {string}
753
+ */
754
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid";
755
+ /**
756
+ * Format: date-time
757
+ * @description Timestamp when the subscription was created.
758
+ */
759
+ createdAt?: string;
760
+ /**
761
+ * Format: date-time
762
+ * @description Timestamp when the subscription was last updated.
763
+ */
764
+ updatedAt?: string;
765
+ /**
766
+ * Format: date-time
767
+ * @description Timestamp when the subscription was soft-deleted, if applicable.
768
+ */
769
+ deletedAt?: string;
770
+ /** @description Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe). */
771
+ billingId: string;
772
+ }[];
773
+ };
774
+ };
775
+ };
776
+ /** @description Invalid request body or request param */
777
+ 400: {
778
+ headers: {
779
+ [name: string]: unknown;
780
+ };
781
+ content: {
782
+ "text/plain": string;
783
+ };
784
+ };
785
+ /** @description Expired JWT token used or insufficient privilege */
786
+ 401: {
787
+ headers: {
788
+ [name: string]: unknown;
789
+ };
790
+ content: {
791
+ "text/plain": string;
792
+ };
793
+ };
794
+ /** @description Forbidden */
795
+ 403: {
796
+ headers: {
797
+ [name: string]: unknown;
798
+ };
799
+ content: {
800
+ "text/plain": string;
801
+ };
802
+ };
803
+ /** @description Result not found */
804
+ 404: {
805
+ headers: {
806
+ [name: string]: unknown;
807
+ };
808
+ content: {
809
+ "text/plain": string;
810
+ };
811
+ };
812
+ /** @description Internal server error */
813
+ 500: {
814
+ headers: {
815
+ [name: string]: unknown;
816
+ };
817
+ content: {
818
+ "text/plain": string;
819
+ };
820
+ };
821
+ };
822
+ };
823
+ getSubscriptionById: {
824
+ parameters: {
825
+ query?: never;
826
+ header?: never;
827
+ path: {
828
+ /** @description Subscription ID */
829
+ subscriptionId: string;
830
+ };
831
+ cookie?: never;
832
+ };
833
+ requestBody?: never;
834
+ responses: {
835
+ /** @description Subscription response */
836
+ 200: {
837
+ headers: {
838
+ [name: string]: unknown;
839
+ };
840
+ content: {
841
+ "application/json": {
842
+ /** @description Current page number of the result set. */
843
+ page: number;
844
+ /** @description Number of items per page. */
845
+ pageSize: number;
846
+ /** @description Total number of items available. */
847
+ totalCount: number;
848
+ /** @description Subscriptions returned on the current page. */
849
+ subscriptions: {
850
+ /**
851
+ * Format: uuid
852
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
853
+ */
854
+ id: string;
855
+ /**
856
+ * Format: uuid
857
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
858
+ */
859
+ orgId: string;
860
+ /**
861
+ * Format: uuid
862
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
863
+ */
864
+ planId: string;
865
+ /** @description Eager-loaded plan associated with this subscription. */
866
+ plan?: {
867
+ /**
868
+ * Format: uuid
869
+ * @description A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
870
+ */
871
+ id: string;
872
+ /**
873
+ * @description Display name of the plan.
874
+ * @enum {string}
875
+ */
876
+ name: "Free" | "Team Designer" | "Team Operator" | "Enterprise";
877
+ /**
878
+ * @description Billing cadence for the plan (monthly, annually, or none).
879
+ * @enum {string}
880
+ */
881
+ cadence: "none" | "monthly" | "annually";
882
+ /**
883
+ * @description Unit of consumption this plan charges against (e.g. user).
884
+ * @enum {string}
885
+ */
886
+ unit: "user" | "free";
887
+ /** @description Minimum number of units required for the plan. */
888
+ minimumUnits: number;
889
+ /** @description Price per unit of the plan. */
890
+ pricePerUnit: number;
891
+ /**
892
+ * @description Currency in which the plan is priced.
893
+ * @enum {string}
894
+ */
895
+ currency: "usd";
896
+ };
897
+ /** @description Number of units subscribed (eg number of users). */
898
+ quantity: number;
899
+ /**
900
+ * Format: date-time
901
+ * @description Timestamp when the subscription period started.
902
+ */
903
+ startDate?: string;
904
+ /**
905
+ * Format: date-time
906
+ * @description Timestamp when the current subscription period ends.
907
+ */
908
+ endDate?: string;
909
+ /**
910
+ * @description Current status of the subscription (e.g. active, past_due, canceled).
911
+ * @enum {string}
912
+ */
913
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid";
914
+ /**
915
+ * Format: date-time
916
+ * @description Timestamp when the subscription was created.
917
+ */
918
+ createdAt?: string;
919
+ /**
920
+ * Format: date-time
921
+ * @description Timestamp when the subscription was last updated.
922
+ */
923
+ updatedAt?: string;
924
+ /**
925
+ * Format: date-time
926
+ * @description Timestamp when the subscription was soft-deleted, if applicable.
927
+ */
928
+ deletedAt?: string;
929
+ /** @description Billing ID of the subscription. The ID of the subscription in the external billing system (for example, Stripe). */
930
+ billingId: string;
931
+ }[];
932
+ };
933
+ };
934
+ };
935
+ /** @description Invalid request body or request param */
936
+ 400: {
937
+ headers: {
938
+ [name: string]: unknown;
939
+ };
940
+ content: {
941
+ "text/plain": string;
942
+ };
943
+ };
944
+ /** @description Expired JWT token used or insufficient privilege */
945
+ 401: {
946
+ headers: {
947
+ [name: string]: unknown;
948
+ };
949
+ content: {
950
+ "text/plain": string;
951
+ };
952
+ };
953
+ /** @description Result not found */
954
+ 404: {
955
+ headers: {
956
+ [name: string]: unknown;
957
+ };
958
+ content: {
959
+ "text/plain": string;
960
+ };
961
+ };
562
962
  /** @description Internal server error */
563
963
  500: {
564
964
  headers: {
@@ -700,6 +1100,15 @@ export interface operations {
700
1100
  "text/plain": string;
701
1101
  };
702
1102
  };
1103
+ /** @description Forbidden */
1104
+ 403: {
1105
+ headers: {
1106
+ [name: string]: unknown;
1107
+ };
1108
+ content: {
1109
+ "text/plain": string;
1110
+ };
1111
+ };
703
1112
  /** @description Result not found */
704
1113
  404: {
705
1114
  headers: {
@@ -787,6 +1196,15 @@ export interface operations {
787
1196
  "text/plain": string;
788
1197
  };
789
1198
  };
1199
+ /** @description Forbidden */
1200
+ 403: {
1201
+ headers: {
1202
+ [name: string]: unknown;
1203
+ };
1204
+ content: {
1205
+ "text/plain": string;
1206
+ };
1207
+ };
790
1208
  /** @description Internal server error */
791
1209
  500: {
792
1210
  headers: {
@@ -934,6 +1352,15 @@ export interface operations {
934
1352
  "text/plain": string;
935
1353
  };
936
1354
  };
1355
+ /** @description Forbidden */
1356
+ 403: {
1357
+ headers: {
1358
+ [name: string]: unknown;
1359
+ };
1360
+ content: {
1361
+ "text/plain": string;
1362
+ };
1363
+ };
937
1364
  /** @description Result not found */
938
1365
  404: {
939
1366
  headers: {
@@ -1008,6 +1435,15 @@ export interface operations {
1008
1435
  "text/plain": string;
1009
1436
  };
1010
1437
  };
1438
+ /** @description Forbidden */
1439
+ 403: {
1440
+ headers: {
1441
+ [name: string]: unknown;
1442
+ };
1443
+ content: {
1444
+ "text/plain": string;
1445
+ };
1446
+ };
1011
1447
  /** @description Result not found */
1012
1448
  404: {
1013
1449
  headers: {