@keetanetwork/anchor 0.0.13 → 0.0.14
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/lib/certificates.d.ts +83 -21
- package/lib/certificates.d.ts.map +1 -1
- package/lib/certificates.generated.d.ts +3 -0
- package/lib/certificates.generated.d.ts.map +1 -0
- package/lib/certificates.generated.js +120 -0
- package/lib/certificates.generated.js.map +1 -0
- package/lib/certificates.js +579 -117
- package/lib/certificates.js.map +1 -1
- package/lib/http-server.d.ts +2 -1
- package/lib/http-server.d.ts.map +1 -1
- package/lib/http-server.js +4 -4
- package/lib/http-server.js.map +1 -1
- package/lib/resolver.d.ts +2 -1
- package/lib/resolver.d.ts.map +1 -1
- package/lib/resolver.js.map +1 -1
- package/lib/utils/asn1.d.ts +2 -1
- package/lib/utils/asn1.d.ts.map +1 -1
- package/lib/utils/asn1.js.map +1 -1
- package/lib/utils/buffer.d.ts +3 -0
- package/lib/utils/buffer.d.ts.map +1 -1
- package/lib/utils/buffer.js +26 -0
- package/lib/utils/buffer.js.map +1 -1
- package/lib/utils/guards.d.ts +14 -0
- package/lib/utils/guards.d.ts.map +1 -0
- package/lib/utils/guards.js +31 -0
- package/lib/utils/guards.js.map +1 -0
- package/lib/utils/index.d.ts +3 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +3 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/oid.d.ts +7 -0
- package/lib/utils/oid.d.ts.map +1 -0
- package/lib/utils/oid.js +22 -0
- package/lib/utils/oid.js.map +1 -0
- package/lib/utils/signing.d.ts.map +1 -1
- package/lib/utils/signing.js +26 -2
- package/lib/utils/signing.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/services/fx/server.js +1 -1
- package/services/fx/server.js.map +1 -1
- package/services/kyc/client.d.ts.map +1 -1
- package/services/kyc/client.js +1 -8
- package/services/kyc/client.js.map +1 -1
- package/services/kyc/common.d.ts +39 -3
- package/services/kyc/common.d.ts.map +1 -1
- package/services/kyc/common.generated.d.ts +5 -0
- package/services/kyc/common.generated.d.ts.map +1 -0
- package/services/kyc/common.generated.js +241 -0
- package/services/kyc/common.generated.js.map +1 -0
- package/services/kyc/common.js +68 -1
- package/services/kyc/common.js.map +1 -1
- package/services/kyc/iso20022.generated.d.ts +285 -0
- package/services/kyc/iso20022.generated.d.ts.map +1 -0
- package/services/kyc/iso20022.generated.js +205 -0
- package/services/kyc/iso20022.generated.js.map +1 -0
- package/services/kyc/oids.generated.d.ts +83 -0
- package/services/kyc/oids.generated.d.ts.map +1 -0
- package/services/kyc/oids.generated.js +130 -0
- package/services/kyc/oids.generated.js.map +1 -0
- package/services/kyc/server.d.ts +141 -0
- package/services/kyc/server.d.ts.map +1 -0
- package/services/kyc/server.js +183 -0
- package/services/kyc/server.js.map +1 -0
- package/services/kyc/utils/generate-kyc-schema.d.ts +3 -0
- package/services/kyc/utils/generate-kyc-schema.d.ts.map +1 -0
- package/services/kyc/utils/generate-kyc-schema.js +1154 -0
- package/services/kyc/utils/generate-kyc-schema.js.map +1 -0
package/lib/certificates.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import * as KeetaNetClient from '@keetanetwork/keetanet-client';
|
|
2
2
|
import { Buffer } from './utils/buffer.js';
|
|
3
|
+
import type { CertificateAttributeValue } from '../services/kyc/iso20022.generated.js';
|
|
4
|
+
import { CertificateAttributeOIDDB } from '../services/kyc/iso20022.generated.js';
|
|
3
5
|
type AccountKeyAlgorithm = InstanceType<typeof KeetaNetClient.lib.Account>['keyType'];
|
|
4
6
|
/**
|
|
5
7
|
* An alias for the KeetaNetAccount type
|
|
6
8
|
*/
|
|
7
9
|
type KeetaNetAccount = ReturnType<typeof KeetaNetClient.lib.Account.fromSeed<AccountKeyAlgorithm>>;
|
|
8
|
-
declare
|
|
10
|
+
declare const KeetaNetAccount: typeof KeetaNetClient.lib.Account;
|
|
11
|
+
declare function assertCertificateAttributeNames(name: string): asserts name is CertificateAttributeNames;
|
|
12
|
+
declare class SensitiveAttribute<T = ArrayBuffer> {
|
|
9
13
|
#private;
|
|
10
|
-
constructor(account: KeetaNetAccount, data: Buffer | ArrayBuffer);
|
|
14
|
+
constructor(account: KeetaNetAccount, data: Buffer | ArrayBuffer, decoder?: (data: Buffer | ArrayBuffer) => T);
|
|
11
15
|
private decode;
|
|
12
16
|
/**
|
|
13
17
|
* Get the value of the sensitive attribute
|
|
@@ -19,17 +23,13 @@ declare class SensitiveAttribute {
|
|
|
19
23
|
* ArrayBuffer
|
|
20
24
|
*/
|
|
21
25
|
get(): Promise<ArrayBuffer>;
|
|
22
|
-
|
|
23
|
-
* Get the value of the sensitive attribute as a string after being
|
|
24
|
-
* interpreted as UTF-8 ( @see SensitiveAttribute.get for more information)
|
|
25
|
-
*/
|
|
26
|
-
getString(): Promise<string>;
|
|
26
|
+
getValue(): Promise<T>;
|
|
27
27
|
/**
|
|
28
28
|
* Generate a proof that a sensitive attribute is a given value,
|
|
29
29
|
* which can be validated by a third party using the certificate
|
|
30
30
|
* and the `validateProof` method
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
getProof(): Promise<{
|
|
33
33
|
value: string;
|
|
34
34
|
hash: {
|
|
35
35
|
salt: string;
|
|
@@ -38,19 +38,12 @@ declare class SensitiveAttribute {
|
|
|
38
38
|
/**
|
|
39
39
|
* Validate the proof that a sensitive attribute is a given value
|
|
40
40
|
*/
|
|
41
|
-
validateProof(proof: Awaited<ReturnType<this['
|
|
41
|
+
validateProof(proof: Awaited<ReturnType<this['getProof']>>): Promise<boolean>;
|
|
42
42
|
toJSON(): unknown;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Type for certificate attribute names (derived from generated OID database)
|
|
46
46
|
*/
|
|
47
|
-
declare const CertificateAttributeOIDDB: {
|
|
48
|
-
fullName: string;
|
|
49
|
-
dateOfBirth: string;
|
|
50
|
-
address: string;
|
|
51
|
-
email: string;
|
|
52
|
-
phoneNumber: string;
|
|
53
|
-
};
|
|
54
47
|
type CertificateAttributeNames = keyof typeof CertificateAttributeOIDDB;
|
|
55
48
|
type BaseCertificateBuilderParams = NonNullable<ConstructorParameters<typeof KeetaNetClient.lib.Utils.Certificate.CertificateBuilder>[0]>;
|
|
56
49
|
type CertificateBuilderParams = Required<Pick<BaseCertificateBuilderParams, 'issuer' | 'validFrom' | 'validTo' | 'serial' | 'hashLib' | 'issuerDN' | 'subjectDN' | 'isCA'> & {
|
|
@@ -60,6 +53,7 @@ type CertificateBuilderParams = Required<Pick<BaseCertificateBuilderParams, 'iss
|
|
|
60
53
|
*/
|
|
61
54
|
subject: BaseCertificateBuilderParams['subjectPublicKey'];
|
|
62
55
|
}>;
|
|
56
|
+
type CertificateAttributeInput<NAME extends CertificateAttributeNames> = CertificateAttributeValue<NAME>;
|
|
63
57
|
export declare class CertificateBuilder extends KeetaNetClient.lib.Utils.Certificate.CertificateBuilder {
|
|
64
58
|
#private;
|
|
65
59
|
/**
|
|
@@ -69,9 +63,14 @@ export declare class CertificateBuilder extends KeetaNetClient.lib.Utils.Certifi
|
|
|
69
63
|
private static mapParams;
|
|
70
64
|
constructor(params?: Partial<CertificateBuilderParams>);
|
|
71
65
|
/**
|
|
72
|
-
* Set a KYC Attribute to a given value
|
|
66
|
+
* Set a KYC Attribute to a given value.
|
|
67
|
+
* The sensitive flag is required.
|
|
68
|
+
*
|
|
69
|
+
* If an attribute is marked sensitive, the value is encoded
|
|
70
|
+
* into the certificate using a commitment scheme so that the
|
|
71
|
+
* value can be proven later without revealing it.
|
|
73
72
|
*/
|
|
74
|
-
setAttribute(name:
|
|
73
|
+
setAttribute<NAME extends CertificateAttributeNames>(name: NAME, sensitive: boolean, value: CertificateAttributeInput<NAME>): void;
|
|
75
74
|
protected addExtensions(...args: Parameters<InstanceType<typeof KeetaNetClient.lib.Utils.Certificate.CertificateBuilder>['addExtensions']>): ReturnType<InstanceType<typeof KeetaNetClient.lib.Utils.Certificate.CertificateBuilder>['addExtensions']>;
|
|
76
75
|
/**
|
|
77
76
|
* Create a Certificate object from the builder
|
|
@@ -84,13 +83,14 @@ export declare class CertificateBuilder extends KeetaNetClient.lib.Utils.Certifi
|
|
|
84
83
|
export declare class Certificate extends KeetaNetClient.lib.Utils.Certificate.Certificate {
|
|
85
84
|
private readonly subjectKey;
|
|
86
85
|
static readonly Builder: typeof CertificateBuilder;
|
|
86
|
+
static readonly SharableAttributes: typeof SharableCertificateAttributes;
|
|
87
87
|
/**
|
|
88
88
|
* User KYC Attributes
|
|
89
89
|
*/
|
|
90
90
|
readonly attributes: {
|
|
91
|
-
[name
|
|
91
|
+
[name in CertificateAttributeNames]?: {
|
|
92
92
|
sensitive: true;
|
|
93
|
-
value: SensitiveAttribute
|
|
93
|
+
value: SensitiveAttribute<CertificateAttributeValue<name>>;
|
|
94
94
|
} | {
|
|
95
95
|
sensitive: false;
|
|
96
96
|
value: ArrayBuffer;
|
|
@@ -100,7 +100,69 @@ export declare class Certificate extends KeetaNetClient.lib.Utils.Certificate.Ce
|
|
|
100
100
|
subjectKey?: KeetaNetAccount;
|
|
101
101
|
});
|
|
102
102
|
protected finalizeConstruction(): void;
|
|
103
|
+
private setPlainAttribute;
|
|
104
|
+
private setSensitiveAttribute;
|
|
105
|
+
/**
|
|
106
|
+
* Get the underlying value for an attribute.
|
|
107
|
+
*
|
|
108
|
+
* If the attribute is sensitive, this will decrypt it using the
|
|
109
|
+
* subject's private key, otherwise it will return the value.
|
|
110
|
+
*/
|
|
111
|
+
getAttributeValue<NAME extends CertificateAttributeNames>(attributeName: NAME): Promise<CertificateAttributeValue<NAME>>;
|
|
103
112
|
protected processExtension(id: string, value: ArrayBuffer): boolean;
|
|
104
113
|
}
|
|
114
|
+
export declare namespace SharableCertificateAttributesTypes {
|
|
115
|
+
type ExportOptions = {
|
|
116
|
+
format?: 'string' | 'arraybuffer';
|
|
117
|
+
};
|
|
118
|
+
type ImportOptions = {
|
|
119
|
+
principals?: Set<KeetaNetAccount> | KeetaNetAccount[] | KeetaNetAccount | null;
|
|
120
|
+
};
|
|
121
|
+
type ContentsSchema = {
|
|
122
|
+
certificate: string;
|
|
123
|
+
attributes: {
|
|
124
|
+
[name: string]: {
|
|
125
|
+
sensitive: true;
|
|
126
|
+
value: Awaited<ReturnType<SensitiveAttribute['getProof']>>;
|
|
127
|
+
} | {
|
|
128
|
+
sensitive: false;
|
|
129
|
+
value: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
type SharableCertificateAttributesExportOptions = SharableCertificateAttributesTypes.ExportOptions;
|
|
135
|
+
type SharableCertificateAttributesImportOptions = SharableCertificateAttributesTypes.ImportOptions;
|
|
136
|
+
export declare class SharableCertificateAttributes {
|
|
137
|
+
#private;
|
|
138
|
+
private container;
|
|
139
|
+
private populatedFromInit;
|
|
140
|
+
static assertCertificateAttributeName: typeof assertCertificateAttributeNames;
|
|
141
|
+
constructor(input: ArrayBuffer | string, options?: SharableCertificateAttributesImportOptions);
|
|
142
|
+
/**
|
|
143
|
+
* Create a SharableCertificateAttributes from a Certificate
|
|
144
|
+
* and a list of attribute names to include -- if no list is
|
|
145
|
+
* provided, all attributes are included.
|
|
146
|
+
*/
|
|
147
|
+
static fromCertificate(certificate: Certificate, attributeNames?: CertificateAttributeNames[]): Promise<SharableCertificateAttributes>;
|
|
148
|
+
grantAccess(principal: KeetaNetAccount): Promise<this>;
|
|
149
|
+
revokeAccess(principal: KeetaNetAccount): Promise<this>;
|
|
150
|
+
get principals(): KeetaNetAccount[];
|
|
151
|
+
getCertificate(): Promise<Certificate>;
|
|
152
|
+
getAttributeBuffer(name: string): Promise<ArrayBuffer | undefined>;
|
|
153
|
+
getAttribute<NAME extends CertificateAttributeNames>(name: NAME): Promise<CertificateAttributeValue<NAME> | undefined>;
|
|
154
|
+
getAttributeNames(includeUnknown: true): Promise<string[]>;
|
|
155
|
+
getAttributeNames(includeUnknown?: false): Promise<CertificateAttributeNames[]>;
|
|
156
|
+
export(options?: Omit<SharableCertificateAttributesExportOptions, 'format'> & {
|
|
157
|
+
format?: never;
|
|
158
|
+
}): Promise<ArrayBuffer>;
|
|
159
|
+
export(options: (Omit<SharableCertificateAttributesExportOptions, 'format'> & {
|
|
160
|
+
format: 'arraybuffer';
|
|
161
|
+
})): Promise<ArrayBuffer>;
|
|
162
|
+
export(options: Omit<SharableCertificateAttributesExportOptions, 'format'> & {
|
|
163
|
+
format: 'string';
|
|
164
|
+
}): Promise<string>;
|
|
165
|
+
export(options?: SharableCertificateAttributesExportOptions): Promise<ArrayBuffer | string>;
|
|
166
|
+
}
|
|
105
167
|
export {};
|
|
106
168
|
//# sourceMappingURL=certificates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"certificates.d.ts","sourceRoot":"","sources":["../../src/lib/certificates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"certificates.d.ts","sourceRoot":"","sources":["../../src/lib/certificates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAKhE,OAAO,EAAgD,MAAM,EAAuB,MAAM,mBAAmB,CAAC;AAG9G,OAAO,KAAK,EAA0B,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAA8D,MAAM,uCAAuC,CAAC;AAa9I,KAAK,mBAAmB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;AAEtF;;GAEG;AACH,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC;AACnG,QAAA,MAAM,eAAe,EAAE,OAAO,cAAc,CAAC,GAAG,CAAC,OAAoC,CAAC;AAoGtF,iBAAS,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,OAA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AE,CAAC,IAAI,CAAC,0CAA0C,EAAE,QAAQ,CAAC,GAAG;QAAE,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAC/H,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,0CAA0C,EAAE,QAAQ,CAAC,GAAG;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IACnH,MAAM,CAAC,OAAO,CAAC,EAAE,0CAA0C,GAAG,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC;CA8B3F"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SharableCertificateAttributesTypes } from './certificates.js';
|
|
2
|
+
export declare const assertSharableCertificateAttributesContentsSchema: (input: unknown) => SharableCertificateAttributesTypes.ContentsSchema;
|
|
3
|
+
//# sourceMappingURL=certificates.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"certificates.generated.d.ts","sourceRoot":"","sources":["../../src/lib/certificates.generated.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AAE5E,eAAO,MAAM,iDAAiD,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,kCAAkC,CAAC,cAAwF,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
|
|
2
|
+
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
3
|
+
import * as typia from 'typia';
|
|
4
|
+
export const assertSharableCertificateAttributesContentsSchema = (() => { const _io0 = input => "string" === typeof input.certificate && ("object" === typeof input.attributes && null !== input.attributes && false === Array.isArray(input.attributes) && _io1(input.attributes)); const _io1 = input => Object.keys(input).every(key => {
|
|
5
|
+
const value = input[key];
|
|
6
|
+
if (undefined === value)
|
|
7
|
+
return true;
|
|
8
|
+
return "object" === typeof value && null !== value && _iu0(value);
|
|
9
|
+
}); const _io2 = input => true === input.sensitive && ("object" === typeof input.value && null !== input.value && _io3(input.value)); const _io3 = input => "string" === typeof input.value && ("object" === typeof input.hash && null !== input.hash && _io4(input.hash)); const _io4 = input => "string" === typeof input.salt; const _io5 = input => false === input.sensitive && "string" === typeof input.value; const _iu0 = input => (() => {
|
|
10
|
+
if (false === input.sensitive)
|
|
11
|
+
return _io5(input);
|
|
12
|
+
else if (true === input.sensitive)
|
|
13
|
+
return _io2(input);
|
|
14
|
+
else
|
|
15
|
+
return false;
|
|
16
|
+
})(); const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.certificate || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
17
|
+
method: "typia.createAssert",
|
|
18
|
+
path: _path + ".certificate",
|
|
19
|
+
expected: "string",
|
|
20
|
+
value: input.certificate
|
|
21
|
+
}, _errorFactory)) && (("object" === typeof input.attributes && null !== input.attributes && false === Array.isArray(input.attributes) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
22
|
+
method: "typia.createAssert",
|
|
23
|
+
path: _path + ".attributes",
|
|
24
|
+
expected: "__type",
|
|
25
|
+
value: input.attributes
|
|
26
|
+
}, _errorFactory)) && _ao1(input.attributes, _path + ".attributes", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
27
|
+
method: "typia.createAssert",
|
|
28
|
+
path: _path + ".attributes",
|
|
29
|
+
expected: "__type",
|
|
30
|
+
value: input.attributes
|
|
31
|
+
}, _errorFactory)); const _ao1 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
|
|
32
|
+
const value = input[key];
|
|
33
|
+
if (undefined === value)
|
|
34
|
+
return true;
|
|
35
|
+
return ("object" === typeof value && null !== value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
36
|
+
method: "typia.createAssert",
|
|
37
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
38
|
+
expected: "(__type.o1 | __type.o4)",
|
|
39
|
+
value: value
|
|
40
|
+
}, _errorFactory)) && _au0(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
41
|
+
method: "typia.createAssert",
|
|
42
|
+
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
43
|
+
expected: "(__type.o1 | __type.o4)",
|
|
44
|
+
value: value
|
|
45
|
+
}, _errorFactory);
|
|
46
|
+
}); const _ao2 = (input, _path, _exceptionable = true) => (true === input.sensitive || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
47
|
+
method: "typia.createAssert",
|
|
48
|
+
path: _path + ".sensitive",
|
|
49
|
+
expected: "true",
|
|
50
|
+
value: input.sensitive
|
|
51
|
+
}, _errorFactory)) && (("object" === typeof input.value && null !== input.value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
52
|
+
method: "typia.createAssert",
|
|
53
|
+
path: _path + ".value",
|
|
54
|
+
expected: "__type.o2",
|
|
55
|
+
value: input.value
|
|
56
|
+
}, _errorFactory)) && _ao3(input.value, _path + ".value", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
57
|
+
method: "typia.createAssert",
|
|
58
|
+
path: _path + ".value",
|
|
59
|
+
expected: "__type.o2",
|
|
60
|
+
value: input.value
|
|
61
|
+
}, _errorFactory)); const _ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
62
|
+
method: "typia.createAssert",
|
|
63
|
+
path: _path + ".value",
|
|
64
|
+
expected: "string",
|
|
65
|
+
value: input.value
|
|
66
|
+
}, _errorFactory)) && (("object" === typeof input.hash && null !== input.hash || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
67
|
+
method: "typia.createAssert",
|
|
68
|
+
path: _path + ".hash",
|
|
69
|
+
expected: "__type.o3",
|
|
70
|
+
value: input.hash
|
|
71
|
+
}, _errorFactory)) && _ao4(input.hash, _path + ".hash", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
72
|
+
method: "typia.createAssert",
|
|
73
|
+
path: _path + ".hash",
|
|
74
|
+
expected: "__type.o3",
|
|
75
|
+
value: input.hash
|
|
76
|
+
}, _errorFactory)); const _ao4 = (input, _path, _exceptionable = true) => "string" === typeof input.salt || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
77
|
+
method: "typia.createAssert",
|
|
78
|
+
path: _path + ".salt",
|
|
79
|
+
expected: "string",
|
|
80
|
+
value: input.salt
|
|
81
|
+
}, _errorFactory); const _ao5 = (input, _path, _exceptionable = true) => (false === input.sensitive || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
82
|
+
method: "typia.createAssert",
|
|
83
|
+
path: _path + ".sensitive",
|
|
84
|
+
expected: "false",
|
|
85
|
+
value: input.sensitive
|
|
86
|
+
}, _errorFactory)) && ("string" === typeof input.value || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
87
|
+
method: "typia.createAssert",
|
|
88
|
+
path: _path + ".value",
|
|
89
|
+
expected: "string",
|
|
90
|
+
value: input.value
|
|
91
|
+
}, _errorFactory)); const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
92
|
+
if (false === input.sensitive)
|
|
93
|
+
return _ao5(input, _path, true && _exceptionable);
|
|
94
|
+
else if (true === input.sensitive)
|
|
95
|
+
return _ao2(input, _path, true && _exceptionable);
|
|
96
|
+
else
|
|
97
|
+
return __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
98
|
+
method: "typia.createAssert",
|
|
99
|
+
path: _path,
|
|
100
|
+
expected: "(__type.o4 | __type.o1)",
|
|
101
|
+
value: input
|
|
102
|
+
}, _errorFactory);
|
|
103
|
+
})(); const __is = input => "object" === typeof input && null !== input && _io0(input); let _errorFactory; return (input, errorFactory) => {
|
|
104
|
+
if (false === __is(input)) {
|
|
105
|
+
_errorFactory = errorFactory;
|
|
106
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __typia_transform__assertGuard._assertGuard(true, {
|
|
107
|
+
method: "typia.createAssert",
|
|
108
|
+
path: _path + "",
|
|
109
|
+
expected: "SharableCertificateAttributesTypes.ContentsSchema",
|
|
110
|
+
value: input
|
|
111
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
112
|
+
method: "typia.createAssert",
|
|
113
|
+
path: _path + "",
|
|
114
|
+
expected: "SharableCertificateAttributesTypes.ContentsSchema",
|
|
115
|
+
value: input
|
|
116
|
+
}, _errorFactory))(input, "$input", true);
|
|
117
|
+
}
|
|
118
|
+
return input;
|
|
119
|
+
}; })();
|
|
120
|
+
//# sourceMappingURL=certificates.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"certificates.generated.js","sourceRoot":"","sources":["../../src/lib/certificates.generated.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,CAAC,MAAM,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAiJ,CAAC","sourcesContent":["import * as typia from 'typia';\nimport type { SharableCertificateAttributesTypes } from './certificates.js';\n\nexport const assertSharableCertificateAttributesContentsSchema: (input: unknown) => SharableCertificateAttributesTypes.ContentsSchema = typia.createAssert<SharableCertificateAttributesTypes.ContentsSchema>();\n"]}
|