@intlayer/api 6.1.6 → 7.0.0-canary.1
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 +25 -0
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs +18 -55
- package/dist/cjs/distantDictionary/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs +20 -58
- package/dist/cjs/distantDictionary/fetchDistantDictionary.cjs.map +1 -1
- package/dist/cjs/distantDictionary/index.cjs +5 -25
- package/dist/cjs/fetcher.cjs +113 -89
- package/dist/cjs/fetcher.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/ai.cjs +163 -188
- package/dist/cjs/getIntlayerAPI/ai.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/dictionary.cjs +69 -117
- package/dist/cjs/getIntlayerAPI/dictionary.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/editor.cjs +37 -74
- package/dist/cjs/getIntlayerAPI/editor.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/index.cjs +27 -49
- package/dist/cjs/getIntlayerAPI/index.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/newsletter.cjs +40 -77
- package/dist/cjs/getIntlayerAPI/newsletter.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/oAuth.cjs +26 -65
- package/dist/cjs/getIntlayerAPI/oAuth.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/organization.cjs +93 -130
- package/dist/cjs/getIntlayerAPI/organization.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/project.cjs +109 -154
- package/dist/cjs/getIntlayerAPI/project.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/search.cjs +22 -58
- package/dist/cjs/getIntlayerAPI/search.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/stripe.cjs +38 -77
- package/dist/cjs/getIntlayerAPI/stripe.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/tag.cjs +47 -86
- package/dist/cjs/getIntlayerAPI/tag.cjs.map +1 -1
- package/dist/cjs/getIntlayerAPI/user.cjs +79 -106
- package/dist/cjs/getIntlayerAPI/user.cjs.map +1 -1
- package/dist/cjs/index.cjs +30 -49
- package/dist/cjs/proxy.cjs +90 -115
- package/dist/cjs/proxy.cjs.map +1 -1
- package/dist/cjs/types.cjs +0 -17
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs +17 -20
- package/dist/esm/distantDictionary/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs +19 -23
- package/dist/esm/distantDictionary/fetchDistantDictionary.mjs.map +1 -1
- package/dist/esm/distantDictionary/index.mjs +4 -3
- package/dist/esm/fetcher.mjs +111 -64
- package/dist/esm/fetcher.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/ai.mjs +160 -153
- package/dist/esm/getIntlayerAPI/ai.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/dictionary.mjs +66 -82
- package/dist/esm/getIntlayerAPI/dictionary.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/editor.mjs +34 -39
- package/dist/esm/getIntlayerAPI/editor.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/index.mjs +16 -14
- package/dist/esm/getIntlayerAPI/index.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/newsletter.mjs +37 -42
- package/dist/esm/getIntlayerAPI/newsletter.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/oAuth.mjs +23 -30
- package/dist/esm/getIntlayerAPI/oAuth.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/organization.mjs +90 -95
- package/dist/esm/getIntlayerAPI/organization.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/project.mjs +106 -119
- package/dist/esm/getIntlayerAPI/project.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/search.mjs +19 -23
- package/dist/esm/getIntlayerAPI/search.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/stripe.mjs +35 -42
- package/dist/esm/getIntlayerAPI/stripe.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/tag.mjs +44 -51
- package/dist/esm/getIntlayerAPI/tag.mjs.map +1 -1
- package/dist/esm/getIntlayerAPI/user.mjs +76 -71
- package/dist/esm/getIntlayerAPI/user.mjs.map +1 -1
- package/dist/esm/index.mjs +16 -15
- package/dist/esm/proxy.mjs +89 -90
- package/dist/esm/proxy.mjs.map +1 -1
- package/dist/esm/types.mjs +0 -1
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts +8 -3
- package/dist/types/distantDictionary/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts +8 -3
- package/dist/types/distantDictionary/fetchDistantDictionary.d.ts.map +1 -1
- package/dist/types/distantDictionary/index.d.ts +3 -3
- package/dist/types/fetcher.d.ts +14 -11
- package/dist/types/fetcher.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/ai.d.ts +22 -18
- package/dist/types/getIntlayerAPI/ai.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/dictionary.d.ts +16 -12
- package/dist/types/getIntlayerAPI/dictionary.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/editor.d.ts +11 -7
- package/dist/types/getIntlayerAPI/editor.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/index.d.ts +30 -27
- package/dist/types/getIntlayerAPI/index.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/newsletter.d.ts +11 -7
- package/dist/types/getIntlayerAPI/newsletter.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/oAuth.d.ts +8 -5
- package/dist/types/getIntlayerAPI/oAuth.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/organization.d.ts +18 -13
- package/dist/types/getIntlayerAPI/organization.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/project.d.ts +19 -15
- package/dist/types/getIntlayerAPI/project.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/search.d.ts +9 -5
- package/dist/types/getIntlayerAPI/search.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/stripe.d.ts +11 -7
- package/dist/types/getIntlayerAPI/stripe.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/tag.d.ts +12 -8
- package/dist/types/getIntlayerAPI/tag.d.ts.map +1 -1
- package/dist/types/getIntlayerAPI/user.d.ts +16 -12
- package/dist/types/getIntlayerAPI/user.d.ts.map +1 -1
- package/dist/types/index.d.ts +16 -15
- package/dist/types/proxy.d.ts +10 -5
- package/dist/types/proxy.d.ts.map +1 -1
- package/dist/types/types.d.ts +13 -12
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +29 -38
- package/LICENSE +0 -202
- package/dist/cjs/distantDictionary/index.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/types.cjs.map +0 -1
- package/dist/esm/distantDictionary/index.mjs.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/types/distantDictionary/index.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
|
@@ -1,61 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var search_exports = {};
|
|
30
|
-
__export(search_exports, {
|
|
31
|
-
getSearchAPI: () => getSearchAPI
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(search_exports);
|
|
34
|
-
var import_built = __toESM(require("@intlayer/config/built"));
|
|
35
|
-
var import_fetcher = require('../fetcher.cjs');
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_fetcher = require('../fetcher.cjs');
|
|
3
|
+
let __intlayer_config_built = require("@intlayer/config/built");
|
|
4
|
+
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
5
|
+
|
|
6
|
+
//#region src/getIntlayerAPI/search.ts
|
|
36
7
|
const getSearchAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
params
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
return {
|
|
54
|
-
searchDoc
|
|
55
|
-
};
|
|
8
|
+
const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
|
|
9
|
+
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
10
|
+
const AI_API_ROUTE = `${backendURL}/api/search`;
|
|
11
|
+
/**
|
|
12
|
+
* Search documentation
|
|
13
|
+
* @param params - Search parameters containing the input query.
|
|
14
|
+
* @returns Search results with GitHub URLs.
|
|
15
|
+
*/
|
|
16
|
+
const searchDoc = async (params, otherOptions = {}) => await require_fetcher.fetcher(`${AI_API_ROUTE}/doc`, authAPIOptions, otherOptions, {
|
|
17
|
+
method: "GET",
|
|
18
|
+
params
|
|
19
|
+
});
|
|
20
|
+
return { searchDoc };
|
|
56
21
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.getSearchAPI = getSearchAPI;
|
|
61
25
|
//# sourceMappingURL=search.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/
|
|
1
|
+
{"version":3,"file":"search.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/search.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type { SearchDocUtilParams, SearchDocUtilResult } from '../types';\n\nexport const getSearchAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\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":";;;;;;AAKA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,eAAe,GAAG,WAAW;;;;;;CAOnC,MAAM,YAAY,OAChB,QACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,aAAa,OAChB,gBACA,cACA;EACE,QAAQ;EACA;EACT,CACF;AAEH,QAAO,EACL,WACD"}
|
|
@@ -1,80 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var stripe_exports = {};
|
|
30
|
-
__export(stripe_exports, {
|
|
31
|
-
getStripeAPI: () => getStripeAPI
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(stripe_exports);
|
|
34
|
-
var import_built = __toESM(require("@intlayer/config/built"));
|
|
35
|
-
var import_fetcher = require('../fetcher.cjs');
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_fetcher = require('../fetcher.cjs');
|
|
3
|
+
let __intlayer_config_built = require("@intlayer/config/built");
|
|
4
|
+
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
5
|
+
|
|
6
|
+
//#region src/getIntlayerAPI/stripe.ts
|
|
36
7
|
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
method: "POST"
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
return {
|
|
71
|
-
getPricing,
|
|
72
|
-
getSubscription,
|
|
73
|
-
cancelSubscription
|
|
74
|
-
};
|
|
8
|
+
const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
|
|
9
|
+
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
10
|
+
const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
|
|
11
|
+
/**
|
|
12
|
+
* Get a pricing plan calculated for a given promotion code.
|
|
13
|
+
* @param body - Pricing plan body.
|
|
14
|
+
*/
|
|
15
|
+
const getPricing = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/pricing`, authAPIOptions, otherOptions, {
|
|
16
|
+
method: "POST",
|
|
17
|
+
body
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a checkout session.
|
|
21
|
+
* @param body - Checkout session body.
|
|
22
|
+
*/
|
|
23
|
+
const getSubscription = async (body, otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/create-subscription`, authAPIOptions, otherOptions, {
|
|
24
|
+
method: "POST",
|
|
25
|
+
body
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Cancels a subscription.
|
|
29
|
+
* @param body - Checkout session body.
|
|
30
|
+
*/
|
|
31
|
+
const cancelSubscription = async (otherOptions = {}) => await require_fetcher.fetcher(`${STRIPE_API_ROUTE}/cancel-subscription`, authAPIOptions, otherOptions, { method: "POST" });
|
|
32
|
+
return {
|
|
33
|
+
getPricing,
|
|
34
|
+
getSubscription,
|
|
35
|
+
cancelSubscription
|
|
36
|
+
};
|
|
75
37
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
exports.getStripeAPI = getStripeAPI;
|
|
80
41
|
//# sourceMappingURL=stripe.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/
|
|
1
|
+
{"version":3,"file":"stripe.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/stripe.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n GetPricingBody,\n GetPricingResult,\n} from '../types';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\n\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Get a pricing plan calculated for a given promotion code.\n * @param body - Pricing plan body.\n */\n const getPricing = async (\n body?: GetPricingBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetPricingResult>(\n `${STRIPE_API_ROUTE}/pricing`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getPricing,\n getSubscription,\n cancelSubscription,\n };\n};\n"],"mappings":";;;;;;AAUA,MAAa,gBACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,mBAAmB,GAAG,WAAW;;;;;CAMvC,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,GAAG,iBAAiB,WACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,kBAAkB,OACtB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA;EACE,QAAQ;EACR;EACD,CACF;;;;;CAMH,MAAM,qBAAqB,OAAO,eAA+B,EAAE,KACjE,MAAMA,wBACJ,GAAG,iBAAiB,uBACpB,gBACA,cACA,EACE,QAAQ,QACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACD"}
|
|
@@ -1,89 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var tag_exports = {};
|
|
30
|
-
__export(tag_exports, {
|
|
31
|
-
getTagAPI: () => getTagAPI
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(tag_exports);
|
|
34
|
-
var import_built = __toESM(require("@intlayer/config/built"));
|
|
35
|
-
var import_fetcher = require('../fetcher.cjs');
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_fetcher = require('../fetcher.cjs');
|
|
3
|
+
let __intlayer_config_built = require("@intlayer/config/built");
|
|
4
|
+
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
5
|
+
|
|
6
|
+
//#region src/getIntlayerAPI/tag.ts
|
|
36
7
|
const getTagAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
method: "DELETE"
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
return {
|
|
79
|
-
getTags,
|
|
80
|
-
addTag,
|
|
81
|
-
updateTag,
|
|
82
|
-
deleteTag
|
|
83
|
-
};
|
|
8
|
+
const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
|
|
9
|
+
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
10
|
+
const PROJECT_API_ROUTE = `${backendURL}/api/tag`;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a list of tags based on filters and pagination.
|
|
13
|
+
* @param filters - Filters and pagination options.
|
|
14
|
+
*/
|
|
15
|
+
const getTags = async (filters, otherOptions = {}) => await require_fetcher.fetcher(PROJECT_API_ROUTE, authAPIOptions, otherOptions, {
|
|
16
|
+
cache: "no-store",
|
|
17
|
+
params: filters
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Adds a new tag to the database.
|
|
21
|
+
* @param tag - Tag data.
|
|
22
|
+
*/
|
|
23
|
+
const addTag = async (tag, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
24
|
+
method: "POST",
|
|
25
|
+
body: tag
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Updates an existing tag in the database.
|
|
29
|
+
* @param tag - Updated tag data.
|
|
30
|
+
*/
|
|
31
|
+
const updateTag = async (tagId, tag, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}/${tagId}`, authAPIOptions, otherOptions, {
|
|
32
|
+
method: "PUT",
|
|
33
|
+
body: tag
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Deletes a tag from the database by its ID.
|
|
37
|
+
* @param tagId - Tag ID.
|
|
38
|
+
*/
|
|
39
|
+
const deleteTag = async (tagId, otherOptions = {}) => await require_fetcher.fetcher(`${PROJECT_API_ROUTE}/${tagId}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
40
|
+
return {
|
|
41
|
+
getTags,
|
|
42
|
+
addTag,
|
|
43
|
+
updateTag,
|
|
44
|
+
deleteTag
|
|
45
|
+
};
|
|
84
46
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
exports.getTagAPI = getTagAPI;
|
|
89
50
|
//# sourceMappingURL=tag.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/
|
|
1
|
+
{"version":3,"file":"tag.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/tag.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n AddTagBody,\n AddTagResult,\n DeleteTagParams,\n DeleteTagResult,\n GetTagsParams,\n GetTagsResult,\n UpdateTagBody,\n UpdateTagParams,\n UpdateTagResult,\n} from '../types';\n\nexport const getTagAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\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":";;;;;;AAeA,MAAa,aACX,iBAAiC,EAAE,EACnC,mBACG;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,oBAAoB,GAAG,WAAW;;;;;CAMxC,MAAM,UAAU,OACd,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,mBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;CAMH,MAAM,SAAS,OAAO,KAAiB,eAA+B,EAAE,KACtE,MAAMA,wBACJ,GAAG,qBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OACA,KACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;CAMH,MAAM,YAAY,OAChB,OAEA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBAAkB,GAAG,SACxB,gBACA,cACA,EACE,QAAQ,UACT,CACF;AAEH,QAAO;EACL;EACA;EACA;EACA;EACD"}
|
|
@@ -1,109 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var user_exports = {};
|
|
30
|
-
__export(user_exports, {
|
|
31
|
-
getUserAPI: () => getUserAPI
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(user_exports);
|
|
34
|
-
var import_built = __toESM(require("@intlayer/config/built"));
|
|
35
|
-
var import_fetcher = require('../fetcher.cjs');
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_fetcher = require('../fetcher.cjs');
|
|
3
|
+
let __intlayer_config_built = require("@intlayer/config/built");
|
|
4
|
+
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
5
|
+
|
|
6
|
+
//#region src/getIntlayerAPI/user.ts
|
|
36
7
|
const getUserAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
8
|
+
const backendURL = intlayerConfig?.editor?.backendURL ?? __intlayer_config_built.default?.editor?.backendURL;
|
|
9
|
+
if (!backendURL) throw new Error("Backend URL is not defined in the Intlayer configuration.");
|
|
10
|
+
const USER_API_ROUTE = `${backendURL}/api/user`;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a list of users based on filters and pagination.
|
|
13
|
+
* @param filters - Filters and pagination options.
|
|
14
|
+
* @returns List of users.
|
|
15
|
+
*/
|
|
16
|
+
const getUsers = async (filters, otherOptions = {}) => await require_fetcher.fetcher(USER_API_ROUTE, authAPIOptions, otherOptions, {
|
|
17
|
+
cache: "no-store",
|
|
18
|
+
params: filters
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves a user by ID.
|
|
22
|
+
* @param userId - User ID.
|
|
23
|
+
* @returns User object.
|
|
24
|
+
*/
|
|
25
|
+
const getUserById = async (userId, otherOptions = {}) => await require_fetcher.fetcher(`${USER_API_ROUTE}/${userId}`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a user by email.
|
|
28
|
+
* @param email - User email.
|
|
29
|
+
* @returns User object.
|
|
30
|
+
*/
|
|
31
|
+
const getUserByEmail = async (email, otherOptions = {}) => await require_fetcher.fetcher(`${USER_API_ROUTE}/email/${email}`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves a user by account.
|
|
34
|
+
* @param providerAccountId - The provider account ID.
|
|
35
|
+
* @param provider - The provider of the account.
|
|
36
|
+
*/
|
|
37
|
+
const getUserByAccount = async (providerAccountId, provider, otherOptions = {}) => await require_fetcher.fetcher(`${USER_API_ROUTE}/account/${provider}/${providerAccountId}`, authAPIOptions, otherOptions, { cache: "no-store" });
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new user.
|
|
40
|
+
* @param user - User credentials.
|
|
41
|
+
* @returns User object.
|
|
42
|
+
*/
|
|
43
|
+
const createUser = async (user, otherOptions = {}) => await require_fetcher.fetcher(`${USER_API_ROUTE}/`, authAPIOptions, otherOptions, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
body: user
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Updates the user with the provided data.
|
|
49
|
+
* @param user - Updated user data.
|
|
50
|
+
* @returns User object.
|
|
51
|
+
*/
|
|
52
|
+
const updateUser = async (user, otherOptions = {}) => await require_fetcher.fetcher(`${USER_API_ROUTE}`, authAPIOptions, otherOptions, {
|
|
53
|
+
method: "PUT",
|
|
54
|
+
body: user
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Deletes a user with the provided ID.
|
|
58
|
+
* @param userId - User ID.
|
|
59
|
+
* @returns User object.
|
|
60
|
+
*/
|
|
61
|
+
const deleteUser = async (userId, otherOptions = {}) => await require_fetcher.fetcher(`${USER_API_ROUTE}/${userId}`, authAPIOptions, otherOptions, { method: "DELETE" });
|
|
62
|
+
/**
|
|
63
|
+
* Gets the verify email status URL to use in the SSE.
|
|
64
|
+
* @param userId - User ID.
|
|
65
|
+
* @returns The verify email status URL.
|
|
66
|
+
*/
|
|
67
|
+
const getVerifyEmailStatusURL = (userId) => `${USER_API_ROUTE}/verify-email-status/${String(userId)}`;
|
|
68
|
+
return {
|
|
69
|
+
createUser,
|
|
70
|
+
getUsers,
|
|
71
|
+
getUserById,
|
|
72
|
+
getUserByAccount,
|
|
73
|
+
getUserByEmail,
|
|
74
|
+
updateUser,
|
|
75
|
+
deleteUser,
|
|
76
|
+
getVerifyEmailStatusURL
|
|
77
|
+
};
|
|
104
78
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
});
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.getUserAPI = getUserAPI;
|
|
109
82
|
//# sourceMappingURL=user.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/getIntlayerAPI/user.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport {
|
|
1
|
+
{"version":3,"file":"user.cjs","names":["configuration","fetcher"],"sources":["../../../src/getIntlayerAPI/user.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { type FetcherOptions, fetcher } from '../fetcher';\nimport type {\n CreateUserBody,\n CreateUserResult,\n GetUserByAccountParams,\n GetUserByAccountResult,\n GetUserByEmailParams,\n GetUserByEmailResult,\n GetUserByIdParams,\n GetUserByIdResult,\n GetUsersParams,\n GetUsersResult,\n UpdateUserBody,\n UpdateUserResult,\n UserAPI,\n} from '../types';\n\nexport const getUserAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL =\n intlayerConfig?.editor?.backendURL ?? configuration?.editor?.backendURL;\n\n if (!backendURL) {\n throw new Error(\n 'Backend URL is not defined in the Intlayer configuration.'\n );\n }\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;CACH,MAAM,aACJ,gBAAgB,QAAQ,cAAcA,iCAAe,QAAQ;AAE/D,KAAI,CAAC,WACH,OAAM,IAAI,MACR,4DACD;CAGH,MAAM,iBAAiB,GAAG,WAAW;;;;;;CAOrC,MAAM,WAAW,OACf,SACA,eAA+B,EAAE,KAEjC,MAAMC,wBACJ,gBACA,gBACA,cACA;EACE,OAAO;EAEP,QAAQ;EACT,CACF;;;;;;CAOH,MAAM,cAAc,OAClB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,GAAG,UACrB,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,iBAAiB,OACrB,OACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,SAAS,SAC3B,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,mBAAmB,OACvB,mBACA,UACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,WAAW,SAAS,GAAG,qBACzC,gBACA,cACA,EACE,OAAO,YACR,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,eAAe,IAClB,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,MACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,GAAG,kBACH,gBACA,cACA;EACE,QAAQ;EACR,MAAM;EACP,CACF;;;;;;CAOH,MAAM,aAAa,OACjB,QACA,eAA+B,EAAE,KAEjC,MAAMA,wBACJ,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"}
|