@intlayer/api 8.4.6 → 8.4.8
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 +5 -2
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs +3 -2
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts +1 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_fetcher = require('../fetcher.cjs');
|
|
4
|
+
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
|
+
_intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
|
|
3
6
|
|
|
4
7
|
//#region src/getIntlayerAPI/stripe.ts
|
|
5
|
-
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const STRIPE_API_ROUTE = `${intlayerConfig
|
|
8
|
+
const getStripeAPI = (authAPIOptions = {}, intlayerConfig = _intlayer_config_built.default) => {
|
|
9
|
+
const STRIPE_API_ROUTE = `${intlayerConfig?.editor?.backendURL}/api/stripe`;
|
|
7
10
|
/**
|
|
8
11
|
* Get a pricing plan calculated for a given promotion code.
|
|
9
12
|
* @param body - Pricing plan body.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.cjs","names":["fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig
|
|
1
|
+
{"version":3,"file":"stripe.cjs","names":["builtConfiguration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '@intlayer/backend';\nimport builtConfiguration 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 = builtConfiguration\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 return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":";;;;;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,iBAAiCA,mCAC9B;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,WAEJ;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { fetcher } from "../fetcher.mjs";
|
|
2
|
+
import builtConfiguration from "@intlayer/config/built";
|
|
2
3
|
|
|
3
4
|
//#region src/getIntlayerAPI/stripe.ts
|
|
4
|
-
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
5
|
-
const STRIPE_API_ROUTE = `${intlayerConfig
|
|
5
|
+
const getStripeAPI = (authAPIOptions = {}, intlayerConfig = builtConfiguration) => {
|
|
6
|
+
const STRIPE_API_ROUTE = `${intlayerConfig?.editor?.backendURL}/api/stripe`;
|
|
6
7
|
/**
|
|
7
8
|
* Get a pricing plan calculated for a given promotion code.
|
|
8
9
|
* @param body - Pricing plan body.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.mjs","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig
|
|
1
|
+
{"version":3,"file":"stripe.mjs","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '@intlayer/backend';\nimport builtConfiguration 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 = builtConfiguration\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 return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":";;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,iBAAiC,uBAC9B;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,WAEJ;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
|
|
@@ -3,7 +3,7 @@ import { GetCheckoutSessionBody, GetPricingBody } from "@intlayer/backend";
|
|
|
3
3
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
4
|
|
|
5
5
|
//#region src/getIntlayerAPI/stripe.d.ts
|
|
6
|
-
declare const getStripeAPI: (authAPIOptions
|
|
6
|
+
declare const getStripeAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
7
7
|
getPricing: (body?: GetPricingBody, otherOptions?: FetcherOptions) => Promise<GetPricingResult>;
|
|
8
8
|
getSubscription: (body?: GetCheckoutSessionBody, otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
|
|
9
9
|
cancelSubscription: (otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
|
|
@@ -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":";;;;;cAUa,YAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAgB,cAAA;sBAWP,cAAA,EAAc,YAAA,GACP,cAAA,KAAc,OAAA,CAAA,gBAAA;2BAiBrB,sBAAA,EAAsB,YAAA,GACf,cAAA,KAAc,OAAA,CAAA,wBAAA;sCAgBkB,cAAA,KAAc,OAAA,CAAA,wBAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/api",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.8",
|
|
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": [
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@intlayer/config": "8.4.
|
|
76
|
-
"@intlayer/types": "8.4.
|
|
75
|
+
"@intlayer/config": "8.4.8",
|
|
76
|
+
"@intlayer/types": "8.4.8",
|
|
77
77
|
"defu": "6.1.4"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|