@intlayer/api 8.10.0 → 8.11.0-canary.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.
@@ -16,6 +16,7 @@ const require_getIntlayerAPI_showcaseProject = require('./showcaseProject.cjs');
16
16
  const require_getIntlayerAPI_stripe = require('./stripe.cjs');
17
17
  const require_getIntlayerAPI_tag = require('./tag.cjs');
18
18
  const require_getIntlayerAPI_translate = require('./translate.cjs');
19
+ const require_getIntlayerAPI_reviewer = require('./reviewer.cjs');
19
20
  const require_getIntlayerAPI_user = require('./user.cjs');
20
21
  let _intlayer_config_built = require("@intlayer/config/built");
21
22
  _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
@@ -41,7 +42,8 @@ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig = _intlayer_config_b
41
42
  gitlab: require_getIntlayerAPI_gitlab.getGitlabAPI(authAPIOptions, resolvedConfig),
42
43
  bitbucket: require_getIntlayerAPI_bitbucket.getBitbucketAPI(authAPIOptions, resolvedConfig),
43
44
  showcaseProject: require_getIntlayerAPI_showcaseProject.getShowcaseProjectAPI(authAPIOptions, resolvedConfig),
44
- translate: require_getIntlayerAPI_translate.getTranslateAPI(authAPIOptions, resolvedConfig)
45
+ translate: require_getIntlayerAPI_translate.getTranslateAPI(authAPIOptions, resolvedConfig),
46
+ reviewer: require_getIntlayerAPI_reviewer.getReviewerAPI(authAPIOptions, resolvedConfig)
45
47
  };
46
48
  };
