@functionalcms/svelte-components 2.18.3 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index-server.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { authenticationHandle } from './auth/authenticationHandle.js';
|
|
2
2
|
import authorizationHandle from './auth/authorizationHandle.js';
|
|
3
3
|
import errorHandler from './auth/errorHandle.js';
|
|
4
|
-
|
|
4
|
+
import { getBlobService, getCommunicationService, getDataService, getTemplateService, getWebsiteService } from './server-side/getServices.js';
|
|
5
|
+
export { authenticationHandle, authorizationHandle, errorHandler, getDataService, getCommunicationService, getWebsiteService, getTemplateService, getBlobService };
|
package/dist/index-server.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { authenticationHandle } from './auth/authenticationHandle.js';
|
|
2
2
|
import authorizationHandle from './auth/authorizationHandle.js';
|
|
3
3
|
import errorHandler from './auth/errorHandle.js';
|
|
4
|
-
|
|
4
|
+
import { getBlobService, getCommunicationService, getDataService, getTemplateService, getWebsiteService } from './server-side/getServices.js';
|
|
5
|
+
export { authenticationHandle, authorizationHandle, errorHandler, getDataService, getCommunicationService, getWebsiteService, getTemplateService, getBlobService };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getDataService: (locals: any) => any;
|
|
2
|
+
export declare const getCommunicationService: (locals: any) => any;
|
|
3
|
+
export declare const getWebsiteService: (locals: any) => any;
|
|
4
|
+
export declare const getTemplateService: (locals: any) => any;
|
|
5
|
+
export declare const getBlobService: (locals: any) => any;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DOMAIN, ENDPOINT } from "$env/static/private";
|
|
2
|
+
import { CommunicationService, DataService, TemplateService, WebsitesService, BlobService } from "@functionalcms/services";
|
|
3
|
+
const getAccessToken = (locals) => {
|
|
4
|
+
return locals.token.access_token;
|
|
5
|
+
};
|
|
6
|
+
export const getDataService = (locals) => {
|
|
7
|
+
const accessToken = getAccessToken(locals);
|
|
8
|
+
const service = new DataService(accessToken, DOMAIN, ENDPOINT);
|
|
9
|
+
return service;
|
|
10
|
+
};
|
|
11
|
+
export const getCommunicationService = (locals) => {
|
|
12
|
+
const accessToken = getAccessToken(locals);
|
|
13
|
+
const service = new CommunicationService(accessToken, DOMAIN, ENDPOINT);
|
|
14
|
+
return service;
|
|
15
|
+
};
|
|
16
|
+
export const getWebsiteService = (locals) => {
|
|
17
|
+
const accessToken = getAccessToken(locals);
|
|
18
|
+
const service = new WebsitesService(accessToken, DOMAIN, ENDPOINT);
|
|
19
|
+
return service;
|
|
20
|
+
};
|
|
21
|
+
export const getTemplateService = (locals) => {
|
|
22
|
+
const accessToken = getAccessToken(locals);
|
|
23
|
+
const service = new TemplateService(accessToken, DOMAIN, ENDPOINT);
|
|
24
|
+
return service;
|
|
25
|
+
};
|
|
26
|
+
export const getBlobService = (locals) => {
|
|
27
|
+
const accessToken = getAccessToken(locals);
|
|
28
|
+
const service = new BlobService(accessToken, DOMAIN, ENDPOINT);
|
|
29
|
+
return service;
|
|
30
|
+
};
|