@functionalcms/svelte-components 4.22.0 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CommunicationService, DataService, TemplateService, WebsitesService, BlobService, AiService, AuthService } from "@functionalcms/services";
|
|
2
2
|
import type { Locals } from "./types.js";
|
|
3
|
-
export declare const getDataService: (locals: Locals) => DataService;
|
|
4
|
-
export declare const getCommunicationService: (locals: Locals) => CommunicationService;
|
|
5
|
-
export declare const getWebsiteService: (locals: Locals) => WebsitesService;
|
|
6
|
-
export declare const getTemplateService: (locals: Locals) => TemplateService;
|
|
7
|
-
export declare const getBlobService: (locals: Locals) => BlobService;
|
|
8
|
-
export declare const getAIService: (locals: Locals) => AiService;
|
|
9
|
-
export declare const getAuthService: (locals: Locals) => AuthService;
|
|
3
|
+
export declare const getDataService: (locals: Locals, endpoint?: string | undefined) => DataService;
|
|
4
|
+
export declare const getCommunicationService: (locals: Locals, endpoint?: string | undefined) => CommunicationService;
|
|
5
|
+
export declare const getWebsiteService: (locals: Locals, endpoint?: string | undefined) => WebsitesService;
|
|
6
|
+
export declare const getTemplateService: (locals: Locals, endpoint?: string | undefined) => TemplateService;
|
|
7
|
+
export declare const getBlobService: (locals: Locals, endpoint?: string | undefined) => BlobService;
|
|
8
|
+
export declare const getAIService: (locals: Locals, endpoint?: string | undefined) => AiService;
|
|
9
|
+
export declare const getAuthService: (locals: Locals, endpoint?: string | undefined) => AuthService;
|
|
@@ -3,38 +3,45 @@ import { CommunicationService, DataService, TemplateService, WebsitesService, Bl
|
|
|
3
3
|
const getAccessToken = (locals) => {
|
|
4
4
|
return locals.token.access_token;
|
|
5
5
|
};
|
|
6
|
-
export const getDataService = (locals) => {
|
|
6
|
+
export const getDataService = (locals, endpoint = undefined) => {
|
|
7
7
|
const accessToken = getAccessToken(locals);
|
|
8
|
-
const
|
|
8
|
+
const serviceEndopint = endpoint ?? ENDPOINT;
|
|
9
|
+
const service = new DataService(accessToken, DOMAIN, serviceEndopint);
|
|
9
10
|
return service;
|
|
10
11
|
};
|
|
11
|
-
export const getCommunicationService = (locals) => {
|
|
12
|
+
export const getCommunicationService = (locals, endpoint = undefined) => {
|
|
12
13
|
const accessToken = getAccessToken(locals);
|
|
13
|
-
const
|
|
14
|
+
const serviceEndopint = endpoint ?? ENDPOINT;
|
|
15
|
+
const service = new CommunicationService(accessToken, DOMAIN, serviceEndopint);
|
|
14
16
|
return service;
|
|
15
17
|
};
|
|
16
|
-
export const getWebsiteService = (locals) => {
|
|
18
|
+
export const getWebsiteService = (locals, endpoint = undefined) => {
|
|
17
19
|
const accessToken = getAccessToken(locals);
|
|
18
|
-
const
|
|
20
|
+
const serviceEndopint = endpoint ?? ENDPOINT;
|
|
21
|
+
const service = new WebsitesService(accessToken, DOMAIN, serviceEndopint);
|
|
19
22
|
return service;
|
|
20
23
|
};
|
|
21
|
-
export const getTemplateService = (locals) => {
|
|
24
|
+
export const getTemplateService = (locals, endpoint = undefined) => {
|
|
22
25
|
const accessToken = getAccessToken(locals);
|
|
23
|
-
const
|
|
26
|
+
const serviceEndopint = endpoint ?? ENDPOINT;
|
|
27
|
+
const service = new TemplateService(accessToken, DOMAIN, serviceEndopint);
|
|
24
28
|
return service;
|
|
25
29
|
};
|
|
26
|
-
export const getBlobService = (locals) => {
|
|
30
|
+
export const getBlobService = (locals, endpoint = undefined) => {
|
|
27
31
|
const accessToken = getAccessToken(locals);
|
|
28
|
-
const
|
|
32
|
+
const serviceEndopint = endpoint ?? ENDPOINT;
|
|
33
|
+
const service = new BlobService(accessToken, DOMAIN, serviceEndopint);
|
|
29
34
|
return service;
|
|
30
35
|
};
|
|
31
|
-
export const getAIService = (locals) => {
|
|
36
|
+
export const getAIService = (locals, endpoint = undefined) => {
|
|
32
37
|
const accessToken = getAccessToken(locals);
|
|
33
|
-
const
|
|
38
|
+
const serviceEndopint = endpoint ?? ENDPOINT;
|
|
39
|
+
const service = new AiService(accessToken, DOMAIN, serviceEndopint);
|
|
34
40
|
return service;
|
|
35
41
|
};
|
|
36
|
-
export const getAuthService = (locals) => {
|
|
42
|
+
export const getAuthService = (locals, endpoint = undefined) => {
|
|
37
43
|
const accessToken = getAccessToken(locals);
|
|
38
|
-
const
|
|
44
|
+
const serviceEndopint = endpoint ?? ENDPOINT;
|
|
45
|
+
const service = new AuthService(accessToken, serviceEndopint);
|
|
39
46
|
return service;
|
|
40
47
|
};
|