pim-import 3.4.6 → 4.2.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/.env.example +4 -3
- package/dist/algolia/families.js +4 -0
- package/dist/algolia/families.js.map +1 -1
- package/dist/algolia/products.js +18 -9
- package/dist/algolia/products.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/libs/contentful.js +9 -1
- package/dist/libs/contentful.js.map +1 -1
- package/dist/libs/puppeteer.js +79 -21
- package/dist/libs/puppeteer.js.map +1 -1
- package/dist/pim/methods/products.js +7 -8
- package/dist/pim/methods/products.js.map +1 -1
- package/package.json +2 -2
- package/src/algolia/families.ts +6 -0
- package/src/algolia/products.ts +21 -12
- package/src/index.ts +1 -0
- package/src/libs/contentful.ts +18 -0
- package/src/libs/puppeteer.ts +133 -29
- package/src/pim/methods/products.ts +10 -9
- package/src/resources/ProductDetails.ts +1 -0
- package/types/algolia/families.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/libs/contentful.d.ts +3 -1
- package/types/libs/puppeteer.d.ts +11 -5
- package/types/resources/ProductDetails.d.ts +1 -0
|
@@ -1969,16 +1969,17 @@ export const generateTechSpecPdf = async (topicProductId: string) => {
|
|
|
1969
1969
|
);
|
|
1970
1970
|
log(`pdpSiteUrl: ${pdpSiteUrl}`);
|
|
1971
1971
|
const contents = {
|
|
1972
|
-
header: {
|
|
1973
|
-
|
|
1974
|
-
},
|
|
1972
|
+
// header: {
|
|
1973
|
+
// right: "Technical Specifications",
|
|
1974
|
+
// },
|
|
1975
1975
|
footer: {
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1976
|
+
topLeft: `<a style="text-decoration: none; color:#000" href="${pdpSiteUrl}">${pdpSiteUrl}</a>`,
|
|
1977
|
+
topRight: topicProductId,
|
|
1978
|
+
bottomLeft: ``,
|
|
1979
|
+
bottomRight: ``,
|
|
1980
|
+
mail: topicCatalogIds.includes("OUTDOOR")
|
|
1981
|
+
? "flos.outdoor@flos.com"
|
|
1982
|
+
: "info@flos.com",
|
|
1982
1983
|
},
|
|
1983
1984
|
};
|
|
1984
1985
|
|
|
@@ -29,7 +29,7 @@ export declare const reindexFamilies: (offset?: number, limit?: number, catalogC
|
|
|
29
29
|
s3FilePath?: string | undefined;
|
|
30
30
|
total?: number | undefined;
|
|
31
31
|
}>;
|
|
32
|
-
export declare const reindexFamily: (topicFamilyEntryId: string) => Promise<{
|
|
32
|
+
export declare const reindexFamily: (topicFamilyEntryId: string) => Promise<false | {
|
|
33
33
|
objectID: string;
|
|
34
34
|
names: CfLocalizedEntryField;
|
|
35
35
|
code: string;
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { init as initPim } from "./pim/config";
|
|
2
|
-
export { init as initContentful, initBaseEntries, deletePages, deleteEntries, getEntryByID, getTopicPage, } from "./libs/contentful";
|
|
2
|
+
export { init as initContentful, initBaseEntries, deletePages, deleteEntries, getEntryByID, getTopicPage, getEntries, } from "./libs/contentful";
|
|
3
3
|
export { init as initS3, upload as uploadS3, saveJsonToS3, getFileFromS3, savePDFToS3, } from "./libs/s3";
|
|
4
4
|
export { importDictionaryFields, importDictionaryIcons, importDictionaryProductLine, importDictionaryProductSubLine, } from "./pim/methods/dictionary";
|
|
5
5
|
export { importCategories } from "./pim/methods/catalogs";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Entry, CreateEntryProps } from "contentful-management/dist/typings/entities/entry";
|
|
1
|
+
import type { Entry, CreateEntryProps, EntryProps } from "contentful-management/dist/typings/entities/entry";
|
|
2
|
+
import type { QueryOptions } from "contentful-management/dist/typings/common-types";
|
|
2
3
|
import { Environment, Locale, CreateAssetProps } from "contentful-management/types";
|
|
3
4
|
import { ContentfulLocale, AvailableCatalogs, TopicDetailsResponse, AssetPropFields, OtherFilters, WrapperImageFields } from "../types";
|
|
4
5
|
import { GenericData } from "../resources/ProductDetails";
|
|
@@ -57,3 +58,4 @@ export declare const createWrapperImgix: (id: string, data: WrapperImageFields)
|
|
|
57
58
|
export declare const archiveEntry: (entry: Entry, isProduct?: boolean) => Promise<Entry>;
|
|
58
59
|
export declare const getDesignerData: (designer: GenericData) => Promise<CreateEntryProps<import("contentful-management/types").KeyValueMap>>;
|
|
59
60
|
export declare const addDesignerData: (data: any, designer: GenericData, manyReferences?: boolean) => Promise<any>;
|
|
61
|
+
export declare const getEntries: (opts: QueryOptions) => Promise<import("contentful-management/dist/typings/common-types").Collection<import("contentful-management/dist/typings/entities/entry").Entry, EntryProps<Record<string, any>>>>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
interface Columns {
|
|
1
|
+
interface HeaderColumns {
|
|
3
2
|
left?: string;
|
|
4
3
|
right?: string;
|
|
5
4
|
}
|
|
5
|
+
interface FooterColumns {
|
|
6
|
+
topLeft?: string;
|
|
7
|
+
topRight?: string;
|
|
8
|
+
bottomLeft?: string;
|
|
9
|
+
bottomRight?: string;
|
|
10
|
+
mail?: string;
|
|
11
|
+
}
|
|
6
12
|
interface PDFHeaderAndFooter {
|
|
7
|
-
header?:
|
|
8
|
-
footer?:
|
|
13
|
+
header?: HeaderColumns;
|
|
14
|
+
footer?: FooterColumns;
|
|
9
15
|
}
|
|
10
|
-
export declare const generatePDFByUrl: (url: string, path?: string, contents?: PDFHeaderAndFooter | undefined) => Promise<
|
|
16
|
+
export declare const generatePDFByUrl: (url: string, path?: string, contents?: PDFHeaderAndFooter | undefined) => Promise<any>;
|
|
11
17
|
export {};
|