|
1
|
import { LinkModulesExtraFields, ModuleJoinerConfig } from "@medusajs/types" |
|
2
|
import { |
|
3
|
camelToSnakeCase, |
|
4
|
getCallerFilePath, |
|
5
|
isFileDisabled, |
|
6
|
isObject, |
|
7
|
MEDUSA_SKIP_FILE, |
|
8
|
pluralize, |
|
9
|
toPascalCase, |
|
10
|
} from "../common" |
|
11
|
import { composeLinkName } from "../link/compose-link-name" |
|
12
|
|
|
13
|
export const DefineLinkSymbol = Symbol.for("DefineLink") |
|
14
|
|
|
15
|
export interface DefineLinkExport { |
|
16
|
[DefineLinkSymbol]: boolean |
|
17
|
serviceName: string |
|
18
|
entity?: string |
|
19
|
entryPoint: string |
|
20
|
} |
|
21
|
|
|
22
|
type InputSource = { |
|
23
|
serviceName: string |
|
24
|
field: string |
|
25
|
entity?: string |
|
26
|
alias?: string |
|
27
|
linkable: string |
|
28
|
primaryKey: string |
|
29
|
filterable?: string[] |
|
30
|
} |
|
31
|
|
|
32
|
type ReadOnlyInputSource = { |
|
33
|
linkable: |
|
34
|
| CombinedSource |
|
35
|
| InputSource |
|
36
|
| { |
|
37
|
serviceName: string |
|
38
|
entity?: string |
|
39
|
} |
|
40
|
field?: string |
|
41
|
} |
|
42
|
|
|
43
|
type InputToJson = { |
|
44
|
toJSON: () => InputSource |
|
45
|
} |
|
46
|
|
|
47
|
type CombinedSource = Record<any, any> & InputToJson |
|
48
|
|
|
49
|
type InputOptions = { |
|
50
|
linkable: CombinedSource | InputSource |
|
51
|
field?: string |
|
52
|
alias?: string |
|
53
|
isList?: boolean |
|
54
|
deleteCascade?: boolean |
|
55
|
filterable?: string[] |
|
56
|
} |
|
57
|
|
|
58
|
type Shortcut = { |
|
59
|
property: string |
|
60
|
path: string |
|
61
|
isList?: boolean |
|
62
|
forwardArguments?: string | string[] |
|
63
|
} |
|
64
|
|
|
65
|
type ExtraOptions = { |
|
66
|
pk?: { |
|
67
|
[key: string]: string |
|
68
|
} |
|
69
|
database?: { |
|
70
|
table?: string |
|
71
|
idPrefix?: string |
|
72
|
extraColumns?: LinkModulesExtraFields |
|
73
|
} |
|
74
|
readOnly?: boolean |
|
75
|
} |
|
76
|
|
|
77
|
type ReadOnlyExtraOptions = { |
|
78
|
readOnly: true |
|
79
|
isList?: boolean |
|
80
|
shortcut?: Shortcut | Shortcut[] |
|
81
|
} |
|
82
|
|
|
83
|
type DefineLinkInputSource = InputSource | InputOptions | CombinedSource |
|
84
|
|
|
85
|
type DefineReadOnlyLinkInputSource = |
|
86
|
| ReadOnlyInputSource |
|
87
|
| InputOptions |
|
88
|
| CombinedSource |
|
89
|
|
|
90
|
type ModuleLinkableKeyConfig = { |
|
91
|
module: string |
|
92
|
entity?: string |
|
93
|
key: string |
|
94
|
field: string |
|
95
|
isList?: boolean |
|
96
|
deleteCascade?: boolean |
|
97
|
primaryKey: string |
|
98
|
alias: string |
|
99
|
hasMany?: boolean |
|
100
|
shortcut?: Shortcut | Shortcut[] |
|
101
|
filterable?: string[] |
|
102
|
} |
|
103
|
|
|
104
|
function isInputOptions(input: any): input is InputOptions { |
|
105
|
return isObject(input) && input?.["linkable"] |
|
106
|
} |
|
107
|
|
|
108
|
function isInputSource(input: any): input is InputSource { |
|
109
|
return (isObject(input) && input?.["serviceName"]) || input?.["toJSON"] |
|
110
|
} |
|
111
|
|
|
112
|
function isToJSON(input: any): input is InputToJson { |
|
113
|
return isObject(input) && input?.["toJSON"] |
|
114
|
} |
|
115
|
|
|
116
|
function buildFieldAlias(fieldAliases?: Shortcut | Shortcut[]) { |
|
117
|
if (!fieldAliases) { |
|
118
|
return |
|
119
|
} |
|
120
|
|
|
121
|
const fieldAlias = {} |
|
122
|
|
|
123
|
const shortcuts = Array.isArray(fieldAliases) ? fieldAliases : [fieldAliases] |
|
124
|
for (const sc of shortcuts) { |
|
125
|
const fwArgs = sc.forwardArguments |
|
126
|
? Array.isArray(sc.forwardArguments) |
|
127
|
? sc.forwardArguments |
|
128
|
: [sc.forwardArguments] |
|
129
|
: [] |
|
130
|
fieldAlias[sc.property] = { |
|
131
|
path: sc.path, |
|
132
|
isList: !!sc.isList, |
|
133
|
forwardArgumentsOnPath: fwArgs, |
|
134
|
} |
|
135
|
} |
|
136
|
|
|
137
|
return fieldAlias |
|
138
|
} |
|
139
|
|
|
140
|
function prepareServiceConfig( |
|
141
|
input: DefineLinkInputSource | DefineReadOnlyLinkInputSource |
|
142
|
) { |
|
143
|
let serviceConfig = {} as ModuleLinkableKeyConfig |
|
144
|
|
|
145
|
if (isInputSource(input)) { |
|
146
|
const source = isToJSON(input) ? input.toJSON() : input |
|
147
|
|
|
148
|
serviceConfig = { |
|
149
|
key: source.linkable, |
|
150
|
alias: source.alias ?? camelToSnakeCase(source.field ?? ""), |
|
151
|
field: input.field ?? source.field, |
|
152
|
primaryKey: source.primaryKey, |
|
153
|
isList: false, |
|
154
|
hasMany: false, |
|
155
|
deleteCascade: false, |
|
156
|
filterable: source.filterable, |
|
157
|
module: source.serviceName, |
|
158
|
entity: source.entity, |
|
159
|
} |
|
160
|
} else if (isInputOptions(input)) { |
|
161
|
const source = isToJSON(input.linkable) |
|
162
|
? input.linkable.toJSON() |
|
163
|
: input.linkable |
|
164
|
|
|
165
|
const hasMany = !!input.isList |
|
166
|
|
|
167
|
serviceConfig = { |
|
168
|
key: source.linkable, |
|
169
|
alias: input.alias ?? source.alias ?? camelToSnakeCase(source.field ?? ""), |
|
170
|
field: input.field ?? source.field, |
|
171
|
primaryKey: source.primaryKey, |
|
172
|
isList: input.isList ?? false, |
|
173
|
hasMany, |
|
174
|
deleteCascade: input.deleteCascade ?? false, |
|
175
|
filterable: input.filterable, |
|
176
|
module: source.serviceName, |
|
177
|
entity: source.entity, |
|
178
|
} |
|
179
|
} else { |
|
180
|
throw new Error( |
|
181
|
`Invalid linkable passed for the argument\n${JSON.stringify( |
|
182
|
input, |
|
183
|
null, |
|
184
|
2 |
|
185
|
)}` |
|
186
|
) |
|
187
|
} |
|
188
|
|
|
189
|
return serviceConfig |
|
190
|
} |
|
191
|
|
|
192
|
/** |
|
193
|
* Generate a ModuleJoinerConfig for the link definition on the fly. |
|
194
|
* All naming, aliases etc are following our conventional naming. |
|
195
|
* |
|
196
|
* @param leftService |
|
197
|
* @param rightService |
|
198
|
* @param linkServiceOptions |
|
199
|
*/ |
|
200
|
export function defineLink( |
|
201
|
leftService: DefineLinkInputSource | DefineReadOnlyLinkInputSource, |
|
202
|
rightService: DefineLinkInputSource | DefineReadOnlyLinkInputSource, |
|
203
|
linkServiceOptions?: ExtraOptions | ReadOnlyExtraOptions |
|
204
|
): DefineLinkExport { |
|
205
|
const callerFilePath = getCallerFilePath() |
|
206
|
if (isFileDisabled(callerFilePath ?? "")) { |
|
207
|
return { [MEDUSA_SKIP_FILE]: true } as any |
|
208
|
} |
|
209
|
|
|
210
|
const serviceAObj = prepareServiceConfig(leftService) |
|
211
|
const serviceBObj = prepareServiceConfig(rightService) |
|
212
|
|
|
213
|
if (linkServiceOptions?.readOnly) { |
|
214
|
if (!leftService.linkable || !leftService.field) { |
|
215
|
throw new Error( |
|
216
|
`ReadOnly link requires "linkable" and "field" to be defined for the left service.` |
|
217
|
) |
|
218
|
} else if ( |
|
219
|
(leftService as DefineLinkInputSource).filterable || |
|
220
|
(rightService as DefineLinkInputSource).filterable |
|
221
|
) { |
|
222
|
throw new Error(`ReadOnly link does not support filterable fields.`) |
|
223
|
} |
|
224
|
|
|
225
|
return defineReadOnlyLink( |
|
226
|
serviceAObj, |
|
227
|
serviceBObj, |
|
228
|
linkServiceOptions as ReadOnlyExtraOptions |
|
229
|
) as unknown as DefineLinkExport |
|
230
|
} |
|
231
|
|
|
232
|
const output = { |
|
233
|
[DefineLinkSymbol]: true, |
|
234
|
serviceName: "", |
|
235
|
entity: "", |
|
236
|
entryPoint: "", |
|
237
|
} |
|
238
|
|
|
239
|
const register = function ( |
|
240
|
modules: ModuleJoinerConfig[] |
|
241
|
): ModuleJoinerConfig { |
|
242
|
const serviceAInfo = modules.find( |
|
243
|
(mod) => mod.serviceName === serviceAObj.module |
|
244
|
)! |
|
245
|
const serviceBInfo = modules.find( |
|
246
|
(mod) => mod.serviceName === serviceBObj.module |
|
247
|
)! |
|
248
|
|
|
249
|
if (!serviceAInfo) { |
|
250
|
throw new Error(`Service ${serviceAObj.module} was not found. If this is your module, make sure you set isQueryable to true in medusa-config.js: |
|
251
|
|
|
252
|
${serviceAObj.module}: { |
|
253
|
// ... |
|
254
|
definition: { |
|
255
|
isQueryable: true |
|
256
|
} |
|
257
|
}`) |
|
258
|
} |
|
259
|
if (!serviceBInfo) { |
|
260
|
throw new Error(`Service ${serviceBObj.module} was not found. If this is your module, make sure you set isQueryable to true in medusa-config.js: |
|
261
|
|
|
262
|
${serviceBObj.module}: { |
|
263
|
// ... |
|
264
|
definition: { |
|
265
|
isQueryable: true |
|
266
|
} |
|
267
|
}`) |
|
268
|
} |
|
269
|
|
|
270
|
const serviceAKeyEntity = serviceAInfo.linkableKeys?.[serviceAObj.key] |
|
271
|
const serviceBKeyInfo = serviceBInfo.linkableKeys?.[serviceBObj.key] |
|
272
|
if (!serviceAKeyEntity) { |
|
273
|
throw new Error( |
|
274
|
`Key ${serviceAObj.key} is not linkable on service ${serviceAObj.module}` |
|
275
|
) |
|
276
|
} |
|
277
|
if (!serviceBKeyInfo) { |
|
278
|
throw new Error( |
|
279
|
`Key ${serviceBObj.key} is not linkable on service ${serviceBObj.module}` |
|
280
|
) |
|
281
|
} |
|
282
|
|
|
283
|
let serviceAAliases = serviceAInfo.alias ?? [] |
|
284
|
if (!Array.isArray(serviceAAliases)) { |
|
285
|
serviceAAliases = [serviceAAliases] |
|
286
|
} |
|
287
|
|
|
288
|
let aliasAOptions = |
|
289
|
serviceAObj.alias ?? |
|
290
|
serviceAAliases.find((a) => { |
|
291
|
return a.entity == serviceAKeyEntity |
|
292
|
})?.name |
|
293
|
|
|
294
|
let aliasA = aliasAOptions |
|
295
|
if (Array.isArray(aliasAOptions)) { |
|
296
|
aliasA = aliasAOptions[0] |
|
297
|
} |
|
298
|
|
|
299
|
if (!aliasA) { |
|
300
|
throw new Error( |
|
301
|
`You need to provide an alias for ${serviceAObj.module}.${serviceAObj.key}` |
|
302
|
) |
|
303
|
} |
|
304
|
|
|
305
|
const serviceAObjEntryPoint = camelToSnakeCase(serviceAObj.field) |
|
306
|
const serviceAMethodSuffix = serviceAAliases.find((serviceAlias) => { |
|
307
|
return Array.isArray(serviceAlias.name) |
|
308
|
? serviceAlias.name.includes(serviceAObjEntryPoint) |
|
309
|
: serviceAlias.name === serviceAObjEntryPoint |
|
310
|
})?.args?.methodSuffix |
|
311
|
|
|
312
|
let serviceBAliases = serviceBInfo.alias ?? [] |
|
313
|
if (!Array.isArray(serviceBAliases)) { |
|
314
|
serviceBAliases = [serviceBAliases] |
|
315
|
} |
|
316
|
|
|
317
|
let aliasBOptions = |
|
318
|
serviceBObj.alias ?? |
|
319
|
serviceBAliases.find((a) => { |
|
320
|
return a.entity == serviceBKeyInfo |
|
321
|
})?.name |
|
322
|
|
|
323
|
let aliasB = aliasBOptions |
|
324
|
if (Array.isArray(aliasBOptions)) { |
|
325
|
aliasB = aliasBOptions[0] |
|
326
|
} |
|
327
|
|
|
328
|
if (!aliasB) { |
|
329
|
throw new Error( |
|
330
|
`You need to provide an alias for ${serviceBObj.module}.${serviceBObj.key}` |
|
331
|
) |
|
332
|
} |
|
333
|
|
|
334
|
const serviceBObjEntryPoint = camelToSnakeCase(serviceBObj.field) |
|
335
|
const serviceBMethodSuffix = serviceBAliases.find((serviceAlias) => { |
|
336
|
return Array.isArray(serviceAlias.name) |
|
337
|
? serviceAlias.name.includes(serviceBObjEntryPoint) |
|
338
|
: serviceAlias.name === serviceBObjEntryPoint |
|
339
|
})?.args?.methodSuffix |
|
340
|
|
|
341
|
const moduleAPrimaryKeys = serviceAInfo.primaryKeys ?? [] |
|
342
|
let serviceAPrimaryKey = |
|
343
|
serviceAObj.primaryKey ?? |
|
344
|
linkServiceOptions?.pk?.[serviceAObj.module] ?? |
|
345
|
moduleAPrimaryKeys |
|
346
|
if (Array.isArray(serviceAPrimaryKey)) { |
|
347
|
serviceAPrimaryKey = serviceAPrimaryKey[0] |
|
348
|
} |
|
349
|
|
|
350
|
const isModuleAPrimaryKeyValid = |
|
351
|
moduleAPrimaryKeys.includes(serviceAPrimaryKey) |
|
352
|
|
|
353
|
if (!isModuleAPrimaryKeyValid) { |
|
354
|
throw new Error( |
|
355
|
`Primary key ${serviceAPrimaryKey} is not defined on service ${serviceAObj.module}` |
|
356
|
) |
|
357
|
} |
|
358
|
|
|
359
|
const moduleBPrimaryKeys = serviceBInfo.primaryKeys ?? [] |
|
360
|
let serviceBPrimaryKey = |
|
361
|
serviceBObj.primaryKey ?? |
|
362
|
linkServiceOptions?.pk?.[serviceBObj.module] ?? |
|
363
|
moduleBPrimaryKeys |
|
364
|
if (Array.isArray(serviceBPrimaryKey)) { |
|
365
|
serviceBPrimaryKey = serviceBPrimaryKey[0] |
|
366
|
} |
|
367
|
|
|
368
|
const isModuleBPrimaryKeyValid = |
|
369
|
moduleBPrimaryKeys.includes(serviceBPrimaryKey) |
|
370
|
if (!isModuleBPrimaryKeyValid) { |
|
371
|
throw new Error( |
|
372
|
`Primary key ${serviceBPrimaryKey} is not defined on service ${serviceBObj.module}` |
|
373
|
) |
|
374
|
} |
|
375
|
|
|
376
|
output.serviceName = composeLinkName( |
|
377
|
serviceAObj.module, |
|
378
|
aliasA, |
|
379
|
serviceBObj.module, |
|
380
|
aliasB |
|
381
|
) |
|
382
|
|
|
383
|
output.entryPoint = aliasA + "_" + aliasB |
|
384
|
output.entity = toPascalCase( |
|
385
|
["Link", serviceAObj.module, aliasA, serviceBObj.module, aliasB].join("_") |
|
386
|
) |
|
387
|
|
|
388
|
const linkDefinition: ModuleJoinerConfig = { |
|
389
|
serviceName: output.serviceName, |
|
390
|
isLink: true, |
|
391
|
alias: [ |
|
392
|
{ |
|
393
|
name: [output.entryPoint], |
|
394
|
args: { |
|
395
|
entity: output.entity, |
|
396
|
}, |
|
397
|
}, |
|
398
|
], |
|
399
|
primaryKeys: ["id", serviceAObj.key, serviceBObj.key], |
|
400
|
relationships: [ |
|
401
|
{ |
|
402
|
serviceName: serviceAObj.module, |
|
403
|
entity: serviceAObj.entity, |
|
404
|
primaryKey: serviceAPrimaryKey, |
|
405
|
foreignKey: serviceAObj.key, |
|
406
|
alias: aliasA, |
|
407
|
args: { |
|
408
|
methodSuffix: serviceAMethodSuffix, |
|
409
|
}, |
|
410
|
deleteCascade: serviceAObj.deleteCascade, |
|
411
|
filterable: serviceAObj.filterable, |
|
412
|
hasMany: serviceAObj.hasMany, |
|
413
|
}, |
|
414
|
{ |
|
415
|
serviceName: serviceBObj.module, |
|
416
|
entity: serviceBObj.entity, |
|
417
|
primaryKey: serviceBPrimaryKey!, |
|
418
|
foreignKey: serviceBObj.key, |
|
419
|
alias: aliasB, |
|
420
|
args: { |
|
421
|
methodSuffix: serviceBMethodSuffix, |
|
422
|
}, |
|
423
|
deleteCascade: serviceBObj.deleteCascade, |
|
424
|
filterable: serviceBObj.filterable, |
|
425
|
hasMany: serviceBObj.hasMany, |
|
426
|
}, |
|
427
|
], |
|
428
|
extends: [ |
|
429
|
{ |
|
430
|
serviceName: serviceAObj.module, |
|
431
|
entity: serviceAObj.entity, |
|
432
|
fieldAlias: buildFieldAlias({ |
|
433
|
property: serviceBObj.isList ? pluralize(aliasB) : aliasB, |
|
434
|
path: aliasB + "_link." + aliasB, |
|
435
|
isList: serviceBObj.isList, |
|
436
|
forwardArguments: [aliasB + "_link." + aliasB], |
|
437
|
}), |
|
438
|
relationship: { |
|
439
|
serviceName: output.serviceName, |
|
440
|
entity: output.entity, |
|
441
|
primaryKey: serviceAObj.key, |
|
442
|
foreignKey: serviceAPrimaryKey, |
|
443
|
alias: aliasB + "_link", |
|
444
|
isList: serviceBObj.isList, |
|
445
|
}, |
|
446
|
}, |
|
447
|
{ |
|
448
|
serviceName: serviceBObj.module, |
|
449
|
entity: serviceBObj.entity, |
|
450
|
fieldAlias: buildFieldAlias({ |
|
451
|
property: serviceAObj.isList ? pluralize(aliasA) : aliasA, |
|
452
|
path: aliasA + "_link." + aliasA, |
|
453
|
isList: serviceAObj.isList, |
|
454
|
forwardArguments: [aliasA + "_link." + aliasA], |
|
455
|
}), |
|
456
|
relationship: { |
|
457
|
serviceName: output.serviceName, |
|
458
|
entity: output.entity, |
|
459
|
primaryKey: serviceBObj.key, |
|
460
|
foreignKey: serviceBPrimaryKey, |
|
461
|
alias: aliasA + "_link", |
|
462
|
isList: serviceAObj.isList, |
|
463
|
}, |
|
464
|
}, |
|
465
|
], |
|
466
|
} |
|
467
|
|
|
468
|
if (linkServiceOptions?.database) { |
|
469
|
const { table, idPrefix, extraColumns } = linkServiceOptions.database |
|
470
|
linkDefinition.databaseConfig = { |
|
471
|
tableName: table, |
|
472
|
idPrefix, |
|
473
|
extraFields: extraColumns, |
|
474
|
} |
|
475
|
} |
|
476
|
|
|
477
|
return linkDefinition |
|
478
|
} |
|
479
|
|
|
480
|
global.MedusaModule.setCustomLink(register) |
|
481
|
|
|
482
|
return output |
|
483
|
} |
|
484
|
|
|
485
|
function defineReadOnlyLink( |
|
486
|
serviceAObj: ModuleLinkableKeyConfig, |
|
487
|
serviceBObj: ModuleLinkableKeyConfig, |
|
488
|
readOnlyLinkOptions?: ReadOnlyExtraOptions |
|
489
|
): void { |
|
490
|
const register = function ( |
|
491
|
modules: ModuleJoinerConfig[] |
|
492
|
): ModuleJoinerConfig { |
|
493
|
const serviceAInfo = modules.find( |
|
494
|
(mod) => mod.serviceName === serviceAObj.module |
|
495
|
)! |
|
496
|
const serviceBInfo = modules.find( |
|
497
|
(mod) => mod.serviceName === serviceBObj.module |
|
498
|
)! |
|
499
|
|
|
500
|
if (!serviceAInfo) { |
|
501
|
throw new Error(`Service ${serviceAObj.module} was not found. If this is your module, make sure you set isQueryable to true in medusa-config.js: |
|
502
|
|
|
503
|
${serviceAObj.module}: { |
|
504
|
// ... |
|
505
|
definition: { |
|
506
|
isQueryable: true |
|
507
|
} |
|
508
|
}`) |
|
509
|
} |
|
510
|
if (!serviceBInfo) { |
|
511
|
throw new Error(`Service ${serviceBObj.module} was not found. If this is your module, make sure you set isQueryable to true in medusa-config.js: |
|
512
|
|
|
513
|
${serviceBObj.module}: { |
|
514
|
// ... |
|
515
|
definition: { |
|
516
|
isQueryable: true |
|
517
|
} |
|
518
|
}`) |
|
519
|
} |
|
520
|
|
|
521
|
const extendsConfig: ModuleJoinerConfig["extends"] = [ |
|
522
|
{ |
|
523
|
serviceName: serviceAObj.module, |
|
524
|
entity: serviceAObj.entity, |
|
525
|
fieldAlias: buildFieldAlias(readOnlyLinkOptions?.shortcut), |
|
526
|
relationship: { |
|
527
|
serviceName: serviceBObj.module, |
|
528
|
entity: serviceBObj.entity, |
|
529
|
primaryKey: serviceBObj.primaryKey, |
|
530
|
foreignKey: serviceAObj.field, |
|
531
|
alias: serviceBObj.alias, |
|
532
|
isList: readOnlyLinkOptions?.isList ?? serviceAObj.isList, |
|
533
|
}, |
|
534
|
}, |
|
535
|
] |
|
536
|
|
|
537
|
if (readOnlyLinkOptions?.isList || serviceAObj.isList) { |
|
538
|
extendsConfig.push({ |
|
539
|
serviceName: serviceAObj.module, |
|
540
|
entity: serviceAObj.entity, |
|
541
|
fieldAlias: buildFieldAlias(readOnlyLinkOptions?.shortcut), |
|
542
|
relationship: { |
|
543
|
serviceName: serviceBObj.module, |
|
544
|
entity: serviceBObj.entity, |
|
545
|
primaryKey: serviceBObj.primaryKey, |
|
546
|
foreignKey: serviceAObj.field, |
|
547
|
alias: |
|
548
|
readOnlyLinkOptions?.isList ?? serviceAObj.isList |
|
549
|
? pluralize(serviceBObj.alias) |
|
550
|
: serviceBObj.alias, |
|
551
|
isList: readOnlyLinkOptions?.isList ?? serviceAObj.isList, |
|
552
|
}, |
|
553
|
}) |
|
554
|
} |
|
555
|
|
|
556
|
return { |
|
557
|
isLink: true, |
|
558
|
isReadOnlyLink: true, |
|
559
|
extends: extendsConfig, |
|
560
|
} |
|
561
|
} |
|
562
|
|
|
563
|
global.MedusaModule.setCustomLink(register) |
|
564
|
} |