simple-dynamsoft-mcp 7.2.8 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/data/metadata/data-manifest.json +48 -8
- package/data/metadata/dynamsoft_sdks.json +3 -3
- package/package.json +1 -1
- package/src/data/repo-map.js +42 -2
- package/src/server/create-server.js +6 -1
- package/src/server/normalizers.js +8 -14
- package/src/server/public-offerings.js +71 -0
- package/src/server/resource-index/builders.js +384 -20
- package/src/server/resource-index/config.js +14 -0
- package/src/server/resource-index/paths.js +4 -0
- package/src/server/resource-index/samples.js +148 -1
- package/src/server/resource-index/uri.js +12 -0
- package/src/server/resource-index/version-policy.js +13 -5
- package/src/server/resource-index.js +60 -2
- package/src/server/resources/register-resources.js +1 -1
- package/src/server/tools/public-routing.js +75 -0
- package/src/server/tools/register-index-tools.js +33 -14
- package/src/server/tools/register-project-tools.js +100 -27
- package/src/server/tools/register-quickstart-tools.js +103 -14
- package/src/server/tools/register-sample-tools.js +12 -3
- package/src/server/tools/register-version-tools.js +51 -43
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
2
2
|
import { extname, join } from "node:path";
|
|
3
3
|
import { DDV_PREFERRED_ENTRY_FILES } from "./config.js";
|
|
4
|
+
import { PUBLIC_OFFERING_PRODUCTS } from "../public-offerings.js";
|
|
5
|
+
|
|
6
|
+
const MRZ_MATCHER = /(?:\bmrz\b|machine[-\s]?readable[-\s]?zone|passport)/i;
|
|
7
|
+
const MDS_MATCHER = /(?:document[-\s]scan|document scanner|document scanning|document normalizer|document normalization|normaliz|auto[-\s]?capture|crop|cropping|deskew)/i;
|
|
8
|
+
const WEB_FRAMEWORK_PLATFORMS = new Set(["react", "vue", "angular", "next", "nuxt", "svelte", "blazor", "capacitor", "electron", "es6", "native-ts", "pwa", "requirejs", "webview"]);
|
|
9
|
+
|
|
10
|
+
function normalizeFrameworkTag(tag) {
|
|
11
|
+
const normalized = String(tag || "").trim().toLowerCase();
|
|
12
|
+
if (normalized === "react-hooks" || normalized === "react-vite") return "react";
|
|
13
|
+
return normalized;
|
|
14
|
+
}
|
|
4
15
|
|
|
5
16
|
function countSamples(sampleData) {
|
|
6
17
|
if (Array.isArray(sampleData)) {
|
|
@@ -47,23 +58,125 @@ function buildProductSelectionGuidanceText() {
|
|
|
47
58
|
return [
|
|
48
59
|
"# Product Selection Guidance",
|
|
49
60
|
"",
|
|
50
|
-
"##
|
|
51
|
-
"",
|
|
52
|
-
"Dynamsoft Capture Vision (DCV) is a superset architecture that aggregates Dynamsoft Barcode Reader (DBR), Dynamsoft Label Recognizer (DLR), Dynamsoft Document Normalizer (DDN), Dynamsoft Code Parser (DCP), and Dynamsoft Camera Enhancer (DCE).",
|
|
61
|
+
"## Public Product Offerings",
|
|
53
62
|
"",
|
|
54
|
-
"
|
|
63
|
+
"The public MCP catalog exposes five first-tier products: Dynamic Web TWAIN (DWT), Dynamsoft Document Viewer (DDV), Dynamsoft Barcode Reader (DBR), MRZ Scanner (MRZ), and Mobile Document Scanner (MDS).",
|
|
55
64
|
"",
|
|
56
|
-
"
|
|
57
|
-
"-
|
|
58
|
-
"-
|
|
59
|
-
"-
|
|
60
|
-
"- Document
|
|
61
|
-
"- Multi-task image processing and parsing workflows",
|
|
65
|
+
"- Dynamic Web TWAIN (DWT): use for browser-based document acquisition and scanner control.",
|
|
66
|
+
"- Dynamsoft Document Viewer (DDV): use as a standalone viewer. It is the extension path for DWT users who need mobile support or PDF annotation, and for MDS users who need multi-page support or PDF output.",
|
|
67
|
+
"- Dynamsoft Barcode Reader (DBR): use for barcode workflows. On server/desktop, it is the foundational subset with dedicated docs, samples, and packages for C++, Python, Java, and .NET. On web, start with the foundational API by default for the current 11.4 positioning, with only minimal use of BarcodeScanner RTU when utter simplicity matters. On mobile, both the foundational API and BarcodeScanner RTU remain official.",
|
|
68
|
+
"- MRZ Scanner (MRZ): use for passport and machine-readable-zone workflows. Public guidance is web/mobile solution/RTU only. Do not default to a foundational API path here; handle server/desktop separately through contact-driven guidance.",
|
|
69
|
+
"- Mobile Document Scanner (MDS): use for document scan and normalization workflows. Public guidance is web-only solution/RTU. Do not default to a foundational API path here; handle mobile and server/desktop separately through contact-driven guidance.",
|
|
62
70
|
"",
|
|
63
|
-
"
|
|
71
|
+
"Choose DBR when you want direct barcode capabilities, MRZ when you want passport/MRZ flows, MDS when you want document scanning flows, DWT when you need browser acquisition, and DDV when you need viewing, annotation, multi-page handling, or PDF-oriented extension paths."
|
|
64
72
|
].join("\n");
|
|
65
73
|
}
|
|
66
74
|
|
|
75
|
+
function getEntryClassificationText(entry) {
|
|
76
|
+
return [
|
|
77
|
+
entry.title,
|
|
78
|
+
entry.summary,
|
|
79
|
+
entry.uri,
|
|
80
|
+
entry.path,
|
|
81
|
+
Array.isArray(entry.tags) ? entry.tags.join(" ") : ""
|
|
82
|
+
].filter(Boolean).join(" ");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function classifyDcvPublicProduct(entry) {
|
|
86
|
+
if (entry.edition === "web" || entry.platform === "web") {
|
|
87
|
+
return "";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const text = getEntryClassificationText(entry);
|
|
91
|
+
const isSupportedMrzEdition = entry.edition === "mobile";
|
|
92
|
+
|
|
93
|
+
if (isSupportedMrzEdition && MRZ_MATCHER.test(text)) {
|
|
94
|
+
return "mrz";
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return "";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function rewriteProductInUri(uri, product) {
|
|
101
|
+
if (typeof uri !== "string" || !uri.includes("://") || !product) return uri;
|
|
102
|
+
const [scheme, rest] = uri.split("://");
|
|
103
|
+
const parts = String(rest || "").split("/");
|
|
104
|
+
if (parts.length === 0) return uri;
|
|
105
|
+
parts[0] = product;
|
|
106
|
+
return `${scheme}://${parts.join("/")}`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function rewritePublicTitle(title, publicProduct) {
|
|
110
|
+
if (typeof title !== "string") return title;
|
|
111
|
+
const base = title
|
|
112
|
+
.replace(/\bDynamsoft\s+Capture\s+Vision\b\s*/gi, "")
|
|
113
|
+
.replace(/\bCapture\s+Vision\b\s*/gi, "")
|
|
114
|
+
.replace(/\bDCV\b\s*/gi, "")
|
|
115
|
+
.trim();
|
|
116
|
+
if (publicProduct === "mrz") return base.replace(/sample:/i, "MRZ sample:");
|
|
117
|
+
if (publicProduct === "mds") return base.replace(/sample:/i, "MDS sample:");
|
|
118
|
+
return base;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function rewritePublicSummary(summary, publicProduct) {
|
|
122
|
+
if (typeof summary !== "string") return summary;
|
|
123
|
+
const withoutBrand = summary
|
|
124
|
+
.replace(/\bDynamsoft\s+Capture\s+Vision\b\s*/gi, "")
|
|
125
|
+
.replace(/\bCapture\s+Vision\b\s*/gi, "")
|
|
126
|
+
.replace(/\bDCV\b\s*/gi, "")
|
|
127
|
+
.trim();
|
|
128
|
+
if (publicProduct === "mrz") {
|
|
129
|
+
return withoutBrand.replace(/^python sample/i, "MRZ python sample")
|
|
130
|
+
.replace(/^cpp sample/i, "MRZ cpp sample")
|
|
131
|
+
.replace(/^dotnet sample/i, "MRZ dotnet sample")
|
|
132
|
+
.replace(/^java sample/i, "MRZ java sample")
|
|
133
|
+
.replace(/^mobile ([a-z-]+) sample/i, "MRZ mobile $1 sample")
|
|
134
|
+
.replace(/^web documentation/i, "MRZ web documentation")
|
|
135
|
+
.replace(/^mobile documentation/i, "MRZ mobile documentation")
|
|
136
|
+
.replace(/^server\/desktop documentation/i, "MRZ server/desktop documentation")
|
|
137
|
+
.replace(/^core documentation/i, "MRZ core documentation");
|
|
138
|
+
}
|
|
139
|
+
if (publicProduct === "mds") {
|
|
140
|
+
return withoutBrand.replace(/^python sample/i, "MDS python sample")
|
|
141
|
+
.replace(/^cpp sample/i, "MDS cpp sample")
|
|
142
|
+
.replace(/^dotnet sample/i, "MDS dotnet sample")
|
|
143
|
+
.replace(/^java sample/i, "MDS java sample")
|
|
144
|
+
.replace(/^mobile ([a-z-]+) sample/i, "MDS mobile $1 sample")
|
|
145
|
+
.replace(/^web documentation/i, "MDS web documentation")
|
|
146
|
+
.replace(/^mobile documentation/i, "MDS mobile documentation")
|
|
147
|
+
.replace(/^server\/desktop documentation/i, "MDS server/desktop documentation")
|
|
148
|
+
.replace(/^core documentation/i, "MDS core documentation");
|
|
149
|
+
}
|
|
150
|
+
return withoutBrand;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function toPublicEntry(entry) {
|
|
154
|
+
if (!entry?.product || entry.product !== "dcv") {
|
|
155
|
+
return entry;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const publicProduct = classifyDcvPublicProduct(entry);
|
|
159
|
+
if (!publicProduct) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
...entry,
|
|
165
|
+
product: publicProduct,
|
|
166
|
+
uri: rewriteProductInUri(entry.uri, publicProduct),
|
|
167
|
+
title: rewritePublicTitle(entry.title, publicProduct),
|
|
168
|
+
summary: rewritePublicSummary(entry.summary, publicProduct),
|
|
169
|
+
tags: Array.from(new Set([...(entry.tags || []), publicProduct]))
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function addPublicResourceToIndex(addResourceToIndex, entry) {
|
|
174
|
+
const publicEntry = toPublicEntry(entry);
|
|
175
|
+
if (publicEntry) {
|
|
176
|
+
addResourceToIndex(publicEntry);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
67
180
|
function addMarkdownDocResources({
|
|
68
181
|
addResourceToIndex,
|
|
69
182
|
docs,
|
|
@@ -85,7 +198,7 @@ function addMarkdownDocResources({
|
|
|
85
198
|
const tags = [...baseTags, platform];
|
|
86
199
|
if (article.breadcrumb) tags.push(...article.breadcrumb.toLowerCase().split(/\s*>\s*/));
|
|
87
200
|
|
|
88
|
-
addResourceToIndex
|
|
201
|
+
addPublicResourceToIndex(addResourceToIndex, {
|
|
89
202
|
id: `${idPrefix}-${i}`,
|
|
90
203
|
uri: `${uriPrefix}/${platform}/${version}/${slug}`,
|
|
91
204
|
type: "doc",
|
|
@@ -94,8 +207,12 @@ function addMarkdownDocResources({
|
|
|
94
207
|
platform,
|
|
95
208
|
version,
|
|
96
209
|
majorVersion,
|
|
97
|
-
title:
|
|
98
|
-
|
|
210
|
+
title: product === "mrz" || product === "mds"
|
|
211
|
+
? rewritePublicTitle(article.title, product)
|
|
212
|
+
: article.title,
|
|
213
|
+
summary: product === "mrz" || product === "mds"
|
|
214
|
+
? rewritePublicSummary(article.breadcrumb || defaultSummary, product)
|
|
215
|
+
: (article.breadcrumb || defaultSummary),
|
|
99
216
|
embedText: article.content,
|
|
100
217
|
mimeType: "text/markdown",
|
|
101
218
|
tags,
|
|
@@ -116,11 +233,46 @@ function addMarkdownDocResources({
|
|
|
116
233
|
}
|
|
117
234
|
}
|
|
118
235
|
|
|
236
|
+
function loadStructuredWebSampleContent({
|
|
237
|
+
category,
|
|
238
|
+
sampleName,
|
|
239
|
+
getSamplePath,
|
|
240
|
+
findCodeFilesInSample,
|
|
241
|
+
readCodeFile,
|
|
242
|
+
getMimeTypeForExtension
|
|
243
|
+
}) {
|
|
244
|
+
const samplePath = getSamplePath(category, sampleName);
|
|
245
|
+
if (!samplePath || !existsSync(samplePath)) {
|
|
246
|
+
return { text: "Sample not found", mimeType: "text/plain" };
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const stat = statSync(samplePath);
|
|
250
|
+
if (stat.isDirectory()) {
|
|
251
|
+
const readmePath = join(samplePath, "README.md");
|
|
252
|
+
if (existsSync(readmePath)) {
|
|
253
|
+
return { text: readCodeFile(readmePath), mimeType: "text/markdown" };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const codeFiles = findCodeFilesInSample(samplePath);
|
|
257
|
+
if (codeFiles.length > 0) {
|
|
258
|
+
const preferred = codeFiles.find((file) => file.filename === "index.html") || codeFiles[0];
|
|
259
|
+
return { text: readCodeFile(preferred.path), mimeType: getMimeTypeForExtension(preferred.extension) };
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return { text: "Sample found, but no code files detected.", mimeType: "text/plain" };
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const ext = extname(samplePath).replace(".", "");
|
|
266
|
+
return { text: readCodeFile(samplePath), mimeType: getMimeTypeForExtension(ext) };
|
|
267
|
+
}
|
|
268
|
+
|
|
119
269
|
function buildIndexData({
|
|
120
270
|
LATEST_VERSIONS,
|
|
121
271
|
LATEST_MAJOR,
|
|
122
272
|
dcvCoreDocs,
|
|
123
273
|
dcvWebDocs,
|
|
274
|
+
mrzWebDocs,
|
|
275
|
+
mdsWebDocs,
|
|
124
276
|
dcvMobileDocs,
|
|
125
277
|
dcvServerDocs,
|
|
126
278
|
dbrWebDocs,
|
|
@@ -130,6 +282,10 @@ function buildIndexData({
|
|
|
130
282
|
ddvDocs,
|
|
131
283
|
discoverDcvWebSamples,
|
|
132
284
|
getDcvWebFrameworkPlatforms,
|
|
285
|
+
discoverMrzWebSamples,
|
|
286
|
+
getMrzWebFrameworkPlatforms,
|
|
287
|
+
discoverMdsWebSamples,
|
|
288
|
+
getMdsWebFrameworkPlatforms,
|
|
133
289
|
getDcvMobilePlatforms,
|
|
134
290
|
getDcvServerPlatforms,
|
|
135
291
|
discoverDcvMobileSamples,
|
|
@@ -142,8 +298,102 @@ function buildIndexData({
|
|
|
142
298
|
discoverDbrServerSamples,
|
|
143
299
|
discoverDwtSamples,
|
|
144
300
|
discoverDdvSamples,
|
|
145
|
-
getDdvWebFrameworkPlatforms
|
|
301
|
+
getDdvWebFrameworkPlatforms,
|
|
302
|
+
resourceIndex
|
|
146
303
|
}) {
|
|
304
|
+
if (Array.isArray(resourceIndex) && resourceIndex.length > 0) {
|
|
305
|
+
const products = Object.fromEntries(PUBLIC_OFFERING_PRODUCTS.map((product) => [product, {
|
|
306
|
+
latestMajor: product === "mrz" || product === "mds" ? LATEST_MAJOR.dcv : LATEST_MAJOR[product],
|
|
307
|
+
editions: {}
|
|
308
|
+
}]));
|
|
309
|
+
|
|
310
|
+
for (const entry of resourceIndex) {
|
|
311
|
+
if (!entry?.product || !PUBLIC_OFFERING_PRODUCTS.includes(entry.product)) continue;
|
|
312
|
+
if (entry.type !== "doc" && entry.type !== "sample") continue;
|
|
313
|
+
|
|
314
|
+
const editionName = entry.edition === "python" ? "server" : (entry.edition || "web");
|
|
315
|
+
if (!products[entry.product].editions[editionName]) {
|
|
316
|
+
const version = entry.version
|
|
317
|
+
|| ((entry.product === "mrz" || entry.product === "mds") ? LATEST_VERSIONS.dcv[editionName] : LATEST_VERSIONS[entry.product]?.[editionName])
|
|
318
|
+
|| "";
|
|
319
|
+
products[entry.product].editions[editionName] = {
|
|
320
|
+
version,
|
|
321
|
+
platforms: [],
|
|
322
|
+
docCount: 0,
|
|
323
|
+
sampleCount: 0
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const edition = products[entry.product].editions[editionName];
|
|
328
|
+
const platforms = new Set();
|
|
329
|
+
if (entry.platform) {
|
|
330
|
+
platforms.add(entry.platform);
|
|
331
|
+
if (entry.edition === "web" && entry.platform === "web") {
|
|
332
|
+
platforms.add("js");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (entry.edition === "web" && Array.isArray(entry.tags)) {
|
|
336
|
+
for (const tag of entry.tags) {
|
|
337
|
+
const normalizedTag = normalizeFrameworkTag(tag);
|
|
338
|
+
if (WEB_FRAMEWORK_PLATFORMS.has(normalizedTag)) {
|
|
339
|
+
platforms.add(normalizedTag);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
for (const platform of platforms) {
|
|
345
|
+
if (!edition.platforms.includes(platform)) {
|
|
346
|
+
edition.platforms.push(platform);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (entry.type === "doc") edition.docCount += 1;
|
|
350
|
+
if (entry.type === "sample") edition.sampleCount += 1;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
for (const product of Object.values(products)) {
|
|
354
|
+
for (const edition of Object.values(product.editions)) {
|
|
355
|
+
edition.platforms.sort();
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return {
|
|
360
|
+
productSelection: {
|
|
361
|
+
publicOfferings: [...PUBLIC_OFFERING_PRODUCTS],
|
|
362
|
+
offerings: {
|
|
363
|
+
dwt: {
|
|
364
|
+
name: "Dynamic Web TWAIN",
|
|
365
|
+
abbreviation: "DWT",
|
|
366
|
+
whenToUse: ["Browser-based document acquisition and scanner control."]
|
|
367
|
+
},
|
|
368
|
+
ddv: {
|
|
369
|
+
name: "Dynamsoft Document Viewer",
|
|
370
|
+
abbreviation: "DDV",
|
|
371
|
+
whenToUse: ["Standalone viewing plus extension paths for mobile, annotation, multi-page handling, and PDF output."]
|
|
372
|
+
},
|
|
373
|
+
dbr: {
|
|
374
|
+
name: "Dynamsoft Barcode Reader",
|
|
375
|
+
abbreviation: "DBR",
|
|
376
|
+
whenToUse: [
|
|
377
|
+
"Barcode workflows across server/desktop, web, and mobile.",
|
|
378
|
+
"Use the foundational API by default on web; BarcodeScanner RTU is a minimal-simplicity option; mobile supports both foundational API and BarcodeScanner RTU."
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
mrz: {
|
|
382
|
+
name: "MRZ Scanner",
|
|
383
|
+
abbreviation: "MRZ",
|
|
384
|
+
whenToUse: ["Passport and machine-readable-zone workflows on public web/mobile solution or RTU paths."]
|
|
385
|
+
},
|
|
386
|
+
mds: {
|
|
387
|
+
name: "Mobile Document Scanner",
|
|
388
|
+
abbreviation: "MDS",
|
|
389
|
+
whenToUse: ["Document scan and normalization workflows on the public web-only solution or RTU path."]
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
products
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
147
397
|
const dcvCoreVersion = LATEST_VERSIONS.dcv.core;
|
|
148
398
|
const dcvWebVersion = LATEST_VERSIONS.dcv.web;
|
|
149
399
|
const dcvMobileVersion = LATEST_VERSIONS.dcv.mobile;
|
|
@@ -156,6 +406,10 @@ function buildIndexData({
|
|
|
156
406
|
|
|
157
407
|
const dcvWebSamples = discoverDcvWebSamples();
|
|
158
408
|
const dcvWebFrameworks = getDcvWebFrameworkPlatforms();
|
|
409
|
+
const mrzWebSamples = discoverMrzWebSamples();
|
|
410
|
+
const mrzWebFrameworks = getMrzWebFrameworkPlatforms();
|
|
411
|
+
const mdsWebSamples = discoverMdsWebSamples();
|
|
412
|
+
const mdsWebFrameworks = getMdsWebFrameworkPlatforms();
|
|
159
413
|
const dcvMobilePlatforms = getDcvMobilePlatforms();
|
|
160
414
|
const dcvServerPlatforms = getDcvServerPlatforms();
|
|
161
415
|
const dbrWebSampleCount = countSamples(discoverWebSamples());
|
|
@@ -254,6 +508,28 @@ function buildIndexData({
|
|
|
254
508
|
sampleCount: countSamples(ddvSamples)
|
|
255
509
|
}
|
|
256
510
|
}
|
|
511
|
+
},
|
|
512
|
+
mrz: {
|
|
513
|
+
latestMajor: LATEST_MAJOR.dcv,
|
|
514
|
+
editions: {
|
|
515
|
+
web: {
|
|
516
|
+
version: dcvWebVersion,
|
|
517
|
+
platforms: ["js", ...mrzWebFrameworks],
|
|
518
|
+
docCount: mrzWebDocs.length,
|
|
519
|
+
sampleCount: countSamples(mrzWebSamples)
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
mds: {
|
|
524
|
+
latestMajor: LATEST_MAJOR.dcv,
|
|
525
|
+
editions: {
|
|
526
|
+
web: {
|
|
527
|
+
version: dcvWebVersion,
|
|
528
|
+
platforms: ["js", ...mdsWebFrameworks],
|
|
529
|
+
docCount: mdsWebDocs.length,
|
|
530
|
+
sampleCount: countSamples(mdsWebSamples)
|
|
531
|
+
}
|
|
532
|
+
}
|
|
257
533
|
}
|
|
258
534
|
}
|
|
259
535
|
};
|
|
@@ -267,6 +543,8 @@ function buildResourceIndex({
|
|
|
267
543
|
LATEST_MAJOR,
|
|
268
544
|
dcvCoreDocs,
|
|
269
545
|
dcvWebDocs,
|
|
546
|
+
mrzWebDocs,
|
|
547
|
+
mdsWebDocs,
|
|
270
548
|
dcvMobileDocs,
|
|
271
549
|
dcvServerDocs,
|
|
272
550
|
dbrWebDocs,
|
|
@@ -282,6 +560,10 @@ function buildResourceIndex({
|
|
|
282
560
|
getDcvServerSampleContent,
|
|
283
561
|
discoverDcvWebSamples,
|
|
284
562
|
getDcvWebSamplePath,
|
|
563
|
+
discoverMrzWebSamples,
|
|
564
|
+
getMrzWebSamplePath,
|
|
565
|
+
discoverMdsWebSamples,
|
|
566
|
+
getMdsWebSamplePath,
|
|
285
567
|
discoverMobileSamples,
|
|
286
568
|
getDbrMobilePlatforms,
|
|
287
569
|
getMobileSamplePath,
|
|
@@ -334,9 +616,9 @@ function buildResourceIndex({
|
|
|
334
616
|
uri: "doc://product-selection",
|
|
335
617
|
type: "policy",
|
|
336
618
|
title: "Product Selection Guidance",
|
|
337
|
-
summary: "When to use
|
|
619
|
+
summary: "When to use Dynamic Web TWAIN (DWT), Dynamsoft Document Viewer (DDV), Dynamsoft Barcode Reader (DBR), MRZ Scanner (MRZ), and Mobile Document Scanner (MDS).",
|
|
338
620
|
mimeType: "text/markdown",
|
|
339
|
-
tags: ["guidance", "product-selection", "
|
|
621
|
+
tags: ["guidance", "product-selection", "dbr", "dwt", "ddv", "mrz", "mds"],
|
|
340
622
|
pinned: true,
|
|
341
623
|
loadContent: async () => ({
|
|
342
624
|
text: buildProductSelectionGuidanceText(),
|
|
@@ -382,6 +664,34 @@ function buildResourceIndex({
|
|
|
382
664
|
baseTags: ["doc", "dcv", "web"]
|
|
383
665
|
});
|
|
384
666
|
|
|
667
|
+
addMarkdownDocResources({
|
|
668
|
+
addResourceToIndex,
|
|
669
|
+
docs: mrzWebDocs,
|
|
670
|
+
idPrefix: "mrz-web-doc",
|
|
671
|
+
uriPrefix: "doc://mrz/web",
|
|
672
|
+
product: "mrz",
|
|
673
|
+
edition: "web",
|
|
674
|
+
version: dcvWebVersion,
|
|
675
|
+
majorVersion: LATEST_MAJOR.dcv,
|
|
676
|
+
defaultPlatform: "web",
|
|
677
|
+
defaultSummary: "Dynamsoft MRZ Scanner Web documentation",
|
|
678
|
+
baseTags: ["doc", "mrz", "web"]
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
addMarkdownDocResources({
|
|
682
|
+
addResourceToIndex,
|
|
683
|
+
docs: mdsWebDocs,
|
|
684
|
+
idPrefix: "mds-web-doc",
|
|
685
|
+
uriPrefix: "doc://mds/web",
|
|
686
|
+
product: "mds",
|
|
687
|
+
edition: "web",
|
|
688
|
+
version: dcvWebVersion,
|
|
689
|
+
majorVersion: LATEST_MAJOR.dcv,
|
|
690
|
+
defaultPlatform: "web",
|
|
691
|
+
defaultSummary: "Dynamsoft Mobile Document Scanner Web documentation",
|
|
692
|
+
baseTags: ["doc", "mds", "web"]
|
|
693
|
+
});
|
|
694
|
+
|
|
385
695
|
addMarkdownDocResources({
|
|
386
696
|
addResourceToIndex,
|
|
387
697
|
docs: dcvMobileDocs,
|
|
@@ -412,7 +722,7 @@ function buildResourceIndex({
|
|
|
412
722
|
|
|
413
723
|
for (const sampleName of discoverDcvWebSamples()) {
|
|
414
724
|
const scenarioTags = getDcvScenarioTags(sampleName);
|
|
415
|
-
addResourceToIndex
|
|
725
|
+
addPublicResourceToIndex(addResourceToIndex, {
|
|
416
726
|
id: `dcv-web-${sampleName}`,
|
|
417
727
|
uri: `sample://dcv/web/web/${dcvWebVersion}/${sampleName}`,
|
|
418
728
|
type: "sample",
|
|
@@ -447,10 +757,64 @@ function buildResourceIndex({
|
|
|
447
757
|
});
|
|
448
758
|
}
|
|
449
759
|
|
|
760
|
+
for (const [category, samples] of Object.entries(discoverMrzWebSamples())) {
|
|
761
|
+
for (const sampleName of samples) {
|
|
762
|
+
addResourceToIndex({
|
|
763
|
+
id: `mrz-web-${category}-${sampleName}`,
|
|
764
|
+
uri: `sample://mrz/web/web/${dcvWebVersion}/${category}/${sampleName}`,
|
|
765
|
+
type: "sample",
|
|
766
|
+
product: "mrz",
|
|
767
|
+
edition: "web",
|
|
768
|
+
platform: "web",
|
|
769
|
+
version: dcvWebVersion,
|
|
770
|
+
majorVersion: LATEST_MAJOR.dcv,
|
|
771
|
+
title: `MRZ sample: ${sampleName} (${category})`,
|
|
772
|
+
summary: `MRZ web sample ${category}/${sampleName}.`,
|
|
773
|
+
mimeType: "text/plain",
|
|
774
|
+
tags: ["sample", "mrz", "web", category, sampleName],
|
|
775
|
+
loadContent: async () => loadStructuredWebSampleContent({
|
|
776
|
+
category,
|
|
777
|
+
sampleName,
|
|
778
|
+
getSamplePath: getMrzWebSamplePath,
|
|
779
|
+
findCodeFilesInSample,
|
|
780
|
+
readCodeFile,
|
|
781
|
+
getMimeTypeForExtension
|
|
782
|
+
})
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
for (const [category, samples] of Object.entries(discoverMdsWebSamples())) {
|
|
788
|
+
for (const sampleName of samples) {
|
|
789
|
+
addResourceToIndex({
|
|
790
|
+
id: `mds-web-${category}-${sampleName}`,
|
|
791
|
+
uri: `sample://mds/web/web/${dcvWebVersion}/${category}/${sampleName}`,
|
|
792
|
+
type: "sample",
|
|
793
|
+
product: "mds",
|
|
794
|
+
edition: "web",
|
|
795
|
+
platform: "web",
|
|
796
|
+
version: dcvWebVersion,
|
|
797
|
+
majorVersion: LATEST_MAJOR.dcv,
|
|
798
|
+
title: `MDS sample: ${sampleName} (${category})`,
|
|
799
|
+
summary: `MDS web sample ${category}/${sampleName}.`,
|
|
800
|
+
mimeType: "text/plain",
|
|
801
|
+
tags: ["sample", "mds", "web", category, sampleName],
|
|
802
|
+
loadContent: async () => loadStructuredWebSampleContent({
|
|
803
|
+
category,
|
|
804
|
+
sampleName,
|
|
805
|
+
getSamplePath: getMdsWebSamplePath,
|
|
806
|
+
findCodeFilesInSample,
|
|
807
|
+
readCodeFile,
|
|
808
|
+
getMimeTypeForExtension
|
|
809
|
+
})
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
450
814
|
for (const platform of getDcvMobilePlatforms()) {
|
|
451
815
|
for (const sampleName of discoverDcvMobileSamples(platform)) {
|
|
452
816
|
const scenarioTags = getDcvScenarioTags(sampleName);
|
|
453
|
-
addResourceToIndex
|
|
817
|
+
addPublicResourceToIndex(addResourceToIndex, {
|
|
454
818
|
id: `dcv-mobile-${platform}-${sampleName}`,
|
|
455
819
|
uri: `sample://dcv/mobile/${platform}/${dcvMobileVersion}/${sampleName}`,
|
|
456
820
|
type: "sample",
|
|
@@ -490,7 +854,7 @@ function buildResourceIndex({
|
|
|
490
854
|
for (const platform of getDcvServerPlatforms()) {
|
|
491
855
|
for (const sampleName of discoverDcvServerSamples(platform)) {
|
|
492
856
|
const scenarioTags = getDcvScenarioTags(sampleName);
|
|
493
|
-
addResourceToIndex
|
|
857
|
+
addPublicResourceToIndex(addResourceToIndex, {
|
|
494
858
|
id: `dcv-${platform}-${sampleName}`,
|
|
495
859
|
uri: `sample://dcv/server/${platform}/${dcvServerVersion}/${sampleName}`,
|
|
496
860
|
type: "sample",
|
|
@@ -10,6 +10,8 @@ const SAMPLE_DIRS = {
|
|
|
10
10
|
dbrFlutter: "dynamsoft-barcode-reader-flutter",
|
|
11
11
|
dbrNodejs: "dynamsoft-capture-vision-nodejs",
|
|
12
12
|
dcvWeb: "dynamsoft-capture-vision-javascript",
|
|
13
|
+
mrzWeb: "mrz-scanner-javascript",
|
|
14
|
+
mdsWeb: "document-scanner-javascript",
|
|
13
15
|
dcvMobile: "dynamsoft-capture-vision-mobile",
|
|
14
16
|
dcvPython: "dynamsoft-capture-vision-python",
|
|
15
17
|
dcvDotnet: "dynamsoft-capture-vision-dotnet",
|
|
@@ -29,6 +31,8 @@ const DOC_DIRS = {
|
|
|
29
31
|
dbrMobile: "barcode-reader-docs-mobile",
|
|
30
32
|
dbrServer: "barcode-reader-docs-server",
|
|
31
33
|
dcvWeb: "capture-vision-docs-js",
|
|
34
|
+
mrzWeb: "mrz-scanner-docs-js",
|
|
35
|
+
mdsWeb: "mobile-document-scanner-docs-js",
|
|
32
36
|
dcvMobile: "capture-vision-docs-mobile",
|
|
33
37
|
dcvServer: "capture-vision-docs-server",
|
|
34
38
|
dcvCore: "capture-vision-docs",
|
|
@@ -57,6 +61,16 @@ const DOCS_CONFIG = {
|
|
|
57
61
|
excludeDirs: [".git", ".github", ".vscode", ".vs", "_data", "_includes", "_layouts", "assets"],
|
|
58
62
|
excludeFiles: ["README.md", "search.md", "error.md"]
|
|
59
63
|
},
|
|
64
|
+
mrzWeb: {
|
|
65
|
+
urlBase: "https://www.dynamsoft.com/mrz-scanner/docs/web/",
|
|
66
|
+
excludeDirs: [".git", ".github", ".vscode", ".vs", "_data", "_includes", "_layouts", "assets"],
|
|
67
|
+
excludeFiles: ["README.md", "search.md", "error.md"]
|
|
68
|
+
},
|
|
69
|
+
mdsWeb: {
|
|
70
|
+
urlBase: "https://www.dynamsoft.com/mobile-document-scanner/docs/web/",
|
|
71
|
+
excludeDirs: [".git", ".github", ".vscode", ".vs", "_data", "_includes", "_layouts", "assets"],
|
|
72
|
+
excludeFiles: ["README.md", "search.md", "error.md"]
|
|
73
|
+
},
|
|
60
74
|
dcvMobile: {
|
|
61
75
|
urlBase: "https://www.dynamsoft.com/capture-vision/docs/mobile/",
|
|
62
76
|
excludeDirs: [".git", ".github", ".vscode", ".vs", "_data", "_includes", "_layouts", "assets"],
|
|
@@ -29,6 +29,8 @@ const SAMPLE_ROOTS = {
|
|
|
29
29
|
dbrFlutter: join(samplesRoot, SAMPLE_DIRS.dbrFlutter),
|
|
30
30
|
dbrNodejs: join(samplesRoot, SAMPLE_DIRS.dbrNodejs),
|
|
31
31
|
dcvWeb: join(samplesRoot, SAMPLE_DIRS.dcvWeb),
|
|
32
|
+
mrzWeb: join(samplesRoot, SAMPLE_DIRS.mrzWeb),
|
|
33
|
+
mdsWeb: join(samplesRoot, SAMPLE_DIRS.mdsWeb),
|
|
32
34
|
dcvMobile: join(samplesRoot, SAMPLE_DIRS.dcvMobile),
|
|
33
35
|
dcvPython: join(samplesRoot, SAMPLE_DIRS.dcvPython),
|
|
34
36
|
dcvDotnet: join(samplesRoot, SAMPLE_DIRS.dcvDotnet),
|
|
@@ -48,6 +50,8 @@ const DOC_ROOTS = {
|
|
|
48
50
|
dbrMobile: join(docsRoot, DOC_DIRS.dbrMobile),
|
|
49
51
|
dbrServer: join(docsRoot, DOC_DIRS.dbrServer),
|
|
50
52
|
dcvWeb: join(docsRoot, DOC_DIRS.dcvWeb),
|
|
53
|
+
mrzWeb: join(docsRoot, DOC_DIRS.mrzWeb),
|
|
54
|
+
mdsWeb: join(docsRoot, DOC_DIRS.mdsWeb),
|
|
51
55
|
dcvMobile: join(docsRoot, DOC_DIRS.dcvMobile),
|
|
52
56
|
dcvServer: join(docsRoot, DOC_DIRS.dcvServer),
|
|
53
57
|
dcvCore: join(docsRoot, DOC_DIRS.dcvCore),
|