@keetanetwork/anchor 0.0.99 → 0.0.101

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.
@@ -22,6 +22,7 @@ export var keeta;
22
22
  /** DigestInfo from RFC 3447 */
23
23
  /** External reference pointer */
24
24
  /** Reference */
25
+ /** Files an organization filed under one document category */
25
26
  /** Person's full name */
26
27
  /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0 */
27
28
  keeta.FULL_NAME = '1.3.6.1.4.1.62675.1.0';
@@ -94,9 +95,18 @@ export var keeta;
94
95
  /** Residence document */
95
96
  /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.6 */
96
97
  keeta.DOCUMENT_RESIDENCE_DOCUMENT = '1.3.6.1.4.1.62675.1.11.6';
97
- /** Business registration document */
98
+ /** Business registration documents */
98
99
  /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.7 */
99
100
  keeta.DOCUMENT_BUSINESS_REGISTRATION = '1.3.6.1.4.1.62675.1.11.7';
101
+ /** Register of directors documents */
102
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.8 */
103
+ keeta.DOCUMENT_REGISTER_OF_DIRECTORS = '1.3.6.1.4.1.62675.1.11.8';
104
+ /** Financial statement documents */
105
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.9 */
106
+ keeta.DOCUMENT_FINANCIAL_STATEMENT = '1.3.6.1.4.1.62675.1.11.9';
107
+ /** Additional organization documents */
108
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.10 */
109
+ keeta.DOCUMENT_ADDITIONAL = '1.3.6.1.4.1.62675.1.11.10';
100
110
  /** Organization's legal name */
101
111
  /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.12 */
102
112
  keeta.ORGANIZATION_NAME = '1.3.6.1.4.1.62675.1.12';
@@ -112,6 +122,33 @@ export var keeta;
112
122
  /** Organization's website */
113
123
  /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.15 */
114
124
  keeta.WEBSITE = '1.3.6.1.4.1.62675.1.15';
125
+ /** Description of the organization's business activities */
126
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.16 */
127
+ keeta.BUSINESS_ACTIVITY = '1.3.6.1.4.1.62675.1.16';
128
+ /** Primary source of the organization's funds */
129
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.17 */
130
+ keeta.SOURCE_OF_FUNDS = '1.3.6.1.4.1.62675.1.17';
131
+ /** Organization's expected annual transaction volume band */
132
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.18 */
133
+ keeta.EXPECTED_ANNUAL_VOLUME = '1.3.6.1.4.1.62675.1.18';
134
+ /** Countries the organization operates in */
135
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.19 */
136
+ keeta.COUNTRIES_OF_OPERATION = '1.3.6.1.4.1.62675.1.19';
137
+ /** Address the organization operates from */
138
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.20 */
139
+ keeta.OPERATING_ADDRESS = '1.3.6.1.4.1.62675.1.20';
140
+ /** Whether the organization's shares are publicly traded */
141
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.21 */
142
+ keeta.PUBLICLY_TRADED = '1.3.6.1.4.1.62675.1.21';
143
+ /** Whether the organization operates from its registered address */
144
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.22 */
145
+ keeta.OPERATES_FROM_REGISTERED_ADDRESS = '1.3.6.1.4.1.62675.1.22';
146
+ /** Ultimate beneficial owner of an organization */
147
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.23.1 */
148
+ keeta.UBO = '1.3.6.1.4.1.62675.1.23.1';
149
+ /** Organization's ultimate beneficial owners */
150
+ /** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.23 */
151
+ keeta.UBOS = '1.3.6.1.4.1.62675.1.23';
115
152
  })(keeta || (keeta = {}));
116
153
  // OID to name lookup maps
