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