mushroom-cli 1.2.0-alpha.8 → 1.2.0-alpha.9

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/docs/docs.v2.html CHANGED
@@ -23,6 +23,9 @@
23
23
  body {
24
24
  padding: var(--padding);
25
25
  }
26
+ .mushroom-docs-template {
27
+ display: none !important;
28
+ }
26
29
  code {
27
30
  word-break: break-all;
28
31
  word-break: break-word;
@@ -216,1371 +219,6 @@
216
219
  }
217
220
  }
218
221
  </style>
219
- <script>
220
- window.docs = undefined/*INJECT-HERE*/;
221
- </script>
222
- <script>
223
- function toCSharpName(str) {
224
- if (typeof str != "string" || str === "") return "";
225
- const name = str.replace(/\W/g, "_");
226
- return name.charAt(0).toUpperCase() + name.substr(1);
227
- }
228
- function encodeHtml(data) {
229
- if (data === undefined || data === null)
230
- return "";
231
- var html = typeof data === "string" ? data : data.toString();
232
- html = html.replace(/&/g, "&amp;");
233
- html = html.replace(/</g, "&lt;");
234
- html = html.replace(/>/g, "&gt;");
235
- html = html.replace(/"/g, "&quot;");
236
- html = html.replace(/'/g, "&apos;");
237
- return html;
238
- }
239
- function renderTemplate(templateId, data) {
240
- const template = document.querySelector("#"+ templateId)?.innerHTML;
241
- if (!template) return "";
242
- return template.replace(/\{\{(\w+)(:html)?\}\}/g, (str, field, format) => format === ":html" ? (data?.[field] ?? "") : encodeHtml(data?.[field]));
243
- }
244
-
245
- function getApiDomain(url) {
246
- const m = url.match(/^(\w+:)?\/\/(([\w-]+\.)+\w+(:\d+)?)/);
247
- return m ? m[2] : "your host";
248
- }
249
- function getApiPath(url) {
250
- const m = url.match(/^(\w+:)?\/\/([\w-]+\.)+\w+(:\d+)?/);
251
- return m ? url.substr(m[0].length) : url;
252
- }
253
-
254
- function getPanelClass(actionName) {
255
- switch (actionName) {
256
- case "findMany":
257
- case "findById":
258
- return "panel panel-primary";
259
- case "createOne":
260
- case "createMany":
261
- return "panel panel-info";
262
- case "updateOne":
263
- case "updateMany":
264
- return "panel panel-warning";
265
- case "updatePartially":
266
- return "panel panel-warning";
267
- case "deleteOne":
268
- case "deleteMany":
269
- return "panel panel-danger";
270
- default:
271
- return "panel panel-default";
272
- }
273
- }
274
- function getHttpMethod(actionName) {
275
- switch (actionName) {
276
- case "findMany":
277
- case "findById":
278
- return "GET";
279
- case "createOne":
280
- case "createMany":
281
- return "POST";
282
- case "updateOne":
283
- case "updateMany":
284
- return "PUT";
285
- case "updatePartially":
286
- return "PATCH";
287
- case "deleteOne":
288
- case "deleteMany":
289
- return "DELETE";
290
- default:
291
- if (actionName && actionName.indexOf("_raw_http_method_") !== -1)
292
- return actionName.substr("_raw_http_method_".length);
293
- return "UNKNOWN(" + actionName + ")";
294
- }
295
- }
296
- function getApiUrl(actionName, rootUrl, entityName) {
297
- switch (actionName) {
298
- case "findMany":
299
- case "createOne":
300
- case "createMany":
301
- case "updateMany":
302
- case "deleteMany":
303
- return rootUrl + entityName + "s";
304
- case "findById":
305
- case "updateOne":
306
- case "updatePartially":
307
- case "deleteOne":
308
- return rootUrl + entityName + "s/{" + entityName + "Id}";
309
- default:
310
- if (actionName && actionName.indexOf("_raw_http_method_") !== -1)
311
- return rootUrl + entityName + "s/" + actionName.substr("_raw_http_method_".length);
312
- return "UNKNOWN(" + actionName + ")";
313
- }
314
- }
315
- function getApiViewUrl(rootUrl, entityName, viewName) {
316
- return rootUrl + entityName + "s/views/" + viewName;
317
- }
318
- function getDescriptionByActionName(actionName, entityName) {
319
- switch (actionName) {
320
- case "findMany":
321
- return "Lấy về danh sách các " + entityName;
322
- case "findById":
323
- return "Lấy về một " + entityName + " theo mã của nó";
324
- case "createOne":
325
- return "Tạo mới một " + entityName;
326
- case "createMany":
327
- return "Tạo mới hàng loạt các " + entityName;
328
- case "updateOne":
329
- return "Cập nhật một " + entityName;
330
- case "updateMany":
331
- return "Cập nhật hàng loạt các " + entityName;
332
- case "updatePartially":
333
- return "Cập nhật một phần dữ liệu của " + entityName;
334
- case "deleteOne":
335
- return "Xóa một " + entityName + " theo mã của nó";
336
- case "deleteMany":
337
- return "Xóa hàng loạt " + entityName;
338
- default:
339
- if (actionName && actionName.indexOf("_raw_http_method_") !== -1)
340
- return "";
341
- return "UNKNOWN(" + actionName + ")";
342
- }
343
- }
344
- function explainRoles(strRoles) {
345
- if (!strRoles)
346
- return "";
347
-
348
- return strRoles.split("|").map(function (item) {
349
- if (item === "*")
350
- return "[Mọi người dùng]";
351
- const roles = item.split("+");
352
- let s = "";
353
- if (roles.length > 1)
354
- s += "(";
355
-
356
- s += roles.join(" và ");
357
-
358
- if (roles.length > 1)
359
- s += ")";
360
-
361
- return s;
362
- }).join(" hoặc ");
363
- }
364
- function getModelOutput(arrFields, fields, options) {
365
- if (!fields || !arrFields)
366
- return "";
367
-
368
- var obj = {};
369
- for (var j = 0; j < arrFields.length; j++) {
370
- if (!arrFields[j])
371
- continue;
372
- var segs = arrFields[j].split('.');
373
- var objFields = fields;
374
- var cur = obj;
375
- for (var i = 0; i < segs.length; i++) {
376
- if (segs[i] in objFields) {
377
- var field = objFields[segs[i]];
378
-
379
- if (i === segs.length - 1) {
380
- if (!(segs[i] in cur))
381
- cur[segs[i]] = JSON.parse(JSON.stringify(field));
382
- }
383
- else if (field.type === "object") {
384
- objFields = field.fields;
385
- if (!(segs[i] in cur)) {
386
- var o = { type: "object", fields: {} };
387
- cur[segs[i]] = o;
388
- cur = o.fields;
389
- } else
390
- cur = cur[segs[i]].fields;
391
- }
392
- else if (field.type === "array") {
393
- objFields = field.items.fields;
394
- if (!(segs[i] in cur)) {
395
- var a = { type: "array", items: { type: "object", fields: {}} };
396
- cur[segs[i]] = a;
397
- cur = a.items.fields;
398
- } else
399
- cur = cur[segs[i]].items.fields;
400
- }
401
- }
402
- }
403
- }
404
-
405
- return formatModel(obj, "", options).trim();
406
- }
407
- function formatModel(obj, strIndent, options) {
408
- if (!obj)
409
- return "";
410
-
411
- options = options || {};
412
-
413
- var result = "";
414
- var nextIndent = strIndent + " ";
415
- for (var m in obj) {
416
- if (!obj.hasOwnProperty(m))
417
- continue;
418
-
419
- var child = obj[m];
420
-
421
- var validation = !options.optionalToAll && child.validation && child.validation.required ? "required" : "optional";
422
- if (child.type === "IdRef" && child.reference) {
423
- validation += ", ref: <a href='#" + encodeHtml(child.reference) + "' onclick='setTimeout(gotoHash, 20)'>" + encodeHtml(child.reference) + "</a>";
424
- }
425
-
426
- if (child.validation) {
427
- if ("validValues" in child.validation)
428
- validation += ", enum(" + encodeHtml(child.validation.validValues.join(", ")) + ")";
429
- if ("invalidValues" in child.validation)
430
- validation += ", not allow(" + encodeHtml(child.validation.invalidValues.join(", ")) + ")";
431
- if ("pattern" in child.validation)
432
- validation += ", pattern: /" + encodeHtml(child.validation.pattern) + "/";
433
- if ("length" in child.validation)
434
- validation += ", length: " + child.validation.length;
435
- if ("minLength" in child.validation)
436
- validation += ", minLength: " + child.validation.minLength;
437
- if ("maxLength" in child.validation)
438
- validation += ", maxLength: " + child.validation.maxLength;
439
- if ("min" in child.validation)
440
- validation += ", min: " + encodeHtml(child.validation.min);
441
- if ("max" in child.validation)
442
- validation += ", max: " + encodeHtml(child.validation.max);
443
- if ("gt" in child.validation)
444
- validation += ", gt: " + encodeHtml(child.validation.gt);
445
- if ("lt" in child.validation)
446
- validation += ", lt: " + encodeHtml(child.validation.lt);
447
- }
448
-
449
- if (child.type === "array" && child.items && child.items.type != "object" && child.items.validation) {
450
- validation += ", array items: " + (!options.optionalToAll && child.items.validation.required ? "required" : "optional");
451
- if ("validValues" in child.items.validation)
452
- validation += ", enum(" + encodeHtml(child.items.validation.validValues.join(", ")) + ")";
453
- if ("invalidValues" in child.items.validation)
454
- validation += ", not allow(" + encodeHtml(child.items.validation.invalidValues.join(", ")) + ")";
455
- if ("pattern" in child.items.validation)
456
- validation += ", pattern: /" + encodeHtml(child.items.validation.pattern) + "/";
457
- if ("length" in child.items.validation)
458
- validation += ", length: " + child.items.validation.length;
459
- if ("minLength" in child.items.validation)
460
- validation += ", minLength: " + child.items.validation.minLength;
461
- if ("maxLength" in child.items.validation)
462
- validation += ", maxLength: " + child.items.validation.maxLength;
463
- if ("min" in child.items.validation)
464
- validation += ", min: " + encodeHtml(child.items.validation.min);
465
- if ("max" in child.items.validation)
466
- validation += ", max: " + encodeHtml(child.items.validation.max);
467
- if ("gt" in child.items.validation)
468
- validation += ", gt: " + encodeHtml(child.items.validation.gt);
469
- if ("lt" in child.items.validation)
470
- validation += ", lt: " + encodeHtml(child.items.validation.lt);
471
- }
472
-
473
- var comment = `<span class="code-comment">// ${validation} ${typeof child.description === "string" && child.description !== "" ? "- " + encodeHtml(child.description) : ""}</span>`;
474
-
475
- if (options.mode === "model") {
476
- if (child.type === "object")
477
- result += "\r\n" + nextIndent + '"' + m + '": ' + comment + formatModel(child.fields, nextIndent, options) + ",";
478
- else if (child.type === "array") {
479
- result += `\r\n${nextIndent}"${m}": [`;
480
- if (child.items.type === "object")
481
- result += " " + comment + formatModel(child.items.fields, nextIndent, options);
482
- else if (child.items.type === "datetime")
483
- result += `\r\n${nextIndent} ` + JSON.stringify(child.items.defaultValue || "ISODate_ISO_8601") + " " + comment + `\r\n${nextIndent}`;
484
- else if (child.items.type === "boolean")
485
- result += `\r\n${nextIndent} ` + child.items.defaultValue || "false" + " " + comment + `\r\n${nextIndent}`;
486
- else if (child.items.type === "integer" || child.items.type === "long"|| child.items.type === "double")
487
- result += `\r\n${nextIndent} ` + child.items.defaultValue || "0" + " " + comment + `\r\n${nextIndent}`;
488
- else
489
- result += `\r\n${nextIndent} ` + JSON.stringify(child.defaultValue || child.type) + " " + comment + `\r\n${nextIndent}`;
490
- result += `]`;
491
- }
492
- else if (child.type === "datetime")
493
- result += `\r\n${nextIndent}"${m}": ` + JSON.stringify(child.defaultValue || "ISODate_ISO_8601") + ", " + comment;
494
- else if (child.type === "boolean")
495
- result += `\r\n${nextIndent}"${m}": ` + (child.defaultValue || "false") + ", " + comment;
496
- else if (child.type === "integer" || child.type === "long"|| child.type === "double")
497
- result += `\r\n${nextIndent}"${m}": ` + (child.defaultValue || "0") + ", " + comment;
498
- else
499
- result += `\r\n${nextIndent}"${m}": ` + JSON.stringify(child.defaultValue || child.type) + ", " + comment;
500
- } else if (options.mode === "model_null") {
501
- if (child.type === "object")
502
- result += "\r\n" + nextIndent + '"' + m + '": ' + comment + formatModel(child.fields, nextIndent, options);
503
- else if (child.type === "array") {
504
- result += `\r\n${nextIndent}"${m}": [`;
505
- if (child.items.type === "object")
506
- result += " " + comment + formatModel(child.items.fields, nextIndent, options) + "],";
507
- else
508
- result += "], " + comment;
509
- }
510
- else
511
- result += `\r\n${nextIndent}"${m}": null, ${comment}`;
512
- } else if (options.mode === "model_undefined") {
513
- if (child.type === "object")
514
- result += "\r\n" + nextIndent + '"' + m + '": ' + comment + formatModel(child.fields, nextIndent, options);
515
- else if (child.type === "array") {
516
- result += `\r\n${nextIndent}"${m}": [`;
517
- if (child.items.type === "object")
518
- result += " " + comment + formatModel(child.items.fields, nextIndent, options) + "], ";
519
- else
520
- result += "], " + comment;
521
- }
522
- else
523
- result += `\r\n${nextIndent}"${m}": undefined, ${comment}`;
524
- } else {
525
- result += "\r\n" + strIndent + encodeHtml(m) + ": " + encodeHtml(child.type);
526
- if (child.type === "array")
527
- result += child.items.type === "object" ? " of object" : " of " + child.items.type;
528
- if (child.type === "object")
529
- result += " " + comment + formatModel(child.fields, strIndent + " ", options);
530
- else if (child.type === "array" && child.items.type === "object")
531
- result += " " + comment + formatModel(child.items.fields, strIndent + " ", options);
532
- else
533
- result += ", " + comment;
534
- }
535
- }
536
-
537
- if (options.mode === "model" || options.mode === "model_null" || options.mode === "model_undefined") {
538
- return (strIndent ? "\r\n" + strIndent : "") + "{" + result + "\r\n" + strIndent + "}";
539
- }
540
-
541
- return result;
542
- }
543
- function toCachePolicyString(cachePolicy) {
544
- if (cachePolicy === undefined || cachePolicy === null || cachePolicy === "unset") return "Không thiết lập cấu hình";
545
- if (cachePolicy === "required") return "Bắt buộc phải cache";
546
- if (cachePolicy === "allow") return "Cho phép";
547
- if (cachePolicy === "disabled") return "Bắt buộc không được cache";
548
- return "";
549
- }
550
- function getModelInput(excludedFields, fields, options) {
551
- fields = JSON.parse(JSON.stringify(fields));
552
- if (!fields)
553
- return "";
554
-
555
- options = options || {};
556
-
557
- fields.id = fields.id || {};
558
- fields.id.type = fields.id.type || "AutoId";
559
- fields.id.validation = fields.id.validation || {};
560
- fields.id.validation.required = true;
561
-
562
- if (excludedFields && Array.isArray(excludedFields)) {
563
- if (options.excludeId && fields.id.type === "AutoId")
564
- excludedFields.push("id");
565
-
566
- excludedFields.forEach((item) => {
567
- let obj = fields;
568
- const segs = item.split(".");
569
- for (let i = 0; i < segs.length; i++) {
570
- if (!obj) return;
571
- const seg = segs[i];
572
- if (!(seg in obj))
573
- return;
574
-
575
- if (i === segs.length - 1)
576
- delete obj[seg];
577
- else if (obj[seg].type === "object")
578
- obj = obj[seg].fields;
579
- else if (obj[seg].type === "array")
580
- obj = obj[seg].items?.fields;
581
- else
582
- return;
583
- }
584
- });
585
- }
586
-
587
- return formatModel(fields, "", { showValidation: true, optionalToAll: options.optionalToAll, mode: options.mode }).trim();
588
- }
589
- function formatHintModel(obj, strIndent, options) {
590
- if (!obj)
591
- return "";
592
-
593
- strIndent = strIndent || "";
594
- options = options || {};
595
-
596
- var result = "";
597
- var nextIndent = strIndent + " ";
598
- for (var m in obj) {
599
- if (!obj.hasOwnProperty(m))
600
- continue;
601
-
602
- var child = obj[m];
603
-
604
- var validation = !options.optionalToAll && child.required ? "required" : "optional";
605
- if (child.type === "IdRef" && child.reference) {
606
- validation += ", ref: <a href='#" + encodeHtml(child.reference) + "' onclick='setTimeout(gotoHash, 20)'>" + encodeHtml(child.reference) + "</a>";
607
- }
608
-
609
- if (child.validValues && Array.isArray(child.validValues)) {
610
- validation += ", enum(" + encodeHtml(child.validValues.join(", ")) + ")";
611
- }
612
-
613
- if (child.type === "array" && child.items && child.items.type != "object") {
614
- validation += ", array items: " + (!options.optionalToAll && child.items.required ? "required" : "optional");
615
- if (child.items.validValues && Array.isArray(child.items.validValues))
616
- validation += ", enum(" + encodeHtml(child.items.validValues.join(", ")) + ")";
617
- }
618
-
619
- var comment = `<span class="code-comment">// ${validation} ${typeof child.description === "string" && child.description !== "" ? "- " + encodeHtml(child.description) : ""}</span>`;
620
-
621
- if (options.mode === "model") {
622
- if (child.type === "object")
623
- result += "\r\n" + nextIndent + '"' + m + '": ' + comment + formatHintModel(child.fields, nextIndent, options) + ",";
624
- else if (child.type === "array") {
625
- result += `\r\n${nextIndent}"${m}": [`;
626
- if (child.items.type === "object")
627
- result += " " + comment + formatHintModel(child.items.fields, nextIndent, options);
628
- else if (child.items.type === "datetime")
629
- result += `\r\n${nextIndent} ` + JSON.stringify(child.items.defaultValue || "ISODate_ISO_8601") + " " + comment + `\r\n${nextIndent}`;
630
- else if (child.items.type === "boolean")
631
- result += `\r\n${nextIndent} ` + child.items.defaultValue || "false" + " " + comment + `\r\n${nextIndent}`;
632
- else if (child.items.type === "integer" || child.items.type === "long"|| child.items.type === "double")
633
- result += `\r\n${nextIndent} ` + child.items.defaultValue || "0" + " " + comment + `\r\n${nextIndent}`;
634
- else
635
- result += `\r\n${nextIndent} ` + JSON.stringify(child.defaultValue || child.type) + " " + comment + `\r\n${nextIndent}`;
636
- result += `]`;
637
- }
638
- else if (child.type === "datetime")
639
- result += `\r\n${nextIndent}"${m}": ` + JSON.stringify(child.defaultValue || "ISODate_ISO_8601") + ", " + comment;
640
- else if (child.type === "boolean")
641
- result += `\r\n${nextIndent}"${m}": ` + (child.defaultValue || "false") + ", " + comment;
642
- else if (child.type === "integer" || child.type === "long"|| child.type === "double")
643
- result += `\r\n${nextIndent}"${m}": ` + (child.defaultValue || "0") + ", " + comment;
644
- else
645
- result += `\r\n${nextIndent}"${m}": ` + JSON.stringify(child.defaultValue || child.type) + ", " + comment;
646
- } else if (options.mode === "model_null") {
647
- if (child.type === "object")
648
- result += "\r\n" + nextIndent + '"' + m + '": ' + comment + formatHintModel(child.fields, nextIndent, options);
649
- else if (child.type === "array") {
650
- result += `\r\n${nextIndent}"${m}": [`;
651
- if (child.items.type === "object")
652
- result += " " + comment + formatHintModel(child.items.fields, nextIndent, options) + "],";
653
- else
654
- result += "], " + comment;
655
- }
656
- else
657
- result += `\r\n${nextIndent}"${m}": null, ${comment}`;
658
- } else if (options.mode === "model_undefined") {
659
- if (child.type === "object")
660
- result += "\r\n" + nextIndent + '"' + m + '": ' + comment + formatHintModel(child.fields, nextIndent, options);
661
- else if (child.type === "array") {
662
- result += `\r\n${nextIndent}"${m}": [`;
663
- if (child.items.type === "object")
664
- result += " " + comment + formatHintModel(child.items.fields, nextIndent, options) + "], ";
665
- else
666
- result += "], " + comment;
667
- }
668
- else
669
- result += `\r\n${nextIndent}"${m}": undefined, ${comment}`;
670
- } else {
671
- result += "\r\n" + strIndent + encodeHtml(m) + ": " + encodeHtml(child.type);
672
- if (child.type === "array")
673
- result += child.items.type === "object" ? " of object" : " of " + child.items.type;
674
- if (child.type === "object")
675
- result += " " + comment + formatHintModel(child.fields, strIndent + " ", options);
676
- else if (child.type === "array" && child.items.type === "object")
677
- result += " " + comment + formatHintModel(child.items.fields, strIndent + " ", options);
678
- else
679
- result += ", " + comment;
680
- }
681
- }
682
-
683
- if (options.mode === "model" || options.mode === "model_null" || options.mode === "model_undefined") {
684
- return (strIndent ? "\r\n" + strIndent : "") + "{" + result + "\r\n" + strIndent + "}";
685
- }
686
-
687
- return result;
688
- }
689
-
690
- function renderInfo() {
691
- document.title = document.querySelector("#project-title").innerText = window.docs.info.name + " API document";
692
- document.querySelector("#project-rootUrl").innerText = window.docs.info.rootUrl;
693
- document.querySelector("#project-description").innerText = window.docs.info.description;
694
-
695
- document.querySelector("#project-roles").innerHTML = window.docs.roles.map(role => renderTemplate("template-project-role", role)).join("");
696
-
697
- if (window.docs.info.security?.crossDomain === false) {
698
- document.querySelector("#project-security-crossDomain-false").style.display = "block";
699
- }
700
- if (window.docs.info.security?.crossDomain === true && Array.isArray(window.docs.info.security.allowOrigins) && window.docs.info.security.allowOrigins.length && !window.docs.info.security.allowOrigins.includes("*")) {
701
- document.querySelector("#project-security-allowOrigins").style.display = "block";
702
- document.querySelector("#project-security-allowOrigins ul").innerHTML = window.docs.info.security.allowOrigins.map(origin => renderTemplate("template-li-code", {value: origin})).join("");
703
- }
704
- }
705
-
706
- function renderEnvironmentVariables() {
707
- document.querySelector("#extension-env-vars").innerHTML = renderTemplate("template-project-environmentVariables");
708
- if (!window.docs.environmentVariables) return;
709
- const keys = Object.keys(window.docs.environmentVariables);
710
- if (!keys.length) return;
711
-
712
- document.querySelector("#extension-env-vars-custom").innerHTML = keys.map(name => renderTemplate("template-project-environmentVariables-custom", {
713
- name,
714
- description: window.docs.environmentVariables[name].description,
715
- type: window.docs.environmentVariables[name].type
716
- })).join("");
717
- }
718
-
719
- function renderExtensionAuth() {
720
- if (!window.docs.features?.includes("auth")) return;
721
- document.querySelector("#extension-auth").innerHTML = renderTemplate("template-extension-DefaultAuth-module", {
722
- rootUrl: window.docs.info.rootUrl,
723
- rootUrlPath: getApiPath(window.docs.info.rootUrl),
724
- domain: getApiDomain(window.docs.info.rootUrl)
725
- });
726
- }
727
-
728
- function renderExtensionFile() {
729
- if (!window.docs.features?.includes("file")) return;
730
- document.querySelector("#extension-file").innerHTML = renderTemplate("template-extension-File-module", {
731
- rootUrl: window.docs.info.rootUrl,
732
- rootUrlPath: getApiPath(window.docs.info.rootUrl),
733
- domain: getApiDomain(window.docs.info.rootUrl)
734
- });
735
- }
736
-
737
- function renderExtensionMail() {
738
- if (!window.docs.features?.includes("mail")) return;
739
- document.querySelector("#extension-mailing").innerHTML = renderTemplate("template-extension-Mailing-module", {
740
- rootUrl: window.docs.info.rootUrl,
741
- rootUrlPath: getApiPath(window.docs.info.rootUrl),
742
- domain: getApiDomain(window.docs.info.rootUrl)
743
- });
744
- }
745
-
746
- function renderClientDrivers() {
747
- if (!window.docs.features?.includes("driver")) return;
748
- document.querySelector("#extension-client-drivers").innerHTML = renderTemplate("template-client-drivers");
749
- }
750
-
751
- function renderEntities() {
752
- if (!window.docs.entities ||typeof window.docs.entities !== "object" ) return;
753
- document.querySelector("#project-entities").innerHTML = Object.values(window.docs.entities).map(entity => renderTemplate("template-project-entity", entity)).join("");
754
- }
755
-
756
- function renderEntity(entityName) {
757
- if (this.dataset.rendered) return;
758
- this.dataset.rendered = true
759
- const entity = window.docs.entities[entityName];
760
- if (!entity) return;
761
- if (entity.actions && typeof(entity.actions) === "object") {
762
- const dom = this.parentNode.querySelector(".project-entity-actions");
763
- dom.innerHTML = Object.keys(entity.actions).map(actionName => renderTemplate("template-project-entity-actions", {
764
- entityName: entity.name,
765
- actionName,
766
- className: getPanelClass(actionName),
767
- actionHttpMethod: getHttpMethod(actionName),
768
- actionApiUrl: getApiUrl(actionName, window.docs.info.rootUrl, entity.name),
769
- actionDescription: getDescriptionByActionName(actionName, entity.name)
770
- })).join("");
771
- initDom(dom);
772
- }
773
-
774
- if (entity.views && typeof(entity.views) === "object") {
775
- const dom = this.parentNode.querySelector(".project-entity-views");
776
- dom.innerHTML = Object.keys(entity.views).map(viewName => renderTemplate("template-project-entity-views", {
777
- entityName: entity.name,
778
- viewName,
779
- actionApiUrl: getApiViewUrl(window.docs.info.rootUrl, entity.name, viewName),
780
- description: entity.views[viewName]?.[0]?.description ?? ""
781
- })).join("");
782
- initDom(dom);
783
- }
784
- }
785
-
786
- function renderEntityAction(entityName, actionName) {
787
- if (this.dataset.rendered) return;
788
- this.dataset.rendered = true;
789
-
790
- const entity = window.docs.entities[entityName];
791
- const actionRoles = entity.actions[actionName];
792
-
793
- const navTabs = this.parentNode.querySelector(".nav-tabs");
794
-
795
- navTabs.innerHTML = actionRoles.map(actionRole => renderTemplate("template-project-entity-action-role", {
796
- explainedRole: explainRoles(actionRole.grant),
797
- entityName,
798
- actionName,
799
- grant: actionRole.grant
800
- })).join("");
801
-
802
- initDom(navTabs);
803
-
804
- activeFirstChild.call(navTabs);
805
- }
806
-
807
- function renderEntityActionRolePage(entityName, actionName, grant) {
808
- if (this.dataset.rendered) return;
809
- this.dataset.rendered = true
810
-
811
- const entity = window.docs.entities[entityName];
812
- const action = entity.actions[actionName].find(a => a.grant === grant);
813
-
814
- const tabPages = this.parentNode.parentNode.parentNode.querySelector(".tab-pages");
815
- tabPages.innerHTML += renderTemplate("template-project-entity-action-page", { grant });
816
-
817
- let template;
818
- let callback;
819
- let codeSnippetName = actionName;
820
- switch (actionName) {
821
- case "findMany":
822
- template = "template-findMany"
823
- callback = renderFindMany;
824
- break;
825
- case "findById":
826
- template = "template-findById"
827
- callback = renderFindById;
828
- break;
829
- case "createOne":
830
- template = "template-createOne"
831
- callback = renderCreateOne;
832
- break;
833
- case "createMany":
834
- template = "template-createMany"
835
- callback = renderCreateMany;
836
- break;
837
- case "updateOne":
838
- template = "template-updateOne"
839
- callback = renderUpdateOne;
840
- break;
841
- case "updateMany":
842
- template = "template-updateMany"
843
- callback = renderUpdateMany;
844
- break;
845
- case "updatePartially":
846
- template = "template-updatePartially"
847
- callback = renderUpdatePartially;
848
- break;
849
- case "deleteOne":
850
- template = "template-deleteOne"
851
- callback = renderDeleteOne;
852
- break;
853
- case "deleteMany":
854
- template = "template-deleteMany"
855
- callback = renderDeleteMany;
856
- break;
857
- default:
858
- template = "template-generalAction"
859
- callback = renderGeneralAction;
860
- codeSnippetName = "generalAction";
861
- break;
862
- }
863
- const tabPage = Array.prototype.find.call(tabPages.querySelectorAll(".tab-page"), dom => dom.dataset?.role == action.grant);
864
- if (!tabPage) return;
865
- const args = {
866
- tabPage,
867
- action,
868
- actionName,
869
- entity,
870
- entityName,
871
- EntityName: toCSharpName(entityName),
872
- domain: getApiDomain(window.docs.info.rootUrl),
873
- rootUrlPath: getApiPath(window.docs.info.rootUrl),
874
- };
875
- const snippet = window.codeSnippets[codeSnippetName] ?? {};
876
- const data = {
877
- explainedDenyRoles: explainRoles(action.deny),
878
- entityName,
879
- codeSnippetTabHeaders: Object.keys(snippet).map((lang, idx) => `<li role="presentation" ${idx ? '' : 'class="active"'}><a data-role="${lang}" onclick="activeRoleTab.call(this)">${lang}</a></li>`).join(""),
880
- codeSnippetTabPages: Object.keys(snippet).map((lang, idx) => `<div class="tab-page ${lang} ${idx ? '' : 'active'}" data-role="${lang}">${snippet[lang]?.call(null, args) ?? ''}</div>`).join(""),
881
- EntityName: args.EntityName,
882
- domain: args.domain,
883
- rootUrlPath: args.rootUrlPath,
884
- description: action.description
885
- };
886
- tabPage.innerHTML = renderTemplate(template, data) + renderTemplate("template-project-entity-action-page-codeSnippets", data);
887
- initDom(tabPage);
888
- if (!action.deny) tabPage.querySelector(".deny-roles")?.remove();
889
-
890
- if (!action.matches || !Array.isArray(action.matches) || !action.matches.length) tabPage.querySelector(".matches")?.remove();
891
- else {
892
- if (action.matches.length === 1) {
893
- tabPage.querySelector(".matches .matches-length-gt-1")?.remove();
894
- }
895
- const dom = tabPage.querySelector(".matches .match-conditions");
896
- if (dom) {
897
- dom.innerHTML = action.matches.map(m => renderTemplate("template-li-code", {value: m})).join("");
898
- }
899
- }
900
- if (!action.description) {
901
- tabPage.querySelector(".description")?.remove();
902
- }
903
- callback(args);
904
- }
905
-
906
- function renderFindMany(args) {
907
- if (Array.isArray(args.action.returnableFields)) {
908
- args.tabPage.querySelector(".output-without-fields").innerHTML = getModelOutput(args.action.defaultFields, args.entity.fields);
909
- args.tabPage.querySelector(".field-list").innerHTML = args.action.returnableFields.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join("");
910
- args.tabPage.querySelector(".output-with-fields").innerHTML = getModelOutput(args.action.returnableFields, args.entity.fields);
911
- }
912
-
913
- if (!args.action.defaultFilters && !args.action.allowFilteringFields && !args.action.requiredFilteringFields && !args.entity.features?.vn_text?.fields?.length) {
914
- args.tabPage.querySelector(".filters")?.remove()
915
- }
916
- else {
917
- if (Array.isArray(args.action.defaultFilters) && args.action.defaultFilters.length) {
918
- if (args.action.defaultFilters.length === 1) args.tabPage.querySelector(".defaultFilters-length-gt-1")?.remove();
919
- args.tabPage.querySelector(".defaultFilters-ul").innerHTML = args.action.defaultFilters.map(filter => renderTemplate("template-li-code", {value: filter})).join("");
920
- }
921
- else {
922
- args.tabPage.querySelector(".defaultFilters")?.remove();
923
- }
924
-
925
- if (Array.isArray(args.action.allowFilteringFields) && args.action.allowFilteringFields.length) {
926
- args.tabPage.querySelector(".allowFilteringFields-list").innerHTML = args.action.allowFilteringFields.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(" ");
927
- }
928
- else {
929
- args.tabPage.querySelector(".allowFilteringFields")?.remove();
930
- }
931
-
932
- if (Array.isArray(args.action.requiredFilteringFields) && args.action.requiredFilteringFields.length) {
933
- args.tabPage.querySelector(".requiredFilteringFields-list").innerHTML = args.action.requiredFilteringFields.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(" ");
934
- }
935
- else {
936
- args.tabPage.querySelector(".requiredFilteringFields")?.remove();
937
- }
938
-
939
- if (args.entity.features?.vn_text?.fields?.length) {
940
- args.tabPage.querySelector(".features-vn_text-fields-channel-default-fields").innerHTML = args.entity.features.vn_text.fields.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(" ");
941
-
942
- if (args.entity.features?.vn_text?.channels?.length) {
943
- args.tabPage.querySelector(".features-vn_text-channels-list").innerHTML = args.entity.features.vn_text.channels.map(channel => renderTemplate("template-findMany-vn_text-channel", {
944
- name: channel.name,
945
- htmlFields: channel.fields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(" ")
946
- })).join("");
947
- }
948
- }
949
- else {
950
- args.tabPage.querySelector(".features-vn_text-fields")?.remove();
951
- }
952
- }
953
-
954
- if (!args.action.allowSortings && !args.action.defaultSortings) {
955
- args.tabPage.querySelector(".sort")?.remove()
956
- }
957
- else {
958
- if (Array.isArray(args.action.allowSortings) && args.action.allowSortings.length) {
959
- args.tabPage.querySelector(".allowSortings-fields").innerHTML = args.action.allowSortings.map(item => renderTemplate("template-findMany-sorting", {
960
- field: item.field,
961
- sortType: item.type === "Both"
962
- ? "Cả TĂNG dần và GIẢM dần"
963
- : item.type === "Asc"
964
- ? "Chỉ TĂNG dần"
965
- : item.type === "Desc"
966
- ? "Chỉ GIẢM dần"
967
- : item.type === undefined || item.type === null
968
- ? "Chỉ TĂNG dần"
969
- : ""
970
- })).join("");
971
- }
972
- else {
973
- args.tabPage.querySelector(".defaultFilters")?.remove();
974
- }
975
-
976
- if (Array.isArray(args.action.defaultSortings) && args.action.defaultSortings.length) {
977
- args.tabPage.querySelector(".defaultSortings-fields").innerHTML = args.action.defaultSortings.map(item => renderTemplate("template-findMany-sorting", {
978
- field: item.field,
979
- sortType: item.type === "Asc"
980
- ? "TĂNG dần"
981
- : item.type === "Desc"
982
- ? "GIẢM dần"
983
- : item.type === undefined || item.type === null
984
- ? "TĂNG dần"
985
- : ""
986
- })).join("");
987
- }
988
- else {
989
- args.tabPage.querySelector(".defaultSortings")?.remove();
990
- }
991
- }
992
-
993
- args.tabPage.querySelector(".paging").innerHTML = renderTemplate("template-findMany-paging", {
994
- strPagingType: args.action.pagingType === undefined || args.action.pagingType === null || args.action.pagingType === "None"
995
- ? "Không phân trang"
996
- : args.action.pagingType === "LimitOffset"
997
- ? "Theo limit, offset"
998
- : args.action.pagingType === "Page"
999
- ? "Theo page number"
1000
- : "",
1001
- entityName: args.entityName,
1002
- maxPageSize: args.action.maxPageSize,
1003
- maxRecordCount: args.action.maxPageSize === undefined || args.action.maxPageSize === null
1004
- ? (args.action.pageSize ?? 25)
1005
- : Math.min(args.action.maxPageSize, args.action.pageSize ?? 25)
1006
- });
1007
-
1008
- if (args.action.pagingType === undefined || args.action.pagingType === null || args.action.pagingType === "None") {
1009
- args.tabPage.querySelector(".pagingType-ne-None")?.remove();
1010
- } else if (args.action.maxPageSize === undefined || args.action.maxPageSize === null) {
1011
- args.tabPage.querySelector(".maxPageSize")?.remove();
1012
- }
1013
-
1014
- if (args.action.includeTotal !== true) {
1015
- args.tabPage.querySelector(".includeTotal")?.remove();
1016
- }
1017
-
1018
- if (args.action.cache?.enable !== true) {
1019
- args.tabPage.querySelector(".cache")?.remove();
1020
- } else {
1021
- args.tabPage.querySelector(".cache").innerHTML = renderTemplate("template-findMany-cache", {
1022
- serverPolicy: toCachePolicyString(args.action.cache?.server?.policy),
1023
- clientPolicy: toCachePolicyString(args.action.cache?.client?.policy)
1024
- })
1025
- }
1026
- }
1027
-
1028
- function renderFindById(args) {
1029
- if (Array.isArray(args.action.returnableFields)) {
1030
- args.tabPage.querySelector(".output-without-fields").innerHTML = getModelOutput(args.action.defaultFields, args.entity.fields);
1031
- args.tabPage.querySelector(".field-list").innerHTML = args.action.returnableFields.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join("");
1032
- args.tabPage.querySelector(".output-with-fields").innerHTML = getModelOutput(args.action.returnableFields, args.entity.fields);
1033
- }
1034
-
1035
- if (args.action.cache?.enable !== true) {
1036
- args.tabPage.querySelector(".cache")?.remove();
1037
- } else {
1038
- args.tabPage.querySelector(".cache").innerHTML = renderTemplate("template-findMany-cache", {
1039
- serverPolicy: toCachePolicyString(args.action.cache?.server?.policy),
1040
- clientPolicy: toCachePolicyString(args.action.cache?.client?.policy)
1041
- })
1042
- }
1043
- }
1044
-
1045
- function renderCreateOne(args) {
1046
- args.tabPage.querySelector(".input-model").innerHTML = getModelInput(args.action.exclude, args.entity.fields, {"excludeId": true});
1047
- }
1048
-
1049
- function renderCreateMany(args) {
1050
- args.tabPage.querySelector(".input-model").innerHTML = getModelInput(args.action.exclude, args.entity.fields, {"excludeId": true});
1051
- }
1052
-
1053
- function renderUpdateOne(args) {
1054
- args.tabPage.querySelector(".input-model").innerHTML = getModelInput(args.action.exclude, args.entity.fields);
1055
- }
1056
-
1057
- function renderUpdateMany(args) {
1058
- args.tabPage.querySelector(".input-model").innerHTML = getModelInput(args.action.exclude, args.entity.fields);
1059
- }
1060
-
1061
- function renderUpdatePartially(args) {
1062
- args.tabPage.querySelector(".input-model").innerHTML = getModelInput(args.action.exclude, args.entity.fields, {optionalToAll: true});
1063
- }
1064
-
1065
- function renderDeleteOne(args) {
1066
-
1067
- }
1068
-
1069
- function renderDeleteMany(args) {
1070
-
1071
- }
1072
-
1073
- function renderGeneralAction(args) {
1074
- if (args.action?.codeHint?.delegator?.param?.fields) {
1075
- args.tabPage.querySelector(".query-string-model").innerHTML = formatHintModel(args.action.codeHint.delegator.param.fields);
1076
- }
1077
- else {
1078
- args.tabPage.querySelector(".query-string")?.remove();
1079
- }
1080
- if (args.action?.codeHint?.delegator?.requestBody?.fields) {
1081
- args.tabPage.querySelector(".request-body-model").innerHTML = formatHintModel(args.action.codeHint.delegator.requestBody.fields);
1082
- }
1083
- else {
1084
- args.tabPage.querySelector(".request-body")?.remove();
1085
- }
1086
- }
1087
-
1088
- function renderEntityView(entityName, viewName) {
1089
- if (this.dataset.rendered) return;
1090
- this.dataset.rendered = true;
1091
-
1092
- const entity = window.docs.entities[entityName];
1093
- const viewRoles = entity.views[viewName];
1094
-
1095
- const navTabs = this.parentNode.querySelector(".nav-tabs");
1096
-
1097
- navTabs.innerHTML = viewRoles.map(viewRole => renderTemplate("template-project-entity-view-role", {
1098
- explainedRole: explainRoles(viewRole.grant),
1099
- entityName,
1100
- viewName,
1101
- grant: viewRole.grant
1102
- })).join("");
1103
- initDom(navTabs);
1104
- activeFirstChild.call(navTabs);
1105
- }
1106
-
1107
- function renderEntityViewRolePage(entityName, viewName, grant) {
1108
- if (this.dataset.rendered) return;
1109
- this.dataset.rendered = true
1110
-
1111
- const entity = window.docs.entities[entityName];
1112
- const view = entity.views[viewName].find(a => a.grant === grant);
1113
-
1114
- const tabPages = this.parentNode.parentNode.parentNode.querySelector(".tab-pages");
1115
- tabPages.innerHTML += renderTemplate("template-project-entity-view-page", { grant });
1116
-
1117
- const tabPage = Array.prototype.find.call(tabPages.querySelectorAll(".tab-page"), dom => dom.dataset?.role == view.grant);
1118
- if (!tabPage) return;
1119
- const args = {
1120
- tabPage,
1121
- view,
1122
- viewName,
1123
- entity,
1124
- entityName,
1125
- EntityName: toCSharpName(entityName),
1126
- domain: getApiDomain(window.docs.info.rootUrl),
1127
- rootUrlPath: getApiPath(window.docs.info.rootUrl),
1128
- };
1129
- const snippet = window.codeSnippets.view;
1130
- const data = {
1131
- explainedDenyRoles: explainRoles(view.deny),
1132
- entityName,
1133
- viewName,
1134
- codeSnippetTabHeaders: Object.keys(snippet).map((lang, idx) => `<li role="presentation" ${idx ? '' : 'class="active"'}><a data-role="${lang}" onclick="activeRoleTab.call(this)">${lang}</a></li>`).join(""),
1135
- codeSnippetTabPages: Object.keys(snippet).map((lang, idx) => `<div class="tab-page ${lang} ${idx ? '' : 'active'}" data-role="${lang}">${snippet[lang]?.call(null, args) ?? ''}</div>`).join(""),
1136
- description: view.description,
1137
- outputModel: formatHintModel(view.codeHint?.output?.fields),
1138
- outputEmptyResult: JSON.stringify(view.emptyResult, null, 4)
1139
- };
1140
- tabPage.innerHTML = renderTemplate("template-view", data) + renderTemplate("template-project-entity-view-page-codeSnippets", data);
1141
- initDom(tabPage);
1142
- if (!view.deny) tabPage.querySelector(".deny-roles")?.remove();
1143
-
1144
- if (!Array.isArray(view.parameters) || !view.parameters.length) {
1145
- tabPage.querySelector(".parameters-input-pane")?.remove();
1146
- }
1147
- else {
1148
- tabPage.querySelector(".parameters-list").innerHTML = view.parameters.map(p => renderTemplate("template-view-parameters", {
1149
- field: p.field,
1150
- type: (p.isArray ? "array of " : "") + (p.type ?? "string"),
1151
- description: p.description ?? "",
1152
- defaultValue: p.defaultValue ? `, default (${p.defaultValue})` : "",
1153
- required: p.required ? "required" : "optional"
1154
- })).join("");
1155
- }
1156
- if (!view.codeHint?.output?.fields) {
1157
- tabPage.querySelector(".output-model")?.remove();
1158
- }
1159
- if (!view.emptyResult) {
1160
- tabPage.querySelector(".output-epmty-result")?.remove();
1161
- }
1162
- if (!view.codeHint?.output?.fields && !view.emptyResult) {
1163
- tabPage.querySelector(".output-pane")?.remove();
1164
- }
1165
-
1166
- if (!view.description) {
1167
- tabPage.querySelector(".description")?.remove();
1168
- }
1169
- //callback(args);
1170
- }
1171
-
1172
- window.codeSnippets = {
1173
- findMany: {
1174
- Javascript: (args) => renderTemplate("template-codeSnippets-findMany-Javascript", {
1175
- entityName: args.entityName,
1176
- allowPagingDisplay: args.action.pagingType && args.action.pagingType != 'None' ? 'inline' : 'none',
1177
- includeTotalDisplay: args.action.includeTotal ? 'inline' : 'none',
1178
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1179
- allowSortingsDisplay: args.action.allowSortings ? 'inline' : 'none',
1180
- sortFields: args.action.allowSortings?.map(sort => (sort.type === "Desc" ? '-' : '') + renderTemplate("template-fields-inline", {fieldName: sort.field})).join(""),
1181
- limitDisplay: args.action.pagingType === "LimitOffset" || args.action.pagingType === "Page" ? 'inline' : 'none',
1182
- offsetDisplay: args.action.pagingType === "LimitOffset" ? 'inline' : 'none',
1183
- pageDisplay: args.action.pagingType === "Page" ? 'inline' : 'none',
1184
- vnTextDisplay: args.entity.features?.vn_text?.fields?.length ? 'inline' : 'none',
1185
- vnTextFields: args.entity.features?.vn_text?.fields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1186
- countAsyncDisplay: args.action.includeTotal ? 'inline' : 'none'
1187
- }),
1188
- JavascriptModel: (args) => renderTemplate("template-codeSnippets-findMany-JavascriptModel", {
1189
- undefinedModel: getModelOutput(args.action.returnableFields, args.entity.fields, {mode: "model_undefined"}),
1190
- valueModel: getModelOutput(args.action.returnableFields, args.entity.fields, {mode: "model"}),
1191
- nullModel: getModelOutput(args.action.returnableFields, args.entity.fields, {mode: "model_null"})
1192
- }),
1193
- CSharp: (args) => renderTemplate("template-codeSnippets-findMany-CSharp", {
1194
- entityName: args.entityName,
1195
- EntityName: args.EntityName,
1196
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1197
- sortFields: args.action.allowSortings?.map(sort => (sort.type === "Desc" ? '-' : '') + renderTemplate("template-fields-inline", {fieldName: sort.field})).join("")
1198
- }),
1199
- HTTP: (args) => renderTemplate("template-codeSnippets-findMany-HTTP", {
1200
- domain: args.domain,
1201
- rootUrlPath: args.rootUrlPath,
1202
- entityName: args.entityName,
1203
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1204
- allowSortingsDisplay: args.action.allowSortings ? 'inline' : 'none',
1205
- sortFields: args.action.allowSortings?.map(sort => (sort.type === "Desc" ? '-' : '') + renderTemplate("template-fields-inline", {fieldName: sort.field})).join(""),
1206
- limitOffsetDisplay: args.action.pagingType === "LimitOffset" ? 'inline' : 'none',
1207
- pageDisplay: args.action.pagingType === "Page" ? 'inline' : 'none',
1208
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none',
1209
- }),
1210
- cURL: (args) => renderTemplate("template-codeSnippets-findMany-cURL", {
1211
- rootUrl: window.docs.info.rootUrl,
1212
- entityName: args.entityName,
1213
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none',
1214
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1215
- allowSortingsDisplay: args.action.allowSortings ? 'inline' : 'none',
1216
- sortFields: args.action.allowSortings?.map(sort => (sort.type === "Desc" ? '-' : '') + renderTemplate("template-fields-inline", {fieldName: sort.field})).join(""),
1217
- limitOffsetDisplay: args.action.pagingType === "LimitOffset" ? 'inline' : 'none',
1218
- pageDisplay: args.action.pagingType === "Page" ? 'inline' : 'none',
1219
- }),
1220
- Java: (args) => renderTemplate("template-codeSnippets-findMany-Java", {
1221
- entityName: args.entityName,
1222
- EntityName: args.EntityName,
1223
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1224
- allowSortingsDisplay: args.action.allowSortings ? 'inline' : 'none',
1225
- sortFields: args.action.allowSortings?.map(sort => (sort.type === "Desc" ? '-' : '') + renderTemplate("template-fields-inline", {fieldName: sort.field})).join(""),
1226
- }),
1227
- JavaAsync: (args) => renderTemplate("template-codeSnippets-findMany-JavaAsync", {
1228
- entityName: args.entityName,
1229
- EntityName: args.EntityName,
1230
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1231
- allowSortingsDisplay: args.action.allowSortings ? 'inline' : 'none',
1232
- sortFields: args.action.allowSortings?.map(sort => (sort.type === "Desc" ? '-' : '') + renderTemplate("template-fields-inline", {fieldName: sort.field})).join(""),
1233
- })
1234
- },
1235
- findById: {
1236
- Javascript: (args) => renderTemplate("template-codeSnippets-findById-Javascript", {
1237
- entityName: args.entityName,
1238
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join("")
1239
- }),
1240
- JavascriptModel: (args) => renderTemplate("template-codeSnippets-findById-JavascriptModel", {
1241
- undefinedModel: getModelOutput(args.action.returnableFields, args.entity.fields, {mode: "model_undefined"}),
1242
- valueModel: getModelOutput(args.action.returnableFields, args.entity.fields, {mode: "model"}),
1243
- nullModel: getModelOutput(args.action.returnableFields, args.entity.fields, {mode: "model_null"})
1244
- }),
1245
- CSharp: (args) => renderTemplate("template-codeSnippets-findById-CSharp", {
1246
- entityName: args.entityName,
1247
- EntityName: args.EntityName,
1248
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join("")
1249
- }),
1250
- HTTP: (args) => renderTemplate("template-codeSnippets-findById-HTTP", {
1251
- domain: args.domain,
1252
- rootUrlPath: args.rootUrlPath,
1253
- entityName: args.entityName,
1254
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join(""),
1255
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1256
- }),
1257
- cURL: (args) => renderTemplate("template-codeSnippets-findById-cURL", {
1258
- rootUrl: window.docs.info.rootUrl,
1259
- entityName: args.entityName,
1260
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none',
1261
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join("")
1262
- }),
1263
- Java: (args) => renderTemplate("template-codeSnippets-findById-Java", {
1264
- entityName: args.entityName,
1265
- EntityName: args.EntityName,
1266
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join("")
1267
- }),
1268
- JavaAsync: (args) => renderTemplate("template-codeSnippets-findById-JavaAsync", {
1269
- entityName: args.entityName,
1270
- EntityName: args.EntityName,
1271
- fields: args.action.returnableFields?.map(fieldName => renderTemplate("template-fields-inline", {fieldName})).join("")
1272
- })
1273
- },
1274
- createOne: {
1275
- Javascript: (args) => renderTemplate("template-codeSnippets-createOne-Javascript", {
1276
- entityName: args.entityName
1277
- }),
1278
- JavascriptModel: (args) => renderTemplate("template-codeSnippets-createOne-JavascriptModel", {
1279
- undefinedModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_undefined", excludeId: true}),
1280
- valueModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model", excludeId: true}),
1281
- nullModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_null", excludeId: true})
1282
- }),
1283
- CSharp: (args) => renderTemplate("template-codeSnippets-createOne-CSharp", {
1284
- entityName: args.entityName,
1285
- EntityName: args.EntityName
1286
- }),
1287
- HTTP: (args) => renderTemplate("template-codeSnippets-createOne-HTTP", {
1288
- domain: args.domain,
1289
- rootUrlPath: args.rootUrlPath,
1290
- entityName: args.entityName,
1291
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1292
- }),
1293
- cURL: (args) => renderTemplate("template-codeSnippets-createOne-cURL", {
1294
- rootUrl: window.docs.info.rootUrl,
1295
- entityName: args.entityName,
1296
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1297
- }),
1298
- Java: (args) => renderTemplate("template-codeSnippets-createOne-Java", {
1299
- entityName: args.entityName,
1300
- EntityName: args.EntityName
1301
- }),
1302
- JavaAsync: (args) => renderTemplate("template-codeSnippets-createOne-JavaAsync", {
1303
- entityName: args.entityName,
1304
- EntityName: args.EntityName
1305
- })
1306
- },
1307
- createMany: {
1308
- Javascript: (args) => renderTemplate("template-codeSnippets-createMany-Javascript", {
1309
- entityName: args.entityName
1310
- }),
1311
- JavascriptModel: (args) => renderTemplate("template-codeSnippets-createMany-JavascriptModel", {
1312
- undefinedModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_undefined", excludeId: true}),
1313
- valueModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model", excludeId: true}),
1314
- nullModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_null", excludeId: true})
1315
- }),
1316
- CSharp: (args) => renderTemplate("template-codeSnippets-createMany-CSharp", {
1317
- entityName: args.entityName,
1318
- EntityName: args.EntityName
1319
- }),
1320
- HTTP: (args) => renderTemplate("template-codeSnippets-createMany-HTTP", {
1321
- domain: args.domain,
1322
- rootUrlPath: args.rootUrlPath,
1323
- entityName: args.entityName,
1324
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1325
- }),
1326
- cURL: (args) => renderTemplate("template-codeSnippets-createMany-cURL", {
1327
- rootUrl: window.docs.info.rootUrl,
1328
- entityName: args.entityName,
1329
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1330
- }),
1331
- Java: (args) => renderTemplate("template-codeSnippets-createMany-Java", {
1332
- entityName: args.entityName,
1333
- EntityName: args.EntityName
1334
- }),
1335
- JavaAsync: (args) => renderTemplate("template-codeSnippets-createMany-JavaAsync", {
1336
- entityName: args.entityName,
1337
- EntityName: args.EntityName
1338
- })
1339
- },
1340
- updateOne: {
1341
- Javascript: (args) => renderTemplate("template-codeSnippets-updateOne-Javascript", {
1342
- entityName: args.entityName
1343
- }),
1344
- JavascriptModel: (args) => renderTemplate("template-codeSnippets-updateOne-JavascriptModel", {
1345
- undefinedModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_undefined"}),
1346
- valueModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model"}),
1347
- nullModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_null"})
1348
- }),
1349
- CSharp: (args) => renderTemplate("template-codeSnippets-updateOne-CSharp", {
1350
- entityName: args.entityName,
1351
- EntityName: args.EntityName
1352
- }),
1353
- HTTP: (args) => renderTemplate("template-codeSnippets-updateOne-HTTP", {
1354
- domain: args.domain,
1355
- rootUrlPath: args.rootUrlPath,
1356
- entityName: args.entityName,
1357
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1358
- }),
1359
- cURL: (args) => renderTemplate("template-codeSnippets-updateOne-cURL", {
1360
- rootUrl: window.docs.info.rootUrl,
1361
- entityName: args.entityName,
1362
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1363
- }),
1364
- Java: (args) => renderTemplate("template-codeSnippets-updateOne-Java", {
1365
- entityName: args.entityName,
1366
- EntityName: args.EntityName
1367
- }),
1368
- JavaAsync: (args) => renderTemplate("template-codeSnippets-updateOne-JavaAsync", {
1369
- entityName: args.entityName,
1370
- EntityName: args.EntityName
1371
- })
1372
- },
1373
- updateMany: {
1374
- Javascript: (args) => renderTemplate("template-codeSnippets-updateMany-Javascript", {
1375
- entityName: args.entityName
1376
- }),
1377
- JavascriptModel: (args) => renderTemplate("template-codeSnippets-updateMany-JavascriptModel", {
1378
- undefinedModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_undefined"}),
1379
- valueModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model"}),
1380
- nullModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_null"})
1381
- }),
1382
- CSharp: (args) => renderTemplate("template-codeSnippets-updateMany-CSharp", {
1383
- entityName: args.entityName,
1384
- EntityName: args.EntityName
1385
- }),
1386
- HTTP: (args) => renderTemplate("template-codeSnippets-updateMany-HTTP", {
1387
- domain: args.domain,
1388
- rootUrlPath: args.rootUrlPath,
1389
- entityName: args.entityName,
1390
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1391
- }),
1392
- cURL: (args) => renderTemplate("template-codeSnippets-updateMany-cURL", {
1393
- rootUrl: window.docs.info.rootUrl,
1394
- entityName: args.entityName,
1395
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1396
- }),
1397
- Java: (args) => renderTemplate("template-codeSnippets-updateMany-Java", {
1398
- entityName: args.entityName,
1399
- EntityName: args.EntityName
1400
- }),
1401
- JavaAsync: (args) => renderTemplate("template-codeSnippets-updateMany-JavaAsync", {
1402
- entityName: args.entityName,
1403
- EntityName: args.EntityName
1404
- })
1405
- },
1406
- updatePartially: {
1407
- Javascript: (args) => renderTemplate("template-codeSnippets-updatePartially-Javascript", {
1408
- entityName: args.entityName
1409
- }),
1410
- JavascriptModel: (args) => renderTemplate("template-codeSnippets-updatePartially-JavascriptModel", {
1411
- undefinedModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_undefined", optionalToAll: true}),
1412
- valueModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model", optionalToAll: true}),
1413
- nullModel: getModelInput(args.action.exclude, args.entity.fields, {mode: "model_null", optionalToAll: true})
1414
- }),
1415
- CSharp: (args) => renderTemplate("template-codeSnippets-updatePartially-CSharp", {
1416
- entityName: args.entityName,
1417
- EntityName: args.EntityName
1418
- }),
1419
- HTTP: (args) => renderTemplate("template-codeSnippets-updatePartially-HTTP", {
1420
- domain: args.domain,
1421
- rootUrlPath: args.rootUrlPath,
1422
- entityName: args.entityName,
1423
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1424
- }),
1425
- cURL: (args) => renderTemplate("template-codeSnippets-updatePartially-cURL", {
1426
- rootUrl: window.docs.info.rootUrl,
1427
- entityName: args.entityName,
1428
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1429
- }),
1430
- Java: (args) => renderTemplate("template-codeSnippets-updatePartially-Java", {
1431
- entityName: args.entityName,
1432
- EntityName: args.EntityName
1433
- }),
1434
- JavaAsync: (args) => renderTemplate("template-codeSnippets-updatePartially-JavaAsync", {
1435
- entityName: args.entityName,
1436
- EntityName: args.EntityName
1437
- })
1438
- },
1439
- deleteOne: {
1440
- Javascript: (args) => renderTemplate("template-codeSnippets-deleteOne-Javascript", {
1441
- entityName: args.entityName
1442
- }),
1443
- CSharp: (args) => renderTemplate("template-codeSnippets-deleteOne-CSharp", {
1444
- entityName: args.entityName,
1445
- EntityName: args.EntityName
1446
- }),
1447
- HTTP: (args) => renderTemplate("template-codeSnippets-deleteOne-HTTP", {
1448
- domain: args.domain,
1449
- rootUrlPath: args.rootUrlPath,
1450
- entityName: args.entityName,
1451
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1452
- }),
1453
- cURL: (args) => renderTemplate("template-codeSnippets-deleteOne-cURL", {
1454
- rootUrl: window.docs.info.rootUrl,
1455
- entityName: args.entityName,
1456
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1457
- }),
1458
- Java: (args) => renderTemplate("template-codeSnippets-deleteOne-Java", {
1459
- entityName: args.entityName,
1460
- EntityName: args.EntityName
1461
- }),
1462
- JavaAsync: (args) => renderTemplate("template-codeSnippets-deleteOne-JavaAsync", {
1463
- entityName: args.entityName,
1464
- EntityName: args.EntityName
1465
- })
1466
- },
1467
- deleteMany: {
1468
- Javascript: (args) => renderTemplate("template-codeSnippets-deleteMany-Javascript", {
1469
- entityName: args.entityName
1470
- }),
1471
- CSharp: (args) => renderTemplate("template-codeSnippets-deleteMany-CSharp", {
1472
- entityName: args.entityName,
1473
- EntityName: args.EntityName
1474
- }),
1475
- HTTP: (args) => renderTemplate("template-codeSnippets-deleteMany-HTTP", {
1476
- domain: args.domain,
1477
- rootUrlPath: args.rootUrlPath,
1478
- entityName: args.entityName,
1479
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1480
- }),
1481
- cURL: (args) => renderTemplate("template-codeSnippets-deleteMany-cURL", {
1482
- rootUrl: window.docs.info.rootUrl,
1483
- entityName: args.entityName,
1484
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1485
- }),
1486
- Java: (args) => renderTemplate("template-codeSnippets-deleteMany-Java", {
1487
- entityName: args.entityName,
1488
- EntityName: args.EntityName
1489
- }),
1490
- JavaAsync: (args) => renderTemplate("template-codeSnippets-deleteMany-JavaAsync", {
1491
- entityName: args.entityName,
1492
- EntityName: args.EntityName
1493
- })
1494
- },
1495
- generalAction: {
1496
- Javascript: (args) => renderTemplate("template-codeSnippets-generalAction-Javascript", {
1497
- entityName: args.entityName,
1498
- httpMethod: getHttpMethod(args.actionName),
1499
- paramDisplay: args.action?.codeHint?.delegator?.param?.fields ? 'inline' : 'none',
1500
- bodyDisplay: args.action?.codeHint?.delegator?.requestBody?.fields ? 'inline' : 'none'
1501
- }),
1502
- CSharp: (args) => renderTemplate("template-codeSnippets-generalAction-CSharp", {
1503
- entityName: args.entityName,
1504
- EntityName: args.EntityName,
1505
- MethodName: toCSharpName(getHttpMethod(args.actionName))
1506
- }),
1507
- HTTP: (args) => renderTemplate("template-codeSnippets-generalAction-HTTP", {
1508
- domain: args.domain,
1509
- rootUrlPath: args.rootUrlPath,
1510
- entityName: args.entityName,
1511
- httpMethod: getHttpMethod(args.actionName),
1512
- bodyDisplay: args.action?.codeHint?.delegator?.requestBody?.fields ? 'inline' : 'none',
1513
- noBodyDisplay: args.action?.codeHint?.delegator?.requestBody?.fields ? 'none' : 'inline',
1514
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1515
- }),
1516
- cURL: (args) => renderTemplate("template-codeSnippets-generalAction-cURL", {
1517
- rootUrl: window.docs.info.rootUrl,
1518
- entityName: args.entityName,
1519
- tokenDisplay: args.action.grant !== "*" ? 'inline' : 'none'
1520
- }),
1521
- Java: (args) => renderTemplate("template-codeSnippets-generalAction-Java", {
1522
- entityName: args.entityName,
1523
- EntityName: args.EntityName,
1524
- methodName: getHttpMethod(args.actionName),
1525
- MethodName: toCSharpName(getHttpMethod(args.actionName))
1526
- }),
1527
- JavaAsync: (args) => renderTemplate("template-codeSnippets-generalAction-JavaAsync", {
1528
- entityName: args.entityName,
1529
- EntityName: args.EntityName,
1530
- methodName: getHttpMethod(args.actionName),
1531
- MethodName: toCSharpName(getHttpMethod(args.actionName))
1532
- })
1533
- },
1534
- view: {
1535
- Javascript: (args) => renderTemplate("template-codeSnippets-view-Javascript", {
1536
- entityName: args.entityName,
1537
- viewName: args.viewName,
1538
- parameters: args.view.parameters ? "{\n " + args.view.parameters.map(p => `${encodeHtml(p.field)}: <span class="place-holder">value_of_${encodeHtml(p.field)}</span>`).join(",\n ") + "\n }" : ""
1539
- }),
1540
- JavascriptModel: (args) => args.view.codeHint?.output?.fields ? renderTemplate("template-codeSnippets-view-JavascriptModel", {
1541
- undefinedModel: formatHintModel(args.view.codeHint.output.fields, undefined, {mode: "model_undefined"}),
1542
- valueModel: formatHintModel(args.view.codeHint.output.fields, undefined, {mode: "model"}),
1543
- nullModel: formatHintModel(args.view.codeHint.output.fields, undefined, {mode: "model_null"})
1544
- }) : "",
1545
- CSharp: (args) => renderTemplate("template-codeSnippets-view-CSharp", {
1546
- entityName: args.entityName,
1547
- EntityName: args.EntityName,
1548
- grantDisplay: args.view.grant === "*" ? 'none' : "inline",
1549
- Grant: toCSharpName(args.view.grant),
1550
- ViewName: toCSharpName(args.viewName),
1551
- parameters: args.view.parameters ? args.view.parameters.map(p => `${encodeHtml(toCSharpName(p.field))} = <span class="place-holder">value_of_${encodeHtml(p.field)}</span>`).join(",\n ") : ""
1552
- }),
1553
- HTTP: (args) => renderTemplate("template-codeSnippets-view-HTTP", {
1554
- domain: args.domain,
1555
- rootUrlPath: args.rootUrlPath,
1556
- entityName: args.entityName,
1557
- viewName: args.viewName,
1558
- tokenDisplay: args.view.grant !== "*" ? 'inline' : 'none',
1559
- parameters: args.view.parameters ? "?" + args.view.parameters.map(p => `${encodeHtml(p.field)}=<span class="place-holder">value_of_${encodeHtml(p.field)}</span>`).join("&") : ""
1560
- }),
1561
- cURL: (args) => renderTemplate("template-codeSnippets-view-cURL", {
1562
- rootUrl: window.docs.info.rootUrl,
1563
- entityName: args.entityName,
1564
- tokenDisplay: args.view.grant !== "*" ? 'inline' : 'none',
1565
- parameters: args.view.parameters ? "?" + args.view.parameters.map(p => `${encodeHtml(p.field)}=<span class="place-holder">value_of_${encodeHtml(p.field)}</span>`).join("&") : ""
1566
- }),
1567
- Java: (args) => renderTemplate("template-codeSnippets-view-Java", {
1568
- entityName: args.entityName,
1569
- EntityName: args.EntityName,
1570
- viewName: args.viewName,
1571
- ViewName: toCSharpName(args.viewName),
1572
- parameters: args.view.parameters ? args.view.parameters.map(p => `arg.set${encodeHtml(toCSharpName(p.field))}(<span class="place-holder">value_of_${encodeHtml(p.field)}</span>);`).join(",\n ") : ""
1573
- }),
1574
- JavaAsync: (args) => renderTemplate("template-codeSnippets-view-JavaAsync", {
1575
- entityName: args.entityName,
1576
- EntityName: args.EntityName,
1577
- viewName: args.viewName,
1578
- ViewName: toCSharpName(args.viewName),
1579
- parameters: args.view.parameters ? args.view.parameters.map(p => `arg.set${encodeHtml(toCSharpName(p.field))}(<span class="place-holder">value_of_${encodeHtml(p.field)}</span>);`).join(",\n ") : ""
1580
- })
1581
- }
1582
- }
1583
- </script>
1584
222
  </head>
1585
223
  <body>
1586
224
  <div class="info">
@@ -1614,16 +252,16 @@
1614
252
  <div id="copied" class="yellow-fade"><div class="text">COPIED!</div></div>
1615
253
 
1616
254
 
1617
- <script type="text/mushroom-docs-template" id="template-li-code">
255
+ <div class="mushroom-docs-template" id="template-li-code">
1618
256
  <li><code>{{value}}</code></li>
1619
- </script>
1620
- <script type="text/mushroom-docs-template" id="template-fields-inline"><span>{{fieldName}}</span><span class="separator">,</span></script>
257
+ </div>
258
+ <div class="mushroom-docs-template" id="template-fields-inline"><span>{{fieldName}}</span><span class="separator">,</span></div>
1621
259
 
1622
- <script type="text/mushroom-docs-template" id="template-project-role">
260
+ <div class="mushroom-docs-template" id="template-project-role">
1623
261
  <li><code>{{name}}</code>: <span>{{description}}</span></li>
1624
- </script>
262
+ </div>
1625
263
 
1626
- <script type="text/mushroom-docs-template" id="template-project-environmentVariables">
264
+ <div class="mushroom-docs-template" id="template-project-environmentVariables">
1627
265
  <h2 onclick="toggleParentClass.call(this)" data-toggled-class="expand" data-hash="$env-vars">Environment variables</h2>
1628
266
  <div class="actions">
1629
267
  <div>
@@ -1789,8 +427,8 @@
1789
427
  </div>
1790
428
  <div id="extension-env-vars-custom"></div>
1791
429
  </div>
1792
- </script>
1793
- <script type="text/mushroom-docs-template" id="template-project-environmentVariables-custom">
430
+ </div>
431
+ <div class="mushroom-docs-template" id="template-project-environmentVariables-custom">
1794
432
  <div class="panel panel-primary" id="extension-env-vars-{{name}}">
1795
433
  <div class="panel-heading" onclick="toggleParentClass.call(this)" data-toggled-class="show" id="env-vars-{{name}}">
1796
434
  <span>$${{name}}</span>
@@ -1804,9 +442,9 @@
1804
442
  </div>
1805
443
  </div>
1806
444
  </div>
1807
- </script>
445
+ </div>
1808
446
 
1809
- <script type="text/mushroom-docs-template" id="template-extension-DefaultAuth-module">
447
+ <div class="mushroom-docs-template" id="template-extension-DefaultAuth-module">
1810
448
  <h2 onclick="toggleParentClass.call(this)" data-toggled-class="expand" data-hash="$auth">Authentication extension</h2>
1811
449
  <div class="actions">
1812
450
  <div class="panel panel-info" id="extension-auth-login">
@@ -3231,8 +1869,8 @@ API.getAuthentication().changePasswordAsync("your account", "your old password",
3231
1869
  </div>
3232
1870
  </div>
3233
1871
  </div>
3234
- </script>
3235
- <script type="text/mushroom-docs-template" id="template-extension-File-module">
1872
+ </div>
1873
+ <div class="mushroom-docs-template" id="template-extension-File-module">
3236
1874
  <h2 onclick="toggleParentClass.call(this)" data-toggled-class="expand" data-hash="$file">File extension</h2>
3237
1875
  <div class="actions">
3238
1876
  <div class="panel panel-info" id="extension-file-upload">
@@ -3681,8 +2319,8 @@ Content-Disposition: attachment; filename="{name}"</pre>
3681
2319
  </div>
3682
2320
  </div>
3683
2321
  </div>
3684
- </script>
3685
- <script type="text/mushroom-docs-template" id="template-extension-Mailing-module">
2322
+ </div>
2323
+ <div class="mushroom-docs-template" id="template-extension-Mailing-module">
3686
2324
  <h2 onclick="toggleParentClass.call(this)" data-toggled-class="expand" data-hash="$mailing">Mailing extension</h2>
3687
2325
  <div class="actions">
3688
2326
  <div class="panel panel-info" id="extension-mailing-sent">
@@ -3947,8 +2585,8 @@ catch (error) {
3947
2585
  </div>
3948
2586
  </div>
3949
2587
  </div>
3950
- </script>
3951
- <script type="text/mushroom-docs-template" id="template-client-drivers">
2588
+ </div>
2589
+ <div class="mushroom-docs-template" id="template-client-drivers">
3952
2590
  <h2 onclick="toggleParentClass.call(this)" data-toggled-class="expand" data-hash="$client-drivers"><em>driver</em></h2>
3953
2591
  <div class="actions">
3954
2592
  <div class="panel panel-primary" id="extension-client-drivers-javascript">
@@ -3997,16 +2635,16 @@ catch (error) {
3997
2635
  </div>
3998
2636
  </div>
3999
2637
  </div>
4000
- </script>
2638
+ </div>
4001
2639
 
4002
- <script type="text/mushroom-docs-template" id="template-project-entity">
2640
+ <div class="mushroom-docs-template" id="template-project-entity">
4003
2641
  <div class="entity" id="entity-{{name}}">
4004
2642
  <h2 data-hash="{{name}}" onclick="renderEntity.call(this, '{{name}}'); toggleParentClass.call(this)" data-toggled-class="expand">{{name}}</h2>
4005
2643
  <div class="project-entity-actions"></div>
4006
2644
  <div class="project-entity-views"></div>
4007
2645
  </div>
4008
- </script>
4009
- <script type="text/mushroom-docs-template" id="template-project-entity-actions">
2646
+ </div>
2647
+ <div class="mushroom-docs-template" id="template-project-entity-actions">
4010
2648
  <div class="actions">
4011
2649
  <div id="action-{{entityName}}-{{actionName}}" class="{{className}}">
4012
2650
  <div class="panel-heading" onclick="renderEntityAction.call(this, '{{entityName}}', '{{actionName}}'); toggleParentClass.call(this)" data-toggled-class="show" data-hash="{{entityName}}.{{actionName}}">
@@ -4020,22 +2658,22 @@ catch (error) {
4020
2658
  </div>
4021
2659
  </div>
4022
2660
  </div>
4023
- </script>
4024
- <script type="text/mushroom-docs-template" id="template-project-entity-action-role">
2661
+ </div>
2662
+ <div class="mushroom-docs-template" id="template-project-entity-action-role">
4025
2663
  <li role="presentation"><a onclick="renderEntityActionRolePage.call(this, '{{entityName}}', '{{actionName}}', '{{grant}}'); activeRoleTab.call(this)" data-role="{{grant}}">{{explainedRole}}</a></li>
4026
- </script>
4027
- <script type="text/mushroom-docs-template" id="template-project-entity-action-page">
2664
+ </div>
2665
+ <div class="mushroom-docs-template" id="template-project-entity-action-page">
4028
2666
  <div class="tab-page" data-role="{{grant}}"></div>
4029
- </script>
4030
- <script type="text/mushroom-docs-template" id="template-project-entity-action-page-codeSnippets">
2667
+ </div>
2668
+ <div class="mushroom-docs-template" id="template-project-entity-action-page-codeSnippets">
4031
2669
  <div class="driver-snippet">
4032
2670
  <h4>Code mẫu</h4>
4033
2671
  <ul class="nav nav-tabs">{{codeSnippetTabHeaders:html}}</ul>
4034
2672
  <div class="tab-pages">{{codeSnippetTabPages:html}}</div>
4035
2673
  </div>
4036
- </script>
2674
+ </div>
4037
2675
 
4038
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findMany-Javascript">
2676
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-findMany-Javascript">
4039
2677
  <div class="js-driver-snippet">
4040
2678
  Đơn giản
4041
2679
  <pre data-language="javascript"><span class="code-comment">// Lấy về danh sách<span style="display: {{allowPagingDisplay}}"> có phân trang</span></span>
@@ -4084,7 +2722,7 @@ catch (e) {
4084
2722
  // Tham số cho countAsync chỉ hỗ trợ filters</span></pre>
4085
2723
  </div>
4086
2724
  </script>
4087
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findMany-JavascriptModel">
2725
+ <div class="mushroom-docs-template" id="template-codeSnippets-findMany-JavascriptModel">
4088
2726
  <div class="js-model-snippet">
4089
2727
  Javascript UNDEFINED model
4090
2728
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -4093,8 +2731,8 @@ catch (e) {
4093
2731
  Javascript NULL model
4094
2732
  <pre data-language="json">{{nullModel:html}}</pre>
4095
2733
  </div>
4096
- </script>
4097
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findMany-CSharp">
2734
+ </div>
2735
+ <div class="mushroom-docs-template" id="template-codeSnippets-findMany-CSharp">
4098
2736
  <div class="csharp-driver-snippet">
4099
2737
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
4100
2738
  Đơn giản
@@ -4141,8 +2779,8 @@ catch (Exception ex)
4141
2779
  Console.Write($"Error: {ex.Message}");
4142
2780
  }</pre>
4143
2781
  </div>
4144
- </script>
4145
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findMany-HTTP">
2782
+ </div>
2783
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-findMany-HTTP">
4146
2784
  <div class="http-snippet">
4147
2785
  Đơn giản
4148
2786
  <pre data-language="http">GET {{rootUrlPath}}{{entityName}}s HTTP/1.1
@@ -4156,7 +2794,7 @@ Token: your token
4156
2794
  </span></pre>
4157
2795
  </div>
4158
2796
  </script>
4159
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findMany-cURL">
2797
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-findMany-cURL">
4160
2798
  <div class="curl-snippet">
4161
2799
  Đơn giản
4162
2800
  <pre data-language="cURL">curl -X GET \
@@ -4175,7 +2813,7 @@ Token: your token
4175
2813
  </span></pre>
4176
2814
  </div>
4177
2815
  </script>
4178
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findMany-Java">
2816
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-findMany-Java">
4179
2817
  <div class="java-driver-snippet">
4180
2818
  Đơn giản
4181
2819
  <pre data-language="java">try {
@@ -4230,7 +2868,7 @@ catch(Exception ex) {
4230
2868
  }</pre>
4231
2869
  </div>
4232
2870
  </script>
4233
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findMany-JavaAsync">
2871
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-findMany-JavaAsync">
4234
2872
  <div class="java-driver-snippet">
4235
2873
  Đơn giản
4236
2874
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -4335,7 +2973,7 @@ API.get{{EntityName}}().listAsync(arg, {{entityName}}s -> {
4335
2973
  </div>
4336
2974
  </script>
4337
2975
 
4338
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findById-Javascript">
2976
+ <div class="mushroom-docs-template" id="template-codeSnippets-findById-Javascript">
4339
2977
  <div class="js-driver-snippet">
4340
2978
  Đơn giản
4341
2979
  <pre data-language="javascript">try {
@@ -4359,8 +2997,8 @@ catch (e) {
4359
2997
  console.error("Có lỗi: %o", e);
4360
2998
  }</pre>
4361
2999
  </div>
4362
- </script>
4363
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findById-JavascriptModel">
3000
+ </div>
3001
+ <div class="mushroom-docs-template" id="template-codeSnippets-findById-JavascriptModel">
4364
3002
  <div class="js-model-snippet">
4365
3003
  Javascript UNDEFINED model
4366
3004
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -4369,8 +3007,8 @@ catch (e) {
4369
3007
  Javascript NULL model
4370
3008
  <pre data-language="json">{{nullModel:html}}</pre>
4371
3009
  </div>
4372
- </script>
4373
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findById-CSharp">
3010
+ </div>
3011
+ <div class="mushroom-docs-template" id="template-codeSnippets-findById-CSharp">
4374
3012
  <div class="csharp-driver-snippet">
4375
3013
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
4376
3014
  Đơn giản
@@ -4410,8 +3048,8 @@ catch (Exception ex)
4410
3048
  Console.Write($"Error: {ex.Message}");
4411
3049
  }</pre>
4412
3050
  </div>
4413
- </script>
4414
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findById-HTTP">
3051
+ </div>
3052
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-findById-HTTP">
4415
3053
  <div class="http-snippet">
4416
3054
  Đơn giản
4417
3055
  <pre data-language="http">GET {{rootUrlPath}}{{entityName}}s/<span class="place-holder">id</span> HTTP/1.1
@@ -4425,7 +3063,7 @@ Token: your token
4425
3063
  </span></pre>
4426
3064
  </div>
4427
3065
  </script>
4428
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findById-cURL">
3066
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-findById-cURL">
4429
3067
  <div class="curl-snippet">
4430
3068
  Đơn giản
4431
3069
  <pre data-language="cURL">curl -X GET \
@@ -4444,7 +3082,7 @@ Token: your token
4444
3082
  </span></pre>
4445
3083
  </div>
4446
3084
  </script>
4447
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findById-Java">
3085
+ <div class="mushroom-docs-template" id="template-codeSnippets-findById-Java">
4448
3086
  <div class="java-driver-snippet">
4449
3087
  Đơn giản
4450
3088
  <pre data-language="java">try {
@@ -4491,8 +3129,8 @@ catch(Exception ex) {
4491
3129
  ex.printStackTrace();
4492
3130
  }</pre>
4493
3131
  </div>
4494
- </script>
4495
- <script type="text/mushroom-docs-template" id="template-codeSnippets-findById-JavaAsync">
3132
+ </div>
3133
+ <div class="mushroom-docs-template" id="template-codeSnippets-findById-JavaAsync">
4496
3134
  <div class="java-driver-snippet">
4497
3135
  Đơn giản
4498
3136
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -4579,9 +3217,9 @@ API.get{{EntityName}}().findByIdAsync(arg, {{entityName}} -> {
4579
3217
  "Detail: " + e.getDetail());
4580
3218
  });</pre>
4581
3219
  </div>
4582
- </script>
3220
+ </div>
4583
3221
 
4584
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createOne-Javascript">
3222
+ <div class="mushroom-docs-template" id="template-codeSnippets-createOne-Javascript">
4585
3223
  <div class="js-driver-snippet">
4586
3224
  Tạo mới một {{entityName}}
4587
3225
  <pre data-language="javascript">const {{entityName}}_object = {
@@ -4594,8 +3232,8 @@ try {
4594
3232
  console.error("Có lỗi: %o", error);
4595
3233
  }</pre>
4596
3234
  </div>
4597
- </script>
4598
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createOne-JavascriptModel">
3235
+ </div>
3236
+ <div class="mushroom-docs-template" id="template-codeSnippets-createOne-JavascriptModel">
4599
3237
  <div class="js-model-snippet">
4600
3238
  Javascript UNDEFINED model
4601
3239
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -4604,8 +3242,8 @@ try {
4604
3242
  Javascript NULL model
4605
3243
  <pre data-language="json">{{nullModel:html}}</pre>
4606
3244
  </div>
4607
- </script>
4608
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createOne-CSharp">
3245
+ </div>
3246
+ <div class="mushroom-docs-template" id="template-codeSnippets-createOne-CSharp">
4609
3247
  <div class="csharp-driver-snippet">
4610
3248
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
4611
3249
  Tạo mới một {{entityName}}
@@ -4629,8 +3267,8 @@ catch (Exception ex)
4629
3267
  Console.Write($"Error: {ex.Message}");
4630
3268
  }</pre>
4631
3269
  </div>
4632
- </script>
4633
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createOne-HTTP">
3270
+ </div>
3271
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-createOne-HTTP">
4634
3272
  <div class="http-snippet">
4635
3273
  Tạo mới một {{entityName}}
4636
3274
  <pre data-language="http">POST {{rootUrlPath}}{{entityName}}s HTTP/1.1
@@ -4643,7 +3281,7 @@ Token: your token</span>
4643
3281
  }</pre>
4644
3282
  </div>
4645
3283
  </script>
4646
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createOne-cURL">
3284
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-createOne-cURL">
4647
3285
  <div class="curl-snippet">
4648
3286
  cURL
4649
3287
  <pre data-language="cURL">curl -X POST \
@@ -4660,7 +3298,7 @@ Token: your token</span>
4660
3298
  --data '{\n"fieldName": value\n}'</pre>
4661
3299
  </div>
4662
3300
  </script>
4663
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createOne-Java">
3301
+ <div class="mushroom-docs-template" id="template-codeSnippets-createOne-Java">
4664
3302
  <div class="java-driver-snippet">
4665
3303
  Tạo mới một {{entityName}}
4666
3304
  <pre data-language="java">try {
@@ -4687,8 +3325,8 @@ catch(Exception ex) {
4687
3325
  ex.printStackTrace();
4688
3326
  }</pre>
4689
3327
  </div>
4690
- </script>
4691
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createOne-JavaAsync">
3328
+ </div>
3329
+ <div class="mushroom-docs-template" id="template-codeSnippets-createOne-JavaAsync">
4692
3330
  <div class="java-driver-snippet">
4693
3331
  Tạo mới một {{entityName}}
4694
3332
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -4740,9 +3378,9 @@ API.get{{EntityName}}().createAsync(arg, id -> {
4740
3378
  // do something with id and exception e
4741
3379
  });</pre>
4742
3380
  </div>
4743
- </script>
3381
+ </div>
4744
3382
 
4745
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createMany-Javascript">
3383
+ <div class="mushroom-docs-template" id="template-codeSnippets-createMany-Javascript">
4746
3384
  <div class="js-driver-snippet">
4747
3385
  Tạo mới hàng loạt {{entityName}}
4748
3386
  <pre data-language="javascript">const arr = [];
@@ -4758,8 +3396,8 @@ try {
4758
3396
  console.error("Có lỗi: %o", error);
4759
3397
  }</pre>
4760
3398
  </div>
4761
- </script>
4762
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createMany-JavascriptModel">
3399
+ </div>
3400
+ <div class="mushroom-docs-template" id="template-codeSnippets-createMany-JavascriptModel">
4763
3401
  <div class="js-model-snippet">
4764
3402
  Javascript UNDEFINED model
4765
3403
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -4768,8 +3406,8 @@ try {
4768
3406
  Javascript NULL model
4769
3407
  <pre data-language="json">{{nullModel:html}}</pre>
4770
3408
  </div>
4771
- </script>
4772
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createMany-CSharp">
3409
+ </div>
3410
+ <div class="mushroom-docs-template" id="template-codeSnippets-createMany-CSharp">
4773
3411
  <div class="csharp-driver-snippet">
4774
3412
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
4775
3413
  Tạo mới hàng loạt {{entityName}}
@@ -4798,8 +3436,8 @@ catch (Exception ex)
4798
3436
  Console.Write($"Error: {ex.Message}");
4799
3437
  }</pre>
4800
3438
  </div>
4801
- </script>
4802
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createMany-HTTP">
3439
+ </div>
3440
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-createMany-HTTP">
4803
3441
  <div class="http-snippet">
4804
3442
  Tạo mới hàng loạt {{entityName}}
4805
3443
  <pre data-language="http">POST {{rootUrlPath}}{{entityName}}s HTTP/1.1
@@ -4815,7 +3453,7 @@ Token: your token</span>
4815
3453
  ]</pre>
4816
3454
  </div>
4817
3455
  </script>
4818
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createMany-cURL">
3456
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-createMany-cURL">
4819
3457
  <div class="curl-snippet">
4820
3458
  cURL
4821
3459
  <pre data-language="cURL">curl -X POST \
@@ -4836,7 +3474,7 @@ Token: your token</span>
4836
3474
  --data '[{\n"fieldName": value\n}]'</pre>
4837
3475
  </div>
4838
3476
  </script>
4839
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createMany-Java">
3477
+ <div class="mushroom-docs-template" id="template-codeSnippets-createMany-Java">
4840
3478
  <div class="java-driver-snippet">
4841
3479
  Tạo mới hàng loạt {{entityName}}
4842
3480
  <pre data-language="java">try {
@@ -4865,8 +3503,8 @@ catch(Exception ex) {
4865
3503
  ex.printStackTrace();
4866
3504
  }</pre>
4867
3505
  </div>
4868
- </script>
4869
- <script type="text/mushroom-docs-template" id="template-codeSnippets-createMany-JavaAsync">
3506
+ </div>
3507
+ <div class="mushroom-docs-template" id="template-codeSnippets-createMany-JavaAsync">
4870
3508
  <div class="java-driver-snippet">
4871
3509
  Tạo mới một {{entityName}}
4872
3510
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -4922,9 +3560,9 @@ API.get{{EntityName}}().batchCreateAsync(arg, ids -> {
4922
3560
  // do something with id and exception e
4923
3561
  });</pre>
4924
3562
  </div>
4925
- </script>
3563
+ </div>
4926
3564
 
4927
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateOne-Javascript">
3565
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateOne-Javascript">
4928
3566
  <div class="js-driver-snippet">
4929
3567
  Cập nhật một {{entityName}}
4930
3568
  <pre data-language="javascript">var {{entityName}}_object = {
@@ -4942,8 +3580,8 @@ try {
4942
3580
  }
4943
3581
  </pre>
4944
3582
  </div>
4945
- </script>
4946
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateOne-JavascriptModel">
3583
+ </div>
3584
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateOne-JavascriptModel">
4947
3585
  <div class="js-model-snippet">
4948
3586
  Javascript UNDEFINED model
4949
3587
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -4952,8 +3590,8 @@ try {
4952
3590
  Javascript NULL model
4953
3591
  <pre data-language="json">{{nullModel:html}}</pre>
4954
3592
  </div>
4955
- </script>
4956
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateOne-CSharp">
3593
+ </div>
3594
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateOne-CSharp">
4957
3595
  <div class="csharp-driver-snippet">
4958
3596
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
4959
3597
  Cập nhật một {{entityName}}
@@ -4977,8 +3615,8 @@ catch (Exception ex)
4977
3615
  Console.Write($"Error: {ex.Message}");
4978
3616
  }</pre>
4979
3617
  </div>
4980
- </script>
4981
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateOne-HTTP">
3618
+ </div>
3619
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-updateOne-HTTP">
4982
3620
  <div class="http-snippet">
4983
3621
  Cập nhật một {{entityName}}
4984
3622
  <pre data-language="http">PUT {{rootUrlPath}}{{entityName}}s/<span class="place-holder">id</span> HTTP/1.1
@@ -4992,7 +3630,7 @@ Token: your token</span>
4992
3630
  }</pre>
4993
3631
  </div>
4994
3632
  </script>
4995
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateOne-cURL">
3633
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-updateOne-cURL">
4996
3634
  <div class="curl-snippet">
4997
3635
  cURL
4998
3636
  <pre data-language="cURL">curl -X PUT \
@@ -5010,7 +3648,7 @@ Token: your token</span>
5010
3648
  --data '{\n"id": "<span class="place-holder">{{entityName}}_id</span>", "<span class="place-holder">fieldName</span>": <span class="place-holder">value</span>\n}'</pre>
5011
3649
  </div>
5012
3650
  </script>
5013
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateOne-Java">
3651
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateOne-Java">
5014
3652
  <div class="java-driver-snippet">
5015
3653
  Cập nhật một {{entityName}}
5016
3654
  <pre data-language="java">try {
@@ -5038,8 +3676,8 @@ catch(Exception ex) {
5038
3676
  ex.printStackTrace();
5039
3677
  }</pre>
5040
3678
  </div>
5041
- </script>
5042
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateOne-JavaAsync">
3679
+ </div>
3680
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateOne-JavaAsync">
5043
3681
  <div class="java-driver-snippet">
5044
3682
  Tạo mới một {{entityName}}
5045
3683
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -5093,9 +3731,9 @@ API.get{{EntityName}}().createAsync(arg, id -> {
5093
3731
  // do something with id and exception e
5094
3732
  });</pre>
5095
3733
  </div>
5096
- </script>
3734
+ </div>
5097
3735
 
5098
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateMany-Javascript">
3736
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateMany-Javascript">
5099
3737
  <div class="js-driver-snippet">
5100
3738
  Cập nhật hàng loạt {{entityName}}
5101
3739
  <pre data-language="javascript">const arr = [];
@@ -5111,8 +3749,8 @@ try {
5111
3749
  console.error("Có lỗi: %o", error);
5112
3750
  }</pre>
5113
3751
  </div>
5114
- </script>
5115
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateMany-JavascriptModel">
3752
+ </div>
3753
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateMany-JavascriptModel">
5116
3754
  <div class="js-model-snippet">
5117
3755
  Javascript UNDEFINED model
5118
3756
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -5121,8 +3759,8 @@ try {
5121
3759
  Javascript NULL model
5122
3760
  <pre data-language="json">{{nullModel:html}}</pre>
5123
3761
  </div>
5124
- </script>
5125
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateMany-CSharp">
3762
+ </div>
3763
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateMany-CSharp">
5126
3764
  <div class="csharp-driver-snippet">
5127
3765
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
5128
3766
  Cập nhật hàng loạt {{entityName}}
@@ -5151,8 +3789,8 @@ catch (Exception ex)
5151
3789
  Console.Write($"Error: {ex.Message}");
5152
3790
  }</pre>
5153
3791
  </div>
5154
- </script>
5155
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateMany-HTTP">
3792
+ </div>
3793
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-updateMany-HTTP">
5156
3794
  <div class="http-snippet">
5157
3795
  Cập nhật hàng loạt {{entityName}}
5158
3796
  <pre data-language="http">PUT {{rootUrlPath}}{{entityName}}s HTTP/1.1
@@ -5167,7 +3805,7 @@ Token: your token</span>
5167
3805
  ]</pre>
5168
3806
  </div>
5169
3807
  </script>
5170
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateMany-cURL">
3808
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-updateMany-cURL">
5171
3809
  <div class="curl-snippet">
5172
3810
  cURL
5173
3811
  <pre data-language="cURL">curl -X PUT \
@@ -5187,7 +3825,7 @@ Token: your token</span>
5187
3825
  --data '[{\n"fieldName": value\n}]'</pre>
5188
3826
  </div>
5189
3827
  </script>
5190
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateMany-Java">
3828
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateMany-Java">
5191
3829
  <div class="java-driver-snippet">
5192
3830
  Cập nhật hàng loạt {{entityName}}
5193
3831
  <pre data-language="java">try {
@@ -5216,8 +3854,8 @@ catch(Exception ex) {
5216
3854
  ex.printStackTrace();
5217
3855
  }</pre>
5218
3856
  </div>
5219
- </script>
5220
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updateMany-JavaAsync">
3857
+ </div>
3858
+ <div class="mushroom-docs-template" id="template-codeSnippets-updateMany-JavaAsync">
5221
3859
  <div class="java-driver-snippet">
5222
3860
  Cập nhật hàng loạt {{entityName}}
5223
3861
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -5273,9 +3911,9 @@ API.get{{EntityName}}().batchUpdateAsync(arg, ids -> {
5273
3911
  // do something with id and exception e
5274
3912
  });</pre>
5275
3913
  </div>
5276
- </script>
3914
+ </div>
5277
3915
 
5278
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updatePartially-Javascript">
3916
+ <div class="mushroom-docs-template" id="template-codeSnippets-updatePartially-Javascript">
5279
3917
  <div class="js-driver-snippet">
5280
3918
  Cập nhật một phần {{entityName}}
5281
3919
  <pre data-language="javascript">const {{entityName}}_object = {
@@ -5293,8 +3931,8 @@ try {
5293
3931
  console.error("Có lỗi: %o", error);
5294
3932
  }</pre>
5295
3933
  </div>
5296
- </script>
5297
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updatePartially-JavascriptModel">
3934
+ </div>
3935
+ <div class="mushroom-docs-template" id="template-codeSnippets-updatePartially-JavascriptModel">
5298
3936
  <div class="js-model-snippet">
5299
3937
  Javascript UNDEFINED model
5300
3938
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -5303,8 +3941,8 @@ try {
5303
3941
  Javascript NULL model
5304
3942
  <pre data-language="json">{{nullModel:html}}</pre>
5305
3943
  </div>
5306
- </script>
5307
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updatePartially-CSharp">
3944
+ </div>
3945
+ <div class="mushroom-docs-template" id="template-codeSnippets-updatePartially-CSharp">
5308
3946
  <div class="csharp-driver-snippet">
5309
3947
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
5310
3948
  Cập nhật một phần {{entityName}}
@@ -5330,8 +3968,8 @@ catch (Exception ex)
5330
3968
  Console.Write($"Error: {ex.Message}");
5331
3969
  }</pre>
5332
3970
  </div>
5333
- </script>
5334
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updatePartially-HTTP">
3971
+ </div>
3972
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-updatePartially-HTTP">
5335
3973
  <div class="http-snippet">
5336
3974
  Cập nhật một {{entityName}}
5337
3975
  <pre data-language="http">PATCH {{rootUrlPath}}{{entityName}}s/<span class="place-holder">id</span> HTTP/1.1
@@ -5345,7 +3983,7 @@ Token: your token</span>
5345
3983
  }</pre>
5346
3984
  </div>
5347
3985
  </script>
5348
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updatePartially-cURL">
3986
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-updatePartially-cURL">
5349
3987
  <div class="curl-snippet">
5350
3988
  cURL
5351
3989
  <pre data-language="cURL">curl -X PATCH \
@@ -5363,7 +4001,7 @@ Token: your token</span>
5363
4001
  --data '{\n"id": "<span class="place-holder">{{entityName}}_id</span>", "<span class="place-holder">fieldName</span>": <span class="place-holder">value</span>\n}'</pre>
5364
4002
  </div>
5365
4003
  </script>
5366
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updatePartially-Java">
4004
+ <div class="mushroom-docs-template" id="template-codeSnippets-updatePartially-Java">
5367
4005
  <div class="java-driver-snippet">
5368
4006
  Cập nhật một {{entityName}}
5369
4007
  <pre data-language="java">try {
@@ -5391,8 +4029,8 @@ catch(Exception ex) {
5391
4029
  ex.printStackTrace();
5392
4030
  }</pre>
5393
4031
  </div>
5394
- </script>
5395
- <script type="text/mushroom-docs-template" id="template-codeSnippets-updatePartially-JavaAsync">
4032
+ </div>
4033
+ <div class="mushroom-docs-template" id="template-codeSnippets-updatePartially-JavaAsync">
5396
4034
  <div class="java-driver-snippet">
5397
4035
  Tạo mới một {{entityName}}
5398
4036
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -5446,9 +4084,9 @@ API.get{{EntityName}}().createAsync(arg, id -> {
5446
4084
  // do something with id and exception e
5447
4085
  });</pre>
5448
4086
  </div>
5449
- </script>
4087
+ </div>
5450
4088
 
5451
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteOne-Javascript">
4089
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteOne-Javascript">
5452
4090
  <div class="js-driver-snippet">
5453
4091
  Xóa một {{entityName}}
5454
4092
  <pre data-language="javascript">try {
@@ -5461,8 +4099,8 @@ catch (e) {
5461
4099
  console.error("Có lỗi: %o", e);
5462
4100
  }</pre>
5463
4101
  </div>
5464
- </script>
5465
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteOne-CSharp">
4102
+ </div>
4103
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteOne-CSharp">
5466
4104
  <div class="csharp-driver-snippet">
5467
4105
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
5468
4106
  Xóa một {{entityName}}
@@ -5481,8 +4119,8 @@ catch (Exception ex)
5481
4119
  Console.Write($"Error: {ex.Message}");
5482
4120
  }</pre>
5483
4121
  </div>
5484
- </script>
5485
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteOne-HTTP">
4122
+ </div>
4123
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-deleteOne-HTTP">
5486
4124
  <div class="http-snippet">
5487
4125
  Xóa nhật một {{entityName}}
5488
4126
  <pre data-language="http">DELETE {{rootUrlPath}}{{entityName}}s/<span class="place-holder">id</span> HTTP/1.1
@@ -5491,7 +4129,7 @@ Content-Type: application/json<span style="display: {{tokenDisplay}}">
5491
4129
  Token: your token</span></pre>
5492
4130
  </div>
5493
4131
  </script>
5494
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteOne-cURL">
4132
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-deleteOne-cURL">
5495
4133
  <div class="curl-snippet">
5496
4134
  cURL
5497
4135
  <pre data-language="cURL">curl -X DELETE \
@@ -5504,7 +4142,7 @@ Token: your token</span></pre>
5504
4142
  --header 'Token: your token' \</span></pre>
5505
4143
  </div>
5506
4144
  </script>
5507
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteOne-Java">
4145
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteOne-Java">
5508
4146
  <div class="java-driver-snippet">
5509
4147
  Xóa một {{entityName}}
5510
4148
  <pre data-language="java">try {
@@ -5527,8 +4165,8 @@ catch(Exception ex) {
5527
4165
  ex.printStackTrace();
5528
4166
  }</pre>
5529
4167
  </div>
5530
- </script>
5531
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteOne-JavaAsync">
4168
+ </div>
4169
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteOne-JavaAsync">
5532
4170
  <div class="java-driver-snippet">
5533
4171
  Xóa một {{entityName}}
5534
4172
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -5572,9 +4210,9 @@ API.get{{EntityName}}().deleteAsync(arg, count -> {
5572
4210
  // do something with id and exception e
5573
4211
  });</pre>
5574
4212
  </div>
5575
- </script>
4213
+ </div>
5576
4214
 
5577
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteMany-Javascript">
4215
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteMany-Javascript">
5578
4216
  <div class="js-driver-snippet">
5579
4217
  Xóa hàng loại hàng loạt {{entityName}}
5580
4218
  <pre data-language="javascript">const ids = [];
@@ -5591,8 +4229,8 @@ catch (e) {
5591
4229
  console.error("Có lỗi: %o", e);
5592
4230
  }</pre>
5593
4231
  </div>
5594
- </script>
5595
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteMany-CSharp">
4232
+ </div>
4233
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteMany-CSharp">
5596
4234
  <div class="csharp-driver-snippet">
5597
4235
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
5598
4236
  Xóa hàng loạt {{entityName}}
@@ -5614,8 +4252,8 @@ catch (Exception ex)
5614
4252
  Console.Write($"Error: {ex.Message}");
5615
4253
  }</pre>
5616
4254
  </div>
5617
- </script>
5618
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteMany-HTTP">
4255
+ </div>
4256
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-deleteMany-HTTP">
5619
4257
  <div class="http-snippet">
5620
4258
  Xóa nhật một {{entityName}}
5621
4259
  <pre data-language="http">DELETE {{rootUrlPath}}{{entityName}}s/<span class="place-holder">id</span> HTTP/1.1
@@ -5626,7 +4264,7 @@ Token: your token</span>
5626
4264
  [id1, id2, idn]</pre>
5627
4265
  </div>
5628
4266
  </script>
5629
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteMany-cURL">
4267
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-deleteMany-cURL">
5630
4268
  <div class="curl-snippet">
5631
4269
  cURL
5632
4270
  <pre data-language="cURL">curl -X DELETE \
@@ -5641,7 +4279,7 @@ Token: your token</span>
5641
4279
  --data '[id1, id2, idn]'</pre>
5642
4280
  </div>
5643
4281
  </script>
5644
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteMany-Java">
4282
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteMany-Java">
5645
4283
  <div class="java-driver-snippet">
5646
4284
  Xóa hàng loạt {{entityName}}
5647
4285
  <pre data-language="java">try {
@@ -5666,8 +4304,8 @@ catch(Exception ex) {
5666
4304
  ex.printStackTrace();
5667
4305
  }</pre>
5668
4306
  </div>
5669
- </script>
5670
- <script type="text/mushroom-docs-template" id="template-codeSnippets-deleteMany-JavaAsync">
4307
+ </div>
4308
+ <div class="mushroom-docs-template" id="template-codeSnippets-deleteMany-JavaAsync">
5671
4309
  <div class="java-driver-snippet">
5672
4310
  Xóa hàng loạt {{entityName}}
5673
4311
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -5715,9 +4353,9 @@ API.get{{EntityName}}().deleteAsync(arg, count -> {
5715
4353
  // do something with id and exception e
5716
4354
  });</pre>
5717
4355
  </div>
5718
- </script>
4356
+ </div>
5719
4357
 
5720
- <script type="text/mushroom-docs-template" id="template-codeSnippets-generalAction-Javascript">
4358
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-generalAction-Javascript">
5721
4359
  <div class="js-driver-snippet">
5722
4360
  Code tham khảo:
5723
4361
  <pre data-language="javascript">try {
@@ -5735,7 +4373,7 @@ API.get{{EntityName}}().deleteAsync(arg, count -> {
5735
4373
  }</pre>
5736
4374
  </div>
5737
4375
  </script>
5738
- <script type="text/mushroom-docs-template" id="template-codeSnippets-generalAction-CSharp">
4376
+ <div class="mushroom-docs-template" id="template-codeSnippets-generalAction-CSharp">
5739
4377
  <div class="csharp-driver-snippet">
5740
4378
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
5741
4379
  Code tham khảo:
@@ -5753,8 +4391,8 @@ catch (Exception ex)
5753
4391
  Console.Write($"Error: {ex.Message}");
5754
4392
  }</pre>
5755
4393
  </div>
5756
- </script>
5757
- <script type="text/mushroom-docs-template" id="template-codeSnippets-generalAction-HTTP">
4394
+ </div>
4395
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-generalAction-HTTP">
5758
4396
  <div class="http-snippet">
5759
4397
  Code tham khảo:
5760
4398
  <pre data-language="http">{{httpMethod}} {{rootUrlPath}}{{entityName}}s/{{httpMethod}}<span class="place-holder">?param1=value1&amp;param2=value2</span> HTTP/1.1
@@ -5781,7 +4419,7 @@ Token: your token</span></span>
5781
4419
  </pre>
5782
4420
  </div>
5783
4421
  </script>
5784
- <script type="text/mushroom-docs-template" id="template-codeSnippets-generalAction-cURL">
4422
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-generalAction-cURL">
5785
4423
  <div class="curl-snippet">
5786
4424
  cURL
5787
4425
  <pre data-language="cURL">curl -X {{httpMethod}} \
@@ -5797,7 +4435,7 @@ Token: your token</span></span>
5797
4435
  --data 'BODY DATA IF ANY'</pre>
5798
4436
  </div>
5799
4437
  </script>
5800
- <script type="text/mushroom-docs-template" id="template-codeSnippets-generalAction-Java">
4438
+ <div class="mushroom-docs-template" id="template-codeSnippets-generalAction-Java">
5801
4439
  <div class="java-driver-snippet">
5802
4440
  Code tham khảo:
5803
4441
  <pre data-language="java">try {
@@ -5821,8 +4459,8 @@ catch(Exception ex) {
5821
4459
  ex.printStackTrace();
5822
4460
  }</pre>
5823
4461
  </div>
5824
- </script>
5825
- <script type="text/mushroom-docs-template" id="template-codeSnippets-generalAction-JavaAsync">
4462
+ </div>
4463
+ <div class="mushroom-docs-template" id="template-codeSnippets-generalAction-JavaAsync">
5826
4464
  <div class="java-driver-snippet">
5827
4465
  Code tham khảo:
5828
4466
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -5867,9 +4505,9 @@ API.get{{EntityName}}().{{methodName}}Async(arg, result -> {
5867
4505
  // do something with id and exception e
5868
4506
  });</pre>
5869
4507
  </div>
5870
- </script>
4508
+ </div>
5871
4509
 
5872
- <script type="text/mushroom-docs-template" id="template-codeSnippets-view-Javascript">
4510
+ <div class="mushroom-docs-template" id="template-codeSnippets-view-Javascript">
5873
4511
  <div class="js-driver-snippet">
5874
4512
  Code tham khảo:
5875
4513
  <pre data-language="javascript">try {
@@ -5880,8 +4518,8 @@ catch (e) {
5880
4518
  console.error("Có lỗi: %o", e);
5881
4519
  }</pre>
5882
4520
  </div>
5883
- </script>
5884
- <script type="text/mushroom-docs-template" id="template-codeSnippets-view-JavascriptModel">
4521
+ </div>
4522
+ <div class="mushroom-docs-template" id="template-codeSnippets-view-JavascriptModel">
5885
4523
  <div class="js-driver-snippet">
5886
4524
  Javascript UNDEFINED model
5887
4525
  <pre data-language="json">{{undefinedModel:html}}</pre>
@@ -5890,8 +4528,8 @@ catch (e) {
5890
4528
  Javascript NULL model
5891
4529
  <pre data-language="json">{{nullModel:html}}</pre>
5892
4530
  </div>
5893
- </script>
5894
- <script type="text/mushroom-docs-template" id="template-codeSnippets-view-CSharp">
4531
+ </div>
4532
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-view-CSharp">
5895
4533
  <div class="csharp-driver-snippet">
5896
4534
  <p>Hỗ trợ: DotNet Framework 4.5+, DotNet Core 3.1+, Unity3D, Mono</p>
5897
4535
  Code tham khảo:
@@ -5914,7 +4552,7 @@ catch (Exception ex)
5914
4552
  }</pre>
5915
4553
  </div>
5916
4554
  </script>
5917
- <script type="text/mushroom-docs-template" id="template-codeSnippets-view-HTTP">
4555
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-view-HTTP">
5918
4556
  <div class="http-snippet">
5919
4557
  <pre data-language="http">GET {{rootUrlPath}}{{entityName}}s/views/{{viewName}}{{parameters:html}} HTTP/1.1
5920
4558
  Host: {{domain}}
@@ -5922,7 +4560,7 @@ Content-Type: application/json<span style="display: {{tokenDisplay}}">
5922
4560
  Token: your token</span></pre>
5923
4561
  </div>
5924
4562
  </script>
5925
- <script type="text/mushroom-docs-template" id="template-codeSnippets-view-cURL">
4563
+ <script type="text/mushroom-docs-template" class="mushroom-docs-template" id="template-codeSnippets-view-cURL">
5926
4564
  <div class="curl-snippet">
5927
4565
  cURL
5928
4566
  <pre data-language="cURL">curl -X GET \
@@ -5935,7 +4573,7 @@ Token: your token</span></pre>
5935
4573
  --header 'Token: your token'</span></pre>
5936
4574
  </div>
5937
4575
  </script>
5938
- <script type="text/mushroom-docs-template" id="template-codeSnippets-view-Java">
4576
+ <div class="mushroom-docs-template" id="template-codeSnippets-view-Java">
5939
4577
  <div class="java-driver-snippet">
5940
4578
  Code tham khảo:
5941
4579
  <pre data-language="java">try {
@@ -5959,8 +4597,8 @@ catch(Exception ex) {
5959
4597
  ex.printStackTrace();
5960
4598
  }</pre>
5961
4599
  </div>
5962
- </script>
5963
- <script type="text/mushroom-docs-template" id="template-codeSnippets-view-JavaAsync">
4600
+ </div>
4601
+ <div class="mushroom-docs-template" id="template-codeSnippets-view-JavaAsync">
5964
4602
  <div class="java-driver-snippet">
5965
4603
  Code tham khảo:
5966
4604
  <pre data-language="java">/// ---------------- JAVA 8 OR ANDROID API Level 24+ (Android 7+) ----------------
@@ -6006,17 +4644,17 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6006
4644
  // do something with result and exception e
6007
4645
  });</pre>
6008
4646
  </div>
6009
- </script>
4647
+ </div>
6010
4648
 
6011
- <script type="text/mushroom-docs-template" id="template-findMany-vn_text-channel">
4649
+ <div class="mushroom-docs-template" id="template-findMany-vn_text-channel">
6012
4650
  <li>Cho phép tìm kiếm theo kênh <code>{{name}}</code> trên (các) trường: <code class="separated-items" >{{htmlFields:html}}</code></li>
6013
- </script>
6014
- <script type="text/mushroom-docs-template" id="template-findMany-sorting">
4651
+ </div>
4652
+ <div class="mushroom-docs-template" id="template-findMany-sorting">
6015
4653
  <li>
6016
4654
  <code>{{field}}</code>: {{sortType}}
6017
4655
  </li>
6018
- </script>
6019
- <script type="text/mushroom-docs-template" id="template-findMany-paging">
4656
+ </div>
4657
+ <div class="mushroom-docs-template" id="template-findMany-paging">
6020
4658
  <h4>Phân trang dữ liệu</h4>
6021
4659
  <div>
6022
4660
  Kiểu phân trang: <code>{{strPagingType}}</code>
@@ -6035,8 +4673,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6035
4673
  }
6036
4674
  }</pre>
6037
4675
  </div>
6038
- </script>
6039
- <script type="text/mushroom-docs-template" id="template-findMany-cache">
4676
+ </div>
4677
+ <div class="mushroom-docs-template" id="template-findMany-cache">
6040
4678
  <h4>Cache</h4>
6041
4679
  <div>
6042
4680
  Server: <code>{{serverPolicy}}</code>
@@ -6044,9 +4682,9 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6044
4682
  <div>
6045
4683
  Client: <code>{{clientPolicy}}</code>
6046
4684
  </div>
6047
- </script>
4685
+ </div>
6048
4686
 
6049
- <script type="text/mushroom-docs-template" id="template-findMany">
4687
+ <div class="mushroom-docs-template" id="template-findMany">
6050
4688
  <div class="deny-roles">
6051
4689
  <h4>Phân quyền</h4>
6052
4690
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6100,8 +4738,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6100
4738
  <h4>Thông tin thêm</h4>
6101
4739
  <p>{{description}}</p>
6102
4740
  </div>
6103
- </script>
6104
- <script type="text/mushroom-docs-template" id="template-findById">
4741
+ </div>
4742
+ <div class="mushroom-docs-template" id="template-findById">
6105
4743
  <div class="deny-roles">
6106
4744
  <h4>Phân quyền</h4>
6107
4745
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6123,8 +4761,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6123
4761
  <h4>Thông tin thêm</h4>
6124
4762
  <p>{{description}}</p>
6125
4763
  </div>
6126
- </script>
6127
- <script type="text/mushroom-docs-template" id="template-createOne">
4764
+ </div>
4765
+ <div class="mushroom-docs-template" id="template-createOne">
6128
4766
  <div class="deny-roles">
6129
4767
  <h4>Phân quyền</h4>
6130
4768
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6156,8 +4794,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6156
4794
  <h4>Thông tin thêm</h4>
6157
4795
  <p>{{description}}</p>
6158
4796
  </div>
6159
- </script>
6160
- <script type="text/mushroom-docs-template" id="template-createMany">
4797
+ </div>
4798
+ <div class="mushroom-docs-template" id="template-createMany">
6161
4799
  <div class="deny-roles">
6162
4800
  <h4>Phân quyền</h4>
6163
4801
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6186,8 +4824,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6186
4824
  <h4>Thông tin thêm</h4>
6187
4825
  <p>{{description}}</p>
6188
4826
  </div>
6189
- </script>
6190
- <script type="text/mushroom-docs-template" id="template-updateOne">
4827
+ </div>
4828
+ <div class="mushroom-docs-template" id="template-updateOne">
6191
4829
  <div class="deny-roles">
6192
4830
  <h4>Phân quyền</h4>
6193
4831
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6213,8 +4851,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6213
4851
  <h4>Thông tin thêm</h4>
6214
4852
  <p>{{description}}</p>
6215
4853
  </div>
6216
- </script>
6217
- <script type="text/mushroom-docs-template" id="template-updateMany">
4854
+ </div>
4855
+ <div class="mushroom-docs-template" id="template-updateMany">
6218
4856
  <div class="deny-roles">
6219
4857
  <h4>Phân quyền</h4>
6220
4858
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6240,8 +4878,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6240
4878
  <h4>Thông tin thêm</h4>
6241
4879
  <p>{{description}}</p>
6242
4880
  </div>
6243
- </script>
6244
- <script type="text/mushroom-docs-template" id="template-updatePartially">
4881
+ </div>
4882
+ <div class="mushroom-docs-template" id="template-updatePartially">
6245
4883
  <div class="deny-roles">
6246
4884
  <h4>Phân quyền</h4>
6247
4885
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6273,8 +4911,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6273
4911
  <h4>Thông tin thêm</h4>
6274
4912
  <p>{{description}}</p>
6275
4913
  </div>
6276
- </script>
6277
- <script type="text/mushroom-docs-template" id="template-deleteOne">
4914
+ </div>
4915
+ <div class="mushroom-docs-template" id="template-deleteOne">
6278
4916
  <div class="deny-roles">
6279
4917
  <h4>Phân quyền</h4>
6280
4918
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6296,8 +4934,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6296
4934
  <h4>Thông tin thêm</h4>
6297
4935
  <p>{{description}}</p>
6298
4936
  </div>
6299
- </script>
6300
- <script type="text/mushroom-docs-template" id="template-deleteMany">
4937
+ </div>
4938
+ <div class="mushroom-docs-template" id="template-deleteMany">
6301
4939
  <div class="deny-roles">
6302
4940
  <h4>Phân quyền</h4>
6303
4941
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6323,8 +4961,8 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6323
4961
  <h4>Thông tin thêm</h4>
6324
4962
  <p>{{description}}</p>
6325
4963
  </div>
6326
- </script>
6327
- <script type="text/mushroom-docs-template" id="template-generalAction">
4964
+ </div>
4965
+ <div class="mushroom-docs-template" id="template-generalAction">
6328
4966
  <div class="deny-roles">
6329
4967
  <h4>Phân quyền</h4>
6330
4968
  Từ chối truy cập khi quyền người dùng thỏa điều kiện: <code>{{explainedDenyRoles}}</code>
@@ -6341,10 +4979,10 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6341
4979
  <h4>Request body</h4>
6342
4980
  <pre class="request-body-model"></pre>
6343
4981
  </div>
6344
- </script>
4982
+ </div>
6345
4983
 
6346
4984
 
6347
- <script type="text/mushroom-docs-template" id="template-project-entity-views">
4985
+ <div class="mushroom-docs-template" id="template-project-entity-views">
6348
4986
  <div class="actions">
6349
4987
  <div class="panel panel-primary" id="action-{{entityName}}-views-{{viewName}}">
6350
4988
  <div class="panel-heading" onclick="renderEntityView.call(this, '{{entityName}}', '{{viewName}}'); toggleParentClass.call(this)" data-toggled-class="show" data-hash="{{entityName}}.views.{{viewName}}">
@@ -6358,19 +4996,19 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6358
4996
  </div>
6359
4997
  </div>
6360
4998
  </div>
6361
- </script>
6362
- <script type="text/mushroom-docs-template" id="template-project-entity-view-role">
4999
+ </div>
5000
+ <div class="mushroom-docs-template" id="template-project-entity-view-role">
6363
5001
  <li role="presentation"><a onclick="renderEntityViewRolePage.call(this, '{{entityName}}', '{{viewName}}', '{{grant}}'); activeRoleTab.call(this)" data-role="{{grant}}">{{explainedRole}}</a></li>
6364
- </script>
6365
- <script type="text/mushroom-docs-template" id="template-project-entity-view-page">
5002
+ </div>
5003
+ <div class="mushroom-docs-template" id="template-project-entity-view-page">
6366
5004
  <div class="tab-page" data-role="{{grant}}"></div>
6367
- </script>
6368
- <script type="text/mushroom-docs-template" id="template-view-parameters">
5005
+ </div>
5006
+ <div class="mushroom-docs-template" id="template-view-parameters">
6369
5007
  <li>
6370
5008
  <b>{{field}}</b>: {{type}}, {{required}}{{defaultValue}} - {{description}}
6371
5009
  </li>
6372
- </script>
6373
- <script type="text/mushroom-docs-template" id="template-view">
5010
+ </div>
5011
+ <div class="mushroom-docs-template" id="template-view">
6374
5012
  <div class="description">
6375
5013
  <h4>Mô tả</h4>
6376
5014
  <span>{{description}}</span>
@@ -6394,205 +5032,16 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6394
5032
  <pre>{{outputEmptyResult}}</pre>
6395
5033
  </div>
6396
5034
  </div>
6397
- </script>
6398
- <script type="text/mushroom-docs-template" id="template-project-entity-view-page-codeSnippets">
5035
+ </div>
5036
+ <div class="mushroom-docs-template" id="template-project-entity-view-page-codeSnippets">
6399
5037
  <div class="driver-snippet">
6400
5038
  <h4>Code mẫu</h4>
6401
5039
  <ul class="nav nav-tabs">{{codeSnippetTabHeaders:html}}</ul>
6402
5040
  <div class="tab-pages">{{codeSnippetTabPages:html}}</div>
6403
5041
  </div>
6404
- </script>
6405
-
6406
- <script type="text/javascript">
6407
- function toggleParentClass() {
6408
- const clazz = $(this).data("toggledClass");
6409
- $(this).parent().toggleClass(clazz);
6410
- var hash = $(this).data("hash");
6411
- if (hash) {
6412
- location.hash = hash;
6413
- }
6414
- const computedStyle = getComputedStyle(this);
6415
- let stickyTop = 0;
6416
- if (computedStyle.position === "sticky") {
6417
- stickyTop = parseInt(computedStyle.top);
6418
- if (isNaN(stickyTop)) stickyTop = 0;
6419
- }
6420
-
6421
- if (!$(this).parent().hasClass(clazz)) {
6422
- const b = document.body; //IE 'quirks'
6423
- let d = document.documentElement; //IE with doctype
6424
- d = (d.clientHeight) ? d : b;
6425
-
6426
- if (parseInt(d.scrollTop) > this.offsetTop - stickyTop)
6427
- window.scrollTo(0, this.offsetTop - stickyTop);
6428
- }
6429
- }
6430
-
6431
- function activeRoleTab() {
6432
- var role = $(this).data("role");
6433
- $(this).parent().parent().find(".active").removeClass("active");
6434
- $(this).parent().addClass("active");
6435
- $(this).parent().parent().parent().find("> .tab-pages > .tab-page").removeClass("active").filter(function () {
6436
- return $(this).data("role") === role;
6437
- }).addClass("active");
6438
- }
6439
-
6440
- function activeFirstChild() {
6441
- let dom = this;
6442
- dom = dom.children.length && dom.children[0];
6443
- if (!dom) return;
6444
- dom = dom.children.length && dom.children[0];
6445
- if (!dom) return;
6446
- dom.onclick && dom.onclick();
6447
- }
6448
-
6449
- function gotoHash() {
6450
- if (!location.hash) return;
6451
-
6452
- const m = location.hash.match(/^#(\$[\w-]+|\w+)(\.((views\.)?\w+))?$/);
6453
- if (!m) return;
6454
-
6455
- const cardSelector = m[1].charAt(0) === "$" ? "#extension-" + m[1].substr(1) : "#entity-" + m[1];
6456
- let dom = document.querySelector(cardSelector);
6457
- if (!dom) return;
6458
-
6459
- let top = dom.offsetTop;
6460
- dom = dom.firstElementChild;
6461
- if (!dom) return;
6462
- dom.onclick && dom.onclick();
6463
- let computedStyle = getComputedStyle(dom);
6464
- let stickyTop = 0;
6465
- if (computedStyle.position === "sticky") {
6466
- stickyTop = parseInt(computedStyle.top);
6467
- if (isNaN(stickyTop)) stickyTop = 0;
6468
- }
6469
- window.scrollTo(0, top - stickyTop);
6470
-
6471
-
6472
- if (!m[3]) return;
6473
-
6474
- const panelSelector = m[1].charAt(0) === "$"
6475
- ? "#extension-" + m[1].substr(1) + "-" + m[3].replace(/[.]/g, "-")
6476
- : "#action-" + m[1] + "-" + m[3].replace(/[.]/g, "-");
6477
- dom = document.querySelector(panelSelector);
6478
- if (!dom) return;
6479
-
6480
- top = dom.offsetTop;
6481
- dom = dom.firstElementChild;
6482
- if (!dom) return;
6483
- dom.onclick && dom.onclick();
6484
- computedStyle = getComputedStyle(dom);
6485
- stickyTop = 0;
6486
- if (computedStyle.position === "sticky") {
6487
- stickyTop = parseInt(computedStyle.top);
6488
- if (isNaN(stickyTop)) stickyTop = 0;
6489
- }
6490
- window.scrollTo(0, top - stickyTop);
6491
- }
6492
-
6493
- function copied() {
6494
- const dom = document.querySelector("#copied");
6495
- if (!dom) return;
6496
-
6497
- dom.classList.add("show");
6498
- setTimeout(() => dom.classList.remove("show"), 1000);
6499
- }
6500
-
6501
- function initDom(dom) {
6502
- $("pre[data-language]", dom).each(function() {
6503
- const holder = document.createElement("div");
6504
- holder.className = "command-bar";
6505
- const copyButton = document.createElement("a");
6506
- copyButton.innerHTML = "Copy";
6507
- holder.appendChild(copyButton);
6508
- $(this).prepend(holder);
6509
- copyButton.onclick = function() {
6510
- if (location.protocol !== 'https:' && location.protocol !== 'file:') {
6511
- alert("Can not copy, please use https protocol!");
6512
- return;
6513
- }
6514
- const pre = $(this).parent().parent();
6515
- const commandBar = $(this).parent().detach();
6516
- try {
6517
- if (window.ClipboardItem) {
6518
- const content = pre.text();
6519
- const blob = new Blob([content], { type: "text/plain" });
6520
- const text = new ClipboardItem({ "text/plain": blob });
6521
- navigator.clipboard.write([text]);
6522
- }
6523
- else {
6524
- if (document.body.createTextRange) {
6525
- const range = document.body.createTextRange();
6526
- range.moveToElementText(pre[0]);
6527
- range.select();
6528
- } else if (window.getSelection) {
6529
- const selection = window.getSelection();
6530
- const range = document.createRange();
6531
- range.selectNodeContents(pre[0]);
6532
- selection.removeAllRanges();
6533
- selection.addRange(range);
6534
- }
6535
- document.execCommand("copy");
6536
- }
6537
- }
6538
- finally {
6539
- pre.prepend(commandBar);
6540
- }
5042
+ </div>
6541
5043
 
6542
- copied();
6543
- }
6544
- });
6545
-
6546
- $("pre[data-language=json] .command-bar", dom).each(function() {
6547
- const copyButton = document.createElement("a");
6548
- copyButton.innerHTML = "Copy (without comment)";
6549
- $(this).prepend(copyButton);
6550
- copyButton.onclick = function() {
6551
- if (location.protocol !== 'https:' && location.protocol !== 'file:') {
6552
- alert("Can not copy, please use https protocol!");
6553
- return;
6554
- }
6555
- const pre = $(this).parent().parent();
6556
- const commandBar = $(this).parent().detach();
6557
- pre.find(".code-comment").each(function() {
6558
- this.dataset.innerHTML = this.innerHTML;
6559
- this.innerHTML = "";
6560
- });
6561
- try {
6562
- if (window.ClipboardItem) {
6563
- const content = pre.text();
6564
- const blob = new Blob([content], { type: "text/plain" });
6565
- const text = new ClipboardItem({ "text/plain": blob });
6566
- navigator.clipboard.write([text]);
6567
- }
6568
- else {
6569
- if (document.body.createTextRange) {
6570
- const range = document.body.createTextRange();
6571
- range.moveToElementText(pre[0]);
6572
- range.select();
6573
- } else if (window.getSelection) {
6574
- const selection = window.getSelection();
6575
- const range = document.createRange();
6576
- range.selectNodeContents(pre[0]);
6577
- selection.removeAllRanges();
6578
- selection.addRange(range);
6579
- }
6580
- document.execCommand("copy");
6581
- }
6582
- }
6583
- finally {
6584
- pre.prepend(commandBar);
6585
- pre.find(".code-comment").each(function() {
6586
- this.innerHTML = this.dataset.innerHTML;
6587
- delete this.dataset.innerHTML;
6588
- });
6589
- }
6590
-
6591
- copied();
6592
- }
6593
- });
6594
- }
6595
- </script>
5044
+ <script id="INJECT-JAVASCRIPT-HERE"></script>
6596
5045
  <script type="text/javascript">
6597
5046
  (() => {
6598
5047
  if (!window.docs) {
@@ -6600,6 +5049,7 @@ API.get{{EntityName}}().getViews().{{viewName}}Async(arg, result -> {
6600
5049
  document.title = document.body.innerHTML = "Empty document.";
6601
5050
  return;
6602
5051
  }
5052
+ populateTemplates();
6603
5053
  renderInfo();
6604
5054
  renderEnvironmentVariables();
6605
5055
  renderExtensionAuth();