@fusebase/fusebase-gate-sdk 2.2.2-sdk.9 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Billing API
3
+ *
4
+ * Generated from contract introspection
5
+ * Domain: billing
6
+ */
7
+ import type { Client } from "../runtime/transport";
8
+ import type { orgIdInPathRequired, StripeCheckoutLinkRequestContract, StripeCheckoutLinkResponseContract, StripeModeMutationResponseContract, StripeModeUpdateRequestContract, StripeOauthLookupRequestContract, StripeOauthLookupResponseContract, StripePaymentStateRequestContract, StripePaymentStateResponseContract, StripeProductCreateRequestContract, StripeProductDeleteRequestContract, StripeProductDeleteResponseContract, StripeProductFindRequestContract, StripeProductLookupResponseContract, StripeProductMutationResponseContract, StripeSubscriptionCancelRequestContract, StripeSubscriptionCancelResponseContract } from "../types";
9
+ export declare class BillingApi {
10
+ private client;
11
+ constructor(client: Client);
12
+ /**
13
+ * Cancel Stripe subscription
14
+ * Cancels a Stripe subscription for the supplied buyer and Stripe product identity. When cancelAtPeriodEnd is omitted or true, cancellation is scheduled for the end of the billing period. Set cancelAtPeriodEnd=false for immediate cancellation.
15
+ */
16
+ cancelStripeSubscription(params: {
17
+ path: {
18
+ orgId: orgIdInPathRequired;
19
+ };
20
+ headers?: Record<string, string>;
21
+ body: StripeSubscriptionCancelRequestContract;
22
+ }): Promise<StripeSubscriptionCancelResponseContract>;
23
+ /**
24
+ * Create Stripe product
25
+ * Creates a Stripe payment or subscription product/link for the organization.
26
+ */
27
+ createStripeProduct(params: {
28
+ path: {
29
+ orgId: orgIdInPathRequired;
30
+ };
31
+ headers?: Record<string, string>;
32
+ body: StripeProductCreateRequestContract;
33
+ }): Promise<StripeProductMutationResponseContract>;
34
+ /**
35
+ * Delete Stripe product
36
+ * Marks a Stripe product/link as deleted for the supplied kind and kindId.
37
+ */
38
+ deleteStripeProduct(params: {
39
+ path: {
40
+ orgId: orgIdInPathRequired;
41
+ };
42
+ headers?: Record<string, string>;
43
+ body: StripeProductDeleteRequestContract;
44
+ }): Promise<StripeProductDeleteResponseContract>;
45
+ /**
46
+ * Find Stripe product
47
+ * Returns the Stripe product/link matching the supplied filters, or null when nothing matches.
48
+ */
49
+ findStripeProduct(params: {
50
+ path: {
51
+ orgId: orgIdInPathRequired;
52
+ };
53
+ headers?: Record<string, string>;
54
+ body?: StripeProductFindRequestContract;
55
+ }): Promise<StripeProductLookupResponseContract>;
56
+ /**
57
+ * Get Stripe OAuth connection
58
+ * Returns the Stripe OAuth connection for the organization, or null when no connected Stripe account matches the lookup.
59
+ */
60
+ getStripeOauth(params: {
61
+ path: {
62
+ orgId: orgIdInPathRequired;
63
+ };
64
+ headers?: Record<string, string>;
65
+ body?: StripeOauthLookupRequestContract;
66
+ }): Promise<StripeOauthLookupResponseContract>;
67
+ /**
68
+ * Get Stripe payment link
69
+ * Creates or retrieves the Stripe checkout URL that the buyer should be redirected to for payment.
70
+ */
71
+ getStripePaymentLink(params: {
72
+ path: {
73
+ orgId: orgIdInPathRequired;
74
+ };
75
+ headers?: Record<string, string>;
76
+ body: StripeCheckoutLinkRequestContract;
77
+ }): Promise<StripeCheckoutLinkResponseContract>;
78
+ /**
79
+ * Get Stripe payment state
80
+ * Returns the latest webhook-backed payment state for the supplied buyer and Stripe product identity.
81
+ */
82
+ getStripePaymentState(params: {
83
+ path: {
84
+ orgId: orgIdInPathRequired;
85
+ };
86
+ headers?: Record<string, string>;
87
+ body: StripePaymentStateRequestContract;
88
+ }): Promise<StripePaymentStateResponseContract>;
89
+ /**
90
+ * Update Stripe mode
91
+ * Switches the connected Stripe account between test and live mode without copying Stripe products or prices.
92
+ */
93
+ updateStripeMode(params: {
94
+ path: {
95
+ orgId: orgIdInPathRequired;
96
+ };
97
+ headers?: Record<string, string>;
98
+ body: StripeModeUpdateRequestContract;
99
+ }): Promise<StripeModeMutationResponseContract>;
100
+ /**
101
+ * Update Stripe product
102
+ * Replaces a Stripe product by marking the existing record deleted for the same kind and kindId, then creating a new one.
103
+ */
104
+ updateStripeProduct(params: {
105
+ path: {
106
+ orgId: orgIdInPathRequired;
107
+ };
108
+ headers?: Record<string, string>;
109
+ body: StripeProductCreateRequestContract;
110
+ }): Promise<StripeProductMutationResponseContract>;
111
+ }
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ /**
3
+ * Billing API
4
+ *
5
+ * Generated from contract introspection
6
+ * Domain: billing
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.BillingApi = void 0;
10
+ class BillingApi {
11
+ constructor(client) {
12
+ this.client = client;
13
+ }
14
+ /**
15
+ * Cancel Stripe subscription
16
+ * Cancels a Stripe subscription for the supplied buyer and Stripe product identity. When cancelAtPeriodEnd is omitted or true, cancellation is scheduled for the end of the billing period. Set cancelAtPeriodEnd=false for immediate cancellation.
17
+ */
18
+ async cancelStripeSubscription(params) {
19
+ return this.client.request({
20
+ method: "POST",
21
+ path: "/:orgId/billing/stripe/subscription/cancel",
22
+ pathParams: params.path,
23
+ headers: params.headers,
24
+ body: params.body,
25
+ opId: "cancelStripeSubscription",
26
+ expectedContentType: "application/json",
27
+ });
28
+ }
29
+ /**
30
+ * Create Stripe product
31
+ * Creates a Stripe payment or subscription product/link for the organization.
32
+ */
33
+ async createStripeProduct(params) {
34
+ return this.client.request({
35
+ method: "POST",
36
+ path: "/:orgId/billing/stripe/products",
37
+ pathParams: params.path,
38
+ headers: params.headers,
39
+ body: params.body,
40
+ opId: "createStripeProduct",
41
+ expectedContentType: "application/json",
42
+ });
43
+ }
44
+ /**
45
+ * Delete Stripe product
46
+ * Marks a Stripe product/link as deleted for the supplied kind and kindId.
47
+ */
48
+ async deleteStripeProduct(params) {
49
+ return this.client.request({
50
+ method: "DELETE",
51
+ path: "/:orgId/billing/stripe/products",
52
+ pathParams: params.path,
53
+ headers: params.headers,
54
+ body: params.body,
55
+ opId: "deleteStripeProduct",
56
+ expectedContentType: "application/json",
57
+ });
58
+ }
59
+ /**
60
+ * Find Stripe product
61
+ * Returns the Stripe product/link matching the supplied filters, or null when nothing matches.
62
+ */
63
+ async findStripeProduct(params) {
64
+ return this.client.request({
65
+ method: "POST",
66
+ path: "/:orgId/billing/stripe/products/find",
67
+ pathParams: params.path,
68
+ headers: params.headers,
69
+ body: params.body,
70
+ opId: "findStripeProduct",
71
+ expectedContentType: "application/json",
72
+ });
73
+ }
74
+ /**
75
+ * Get Stripe OAuth connection
76
+ * Returns the Stripe OAuth connection for the organization, or null when no connected Stripe account matches the lookup.
77
+ */
78
+ async getStripeOauth(params) {
79
+ return this.client.request({
80
+ method: "POST",
81
+ path: "/:orgId/billing/stripe/oauth/find",
82
+ pathParams: params.path,
83
+ headers: params.headers,
84
+ body: params.body,
85
+ opId: "getStripeOauth",
86
+ expectedContentType: "application/json",
87
+ });
88
+ }
89
+ /**
90
+ * Get Stripe payment link
91
+ * Creates or retrieves the Stripe checkout URL that the buyer should be redirected to for payment.
92
+ */
93
+ async getStripePaymentLink(params) {
94
+ return this.client.request({
95
+ method: "POST",
96
+ path: "/:orgId/billing/stripe/payment-link",
97
+ pathParams: params.path,
98
+ headers: params.headers,
99
+ body: params.body,
100
+ opId: "getStripePaymentLink",
101
+ expectedContentType: "application/json",
102
+ });
103
+ }
104
+ /**
105
+ * Get Stripe payment state
106
+ * Returns the latest webhook-backed payment state for the supplied buyer and Stripe product identity.
107
+ */
108
+ async getStripePaymentState(params) {
109
+ return this.client.request({
110
+ method: "POST",
111
+ path: "/:orgId/billing/stripe/payment-state",
112
+ pathParams: params.path,
113
+ headers: params.headers,
114
+ body: params.body,
115
+ opId: "getStripePaymentState",
116
+ expectedContentType: "application/json",
117
+ });
118
+ }
119
+ /**
120
+ * Update Stripe mode
121
+ * Switches the connected Stripe account between test and live mode without copying Stripe products or prices.
122
+ */
123
+ async updateStripeMode(params) {
124
+ return this.client.request({
125
+ method: "PUT",
126
+ path: "/:orgId/billing/stripe/mode",
127
+ pathParams: params.path,
128
+ headers: params.headers,
129
+ body: params.body,
130
+ opId: "updateStripeMode",
131
+ expectedContentType: "application/json",
132
+ });
133
+ }
134
+ /**
135
+ * Update Stripe product
136
+ * Replaces a Stripe product by marking the existing record deleted for the same kind and kindId, then creating a new one.
137
+ */
138
+ async updateStripeProduct(params) {
139
+ return this.client.request({
140
+ method: "PUT",
141
+ path: "/:orgId/billing/stripe/products",
142
+ pathParams: params.path,
143
+ headers: params.headers,
144
+ body: params.body,
145
+ opId: "updateStripeProduct",
146
+ expectedContentType: "application/json",
147
+ });
148
+ }
149
+ }
150
+ exports.BillingApi = BillingApi;