117
154
  export const OID_TO_NAME = {
@@ -141,11 +178,23 @@ export const OID_TO_NAME = {
141
178
  '1.3.6.1.4.1.62675.1.11.5': 'documentVisa',
142
179
  '1.3.6.1.4.1.62675.1.11.6': 'documentResidenceDocument',
143
180
  '1.3.6.1.4.1.62675.1.11.7': 'documentBusinessRegistration',
181
+ '1.3.6.1.4.1.62675.1.11.8': 'documentRegisterOfDirectors',
182
+ '1.3.6.1.4.1.62675.1.11.9': 'documentFinancialStatement',
183
+ '1.3.6.1.4.1.62675.1.11.10': 'documentAdditional',
144
184
  '1.3.6.1.4.1.62675.1.12': 'organizationName',
145
185
  '1.3.6.1.4.1.62675.1.12.1': 'tradeName',
146
186
  '1.3.6.1.4.1.62675.1.13': 'legalForm',
147
187
  '1.3.6.1.4.1.62675.1.14': 'incorporation',
148
- '1.3.6.1.4.1.62675.1.15': 'website'
188
+ '1.3.6.1.4.1.62675.1.15': 'website',
189
+ '1.3.6.1.4.1.62675.1.16': 'businessActivity',
190
+ '1.3.6.1.4.1.62675.1.17': 'sourceOfFunds',
191
+ '1.3.6.1.4.1.62675.1.18': 'expectedAnnualVolume',
192
+ '1.3.6.1.4.1.62675.1.19': 'countriesOfOperation',
193
+ '1.3.6.1.4.1.62675.1.20': 'operatingAddress',
194
+ '1.3.6.1.4.1.62675.1.21': 'publiclyTraded',
195
+ '1.3.6.1.4.1.62675.1.22': 'operatesFromRegisteredAddress',
196
+ '1.3.6.1.4.1.62675.1.23.1': 'ubo',
197
+ '1.3.6.1.4.1.62675.1.23': 'ubos'
149
198
  };
150
199
  export const NAME_TO_OID = {
151
200
  'postalCode': '2.5.5.17',
@@ -174,10 +223,22 @@ export const NAME_TO_OID = {
174
223
  'documentVisa': '1.3.6.1.4.1.62675.1.11.5',
175
224
  'documentResidenceDocument': '1.3.6.1.4.1.62675.1.11.6',
176
225
  'documentBusinessRegistration': '1.3.6.1.4.1.62675.1.11.7',
226
+ 'documentRegisterOfDirectors': '1.3.6.1.4.1.62675.1.11.8',
227
+ 'documentFinancialStatement': '1.3.6.1.4.1.62675.1.11.9',
228
+ 'documentAdditional': '1.3.6.1.4.1.62675.1.11.10',
177
229
  'organizationName': '1.3.6.1.4.1.62675.1.12',
178
230
  'tradeName': '1.3.6.1.4.1.62675.1.12.1',
179
231
  'legalForm': '1.3.6.1.4.1.62675.1.13',
180
232
  'incorporation': '1.3.6.1.4.1.62675.1.14',
181
- 'website': '1.3.6.1.4.1.62675.1.15'
233
+ 'website': '1.3.6.1.4.1.62675.1.15',
234
+ 'businessActivity': '1.3.6.1.4.1.62675.1.16',
235
+ 'sourceOfFunds': '1.3.6.1.4.1.62675.1.17',
236
+ 'expectedAnnualVolume': '1.3.6.1.4.1.62675.1.18',
237
+ 'countriesOfOperation': '1.3.6.1.4.1.62675.1.19',
238
+ 'operatingAddress': '1.3.6.1.4.1.62675.1.20',
239
+ 'publiclyTraded': '1.3.6.1.4.1.62675.1.21',
240
+ 'operatesFromRegisteredAddress': '1.3.6.1.4.1.62675.1.22',
241
+ 'ubo': '1.3.6.1.4.1.62675.1.23.1',
242
+ 'ubos': '1.3.6.1.4.1.62675.1.23'
182
243
  };
183
244
  //# sourceMappingURL=oids.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oids.generated.js","sourceRoot":"","sources":["../../../src/services/kyc/oids.generated.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;GAGG;AAEH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAG,yBAAyB,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,yBAAyB,CAAC;AACrD,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAEjD,gCAAgC;AAChC,sBAAsB;AACtB,uCAAuC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAEtC,+BAA+B;AAC/B,2DAA2D;AAC3D,MAAM,KAAW,KAAK,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;IAC5C,cAAc,EAAE,0BAA0B;IAC1C,2BAA2B,EAAE,0BAA0B;IACvD,8BAA8B,EAAE,0BAA0B;IAC1D,kBAAkB,EAAE,wBAAwB;IAC5C,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,wBAAwB;IACrC,eAAe,EAAE,wBAAwB;IACzC,SAAS,EAAE,wBAAwB;CACnC,CAAC","sourcesContent":["/* eslint-disable */\n/**\n * Generated OID Constants\n * This file is auto-generated from oids.json.\n */\n\n// Algorithm OID constants\nexport const AES_256_GCM = '2.16.840.1.101.3.4.1.46';\nexport const AES_256_CBC = '2.16.840.1.101.3.4.1.42';\nexport const SHA2_256 = '2.16.840.1.101.3.4.2.1';\nexport const SHA3_256 = '2.16.840.1.101.3.4.2.8';\n\n// Plain attribute OID constants\n/** Postal code OID */\n/** @see https://oidref.com/2.5.5.17 */\nexport const POSTAL_CODE = '2.5.5.17';\n\n// Keeta-specific OID constants\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace keeta {\n\t/** KYC attributes extension for X.509 certificates */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.0.0 */\n\texport const KYC_ATTRIBUTES = '1.3.6.1.4.1.62675.0.0';\n\t/** DigestInfo from RFC 3447 */\n\t/** External reference pointer */\n\t/** Reference */\n\t/** Person's full name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0 */\n\texport const FULL_NAME = '1.3.6.1.4.1.62675.1.0';\n\t/** Person's first name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0.1 */\n\texport const FIRST_NAME = '1.3.6.1.4.1.62675.1.0.1';\n\t/** Person's last name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0.2 */\n\texport const LAST_NAME = '1.3.6.1.4.1.62675.1.0.2';\n\t/** Person's middle name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0.3 */\n\texport const MIDDLE_NAME = '1.3.6.1.4.1.62675.1.0.3';\n\t/** Date of birth */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.1 */\n\texport const DATE_OF_BIRTH = '1.3.6.1.4.1.62675.1.1';\n\t/** Physical address */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.2 */\n\texport const ADDRESS = '1.3.6.1.4.1.62675.1.2';\n\t/** Email address */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.3 */\n\texport const EMAIL = '1.3.6.1.4.1.62675.1.3';\n\t/** Phone number */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.4 */\n\texport const PHONE_NUMBER = '1.3.6.1.4.1.62675.1.4';\n\t/** Date and place of birth information */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.5 */\n\texport const DATE_AND_PLACE_OF_BIRTH = '1.3.6.1.4.1.62675.1.5';\n\t/** Job title */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.6 */\n\texport const JOB_TITLE = '1.3.6.1.4.1.62675.1.6';\n\t/** Job responsibility */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.6.1 */\n\texport const JOB_RESPONSIBILITY = '1.3.6.1.4.1.62675.1.6.1';\n\t/** Identifier */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.7 */\n\texport const ID = '1.3.6.1.4.1.62675.1.7';\n\t/** Issuer identifier */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.7.1 */\n\texport const ISSUER = '1.3.6.1.4.1.62675.1.7.1';\n\t/** Entity type (organization or person) */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.8 */\n\texport const ENTITY_TYPE = '1.3.6.1.4.1.62675.1.8';\n\t/** Contact details */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.9 */\n\texport const CONTACT_DETAILS = '1.3.6.1.4.1.62675.1.9';\n\t/** Nationality */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.10 */\n\texport const NATIONALITY = '1.3.6.1.4.1.62675.1.10';\n\t/** Generic document structure with metadata */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11 */\n\texport const DOCUMENT = '1.3.6.1.4.1.62675.1.11';\n\t/** Driver's license document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.0 */\n\texport const DOCUMENT_DRIVERS_LICENSE = '1.3.6.1.4.1.62675.1.11.0';\n\t/** ID card document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.1 */\n\texport const DOCUMENT_ID_CARD = '1.3.6.1.4.1.62675.1.11.1';\n\t/** Passport document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.2 */\n\texport const DOCUMENT_PASSPORT = '1.3.6.1.4.1.62675.1.11.2';\n\t/** Passport card document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.3 */\n\texport const DOCUMENT_PASSPORT_CARD = '1.3.6.1.4.1.62675.1.11.3';\n\t/** Permit document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.4 */\n\texport const DOCUMENT_PERMIT = '1.3.6.1.4.1.62675.1.11.4';\n\t/** Visa document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.5 */\n\texport const DOCUMENT_VISA = '1.3.6.1.4.1.62675.1.11.5';\n\t/** Residence document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.6 */\n\texport const DOCUMENT_RESIDENCE_DOCUMENT = '1.3.6.1.4.1.62675.1.11.6';\n\t/** Business registration document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.7 */\n\texport const DOCUMENT_BUSINESS_REGISTRATION = '1.3.6.1.4.1.62675.1.11.7';\n\t/** Organization's legal name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.12 */\n\texport const ORGANIZATION_NAME = '1.3.6.1.4.1.62675.1.12';\n\t/** Organization's trade name (doing-business-as name) */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.12.1 */\n\texport const TRADE_NAME = '1.3.6.1.4.1.62675.1.12.1';\n\t/** Organization's legal form */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.13 */\n\texport const LEGAL_FORM = '1.3.6.1.4.1.62675.1.13';\n\t/** Organization incorporation details */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.14 */\n\texport const INCORPORATION = '1.3.6.1.4.1.62675.1.14';\n\t/** Organization's website */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.15 */\n\texport const WEBSITE = '1.3.6.1.4.1.62675.1.15';\n}\n\n// OID to name lookup maps\nexport const OID_TO_NAME: { [key: string]: string } = {\n\t'2.5.5.17': 'postalCode',\n\t'1.3.6.1.4.1.62675.1.0': 'fullName',\n\t'1.3.6.1.4.1.62675.1.0.1': 'firstName',\n\t'1.3.6.1.4.1.62675.1.0.2': 'lastName',\n\t'1.3.6.1.4.1.62675.1.0.3': 'middleName',\n\t'1.3.6.1.4.1.62675.1.1': 'dateOfBirth',\n\t'1.3.6.1.4.1.62675.1.2': 'address',\n\t'1.3.6.1.4.1.62675.1.3': 'email',\n\t'1.3.6.1.4.1.62675.1.4': 'phoneNumber',\n\t'1.3.6.1.4.1.62675.1.5': 'dateAndPlaceOfBirth',\n\t'1.3.6.1.4.1.62675.1.6': 'jobTitle',\n\t'1.3.6.1.4.1.62675.1.6.1': 'jobResponsibility',\n\t'1.3.6.1.4.1.62675.1.7': 'id',\n\t'1.3.6.1.4.1.62675.1.7.1': 'issuer',\n\t'1.3.6.1.4.1.62675.1.8': 'entityType',\n\t'1.3.6.1.4.1.62675.1.9': 'contactDetails',\n\t'1.3.6.1.4.1.62675.1.10': 'nationality',\n\t'1.3.6.1.4.1.62675.1.11': 'document',\n\t'1.3.6.1.4.1.62675.1.11.0': 'documentDriversLicense',\n\t'1.3.6.1.4.1.62675.1.11.1': 'documentIdCard',\n\t'1.3.6.1.4.1.62675.1.11.2': 'documentPassport',\n\t'1.3.6.1.4.1.62675.1.11.3': 'documentPassportCard',\n\t'1.3.6.1.4.1.62675.1.11.4': 'documentPermit',\n\t'1.3.6.1.4.1.62675.1.11.5': 'documentVisa',\n\t'1.3.6.1.4.1.62675.1.11.6': 'documentResidenceDocument',\n\t'1.3.6.1.4.1.62675.1.11.7': 'documentBusinessRegistration',\n\t'1.3.6.1.4.1.62675.1.12': 'organizationName',\n\t'1.3.6.1.4.1.62675.1.12.1': 'tradeName',\n\t'1.3.6.1.4.1.62675.1.13': 'legalForm',\n\t'1.3.6.1.4.1.62675.1.14': 'incorporation',\n\t'1.3.6.1.4.1.62675.1.15': 'website'\n};\n\nexport const NAME_TO_OID: { [key: string]: string } = {\n\t'postalCode': '2.5.5.17',\n\t'fullName': '1.3.6.1.4.1.62675.1.0',\n\t'firstName': '1.3.6.1.4.1.62675.1.0.1',\n\t'lastName': '1.3.6.1.4.1.62675.1.0.2',\n\t'middleName': '1.3.6.1.4.1.62675.1.0.3',\n\t'dateOfBirth': '1.3.6.1.4.1.62675.1.1',\n\t'address': '1.3.6.1.4.1.62675.1.2',\n\t'email': '1.3.6.1.4.1.62675.1.3',\n\t'phoneNumber': '1.3.6.1.4.1.62675.1.4',\n\t'dateAndPlaceOfBirth': '1.3.6.1.4.1.62675.1.5',\n\t'jobTitle': '1.3.6.1.4.1.62675.1.6',\n\t'jobResponsibility': '1.3.6.1.4.1.62675.1.6.1',\n\t'id': '1.3.6.1.4.1.62675.1.7',\n\t'issuer': '1.3.6.1.4.1.62675.1.7.1',\n\t'entityType': '1.3.6.1.4.1.62675.1.8',\n\t'contactDetails': '1.3.6.1.4.1.62675.1.9',\n\t'nationality': '1.3.6.1.4.1.62675.1.10',\n\t'document': '1.3.6.1.4.1.62675.1.11',\n\t'documentDriversLicense': '1.3.6.1.4.1.62675.1.11.0',\n\t'documentIdCard': '1.3.6.1.4.1.62675.1.11.1',\n\t'documentPassport': '1.3.6.1.4.1.62675.1.11.2',\n\t'documentPassportCard': '1.3.6.1.4.1.62675.1.11.3',\n\t'documentPermit': '1.3.6.1.4.1.62675.1.11.4',\n\t'documentVisa': '1.3.6.1.4.1.62675.1.11.5',\n\t'documentResidenceDocument': '1.3.6.1.4.1.62675.1.11.6',\n\t'documentBusinessRegistration': '1.3.6.1.4.1.62675.1.11.7',\n\t'organizationName': '1.3.6.1.4.1.62675.1.12',\n\t'tradeName': '1.3.6.1.4.1.62675.1.12.1',\n\t'legalForm': '1.3.6.1.4.1.62675.1.13',\n\t'incorporation': '1.3.6.1.4.1.62675.1.14',\n\t'website': '1.3.6.1.4.1.62675.1.15'\n};\n"]}
1
+ {"version":3,"file":"oids.generated.js","sourceRoot":"","sources":["../../../src/services/kyc/oids.generated.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;GAGG;AAEH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,WAAW,GAAG,yBAAyB,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,yBAAyB,CAAC;AACrD,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAEjD,gCAAgC;AAChC,sBAAsB;AACtB,uCAAuC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAEtC,+BAA+B;AAC/B,2DAA2D;AAC3D,MAAM,KAAW,KAAK,CAsIrB;AAtID,WAAiB,KAAK;IACrB,sDAAsD;IACtD,0DAA0D;IAC7C,oBAAc,GAAG,uBAAuB,CAAC;IACtD,+BAA+B;IAC/B,iCAAiC;IACjC,gBAAgB;IAChB,8DAA8D;IAC9D,yBAAyB;IACzB,0DAA0D;IAC7C,eAAS,GAAG,uBAAuB,CAAC;IACjD,0BAA0B;IAC1B,4DAA4D;IAC/C,gBAAU,GAAG,yBAAyB,CAAC;IACpD,yBAAyB;IACzB,4DAA4D;IAC/C,eAAS,GAAG,yBAAyB,CAAC;IACnD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,EAAE,wBAAwB;IAC5C,gBAAgB,EAAE,wBAAwB;IAC1C,+BAA+B,EAAE,wBAAwB;IACzD,KAAK,EAAE,0BAA0B;IACjC,MAAM,EAAE,wBAAwB;CAChC,CAAC","sourcesContent":["/* eslint-disable */\n/**\n * Generated OID Constants\n * This file is auto-generated from oids.json.\n */\n\n// Algorithm OID constants\nexport const AES_256_GCM = '2.16.840.1.101.3.4.1.46';\nexport const AES_256_CBC = '2.16.840.1.101.3.4.1.42';\nexport const SHA2_256 = '2.16.840.1.101.3.4.2.1';\nexport const SHA3_256 = '2.16.840.1.101.3.4.2.8';\n\n// Plain attribute OID constants\n/** Postal code OID */\n/** @see https://oidref.com/2.5.5.17 */\nexport const POSTAL_CODE = '2.5.5.17';\n\n// Keeta-specific OID constants\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace keeta {\n\t/** KYC attributes extension for X.509 certificates */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.0.0 */\n\texport const KYC_ATTRIBUTES = '1.3.6.1.4.1.62675.0.0';\n\t/** DigestInfo from RFC 3447 */\n\t/** External reference pointer */\n\t/** Reference */\n\t/** Files an organization filed under one document category */\n\t/** Person's full name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0 */\n\texport const FULL_NAME = '1.3.6.1.4.1.62675.1.0';\n\t/** Person's first name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0.1 */\n\texport const FIRST_NAME = '1.3.6.1.4.1.62675.1.0.1';\n\t/** Person's last name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0.2 */\n\texport const LAST_NAME = '1.3.6.1.4.1.62675.1.0.2';\n\t/** Person's middle name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.0.3 */\n\texport const MIDDLE_NAME = '1.3.6.1.4.1.62675.1.0.3';\n\t/** Date of birth */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.1 */\n\texport const DATE_OF_BIRTH = '1.3.6.1.4.1.62675.1.1';\n\t/** Physical address */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.2 */\n\texport const ADDRESS = '1.3.6.1.4.1.62675.1.2';\n\t/** Email address */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.3 */\n\texport const EMAIL = '1.3.6.1.4.1.62675.1.3';\n\t/** Phone number */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.4 */\n\texport const PHONE_NUMBER = '1.3.6.1.4.1.62675.1.4';\n\t/** Date and place of birth information */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.5 */\n\texport const DATE_AND_PLACE_OF_BIRTH = '1.3.6.1.4.1.62675.1.5';\n\t/** Job title */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.6 */\n\texport const JOB_TITLE = '1.3.6.1.4.1.62675.1.6';\n\t/** Job responsibility */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.6.1 */\n\texport const JOB_RESPONSIBILITY = '1.3.6.1.4.1.62675.1.6.1';\n\t/** Identifier */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.7 */\n\texport const ID = '1.3.6.1.4.1.62675.1.7';\n\t/** Issuer identifier */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.7.1 */\n\texport const ISSUER = '1.3.6.1.4.1.62675.1.7.1';\n\t/** Entity type (organization or person) */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.8 */\n\texport const ENTITY_TYPE = '1.3.6.1.4.1.62675.1.8';\n\t/** Contact details */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.9 */\n\texport const CONTACT_DETAILS = '1.3.6.1.4.1.62675.1.9';\n\t/** Nationality */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.10 */\n\texport const NATIONALITY = '1.3.6.1.4.1.62675.1.10';\n\t/** Generic document structure with metadata */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11 */\n\texport const DOCUMENT = '1.3.6.1.4.1.62675.1.11';\n\t/** Driver's license document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.0 */\n\texport const DOCUMENT_DRIVERS_LICENSE = '1.3.6.1.4.1.62675.1.11.0';\n\t/** ID card document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.1 */\n\texport const DOCUMENT_ID_CARD = '1.3.6.1.4.1.62675.1.11.1';\n\t/** Passport document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.2 */\n\texport const DOCUMENT_PASSPORT = '1.3.6.1.4.1.62675.1.11.2';\n\t/** Passport card document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.3 */\n\texport const DOCUMENT_PASSPORT_CARD = '1.3.6.1.4.1.62675.1.11.3';\n\t/** Permit document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.4 */\n\texport const DOCUMENT_PERMIT = '1.3.6.1.4.1.62675.1.11.4';\n\t/** Visa document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.5 */\n\texport const DOCUMENT_VISA = '1.3.6.1.4.1.62675.1.11.5';\n\t/** Residence document */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.6 */\n\texport const DOCUMENT_RESIDENCE_DOCUMENT = '1.3.6.1.4.1.62675.1.11.6';\n\t/** Business registration documents */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.7 */\n\texport const DOCUMENT_BUSINESS_REGISTRATION = '1.3.6.1.4.1.62675.1.11.7';\n\t/** Register of directors documents */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.8 */\n\texport const DOCUMENT_REGISTER_OF_DIRECTORS = '1.3.6.1.4.1.62675.1.11.8';\n\t/** Financial statement documents */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.9 */\n\texport const DOCUMENT_FINANCIAL_STATEMENT = '1.3.6.1.4.1.62675.1.11.9';\n\t/** Additional organization documents */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.11.10 */\n\texport const DOCUMENT_ADDITIONAL = '1.3.6.1.4.1.62675.1.11.10';\n\t/** Organization's legal name */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.12 */\n\texport const ORGANIZATION_NAME = '1.3.6.1.4.1.62675.1.12';\n\t/** Organization's trade name (doing-business-as name) */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.12.1 */\n\texport const TRADE_NAME = '1.3.6.1.4.1.62675.1.12.1';\n\t/** Organization's legal form */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.13 */\n\texport const LEGAL_FORM = '1.3.6.1.4.1.62675.1.13';\n\t/** Organization incorporation details */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.14 */\n\texport const INCORPORATION = '1.3.6.1.4.1.62675.1.14';\n\t/** Organization's website */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.15 */\n\texport const WEBSITE = '1.3.6.1.4.1.62675.1.15';\n\t/** Description of the organization's business activities */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.16 */\n\texport const BUSINESS_ACTIVITY = '1.3.6.1.4.1.62675.1.16';\n\t/** Primary source of the organization's funds */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.17 */\n\texport const SOURCE_OF_FUNDS = '1.3.6.1.4.1.62675.1.17';\n\t/** Organization's expected annual transaction volume band */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.18 */\n\texport const EXPECTED_ANNUAL_VOLUME = '1.3.6.1.4.1.62675.1.18';\n\t/** Countries the organization operates in */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.19 */\n\texport const COUNTRIES_OF_OPERATION = '1.3.6.1.4.1.62675.1.19';\n\t/** Address the organization operates from */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.20 */\n\texport const OPERATING_ADDRESS = '1.3.6.1.4.1.62675.1.20';\n\t/** Whether the organization's shares are publicly traded */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.21 */\n\texport const PUBLICLY_TRADED = '1.3.6.1.4.1.62675.1.21';\n\t/** Whether the organization operates from its registered address */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.22 */\n\texport const OPERATES_FROM_REGISTERED_ADDRESS = '1.3.6.1.4.1.62675.1.22';\n\t/** Ultimate beneficial owner of an organization */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.23.1 */\n\texport const UBO = '1.3.6.1.4.1.62675.1.23.1';\n\t/** Organization's ultimate beneficial owners */\n\t/** @see https://oid-base.com/get/1.3.6.1.4.1.62675.1.23 */\n\texport const UBOS = '1.3.6.1.4.1.62675.1.23';\n}\n\n// OID to name lookup maps\nexport const OID_TO_NAME: { [key: string]: string } = {\n\t'2.5.5.17': 'postalCode',\n\t'1.3.6.1.4.1.62675.1.0': 'fullName',\n\t'1.3.6.1.4.1.62675.1.0.1': 'firstName',\n\t'1.3.6.1.4.1.62675.1.0.2': 'lastName',\n\t'1.3.6.1.4.1.62675.1.0.3': 'middleName',\n\t'1.3.6.1.4.1.62675.1.1': 'dateOfBirth',\n\t'1.3.6.1.4.1.62675.1.2': 'address',\n\t'1.3.6.1.4.1.62675.1.3': 'email',\n\t'1.3.6.1.4.1.62675.1.4': 'phoneNumber',\n\t'1.3.6.1.4.1.62675.1.5': 'dateAndPlaceOfBirth',\n\t'1.3.6.1.4.1.62675.1.6': 'jobTitle',\n\t'1.3.6.1.4.1.62675.1.6.1': 'jobResponsibility',\n\t'1.3.6.1.4.1.62675.1.7': 'id',\n\t'1.3.6.1.4.1.62675.1.7.1': 'issuer',\n\t'1.3.6.1.4.1.62675.1.8': 'entityType',\n\t'1.3.6.1.4.1.62675.1.9': 'contactDetails',\n\t'1.3.6.1.4.1.62675.1.10': 'nationality',\n\t'1.3.6.1.4.1.62675.1.11': 'document',\n\t'1.3.6.1.4.1.62675.1.11.0': 'documentDriversLicense',\n\t'1.3.6.1.4.1.62675.1.11.1': 'documentIdCard',\n\t'1.3.6.1.4.1.62675.1.11.2': 'documentPassport',\n\t'1.3.6.1.4.1.62675.1.11.3': 'documentPassportCard',\n\t'1.3.6.1.4.1.62675.1.11.4': 'documentPermit',\n\t'1.3.6.1.4.1.62675.1.11.5': 'documentVisa',\n\t'1.3.6.1.4.1.62675.1.11.6': 'documentResidenceDocument',\n\t'1.3.6.1.4.1.62675.1.11.7': 'documentBusinessRegistration',\n\t'1.3.6.1.4.1.62675.1.11.8': 'documentRegisterOfDirectors',\n\t'1.3.6.1.4.1.62675.1.11.9': 'documentFinancialStatement',\n\t'1.3.6.1.4.1.62675.1.11.10': 'documentAdditional',\n\t'1.3.6.1.4.1.62675.1.12': 'organizationName',\n\t'1.3.6.1.4.1.62675.1.12.1': 'tradeName',\n\t'1.3.6.1.4.1.62675.1.13': 'legalForm',\n\t'1.3.6.1.4.1.62675.1.14': 'incorporation',\n\t'1.3.6.1.4.1.62675.1.15': 'website',\n\t'1.3.6.1.4.1.62675.1.16': 'businessActivity',\n\t'1.3.6.1.4.1.62675.1.17': 'sourceOfFunds',\n\t'1.3.6.1.4.1.62675.1.18': 'expectedAnnualVolume',\n\t'1.3.6.1.4.1.62675.1.19': 'countriesOfOperation',\n\t'1.3.6.1.4.1.62675.1.20': 'operatingAddress',\n\t'1.3.6.1.4.1.62675.1.21': 'publiclyTraded',\n\t'1.3.6.1.4.1.62675.1.22': 'operatesFromRegisteredAddress',\n\t'1.3.6.1.4.1.62675.1.23.1': 'ubo',\n\t'1.3.6.1.4.1.62675.1.23': 'ubos'\n};\n\nexport const NAME_TO_OID: { [key: string]: string } = {\n\t'postalCode': '2.5.5.17',\n\t'fullName': '1.3.6.1.4.1.62675.1.0',\n\t'firstName': '1.3.6.1.4.1.62675.1.0.1',\n\t'lastName': '1.3.6.1.4.1.62675.1.0.2',\n\t'middleName': '1.3.6.1.4.1.62675.1.0.3',\n\t'dateOfBirth': '1.3.6.1.4.1.62675.1.1',\n\t'address': '1.3.6.1.4.1.62675.1.2',\n\t'email': '1.3.6.1.4.1.62675.1.3',\n\t'phoneNumber': '1.3.6.1.4.1.62675.1.4',\n\t'dateAndPlaceOfBirth': '1.3.6.1.4.1.62675.1.5',\n\t'jobTitle': '1.3.6.1.4.1.62675.1.6',\n\t'jobResponsibility': '1.3.6.1.4.1.62675.1.6.1',\n\t'id': '1.3.6.1.4.1.62675.1.7',\n\t'issuer': '1.3.6.1.4.1.62675.1.7.1',\n\t'entityType': '1.3.6.1.4.1.62675.1.8',\n\t'contactDetails': '1.3.6.1.4.1.62675.1.9',\n\t'nationality': '1.3.6.1.4.1.62675.1.10',\n\t'document': '1.3.6.1.4.1.62675.1.11',\n\t'documentDriversLicense': '1.3.6.1.4.1.62675.1.11.0',\n\t'documentIdCard': '1.3.6.1.4.1.62675.1.11.1',\n\t'documentPassport': '1.3.6.1.4.1.62675.1.11.2',\n\t'documentPassportCard': '1.3.6.1.4.1.62675.1.11.3',\n\t'documentPermit': '1.3.6.1.4.1.62675.1.11.4',\n\t'documentVisa': '1.3.6.1.4.1.62675.1.11.5',\n\t'documentResidenceDocument': '1.3.6.1.4.1.62675.1.11.6',\n\t'documentBusinessRegistration': '1.3.6.1.4.1.62675.1.11.7',\n\t'documentRegisterOfDirectors': '1.3.6.1.4.1.62675.1.11.8',\n\t'documentFinancialStatement': '1.3.6.1.4.1.62675.1.11.9',\n\t'documentAdditional': '1.3.6.1.4.1.62675.1.11.10',\n\t'organizationName': '1.3.6.1.4.1.62675.1.12',\n\t'tradeName': '1.3.6.1.4.1.62675.1.12.1',\n\t'legalForm': '1.3.6.1.4.1.62675.1.13',\n\t'incorporation': '1.3.6.1.4.1.62675.1.14',\n\t'website': '1.3.6.1.4.1.62675.1.15',\n\t'businessActivity': '1.3.6.1.4.1.62675.1.16',\n\t'sourceOfFunds': '1.3.6.1.4.1.62675.1.17',\n\t'expectedAnnualVolume': '1.3.6.1.4.1.62675.1.18',\n\t'countriesOfOperation': '1.3.6.1.4.1.62675.1.19',\n\t'operatingAddress': '1.3.6.1.4.1.62675.1.20',\n\t'publiclyTraded': '1.3.6.1.4.1.62675.1.21',\n\t'operatesFromRegisteredAddress': '1.3.6.1.4.1.62675.1.22',\n\t'ubo': '1.3.6.1.4.1.62675.1.23.1',\n\t'ubos': '1.3.6.1.4.1.62675.1.23'\n};\n"]}
@@ -36,6 +36,8 @@ function resolveTypeReference(typeName) {
36
36
  return ('string');
37
37
  case 'GeneralizedTime':
38
38
  return ('Date');
39
+ case 'BOOLEAN':
40
+ return ('boolean');
39
41
  case 'ENUMERATED':
40
42
  return ('string');
41
43
  case 'OBJECT IDENTIFIER':
@@ -49,7 +51,7 @@ function resolveTypeReference(typeName) {
49
51
  function resolveToBaseType(typeName) {
50
52
  typeName = typeName.trim();
51
53
  // Check if it's a primitive type first
52
- if (/^(UTF8String|Utf8String|GeneralizedTime)$/i.test(typeName)) {
54
+ if (/^(UTF8String|Utf8String|GeneralizedTime|BOOLEAN)$/i.test(typeName)) {
53
55
  return (typeName);
54
56
  }
55
57
  // Check if it's defined as a sensitive attribute
@@ -290,6 +292,9 @@ function genSequenceSchema(typeName, fields, config) {
290
292
  if (baseType === 'GeneralizedTime') {
291
293
  fieldSchema = 'ASN1.ValidateASN1.IsAnyDate';
292
294
  }
295
+ else if (baseType === 'BOOLEAN') {
296
+ fieldSchema = 'ASN1.ValidateASN1.IsBoolean';
297
+ }
293
298
  else {
294
299
  // Check if this is a SEQUENCE OF type directly or via type reference
295
300
  let fieldType = baseType.trim();
@@ -497,6 +502,9 @@ function generateIso20022Types() {
497
502
  else if (config.type === 'GeneralizedTime') {
498
503
  baseType = 'Date';
499
504
  }
505
+ else if (config.type === 'BOOLEAN') {
506
+ baseType = 'boolean';
507
+ }
500
508
  else {
501
509
  if (config.type === undefined) {
502
510
  throw (new Error(`Sensitive attribute ${name} has no defined type.`));
@@ -714,6 +722,9 @@ function generateIso20022Types() {
714
722
  else if (baseType === 'GeneralizedTime') {
715
723
  schemaRef = 'ASN1.ValidateASN1.IsAnyDate';
716
724
  }
725
+ else if (baseType === 'BOOLEAN') {
726
+ schemaRef = 'ASN1.ValidateASN1.IsBoolean';
727
+ }
717
728
  else if (baseType === 'OCTET STRING') {
718
729
  schemaRef = 'ASN1.ValidateASN1.IsOctetString';
719
730
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generate-kyc-schema.js","sourceRoot":"","sources":["../../../../src/services/kyc/utils/generate-kyc-schema.ts"],"names":[],"mappings":";;;AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqF/B;;GAEG;AACH,IAAI,SAA4B,CAAC;AAEjC,4BAA4B;AAC5B,SAAS,gBAAgB,CAAC,GAAwB;IACjD,OAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC;AACD,SAAS,cAAc,CAAC,GAAW;IAClC,OAAM,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAS,IAAI;QACzC,OAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACnB,CAAC;AACD,SAAS,YAAY,CAAC,GAAW;IAChC,OAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAS,IAAI;QACzC,OAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACd,CAAC;AACD,SAAS,WAAW,CAAC,GA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAAmC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAE/F,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,oBAAoB,EAAE,EAAE,MAAM,CAAC,CAAC;IACjE,EAAE,CAAC,aAAa,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,EAAE,MAAM,CAAC,CAAC;AACvE,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["#! /usr/bin/env ts-node\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as typia from 'typia';\n\ntype oidSchemaContentsAttribute = {\n\t[key: string]: {\n\t\toid: number[];\n\t\ttype?: string;\n\t\ttoken?: string;\n\t\tdescription: string;\n\t\treference: string;\n\t\tfields?: {\n\t\t\t[key: string]: {\n\t\t\t\ttype: string;\n\t\t\t\toptional?: boolean;\n\t\t\t};\n\t\t};\n\t\tchoices?: {\n\t\t\t[key: string]: {\n\t\t\t\ttype: string;\n\t\t\t};\n\t\t};\n\t\tfield_order?: string[];\n\t};\n}\ntype oidSchemaContents = {\n\talgorithms: {\n\t\t[key: string]: number[]\n\t};\n\tsensitive_attributes: oidSchemaContentsAttribute;\n\tplain_attributes: oidSchemaContentsAttribute;\n\tiso20022_types: {\n\t\tprimitives: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\ttype: string;\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t\tenumerations: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\tvalues: string[];\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t\tchoices: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\tchoices: {\n\t\t\t\t\t[key: string]: {\n\t\t\t\t\t\ttype: string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t\tsequences: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\tfields: {\n\t\t\t\t\t[key: string]: {\n\t\t\t\t\t\ttype: string;\n\t\t\t\t\t\toptional?: boolean;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tfield_order?: string[];\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t};\n\textensions: {\n\t\t[key: string]: {\n\t\t\toid?: number[];\n\t\t\ttype?: string;\n\t\t\tdescription: string;\n\t\t\treference?: string;\n\t\t\tfields?: {\n\t\t\t\t[key: string]: {\n\t\t\t\t\ttype: string;\n\t\t\t\t\toptional?: boolean;\n\t\t\t\t};\n\t\t\t};\n\t\t\tfield_order?: string[];\n\t\t};\n\t};\n};\n/*\n * Populated in `main` function\n */\nlet oidSchema: oidSchemaContents;\n\n// --- Utility Functions ---\nfunction oidArrayToString(oid: (string | number)[]): string {\n\treturn(oid.join('.'));\n}\nfunction toConstantCase(str: string): string {\n\treturn(str.replace(/[A-Z]/g, function(part) {\n\t\treturn(`_${part}`);\n\t}).toUpperCase());\n}\nfunction toPascalCase(str: string): string {\n\treturn(str.split(/[_-]/).map(function(part) {\n\t\treturn(part.charAt(0).toUpperCase() + part.slice(1));\n\t}).join(''));\n}\nfunction toSnakeCase(str: string): string {\n\treturn(str.replace(/([A-Z])/g, '_$1').toLowerCase().replace(/^_/, ''));\n}\n\n// --- Type Resolution ---\nfunction resolveTypeReference(typeName: string): string {\n\tif (typeName.startsWith('SEQUENCE OF ')) {\n\t\treturn(`${resolveTypeReference(typeName.substring('SEQUENCE OF '.length).trim())}[]`);\n\t}\n\tswitch (typeName.trim()) {\n\t\tcase 'UTF8String':\n\t\tcase 'Utf8String':\n\t\t\treturn('string');\n\t\tcase 'GeneralizedTime':\n\t\t\treturn('Date');\n\t\tcase 'ENUMERATED':\n\t\t\treturn('string');\n\t\tcase 'OBJECT IDENTIFIER':\n\t\t\treturn('ASN1.ASN1OID');\n\t\tcase 'OCTET STRING':\n\t\t\treturn('Buffer');\n\t\tdefault:\n\t\t\treturn(toPascalCase(typeName));\n\t}\n}\n\nfunction resolveToBaseType(typeName: string): string {\n\ttypeName = typeName.trim();\n\n\t// Check if it's a primitive type first\n\tif (/^(UTF8String|Utf8String|GeneralizedTime)$/i.test(typeName)) {\n\t\treturn(typeName);\n\t}\n\n\t// Check if it's defined as a sensitive attribute\n\tconst sensitiveAttr = oidSchema.sensitive_attributes[typeName] ?? Object.values(oidSchema.sensitive_attributes).find(function(attr) {\n\t\treturn(attr.token === typeName);\n\t});\n\n\tif (sensitiveAttr && !sensitiveAttr.fields && !sensitiveAttr.choices) {\n\t\tif (sensitiveAttr.type === undefined) {\n\t\t\tthrow(new Error(`Sensitive attribute ${typeName} has no defined type.`));\n\t\t}\n\t\treturn(resolveToBaseType(sensitiveAttr.type));\n\t}\n\n\t// Check if it's an ISO20022 primitive\n\tconst primitive = oidSchema.iso20022_types.primitives[typeName];\n\tif (primitive) {\n\t\treturn(resolveToBaseType(primitive.type));\n\t}\n\n\t// Otherwise return as-is\n\treturn(typeName);\n}\n\nfunction isEnumerationType(typeName: string): boolean {\n\tconst normalized = toSnakeCase(typeName);\n\treturn(Boolean(\n\t\toidSchema.iso20022_types.enumerations[typeName] ??\n\t\toidSchema.iso20022_types.enumerations[normalized]\n\t));\n}\n\nfunction isSequenceOfChoice(config: { fields: { [key: string]: { optional?: boolean }}}): boolean {\n\tconst hasFields = config.fields && Object.keys(config.fields).length > 0;\n\tconst allOptional = hasFields && Object.values(config.fields).every(function(field) {\n\t\treturn(field.optional);\n\t});\n\treturn(allOptional);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction _ignore_getPrimitiveType(type: string): 'string' | 'date' {\n\tif (type === 'UTF8String' || type === 'Utf8String') {\n\t\treturn('string');\n\t}\n\tif (type === 'GeneralizedTime') {\n\t\treturn('date');\n\t}\n\treturn('string');\n}\n\n// --- Output Generators ---\nfunction genHeader(comment: string) {\n\treturn([\n\t\t'/* eslint-disable */',\n\t\t'/**',\n\t\t` * ${comment}`,\n\t\t' * This file is auto-generated from oids.json.',\n\t\t' */',\n\t\t''\n\t].join('\\n'));\n}\n\nfunction genTypeAlias(name: string, type: string, description: string, oid: string): string {\n\treturn(`/** ${description} */\\n/** OID: ${oid} */\\nexport type ${name} = ${type};\\n`);\n}\n\nfunction genEnumType(name: string, values: string[], description: string, oid: string): string {\n\treturn(`/** ${description} */\\n/** OID: ${oid} */\\nexport type ${name} = ${values.map(function(value) {\n\t\treturn(`'${value}'`);\n\t}).join(' | ')};\\n`);\n}\n\nfunction genInterface(name: string, fields: { [key: string]: { type: string; optional?: boolean }}, description: string, oid: string): string {\n\tconst fieldLines = Object.entries(fields).map(function([fieldName, fieldConfig]) {\n\t\treturn(`\\t${fieldName}${fieldConfig.optional ? '?' : ''}: ${resolveTypeReference(fieldConfig.type)};`);\n\t});\n\treturn(`/** ${description} */\\n/** OID: ${oid} */\\nexport interface ${name} {\\n${fieldLines.join('\\n')}\\n}\\n`);\n}\n\n// Generate TypeScript **types** for sequence-of-choice\nfunction genSequenceOfChoiceTypes(name: string, config: { fields: { [key: string]: { type: string; optional?: boolean }}; field_order?: string[] }): string {\n\tconst typeName = toPascalCase(name);\n\tconst fieldOrder = config.field_order ?? Object.keys(config.fields);\n\tconst choiceEntries = fieldOrder.map(function(fieldName): [string, { type: string; optional?: boolean }] {\n\t\tif (!(fieldName in config.fields) || config.fields[fieldName] === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\t\treturn([fieldName, config.fields[fieldName]]);\n\t});\n\tconst choiceTypes = choiceEntries.map(function([fieldName, fieldConfig], index) {\n\t\tif (fieldConfig === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\t\tconst fieldType = resolveTypeReference(fieldConfig.type);\n\t\tconst choiceTypeName = `${typeName}${toPascalCase(fieldName)}Choice`;\n\t\treturn({\n\t\t\tcode: `export interface ${choiceTypeName} {\\n\\ttag: ${index};\\n\\tname: '${fieldName}';\\n\\tvalue: ${fieldType};\\n}\\n`,\n\t\t\tname: choiceTypeName\n\t\t});\n\t});\n\n\tlet out = '';\n\t// Individual choice interfaces\n\tout += choiceTypes.map(function(choiceInfo) {\n\t\treturn(choiceInfo.code);\n\t}).join('\\n');\n\n\t// Union type\n\tout += `export type ${typeName}Choice =\\n\\t| ${choiceTypes.map(function(choiceInfo) {\n\t\treturn(choiceInfo.name);\n\t}).join('\\n\\t| ')};\\n\\n`;\n\n\t// Main type is array of choices\n\tout += `export type ${typeName} = ${typeName}Choice[];\\n\\n`;\n\n\treturn(out);\n}\n\n// Generate ASN.1 **schema** for sequence-of-choice\nfunction genSequenceOfChoiceSchema(name: string, config: { fields: { [key: string]: { type: string; optional?: boolean }}; field_order?: string[] }): string {\n\tconst typeName = toPascalCase(name);\n\tconst fieldOrder = config.field_order ?? Object.keys(config.fields);\n\tconst choiceEntries = fieldOrder.map(function(fieldName): [string, { type: string; optional?: boolean }] {\n\t\tif (!(fieldName in config.fields) || config.fields[fieldName] === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\t\treturn([fieldName, config.fields[fieldName]]);\n\t});\n\n\tlet out = '';\n\n\t// ASN.1 schema\n\tout += `/** ASN.1 schema for ${typeName} */\\n`;\n\tout += `export const ${typeName}Schema: ASN1.Schema = {\\n\\tsequenceOf: {\\n\\t\\tchoice: [\\n`;\n\tout += choiceEntries.map(function([fieldName, fieldConfig], index) {\n\t\tif (fieldConfig === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\n\t\t// Determine the type for this choice\n\t\tlet fieldType = fieldConfig.type.trim();\n\t\tif (fieldType.startsWith('SEQUENCE OF ')) {\n\t\t\tfieldType = fieldType.substring('SEQUENCE OF '.length).trim();\n\t\t}\n\t\tfieldType = fieldType.replace(/\\[\\]$/, '');\n\n\t\tconst fieldTypePascal = toPascalCase(fieldType);\n\t\tconst fieldTypeSnake = toSnakeCase(fieldType);\n\n\t\t// Check if this is a complex type that has a schema\n\t\tconst isChoice = oidSchema.iso20022_types.choices[fieldTypeSnake] ?? oidSchema.iso20022_types.choices[fieldType];\n\t\tconst isSequence = oidSchema.iso20022_types.sequences[fieldTypeSnake] ?? oidSchema.iso20022_types.sequences[fieldType];\n\t\tconst isSensitiveSequence = oidSchema.sensitive_attributes[fieldTypeSnake]?.fields;\n\t\tconst isSensitiveChoice = oidSchema.sensitive_attributes[fieldTypeSnake]?.choices;\n\t\tconst hasSchema = isChoice ?? isSequence ?? isSensitiveSequence ?? isSensitiveChoice;\n\n\t\tlet contains;\n\t\tif (hasSchema) {\n\t\t\tcontains = `${fieldTypePascal}Schema`;\n\t\t} else {\n\t\t\t// Primitive type\n\t\t\tcontains = `{ type: 'string', kind: 'utf8' }`;\n\t\t}\n\n\t\treturn(`\\t\\t\\t{ type: 'context', kind: 'explicit', value: ${index}, contains: ${contains} }`);\n\t}).join(',\\n');\n\tout += `\\n\\t\\t]\\n\\t}\\n};\\n\\n`;\n\n\t// Field names array\n\tout += `export const ${typeName}Fields = [\\n${fieldOrder.map(function(fieldName){\n\t\treturn(`\\t'${fieldName}'`);\n\t}).join(',\\n')}\\n] as const;\\n\\n`;\n\n\treturn(out);\n}\n\nfunction deleteLastCommaIfFoundGenerator(lines: string[]) {\n\treturn(function deleteLastCommaIfFound() {\n\t\tlet lastLine = lines.pop();\n\t\tif (lastLine === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tif (lastLine.endsWith(',')) {\n\t\t\tlastLine = lastLine.slice(0, -1);\n\t\t}\n\t\tlines.push(lastLine);\n\t});\n}\n\n\n// --- Main Generation ---\nfunction generateOidConstants() {\n\tconst lines = [genHeader('Generated OID Constants')];\n\tconst deleteLastCommaIfFound = deleteLastCommaIfFoundGenerator(lines);\n\n\t// Algorithm OID constants\n\tlines.push('// Algorithm OID constants');\n\tfor (const [name, oid] of Object.entries(oidSchema.algorithms)) {\n\t\tlines.push(`export const ${toConstantCase(name.replace(/-/g, '_'))} = '${oidArrayToString(oid)}';`);\n\t}\n\tlines.push('');\n\n\t// Plain attribute OID constants\n\tlines.push('// Plain attribute OID constants');\n\tfor (const [name, config] of Object.entries(oidSchema.plain_attributes)) {\n\t\tlines.push(`/** ${config.description} */`);\n\t\tlines.push(`/** @see ${config.reference} */`);\n\t\tlines.push(`export const ${toConstantCase(name)} = '${oidArrayToString(config.oid)}';`);\n\t}\n\tlines.push('');\n\n\t// Keeta namespace for sensitive attributes\n\tlines.push('// Keeta-specific OID constants');\n\tlines.push('// eslint-disable-next-line @typescript-eslint/no-namespace');\n\tlines.push('export namespace keeta {');\n\tfor (const [name, config] of Object.entries(oidSchema.extensions)) {\n\t\tlines.push(`\\t/** ${config.description} */`);\n\t\tif (config.reference) {\n\t\t\tlines.push(`\\t/** @see ${config.reference} */`);\n\t\t}\n\t\tif (config.oid) {\n\t\t\tlines.push(`\\texport const ${toConstantCase(name)} = '${oidArrayToString(config.oid)}';`);\n\t\t}\n\t}\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t/** ${config.description} */`);\n\t\tlines.push(`\\t/** @see ${config.reference} */`);\n\t\tlines.push(`\\texport const ${toConstantCase(name)} = '${oidArrayToString(config.oid)}';`);\n\t}\n\tlines.push('}');\n\tlines.push('');\n\n\t// Lookup maps\n\tlines.push('// OID to name lookup maps');\n\tlines.push('export const OID_TO_NAME: { [key: string]: string } = {');\n\tfor (const [name, config] of Object.entries({\n\t\t...oidSchema.plain_attributes,\n\t\t...oidSchema.sensitive_attributes\n\t})) {\n\t\tlines.push(`\\t'${oidArrayToString(config.oid)}': '${name}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('};');\n\tlines.push('');\n\tlines.push('export const NAME_TO_OID: { [key: string]: string } = {');\n\tfor (const [name, config] of Object.entries({\n\t\t...oidSchema.plain_attributes,\n\t\t...oidSchema.sensitive_attributes\n\t})) {\n\t\tlines.push(`\\t'${name}': '${oidArrayToString(config.oid)}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('};');\n\tlines.push('');\n\n\treturn(lines.join('\\n'));\n}\n\nfunction genSequenceSchema(typeName: string, fields: { [key: string]: { type: string; optional?: boolean }}, config: { field_order?: string[] }) {\n\tconst fieldOrder = config?.field_order ?? Object.keys(fields);\n\tconst structFields: { [key: string]: { schema: string; optional: boolean; isChoice: boolean }} = {};\n\n\tfor (const fname of fieldOrder) {\n\t\tconst fcfg = fields[fname];\n\t\tif (!fcfg) {continue;}\n\n\t\t// Resolve to base type to handle aliases\n\t\tconst baseType = resolveToBaseType(fcfg.type);\n\n\t\tlet fieldSchema;\n\t\tlet isChoiceType = false;\n\n\t\t// Check if field type is GeneralizedTime (date)\n\t\tif (baseType === 'GeneralizedTime') {\n\t\t\tfieldSchema = 'ASN1.ValidateASN1.IsAnyDate';\n\t\t} else {\n\t\t\t// Check if this is a SEQUENCE OF type directly or via type reference\n\t\t\tlet fieldType = baseType.trim();\n\t\t\tconst isSequenceOf = fieldType.startsWith('SEQUENCE OF ');\n\t\t\tif (isSequenceOf) {\n\t\t\t\tfieldType = fieldType.substring('SEQUENCE OF '.length).trim();\n\t\t\t}\n\n\t\t\tfieldType = fieldType.replace(/\\[\\]$/, '');\n\n\t\t\tconst fieldTypePascal = toPascalCase(fieldType);\n\t\t\tconst fieldTypeSnake = toSnakeCase(fieldType);\n\n\t\t\t// Check if this is a COMPLEX type (not a primitive)\n\t\t\tconst isChoice = oidSchema.iso20022_types.choices[fieldTypeSnake] ?? oidSchema.iso20022_types.choices[fieldType];\n\t\t\tconst isSequence = oidSchema.iso20022_types.sequences[fieldTypeSnake] ?? oidSchema.iso20022_types.sequences[fieldType];\n\t\t\tconst isSensitiveSequence = oidSchema.sensitive_attributes[fieldTypeSnake]?.fields;\n\t\t\tconst isSensitiveChoice = oidSchema.sensitive_attributes[fieldTypeSnake]?.choices;\n\t\t\tconst isExtension = oidSchema.extensions[fieldTypeSnake]?.fields ?? oidSchema.extensions[fieldType]?.fields;\n\n\t\t\tconst hasSchema = isChoice ?? isSequence ?? isSensitiveSequence ?? isSensitiveChoice ?? isExtension;\n\t\t\tisChoiceType = !!(isChoice ?? isSensitiveChoice);\n\n\t\t\tif (hasSchema) {\n\t\t\t\tfieldSchema = `${fieldTypePascal}Schema`;\n\t\t\t} else {\n\t\t\t\t// Primitive type - use inline schema\n\t\t\t\tif (fieldType === 'OBJECT IDENTIFIER') {\n\t\t\t\t\tfieldSchema = `ASN1.ValidateASN1.IsOID`;\n\t\t\t\t} else if (fieldType === 'OCTET STRING') {\n\t\t\t\t\tfieldSchema = `ASN1.ValidateASN1.IsOctetString`;\n\t\t\t\t} else {\n\t\t\t\t\tfieldSchema = `{ type: 'string', kind: 'utf8' }`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Wrap in sequenceOf if this was a SEQUENCE OF type\n\t\t\tif (isSequenceOf) {\n\t\t\t\tfieldSchema = `{ sequenceOf: ${fieldSchema} }`;\n\t\t\t}\n\t\t}\n\n\t\t// Store field metadata\n\t\tstructFields[fname] = {\n\t\t\tschema: fieldSchema,\n\t\t\toptional: fcfg.optional ?? false,\n\t\t\tisChoice: isChoiceType\n\t\t};\n\t}\n\n\t// Check if ANY field is optional - if so, ALL fields need context tags for proper ordering\n\tconst hasAnyOptionalField = fieldOrder.some(function(fname) {\n\t\tconst fieldInfo = structFields[fname];\n\t\treturn(fieldInfo?.optional ?? false);\n\t});\n\n\tconst containsObject = fieldOrder.map(function(fname, index) {\n\t\tconst fieldInfo = structFields[fname];\n\t\tif (!fieldInfo) {\n\t\t\tthrow(new Error(`Field ${fname} not found in structFields`));\n\t\t}\n\n\t\tconst baseSchema = fieldInfo.schema;\n\t\tconst isOptional = fieldInfo.optional;\n\t\tconst isChoiceField = fieldInfo.isChoice;\n\t\tif (hasAnyOptionalField && !isChoiceField) {\n\t\t\tconst wrappedInContext = `{ type: 'context', kind: 'explicit', value: ${index}, contains: ${baseSchema} }`;\n\t\t\tif (isOptional) {\n\t\t\t\treturn(`\\t\\t${fname}: { optional: ${wrappedInContext} }`);\n\t\t\t} else {\n\t\t\t\treturn(`\\t\\t${fname}: ${wrappedInContext}`);\n\t\t\t}\n\t\t} else if (isOptional) {\n\t\t\treturn(`\\t\\t${fname}: { optional: ${baseSchema} }`);\n\t\t} else {\n\t\t\treturn(`\\t\\t${fname}: ${baseSchema}`);\n\t\t}\n\t}).join(',\\n');\n\n\treturn(`export const ${typeName}Schema: ASN1.Schema = {\\n\\ttype: 'struct',\\n\\tfieldNames: [${fieldOrder.map(f => `'${f}'`).join(', ')}],\\n\\tcontains: {\\n${containsObject}\\n\\t}\\n};`);\n}\n\nfunction generateIso20022Types() {\n\tconst lines = [\n\t\tgenHeader('Generated ISO20022 Type Definitions'),\n\t\t\"import * as ASN1 from '../../lib/utils/asn1.js';\",\n\t\t\"import { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';\",\n\t\t'type KeetaNetAccount = InstanceType<typeof KeetaNetLib.Account>;',\n\t\t''\n\t];\n\tconst deleteLastCommaIfFound = deleteLastCommaIfFoundGenerator(lines);\n\n\t// Primitives\n\tlines.push('// ISO20022 Primitive Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.primitives)) {\n\t\tlines.push(genTypeAlias(toPascalCase(name), resolveTypeReference(config.type), config.description, oidArrayToString(config.oid)));\n\t}\n\n\t// Enumerations\n\tlines.push('// ISO20022 Enumeration Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.enumerations)) {\n\t\tlines.push(genEnumType(toPascalCase(name), config.values, config.description, oidArrayToString(config.oid)));\n\t}\n\n\t// Choices\n\tlines.push('// ISO20022 Choice Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.choices)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tconst choices = Object.entries(config.choices ?? {});\n\t\tconst hasComplexTypes = choices.some(function([_ignore_choiceName, choiceConfig]) {\n\t\t\tconst choiceType = choiceConfig.type.trim();\n\t\t\treturn(choiceType !== 'UTF8String' && choiceType !== 'string');\n\t\t});\n\t\tif (hasComplexTypes) {\n\t\t\tconst unionTypes = Array.from(new Set(choices.map(function([_ignore_choiceName, choiceConfig]) {\n\t\t\t\treturn(resolveTypeReference(choiceConfig.type.trim()));\n\t\t\t})));\n\t\t\tlines.push(genTypeAlias(typeName, unionTypes.join(' | '), config.description, oidArrayToString(config.oid)));\n\t\t} else {\n\t\t\tlines.push(genTypeAlias(typeName, 'string', config.description, oidArrayToString(config.oid)));\n\t\t}\n\t}\n\n\t// ISO20022 Sequences and Sequence-of-Choice Types\n\tlines.push('// ISO20022 Sequence Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.sequences)) {\n\t\tif (isSequenceOfChoice(config)) {\n\t\t\tlines.push(genSequenceOfChoiceTypes(name, config));\n\t\t} else {\n\t\t\tlines.push(genInterface(toPascalCase(name), config.fields, config.description, oidArrayToString(config.oid)));\n\t\t}\n\t}\n\tlines.push('');\n\n\t// --- Choice Type Schemas ---\n\tlines.push('// Generated ASN.1 schemas for ISO 20022 choice types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.choices)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tconst choices = Object.entries(config.choices ?? {});\n\n\t\tlines.push(`/** ASN.1 schema for ${typeName} */`);\n\n\t\tif (choices.length === 0) {\n\t\t\t// No choices defined - simple string schema\n\t\t\tlines.push(`export const ${typeName}Schema: ASN1.Schema = { type: 'string', kind: 'utf8' };`);\n\t\t} else {\n\t\t\t// Generate choice schema with context tags to make them differentiable\n\t\t\tconst choiceSchemas = choices.map(function([_ignore_choiceName, choiceConfig], index) {\n\t\t\t\tconst choiceType = choiceConfig.type.trim();\n\t\t\t\tlet containsSchema;\n\n\t\t\t\t// Check if it is a primitive type\n\t\t\t\tif (choiceType === 'UTF8String' || choiceType === 'Utf8String' || choiceType === 'string' || isEnumerationType(choiceType)) {\n\t\t\t\t\tcontainsSchema = `{ type: 'string', kind: 'utf8' }`;\n\t\t\t\t} else {\n\t\t\t\t\t// Complex type - reference its schema\n\t\t\t\t\tconst choiceTypeName = toPascalCase(choiceType);\n\t\t\t\t\tcontainsSchema = `${choiceTypeName}Schema`;\n\t\t\t\t}\n\n\t\t\t\t// Wrap in context tag to make it differentiable\n\t\t\t\treturn(`{ type: 'context', kind: 'explicit', value: ${index}, contains: ${containsSchema} }`);\n\t\t\t});\n\n\t\t\tlines.push(`export const ${typeName}Schema: ASN1.Schema = {`);\n\t\t\tlines.push(`\\tchoice: [`);\n\t\t\tlines.push(`\\t\\t${choiceSchemas.join(',\\n\\t\\t')}`);\n\t\t\tlines.push(`\\t]`);\n\t\t\tlines.push(`};`);\n\t\t}\n\t\tlines.push('');\n\t}\n\n\t// --- Regular Sequence Type Schemas (SECOND - may depend on choice schemas) ---\n\tlines.push('// Generated ASN.1 schemas for ISO 20022 regular sequence types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.sequences)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (config.fields && !isSequenceOfChoice(config)) {\n\t\t\tlines.push(`/** ASN.1 schema for ${typeName} */`);\n\t\t\tlines.push(genSequenceSchema(typeName, config.fields, config));\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// --- Sequence-of-Choice Type Schemas (THIRD - depend on regular sequence schemas) ---\n\tlines.push('// Generated ASN.1 schemas for ISO 20022 sequence-of-choice types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.sequences)) {\n\t\tif (isSequenceOfChoice(config)) {\n\t\t\tlines.push(genSequenceOfChoiceSchema(name, config));\n\t\t}\n\t}\n\n\t// --- Choice-Type Sensitive Attribute Schemas ---\n\tlines.push('// Generated ASN.1 schemas for choice-type sensitive attributes');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (config.choices) {\n\t\t\tconst choiceSchemas = Object.values(config.choices).map(function(choice) {\n\t\t\t\tconst choiceTypeName = toPascalCase(choice.type.trim());\n\t\t\t\treturn(`${choiceTypeName}Schema`);\n\t\t\t});\n\t\t\tlines.push(`/** ASN.1 schema for ${typeName} */`);\n\t\t\tlines.push(`export const ${typeName}Schema: ASN1.Schema = {`);\n\t\t\tlines.push(`\\tchoice: [`);\n\t\t\tlines.push(`\\t\\t${choiceSchemas.join(',\\n\\t\\t')}`);\n\t\t\tlines.push(`\\t]`);\n\t\t\tlines.push(`};`);\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Sensitive Attribute Types\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (!config.fields && !config.choices) {\n\t\t\t// Primitive type\n\t\t\tlet baseType;\n\t\t\tif (config.type === 'UTF8String' || config.type === 'Utf8String') {\n\t\t\t\tbaseType = 'string';\n\t\t\t} else if (config.type === 'GeneralizedTime') {\n\t\t\t\tbaseType = 'Date';\n\t\t\t} else {\n\t\t\t\tif (config.type === undefined) {\n\t\t\t\t\tthrow(new Error(`Sensitive attribute ${name} has no defined type.`));\n\t\t\t\t}\n\t\t\t\tbaseType = toPascalCase(config.type);\n\t\t\t}\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\tlines.push(`export type ${typeName} = ${baseType};`);\n\t\t\tlines.push('');\n\t\t} else if (config.fields) {\n\t\t\t// Sequence type\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\tlines.push(`export interface ${typeName} {`);\n\t\t\tfor (const [fieldName, fieldConfig] of Object.entries(config.fields)) {\n\t\t\t\tconst optional = fieldConfig.optional ? '?' : '';\n\t\t\t\tconst resolvedType = resolveTypeReference(fieldConfig.type);\n\t\t\t\tlines.push(`\\t${fieldName}${optional}: ${resolvedType};`);\n\t\t\t}\n\t\t\tlines.push('}');\n\t\t\tlines.push('');\n\t\t} else if (config.choices) {\n\t\t\t// Choice type\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\tconst hasComplexTypes = Object.values(config.choices).some(function(choice) {\n\t\t\t\tconst choiceType = choice.type.trim();\n\t\t\t\treturn(choiceType !== 'UTF8String' && choiceType !== 'string');\n\t\t\t});\n\t\t\tif (hasComplexTypes) {\n\t\t\t\tconst unionTypes = Object.values(config.choices).map(function(choice) {\n\t\t\t\t\treturn(toPascalCase(choice.type.trim()));\n\t\t\t\t});\n\t\t\t\tlines.push(`export type ${typeName} = ${unionTypes.join(' | ')};`);\n\t\t\t} else {\n\t\t\t\tlines.push(`export type ${typeName} = string;`);\n\t\t\t}\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Extension Types with fields\n\tfor (const [name, config] of Object.entries(oidSchema.extensions)) {\n\t\tif (config.fields) {\n\t\t\tconst typeName = toPascalCase(name);\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tif (config.oid) {\n\t\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\t}\n\t\t\tlines.push(`export interface ${typeName} {`);\n\t\t\tfor (const [fieldName, fieldConfig] of Object.entries(config.fields)) {\n\t\t\t\tconst optional = fieldConfig.optional ? '?' : '';\n\t\t\t\tconst resolvedType = resolveTypeReference(fieldConfig.type);\n\t\t\t\tlines.push(`\\t${fieldName}${optional}: ${resolvedType};`);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * The \"Reference\" type is a special case where we inject\n\t\t\t * some additional attributes when decoding.\n\t\t\t */\n\t\t\tif (typeName === 'Reference') {\n\t\t\t\tlines.push('\\t/**');\n\t\t\t\tlines.push('\\t * TODOC');\n\t\t\t\tlines.push('\\t */');\n\t\t\t\tlines.push('\\t$blob: (principals?: KeetaNetAccount[]) => Promise<Blob>;');\n\t\t\t}\n\t\t\tlines.push('}');\n\t\t\tlines.push('');\n\t\t\t// Schema\n\t\t\tlines.push(genSequenceSchema(typeName, config.fields, config));\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Token aliases for sensitive attributes\n\tlines.push('// Token aliases for sensitive attributes');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tif (config.token && config.token !== toPascalCase(name)) {\n\t\t\tconst typeName = toPascalCase(name);\n\t\t\tconst tokenName = config.token;\n\t\t\tlines.push(`/** Alias for ${typeName} */`);\n\t\t\tlines.push(`export type ${tokenName} = ${typeName};`);\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Union type, value map, helper generic\n\tlines.push('/** Union type of all sensitive attribute types */');\n\tlines.push('export type SensitiveAttributeType =');\n\tlines.push(Object.keys(oidSchema.sensitive_attributes).map(function(name) {\n\t\treturn(`\\t| ${toPascalCase(name)}`);\n\t}).join('\\n') + ';');\n\tlines.push('');\n\tlines.push('/** Map of attribute name to acceptable input type for CertificateBuilder.setAttribute */');\n\tlines.push('export interface CertificateAttributeValueMap {');\n\tfor (const [name] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${name}': ${toPascalCase(name)};`);\n\t}\n\tlines.push('}');\n\tlines.push('');\n\tlines.push('/** Helper generic to get attribute value type by name */');\n\tlines.push('export type CertificateAttributeValue<Name extends keyof CertificateAttributeValueMap> = CertificateAttributeValueMap[Name];');\n\tlines.push('');\n\n\t// Field arrays and schemas for sequence types\n\t// Sort to ensure dependencies are defined before they're used\n\tconst sensitiveAttrEntries = Object.entries(oidSchema.sensitive_attributes);\n\tconst sortedEntries: [string, typeof sensitiveAttrEntries[0][1]][] = [];\n\tconst processed = new Set<string>();\n\n\tfunction hasDependency(config: typeof sensitiveAttrEntries[0][1], depName: string): boolean {\n\t\tif (!config.fields) {return(false);}\n\t\treturn(Object.values(config.fields).some(field => {\n\t\t\tconst fieldType = field.type.trim();\n\t\t\treturn(fieldType === toPascalCase(depName) || fieldType === depName);\n\t\t}));\n\t}\n\n\t// Process entries, dependencies first\n\twhile (sortedEntries.length < sensitiveAttrEntries.length) {\n\t\tfor (const [name, config] of sensitiveAttrEntries) {\n\t\t\tif (processed.has(name)) {continue;}\n\n\t\t\t// Check if all dependencies are processed\n\t\t\tlet allDepsProcessed = true;\n\t\t\tif (config.fields) {\n\t\t\t\tfor (const [otherName] of sensitiveAttrEntries) {\n\t\t\t\t\tif (otherName === name || processed.has(otherName)) {continue;}\n\t\t\t\t\tif (hasDependency(config, otherName)) {\n\t\t\t\t\t\tallDepsProcessed = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (allDepsProcessed) {\n\t\t\t\tsortedEntries.push([name, config]);\n\t\t\t\tprocessed.add(name);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const [name, config] of sortedEntries) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (config.fields) {\n\t\t\tconst fieldOrder = config.field_order ?? Object.keys(config.fields);\n\t\t\tlines.push(`export const ${typeName}Fields = [${fieldOrder.map(function(field) {\n\t\t\t\treturn(`'${field}'`);\n\t\t\t}).join(', ')}] as const;`);\n\t\t\tlines.push(genSequenceSchema(typeName, config.fields, config));\n\t\t}\n\t}\n\n\t// OID DB\n\tlines.push('export const CertificateAttributeOIDDB = {');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${name}': '${oidArrayToString(config.oid)}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('} as const;');\n\tlines.push('');\n\n\t// Sensitive attribute list\n\tlines.push('export const SENSITIVE_CERTIFICATE_ATTRIBUTES = [');\n\tfor (const name of Object.keys(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${name}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('] as const;');\n\tlines.push('');\n\n\tlines.push('export type SensitiveCertificateAttributeNames = typeof SENSITIVE_CERTIFICATE_ATTRIBUTES[number];');\n\tlines.push('');\n\n\t// PascalCase names\n\tlines.push('export const SensitiveCertificateAttributeNames = [');\n\tfor (const name of Object.keys(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${toPascalCase(name)}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('] as const;');\n\tlines.push('');\n\n\t// Field name mapping\n\tlines.push('export const CertificateAttributeFieldNames: { readonly [K in keyof typeof CertificateAttributeOIDDB]?: readonly string[] } = {');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tif (config.fields) {\n\t\t\tconst typeName = toPascalCase(name);\n\t\t\tlines.push(`\\t'${name}': ${typeName}Fields,`);\n\t\t}\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('} as const;');\n\tlines.push('');\n\n\t// Complete schema mapping (ONCE, at the end)\n\tlines.push('export const CertificateAttributeSchema: { readonly [K in keyof typeof CertificateAttributeOIDDB]: ASN1.Schema } = {');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tlet schemaRef;\n\t\tif (config.fields) {\n\t\t\tschemaRef = `${typeName}Schema`;\n\t\t} else if (config.choices) {\n\t\t\tschemaRef = `${typeName}Schema`;\n\t\t} else {\n\t\t\tif (config.type === undefined) {\n\t\t\t\tthrow(new Error(`Sensitive attribute ${name} has no defined type.`));\n\t\t\t}\n\t\t\tconst baseType = resolveToBaseType(config.type);\n\t\t\tconst baseTypeSnake = toSnakeCase(baseType);\n\t\t\tconst isExtensionType = oidSchema.extensions[baseTypeSnake]?.fields ?? oidSchema.extensions[baseType]?.fields;\n\t\t\tconst isSensitiveType = oidSchema.sensitive_attributes[toSnakeCase(baseType)]?.fields ?? oidSchema.sensitive_attributes[baseType]?.fields;\n\n\t\t\tif (isSensitiveType) {\n\t\t\t\tschemaRef = `${baseType}Schema`;\n\t\t\t} else if (isExtensionType) {\n\t\t\t\tschemaRef = `${baseType}Schema`;\n\t\t\t} else if (baseType === 'GeneralizedTime') {\n\t\t\t\tschemaRef = 'ASN1.ValidateASN1.IsAnyDate';\n\t\t\t} else if (baseType === 'OCTET STRING') {\n\t\t\t\tschemaRef = 'ASN1.ValidateASN1.IsOctetString';\n\t\t\t} else if (baseType === 'OBJECT IDENTIFIER') {\n\t\t\t\tschemaRef = 'ASN1.ValidateASN1.IsOID';\n\t\t\t} else {\n\t\t\t\tschemaRef = `{ type: 'string', kind: 'utf8' }`;\n\t\t\t}\n\t\t}\n\t\tlines.push(`\\t'${name}': ${schemaRef},`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('} as const;');\n\tlines.push('');\n\n\treturn(lines.join('\\n'));\n}\n\nfunction parseArgs(argv: string[]): { oidsJSONPath: string; oidsOutputPath: string; iso20022OutputPath: string } {\n\tlet oidsJSONPath: string | undefined = undefined;\n\tlet oidsOutputPath: string | undefined = undefined;\n\tlet iso20022OutputPath: string | undefined = undefined;\n\tfor (const arg of argv) {\n\t\tif (arg.startsWith('--oids-json=')) {\n\t\t\toidsJSONPath = arg.substring('--oids-json='.length);\n\t\t}\n\t\tif (arg.startsWith('--oids-output=')) {\n\t\t\toidsOutputPath = arg.substring('--oids-output='.length);\n\t\t}\n\t\tif (arg.startsWith('--iso20022-output=')) {\n\t\t\tiso20022OutputPath = arg.substring('--iso20022-output='.length);\n\t\t}\n\t}\n\n\tif (oidsJSONPath === undefined) {\n\t\tthrow(new Error('Missing required argument: --oids-json=path/to/oids.json'));\n\t}\n\tif (oidsOutputPath === undefined) {\n\t\tthrow(new Error('Missing required argument: --oids-output=path/to/oids.generated.ts'));\n\t}\n\tif (iso20022OutputPath === undefined) {\n\t\tthrow(new Error('Missing required argument: --iso20022-output=path/to/iso20022.generated.ts'));\n\t}\n\tif (!fs.existsSync(oidsJSONPath)) {\n\t\tthrow(new Error(`OID JSON file not found: ${oidsJSONPath}`));\n\t}\n\treturn({\n\t\toidsJSONPath,\n\t\toidsOutputPath,\n\t\tiso20022OutputPath\n\t});\n}\n\n// --- Main ---\nfunction main(argv: string[]): void {\n\tconst {\n\t\toidsJSONPath,\n\t\toidsOutputPath,\n\t\tiso20022OutputPath\n\t} = parseArgs(argv);\n\n\tfs.mkdirSync(path.dirname(oidsOutputPath), { recursive: true });\n\tfs.mkdirSync(path.dirname(iso20022OutputPath), { recursive: true });\n\n\toidSchema = typia.assert<oidSchemaContents>(JSON.parse(fs.readFileSync(oidsJSONPath, 'utf8')));\n\n\tfs.writeFileSync(oidsOutputPath, generateOidConstants(), 'utf8');\n\tfs.writeFileSync(iso20022OutputPath, generateIso20022Types(), 'utf8');\n}\n\nmain(process.argv.slice(2));\n"]}
1
+ {"version":3,"file":"generate-kyc-schema.js","sourceRoot":"","sources":["../../../../src/services/kyc/utils/generate-kyc-schema.ts"],"names":[],"mappings":";;;AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqF/B;;GAEG;AACH,IAAI,SAA4B,CAAC;AAEjC,4BAA4B;AAC5B,SAAS,gBAAgB,CAAC,GAAwB;IACjD,OAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACvB,CAAC;AACD,SAAS,cAAc,CAAC,GAAW;IAClC,OAAM,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,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B,EAAE,EAAE,MAAM,CAAC,CAAC;IACjE,EAAE,CAAC,aAAa,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,EAAE,MAAM,CAAC,CAAC;AACvE,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["#! /usr/bin/env ts-node\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as typia from 'typia';\n\ntype oidSchemaContentsAttribute = {\n\t[key: string]: {\n\t\toid: number[];\n\t\ttype?: string;\n\t\ttoken?: string;\n\t\tdescription: string;\n\t\treference: string;\n\t\tfields?: {\n\t\t\t[key: string]: {\n\t\t\t\ttype: string;\n\t\t\t\toptional?: boolean;\n\t\t\t};\n\t\t};\n\t\tchoices?: {\n\t\t\t[key: string]: {\n\t\t\t\ttype: string;\n\t\t\t};\n\t\t};\n\t\tfield_order?: string[];\n\t};\n}\ntype oidSchemaContents = {\n\talgorithms: {\n\t\t[key: string]: number[]\n\t};\n\tsensitive_attributes: oidSchemaContentsAttribute;\n\tplain_attributes: oidSchemaContentsAttribute;\n\tiso20022_types: {\n\t\tprimitives: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\ttype: string;\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t\tenumerations: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\tvalues: string[];\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t\tchoices: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\tchoices: {\n\t\t\t\t\t[key: string]: {\n\t\t\t\t\t\ttype: string;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t\tsequences: {\n\t\t\t[key: string]: {\n\t\t\t\toid: number[];\n\t\t\t\tfields: {\n\t\t\t\t\t[key: string]: {\n\t\t\t\t\t\ttype: string;\n\t\t\t\t\t\toptional?: boolean;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t\tfield_order?: string[];\n\t\t\t\tdescription: string;\n\t\t\t};\n\t\t};\n\t};\n\textensions: {\n\t\t[key: string]: {\n\t\t\toid?: number[];\n\t\t\ttype?: string;\n\t\t\tdescription: string;\n\t\t\treference?: string;\n\t\t\tfields?: {\n\t\t\t\t[key: string]: {\n\t\t\t\t\ttype: string;\n\t\t\t\t\toptional?: boolean;\n\t\t\t\t};\n\t\t\t};\n\t\t\tfield_order?: string[];\n\t\t};\n\t};\n};\n/*\n * Populated in `main` function\n */\nlet oidSchema: oidSchemaContents;\n\n// --- Utility Functions ---\nfunction oidArrayToString(oid: (string | number)[]): string {\n\treturn(oid.join('.'));\n}\nfunction toConstantCase(str: string): string {\n\treturn(str.replace(/[A-Z]/g, function(part) {\n\t\treturn(`_${part}`);\n\t}).toUpperCase());\n}\nfunction toPascalCase(str: string): string {\n\treturn(str.split(/[_-]/).map(function(part) {\n\t\treturn(part.charAt(0).toUpperCase() + part.slice(1));\n\t}).join(''));\n}\nfunction toSnakeCase(str: string): string {\n\treturn(str.replace(/([A-Z])/g, '_$1').toLowerCase().replace(/^_/, ''));\n}\n\n// --- Type Resolution ---\nfunction resolveTypeReference(typeName: string): string {\n\tif (typeName.startsWith('SEQUENCE OF ')) {\n\t\treturn(`${resolveTypeReference(typeName.substring('SEQUENCE OF '.length).trim())}[]`);\n\t}\n\tswitch (typeName.trim()) {\n\t\tcase 'UTF8String':\n\t\tcase 'Utf8String':\n\t\t\treturn('string');\n\t\tcase 'GeneralizedTime':\n\t\t\treturn('Date');\n\t\tcase 'BOOLEAN':\n\t\t\treturn('boolean');\n\t\tcase 'ENUMERATED':\n\t\t\treturn('string');\n\t\tcase 'OBJECT IDENTIFIER':\n\t\t\treturn('ASN1.ASN1OID');\n\t\tcase 'OCTET STRING':\n\t\t\treturn('Buffer');\n\t\tdefault:\n\t\t\treturn(toPascalCase(typeName));\n\t}\n}\n\nfunction resolveToBaseType(typeName: string): string {\n\ttypeName = typeName.trim();\n\n\t// Check if it's a primitive type first\n\tif (/^(UTF8String|Utf8String|GeneralizedTime|BOOLEAN)$/i.test(typeName)) {\n\t\treturn(typeName);\n\t}\n\n\t// Check if it's defined as a sensitive attribute\n\tconst sensitiveAttr = oidSchema.sensitive_attributes[typeName] ?? Object.values(oidSchema.sensitive_attributes).find(function(attr) {\n\t\treturn(attr.token === typeName);\n\t});\n\n\tif (sensitiveAttr && !sensitiveAttr.fields && !sensitiveAttr.choices) {\n\t\tif (sensitiveAttr.type === undefined) {\n\t\t\tthrow(new Error(`Sensitive attribute ${typeName} has no defined type.`));\n\t\t}\n\t\treturn(resolveToBaseType(sensitiveAttr.type));\n\t}\n\n\t// Check if it's an ISO20022 primitive\n\tconst primitive = oidSchema.iso20022_types.primitives[typeName];\n\tif (primitive) {\n\t\treturn(resolveToBaseType(primitive.type));\n\t}\n\n\t// Otherwise return as-is\n\treturn(typeName);\n}\n\nfunction isEnumerationType(typeName: string): boolean {\n\tconst normalized = toSnakeCase(typeName);\n\treturn(Boolean(\n\t\toidSchema.iso20022_types.enumerations[typeName] ??\n\t\toidSchema.iso20022_types.enumerations[normalized]\n\t));\n}\n\nfunction isSequenceOfChoice(config: { fields: { [key: string]: { optional?: boolean }}}): boolean {\n\tconst hasFields = config.fields && Object.keys(config.fields).length > 0;\n\tconst allOptional = hasFields && Object.values(config.fields).every(function(field) {\n\t\treturn(field.optional);\n\t});\n\treturn(allOptional);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction _ignore_getPrimitiveType(type: string): 'string' | 'date' {\n\tif (type === 'UTF8String' || type === 'Utf8String') {\n\t\treturn('string');\n\t}\n\tif (type === 'GeneralizedTime') {\n\t\treturn('date');\n\t}\n\treturn('string');\n}\n\n// --- Output Generators ---\nfunction genHeader(comment: string) {\n\treturn([\n\t\t'/* eslint-disable */',\n\t\t'/**',\n\t\t` * ${comment}`,\n\t\t' * This file is auto-generated from oids.json.',\n\t\t' */',\n\t\t''\n\t].join('\\n'));\n}\n\nfunction genTypeAlias(name: string, type: string, description: string, oid: string): string {\n\treturn(`/** ${description} */\\n/** OID: ${oid} */\\nexport type ${name} = ${type};\\n`);\n}\n\nfunction genEnumType(name: string, values: string[], description: string, oid: string): string {\n\treturn(`/** ${description} */\\n/** OID: ${oid} */\\nexport type ${name} = ${values.map(function(value) {\n\t\treturn(`'${value}'`);\n\t}).join(' | ')};\\n`);\n}\n\nfunction genInterface(name: string, fields: { [key: string]: { type: string; optional?: boolean }}, description: string, oid: string): string {\n\tconst fieldLines = Object.entries(fields).map(function([fieldName, fieldConfig]) {\n\t\treturn(`\\t${fieldName}${fieldConfig.optional ? '?' : ''}: ${resolveTypeReference(fieldConfig.type)};`);\n\t});\n\treturn(`/** ${description} */\\n/** OID: ${oid} */\\nexport interface ${name} {\\n${fieldLines.join('\\n')}\\n}\\n`);\n}\n\n// Generate TypeScript **types** for sequence-of-choice\nfunction genSequenceOfChoiceTypes(name: string, config: { fields: { [key: string]: { type: string; optional?: boolean }}; field_order?: string[] }): string {\n\tconst typeName = toPascalCase(name);\n\tconst fieldOrder = config.field_order ?? Object.keys(config.fields);\n\tconst choiceEntries = fieldOrder.map(function(fieldName): [string, { type: string; optional?: boolean }] {\n\t\tif (!(fieldName in config.fields) || config.fields[fieldName] === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\t\treturn([fieldName, config.fields[fieldName]]);\n\t});\n\tconst choiceTypes = choiceEntries.map(function([fieldName, fieldConfig], index) {\n\t\tif (fieldConfig === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\t\tconst fieldType = resolveTypeReference(fieldConfig.type);\n\t\tconst choiceTypeName = `${typeName}${toPascalCase(fieldName)}Choice`;\n\t\treturn({\n\t\t\tcode: `export interface ${choiceTypeName} {\\n\\ttag: ${index};\\n\\tname: '${fieldName}';\\n\\tvalue: ${fieldType};\\n}\\n`,\n\t\t\tname: choiceTypeName\n\t\t});\n\t});\n\n\tlet out = '';\n\t// Individual choice interfaces\n\tout += choiceTypes.map(function(choiceInfo) {\n\t\treturn(choiceInfo.code);\n\t}).join('\\n');\n\n\t// Union type\n\tout += `export type ${typeName}Choice =\\n\\t| ${choiceTypes.map(function(choiceInfo) {\n\t\treturn(choiceInfo.name);\n\t}).join('\\n\\t| ')};\\n\\n`;\n\n\t// Main type is array of choices\n\tout += `export type ${typeName} = ${typeName}Choice[];\\n\\n`;\n\n\treturn(out);\n}\n\n// Generate ASN.1 **schema** for sequence-of-choice\nfunction genSequenceOfChoiceSchema(name: string, config: { fields: { [key: string]: { type: string; optional?: boolean }}; field_order?: string[] }): string {\n\tconst typeName = toPascalCase(name);\n\tconst fieldOrder = config.field_order ?? Object.keys(config.fields);\n\tconst choiceEntries = fieldOrder.map(function(fieldName): [string, { type: string; optional?: boolean }] {\n\t\tif (!(fieldName in config.fields) || config.fields[fieldName] === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\t\treturn([fieldName, config.fields[fieldName]]);\n\t});\n\n\tlet out = '';\n\n\t// ASN.1 schema\n\tout += `/** ASN.1 schema for ${typeName} */\\n`;\n\tout += `export const ${typeName}Schema: ASN1.Schema = {\\n\\tsequenceOf: {\\n\\t\\tchoice: [\\n`;\n\tout += choiceEntries.map(function([fieldName, fieldConfig], index) {\n\t\tif (fieldConfig === undefined) {\n\t\t\tthrow(new Error(`Field ${fieldName} not found in sequence of choice ${name}`));\n\t\t}\n\n\t\t// Determine the type for this choice\n\t\tlet fieldType = fieldConfig.type.trim();\n\t\tif (fieldType.startsWith('SEQUENCE OF ')) {\n\t\t\tfieldType = fieldType.substring('SEQUENCE OF '.length).trim();\n\t\t}\n\t\tfieldType = fieldType.replace(/\\[\\]$/, '');\n\n\t\tconst fieldTypePascal = toPascalCase(fieldType);\n\t\tconst fieldTypeSnake = toSnakeCase(fieldType);\n\n\t\t// Check if this is a complex type that has a schema\n\t\tconst isChoice = oidSchema.iso20022_types.choices[fieldTypeSnake] ?? oidSchema.iso20022_types.choices[fieldType];\n\t\tconst isSequence = oidSchema.iso20022_types.sequences[fieldTypeSnake] ?? oidSchema.iso20022_types.sequences[fieldType];\n\t\tconst isSensitiveSequence = oidSchema.sensitive_attributes[fieldTypeSnake]?.fields;\n\t\tconst isSensitiveChoice = oidSchema.sensitive_attributes[fieldTypeSnake]?.choices;\n\t\tconst hasSchema = isChoice ?? isSequence ?? isSensitiveSequence ?? isSensitiveChoice;\n\n\t\tlet contains;\n\t\tif (hasSchema) {\n\t\t\tcontains = `${fieldTypePascal}Schema`;\n\t\t} else {\n\t\t\t// Primitive type\n\t\t\tcontains = `{ type: 'string', kind: 'utf8' }`;\n\t\t}\n\n\t\treturn(`\\t\\t\\t{ type: 'context', kind: 'explicit', value: ${index}, contains: ${contains} }`);\n\t}).join(',\\n');\n\tout += `\\n\\t\\t]\\n\\t}\\n};\\n\\n`;\n\n\t// Field names array\n\tout += `export const ${typeName}Fields = [\\n${fieldOrder.map(function(fieldName){\n\t\treturn(`\\t'${fieldName}'`);\n\t}).join(',\\n')}\\n] as const;\\n\\n`;\n\n\treturn(out);\n}\n\nfunction deleteLastCommaIfFoundGenerator(lines: string[]) {\n\treturn(function deleteLastCommaIfFound() {\n\t\tlet lastLine = lines.pop();\n\t\tif (lastLine === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tif (lastLine.endsWith(',')) {\n\t\t\tlastLine = lastLine.slice(0, -1);\n\t\t}\n\t\tlines.push(lastLine);\n\t});\n}\n\n\n// --- Main Generation ---\nfunction generateOidConstants() {\n\tconst lines = [genHeader('Generated OID Constants')];\n\tconst deleteLastCommaIfFound = deleteLastCommaIfFoundGenerator(lines);\n\n\t// Algorithm OID constants\n\tlines.push('// Algorithm OID constants');\n\tfor (const [name, oid] of Object.entries(oidSchema.algorithms)) {\n\t\tlines.push(`export const ${toConstantCase(name.replace(/-/g, '_'))} = '${oidArrayToString(oid)}';`);\n\t}\n\tlines.push('');\n\n\t// Plain attribute OID constants\n\tlines.push('// Plain attribute OID constants');\n\tfor (const [name, config] of Object.entries(oidSchema.plain_attributes)) {\n\t\tlines.push(`/** ${config.description} */`);\n\t\tlines.push(`/** @see ${config.reference} */`);\n\t\tlines.push(`export const ${toConstantCase(name)} = '${oidArrayToString(config.oid)}';`);\n\t}\n\tlines.push('');\n\n\t// Keeta namespace for sensitive attributes\n\tlines.push('// Keeta-specific OID constants');\n\tlines.push('// eslint-disable-next-line @typescript-eslint/no-namespace');\n\tlines.push('export namespace keeta {');\n\tfor (const [name, config] of Object.entries(oidSchema.extensions)) {\n\t\tlines.push(`\\t/** ${config.description} */`);\n\t\tif (config.reference) {\n\t\t\tlines.push(`\\t/** @see ${config.reference} */`);\n\t\t}\n\t\tif (config.oid) {\n\t\t\tlines.push(`\\texport const ${toConstantCase(name)} = '${oidArrayToString(config.oid)}';`);\n\t\t}\n\t}\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t/** ${config.description} */`);\n\t\tlines.push(`\\t/** @see ${config.reference} */`);\n\t\tlines.push(`\\texport const ${toConstantCase(name)} = '${oidArrayToString(config.oid)}';`);\n\t}\n\tlines.push('}');\n\tlines.push('');\n\n\t// Lookup maps\n\tlines.push('// OID to name lookup maps');\n\tlines.push('export const OID_TO_NAME: { [key: string]: string } = {');\n\tfor (const [name, config] of Object.entries({\n\t\t...oidSchema.plain_attributes,\n\t\t...oidSchema.sensitive_attributes\n\t})) {\n\t\tlines.push(`\\t'${oidArrayToString(config.oid)}': '${name}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('};');\n\tlines.push('');\n\tlines.push('export const NAME_TO_OID: { [key: string]: string } = {');\n\tfor (const [name, config] of Object.entries({\n\t\t...oidSchema.plain_attributes,\n\t\t...oidSchema.sensitive_attributes\n\t})) {\n\t\tlines.push(`\\t'${name}': '${oidArrayToString(config.oid)}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('};');\n\tlines.push('');\n\n\treturn(lines.join('\\n'));\n}\n\nfunction genSequenceSchema(typeName: string, fields: { [key: string]: { type: string; optional?: boolean }}, config: { field_order?: string[] }) {\n\tconst fieldOrder = config?.field_order ?? Object.keys(fields);\n\tconst structFields: { [key: string]: { schema: string; optional: boolean; isChoice: boolean }} = {};\n\n\tfor (const fname of fieldOrder) {\n\t\tconst fcfg = fields[fname];\n\t\tif (!fcfg) {continue;}\n\n\t\t// Resolve to base type to handle aliases\n\t\tconst baseType = resolveToBaseType(fcfg.type);\n\n\t\tlet fieldSchema;\n\t\tlet isChoiceType = false;\n\n\t\t// Check if field type is GeneralizedTime (date)\n\t\tif (baseType === 'GeneralizedTime') {\n\t\t\tfieldSchema = 'ASN1.ValidateASN1.IsAnyDate';\n\t\t} else if (baseType === 'BOOLEAN') {\n\t\t\tfieldSchema = 'ASN1.ValidateASN1.IsBoolean';\n\t\t} else {\n\t\t\t// Check if this is a SEQUENCE OF type directly or via type reference\n\t\t\tlet fieldType = baseType.trim();\n\t\t\tconst isSequenceOf = fieldType.startsWith('SEQUENCE OF ');\n\t\t\tif (isSequenceOf) {\n\t\t\t\tfieldType = fieldType.substring('SEQUENCE OF '.length).trim();\n\t\t\t}\n\n\t\t\tfieldType = fieldType.replace(/\\[\\]$/, '');\n\n\t\t\tconst fieldTypePascal = toPascalCase(fieldType);\n\t\t\tconst fieldTypeSnake = toSnakeCase(fieldType);\n\n\t\t\t// Check if this is a COMPLEX type (not a primitive)\n\t\t\tconst isChoice = oidSchema.iso20022_types.choices[fieldTypeSnake] ?? oidSchema.iso20022_types.choices[fieldType];\n\t\t\tconst isSequence = oidSchema.iso20022_types.sequences[fieldTypeSnake] ?? oidSchema.iso20022_types.sequences[fieldType];\n\t\t\tconst isSensitiveSequence = oidSchema.sensitive_attributes[fieldTypeSnake]?.fields;\n\t\t\tconst isSensitiveChoice = oidSchema.sensitive_attributes[fieldTypeSnake]?.choices;\n\t\t\tconst isExtension = oidSchema.extensions[fieldTypeSnake]?.fields ?? oidSchema.extensions[fieldType]?.fields;\n\n\t\t\tconst hasSchema = isChoice ?? isSequence ?? isSensitiveSequence ?? isSensitiveChoice ?? isExtension;\n\t\t\tisChoiceType = !!(isChoice ?? isSensitiveChoice);\n\n\t\t\tif (hasSchema) {\n\t\t\t\tfieldSchema = `${fieldTypePascal}Schema`;\n\t\t\t} else {\n\t\t\t\t// Primitive type - use inline schema\n\t\t\t\tif (fieldType === 'OBJECT IDENTIFIER') {\n\t\t\t\t\tfieldSchema = `ASN1.ValidateASN1.IsOID`;\n\t\t\t\t} else if (fieldType === 'OCTET STRING') {\n\t\t\t\t\tfieldSchema = `ASN1.ValidateASN1.IsOctetString`;\n\t\t\t\t} else {\n\t\t\t\t\tfieldSchema = `{ type: 'string', kind: 'utf8' }`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Wrap in sequenceOf if this was a SEQUENCE OF type\n\t\t\tif (isSequenceOf) {\n\t\t\t\tfieldSchema = `{ sequenceOf: ${fieldSchema} }`;\n\t\t\t}\n\t\t}\n\n\t\t// Store field metadata\n\t\tstructFields[fname] = {\n\t\t\tschema: fieldSchema,\n\t\t\toptional: fcfg.optional ?? false,\n\t\t\tisChoice: isChoiceType\n\t\t};\n\t}\n\n\t// Check if ANY field is optional - if so, ALL fields need context tags for proper ordering\n\tconst hasAnyOptionalField = fieldOrder.some(function(fname) {\n\t\tconst fieldInfo = structFields[fname];\n\t\treturn(fieldInfo?.optional ?? false);\n\t});\n\n\tconst containsObject = fieldOrder.map(function(fname, index) {\n\t\tconst fieldInfo = structFields[fname];\n\t\tif (!fieldInfo) {\n\t\t\tthrow(new Error(`Field ${fname} not found in structFields`));\n\t\t}\n\n\t\tconst baseSchema = fieldInfo.schema;\n\t\tconst isOptional = fieldInfo.optional;\n\t\tconst isChoiceField = fieldInfo.isChoice;\n\t\tif (hasAnyOptionalField && !isChoiceField) {\n\t\t\tconst wrappedInContext = `{ type: 'context', kind: 'explicit', value: ${index}, contains: ${baseSchema} }`;\n\t\t\tif (isOptional) {\n\t\t\t\treturn(`\\t\\t${fname}: { optional: ${wrappedInContext} }`);\n\t\t\t} else {\n\t\t\t\treturn(`\\t\\t${fname}: ${wrappedInContext}`);\n\t\t\t}\n\t\t} else if (isOptional) {\n\t\t\treturn(`\\t\\t${fname}: { optional: ${baseSchema} }`);\n\t\t} else {\n\t\t\treturn(`\\t\\t${fname}: ${baseSchema}`);\n\t\t}\n\t}).join(',\\n');\n\n\treturn(`export const ${typeName}Schema: ASN1.Schema = {\\n\\ttype: 'struct',\\n\\tfieldNames: [${fieldOrder.map(f => `'${f}'`).join(', ')}],\\n\\tcontains: {\\n${containsObject}\\n\\t}\\n};`);\n}\n\nfunction generateIso20022Types() {\n\tconst lines = [\n\t\tgenHeader('Generated ISO20022 Type Definitions'),\n\t\t\"import * as ASN1 from '../../lib/utils/asn1.js';\",\n\t\t\"import { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';\",\n\t\t'type KeetaNetAccount = InstanceType<typeof KeetaNetLib.Account>;',\n\t\t''\n\t];\n\tconst deleteLastCommaIfFound = deleteLastCommaIfFoundGenerator(lines);\n\n\t// Primitives\n\tlines.push('// ISO20022 Primitive Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.primitives)) {\n\t\tlines.push(genTypeAlias(toPascalCase(name), resolveTypeReference(config.type), config.description, oidArrayToString(config.oid)));\n\t}\n\n\t// Enumerations\n\tlines.push('// ISO20022 Enumeration Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.enumerations)) {\n\t\tlines.push(genEnumType(toPascalCase(name), config.values, config.description, oidArrayToString(config.oid)));\n\t}\n\n\t// Choices\n\tlines.push('// ISO20022 Choice Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.choices)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tconst choices = Object.entries(config.choices ?? {});\n\t\tconst hasComplexTypes = choices.some(function([_ignore_choiceName, choiceConfig]) {\n\t\t\tconst choiceType = choiceConfig.type.trim();\n\t\t\treturn(choiceType !== 'UTF8String' && choiceType !== 'string');\n\t\t});\n\t\tif (hasComplexTypes) {\n\t\t\tconst unionTypes = Array.from(new Set(choices.map(function([_ignore_choiceName, choiceConfig]) {\n\t\t\t\treturn(resolveTypeReference(choiceConfig.type.trim()));\n\t\t\t})));\n\t\t\tlines.push(genTypeAlias(typeName, unionTypes.join(' | '), config.description, oidArrayToString(config.oid)));\n\t\t} else {\n\t\t\tlines.push(genTypeAlias(typeName, 'string', config.description, oidArrayToString(config.oid)));\n\t\t}\n\t}\n\n\t// ISO20022 Sequences and Sequence-of-Choice Types\n\tlines.push('// ISO20022 Sequence Types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.sequences)) {\n\t\tif (isSequenceOfChoice(config)) {\n\t\t\tlines.push(genSequenceOfChoiceTypes(name, config));\n\t\t} else {\n\t\t\tlines.push(genInterface(toPascalCase(name), config.fields, config.description, oidArrayToString(config.oid)));\n\t\t}\n\t}\n\tlines.push('');\n\n\t// --- Choice Type Schemas ---\n\tlines.push('// Generated ASN.1 schemas for ISO 20022 choice types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.choices)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tconst choices = Object.entries(config.choices ?? {});\n\n\t\tlines.push(`/** ASN.1 schema for ${typeName} */`);\n\n\t\tif (choices.length === 0) {\n\t\t\t// No choices defined - simple string schema\n\t\t\tlines.push(`export const ${typeName}Schema: ASN1.Schema = { type: 'string', kind: 'utf8' };`);\n\t\t} else {\n\t\t\t// Generate choice schema with context tags to make them differentiable\n\t\t\tconst choiceSchemas = choices.map(function([_ignore_choiceName, choiceConfig], index) {\n\t\t\t\tconst choiceType = choiceConfig.type.trim();\n\t\t\t\tlet containsSchema;\n\n\t\t\t\t// Check if it is a primitive type\n\t\t\t\tif (choiceType === 'UTF8String' || choiceType === 'Utf8String' || choiceType === 'string' || isEnumerationType(choiceType)) {\n\t\t\t\t\tcontainsSchema = `{ type: 'string', kind: 'utf8' }`;\n\t\t\t\t} else {\n\t\t\t\t\t// Complex type - reference its schema\n\t\t\t\t\tconst choiceTypeName = toPascalCase(choiceType);\n\t\t\t\t\tcontainsSchema = `${choiceTypeName}Schema`;\n\t\t\t\t}\n\n\t\t\t\t// Wrap in context tag to make it differentiable\n\t\t\t\treturn(`{ type: 'context', kind: 'explicit', value: ${index}, contains: ${containsSchema} }`);\n\t\t\t});\n\n\t\t\tlines.push(`export const ${typeName}Schema: ASN1.Schema = {`);\n\t\t\tlines.push(`\\tchoice: [`);\n\t\t\tlines.push(`\\t\\t${choiceSchemas.join(',\\n\\t\\t')}`);\n\t\t\tlines.push(`\\t]`);\n\t\t\tlines.push(`};`);\n\t\t}\n\t\tlines.push('');\n\t}\n\n\t// --- Regular Sequence Type Schemas (SECOND - may depend on choice schemas) ---\n\tlines.push('// Generated ASN.1 schemas for ISO 20022 regular sequence types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.sequences)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (config.fields && !isSequenceOfChoice(config)) {\n\t\t\tlines.push(`/** ASN.1 schema for ${typeName} */`);\n\t\t\tlines.push(genSequenceSchema(typeName, config.fields, config));\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// --- Sequence-of-Choice Type Schemas (THIRD - depend on regular sequence schemas) ---\n\tlines.push('// Generated ASN.1 schemas for ISO 20022 sequence-of-choice types');\n\tfor (const [name, config] of Object.entries(oidSchema.iso20022_types.sequences)) {\n\t\tif (isSequenceOfChoice(config)) {\n\t\t\tlines.push(genSequenceOfChoiceSchema(name, config));\n\t\t}\n\t}\n\n\t// --- Choice-Type Sensitive Attribute Schemas ---\n\tlines.push('// Generated ASN.1 schemas for choice-type sensitive attributes');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (config.choices) {\n\t\t\tconst choiceSchemas = Object.values(config.choices).map(function(choice) {\n\t\t\t\tconst choiceTypeName = toPascalCase(choice.type.trim());\n\t\t\t\treturn(`${choiceTypeName}Schema`);\n\t\t\t});\n\t\t\tlines.push(`/** ASN.1 schema for ${typeName} */`);\n\t\t\tlines.push(`export const ${typeName}Schema: ASN1.Schema = {`);\n\t\t\tlines.push(`\\tchoice: [`);\n\t\t\tlines.push(`\\t\\t${choiceSchemas.join(',\\n\\t\\t')}`);\n\t\t\tlines.push(`\\t]`);\n\t\t\tlines.push(`};`);\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Sensitive Attribute Types\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (!config.fields && !config.choices) {\n\t\t\t// Primitive type\n\t\t\tlet baseType;\n\t\t\tif (config.type === 'UTF8String' || config.type === 'Utf8String') {\n\t\t\t\tbaseType = 'string';\n\t\t\t} else if (config.type === 'GeneralizedTime') {\n\t\t\t\tbaseType = 'Date';\n\t\t\t} else if (config.type === 'BOOLEAN') {\n\t\t\t\tbaseType = 'boolean';\n\t\t\t} else {\n\t\t\t\tif (config.type === undefined) {\n\t\t\t\t\tthrow(new Error(`Sensitive attribute ${name} has no defined type.`));\n\t\t\t\t}\n\t\t\t\tbaseType = toPascalCase(config.type);\n\t\t\t}\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\tlines.push(`export type ${typeName} = ${baseType};`);\n\t\t\tlines.push('');\n\t\t} else if (config.fields) {\n\t\t\t// Sequence type\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\tlines.push(`export interface ${typeName} {`);\n\t\t\tfor (const [fieldName, fieldConfig] of Object.entries(config.fields)) {\n\t\t\t\tconst optional = fieldConfig.optional ? '?' : '';\n\t\t\t\tconst resolvedType = resolveTypeReference(fieldConfig.type);\n\t\t\t\tlines.push(`\\t${fieldName}${optional}: ${resolvedType};`);\n\t\t\t}\n\t\t\tlines.push('}');\n\t\t\tlines.push('');\n\t\t} else if (config.choices) {\n\t\t\t// Choice type\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\tconst hasComplexTypes = Object.values(config.choices).some(function(choice) {\n\t\t\t\tconst choiceType = choice.type.trim();\n\t\t\t\treturn(choiceType !== 'UTF8String' && choiceType !== 'string');\n\t\t\t});\n\t\t\tif (hasComplexTypes) {\n\t\t\t\tconst unionTypes = Object.values(config.choices).map(function(choice) {\n\t\t\t\t\treturn(toPascalCase(choice.type.trim()));\n\t\t\t\t});\n\t\t\t\tlines.push(`export type ${typeName} = ${unionTypes.join(' | ')};`);\n\t\t\t} else {\n\t\t\t\tlines.push(`export type ${typeName} = string;`);\n\t\t\t}\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Extension Types with fields\n\tfor (const [name, config] of Object.entries(oidSchema.extensions)) {\n\t\tif (config.fields) {\n\t\t\tconst typeName = toPascalCase(name);\n\t\t\tlines.push(`/** ${config.description} */`);\n\t\t\tif (config.oid) {\n\t\t\t\tlines.push(`/** OID: ${oidArrayToString(config.oid)} */`);\n\t\t\t}\n\t\t\tlines.push(`export interface ${typeName} {`);\n\t\t\tfor (const [fieldName, fieldConfig] of Object.entries(config.fields)) {\n\t\t\t\tconst optional = fieldConfig.optional ? '?' : '';\n\t\t\t\tconst resolvedType = resolveTypeReference(fieldConfig.type);\n\t\t\t\tlines.push(`\\t${fieldName}${optional}: ${resolvedType};`);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * The \"Reference\" type is a special case where we inject\n\t\t\t * some additional attributes when decoding.\n\t\t\t */\n\t\t\tif (typeName === 'Reference') {\n\t\t\t\tlines.push('\\t/**');\n\t\t\t\tlines.push('\\t * TODOC');\n\t\t\t\tlines.push('\\t */');\n\t\t\t\tlines.push('\\t$blob: (principals?: KeetaNetAccount[]) => Promise<Blob>;');\n\t\t\t}\n\t\t\tlines.push('}');\n\t\t\tlines.push('');\n\t\t\t// Schema\n\t\t\tlines.push(genSequenceSchema(typeName, config.fields, config));\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Token aliases for sensitive attributes\n\tlines.push('// Token aliases for sensitive attributes');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tif (config.token && config.token !== toPascalCase(name)) {\n\t\t\tconst typeName = toPascalCase(name);\n\t\t\tconst tokenName = config.token;\n\t\t\tlines.push(`/** Alias for ${typeName} */`);\n\t\t\tlines.push(`export type ${tokenName} = ${typeName};`);\n\t\t\tlines.push('');\n\t\t}\n\t}\n\n\t// Union type, value map, helper generic\n\tlines.push('/** Union type of all sensitive attribute types */');\n\tlines.push('export type SensitiveAttributeType =');\n\tlines.push(Object.keys(oidSchema.sensitive_attributes).map(function(name) {\n\t\treturn(`\\t| ${toPascalCase(name)}`);\n\t}).join('\\n') + ';');\n\tlines.push('');\n\tlines.push('/** Map of attribute name to acceptable input type for CertificateBuilder.setAttribute */');\n\tlines.push('export interface CertificateAttributeValueMap {');\n\tfor (const [name] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${name}': ${toPascalCase(name)};`);\n\t}\n\tlines.push('}');\n\tlines.push('');\n\tlines.push('/** Helper generic to get attribute value type by name */');\n\tlines.push('export type CertificateAttributeValue<Name extends keyof CertificateAttributeValueMap> = CertificateAttributeValueMap[Name];');\n\tlines.push('');\n\n\t// Field arrays and schemas for sequence types\n\t// Sort to ensure dependencies are defined before they're used\n\tconst sensitiveAttrEntries = Object.entries(oidSchema.sensitive_attributes);\n\tconst sortedEntries: [string, typeof sensitiveAttrEntries[0][1]][] = [];\n\tconst processed = new Set<string>();\n\n\tfunction hasDependency(config: typeof sensitiveAttrEntries[0][1], depName: string): boolean {\n\t\tif (!config.fields) {return(false);}\n\t\treturn(Object.values(config.fields).some(field => {\n\t\t\tconst fieldType = field.type.trim();\n\t\t\treturn(fieldType === toPascalCase(depName) || fieldType === depName);\n\t\t}));\n\t}\n\n\t// Process entries, dependencies first\n\twhile (sortedEntries.length < sensitiveAttrEntries.length) {\n\t\tfor (const [name, config] of sensitiveAttrEntries) {\n\t\t\tif (processed.has(name)) {continue;}\n\n\t\t\t// Check if all dependencies are processed\n\t\t\tlet allDepsProcessed = true;\n\t\t\tif (config.fields) {\n\t\t\t\tfor (const [otherName] of sensitiveAttrEntries) {\n\t\t\t\t\tif (otherName === name || processed.has(otherName)) {continue;}\n\t\t\t\t\tif (hasDependency(config, otherName)) {\n\t\t\t\t\t\tallDepsProcessed = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (allDepsProcessed) {\n\t\t\t\tsortedEntries.push([name, config]);\n\t\t\t\tprocessed.add(name);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const [name, config] of sortedEntries) {\n\t\tconst typeName = toPascalCase(name);\n\t\tif (config.fields) {\n\t\t\tconst fieldOrder = config.field_order ?? Object.keys(config.fields);\n\t\t\tlines.push(`export const ${typeName}Fields = [${fieldOrder.map(function(field) {\n\t\t\t\treturn(`'${field}'`);\n\t\t\t}).join(', ')}] as const;`);\n\t\t\tlines.push(genSequenceSchema(typeName, config.fields, config));\n\t\t}\n\t}\n\n\t// OID DB\n\tlines.push('export const CertificateAttributeOIDDB = {');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${name}': '${oidArrayToString(config.oid)}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('} as const;');\n\tlines.push('');\n\n\t// Sensitive attribute list\n\tlines.push('export const SENSITIVE_CERTIFICATE_ATTRIBUTES = [');\n\tfor (const name of Object.keys(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${name}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('] as const;');\n\tlines.push('');\n\n\tlines.push('export type SensitiveCertificateAttributeNames = typeof SENSITIVE_CERTIFICATE_ATTRIBUTES[number];');\n\tlines.push('');\n\n\t// PascalCase names\n\tlines.push('export const SensitiveCertificateAttributeNames = [');\n\tfor (const name of Object.keys(oidSchema.sensitive_attributes)) {\n\t\tlines.push(`\\t'${toPascalCase(name)}',`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('] as const;');\n\tlines.push('');\n\n\t// Field name mapping\n\tlines.push('export const CertificateAttributeFieldNames: { readonly [K in keyof typeof CertificateAttributeOIDDB]?: readonly string[] } = {');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tif (config.fields) {\n\t\t\tconst typeName = toPascalCase(name);\n\t\t\tlines.push(`\\t'${name}': ${typeName}Fields,`);\n\t\t}\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('} as const;');\n\tlines.push('');\n\n\t// Complete schema mapping (ONCE, at the end)\n\tlines.push('export const CertificateAttributeSchema: { readonly [K in keyof typeof CertificateAttributeOIDDB]: ASN1.Schema } = {');\n\tfor (const [name, config] of Object.entries(oidSchema.sensitive_attributes)) {\n\t\tconst typeName = toPascalCase(name);\n\t\tlet schemaRef;\n\t\tif (config.fields) {\n\t\t\tschemaRef = `${typeName}Schema`;\n\t\t} else if (config.choices) {\n\t\t\tschemaRef = `${typeName}Schema`;\n\t\t} else {\n\t\t\tif (config.type === undefined) {\n\t\t\t\tthrow(new Error(`Sensitive attribute ${name} has no defined type.`));\n\t\t\t}\n\t\t\tconst baseType = resolveToBaseType(config.type);\n\t\t\tconst baseTypeSnake = toSnakeCase(baseType);\n\t\t\tconst isExtensionType = oidSchema.extensions[baseTypeSnake]?.fields ?? oidSchema.extensions[baseType]?.fields;\n\t\t\tconst isSensitiveType = oidSchema.sensitive_attributes[toSnakeCase(baseType)]?.fields ?? oidSchema.sensitive_attributes[baseType]?.fields;\n\n\t\t\tif (isSensitiveType) {\n\t\t\t\tschemaRef = `${baseType}Schema`;\n\t\t\t} else if (isExtensionType) {\n\t\t\t\tschemaRef = `${baseType}Schema`;\n\t\t\t} else if (baseType === 'GeneralizedTime') {\n\t\t\t\tschemaRef = 'ASN1.ValidateASN1.IsAnyDate';\n\t\t\t} else if (baseType === 'BOOLEAN') {\n\t\t\t\tschemaRef = 'ASN1.ValidateASN1.IsBoolean';\n\t\t\t} else if (baseType === 'OCTET STRING') {\n\t\t\t\tschemaRef = 'ASN1.ValidateASN1.IsOctetString';\n\t\t\t} else if (baseType === 'OBJECT IDENTIFIER') {\n\t\t\t\tschemaRef = 'ASN1.ValidateASN1.IsOID';\n\t\t\t} else {\n\t\t\t\tschemaRef = `{ type: 'string', kind: 'utf8' }`;\n\t\t\t}\n\t\t}\n\t\tlines.push(`\\t'${name}': ${schemaRef},`);\n\t}\n\tdeleteLastCommaIfFound();\n\tlines.push('} as const;');\n\tlines.push('');\n\n\treturn(lines.join('\\n'));\n}\n\nfunction parseArgs(argv: string[]): { oidsJSONPath: string; oidsOutputPath: string; iso20022OutputPath: string } {\n\tlet oidsJSONPath: string | undefined = undefined;\n\tlet oidsOutputPath: string | undefined = undefined;\n\tlet iso20022OutputPath: string | undefined = undefined;\n\tfor (const arg of argv) {\n\t\tif (arg.startsWith('--oids-json=')) {\n\t\t\toidsJSONPath = arg.substring('--oids-json='.length);\n\t\t}\n\t\tif (arg.startsWith('--oids-output=')) {\n\t\t\toidsOutputPath = arg.substring('--oids-output='.length);\n\t\t}\n\t\tif (arg.startsWith('--iso20022-output=')) {\n\t\t\tiso20022OutputPath = arg.substring('--iso20022-output='.length);\n\t\t}\n\t}\n\n\tif (oidsJSONPath === undefined) {\n\t\tthrow(new Error('Missing required argument: --oids-json=path/to/oids.json'));\n\t}\n\tif (oidsOutputPath === undefined) {\n\t\tthrow(new Error('Missing required argument: --oids-output=path/to/oids.generated.ts'));\n\t}\n\tif (iso20022OutputPath === undefined) {\n\t\tthrow(new Error('Missing required argument: --iso20022-output=path/to/iso20022.generated.ts'));\n\t}\n\tif (!fs.existsSync(oidsJSONPath)) {\n\t\tthrow(new Error(`OID JSON file not found: ${oidsJSONPath}`));\n\t}\n\treturn({\n\t\toidsJSONPath,\n\t\toidsOutputPath,\n\t\tiso20022OutputPath\n\t});\n}\n\n// --- Main ---\nfunction main(argv: string[]): void {\n\tconst {\n\t\toidsJSONPath,\n\t\toidsOutputPath,\n\t\tiso20022OutputPath\n\t} = parseArgs(argv);\n\n\tfs.mkdirSync(path.dirname(oidsOutputPath), { recursive: true });\n\tfs.mkdirSync(path.dirname(iso20022OutputPath), { recursive: true });\n\n\toidSchema = typia.assert<oidSchemaContents>(JSON.parse(fs.readFileSync(oidsJSONPath, 'utf8')));\n\n\tfs.writeFileSync(oidsOutputPath, generateOidConstants(), 'utf8');\n\tfs.writeFileSync(iso20022OutputPath, generateIso20022Types(), 'utf8');\n}\n\nmain(process.argv.slice(2));\n"]}