@intlayer/api 8.4.3 → 8.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs +20 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +22 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -1
- package/dist/cjs/distantDictionary/index.cjs +6 -1
- package/dist/cjs/fetcher.cjs +122 -1
- package/dist/cjs/fetcher.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/ai.cjs +161 -2
- package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/audit.cjs +94 -2
- package/dist/cjs/getIntlayerAPI/audit.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs +69 -1
- package/dist/cjs/getIntlayerAPI/bitbucket.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/dictionary.cjs +67 -1
- package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/editor.cjs +37 -1
- package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/github.cjs +69 -1
- package/dist/cjs/getIntlayerAPI/github.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/gitlab.cjs +83 -1
- package/dist/cjs/getIntlayerAPI/gitlab.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/index.cjs +48 -1
- package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -0
- package/dist/cjs/getIntlayerAPI/newsletter.cjs +38 -1
- package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/oAuth.cjs +25 -1
- package/dist/cjs/getIntlayerAPI/oAuth.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/organization.cjs +91 -1
- package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/project.cjs +139 -1
- package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/search.cjs +20 -1
- package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/showcaseProject.cjs +58 -1
- package/dist/cjs/getIntlayerAPI/showcaseProject.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/stripe.cjs +36 -1
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/tag.cjs +45 -1
- package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/user.cjs +77 -1
- package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
- package/dist/cjs/index.cjs +43 -1
- package/dist/cjs/proxy.cjs +100 -1
- package/dist/cjs/proxy.cjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +19 -1
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +21 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
- package/dist/esm/distantDictionary/index.mjs +4 -1
- package/dist/esm/fetcher.mjs +119 -1
- package/dist/esm/fetcher.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/ai.mjs +160 -2
- package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/audit.mjs +93 -2
- package/dist/esm/getIntlayerAPI/audit.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/bitbucket.mjs +68 -1
- package/dist/esm/getIntlayerAPI/bitbucket.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs +66 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/editor.mjs +36 -1
- package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/github.mjs +68 -1
- package/dist/esm/getIntlayerAPI/github.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/gitlab.mjs +82 -1
- package/dist/esm/getIntlayerAPI/gitlab.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/index.mjs +44 -1
- package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/newsletter.mjs +37 -1
- package/dist/esm/getIntlayerAPI/newsletter.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/oAuth.mjs +24 -1
- package/dist/esm/getIntlayerAPI/oAuth.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/organization.mjs +90 -1
- package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/project.mjs +138 -1
- package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/search.mjs +19 -1
- package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/showcaseProject.mjs +57 -1
- package/dist/esm/getIntlayerAPI/showcaseProject.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs +35 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/tag.mjs +44 -1
- package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/user.mjs +76 -1
- package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
- package/dist/esm/index.mjs +22 -1
- package/dist/esm/proxy.mjs +99 -1
- package/dist/esm/proxy.mjs.map +1 -1
- package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts +10 -0
- package/dist/types/@intlayer/unmerged-dictionaries-entry/dist/types/index.d.ts.map +1 -0
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts +11 -2
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts.map +1 -0
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +11 -2
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -0
- package/dist/types/distantDictionary/index.d.ts +2 -2
- package/dist/types/getIntlayerAPI/ai.d.ts +32 -2
- package/dist/types/getIntlayerAPI/ai.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/audit.d.ts +44 -2
- package/dist/types/getIntlayerAPI/audit.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/bitbucket.d.ts +81 -2
- package/dist/types/getIntlayerAPI/bitbucket.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/dictionary.d.ts +18 -2
- package/dist/types/getIntlayerAPI/dictionary.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/editor.d.ts +14 -2
- package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/github.d.ts +65 -2
- package/dist/types/getIntlayerAPI/github.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/gitlab.d.ts +70 -2
- package/dist/types/getIntlayerAPI/gitlab.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/index.d.ts +16 -16
- package/dist/types/getIntlayerAPI/newsletter.d.ts +13 -2
- package/dist/types/getIntlayerAPI/newsletter.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/oAuth.d.ts +10 -2
- package/dist/types/getIntlayerAPI/oAuth.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/organization.d.ts +20 -2
- package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/project.d.ts +25 -2
- package/dist/types/getIntlayerAPI/project.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/search.d.ts +11 -2
- package/dist/types/getIntlayerAPI/search.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts +33 -2
- package/dist/types/getIntlayerAPI/showcaseProject.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/stripe.d.ts +13 -2
- package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/tag.d.ts +14 -2
- package/dist/types/getIntlayerAPI/tag.d.ts.map +1 -0
- package/dist/types/getIntlayerAPI/user.d.ts +22 -2
- package/dist/types/getIntlayerAPI/user.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -17
- package/dist/types/intlayer-editor/server/dist/controllers/configuration.controller.d.ts +12 -0
- package/dist/types/intlayer-editor/server/dist/controllers/configuration.controller.d.ts.map +1 -0
- package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts +25 -0
- package/dist/types/intlayer-editor/server/dist/controllers/dictionary.controller.d.ts.map +1 -0
- package/dist/types/intlayer-editor/server/dist/export.d.ts +2 -0
- package/dist/types/{editor-DTBh5ovU.d.ts → intlayer-editor/server/dist/utils/httpStatusCodes.d.ts} +3 -61
- package/dist/types/intlayer-editor/server/dist/utils/httpStatusCodes.d.ts.map +1 -0
- package/dist/types/intlayer-editor/server/dist/utils/responseData.d.ts +20 -0
- package/dist/types/intlayer-editor/server/dist/utils/responseData.d.ts.map +1 -0
- package/dist/types/proxy.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/getIntlayerAPI-CUu2tiLP.cjs +0 -2
- package/dist/cjs/getIntlayerAPI-CUu2tiLP.cjs.map +0 -1
- package/dist/types/ai-FbIMwui1.d.ts +0 -32
- package/dist/types/ai-FbIMwui1.d.ts.map +0 -1
- package/dist/types/audit-DzTxbapP.d.ts +0 -44
- package/dist/types/audit-DzTxbapP.d.ts.map +0 -1
- package/dist/types/bitbucket-DeRx5IlR.d.ts +0 -81
- package/dist/types/bitbucket-DeRx5IlR.d.ts.map +0 -1
- package/dist/types/dictionary-W5LSPsxq.d.ts +0 -18
- package/dist/types/dictionary-W5LSPsxq.d.ts.map +0 -1
- package/dist/types/editor-DTBh5ovU.d.ts.map +0 -1
- package/dist/types/fetchDistantDictionaries-CLQEr6NS.d.ts +0 -11
- package/dist/types/fetchDistantDictionaries-CLQEr6NS.d.ts.map +0 -1
- package/dist/types/fetchDistantDictionary-C7esreMl.d.ts +0 -11
- package/dist/types/fetchDistantDictionary-C7esreMl.d.ts.map +0 -1
- package/dist/types/github-D077Il7G.d.ts +0 -65
- package/dist/types/github-D077Il7G.d.ts.map +0 -1
- package/dist/types/gitlab-BrWydMCh.d.ts +0 -70
- package/dist/types/gitlab-BrWydMCh.d.ts.map +0 -1
- package/dist/types/newsletter-Dg_6QDY_.d.ts +0 -13
- package/dist/types/newsletter-Dg_6QDY_.d.ts.map +0 -1
- package/dist/types/oAuth-DfQmGzLO.d.ts +0 -10
- package/dist/types/oAuth-DfQmGzLO.d.ts.map +0 -1
- package/dist/types/organization-CNkB8dnj.d.ts +0 -20
- package/dist/types/organization-CNkB8dnj.d.ts.map +0 -1
- package/dist/types/project-DKLgh9Mz.d.ts +0 -25
- package/dist/types/project-DKLgh9Mz.d.ts.map +0 -1
- package/dist/types/search-CVbo1OMK.d.ts +0 -11
- package/dist/types/search-CVbo1OMK.d.ts.map +0 -1
- package/dist/types/showcaseProject-1zcpB4aW.d.ts +0 -33
- package/dist/types/showcaseProject-1zcpB4aW.d.ts.map +0 -1
- package/dist/types/stripe-vRfMjdAc.d.ts +0 -13
- package/dist/types/stripe-vRfMjdAc.d.ts.map +0 -1
- package/dist/types/tag-0oc2-9J5.d.ts +0 -14
- package/dist/types/tag-0oc2-9J5.d.ts.map +0 -1
- package/dist/types/user-BVi1Ho0Q.d.ts +0 -22
- package/dist/types/user-BVi1Ho0Q.d.ts.map +0 -1
|
@@ -1,2 +1,139 @@
|
|
|
1
|
-
import{fetcher
|
|
1
|
+
import { fetcher } from "../fetcher.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/getIntlayerAPI/project.ts
|
|
4
|
+
const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
5
|
+
const PROJECT_API_ROUTE = `${intlayerConfig.editor.backendURL}/api/project`;
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves a list of projects based on filters and pagination.
|
|
8
|
+
* @param filters - Filters and pagination options.
|
|
9
|
+
*/
|
|
10
|
+
const getProjects = async (filters, otherOptions = {}) => await fetcher(PROJECT_API_ROUTE, authAPIOptions, otherOptions, {
|
|
11
|
+
cache: "no-store",
|
|
12
|
+
params: filters
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Adds a new project to the database.
|
|
16
|
+
* @param project - Project data.
|
|
17
|
+
*/
|
|
18
|
+
const addProject = async (project, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
body: project
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Updates an existing project in the database.
|
|
24
|
+
* @param project - Updated project data.
|
|
25
|
+
*/
|
|
26
|
+
const updateProject = async (project, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
27
|
+
method: "PUT",
|
|
28
|
+
body: project
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Updates project members in the database.
|
|
32
|
+
* @param project - Updated project data.
|
|
33
|
+
*/
|
|
34
|
+
const updateProjectMembers = async (body, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/members`, authAPIOptions, otherOptions, {
|
|
35
|
+
method: "PUT",
|
|
36
|
+
body
|
|
37
|
+
});
|
|
38
|
+
/** Pushes a project configuration to the database.
|
|
39
|
+
* @param projectConfiguration - Project configuration data.
|
|
40
|
+
*/
|
|
41
|
+
const pushProjectConfiguration = async (projectConfiguration, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/configuration`, authAPIOptions, otherOptions, {
|
|
42
|
+
method: "PUT",
|
|
43
|
+
body: projectConfiguration
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Deletes a project from the database by its ID.
|
|
47
|
+
* @param id - Project ID.
|
|
48
|
+
*/
|
|
49
|
+
const deleteProject = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
50
|
+
/**
|
|
51
|
+
* Select a project from the database by its ID.
|
|
52
|
+
* @param projectId - Organization ID.
|
|
53
|
+
*/
|
|
54
|
+
const selectProject = async (projectId, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/${String(projectId)}`, authAPIOptions, otherOptions, { method: "PUT" });
|
|
55
|
+
/**
|
|
56
|
+
* Unselect a project from the database by its ID.
|
|
57
|
+
* @param projectId - Project ID.
|
|
58
|
+
*/
|
|
59
|
+
const unselectProject = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/logout`, authAPIOptions, otherOptions, { method: "POST" });
|
|
60
|
+
/**
|
|
61
|
+
* Add a new access key to a project.
|
|
62
|
+
* @param accessKey - Access key data.
|
|
63
|
+
* @param otherOptions - Fetcher options.
|
|
64
|
+
* @returns The new access key.
|
|
65
|
+
*/
|
|
66
|
+
const addNewAccessKey = async (accessKey, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/access_key`, authAPIOptions, otherOptions, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
body: accessKey
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Delete a project access key.
|
|
72
|
+
* @param clientId - Access key client ID.
|
|
73
|
+
* @param otherOptions - Fetcher options.
|
|
74
|
+
* @returns The deleted project.
|
|
75
|
+
*/
|
|
76
|
+
const deleteAccessKey = async (clientId, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/access_key`, authAPIOptions, otherOptions, {
|
|
77
|
+
method: "DELETE",
|
|
78
|
+
body: { clientId }
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Refreshes an access key from a project.
|
|
82
|
+
* @param clientId - The ID of the client to refresh.
|
|
83
|
+
* @param projectId - The ID of the project to refresh the access key from.
|
|
84
|
+
* @returns The new access key.
|
|
85
|
+
*/
|
|
86
|
+
const refreshAccessKey = async (clientId, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/access_key`, authAPIOptions, otherOptions, {
|
|
87
|
+
method: "PATCH",
|
|
88
|
+
body: { clientId }
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Triggers CI builds for a project (Git provider pipelines and webhooks).
|
|
92
|
+
* @param otherOptions - Fetcher options.
|
|
93
|
+
* @returns The trigger results.
|
|
94
|
+
*/
|
|
95
|
+
const triggerBuild = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/build`, authAPIOptions, otherOptions, { method: "POST" });
|
|
96
|
+
/**
|
|
97
|
+
* Triggers a single webhook by index.
|
|
98
|
+
* @param webhookIndex - The index of the webhook to trigger.
|
|
99
|
+
* @param otherOptions - Fetcher options.
|
|
100
|
+
* @returns The trigger result.
|
|
101
|
+
*/
|
|
102
|
+
const triggerWebhook = async (webhookIndex, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/webhook`, authAPIOptions, otherOptions, {
|
|
103
|
+
method: "POST",
|
|
104
|
+
body: { webhookIndex }
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* Get CI configuration status for the current project.
|
|
108
|
+
* @param otherOptions - Fetcher options.
|
|
109
|
+
* @returns The CI configuration status.
|
|
110
|
+
*/
|
|
111
|
+
const getCIConfig = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/ci`, authAPIOptions, otherOptions, { method: "GET" });
|
|
112
|
+
/**
|
|
113
|
+
* Push CI configuration file to the repository.
|
|
114
|
+
* @param otherOptions - Fetcher options.
|
|
115
|
+
* @returns Success status.
|
|
116
|
+
*/
|
|
117
|
+
const pushCIConfig = async (otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/ci`, authAPIOptions, otherOptions, { method: "POST" });
|
|
118
|
+
return {
|
|
119
|
+
getProjects,
|
|
120
|
+
addProject,
|
|
121
|
+
updateProject,
|
|
122
|
+
updateProjectMembers,
|
|
123
|
+
pushProjectConfiguration,
|
|
124
|
+
deleteProject,
|
|
125
|
+
selectProject,
|
|
126
|
+
unselectProject,
|
|
127
|
+
addNewAccessKey,
|
|
128
|
+
deleteAccessKey,
|
|
129
|
+
refreshAccessKey,
|
|
130
|
+
triggerBuild,
|
|
131
|
+
triggerWebhook,
|
|
132
|
+
getCIConfig,
|
|
133
|
+
pushCIConfig
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { getProjectAPI };
|
|
2
139
|
//# sourceMappingURL=project.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.mjs","names":[],"sources":["../../../src/getIntlayerAPI/project.ts"],"sourcesContent":["import type {\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n AddProjectBody,\n AddProjectResult,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n DeleteProjectResult,\n GetProjectsParams,\n GetProjectsResult,\n PushProjectConfigurationBody,\n PushProjectConfigurationResult,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n ResponseData,\n SelectProjectParam,\n SelectProjectResult,\n TriggerBuildResult,\n TriggerWebhookBody,\n TriggerWebhookResult,\n UnselectProjectResult,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n UpdateProjectResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /** Pushes a project configuration to the database.\n * @param projectConfiguration - Project configuration data.\n */\n const pushProjectConfiguration = async (\n projectConfiguration: PushProjectConfigurationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushProjectConfigurationResult>(\n `${PROJECT_API_ROUTE}/configuration`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: projectConfiguration,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n /**\n * Triggers CI builds for a project (Git provider pipelines and webhooks).\n * @param otherOptions - Fetcher options.\n * @returns The trigger results.\n */\n const triggerBuild = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<TriggerBuildResult>(\n `${PROJECT_API_ROUTE}/build`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Triggers a single webhook by index.\n * @param webhookIndex - The index of the webhook to trigger.\n * @param otherOptions - Fetcher options.\n * @returns The trigger result.\n */\n const triggerWebhook = async (\n webhookIndex: TriggerWebhookBody['webhookIndex'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<TriggerWebhookResult>(\n `${PROJECT_API_ROUTE}/webhook`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { webhookIndex },\n }\n );\n\n /**\n * Get CI configuration status for the current project.\n * @param otherOptions - Fetcher options.\n * @returns The CI configuration status.\n */\n const getCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n /**\n * Push CI configuration file to the repository.\n * @param otherOptions - Fetcher options.\n * @returns Success status.\n */\n const pushCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getProjects,\n addProject,\n updateProject,\n updateProjectMembers,\n pushProjectConfiguration,\n deleteProject,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n triggerBuild,\n triggerWebhook,\n getCIConfig,\n pushCIConfig,\n };\n};\n"],"mappings":"yCA6BA,MAAa,GACX,EAAiC,EAAE,CACnC,IACG,CAGH,IAAM,EAAoB,GAFP,EAAe,OAAO,WAED,cAsQxC,MAAO,CACL,YAjQkB,MAClB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,EACA,EACA,EACA,CACE,MAAO,WAEP,OAAQ,EACT,CACF,CAqPD,WA/OiB,MACjB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,IACH,EACA,EACA,CACE,OAAQ,OACR,KAAM,EACP,CACF,CAoOD,cA9NoB,MACpB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,IACH,EACA,EACA,CACE,OAAQ,MACR,KAAM,EACP,CACF,CAmND,qBA7M2B,MAC3B,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAkB,UACrB,EACA,EACA,CACE,OAAQ,MACR,OACD,CACF,CAkMD,yBA7L+B,MAC/B,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAkB,gBACrB,EACA,EACA,CACE,OAAQ,MACR,KAAM,EACP,CACF,CAkLD,cA5KoB,MAAO,EAA+B,EAAE,GAC5D,MAAM,EACJ,GAAG,IACH,EACA,EACA,CACE,OAAQ,SACT,CACF,CAqKD,cA/JoB,MACpB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAkB,GAAG,OAAO,EAAU,GACzC,EACA,EACA,CACE,OAAQ,MACT,CACF,CAqJD,gBA/IsB,MAAO,EAA+B,EAAE,GAC9D,MAAM,EACJ,GAAG,EAAkB,SACrB,EACA,EACA,CACE,OAAQ,OACT,CACF,CAwID,gBAhIsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAkB,aACrB,EACA,EACA,CACE,OAAQ,OACR,KAAM,EACP,CACF,CAqHD,gBA7GsB,MACtB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAkB,aACrB,EACA,EACA,CACE,OAAQ,SACR,KAAM,CAAE,WAAU,CACnB,CACF,CAkGD,iBA1FuB,MACvB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAkB,aACrB,EACA,EACA,CACE,OAAQ,QACR,KAAM,CAAE,WAAU,CACnB,CACF,CA+ED,aAxEmB,MAAO,EAA+B,EAAE,GAC3D,MAAM,EACJ,GAAG,EAAkB,QACrB,EACA,EACA,CACE,OAAQ,OACT,CACF,CAiED,eAzDqB,MACrB,EACA,EAA+B,EAAE,GAEjC,MAAM,EACJ,GAAG,EAAkB,UACrB,EACA,EACA,CACE,OAAQ,OACR,KAAM,CAAE,eAAc,CACvB,CACF,CA8CD,YAvCkB,MAAO,EAA+B,EAAE,GAC1D,MAAM,EACJ,GAAG,EAAkB,KACrB,EACA,EACA,CACE,OAAQ,MACT,CACF,CAgCD,aAzBmB,MAAO,EAA+B,EAAE,GAC3D,MAAM,EACJ,GAAG,EAAkB,KACrB,EACA,EACA,CACE,OAAQ,OACT,CACF,CAkBF"}
|
|
1
|
+
{"version":3,"file":"project.mjs","names":[],"sources":["../../../src/getIntlayerAPI/project.ts"],"sourcesContent":["import type {\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n AddProjectBody,\n AddProjectResult,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n DeleteProjectResult,\n GetProjectsParams,\n GetProjectsResult,\n PushProjectConfigurationBody,\n PushProjectConfigurationResult,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n ResponseData,\n SelectProjectParam,\n SelectProjectResult,\n TriggerBuildResult,\n TriggerWebhookBody,\n TriggerWebhookResult,\n UnselectProjectResult,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n UpdateProjectResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /** Pushes a project configuration to the database.\n * @param projectConfiguration - Project configuration data.\n */\n const pushProjectConfiguration = async (\n projectConfiguration: PushProjectConfigurationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<PushProjectConfigurationResult>(\n `${PROJECT_API_ROUTE}/configuration`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: projectConfiguration,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n /**\n * Triggers CI builds for a project (Git provider pipelines and webhooks).\n * @param otherOptions - Fetcher options.\n * @returns The trigger results.\n */\n const triggerBuild = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<TriggerBuildResult>(\n `${PROJECT_API_ROUTE}/build`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Triggers a single webhook by index.\n * @param webhookIndex - The index of the webhook to trigger.\n * @param otherOptions - Fetcher options.\n * @returns The trigger result.\n */\n const triggerWebhook = async (\n webhookIndex: TriggerWebhookBody['webhookIndex'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<TriggerWebhookResult>(\n `${PROJECT_API_ROUTE}/webhook`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: { webhookIndex },\n }\n );\n\n /**\n * Get CI configuration status for the current project.\n * @param otherOptions - Fetcher options.\n * @returns The CI configuration status.\n */\n const getCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n }\n );\n\n /**\n * Push CI configuration file to the repository.\n * @param otherOptions - Fetcher options.\n * @returns Success status.\n */\n const pushCIConfig = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<ResponseData<any>>(\n `${PROJECT_API_ROUTE}/ci`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getProjects,\n addProject,\n updateProject,\n updateProjectMembers,\n pushProjectConfiguration,\n deleteProject,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n triggerBuild,\n triggerWebhook,\n getCIConfig,\n pushCIConfig,\n };\n};\n"],"mappings":";;;AA6BA,MAAa,iBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,oBAAoB,GAFP,eAAe,OAAO,WAED;;;;;CAMxC,MAAM,cAAc,OAClB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,aAAa,OACjB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,uBAAuB,OAC3B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,WACrB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;CAKH,MAAM,2BAA2B,OAC/B,sBACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,iBACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,gBAAgB,OAAO,eAA+B,EAAE,KAC5D,MAAM,QACJ,GAAG,qBACH,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;CAMH,MAAM,gBAAgB,OACpB,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,GAAG,OAAO,UAAU,IACzC,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;CAMH,MAAM,kBAAkB,OAAO,eAA+B,EAAE,KAC9D,MAAM,QACJ,GAAG,kBAAkB,UACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;;CAQH,MAAM,kBAAkB,OACtB,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;;CAQH,MAAM,kBAAkB,OACtB,UACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;;;;;;;CAQH,MAAM,mBAAmB,OACvB,UACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,cACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,UAAU;EACnB,CACF;;;;;;CAOH,MAAM,eAAe,OAAO,eAA+B,EAAE,KAC3D,MAAM,QACJ,GAAG,kBAAkB,SACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;;;;;;;CAQH,MAAM,iBAAiB,OACrB,cACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,WACrB,gBACA,cACA;EACE,QAAQ;EACR,MAAM,EAAE,cAAc;EACvB,CACF;;;;;;CAOH,MAAM,cAAc,OAAO,eAA+B,EAAE,KAC1D,MAAM,QACJ,GAAG,kBAAkB,MACrB,gBACA,cACA,EACE,QAAQ,OACT,CACF;;;;;;CAOH,MAAM,eAAe,OAAO,eAA+B,EAAE,KAC3D,MAAM,QACJ,GAAG,kBAAkB,MACrB,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
import{fetcher
|
|
1
|
+
import { fetcher } from "../fetcher.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/getIntlayerAPI/search.ts
|
|
4
|
+
const getSearchAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
5
|
+
const AI_API_ROUTE = `${intlayerConfig.editor.backendURL}/api/search`;
|
|
6
|
+
/**
|
|
7
|
+
* Search documentation
|
|
8
|
+
* @param params - Search parameters containing the input query.
|
|
9
|
+
* @returns Search results with GitHub URLs.
|
|
10
|
+
*/
|
|
11
|
+
const searchDoc = async (params, otherOptions = {}) => await fetcher(`${AI_API_ROUTE}/doc`, authAPIOptions, otherOptions, {
|
|
12
|
+
method: "GET",
|
|
13
|
+
params
|
|
14
|
+
});
|
|
15
|
+
return { searchDoc };
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { getSearchAPI };
|
|
2
20
|
//# sourceMappingURL=search.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.mjs","names":[],"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import type {\n SearchDocUtilParams,\n SearchDocUtilResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getSearchAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const AI_API_ROUTE = `${backendURL}/api/search`;\n\n /**\n * Search documentation\n * @param params - Search parameters containing the input query.\n * @returns Search results with GitHub URLs.\n */\n const searchDoc = async (\n params?: SearchDocUtilParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SearchDocUtilResult>(\n `${AI_API_ROUTE}/doc`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: params,\n }\n );\n\n return {\n searchDoc,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.mjs","names":[],"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import type {\n SearchDocUtilParams,\n SearchDocUtilResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getSearchAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const AI_API_ROUTE = `${backendURL}/api/search`;\n\n /**\n * Search documentation\n * @param params - Search parameters containing the input query.\n * @returns Search results with GitHub URLs.\n */\n const searchDoc = async (\n params?: SearchDocUtilParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SearchDocUtilResult>(\n `${AI_API_ROUTE}/doc`,\n authAPIOptions,\n otherOptions,\n {\n method: 'GET',\n params: params,\n }\n );\n\n return {\n searchDoc,\n };\n};\n"],"mappings":";;;AAOA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,eAAe,GAFF,eAAe,OAAO,WAEN;;;;;;CAOnC,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,aAAa,OAChB,gBACA,cACA;EACE,QAAQ;EACA;EACT,CACF;AAEH,QAAO,EACL,WACD"}
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
-
import{fetcher
|
|
1
|
+
import { fetcher } from "../fetcher.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/getIntlayerAPI/showcaseProject.ts
|
|
4
|
+
const getShowcaseProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
5
|
+
const SHOWCASE_API_ROUTE = `${intlayerConfig.editor.backendURL}/api/showcase-project`;
|
|
6
|
+
const getShowcaseProjects = async (query, otherOptions = {}) => {
|
|
7
|
+
const params = {};
|
|
8
|
+
if (query?.page !== void 0) params.page = String(query.page);
|
|
9
|
+
if (query?.pageSize !== void 0) params.pageSize = String(query.pageSize);
|
|
10
|
+
if (query?.search !== void 0) params.search = query.search;
|
|
11
|
+
if (query?.isOpenSource !== void 0) params.isOpenSource = String(query.isOpenSource);
|
|
12
|
+
if (query?.selectedUseCases?.length) params.selectedUseCases = query.selectedUseCases;
|
|
13
|
+
return await fetcher(SHOWCASE_API_ROUTE, authAPIOptions, otherOptions, {
|
|
14
|
+
method: "GET",
|
|
15
|
+
params
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const getShowcaseProjectById = async (projectId, otherOptions = {}) => await fetcher(`${SHOWCASE_API_ROUTE}/${projectId}`, authAPIOptions, otherOptions, { method: "GET" });
|
|
19
|
+
const getOtherShowcaseProjects = async (query, otherOptions = {}) => {
|
|
20
|
+
const params = { excludeId: query.excludeId };
|
|
21
|
+
if (query.limit !== void 0) params.limit = String(query.limit);
|
|
22
|
+
return await fetcher(`${SHOWCASE_API_ROUTE}/others`, authAPIOptions, otherOptions, {
|
|
23
|
+
method: "GET",
|
|
24
|
+
params
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const submitShowcaseProject = async (body, otherOptions = {}) => await fetcher(`${SHOWCASE_API_ROUTE}/submit`, authAPIOptions, otherOptions, {
|
|
28
|
+
method: "POST",
|
|
29
|
+
body
|
|
30
|
+
});
|
|
31
|
+
const toggleShowcaseUpvote = async (body, otherOptions = {}) => await fetcher(`${SHOWCASE_API_ROUTE}/upvote`, authAPIOptions, otherOptions, {
|
|
32
|
+
method: "POST",
|
|
33
|
+
body
|
|
34
|
+
});
|
|
35
|
+
const toggleShowcaseDownvote = async (body, otherOptions = {}) => await fetcher(`${SHOWCASE_API_ROUTE}/downvote`, authAPIOptions, otherOptions, {
|
|
36
|
+
method: "POST",
|
|
37
|
+
body
|
|
38
|
+
});
|
|
39
|
+
const deleteShowcaseProject = async (projectId, otherOptions = {}) => await fetcher(`${SHOWCASE_API_ROUTE}/${projectId}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
40
|
+
const updateShowcaseProject = async (projectId, body, otherOptions = {}) => await fetcher(`${SHOWCASE_API_ROUTE}/${projectId}`, authAPIOptions, otherOptions, {
|
|
41
|
+
method: "PATCH",
|
|
42
|
+
body
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
getShowcaseProjects,
|
|
46
|
+
getShowcaseProjectById,
|
|
47
|
+
getOtherShowcaseProjects,
|
|
48
|
+
submitShowcaseProject,
|
|
49
|
+
toggleShowcaseUpvote,
|
|
50
|
+
toggleShowcaseDownvote,
|
|
51
|
+
deleteShowcaseProject,
|
|
52
|
+
updateShowcaseProject
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { getShowcaseProjectAPI };
|
|
2
58
|
//# sourceMappingURL=showcaseProject.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"showcaseProject.mjs","names":[],"sources":["../../../src/getIntlayerAPI/showcaseProject.ts"],"sourcesContent":["import type {\n GetOtherShowcaseProjectsResult,\n GetShowcaseProjectByIdParams,\n GetShowcaseProjectByIdResult,\n GetShowcaseProjectsResult,\n SubmitShowcaseProjectBody,\n SubmitShowcaseProjectResult,\n ToggleShowcaseDownvoteBody,\n ToggleShowcaseDownvoteResult,\n ToggleShowcaseUpvoteBody,\n ToggleShowcaseUpvoteResult,\n UpdateShowcaseProjectBody,\n UpdateShowcaseProjectResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n// Client-side query types use proper JS types (numbers/booleans) rather than\n// the backend querystring types which are always strings.\nexport type ShowcaseProjectsQuery = {\n page?: number;\n pageSize?: number;\n search?: string;\n selectedUseCases?: string[];\n isOpenSource?: boolean;\n};\n\nexport type OtherShowcaseProjectsQuery = {\n excludeId: string;\n limit?: number;\n};\n\nexport const getShowcaseProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const SHOWCASE_API_ROUTE = `${backendURL}/api/showcase-project`;\n\n const getShowcaseProjects = async (\n query?: ShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string | string[]> = {};\n if (query?.page !== undefined) params.page = String(query.page);\n if (query?.pageSize !== undefined) params.pageSize = String(query.pageSize);\n if (query?.search !== undefined) params.search = query.search;\n if (query?.isOpenSource !== undefined)\n params.isOpenSource = String(query.isOpenSource);\n if (query?.selectedUseCases?.length)\n params.selectedUseCases = query.selectedUseCases;\n\n return await fetcher<GetShowcaseProjectsResult>(\n SHOWCASE_API_ROUTE,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const getShowcaseProjectById = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetShowcaseProjectByIdResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getOtherShowcaseProjects = async (\n query: OtherShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string> = { excludeId: query.excludeId };\n if (query.limit !== undefined) params.limit = String(query.limit);\n return await fetcher<GetOtherShowcaseProjectsResult>(\n `${SHOWCASE_API_ROUTE}/others`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const submitShowcaseProject = async (\n body: SubmitShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SubmitShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/submit`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseUpvote = async (\n body: ToggleShowcaseUpvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseUpvoteResult>(\n `${SHOWCASE_API_ROUTE}/upvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseDownvote = async (\n body: ToggleShowcaseDownvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseDownvoteResult>(\n `${SHOWCASE_API_ROUTE}/downvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const deleteShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<{ data: { success: boolean } }>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n const updateShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n body: UpdateShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n return {\n getShowcaseProjects,\n getShowcaseProjectById,\n getOtherShowcaseProjects,\n submitShowcaseProject,\n toggleShowcaseUpvote,\n toggleShowcaseDownvote,\n deleteShowcaseProject,\n updateShowcaseProject,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"showcaseProject.mjs","names":[],"sources":["../../../src/getIntlayerAPI/showcaseProject.ts"],"sourcesContent":["import type {\n GetOtherShowcaseProjectsResult,\n GetShowcaseProjectByIdParams,\n GetShowcaseProjectByIdResult,\n GetShowcaseProjectsResult,\n SubmitShowcaseProjectBody,\n SubmitShowcaseProjectResult,\n ToggleShowcaseDownvoteBody,\n ToggleShowcaseDownvoteResult,\n ToggleShowcaseUpvoteBody,\n ToggleShowcaseUpvoteResult,\n UpdateShowcaseProjectBody,\n UpdateShowcaseProjectResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\n// Client-side query types use proper JS types (numbers/booleans) rather than\n// the backend querystring types which are always strings.\nexport type ShowcaseProjectsQuery = {\n page?: number;\n pageSize?: number;\n search?: string;\n selectedUseCases?: string[];\n isOpenSource?: boolean;\n};\n\nexport type OtherShowcaseProjectsQuery = {\n excludeId: string;\n limit?: number;\n};\n\nexport const getShowcaseProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const SHOWCASE_API_ROUTE = `${backendURL}/api/showcase-project`;\n\n const getShowcaseProjects = async (\n query?: ShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string | string[]> = {};\n if (query?.page !== undefined) params.page = String(query.page);\n if (query?.pageSize !== undefined) params.pageSize = String(query.pageSize);\n if (query?.search !== undefined) params.search = query.search;\n if (query?.isOpenSource !== undefined)\n params.isOpenSource = String(query.isOpenSource);\n if (query?.selectedUseCases?.length)\n params.selectedUseCases = query.selectedUseCases;\n\n return await fetcher<GetShowcaseProjectsResult>(\n SHOWCASE_API_ROUTE,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const getShowcaseProjectById = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetShowcaseProjectByIdResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'GET' }\n );\n\n const getOtherShowcaseProjects = async (\n query: OtherShowcaseProjectsQuery,\n otherOptions: FetcherOptions = {}\n ) => {\n const params: Record<string, string> = { excludeId: query.excludeId };\n if (query.limit !== undefined) params.limit = String(query.limit);\n return await fetcher<GetOtherShowcaseProjectsResult>(\n `${SHOWCASE_API_ROUTE}/others`,\n authAPIOptions,\n otherOptions,\n { method: 'GET', params: params as any }\n );\n };\n\n const submitShowcaseProject = async (\n body: SubmitShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SubmitShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/submit`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseUpvote = async (\n body: ToggleShowcaseUpvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseUpvoteResult>(\n `${SHOWCASE_API_ROUTE}/upvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const toggleShowcaseDownvote = async (\n body: ToggleShowcaseDownvoteBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<ToggleShowcaseDownvoteResult>(\n `${SHOWCASE_API_ROUTE}/downvote`,\n authAPIOptions,\n otherOptions,\n { method: 'POST', body }\n );\n\n const deleteShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<{ data: { success: boolean } }>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'DELETE' }\n );\n\n const updateShowcaseProject = async (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n body: UpdateShowcaseProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateShowcaseProjectResult>(\n `${SHOWCASE_API_ROUTE}/${projectId}`,\n authAPIOptions,\n otherOptions,\n { method: 'PATCH', body }\n );\n\n return {\n getShowcaseProjects,\n getShowcaseProjectById,\n getOtherShowcaseProjects,\n submitShowcaseProject,\n toggleShowcaseUpvote,\n toggleShowcaseDownvote,\n deleteShowcaseProject,\n updateShowcaseProject,\n };\n};\n"],"mappings":";;;AAgCA,MAAa,yBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,qBAAqB,GAFR,eAAe,OAAO,WAEA;CAEzC,MAAM,sBAAsB,OAC1B,OACA,eAA+B,EAAE,KAC9B;EACH,MAAM,SAA4C,EAAE;AACpD,MAAI,OAAO,SAAS,OAAW,QAAO,OAAO,OAAO,MAAM,KAAK;AAC/D,MAAI,OAAO,aAAa,OAAW,QAAO,WAAW,OAAO,MAAM,SAAS;AAC3E,MAAI,OAAO,WAAW,OAAW,QAAO,SAAS,MAAM;AACvD,MAAI,OAAO,iBAAiB,OAC1B,QAAO,eAAe,OAAO,MAAM,aAAa;AAClD,MAAI,OAAO,kBAAkB,OAC3B,QAAO,mBAAmB,MAAM;AAElC,SAAO,MAAM,QACX,oBACA,gBACA,cACA;GAAE,QAAQ;GAAe;GAAe,CACzC;;CAGH,MAAM,yBAAyB,OAC7B,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA,EAAE,QAAQ,OAAO,CAClB;CAEH,MAAM,2BAA2B,OAC/B,OACA,eAA+B,EAAE,KAC9B;EACH,MAAM,SAAiC,EAAE,WAAW,MAAM,WAAW;AACrE,MAAI,MAAM,UAAU,OAAW,QAAO,QAAQ,OAAO,MAAM,MAAM;AACjE,SAAO,MAAM,QACX,GAAG,mBAAmB,UACtB,gBACA,cACA;GAAE,QAAQ;GAAe;GAAe,CACzC;;CAGH,MAAM,wBAAwB,OAC5B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,UACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,uBAAuB,OAC3B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,UACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,yBAAyB,OAC7B,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,YACtB,gBACA,cACA;EAAE,QAAQ;EAAQ;EAAM,CACzB;CAEH,MAAM,wBAAwB,OAC5B,WACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA,EAAE,QAAQ,UAAU,CACrB;CAEH,MAAM,wBAAwB,OAC5B,WACA,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,mBAAmB,GAAG,aACzB,gBACA,cACA;EAAE,QAAQ;EAAS;EAAM,CAC1B;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -1,2 +1,36 @@
|
|
|
1
|
-
import{fetcher
|
|
1
|
+
import { fetcher } from "../fetcher.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/getIntlayerAPI/stripe.ts
|
|
4
|
+
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
5
|
+
const STRIPE_API_ROUTE = `${intlayerConfig.editor.backendURL}/api/stripe`;
|
|
6
|
+
/**
|
|
7
|
+
* Get a pricing plan calculated for a given promotion code.
|
|
8
|
+
* @param body - Pricing plan body.
|
|
9
|
+
*/
|
|
10
|
+
const getPricing = async (body, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/pricing`, authAPIOptions, otherOptions, {
|
|
11
|
+
method: "POST",
|
|
12
|
+
body
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves a checkout session.
|
|
16
|
+
* @param body - Checkout session body.
|
|
17
|
+
*/
|
|
18
|
+
const getSubscription = async (body, otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/create-subscription`, authAPIOptions, otherOptions, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
body
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Cancels a subscription.
|
|
24
|
+
* @param body - Checkout session body.
|
|
25
|
+
*/
|
|
26
|
+
const cancelSubscription = async (otherOptions = {}) => await fetcher(`${STRIPE_API_ROUTE}/cancel-subscription`, authAPIOptions, otherOptions, { method: "POST" });
|
|
27
|
+
return {
|
|
28
|
+
getPricing,
|
|
29
|
+
getSubscription,
|
|
30
|
+
cancelSubscription
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { getStripeAPI };
|
|
2
36
|
//# sourceMappingURL=stripe.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.mjs","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"stripe.mjs","names":[],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":";;;AASA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,mBAAmB,GAFN,eAAe,OAAO,WAEF;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAM,QACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
|
|
@@ -1,2 +1,45 @@
|
|
|
1
|
-
import{fetcher
|
|
1
|
+
import { fetcher } from "../fetcher.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/getIntlayerAPI/tag.ts
|
|
4
|
+
const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
5
|
+
const PROJECT_API_ROUTE = `${intlayerConfig.editor.backendURL}/api/tag`;
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves a list of tags based on filters and pagination.
|
|
8
|
+
* @param filters - Filters and pagination options.
|
|
9
|
+
*/
|
|
10
|
+
const getTags = async (filters, otherOptions = {}) => await fetcher(PROJECT_API_ROUTE, authAPIOptions, otherOptions, {
|
|
11
|
+
cache: "no-store",
|
|
12
|
+
params: filters
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Adds a new tag to the database.
|
|
16
|
+
* @param tag - Tag data.
|
|
17
|
+
*/
|
|
18
|
+
const addTag = async (tag, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
body: tag
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Updates an existing tag in the database.
|
|
24
|
+
* @param tag - Updated tag data.
|
|
25
|
+
*/
|
|
26
|
+
const updateTag = async (tagId, tag, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/${tagId}`, authAPIOptions, otherOptions, {
|
|
27
|
+
method: "PUT",
|
|
28
|
+
body: tag
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Deletes a tag from the database by its ID.
|
|
32
|
+
* @param tagId - Tag ID.
|
|
33
|
+
*/
|
|
34
|
+
const deleteTag = async (tagId, otherOptions = {}) => await fetcher(`${PROJECT_API_ROUTE}/${tagId}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
35
|
+
return {
|
|
36
|
+
getTags,
|
|
37
|
+
addTag,
|
|
38
|
+
updateTag,
|
|
39
|
+
deleteTag
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { getTagAPI };
|
|
2
45
|
//# sourceMappingURL=tag.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.mjs","names":[],"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getTagAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/tag`;\n\n /**\n * Retrieves a list of tags based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getTags = async (\n filters?: GetTagsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetTagsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Adds a new tag to the database.\n * @param tag - Tag data.\n */\n const addTag = async (tag: AddTagBody, otherOptions: FetcherOptions = {}) =>\n await fetcher<AddTagResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: tag,\n }\n );\n\n /**\n * Updates an existing tag in the database.\n * @param tag - Updated tag data.\n */\n const updateTag = async (\n tagId: UpdateTagParams['tagId'],\n tag: UpdateTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: tag,\n }\n );\n\n /**\n * Deletes a tag from the database by its ID.\n * @param tagId - Tag ID.\n */\n const deleteTag = async (\n tagId: DeleteTagParams['tagId'],\n\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getTags,\n addTag,\n updateTag,\n deleteTag,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tag.mjs","names":[],"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\nexport const getTagAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const PROJECT_API_ROUTE = `${backendURL}/api/tag`;\n\n /**\n * Retrieves a list of tags based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getTags = async (\n filters?: GetTagsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetTagsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Adds a new tag to the database.\n * @param tag - Tag data.\n */\n const addTag = async (tag: AddTagBody, otherOptions: FetcherOptions = {}) =>\n await fetcher<AddTagResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: tag,\n }\n );\n\n /**\n * Updates an existing tag in the database.\n * @param tag - Updated tag data.\n */\n const updateTag = async (\n tagId: UpdateTagParams['tagId'],\n tag: UpdateTagBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: tag,\n }\n );\n\n /**\n * Deletes a tag from the database by its ID.\n * @param tagId - Tag ID.\n */\n const deleteTag = async (\n tagId: DeleteTagParams['tagId'],\n\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteTagResult>(\n `${PROJECT_API_ROUTE}/${tagId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n return {\n getTags,\n addTag,\n updateTag,\n deleteTag,\n };\n};\n"],"mappings":";;;AAcA,MAAa,aACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,oBAAoB,GAFP,eAAe,OAAO,WAED;;;;;CAMxC,MAAM,UAAU,OACd,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,SAAS,OAAO,KAAiB,eAA+B,EAAE,KACtE,MAAM,QACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OACA,KACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OAEA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACD"}
|
|
@@ -1,2 +1,77 @@
|
|
|
1
|
-
import{fetcher
|
|
1
|
+
import { fetcher } from "../fetcher.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/getIntlayerAPI/user.ts
|
|
4
|
+
const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
5
|
+
const USER_API_ROUTE = `${intlayerConfig.editor.backendURL}/api/user`;
|
|
6
|
+
/**
|
|
7
|
+
* Retrieves a list of users based on filters and pagination.
|
|
8
|
+
* @param filters - Filters and pagination options.
|
|
9
|
+
* @returns List of users.
|
|
10
|
+
*/
|
|
11
|
+
const getUsers = async (filters, otherOptions = {}) => await fetcher(USER_API_ROUTE, authAPIOptions, otherOptions, {
|
|
12
|
+
cache: "no-store",
|
|
13
|
+
params: filters
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves a user by ID.
|
|
17
|
+
* @param userId - User ID.
|
|
18
|
+
* @returns User object.
|
|
19
|
+
*/
|
|
20
|
+
const getUserById = async (userId, otherOptions = {}) => await fetcher(`${USER_API_ROUTE}/${userId}`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a user by email.
|
|
23
|
+
* @param email - User email.
|
|
24
|
+
* @returns User object.
|
|
25
|
+
*/
|
|
26
|
+
const getUserByEmail = async (email, otherOptions = {}) => await fetcher(`${USER_API_ROUTE}/email/${email}`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a user by account.
|
|
29
|
+
* @param providerAccountId - The provider account ID.
|
|
30
|
+
* @param provider - The provider of the account.
|
|
31
|
+
*/
|
|
32
|
+
const getUserByAccount = async (providerAccountId, provider, otherOptions = {}) => await fetcher(`${USER_API_ROUTE}/account/${provider}/${providerAccountId}`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new user.
|
|
35
|
+
* @param user - User credentials.
|
|
36
|
+
* @returns User object.
|
|
37
|
+
*/
|
|
38
|
+
const createUser = async (user, otherOptions = {}) => await fetcher(`${USER_API_ROUTE}/`, authAPIOptions, otherOptions, {
|
|
39
|
+
method: "POST",
|
|
40
|
+
body: user
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Updates the user with the provided data.
|
|
44
|
+
* @param user - Updated user data.
|
|
45
|
+
* @returns User object.
|
|
46
|
+
*/
|
|
47
|
+
const updateUser = async (user, otherOptions = {}) => await fetcher(`${USER_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
48
|
+
method: "PUT",
|
|
49
|
+
body: user
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Deletes a user with the provided ID.
|
|
53
|
+
* @param userId - User ID.
|
|
54
|
+
* @returns User object.
|
|
55
|
+
*/
|
|
56
|
+
const deleteUser = async (userId, otherOptions = {}) => await fetcher(`${USER_API_ROUTE}/${userId}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
57
|
+
/**
|
|
58
|
+
* Gets the verify email status URL to use in the SSE.
|
|
59
|
+
* @param userId - User ID.
|
|
60
|
+
* @returns The verify email status URL.
|
|
61
|
+
*/
|
|
62
|
+
const getVerifyEmailStatusURL = (userId) => `${USER_API_ROUTE}/verify-email-status/${String(userId)}`;
|
|
63
|
+
return {
|
|
64
|
+
createUser,
|
|
65
|
+
getUsers,
|
|
66
|
+
getUserById,
|
|
67
|
+
getUserByAccount,
|
|
68
|
+
getUserByEmail,
|
|
69
|
+
updateUser,
|
|
70
|
+
deleteUser,
|
|
71
|
+
getVerifyEmailStatusURL
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { getUserAPI };
|
|
2
77
|
//# sourceMappingURL=user.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.mjs","names":[],"sources":["../../../src/getIntlayerAPI/user.ts"],"sourcesContent":["import type {\n CreateUserBody,\n CreateUserResult,\n GetUserByEmailParams,\n GetUserByEmailResult,\n GetUserByIdParams,\n GetUserByIdResult,\n GetUsersParams,\n GetUsersResult,\n UpdateUserBody,\n UpdateUserResult,\n UserAPI,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\ntype GetUserByAccountParams = { providerAccountId: string; provider: string };\ntype GetUserByAccountResult = import('@intlayer/backend').ResponseData<UserAPI>;\n\nexport const getUserAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const USER_API_ROUTE = `${backendURL}/api/user`;\n\n /**\n * Retrieves a list of users based on filters and pagination.\n * @param filters - Filters and pagination options.\n * @returns List of users.\n */\n const getUsers = async (\n filters?: GetUsersParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUsersResult>(\n USER_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves a user by ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const getUserById = async (\n userId: GetUserByIdParams['userId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByIdResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by email.\n * @param email - User email.\n * @returns User object.\n */\n const getUserByEmail = async (\n email: GetUserByEmailParams['email'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByEmailResult>(\n `${USER_API_ROUTE}/email/${email}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by account.\n * @param providerAccountId - The provider account ID.\n * @param provider - The provider of the account.\n */\n const getUserByAccount = async (\n providerAccountId: GetUserByAccountParams['providerAccountId'],\n provider: GetUserByAccountParams['provider'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByAccountResult>(\n `${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Creates a new user.\n * @param user - User credentials.\n * @returns User object.\n */\n const createUser = async (\n user: CreateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreateUserResult>(\n `${USER_API_ROUTE}/`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: user,\n }\n );\n\n /**\n * Updates the user with the provided data.\n * @param user - Updated user data.\n * @returns User object.\n */\n const updateUser = async (\n user: UpdateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: user,\n }\n );\n\n /**\n * Deletes a user with the provided ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const deleteUser = async (\n userId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Gets the verify email status URL to use in the SSE.\n * @param userId - User ID.\n * @returns The verify email status URL.\n */\n const getVerifyEmailStatusURL = (userId: string | UserAPI['id']) =>\n `${USER_API_ROUTE}/verify-email-status/${String(userId)}`;\n\n return {\n createUser,\n getUsers,\n getUserById,\n getUserByAccount,\n getUserByEmail,\n updateUser,\n deleteUser,\n getVerifyEmailStatusURL,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.mjs","names":[],"sources":["../../../src/getIntlayerAPI/user.ts"],"sourcesContent":["import type {\n CreateUserBody,\n CreateUserResult,\n GetUserByEmailParams,\n GetUserByEmailResult,\n GetUserByIdParams,\n GetUserByIdResult,\n GetUsersParams,\n GetUsersResult,\n UpdateUserBody,\n UpdateUserResult,\n UserAPI,\n} from '@intlayer/backend';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { type FetcherOptions, fetcher } from '../fetcher';\n\ntype GetUserByAccountParams = { providerAccountId: string; provider: string };\ntype GetUserByAccountResult = import('@intlayer/backend').ResponseData<UserAPI>;\n\nexport const getUserAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig: IntlayerConfig\n) => {\n const backendURL = intlayerConfig.editor.backendURL;\n\n const USER_API_ROUTE = `${backendURL}/api/user`;\n\n /**\n * Retrieves a list of users based on filters and pagination.\n * @param filters - Filters and pagination options.\n * @returns List of users.\n */\n const getUsers = async (\n filters?: GetUsersParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUsersResult>(\n USER_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n // @ts-ignore Number of parameter will be stringified by the fetcher\n params: filters,\n }\n );\n\n /**\n * Retrieves a user by ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const getUserById = async (\n userId: GetUserByIdParams['userId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByIdResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by email.\n * @param email - User email.\n * @returns User object.\n */\n const getUserByEmail = async (\n email: GetUserByEmailParams['email'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByEmailResult>(\n `${USER_API_ROUTE}/email/${email}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Retrieves a user by account.\n * @param providerAccountId - The provider account ID.\n * @param provider - The provider of the account.\n */\n const getUserByAccount = async (\n providerAccountId: GetUserByAccountParams['providerAccountId'],\n provider: GetUserByAccountParams['provider'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetUserByAccountResult>(\n `${USER_API_ROUTE}/account/${provider}/${providerAccountId}`,\n authAPIOptions,\n otherOptions,\n {\n cache: 'no-store',\n }\n );\n\n /**\n * Creates a new user.\n * @param user - User credentials.\n * @returns User object.\n */\n const createUser = async (\n user: CreateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<CreateUserResult>(\n `${USER_API_ROUTE}/`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: user,\n }\n );\n\n /**\n * Updates the user with the provided data.\n * @param user - Updated user data.\n * @returns User object.\n */\n const updateUser = async (\n user: UpdateUserBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: user,\n }\n );\n\n /**\n * Deletes a user with the provided ID.\n * @param userId - User ID.\n * @returns User object.\n */\n const deleteUser = async (\n userId: string,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateUserResult>(\n `${USER_API_ROUTE}/${userId}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Gets the verify email status URL to use in the SSE.\n * @param userId - User ID.\n * @returns The verify email status URL.\n */\n const getVerifyEmailStatusURL = (userId: string | UserAPI['id']) =>\n `${USER_API_ROUTE}/verify-email-status/${String(userId)}`;\n\n return {\n createUser,\n getUsers,\n getUserById,\n getUserByAccount,\n getUserByEmail,\n updateUser,\n deleteUser,\n getVerifyEmailStatusURL,\n };\n};\n"],"mappings":";;;AAmBA,MAAa,cACX,iBAAiC,EAAE,EACnC,mBACG;CAGH,MAAM,iBAAiB,GAFJ,eAAe,OAAO,WAEJ;;;;;;CAOrC,MAAM,WAAW,OACf,SACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,gBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;;CAOH,MAAM,cAAc,OAClB,QACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,eAAe,GAAG,UACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,iBAAiB,OACrB,OACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,eAAe,SAAS,SAC3B,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,mBAAmB,OACvB,mBACA,UACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,eAAe,WAAW,SAAS,GAAG,qBACzC,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,eAAe,IAClB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,kBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,QACA,eAA+B,EAAE,KAEjC,MAAM,QACJ,GAAG,eAAe,GAAG,UACrB,gBACA,cACA,EACE,QAAQ,UACT,CACF;;;;;;CAOH,MAAM,2BAA2B,WAC/B,GAAG,eAAe,uBAAuB,OAAO,OAAO;AAEzD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
import{fetcher
|
|
1
|
+
import { fetcher, fetcherOptions } from "./fetcher.mjs";
|
|
2
|
+
import { getAiAPI } from "./getIntlayerAPI/ai.mjs";
|
|
3
|
+
import { getAuditAPI } from "./getIntlayerAPI/audit.mjs";
|
|
4
|
+
import { getBitbucketAPI } from "./getIntlayerAPI/bitbucket.mjs";
|
|
5
|
+
import { getDictionaryAPI } from "./getIntlayerAPI/dictionary.mjs";
|
|
6
|
+
import { getEditorAPI } from "./getIntlayerAPI/editor.mjs";
|
|
7
|
+
import { getGithubAPI } from "./getIntlayerAPI/github.mjs";
|
|
8
|
+
import { getGitlabAPI } from "./getIntlayerAPI/gitlab.mjs";
|
|
9
|
+
import { getNewsletterAPI } from "./getIntlayerAPI/newsletter.mjs";
|
|
10
|
+
import { getOAuthAPI } from "./getIntlayerAPI/oAuth.mjs";
|
|
11
|
+
import { getOrganizationAPI } from "./getIntlayerAPI/organization.mjs";
|
|
12
|
+
import { getProjectAPI } from "./getIntlayerAPI/project.mjs";
|
|
13
|
+
import { getSearchAPI } from "./getIntlayerAPI/search.mjs";
|
|
14
|
+
import { getStripeAPI } from "./getIntlayerAPI/stripe.mjs";
|
|
15
|
+
import { getTagAPI } from "./getIntlayerAPI/tag.mjs";
|
|
16
|
+
import { getUserAPI } from "./getIntlayerAPI/user.mjs";
|
|
17
|
+
import { getIntlayerAPI } from "./getIntlayerAPI/index.mjs";
|
|
18
|
+
import { getIntlayerAPIProxy } from "./proxy.mjs";
|
|
19
|
+
import { fetchDistantDictionaries } from "./distantDictionary/fetchDistantDictionaries.mjs";
|
|
20
|
+
import { fetchDistantDictionary } from "./distantDictionary/fetchDistantDictionary.mjs";
|
|
21
|
+
|
|
22
|
+
export { fetchDistantDictionaries, fetchDistantDictionary, fetcher, fetcherOptions, getAiAPI, getAuditAPI, getBitbucketAPI, getDictionaryAPI, getEditorAPI, getGithubAPI, getGitlabAPI, getIntlayerAPI, getIntlayerAPIProxy, getNewsletterAPI, getOAuthAPI, getOrganizationAPI, getProjectAPI, getSearchAPI, getStripeAPI, getTagAPI, getUserAPI };
|