47
49
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["config","getOrganizationAPI","getProjectAPI","getUserAPI","getOAuthAPI","getDictionaryAPI","getStripeAPI","getAiAPI","getAuditAPI","getTagAPI","getSearchAPI","getEditorAPI","getNewsletterAPI","getGithubAPI","getGitlabAPI","getBitbucketAPI","getShowcaseProjectAPI","getTranslateAPI"],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import config 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 { getTranslateAPI } from './translate';\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 translate: ReturnType<typeof getTranslateAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = config\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(intlayerConfig ?? {}, config) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(authAPIOptions, 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 translate: getTranslateAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,kBACX,iBAAiC,CAAC,GAClC,iBAAiCA,mCACX;CACtB,MAAM,gCAAsB,kBAAkB,CAAC,GAAGA,8BAAM;CAExD,OAAO;EACL,cAAcC,uDAAmB,gBAAgB,cAAc;EAC/D,SAASC,6CAAc,gBAAgB,cAAc;EACrD,MAAMC,uCAAW,gBAAgB,cAAc;EAC/C,OAAOC,yCAAY,gBAAgB,cAAc;EACjD,YAAYC,mDAAiB,gBAAgB,cAAc;EAC3D,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,IAAIC,mCAAS,gBAAgB,cAAc;EAC3C,OAAOC,yCAAY,gBAAgB,cAAc;EACjD,KAAKC,qCAAU,gBAAgB,cAAc;EAC7C,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,YAAYC,mDAAiB,gBAAgB,cAAc;EAC3D,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,WAAWC,iDAAgB,gBAAgB,cAAc;EACzD,iBAAiBC,6DAAsB,gBAAgB,cAAc;EACrE,WAAWC,iDAAgB,gBAAgB,cAAc;CAC3D;AACF"}
1
+ {"version":3,"file":"index.cjs","names":["config","getOrganizationAPI","getProjectAPI","getUserAPI","getOAuthAPI","getDictionaryAPI","getStripeAPI","getAiAPI","getAuditAPI","getTagAPI","getSearchAPI","getEditorAPI","getNewsletterAPI","getGithubAPI","getGitlabAPI","getBitbucketAPI","getShowcaseProjectAPI","getTranslateAPI","getReviewerAPI"],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import config 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 { getTranslateAPI } from './translate';\nimport { getReviewerAPI } from './reviewer';\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 translate: ReturnType<typeof getTranslateAPI>;\n reviewer: ReturnType<typeof getReviewerAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = config\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(intlayerConfig ?? {}, config) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(authAPIOptions, 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 translate: getTranslateAPI(authAPIOptions, resolvedConfig),\n reviewer: getReviewerAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAa,kBACX,iBAAiC,CAAC,GAClC,iBAAiCA,mCACX;CACtB,MAAM,gCAAsB,kBAAkB,CAAC,GAAGA,8BAAM;CAExD,OAAO;EACL,cAAcC,uDAAmB,gBAAgB,cAAc;EAC/D,SAASC,6CAAc,gBAAgB,cAAc;EACrD,MAAMC,uCAAW,gBAAgB,cAAc;EAC/C,OAAOC,yCAAY,gBAAgB,cAAc;EACjD,YAAYC,mDAAiB,gBAAgB,cAAc;EAC3D,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,IAAIC,mCAAS,gBAAgB,cAAc;EAC3C,OAAOC,yCAAY,gBAAgB,cAAc;EACjD,KAAKC,qCAAU,gBAAgB,cAAc;EAC7C,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,YAAYC,mDAAiB,gBAAgB,cAAc;EAC3D,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,QAAQC,2CAAa,gBAAgB,cAAc;EACnD,WAAWC,iDAAgB,gBAAgB,cAAc;EACzD,iBAAiBC,6DAAsB,gBAAgB,cAAc;EACrE,WAAWC,iDAAgB,gBAAgB,cAAc;EACzD,UAAUC,+CAAe,gBAAgB,cAAc;CACzD;AACF"}
@@ -0,0 +1,133 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
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);
6
+
7
+ //#region src/getIntlayerAPI/reviewer.ts
8
+ const getReviewerAPI = (authAPIOptions = {}, intlayerConfig = _intlayer_config_built.default) => {
9
+ const BASE = `${intlayerConfig.editor.backendURL}/api/reviewer`;
10
+ const getMarketplace = (params = {}, otherOptions = {}) => {
11
+ const searchParams = new URLSearchParams();
12
+ for (const [key, value] of Object.entries(params)) {
13
+ if (value === void 0) continue;
14
+ if (Array.isArray(value)) value.forEach((item) => {
15
+ searchParams.append(key, String(item));
16
+ });
17
+ else searchParams.append(key, String(value));
18
+ }
19
+ const query = searchParams.toString();
20
+ return require_fetcher.fetcher(`${BASE}/marketplace${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
21
+ };
22
+ const getPriceDistribution = (params = {}, otherOptions = {}) => {
23
+ const searchParams = new URLSearchParams();
24
+ for (const [key, value] of Object.entries(params)) {
25
+ if (value === void 0) continue;
26
+ if (Array.isArray(value)) value.forEach((item) => searchParams.append(key, String(item)));
27
+ else searchParams.append(key, String(value));
28
+ }
29
+ const query = searchParams.toString();
30
+ return require_fetcher.fetcher(`${BASE}/marketplace/price-distribution${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
31
+ };
32
+ const getReviewerById = (reviewerId, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/${reviewerId}`, authAPIOptions, otherOptions, { method: "GET" });
33
+ const getReviewerReviews = (reviewerId, params = {}, otherOptions = {}) => {
34
+ const query = new URLSearchParams(Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)]))).toString();
35
+ return require_fetcher.fetcher(`${BASE}/${reviewerId}/reviews${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
36
+ };
37
+ const getMyReviewerProfile = (otherOptions = {}) => require_fetcher.fetcher(`${BASE}/me`, authAPIOptions, otherOptions, { method: "GET" });
38
+ const registerAsReviewer = (body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/register`, authAPIOptions, otherOptions, {
39
+ method: "POST",
40
+ body
41
+ });
42
+ const updateReviewerProfile = (body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/`, authAPIOptions, otherOptions, {
43
+ method: "PUT",
44
+ body
45
+ });
46
+ const deleteReviewerProfile = (otherOptions = {}) => require_fetcher.fetcher(`${BASE}/`, authAPIOptions, otherOptions, { method: "DELETE" });
47
+ const contactReviewer = (reviewerId, body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/${reviewerId}/contact`, authAPIOptions, otherOptions, {
48
+ method: "POST",
49
+ body
50
+ });
51
+ const estimateMission = (body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/mission/estimate`, authAPIOptions, otherOptions, {
52
+ method: "POST",
53
+ body
54
+ });
55
+ const createMission = (body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/mission`, authAPIOptions, otherOptions, {
56
+ method: "POST",
57
+ body
58
+ });
59
+ const getMyMissions = (params = {}, otherOptions = {}) => {
60
+ const query = new URLSearchParams(Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)]))).toString();
61
+ return require_fetcher.fetcher(`${BASE}/mission${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
62
+ };
63
+ const getMissionById = (missionId, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/mission/${missionId}`, authAPIOptions, otherOptions, { method: "GET" });
64
+ const updateMissionStatus = (missionId, body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/mission/${missionId}/status`, authAPIOptions, otherOptions, {
65
+ method: "PUT",
66
+ body
67
+ });
68
+ const submitReview = (missionId, body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/mission/${missionId}/review`, authAPIOptions, otherOptions, {
69
+ method: "POST",
70
+ body
71
+ });
72
+ const getChatHistory = (missionId, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/mission/${missionId}/chat/history`, authAPIOptions, otherOptions, { method: "GET" });
73
+ const sendMessage = (missionId, body, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/mission/${missionId}/chat`, authAPIOptions, otherOptions, {
74
+ method: "POST",
75
+ body
76
+ });
77
+ const getChatStreamUrl = (missionId) => `${BASE}/mission/${missionId}/chat/stream`;
78
+ const uploadPicture = async (kind, file, otherOptions = {}) => {
79
+ const buffer = await file.arrayBuffer();
80
+ const baseHeaders = { "Content-Type": file.type || "image/jpeg" };
81
+ const authHeaders = authAPIOptions.headers ?? {};
82
+ const response = await fetch(`${BASE}/me/picture/${kind}`, {
83
+ method: "POST",
84
+ credentials: "include",
85
+ headers: {
86
+ ...authHeaders,
87
+ ...baseHeaders
88
+ },
89
+ body: buffer,
90
+ signal: otherOptions.signal
91
+ });
92
+ if (!response.ok) {
93
+ const result = await response.json();
94
+ throw new Error(JSON.stringify(result.error) ?? "Picture upload failed");
95
+ }
96
+ return await response.json();
97
+ };
98
+ const uploadMainPicture = (file, otherOptions = {}) => uploadPicture("main", file, otherOptions);
99
+ const uploadCoverPicture = (file, otherOptions = {}) => uploadPicture("cover", file, otherOptions);
100
+ const validateReviewerProfile = (reviewerId, otherOptions = {}) => require_fetcher.fetcher(`${BASE}/${reviewerId}/validate`, authAPIOptions, otherOptions, { method: "PUT" });
101
+ const getAdminReviewers = (params = {}, otherOptions = {}) => {
102
+ const query = new URLSearchParams(Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)]))).toString();
103
+ return require_fetcher.fetcher(`${BASE}/admin/reviewers${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
104
+ };
105
+ return {
106
+ getMarketplace,
107
+ getPriceDistribution,
108
+ getReviewerById,
109
+ getReviewerReviews,
110
+ getMyReviewerProfile,
111
+ registerAsReviewer,
112
+ updateReviewerProfile,
113
+ deleteReviewerProfile,
114
+ estimateMission,
115
+ createMission,
116
+ getMyMissions,
117
+ getMissionById,
118
+ updateMissionStatus,
119
+ submitReview,
120
+ contactReviewer,
121
+ getChatHistory,
122
+ sendMessage,
123
+ getChatStreamUrl,
124
+ uploadMainPicture,
125
+ uploadCoverPicture,
126
+ validateReviewerProfile,
127
+ getAdminReviewers
128
+ };
129
+ };
130
+
131
+ //#endregion
132
+ exports.getReviewerAPI = getReviewerAPI;
133
+ //# sourceMappingURL=reviewer.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewer.cjs","names":["config","fetcher"],"sources":["../../../src/getIntlayerAPI/reviewer.ts"],"sourcesContent":["import type {\n CreateMissionBody,\n EstimateMissionBody,\n GetMarketplaceQuery,\n MissionEstimate,\n PaginatedResponse,\n PriceDistributionData,\n RegisterReviewerBody,\n ResponseData,\n ReviewerMessageAPI,\n ReviewerProfileAPI,\n ReviewerReviewAPI,\n SendMessageBody,\n SubmitReviewBody,\n TranslationMissionAPI,\n UpdateMissionStatusBody,\n UpdateReviewerBody,\n UploadReviewerPictureResult,\n} from '@intlayer/backend';\nimport config from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getReviewerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = config\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n const BASE = `${backendURL}/api/reviewer`;\n\n // ── Marketplace ────────────────────────────────────────────────────────────\n\n const getMarketplace = (\n params: GetMarketplaceQuery = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => {\n searchParams.append(key, String(item));\n });\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/marketplace${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getPriceDistribution = (\n params: Pick<\n GetMarketplaceQuery,\n 'fromLocale' | 'toLocale' | 'minRating' | 'categories'\n > = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => searchParams.append(key, String(item)));\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n return fetcher<ResponseData<PriceDistributionData>>(\n `${BASE}/marketplace/price-distribution${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getReviewerById = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getReviewerReviews = (\n reviewerId: string,\n params: { page?: number; pageSize?: number } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerReviewAPI>>(\n `${BASE}/${reviewerId}/reviews${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n // ── My profile ─────────────────────────────────────────────────────────────\n\n const getMyReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<ReviewerProfileAPI | null>>(\n `${BASE}/me`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const registerAsReviewer = (\n body: RegisterReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/register`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const updateReviewerProfile = (\n body: UpdateReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n const deleteReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<null>>(\n `${BASE}/`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n // ── Contact ────────────────────────────────────────────────────────────────\n\n const contactReviewer = (\n reviewerId: string,\n body: { message: string },\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<null>>(\n `${BASE}/${reviewerId}/contact`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Missions ───────────────────────────────────────────────────────────────\n\n const estimateMission = (\n body: EstimateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<MissionEstimate>>(\n `${BASE}/mission/estimate`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const createMission = (\n body: CreateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getMyMissions = (\n params: {\n role?: 'client' | 'reviewer';\n page?: number;\n pageSize?: number;\n } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<TranslationMissionAPI>>(\n `${BASE}/mission${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getMissionById = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const updateMissionStatus = (\n missionId: string,\n body: UpdateMissionStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n // ── Reviews ────────────────────────────────────────────────────────────────\n\n const submitReview = (\n missionId: string,\n body: SubmitReviewBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerReviewAPI>>(\n `${BASE}/mission/${missionId}/review`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Chat ───────────────────────────────────────────────────────────────────\n\n const getChatHistory = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI[]>>(\n `${BASE}/mission/${missionId}/chat/history`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const sendMessage = (\n missionId: string,\n body: SendMessageBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI>>(\n `${BASE}/mission/${missionId}/chat`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getChatStreamUrl = (missionId: string) =>\n `${BASE}/mission/${missionId}/chat/stream`;\n\n // ── Picture uploads ────────────────────────────────────────────────────────\n\n const uploadPicture = async (\n kind: 'main' | 'cover',\n file: File,\n otherOptions: FetcherOptions = {}\n ): Promise<UploadReviewerPictureResult> => {\n const buffer = await file.arrayBuffer();\n\n const baseHeaders: Record<string, string> = {\n 'Content-Type': file.type || 'image/jpeg',\n };\n\n const authHeaders =\n (authAPIOptions.headers as Record<string, string> | undefined) ?? {};\n\n const response = await fetch(`${BASE}/me/picture/${kind}`, {\n method: 'POST',\n credentials: 'include',\n headers: { ...authHeaders, ...baseHeaders },\n body: buffer,\n signal: otherOptions.signal as AbortSignal | undefined,\n });\n\n if (!response.ok) {\n const result = await response.json();\n throw new Error(JSON.stringify(result.error) ?? 'Picture upload failed');\n }\n\n return (await response.json()) as UploadReviewerPictureResult;\n };\n\n const uploadMainPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('main', file, otherOptions);\n\n const uploadCoverPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('cover', file, otherOptions);\n\n // ── Admin ──────────────────────────────────────────────────────────────────\n\n const validateReviewerProfile = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}/validate`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT' }\n );\n\n const getAdminReviewers = (\n params: { page?: number; pageSize?: number; status?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/admin/reviewers${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n return {\n getMarketplace,\n getPriceDistribution,\n getReviewerById,\n getReviewerReviews,\n getMyReviewerProfile,\n registerAsReviewer,\n updateReviewerProfile,\n deleteReviewerProfile,\n estimateMission,\n createMission,\n getMyMissions,\n getMissionById,\n updateMissionStatus,\n submitReview,\n contactReviewer,\n getChatHistory,\n sendMessage,\n getChatStreamUrl,\n uploadMainPicture,\n uploadCoverPicture,\n validateReviewerProfile,\n getAdminReviewers,\n };\n};\n"],"mappings":";;;;;;;AAuBA,MAAa,kBACX,iBAAiC,CAAC,GAClC,iBAAiCA,mCAC9B;CAEH,MAAM,OAAO,GADM,eAAe,OAAO,WACd;CAI3B,MAAM,kBACJ,SAA8B,CAAC,GAC/B,eAA+B,CAAC,MAC7B;EACH,MAAM,eAAe,IAAI,gBAAgB;EACzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAAG;GACjD,IAAI,UAAU,QAAW;GACzB,IAAI,MAAM,QAAQ,KAAK,GACrB,MAAM,SAAS,SAAS;IACtB,aAAa,OAAO,KAAK,OAAO,IAAI,CAAC;GACvC,CAAC;QAED,aAAa,OAAO,KAAK,OAAO,KAAK,CAAC;EAE1C;EACA,MAAM,QAAQ,aAAa,SAAS;EACpC,OAAOC,wBACL,GAAG,KAAK,cAAc,QAAQ,IAAI,UAAU,MAC5C,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CACF;CAEA,MAAM,wBACJ,SAGI,CAAC,GACL,eAA+B,CAAC,MAC7B;EACH,MAAM,eAAe,IAAI,gBAAgB;EACzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAAG;GACjD,IAAI,UAAU,QAAW;GACzB,IAAI,MAAM,QAAQ,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A;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -41,13 +41,78 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = _intlayer_config_bui
41
41
  * Creates a Stripe Billing Portal session for the authenticated organization.
42
42
  */
43
43
  const createPortalSession = async (otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/portal-session`, authAPIOptions, otherOptions, { method: "POST" });
44
+ /**
45
+ * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.
46
+ */
47
+ const grantAffiliateAccess = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/grant`, authAPIOptions, otherOptions, {
48
+ method: "POST",
49
+ body
50
+ });
51
+ /**
52
+ * Admin-only: returns a paginated list of all affiliates.
53
+ */
54
+ const getAffiliates = async (params, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliates`, authAPIOptions, otherOptions, {
55
+ method: "GET",
56
+ params
57
+ });
58
+ /**
59
+ * Admin-only: returns a single affiliate by ID.
60
+ */
61
+ const getAffiliateById = async ({ id }, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliates/${id}`, authAPIOptions, otherOptions, { method: "GET" });
62
+ /**
63
+ * Returns the affiliate record for the authenticated user (null if not an affiliate).
64
+ */
65
+ const getAffiliate = async (otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate`, authAPIOptions, otherOptions, { method: "GET" });
66
+ /**
67
+ * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).
68
+ */
69
+ const getAffiliateAccountSession = async (otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/account-session`, authAPIOptions, otherOptions, { method: "POST" });
70
+ /**
71
+ * Returns referral stats for the authenticated affiliate.
72
+ */
73
+ const getAffiliateStats = async (otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/stats`, authAPIOptions, otherOptions, { method: "GET" });
74
+ /**
75
+ * Sends an affiliate invitation email to the given address (admin only).
76
+ */
77
+ const sendAffiliateInvitation = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/invite`, authAPIOptions, otherOptions, {
78
+ method: "POST",
79
+ body
80
+ });
81
+ /**
82
+ * Retrieves an affiliate invitation by token (public — no auth required).
83
+ */
84
+ const getAffiliateInvitation = async ({ token }, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}`, authAPIOptions, otherOptions, { method: "GET" });
85
+ /**
86
+ * Admin-only: updates an affiliate's status and/or category.
87
+ */
88
+ const updateAffiliateStatus = async ({ id }, body, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliates/${id}/status`, authAPIOptions, otherOptions, {
89
+ method: "PATCH",
90
+ body
91
+ });
92
+ /**
93
+ * Accepts an affiliate invitation and creates the affiliate account.
94
+ */
95
+ const acceptAffiliateInvitation = async ({ token, country }, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`, authAPIOptions, otherOptions, {
96
+ method: "POST",
97
+ body: { country }
98
+ });
44
99
  return {
45
100
  getPricing,
46
101
  getSubscription,
47
102
  cancelSubscription,
48
103
  getInvoices,
49
104
  getPaymentMethod,
50
- createPortalSession
105
+ createPortalSession,
106
+ grantAffiliateAccess,
107
+ getAffiliates,
108
+ getAffiliateById,
109
+ getAffiliate,
110
+ getAffiliateAccountSession,
111
+ getAffiliateStats,
112
+ sendAffiliateInvitation,
113
+ getAffiliateInvitation,
114
+ acceptAffiliateInvitation,
115
+ updateAffiliateStatus
51
116
  };
52
117
  };
53
118
 
@@ -1 +1 @@
1
- {"version":3,"file":"stripe.cjs","names":["defaultConfiguration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n CreatePortalSessionResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\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 return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n };\n};\n"],"mappings":";;;;;;;AAaA,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,OAAO,eAA+B,CAAC,MAChE,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,OACV,CACF;;;;CAKF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAMA,wBACJ,GAAG,iBAAiB,YACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;CAMF,MAAM,mBAAmB,OAAO,eAA+B,CAAC,MAC9D,MAAMA,wBACJ,GAAG,iBAAiB,kBACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;CAKF,MAAM,sBAAsB,OAAO,eAA+B,CAAC,MACjE,MAAMA,wBACJ,GAAG,iBAAiB,kBACpB,gBACA,cACA,EAAE,QAAQ,OAAO,CACnB;CAEF,OAAO;EACL;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 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,OAAO,eAA+B,CAAC,MAChE,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,OACV,CACF;;;;CAKF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAMA,wBACJ,GAAG,iBAAiB,YACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;CAMF,MAAM,mBAAmB,OAAO,eAA+B,CAAC,MAC9D,MAAMA,wBACJ,GAAG,iBAAiB,kBACpB,gBACA,cACA,EAAE,QAAQ,MAAM,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,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"}
@@ -15,6 +15,7 @@ const require_getIntlayerAPI_search = require('./getIntlayerAPI/search.cjs');
15
15
  const require_getIntlayerAPI_stripe = require('./getIntlayerAPI/stripe.cjs');
16
16
  const require_getIntlayerAPI_tag = require('./getIntlayerAPI/tag.cjs');
17
17
  const require_getIntlayerAPI_translate = require('./getIntlayerAPI/translate.cjs');
18
+ const require_getIntlayerAPI_reviewer = require('./getIntlayerAPI/reviewer.cjs');
18
19
  const require_getIntlayerAPI_user = require('./getIntlayerAPI/user.cjs');
19
20
  const require_getIntlayerAPI_index = require('./getIntlayerAPI/index.cjs');
20
21
  const require_proxy = require('./proxy.cjs');
@@ -38,6 +39,7 @@ exports.getNewsletterAPI = require_getIntlayerAPI_newsletter.getNewsletterAPI;
38
39
  exports.getOAuthAPI = require_getIntlayerAPI_oAuth.getOAuthAPI;
39
40
  exports.getOrganizationAPI = require_getIntlayerAPI_organization.getOrganizationAPI;
40
41
  exports.getProjectAPI = require_getIntlayerAPI_project.getProjectAPI;
42
+ exports.getReviewerAPI = require_getIntlayerAPI_reviewer.getReviewerAPI;
41
43
  exports.getSearchAPI = require_getIntlayerAPI_search.getSearchAPI;
42
44
  exports.getStripeAPI = require_getIntlayerAPI_stripe.getStripeAPI;
43
45
  exports.getTagAPI = require_getIntlayerAPI_tag.getTagAPI;
@@ -14,6 +14,7 @@ import { getShowcaseProjectAPI } from "./showcaseProject.mjs";
14
14
  import { getStripeAPI } from "./stripe.mjs";
15
15
  import { getTagAPI } from "./tag.mjs";
16
16
  import { getTranslateAPI } from "./translate.mjs";
17
+ import { getReviewerAPI } from "./reviewer.mjs";
17
18
  import { getUserAPI } from "./user.mjs";
18
19
  import config from "@intlayer/config/built";
19
20
  import { defu } from "defu";
@@ -38,7 +39,8 @@ const getIntlayerAPI = (authAPIOptions = {}, intlayerConfig = config) => {
38
39
  gitlab: getGitlabAPI(authAPIOptions, resolvedConfig),
39
40
  bitbucket: getBitbucketAPI(authAPIOptions, resolvedConfig),
40
41
  showcaseProject: getShowcaseProjectAPI(authAPIOptions, resolvedConfig),
41
- translate: getTranslateAPI(authAPIOptions, resolvedConfig)
42
+ translate: getTranslateAPI(authAPIOptions, resolvedConfig),
43
+ reviewer: getReviewerAPI(authAPIOptions, resolvedConfig)
42
44
  };
43
45
  };
44
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import config 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 { getTranslateAPI } from './translate';\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 translate: ReturnType<typeof getTranslateAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = config\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(intlayerConfig ?? {}, config) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(authAPIOptions, 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 translate: getTranslateAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,kBACX,iBAAiC,CAAC,GAClC,iBAAiC,WACX;CACtB,MAAM,iBAAiB,KAAK,kBAAkB,CAAC,GAAG,MAAM;CAExD,OAAO;EACL,cAAc,mBAAmB,gBAAgB,cAAc;EAC/D,SAAS,cAAc,gBAAgB,cAAc;EACrD,MAAM,WAAW,gBAAgB,cAAc;EAC/C,OAAO,YAAY,gBAAgB,cAAc;EACjD,YAAY,iBAAiB,gBAAgB,cAAc;EAC3D,QAAQ,aAAa,gBAAgB,cAAc;EACnD,IAAI,SAAS,gBAAgB,cAAc;EAC3C,OAAO,YAAY,gBAAgB,cAAc;EACjD,KAAK,UAAU,gBAAgB,cAAc;EAC7C,QAAQ,aAAa,gBAAgB,cAAc;EACnD,QAAQ,aAAa,gBAAgB,cAAc;EACnD,YAAY,iBAAiB,gBAAgB,cAAc;EAC3D,QAAQ,aAAa,gBAAgB,cAAc;EACnD,QAAQ,aAAa,gBAAgB,cAAc;EACnD,WAAW,gBAAgB,gBAAgB,cAAc;EACzD,iBAAiB,sBAAsB,gBAAgB,cAAc;EACrE,WAAW,gBAAgB,gBAAgB,cAAc;CAC3D;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/getIntlayerAPI/index.ts"],"sourcesContent":["import config 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 { getTranslateAPI } from './translate';\nimport { getReviewerAPI } from './reviewer';\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 translate: ReturnType<typeof getTranslateAPI>;\n reviewer: ReturnType<typeof getReviewerAPI>;\n}\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = config\n): IntlayerAPIReturn => {\n const resolvedConfig = defu(intlayerConfig ?? {}, config) as IntlayerConfig;\n\n return {\n organization: getOrganizationAPI(authAPIOptions, resolvedConfig),\n project: getProjectAPI(authAPIOptions, resolvedConfig),\n user: getUserAPI(authAPIOptions, resolvedConfig),\n oAuth: getOAuthAPI(authAPIOptions, 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 translate: getTranslateAPI(authAPIOptions, resolvedConfig),\n reviewer: getReviewerAPI(authAPIOptions, resolvedConfig),\n };\n};\n\nexport type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAa,kBACX,iBAAiC,CAAC,GAClC,iBAAiC,WACX;CACtB,MAAM,iBAAiB,KAAK,kBAAkB,CAAC,GAAG,MAAM;CAExD,OAAO;EACL,cAAc,mBAAmB,gBAAgB,cAAc;EAC/D,SAAS,cAAc,gBAAgB,cAAc;EACrD,MAAM,WAAW,gBAAgB,cAAc;EAC/C,OAAO,YAAY,gBAAgB,cAAc;EACjD,YAAY,iBAAiB,gBAAgB,cAAc;EAC3D,QAAQ,aAAa,gBAAgB,cAAc;EACnD,IAAI,SAAS,gBAAgB,cAAc;EAC3C,OAAO,YAAY,gBAAgB,cAAc;EACjD,KAAK,UAAU,gBAAgB,cAAc;EAC7C,QAAQ,aAAa,gBAAgB,cAAc;EACnD,QAAQ,aAAa,gBAAgB,cAAc;EACnD,YAAY,iBAAiB,gBAAgB,cAAc;EAC3D,QAAQ,aAAa,gBAAgB,cAAc;EACnD,QAAQ,aAAa,gBAAgB,cAAc;EACnD,WAAW,gBAAgB,gBAAgB,cAAc;EACzD,iBAAiB,sBAAsB,gBAAgB,cAAc;EACrE,WAAW,gBAAgB,gBAAgB,cAAc;EACzD,UAAU,eAAe,gBAAgB,cAAc;CACzD;AACF"}
@@ -0,0 +1,130 @@
1
+ import { fetcher } from "../fetcher.mjs";
2
+ import config from "@intlayer/config/built";
3
+
4
+ //#region src/getIntlayerAPI/reviewer.ts
5
+ const getReviewerAPI = (authAPIOptions = {}, intlayerConfig = config) => {
6
+ const BASE = `${intlayerConfig.editor.backendURL}/api/reviewer`;
7
+ const getMarketplace = (params = {}, otherOptions = {}) => {
8
+ const searchParams = new URLSearchParams();
9
+ for (const [key, value] of Object.entries(params)) {
10
+ if (value === void 0) continue;
11
+ if (Array.isArray(value)) value.forEach((item) => {
12
+ searchParams.append(key, String(item));
13
+ });
14
+ else searchParams.append(key, String(value));
15
+ }
16
+ const query = searchParams.toString();
17
+ return fetcher(`${BASE}/marketplace${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
18
+ };
19
+ const getPriceDistribution = (params = {}, otherOptions = {}) => {
20
+ const searchParams = new URLSearchParams();
21
+ for (const [key, value] of Object.entries(params)) {
22
+ if (value === void 0) continue;
23
+ if (Array.isArray(value)) value.forEach((item) => searchParams.append(key, String(item)));
24
+ else searchParams.append(key, String(value));
25
+ }
26
+ const query = searchParams.toString();
27
+ return fetcher(`${BASE}/marketplace/price-distribution${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
28
+ };
29
+ const getReviewerById = (reviewerId, otherOptions = {}) => fetcher(`${BASE}/${reviewerId}`, authAPIOptions, otherOptions, { method: "GET" });
30
+ const getReviewerReviews = (reviewerId, params = {}, otherOptions = {}) => {
31
+ const query = new URLSearchParams(Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)]))).toString();
32
+ return fetcher(`${BASE}/${reviewerId}/reviews${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
33
+ };
34
+ const getMyReviewerProfile = (otherOptions = {}) => fetcher(`${BASE}/me`, authAPIOptions, otherOptions, { method: "GET" });
35
+ const registerAsReviewer = (body, otherOptions = {}) => fetcher(`${BASE}/register`, authAPIOptions, otherOptions, {
36
+ method: "POST",
37
+ body
38
+ });
39
+ const updateReviewerProfile = (body, otherOptions = {}) => fetcher(`${BASE}/`, authAPIOptions, otherOptions, {
40
+ method: "PUT",
41
+ body
42
+ });
43
+ const deleteReviewerProfile = (otherOptions = {}) => fetcher(`${BASE}/`, authAPIOptions, otherOptions, { method: "DELETE" });
44
+ const contactReviewer = (reviewerId, body, otherOptions = {}) => fetcher(`${BASE}/${reviewerId}/contact`, authAPIOptions, otherOptions, {
45
+ method: "POST",
46
+ body
47
+ });
48
+ const estimateMission = (body, otherOptions = {}) => fetcher(`${BASE}/mission/estimate`, authAPIOptions, otherOptions, {
49
+ method: "POST",
50
+ body
51
+ });
52
+ const createMission = (body, otherOptions = {}) => fetcher(`${BASE}/mission`, authAPIOptions, otherOptions, {
53
+ method: "POST",
54
+ body
55
+ });
56
+ const getMyMissions = (params = {}, otherOptions = {}) => {
57
+ const query = new URLSearchParams(Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)]))).toString();
58
+ return fetcher(`${BASE}/mission${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
59
+ };
60
+ const getMissionById = (missionId, otherOptions = {}) => fetcher(`${BASE}/mission/${missionId}`, authAPIOptions, otherOptions, { method: "GET" });
61
+ const updateMissionStatus = (missionId, body, otherOptions = {}) => fetcher(`${BASE}/mission/${missionId}/status`, authAPIOptions, otherOptions, {
62
+ method: "PUT",
63
+ body
64
+ });
65
+ const submitReview = (missionId, body, otherOptions = {}) => fetcher(`${BASE}/mission/${missionId}/review`, authAPIOptions, otherOptions, {
66
+ method: "POST",
67
+ body
68
+ });
69
+ const getChatHistory = (missionId, otherOptions = {}) => fetcher(`${BASE}/mission/${missionId}/chat/history`, authAPIOptions, otherOptions, { method: "GET" });
70
+ const sendMessage = (missionId, body, otherOptions = {}) => fetcher(`${BASE}/mission/${missionId}/chat`, authAPIOptions, otherOptions, {
71
+ method: "POST",
72
+ body
73
+ });
74
+ const getChatStreamUrl = (missionId) => `${BASE}/mission/${missionId}/chat/stream`;
75
+ const uploadPicture = async (kind, file, otherOptions = {}) => {
76
+ const buffer = await file.arrayBuffer();
77
+ const baseHeaders = { "Content-Type": file.type || "image/jpeg" };
78
+ const authHeaders = authAPIOptions.headers ?? {};
79
+ const response = await fetch(`${BASE}/me/picture/${kind}`, {
80
+ method: "POST",
81
+ credentials: "include",
82
+ headers: {
83
+ ...authHeaders,
84
+ ...baseHeaders
85
+ },
86
+ body: buffer,
87
+ signal: otherOptions.signal
88
+ });
89
+ if (!response.ok) {
90
+ const result = await response.json();
91
+ throw new Error(JSON.stringify(result.error) ?? "Picture upload failed");
92
+ }
93
+ return await response.json();
94
+ };
95
+ const uploadMainPicture = (file, otherOptions = {}) => uploadPicture("main", file, otherOptions);
96
+ const uploadCoverPicture = (file, otherOptions = {}) => uploadPicture("cover", file, otherOptions);
97
+ const validateReviewerProfile = (reviewerId, otherOptions = {}) => fetcher(`${BASE}/${reviewerId}/validate`, authAPIOptions, otherOptions, { method: "PUT" });
98
+ const getAdminReviewers = (params = {}, otherOptions = {}) => {
99
+ const query = new URLSearchParams(Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)]))).toString();
100
+ return fetcher(`${BASE}/admin/reviewers${query ? `?${query}` : ""}`, authAPIOptions, otherOptions, { method: "GET" });
101
+ };
102
+ return {
103
+ getMarketplace,
104
+ getPriceDistribution,
105
+ getReviewerById,
106
+ getReviewerReviews,
107
+ getMyReviewerProfile,
108
+ registerAsReviewer,
109
+ updateReviewerProfile,
110
+ deleteReviewerProfile,
111
+ estimateMission,
112
+ createMission,
113
+ getMyMissions,
114
+ getMissionById,
115
+ updateMissionStatus,
116
+ submitReview,
117
+ contactReviewer,
118
+ getChatHistory,
119
+ sendMessage,
120
+ getChatStreamUrl,
121
+ uploadMainPicture,
122
+ uploadCoverPicture,
123
+ validateReviewerProfile,
124
+ getAdminReviewers
125
+ };
126
+ };
127
+
128
+ //#endregion
129
+ export { getReviewerAPI };
130
+ //# sourceMappingURL=reviewer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewer.mjs","names":[],"sources":["../../../src/getIntlayerAPI/reviewer.ts"],"sourcesContent":["import type {\n CreateMissionBody,\n EstimateMissionBody,\n GetMarketplaceQuery,\n MissionEstimate,\n PaginatedResponse,\n PriceDistributionData,\n RegisterReviewerBody,\n ResponseData,\n ReviewerMessageAPI,\n ReviewerProfileAPI,\n ReviewerReviewAPI,\n SendMessageBody,\n SubmitReviewBody,\n TranslationMissionAPI,\n UpdateMissionStatusBody,\n UpdateReviewerBody,\n UploadReviewerPictureResult,\n} from '@intlayer/backend';\nimport config from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getReviewerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig = config\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n const BASE = `${backendURL}/api/reviewer`;\n\n // ── Marketplace ────────────────────────────────────────────────────────────\n\n const getMarketplace = (\n params: GetMarketplaceQuery = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => {\n searchParams.append(key, String(item));\n });\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/marketplace${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getPriceDistribution = (\n params: Pick<\n GetMarketplaceQuery,\n 'fromLocale' | 'toLocale' | 'minRating' | 'categories'\n > = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n value.forEach((item) => searchParams.append(key, String(item)));\n } else {\n searchParams.append(key, String(value));\n }\n }\n const query = searchParams.toString();\n return fetcher<ResponseData<PriceDistributionData>>(\n `${BASE}/marketplace/price-distribution${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getReviewerById = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getReviewerReviews = (\n reviewerId: string,\n params: { page?: number; pageSize?: number } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerReviewAPI>>(\n `${BASE}/${reviewerId}/reviews${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n // ── My profile ─────────────────────────────────────────────────────────────\n\n const getMyReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<ReviewerProfileAPI | null>>(\n `${BASE}/me`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const registerAsReviewer = (\n body: RegisterReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/register`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const updateReviewerProfile = (\n body: UpdateReviewerBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n const deleteReviewerProfile = (otherOptions: FetcherOptions = {}) =>\n fetcher<ResponseData<null>>(\n `${BASE}/`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n // ── Contact ────────────────────────────────────────────────────────────────\n\n const contactReviewer = (\n reviewerId: string,\n body: { message: string },\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<null>>(\n `${BASE}/${reviewerId}/contact`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Missions ───────────────────────────────────────────────────────────────\n\n const estimateMission = (\n body: EstimateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<MissionEstimate>>(\n `${BASE}/mission/estimate`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const createMission = (\n body: CreateMissionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getMyMissions = (\n params: {\n role?: 'client' | 'reviewer';\n page?: number;\n pageSize?: number;\n } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<TranslationMissionAPI>>(\n `${BASE}/mission${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n const getMissionById = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const updateMissionStatus = (\n missionId: string,\n body: UpdateMissionStatusBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<TranslationMissionAPI>>(\n `${BASE}/mission/${missionId}/status`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT', body }\n );\n\n // ── Reviews ────────────────────────────────────────────────────────────────\n\n const submitReview = (\n missionId: string,\n body: SubmitReviewBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerReviewAPI>>(\n `${BASE}/mission/${missionId}/review`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n // ── Chat ───────────────────────────────────────────────────────────────────\n\n const getChatHistory = (\n missionId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI[]>>(\n `${BASE}/mission/${missionId}/chat/history`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const sendMessage = (\n missionId: string,\n body: SendMessageBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerMessageAPI>>(\n `${BASE}/mission/${missionId}/chat`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const getChatStreamUrl = (missionId: string) =>\n `${BASE}/mission/${missionId}/chat/stream`;\n\n // ── Picture uploads ────────────────────────────────────────────────────────\n\n const uploadPicture = async (\n kind: 'main' | 'cover',\n file: File,\n otherOptions: FetcherOptions = {}\n ): Promise<UploadReviewerPictureResult> => {\n const buffer = await file.arrayBuffer();\n\n const baseHeaders: Record<string, string> = {\n 'Content-Type': file.type || 'image/jpeg',\n };\n\n const authHeaders =\n (authAPIOptions.headers as Record<string, string> | undefined) ?? {};\n\n const response = await fetch(`${BASE}/me/picture/${kind}`, {\n method: 'POST',\n credentials: 'include',\n headers: { ...authHeaders, ...baseHeaders },\n body: buffer,\n signal: otherOptions.signal as AbortSignal | undefined,\n });\n\n if (!response.ok) {\n const result = await response.json();\n throw new Error(JSON.stringify(result.error) ?? 'Picture upload failed');\n }\n\n return (await response.json()) as UploadReviewerPictureResult;\n };\n\n const uploadMainPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('main', file, otherOptions);\n\n const uploadCoverPicture = (file: File, otherOptions: FetcherOptions = {}) =>\n uploadPicture('cover', file, otherOptions);\n\n // ── Admin ──────────────────────────────────────────────────────────────────\n\n const validateReviewerProfile = (\n reviewerId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<ResponseData<ReviewerProfileAPI>>(\n `${BASE}/${reviewerId}/validate`,\n authAPIOptions,\n otherOptions,\n { method: 'PUT' }\n );\n\n const getAdminReviewers = (\n params: { page?: number; pageSize?: number; status?: string } = {},\n otherOptions: FetcherOptions = {}\n ) => {\n const query = new URLSearchParams(\n Object.fromEntries(\n Object.entries(params)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => [k, String(v)])\n )\n ).toString();\n return fetcher<PaginatedResponse<ReviewerProfileAPI>>(\n `${BASE}/admin/reviewers${query ? `?${query}` : ''}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n };\n\n return {\n getMarketplace,\n getPriceDistribution,\n getReviewerById,\n getReviewerReviews,\n getMyReviewerProfile,\n registerAsReviewer,\n updateReviewerProfile,\n deleteReviewerProfile,\n estimateMission,\n createMission,\n getMyMissions,\n getMissionById,\n updateMissionStatus,\n submitReview,\n contactReviewer,\n getChatHistory,\n sendMessage,\n getChatStreamUrl,\n uploadMainPicture,\n uploadCoverPicture,\n validateReviewerProfile,\n getAdminReviewers,\n };\n};\n"],"mappings":";;;;AAuBA,MAAa,kBACX,iBAAiC,CAAC,GAClC,iBAAiC,WAC9B;CAEH,MAAM,OAAO,GADM,eAAe,OAAO,WACd;CAI3B,MAAM,kBACJ,SAA8B,CAAC,GAC/B,eAA+B,CAAC,MAC7B;EACH,MAAM,eAAe,IAAI,gBAAgB;EACzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,GAAG;GACjD,IAAI,UAAU,QAAW;GACzB,IAAI,MAAM,QAAQ,KAAK,GACrB,MAAM,SAAS,SAAS;IACtB,aAAa,OAAO,KAAK,OAAO,IAAI,CAAC;GACvC,CAAC;QAED,aAAa,OAAO,KAAK,OAAO,KAAK,CAAC;EAE1C;EACA,MAAM,QAAQ,aAAa,SAAS;EACpC,OAAO,QACL,GAAG,KAAK,cAAc,QAAQ,IAAI,UAAU,MAC5C,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;CACF;CAEA,MAAM,wBACJ,SAGI,CAAC,GACL,eAA+B,CAAC,MAC7B;EACH,MAAM,eAAe,IAAI,gBAAgB;EACzC,KAAK,MAA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AAQ,MAAM,CAClB;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -38,13 +38,78 @@ const getStripeAPI = (authAPIOptions = {}, intlayerConfig = config) => {
38
38
  * Creates a Stripe Billing Portal session for the authenticated organization.
39
39
  */
40
40
  const createPortalSession = async (otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/portal-session`, authAPIOptions, otherOptions, { method: "POST" });
41
+ /**
42
+ * Admin-only: grants affiliate access to a user by creating their Stripe Connect account.
43
+ */
44
+ const grantAffiliateAccess = async (body, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/grant`, authAPIOptions, otherOptions, {
45
+ method: "POST",
46
+ body
47
+ });
48
+ /**
49
+ * Admin-only: returns a paginated list of all affiliates.
50
+ */
51
+ const getAffiliates = async (params, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliates`, authAPIOptions, otherOptions, {
52
+ method: "GET",
53
+ params
54
+ });
55
+ /**
56
+ * Admin-only: returns a single affiliate by ID.
57
+ */
58
+ const getAffiliateById = async ({ id }, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliates/${id}`, authAPIOptions, otherOptions, { method: "GET" });
59
+ /**
60
+ * Returns the affiliate record for the authenticated user (null if not an affiliate).
61
+ */
62
+ const getAffiliate = async (otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate`, authAPIOptions, otherOptions, { method: "GET" });
63
+ /**
64
+ * Creates a Stripe Connect account session for the authenticated affiliate (embedded onboarding).
65
+ */
66
+ const getAffiliateAccountSession = async (otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/account-session`, authAPIOptions, otherOptions, { method: "POST" });
67
+ /**
68
+ * Returns referral stats for the authenticated affiliate.
69
+ */
70
+ const getAffiliateStats = async (otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/stats`, authAPIOptions, otherOptions, { method: "GET" });
71
+ /**
72
+ * Sends an affiliate invitation email to the given address (admin only).
73
+ */
74
+ const sendAffiliateInvitation = async (body, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/invite`, authAPIOptions, otherOptions, {
75
+ method: "POST",
76
+ body
77
+ });
78
+ /**
79
+ * Retrieves an affiliate invitation by token (public — no auth required).
80
+ */
81
+ const getAffiliateInvitation = async ({ token }, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}`, authAPIOptions, otherOptions, { method: "GET" });
82
+ /**
83
+ * Admin-only: updates an affiliate's status and/or category.
84
+ */
85
+ const updateAffiliateStatus = async ({ id }, body, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliates/${id}/status`, authAPIOptions, otherOptions, {
86
+ method: "PATCH",
87
+ body
88
+ });
89
+ /**
90
+ * Accepts an affiliate invitation and creates the affiliate account.
91
+ */
92
+ const acceptAffiliateInvitation = async ({ token, country }, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/affiliate/invitation/${token}/accept`, authAPIOptions, otherOptions, {
93
+ method: "POST",
94
+ body: { country }
95
+ });
41
96
  return {
42
97
  getPricing,
43
98
  getSubscription,
44
99
  cancelSubscription,
45
100
  getInvoices,
46
101
  getPaymentMethod,
47
- createPortalSession
102
+ createPortalSession,
103
+ grantAffiliateAccess,
104
+ getAffiliates,
105
+ getAffiliateById,
106
+ getAffiliate,
107
+ getAffiliateAccountSession,
108
+ getAffiliateStats,
109
+ sendAffiliateInvitation,
110
+ getAffiliateInvitation,
111
+ acceptAffiliateInvitation,
112
+ updateAffiliateStatus
48
113
  };
49
114
  };
50
115
 
@@ -1 +1 @@
1
- {"version":3,"file":"stripe.mjs","names":["defaultConfiguration"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n CreatePortalSessionResult,\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetInvoicesResult,\n GetPaymentMethodResult,\n GetPricingBody,\n GetPricingResult,\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 return {\n getPricing,\n getSubscription,\n cancelSubscription,\n getInvoices,\n getPaymentMethod,\n createPortalSession,\n };\n};\n"],"mappings":";;;;AAaA,MAAa,gBACX,iBAAiC,CAAC,GAClC,iBAAiCA,WAC9B;CAGH,MAAM,mBAAmB,GAFN,gBAAgB,QAAQ,WAEJ;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,kBAAkB,OACtB,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,qBAAqB,OAAO,eAA+B,CAAC,MAChE,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,OACV,CACF;;;;CAKF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAM,QACJ,GAAG,iBAAiB,YACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;CAMF,MAAM,mBAAmB,OAAO,eAA+B,CAAC,MAC9D,MAAM,QACJ,GAAG,iBAAiB,kBACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;CAKF,MAAM,sBAAsB,OAAO,eAA+B,CAAC,MACjE,MAAM,QACJ,GAAG,iBAAiB,kBACpB,gBACA,cACA,EAAE,QAAQ,OAAO,CACnB;CAEF,OAAO;EACL;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 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,MAAM,QACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,kBAAkB,OACtB,MACA,eAA+B,CAAC,MAEhC,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;CACF,CACF;;;;;CAMF,MAAM,qBAAqB,OAAO,eAA+B,CAAC,MAChE,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,OACV,CACF;;;;CAKF,MAAM,cAAc,OAAO,eAA+B,CAAC,MACzD,MAAM,QACJ,GAAG,iBAAiB,YACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;;CAMF,MAAM,mBAAmB,OAAO,eAA+B,CAAC,MAC9D,MAAM,QACJ,GAAG,iBAAiB,kBACpB,gBACA,cACA,EAAE,QAAQ,MAAM,CAClB;;;;CAKF,MAAM,sBAAsB,OAAO,eAA+B,CAAC,MACjE,MAAM,QACJ,GAAG,iBAAiB,kBACpB,gBACA,c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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"}
@@ -14,10 +14,11 @@ import { getSearchAPI } from "./getIntlayerAPI/search.mjs";
14
14
  import { getStripeAPI } from "./getIntlayerAPI/stripe.mjs";
15
15
  import { getTagAPI } from "./getIntlayerAPI/tag.mjs";
16
16
  import { getTranslateAPI } from "./getIntlayerAPI/translate.mjs";
17
+ import { getReviewerAPI } from "./getIntlayerAPI/reviewer.mjs";
17
18
  import { getUserAPI } from "./getIntlayerAPI/user.mjs";
18
19
  import { getIntlayerAPI } from "./getIntlayerAPI/index.mjs";
19
20
  import { getIntlayerAPIProxy } from "./proxy.mjs";
20
21
  import { fetchDistantDictionaries } from "./distantDictionary/fetchDistantDictionaries.mjs";
21
22
  import { fetchDistantDictionary } from "./distantDictionary/fetchDistantDictionary.mjs";
22
23
 
23
- export { fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getSearchAPI, getStripeAPI, getTagAPI, getTranslateAPI, getUserAPI };
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 };
@@ -15,6 +15,7 @@ import { getShowcaseProjectAPI } from "./showcaseProject.js";
15
15
  import { getStripeAPI } from "./stripe.js";
16
16
  import { getTagAPI } from "./tag.js";
17
17
  import { getTranslateAPI } from "./translate.js";
18
+ import { getReviewerAPI } from "./reviewer.js";
18
19
  import { getUserAPI } from "./user.js";
19
20
  import { IntlayerConfig } from "@intlayer/types/config";
20
21
 
@@ -37,6 +38,7 @@ interface IntlayerAPIReturn {
37
38
  bitbucket: ReturnType<typeof getBitbucketAPI>;
38
39
  showcaseProject: ReturnType<typeof getShowcaseProjectAPI>;
39
40
  translate: ReturnType<typeof getTranslateAPI>;
41
+ reviewer: ReturnType<typeof getReviewerAPI>;
40
42
  }
41
43
  declare const getIntlayerAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => IntlayerAPIReturn;
42
44
  type IntlayerAPI = ReturnType<typeof getIntlayerAPI>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;UAsBU,iBAAA;EACR,YAAA,EAAc,UAAA,QAAkB,kBAAA;EAChC,OAAA,EAAS,UAAA,QAAkB,aAAA;EAC3B,IAAA,EAAM,UAAA,QAAkB,UAAA;EACxB,KAAA,EAAO,UAAA,QAAkB,WAAA;EACzB,UAAA,EAAY,UAAA,QAAkB,gBAAA;EAC9B,MAAA,EAAQ,UAAA,QAAkB,YAAA;EAC1B,EAAA,EAAI,UAAA,QAAkB,QAAA;EACtB,KAAA,EAAO,UAAA,QAAkB,WAAA;EACzB,GAAA,EAAK,UAAA,QAAkB,SAAA;EACvB,MAAA,EAAQ,UAAA,QAAkB,YAAA;EAC1B,MAAA,EAAQ,UAAA,QAAkB,YAAA;EAC1B,UAAA,EAAY,UAAA,QAAkB,gBAAA;EAC9B,MAAA,EAAQ,UAAA,QAAkB,YAAA;EAC1B,MAAA,EAAQ,UAAA,QAAkB,YAAA;EAC1B,SAAA,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ateMissionBody, EstimateMissionBody, GetMarketplaceQuery, RegisterReviewerBody, SendMessageBody, SubmitReviewBody, UpdateMissionStatusBody, UpdateReviewerBody } from "@intlayer/backend";
3
+ import { IntlayerConfig } from "@intlayer/types/config";
4
+
5
+ //#region src/getIntlayerAPI/reviewer.d.ts
6
+ declare const getReviewerAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
7
+ getMarketplace: (params?: GetMarketplaceQuery, otherOptions?: FetcherOptions) => Promise<PaginatedResponse<ReviewerProfileAPI>>;
8
+ getPriceDistribution: (params?: Pick<GetMarketplaceQuery, "fromLocale" | "toLocale" | "minRating" | "categories">, otherOptions?: FetcherOptions) => Promise<ResponseData<PriceDistributionData>>;
9
+ getReviewerById: (reviewerId: string, otherOptions?: FetcherOptions) => Promise<ResponseData<ReviewerProfileAPI>>;
10
+ getReviewerReviews: (reviewerId: string, params?: {
11
+ page?: number;
12
+ pageSize?: number;
13
+ }, otherOptions?: FetcherOptions) => Promise<PaginatedResponse<ReviewerReviewAPI>>;
14
+ getMyReviewerProfile: (otherOptions?: FetcherOptions) => Promise<ResponseData<any>>;
15
+ registerAsReviewer: (body: RegisterReviewerBody, otherOptions?: FetcherOptions) => Promise<ResponseData<ReviewerProfileAPI>>;
16
+ updateReviewerProfile: (body: UpdateReviewerBody, otherOptions?: FetcherOptions) => Promise<ResponseData<ReviewerProfileAPI>>;
17
+ deleteReviewerProfile: (otherOptions?: FetcherOptions) => Promise<ResponseData<null>>;
18
+ estimateMission: (body: EstimateMissionBody, otherOptions?: FetcherOptions) => Promise<ResponseData<MissionEstimate>>;
19
+ createMission: (body: CreateMissionBody, otherOptions?: FetcherOptions) => Promise<ResponseData<TranslationMissionAPI>>;
20
+ getMyMissions: (params?: {
21
+ role?: "client" | "reviewer";
22
+ page?: number;
23
+ pageSize?: number;
24
+ }, otherOptions?: FetcherOptions) => Promise<PaginatedResponse<TranslationMissionAPI>>;
25
+ getMissionById: (missionId: string, otherOptions?: FetcherOptions) => Promise<ResponseData<TranslationMissionAPI>>;
26
+ updateMissionStatus: (missionId: string, body: UpdateMissionStatusBody, otherOptions?: FetcherOptions) => Promise<ResponseData<TranslationMissionAPI>>;
27
+ submitReview: (missionId: string, body: SubmitReviewBody, otherOptions?: FetcherOptions) => Promise<ResponseData<ReviewerReviewAPI>>;
28
+ contactReviewer: (reviewerId: string, body: {
29
+ message: string;
30
+ }, otherOptions?: FetcherOptions) => Promise<ResponseData<null>>;
31
+ getChatHistory: (missionId: string, otherOptions?: FetcherOptions) => Promise<ResponseData<ReviewerMessageAPI[]>>;
32
+ sendMessage: (missionId: string, body: SendMessageBody, otherOptions?: FetcherOptions) => Promise<ResponseData<ReviewerMessageAPI>>;
33
+ getChatStreamUrl: (missionId: string) => string;
34
+ uploadMainPicture: (file: File, otherOptions?: FetcherOptions) => Promise<UploadReviewerPictureResult>;
35
+ uploadCoverPicture: (file: File, otherOptions?: FetcherOptions) => Promise<UploadReviewerPictureResult>;
36
+ validateReviewerProfile: (reviewerId: string, otherOptions?: FetcherOptions) => Promise<ResponseData<ReviewerProfileAPI>>;
37
+ getAdminReviewers: (params?: {
38
+ page?: number;
39
+ pageSize?: number;
40
+ status?: string;
41
+ }, otherOptions?: FetcherOptions) => Promise<PaginatedResponse<ReviewerProfileAPI>>;
42
+ };
43
+ //#endregion
44
+ export { getReviewerAPI };
45
+ //# sourceMappingURL=reviewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewer.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/reviewer.ts"],"mappings":";;;;;cAuBa,cAAA,GACX,cAAA,GAAgB,cAAA,EAChB,cAAA,GAAgB,cAAA;4BAQN,mBAAA,EAAmB,YAAA,GACb,cAAA,KAAc,OAAA,CAAA,iBAAA,CAAA,kBAAA;kCAuBpB,IAAA,CACN,mBAAA,2DAED,YAAA,GACa,cAAA,KAAc,OAAA,CAAA,YAAA,CAAA,qBAAA;wCAqBV,YAAA,GACJ,cAAA,KA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A,GACJ,cAAA,KAAc,OAAA,CAAA,YAAA,CAAA,kBAAA;;IAUlB,IAAA;IAAe,QAAA;IAAmB,MAAA;EAAA,GAAiB,YAAA,GAC/C,cAAA,KAAc,OAAA,CAAA,iBAAA,CAAA,kBAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  import { FetcherOptions } from "../fetcher.js";
2
- import { GetCheckoutSessionBody, GetPricingBody } from "@intlayer/backend";
2
+ import { GetAffiliatesParams, GetCheckoutSessionBody, GetPricingBody, GrantAffiliateAccessBody, SendAffiliateInvitationBody, UpdateAffiliateStatusBody } from "@intlayer/backend";
3
3
  import { IntlayerConfig } from "@intlayer/types/config";
4
4
 
5
5
  //#region src/getIntlayerAPI/stripe.d.ts
@@ -10,6 +10,34 @@ declare const getStripeAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: I
10
10
  getInvoices: (otherOptions?: FetcherOptions) => Promise<GetInvoicesResult>;
11
11
  getPaymentMethod: (otherOptions?: FetcherOptions) => Promise<GetPaymentMethodResult>;
12
12
  createPortalSession: (otherOptions?: FetcherOptions) => Promise<CreatePortalSessionResult>;
13
+ grantAffiliateAccess: (body: GrantAffiliateAccessBody, otherOptions?: FetcherOptions) => Promise<GrantAffiliateAccessResult>;
14
+ getAffiliates: (params?: GetAffiliatesParams, otherOptions?: FetcherOptions) => Promise<GetAffiliatesResult>;
15
+ getAffiliateById: ({
16
+ id
17
+ }: {
18
+ id: string;
19
+ }, otherOptions?: FetcherOptions) => Promise<GetAffiliateByIdResult>;
20
+ getAffiliate: (otherOptions?: FetcherOptions) => Promise<GetAffiliateResult>;
21
+ getAffiliateAccountSession: (otherOptions?: FetcherOptions) => Promise<GetAffiliateAccountSessionResult>;
22
+ getAffiliateStats: (otherOptions?: FetcherOptions) => Promise<GetAffiliateStatsResult>;
23
+ sendAffiliateInvitation: (body: SendAffiliateInvitationBody, otherOptions?: FetcherOptions) => Promise<SendAffiliateInvitationResult>;
24
+ getAffiliateInvitation: ({
25
+ token
26
+ }: {
27
+ token: string;
28
+ }, otherOptions?: FetcherOptions) => Promise<GetAffiliateInvitationResult>;
29
+ acceptAffiliateInvitation: ({
30
+ token,
31
+ country
32
+ }: {
33
+ token: string;
34
+ country?: string;
35
+ }, otherOptions?: FetcherOptions) => Promise<AcceptAffiliateInvitationResult>;
36
+ updateAffiliateStatus: ({
37
+ id
38
+ }: {
39
+ id: string;
40
+ }, body: UpdateAffiliateStatusBody, otherOptions?: FetcherOptions) => Promise<UpdateAffiliateStatusResult>;
13
41
  };
14
42
  //#endregion
15
43
  export { getStripeAPI };
@@ -1 +1 @@
1
- {"version":3,"file":"stripe.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"mappings":";;;;;cAaa,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;+BAarB,cAAA,KAAc,OAAA,CAAA,iBAAA;oCAYT,cAAA,KAAc,OAAA,CAAA,sBAAA;uCAWX,cAAA,KAAc,OAAA,CAAA,yBAAA;AAAA"}
1
+ {"version":3,"file":"stripe.d.ts","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"mappings":";;;;;cA2Ba,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;+BAarB,cAAA,KAAc,OAAA,CAAA,iBAAA;oCAYT,cAAA,KAAc,OAAA,CAAA,sBAAA;uCAWX,cAAA,KAAc,OAAA,CAAA,yBAAA;+BAYvD,wBAAA,EAAwB,YAAA,GAChB,cAAA,KAAc,OAAA,CAAA,0BAAA;2BAanB,mBAAA,EAAmB,YAAA,GACd,cAAA,KAAc,OAAA,CAAA,mBAAA;;;;IAalB,EAAA;EAAA,GAAY,YAAA,GACR,cAAA,KAAc,OAAA,CAAA,sBAAA;gCAYY,cAAA,KAAc,OAAA,CAAA,kBAAA;8CAYxC,cAAA,KAAc,OAAA,CAAA,gCAAA;qCAYiB,cAAA,KAAc,OAAA,CAAA,uBAAA;kCAYrD,2BAAA,EAA2B,YAAA,GACnB,cAAA,KAAc,OAAA,CAAA,6BAAA;;;;IAaf,KAAA;EAAA,GAAe,YAAA,GACd,cAAA,KAAc,OAAA,CAAA,4BAAA;;;;;IA4BN,KAAA;IAAe,OAAA;EAAA,GAAkB,YAAA,GACzC,cAAA,KAAc,OAAA,CAAA,+BAAA;;;;IAhBlB,EAAA;EAAA,GAAY,IAAA,EAChB,yBAAA,EAAyB,YAAA,GACjB,cAAA,KAAc,OAAA,CAAA,2BAAA;AAAA"}
@@ -16,8 +16,9 @@ import { getSearchAPI } from "./getIntlayerAPI/search.js";
16
16
  import { getStripeAPI } from "./getIntlayerAPI/stripe.js";
17
17
  import { getTagAPI } from "./getIntlayerAPI/tag.js";
18
18
  import { TranslateDictionariesBody, TranslateDictionariesResult, getTranslateAPI } from "./getIntlayerAPI/translate.js";
19
+ import { getReviewerAPI } from "./getIntlayerAPI/reviewer.js";
19
20
  import { getUserAPI } from "./getIntlayerAPI/user.js";
20
21
  import { IntlayerAPI, getIntlayerAPI } from "./getIntlayerAPI/index.js";
21
22
  import { IntlayerAPIProxy, getIntlayerAPIProxy } from "./proxy.js";
22
23
  import { AIOptions } from "./types.js";
23
- 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, getSearchAPI, getStripeAPI, getTagAPI, getTranslateAPI, getUserAPI };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/api",
3
- "version": "8.10.0",
3
+ "version": "8.11.0-canary.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": [
@@ -72,8 +72,8 @@
72
72
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
73
73
  },
74
74
  "dependencies": {
75
- "@intlayer/config": "8.10.0",
76
- "@intlayer/types": "8.10.0",
75
+ "@intlayer/config": "8.11.0-canary.0",
76
+ "@intlayer/types": "8.11.0-canary.0",
77
77
  "defu": "6.1.7"
78
78
  },
79
79
  "devDependencies": {
@@ -84,7 +84,7 @@
84
84
  "rimraf": "6.1.3",
85
85
  "tsdown": "0.22.00",
86
86
  "typescript": "6.0.3",
87
- "vitest": "4.1.6"
87
+ "vitest": "4.1.7"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=14.18"