@wemush/wols 0.1.0 → 1.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/CHANGELOG.md +170 -0
- package/README.md +204 -31
- package/dist/cjs/compact-url.d.ts +150 -0
- package/dist/cjs/compact-url.d.ts.map +1 -0
- package/dist/cjs/compact-url.js +64 -0
- package/dist/cjs/compact-url.js.map +1 -1
- package/dist/cjs/crypto/decrypt.d.ts +110 -0
- package/dist/cjs/crypto/decrypt.d.ts.map +1 -0
- package/dist/cjs/crypto/decrypt.js +521 -90
- package/dist/cjs/crypto/decrypt.js.map +1 -1
- package/dist/cjs/crypto/encrypt.d.ts +132 -0
- package/dist/cjs/crypto/encrypt.d.ts.map +1 -0
- package/dist/cjs/crypto/encrypt.js +288 -105
- package/dist/cjs/crypto/encrypt.js.map +1 -1
- package/dist/cjs/crypto/index.d.ts +12 -0
- package/dist/cjs/crypto/index.d.ts.map +1 -0
- package/dist/cjs/crypto/index.js +15 -2
- package/dist/cjs/crypto/index.js.map +1 -1
- package/dist/cjs/crypto/shared.d.ts +116 -0
- package/dist/cjs/crypto/shared.d.ts.map +1 -0
- package/dist/cjs/crypto/shared.js +238 -0
- package/dist/cjs/crypto/shared.js.map +1 -0
- package/dist/cjs/errors.d.ts +133 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +39 -1
- package/dist/cjs/errors.js.map +1 -1
- package/dist/cjs/index.d.ts +29 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +70 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/parser.d.ts +30 -0
- package/dist/cjs/parser.d.ts.map +1 -0
- package/dist/cjs/parser.js +3 -0
- package/dist/cjs/parser.js.map +1 -1
- package/dist/cjs/qr/generate.d.ts +62 -0
- package/dist/cjs/qr/generate.d.ts.map +1 -0
- package/dist/cjs/qr/index.d.ts +10 -0
- package/dist/cjs/qr/index.d.ts.map +1 -0
- package/dist/cjs/specimen.d.ts +96 -0
- package/dist/cjs/specimen.d.ts.map +1 -0
- package/dist/cjs/specimen.js +95 -9
- package/dist/cjs/specimen.js.map +1 -1
- package/dist/cjs/types.d.ts +735 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +327 -3
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/cuid.d.ts +46 -0
- package/dist/cjs/utils/cuid.d.ts.map +1 -0
- package/dist/cjs/utils/cuid.js +6 -4
- package/dist/cjs/utils/cuid.js.map +1 -1
- package/dist/cjs/utils/environment.d.ts +137 -0
- package/dist/cjs/utils/environment.d.ts.map +1 -0
- package/dist/cjs/utils/environment.js +206 -0
- package/dist/cjs/utils/environment.js.map +1 -0
- package/dist/cjs/utils/iso8601.d.ts +79 -0
- package/dist/cjs/utils/iso8601.d.ts.map +1 -0
- package/dist/cjs/utils/migration.d.ts +162 -0
- package/dist/cjs/utils/migration.d.ts.map +1 -0
- package/dist/cjs/utils/migration.js +248 -0
- package/dist/cjs/utils/migration.js.map +1 -0
- package/dist/cjs/validator.d.ts +25 -0
- package/dist/cjs/validator.d.ts.map +1 -0
- package/dist/cjs/validator.js +85 -21
- package/dist/cjs/validator.js.map +1 -1
- package/dist/esm/compact-url.js +62 -0
- package/dist/esm/compact-url.js.map +1 -1
- package/dist/esm/crypto/decrypt.js +517 -90
- package/dist/esm/crypto/decrypt.js.map +1 -1
- package/dist/esm/crypto/encrypt.js +284 -105
- package/dist/esm/crypto/encrypt.js.map +1 -1
- package/dist/esm/crypto/index.js +5 -3
- package/dist/esm/crypto/index.js.map +1 -1
- package/dist/esm/crypto/shared.js +222 -0
- package/dist/esm/crypto/shared.js.map +1 -0
- package/dist/esm/errors.js +37 -0
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/index.js +26 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/parser.js +3 -0
- package/dist/esm/parser.js.map +1 -1
- package/dist/esm/specimen.js +95 -10
- package/dist/esm/specimen.js.map +1 -1
- package/dist/esm/types.js +317 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/cuid.js +6 -4
- package/dist/esm/utils/cuid.js.map +1 -1
- package/dist/esm/utils/environment.js +193 -0
- package/dist/esm/utils/environment.js.map +1 -0
- package/dist/esm/utils/migration.js +237 -0
- package/dist/esm/utils/migration.js.map +1 -0
- package/dist/esm/validator.js +86 -22
- package/dist/esm/validator.js.map +1 -1
- package/dist/types/compact-url.d.ts +46 -0
- package/dist/types/compact-url.d.ts.map +1 -1
- package/dist/types/crypto/decrypt.d.ts +95 -18
- package/dist/types/crypto/decrypt.d.ts.map +1 -1
- package/dist/types/crypto/encrypt.d.ts +114 -14
- package/dist/types/crypto/encrypt.d.ts.map +1 -1
- package/dist/types/crypto/index.d.ts +5 -3
- package/dist/types/crypto/index.d.ts.map +1 -1
- package/dist/types/crypto/shared.d.ts +116 -0
- package/dist/types/crypto/shared.d.ts.map +1 -0
- package/dist/types/errors.d.ts +31 -1
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/parser.d.ts.map +1 -1
- package/dist/types/specimen.d.ts +29 -4
- package/dist/types/specimen.d.ts.map +1 -1
- package/dist/types/types.d.ts +483 -17
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/cuid.d.ts +5 -3
- package/dist/types/utils/cuid.d.ts.map +1 -1
- package/dist/types/utils/environment.d.ts +137 -0
- package/dist/types/utils/environment.d.ts.map +1 -0
- package/dist/types/utils/migration.d.ts +162 -0
- package/dist/types/utils/migration.d.ts.map +1 -0
- package/dist/types/validator.d.ts +1 -1
- package/dist/types/validator.d.ts.map +1 -1
- package/package.json +32 -14
package/dist/cjs/errors.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module errors
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.WolsEncryptionError = exports.WolsValidationError = exports.WolsParseError = exports.WolsError = exports.WolsErrorCode = void 0;
|
|
11
|
+
exports.WolsDecryptionError = exports.WolsEncryptionError = exports.WolsValidationError = exports.WolsParseError = exports.WolsError = exports.WolsErrorCode = void 0;
|
|
12
12
|
exports.requiredFieldError = requiredFieldError;
|
|
13
13
|
exports.invalidFormatError = invalidFormatError;
|
|
14
14
|
exports.parseErrorFromException = parseErrorFromException;
|
|
@@ -138,6 +138,44 @@ class WolsEncryptionError extends WolsError {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
exports.WolsEncryptionError = WolsEncryptionError;
|
|
141
|
+
/**
|
|
142
|
+
* Decryption failure with a stable, typed {@link DecryptionFailureReason}.
|
|
143
|
+
*
|
|
144
|
+
* It extends `WolsEncryptionError` on purpose: 1.2.x returned a
|
|
145
|
+
* `WolsEncryptionError` for decryption failures, so existing
|
|
146
|
+
* `instanceof WolsEncryptionError` checks keep matching. Encryption misuse is
|
|
147
|
+
* thrown as a plain `WolsEncryptionError`; decryption failures are returned as
|
|
148
|
+
* this subclass, so check `instanceof WolsDecryptionError` to tell them apart.
|
|
149
|
+
* Malformed encrypted URLs are reported here too (`invalid-url`), not as
|
|
150
|
+
* `WolsParseError`, so every decryption input problem has one error type.
|
|
151
|
+
*
|
|
152
|
+
* Returned (never thrown) by `decryptSpecimen`, `decryptPlaintext`,
|
|
153
|
+
* `decryptField` and `decryptFields`. `reason` is also copied into
|
|
154
|
+
* `details.reason` for code that reads the generic error shape.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```typescript
|
|
158
|
+
* const r = await decryptSpecimen(url, { key });
|
|
159
|
+
* if (!r.success && r.error.reason === 'legacy-format') {
|
|
160
|
+
* // a pre-1.3.0 label: retry with { allowLegacy: true } during migration
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* @since 1.3.0
|
|
165
|
+
*/
|
|
166
|
+
class WolsDecryptionError extends WolsEncryptionError {
|
|
167
|
+
/** Stable failure category */
|
|
168
|
+
reason;
|
|
169
|
+
constructor(reason, message, details) {
|
|
170
|
+
super(reason === 'invalid-key' ? WolsErrorCode.INVALID_KEY : WolsErrorCode.DECRYPTION_ERROR, message, { ...details, reason });
|
|
171
|
+
this.name = 'WolsDecryptionError';
|
|
172
|
+
this.reason = reason;
|
|
173
|
+
if (Error.captureStackTrace) {
|
|
174
|
+
Error.captureStackTrace(this, WolsDecryptionError);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.WolsDecryptionError = WolsDecryptionError;
|
|
141
179
|
// =============================================================================
|
|
142
180
|
// ERROR FACTORY FUNCTIONS
|
|
143
181
|
// =============================================================================
|
package/dist/cjs/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAmMH,gDAQC;AAKD,gDAYC;AAKD,0DAoBC;AAjPD,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;GAEG;AACH,IAAY,aAmCX;AAnCD,WAAY,aAAa;IACvB,0BAA0B;IAC1B,iDAAgC,CAAA;IAChC,0BAA0B;IAC1B,mDAAkC,CAAA;IAClC,8BAA8B;IAC9B,uDAAsC,CAAA;IACtC,wCAAwC;IACxC,yDAAwC,CAAA;IACxC,qCAAqC;IACrC,mDAAkC,CAAA;IAClC,gDAAgD;IAChD,6DAA4C,CAAA;IAC5C,+BAA+B;IAC/B,yDAAwC,CAAA;IACxC,oCAAoC;IACpC,qEAAoD,CAAA;IACpD,gCAAgC;IAChC,uDAAsC,CAAA;IACtC,kCAAkC;IAClC,iEAAgD,CAAA;IAChD,0CAA0C;IAC1C,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AE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEjE,MAAM,OAAO,GAA4B,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC1E,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;QACjC,CAAC;QAED,OAAO,IAAI,cAAc,CAAC,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,IAAI,cAAc,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @wemush/wols - Official WOLS TypeScript Library
|
|
3
|
+
*
|
|
4
|
+
* WeMush Open Labeling Standard (WOLS) v1.3.0 implementation
|
|
5
|
+
* for biological specimen labeling and traceability.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
* @module @wemush/wols
|
|
9
|
+
* @version 1.3.0
|
|
10
|
+
*/
|
|
11
|
+
export { WOLS_VERSION, WOLS_CONTEXT } from './types.js';
|
|
12
|
+
export type { Brand, SpecimenId, SpecimenType, GrowthStage, Strain, Specimen, SpecimenInput, SpecimenMeta, CreateSpecimenOptions, ParseResult, ValidationResult, ValidationError, ValidationWarning, ValidationOptions, IdValidationMode, IdValidator, SpecimenRef, QRCodeOptions, EncryptionOptions, DecryptionOptions, EncryptedSpecimen, EncryptedField, EncryptionKdf, RawEncryptionKey, DecryptionFailureReason, DecryptResult, FieldEncryptedSpecimen, FieldEncryptionOptions, } from './types.js';
|
|
13
|
+
export { asSpecimenId, isSpecimenType, isGrowthStage, isStrain, SPECIMEN_TYPES, GROWTH_STAGES, } from './types.js';
|
|
14
|
+
export { registerTypeAlias, resolveTypeAlias, getTypeAliases, resolveTypeAndStage, PRIMORDIA_TYPE_ALIAS, } from './types.js';
|
|
15
|
+
export { WOLS_TO_PLATFORM_MAP, mapToWolsType, mapFromWolsType, registerPlatformType, } from './types.js';
|
|
16
|
+
export { normalizeGeneration, isValidGeneration } from './types.js';
|
|
17
|
+
export type { GenerationFormat } from './types.js';
|
|
18
|
+
export { WolsErrorCode, WolsError, WolsParseError, WolsValidationError, WolsEncryptionError, WolsDecryptionError, } from './errors.js';
|
|
19
|
+
export { createSpecimen, serializeSpecimen, PRIMORDIA_AS_TYPE_WARNING } from './specimen.js';
|
|
20
|
+
export { validateSpecimen } from './validator.js';
|
|
21
|
+
export { parseSpecimen } from './parser.js';
|
|
22
|
+
export { toCompactUrl, parseCompactUrl, parseCompactUrlOrThrow, parseCompactUrlOrNull, SPECIES_CODES, getSpeciesFromCode, getCodeFromSpecies, registerSpeciesCode, } from './compact-url.js';
|
|
23
|
+
export { encryptSpecimen, encryptFields, isEncrypted, isEncryptedSpecimen, isEncryptedField, toEncryptedUrl, decryptSpecimen, decryptPlaintext, decryptField, decryptFields, parseEncryptedUrl, type FieldBinding, base64UrlEncode, base64UrlDecode, derivePassphraseKey, } from './crypto/index.js';
|
|
24
|
+
export { toQRCode, toQRCodeDataURL, toQRCodeSVG, isQRAvailable, isQRAvailableSync, } from './qr/index.js';
|
|
25
|
+
export { isServer, isBrowser, isWebWorker, isDeno, isBun, getRuntimeEnvironment, supportsWebCrypto, supportsNodeCrypto, isCryptoSupported, supportsTextEncoding, supportsURLAPIs, } from './utils/environment.js';
|
|
26
|
+
export type { RuntimeEnvironment } from './utils/environment.js';
|
|
27
|
+
export { compareVersions, isOutdated, isNewer, getCurrentVersion, registerMigration, canMigrate, migrate, getMigrations, clearMigrations, } from './utils/migration.js';
|
|
28
|
+
export type { VersionComparison, MigrationHandler } from './utils/migration.js';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAKxD,YAAY,EAEV,KAAK,EACL,UAAU,EAGV,YAAY,EACZ,WAAW,EACX,MAAM,EACN,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,qBAAqB,EAGrB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EAGjB,gBAAgB,EAChB,WAAW,EAGX,WAAW,EAGX,aAAa,EAGb,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,QAAQ,EACR,cAAc,EACd,aAAa,GACd,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKnD,OAAO,EACL,aAAa,EACb,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAK7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKlD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAK5C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,eAAe,EACf,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,KAAK,YAAY,EACjB,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,QAAQ,EACR,eAAe,EACf,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,QAAQ,EACR,SAAS,EACT,WAAW,EACX,MAAM,EACN,KAAK,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAKjE,OAAO,EACL,eAAe,EACf,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,aAAa,EACb,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @wemush/wols - Official WOLS TypeScript Library
|
|
4
4
|
*
|
|
5
|
-
* WeMush Open Labeling Standard (WOLS) v1.
|
|
5
|
+
* WeMush Open Labeling Standard (WOLS) v1.3.0 implementation
|
|
6
6
|
* for biological specimen labeling and traceability.
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module @wemush/wols
|
|
10
|
-
* @version 1.
|
|
10
|
+
* @version 1.3.0
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.base64UrlEncode = exports.parseEncryptedUrl = exports.decryptFields = exports.decryptField = exports.decryptPlaintext = exports.decryptSpecimen = exports.toEncryptedUrl = exports.isEncryptedField = exports.isEncryptedSpecimen = exports.isEncrypted = exports.encryptFields = exports.encryptSpecimen = exports.registerSpeciesCode = exports.getCodeFromSpecies = exports.getSpeciesFromCode = exports.SPECIES_CODES = exports.parseCompactUrlOrNull = exports.parseCompactUrlOrThrow = exports.parseCompactUrl = exports.toCompactUrl = exports.parseSpecimen = exports.validateSpecimen = exports.PRIMORDIA_AS_TYPE_WARNING = exports.serializeSpecimen = exports.createSpecimen = exports.WolsDecryptionError = exports.WolsEncryptionError = exports.WolsValidationError = exports.WolsParseError = exports.WolsError = exports.WolsErrorCode = exports.isValidGeneration = exports.normalizeGeneration = exports.registerPlatformType = exports.mapFromWolsType = exports.mapToWolsType = exports.WOLS_TO_PLATFORM_MAP = exports.PRIMORDIA_TYPE_ALIAS = exports.resolveTypeAndStage = exports.getTypeAliases = exports.resolveTypeAlias = exports.registerTypeAlias = exports.GROWTH_STAGES = exports.SPECIMEN_TYPES = exports.isStrain = exports.isGrowthStage = exports.isSpecimenType = exports.asSpecimenId = exports.WOLS_CONTEXT = exports.WOLS_VERSION = void 0;
|
|
14
|
+
exports.clearMigrations = exports.getMigrations = exports.migrate = exports.canMigrate = exports.registerMigration = exports.getCurrentVersion = exports.isNewer = exports.isOutdated = exports.compareVersions = exports.supportsURLAPIs = exports.supportsTextEncoding = exports.isCryptoSupported = exports.supportsNodeCrypto = exports.supportsWebCrypto = exports.getRuntimeEnvironment = exports.isBun = exports.isDeno = exports.isWebWorker = exports.isBrowser = exports.isServer = exports.isQRAvailableSync = exports.isQRAvailable = exports.toQRCodeSVG = exports.toQRCodeDataURL = exports.toQRCode = exports.derivePassphraseKey = exports.base64UrlDecode = void 0;
|
|
14
15
|
// =============================================================================
|
|
15
16
|
// Constants
|
|
16
17
|
// =============================================================================
|
|
@@ -28,6 +29,29 @@ Object.defineProperty(exports, "isStrain", { enumerable: true, get: function ()
|
|
|
28
29
|
Object.defineProperty(exports, "SPECIMEN_TYPES", { enumerable: true, get: function () { return types_js_2.SPECIMEN_TYPES; } });
|
|
29
30
|
Object.defineProperty(exports, "GROWTH_STAGES", { enumerable: true, get: function () { return types_js_2.GROWTH_STAGES; } });
|
|
30
31
|
// =============================================================================
|
|
32
|
+
// Type Alias System (v1.2.0)
|
|
33
|
+
// =============================================================================
|
|
34
|
+
var types_js_3 = require("./types.js");
|
|
35
|
+
Object.defineProperty(exports, "registerTypeAlias", { enumerable: true, get: function () { return types_js_3.registerTypeAlias; } });
|
|
36
|
+
Object.defineProperty(exports, "resolveTypeAlias", { enumerable: true, get: function () { return types_js_3.resolveTypeAlias; } });
|
|
37
|
+
Object.defineProperty(exports, "getTypeAliases", { enumerable: true, get: function () { return types_js_3.getTypeAliases; } });
|
|
38
|
+
Object.defineProperty(exports, "resolveTypeAndStage", { enumerable: true, get: function () { return types_js_3.resolveTypeAndStage; } });
|
|
39
|
+
Object.defineProperty(exports, "PRIMORDIA_TYPE_ALIAS", { enumerable: true, get: function () { return types_js_3.PRIMORDIA_TYPE_ALIAS; } });
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// Type Mapping System (v1.2.0)
|
|
42
|
+
// =============================================================================
|
|
43
|
+
var types_js_4 = require("./types.js");
|
|
44
|
+
Object.defineProperty(exports, "WOLS_TO_PLATFORM_MAP", { enumerable: true, get: function () { return types_js_4.WOLS_TO_PLATFORM_MAP; } });
|
|
45
|
+
Object.defineProperty(exports, "mapToWolsType", { enumerable: true, get: function () { return types_js_4.mapToWolsType; } });
|
|
46
|
+
Object.defineProperty(exports, "mapFromWolsType", { enumerable: true, get: function () { return types_js_4.mapFromWolsType; } });
|
|
47
|
+
Object.defineProperty(exports, "registerPlatformType", { enumerable: true, get: function () { return types_js_4.registerPlatformType; } });
|
|
48
|
+
// =============================================================================
|
|
49
|
+
// Generation Format System (v1.2.0)
|
|
50
|
+
// =============================================================================
|
|
51
|
+
var types_js_5 = require("./types.js");
|
|
52
|
+
Object.defineProperty(exports, "normalizeGeneration", { enumerable: true, get: function () { return types_js_5.normalizeGeneration; } });
|
|
53
|
+
Object.defineProperty(exports, "isValidGeneration", { enumerable: true, get: function () { return types_js_5.isValidGeneration; } });
|
|
54
|
+
// =============================================================================
|
|
31
55
|
// Errors
|
|
32
56
|
// =============================================================================
|
|
33
57
|
var errors_js_1 = require("./errors.js");
|
|
@@ -36,12 +60,14 @@ Object.defineProperty(exports, "WolsError", { enumerable: true, get: function ()
|
|
|
36
60
|
Object.defineProperty(exports, "WolsParseError", { enumerable: true, get: function () { return errors_js_1.WolsParseError; } });
|
|
37
61
|
Object.defineProperty(exports, "WolsValidationError", { enumerable: true, get: function () { return errors_js_1.WolsValidationError; } });
|
|
38
62
|
Object.defineProperty(exports, "WolsEncryptionError", { enumerable: true, get: function () { return errors_js_1.WolsEncryptionError; } });
|
|
63
|
+
Object.defineProperty(exports, "WolsDecryptionError", { enumerable: true, get: function () { return errors_js_1.WolsDecryptionError; } });
|
|
39
64
|
// =============================================================================
|
|
40
65
|
// Core Functions - Specimen
|
|
41
66
|
// =============================================================================
|
|
42
67
|
var specimen_js_1 = require("./specimen.js");
|
|
43
68
|
Object.defineProperty(exports, "createSpecimen", { enumerable: true, get: function () { return specimen_js_1.createSpecimen; } });
|
|
44
69
|
Object.defineProperty(exports, "serializeSpecimen", { enumerable: true, get: function () { return specimen_js_1.serializeSpecimen; } });
|
|
70
|
+
Object.defineProperty(exports, "PRIMORDIA_AS_TYPE_WARNING", { enumerable: true, get: function () { return specimen_js_1.PRIMORDIA_AS_TYPE_WARNING; } });
|
|
45
71
|
// =============================================================================
|
|
46
72
|
// Core Functions - Validation
|
|
47
73
|
// =============================================================================
|
|
@@ -58,6 +84,8 @@ Object.defineProperty(exports, "parseSpecimen", { enumerable: true, get: functio
|
|
|
58
84
|
var compact_url_js_1 = require("./compact-url.js");
|
|
59
85
|
Object.defineProperty(exports, "toCompactUrl", { enumerable: true, get: function () { return compact_url_js_1.toCompactUrl; } });
|
|
60
86
|
Object.defineProperty(exports, "parseCompactUrl", { enumerable: true, get: function () { return compact_url_js_1.parseCompactUrl; } });
|
|
87
|
+
Object.defineProperty(exports, "parseCompactUrlOrThrow", { enumerable: true, get: function () { return compact_url_js_1.parseCompactUrlOrThrow; } });
|
|
88
|
+
Object.defineProperty(exports, "parseCompactUrlOrNull", { enumerable: true, get: function () { return compact_url_js_1.parseCompactUrlOrNull; } });
|
|
61
89
|
Object.defineProperty(exports, "SPECIES_CODES", { enumerable: true, get: function () { return compact_url_js_1.SPECIES_CODES; } });
|
|
62
90
|
Object.defineProperty(exports, "getSpeciesFromCode", { enumerable: true, get: function () { return compact_url_js_1.getSpeciesFromCode; } });
|
|
63
91
|
Object.defineProperty(exports, "getCodeFromSpecies", { enumerable: true, get: function () { return compact_url_js_1.getCodeFromSpecies; } });
|
|
@@ -67,8 +95,19 @@ Object.defineProperty(exports, "registerSpeciesCode", { enumerable: true, get: f
|
|
|
67
95
|
// =============================================================================
|
|
68
96
|
var index_js_1 = require("./crypto/index.js");
|
|
69
97
|
Object.defineProperty(exports, "encryptSpecimen", { enumerable: true, get: function () { return index_js_1.encryptSpecimen; } });
|
|
98
|
+
Object.defineProperty(exports, "encryptFields", { enumerable: true, get: function () { return index_js_1.encryptFields; } });
|
|
70
99
|
Object.defineProperty(exports, "isEncrypted", { enumerable: true, get: function () { return index_js_1.isEncrypted; } });
|
|
100
|
+
Object.defineProperty(exports, "isEncryptedSpecimen", { enumerable: true, get: function () { return index_js_1.isEncryptedSpecimen; } });
|
|
101
|
+
Object.defineProperty(exports, "isEncryptedField", { enumerable: true, get: function () { return index_js_1.isEncryptedField; } });
|
|
102
|
+
Object.defineProperty(exports, "toEncryptedUrl", { enumerable: true, get: function () { return index_js_1.toEncryptedUrl; } });
|
|
71
103
|
Object.defineProperty(exports, "decryptSpecimen", { enumerable: true, get: function () { return index_js_1.decryptSpecimen; } });
|
|
104
|
+
Object.defineProperty(exports, "decryptPlaintext", { enumerable: true, get: function () { return index_js_1.decryptPlaintext; } });
|
|
105
|
+
Object.defineProperty(exports, "decryptField", { enumerable: true, get: function () { return index_js_1.decryptField; } });
|
|
106
|
+
Object.defineProperty(exports, "decryptFields", { enumerable: true, get: function () { return index_js_1.decryptFields; } });
|
|
107
|
+
Object.defineProperty(exports, "parseEncryptedUrl", { enumerable: true, get: function () { return index_js_1.parseEncryptedUrl; } });
|
|
108
|
+
Object.defineProperty(exports, "base64UrlEncode", { enumerable: true, get: function () { return index_js_1.base64UrlEncode; } });
|
|
109
|
+
Object.defineProperty(exports, "base64UrlDecode", { enumerable: true, get: function () { return index_js_1.base64UrlDecode; } });
|
|
110
|
+
Object.defineProperty(exports, "derivePassphraseKey", { enumerable: true, get: function () { return index_js_1.derivePassphraseKey; } });
|
|
72
111
|
// =============================================================================
|
|
73
112
|
// Core Functions - QR Code Generation
|
|
74
113
|
// =============================================================================
|
|
@@ -78,4 +117,32 @@ Object.defineProperty(exports, "toQRCodeDataURL", { enumerable: true, get: funct
|
|
|
78
117
|
Object.defineProperty(exports, "toQRCodeSVG", { enumerable: true, get: function () { return index_js_2.toQRCodeSVG; } });
|
|
79
118
|
Object.defineProperty(exports, "isQRAvailable", { enumerable: true, get: function () { return index_js_2.isQRAvailable; } });
|
|
80
119
|
Object.defineProperty(exports, "isQRAvailableSync", { enumerable: true, get: function () { return index_js_2.isQRAvailableSync; } });
|
|
120
|
+
// =============================================================================
|
|
121
|
+
// Environment Detection (v1.2.0)
|
|
122
|
+
// =============================================================================
|
|
123
|
+
var environment_js_1 = require("./utils/environment.js");
|
|
124
|
+
Object.defineProperty(exports, "isServer", { enumerable: true, get: function () { return environment_js_1.isServer; } });
|
|
125
|
+
Object.defineProperty(exports, "isBrowser", { enumerable: true, get: function () { return environment_js_1.isBrowser; } });
|
|
126
|
+
Object.defineProperty(exports, "isWebWorker", { enumerable: true, get: function () { return environment_js_1.isWebWorker; } });
|
|
127
|
+
Object.defineProperty(exports, "isDeno", { enumerable: true, get: function () { return environment_js_1.isDeno; } });
|
|
128
|
+
Object.defineProperty(exports, "isBun", { enumerable: true, get: function () { return environment_js_1.isBun; } });
|
|
129
|
+
Object.defineProperty(exports, "getRuntimeEnvironment", { enumerable: true, get: function () { return environment_js_1.getRuntimeEnvironment; } });
|
|
130
|
+
Object.defineProperty(exports, "supportsWebCrypto", { enumerable: true, get: function () { return environment_js_1.supportsWebCrypto; } });
|
|
131
|
+
Object.defineProperty(exports, "supportsNodeCrypto", { enumerable: true, get: function () { return environment_js_1.supportsNodeCrypto; } });
|
|
132
|
+
Object.defineProperty(exports, "isCryptoSupported", { enumerable: true, get: function () { return environment_js_1.isCryptoSupported; } });
|
|
133
|
+
Object.defineProperty(exports, "supportsTextEncoding", { enumerable: true, get: function () { return environment_js_1.supportsTextEncoding; } });
|
|
134
|
+
Object.defineProperty(exports, "supportsURLAPIs", { enumerable: true, get: function () { return environment_js_1.supportsURLAPIs; } });
|
|
135
|
+
// =============================================================================
|
|
136
|
+
// Migration Utilities (v1.2.0)
|
|
137
|
+
// =============================================================================
|
|
138
|
+
var migration_js_1 = require("./utils/migration.js");
|
|
139
|
+
Object.defineProperty(exports, "compareVersions", { enumerable: true, get: function () { return migration_js_1.compareVersions; } });
|
|
140
|
+
Object.defineProperty(exports, "isOutdated", { enumerable: true, get: function () { return migration_js_1.isOutdated; } });
|
|
141
|
+
Object.defineProperty(exports, "isNewer", { enumerable: true, get: function () { return migration_js_1.isNewer; } });
|
|
142
|
+
Object.defineProperty(exports, "getCurrentVersion", { enumerable: true, get: function () { return migration_js_1.getCurrentVersion; } });
|
|
143
|
+
Object.defineProperty(exports, "registerMigration", { enumerable: true, get: function () { return migration_js_1.registerMigration; } });
|
|
144
|
+
Object.defineProperty(exports, "canMigrate", { enumerable: true, get: function () { return migration_js_1.canMigrate; } });
|
|
145
|
+
Object.defineProperty(exports, "migrate", { enumerable: true, get: function () { return migration_js_1.migrate; } });
|
|
146
|
+
Object.defineProperty(exports, "getMigrations", { enumerable: true, get: function () { return migration_js_1.getMigrations; } });
|
|
147
|
+
Object.defineProperty(exports, "clearMigrations", { enumerable: true, get: function () { return migration_js_1.clearMigrations; } });
|
|
81
148
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;AAEH,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAChF,uCAAwD;AAA/C,wGAAA,YAAY,OAAA;AAAE,wGAAA,YAAY,OAAA;AAiDnC,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAChF,uCAOoB;AANlB,wGAAA,YAAY,OAAA;AACZ,0GAAA,cAAc,OAAA;AACd,yGAAA,aAAa,OAAA;AACb,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,yGAAA,aAAa,OAAA;AAGf,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAChF,uCAMoB;AALlB,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,+GAAA,mBAAmB,OAAA;AACnB,gHAAA,oBAAoB,OAAA;AAGtB,gFAAgF;AAChF,+BAA+B;AAC/B,gFAAgF;AAChF,uCAKoB;AAJlB,gHAAA,oBAA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OAAA;AACf,4GAAA,gBAAgB,OAAA;AAChB,wGAAA,YAAY,OAAA;AACZ,yGAAA,aAAa,OAAA;AACb,6GAAA,iBAAiB,OAAA;AAEjB,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AAGrB,gFAAgF;AAChF,sCAAsC;AACtC,gFAAgF;AAChF,0CAMuB;AALrB,oGAAA,QAAQ,OAAA;AACR,2GAAA,eAAe,OAAA;AACf,uGAAA,WAAW,OAAA;AACX,yGAAA,aAAa,OAAA;AACb,6GAAA,iBAAiB,OAAA;AAGnB,gFAAgF;AAChF,iCAAiC;AACjC,gFAAgF;AAChF,yDAYgC;AAX9B,0GAAA,QAAQ,OAAA;AACR,2GAAA,SAAS,OAAA;AACT,6GAAA,WAAW,OAAA;AACX,wGAAA,MAAM,OAAA;AACN,uGAAA,KAAK,OAAA;AACL,uHAAA,qBAAqB,OAAA;AACrB,mHAAA,iBAAiB,OAAA;AACjB,oHAAA,kBAAkB,OAAA;AAClB,mHAAA,iBAAiB,OAAA;AACjB,sHAAA,oBAAoB,OAAA;AACpB,iHAAA,eAAe,OAAA;AAIjB,gFAAgF;AAChF,+BAA+B;AAC/B,gFAAgF;AAChF,qDAU8B;AAT5B,+GAAA,eAAe,OAAA;AACf,0GAAA,UAAU,OAAA;AACV,uGAAA,OAAO,OAAA;AACP,iHAAA,iBAAiB,OAAA;AACjB,iHAAA,iBAAiB,OAAA;AACjB,0GAAA,UAAU,OAAA;AACV,uGAAA,OAAO,OAAA;AACP,6GAAA,aAAa,OAAA;AACb,+GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WOLS Specimen Parser
|
|
3
|
+
*
|
|
4
|
+
* This module provides parsing functionality for WOLS specimen JSON.
|
|
5
|
+
*
|
|
6
|
+
* @module parser
|
|
7
|
+
*/
|
|
8
|
+
import { type ParseResult, type Specimen } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parse a JSON string into a validated Specimen object.
|
|
11
|
+
*
|
|
12
|
+
* This function performs both JSON parsing and WOLS validation.
|
|
13
|
+
* If the JSON is invalid or the parsed object doesn't conform to WOLS,
|
|
14
|
+
* it returns a failure result with a detailed error.
|
|
15
|
+
*
|
|
16
|
+
* @param json - The JSON string to parse
|
|
17
|
+
* @returns ParseResult with either the parsed Specimen or an error
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const result = parseSpecimen('{"@context": "https://wemush.com/wols/v1", ...}');
|
|
22
|
+
* if (result.success) {
|
|
23
|
+
* console.log('Specimen ID:', result.data.id);
|
|
24
|
+
* } else {
|
|
25
|
+
* console.error('Parse error:', result.error.message);
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseSpecimen(json: string): ParseResult<Specimen>;
|
|
30
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,QAAQ,EAKd,MAAM,YAAY,CAAC;AAyCpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,CAwGjE"}
|
package/dist/cjs/parser.js
CHANGED
|
@@ -140,6 +140,9 @@ function parseSpecimen(json) {
|
|
|
140
140
|
if (data['signature'] !== undefined) {
|
|
141
141
|
specimen.signature = data['signature'];
|
|
142
142
|
}
|
|
143
|
+
if (data['_meta'] !== undefined) {
|
|
144
|
+
specimen._meta = data['_meta'];
|
|
145
|
+
}
|
|
143
146
|
return {
|
|
144
147
|
success: true,
|
|
145
148
|
data: specimen,
|
package/dist/cjs/parser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA6EH,sCAwGC;AAnLD,2CAKqB;AACrB,yCAQoB;AACpB,iDAAkD;AAElD,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;GAEG;AACH,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,MAA0B;IACnD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,yBAAa,CAAC,cAAc,CAAC;IACtC,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,yBAAa,CAAC,cAAc,CAAC;IACtC,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;IAE7B,yCAAyC;IACzC,IAAI,MAAM,CAAC,MAAM,CAAC,yBAAa,CAAC,CAAC,QAAQ,CAAC,IAAqB,CAAC,EAAE,CAAC;QACjE,OAAO,IAAqB,CAAC;IAC/B,CAAC;IAED,OAAO,yBAAa,CAAC,cAAc,CAAC;AACtC,CAAC;AAED,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,qBAAqB;IACrB,IAAI,MAAe,CAAC;IAEpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;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S,CAAC,KAAK,SAAS,EAAE,CAAC;QAClC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAW,CAAC;IAC/C,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;QACjC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAA4B,CAAC;IAC9D,CAAC;IAED,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,SAAS,EAAE,CAAC;QACpC,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAW,CAAC;IACnD,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;QAChC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAiB,CAAC;IACjD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QR Code Generation Module
|
|
3
|
+
*
|
|
4
|
+
* This module provides QR code generation functionality for WOLS specimens.
|
|
5
|
+
* Requires the 'qrcode' package as an optional peer dependency.
|
|
6
|
+
*
|
|
7
|
+
* @module qr/generate
|
|
8
|
+
*/
|
|
9
|
+
import type { Specimen, QRCodeOptions } from '../types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Check if QR code generation is available.
|
|
12
|
+
* Returns true if the qrcode library is installed.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isQRAvailable(): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Synchronous check if QR code generation is available.
|
|
17
|
+
* Note: Only accurate after first async call to any QR function.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isQRAvailableSync(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Generate QR code as PNG buffer.
|
|
22
|
+
*
|
|
23
|
+
* @param specimen - The specimen to encode
|
|
24
|
+
* @param options - QR code generation options
|
|
25
|
+
* @returns PNG buffer containing the QR code
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const buffer = await toQRCode(specimen, { size: 400 });
|
|
30
|
+
* fs.writeFileSync('specimen-qr.png', buffer);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function toQRCode(specimen: Specimen, options?: QRCodeOptions): Promise<Buffer>;
|
|
34
|
+
/**
|
|
35
|
+
* Generate QR code as data URL (base64 encoded PNG).
|
|
36
|
+
*
|
|
37
|
+
* @param specimen - The specimen to encode
|
|
38
|
+
* @param options - QR code generation options
|
|
39
|
+
* @returns Data URL string (data:image/png;base64,...)
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const dataUrl = await toQRCodeDataURL(specimen);
|
|
44
|
+
* // Use in HTML: <img src={dataUrl} />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function toQRCodeDataURL(specimen: Specimen, options?: QRCodeOptions): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Generate QR code as SVG string.
|
|
50
|
+
*
|
|
51
|
+
* @param specimen - The specimen to encode
|
|
52
|
+
* @param options - QR code generation options
|
|
53
|
+
* @returns SVG string
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const svg = await toQRCodeSVG(specimen, { color: { dark: '#000', light: '#fff' } });
|
|
58
|
+
* fs.writeFileSync('specimen-qr.svg', svg);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function toQRCodeSVG(specimen: Specimen, options?: QRCodeOptions): Promise<string>;
|
|
62
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/qr/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAwK3D;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAGtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAa/F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAajB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QR Code Submodule
|
|
3
|
+
*
|
|
4
|
+
* This module provides QR code generation functionality for WOLS specimens.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
* @module @wemush/wols/qr
|
|
8
|
+
*/
|
|
9
|
+
export { toQRCode, toQRCodeDataURL, toQRCodeSVG, isQRAvailable, isQRAvailableSync, } from './generate.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/qr/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,QAAQ,EACR,eAAe,EACf,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specimen Creation and Serialization
|
|
3
|
+
*
|
|
4
|
+
* This module provides functions to create and serialize
|
|
5
|
+
* WOLS v1.3.0 compliant specimen objects.
|
|
6
|
+
*
|
|
7
|
+
* @module specimen
|
|
8
|
+
*/
|
|
9
|
+
import type { CreateSpecimenOptions, Specimen, SpecimenInput } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Warning code emitted when `PRIMORDIA` is supplied as a specimen type.
|
|
12
|
+
*
|
|
13
|
+
* @since 1.3.0
|
|
14
|
+
*/
|
|
15
|
+
export declare const PRIMORDIA_AS_TYPE_WARNING = "PRIMORDIA_AS_TYPE";
|
|
16
|
+
/**
|
|
17
|
+
* Create a new specimen with auto-generated ID and JSON-LD fields.
|
|
18
|
+
*
|
|
19
|
+
* This function creates a fully-formed WOLS v1.3.0 compliant Specimen
|
|
20
|
+
* with automatic ID generation, version assignment, and JSON-LD context.
|
|
21
|
+
*
|
|
22
|
+
* Type aliases resolve case-insensitively. `PRIMORDIA` supplied as a type
|
|
23
|
+
* resolves to `FRUITING`, sets `stage: 'PRIMORDIA'` when no stage was given
|
|
24
|
+
* (a supplied stage is never overridden), and emits a warning.
|
|
25
|
+
*
|
|
26
|
+
* @param input - Specimen creation parameters
|
|
27
|
+
* @param options - `onWarning` receives non-fatal warnings (default: console.warn)
|
|
28
|
+
* @returns Fully-formed Specimen with JSON-LD fields
|
|
29
|
+
* @throws Error if the type is unknown or `created` is not ISO 8601
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // Minimal specimen
|
|
34
|
+
* const culture = createSpecimen({
|
|
35
|
+
* type: 'CULTURE',
|
|
36
|
+
* species: 'Pleurotus ostreatus',
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* // Full specimen with strain info
|
|
40
|
+
* const substrate = createSpecimen({
|
|
41
|
+
* type: 'SUBSTRATE',
|
|
42
|
+
* species: 'Hericium erinaceus',
|
|
43
|
+
* strain: {
|
|
44
|
+
* name: "Lion's Mane Premium",
|
|
45
|
+
* generation: 'F2',
|
|
46
|
+
* clonalGeneration: 3,
|
|
47
|
+
* },
|
|
48
|
+
* stage: 'COLONIZATION',
|
|
49
|
+
* batch: 'batch_2025_12_001',
|
|
50
|
+
* organization: 'org_mushoh',
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // String strain shorthand
|
|
54
|
+
* const spawn = createSpecimen({
|
|
55
|
+
* type: 'SPAWN',
|
|
56
|
+
* species: 'Ganoderma lucidum',
|
|
57
|
+
* strain: 'Reishi Red', // Auto-expands to { name: 'Reishi Red' }
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* // PRIMORDIA as a type (v1.3.0) -> type FRUITING, stage PRIMORDIA, plus a warning
|
|
61
|
+
* const pinning = createSpecimen(
|
|
62
|
+
* { type: 'PRIMORDIA', species: 'Pleurotus ostreatus' },
|
|
63
|
+
* { onWarning: w => console.info(w.message) }
|
|
64
|
+
* );
|
|
65
|
+
*
|
|
66
|
+
* // Explicit creation timestamp (v1.3.0)
|
|
67
|
+
* const dated = createSpecimen({
|
|
68
|
+
* type: 'CULTURE',
|
|
69
|
+
* species: 'Pleurotus ostreatus',
|
|
70
|
+
* created: '2025-12-16T10:30:00Z',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function createSpecimen(input: SpecimenInput, options?: CreateSpecimenOptions): Specimen;
|
|
75
|
+
/**
|
|
76
|
+
* Serialize a specimen to JSON-LD string.
|
|
77
|
+
*
|
|
78
|
+
* The output is formatted with JSON-LD fields (@context, @type) first,
|
|
79
|
+
* followed by id, version, and remaining fields. Undefined fields are omitted.
|
|
80
|
+
*
|
|
81
|
+
* @param specimen - Specimen to serialize
|
|
82
|
+
* @returns JSON string suitable for QR encoding
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const specimen = createSpecimen({
|
|
87
|
+
* type: 'CULTURE',
|
|
88
|
+
* species: 'Pleurotus ostreatus',
|
|
89
|
+
* });
|
|
90
|
+
*
|
|
91
|
+
* const json = serializeSpecimen(specimen);
|
|
92
|
+
* // Returns: '{"@context":"https://wemush.com/wols/v1","@type":"Specimen",...}'
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function serializeSpecimen(specimen: Specimen): string;
|
|
96
|
+
//# sourceMappingURL=specimen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specimen.d.ts","sourceRoot":"","sources":["../../src/specimen.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACR,aAAa,EAGd,MAAM,YAAY,CAAC;AAWpB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,sBAAsB,CAAC;AAkC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,qBAA0B,GAClC,QAAQ,CAmFV;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CA4D5D"}
|