cloudcommerce 0.1.5 → 0.1.6
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/CHANGELOG.md +12 -0
- package/ecomplus-stores/monocard/functions/core/package.json +1 -1
- package/ecomplus-stores/monocard/functions/events/package.json +2 -2
- package/ecomplus-stores/monocard/functions/modules/package.json +2 -2
- package/ecomplus-stores/monocard/functions/passport/package.json +2 -2
- package/ecomplus-stores/monocard/functions/ssr/package.json +6 -9
- package/ecomplus-stores/monocard/package.json +1 -1
- package/ecomplus-stores/tia-sonia/functions/core/package.json +1 -1
- package/ecomplus-stores/tia-sonia/functions/events/package.json +2 -2
- package/ecomplus-stores/tia-sonia/functions/modules/package.json +2 -2
- package/ecomplus-stores/tia-sonia/functions/passport/package.json +2 -2
- package/ecomplus-stores/tia-sonia/functions/ssr/package.json +6 -9
- package/ecomplus-stores/tia-sonia/functions/ssr/src/layouts/Pages.astro +2 -0
- package/ecomplus-stores/tia-sonia/functions/ssr/src/main/Home.astro +2 -0
- package/ecomplus-stores/tia-sonia/package.json +1 -1
- package/package.json +1 -1
- package/packages/api/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/CHANGELOG.md +1 -0
- package/packages/apps/fb-conversions/README.md +1 -0
- package/packages/apps/fb-conversions/lib/fb-conversions-events.js +145 -0
- package/packages/apps/fb-conversions/lib/fb-conversions-events.js.map +1 -0
- package/packages/apps/fb-conversions/lib/index.js +2 -0
- package/packages/apps/fb-conversions/lib/index.js.map +1 -0
- package/packages/apps/fb-conversions/package.json +33 -0
- package/packages/apps/fb-conversions/src/fb-conversions-events.ts +178 -0
- package/packages/apps/fb-conversions/src/index.ts +1 -0
- package/packages/apps/fb-conversions/tsconfig.json +3 -0
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/infinitepay/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/events/lib/firebase.js +2 -0
- package/packages/events/lib/firebase.js.map +1 -1
- package/packages/events/package.json +2 -1
- package/packages/events/src/firebase.ts +2 -0
- package/packages/firebase/lib/config.d.ts +4 -0
- package/packages/firebase/lib/config.js +7 -0
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/firebase/src/config.ts +7 -0
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +3 -1
- package/packages/storefront/astro.config.mjs +3 -1
- package/packages/storefront/dist/server/entry.mjs +50 -164
- package/packages/storefront/package.json +3 -4
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/monocard/functions/ssr/.nvmrc +0 -1
- package/ecomplus-stores/tia-sonia/functions/ssr/.nvmrc +0 -1
- package/packages/storefront/.nvmrc +0 -1
- package/packages/storefront/dist/server/chunks/avif/avif_node_dec.wasm +0 -0
- package/packages/storefront/dist/server/chunks/avif/avif_node_enc.wasm +0 -0
- package/packages/storefront/dist/server/chunks/image-pool.abfa6f7b.mjs +0 -10794
- package/packages/storefront/dist/server/chunks/mozjpeg/mozjpeg_node_dec.wasm +0 -0
- package/packages/storefront/dist/server/chunks/mozjpeg/mozjpeg_node_enc.wasm +0 -0
- package/packages/storefront/dist/server/chunks/png/squoosh_oxipng_bg.wasm +0 -0
- package/packages/storefront/dist/server/chunks/png/squoosh_png_bg.wasm +0 -0
- package/packages/storefront/dist/server/chunks/resize/squoosh_resize_bg.wasm +0 -0
- package/packages/storefront/dist/server/chunks/rotate/rotate.wasm +0 -0
- package/packages/storefront/dist/server/chunks/webp/webp_node_dec.wasm +0 -0
- package/packages/storefront/dist/server/chunks/webp/webp_node_enc.wasm +0 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/* eslint-disable import/prefer-default-export */
|
|
2
|
+
import type { Orders } from '@cloudcommerce/types';
|
|
3
|
+
import {
|
|
4
|
+
createAppEventsFunction,
|
|
5
|
+
ApiEventHandler,
|
|
6
|
+
} from '@cloudcommerce/firebase/lib/helpers/pubsub';
|
|
7
|
+
import logger from 'firebase-functions/logger';
|
|
8
|
+
import {
|
|
9
|
+
Content,
|
|
10
|
+
CustomData,
|
|
11
|
+
DeliveryCategory,
|
|
12
|
+
EventRequest,
|
|
13
|
+
UserData,
|
|
14
|
+
ServerEvent,
|
|
15
|
+
FacebookAdsApi,
|
|
16
|
+
} from 'facebook-nodejs-business-sdk';
|
|
17
|
+
|
|
18
|
+
const handleApiEvent: ApiEventHandler = async ({
|
|
19
|
+
evName,
|
|
20
|
+
apiEvent,
|
|
21
|
+
apiDoc,
|
|
22
|
+
app,
|
|
23
|
+
}) => {
|
|
24
|
+
const resourceId = apiEvent.resource_id;
|
|
25
|
+
logger.info('>> ', resourceId, ' - Action: ', apiEvent.action);
|
|
26
|
+
const key = `${evName}_${resourceId}`;
|
|
27
|
+
const appData = { ...app.data, ...app.hidden_data };
|
|
28
|
+
if (
|
|
29
|
+
Array.isArray(appData.ignore_events)
|
|
30
|
+
&& appData.ignore_events.includes(evName)
|
|
31
|
+
) {
|
|
32
|
+
logger.info('>> ', key, ' - Ignored event');
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
logger.info(`> Webhook ${resourceId} [${evName}]`);
|
|
36
|
+
|
|
37
|
+
const order = apiDoc as Orders;
|
|
38
|
+
if (order.status === 'cancelled') {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const orderId = order._id;
|
|
42
|
+
|
|
43
|
+
let eventID: undefined | string;
|
|
44
|
+
let clientUserAgent: undefined | string;
|
|
45
|
+
if (order.metafields) {
|
|
46
|
+
const metafield = order.metafields.find(({ namespace, field }) => {
|
|
47
|
+
return namespace === 'fb' && field === 'pixel';
|
|
48
|
+
});
|
|
49
|
+
if (metafield) {
|
|
50
|
+
const { value } = metafield;
|
|
51
|
+
eventID = value.eventID as string;
|
|
52
|
+
clientUserAgent = value.userAgent as string;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (!clientUserAgent) {
|
|
56
|
+
clientUserAgent = order.client_user_agent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
const buyer = order.buyers && order.buyers[0];
|
|
61
|
+
const clientIp = order.client_ip;
|
|
62
|
+
if (orderId && buyer && clientIp) {
|
|
63
|
+
// https://developers.facebook.com/docs/marketing-api/conversions-api/using-the-api#send
|
|
64
|
+
const fbPixelId = appData.fb_pixel_id;
|
|
65
|
+
const fbGraphToken = appData.fb_graph_token;
|
|
66
|
+
|
|
67
|
+
if (fbPixelId && fbGraphToken) {
|
|
68
|
+
FacebookAdsApi.init(fbGraphToken);
|
|
69
|
+
|
|
70
|
+
const userData = new UserData();
|
|
71
|
+
userData.setExternalId(buyer._id);
|
|
72
|
+
const emails: string[] = [];
|
|
73
|
+
buyer.emails?.forEach((email) => {
|
|
74
|
+
emails.push(email.address);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (buyer.main_email) {
|
|
78
|
+
emails.push(buyer.main_email);
|
|
79
|
+
}
|
|
80
|
+
if (emails.length) {
|
|
81
|
+
userData.setEmails(emails);
|
|
82
|
+
}
|
|
83
|
+
if (buyer.phones && buyer.phones.length) {
|
|
84
|
+
userData.setPhones(buyer.phones.map(({ number }) => String(number)));
|
|
85
|
+
}
|
|
86
|
+
if (buyer.name && buyer.name.given_name) {
|
|
87
|
+
userData.setFirstName(buyer.name.given_name);
|
|
88
|
+
if (buyer.name.family_name) {
|
|
89
|
+
userData.setLastName(buyer.name.family_name);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (buyer.pronoun === 'she' || buyer.pronoun === 'he') {
|
|
93
|
+
userData.setGender(buyer.pronoun === 'she' ? 'f' : 'm');
|
|
94
|
+
}
|
|
95
|
+
userData.setClientIpAddress(clientIp);
|
|
96
|
+
if (clientUserAgent) {
|
|
97
|
+
userData.setClientUserAgent(clientUserAgent);
|
|
98
|
+
}
|
|
99
|
+
const shippingLine = order.shipping_lines && order.shipping_lines[0];
|
|
100
|
+
if (shippingLine && shippingLine.to.zip) {
|
|
101
|
+
userData.setZip(shippingLine.to.zip.replace(/\D/g, ''));
|
|
102
|
+
if (shippingLine.to.province_code) {
|
|
103
|
+
userData.setState(shippingLine.to.province_code.toLowerCase());
|
|
104
|
+
userData.setCountry((shippingLine.to.country_code || 'BR').toLowerCase());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const contents: any[] = [];
|
|
109
|
+
const { items } = order;
|
|
110
|
+
if (items && items.length) {
|
|
111
|
+
items.forEach((item) => {
|
|
112
|
+
if (item.quantity > 0) {
|
|
113
|
+
const content = (new Content())
|
|
114
|
+
.setId(item.sku || item.product_id)
|
|
115
|
+
.setQuantity(item.quantity)
|
|
116
|
+
.setDeliveryCategory(DeliveryCategory.HOME_DELIVERY);
|
|
117
|
+
if (item.name) {
|
|
118
|
+
content.setTitle(item.name);
|
|
119
|
+
}
|
|
120
|
+
contents.push(content);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const customData = (new CustomData())
|
|
125
|
+
.setContents(contents)
|
|
126
|
+
.setCurrency((order.currency_id && order.currency_id.toLowerCase()) || 'brl')
|
|
127
|
+
.setValue(Math.round(order.amount.total * 100) / 100);
|
|
128
|
+
|
|
129
|
+
const eventMs = Math.min(
|
|
130
|
+
new Date(order.created_at || apiEvent.timestamp).getTime(),
|
|
131
|
+
Date.now() - 3000,
|
|
132
|
+
);
|
|
133
|
+
logger.log(`>> (App fb-conversions): #${orderId} (${eventID}) at ${eventMs}ms`);
|
|
134
|
+
|
|
135
|
+
const serverEvent = (new ServerEvent())
|
|
136
|
+
.setEventName('Purchase')
|
|
137
|
+
.setEventTime(Math.round(eventMs / 1000))
|
|
138
|
+
.setUserData(userData)
|
|
139
|
+
.setCustomData(customData)
|
|
140
|
+
.setActionSource('website');
|
|
141
|
+
|
|
142
|
+
if (order.checkout_link) {
|
|
143
|
+
serverEvent.setEventSourceUrl(order.checkout_link);
|
|
144
|
+
} else if (order.domain) {
|
|
145
|
+
serverEvent.setEventSourceUrl(`https://${order.domain}`);
|
|
146
|
+
}
|
|
147
|
+
serverEvent.setEventId(eventID || orderId);
|
|
148
|
+
|
|
149
|
+
const eventsData = [serverEvent];
|
|
150
|
+
const eventRequest = (new EventRequest(fbGraphToken, fbPixelId))
|
|
151
|
+
.setEvents(eventsData);
|
|
152
|
+
|
|
153
|
+
try {
|
|
154
|
+
const response = await eventRequest.execute();
|
|
155
|
+
logger.info('>> (App fb-conversions): ', response);
|
|
156
|
+
return null;
|
|
157
|
+
} catch (err: any) {
|
|
158
|
+
logger.error(`(App fb-conversions): event request error: ${err.message} =>`, err);
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
logger.warn('>> (App fb-conversions): PixelId or fbToken not found');
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
logger.warn('>> (App fb-conversions): orderId , buyer or clientIp not found');
|
|
166
|
+
return null;
|
|
167
|
+
} catch (err: any) {
|
|
168
|
+
logger.error(`>> (App fb-conversions) Error ${err.message} =>`, err);
|
|
169
|
+
throw err;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const fbconversions = {
|
|
174
|
+
onStoreEvent: createAppEventsFunction(
|
|
175
|
+
'fbConversions',
|
|
176
|
+
handleApiEvent,
|
|
177
|
+
) as any,
|
|
178
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fb-conversions-events';
|
|
@@ -18,4 +18,6 @@ export * from '@cloudcommerce/app-galaxpay/events';
|
|
|
18
18
|
export * from '@cloudcommerce/app-loyalty-points/events';
|
|
19
19
|
|
|
20
20
|
export * from '@cloudcommerce/app-frenet/events';
|
|
21
|
+
|
|
22
|
+
export * from '@cloudcommerce/app-fb-conversions';
|
|
21
23
|
// # sourceMappingURL=firebase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,OAAO,kCAAkC,CAAC;AAE1C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,wCAAwC,CAAC;AAEvD,cAAc,2BAA2B,CAAC;AAE1C,cAAc,oCAAoC,CAAC;AAEnD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,wCAAwC,CAAC;AAEvD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,0CAA0C,CAAC;AAEzD,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,OAAO,kCAAkC,CAAC;AAE1C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,wCAAwC,CAAC;AAEvD,cAAc,2BAA2B,CAAC;AAE1C,cAAc,oCAAoC,CAAC;AAEnD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,wCAAwC,CAAC;AAEvD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,0CAA0C,CAAC;AAEzD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,mCAAmC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/events",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app events",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/app-emails": "workspace:*",
|
|
28
|
+
"@cloudcommerce/app-fb-conversions": "workspace:*",
|
|
28
29
|
"@cloudcommerce/app-frenet": "workspace:*",
|
|
29
30
|
"@cloudcommerce/app-galaxpay": "workspace:*",
|
|
30
31
|
"@cloudcommerce/app-infinitepay": "workspace:*",
|
|
@@ -22,6 +22,9 @@ const loyaltyPointsEvents = [
|
|
|
22
22
|
const frenetEvents = [
|
|
23
23
|
'orders-new',
|
|
24
24
|
];
|
|
25
|
+
const fbConversionsEvents = [
|
|
26
|
+
'orders-new',
|
|
27
|
+
];
|
|
25
28
|
const {
|
|
26
29
|
SETTINGS_FILEPATH, DEPLOY_REGION, SSR_DEPLOY_REGION, SSR_DEPLOY_MEMORY, SSR_DEPLOY_TIMEOUT_SECONDS, SSR_DEPLOY_MIN_INSTANCES,
|
|
27
30
|
} = process.env;
|
|
@@ -91,6 +94,10 @@ const mergeConfig = {
|
|
|
91
94
|
appId: 124890,
|
|
92
95
|
events: loyaltyPointsEvents,
|
|
93
96
|
},
|
|
97
|
+
fbConversions: {
|
|
98
|
+
appId: 131670,
|
|
99
|
+
events: fbConversionsEvents,
|
|
100
|
+
},
|
|
94
101
|
},
|
|
95
102
|
cmsSettings,
|
|
96
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,MAAsB,MAAM,uBAAuB,CAAC;AAE3D,MAAM,aAAa,GAAmB;IACp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,CAAC;KAC9E;IACD,IAAI,EAAE;QACJ,SAAS,EAAE;YACT,KAAK,EAAE,IAAI;SACZ;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,IAAI;SACZ;QACD,cAAc,EAAE;YACd,KAAK,EAAE,IAAI;SACZ;QACD,MAAM,EAAE;YACN,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,YAAY;SACrB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,aAAa;SACtB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,YAAY;SACrB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;SACd;QACD,GAAG,EAAE;YACH,KAAK,EAAE,MAAM;SACd;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,KAAK,EAAE,MAAM;SACd;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,cAAc;SACvB;QACD,aAAa,EAAE;YACb,KAAK,EAAE,MAAM;SACd;QACD,aAAa,EAAE;YACb,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,mBAAmB;SAC5B;KACF;IACD,WAAW;CACZ,CAAC;AACF,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAExB,eAAe,MAId,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,MAAsB,MAAM,uBAAuB,CAAC;AAE3D,MAAM,aAAa,GAAmB;IACpC,qBAAqB;IACrB,cAAc;IACd,mBAAmB;IACnB,sBAAsB;CACvB,CAAC;AAEF,MAAM,YAAY,GAAmB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,SAAS,EAAE;YACT,KAAK,EAAE,IAAI;SACZ;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,IAAI;SACZ;QACD,cAAc,EAAE;YACd,KAAK,EAAE,IAAI;SACZ;QACD,MAAM,EAAE;YACN,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,YAAY;SACrB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,aAAa;SACtB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,YAAY;SACrB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;SACd;QACD,GAAG,EAAE;YACH,KAAK,EAAE,MAAM;SACd;QACD,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,KAAK,EAAE,MAAM;SACd;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,cAAc;SACvB;QACD,aAAa,EAAE;YACb,KAAK,EAAE,MAAM;SACd;QACD,aAAa,EAAE;YACb,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,mBAAmB;SAC5B;QACD,aAAa,EAAE;YACb,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,mBAAmB;SAC5B;KACF;IACD,WAAW;CACZ,CAAC;AACF,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAExB,eAAe,MAId,CAAC"}
|
|
@@ -27,6 +27,9 @@ const loyaltyPointsEvents: ApiEventName[] = [
|
|
|
27
27
|
const frenetEvents: ApiEventName[] = [
|
|
28
28
|
'orders-new',
|
|
29
29
|
];
|
|
30
|
+
const fbConversionsEvents: ApiEventName[] = [
|
|
31
|
+
'orders-new',
|
|
32
|
+
];
|
|
30
33
|
|
|
31
34
|
const {
|
|
32
35
|
SETTINGS_FILEPATH,
|
|
@@ -104,6 +107,10 @@ const mergeConfig = {
|
|
|
104
107
|
appId: 124890,
|
|
105
108
|
events: loyaltyPointsEvents,
|
|
106
109
|
},
|
|
110
|
+
fbConversions: {
|
|
111
|
+
appId: 131670,
|
|
112
|
+
events: fbConversionsEvents,
|
|
113
|
+
},
|
|
107
114
|
},
|
|
108
115
|
cmsSettings,
|
|
109
116
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
"firebase-admin": "^11.4.1",
|
|
36
36
|
"firebase-functions": "^4.1.1",
|
|
37
37
|
"image-size": "^1.0.2",
|
|
38
|
+
"semver": "^7.3.8",
|
|
39
|
+
"sharp": "^0.31.3",
|
|
38
40
|
"vue": "^3.2.45"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
@@ -150,7 +150,9 @@ const genAstroConfig = ({
|
|
|
150
150
|
}),
|
|
151
151
|
outDir: isSSG ? './dist/client' : './dist',
|
|
152
152
|
integrations: [
|
|
153
|
-
image(
|
|
153
|
+
image({
|
|
154
|
+
serviceEntryPoint: '@astrojs/image/sharp',
|
|
155
|
+
}),
|
|
154
156
|
vue({ appEntrypoint: '/src/pages/_vue' }),
|
|
155
157
|
partytown(),
|
|
156
158
|
prefetch(),
|