@candlerip/shared3 0.0.157 → 0.0.159
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +3 -3
- package/src/backend/cache/cache/config.d.ts +8 -2
- package/src/backend/cache/cache/config.js +8 -2
- package/src/backend/cache/cache/type.d.ts +5 -2
- package/src/backend/dictionary/compose-dictionary/index.js +1 -1
- package/src/backend/dictionary/compose-dictionary/type.d.ts +4 -2
- package/src/backend/dictionary/translation-id/excluded/compose-excluded-translation-ids/type.d.ts +4 -4
- package/src/backend/server/index.d.ts +1 -0
- package/src/backend/server/index.js +1 -0
- package/src/backend/server/server-data/contact/compose-contact-page-server-data/index.d.ts +2 -0
- package/src/backend/server/server-data/contact/compose-contact-page-server-data/index.js +14 -0
- package/src/backend/server/server-data/contact/compose-contact-page-server-data/type.d.ts +11 -0
- package/src/backend/server/server-data/contact/index.d.ts +2 -0
- package/src/backend/server/server-data/contact/index.js +2 -0
- package/src/backend/{api/api-response/terms-and-conditions → server/server-data/contact}/type.d.ts +1 -1
- package/src/backend/server/server-data/cookie-policy/compose-cookie-policy-page-server-data/index.d.ts +2 -0
- package/src/backend/server/server-data/cookie-policy/compose-cookie-policy-page-server-data/index.js +14 -0
- package/src/backend/server/server-data/cookie-policy/compose-cookie-policy-page-server-data/type.d.ts +11 -0
- package/src/backend/server/server-data/cookie-policy/index.d.ts +2 -0
- package/src/backend/server/server-data/cookie-policy/index.js +2 -0
- package/src/backend/server/server-data/cookie-policy/type.d.ts +4 -0
- package/src/backend/server/server-data/help/compose-help-page-server-data/index.d.ts +2 -0
- package/src/backend/server/server-data/help/compose-help-page-server-data/index.js +14 -0
- package/src/backend/server/server-data/help/compose-help-page-server-data/type.d.ts +11 -0
- package/src/backend/server/server-data/help/compose-help-page-server-data/type.js +1 -0
- package/src/backend/server/server-data/help/index.d.ts +2 -0
- package/src/backend/server/server-data/help/index.js +2 -0
- package/src/backend/server/server-data/help/type.d.ts +4 -0
- package/src/backend/server/server-data/help/type.js +1 -0
- package/src/backend/{api/api-response → server/server-data}/index.d.ts +3 -0
- package/src/backend/{api/api-response → server/server-data}/index.js +3 -0
- package/src/backend/server/server-data/persons-map/compose-persons-map-page-api-response/type.js +1 -0
- package/src/backend/server/server-data/persons-map/type.js +1 -0
- package/src/backend/server/server-data/terms-and-conditions/compose-terms-and-conditions-page-server-data/index.d.ts +2 -0
- package/src/backend/{api/api-response/terms-and-conditions/compose-terms-and-conditions-page-api-response → server/server-data/terms-and-conditions/compose-terms-and-conditions-page-server-data}/index.js +3 -3
- package/src/backend/server/server-data/terms-and-conditions/compose-terms-and-conditions-page-server-data/type.d.ts +11 -0
- package/src/backend/server/server-data/terms-and-conditions/compose-terms-and-conditions-page-server-data/type.js +1 -0
- package/src/backend/server/server-data/terms-and-conditions/index.d.ts +2 -0
- package/src/backend/server/server-data/terms-and-conditions/index.js +2 -0
- package/src/backend/server/server-data/terms-and-conditions/type.d.ts +4 -0
- package/src/backend/server/server-data/terms-and-conditions/type.js +1 -0
- package/src/backend/api/api-response/terms-and-conditions/compose-terms-and-conditions-page-api-response/index.d.ts +0 -2
- package/src/backend/api/api-response/terms-and-conditions/compose-terms-and-conditions-page-api-response/type.d.ts +0 -11
- package/src/backend/api/api-response/terms-and-conditions/index.d.ts +0 -2
- package/src/backend/api/api-response/terms-and-conditions/index.js +0 -2
- package/src/backend/api/index.d.ts +0 -1
- package/src/backend/api/index.js +0 -1
- /package/src/backend/{api/api-response → server/server-data}/candles/compose-candles-page-api-response/index.d.ts +0 -0
- /package/src/backend/{api/api-response → server/server-data}/candles/compose-candles-page-api-response/index.js +0 -0
- /package/src/backend/{api/api-response → server/server-data}/candles/compose-candles-page-api-response/type.d.ts +0 -0
- /package/src/backend/{api/api-response → server/server-data}/candles/compose-candles-page-api-response/type.js +0 -0
- /package/src/backend/{api/api-response → server/server-data}/candles/index.d.ts +0 -0
- /package/src/backend/{api/api-response → server/server-data}/candles/index.js +0 -0
- /package/src/backend/{api/api-response → server/server-data}/candles/type.d.ts +0 -0
- /package/src/backend/{api/api-response → server/server-data}/candles/type.js +0 -0
- /package/src/backend/{api/api-response/persons-map/compose-persons-map-page-api-response → server/server-data/contact/compose-contact-page-server-data}/type.js +0 -0
- /package/src/backend/{api/api-response/persons-map → server/server-data/contact}/type.js +0 -0
- /package/src/backend/{api/api-response/terms-and-conditions/compose-terms-and-conditions-page-api-response → server/server-data/cookie-policy/compose-cookie-policy-page-server-data}/type.js +0 -0
- /package/src/backend/{api/api-response/terms-and-conditions → server/server-data/cookie-policy}/type.js +0 -0
- /package/src/backend/{api/api-response → server/server-data}/persons-map/compose-persons-map-page-api-response/index.d.ts +0 -0
- /package/src/backend/{api/api-response → server/server-data}/persons-map/compose-persons-map-page-api-response/index.js +0 -0
- /package/src/backend/{api/api-response → server/server-data}/persons-map/compose-persons-map-page-api-response/type.d.ts +0 -0
- /package/src/backend/{api/api-response → server/server-data}/persons-map/index.d.ts +0 -0
- /package/src/backend/{api/api-response → server/server-data}/persons-map/index.js +0 -0
- /package/src/backend/{api/api-response → server/server-data}/persons-map/type.d.ts +0 -0
package/package.json
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "@candlerip/shared3",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.159",
|
4
4
|
"type": "module",
|
5
5
|
"exports": {
|
6
6
|
".": "./src/index.js",
|
7
7
|
"./aws": "./src/aws/index.js",
|
8
8
|
"./backend": "./src/backend/index.js",
|
9
|
-
"./backend/api": "./src/backend/api/index.js",
|
10
9
|
"./backend/cache": "./src/backend/cache/index.js",
|
11
10
|
"./backend/database": "./src/backend/database/index.js",
|
12
11
|
"./backend/dictionary": "./src/backend/dictionary/index.js",
|
13
12
|
"./backend/environment": "./src/backend/environment/index.js",
|
14
13
|
"./backend/express": "./src/backend/express/index.js",
|
15
14
|
"./backend/message-broker": "./src/backend/message-broker/index.js",
|
16
|
-
"./backend/page": "./src/backend/page/index.js"
|
15
|
+
"./backend/page": "./src/backend/page/index.js",
|
16
|
+
"./backend/server": "./src/backend/server/index.js"
|
17
17
|
},
|
18
18
|
"bin": {
|
19
19
|
"crs-cdk-deploy": "./_devops/cdk/cdk-deploy.sh",
|
@@ -9,8 +9,12 @@ export declare const CACHE: {
|
|
9
9
|
readonly 'candles-page-dictionary-hu': "Dictionary";
|
10
10
|
readonly 'contact-page-dictionary-en': "Dictionary";
|
11
11
|
readonly 'contact-page-dictionary-hu': "Dictionary";
|
12
|
+
readonly 'contact-page-server-data-en': "ContactPageServerData";
|
13
|
+
readonly 'contact-page-server-data-hu': "ContactPageServerData";
|
12
14
|
readonly 'cookie-policy-page-dictionary-en': "Dictionary";
|
13
15
|
readonly 'cookie-policy-page-dictionary-hu': "Dictionary";
|
16
|
+
readonly 'cookie-policy-page-server-data-en': "CookiePolicyPageServerData";
|
17
|
+
readonly 'cookie-policy-page-server-data-hu': "CookiePolicyPageServerData";
|
14
18
|
readonly 'edit-candle-page-dictionary-en': "Dictionary";
|
15
19
|
readonly 'edit-candle-page-dictionary-hu': "Dictionary";
|
16
20
|
readonly 'edit-person-page-dictionary-en': "Dictionary";
|
@@ -19,6 +23,8 @@ export declare const CACHE: {
|
|
19
23
|
readonly 'light-candle-page-dictionary-hu': "Dictionary";
|
20
24
|
readonly 'help-page-dictionary-en': "Dictionary";
|
21
25
|
readonly 'help-page-dictionary-hu': "Dictionary";
|
26
|
+
readonly 'help-page-server-data-en': "HelpPageServerData";
|
27
|
+
readonly 'help-page-server-data-hu': "HelpPageServerData";
|
22
28
|
readonly 'home-page-dictionary-en': "Dictionary";
|
23
29
|
readonly 'home-page-dictionary-hu': "Dictionary";
|
24
30
|
readonly 'person-candles-page-dictionary-en': "Dictionary";
|
@@ -33,6 +39,6 @@ export declare const CACHE: {
|
|
33
39
|
readonly 'persons-map-page-dictionary-hu': "Dictionary";
|
34
40
|
readonly 'terms-and-conditions-page-dictionary-en': "Dictionary";
|
35
41
|
readonly 'terms-and-conditions-page-dictionary-hu': "Dictionary";
|
36
|
-
readonly 'terms-and-conditions-page-
|
37
|
-
readonly 'terms-and-conditions-page-
|
42
|
+
readonly 'terms-and-conditions-page-server-data-en': "TermsAndConditionsPageServerData";
|
43
|
+
readonly 'terms-and-conditions-page-server-data-hu': "TermsAndConditionsPageServerData";
|
38
44
|
};
|
@@ -9,8 +9,12 @@ export const CACHE = {
|
|
9
9
|
'candles-page-dictionary-hu': 'Dictionary',
|
10
10
|
'contact-page-dictionary-en': 'Dictionary',
|
11
11
|
'contact-page-dictionary-hu': 'Dictionary',
|
12
|
+
'contact-page-server-data-en': 'ContactPageServerData',
|
13
|
+
'contact-page-server-data-hu': 'ContactPageServerData',
|
12
14
|
'cookie-policy-page-dictionary-en': 'Dictionary',
|
13
15
|
'cookie-policy-page-dictionary-hu': 'Dictionary',
|
16
|
+
'cookie-policy-page-server-data-en': 'CookiePolicyPageServerData',
|
17
|
+
'cookie-policy-page-server-data-hu': 'CookiePolicyPageServerData',
|
14
18
|
'edit-candle-page-dictionary-en': 'Dictionary',
|
15
19
|
'edit-candle-page-dictionary-hu': 'Dictionary',
|
16
20
|
'edit-person-page-dictionary-en': 'Dictionary',
|
@@ -19,6 +23,8 @@ export const CACHE = {
|
|
19
23
|
'light-candle-page-dictionary-hu': 'Dictionary',
|
20
24
|
'help-page-dictionary-en': 'Dictionary',
|
21
25
|
'help-page-dictionary-hu': 'Dictionary',
|
26
|
+
'help-page-server-data-en': 'HelpPageServerData',
|
27
|
+
'help-page-server-data-hu': 'HelpPageServerData',
|
22
28
|
'home-page-dictionary-en': 'Dictionary',
|
23
29
|
'home-page-dictionary-hu': 'Dictionary',
|
24
30
|
'person-candles-page-dictionary-en': 'Dictionary',
|
@@ -33,6 +39,6 @@ export const CACHE = {
|
|
33
39
|
'persons-map-page-dictionary-hu': 'Dictionary',
|
34
40
|
'terms-and-conditions-page-dictionary-en': 'Dictionary',
|
35
41
|
'terms-and-conditions-page-dictionary-hu': 'Dictionary',
|
36
|
-
'terms-and-conditions-page-
|
37
|
-
'terms-and-conditions-page-
|
42
|
+
'terms-and-conditions-page-server-data-en': 'TermsAndConditionsPageServerData',
|
43
|
+
'terms-and-conditions-page-server-data-hu': 'TermsAndConditionsPageServerData',
|
38
44
|
};
|
@@ -1,13 +1,16 @@
|
|
1
1
|
import { Dictionary } from '../../../dictionary/index.js';
|
2
|
-
import { CandlesPageApiResponse, PersonsMapPageApiResponse,
|
2
|
+
import { CandlesPageApiResponse, ContactPageServerData, CookiePolicyPageServerData, HelpPageServerData, PersonsMapPageApiResponse, TermsAndConditionsPageServerData } from '../../server/index.js';
|
3
3
|
import { CACHE } from './config.js';
|
4
4
|
export type Cache = {
|
5
5
|
[key in keyof typeof CACHE]: TypeMap[(typeof CACHE)[key]];
|
6
6
|
};
|
7
7
|
interface TypeMap {
|
8
8
|
CandlesPageApiResponse: CandlesPageApiResponse;
|
9
|
+
ContactPageServerData: ContactPageServerData;
|
10
|
+
CookiePolicyPageServerData: CookiePolicyPageServerData;
|
9
11
|
Dictionary: Dictionary;
|
12
|
+
HelpPageServerData: HelpPageServerData;
|
10
13
|
PersonsMapPageApiResponse: PersonsMapPageApiResponse;
|
11
|
-
|
14
|
+
TermsAndConditionsPageServerData: TermsAndConditionsPageServerData;
|
12
15
|
}
|
13
16
|
export {};
|
@@ -3,7 +3,7 @@ import { getTranslationsAsDictionary } from '../../database/mutation/translation
|
|
3
3
|
import { composeExcludedTranslationIds } from '../translation-id/index.js';
|
4
4
|
export const composeDictionary = async (page, language, options) => {
|
5
5
|
let translationIds = [...DICTIONARY_CONFIG[page].translationIds];
|
6
|
-
const excludedIds = composeExcludedTranslationIds(page, options);
|
6
|
+
const excludedIds = composeExcludedTranslationIds(page, options?.excludedTranslationIdOptions);
|
7
7
|
translationIds = translationIds.filter((it) => !excludedIds.includes(it));
|
8
8
|
const resp = await getTranslationsAsDictionary(language, translationIds);
|
9
9
|
return resp;
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { Dictionary, Language } from '../../../dictionary/index.js';
|
2
2
|
import { CustomError } from '../../../error/index.js';
|
3
3
|
import { Page } from '../../../page/index.js';
|
4
|
-
import {
|
5
|
-
export type ComposeDictionary = (page: Page, language: Language, options?:
|
4
|
+
import { ExcludedTranslationIdOptions } from '../translation-id/index.js';
|
5
|
+
export type ComposeDictionary = (page: Page, language: Language, options?: {
|
6
|
+
excludedTranslationIdOptions?: ExcludedTranslationIdOptions;
|
7
|
+
}) => Promise<{
|
6
8
|
data: Dictionary;
|
7
9
|
} | {
|
8
10
|
customError: CustomError;
|
package/src/backend/dictionary/translation-id/excluded/compose-excluded-translation-ids/type.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { TranslationId } from '../../../../../dictionary/index.js';
|
2
2
|
import { Page } from '../../../../../page/index.js';
|
3
|
-
export type ComposeExcludedTranslationIds = (page: Page, options?:
|
4
|
-
export type
|
5
|
-
isAuthenticated
|
6
|
-
isCookieConsent
|
3
|
+
export type ComposeExcludedTranslationIds = (page: Page, options?: ExcludedTranslationIdOptions) => TranslationId[];
|
4
|
+
export type ExcludedTranslationIdOptions = {
|
5
|
+
isAuthenticated?: boolean;
|
6
|
+
isCookieConsent?: boolean;
|
7
7
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './server-data/index.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './server-data/index.js';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { composeDictionary } from '../../../../dictionary/index.js';
|
2
|
+
export const composeContactPageServerData = async (language, options) => {
|
3
|
+
const excludedTranslationIdOptions = options?.excludedTranslationIdOptions;
|
4
|
+
const resp = await composeDictionary('contact-page', language, { excludedTranslationIdOptions });
|
5
|
+
if ('customError' in resp) {
|
6
|
+
return resp;
|
7
|
+
}
|
8
|
+
const dictionary = resp.data;
|
9
|
+
return {
|
10
|
+
data: {
|
11
|
+
dictionary,
|
12
|
+
},
|
13
|
+
};
|
14
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Language } from '../../../../../dictionary/index.js';
|
2
|
+
import { CustomError } from '../../../../../error/index.js';
|
3
|
+
import { ExcludedTranslationIdOptions } from '../../../../dictionary/index.js';
|
4
|
+
import { ContactPageServerData } from '../type.js';
|
5
|
+
export type ComposeContactPageServerData = (language: Language, options?: {
|
6
|
+
excludedTranslationIdOptions?: ExcludedTranslationIdOptions;
|
7
|
+
}) => Promise<{
|
8
|
+
data: ContactPageServerData;
|
9
|
+
} | {
|
10
|
+
customError: CustomError;
|
11
|
+
}>;
|
package/src/backend/server/server-data/cookie-policy/compose-cookie-policy-page-server-data/index.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import { composeDictionary } from '../../../../dictionary/index.js';
|
2
|
+
export const composeCookiePolicyPageServerData = async (language, options) => {
|
3
|
+
const excludedTranslationIdOptions = options?.excludedTranslationIdOptions;
|
4
|
+
const resp = await composeDictionary('cookie-policy-page', language, { excludedTranslationIdOptions });
|
5
|
+
if ('customError' in resp) {
|
6
|
+
return resp;
|
7
|
+
}
|
8
|
+
const dictionary = resp.data;
|
9
|
+
return {
|
10
|
+
data: {
|
11
|
+
dictionary,
|
12
|
+
},
|
13
|
+
};
|
14
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Language } from '../../../../../dictionary/index.js';
|
2
|
+
import { CustomError } from '../../../../../error/index.js';
|
3
|
+
import { ExcludedTranslationIdOptions } from '../../../../dictionary/index.js';
|
4
|
+
import { CookiePolicyPageServerData } from '../type.js';
|
5
|
+
export type ComposeCookiePolicyPageServerData = (language: Language, options?: {
|
6
|
+
excludedTranslationIdOptions?: ExcludedTranslationIdOptions;
|
7
|
+
}) => Promise<{
|
8
|
+
data: CookiePolicyPageServerData;
|
9
|
+
} | {
|
10
|
+
customError: CustomError;
|
11
|
+
}>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { composeDictionary } from '../../../../dictionary/index.js';
|
2
|
+
export const composeHelpPageServerData = async (language, options) => {
|
3
|
+
const excludedTranslationIdOptions = options?.excludedTranslationIdOptions;
|
4
|
+
const resp = await composeDictionary('help-page', language, { excludedTranslationIdOptions });
|
5
|
+
if ('customError' in resp) {
|
6
|
+
return resp;
|
7
|
+
}
|
8
|
+
const dictionary = resp.data;
|
9
|
+
return {
|
10
|
+
data: {
|
11
|
+
dictionary,
|
12
|
+
},
|
13
|
+
};
|
14
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Language } from '../../../../../dictionary/index.js';
|
2
|
+
import { CustomError } from '../../../../../error/index.js';
|
3
|
+
import { ExcludedTranslationIdOptions } from '../../../../dictionary/index.js';
|
4
|
+
import { HelpPageServerData } from '../type.js';
|
5
|
+
export type ComposeHelpPageServerData = (language: Language, options?: {
|
6
|
+
excludedTranslationIdOptions?: ExcludedTranslationIdOptions;
|
7
|
+
}) => Promise<{
|
8
|
+
data: HelpPageServerData;
|
9
|
+
} | {
|
10
|
+
customError: CustomError;
|
11
|
+
}>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/src/backend/server/server-data/persons-map/compose-persons-map-page-api-response/type.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { composeDictionary } from '../../../../dictionary/index.js';
|
2
|
-
export const
|
3
|
-
const
|
4
|
-
const resp = await composeDictionary('terms-and-conditions-page', language,
|
2
|
+
export const composeTermsAndConditionsPageServerData = async (language, options) => {
|
3
|
+
const excludedTranslationIdOptions = options?.excludedTranslationIdOptions;
|
4
|
+
const resp = await composeDictionary('terms-and-conditions-page', language, { excludedTranslationIdOptions });
|
5
5
|
if ('customError' in resp) {
|
6
6
|
return resp;
|
7
7
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Language } from '../../../../../dictionary/index.js';
|
2
|
+
import { CustomError } from '../../../../../error/index.js';
|
3
|
+
import { ExcludedTranslationIdOptions } from '../../../../dictionary/index.js';
|
4
|
+
import { TermsAndConditionsPageServerData } from '../type.js';
|
5
|
+
export type ComposeTermsAndConditionsPageServerData = (language: Language, options?: {
|
6
|
+
excludedTranslationIdOptions?: ExcludedTranslationIdOptions;
|
7
|
+
}) => Promise<{
|
8
|
+
data: TermsAndConditionsPageServerData;
|
9
|
+
} | {
|
10
|
+
customError: CustomError;
|
11
|
+
}>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { Language } from '../../../../../dictionary/index.js';
|
2
|
-
import { CustomError } from '../../../../../error/index.js';
|
3
|
-
import { ExcludedIdOptions } from '../../../../dictionary/index.js';
|
4
|
-
import { TermsAndConditionsPageApiResponse } from '../type.js';
|
5
|
-
export type ComposeTermsAndConditionsPageApiResponse = (language: Language, options?: {
|
6
|
-
excludedIdOptions?: ExcludedIdOptions;
|
7
|
-
}) => Promise<{
|
8
|
-
data: TermsAndConditionsPageApiResponse;
|
9
|
-
} | {
|
10
|
-
customError: CustomError;
|
11
|
-
}>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './api-response/index.js';
|
package/src/backend/api/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './api-response/index.js';
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|