pim-import 5.0.1 → 5.0.2
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/algolia/clean.js +0 -1
- package/dist/algolia/config.js +0 -1
- package/dist/algolia/downloads.js +0 -1
- package/dist/algolia/families.js +0 -1
- package/dist/algolia/inspirations.js +0 -1
- package/dist/algolia/models.js +0 -1
- package/dist/algolia/news.js +0 -1
- package/dist/algolia/pressRelease.js +0 -1
- package/dist/algolia/pressReview.js +0 -1
- package/dist/algolia/products.js +0 -1
- package/dist/algolia/projects.js +0 -1
- package/dist/algolia/stories.js +0 -1
- package/dist/algolia/subFamilies.js +0 -1
- package/dist/algolia/subModels.js +0 -1
- package/dist/browser.js +0 -1
- package/dist/downloads/classes/manageEntry.js +0 -1
- package/dist/downloads/import.js +0 -1
- package/dist/index.js +0 -1
- package/dist/libs/contentful-cda.js +0 -1
- package/dist/libs/contentful.js +0 -1
- package/dist/libs/imgix.js +0 -1
- package/dist/libs/logs.js +0 -1
- package/dist/libs/netlify.js +0 -1
- package/dist/libs/notifications.js +0 -1
- package/dist/libs/pdf.js +0 -1
- package/dist/libs/s3.js +0 -1
- package/dist/libs/sentry.js +0 -1
- package/dist/pim/config.js +0 -1
- package/dist/pim/endpoints.js +0 -1
- package/dist/pim/methods/bulkPublish.js +0 -1
- package/dist/pim/methods/catalogs.js +0 -1
- package/dist/pim/methods/checkTopicDraftAndPagePublished.js +0 -1
- package/dist/pim/methods/designers.js +0 -1
- package/dist/pim/methods/dictionary.js +0 -1
- package/dist/pim/methods/families.js +0 -1
- package/dist/pim/methods/latestProducts.js +0 -1
- package/dist/pim/methods/migrateEntryFields.js +0 -1
- package/dist/pim/methods/models.js +0 -1
- package/dist/pim/methods/pages/catalogs.js +0 -1
- package/dist/pim/methods/pages/families.js +0 -1
- package/dist/pim/methods/pages/subfamilies.js +0 -1
- package/dist/pim/methods/products.js +0 -1
- package/dist/pim/methods/subfamilies.js +0 -1
- package/dist/pim/methods/submodels.js +0 -1
- package/dist/pim/request.js +0 -1
- package/dist/resources/AllProducts.js +0 -1
- package/dist/resources/Audit.js +0 -1
- package/dist/resources/CatalogDetails.js +0 -1
- package/dist/resources/CollectionModels.js +0 -1
- package/dist/resources/CollectionSubFamilies.js +0 -1
- package/dist/resources/CollectionSubModels.js +0 -1
- package/dist/resources/DProductSubLine.js +0 -1
- package/dist/resources/FamilyDetails.js +0 -1
- package/dist/resources/ProductDetails.js +0 -1
- package/dist/resources/ProductRelation.js +0 -1
- package/dist/resources/cfFields.js +0 -1
- package/dist/types.js +0 -1
- package/dist/utils.js +0 -1
- package/package.json +7 -2
- package/.env.example +0 -45
- package/.nvmrc +0 -1
- package/.vscode/settings.json +0 -21
- package/dist/algolia/clean.js.map +0 -1
- package/dist/algolia/config.js.map +0 -1
- package/dist/algolia/downloads.js.map +0 -1
- package/dist/algolia/families.js.map +0 -1
- package/dist/algolia/inspirations.js.map +0 -1
- package/dist/algolia/models.js.map +0 -1
- package/dist/algolia/news.js.map +0 -1
- package/dist/algolia/pressRelease.js.map +0 -1
- package/dist/algolia/pressReview.js.map +0 -1
- package/dist/algolia/products.js.map +0 -1
- package/dist/algolia/projects.js.map +0 -1
- package/dist/algolia/stories.js.map +0 -1
- package/dist/algolia/subFamilies.js.map +0 -1
- package/dist/algolia/subModels.js.map +0 -1
- package/dist/browser.js.map +0 -1
- package/dist/downloads/classes/manageEntry.js.map +0 -1
- package/dist/downloads/import.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/libs/contentful-cda.js.map +0 -1
- package/dist/libs/contentful.js.map +0 -1
- package/dist/libs/imgix.js.map +0 -1
- package/dist/libs/logs.js.map +0 -1
- package/dist/libs/netlify.js.map +0 -1
- package/dist/libs/notifications.js.map +0 -1
- package/dist/libs/pdf.js.map +0 -1
- package/dist/libs/s3.js.map +0 -1
- package/dist/libs/sentry.js.map +0 -1
- package/dist/pim/config.js.map +0 -1
- package/dist/pim/endpoints.js.map +0 -1
- package/dist/pim/methods/bulkPublish.js.map +0 -1
- package/dist/pim/methods/catalogs.js.map +0 -1
- package/dist/pim/methods/checkTopicDraftAndPagePublished.js.map +0 -1
- package/dist/pim/methods/designers.js.map +0 -1
- package/dist/pim/methods/dictionary.js.map +0 -1
- package/dist/pim/methods/families.js.map +0 -1
- package/dist/pim/methods/latestProducts.js.map +0 -1
- package/dist/pim/methods/migrateEntryFields.js.map +0 -1
- package/dist/pim/methods/models.js.map +0 -1
- package/dist/pim/methods/pages/catalogs.js.map +0 -1
- package/dist/pim/methods/pages/families.js.map +0 -1
- package/dist/pim/methods/pages/subfamilies.js.map +0 -1
- package/dist/pim/methods/products.js.map +0 -1
- package/dist/pim/methods/subfamilies.js.map +0 -1
- package/dist/pim/methods/submodels.js.map +0 -1
- package/dist/pim/request.js.map +0 -1
- package/dist/resources/AllProducts.js.map +0 -1
- package/dist/resources/Audit.js.map +0 -1
- package/dist/resources/CatalogDetails.js.map +0 -1
- package/dist/resources/CollectionModels.js.map +0 -1
- package/dist/resources/CollectionSubFamilies.js.map +0 -1
- package/dist/resources/CollectionSubModels.js.map +0 -1
- package/dist/resources/DProductSubLine.js.map +0 -1
- package/dist/resources/FamilyDetails.js.map +0 -1
- package/dist/resources/ProductDetails.js.map +0 -1
- package/dist/resources/ProductRelation.js.map +0 -1
- package/dist/resources/cfFields.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/docs/import-data-from-the-dictionary.md +0 -83
- package/docs/import-products.md +0 -61
- package/docs/import-taxonomies-from-the-catalog.md +0 -60
- package/docs/settings.md +0 -47
- package/jest.config.js +0 -16
- package/local-fn/reindex.js +0 -182
- package/src/algolia/clean.ts +0 -164
- package/src/algolia/config.ts +0 -390
- package/src/algolia/downloads.ts +0 -346
- package/src/algolia/families.ts +0 -652
- package/src/algolia/inspirations.ts +0 -315
- package/src/algolia/models.ts +0 -589
- package/src/algolia/news.ts +0 -258
- package/src/algolia/pressRelease.ts +0 -255
- package/src/algolia/pressReview.ts +0 -247
- package/src/algolia/products.ts +0 -731
- package/src/algolia/projects.ts +0 -339
- package/src/algolia/stories.ts +0 -347
- package/src/algolia/subFamilies.ts +0 -709
- package/src/algolia/subModels.ts +0 -359
- package/src/browser.ts +0 -122
- package/src/downloads/classes/manageEntry.ts +0 -99
- package/src/downloads/csv/legal.csv +0 -5
- package/src/downloads/csv/products.csv +0 -373
- package/src/downloads/import.ts +0 -381
- package/src/index.ts +0 -140
- package/src/libs/contentful-cda.ts +0 -543
- package/src/libs/contentful.ts +0 -1453
- package/src/libs/imgix.ts +0 -297
- package/src/libs/logs.ts +0 -121
- package/src/libs/netlify.ts +0 -37
- package/src/libs/notifications.ts +0 -104
- package/src/libs/pdf.ts +0 -107
- package/src/libs/s3.ts +0 -305
- package/src/libs/sentry.ts +0 -33
- package/src/pim/config.ts +0 -84
- package/src/pim/data/productFields.json +0 -1178
- package/src/pim/endpoints.ts +0 -364
- package/src/pim/methods/bulkPublish.ts +0 -266
- package/src/pim/methods/catalogs.ts +0 -586
- package/src/pim/methods/checkTopicDraftAndPagePublished.ts +0 -70
- package/src/pim/methods/designers.ts +0 -128
- package/src/pim/methods/dictionary.ts +0 -611
- package/src/pim/methods/families.ts +0 -345
- package/src/pim/methods/latestProducts.ts +0 -70
- package/src/pim/methods/migrateEntryFields.ts +0 -99
- package/src/pim/methods/models.ts +0 -349
- package/src/pim/methods/pages/catalogs.ts +0 -28
- package/src/pim/methods/pages/families.ts +0 -50
- package/src/pim/methods/pages/subfamilies.ts +0 -98
- package/src/pim/methods/products.ts +0 -3297
- package/src/pim/methods/subfamilies.ts +0 -706
- package/src/pim/methods/submodels.ts +0 -262
- package/src/pim/request.ts +0 -61
- package/src/resources/AllProducts.ts +0 -41
- package/src/resources/Audit.ts +0 -24
- package/src/resources/CatalogDetails.ts +0 -51
- package/src/resources/CollectionModels.ts +0 -42
- package/src/resources/CollectionSubFamilies.ts +0 -45
- package/src/resources/CollectionSubModels.ts +0 -36
- package/src/resources/DProductSubLine.ts +0 -34
- package/src/resources/FamilyDetails.ts +0 -31
- package/src/resources/ProductDetails.ts +0 -352
- package/src/resources/ProductRelation.ts +0 -24
- package/src/resources/cfFields.ts +0 -8
- package/src/types.ts +0 -268
- package/src/utils.ts +0 -553
- package/tsconfig.json +0 -93
- package/tslint.json +0 -22
- package/types/libs/puppeteer.d.ts +0 -17
- package/types/pim/methods/checkIp.d.ts +0 -1
- /package/{types → dist}/algolia/clean.d.ts +0 -0
- /package/{types → dist}/algolia/config.d.ts +0 -0
- /package/{types → dist}/algolia/downloads.d.ts +0 -0
- /package/{types → dist}/algolia/families.d.ts +0 -0
- /package/{types → dist}/algolia/inspirations.d.ts +0 -0
- /package/{types → dist}/algolia/models.d.ts +0 -0
- /package/{types → dist}/algolia/news.d.ts +0 -0
- /package/{types → dist}/algolia/pressRelease.d.ts +0 -0
- /package/{types → dist}/algolia/pressReview.d.ts +0 -0
- /package/{types → dist}/algolia/products.d.ts +0 -0
- /package/{types → dist}/algolia/projects.d.ts +0 -0
- /package/{types → dist}/algolia/stories.d.ts +0 -0
- /package/{types → dist}/algolia/subFamilies.d.ts +0 -0
- /package/{types → dist}/algolia/subModels.d.ts +0 -0
- /package/{types → dist}/browser.d.ts +0 -0
- /package/{types → dist}/downloads/classes/manageEntry.d.ts +0 -0
- /package/{types → dist}/downloads/import.d.ts +0 -0
- /package/{types → dist}/index.d.ts +0 -0
- /package/{types → dist}/libs/contentful-cda.d.ts +0 -0
- /package/{types → dist}/libs/contentful.d.ts +0 -0
- /package/{types → dist}/libs/imgix.d.ts +0 -0
- /package/{types → dist}/libs/logs.d.ts +0 -0
- /package/{types → dist}/libs/netlify.d.ts +0 -0
- /package/{types → dist}/libs/notifications.d.ts +0 -0
- /package/{types → dist}/libs/pdf.d.ts +0 -0
- /package/{types → dist}/libs/s3.d.ts +0 -0
- /package/{types → dist}/libs/sentry.d.ts +0 -0
- /package/{types → dist}/pim/config.d.ts +0 -0
- /package/{types → dist}/pim/endpoints.d.ts +0 -0
- /package/{types → dist}/pim/methods/bulkPublish.d.ts +0 -0
- /package/{types → dist}/pim/methods/catalogs.d.ts +0 -0
- /package/{types → dist}/pim/methods/checkTopicDraftAndPagePublished.d.ts +0 -0
- /package/{types → dist}/pim/methods/designers.d.ts +0 -0
- /package/{types → dist}/pim/methods/dictionary.d.ts +0 -0
- /package/{types → dist}/pim/methods/families.d.ts +0 -0
- /package/{types → dist}/pim/methods/latestProducts.d.ts +0 -0
- /package/{types → dist}/pim/methods/migrateEntryFields.d.ts +0 -0
- /package/{types → dist}/pim/methods/models.d.ts +0 -0
- /package/{types → dist}/pim/methods/pages/catalogs.d.ts +0 -0
- /package/{types → dist}/pim/methods/pages/families.d.ts +0 -0
- /package/{types → dist}/pim/methods/pages/subfamilies.d.ts +0 -0
- /package/{types → dist}/pim/methods/products.d.ts +0 -0
- /package/{types → dist}/pim/methods/subfamilies.d.ts +0 -0
- /package/{types → dist}/pim/methods/submodels.d.ts +0 -0
- /package/{types → dist}/pim/request.d.ts +0 -0
- /package/{types → dist}/resources/AllProducts.d.ts +0 -0
- /package/{types → dist}/resources/Audit.d.ts +0 -0
- /package/{types → dist}/resources/CatalogDetails.d.ts +0 -0
- /package/{types → dist}/resources/CollectionModels.d.ts +0 -0
- /package/{types → dist}/resources/CollectionSubFamilies.d.ts +0 -0
- /package/{types → dist}/resources/CollectionSubModels.d.ts +0 -0
- /package/{types → dist}/resources/DProductSubLine.d.ts +0 -0
- /package/{types → dist}/resources/FamilyDetails.d.ts +0 -0
- /package/{types → dist}/resources/ProductDetails.d.ts +0 -0
- /package/{types → dist}/resources/ProductRelation.d.ts +0 -0
- /package/{types → dist}/resources/cfFields.d.ts +0 -0
- /package/{types → dist}/types.d.ts +0 -0
- /package/{types → dist}/utils.d.ts +0 -0
package/src/utils.ts
DELETED
|
@@ -1,553 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PimLocale,
|
|
3
|
-
ContentfulLocale,
|
|
4
|
-
PimValues,
|
|
5
|
-
CfLocalizedEntryField,
|
|
6
|
-
PimProductDescription,
|
|
7
|
-
PimProductExcerpt,
|
|
8
|
-
} from "./types";
|
|
9
|
-
import { AssetsEntity } from "./resources/ProductDetails";
|
|
10
|
-
import { log } from "./libs/logs";
|
|
11
|
-
import { cfLocales, getEnvironmentDefaultLocaleCode } from "./libs/contentful";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Merge two objects
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* mergeObjects({ name: "Max" },{ age: 30 }); // any type
|
|
18
|
-
* mergeObjects<{ name: string }, { age: number }>({ name: "Max" },{ age: 30 }); // objA: string - objB: number
|
|
19
|
-
* mergeObjects<{ name: string }, { role: string }>({ name: "Max" },{ role: 'admin' });// objA: string - objB: string
|
|
20
|
-
*
|
|
21
|
-
* @param objA
|
|
22
|
-
* @param objB
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export const mergeObjects = <T extends object, U extends object>(
|
|
26
|
-
objA: T,
|
|
27
|
-
objB: U
|
|
28
|
-
) => {
|
|
29
|
-
return { ...objA, ...objB };
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const sleep = (ms: number, showLog: boolean = false) => {
|
|
33
|
-
if (showLog) {
|
|
34
|
-
log(`sleep ${ms}ms...`);
|
|
35
|
-
}
|
|
36
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Get base url
|
|
41
|
-
*
|
|
42
|
-
* @example getBaseURL('http://url.com/page?name=Adam&surname=Smith'); // 'http://url.com/page'
|
|
43
|
-
* @param url
|
|
44
|
-
*/
|
|
45
|
-
export const getBaseURL = (url: string) => url.replace(/[?#].*$/, "");
|
|
46
|
-
|
|
47
|
-
export const basename = (path: string) => {
|
|
48
|
-
return getBaseURL(path).split("/").reverse()[0];
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Seconds between two date
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* const oldDate = new Date();
|
|
56
|
-
* secondBetweenTwoDate(new Date(), oldDate);
|
|
57
|
-
*
|
|
58
|
-
* @param number newDate
|
|
59
|
-
* @param number oldDate
|
|
60
|
-
* @returns
|
|
61
|
-
*/
|
|
62
|
-
export const secondBetweenTwoDate = (newDate: Date, oldDate: Date): number =>
|
|
63
|
-
Math.abs((newDate.getTime() - oldDate.getTime()) / 1000);
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* String to slug (wordpress sanitize_title)
|
|
67
|
-
*
|
|
68
|
-
* @param str
|
|
69
|
-
* @returns
|
|
70
|
-
*/
|
|
71
|
-
export const stringToSlug = (str: string, skipReplaceDots: boolean = false) => {
|
|
72
|
-
str = str.replace(/^\s+|\s+$/g, ""); // trim
|
|
73
|
-
str = str.toLowerCase();
|
|
74
|
-
|
|
75
|
-
// remove accents, swap ñ for n, etc
|
|
76
|
-
const from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;";
|
|
77
|
-
const to = "aaaaeeeeiiiioooouuuuncescrzyuudtn------";
|
|
78
|
-
|
|
79
|
-
for (let i = 0, l = from.length; i < l; i++) {
|
|
80
|
-
str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i));
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
str = str
|
|
84
|
-
.replace(/[^a-z0-9. -]/g, "") // remove invalid chars
|
|
85
|
-
.replace(/\s+/g, "-") // collapse whitespace and replace by a dash
|
|
86
|
-
.replace(/-+/g, "-") // collapse dashes
|
|
87
|
-
.replace(/\//g, ""); // collapse all forward-slashes
|
|
88
|
-
|
|
89
|
-
if (!skipReplaceDots) {
|
|
90
|
-
str = str
|
|
91
|
-
.replace(".", "-") // replace a dot by a dash
|
|
92
|
-
.replace(/[^a-z0-9 -]/g, ""); // remove invalid chars
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return str;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const pimLocaleMap: Partial<Record<PimLocale, ContentfulLocale>> = {
|
|
99
|
-
en: "en",
|
|
100
|
-
en_us: "en-US",
|
|
101
|
-
it: "it",
|
|
102
|
-
es: "es",
|
|
103
|
-
de: "de",
|
|
104
|
-
fr: "fr",
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export const getLocale = (
|
|
108
|
-
pimLocaleCode: PimLocale
|
|
109
|
-
): ContentfulLocale | null => {
|
|
110
|
-
return pimLocaleMap[pimLocaleCode] || null;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const getPimTranslations = (
|
|
114
|
-
values: Partial<
|
|
115
|
-
PimValues | PimProductDescription | PimProductExcerpt | AssetsEntity
|
|
116
|
-
>,
|
|
117
|
-
fieldKey:
|
|
118
|
-
| "value"
|
|
119
|
-
| "description"
|
|
120
|
-
| "description1"
|
|
121
|
-
| "description2"
|
|
122
|
-
| "note"
|
|
123
|
-
| "title"
|
|
124
|
-
| "webNaming" = "value",
|
|
125
|
-
defaultValue: string = "",
|
|
126
|
-
limit: number = 0
|
|
127
|
-
): CfLocalizedEntryField => {
|
|
128
|
-
const names: CfLocalizedEntryField = {};
|
|
129
|
-
const valueString = `${fieldKey}_`;
|
|
130
|
-
let alternativeValue: string = "";
|
|
131
|
-
for (const [key, value] of Object.entries(values)) {
|
|
132
|
-
if (key.includes(valueString)) {
|
|
133
|
-
if (alternativeValue === "") {
|
|
134
|
-
alternativeValue = value! as any;
|
|
135
|
-
}
|
|
136
|
-
const localKey: PimLocale = key
|
|
137
|
-
.substr(valueString.length)
|
|
138
|
-
.toLowerCase() as PimLocale;
|
|
139
|
-
const contentfulLocalKey = getLocale(localKey);
|
|
140
|
-
if (contentfulLocalKey) {
|
|
141
|
-
const bigValue =
|
|
142
|
-
sanitizeValue((value as any) || defaultValue || alternativeValue) ||
|
|
143
|
-
"";
|
|
144
|
-
|
|
145
|
-
names[contentfulLocalKey] = limit
|
|
146
|
-
? truncateString(bigValue, limit)
|
|
147
|
-
: bigValue;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return names;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Get unwonted values
|
|
157
|
-
*
|
|
158
|
-
* @returns
|
|
159
|
-
*/
|
|
160
|
-
export const getUnwantedValues = (): (string | number)[] => {
|
|
161
|
-
return ["N/C", "N/A", "N/S", "-1", -1, "-1.00"];
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Remove unwanted values from string
|
|
166
|
-
*
|
|
167
|
-
* @param value
|
|
168
|
-
* @returns
|
|
169
|
-
*/
|
|
170
|
-
export const sanitizeValue = (value: string) => {
|
|
171
|
-
return getUnwantedValues().includes(value) ? null : value;
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Split array into chunks
|
|
176
|
-
*
|
|
177
|
-
* @param list
|
|
178
|
-
* @param chunkSize
|
|
179
|
-
* @returns
|
|
180
|
-
*/
|
|
181
|
-
export const doChunk = (list: string[], size: number) => {
|
|
182
|
-
const chunks = [];
|
|
183
|
-
let temparray = [];
|
|
184
|
-
|
|
185
|
-
for (let i = 0; i < list.length; i++) {
|
|
186
|
-
if (i % size === 0) {
|
|
187
|
-
temparray = new Array();
|
|
188
|
-
chunks.push(temparray);
|
|
189
|
-
}
|
|
190
|
-
temparray.push(list[i]);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return chunks;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Get local ISO time
|
|
198
|
-
*
|
|
199
|
-
* @example getLocalISOTime() => 2021-08-10T15:36:15.033Z
|
|
200
|
-
*
|
|
201
|
-
* @returns
|
|
202
|
-
*/
|
|
203
|
-
export const getLocalISOTime = () => {
|
|
204
|
-
// const offsetInMs = 60000;
|
|
205
|
-
// const tzoffset = new Date().getTimezoneOffset() * offsetInMs; // offset in milliseconds
|
|
206
|
-
// return new Date(Date.now() - tzoffset).toISOString().slice(0, -1);
|
|
207
|
-
return new Date().toISOString();
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Make only the first letter of a string uppercase
|
|
212
|
-
* @param text
|
|
213
|
-
* @returns
|
|
214
|
-
*/
|
|
215
|
-
export const capitalizeFirstLetter = (text: string) => {
|
|
216
|
-
return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Convert the keys of the object to lowercase
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* keysToLowerCase({'en' : "Foo"}) -> {'en': 'Foo'}
|
|
224
|
-
*
|
|
225
|
-
* @param obj
|
|
226
|
-
* @param includeNestedKeys if true all keys of all levels nested in the object will be converted
|
|
227
|
-
* @returns
|
|
228
|
-
*/
|
|
229
|
-
export const keysToLowerCase = (
|
|
230
|
-
obj: any,
|
|
231
|
-
includeNestedKeys: boolean = false
|
|
232
|
-
) => {
|
|
233
|
-
if (typeof obj !== "object") {
|
|
234
|
-
return {};
|
|
235
|
-
}
|
|
236
|
-
let key;
|
|
237
|
-
const keys = Object.keys(obj);
|
|
238
|
-
let n = keys.length;
|
|
239
|
-
const newobj: any = {};
|
|
240
|
-
while (n--) {
|
|
241
|
-
key = keys[n];
|
|
242
|
-
const content = obj[key];
|
|
243
|
-
if (typeof content === "object" && includeNestedKeys) {
|
|
244
|
-
newobj[key.toLowerCase()] = keysToLowerCase(content);
|
|
245
|
-
} else {
|
|
246
|
-
newobj[key.toLowerCase()] = content;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return newobj;
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
type AnyObject = { [key: string]: any };
|
|
254
|
-
function containsObject(array: AnyObject[], obj: AnyObject): boolean {
|
|
255
|
-
const objStr = JSON.stringify(obj);
|
|
256
|
-
return array.some((item) => JSON.stringify(item) === objStr);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Add productField value code by pimDetail
|
|
261
|
-
*
|
|
262
|
-
* @param pimDetails The productFields field of the topicProduct
|
|
263
|
-
* @param productFields Varialble with other productFields. The new field will be added to this
|
|
264
|
-
* @param fieldKey The fieldKey (ex: numberOfHeads for optical.numberOfHeads)
|
|
265
|
-
* @param fieldParentKey (optional) The field parent (ex: optical for optical.numberOfHeads)
|
|
266
|
-
* @param customKey (optional) The custom key (ex: filterableCertifications)
|
|
267
|
-
* @param mergeValues (optional) Merge all values into the same customKey/fieldParentKey
|
|
268
|
-
* @param keepKey (optional)Keep the field key (ex: {code: 'ABC'})
|
|
269
|
-
* @returns The productFields with new field
|
|
270
|
-
*/
|
|
271
|
-
export const addProductFieldValueCodesByPimDetails = (
|
|
272
|
-
pimDetails: any,
|
|
273
|
-
productFields: any,
|
|
274
|
-
fieldKey: string,
|
|
275
|
-
fieldParentKey?: string,
|
|
276
|
-
customKey?: string,
|
|
277
|
-
mergeValues?: boolean,
|
|
278
|
-
keepKey?: boolean
|
|
279
|
-
): string[] => {
|
|
280
|
-
if (fieldParentKey && pimDetails?.[fieldParentKey]?.[fieldKey]) {
|
|
281
|
-
customKey = customKey ?? fieldParentKey;
|
|
282
|
-
if (!productFields?.[customKey]?.[fieldKey]) {
|
|
283
|
-
if (mergeValues) {
|
|
284
|
-
productFields[customKey] = [];
|
|
285
|
-
} else {
|
|
286
|
-
if (!productFields?.[customKey]) productFields[customKey] = {};
|
|
287
|
-
productFields[customKey][fieldKey] = [];
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// With parent
|
|
292
|
-
if (Array.isArray(pimDetails[fieldParentKey][fieldKey])) {
|
|
293
|
-
pimDetails?.[fieldParentKey]?.[fieldKey].forEach((item: any) => {
|
|
294
|
-
if (keepKey) {
|
|
295
|
-
if (mergeValues) {
|
|
296
|
-
if (
|
|
297
|
-
sanitizeValue(item.code) &&
|
|
298
|
-
// @ts-ignore
|
|
299
|
-
!productFields[customKey].find((el: any) => el.code === item.code)
|
|
300
|
-
) {
|
|
301
|
-
// @ts-ignore
|
|
302
|
-
productFields[customKey].push({ code: item.code });
|
|
303
|
-
}
|
|
304
|
-
} else {
|
|
305
|
-
if (
|
|
306
|
-
sanitizeValue(item.code) &&
|
|
307
|
-
// @ts-ignore
|
|
308
|
-
!productFields[customKey][fieldKey].find(
|
|
309
|
-
(el: any) => el.code === item.code
|
|
310
|
-
)
|
|
311
|
-
) {
|
|
312
|
-
// @ts-ignore
|
|
313
|
-
productFields[customKey][fieldKey].push({ code: item.code });
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
} else {
|
|
317
|
-
if (mergeValues) {
|
|
318
|
-
if (
|
|
319
|
-
sanitizeValue(item.code) &&
|
|
320
|
-
// @ts-ignore
|
|
321
|
-
productFields[customKey].indexOf(item.code) === -1
|
|
322
|
-
) {
|
|
323
|
-
// @ts-ignore
|
|
324
|
-
productFields[customKey].push(item.code);
|
|
325
|
-
}
|
|
326
|
-
} else {
|
|
327
|
-
if (
|
|
328
|
-
sanitizeValue(item.code) &&
|
|
329
|
-
// @ts-ignore
|
|
330
|
-
productFields[customKey][fieldKey].indexOf(item.code) === -1
|
|
331
|
-
) {
|
|
332
|
-
// @ts-ignore
|
|
333
|
-
productFields[customKey][fieldKey].push(item.code);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
} else {
|
|
339
|
-
if (keepKey) {
|
|
340
|
-
if (mergeValues) {
|
|
341
|
-
if (
|
|
342
|
-
sanitizeValue(pimDetails[fieldParentKey][fieldKey].code) &&
|
|
343
|
-
// @ts-ignore
|
|
344
|
-
!productFields[customKey].find(
|
|
345
|
-
(el: any) => el.code === pimDetails[fieldParentKey][fieldKey].code
|
|
346
|
-
)
|
|
347
|
-
) {
|
|
348
|
-
productFields[customKey].push({
|
|
349
|
-
code: pimDetails[fieldParentKey][fieldKey].code,
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
} else {
|
|
353
|
-
if (
|
|
354
|
-
sanitizeValue(pimDetails[fieldParentKey][fieldKey].code) &&
|
|
355
|
-
// @ts-ignore
|
|
356
|
-
!productFields[customKey][fieldKey].find(
|
|
357
|
-
(el: any) => el.code === pimDetails[fieldParentKey][fieldKey].code
|
|
358
|
-
)
|
|
359
|
-
) {
|
|
360
|
-
productFields[customKey][fieldKey].push({
|
|
361
|
-
code: pimDetails[fieldParentKey][fieldKey].code,
|
|
362
|
-
});
|
|
363
|
-
} else if (
|
|
364
|
-
!pimDetails[fieldParentKey][fieldKey].hasOwnProperty("code") &&
|
|
365
|
-
sanitizeValue(pimDetails[fieldParentKey][fieldKey]) &&
|
|
366
|
-
// @ts-ignore
|
|
367
|
-
!productFields[customKey][fieldKey].find(
|
|
368
|
-
(el: any) => el === pimDetails[fieldParentKey][fieldKey]
|
|
369
|
-
) &&
|
|
370
|
-
!containsObject(
|
|
371
|
-
productFields[customKey][fieldKey],
|
|
372
|
-
pimDetails[fieldParentKey][fieldKey]
|
|
373
|
-
)
|
|
374
|
-
) {
|
|
375
|
-
productFields[customKey][fieldKey].push({
|
|
376
|
-
code: pimDetails[fieldParentKey][fieldKey],
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
} else {
|
|
381
|
-
if (mergeValues) {
|
|
382
|
-
if (
|
|
383
|
-
sanitizeValue(pimDetails[fieldParentKey][fieldKey].code) &&
|
|
384
|
-
productFields[customKey].indexOf(
|
|
385
|
-
pimDetails[fieldParentKey][fieldKey].code
|
|
386
|
-
) === -1
|
|
387
|
-
) {
|
|
388
|
-
productFields[customKey].push(
|
|
389
|
-
pimDetails[fieldParentKey][fieldKey].code
|
|
390
|
-
);
|
|
391
|
-
}
|
|
392
|
-
} else {
|
|
393
|
-
if (
|
|
394
|
-
sanitizeValue(pimDetails[fieldParentKey][fieldKey].code) &&
|
|
395
|
-
productFields[customKey][fieldKey].indexOf(
|
|
396
|
-
pimDetails[fieldParentKey][fieldKey].code
|
|
397
|
-
) === -1
|
|
398
|
-
) {
|
|
399
|
-
productFields[customKey][fieldKey].push(
|
|
400
|
-
pimDetails[fieldParentKey][fieldKey].code
|
|
401
|
-
);
|
|
402
|
-
} else if (
|
|
403
|
-
!pimDetails[fieldParentKey][fieldKey].hasOwnProperty("code") &&
|
|
404
|
-
sanitizeValue(pimDetails[fieldParentKey][fieldKey]) &&
|
|
405
|
-
productFields[customKey][fieldKey].indexOf(
|
|
406
|
-
pimDetails[fieldParentKey][fieldKey]
|
|
407
|
-
) === -1 &&
|
|
408
|
-
!containsObject(
|
|
409
|
-
productFields[customKey][fieldKey],
|
|
410
|
-
pimDetails[fieldParentKey][fieldKey]
|
|
411
|
-
)
|
|
412
|
-
) {
|
|
413
|
-
productFields[customKey][fieldKey].push(
|
|
414
|
-
pimDetails[fieldParentKey][fieldKey]
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
} else if (pimDetails?.[fieldKey]) {
|
|
421
|
-
if (!productFields?.[fieldKey]) {
|
|
422
|
-
productFields[fieldKey] = [];
|
|
423
|
-
}
|
|
424
|
-
// Without parent
|
|
425
|
-
if (Array.isArray(pimDetails[fieldKey])) {
|
|
426
|
-
pimDetails?.[fieldKey].forEach((item: any) => {
|
|
427
|
-
if (keepKey) {
|
|
428
|
-
if (
|
|
429
|
-
sanitizeValue(item.code) &&
|
|
430
|
-
!productFields[fieldKey].find((el: any) => el.code === item.code)
|
|
431
|
-
) {
|
|
432
|
-
productFields[fieldKey].push({ code: item.code });
|
|
433
|
-
}
|
|
434
|
-
} else {
|
|
435
|
-
if (
|
|
436
|
-
sanitizeValue(item.code) &&
|
|
437
|
-
productFields[fieldKey].indexOf(item.code) === -1
|
|
438
|
-
) {
|
|
439
|
-
productFields[fieldKey].push(item.code);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
} else {
|
|
444
|
-
if (keepKey) {
|
|
445
|
-
if (
|
|
446
|
-
sanitizeValue(pimDetails[fieldKey].code) &&
|
|
447
|
-
!productFields[fieldKey].find(
|
|
448
|
-
(el: any) => el.code === pimDetails[fieldKey].code
|
|
449
|
-
)
|
|
450
|
-
) {
|
|
451
|
-
productFields[fieldKey].push({ code: pimDetails[fieldKey].code });
|
|
452
|
-
}
|
|
453
|
-
} else {
|
|
454
|
-
if (
|
|
455
|
-
sanitizeValue(pimDetails[fieldKey].code) &&
|
|
456
|
-
productFields[fieldKey].indexOf(pimDetails[fieldKey].code) === -1
|
|
457
|
-
) {
|
|
458
|
-
productFields[fieldKey].push(pimDetails[fieldKey].code);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
return productFields;
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Replace all occurrences of a string
|
|
469
|
-
*
|
|
470
|
-
* @param {string} original Original string
|
|
471
|
-
* @param {string} from String to find
|
|
472
|
-
* @param {string} to New string
|
|
473
|
-
*
|
|
474
|
-
* @example replaceAll('Foo','o','u') => Fuu
|
|
475
|
-
*
|
|
476
|
-
* @returns
|
|
477
|
-
*/
|
|
478
|
-
export const replaceAll = (original: string, from: string, to: string) => {
|
|
479
|
-
const regExp = new RegExp(from, "g");
|
|
480
|
-
return original.replace(regExp, to);
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Get all locale translations
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
* @param {object} values
|
|
488
|
-
*
|
|
489
|
-
* @example getAllTranslations({en:foo}) => {en:foo, it: foo, de: foo...}
|
|
490
|
-
*
|
|
491
|
-
* @returns
|
|
492
|
-
*/
|
|
493
|
-
export const getAllTranslations = async (values: any) => {
|
|
494
|
-
const defaultLocale = await getEnvironmentDefaultLocaleCode();
|
|
495
|
-
|
|
496
|
-
const newValue: any = {};
|
|
497
|
-
for (const locale of cfLocales) {
|
|
498
|
-
newValue[locale] = values?.[locale] || values[defaultLocale] || "";
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
return keysToLowerCase(newValue);
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
export const truncateString = (string: string, limit: number) => {
|
|
505
|
-
const separator = "...";
|
|
506
|
-
return string.length <= limit - separator.length
|
|
507
|
-
? string
|
|
508
|
-
: string.slice(0, limit - separator.length) + "...";
|
|
509
|
-
};
|
|
510
|
-
|
|
511
|
-
export const getCertificationFilters = (productFields: any) => {
|
|
512
|
-
let certificationFilters: any = [];
|
|
513
|
-
certificationFilters =
|
|
514
|
-
productFields?.certification?.certificates?.map((c: any) => c.code) || [];
|
|
515
|
-
|
|
516
|
-
const availableCertificationCodes = [
|
|
517
|
-
"CM1",
|
|
518
|
-
"CM2",
|
|
519
|
-
"CM3",
|
|
520
|
-
"CM4",
|
|
521
|
-
"CM5",
|
|
522
|
-
"CM6",
|
|
523
|
-
"CM7",
|
|
524
|
-
"CM8",
|
|
525
|
-
"CM9",
|
|
526
|
-
"CM10",
|
|
527
|
-
"CM11",
|
|
528
|
-
"CM12",
|
|
529
|
-
"CM13",
|
|
530
|
-
"CM14",
|
|
531
|
-
"CM15",
|
|
532
|
-
"CM16",
|
|
533
|
-
"CM17",
|
|
534
|
-
"CM18",
|
|
535
|
-
];
|
|
536
|
-
|
|
537
|
-
certificationFilters = certificationFilters?.filter((code: string) =>
|
|
538
|
-
availableCertificationCodes.includes(code)
|
|
539
|
-
);
|
|
540
|
-
|
|
541
|
-
if (productFields?.certification?.enecCertified?.state === true)
|
|
542
|
-
certificationFilters.push(
|
|
543
|
-
productFields.certification.enecCertified.label?.value_en ||
|
|
544
|
-
productFields.certification.enecCertified.label
|
|
545
|
-
);
|
|
546
|
-
if (productFields?.certification?.ulCertified?.state === true)
|
|
547
|
-
certificationFilters.push(
|
|
548
|
-
productFields.certification.ulCertified.label?.value_en ||
|
|
549
|
-
productFields.certification.ulCertified.label
|
|
550
|
-
);
|
|
551
|
-
|
|
552
|
-
return certificationFilters;
|
|
553
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Basic Options */
|
|
6
|
-
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
-
"target": "ESNext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
|
8
|
-
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
9
|
-
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
10
|
-
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
11
|
-
// "checkJs": true, /* Report errors in .js files. */
|
|
12
|
-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
|
|
13
|
-
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
14
|
-
"declarationDir": "./types",
|
|
15
|
-
//"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
16
|
-
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
17
|
-
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
18
|
-
"outDir": "./dist", /* Redirect output structure to the directory. */
|
|
19
|
-
//"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
20
|
-
// "composite": true, /* Enable project compilation */
|
|
21
|
-
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
22
|
-
"removeComments": true, /* Do not emit comments to output. */
|
|
23
|
-
// "noEmit": true, /* Do not emit outputs. */
|
|
24
|
-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
25
|
-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
26
|
-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
27
|
-
"noEmitOnError": true, /* Do not emit outputs on error */
|
|
28
|
-
|
|
29
|
-
/* Strict Type-Checking Options */
|
|
30
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
31
|
-
//"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
32
|
-
//"strictNullChecks": true, /* Enable strict null checks. */
|
|
33
|
-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
34
|
-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
35
|
-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
36
|
-
//"noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
37
|
-
//"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
38
|
-
|
|
39
|
-
/* Additional Checks */
|
|
40
|
-
"noUnusedLocals": true, /* Report errors on unused locals. */
|
|
41
|
-
"noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
42
|
-
"noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
43
|
-
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
44
|
-
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
45
|
-
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
|
|
46
|
-
|
|
47
|
-
/* Module Resolution Options */
|
|
48
|
-
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
49
|
-
"baseUrl": ".", /* Base directory to resolve non-absolute module names. */
|
|
50
|
-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
51
|
-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
52
|
-
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
53
|
-
// "types": [], /* Type declaration files to be included in compilation. */
|
|
54
|
-
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
55
|
-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
56
|
-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
57
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
58
|
-
|
|
59
|
-
/* Source Map Options */
|
|
60
|
-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
61
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
62
|
-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
63
|
-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
64
|
-
|
|
65
|
-
/* Experimental Options */
|
|
66
|
-
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
67
|
-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
68
|
-
|
|
69
|
-
/* Advanced Options */
|
|
70
|
-
"skipLibCheck": true, /* Skip type checking of declaration files. */
|
|
71
|
-
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
|
|
72
|
-
|
|
73
|
-
"resolveJsonModule": true,
|
|
74
|
-
|
|
75
|
-
"plugins": [
|
|
76
|
-
{
|
|
77
|
-
"name": "tslint-language-service",
|
|
78
|
-
"disableNoUnusedVariableRule": false,
|
|
79
|
-
"supressWhileTypeErrorsPresent": false
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
"include": [
|
|
85
|
-
"./src/**/*"
|
|
86
|
-
],
|
|
87
|
-
|
|
88
|
-
"exclude": [
|
|
89
|
-
"node_modules",
|
|
90
|
-
"dist",
|
|
91
|
-
]
|
|
92
|
-
|
|
93
|
-
}
|
package/tslint.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"defaultSeverity": "error",
|
|
3
|
-
"extends": ["tslint:recommended", "tslint:latest"],
|
|
4
|
-
"jsRules": {},
|
|
5
|
-
"rules": {
|
|
6
|
-
"member-access": false,
|
|
7
|
-
"object-literal-sort-keys": false,
|
|
8
|
-
"no-trailing-whitespace": false,
|
|
9
|
-
"ordered-imports": false,
|
|
10
|
-
"one-line": false,
|
|
11
|
-
"no-console": false,
|
|
12
|
-
"max-line-length": false,
|
|
13
|
-
"object-literal-shorthand": false,
|
|
14
|
-
"interface-name": false,
|
|
15
|
-
"no-empty-interface": false,
|
|
16
|
-
"no-implicit-dependencies": false,
|
|
17
|
-
"no-var-requires": false,
|
|
18
|
-
"no-submodule-imports": false,
|
|
19
|
-
"max-classes-per-file": false
|
|
20
|
-
},
|
|
21
|
-
"rulesDirectory": []
|
|
22
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface HeaderColumns {
|
|
2
|
-
left?: string;
|
|
3
|
-
right?: string;
|
|
4
|
-
}
|
|
5
|
-
interface FooterColumns {
|
|
6
|
-
topLeft?: string;
|
|
7
|
-
topRight?: string;
|
|
8
|
-
bottomLeft?: string;
|
|
9
|
-
bottomRight?: string;
|
|
10
|
-
mail?: string;
|
|
11
|
-
}
|
|
12
|
-
interface PDFHeaderAndFooter {
|
|
13
|
-
header?: HeaderColumns;
|
|
14
|
-
footer?: FooterColumns;
|
|
15
|
-
}
|
|
16
|
-
export declare const generatePDFByUrl: (url: string, fileName?: string, contents?: PDFHeaderAndFooter | undefined) => Promise<any>;
|
|
17
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const checkIp: (customUrl: string) => Promise<void>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|