@intlayer/api 8.11.0-canary.0 → 8.11.0
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.
- package/dist/cjs/getIntlayerAPI/stripe.cjs +60 -3
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/esm/getIntlayerAPI/stripe.mjs +60 -3
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts +25 -2
- package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +147 -3
|
@@ -68,10 +68,27 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = _intlayer_config_bui
|
|
|
68
68
|
*/
|
|
69
69
|
const getAffiliateAccountSession = async (otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/account-session`, authAPIOptions, otherOptions, { method: "POST" });
|
|
70
70
|
/**
|
|
71
|
+
* Returns a Stripe-hosted onboarding URL for the authenticated affiliate.
|
|
72
|
+
*/
|
|
73
|
+
const getAffiliateOnboardingLink = async (params, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/onboarding-link`, authAPIOptions, otherOptions, {
|
|
74
|
+
method: "GET",
|
|
75
|
+
params
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
71
78
|
* Returns referral stats for the authenticated affiliate.
|
|
72
79
|
*/
|
|
73
80
|
const getAffiliateStats = async (otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/stats`, authAPIOptions, otherOptions, { method: "GET" });
|
|
74
81
|
/**
|
|
82
|
+
* Admin-only: returns a paginated list of all affiliate invitations.
|
|
83
|
+
*/
|
|
84
|
+
const getAffiliateInvitations = async (params = {}, otherOptions = {}) => {
|
|
85
|
+
const qs = new URLSearchParams();
|
|
86
|
+
if (params.page) qs.set("page", String(params.page));
|
|
87
|
+
if (params.pageSize) qs.set("pageSize", String(params.pageSize));
|
|
88
|
+
if (params.search) qs.set("search", params.search);
|
|
89
|
+
return await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/invitations${qs.toString() ? `?${qs.toString()}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
75
92
|
* Sends an affiliate invitation email to the given address (admin only).
|
|
76
93
|
*/
|
|
77
94
|
const sendAffiliateInvitation = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/invite`, authAPIOptions, otherOptions, {
|
|
@@ -92,10 +109,42 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = _intlayer_config_bui
|
|
|
92
109
|
/**
|
|
93
110
|
* Accepts an affiliate invitation and creates the affiliate account.
|
|
94
111
|
*/
|
|
95
|
-
const acceptAffiliateInvitation = async ({ token, country }, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`, authAPIOptions, otherOptions, {
|
|
112
|
+
const acceptAffiliateInvitation = async ({ token, country, stripeAccountType }, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`, authAPIOptions, otherOptions, {
|
|
96
113
|
method: "POST",
|
|
97
|
-
body: {
|
|
114
|
+
body: {
|
|
115
|
+
country,
|
|
116
|
+
stripeAccountType
|
|
117
|
+
}
|
|
98
118
|
});
|
|
119
|
+
/**
|
|
120
|
+
* Admin-only: returns a paginated list of all promo codes.
|
|
121
|
+
*/
|
|
122
|
+
const getPromoCodeById = async (id, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/promo-codes/${id}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
123
|
+
const getPromoCodes = async (params = {}, otherOptions = {}) => {
|
|
124
|
+
return await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/promo-codes${params.affiliateId ? `?affiliateId=${encodeURIComponent(params.affiliateId)}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Admin-only: creates a new promo code (Stripe coupon + promotion code).
|
|
128
|
+
*/
|
|
129
|
+
const createPromoCode = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/promo-codes`, authAPIOptions, otherOptions, {
|
|
130
|
+
method: "POST",
|
|
131
|
+
body
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* Admin-only: updates a promo code.
|
|
135
|
+
*/
|
|
136
|
+
const updatePromoCode = async ({ id, ...body }, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/promo-codes/${id}`, authAPIOptions, otherOptions, {
|
|
137
|
+
method: "PATCH",
|
|
138
|
+
body
|
|
139
|
+
});
|
|
140
|
+
/**
|
|
141
|
+
* Admin-only: deactivates a promo code (sets active=false, disables Stripe promotion code).
|
|
142
|
+
*/
|
|
143
|
+
const deletePromoCode = async ({ id }, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/promo-codes/${id}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
144
|
+
/**
|
|
145
|
+
* Retrieves the active promo code associated with a given affiliate referral code.
|
|
146
|
+
*/
|
|
147
|
+
const getAffiliatePromoCode = async (referralCode, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate-promo-code/${referralCode}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
99
148
|
return {
|
|
100
149
|
getPricing,
|
|
101
150
|
getSubscription,
|
|
@@ -108,11 +157,19 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = _intlayer_config_bui
|
|
|
108
157
|
getAffiliateById,
|
|
109
158
|
getAffiliate,
|
|
110
159
|
getAffiliateAccountSession,
|
|
160
|
+
getAffiliateOnboardingLink,
|
|
111
161
|
getAffiliateStats,
|
|
162
|
+
getAffiliateInvitations,
|
|
112
163
|
sendAffiliateInvitation,
|
|
113
164
|
getAffiliateInvitation,
|
|
114
165
|
acceptAffiliateInvitation,
|
|
115
|
-
updateAffiliateStatus
|
|
166
|
+
updateAffiliateStatus,
|
|
167
|
+
getPromoCodeById,
|
|
168
|
+
getPromoCodes,
|
|
169
|
+
createPromoCode,
|
|
170
|
+
updatePromoCode,
|
|
171
|
+
deletePromoCode,
|
|
172
|
+
getAffiliatePromoCode
|
|
116
173
|
};
|
|
117
174
|
};
|
|
118
175
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.cjs","names":["defaultConfiguration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n AcceptAffiliateInvitationResult,\n CreatePortalSessionResult,\n GetAffiliateAccountSessionResult,\n GetAffiliateByIdResult,\n GetAffiliateInvitationResult,\n GetAffiliateResult,\n GetAffiliateStatsResult,\n GetAffiliatesParams,\n GetAffiliatesResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\n GrantAffiliateAccessBody,\n GrantAffiliateAccessResult,\n SendAffiliateInvitationBody,\n SendAffiliateInvitationResult,\n UpdateAffiliateStatusBody,\n UpdateAffiliateStatusResult,\n} from '@intlayer/backend';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = defaultConfiguration\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Lists invoices for the authenticated organization's Stripe customer.\n */\n const getInvoices = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetInvoicesResult>(\n `${STRIPE_API_ROUTE}/invoices`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the first card payment method for the authenticated organization's\n * Stripe customer (or null if none).\n */\n const getPaymentMethod = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetPaymentMethodResult>(\n `${STRIPE_API_ROUTE}/payment-method`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Billing Portal session for the authenticated organization.\n */\n const createPortalSession = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<CreatePortalSessionResult>(\n `${STRIPE_API_ROUTE}/portal-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.\n */\n const grantAffiliateAccess = async (\n body: GrantAffiliateAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GrantAffiliateAccessResult>(\n `${STRIPE_API_ROUTE}/affiliate/grant`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliates.\n */\n const getAffiliates = async (\n params?: GetAffiliatesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliatesResult>(\n `${STRIPE_API_ROUTE}/affiliates`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Admin-only: returns a single affiliate by ID.\n */\n const getAffiliateById = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateByIdResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the affiliate record for the authenticated user (null if not an affiliate).\n */\n const getAffiliate = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateResult>(\n `${STRIPE_API_ROUTE}/affiliate`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).\n */\n const getAffiliateAccountSession = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateAccountSessionResult>(\n `${STRIPE_API_ROUTE}/affiliate/account-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Returns referral stats for the authenticated affiliate.\n */\n const getAffiliateStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateStatsResult>(\n `${STRIPE_API_ROUTE}/affiliate/stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Sends an affiliate invitation email to the given address (admin only).\n */\n const sendAffiliateInvitation = async (\n body: SendAffiliateInvitationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SendAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invite`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Retrieves an affiliate invitation by token (public — no auth required).\n */\n const getAffiliateInvitation = async (\n { token }: { token: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: updates an affiliate's status and/or category.\n */\n const updateAffiliateStatus = async (\n { id }: { id: string },\n body: UpdateAffiliateStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateAffiliateStatusResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Accepts an affiliate invitation and creates the affiliate account.\n */\n const acceptAffiliateInvitation = async (\n { token, country }: { token: string; country?: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AcceptAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body: { country } }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n grantAffiliateAccess,\n getAffiliates,\n getAffiliateById,\n getAffiliate,\n getAffiliateAccountSession,\n getAffiliateStats,\n sendAffiliateInvitation,\n getAffiliateInvitation,\n acceptAffiliateInvitation,\n updateAffiliateStatus,\n };\n};\n"],"mappings":";;;;;;;AA2BA,MAAa,gBACX,iBAAiC,CAAC,GAClC,iBAAiCA,mCAC9B;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,WAEJ;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAMC,wBACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,kBAAkB,OACtB,MACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,qBAAqB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;;CAKF,MAAM,0BAA0B,OAC9B,MACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,oBACpB,gBACA,cACA;EAAE,QAAQ;EAAQ;CAAK,CACzB;;;;CAKF,MAAM,yBAAyB,OAC7B,EAAE,SACF,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,wBAAwB,SAC5C,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;CAKF,MAAM,wBAAwB,OAC5B,EAAE,MACF,MACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,cAAc,GAAG,UACrC,gBACA,cACA;EAAE,QAAQ;EAAS;CAAK,CAC1B;;;;CAKF,MAAM,4BAA4B,OAChC,EAAE,OAAO,WACT,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,wBAAwB,MAAM,UAClD,gBACA,cACA;EAAE,QAAQ;EAAQ,MAAM,EAAE,QAAQ;CAAE,CACtC;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"stripe.cjs","names":["defaultConfiguration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n AcceptAffiliateInvitationResult,\n CreatePortalSessionResult,\n CreatePromoCodeBody,\n CreatePromoCodeResult,\n DeletePromoCodeResult,\n GetAffiliateAccountSessionResult,\n GetAffiliateByIdResult,\n GetAffiliateInvitationResult,\n GetAffiliateInvitationsResult,\n GetAffiliateOnboardingLinkResult,\n GetAffiliateResult,\n GetAffiliateStatsResult,\n GetAffiliatesParams,\n GetAffiliatesResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\n GetPromoCodeByIdResult,\n GetPromoCodesResult,\n GrantAffiliateAccessBody,\n GrantAffiliateAccessResult,\n SendAffiliateInvitationBody,\n SendAffiliateInvitationResult,\n UpdateAffiliateStatusBody,\n UpdateAffiliateStatusResult,\n UpdatePromoCodeBody,\n UpdatePromoCodeResult,\n} from '@intlayer/backend';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = defaultConfiguration\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Lists invoices for the authenticated organization's Stripe customer.\n */\n const getInvoices = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetInvoicesResult>(\n `${STRIPE_API_ROUTE}/invoices`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the first card payment method for the authenticated organization's\n * Stripe customer (or null if none).\n */\n const getPaymentMethod = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetPaymentMethodResult>(\n `${STRIPE_API_ROUTE}/payment-method`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Billing Portal session for the authenticated organization.\n */\n const createPortalSession = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<CreatePortalSessionResult>(\n `${STRIPE_API_ROUTE}/portal-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.\n */\n const grantAffiliateAccess = async (\n body: GrantAffiliateAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GrantAffiliateAccessResult>(\n `${STRIPE_API_ROUTE}/affiliate/grant`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliates.\n */\n const getAffiliates = async (\n params?: GetAffiliatesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliatesResult>(\n `${STRIPE_API_ROUTE}/affiliates`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Admin-only: returns a single affiliate by ID.\n */\n const getAffiliateById = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateByIdResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the affiliate record for the authenticated user (null if not an affiliate).\n */\n const getAffiliate = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateResult>(\n `${STRIPE_API_ROUTE}/affiliate`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).\n */\n const getAffiliateAccountSession = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateAccountSessionResult>(\n `${STRIPE_API_ROUTE}/affiliate/account-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Returns a Stripe-hosted onboarding URL for the authenticated affiliate.\n */\n const getAffiliateOnboardingLink = async (\n params?: { returnUrl?: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateOnboardingLinkResult>(\n `${STRIPE_API_ROUTE}/affiliate/onboarding-link`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Returns referral stats for the authenticated affiliate.\n */\n const getAffiliateStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateStatsResult>(\n `${STRIPE_API_ROUTE}/affiliate/stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliate invitations.\n */\n const getAffiliateInvitations = async (\n params: GetAffiliatesParams = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = new URLSearchParams();\n if (params.page) qs.set('page', String(params.page));\n if (params.pageSize) qs.set('pageSize', String(params.pageSize));\n if (params.search) qs.set('search', params.search);\n const query = qs.toString() ? `?${qs.toString()}` : '';\n return await fetcher<GetAffiliateInvitationsResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitations${query}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Sends an affiliate invitation email to the given address (admin only).\n */\n const sendAffiliateInvitation = async (\n body: SendAffiliateInvitationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SendAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invite`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Retrieves an affiliate invitation by token (public — no auth required).\n */\n const getAffiliateInvitation = async (\n { token }: { token: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: updates an affiliate's status and/or category.\n */\n const updateAffiliateStatus = async (\n { id }: { id: string },\n body: UpdateAffiliateStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateAffiliateStatusResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Accepts an affiliate invitation and creates the affiliate account.\n */\n const acceptAffiliateInvitation = async (\n {\n token,\n country,\n stripeAccountType,\n }: {\n token: string;\n country?: string;\n stripeAccountType?: 'express' | 'standard';\n },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AcceptAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body: { country, stripeAccountType } }\n );\n\n /**\n * Admin-only: returns a paginated list of all promo codes.\n */\n const getPromoCodeById = async (\n id: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPromoCodeByIdResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getPromoCodes = async (\n params: { affiliateId?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = params.affiliateId\n ? `?affiliateId=${encodeURIComponent(params.affiliateId)}`\n : '';\n return await fetcher<GetPromoCodesResult>(\n `${STRIPE_API_ROUTE}/promo-codes${qs}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Admin-only: creates a new promo code (Stripe coupon + promotion code).\n */\n const createPromoCode = async (\n body: CreatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: updates a promo code.\n */\n const updatePromoCode = async (\n { id, ...body }: { id: string } & UpdatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Admin-only: deactivates a promo code (sets active=false, disables Stripe promotion code).\n */\n const deletePromoCode = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeletePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Retrieves the active promo code associated with a given affiliate referral code.\n */\n const getAffiliatePromoCode = async (\n referralCode: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<any>(\n `${STRIPE_API_ROUTE}/affiliate-promo-code/${referralCode}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n grantAffiliateAccess,\n getAffiliates,\n getAffiliateById,\n getAffiliate,\n getAffiliateAccountSession,\n getAffiliateOnboardingLink,\n getAffiliateStats,\n getAffiliateInvitations,\n sendAffiliateInvitation,\n getAffiliateInvitation,\n acceptAffiliateInvitation,\n updateAffiliateStatus,\n getPromoCodeById,\n getPromoCodes,\n createPromoCode,\n updatePromoCode,\n deletePromoCode,\n getAffiliatePromoCode,\n };\n};\n"],"mappings":";;;;;;;AAoCA,MAAa,gBACX,iBAAiC,CAAC,GAClC,iBAAiCA,mCAC9B;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,WAEJ;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAMC,wBACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,kBAAkB,OACtB,MACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,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AAS;EAAkB;CAAE,CACzD;;;;CAKF,MAAM,mBAAmB,OACvB,IACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CAEF,MAAM,gBAAgB,OACpB,SAAmC,CAAC,GACpC,eAA+B,CAAC,MAC7B;EAIH,OAAO,MAAMA,wBACX,GAAG,iBAAiB,cAJX,OAAO,cACd,gBAAgB,mBAAmB,OAAO,WAAW,MACrD,MAGF,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CACF;;;;CAKA,MAAM,kBAAkB,OACtB,MACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,eACpB,gBACA,cACA;EAAE,QAAQ;EAAQ;CAAK,CACzB;;;;CAKF,MAAM,kBAAkB,OACtB,EAAE,IAAI,GAAG,QACT,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA;EAAE,QAAQ;EAAS;CAAK,CAC1B;;;;CAKF,MAAM,kBAAkB,OACtB,EAAE,MACF,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,eAAe,MACnC,gBACA,cACA,EAAE,QAAQ,SAAS,CACrB;;;;CAKF,MAAM,wBAAwB,OAC5B,cACA,eAA+B,CAAC,MAEhC,MAAMA,wBACJ,GAAG,iBAAiB,wBAAwB,gBAC5C,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ const require_getIntlayerAPI_oAuth = require('./getIntlayerAPI/oAuth.cjs');
|
|
|
12
12
|
const require_getIntlayerAPI_organization = require('./getIntlayerAPI/organization.cjs');
|
|
13
13
|
const require_getIntlayerAPI_project = require('./getIntlayerAPI/project.cjs');
|
|
14
14
|
const require_getIntlayerAPI_search = require('./getIntlayerAPI/search.cjs');
|
|
15
|
+
const require_getIntlayerAPI_showcaseProject = require('./getIntlayerAPI/showcaseProject.cjs');
|
|
15
16
|
const require_getIntlayerAPI_stripe = require('./getIntlayerAPI/stripe.cjs');
|
|
16
17
|
const require_getIntlayerAPI_tag = require('./getIntlayerAPI/tag.cjs');
|
|
17
18
|
const require_getIntlayerAPI_translate = require('./getIntlayerAPI/translate.cjs');
|
|
@@ -41,6 +42,7 @@ exports.getOrganizationAPI = require_getIntlayerAPI_organization.getOrganization
|
|
|
41
42
|
exports.getProjectAPI = require_getIntlayerAPI_project.getProjectAPI;
|
|
42
43
|
exports.getReviewerAPI = require_getIntlayerAPI_reviewer.getReviewerAPI;
|
|
43
44
|
exports.getSearchAPI = require_getIntlayerAPI_search.getSearchAPI;
|
|
45
|
+
exports.getShowcaseProjectAPI = require_getIntlayerAPI_showcaseProject.getShowcaseProjectAPI;
|
|
44
46
|
exports.getStripeAPI = require_getIntlayerAPI_stripe.getStripeAPI;
|
|
45
47
|
exports.getTagAPI = require_getIntlayerAPI_tag.getTagAPI;
|
|
46
48
|
exports.getTranslateAPI = require_getIntlayerAPI_translate.getTranslateAPI;
|
|
@@ -65,10 +65,27 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = config) => {
|
|
|
65
65
|
*/
|
|
66
66
|
const getAffiliateAccountSession = async (otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/account-session`, authAPIOptions, otherOptions, { method: "POST" });
|
|
67
67
|
/**
|
|
68
|
+
* Returns a Stripe-hosted onboarding URL for the authenticated affiliate.
|
|
69
|
+
*/
|
|
70
|
+
const getAffiliateOnboardingLink = async (params, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/onboarding-link`, authAPIOptions, otherOptions, {
|
|
71
|
+
method: "GET",
|
|
72
|
+
params
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
68
75
|
* Returns referral stats for the authenticated affiliate.
|
|
69
76
|
*/
|
|
70
77
|
const getAffiliateStats = async (otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/stats`, authAPIOptions, otherOptions, { method: "GET" });
|
|
71
78
|
/**
|
|
79
|
+
* Admin-only: returns a paginated list of all affiliate invitations.
|
|
80
|
+
*/
|
|
81
|
+
const getAffiliateInvitations = async (params = {}, otherOptions = {}) => {
|
|
82
|
+
const qs = new URLSearchParams();
|
|
83
|
+
if (params.page) qs.set("page", String(params.page));
|
|
84
|
+
if (params.pageSize) qs.set("pageSize", String(params.pageSize));
|
|
85
|
+
if (params.search) qs.set("search", params.search);
|
|
86
|
+
return await fetcher(`${STRIPE_API_ROUTE}/affiliate/invitations${qs.toString() ? `?${qs.toString()}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
72
89
|
* Sends an affiliate invitation email to the given address (admin only).
|
|
73
90
|
*/
|
|
74
91
|
const sendAffiliateInvitation = async (body, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/invite`, authAPIOptions, otherOptions, {
|
|
@@ -89,10 +106,42 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = config) => {
|
|
|
89
106
|
/**
|
|
90
107
|
* Accepts an affiliate invitation and creates the affiliate account.
|
|
91
108
|
*/
|
|
92
|
-
const acceptAffiliateInvitation = async ({ token, country }, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`, authAPIOptions, otherOptions, {
|
|
109
|
+
const acceptAffiliateInvitation = async ({ token, country, stripeAccountType }, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`, authAPIOptions, otherOptions, {
|
|
93
110
|
method: "POST",
|
|
94
|
-
body: {
|
|
111
|
+
body: {
|
|
112
|
+
country,
|
|
113
|
+
stripeAccountType
|
|
114
|
+
}
|
|
95
115
|
});
|
|
116
|
+
/**
|
|
117
|
+
* Admin-only: returns a paginated list of all promo codes.
|
|
118
|
+
*/
|
|
119
|
+
const getPromoCodeById = async (id, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/promo-codes/${id}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
120
|
+
const getPromoCodes = async (params = {}, otherOptions = {}) => {
|
|
121
|
+
return await fetcher(`${STRIPE_API_ROUTE}/promo-codes${params.affiliateId ? `?affiliateId=${encodeURIComponent(params.affiliateId)}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Admin-only: creates a new promo code (Stripe coupon + promotion code).
|
|
125
|
+
*/
|
|
126
|
+
const createPromoCode = async (body, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/promo-codes`, authAPIOptions, otherOptions, {
|
|
127
|
+
method: "POST",
|
|
128
|
+
body
|
|
129
|
+
});
|
|
130
|
+
/**
|
|
131
|
+
* Admin-only: updates a promo code.
|
|
132
|
+
*/
|
|
133
|
+
const updatePromoCode = async ({ id, ...body }, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/promo-codes/${id}`, authAPIOptions, otherOptions, {
|
|
134
|
+
method: "PATCH",
|
|
135
|
+
body
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* Admin-only: deactivates a promo code (sets active=false, disables Stripe promotion code).
|
|
139
|
+
*/
|
|
140
|
+
const deletePromoCode = async ({ id }, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/promo-codes/${id}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
141
|
+
/**
|
|
142
|
+
* Retrieves the active promo code associated with a given affiliate referral code.
|
|
143
|
+
*/
|
|
144
|
+
const getAffiliatePromoCode = async (referralCode, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate-promo-code/${referralCode}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
96
145
|
return {
|
|
97
146
|
getPricing,
|
|
98
147
|
getSubscription,
|
|
@@ -105,11 +154,19 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = config) => {
|
|
|
105
154
|
getAffiliateById,
|
|
106
155
|
getAffiliate,
|
|
107
156
|
getAffiliateAccountSession,
|
|
157
|
+
getAffiliateOnboardingLink,
|
|
108
158
|
getAffiliateStats,
|
|
159
|
+
getAffiliateInvitations,
|
|
109
160
|
sendAffiliateInvitation,
|
|
110
161
|
getAffiliateInvitation,
|
|
111
162
|
acceptAffiliateInvitation,
|
|
112
|
-
updateAffiliateStatus
|
|
163
|
+
updateAffiliateStatus,
|
|
164
|
+
getPromoCodeById,
|
|
165
|
+
getPromoCodes,
|
|
166
|
+
createPromoCode,
|
|
167
|
+
updatePromoCode,
|
|
168
|
+
deletePromoCode,
|
|
169
|
+
getAffiliatePromoCode
|
|
113
170
|
};
|
|
114
171
|
};
|
|
115
172
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.mjs","names":["defaultConfiguration"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n AcceptAffiliateInvitationResult,\n CreatePortalSessionResult,\n GetAffiliateAccountSessionResult,\n GetAffiliateByIdResult,\n GetAffiliateInvitationResult,\n GetAffiliateResult,\n GetAffiliateStatsResult,\n GetAffiliatesParams,\n GetAffiliatesResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\n GrantAffiliateAccessBody,\n GrantAffiliateAccessResult,\n SendAffiliateInvitationBody,\n SendAffiliateInvitationResult,\n UpdateAffiliateStatusBody,\n UpdateAffiliateStatusResult,\n} from '@intlayer/backend';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = defaultConfiguration\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Lists invoices for the authenticated organization's Stripe customer.\n */\n const getInvoices = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetInvoicesResult>(\n `${STRIPE_API_ROUTE}/invoices`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the first card payment method for the authenticated organization's\n * Stripe customer (or null if none).\n */\n const getPaymentMethod = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetPaymentMethodResult>(\n `${STRIPE_API_ROUTE}/payment-method`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Billing Portal session for the authenticated organization.\n */\n const createPortalSession = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<CreatePortalSessionResult>(\n `${STRIPE_API_ROUTE}/portal-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.\n */\n const grantAffiliateAccess = async (\n body: GrantAffiliateAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GrantAffiliateAccessResult>(\n `${STRIPE_API_ROUTE}/affiliate/grant`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliates.\n */\n const getAffiliates = async (\n params?: GetAffiliatesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliatesResult>(\n `${STRIPE_API_ROUTE}/affiliates`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Admin-only: returns a single affiliate by ID.\n */\n const getAffiliateById = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateByIdResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the affiliate record for the authenticated user (null if not an affiliate).\n */\n const getAffiliate = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateResult>(\n `${STRIPE_API_ROUTE}/affiliate`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).\n */\n const getAffiliateAccountSession = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateAccountSessionResult>(\n `${STRIPE_API_ROUTE}/affiliate/account-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Returns referral stats for the authenticated affiliate.\n */\n const getAffiliateStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateStatsResult>(\n `${STRIPE_API_ROUTE}/affiliate/stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Sends an affiliate invitation email to the given address (admin only).\n */\n const sendAffiliateInvitation = async (\n body: SendAffiliateInvitationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SendAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invite`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Retrieves an affiliate invitation by token (public — no auth required).\n */\n const getAffiliateInvitation = async (\n { token }: { token: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: updates an affiliate's status and/or category.\n */\n const updateAffiliateStatus = async (\n { id }: { id: string },\n body: UpdateAffiliateStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateAffiliateStatusResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Accepts an affiliate invitation and creates the affiliate account.\n */\n const acceptAffiliateInvitation = async (\n { token, country }: { token: string; country?: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AcceptAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body: { country } }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n grantAffiliateAccess,\n getAffiliates,\n getAffiliateById,\n getAffiliate,\n getAffiliateAccountSession,\n getAffiliateStats,\n sendAffiliateInvitation,\n getAffiliateInvitation,\n acceptAffiliateInvitation,\n updateAffiliateStatus,\n };\n};\n"],"mappings":";;;;AA2BA,MAAa,gBACX,iBAAiC,CAAC,GAClC,iBAAiCA,WAC9B;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,WAEJ;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MA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hC,MAAM,QACJ,GAAG,iBAAiB,6BACpB,gBACA,cACA,EAAE,QAAQ,OAAO,CACnB;;;;CAKF,MAAM,oBAAoB,OAAO,eAA+B,CAAC,MAC/D,MAAM,QACJ,GAAG,iBAAiB,mBACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;CAKF,MAAM,0BAA0B,OAC9B,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,iBAAiB,oBACpB,gBACA,cACA;EAAE,QAAQ;EAAQ;CAAK,CACzB;;;;CAKF,MAAM,yBAAyB,OAC7B,EAAE,SACF,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,iBAAiB,wBAAwB,SAC5C,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;CAKF,MAAM,wBAAwB,OAC5B,EAAE,MACF,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,iBAAiB,cAAc,GAAG,UACrC,gBACA,cACA;EAAE,QAAQ;EAAS;CAAK,CAC1B;;;;CAKF,MAAM,4BAA4B,OAChC,EAAE,OAAO,WACT,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,iBAAiB,wBAAwB,MAAM,UAClD,gBACA,cACA;EAAE,QAAQ;EAAQ,MAAM,EAAE,QAAQ;CAAE,CACtC;CAEF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"stripe.mjs","names":["defaultConfiguration"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n AcceptAffiliateInvitationResult,\n CreatePortalSessionResult,\n CreatePromoCodeBody,\n CreatePromoCodeResult,\n DeletePromoCodeResult,\n GetAffiliateAccountSessionResult,\n GetAffiliateByIdResult,\n GetAffiliateInvitationResult,\n GetAffiliateInvitationsResult,\n GetAffiliateOnboardingLinkResult,\n GetAffiliateResult,\n GetAffiliateStatsResult,\n GetAffiliatesParams,\n GetAffiliatesResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\n GetPromoCodeByIdResult,\n GetPromoCodesResult,\n GrantAffiliateAccessBody,\n GrantAffiliateAccessResult,\n SendAffiliateInvitationBody,\n SendAffiliateInvitationResult,\n UpdateAffiliateStatusBody,\n UpdateAffiliateStatusResult,\n UpdatePromoCodeBody,\n UpdatePromoCodeResult,\n} from '@intlayer/backend';\nimport defaultConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = defaultConfiguration\n) => {\n const backendURL = intlayerConfig?.editor?.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Lists invoices for the authenticated organization's Stripe customer.\n */\n const getInvoices = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetInvoicesResult>(\n `${STRIPE_API_ROUTE}/invoices`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the first card payment method for the authenticated organization's\n * Stripe customer (or null if none).\n */\n const getPaymentMethod = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetPaymentMethodResult>(\n `${STRIPE_API_ROUTE}/payment-method`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Billing Portal session for the authenticated organization.\n */\n const createPortalSession = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<CreatePortalSessionResult>(\n `${STRIPE_API_ROUTE}/portal-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.\n */\n const grantAffiliateAccess = async (\n body: GrantAffiliateAccessBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GrantAffiliateAccessResult>(\n `${STRIPE_API_ROUTE}/affiliate/grant`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliates.\n */\n const getAffiliates = async (\n params?: GetAffiliatesParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliatesResult>(\n `${STRIPE_API_ROUTE}/affiliates`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Admin-only: returns a single affiliate by ID.\n */\n const getAffiliateById = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateByIdResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Returns the affiliate record for the authenticated user (null if not an affiliate).\n */\n const getAffiliate = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateResult>(\n `${STRIPE_API_ROUTE}/affiliate`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).\n */\n const getAffiliateAccountSession = async (\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateAccountSessionResult>(\n `${STRIPE_API_ROUTE}/affiliate/account-session`,\n authAPIOptions,\n otherOptions,\n { method: 'POST' }\n );\n\n /**\n * Returns a Stripe-hosted onboarding URL for the authenticated affiliate.\n */\n const getAffiliateOnboardingLink = async (\n params?: { returnUrl?: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateOnboardingLinkResult>(\n `${STRIPE_API_ROUTE}/affiliate/onboarding-link`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params }\n );\n\n /**\n * Returns referral stats for the authenticated affiliate.\n */\n const getAffiliateStats = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetAffiliateStatsResult>(\n `${STRIPE_API_ROUTE}/affiliate/stats`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: returns a paginated list of all affiliate invitations.\n */\n const getAffiliateInvitations = async (\n params: GetAffiliatesParams = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = new URLSearchParams();\n if (params.page) qs.set('page', String(params.page));\n if (params.pageSize) qs.set('pageSize', String(params.pageSize));\n if (params.search) qs.set('search', params.search);\n const query = qs.toString() ? `?${qs.toString()}` : '';\n return await fetcher<GetAffiliateInvitationsResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitations${query}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Sends an affiliate invitation email to the given address (admin only).\n */\n const sendAffiliateInvitation = async (\n body: SendAffiliateInvitationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SendAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invite`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Retrieves an affiliate invitation by token (public — no auth required).\n */\n const getAffiliateInvitation = async (\n { token }: { token: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n /**\n * Admin-only: updates an affiliate's status and/or category.\n */\n const updateAffiliateStatus = async (\n { id }: { id: string },\n body: UpdateAffiliateStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateAffiliateStatusResult>(\n `${STRIPE_API_ROUTE}/affiliates/${id}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Accepts an affiliate invitation and creates the affiliate account.\n */\n const acceptAffiliateInvitation = async (\n {\n token,\n country,\n stripeAccountType,\n }: {\n token: string;\n country?: string;\n stripeAccountType?: 'express' | 'standard';\n },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AcceptAffiliateInvitationResult>(\n `${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body: { country, stripeAccountType } }\n );\n\n /**\n * Admin-only: returns a paginated list of all promo codes.\n */\n const getPromoCodeById = async (\n id: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPromoCodeByIdResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getPromoCodes = async (\n params: { affiliateId?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const qs = params.affiliateId\n ? `?affiliateId=${encodeURIComponent(params.affiliateId)}`\n : '';\n return await fetcher<GetPromoCodesResult>(\n `${STRIPE_API_ROUTE}/promo-codes${qs}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n /**\n * Admin-only: creates a new promo code (Stripe coupon + promotion code).\n */\n const createPromoCode = async (\n body: CreatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n /**\n * Admin-only: updates a promo code.\n */\n const updatePromoCode = async (\n { id, ...body }: { id: string } & UpdatePromoCodeBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdatePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n /**\n * Admin-only: deactivates a promo code (sets active=false, disables Stripe promotion code).\n */\n const deletePromoCode = async (\n { id }: { id: string },\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeletePromoCodeResult>(\n `${STRIPE_API_ROUTE}/promo-codes/${id}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n /**\n * Retrieves the active promo code associated with a given affiliate referral code.\n */\n const getAffiliatePromoCode = async (\n referralCode: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<any>(\n `${STRIPE_API_ROUTE}/affiliate-promo-code/${referralCode}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n grantAffiliateAccess,\n getAffiliates,\n getAffiliateById,\n getAffiliate,\n getAffiliateAccountSession,\n getAffiliateOnboardingLink,\n getAffiliateStats,\n getAffiliateInvitations,\n sendAffiliateInvitation,\n getAffiliateInvitation,\n acceptAffiliateInvitation,\n updateAffiliateStatus,\n getPromoCodeById,\n getPromoCodes,\n createPromoCode,\n updatePromoCode,\n deletePromoCode,\n getAffiliatePromoCode,\n };\n};\n"],"mappings":";;;;AAoCA,MAAa,gBACX,iBAAiC,CAAC,GAClC,iBAAiCA,WAC9B;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,WAEJ;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,CAA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 import { getOAuthAPI } from "./getIntlayerAPI/oAuth.mjs";
|
|
|
11
11
|
import { getOrganizationAPI } from "./getIntlayerAPI/organization.mjs";
|
|
12
12
|
import { getProjectAPI } from "./getIntlayerAPI/project.mjs";
|
|
13
13
|
import { getSearchAPI } from "./getIntlayerAPI/search.mjs";
|
|
14
|
+
import { getShowcaseProjectAPI } from "./getIntlayerAPI/showcaseProject.mjs";
|
|
14
15
|
import { getStripeAPI } from "./getIntlayerAPI/stripe.mjs";
|
|
15
16
|
import { getTagAPI } from "./getIntlayerAPI/tag.mjs";
|
|
16
17
|
import { getTranslateAPI } from "./getIntlayerAPI/translate.mjs";
|
|
@@ -21,4 +22,4 @@ import { getIntlayerAPIProxy } from "./proxy.mjs";
|
|
|
21
22
|
import { fetchDistantDictionaries } from "./distantDictionary/fetchDistantDictionaries.mjs";
|
|
22
23
|
import { fetchDistantDictionary } from "./distantDictionary/fetchDistantDictionary.mjs";
|
|
23
24
|
|
|
24
|
-
export { fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getReviewerAPI, getSearchAPI, getStripeAPI, getTagAPI, getTranslateAPI, getUserAPI };
|
|
25
|
+
export { fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getReviewerAPI, getSearchAPI, getShowcaseProjectAPI, getStripeAPI, getTagAPI, getTranslateAPI, getUserAPI };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetcherOptions } from "../fetcher.js";
|
|
2
|
-
import { GetAffiliatesParams, GetCheckoutSessionBody, GetPricingBody, GrantAffiliateAccessBody, SendAffiliateInvitationBody, UpdateAffiliateStatusBody } from "@intlayer/backend";
|
|
2
|
+
import { CreatePromoCodeBody, GetAffiliatesParams, GetCheckoutSessionBody, GetPricingBody, GrantAffiliateAccessBody, SendAffiliateInvitationBody, UpdateAffiliateStatusBody, UpdatePromoCodeBody } from "@intlayer/backend";
|
|
3
3
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/stripe.d.ts
|
|
@@ -19,7 +19,11 @@ declare const getStripeAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: I
|
|
|
19
19
|
}, otherOptions?: FetcherOptions) => Promise<GetAffiliateByIdResult>;
|
|
20
20
|
getAffiliate: (otherOptions?: FetcherOptions) => Promise<GetAffiliateResult>;
|
|
21
21
|
getAffiliateAccountSession: (otherOptions?: FetcherOptions) => Promise<GetAffiliateAccountSessionResult>;
|
|
22
|
+
getAffiliateOnboardingLink: (params?: {
|
|
23
|
+
returnUrl?: string;
|
|
24
|
+
}, otherOptions?: FetcherOptions) => Promise<GetAffiliateOnboardingLinkResult>;
|
|
22
25
|
getAffiliateStats: (otherOptions?: FetcherOptions) => Promise<GetAffiliateStatsResult>;
|
|
26
|
+
getAffiliateInvitations: (params?: GetAffiliatesParams, otherOptions?: FetcherOptions) => Promise<GetAffiliateInvitationsResult>;
|
|
23
27
|
sendAffiliateInvitation: (body: SendAffiliateInvitationBody, otherOptions?: FetcherOptions) => Promise<SendAffiliateInvitationResult>;
|
|
24
28
|
getAffiliateInvitation: ({
|
|
25
29
|
token
|
|
@@ -28,16 +32,35 @@ declare const getStripeAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: I
|
|
|
28
32
|
}, otherOptions?: FetcherOptions) => Promise<GetAffiliateInvitationResult>;
|
|
29
33
|
acceptAffiliateInvitation: ({
|
|
30
34
|
token,
|
|
31
|
-
country
|
|
35
|
+
country,
|
|
36
|
+
stripeAccountType
|
|
32
37
|
}: {
|
|
33
38
|
token: string;
|
|
34
39
|
country?: string;
|
|
40
|
+
stripeAccountType?: "express" | "standard";
|
|
35
41
|
}, otherOptions?: FetcherOptions) => Promise<AcceptAffiliateInvitationResult>;
|
|
36
42
|
updateAffiliateStatus: ({
|
|
37
43
|
id
|
|
38
44
|
}: {
|
|
39
45
|
id: string;
|
|
40
46
|
}, body: UpdateAffiliateStatusBody, otherOptions?: FetcherOptions) => Promise<UpdateAffiliateStatusResult>;
|
|
47
|
+
getPromoCodeById: (id: string, otherOptions?: FetcherOptions) => Promise<GetPromoCodeByIdResult>;
|
|
48
|
+
getPromoCodes: (params?: {
|
|
49
|
+
affiliateId?: string;
|
|
50
|
+
}, otherOptions?: FetcherOptions) => Promise<GetPromoCodesResult>;
|
|
51
|
+
createPromoCode: (body: CreatePromoCodeBody, otherOptions?: FetcherOptions) => Promise<CreatePromoCodeResult>;
|
|
52
|
+
updatePromoCode: ({
|
|
53
|
+
id,
|
|
54
|
+
...body
|
|
55
|
+
}: {
|
|
56
|
+
id: string;
|
|
57
|
+
} & UpdatePromoCodeBody, otherOptions?: FetcherOptions) => Promise<UpdatePromoCodeResult>;
|
|
58
|
+
deletePromoCode: ({
|
|
59
|
+
id
|
|
60
|
+
}: {
|
|
61
|
+
id: string;
|
|
62
|
+
}, otherOptions?: FetcherOptions) => Promise<DeletePromoCodeResult>;
|
|
63
|
+
getAffiliatePromoCode: (referralCode: string, otherOptions?: FetcherOptions) => Promise<any>;
|
|
41
64
|
};
|
|
42
65
|
//#endregion
|
|
43
66
|
export { getStripeAPI };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"stripe.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"mappings":";;;;;cAoCa,YAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAgB,c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AAA,KAAc,OAAA,CAAA,qBAAA;;;;;IAaT,EAAA;EAAA,IAAe,mBAAA,EAAmB,YAAA,GACvC,cAAA,KAAc,OAAA,CAAA,qBAAA;;;;IAalB,EAAA;EAAA,GAAY,YAAA,GACR,cAAA,KAAc,OAAA,CAAA,qBAAA;gDAaR,YAAA,GACN,cAAA,KAAc,OAAA;AAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { getOAuthAPI } from "./getIntlayerAPI/oAuth.js";
|
|
|
13
13
|
import { getOrganizationAPI } from "./getIntlayerAPI/organization.js";
|
|
14
14
|
import { getProjectAPI } from "./getIntlayerAPI/project.js";
|
|
15
15
|
import { getSearchAPI } from "./getIntlayerAPI/search.js";
|
|
16
|
+
import { OtherShowcaseProjectsQuery, ShowcaseProjectsQuery, getShowcaseProjectAPI } from "./getIntlayerAPI/showcaseProject.js";
|
|
16
17
|
import { getStripeAPI } from "./getIntlayerAPI/stripe.js";
|
|
17
18
|
import { getTagAPI } from "./getIntlayerAPI/tag.js";
|
|
18
19
|
import { TranslateDictionariesBody, TranslateDictionariesResult, getTranslateAPI } from "./getIntlayerAPI/translate.js";
|
|
@@ -21,4 +22,4 @@ import { getUserAPI } from "./getIntlayerAPI/user.js";
|
|
|
21
22
|
import { IntlayerAPI, getIntlayerAPI } from "./getIntlayerAPI/index.js";
|
|
22
23
|
import { IntlayerAPIProxy, getIntlayerAPIProxy } from "./proxy.js";
|
|
23
24
|
import { AIOptions } from "./types.js";
|
|
24
|
-
export { type AIOptions, AskDocQuestionBody, type AskDocQuestionResult, type AuditEvent, AutocompleteBody, BitbucketAuthCallbackBody, BitbucketAuthCallbackResult, BitbucketCheckConfigBody, BitbucketCheckConfigResult, BitbucketGetAuthUrlResult, BitbucketGetConfigFileBody, BitbucketGetConfigFileResult, BitbucketListReposResult, BitbucketRepository, ChatBody, type ChatResult, ClientAction, DiscoverUrlsParams, DiscoverUrlsResult, FetcherOptions, GetRecursiveAuditStatusParams, type GetRecursiveAuditStatusResult, GitHubAuthCallbackBody, GitHubAuthCallbackResult, GitHubCheckConfigBody, GitHubCheckConfigResult, GitHubGetAuthUrlResult, GitHubGetConfigFileBody, GitHubGetConfigFileResult, GitHubGetTokenResult, GitHubListReposResult, GitHubRepository, GitLabAuthCallbackBody, GitLabAuthCallbackResult, GitLabCheckConfigBody, GitLabCheckConfigResult, GitLabGetAuthUrlResult, GitLabGetConfigFileBody, GitLabGetConfigFileResult, GitLabListProjectsResult, GitLabProject, IntlayerAPI, IntlayerAPIProxy, RecursiveAuditJobParams, ScanUrlBody, StartRecursiveAuditBody, type StartRecursiveAuditResult, type TranslateDictionariesBody, type TranslateDictionariesResult, fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getReviewerAPI, getSearchAPI, getStripeAPI, getTagAPI, getTranslateAPI, getUserAPI };
|
|
25
|
+
export { type AIOptions, AskDocQuestionBody, type AskDocQuestionResult, type AuditEvent, AutocompleteBody, BitbucketAuthCallbackBody, BitbucketAuthCallbackResult, BitbucketCheckConfigBody, BitbucketCheckConfigResult, BitbucketGetAuthUrlResult, BitbucketGetConfigFileBody, BitbucketGetConfigFileResult, BitbucketListReposResult, BitbucketRepository, ChatBody, type ChatResult, ClientAction, DiscoverUrlsParams, DiscoverUrlsResult, FetcherOptions, GetRecursiveAuditStatusParams, type GetRecursiveAuditStatusResult, GitHubAuthCallbackBody, GitHubAuthCallbackResult, GitHubCheckConfigBody, GitHubCheckConfigResult, GitHubGetAuthUrlResult, GitHubGetConfigFileBody, GitHubGetConfigFileResult, GitHubGetTokenResult, GitHubListReposResult, GitHubRepository, GitLabAuthCallbackBody, GitLabAuthCallbackResult, GitLabCheckConfigBody, GitLabCheckConfigResult, GitLabGetAuthUrlResult, GitLabGetConfigFileBody, GitLabGetConfigFileResult, GitLabListProjectsResult, GitLabProject, IntlayerAPI, IntlayerAPIProxy, OtherShowcaseProjectsQuery, RecursiveAuditJobParams, ScanUrlBody, ShowcaseProjectsQuery, StartRecursiveAuditBody, type StartRecursiveAuditResult, type TranslateDictionariesBody, type TranslateDictionariesResult, fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getReviewerAPI, getSearchAPI, getShowcaseProjectAPI, getStripeAPI, getTagAPI, getTranslateAPI, getUserAPI };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/api",
|
|
3
|
-
"version": "8.11.0
|
|
3
|
+
"version": "8.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SDK for interacting with the Intlayer API, enabling content auditing, and managing organizations, projects, and users.",
|
|
6
6
|
"keywords": [
|
|
@@ -38,6 +38,96 @@
|
|
|
38
38
|
"require": "./dist/cjs/index.cjs",
|
|
39
39
|
"import": "./dist/esm/index.mjs"
|
|
40
40
|
},
|
|
41
|
+
"./ai": {
|
|
42
|
+
"types": "./dist/types/getIntlayerAPI/ai.d.ts",
|
|
43
|
+
"require": "./dist/cjs/getIntlayerAPI/ai.cjs",
|
|
44
|
+
"import": "./dist/esm/getIntlayerAPI/ai.mjs"
|
|
45
|
+
},
|
|
46
|
+
"./audit": {
|
|
47
|
+
"types": "./dist/types/getIntlayerAPI/audit.d.ts",
|
|
48
|
+
"require": "./dist/cjs/getIntlayerAPI/audit.cjs",
|
|
49
|
+
"import": "./dist/esm/getIntlayerAPI/audit.mjs"
|
|
50
|
+
},
|
|
51
|
+
"./bitbucket": {
|
|
52
|
+
"types": "./dist/types/getIntlayerAPI/bitbucket.d.ts",
|
|
53
|
+
"require": "./dist/cjs/getIntlayerAPI/bitbucket.cjs",
|
|
54
|
+
"import": "./dist/esm/getIntlayerAPI/bitbucket.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./dictionary": {
|
|
57
|
+
"types": "./dist/types/getIntlayerAPI/dictionary.d.ts",
|
|
58
|
+
"require": "./dist/cjs/getIntlayerAPI/dictionary.cjs",
|
|
59
|
+
"import": "./dist/esm/getIntlayerAPI/dictionary.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./editor": {
|
|
62
|
+
"types": "./dist/types/getIntlayerAPI/editor.d.ts",
|
|
63
|
+
"require": "./dist/cjs/getIntlayerAPI/editor.cjs",
|
|
64
|
+
"import": "./dist/esm/getIntlayerAPI/editor.mjs"
|
|
65
|
+
},
|
|
66
|
+
"./github": {
|
|
67
|
+
"types": "./dist/types/getIntlayerAPI/github.d.ts",
|
|
68
|
+
"require": "./dist/cjs/getIntlayerAPI/github.cjs",
|
|
69
|
+
"import": "./dist/esm/getIntlayerAPI/github.mjs"
|
|
70
|
+
},
|
|
71
|
+
"./gitlab": {
|
|
72
|
+
"types": "./dist/types/getIntlayerAPI/gitlab.d.ts",
|
|
73
|
+
"require": "./dist/cjs/getIntlayerAPI/gitlab.cjs",
|
|
74
|
+
"import": "./dist/esm/getIntlayerAPI/gitlab.mjs"
|
|
75
|
+
},
|
|
76
|
+
"./newsletter": {
|
|
77
|
+
"types": "./dist/types/getIntlayerAPI/newsletter.d.ts",
|
|
78
|
+
"require": "./dist/cjs/getIntlayerAPI/newsletter.cjs",
|
|
79
|
+
"import": "./dist/esm/getIntlayerAPI/newsletter.mjs"
|
|
80
|
+
},
|
|
81
|
+
"./oAuth": {
|
|
82
|
+
"types": "./dist/types/getIntlayerAPI/oAuth.d.ts",
|
|
83
|
+
"require": "./dist/cjs/getIntlayerAPI/oAuth.cjs",
|
|
84
|
+
"import": "./dist/esm/getIntlayerAPI/oAuth.mjs"
|
|
85
|
+
},
|
|
86
|
+
"./organization": {
|
|
87
|
+
"types": "./dist/types/getIntlayerAPI/organization.d.ts",
|
|
88
|
+
"require": "./dist/cjs/getIntlayerAPI/organization.cjs",
|
|
89
|
+
"import": "./dist/esm/getIntlayerAPI/organization.mjs"
|
|
90
|
+
},
|
|
91
|
+
"./project": {
|
|
92
|
+
"types": "./dist/types/getIntlayerAPI/project.d.ts",
|
|
93
|
+
"require": "./dist/cjs/getIntlayerAPI/project.cjs",
|
|
94
|
+
"import": "./dist/esm/getIntlayerAPI/project.mjs"
|
|
95
|
+
},
|
|
96
|
+
"./search": {
|
|
97
|
+
"types": "./dist/types/getIntlayerAPI/search.d.ts",
|
|
98
|
+
"require": "./dist/cjs/getIntlayerAPI/search.cjs",
|
|
99
|
+
"import": "./dist/esm/getIntlayerAPI/search.mjs"
|
|
100
|
+
},
|
|
101
|
+
"./showcaseProject": {
|
|
102
|
+
"types": "./dist/types/getIntlayerAPI/showcaseProject.d.ts",
|
|
103
|
+
"require": "./dist/cjs/getIntlayerAPI/showcaseProject.cjs",
|
|
104
|
+
"import": "./dist/esm/getIntlayerAPI/showcaseProject.mjs"
|
|
105
|
+
},
|
|
106
|
+
"./stripe": {
|
|
107
|
+
"types": "./dist/types/getIntlayerAPI/stripe.d.ts",
|
|
108
|
+
"require": "./dist/cjs/getIntlayerAPI/stripe.cjs",
|
|
109
|
+
"import": "./dist/esm/getIntlayerAPI/stripe.mjs"
|
|
110
|
+
},
|
|
111
|
+
"./tag": {
|
|
112
|
+
"types": "./dist/types/getIntlayerAPI/tag.d.ts",
|
|
113
|
+
"require": "./dist/cjs/getIntlayerAPI/tag.cjs",
|
|
114
|
+
"import": "./dist/esm/getIntlayerAPI/tag.mjs"
|
|
115
|
+
},
|
|
116
|
+
"./translate": {
|
|
117
|
+
"types": "./dist/types/getIntlayerAPI/translate.d.ts",
|
|
118
|
+
"require": "./dist/cjs/getIntlayerAPI/translate.cjs",
|
|
119
|
+
"import": "./dist/esm/getIntlayerAPI/translate.mjs"
|
|
120
|
+
},
|
|
121
|
+
"./reviewer": {
|
|
122
|
+
"types": "./dist/types/getIntlayerAPI/reviewer.d.ts",
|
|
123
|
+
"require": "./dist/cjs/getIntlayerAPI/reviewer.cjs",
|
|
124
|
+
"import": "./dist/esm/getIntlayerAPI/reviewer.mjs"
|
|
125
|
+
},
|
|
126
|
+
"./user": {
|
|
127
|
+
"types": "./dist/types/getIntlayerAPI/user.d.ts",
|
|
128
|
+
"require": "./dist/cjs/getIntlayerAPI/user.cjs",
|
|
129
|
+
"import": "./dist/esm/getIntlayerAPI/user.mjs"
|
|
130
|
+
},
|
|
41
131
|
"./package.json": "./package.json"
|
|
42
132
|
},
|
|
43
133
|
"main": "dist/cjs/index.cjs",
|
|
@@ -45,6 +135,60 @@
|
|
|
45
135
|
"types": "dist/types/index.d.ts",
|
|
46
136
|
"typesVersions": {
|
|
47
137
|
"*": {
|
|
138
|
+
"ai": [
|
|
139
|
+
"./dist/types/getIntlayerAPI/ai.d.ts"
|
|
140
|
+
],
|
|
141
|
+
"audit": [
|
|
142
|
+
"./dist/types/getIntlayerAPI/audit.d.ts"
|
|
143
|
+
],
|
|
144
|
+
"bitbucket": [
|
|
145
|
+
"./dist/types/getIntlayerAPI/bitbucket.d.ts"
|
|
146
|
+
],
|
|
147
|
+
"dictionary": [
|
|
148
|
+
"./dist/types/getIntlayerAPI/dictionary.d.ts"
|
|
149
|
+
],
|
|
150
|
+
"editor": [
|
|
151
|
+
"./dist/types/getIntlayerAPI/editor.d.ts"
|
|
152
|
+
],
|
|
153
|
+
"github": [
|
|
154
|
+
"./dist/types/getIntlayerAPI/github.d.ts"
|
|
155
|
+
],
|
|
156
|
+
"gitlab": [
|
|
157
|
+
"./dist/types/getIntlayerAPI/gitlab.d.ts"
|
|
158
|
+
],
|
|
159
|
+
"newsletter": [
|
|
160
|
+
"./dist/types/getIntlayerAPI/newsletter.d.ts"
|
|
161
|
+
],
|
|
162
|
+
"oAuth": [
|
|
163
|
+
"./dist/types/getIntlayerAPI/oAuth.d.ts"
|
|
164
|
+
],
|
|
165
|
+
"organization": [
|
|
166
|
+
"./dist/types/getIntlayerAPI/organization.d.ts"
|
|
167
|
+
],
|
|
168
|
+
"project": [
|
|
169
|
+
"./dist/types/getIntlayerAPI/project.d.ts"
|
|
170
|
+
],
|
|
171
|
+
"search": [
|
|
172
|
+
"./dist/types/getIntlayerAPI/search.d.ts"
|
|
173
|
+
],
|
|
174
|
+
"showcaseProject": [
|
|
175
|
+
"./dist/types/getIntlayerAPI/showcaseProject.d.ts"
|
|
176
|
+
],
|
|
177
|
+
"stripe": [
|
|
178
|
+
"./dist/types/getIntlayerAPI/stripe.d.ts"
|
|
179
|
+
],
|
|
180
|
+
"tag": [
|
|
181
|
+
"./dist/types/getIntlayerAPI/tag.d.ts"
|
|
182
|
+
],
|
|
183
|
+
"translate": [
|
|
184
|
+
"./dist/types/getIntlayerAPI/translate.d.ts"
|
|
185
|
+
],
|
|
186
|
+
"reviewer": [
|
|
187
|
+
"./dist/types/getIntlayerAPI/reviewer.d.ts"
|
|
188
|
+
],
|
|
189
|
+
"user": [
|
|
190
|
+
"./dist/types/getIntlayerAPI/user.d.ts"
|
|
191
|
+
],
|
|
48
192
|
"package.json": [
|
|
49
193
|
"./package.json"
|
|
50
194
|
]
|
|
@@ -72,8 +216,8 @@
|
|
|
72
216
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
73
217
|
},
|
|
74
218
|
"dependencies": {
|
|
75
|
-
"@intlayer/config": "8.11.0
|
|
76
|
-
"@intlayer/types": "8.11.0
|
|
219
|
+
"@intlayer/config": "8.11.0",
|
|
220
|
+
"@intlayer/types": "8.11.0",
|
|
77
221
|
"defu": "6.1.7"
|
|
78
222
|
},
|
|
79
223
|
"devDependencies": {
|