@intlayer/api 8.6.3 → 8.6.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["builtConfiguration","getOrganizationAPI","getProjectAPI","getUserAPI","getOAuthAPI","getDictionaryAPI","getStripeAPI","getAiAPI","getAuditAPI","getTagAPI","getSearchAPI","getEditorAPI","getNewsletterAPI","getGithubAPI","getGitlabAPI","getBitbucketAPI","getShowcaseProjectAPI"],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import builtConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuditAPI } from './audit';\nimport { getBitbucketAPI } from './bitbucket';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getGithubAPI } from './github';\nimport { getGitlabAPI } from './gitlab';\nimport { getNewsletterAPI } from './newsletter';\nimport { getOAuthAPI } from './oAuth';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getSearchAPI } from './search';\nimport { getShowcaseProjectAPI } from './showcaseProject';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\ninterface IntlayerAPIReturn {\n organization: ReturnType<typeof getOrganizationAPI>;\n project: ReturnType<typeof getProjectAPI>;\n user: ReturnType<typeof getUserAPI>;\n oAuth: ReturnType<typeof getOAuthAPI>;\n dictionary: ReturnType<typeof getDictionaryAPI>;\n stripe: ReturnType<typeof getStripeAPI>;\n ai: ReturnType<typeof getAiAPI>;\n audit: ReturnType<typeof getAuditAPI>;\n tag: ReturnType<typeof getTagAPI>;\n search: ReturnType<typeof getSearchAPI>;\n editor: ReturnType<typeof getEditorAPI>;\n newsletter: ReturnType<typeof getNewsletterAPI>;\n github: ReturnType<typeof getGithubAPI>;\n gitlab: ReturnType<typeof getGitlabAPI>;\n bitbucket: ReturnType<typeof getBitbucketAPI>;\n showcaseProject: ReturnType<typeof getShowcaseProjectAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(\n intlayerConfig ?? {},\n builtConfiguration\n ) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(resolvedConfig),\n dictionary: getDictionaryAPI(authAPIOptions, resolvedConfig),\n stripe: getStripeAPI(authAPIOptions, resolvedConfig),\n ai: getAiAPI(authAPIOptions, resolvedConfig),\n audit: getAuditAPI(authAPIOptions, resolvedConfig),\n tag: getTagAPI(authAPIOptions, resolvedConfig),\n search: getSearchAPI(authAPIOptions, resolvedConfig),\n editor: getEditorAPI(authAPIOptions, resolvedConfig),\n newsletter: getNewsletterAPI(authAPIOptions, resolvedConfig),\n github: getGithubAPI(authAPIOptions, resolvedConfig),\n gitlab: getGitlabAPI(authAPIOptions, resolvedConfig),\n bitbucket: getBitbucketAPI(authAPIOptions, resolvedConfig),\n showcaseProject: getShowcaseProjectAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,kBACX,iBAAiC,EAAE,EACnC,mBACsB;CACtB,MAAM,gCACJ,kBAAkB,EAAE,EACpBA,+BACD;AAED,QAAO;EACL,cAAcC,uDAAmB,gBAAgB,eAAe;EAChE,SAASC,6CAAc,gBAAgB,eAAe;EACtD,MAAMC,uCAAW,gBAAgB,eAAe;EAChD,OAAOC,yCAAY,eAAe;EAClC,YAAYC,mDAAiB,gBAAgB,eAAe;EAC5D,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,IAAIC,mCAAS,gBAAgB,eAAe;EAC5C,OAAOC,yCAAY,gBAAgB,eAAe;EAClD,KAAKC,qCAAU,gBAAgB,eAAe;EAC9C,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,YAAYC,mDAAiB,gBAAgB,eAAe;EAC5D,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,WAAWC,iDAAgB,gBAAgB,eAAe;EAC1D,iBAAiBC,6DAAsB,gBAAgB,eAAe;EACvE"}
1
+ {"version":3,"file":"index.cjs","names":["defaultConfiguration","getOrganizationAPI","getProjectAPI","getUserAPI","getOAuthAPI","getDictionaryAPI","getStripeAPI","getAiAPI","getAuditAPI","getTagAPI","getSearchAPI","getEditorAPI","getNewsletterAPI","getGithubAPI","getGitlabAPI","getBitbucketAPI","getShowcaseProjectAPI"],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import { default as defaultConfiguration } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuditAPI } from './audit';\nimport { getBitbucketAPI } from './bitbucket';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getGithubAPI } from './github';\nimport { getGitlabAPI } from './gitlab';\nimport { getNewsletterAPI } from './newsletter';\nimport { getOAuthAPI } from './oAuth';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getSearchAPI } from './search';\nimport { getShowcaseProjectAPI } from './showcaseProject';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\ninterface IntlayerAPIReturn {\n organization: ReturnType<typeof getOrganizationAPI>;\n project: ReturnType<typeof getProjectAPI>;\n user: ReturnType<typeof getUserAPI>;\n oAuth: ReturnType<typeof getOAuthAPI>;\n dictionary: ReturnType<typeof getDictionaryAPI>;\n stripe: ReturnType<typeof getStripeAPI>;\n ai: ReturnType<typeof getAiAPI>;\n audit: ReturnType<typeof getAuditAPI>;\n tag: ReturnType<typeof getTagAPI>;\n search: ReturnType<typeof getSearchAPI>;\n editor: ReturnType<typeof getEditorAPI>;\n newsletter: ReturnType<typeof getNewsletterAPI>;\n github: ReturnType<typeof getGithubAPI>;\n gitlab: ReturnType<typeof getGitlabAPI>;\n bitbucket: ReturnType<typeof getBitbucketAPI>;\n showcaseProject: ReturnType<typeof getShowcaseProjectAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(\n intlayerConfig ?? {},\n defaultConfiguration\n ) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(resolvedConfig),\n dictionary: getDictionaryAPI(authAPIOptions, resolvedConfig),\n stripe: getStripeAPI(authAPIOptions, resolvedConfig),\n ai: getAiAPI(authAPIOptions, resolvedConfig),\n audit: getAuditAPI(authAPIOptions, resolvedConfig),\n tag: getTagAPI(authAPIOptions, resolvedConfig),\n search: getSearchAPI(authAPIOptions, resolvedConfig),\n editor: getEditorAPI(authAPIOptions, resolvedConfig),\n newsletter: getNewsletterAPI(authAPIOptions, resolvedConfig),\n github: getGithubAPI(authAPIOptions, resolvedConfig),\n gitlab: getGitlabAPI(authAPIOptions, resolvedConfig),\n bitbucket: getBitbucketAPI(authAPIOptions, resolvedConfig),\n showcaseProject: getShowcaseProjectAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,kBACX,iBAAiC,EAAE,EACnC,mBACsB;CACtB,MAAM,gCACJ,kBAAkB,EAAE,EACpBA,+BACD;AAED,QAAO;EACL,cAAcC,uDAAmB,gBAAgB,eAAe;EAChE,SAASC,6CAAc,gBAAgB,eAAe;EACtD,MAAMC,uCAAW,gBAAgB,eAAe;EAChD,OAAOC,yCAAY,eAAe;EAClC,YAAYC,mDAAiB,gBAAgB,eAAe;EAC5D,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,IAAIC,mCAAS,gBAAgB,eAAe;EAC5C,OAAOC,yCAAY,gBAAgB,eAAe;EAClD,KAAKC,qCAAU,gBAAgB,eAAe;EAC9C,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,YAAYC,mDAAiB,gBAAgB,eAAe;EAC5D,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,QAAQC,2CAAa,gBAAgB,eAAe;EACpD,WAAWC,iDAAgB,gBAAgB,eAAe;EAC1D,iBAAiBC,6DAAsB,gBAAgB,eAAe;EACvE"}
@@ -1 +1 @@
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
+ {"version":3,"file":"stripe.cjs","names":["defaultConfiguration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '@intlayer/backend';\nimport { default as 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 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"}
@@ -14,12 +14,12 @@ import { getShowcaseProjectAPI } from "./showcaseProject.mjs";
14
14
  import { getStripeAPI } from "./stripe.mjs";
15
15
  import { getTagAPI } from "./tag.mjs";
16
16
  import { getUserAPI } from "./user.mjs";
17
- import builtConfiguration from "@intlayer/config/built";
17
+ import defaultConfiguration from "@intlayer/config/built";
18
18
  import { defu } from "defu";
19
19
 
20
20
  //#region src/getIntlayerAPI/index.ts
21
21
  const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig) => {
22
- const resolvedConfig = defu(intlayerConfig ?? {}, builtConfiguration);
22
+ const resolvedConfig = defu(intlayerConfig ?? {}, defaultConfiguration);
23
23
  return {
24
24
  organization: getOrganizationAPI(authAPIOptions, resolvedConfig),
25
25
  project: getProjectAPI(authAPIOptions, resolvedConfig),
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import builtConfiguration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuditAPI } from './audit';\nimport { getBitbucketAPI } from './bitbucket';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getGithubAPI } from './github';\nimport { getGitlabAPI } from './gitlab';\nimport { getNewsletterAPI } from './newsletter';\nimport { getOAuthAPI } from './oAuth';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getSearchAPI } from './search';\nimport { getShowcaseProjectAPI } from './showcaseProject';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\ninterface IntlayerAPIReturn {\n organization: ReturnType<typeof getOrganizationAPI>;\n project: ReturnType<typeof getProjectAPI>;\n user: ReturnType<typeof getUserAPI>;\n oAuth: ReturnType<typeof getOAuthAPI>;\n dictionary: ReturnType<typeof getDictionaryAPI>;\n stripe: ReturnType<typeof getStripeAPI>;\n ai: ReturnType<typeof getAiAPI>;\n audit: ReturnType<typeof getAuditAPI>;\n tag: ReturnType<typeof getTagAPI>;\n search: ReturnType<typeof getSearchAPI>;\n editor: ReturnType<typeof getEditorAPI>;\n newsletter: ReturnType<typeof getNewsletterAPI>;\n github: ReturnType<typeof getGithubAPI>;\n gitlab: ReturnType<typeof getGitlabAPI>;\n bitbucket: ReturnType<typeof getBitbucketAPI>;\n showcaseProject: ReturnType<typeof getShowcaseProjectAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(\n intlayerConfig ?? {},\n builtConfiguration\n ) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(resolvedConfig),\n dictionary: getDictionaryAPI(authAPIOptions, resolvedConfig),\n stripe: getStripeAPI(authAPIOptions, resolvedConfig),\n ai: getAiAPI(authAPIOptions, resolvedConfig),\n audit: getAuditAPI(authAPIOptions, resolvedConfig),\n tag: getTagAPI(authAPIOptions, resolvedConfig),\n search: getSearchAPI(authAPIOptions, resolvedConfig),\n editor: getEditorAPI(authAPIOptions, resolvedConfig),\n newsletter: getNewsletterAPI(authAPIOptions, resolvedConfig),\n github: getGithubAPI(authAPIOptions, resolvedConfig),\n gitlab: getGitlabAPI(authAPIOptions, resolvedConfig),\n bitbucket: getBitbucketAPI(authAPIOptions, resolvedConfig),\n showcaseProject: getShowcaseProjectAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,kBACX,iBAAiC,EAAE,EACnC,mBACsB;CACtB,MAAM,iBAAiB,KACrB,kBAAkB,EAAE,EACpB,mBACD;AAED,QAAO;EACL,cAAc,mBAAmB,gBAAgB,eAAe;EAChE,SAAS,cAAc,gBAAgB,eAAe;EACtD,MAAM,WAAW,gBAAgB,eAAe;EAChD,OAAO,YAAY,eAAe;EAClC,YAAY,iBAAiB,gBAAgB,eAAe;EAC5D,QAAQ,aAAa,gBAAgB,eAAe;EACpD,IAAI,SAAS,gBAAgB,eAAe;EAC5C,OAAO,YAAY,gBAAgB,eAAe;EAClD,KAAK,UAAU,gBAAgB,eAAe;EAC9C,QAAQ,aAAa,gBAAgB,eAAe;EACpD,QAAQ,aAAa,gBAAgB,eAAe;EACpD,YAAY,iBAAiB,gBAAgB,eAAe;EAC5D,QAAQ,aAAa,gBAAgB,eAAe;EACpD,QAAQ,aAAa,gBAAgB,eAAe;EACpD,WAAW,gBAAgB,gBAAgB,eAAe;EAC1D,iBAAiB,sBAAsB,gBAAgB,eAAe;EACvE"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import { default as defaultConfiguration } from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { defu } from 'defu';\nimport type { FetcherOptions } from '../fetcher';\nimport { getAiAPI } from './ai';\nimport { getAuditAPI } from './audit';\nimport { getBitbucketAPI } from './bitbucket';\nimport { getDictionaryAPI } from './dictionary';\nimport { getEditorAPI } from './editor';\nimport { getGithubAPI } from './github';\nimport { getGitlabAPI } from './gitlab';\nimport { getNewsletterAPI } from './newsletter';\nimport { getOAuthAPI } from './oAuth';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getSearchAPI } from './search';\nimport { getShowcaseProjectAPI } from './showcaseProject';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\ninterface IntlayerAPIReturn {\n organization: ReturnType<typeof getOrganizationAPI>;\n project: ReturnType<typeof getProjectAPI>;\n user: ReturnType<typeof getUserAPI>;\n oAuth: ReturnType<typeof getOAuthAPI>;\n dictionary: ReturnType<typeof getDictionaryAPI>;\n stripe: ReturnType<typeof getStripeAPI>;\n ai: ReturnType<typeof getAiAPI>;\n audit: ReturnType<typeof getAuditAPI>;\n tag: ReturnType<typeof getTagAPI>;\n search: ReturnType<typeof getSearchAPI>;\n editor: ReturnType<typeof getEditorAPI>;\n newsletter: ReturnType<typeof getNewsletterAPI>;\n github: ReturnType<typeof getGithubAPI>;\n gitlab: ReturnType<typeof getGitlabAPI>;\n bitbucket: ReturnType<typeof getBitbucketAPI>;\n showcaseProject: ReturnType<typeof getShowcaseProjectAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(\n intlayerConfig ?? {},\n defaultConfiguration\n ) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(resolvedConfig),\n dictionary: getDictionaryAPI(authAPIOptions, resolvedConfig),\n stripe: getStripeAPI(authAPIOptions, resolvedConfig),\n ai: getAiAPI(authAPIOptions, resolvedConfig),\n audit: getAuditAPI(authAPIOptions, resolvedConfig),\n tag: getTagAPI(authAPIOptions, resolvedConfig),\n search: getSearchAPI(authAPIOptions, resolvedConfig),\n editor: getEditorAPI(authAPIOptions, resolvedConfig),\n newsletter: getNewsletterAPI(authAPIOptions, resolvedConfig),\n github: getGithubAPI(authAPIOptions, resolvedConfig),\n gitlab: getGitlabAPI(authAPIOptions, resolvedConfig),\n bitbucket: getBitbucketAPI(authAPIOptions, resolvedConfig),\n showcaseProject: getShowcaseProjectAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,kBACX,iBAAiC,EAAE,EACnC,mBACsB;CACtB,MAAM,iBAAiB,KACrB,kBAAkB,EAAE,EACpB,qBACD;AAED,QAAO;EACL,cAAc,mBAAmB,gBAAgB,eAAe;EAChE,SAAS,cAAc,gBAAgB,eAAe;EACtD,MAAM,WAAW,gBAAgB,eAAe;EAChD,OAAO,YAAY,eAAe;EAClC,YAAY,iBAAiB,gBAAgB,eAAe;EAC5D,QAAQ,aAAa,gBAAgB,eAAe;EACpD,IAAI,SAAS,gBAAgB,eAAe;EAC5C,OAAO,YAAY,gBAAgB,eAAe;EAClD,KAAK,UAAU,gBAAgB,eAAe;EAC9C,QAAQ,aAAa,gBAAgB,eAAe;EACpD,QAAQ,aAAa,gBAAgB,eAAe;EACpD,YAAY,iBAAiB,gBAAgB,eAAe;EAC5D,QAAQ,aAAa,gBAAgB,eAAe;EACpD,QAAQ,aAAa,gBAAgB,eAAe;EACpD,WAAW,gBAAgB,gBAAgB,eAAe;EAC1D,iBAAiB,sBAAsB,gBAAgB,eAAe;EACvE"}
@@ -1,8 +1,8 @@
1
1
  import { fetcher } from "../fetcher.mjs";
2
- import builtConfiguration from "@intlayer/config/built";
2
+ import defaultConfiguration from "@intlayer/config/built";
3
3
 
4
4
  //#region src/getIntlayerAPI/stripe.ts
5
- const getStripeAPI = (authAPIOptions = {}, intlayerConfig = builtConfiguration) => {
5
+ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = defaultConfiguration) => {
6
6
  const STRIPE_API_ROUTE = `${intlayerConfig?.editor?.backendURL}/api/stripe`;
7
7
  /**
8
8
  * Get a pricing plan calculated for a given promotion code.
@@ -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 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"}
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 { default as 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 return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":";;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,iBAAiC,yBAC9B;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/api",
3
- "version": "8.6.3",
3
+ "version": "8.6.5",
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.6.3",
76
- "@intlayer/types": "8.6.3",
75
+ "@intlayer/config": "8.6.5",
76
+ "@intlayer/types": "8.6.5",
77
77
  "defu": "6.1.4"
78
78
  },
79
79
  "devDependencies": {