@the_library/standard-adapters 0.0.0-stage → 1.0.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 +191 -2
- package/dist/bbk/index.d.ts +9 -0
- package/dist/bbk/index.js +3 -0
- package/dist/bbk/index.js.map +1 -0
- package/dist/cc/index.d.ts +9 -0
- package/dist/cc/index.js +3 -0
- package/dist/cc/index.js.map +1 -0
- package/dist/chunk-3OK4JVCA.js +108 -0
- package/dist/chunk-3OK4JVCA.js.map +1 -0
- package/dist/chunk-AHIDYNLW.js +28 -0
- package/dist/chunk-AHIDYNLW.js.map +1 -0
- package/dist/chunk-C5WHAJXI.js +26 -0
- package/dist/chunk-C5WHAJXI.js.map +1 -0
- package/dist/chunk-D5QOJWWA.js +26 -0
- package/dist/chunk-D5QOJWWA.js.map +1 -0
- package/dist/chunk-DX6SH342.js +65 -0
- package/dist/chunk-DX6SH342.js.map +1 -0
- package/dist/chunk-GJJ6NIDQ.js +58 -0
- package/dist/chunk-GJJ6NIDQ.js.map +1 -0
- package/dist/chunk-IJYCM5NU.js +26 -0
- package/dist/chunk-IJYCM5NU.js.map +1 -0
- package/dist/chunk-INW2BUCX.js +26 -0
- package/dist/chunk-INW2BUCX.js.map +1 -0
- package/dist/chunk-KNGZ7NJF.js +82 -0
- package/dist/chunk-KNGZ7NJF.js.map +1 -0
- package/dist/chunk-KOHT5EA3.js +26 -0
- package/dist/chunk-KOHT5EA3.js.map +1 -0
- package/dist/chunk-VP4ER7MD.js +26 -0
- package/dist/chunk-VP4ER7MD.js.map +1 -0
- package/dist/clc/index.d.ts +9 -0
- package/dist/clc/index.js +3 -0
- package/dist/clc/index.js.map +1 -0
- package/dist/ddc/index.d.ts +9 -0
- package/dist/ddc/index.js +3 -0
- package/dist/ddc/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/isbn/index.d.ts +30 -0
- package/dist/isbn/index.js +3 -0
- package/dist/isbn/index.js.map +1 -0
- package/dist/isni/index.d.ts +18 -0
- package/dist/isni/index.js +3 -0
- package/dist/isni/index.js.map +1 -0
- package/dist/issn/index.d.ts +18 -0
- package/dist/issn/index.js +3 -0
- package/dist/issn/index.js.map +1 -0
- package/dist/lcc/index.d.ts +9 -0
- package/dist/lcc/index.js +3 -0
- package/dist/lcc/index.js.map +1 -0
- package/dist/orcid/index.d.ts +24 -0
- package/dist/orcid/index.js +3 -0
- package/dist/orcid/index.js.map +1 -0
- package/dist/tlc/index.d.ts +9 -0
- package/dist/tlc/index.js +3 -0
- package/dist/tlc/index.js.map +1 -0
- package/dist/udc/index.d.ts +9 -0
- package/dist/udc/index.js +3 -0
- package/dist/udc/index.js.map +1 -0
- package/package.json +76 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/clc/index.ts
|
|
2
|
+
var CLCAdapter = {
|
|
3
|
+
standardId: "clc",
|
|
4
|
+
uriScheme: "CLC",
|
|
5
|
+
normalize(value) {
|
|
6
|
+
return value.trim();
|
|
7
|
+
},
|
|
8
|
+
display(value) {
|
|
9
|
+
return CLCAdapter.normalize(value);
|
|
10
|
+
},
|
|
11
|
+
validate(value) {
|
|
12
|
+
if (!value) return { valid: false, error: "CLC notation is absent" };
|
|
13
|
+
const normalized = CLCAdapter.normalize(value);
|
|
14
|
+
if (!/^[A-Z0-9\.\-\+\=\s]+$/.test(normalized))
|
|
15
|
+
return { valid: false, error: `CLC notation does not match pattern: ${normalized}` };
|
|
16
|
+
return { valid: true };
|
|
17
|
+
},
|
|
18
|
+
toLinkedDataUri(value) {
|
|
19
|
+
return `https://clc.nlc.cn/${CLCAdapter.normalize(value)}`;
|
|
20
|
+
},
|
|
21
|
+
apis: {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { CLCAdapter };
|
|
25
|
+
//# sourceMappingURL=chunk-IJYCM5NU.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-IJYCM5NU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/clc/index.ts"],"names":[],"mappings":";AAqBO,IAAM,UAAA,GAAiD;AAAA,EAC5D,UAAA,EAAY,KAAA;AAAA,EACZ,SAAA,EAAY,KAAA;AAAA,EAEZ,UAAU,KAAA,EAAuB;AAC/B,IAAA,OAAO,MAAM,IAAA,EAAK;AAAA,EACpB,CAAA;AAAA,EAEA,QAAQ,KAAA,EAAuB;AAC7B,IAAA,OAAO,UAAA,CAAW,UAAU,KAAK,CAAA;AAAA,EACnC,CAAA;AAAA,EAEA,SAAS,KAAA,EAAoD;AAC3D,IAAA,IAAI,CAAC,KAAA,EAAO,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,OAAO,wBAAA,EAAyB;AACnE,IAAA,MAAM,UAAA,GAAa,UAAA,CAAW,SAAA,CAAU,KAAK,CAAA;AAC7C,IAAA,IAAI,CAAC,uBAAA,CAAwB,IAAA,CAAK,UAAU,CAAA;AAC1C,MAAA,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,CAAA,qCAAA,EAAwC,UAAU,CAAA,CAAA,EAAG;AACrF,IAAA,OAAO,EAAE,OAAO,IAAA,EAAK;AAAA,EACvB,CAAA;AAAA,EAEA,gBAAgB,KAAA,EAAuB;AACrC,IAAA,OAAO,CAAA,mBAAA,EAAsB,UAAA,CAAW,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,EAC1D,CAAA;AAAA,EAEA,MAAM;AACR","file":"chunk-IJYCM5NU.js","sourcesContent":["/*\n * Copyright (c) 2026 DataPond D-Library Pty Ltd. (\"The Sanctuary\")\n * Non-Profit Public Library — The World Library\n * \n * D-SAFE Certification issued by POND Enterprise.\n * Published under the D-Open Code Sovereign Licence v1.0 framework\n * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.\n * https://registry.world.bibliotech.com/licence\n * Source code donated to DataPond D-Library by it's author: data pond.\n * \n * Technical Guardian (\"The Shield\"): Pond Enterprise Pty Ltd. (ACN 694 747 987)\n * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.\n * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.\n */\nimport type { StandardAdapter, ValidationResult }\n from '@the_library/canonical-schemas/types/StandardAdapter';\n\ninterface CLCProps extends Record<string, string | null> { clcNotation: string | null; }\n\ntype CLCApis = Record<string, never>;\n\nexport const CLCAdapter: StandardAdapter<CLCProps, CLCApis> = {\n standardId: 'clc',\n uriScheme: 'CLC',\n\n normalize(value: string): string {\n return value.trim();\n },\n\n display(value: string): string {\n return CLCAdapter.normalize(value);\n },\n\n validate(value: string | null | undefined): ValidationResult {\n if (!value) return { valid: false, error: 'CLC notation is absent' };\n const normalized = CLCAdapter.normalize(value);\n if (!/^[A-Z0-9\\.\\-\\+\\=\\s]+$/.test(normalized))\n return { valid: false, error: `CLC notation does not match pattern: ${normalized}` };\n return { valid: true };\n },\n\n toLinkedDataUri(value: string): string {\n return `https://clc.nlc.cn/${CLCAdapter.normalize(value)}`;\n },\n\n apis: {},\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/bbk/index.ts
|
|
2
|
+
var BBKAdapter = {
|
|
3
|
+
standardId: "bbk",
|
|
4
|
+
uriScheme: "BBK",
|
|
5
|
+
normalize(value) {
|
|
6
|
+
return value.trim();
|
|
7
|
+
},
|
|
8
|
+
display(value) {
|
|
9
|
+
return BBKAdapter.normalize(value);
|
|
10
|
+
},
|
|
11
|
+
validate(value) {
|
|
12
|
+
if (!value) return { valid: false, error: "BBK notation is absent" };
|
|
13
|
+
const normalized = BBKAdapter.normalize(value);
|
|
14
|
+
if (!/^[0-9А-Яа-яA-Za-z\.\-\s]+$/.test(normalized))
|
|
15
|
+
return { valid: false, error: `BBK notation does not match pattern: ${normalized}` };
|
|
16
|
+
return { valid: true };
|
|
17
|
+
},
|
|
18
|
+
toLinkedDataUri(value) {
|
|
19
|
+
return `https://bbk.rsl.ru/external/${BBKAdapter.normalize(value)}`;
|
|
20
|
+
},
|
|
21
|
+
apis: {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { BBKAdapter };
|
|
25
|
+
//# sourceMappingURL=chunk-INW2BUCX.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-INW2BUCX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/bbk/index.ts"],"names":[],"mappings":";AAqBO,IAAM,UAAA,GAAiD;AAAA,EAC5D,UAAA,EAAY,KAAA;AAAA,EACZ,SAAA,EAAY,KAAA;AAAA,EAEZ,UAAU,KAAA,EAAuB;AAC/B,IAAA,OAAO,MAAM,IAAA,EAAK;AAAA,EACpB,CAAA;AAAA,EAEA,QAAQ,KAAA,EAAuB;AAC7B,IAAA,OAAO,UAAA,CAAW,UAAU,KAAK,CAAA;AAAA,EACnC,CAAA;AAAA,EAEA,SAAS,KAAA,EAAoD;AAC3D,IAAA,IAAI,CAAC,KAAA,EAAO,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,OAAO,wBAAA,EAAyB;AACnE,IAAA,MAAM,UAAA,GAAa,UAAA,CAAW,SAAA,CAAU,KAAK,CAAA;AAC7C,IAAA,IAAI,CAAC,4BAAA,CAA6B,IAAA,CAAK,UAAU,CAAA;AAC/C,MAAA,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,CAAA,qCAAA,EAAwC,UAAU,CAAA,CAAA,EAAG;AACrF,IAAA,OAAO,EAAE,OAAO,IAAA,EAAK;AAAA,EACvB,CAAA;AAAA,EAEA,gBAAgB,KAAA,EAAuB;AACrC,IAAA,OAAO,CAAA,4BAAA,EAA+B,UAAA,CAAW,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,EACnE,CAAA;AAAA,EAEA,MAAM;AACR","file":"chunk-INW2BUCX.js","sourcesContent":["/*\n * Copyright (c) 2026 DataPond D-Library Pty Ltd. (\"The Sanctuary\")\n * Non-Profit Public Library — The World Library\n * \n * D-SAFE Certification issued by POND Enterprise.\n * Published under the D-Open Code Sovereign Licence v1.0 framework\n * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.\n * https://registry.world.bibliotech.com/licence\n * Source code donated to DataPond D-Library by it's author: data pond.\n * \n * Technical Guardian (\"The Shield\"): Pond Enterprise Pty Ltd. (ACN 694 747 987)\n * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.\n * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.\n */\nimport type { StandardAdapter, ValidationResult }\n from '@the_library/canonical-schemas/types/StandardAdapter';\n\ninterface BBKProps extends Record<string, string | null> { bbkNotation: string | null; }\n\ntype BBKApis = Record<string, never>;\n\nexport const BBKAdapter: StandardAdapter<BBKProps, BBKApis> = {\n standardId: 'bbk',\n uriScheme: 'BBK',\n\n normalize(value: string): string {\n return value.trim();\n },\n\n display(value: string): string {\n return BBKAdapter.normalize(value);\n },\n\n validate(value: string | null | undefined): ValidationResult {\n if (!value) return { valid: false, error: 'BBK notation is absent' };\n const normalized = BBKAdapter.normalize(value);\n if (!/^[0-9А-Яа-яA-Za-z\\.\\-\\s]+$/.test(normalized))\n return { valid: false, error: `BBK notation does not match pattern: ${normalized}` };\n return { valid: true };\n },\n\n toLinkedDataUri(value: string): string {\n return `https://bbk.rsl.ru/external/${BBKAdapter.normalize(value)}`;\n },\n\n apis: {},\n};\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// src/orcid/index.ts
|
|
2
|
+
function validateORCIDMod11_2(compact) {
|
|
3
|
+
if (compact.length !== 16) return { valid: false, error: `Expected 16 chars, got ${compact.length}` };
|
|
4
|
+
let p = 0;
|
|
5
|
+
for (let i = 0; i < 15; i++) {
|
|
6
|
+
const d = parseInt(compact[i], 10);
|
|
7
|
+
if (isNaN(d)) return { valid: false, error: `Non-digit at position ${i}` };
|
|
8
|
+
p = (p + d) * 2 % 11;
|
|
9
|
+
}
|
|
10
|
+
const checkVal = (12 - p) % 11;
|
|
11
|
+
const checkChar = checkVal === 10 ? "X" : String(checkVal);
|
|
12
|
+
if (compact[15].toUpperCase() !== checkChar)
|
|
13
|
+
return { valid: false, error: `Check digit mismatch: expected ${checkChar}, got ${compact[15]}` };
|
|
14
|
+
return { valid: true };
|
|
15
|
+
}
|
|
16
|
+
var ORCID_API_BASE = "https://pub.orcid.org/v3.0";
|
|
17
|
+
var ORCID_HEADERS = { Accept: "application/vnd.orcid+json" };
|
|
18
|
+
var ORCIDAdapter = {
|
|
19
|
+
standardId: "orcid",
|
|
20
|
+
uriScheme: "ORCID",
|
|
21
|
+
normalize(value) {
|
|
22
|
+
const clean = value.replace(/\s/g, "");
|
|
23
|
+
if (clean.length === 16 && !clean.includes("-"))
|
|
24
|
+
return `${clean.slice(0, 4)}-${clean.slice(4, 8)}-${clean.slice(8, 12)}-${clean.slice(12)}`;
|
|
25
|
+
return clean;
|
|
26
|
+
},
|
|
27
|
+
display(value) {
|
|
28
|
+
return ORCIDAdapter.normalize(value);
|
|
29
|
+
},
|
|
30
|
+
validate(value) {
|
|
31
|
+
if (!value) return { valid: false, error: "ORCID iD is absent" };
|
|
32
|
+
const normalized = ORCIDAdapter.normalize(value);
|
|
33
|
+
if (!/^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$/.test(normalized))
|
|
34
|
+
return { valid: false, error: `ORCID iD does not match pattern: ${normalized}` };
|
|
35
|
+
return validateORCIDMod11_2(normalized.replace(/-/g, ""));
|
|
36
|
+
},
|
|
37
|
+
toLinkedDataUri(value) {
|
|
38
|
+
return `https://orcid.org/${ORCIDAdapter.normalize(value)}`;
|
|
39
|
+
},
|
|
40
|
+
apis: {
|
|
41
|
+
"orcid-lookup": {
|
|
42
|
+
apiId: "orcid-lookup",
|
|
43
|
+
name: "ORCID Public Record API",
|
|
44
|
+
async fetch({ orcidId }) {
|
|
45
|
+
if (!orcidId) return {};
|
|
46
|
+
const res = await fetch(`${ORCID_API_BASE}/${orcidId}/record`, { headers: ORCID_HEADERS });
|
|
47
|
+
if (!res.ok) return {};
|
|
48
|
+
const data = await res.json();
|
|
49
|
+
const person = data.person ?? {};
|
|
50
|
+
const name = person.name ?? {};
|
|
51
|
+
return {
|
|
52
|
+
orcidId,
|
|
53
|
+
givenNames: name["given-names"]?.value,
|
|
54
|
+
familyName: name["family-name"]?.value,
|
|
55
|
+
biography: person.biography?.content ?? void 0
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"orcid-public-api": {
|
|
60
|
+
apiId: "orcid-public-api",
|
|
61
|
+
name: "ORCID Public Search API",
|
|
62
|
+
async fetch({ orcidId }) {
|
|
63
|
+
if (!orcidId) return [];
|
|
64
|
+
const res = await fetch(
|
|
65
|
+
`${ORCID_API_BASE}/search?q=orcid:${orcidId}&rows=10`,
|
|
66
|
+
{ headers: ORCID_HEADERS }
|
|
67
|
+
);
|
|
68
|
+
if (!res.ok) return [];
|
|
69
|
+
const data = await res.json();
|
|
70
|
+
return (data.result ?? []).map((r) => {
|
|
71
|
+
const item = r;
|
|
72
|
+
const oid = item["orcid-identifier"]?.path;
|
|
73
|
+
return { orcidId: oid ?? "" };
|
|
74
|
+
}).filter((r) => r.orcidId);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { ORCIDAdapter };
|
|
81
|
+
//# sourceMappingURL=chunk-KNGZ7NJF.js.map
|
|
82
|
+
//# sourceMappingURL=chunk-KNGZ7NJF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/orcid/index.ts"],"names":[],"mappings":";AAyBA,SAAS,qBAAqB,OAAA,EAAmC;AAC/D,EAAA,IAAI,OAAA,CAAQ,MAAA,KAAW,EAAA,EAAI,OAAO,EAAE,KAAA,EAAO,KAAA,EA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CAAA,KAAe;AACnB,UAAA,MAAM,IAAA,GAAO,CAAA;AACb,UAAA,MAAM,GAAA,GAAQ,IAAA,CAAK,kBAAkB,CAAA,EAA2C,IAAA;AAChF,UAAA,OAAO,EAAE,OAAA,EAAS,GAAA,IAAO,EAAA,EAAG;AAAA,QAC9B,CAAC,CAAA,CACA,MAAA,CAAO,CAAA,CAAA,KAAK,EAAE,OAAO,CAAA;AAAA,MAC1B;AAAA;AACF;AAEJ","file":"chunk-KNGZ7NJF.js","sourcesContent":["/*\n * Copyright (c) 2026 DataPond D-Library Pty Ltd. (\"The Sanctuary\")\n * Non-Profit Public Library — The World Library\n * \n * D-SAFE Certification issued by POND Enterprise.\n * Published under the D-Open Code Sovereign Licence v1.0 framework\n * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.\n * https://registry.world.bibliotech.com/licence\n * Source code donated to DataPond D-Library by it's author: data pond.\n * \n * Technical Guardian (\"The Shield\"): Pond Enterprise Pty Ltd. (ACN 694 747 987)\n * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.\n * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.\n */\nimport type { StandardAdapter, StandardApiAdapter, ValidationResult }\n from '@the_library/canonical-schemas/types/StandardAdapter';\nimport type { OrcidPublicRecordResult, OrcidPublicSearchResult } from './types';\n\ninterface ORCIDProps extends Record<string, string | null> { orcidId: string | null; }\n\ntype ORCIDApis = {\n 'orcid-lookup': StandardApiAdapter<ORCIDProps, OrcidPublicRecordResult>;\n 'orcid-public-api': StandardApiAdapter<ORCIDProps, OrcidPublicSearchResult[]>;\n};\n\nfunction validateORCIDMod11_2(compact: string): ValidationResult {\n if (compact.length !== 16) return { valid: false, error: `Expected 16 chars, got ${compact.length}` };\n let p = 0;\n for (let i = 0; i < 15; i++) {\n const d = parseInt(compact[i], 10);\n if (isNaN(d)) return { valid: false, error: `Non-digit at position ${i}` };\n p = ((p + d) * 2) % 11;\n }\n const checkVal = (12 - p) % 11;\n const checkChar = checkVal === 10 ? 'X' : String(checkVal);\n if (compact[15].toUpperCase() !== checkChar)\n return { valid: false, error: `Check digit mismatch: expected ${checkChar}, got ${compact[15]}` };\n return { valid: true };\n}\n\nconst ORCID_API_BASE = 'https://pub.orcid.org/v3.0';\nconst ORCID_HEADERS = { Accept: 'application/vnd.orcid+json' };\n\nexport const ORCIDAdapter: StandardAdapter<ORCIDProps, ORCIDApis> = {\n standardId: 'orcid',\n uriScheme: 'ORCID',\n\n normalize(value: string): string {\n const clean = value.replace(/\\s/g, '');\n if (clean.length === 16 && !clean.includes('-'))\n return `${clean.slice(0, 4)}-${clean.slice(4, 8)}-${clean.slice(8, 12)}-${clean.slice(12)}`;\n return clean;\n },\n\n display(value: string): string {\n return ORCIDAdapter.normalize(value);\n },\n\n validate(value: string | null | undefined): ValidationResult {\n if (!value) return { valid: false, error: 'ORCID iD is absent' };\n const normalized = ORCIDAdapter.normalize(value);\n if (!/^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$/.test(normalized))\n return { valid: false, error: `ORCID iD does not match pattern: ${normalized}` };\n return validateORCIDMod11_2(normalized.replace(/-/g, ''));\n },\n\n toLinkedDataUri(value: string): string {\n return `https://orcid.org/${ORCIDAdapter.normalize(value)}`;\n },\n\n apis: {\n 'orcid-lookup': {\n apiId: 'orcid-lookup',\n name: 'ORCID Public Record API',\n async fetch({ orcidId }): Promise<OrcidPublicRecordResult> {\n if (!orcidId) return {};\n const res = await fetch(`${ORCID_API_BASE}/${orcidId}/record`, { headers: ORCID_HEADERS });\n if (!res.ok) return {};\n const data = await res.json() as Record<string, unknown>;\n const person = (data.person ?? {}) as Record<string, unknown>;\n const name = (person.name ?? {}) as Record<string, unknown>;\n return {\n orcidId,\n givenNames: (name['given-names'] as { value?: string } | undefined)?.value,\n familyName: (name['family-name'] as { value?: string } | undefined)?.value,\n biography: (person.biography as { content?: string } | undefined)?.content ?? undefined,\n };\n },\n },\n 'orcid-public-api': {\n apiId: 'orcid-public-api',\n name: 'ORCID Public Search API',\n async fetch({ orcidId }): Promise<OrcidPublicSearchResult[]> {\n if (!orcidId) return [];\n const res = await fetch(\n `${ORCID_API_BASE}/search?q=orcid:${orcidId}&rows=10`,\n { headers: ORCID_HEADERS }\n );\n if (!res.ok) return [];\n const data = await res.json() as { result?: unknown[] };\n return (data.result ?? [])\n .map((r: unknown) => {\n const item = r as Record<string, unknown>;\n const oid = (item['orcid-identifier'] as Record<string, unknown> | undefined)?.path as string;\n return { orcidId: oid ?? '' };\n })\n .filter(r => r.orcidId);\n },\n },\n },\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/cc/index.ts
|
|
2
|
+
var CCAdapter = {
|
|
3
|
+
standardId: "cc",
|
|
4
|
+
uriScheme: "CC",
|
|
5
|
+
normalize(value) {
|
|
6
|
+
return value.trim();
|
|
7
|
+
},
|
|
8
|
+
display(value) {
|
|
9
|
+
return CCAdapter.normalize(value);
|
|
10
|
+
},
|
|
11
|
+
validate(value) {
|
|
12
|
+
if (!value) return { valid: false, error: "CC notation is absent" };
|
|
13
|
+
const normalized = CCAdapter.normalize(value);
|
|
14
|
+
if (!/^[A-Za-z0-9\:\,\;\-\.\'\s]+$/.test(normalized))
|
|
15
|
+
return { valid: false, error: `CC notation does not match pattern: ${normalized}` };
|
|
16
|
+
return { valid: true };
|
|
17
|
+
},
|
|
18
|
+
toLinkedDataUri(value) {
|
|
19
|
+
return `https://isko.org/cc/${CCAdapter.normalize(value)}`;
|
|
20
|
+
},
|
|
21
|
+
apis: {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { CCAdapter };
|
|
25
|
+
//# sourceMappingURL=chunk-KOHT5EA3.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-KOHT5EA3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cc/index.ts"],"names":[],"mappings":";AAqBO,IAAM,SAAA,GAA8C;AAAA,EACzD,UAAA,EAAY,IAAA;AAAA,EACZ,SAAA,EAAY,IAAA;AAAA,EAEZ,UAAU,KAAA,EAAuB;AAC/B,IAAA,OAAO,MAAM,IAAA,EAAK;AAAA,EACpB,CAAA;AAAA,EAEA,QAAQ,KAAA,EAAuB;AAC7B,IAAA,OAAO,SAAA,CAAU,UAAU,KAAK,CAAA;AAAA,EAClC,CAAA;AAAA,EAEA,SAAS,KAAA,EAAoD;AAC3D,IAAA,IAAI,CAAC,KAAA,EAAO,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,OAAO,uBAAA,EAAwB;AAClE,IAAA,MAAM,UAAA,GAAa,SAAA,CAAU,SAAA,CAAU,KAAK,CAAA;AAC5C,IAAA,IAAI,CAAC,8BAAA,CAA+B,IAAA,CAAK,UAAU,CAAA;AACjD,MAAA,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,CAAA,oCAAA,EAAuC,UAAU,CAAA,CAAA,EAAG;AACpF,IAAA,OAAO,EAAE,OAAO,IAAA,EAAK;AAAA,EACvB,CAAA;AAAA,EAEA,gBAAgB,KAAA,EAAuB;AACrC,IAAA,OAAO,CAAA,oBAAA,EAAuB,SAAA,CAAU,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,EAC1D,CAAA;AAAA,EAEA,MAAM;AACR","file":"chunk-KOHT5EA3.js","sourcesContent":["/*\n * Copyright (c) 2026 DataPond D-Library Pty Ltd. (\"The Sanctuary\")\n * Non-Profit Public Library — The World Library\n * \n * D-SAFE Certification issued by POND Enterprise.\n * Published under the D-Open Code Sovereign Licence v1.0 framework\n * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.\n * https://registry.world.bibliotech.com/licence\n * Source code donated to DataPond D-Library by it's author: data pond.\n * \n * Technical Guardian (\"The Shield\"): Pond Enterprise Pty Ltd. (ACN 694 747 987)\n * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.\n * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.\n */\nimport type { StandardAdapter, ValidationResult }\n from '@the_library/canonical-schemas/types/StandardAdapter';\n\ninterface CCProps extends Record<string, string | null> { ccNotation: string | null; }\n\ntype CCApis = Record<string, never>;\n\nexport const CCAdapter: StandardAdapter<CCProps, CCApis> = {\n standardId: 'cc',\n uriScheme: 'CC',\n\n normalize(value: string): string {\n return value.trim();\n },\n\n display(value: string): string {\n return CCAdapter.normalize(value);\n },\n\n validate(value: string | null | undefined): ValidationResult {\n if (!value) return { valid: false, error: 'CC notation is absent' };\n const normalized = CCAdapter.normalize(value);\n if (!/^[A-Za-z0-9\\:\\,\\;\\-\\.\\'\\s]+$/.test(normalized))\n return { valid: false, error: `CC notation does not match pattern: ${normalized}` };\n return { valid: true };\n },\n\n toLinkedDataUri(value: string): string {\n return `https://isko.org/cc/${CCAdapter.normalize(value)}`;\n },\n\n apis: {},\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/lcc/index.ts
|
|
2
|
+
var LCCAdapter = {
|
|
3
|
+
standardId: "lcc",
|
|
4
|
+
uriScheme: "LCC",
|
|
5
|
+
normalize(value) {
|
|
6
|
+
return value.trim();
|
|
7
|
+
},
|
|
8
|
+
display(value) {
|
|
9
|
+
return LCCAdapter.normalize(value);
|
|
10
|
+
},
|
|
11
|
+
validate(value) {
|
|
12
|
+
if (!value) return { valid: false, error: "LCC notation is absent" };
|
|
13
|
+
const normalized = LCCAdapter.normalize(value);
|
|
14
|
+
if (!/^[A-Z0-9\.\s]+$/.test(normalized))
|
|
15
|
+
return { valid: false, error: `LCC notation does not match pattern: ${normalized}` };
|
|
16
|
+
return { valid: true };
|
|
17
|
+
},
|
|
18
|
+
toLinkedDataUri(value) {
|
|
19
|
+
return `https://id.loc.gov/authorities/classification/${LCCAdapter.normalize(value)}`;
|
|
20
|
+
},
|
|
21
|
+
apis: {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { LCCAdapter };
|
|
25
|
+
//# sourceMappingURL=chunk-VP4ER7MD.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-VP4ER7MD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lcc/index.ts"],"names":[],"mappings":";AAqBO,IAAM,UAAA,GAAiD;AAAA,EAC5D,UAAA,EAAY,KAAA;AAAA,EACZ,SAAA,EAAY,KAAA;AAAA,EAEZ,UAAU,KAAA,EAAuB;AAC/B,IAAA,OAAO,MAAM,IAAA,EAAK;AAAA,EACpB,CAAA;AAAA,EAEA,QAAQ,KAAA,EAAuB;AAC7B,IAAA,OAAO,UAAA,CAAW,UAAU,KAAK,CAAA;AAAA,EACnC,CAAA;AAAA,EAEA,SAAS,KAAA,EAAoD;AAC3D,IAAA,IAAI,CAAC,KAAA,EAAO,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,OAAO,wBAAA,EAAyB;AACnE,IAAA,MAAM,UAAA,GAAa,UAAA,CAAW,SAAA,CAAU,KAAK,CAAA;AAC7C,IAAA,IAAI,CAAC,iBAAA,CAAkB,IAAA,CAAK,UAAU,CAAA;AACpC,MAAA,OAAO,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,CAAA,qCAAA,EAAwC,UAAU,CAAA,CAAA,EAAG;AACrF,IAAA,OAAO,EAAE,OAAO,IAAA,EAAK;AAAA,EACvB,CAAA;AAAA,EAEA,gBAAgB,KAAA,EAAuB;AACrC,IAAA,OAAO,CAAA,8CAAA,EAAiD,UAAA,CAAW,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,EACrF,CAAA;AAAA,EAEA,MAAM;AACR","file":"chunk-VP4ER7MD.js","sourcesContent":["/*\n * Copyright (c) 2026 DataPond D-Library Pty Ltd. (\"The Sanctuary\")\n * Non-Profit Public Library — The World Library\n * \n * D-SAFE Certification issued by POND Enterprise.\n * Published under the D-Open Code Sovereign Licence v1.0 framework\n * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.\n * https://registry.world.bibliotech.com/licence\n * Source code donated to DataPond D-Library by it's author: data pond.\n * \n * Technical Guardian (\"The Shield\"): Pond Enterprise Pty Ltd. (ACN 694 747 987)\n * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.\n * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.\n */\nimport type { StandardAdapter, ValidationResult }\n from '@the_library/canonical-schemas/types/StandardAdapter';\n\ninterface LCCProps extends Record<string, string | null> { lccNotation: string | null; }\n\ntype LCCApis = Record<string, never>;\n\nexport const LCCAdapter: StandardAdapter<LCCProps, LCCApis> = {\n standardId: 'lcc',\n uriScheme: 'LCC',\n\n normalize(value: string): string {\n return value.trim();\n },\n\n display(value: string): string {\n return LCCAdapter.normalize(value);\n },\n\n validate(value: string | null | undefined): ValidationResult {\n if (!value) return { valid: false, error: 'LCC notation is absent' };\n const normalized = LCCAdapter.normalize(value);\n if (!/^[A-Z0-9\\.\\s]+$/.test(normalized))\n return { valid: false, error: `LCC notation does not match pattern: ${normalized}` };\n return { valid: true };\n },\n\n toLinkedDataUri(value: string): string {\n return `https://id.loc.gov/authorities/classification/${LCCAdapter.normalize(value)}`;\n },\n\n apis: {},\n};\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StandardAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface CLCProps extends Record<string, string | null> {
|
|
4
|
+
clcNotation: string | null;
|
|
5
|
+
}
|
|
6
|
+
type CLCApis = Record<string, never>;
|
|
7
|
+
declare const CLCAdapter: StandardAdapter<CLCProps, CLCApis>;
|
|
8
|
+
|
|
9
|
+
export { CLCAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StandardAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface DDCProps extends Record<string, string | null> {
|
|
4
|
+
ddcNotation: string | null;
|
|
5
|
+
}
|
|
6
|
+
type DDCApis = Record<string, never>;
|
|
7
|
+
declare const DDCAdapter: StandardAdapter<DDCProps, DDCApis>;
|
|
8
|
+
|
|
9
|
+
export { DDCAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { ISBNAdapter } from './isbn/index.js';
|
|
2
|
+
export { ISSNAdapter } from './issn/index.js';
|
|
3
|
+
export { ISNIAdapter } from './isni/index.js';
|
|
4
|
+
export { ORCIDAdapter } from './orcid/index.js';
|
|
5
|
+
export { DDCAdapter } from './ddc/index.js';
|
|
6
|
+
export { LCCAdapter } from './lcc/index.js';
|
|
7
|
+
export { UDCAdapter } from './udc/index.js';
|
|
8
|
+
export { CLCAdapter } from './clc/index.js';
|
|
9
|
+
export { BBKAdapter } from './bbk/index.js';
|
|
10
|
+
export { TLCAdapter } from './tlc/index.js';
|
|
11
|
+
export { CCAdapter } from './cc/index.js';
|
|
12
|
+
import '@the_library/canonical-schemas/types/StandardAdapter';
|
|
13
|
+
|
|
14
|
+
interface ApiKeyDictionary {
|
|
15
|
+
set(apiId: string, value: string): void;
|
|
16
|
+
get(apiId: string): string | undefined;
|
|
17
|
+
require(apiId: string): string;
|
|
18
|
+
}
|
|
19
|
+
declare const apiKeyDictionary: ApiKeyDictionary;
|
|
20
|
+
|
|
21
|
+
export { type ApiKeyDictionary, apiKeyDictionary };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { DDCAdapter } from './chunk-AHIDYNLW.js';
|
|
2
|
+
export { ORCIDAdapter } from './chunk-KNGZ7NJF.js';
|
|
3
|
+
export { TLCAdapter } from './chunk-D5QOJWWA.js';
|
|
4
|
+
export { UDCAdapter } from './chunk-C5WHAJXI.js';
|
|
5
|
+
export { BBKAdapter } from './chunk-INW2BUCX.js';
|
|
6
|
+
export { CCAdapter } from './chunk-KOHT5EA3.js';
|
|
7
|
+
export { CLCAdapter } from './chunk-IJYCM5NU.js';
|
|
8
|
+
export { ISBNAdapter, apiKeyDictionary } from './chunk-3OK4JVCA.js';
|
|
9
|
+
export { ISSNAdapter } from './chunk-GJJ6NIDQ.js';
|
|
10
|
+
export { ISNIAdapter } from './chunk-DX6SH342.js';
|
|
11
|
+
export { LCCAdapter } from './chunk-VP4ER7MD.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StandardAdapter, StandardApiAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface OpenLibraryBookResult {
|
|
4
|
+
title?: string;
|
|
5
|
+
authors?: string[];
|
|
6
|
+
publishDate?: string;
|
|
7
|
+
pageCount?: number;
|
|
8
|
+
coverUrl?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
interface GoogleBooksVolumeResult {
|
|
12
|
+
title?: string;
|
|
13
|
+
authors?: string[];
|
|
14
|
+
publishedDate?: string;
|
|
15
|
+
pageCount?: number;
|
|
16
|
+
language?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
thumbnail?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ISBNProps extends Record<string, string | null> {
|
|
22
|
+
isbn: string | null;
|
|
23
|
+
}
|
|
24
|
+
type ISBNApis = {
|
|
25
|
+
openlibrary: StandardApiAdapter<ISBNProps, OpenLibraryBookResult>;
|
|
26
|
+
googlebooks: StandardApiAdapter<ISBNProps, GoogleBooksVolumeResult>;
|
|
27
|
+
};
|
|
28
|
+
declare const ISBNAdapter: StandardAdapter<ISBNProps, ISBNApis>;
|
|
29
|
+
|
|
30
|
+
export { ISBNAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StandardAdapter, StandardApiAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface IsniSruResult {
|
|
4
|
+
isni: string;
|
|
5
|
+
forename?: string;
|
|
6
|
+
surname?: string;
|
|
7
|
+
deceased?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ISNIProps extends Record<string, string | null> {
|
|
11
|
+
isniId: string | null;
|
|
12
|
+
}
|
|
13
|
+
type ISNIApis = {
|
|
14
|
+
'isni-sru': StandardApiAdapter<ISNIProps, IsniSruResult[]>;
|
|
15
|
+
};
|
|
16
|
+
declare const ISNIAdapter: StandardAdapter<ISNIProps, ISNIApis>;
|
|
17
|
+
|
|
18
|
+
export { ISNIAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StandardAdapter, StandardApiAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface IssnPortalResult {
|
|
4
|
+
title?: string;
|
|
5
|
+
medium?: string;
|
|
6
|
+
country?: string;
|
|
7
|
+
issn?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ISSNProps extends Record<string, string | null> {
|
|
11
|
+
issn: string | null;
|
|
12
|
+
}
|
|
13
|
+
type ISSNApis = {
|
|
14
|
+
'issn-portal': StandardApiAdapter<ISSNProps, IssnPortalResult>;
|
|
15
|
+
};
|
|
16
|
+
declare const ISSNAdapter: StandardAdapter<ISSNProps, ISSNApis>;
|
|
17
|
+
|
|
18
|
+
export { ISSNAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StandardAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface LCCProps extends Record<string, string | null> {
|
|
4
|
+
lccNotation: string | null;
|
|
5
|
+
}
|
|
6
|
+
type LCCApis = Record<string, never>;
|
|
7
|
+
declare const LCCAdapter: StandardAdapter<LCCProps, LCCApis>;
|
|
8
|
+
|
|
9
|
+
export { LCCAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StandardAdapter, StandardApiAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface OrcidPublicRecordResult {
|
|
4
|
+
orcidId?: string;
|
|
5
|
+
givenNames?: string;
|
|
6
|
+
familyName?: string;
|
|
7
|
+
biography?: string;
|
|
8
|
+
}
|
|
9
|
+
interface OrcidPublicSearchResult {
|
|
10
|
+
orcidId: string;
|
|
11
|
+
givenNames?: string;
|
|
12
|
+
familyName?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface ORCIDProps extends Record<string, string | null> {
|
|
16
|
+
orcidId: string | null;
|
|
17
|
+
}
|
|
18
|
+
type ORCIDApis = {
|
|
19
|
+
'orcid-lookup': StandardApiAdapter<ORCIDProps, OrcidPublicRecordResult>;
|
|
20
|
+
'orcid-public-api': StandardApiAdapter<ORCIDProps, OrcidPublicSearchResult[]>;
|
|
21
|
+
};
|
|
22
|
+
declare const ORCIDAdapter: StandardAdapter<ORCIDProps, ORCIDApis>;
|
|
23
|
+
|
|
24
|
+
export { ORCIDAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StandardAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface TLCProps extends Record<string, string | null> {
|
|
4
|
+
tlcNotation: string | null;
|
|
5
|
+
}
|
|
6
|
+
type TLCApis = Record<string, never>;
|
|
7
|
+
declare const TLCAdapter: StandardAdapter<TLCProps, TLCApis>;
|
|
8
|
+
|
|
9
|
+
export { TLCAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StandardAdapter } from '@the_library/canonical-schemas/types/StandardAdapter';
|
|
2
|
+
|
|
3
|
+
interface UDCProps extends Record<string, string | null> {
|
|
4
|
+
udcNotation: string | null;
|
|
5
|
+
}
|
|
6
|
+
type UDCApis = Record<string, never>;
|
|
7
|
+
declare const UDCAdapter: StandardAdapter<UDCProps, UDCApis>;
|
|
8
|
+
|
|
9
|
+
export { UDCAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the_library/standard-adapters",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Runtime StandardAdapter implementations for all canonical standards.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./isbn": {
|
|
14
|
+
"types": "./dist/isbn/index.d.ts",
|
|
15
|
+
"import": "./dist/isbn/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./issn": {
|
|
18
|
+
"types": "./dist/issn/index.d.ts",
|
|
19
|
+
"import": "./dist/issn/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./isni": {
|
|
22
|
+
"types": "./dist/isni/index.d.ts",
|
|
23
|
+
"import": "./dist/isni/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./orcid": {
|
|
26
|
+
"types": "./dist/orcid/index.d.ts",
|
|
27
|
+
"import": "./dist/orcid/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./ddc": {
|
|
30
|
+
"types": "./dist/ddc/index.d.ts",
|
|
31
|
+
"import": "./dist/ddc/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./lcc": {
|
|
34
|
+
"types": "./dist/lcc/index.d.ts",
|
|
35
|
+
"import": "./dist/lcc/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./udc": {
|
|
38
|
+
"types": "./dist/udc/index.d.ts",
|
|
39
|
+
"import": "./dist/udc/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./clc": {
|
|
42
|
+
"types": "./dist/clc/index.d.ts",
|
|
43
|
+
"import": "./dist/clc/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./bbk": {
|
|
46
|
+
"types": "./dist/bbk/index.d.ts",
|
|
47
|
+
"import": "./dist/bbk/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./tlc": {
|
|
50
|
+
"types": "./dist/tlc/index.d.ts",
|
|
51
|
+
"import": "./dist/tlc/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./cc": {
|
|
54
|
+
"types": "./dist/cc/index.d.ts",
|
|
55
|
+
"import": "./dist/cc/index.js"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"files": ["dist"],
|
|
59
|
+
"sideEffects": false,
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsup",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"test:coverage": "vitest run --coverage",
|
|
64
|
+
"test:integration": "INTEGRATION=true vitest run",
|
|
65
|
+
"typecheck": "tsc --noEmit"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"@the_library/canonical-schemas": "workspace:*"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@the_library/canonical-schemas": "workspace:*",
|
|
72
|
+
"@vitest/coverage-v8": "^1.6.1",
|
|
73
|
+
"tsup": "^8.0.1",
|
|
74
|
+
"tsx": "^4.19.3",
|
|
75
|
+
"typescript": "^6.0.3",
|
|
76
|
+
"vitest": "^1.6.1"
|
|
77
|
+
}
|
|
78
|
+
}
|