ts-glitter 19.2.2 → 19.2.4
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/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/shopping-information.js +136 -30
- package/lowcode/cms-plugin/shopping-information.ts +149 -29
- package/lowcode/css/editor.css +1 -1
- package/lowcode/jspage/main.js +1 -1
- package/lowcode/jspage/main.ts +1 -1
- package/lowcode/public-components/checkout/index.js +209 -196
- package/lowcode/public-components/checkout/index.ts +235 -223
- package/package.json +1 -1
- package/src/api-public/controllers/delivery.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/services/ai-robot.d.ts +0 -1
- package/src/api-public/services/fb-api.d.ts +0 -1
- package/src/api-public/services/fb-message.d.ts +0 -1
- package/src/api-public/services/financial-service.d.ts +1 -1
- package/src/api-public/services/financial-service.js +22 -11
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +30 -15
- package/src/api-public/services/invoice.js.map +1 -1
- package/src/api-public/services/line-message.d.ts +0 -1
- package/src/api-public/services/public-table-check.d.ts +7 -0
- package/src/api-public/services/public-table-check.js +10 -1
- package/src/api-public/services/public-table-check.js.map +1 -5
- package/src/api-public/services/public-table-check.ts +13 -2
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/share-permission.d.ts +1 -1
- package/src/api-public/services/shopee.d.ts +0 -1
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +1 -0
- package/src/helper/glitter-util.d.ts +3 -2
- package/src/helper/glitter-util.js +5 -0
- package/src/helper/glitter-util.js.map +1 -1
- package/src/helper/glitter-util.ts +6 -2
- package/src/index.js +146 -98
- package/src/index.js.map +1 -1
- package/src/index.ts +763 -685
- package/src/services/app.js.map +1 -1
|
@@ -2762,6 +2762,7 @@ export class Shopping {
|
|
|
2762
2762
|
})
|
|
2763
2763
|
);
|
|
2764
2764
|
checkPoint('select linepay');
|
|
2765
|
+
|
|
2765
2766
|
return await new LinePay(this.app, kd).createOrder(carData);
|
|
2766
2767
|
case 'paynow': {
|
|
2767
2768
|
kd.ReturnURL = `${process.env.DOMAIN}/api-public/v1/ec/redirect?g-app=${this.app}&return=${id}&type=${carData.customer_info.payment_select}`;
|
|
@@ -12,8 +12,9 @@ export declare class GlitterUtil {
|
|
|
12
12
|
path: string;
|
|
13
13
|
root_path: string;
|
|
14
14
|
seoManager: (req: express.Request, resp: express.Response) => Promise<{
|
|
15
|
-
head
|
|
16
|
-
body
|
|
15
|
+
head?: string;
|
|
16
|
+
body?: string;
|
|
17
|
+
redirect?: string;
|
|
17
18
|
}>;
|
|
18
19
|
sitemap: (req: express.Request, resp: express.Response) => Promise<string>;
|
|
19
20
|
sitemap_list: (req: express.Request, resp: express.Response) => Promise<string>;
|
|
@@ -58,6 +58,11 @@ class GlitterUtil {
|
|
|
58
58
|
req.query.page = req.baseUrl.replace(dd.root_path, '');
|
|
59
59
|
}
|
|
60
60
|
const seo = await dd.seoManager(req, resp);
|
|
61
|
+
if (seo.redirect) {
|
|
62
|
+
console.log(`seo.redirect,`, seo.redirect);
|
|
63
|
+
resp.redirect(301, seo.redirect);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
61
66
|
let fullPath = dd.path + "/index.html";
|
|
62
67
|
const data = fs_1.default.readFileSync(fullPath, 'utf8');
|
|
63
68
|
resp.header('Content-Type', 'text/html; charset=UTF-8');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glitter-util.js","sourceRoot":"","sources":["glitter-util.ts"],"names":[],"mappings":";;;;;;AACA,4CAAoB;AAGpB,MAAa,WAAW;IACb,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAqB,EAAE,IAAqH;QACzK,KAAK,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,EA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AAC;IACL,CAAC;CAEJ;AA1FD,kCA0FC"}
|
|
@@ -23,7 +23,7 @@ export class GlitterUtil {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
public static async set_frontend_v2(express: core.Express, rout: { app_name: string, rout: string, path: string, root_path: string, seoManager: (req: express.Request, resp: express.Response) => Promise<{head
|
|
26
|
+
public static async set_frontend_v2(express: core.Express, rout: { app_name: string, rout: string, path: string, root_path: string, seoManager: (req: express.Request, resp: express.Response) => Promise<{head?:string,body?:string,redirect?:string}>, sitemap: (req: express.Request, resp: express.Response) => Promise<string> ,
|
|
27
27
|
sitemap_list: (req: express.Request, resp: express.Response) => Promise<string>
|
|
28
28
|
robots:(req: express.Request, resp: express.Response) => Promise<string>,
|
|
29
29
|
tw_shop:(req: express.Request, resp: express.Response) => Promise<string>
|
|
@@ -56,6 +56,10 @@ export class GlitterUtil {
|
|
|
56
56
|
req.query.page = req.baseUrl.replace(dd.root_path, '');
|
|
57
57
|
}
|
|
58
58
|
const seo = await dd.seoManager(req, resp)
|
|
59
|
+
if(seo.redirect){
|
|
60
|
+
resp.redirect(301, seo.redirect);
|
|
61
|
+
return
|
|
62
|
+
}
|
|
59
63
|
let fullPath = dd.path + "/index.html"
|
|
60
64
|
const data = fs.readFileSync(fullPath, 'utf8');
|
|
61
65
|
resp.header('Content-Type', 'text/html; charset=UTF-8')
|
|
@@ -71,7 +75,7 @@ export class GlitterUtil {
|
|
|
71
75
|
(req.body) ? `<script>window.post_body=${(typeof req.body==='string') ? req.body:`${JSON.stringify(req.body)}`};</script>`:``,
|
|
72
76
|
`</head>`,
|
|
73
77
|
seo.body,
|
|
74
|
-
].map((dd)=>{
|
|
78
|
+
].map((dd:any)=>{
|
|
75
79
|
return dd.trim()
|
|
76
80
|
});
|
|
77
81
|
try {
|
package/src/index.js
CHANGED
|
@@ -26,7 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.app = void 0;
|
|
30
|
+
exports.initial = initial;
|
|
31
|
+
exports.createAPP = createAPP;
|
|
30
32
|
const path_1 = __importDefault(require("path"));
|
|
31
33
|
const express_1 = __importDefault(require("express"));
|
|
32
34
|
const cors_1 = __importDefault(require("cors"));
|
|
@@ -120,7 +122,6 @@ async function initial(serverPort) {
|
|
|
120
122
|
console.log('Starting up the server now.');
|
|
121
123
|
})();
|
|
122
124
|
}
|
|
123
|
-
exports.initial = initial;
|
|
124
125
|
function createContext(req, res, next) {
|
|
125
126
|
const uuid = (0, uuid_1.v4)();
|
|
126
127
|
const ip = req.ip;
|
|
@@ -130,8 +131,8 @@ function createContext(req, res, next) {
|
|
|
130
131
|
}
|
|
131
132
|
async function createAppRoute() {
|
|
132
133
|
const apps = await database_2.default.execute(`SELECT appName
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
FROM \`${config_1.saasConfig.SAAS_NAME}\`.app_config;
|
|
135
|
+
`, []);
|
|
135
136
|
for (const dd of apps) {
|
|
136
137
|
await createAPP(dd);
|
|
137
138
|
}
|
|
@@ -142,7 +143,7 @@ async function createAPP(dd) {
|
|
|
142
143
|
live_source_1.Live_source.liveAPP.push(dd.appName);
|
|
143
144
|
schedule_js_1.Schedule.app.push(dd.appName);
|
|
144
145
|
const file_path = path_1.default.resolve(__dirname, '../lowcode');
|
|
145
|
-
return await glitter_util_js_1.GlitterUtil.set_frontend_v2(exports.app, ['/' + encodeURI(dd.appName) + '/*', '/' + encodeURI(dd.appName)].map(
|
|
146
|
+
return await glitter_util_js_1.GlitterUtil.set_frontend_v2(exports.app, ['/' + encodeURI(dd.appName) + '/*', '/' + encodeURI(dd.appName)].map(rout => {
|
|
146
147
|
return {
|
|
147
148
|
rout: rout,
|
|
148
149
|
path: file_path,
|
|
@@ -151,7 +152,6 @@ async function createAPP(dd) {
|
|
|
151
152
|
seoManager: async (req) => {
|
|
152
153
|
var _a, _b, _c, _d, _e, _f;
|
|
153
154
|
const og_url = req.headers['x-original-url'];
|
|
154
|
-
const custom_heads = [];
|
|
155
155
|
console.log(`req.query.page=>`, req.query.page);
|
|
156
156
|
try {
|
|
157
157
|
if (req.query.state === 'google_login') {
|
|
@@ -162,7 +162,9 @@ async function createAPP(dd) {
|
|
|
162
162
|
appName = req.query.appName;
|
|
163
163
|
}
|
|
164
164
|
else if (og_url) {
|
|
165
|
-
const new_app = (await database_2.default.query(`SELECT *
|
|
165
|
+
const new_app = (await database_2.default.query(`SELECT *
|
|
166
|
+
FROM \`${config_1.saasConfig.SAAS_NAME}\`.app_config
|
|
167
|
+
where LOWER(domain) = ?`, [og_url]))[0];
|
|
166
168
|
if (new_app && new_app.appName) {
|
|
167
169
|
appName = new_app && new_app.appName;
|
|
168
170
|
}
|
|
@@ -176,8 +178,22 @@ async function createAPP(dd) {
|
|
|
176
178
|
req.headers['g-app'] = appName;
|
|
177
179
|
const start = new Date().getTime();
|
|
178
180
|
console.log(`getPageInfo==>`, (new Date().getTime() - start) / 1000);
|
|
181
|
+
await public_table_check_js_1.ApiPublic.createScheme(appName);
|
|
182
|
+
const find_app = public_table_check_js_1.ApiPublic.app301.find(dd => {
|
|
183
|
+
return dd.app_name === appName;
|
|
184
|
+
});
|
|
185
|
+
if (find_app) {
|
|
186
|
+
const router = find_app.router.find(dd => {
|
|
187
|
+
return dd.legacy_url === req.query.page;
|
|
188
|
+
});
|
|
189
|
+
if (router) {
|
|
190
|
+
return {
|
|
191
|
+
redirect: `https://${(await app_js_1.App.checkBrandAndMemberType(appName)).domain}/${router.new_url}`,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
179
195
|
let seo_content = [];
|
|
180
|
-
let [customCode, FBCode, store_info, language_label, check_schema, brandAndMemberType, login_config, ip_country] = await Promise.all([
|
|
196
|
+
let [customCode, FBCode, store_info, language_label, check_schema, brandAndMemberType, login_config, ip_country,] = await Promise.all([
|
|
181
197
|
new user_js_1.User(appName).getConfigV2({
|
|
182
198
|
key: 'ga4_config',
|
|
183
199
|
user_id: 'manager',
|
|
@@ -223,7 +239,7 @@ async function createAPP(dd) {
|
|
|
223
239
|
page: req.query.page,
|
|
224
240
|
});
|
|
225
241
|
}
|
|
226
|
-
else if (`${req.query.page}` ===
|
|
242
|
+
else if (`${req.query.page}` === 'blogs') {
|
|
227
243
|
const seo = await new user_js_1.User(req.get('g-app'), req.body.token).getConfigV2({
|
|
228
244
|
key: 'article_seo_data_' + language,
|
|
229
245
|
user_id: 'manager',
|
|
@@ -255,18 +271,20 @@ async function createAPP(dd) {
|
|
|
255
271
|
else if (['privacy', 'term', 'refund', 'delivery'].includes(`${req.query.page}`)) {
|
|
256
272
|
data.page_config.seo = {
|
|
257
273
|
title: Language_js_1.Language.text(`${req.query.page}`, language),
|
|
258
|
-
content: Language_js_1.Language.text(`${req.query.page}`, language)
|
|
274
|
+
content: Language_js_1.Language.text(`${req.query.page}`, language),
|
|
259
275
|
};
|
|
260
276
|
}
|
|
261
277
|
else if (d.type !== 'custom') {
|
|
262
278
|
data = home_page_data;
|
|
263
279
|
}
|
|
264
|
-
const preload = req.query.isIframe === 'true'
|
|
280
|
+
const preload = req.query.isIframe === 'true'
|
|
281
|
+
? {}
|
|
282
|
+
: await app_js_1.App.preloadPageData(appName, req.query.page, language);
|
|
265
283
|
data.page_config = (_c = data.page_config) !== null && _c !== void 0 ? _c : {};
|
|
266
284
|
data.page_config.seo = (_d = data.page_config.seo) !== null && _d !== void 0 ? _d : {};
|
|
267
285
|
const seo_detail = await getSeoDetail(appName, req);
|
|
268
286
|
if (seo_detail) {
|
|
269
|
-
Object.keys(seo_detail).map(
|
|
287
|
+
Object.keys(seo_detail).map(dd => {
|
|
270
288
|
data.page_config.seo[dd] = seo_detail[dd];
|
|
271
289
|
});
|
|
272
290
|
}
|
|
@@ -289,7 +307,8 @@ async function createAPP(dd) {
|
|
|
289
307
|
localStorage.setItem('distributionCode','');
|
|
290
308
|
`;
|
|
291
309
|
}
|
|
292
|
-
if (req.query.page.split('/')[0] === 'distribution' &&
|
|
310
|
+
if (req.query.page.split('/')[0] === 'distribution' &&
|
|
311
|
+
req.query.page.split('/')[1]) {
|
|
293
312
|
distribution_code = await seo_config_js_1.SeoConfig.distributionSEO({
|
|
294
313
|
appName: appName,
|
|
295
314
|
url: req.url,
|
|
@@ -299,7 +318,8 @@ async function createAPP(dd) {
|
|
|
299
318
|
language,
|
|
300
319
|
});
|
|
301
320
|
}
|
|
302
|
-
if (req.query.page.split('/')[0] === 'collections' &&
|
|
321
|
+
if (req.query.page.split('/')[0] === 'collections' &&
|
|
322
|
+
req.query.page.split('/')[1]) {
|
|
303
323
|
await seo_config_js_1.SeoConfig.collectionSeo({ appName, language, data, page: req.query.page });
|
|
304
324
|
}
|
|
305
325
|
if (FBCode) {
|
|
@@ -311,20 +331,19 @@ async function createAPP(dd) {
|
|
|
311
331
|
var _a;
|
|
312
332
|
const d = data.page_config.seo;
|
|
313
333
|
return html `
|
|
314
|
-
|
|
334
|
+
${(() => {
|
|
315
335
|
var _a, _b, _c;
|
|
316
336
|
if (req.query.type === 'editor') {
|
|
317
337
|
return seo_config_js_1.SeoConfig.editorSeo;
|
|
318
338
|
}
|
|
319
339
|
else {
|
|
320
|
-
return html `<title
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
href="${(() => {
|
|
340
|
+
return html `<title>
|
|
341
|
+
${[home_seo.title_prefix || '', d.title || '', home_seo.title_suffix || ''].join('') ||
|
|
342
|
+
'尚未設定標題'}
|
|
343
|
+
</title>
|
|
344
|
+
<link
|
|
345
|
+
rel="canonical"
|
|
346
|
+
href="${(() => {
|
|
328
347
|
if (data.tag === 'index') {
|
|
329
348
|
return `https://${brandAndMemberType.domain}`;
|
|
330
349
|
}
|
|
@@ -332,28 +351,43 @@ async function createAPP(dd) {
|
|
|
332
351
|
return `https://${brandAndMemberType.domain}/${data.tag}`;
|
|
333
352
|
}
|
|
334
353
|
})()}"
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
354
|
+
/>
|
|
355
|
+
${data.tag !== req.query.page || req.query.page === 'index-mobile'
|
|
356
|
+
? `<meta name="robots" content="noindex">`
|
|
357
|
+
: `<meta name="robots" content="index, follow"/>`}
|
|
358
|
+
<meta name="keywords" content="${(d.keywords || '尚未設定關鍵字').replace(/"/g, '"')}" />
|
|
359
|
+
<link
|
|
360
|
+
id="appImage"
|
|
361
|
+
rel="shortcut icon"
|
|
362
|
+
href="${d.logo || home_seo.logo || ''}"
|
|
363
|
+
type="image/x-icon"
|
|
364
|
+
/>
|
|
365
|
+
<link rel="icon" href="${d.logo || home_seo.logo || ''}" type="image/png" sizes="128x128" />
|
|
366
|
+
<meta property="og:image" content="${d.image || home_seo.image || ''}" />
|
|
367
|
+
<meta
|
|
368
|
+
property="og:title"
|
|
369
|
+
content="${((_a = d.title) !== null && _a !== void 0 ? _a : '').replace(/\n/g, '').replace(/"/g, '"')}"
|
|
370
|
+
/>
|
|
371
|
+
<meta
|
|
372
|
+
name="description"
|
|
373
|
+
content="${((_b = d.content) !== null && _b !== void 0 ? _b : '').replace(/\n/g, '').replace(/"/g, '"')}"
|
|
374
|
+
/>
|
|
375
|
+
<meta
|
|
376
|
+
name="og:description"
|
|
377
|
+
content="${((_c = d.content) !== null && _c !== void 0 ? _c : '').replace(/\n/g, '').replace(/"/g, '"')}"
|
|
378
|
+
/>
|
|
379
|
+
|
|
380
|
+
${[{ src: 'css/front-end.css', type: 'text/css' }]
|
|
381
|
+
.map(dd => {
|
|
382
|
+
return html `
|
|
383
|
+
<link href="/${link_prefix && `${link_prefix}/`}${dd.src}" type="${dd.type}"
|
|
384
|
+
rel="stylesheet"></link>`;
|
|
350
385
|
})
|
|
351
|
-
.join('')}
|
|
352
|
-
`;
|
|
386
|
+
.join('')} `;
|
|
353
387
|
}
|
|
354
388
|
})()}
|
|
355
|
-
|
|
356
|
-
|
|
389
|
+
${(_a = d.code) !== null && _a !== void 0 ? _a : ''}
|
|
390
|
+
${(() => {
|
|
357
391
|
var _a;
|
|
358
392
|
if (req.query.type === 'editor') {
|
|
359
393
|
return ``;
|
|
@@ -364,12 +398,12 @@ async function createAPP(dd) {
|
|
|
364
398
|
try {
|
|
365
399
|
if (dd.data.elem === 'link') {
|
|
366
400
|
return html ` <link
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
401
|
+
type="text/css"
|
|
402
|
+
rel="stylesheet"
|
|
403
|
+
href="${dd.data.attr.find((dd) => {
|
|
370
404
|
return dd.attr === 'href';
|
|
371
405
|
}).value}"
|
|
372
|
-
|
|
406
|
+
/>`;
|
|
373
407
|
}
|
|
374
408
|
}
|
|
375
409
|
catch (e) {
|
|
@@ -379,7 +413,7 @@ async function createAPP(dd) {
|
|
|
379
413
|
.join('')}`;
|
|
380
414
|
}
|
|
381
415
|
})()}
|
|
382
|
-
|
|
416
|
+
`;
|
|
383
417
|
})(),
|
|
384
418
|
`<script>
|
|
385
419
|
${[
|
|
@@ -400,13 +434,14 @@ async function createAPP(dd) {
|
|
|
400
434
|
`window.ip_country = '${ip_country.country || 'TW'}';`,
|
|
401
435
|
`window.currency_covert = ${JSON.stringify(await shopping_js_1.Shopping.currencyCovert((req.query.base || 'TWD')))};`,
|
|
402
436
|
`window.language_list = ${JSON.stringify(language_label.label)};`,
|
|
403
|
-
`window.home_seo=${JSON.stringify(home_seo)
|
|
404
|
-
.replace(
|
|
437
|
+
`window.home_seo=${JSON.stringify(home_seo)
|
|
438
|
+
.replace(/<\/script>/g, 'sdjuescript_prepand')
|
|
439
|
+
.replace(/<script>/g, 'sdjuescript_prefix')};`,
|
|
405
440
|
]
|
|
406
|
-
.map(
|
|
441
|
+
.map(dd => {
|
|
407
442
|
return (dd || '').trim();
|
|
408
443
|
})
|
|
409
|
-
.filter(
|
|
444
|
+
.filter(dd => {
|
|
410
445
|
return dd;
|
|
411
446
|
})
|
|
412
447
|
.join(';\n')}
|
|
@@ -418,8 +453,11 @@ async function createAPP(dd) {
|
|
|
418
453
|
{ src: 'glitterBundle/plugins/trigger-event.js', type: 'module' },
|
|
419
454
|
{ src: 'api/pageConfig.js', type: 'module' },
|
|
420
455
|
]
|
|
421
|
-
.map(
|
|
422
|
-
return html ` <script
|
|
456
|
+
.map(dd => {
|
|
457
|
+
return html ` <script
|
|
458
|
+
src="/${link_prefix && `${link_prefix}/`}${dd.src}"
|
|
459
|
+
type="${dd.type}"
|
|
460
|
+
></script>`;
|
|
423
461
|
})
|
|
424
462
|
.join('')}
|
|
425
463
|
${((_f = preload.event) !== null && _f !== void 0 ? _f : [])
|
|
@@ -438,15 +476,15 @@ async function createAPP(dd) {
|
|
|
438
476
|
}
|
|
439
477
|
else {
|
|
440
478
|
return html `
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
.map(
|
|
479
|
+
${seo_config_js_1.SeoConfig.gA4(customCode.ga4)} ${seo_config_js_1.SeoConfig.gTag(customCode.g_tag)}
|
|
480
|
+
${seo_content
|
|
481
|
+
.map(dd => {
|
|
444
482
|
return dd.trim();
|
|
445
483
|
})
|
|
446
484
|
.join('\n')}
|
|
447
|
-
|
|
485
|
+
`;
|
|
448
486
|
}
|
|
449
|
-
})()}
|
|
487
|
+
})()}`,
|
|
450
488
|
].join('');
|
|
451
489
|
return {
|
|
452
490
|
head: head,
|
|
@@ -480,12 +518,12 @@ async function createAPP(dd) {
|
|
|
480
518
|
limit: 10000,
|
|
481
519
|
});
|
|
482
520
|
const domain = (await database_2.default.query(`select \`domain\`
|
|
483
|
-
|
|
484
|
-
|
|
521
|
+
from \`${config_1.saasConfig.SAAS_NAME}\`.app_config
|
|
522
|
+
where appName = ?`, [appName]))[0]['domain'];
|
|
485
523
|
const site_map = await getSeoSiteMap(appName, req);
|
|
486
524
|
const cols = (_a = (await database_2.default.query(`SELECT *
|
|
487
|
-
|
|
488
|
-
|
|
525
|
+
FROM \`${appName}\`.public_config
|
|
526
|
+
WHERE \`key\` = 'collection';`, []))[0]) !== null && _a !== void 0 ? _a : {};
|
|
489
527
|
const language_setting = (await new user_js_1.User(appName).getConfigV2({
|
|
490
528
|
key: 'store-information',
|
|
491
529
|
user_id: 'manager',
|
|
@@ -512,10 +550,10 @@ async function createAPP(dd) {
|
|
|
512
550
|
const stream = new sitemap_1.SitemapStream({ hostname: `https://${domain}` });
|
|
513
551
|
const xml = await (0, sitemap_1.streamToPromise)(stream_1.Readable.from([
|
|
514
552
|
...(await database_2.default.query(`select page_config, tag, updated_time
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
553
|
+
from \`${config_1.saasConfig.SAAS_NAME}\`.page_config
|
|
554
|
+
where appName = ?
|
|
555
|
+
and page_config ->>'$.seo.type'='custom'
|
|
556
|
+
`, [appName])).map((d2) => {
|
|
519
557
|
if (d2.tag === 'index') {
|
|
520
558
|
return { url: `https://${domain}`, changefreq: 'weekly' };
|
|
521
559
|
}
|
|
@@ -541,7 +579,12 @@ async function createAPP(dd) {
|
|
|
541
579
|
let array = [];
|
|
542
580
|
(0, seo_config_js_1.extractCols)(cols).map((item) => {
|
|
543
581
|
array = array.concat(language_setting.support.map((d1) => {
|
|
544
|
-
const seo = (item.language_data &&
|
|
582
|
+
const seo = (item.language_data &&
|
|
583
|
+
item.language_data[d1] &&
|
|
584
|
+
item.language_data[d1].seo &&
|
|
585
|
+
item.language_data[d1].seo.domain) ||
|
|
586
|
+
item.code ||
|
|
587
|
+
item.title;
|
|
545
588
|
if (d1 === language_setting.def) {
|
|
546
589
|
return { url: `https://${domain}/collections/${seo}`, changefreq: 'weekly' };
|
|
547
590
|
}
|
|
@@ -566,7 +609,11 @@ async function createAPP(dd) {
|
|
|
566
609
|
product.map((dd) => {
|
|
567
610
|
dd = dd.content;
|
|
568
611
|
array = array.concat(language_setting.support.map((d1) => {
|
|
569
|
-
const seo = (dd.language_data &&
|
|
612
|
+
const seo = (dd.language_data &&
|
|
613
|
+
dd.language_data[d1] &&
|
|
614
|
+
dd.language_data[d1].seo &&
|
|
615
|
+
dd.language_data[d1].seo.domain) ||
|
|
616
|
+
dd.seo.domain;
|
|
570
617
|
if (d1 === language_setting.def) {
|
|
571
618
|
return { url: `https://${domain}/products/${seo}`, changefreq: 'weekly' };
|
|
572
619
|
}
|
|
@@ -586,11 +633,11 @@ async function createAPP(dd) {
|
|
|
586
633
|
});
|
|
587
634
|
return array;
|
|
588
635
|
})(),
|
|
589
|
-
]
|
|
636
|
+
]
|
|
637
|
+
.filter(dd => {
|
|
590
638
|
return dd.url !== `https://${domain}/blogs`;
|
|
591
|
-
})
|
|
592
|
-
{ url: `https://${domain}/blogs`, changefreq: 'weekly' }
|
|
593
|
-
])).pipe(stream)).then((data) => data.toString());
|
|
639
|
+
})
|
|
640
|
+
.concat([{ url: `https://${domain}/blogs`, changefreq: 'weekly' }])).pipe(stream)).then((data) => data.toString());
|
|
594
641
|
return xml;
|
|
595
642
|
},
|
|
596
643
|
sitemap_list: async (req, resp) => {
|
|
@@ -599,8 +646,8 @@ async function createAPP(dd) {
|
|
|
599
646
|
appName = req.query.appName;
|
|
600
647
|
}
|
|
601
648
|
const domain = (await database_2.default.query(`select \`domain\`
|
|
602
|
-
|
|
603
|
-
|
|
649
|
+
from \`${config_1.saasConfig.SAAS_NAME}\`.app_config
|
|
650
|
+
where appName = ?`, [appName]))[0]['domain'];
|
|
604
651
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
605
652
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
606
653
|
<!-- This is the parent sitemap linking to additional sitemaps for products, collections and pages as shown below. The sitemap can not be edited manually, but is kept up to date in real time. -->
|
|
@@ -620,9 +667,11 @@ async function createAPP(dd) {
|
|
|
620
667
|
});
|
|
621
668
|
robots.text = robots.text || '';
|
|
622
669
|
const domain = (await database_2.default.query(`select \`domain\`
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
return robots.text.replace(/\s+/g, '').replace(/\n/g, '')
|
|
670
|
+
from \`${config_1.saasConfig.SAAS_NAME}\`.app_config
|
|
671
|
+
where appName = ?`, [appName]))[0]['domain'];
|
|
672
|
+
return robots.text.replace(/\s+/g, '').replace(/\n/g, '')
|
|
673
|
+
? robots.text
|
|
674
|
+
: html `User-agent: * Allow: / Sitemap: https://${domain}/sitemap.xml`;
|
|
626
675
|
},
|
|
627
676
|
tw_shop: async (req, resp) => {
|
|
628
677
|
let appName = dd.appName;
|
|
@@ -634,49 +683,48 @@ async function createAPP(dd) {
|
|
|
634
683
|
'"': '"',
|
|
635
684
|
"'": ''',
|
|
636
685
|
};
|
|
637
|
-
return text.replace(/[&<>"']/g,
|
|
686
|
+
return text.replace(/[&<>"']/g, m => map[m] || m);
|
|
638
687
|
};
|
|
639
688
|
if (req.query.appName) {
|
|
640
689
|
appName = req.query.appName;
|
|
641
690
|
}
|
|
642
691
|
const products = await database_2.default.query(`SELECT *
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
692
|
+
FROM \`${dd.appName}\`.t_manager_post
|
|
693
|
+
WHERE JSON_EXTRACT(content, '$.type') = 'product';
|
|
694
|
+
`, []);
|
|
646
695
|
const domain = (await database_2.default.query(`select \`domain\`
|
|
647
|
-
|
|
648
|
-
|
|
696
|
+
from \`${config_1.saasConfig.SAAS_NAME}\`.app_config
|
|
697
|
+
where appName = ?`, [appName]))[0]['domain'];
|
|
649
698
|
let printData = products
|
|
650
699
|
.map((product) => {
|
|
651
700
|
return product.content.variants
|
|
652
701
|
.map((variant) => {
|
|
653
702
|
var _a, _b;
|
|
654
703
|
return html `
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
704
|
+
<Product>
|
|
705
|
+
<SKU>${variant.sku}</SKU>
|
|
706
|
+
<Name>${product.content.title}</Name>
|
|
707
|
+
<Description>${dd.appName} - ${product.content.title}</Description>
|
|
708
|
+
<URL> ${`https://` + domain + '/products/' + product.content.title}</URL>
|
|
709
|
+
<Price>${(_a = variant.compare_price) !== null && _a !== void 0 ? _a : variant.sale_price}</Price>
|
|
710
|
+
<LargeImage> ${(_b = variant.preview_image) !== null && _b !== void 0 ? _b : ''}</LargeImage>
|
|
711
|
+
<SalePrice>${variant.sale_price}</SalePrice>
|
|
712
|
+
<Category>${product.content.collection.join('')}</Category>
|
|
713
|
+
</Product>
|
|
714
|
+
`;
|
|
666
715
|
})
|
|
667
716
|
.join('');
|
|
668
717
|
})
|
|
669
718
|
.join('');
|
|
670
719
|
return (0, xml_formatter_1.default)(`<Product>${printData}</Product>`, {
|
|
671
720
|
indentation: ' ',
|
|
672
|
-
filter:
|
|
721
|
+
filter: node => node.type !== 'Comment',
|
|
673
722
|
collapseContent: true,
|
|
674
723
|
});
|
|
675
724
|
},
|
|
676
725
|
};
|
|
677
726
|
}));
|
|
678
727
|
}
|
|
679
|
-
exports.createAPP = createAPP;
|
|
680
728
|
async function getSeoDetail(appName, req) {
|
|
681
729
|
const sqlData = await private_config_js_1.Private_config.getConfig({
|
|
682
730
|
appName: appName,
|
|
@@ -707,7 +755,7 @@ async function getSeoDetail(appName, req) {
|
|
|
707
755
|
const evalString = `
|
|
708
756
|
return {
|
|
709
757
|
execute:(${functionValue
|
|
710
|
-
.map(
|
|
758
|
+
.map(d2 => {
|
|
711
759
|
return d2.key;
|
|
712
760
|
})
|
|
713
761
|
.join(',')})=>{
|
|
@@ -749,7 +797,7 @@ async function getSeoSiteMap(appName, req) {
|
|
|
749
797
|
const evalString = `
|
|
750
798
|
return {
|
|
751
799
|
execute:(${functionValue
|
|
752
|
-
.map(
|
|
800
|
+
.map(d2 => {
|
|
753
801
|
return d2.key;
|
|
754
802
|
})
|
|
755
803
|
.join(',')})=>{
|