@xyo-network/core 2.20.41 → 2.20.42
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/dist/cjs/BoundWitness/Builder/Builder.d.ts +22 -22
- package/dist/cjs/BoundWitness/Builder/Builder.js +67 -67
- package/dist/cjs/BoundWitness/Builder/index.d.ts +1 -1
- package/dist/cjs/BoundWitness/Builder/index.js +4 -4
- package/dist/cjs/BoundWitness/Validator/BodyValidator.d.ts +18 -18
- package/dist/cjs/BoundWitness/Validator/BodyValidator.js +90 -90
- package/dist/cjs/BoundWitness/Validator/MetaValidator.d.ts +14 -14
- package/dist/cjs/BoundWitness/Validator/MetaValidator.js +69 -69
- package/dist/cjs/BoundWitness/Validator/Validator.d.ts +12 -12
- package/dist/cjs/BoundWitness/Validator/Validator.js +45 -45
- package/dist/cjs/BoundWitness/Validator/index.d.ts +3 -3
- package/dist/cjs/BoundWitness/Validator/index.js +6 -6
- package/dist/cjs/BoundWitness/Validator/ip-regex.d.ts +9 -9
- package/dist/cjs/BoundWitness/Validator/ip-regex.js +19 -19
- package/dist/cjs/BoundWitness/Validator/is-ip.d.ts +4 -4
- package/dist/cjs/BoundWitness/Validator/is-ip.js +20 -20
- package/dist/cjs/BoundWitness/Wrapper/Wrapper.d.ts +13 -13
- package/dist/cjs/BoundWitness/Wrapper/Wrapper.js +29 -29
- package/dist/cjs/BoundWitness/Wrapper/index.d.ts +1 -1
- package/dist/cjs/BoundWitness/Wrapper/index.js +4 -4
- package/dist/cjs/BoundWitness/index.d.ts +4 -4
- package/dist/cjs/BoundWitness/index.js +7 -7
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBody.d.ts +11 -11
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBody.js +2 -2
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBodySchema.d.ts +37 -37
- package/dist/cjs/BoundWitness/models/Body/XyoBoundWitnessBodySchema.js +19 -19
- package/dist/cjs/BoundWitness/models/Body/index.d.ts +2 -2
- package/dist/cjs/BoundWitness/models/Body/index.js +5 -5
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMeta.d.ts +13 -13
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMeta.js +2 -2
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.d.ts +85 -85
- package/dist/cjs/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.js +27 -27
- package/dist/cjs/BoundWitness/models/Meta/index.d.ts +2 -2
- package/dist/cjs/BoundWitness/models/Meta/index.js +5 -5
- package/dist/cjs/BoundWitness/models/WithXyoBoundWitnessMeta.d.ts +4 -4
- package/dist/cjs/BoundWitness/models/WithXyoBoundWitnessMeta.js +2 -2
- package/dist/cjs/BoundWitness/models/XyoBoundWitness.d.ts +5 -5
- package/dist/cjs/BoundWitness/models/XyoBoundWitness.js +2 -2
- package/dist/cjs/BoundWitness/models/XyoBoundWitnessSchema.d.ts +75 -75
- package/dist/cjs/BoundWitness/models/XyoBoundWitnessSchema.js +16 -16
- package/dist/cjs/BoundWitness/models/index.d.ts +5 -5
- package/dist/cjs/BoundWitness/models/index.js +8 -8
- package/dist/cjs/Hasher/XyoAbstractHasher.d.ts +11 -11
- package/dist/cjs/Hasher/XyoAbstractHasher.js +33 -33
- package/dist/cjs/Hasher/XyoHasher.d.ts +6 -6
- package/dist/cjs/Hasher/XyoHasher.js +14 -14
- package/dist/cjs/Hasher/index.d.ts +5 -5
- package/dist/cjs/Hasher/index.js +8 -8
- package/dist/cjs/Hasher/removeEmptyFields.d.ts +1 -1
- package/dist/cjs/Hasher/removeEmptyFields.js +19 -19
- package/dist/cjs/Hasher/removeFields.d.ts +6 -6
- package/dist/cjs/Hasher/removeFields.js +28 -28
- package/dist/cjs/Hasher/sortFields.d.ts +1 -1
- package/dist/cjs/Hasher/sortFields.js +26 -26
- package/dist/cjs/Huri/Huri.d.ts +26 -26
- package/dist/cjs/Huri/Huri.js +100 -100
- package/dist/cjs/Huri/index.d.ts +1 -1
- package/dist/cjs/Huri/index.js +4 -4
- package/dist/cjs/Payload/Builder/Builder.d.ts +14 -14
- package/dist/cjs/Payload/Builder/Builder.js +30 -30
- package/dist/cjs/Payload/Builder/index.d.ts +1 -1
- package/dist/cjs/Payload/Builder/index.js +4 -4
- package/dist/cjs/Payload/Validator/BodyValidator.d.ts +11 -11
- package/dist/cjs/Payload/Validator/BodyValidator.js +30 -30
- package/dist/cjs/Payload/Validator/MetaValidator.d.ts +9 -9
- package/dist/cjs/Payload/Validator/MetaValidator.js +36 -36
- package/dist/cjs/Payload/Validator/Validator.d.ts +11 -11
- package/dist/cjs/Payload/Validator/Validator.js +18 -18
- package/dist/cjs/Payload/Validator/index.d.ts +3 -3
- package/dist/cjs/Payload/Validator/index.js +6 -6
- package/dist/cjs/Payload/Wrapper/Validator.d.ts +9 -9
- package/dist/cjs/Payload/Wrapper/Validator.js +18 -18
- package/dist/cjs/Payload/Wrapper/Wrapper.d.ts +9 -9
- package/dist/cjs/Payload/Wrapper/Wrapper.js +20 -20
- package/dist/cjs/Payload/Wrapper/index.d.ts +2 -2
- package/dist/cjs/Payload/Wrapper/index.js +5 -5
- package/dist/cjs/Payload/index.d.ts +4 -4
- package/dist/cjs/Payload/index.js +7 -7
- package/dist/cjs/Payload/models/Body.d.ts +6 -6
- package/dist/cjs/Payload/models/Body.js +2 -2
- package/dist/cjs/Payload/models/Meta.d.ts +10 -10
- package/dist/cjs/Payload/models/Meta.js +2 -2
- package/dist/cjs/Payload/models/WithXyoPayloadMeta.d.ts +4 -4
- package/dist/cjs/Payload/models/WithXyoPayloadMeta.js +2 -2
- package/dist/cjs/Payload/models/XyoPayload.d.ts +4 -4
- package/dist/cjs/Payload/models/XyoPayload.js +2 -2
- package/dist/cjs/Payload/models/index.d.ts +4 -4
- package/dist/cjs/Payload/models/index.js +7 -7
- package/dist/cjs/Query/QueryPayload.d.ts +11 -11
- package/dist/cjs/Query/QueryPayload.js +2 -2
- package/dist/cjs/Query/index.d.ts +1 -1
- package/dist/cjs/Query/index.js +4 -4
- package/dist/cjs/Schema/Payload.d.ts +10 -10
- package/dist/cjs/Schema/Payload.js +2 -2
- package/dist/cjs/Schema/index.d.ts +1 -1
- package/dist/cjs/Schema/index.js +4 -4
- package/dist/cjs/SchemaNameValidator.d.ts +73 -73
- package/dist/cjs/SchemaNameValidator.js +134 -134
- package/dist/cjs/Test/index.d.ts +2 -2
- package/dist/cjs/Test/index.js +5 -5
- package/dist/cjs/Test/testBoundWitness.d.ts +3 -3
- package/dist/cjs/Test/testBoundWitness.js +16 -16
- package/dist/cjs/Test/testPayload.d.ts +4 -4
- package/dist/cjs/Test/testPayload.js +18 -18
- package/dist/cjs/Wallet/Account/Account.d.ts +36 -36
- package/dist/cjs/Wallet/Account/Account.js +78 -78
- package/dist/cjs/Wallet/Account/Key/Data/AbstractData.d.ts +12 -12
- package/dist/cjs/Wallet/Account/Key/Data/AbstractData.js +15 -15
- package/dist/cjs/Wallet/Account/Key/Data/Data.d.ts +15 -15
- package/dist/cjs/Wallet/Account/Key/Data/Data.js +39 -39
- package/dist/cjs/Wallet/Account/Key/Data/XyoDataLike.d.ts +4 -4
- package/dist/cjs/Wallet/Account/Key/Data/XyoDataLike.js +2 -2
- package/dist/cjs/Wallet/Account/Key/Data/index.d.ts +4 -4
- package/dist/cjs/Wallet/Account/Key/Data/index.js +7 -7
- package/dist/cjs/Wallet/Account/Key/Data/toUint8Array.d.ts +3 -3
- package/dist/cjs/Wallet/Account/Key/Data/toUint8Array.js +32 -32
- package/dist/cjs/Wallet/Account/Key/XyoAddressValue.d.ts +11 -11
- package/dist/cjs/Wallet/Account/Key/XyoAddressValue.js +48 -48
- package/dist/cjs/Wallet/Account/Key/XyoEllipticKey.d.ts +5 -5
- package/dist/cjs/Wallet/Account/Key/XyoEllipticKey.js +12 -12
- package/dist/cjs/Wallet/Account/Key/XyoKeyPair.d.ts +10 -10
- package/dist/cjs/Wallet/Account/Key/XyoKeyPair.js +22 -22
- package/dist/cjs/Wallet/Account/Key/XyoPrivateKey.d.ts +14 -14
- package/dist/cjs/Wallet/Account/Key/XyoPrivateKey.js +55 -55
- package/dist/cjs/Wallet/Account/Key/XyoPublicKey.d.ts +10 -10
- package/dist/cjs/Wallet/Account/Key/XyoPublicKey.js +21 -21
- package/dist/cjs/Wallet/Account/Key/index.d.ts +5 -5
- package/dist/cjs/Wallet/Account/Key/index.js +8 -8
- package/dist/cjs/Wallet/Account/index.d.ts +2 -2
- package/dist/cjs/Wallet/Account/index.js +5 -5
- package/dist/cjs/Wallet/Base/Base.d.ts +8 -8
- package/dist/cjs/Wallet/Base/Base.js +36 -36
- package/dist/cjs/Wallet/Base/Words.d.ts +2 -2
- package/dist/cjs/Wallet/Base/Words.js +2643 -2643
- package/dist/cjs/Wallet/Base/WordsPayload.d.ts +4 -4
- package/dist/cjs/Wallet/Base/WordsPayload.js +2 -2
- package/dist/cjs/Wallet/Base/index.d.ts +1 -1
- package/dist/cjs/Wallet/Base/index.js +4 -4
- package/dist/cjs/Wallet/index.d.ts +2 -2
- package/dist/cjs/Wallet/index.js +5 -5
- package/dist/cjs/Witness/LegacyWitness.d.ts +14 -14
- package/dist/cjs/Witness/LegacyWitness.js +27 -27
- package/dist/cjs/Witness/QueryWitness.d.ts +9 -9
- package/dist/cjs/Witness/QueryWitness.js +24 -24
- package/dist/cjs/Witness/Witness.d.ts +5 -5
- package/dist/cjs/Witness/Witness.js +6 -6
- package/dist/cjs/Witness/index.d.ts +3 -3
- package/dist/cjs/Witness/index.js +6 -6
- package/dist/cjs/browser/core/Wallet/Web.d.ts +5 -5
- package/dist/cjs/browser/core/Wallet/Web.js +14 -14
- package/dist/cjs/browser/core/Wallet/index.d.ts +1 -1
- package/dist/cjs/browser/core/Wallet/index.js +4 -4
- package/dist/cjs/browser/core/index.d.ts +1 -1
- package/dist/cjs/browser/core/index.js +4 -4
- package/dist/cjs/browser/index.d.ts +1 -1
- package/dist/cjs/browser/index.js +4 -4
- package/dist/cjs/browserIndex.d.ts +2 -2
- package/dist/cjs/browserIndex.js +5 -5
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/lib/dns/DnsRecordType.d.ts +14 -14
- package/dist/cjs/lib/dns/DnsRecordType.js +18 -18
- package/dist/cjs/lib/dns/DnsReturnCode.d.ts +13 -13
- package/dist/cjs/lib/dns/DnsReturnCode.js +17 -17
- package/dist/cjs/lib/dns/GoogleDnsResult.d.ts +16 -16
- package/dist/cjs/lib/dns/GoogleDnsResult.js +2 -2
- package/dist/cjs/lib/dns/GoogleDnsResultAnswer.d.ts +7 -7
- package/dist/cjs/lib/dns/GoogleDnsResultAnswer.js +2 -2
- package/dist/cjs/lib/dns/GoogleDnsResultQuestion.d.ts +10 -10
- package/dist/cjs/lib/dns/GoogleDnsResultQuestion.js +2 -2
- package/dist/cjs/lib/dns/domainExists.d.ts +7 -7
- package/dist/cjs/lib/dns/domainExists.js +18 -18
- package/dist/cjs/lib/dns/domainResolve.d.ts +8 -8
- package/dist/cjs/lib/dns/domainResolve.js +18 -18
- package/dist/cjs/lib/dns/googleDnsOverHttps.d.ts +4 -4
- package/dist/cjs/lib/dns/googleDnsOverHttps.js +10 -10
- package/dist/cjs/lib/dns/index.d.ts +8 -8
- package/dist/cjs/lib/dns/index.js +11 -11
- package/dist/cjs/lib/dumpErrors.d.ts +2 -2
- package/dist/cjs/lib/dumpErrors.js +9 -9
- package/dist/cjs/lib/exists.d.ts +1 -1
- package/dist/cjs/lib/exists.js +7 -7
- package/dist/cjs/lib/index.d.ts +4 -4
- package/dist/cjs/lib/index.js +7 -7
- package/dist/cjs/lib/isBrowser.d.ts +1 -1
- package/dist/cjs/lib/isBrowser.js +7 -7
- package/dist/cjs/lib/isXyoPayloadOfSchemaType.d.ts +6 -6
- package/dist/cjs/lib/isXyoPayloadOfSchemaType.js +9 -9
- package/dist/cjs/lib/typeOf/TypeOfTypes.d.ts +1 -1
- package/dist/cjs/lib/typeOf/TypeOfTypes.js +2 -2
- package/dist/cjs/lib/typeOf/ifDefined.d.ts +1 -1
- package/dist/cjs/lib/typeOf/ifDefined.js +15 -15
- package/dist/cjs/lib/typeOf/ifTypeOf.d.ts +2 -2
- package/dist/cjs/lib/typeOf/ifTypeOf.js +11 -11
- package/dist/cjs/lib/typeOf/index.d.ts +5 -5
- package/dist/cjs/lib/typeOf/index.js +8 -8
- package/dist/cjs/lib/typeOf/typeOf.d.ts +2 -2
- package/dist/cjs/lib/typeOf/typeOf.js +7 -7
- package/dist/cjs/lib/typeOf/validateType.d.ts +2 -2
- package/dist/cjs/lib/typeOf/validateType.js +17 -17
- package/dist/cjs/models/WithStringIndex.d.ts +1 -1
- package/dist/cjs/models/WithStringIndex.js +2 -2
- package/dist/cjs/models/index.d.ts +1 -1
- package/dist/cjs/models/index.js +4 -4
- package/dist/cjs/nodeIndex.d.ts +1 -1
- package/dist/cjs/nodeIndex.js +4 -4
- package/dist/cjs/shared.d.ts +11 -11
- package/dist/cjs/shared.js +14 -14
- package/dist/esm/BoundWitness/Builder/Builder.d.ts +22 -22
- package/dist/esm/BoundWitness/Builder/Builder.js +65 -65
- package/dist/esm/BoundWitness/Builder/index.d.ts +1 -1
- package/dist/esm/BoundWitness/Builder/index.js +1 -1
- package/dist/esm/BoundWitness/Validator/BodyValidator.d.ts +18 -18
- package/dist/esm/BoundWitness/Validator/BodyValidator.js +85 -85
- package/dist/esm/BoundWitness/Validator/MetaValidator.d.ts +14 -14
- package/dist/esm/BoundWitness/Validator/MetaValidator.js +65 -65
- package/dist/esm/BoundWitness/Validator/Validator.d.ts +12 -12
- package/dist/esm/BoundWitness/Validator/Validator.js +40 -40
- package/dist/esm/BoundWitness/Validator/index.d.ts +3 -3
- package/dist/esm/BoundWitness/Validator/index.js +3 -3
- package/dist/esm/BoundWitness/Validator/ip-regex.d.ts +9 -9
- package/dist/esm/BoundWitness/Validator/ip-regex.js +15 -15
- package/dist/esm/BoundWitness/Validator/is-ip.d.ts +4 -4
- package/dist/esm/BoundWitness/Validator/is-ip.js +13 -13
- package/dist/esm/BoundWitness/Wrapper/Wrapper.d.ts +13 -13
- package/dist/esm/BoundWitness/Wrapper/Wrapper.js +23 -23
- package/dist/esm/BoundWitness/Wrapper/index.d.ts +1 -1
- package/dist/esm/BoundWitness/Wrapper/index.js +1 -1
- package/dist/esm/BoundWitness/index.d.ts +4 -4
- package/dist/esm/BoundWitness/index.js +4 -4
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBody.d.ts +11 -11
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBody.js +1 -1
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBodySchema.d.ts +37 -37
- package/dist/esm/BoundWitness/models/Body/XyoBoundWitnessBodySchema.js +16 -16
- package/dist/esm/BoundWitness/models/Body/index.d.ts +2 -2
- package/dist/esm/BoundWitness/models/Body/index.js +2 -2
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMeta.d.ts +13 -13
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMeta.js +1 -1
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.d.ts +85 -85
- package/dist/esm/BoundWitness/models/Meta/XyoBoundWitnessMetaSchema.js +22 -22
- package/dist/esm/BoundWitness/models/Meta/index.d.ts +2 -2
- package/dist/esm/BoundWitness/models/Meta/index.js +2 -2
- package/dist/esm/BoundWitness/models/WithXyoBoundWitnessMeta.d.ts +4 -4
- package/dist/esm/BoundWitness/models/WithXyoBoundWitnessMeta.js +1 -1
- package/dist/esm/BoundWitness/models/XyoBoundWitness.d.ts +5 -5
- package/dist/esm/BoundWitness/models/XyoBoundWitness.js +1 -1
- package/dist/esm/BoundWitness/models/XyoBoundWitnessSchema.d.ts +75 -75
- package/dist/esm/BoundWitness/models/XyoBoundWitnessSchema.js +20 -20
- package/dist/esm/BoundWitness/models/index.d.ts +5 -5
- package/dist/esm/BoundWitness/models/index.js +5 -5
- package/dist/esm/Hasher/XyoAbstractHasher.d.ts +11 -11
- package/dist/esm/Hasher/XyoAbstractHasher.js +28 -28
- package/dist/esm/Hasher/XyoHasher.d.ts +6 -6
- package/dist/esm/Hasher/XyoHasher.js +10 -10
- package/dist/esm/Hasher/index.d.ts +5 -5
- package/dist/esm/Hasher/index.js +5 -5
- package/dist/esm/Hasher/removeEmptyFields.d.ts +1 -1
- package/dist/esm/Hasher/removeEmptyFields.js +15 -15
- package/dist/esm/Hasher/removeFields.d.ts +6 -6
- package/dist/esm/Hasher/removeFields.js +21 -21
- package/dist/esm/Hasher/sortFields.d.ts +1 -1
- package/dist/esm/Hasher/sortFields.js +22 -22
- package/dist/esm/Huri/Huri.d.ts +26 -26
- package/dist/esm/Huri/Huri.js +89 -89
- package/dist/esm/Huri/index.d.ts +1 -1
- package/dist/esm/Huri/index.js +1 -1
- package/dist/esm/Payload/Builder/Builder.d.ts +14 -14
- package/dist/esm/Payload/Builder/Builder.js +29 -29
- package/dist/esm/Payload/Builder/index.d.ts +1 -1
- package/dist/esm/Payload/Builder/index.js +1 -1
- package/dist/esm/Payload/Validator/BodyValidator.d.ts +11 -11
- package/dist/esm/Payload/Validator/BodyValidator.js +26 -26
- package/dist/esm/Payload/Validator/MetaValidator.d.ts +9 -9
- package/dist/esm/Payload/Validator/MetaValidator.js +33 -33
- package/dist/esm/Payload/Validator/Validator.d.ts +11 -11
- package/dist/esm/Payload/Validator/Validator.js +15 -15
- package/dist/esm/Payload/Validator/index.d.ts +3 -3
- package/dist/esm/Payload/Validator/index.js +3 -3
- package/dist/esm/Payload/Wrapper/Validator.d.ts +9 -9
- package/dist/esm/Payload/Wrapper/Validator.js +14 -14
- package/dist/esm/Payload/Wrapper/Wrapper.d.ts +9 -9
- package/dist/esm/Payload/Wrapper/Wrapper.js +16 -16
- package/dist/esm/Payload/Wrapper/index.d.ts +2 -2
- package/dist/esm/Payload/Wrapper/index.js +2 -2
- package/dist/esm/Payload/index.d.ts +4 -4
- package/dist/esm/Payload/index.js +4 -4
- package/dist/esm/Payload/models/Body.d.ts +6 -6
- package/dist/esm/Payload/models/Body.js +1 -1
- package/dist/esm/Payload/models/Meta.d.ts +10 -10
- package/dist/esm/Payload/models/Meta.js +1 -1
- package/dist/esm/Payload/models/WithXyoPayloadMeta.d.ts +4 -4
- package/dist/esm/Payload/models/WithXyoPayloadMeta.js +1 -1
- package/dist/esm/Payload/models/XyoPayload.d.ts +4 -4
- package/dist/esm/Payload/models/XyoPayload.js +1 -1
- package/dist/esm/Payload/models/index.d.ts +4 -4
- package/dist/esm/Payload/models/index.js +4 -4
- package/dist/esm/Query/QueryPayload.d.ts +11 -11
- package/dist/esm/Query/QueryPayload.js +1 -1
- package/dist/esm/Query/index.d.ts +1 -1
- package/dist/esm/Query/index.js +1 -1
- package/dist/esm/Schema/Payload.d.ts +10 -10
- package/dist/esm/Schema/Payload.js +1 -1
- package/dist/esm/Schema/index.d.ts +1 -1
- package/dist/esm/Schema/index.js +1 -1
- package/dist/esm/SchemaNameValidator.d.ts +73 -73
- package/dist/esm/SchemaNameValidator.js +116 -116
- package/dist/esm/Test/index.d.ts +2 -2
- package/dist/esm/Test/index.js +2 -2
- package/dist/esm/Test/testBoundWitness.d.ts +3 -3
- package/dist/esm/Test/testBoundWitness.js +13 -13
- package/dist/esm/Test/testPayload.d.ts +4 -4
- package/dist/esm/Test/testPayload.js +14 -14
- package/dist/esm/Wallet/Account/Account.d.ts +36 -36
- package/dist/esm/Wallet/Account/Account.js +70 -70
- package/dist/esm/Wallet/Account/Key/Data/AbstractData.d.ts +12 -12
- package/dist/esm/Wallet/Account/Key/Data/AbstractData.js +11 -11
- package/dist/esm/Wallet/Account/Key/Data/Data.d.ts +15 -15
- package/dist/esm/Wallet/Account/Key/Data/Data.js +34 -34
- package/dist/esm/Wallet/Account/Key/Data/XyoDataLike.d.ts +4 -4
- package/dist/esm/Wallet/Account/Key/Data/XyoDataLike.js +1 -1
- package/dist/esm/Wallet/Account/Key/Data/index.d.ts +4 -4
- package/dist/esm/Wallet/Account/Key/Data/index.js +4 -4
- package/dist/esm/Wallet/Account/Key/Data/toUint8Array.d.ts +3 -3
- package/dist/esm/Wallet/Account/Key/Data/toUint8Array.js +30 -30
- package/dist/esm/Wallet/Account/Key/XyoAddressValue.d.ts +11 -11
- package/dist/esm/Wallet/Account/Key/XyoAddressValue.js +44 -44
- package/dist/esm/Wallet/Account/Key/XyoEllipticKey.d.ts +5 -5
- package/dist/esm/Wallet/Account/Key/XyoEllipticKey.js +7 -7
- package/dist/esm/Wallet/Account/Key/XyoKeyPair.d.ts +10 -10
- package/dist/esm/Wallet/Account/Key/XyoKeyPair.js +17 -17
- package/dist/esm/Wallet/Account/Key/XyoPrivateKey.d.ts +14 -14
- package/dist/esm/Wallet/Account/Key/XyoPrivateKey.js +49 -49
- package/dist/esm/Wallet/Account/Key/XyoPublicKey.d.ts +10 -10
- package/dist/esm/Wallet/Account/Key/XyoPublicKey.js +17 -17
- package/dist/esm/Wallet/Account/Key/index.d.ts +5 -5
- package/dist/esm/Wallet/Account/Key/index.js +5 -5
- package/dist/esm/Wallet/Account/index.d.ts +2 -2
- package/dist/esm/Wallet/Account/index.js +2 -2
- package/dist/esm/Wallet/Base/Base.d.ts +8 -8
- package/dist/esm/Wallet/Base/Base.js +29 -29
- package/dist/esm/Wallet/Base/Words.d.ts +2 -2
- package/dist/esm/Wallet/Base/Words.js +2640 -2640
- package/dist/esm/Wallet/Base/WordsPayload.d.ts +4 -4
- package/dist/esm/Wallet/Base/WordsPayload.js +1 -1
- package/dist/esm/Wallet/Base/index.d.ts +1 -1
- package/dist/esm/Wallet/Base/index.js +1 -1
- package/dist/esm/Wallet/index.d.ts +2 -2
- package/dist/esm/Wallet/index.js +2 -2
- package/dist/esm/Witness/LegacyWitness.d.ts +14 -14
- package/dist/esm/Witness/LegacyWitness.js +18 -18
- package/dist/esm/Witness/QueryWitness.d.ts +9 -9
- package/dist/esm/Witness/QueryWitness.js +16 -16
- package/dist/esm/Witness/Witness.d.ts +5 -5
- package/dist/esm/Witness/Witness.js +2 -2
- package/dist/esm/Witness/index.d.ts +3 -3
- package/dist/esm/Witness/index.js +3 -3
- package/dist/esm/browser/core/Wallet/Web.d.ts +5 -5
- package/dist/esm/browser/core/Wallet/Web.js +10 -10
- package/dist/esm/browser/core/Wallet/index.d.ts +1 -1
- package/dist/esm/browser/core/Wallet/index.js +1 -1
- package/dist/esm/browser/core/index.d.ts +1 -1
- package/dist/esm/browser/core/index.js +1 -1
- package/dist/esm/browser/index.d.ts +1 -1
- package/dist/esm/browser/index.js +1 -1
- package/dist/esm/browserIndex.d.ts +2 -2
- package/dist/esm/browserIndex.js +2 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/lib/dns/DnsRecordType.d.ts +14 -14
- package/dist/esm/lib/dns/DnsRecordType.js +15 -15
- package/dist/esm/lib/dns/DnsReturnCode.d.ts +13 -13
- package/dist/esm/lib/dns/DnsReturnCode.js +14 -14
- package/dist/esm/lib/dns/GoogleDnsResult.d.ts +16 -16
- package/dist/esm/lib/dns/GoogleDnsResult.js +1 -1
- package/dist/esm/lib/dns/GoogleDnsResultAnswer.d.ts +7 -7
- package/dist/esm/lib/dns/GoogleDnsResultAnswer.js +1 -1
- package/dist/esm/lib/dns/GoogleDnsResultQuestion.d.ts +10 -10
- package/dist/esm/lib/dns/GoogleDnsResultQuestion.js +1 -1
- package/dist/esm/lib/dns/domainExists.d.ts +7 -7
- package/dist/esm/lib/dns/domainExists.js +14 -14
- package/dist/esm/lib/dns/domainResolve.d.ts +8 -8
- package/dist/esm/lib/dns/domainResolve.js +14 -14
- package/dist/esm/lib/dns/googleDnsOverHttps.d.ts +4 -4
- package/dist/esm/lib/dns/googleDnsOverHttps.js +6 -6
- package/dist/esm/lib/dns/index.d.ts +8 -8
- package/dist/esm/lib/dns/index.js +8 -8
- package/dist/esm/lib/dumpErrors.d.ts +2 -2
- package/dist/esm/lib/dumpErrors.js +6 -6
- package/dist/esm/lib/exists.d.ts +1 -1
- package/dist/esm/lib/exists.js +3 -3
- package/dist/esm/lib/index.d.ts +4 -4
- package/dist/esm/lib/index.js +4 -4
- package/dist/esm/lib/isBrowser.d.ts +1 -1
- package/dist/esm/lib/isBrowser.js +3 -3
- package/dist/esm/lib/isXyoPayloadOfSchemaType.d.ts +6 -6
- package/dist/esm/lib/isXyoPayloadOfSchemaType.js +5 -5
- package/dist/esm/lib/typeOf/TypeOfTypes.d.ts +1 -1
- package/dist/esm/lib/typeOf/TypeOfTypes.js +1 -1
- package/dist/esm/lib/typeOf/ifDefined.d.ts +1 -1
- package/dist/esm/lib/typeOf/ifDefined.js +11 -11
- package/dist/esm/lib/typeOf/ifTypeOf.d.ts +2 -2
- package/dist/esm/lib/typeOf/ifTypeOf.js +7 -7
- package/dist/esm/lib/typeOf/index.d.ts +5 -5
- package/dist/esm/lib/typeOf/index.js +5 -5
- package/dist/esm/lib/typeOf/typeOf.d.ts +2 -2
- package/dist/esm/lib/typeOf/typeOf.js +3 -3
- package/dist/esm/lib/typeOf/validateType.d.ts +2 -2
- package/dist/esm/lib/typeOf/validateType.js +13 -13
- package/dist/esm/models/WithStringIndex.d.ts +1 -1
- package/dist/esm/models/WithStringIndex.js +1 -1
- package/dist/esm/models/index.d.ts +1 -1
- package/dist/esm/models/index.js +1 -1
- package/dist/esm/nodeIndex.d.ts +1 -1
- package/dist/esm/nodeIndex.js +1 -1
- package/dist/esm/shared.d.ts +11 -11
- package/dist/esm/shared.js +11 -11
- package/package.json +1 -1
package/dist/esm/Huri/Huri.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { assertEx } from '@xylabs/sdk-js';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
export class Huri {
|
|
4
|
-
constructor(huri, { archivistUri } = {}) {
|
|
5
|
-
this.originalHref = huri;
|
|
6
|
-
const protocol = Huri.parseProtocol(huri);
|
|
7
|
-
this.protocol = protocol ?? 'https';
|
|
8
|
-
const path = assertEx(Huri.parsePath(huri), 'Missing path');
|
|
9
|
-
this.hash = this.parsePath(path, protocol !== undefined);
|
|
10
|
-
//if archivistUri sent, overwrite protocol and archivist
|
|
11
|
-
if (archivistUri) {
|
|
12
|
-
const archivistUriParts = archivistUri.split('://');
|
|
13
|
-
this.protocol = archivistUriParts[0];
|
|
14
|
-
this.archivist = archivistUriParts[1];
|
|
15
|
-
}
|
|
16
|
-
this.validateParse();
|
|
17
|
-
}
|
|
18
|
-
parsePath(path, hasProtocol) {
|
|
19
|
-
const pathParts = path.split('/');
|
|
20
|
-
//if the protocal was found, then there is not allowed to be a leading /
|
|
21
|
-
assertEx(!(hasProtocol && pathParts[0].length === 0), 'Invalid protocol seperator');
|
|
22
|
-
//remove leading '/' if needed
|
|
23
|
-
pathParts[0].length === 0 ? pathParts.shift() : null;
|
|
24
|
-
//hash is assumed to be the last part
|
|
25
|
-
const hash = assertEx(pathParts.pop(), 'No hash specified');
|
|
26
|
-
//archivist is assumed to be the first part
|
|
27
|
-
this.archivist = pathParts.shift() ?? 'api.archivist.xyo.network';
|
|
28
|
-
//the archive is whatever is left
|
|
29
|
-
this.archive = pathParts.pop();
|
|
30
|
-
//after we pull off all the path parts, there should be nothing left
|
|
31
|
-
assertEx(pathParts.length === 0, 'Too many path parts');
|
|
32
|
-
return hash;
|
|
33
|
-
}
|
|
34
|
-
validateParse() {
|
|
35
|
-
//the archivist should not be zero length
|
|
36
|
-
assertEx(this.archivist?.length !== 0, 'Invalid archivist length');
|
|
37
|
-
//the archivist should not be zero length (can be undefined)
|
|
38
|
-
assertEx(this.archive?.length !== 0, 'Invalid archive length');
|
|
39
|
-
//the archive should not be set if the archivist is not set
|
|
40
|
-
assertEx(!(this.archive && !this.archivist), 'If specifying archive, archivist is also required');
|
|
41
|
-
}
|
|
42
|
-
/*
|
|
43
|
-
The full href or the hash
|
|
44
|
-
*/
|
|
45
|
-
get href() {
|
|
46
|
-
const parts = [];
|
|
47
|
-
if (this.protocol) {
|
|
48
|
-
parts.push(`${this.protocol}:/`);
|
|
49
|
-
}
|
|
50
|
-
if (this.archive) {
|
|
51
|
-
parts.push(`${this.archive}`);
|
|
52
|
-
}
|
|
53
|
-
if (this.archivist) {
|
|
54
|
-
parts.push(`${this.archivist}`);
|
|
55
|
-
}
|
|
56
|
-
parts.push(this.hash);
|
|
57
|
-
return parts.join('/');
|
|
58
|
-
}
|
|
59
|
-
toString() {
|
|
60
|
-
return this.href;
|
|
61
|
-
}
|
|
62
|
-
async fetch() {
|
|
63
|
-
return await Huri.fetch(this);
|
|
64
|
-
}
|
|
65
|
-
static async fetch(huri) {
|
|
66
|
-
return (await axios.get(huri.href)).data;
|
|
67
|
-
}
|
|
68
|
-
static parseProtocol(huri) {
|
|
69
|
-
const protocolSplit = huri.split('//');
|
|
70
|
-
assertEx(protocolSplit.length <= 2, `Invalid second protocol [${protocolSplit[2]}]`);
|
|
71
|
-
const rawProtocol = protocolSplit.length === 2 ? protocolSplit.shift() : undefined;
|
|
72
|
-
if (rawProtocol) {
|
|
73
|
-
const protocolParts = rawProtocol?.split(':');
|
|
74
|
-
assertEx(protocolParts.length === 2, `Invalid protocol format [${rawProtocol}]`);
|
|
75
|
-
assertEx(protocolParts[1].length === 0, `Invalid protocol format (post :) [${rawProtocol}]`);
|
|
76
|
-
return protocolParts.shift();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
static parsePath(huri) {
|
|
80
|
-
const protocolSplit = huri.split('//');
|
|
81
|
-
assertEx(protocolSplit.length <= 2, `Invalid format [${huri}]`);
|
|
82
|
-
if (protocolSplit.length === 1) {
|
|
83
|
-
return huri;
|
|
84
|
-
}
|
|
85
|
-
if (protocolSplit.length === 2) {
|
|
86
|
-
return protocolSplit[1];
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
1
|
+
import { assertEx } from '@xylabs/sdk-js';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
export class Huri {
|
|
4
|
+
constructor(huri, { archivistUri } = {}) {
|
|
5
|
+
this.originalHref = huri;
|
|
6
|
+
const protocol = Huri.parseProtocol(huri);
|
|
7
|
+
this.protocol = protocol ?? 'https';
|
|
8
|
+
const path = assertEx(Huri.parsePath(huri), 'Missing path');
|
|
9
|
+
this.hash = this.parsePath(path, protocol !== undefined);
|
|
10
|
+
//if archivistUri sent, overwrite protocol and archivist
|
|
11
|
+
if (archivistUri) {
|
|
12
|
+
const archivistUriParts = archivistUri.split('://');
|
|
13
|
+
this.protocol = archivistUriParts[0];
|
|
14
|
+
this.archivist = archivistUriParts[1];
|
|
15
|
+
}
|
|
16
|
+
this.validateParse();
|
|
17
|
+
}
|
|
18
|
+
parsePath(path, hasProtocol) {
|
|
19
|
+
const pathParts = path.split('/');
|
|
20
|
+
//if the protocal was found, then there is not allowed to be a leading /
|
|
21
|
+
assertEx(!(hasProtocol && pathParts[0].length === 0), 'Invalid protocol seperator');
|
|
22
|
+
//remove leading '/' if needed
|
|
23
|
+
pathParts[0].length === 0 ? pathParts.shift() : null;
|
|
24
|
+
//hash is assumed to be the last part
|
|
25
|
+
const hash = assertEx(pathParts.pop(), 'No hash specified');
|
|
26
|
+
//archivist is assumed to be the first part
|
|
27
|
+
this.archivist = pathParts.shift() ?? 'api.archivist.xyo.network';
|
|
28
|
+
//the archive is whatever is left
|
|
29
|
+
this.archive = pathParts.pop();
|
|
30
|
+
//after we pull off all the path parts, there should be nothing left
|
|
31
|
+
assertEx(pathParts.length === 0, 'Too many path parts');
|
|
32
|
+
return hash;
|
|
33
|
+
}
|
|
34
|
+
validateParse() {
|
|
35
|
+
//the archivist should not be zero length
|
|
36
|
+
assertEx(this.archivist?.length !== 0, 'Invalid archivist length');
|
|
37
|
+
//the archivist should not be zero length (can be undefined)
|
|
38
|
+
assertEx(this.archive?.length !== 0, 'Invalid archive length');
|
|
39
|
+
//the archive should not be set if the archivist is not set
|
|
40
|
+
assertEx(!(this.archive && !this.archivist), 'If specifying archive, archivist is also required');
|
|
41
|
+
}
|
|
42
|
+
/*
|
|
43
|
+
The full href or the hash
|
|
44
|
+
*/
|
|
45
|
+
get href() {
|
|
46
|
+
const parts = [];
|
|
47
|
+
if (this.protocol) {
|
|
48
|
+
parts.push(`${this.protocol}:/`);
|
|
49
|
+
}
|
|
50
|
+
if (this.archive) {
|
|
51
|
+
parts.push(`${this.archive}`);
|
|
52
|
+
}
|
|
53
|
+
if (this.archivist) {
|
|
54
|
+
parts.push(`${this.archivist}`);
|
|
55
|
+
}
|
|
56
|
+
parts.push(this.hash);
|
|
57
|
+
return parts.join('/');
|
|
58
|
+
}
|
|
59
|
+
toString() {
|
|
60
|
+
return this.href;
|
|
61
|
+
}
|
|
62
|
+
async fetch() {
|
|
63
|
+
return await Huri.fetch(this);
|
|
64
|
+
}
|
|
65
|
+
static async fetch(huri) {
|
|
66
|
+
return (await axios.get(huri.href)).data;
|
|
67
|
+
}
|
|
68
|
+
static parseProtocol(huri) {
|
|
69
|
+
const protocolSplit = huri.split('//');
|
|
70
|
+
assertEx(protocolSplit.length <= 2, `Invalid second protocol [${protocolSplit[2]}]`);
|
|
71
|
+
const rawProtocol = protocolSplit.length === 2 ? protocolSplit.shift() : undefined;
|
|
72
|
+
if (rawProtocol) {
|
|
73
|
+
const protocolParts = rawProtocol?.split(':');
|
|
74
|
+
assertEx(protocolParts.length === 2, `Invalid protocol format [${rawProtocol}]`);
|
|
75
|
+
assertEx(protocolParts[1].length === 0, `Invalid protocol format (post :) [${rawProtocol}]`);
|
|
76
|
+
return protocolParts.shift();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
static parsePath(huri) {
|
|
80
|
+
const protocolSplit = huri.split('//');
|
|
81
|
+
assertEx(protocolSplit.length <= 2, `Invalid format [${huri}]`);
|
|
82
|
+
if (protocolSplit.length === 1) {
|
|
83
|
+
return huri;
|
|
84
|
+
}
|
|
85
|
+
if (protocolSplit.length === 2) {
|
|
86
|
+
return protocolSplit[1];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
90
|
//# sourceMappingURL=Huri.js.map
|
package/dist/esm/Huri/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Huri';
|
|
1
|
+
export * from './Huri';
|
package/dist/esm/Huri/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Huri';
|
|
1
|
+
export * from './Huri';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { XyoPayload } from '../models';
|
|
2
|
-
export interface XyoPayloadBuilderOptions {
|
|
3
|
-
schema: string;
|
|
4
|
-
}
|
|
5
|
-
export declare class XyoPayloadBuilder<T extends XyoPayload> {
|
|
6
|
-
private _fields;
|
|
7
|
-
private _previousHash?;
|
|
8
|
-
private _schema;
|
|
9
|
-
constructor({ schema }: XyoPayloadBuilderOptions);
|
|
10
|
-
fields(fields?: Partial<T>): this;
|
|
11
|
-
previousHash(hash?: string): this;
|
|
12
|
-
hashableFields(): T;
|
|
13
|
-
build(): T;
|
|
14
|
-
}
|
|
1
|
+
import { XyoPayload } from '../models';
|
|
2
|
+
export interface XyoPayloadBuilderOptions {
|
|
3
|
+
schema: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class XyoPayloadBuilder<T extends XyoPayload> {
|
|
6
|
+
private _fields;
|
|
7
|
+
private _previousHash?;
|
|
8
|
+
private _schema;
|
|
9
|
+
constructor({ schema }: XyoPayloadBuilderOptions);
|
|
10
|
+
fields(fields?: Partial<T>): this;
|
|
11
|
+
previousHash(hash?: string): this;
|
|
12
|
+
hashableFields(): T;
|
|
13
|
+
build(): T;
|
|
14
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { deepOmitUnderscoreFields, removeEmptyFields, XyoHasher } from '../../Hasher';
|
|
2
|
-
export class XyoPayloadBuilder {
|
|
3
|
-
constructor({ schema }) {
|
|
4
|
-
this._fields = {};
|
|
5
|
-
this._schema = schema;
|
|
6
|
-
}
|
|
7
|
-
fields(fields) {
|
|
8
|
-
if (fields) {
|
|
9
|
-
this._fields = { ...this._fields, ...removeEmptyFields(fields) };
|
|
10
|
-
}
|
|
11
|
-
return this;
|
|
12
|
-
}
|
|
13
|
-
previousHash(hash) {
|
|
14
|
-
this._previousHash = hash;
|
|
15
|
-
return this;
|
|
16
|
-
}
|
|
17
|
-
hashableFields() {
|
|
18
|
-
return {
|
|
19
|
-
...removeEmptyFields(deepOmitUnderscoreFields({ ...this._fields, previousHash: this._previousHash })),
|
|
20
|
-
schema: this._schema,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
build() {
|
|
24
|
-
const hashableFields = this.hashableFields();
|
|
25
|
-
const _hash = new XyoHasher(hashableFields).hash;
|
|
26
|
-
const _timestamp = Date.now();
|
|
27
|
-
return { ...hashableFields, _client: 'js', _hash, _timestamp, schema: this._schema };
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
import { deepOmitUnderscoreFields, removeEmptyFields, XyoHasher } from '../../Hasher';
|
|
2
|
+
export class XyoPayloadBuilder {
|
|
3
|
+
constructor({ schema }) {
|
|
4
|
+
this._fields = {};
|
|
5
|
+
this._schema = schema;
|
|
6
|
+
}
|
|
7
|
+
fields(fields) {
|
|
8
|
+
if (fields) {
|
|
9
|
+
this._fields = { ...this._fields, ...removeEmptyFields(fields) };
|
|
10
|
+
}
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
previousHash(hash) {
|
|
14
|
+
this._previousHash = hash;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
hashableFields() {
|
|
18
|
+
return {
|
|
19
|
+
...removeEmptyFields(deepOmitUnderscoreFields({ ...this._fields, previousHash: this._previousHash })),
|
|
20
|
+
schema: this._schema,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
build() {
|
|
24
|
+
const hashableFields = this.hashableFields();
|
|
25
|
+
const _hash = new XyoHasher(hashableFields).hash;
|
|
26
|
+
const _timestamp = Date.now();
|
|
27
|
+
return { ...hashableFields, _client: 'js', _hash, _timestamp, schema: this._schema };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
30
|
//# sourceMappingURL=Builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Builder';
|
|
1
|
+
export * from './Builder';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Builder';
|
|
1
|
+
export * from './Builder';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { XyoSchemaNameValidator } from '../../SchemaNameValidator';
|
|
2
|
-
import { XyoPayloadBody } from '../models';
|
|
3
|
-
declare class XyoPayloadBodyValidator {
|
|
4
|
-
private body;
|
|
5
|
-
constructor(body: XyoPayloadBody);
|
|
6
|
-
private _schemaValidator?;
|
|
7
|
-
get schemaValidator(): XyoSchemaNameValidator;
|
|
8
|
-
schemaName(): Error[];
|
|
9
|
-
all(): Error[];
|
|
10
|
-
}
|
|
11
|
-
export { XyoPayloadBodyValidator };
|
|
1
|
+
import { XyoSchemaNameValidator } from '../../SchemaNameValidator';
|
|
2
|
+
import { XyoPayloadBody } from '../models';
|
|
3
|
+
declare class XyoPayloadBodyValidator {
|
|
4
|
+
private body;
|
|
5
|
+
constructor(body: XyoPayloadBody);
|
|
6
|
+
private _schemaValidator?;
|
|
7
|
+
get schemaValidator(): XyoSchemaNameValidator;
|
|
8
|
+
schemaName(): Error[];
|
|
9
|
+
all(): Error[];
|
|
10
|
+
}
|
|
11
|
+
export { XyoPayloadBodyValidator };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { XyoSchemaNameValidator } from '../../SchemaNameValidator';
|
|
2
|
-
class XyoPayloadBodyValidator {
|
|
3
|
-
constructor(body) {
|
|
4
|
-
this.body = body;
|
|
5
|
-
}
|
|
6
|
-
get schemaValidator() {
|
|
7
|
-
this._schemaValidator = this._schemaValidator ?? new XyoSchemaNameValidator(this.body.schema ?? '');
|
|
8
|
-
return this._schemaValidator;
|
|
9
|
-
}
|
|
10
|
-
schemaName() {
|
|
11
|
-
const errors = [];
|
|
12
|
-
if (this.body.schema === undefined) {
|
|
13
|
-
errors.push(Error('schema missing'));
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
errors.push(...this.schemaValidator.all());
|
|
17
|
-
}
|
|
18
|
-
return errors;
|
|
19
|
-
}
|
|
20
|
-
all() {
|
|
21
|
-
const errors = [];
|
|
22
|
-
errors.push(...this.schemaName());
|
|
23
|
-
return errors;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export { XyoPayloadBodyValidator };
|
|
1
|
+
import { XyoSchemaNameValidator } from '../../SchemaNameValidator';
|
|
2
|
+
class XyoPayloadBodyValidator {
|
|
3
|
+
constructor(body) {
|
|
4
|
+
this.body = body;
|
|
5
|
+
}
|
|
6
|
+
get schemaValidator() {
|
|
7
|
+
this._schemaValidator = this._schemaValidator ?? new XyoSchemaNameValidator(this.body.schema ?? '');
|
|
8
|
+
return this._schemaValidator;
|
|
9
|
+
}
|
|
10
|
+
schemaName() {
|
|
11
|
+
const errors = [];
|
|
12
|
+
if (this.body.schema === undefined) {
|
|
13
|
+
errors.push(Error('schema missing'));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
errors.push(...this.schemaValidator.all());
|
|
17
|
+
}
|
|
18
|
+
return errors;
|
|
19
|
+
}
|
|
20
|
+
all() {
|
|
21
|
+
const errors = [];
|
|
22
|
+
errors.push(...this.schemaName());
|
|
23
|
+
return errors;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export { XyoPayloadBodyValidator };
|
|
27
27
|
//# sourceMappingURL=BodyValidator.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { XyoPayload } from '../models';
|
|
2
|
-
declare class XyoPayloadMetaValidator {
|
|
3
|
-
private payload;
|
|
4
|
-
constructor(payload: XyoPayload);
|
|
5
|
-
hash(): Error[];
|
|
6
|
-
timestamp(): Error[];
|
|
7
|
-
all(): Error[];
|
|
8
|
-
}
|
|
9
|
-
export { XyoPayloadMetaValidator };
|
|
1
|
+
import { XyoPayload } from '../models';
|
|
2
|
+
declare class XyoPayloadMetaValidator {
|
|
3
|
+
private payload;
|
|
4
|
+
constructor(payload: XyoPayload);
|
|
5
|
+
hash(): Error[];
|
|
6
|
+
timestamp(): Error[];
|
|
7
|
+
all(): Error[];
|
|
8
|
+
}
|
|
9
|
+
export { XyoPayloadMetaValidator };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { XyoHasher } from '../../Hasher';
|
|
2
|
-
const MIN_ALLOWED_TIMESTAMP = 1609459200000;
|
|
3
|
-
const MAX_ALLOWED_TIMESTAMP = 4102444800000;
|
|
4
|
-
class XyoPayloadMetaValidator {
|
|
5
|
-
constructor(payload) {
|
|
6
|
-
this.payload = payload;
|
|
7
|
-
}
|
|
8
|
-
hash() {
|
|
9
|
-
const errors = [];
|
|
10
|
-
const wrapper = new XyoHasher(this.payload);
|
|
11
|
-
const bodyHash = wrapper.hash;
|
|
12
|
-
if (bodyHash !== this.payload._hash)
|
|
13
|
-
errors.push(new Error(`Body hash mismatch: [calculated: ${bodyHash}] [found: ${this.payload._hash}]`));
|
|
14
|
-
return errors;
|
|
15
|
-
}
|
|
16
|
-
timestamp() {
|
|
17
|
-
const errors = [];
|
|
18
|
-
const { _timestamp } = this.payload;
|
|
19
|
-
if (_timestamp === undefined)
|
|
20
|
-
errors.push(new Error('Missing _timestamp'));
|
|
21
|
-
else if (_timestamp < MIN_ALLOWED_TIMESTAMP)
|
|
22
|
-
errors.push(new Error('_timestamp is before year 2021'));
|
|
23
|
-
else if (_timestamp > MAX_ALLOWED_TIMESTAMP)
|
|
24
|
-
errors.push(new Error('_timestamp is after year 2100'));
|
|
25
|
-
return errors;
|
|
26
|
-
}
|
|
27
|
-
all() {
|
|
28
|
-
const errors = [];
|
|
29
|
-
errors.push(...this.hash(), ...this.timestamp());
|
|
30
|
-
return errors;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export { XyoPayloadMetaValidator };
|
|
1
|
+
import { XyoHasher } from '../../Hasher';
|
|
2
|
+
const MIN_ALLOWED_TIMESTAMP = 1609459200000;
|
|
3
|
+
const MAX_ALLOWED_TIMESTAMP = 4102444800000;
|
|
4
|
+
class XyoPayloadMetaValidator {
|
|
5
|
+
constructor(payload) {
|
|
6
|
+
this.payload = payload;
|
|
7
|
+
}
|
|
8
|
+
hash() {
|
|
9
|
+
const errors = [];
|
|
10
|
+
const wrapper = new XyoHasher(this.payload);
|
|
11
|
+
const bodyHash = wrapper.hash;
|
|
12
|
+
if (bodyHash !== this.payload._hash)
|
|
13
|
+
errors.push(new Error(`Body hash mismatch: [calculated: ${bodyHash}] [found: ${this.payload._hash}]`));
|
|
14
|
+
return errors;
|
|
15
|
+
}
|
|
16
|
+
timestamp() {
|
|
17
|
+
const errors = [];
|
|
18
|
+
const { _timestamp } = this.payload;
|
|
19
|
+
if (_timestamp === undefined)
|
|
20
|
+
errors.push(new Error('Missing _timestamp'));
|
|
21
|
+
else if (_timestamp < MIN_ALLOWED_TIMESTAMP)
|
|
22
|
+
errors.push(new Error('_timestamp is before year 2021'));
|
|
23
|
+
else if (_timestamp > MAX_ALLOWED_TIMESTAMP)
|
|
24
|
+
errors.push(new Error('_timestamp is after year 2100'));
|
|
25
|
+
return errors;
|
|
26
|
+
}
|
|
27
|
+
all() {
|
|
28
|
+
const errors = [];
|
|
29
|
+
errors.push(...this.hash(), ...this.timestamp());
|
|
30
|
+
return errors;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export { XyoPayloadMetaValidator };
|
|
34
34
|
//# sourceMappingURL=MetaValidator.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { XyoPayload } from '../models';
|
|
2
|
-
import { XyoPayloadBodyValidator } from './BodyValidator';
|
|
3
|
-
import { XyoPayloadMetaValidator } from './MetaValidator';
|
|
4
|
-
declare class XyoPayloadValidator<T extends XyoPayload = XyoPayload> {
|
|
5
|
-
protected payload: T;
|
|
6
|
-
body: XyoPayloadBodyValidator;
|
|
7
|
-
meta: XyoPayloadMetaValidator;
|
|
8
|
-
constructor(payload: T);
|
|
9
|
-
all(): Error[];
|
|
10
|
-
}
|
|
11
|
-
export { XyoPayloadValidator };
|
|
1
|
+
import { XyoPayload } from '../models';
|
|
2
|
+
import { XyoPayloadBodyValidator } from './BodyValidator';
|
|
3
|
+
import { XyoPayloadMetaValidator } from './MetaValidator';
|
|
4
|
+
declare class XyoPayloadValidator<T extends XyoPayload = XyoPayload> {
|
|
5
|
+
protected payload: T;
|
|
6
|
+
body: XyoPayloadBodyValidator;
|
|
7
|
+
meta: XyoPayloadMetaValidator;
|
|
8
|
+
constructor(payload: T);
|
|
9
|
+
all(): Error[];
|
|
10
|
+
}
|
|
11
|
+
export { XyoPayloadValidator };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { XyoPayloadBodyValidator } from './BodyValidator';
|
|
2
|
-
import { XyoPayloadMetaValidator } from './MetaValidator';
|
|
3
|
-
class XyoPayloadValidator {
|
|
4
|
-
constructor(payload) {
|
|
5
|
-
this.payload = payload;
|
|
6
|
-
this.body = new XyoPayloadBodyValidator(payload);
|
|
7
|
-
this.meta = new XyoPayloadMetaValidator(payload);
|
|
8
|
-
}
|
|
9
|
-
all() {
|
|
10
|
-
const errors = [];
|
|
11
|
-
errors.push(...this.body.all());
|
|
12
|
-
return errors;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export { XyoPayloadValidator };
|
|
1
|
+
import { XyoPayloadBodyValidator } from './BodyValidator';
|
|
2
|
+
import { XyoPayloadMetaValidator } from './MetaValidator';
|
|
3
|
+
class XyoPayloadValidator {
|
|
4
|
+
constructor(payload) {
|
|
5
|
+
this.payload = payload;
|
|
6
|
+
this.body = new XyoPayloadBodyValidator(payload);
|
|
7
|
+
this.meta = new XyoPayloadMetaValidator(payload);
|
|
8
|
+
}
|
|
9
|
+
all() {
|
|
10
|
+
const errors = [];
|
|
11
|
+
errors.push(...this.body.all());
|
|
12
|
+
return errors;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export { XyoPayloadValidator };
|
|
16
16
|
//# sourceMappingURL=Validator.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './BodyValidator';
|
|
2
|
-
export * from './MetaValidator';
|
|
3
|
-
export * from './Validator';
|
|
1
|
+
export * from './BodyValidator';
|
|
2
|
+
export * from './MetaValidator';
|
|
3
|
+
export * from './Validator';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './BodyValidator';
|
|
2
|
-
export * from './MetaValidator';
|
|
3
|
-
export * from './Validator';
|
|
1
|
+
export * from './BodyValidator';
|
|
2
|
+
export * from './MetaValidator';
|
|
3
|
+
export * from './Validator';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { XyoPayload } from '../models';
|
|
2
|
-
import { XyoPayloadValidator } from '../Validator';
|
|
3
|
-
import { XyoPayloadWrapper } from './Wrapper';
|
|
4
|
-
export declare class XyoPayloadWrapperValidator<T extends XyoPayloadWrapper<XyoPayload> = XyoPayloadWrapper<XyoPayload>> {
|
|
5
|
-
protected wrapper: T;
|
|
6
|
-
constructor(wrapper: T);
|
|
7
|
-
get payload(): XyoPayloadValidator<import("../models").XyoPayloadFull>;
|
|
8
|
-
all(): Error[];
|
|
9
|
-
}
|
|
1
|
+
import { XyoPayload } from '../models';
|
|
2
|
+
import { XyoPayloadValidator } from '../Validator';
|
|
3
|
+
import { XyoPayloadWrapper } from './Wrapper';
|
|
4
|
+
export declare class XyoPayloadWrapperValidator<T extends XyoPayloadWrapper<XyoPayload> = XyoPayloadWrapper<XyoPayload>> {
|
|
5
|
+
protected wrapper: T;
|
|
6
|
+
constructor(wrapper: T);
|
|
7
|
+
get payload(): XyoPayloadValidator<import("../models").XyoPayloadFull>;
|
|
8
|
+
all(): Error[];
|
|
9
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { XyoPayloadValidator } from '../Validator';
|
|
2
|
-
export class XyoPayloadWrapperValidator {
|
|
3
|
-
constructor(wrapper) {
|
|
4
|
-
this.wrapper = wrapper;
|
|
5
|
-
}
|
|
6
|
-
get payload() {
|
|
7
|
-
return new XyoPayloadValidator(this.wrapper.payload);
|
|
8
|
-
}
|
|
9
|
-
all() {
|
|
10
|
-
const errors = [];
|
|
11
|
-
errors.push(...this.payload.all());
|
|
12
|
-
return errors;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
import { XyoPayloadValidator } from '../Validator';
|
|
2
|
+
export class XyoPayloadWrapperValidator {
|
|
3
|
+
constructor(wrapper) {
|
|
4
|
+
this.wrapper = wrapper;
|
|
5
|
+
}
|
|
6
|
+
get payload() {
|
|
7
|
+
return new XyoPayloadValidator(this.wrapper.payload);
|
|
8
|
+
}
|
|
9
|
+
all() {
|
|
10
|
+
const errors = [];
|
|
11
|
+
errors.push(...this.payload.all());
|
|
12
|
+
return errors;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=Validator.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { XyoAbstractHasher } from '../../Hasher';
|
|
2
|
-
import { XyoPayload } from '../models';
|
|
3
|
-
export declare class XyoPayloadWrapper<T extends XyoPayload> extends XyoAbstractHasher<T> {
|
|
4
|
-
payload: T;
|
|
5
|
-
constructor(payload: T);
|
|
6
|
-
protected get obj(): T;
|
|
7
|
-
get body(): T;
|
|
8
|
-
get meta(): T;
|
|
9
|
-
}
|
|
1
|
+
import { XyoAbstractHasher } from '../../Hasher';
|
|
2
|
+
import { XyoPayload } from '../models';
|
|
3
|
+
export declare class XyoPayloadWrapper<T extends XyoPayload> extends XyoAbstractHasher<T> {
|
|
4
|
+
payload: T;
|
|
5
|
+
constructor(payload: T);
|
|
6
|
+
protected get obj(): T;
|
|
7
|
+
get body(): T;
|
|
8
|
+
get meta(): T;
|
|
9
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { deepOmitUnderscoreFields, deepPickUnderscoreFields, XyoAbstractHasher } from '../../Hasher';
|
|
2
|
-
export class XyoPayloadWrapper extends XyoAbstractHasher {
|
|
3
|
-
constructor(payload) {
|
|
4
|
-
super();
|
|
5
|
-
this.payload = payload;
|
|
6
|
-
}
|
|
7
|
-
get obj() {
|
|
8
|
-
return this.payload;
|
|
9
|
-
}
|
|
10
|
-
get body() {
|
|
11
|
-
return deepOmitUnderscoreFields(this.payload);
|
|
12
|
-
}
|
|
13
|
-
get meta() {
|
|
14
|
-
return deepPickUnderscoreFields(this.payload);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
import { deepOmitUnderscoreFields, deepPickUnderscoreFields, XyoAbstractHasher } from '../../Hasher';
|
|
2
|
+
export class XyoPayloadWrapper extends XyoAbstractHasher {
|
|
3
|
+
constructor(payload) {
|
|
4
|
+
super();
|
|
5
|
+
this.payload = payload;
|
|
6
|
+
}
|
|
7
|
+
get obj() {
|
|
8
|
+
return this.payload;
|
|
9
|
+
}
|
|
10
|
+
get body() {
|
|
11
|
+
return deepOmitUnderscoreFields(this.payload);
|
|
12
|
+
}
|
|
13
|
+
get meta() {
|
|
14
|
+
return deepPickUnderscoreFields(this.payload);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
17
|
//# sourceMappingURL=Wrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Validator';
|
|
2
|
-
export * from './Wrapper';
|
|
1
|
+
export * from './Validator';
|
|
2
|
+
export * from './Wrapper';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Validator';
|
|
2
|
-
export * from './Wrapper';
|
|
1
|
+
export * from './Validator';
|
|
2
|
+
export * from './Wrapper';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|