@open-captable-protocol/canton 0.2.70 → 0.2.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/OcpClient.d.ts +75 -55
- package/dist/OcpClient.d.ts.map +1 -1
- package/dist/OcpClient.js +63 -120
- package/dist/OcpClient.js.map +1 -1
- package/dist/functions/convertibleIssuance/archiveConvertibleIssuanceByIssuer.d.ts +4 -7
- package/dist/functions/convertibleIssuance/archiveConvertibleIssuanceByIssuer.d.ts.map +1 -1
- package/dist/functions/convertibleIssuance/archiveConvertibleIssuanceByIssuer.js +10 -16
- package/dist/functions/convertibleIssuance/archiveConvertibleIssuanceByIssuer.js.map +1 -1
- package/dist/functions/convertibleIssuance/createConvertibleIssuance.d.ts +0 -8
- package/dist/functions/convertibleIssuance/createConvertibleIssuance.d.ts.map +1 -1
- package/dist/functions/convertibleIssuance/createConvertibleIssuance.js +0 -25
- package/dist/functions/convertibleIssuance/createConvertibleIssuance.js.map +1 -1
- package/dist/functions/convertibleIssuance/getConvertibleIssuanceAsOcf.d.ts +1 -1
- package/dist/functions/convertibleIssuance/getConvertibleIssuanceAsOcf.d.ts.map +1 -1
- package/dist/functions/convertibleIssuance/getConvertibleIssuanceAsOcf.js +2 -4
- package/dist/functions/convertibleIssuance/getConvertibleIssuanceAsOcf.js.map +1 -1
- package/dist/functions/document/archiveDocumentByIssuer.d.ts +0 -7
- package/dist/functions/document/archiveDocumentByIssuer.d.ts.map +1 -1
- package/dist/functions/document/archiveDocumentByIssuer.js +0 -17
- package/dist/functions/document/archiveDocumentByIssuer.js.map +1 -1
- package/dist/functions/document/createDocument.d.ts.map +1 -1
- package/dist/functions/document/createDocument.js +81 -2
- package/dist/functions/document/createDocument.js.map +1 -1
- package/dist/functions/document/getDocumentAsOcf.d.ts.map +1 -1
- package/dist/functions/document/getDocumentAsOcf.js +77 -2
- package/dist/functions/document/getDocumentAsOcf.js.map +1 -1
- package/dist/functions/equityCompensationExercise/archiveEquityCompensationExerciseByIssuer.d.ts +9 -0
- package/dist/functions/equityCompensationExercise/archiveEquityCompensationExerciseByIssuer.d.ts.map +1 -0
- package/dist/functions/equityCompensationExercise/archiveEquityCompensationExerciseByIssuer.js +15 -0
- package/dist/functions/equityCompensationExercise/archiveEquityCompensationExerciseByIssuer.js.map +1 -0
- package/dist/functions/{stockPlan → equityCompensationExercise}/createEquityCompensationExercise.d.ts +0 -8
- package/dist/functions/equityCompensationExercise/createEquityCompensationExercise.d.ts.map +1 -0
- package/dist/functions/{stockPlan → equityCompensationExercise}/createEquityCompensationExercise.js +0 -18
- package/dist/functions/equityCompensationExercise/createEquityCompensationExercise.js.map +1 -0
- package/dist/functions/equityCompensationExercise/getEquityCompensationExerciseEventAsOcf.d.ts.map +1 -0
- package/dist/functions/equityCompensationExercise/getEquityCompensationExerciseEventAsOcf.js.map +1 -0
- package/dist/functions/equityCompensationExercise/index.d.ts +4 -0
- package/dist/functions/equityCompensationExercise/index.d.ts.map +1 -0
- package/dist/functions/{valuation → equityCompensationExercise}/index.js +3 -3
- package/dist/functions/equityCompensationExercise/index.js.map +1 -0
- package/dist/functions/equityCompensationIssuance/archiveEquityCompensationIssuanceByIssuer.d.ts +9 -0
- package/dist/functions/equityCompensationIssuance/archiveEquityCompensationIssuanceByIssuer.d.ts.map +1 -0
- package/dist/functions/equityCompensationIssuance/archiveEquityCompensationIssuanceByIssuer.js +15 -0
- package/dist/functions/equityCompensationIssuance/archiveEquityCompensationIssuanceByIssuer.js.map +1 -0
- package/dist/functions/{stockPlan → equityCompensationIssuance}/createEquityCompensationIssuance.d.ts +0 -8
- package/dist/functions/equityCompensationIssuance/createEquityCompensationIssuance.d.ts.map +1 -0
- package/dist/functions/equityCompensationIssuance/createEquityCompensationIssuance.js +73 -0
- package/dist/functions/equityCompensationIssuance/createEquityCompensationIssuance.js.map +1 -0
- package/dist/functions/{stockPlan → equityCompensationIssuance}/getEquityCompensationIssuanceEventAsOcf.d.ts +1 -1
- package/dist/functions/equityCompensationIssuance/getEquityCompensationIssuanceEventAsOcf.d.ts.map +1 -0
- package/dist/functions/{stockPlan → equityCompensationIssuance}/getEquityCompensationIssuanceEventAsOcf.js +4 -6
- package/dist/functions/equityCompensationIssuance/getEquityCompensationIssuanceEventAsOcf.js.map +1 -0
- package/dist/functions/equityCompensationIssuance/index.d.ts +4 -0
- package/dist/functions/equityCompensationIssuance/index.d.ts.map +1 -0
- package/dist/functions/equityCompensationIssuance/index.js +20 -0
- package/dist/functions/equityCompensationIssuance/index.js.map +1 -0
- package/dist/functions/index.d.ts +2 -1
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +2 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/issuer/archiveIssuerByIssuer.d.ts +9 -0
- package/dist/functions/issuer/archiveIssuerByIssuer.d.ts.map +1 -0
- package/dist/functions/issuer/archiveIssuerByIssuer.js +15 -0
- package/dist/functions/issuer/archiveIssuerByIssuer.js.map +1 -0
- package/dist/functions/issuer/createIssuer.d.ts +0 -50
- package/dist/functions/issuer/createIssuer.d.ts.map +1 -1
- package/dist/functions/issuer/createIssuer.js +60 -59
- package/dist/functions/issuer/createIssuer.js.map +1 -1
- package/dist/functions/issuer/getIssuerAsOcf.d.ts.map +1 -1
- package/dist/functions/issuer/getIssuerAsOcf.js +74 -1
- package/dist/functions/issuer/getIssuerAsOcf.js.map +1 -1
- package/dist/functions/issuer/index.d.ts +1 -2
- package/dist/functions/issuer/index.d.ts.map +1 -1
- package/dist/functions/issuer/index.js +1 -2
- package/dist/functions/issuer/index.js.map +1 -1
- package/dist/functions/issuerAuthorization/authorizeIssuer.d.ts.map +1 -0
- package/dist/functions/issuerAuthorization/authorizeIssuer.js.map +1 -0
- package/dist/functions/issuerAuthorization/index.d.ts +1 -0
- package/dist/functions/issuerAuthorization/index.d.ts.map +1 -1
- package/dist/functions/issuerAuthorization/index.js +1 -0
- package/dist/functions/issuerAuthorization/index.js.map +1 -1
- package/dist/functions/issuerAuthorizedSharesAdjustment/archiveIssuerAuthorizedSharesAdjustmentByIssuer.d.ts +4 -7
- package/dist/functions/issuerAuthorizedSharesAdjustment/archiveIssuerAuthorizedSharesAdjustmentByIssuer.d.ts.map +1 -1
- package/dist/functions/issuerAuthorizedSharesAdjustment/archiveIssuerAuthorizedSharesAdjustmentByIssuer.js +10 -16
- package/dist/functions/issuerAuthorizedSharesAdjustment/archiveIssuerAuthorizedSharesAdjustmentByIssuer.js.map +1 -1
- package/dist/functions/issuerAuthorizedSharesAdjustment/createIssuerAuthorizedSharesAdjustment.d.ts +0 -8
- package/dist/functions/issuerAuthorizedSharesAdjustment/createIssuerAuthorizedSharesAdjustment.d.ts.map +1 -1
- package/dist/functions/issuerAuthorizedSharesAdjustment/createIssuerAuthorizedSharesAdjustment.js +0 -18
- package/dist/functions/issuerAuthorizedSharesAdjustment/createIssuerAuthorizedSharesAdjustment.js.map +1 -1
- package/dist/functions/stakeholder/archiveStakeholderByIssuer.d.ts +0 -7
- package/dist/functions/stakeholder/archiveStakeholderByIssuer.d.ts.map +1 -1
- package/dist/functions/stakeholder/archiveStakeholderByIssuer.js +0 -17
- package/dist/functions/stakeholder/archiveStakeholderByIssuer.js.map +1 -1
- package/dist/functions/stakeholder/createStakeholder.d.ts +0 -11
- package/dist/functions/stakeholder/createStakeholder.d.ts.map +1 -1
- package/dist/functions/stakeholder/createStakeholder.js +111 -19
- package/dist/functions/stakeholder/createStakeholder.js.map +1 -1
- package/dist/functions/stakeholder/getStakeholderAsOcf.d.ts.map +1 -1
- package/dist/functions/stakeholder/getStakeholderAsOcf.js +113 -1
- package/dist/functions/stakeholder/getStakeholderAsOcf.js.map +1 -1
- package/dist/functions/stockCancellation/archiveStockCancellationByIssuer.d.ts +4 -7
- package/dist/functions/stockCancellation/archiveStockCancellationByIssuer.d.ts.map +1 -1
- package/dist/functions/stockCancellation/archiveStockCancellationByIssuer.js +10 -16
- package/dist/functions/stockCancellation/archiveStockCancellationByIssuer.js.map +1 -1
- package/dist/functions/stockCancellation/createStockCancellation.d.ts +0 -8
- package/dist/functions/stockCancellation/createStockCancellation.d.ts.map +1 -1
- package/dist/functions/stockCancellation/createStockCancellation.js +0 -18
- package/dist/functions/stockCancellation/createStockCancellation.js.map +1 -1
- package/dist/functions/stockClass/archiveStockClassByIssuer.d.ts +0 -7
- package/dist/functions/stockClass/archiveStockClassByIssuer.d.ts.map +1 -1
- package/dist/functions/stockClass/archiveStockClassByIssuer.js +0 -17
- package/dist/functions/stockClass/archiveStockClassByIssuer.js.map +1 -1
- package/dist/functions/stockClass/createStockClass.d.ts +0 -43
- package/dist/functions/stockClass/createStockClass.d.ts.map +1 -1
- package/dist/functions/stockClass/createStockClass.js +81 -52
- package/dist/functions/stockClass/createStockClass.js.map +1 -1
- package/dist/functions/stockClass/getStockClassAsOcf.d.ts.map +1 -1
- package/dist/functions/stockClass/getStockClassAsOcf.js +134 -1
- package/dist/functions/stockClass/getStockClassAsOcf.js.map +1 -1
- package/dist/functions/stockClassAuthorizedSharesAdjustment/archiveStockClassAuthorizedSharesAdjustmentByIssuer.d.ts +4 -7
- package/dist/functions/stockClassAuthorizedSharesAdjustment/archiveStockClassAuthorizedSharesAdjustmentByIssuer.d.ts.map +1 -1
- package/dist/functions/stockClassAuthorizedSharesAdjustment/archiveStockClassAuthorizedSharesAdjustmentByIssuer.js +10 -16
- package/dist/functions/stockClassAuthorizedSharesAdjustment/archiveStockClassAuthorizedSharesAdjustmentByIssuer.js.map +1 -1
- package/dist/functions/stockClassAuthorizedSharesAdjustment/createStockClassAuthorizedSharesAdjustment.d.ts +0 -8
- package/dist/functions/stockClassAuthorizedSharesAdjustment/createStockClassAuthorizedSharesAdjustment.d.ts.map +1 -1
- package/dist/functions/stockClassAuthorizedSharesAdjustment/createStockClassAuthorizedSharesAdjustment.js +0 -18
- package/dist/functions/stockClassAuthorizedSharesAdjustment/createStockClassAuthorizedSharesAdjustment.js.map +1 -1
- package/dist/functions/stockIssuance/archiveStockIssuanceByIssuer.d.ts +0 -7
- package/dist/functions/stockIssuance/archiveStockIssuanceByIssuer.d.ts.map +1 -1
- package/dist/functions/stockIssuance/archiveStockIssuanceByIssuer.js +0 -17
- package/dist/functions/stockIssuance/archiveStockIssuanceByIssuer.js.map +1 -1
- package/dist/functions/stockIssuance/createStockIssuance.d.ts +0 -8
- package/dist/functions/stockIssuance/createStockIssuance.d.ts.map +1 -1
- package/dist/functions/stockIssuance/createStockIssuance.js +57 -20
- package/dist/functions/stockIssuance/createStockIssuance.js.map +1 -1
- package/dist/functions/stockIssuance/getStockIssuanceAsOcf.d.ts.map +1 -1
- package/dist/functions/stockIssuance/getStockIssuanceAsOcf.js +55 -8
- package/dist/functions/stockIssuance/getStockIssuanceAsOcf.js.map +1 -1
- package/dist/functions/stockLegendTemplate/archiveStockLegendTemplateByIssuer.d.ts +0 -7
- package/dist/functions/stockLegendTemplate/archiveStockLegendTemplateByIssuer.d.ts.map +1 -1
- package/dist/functions/stockLegendTemplate/archiveStockLegendTemplateByIssuer.js +0 -17
- package/dist/functions/stockLegendTemplate/archiveStockLegendTemplateByIssuer.js.map +1 -1
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.d.ts +0 -8
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.d.ts.map +1 -1
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.js +8 -18
- package/dist/functions/stockLegendTemplate/createStockLegendTemplate.js.map +1 -1
- package/dist/functions/stockLegendTemplate/getStockLegendTemplateAsOcf.d.ts.map +1 -1
- package/dist/functions/stockLegendTemplate/getStockLegendTemplateAsOcf.js +11 -2
- package/dist/functions/stockLegendTemplate/getStockLegendTemplateAsOcf.js.map +1 -1
- package/dist/functions/stockPlan/archiveStockPlanByIssuer.d.ts +0 -7
- package/dist/functions/stockPlan/archiveStockPlanByIssuer.d.ts.map +1 -1
- package/dist/functions/stockPlan/archiveStockPlanByIssuer.js +0 -17
- package/dist/functions/stockPlan/archiveStockPlanByIssuer.js.map +1 -1
- package/dist/functions/stockPlan/createStockPlan.d.ts +0 -18
- package/dist/functions/stockPlan/createStockPlan.d.ts.map +1 -1
- package/dist/functions/stockPlan/createStockPlan.js +22 -26
- package/dist/functions/stockPlan/createStockPlan.js.map +1 -1
- package/dist/functions/stockPlan/getStockPlanAsOcf.d.ts.map +1 -1
- package/dist/functions/stockPlan/getStockPlanAsOcf.js +24 -1
- package/dist/functions/stockPlan/getStockPlanAsOcf.js.map +1 -1
- package/dist/functions/stockPlan/index.d.ts +0 -4
- package/dist/functions/stockPlan/index.d.ts.map +1 -1
- package/dist/functions/stockPlan/index.js +0 -4
- package/dist/functions/stockPlan/index.js.map +1 -1
- package/dist/functions/stockPlanPoolAdjustment/archiveStockPlanPoolAdjustmentByIssuer.d.ts +4 -7
- package/dist/functions/stockPlanPoolAdjustment/archiveStockPlanPoolAdjustmentByIssuer.d.ts.map +1 -1
- package/dist/functions/stockPlanPoolAdjustment/archiveStockPlanPoolAdjustmentByIssuer.js +10 -16
- package/dist/functions/stockPlanPoolAdjustment/archiveStockPlanPoolAdjustmentByIssuer.js.map +1 -1
- package/dist/functions/stockPlanPoolAdjustment/createStockPlanPoolAdjustment.d.ts +0 -8
- package/dist/functions/stockPlanPoolAdjustment/createStockPlanPoolAdjustment.d.ts.map +1 -1
- package/dist/functions/stockPlanPoolAdjustment/createStockPlanPoolAdjustment.js +0 -18
- package/dist/functions/stockPlanPoolAdjustment/createStockPlanPoolAdjustment.js.map +1 -1
- package/dist/functions/vestingTerms/archiveVestingTermsByIssuer.d.ts +0 -7
- package/dist/functions/vestingTerms/archiveVestingTermsByIssuer.d.ts.map +1 -1
- package/dist/functions/vestingTerms/archiveVestingTermsByIssuer.js +0 -17
- package/dist/functions/vestingTerms/archiveVestingTermsByIssuer.js.map +1 -1
- package/dist/functions/vestingTerms/createVestingTerms.d.ts +0 -8
- package/dist/functions/vestingTerms/createVestingTerms.d.ts.map +1 -1
- package/dist/functions/vestingTerms/createVestingTerms.js +104 -21
- package/dist/functions/vestingTerms/createVestingTerms.js.map +1 -1
- package/dist/functions/vestingTerms/getVestingTermsAsOcf.d.ts.map +1 -1
- package/dist/functions/vestingTerms/getVestingTermsAsOcf.js +151 -1
- package/dist/functions/vestingTerms/getVestingTermsAsOcf.js.map +1 -1
- package/dist/functions/warrantIssuance/archiveWarrantIssuanceByIssuer.d.ts +4 -7
- package/dist/functions/warrantIssuance/archiveWarrantIssuanceByIssuer.d.ts.map +1 -1
- package/dist/functions/warrantIssuance/archiveWarrantIssuanceByIssuer.js +10 -16
- package/dist/functions/warrantIssuance/archiveWarrantIssuanceByIssuer.js.map +1 -1
- package/dist/functions/warrantIssuance/createWarrantIssuance.d.ts +0 -8
- package/dist/functions/warrantIssuance/createWarrantIssuance.d.ts.map +1 -1
- package/dist/functions/warrantIssuance/createWarrantIssuance.js +0 -22
- package/dist/functions/warrantIssuance/createWarrantIssuance.js.map +1 -1
- package/dist/functions/warrantIssuance/getWarrantIssuanceAsOcf.d.ts +4 -4
- package/dist/functions/warrantIssuance/getWarrantIssuanceAsOcf.d.ts.map +1 -1
- package/dist/functions/warrantIssuance/getWarrantIssuanceAsOcf.js +8 -8
- package/dist/functions/warrantIssuance/getWarrantIssuanceAsOcf.js.map +1 -1
- package/dist/utils/createOcfObject.d.ts +62 -0
- package/dist/utils/createOcfObject.d.ts.map +1 -0
- package/dist/utils/createOcfObject.js +223 -0
- package/dist/utils/createOcfObject.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/typeConversions.d.ts +4 -42
- package/dist/utils/typeConversions.d.ts.map +1 -1
- package/dist/utils/typeConversions.js +15 -1324
- package/dist/utils/typeConversions.js.map +1 -1
- package/package.json +9 -5
- package/dist/functions/issuer/authorizeIssuer.d.ts.map +0 -1
- package/dist/functions/issuer/authorizeIssuer.js.map +0 -1
- package/dist/functions/issuer/createValuation.d.ts +0 -33
- package/dist/functions/issuer/createValuation.d.ts.map +0 -1
- package/dist/functions/issuer/createValuation.js +0 -60
- package/dist/functions/issuer/createValuation.js.map +0 -1
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.d.ts +0 -22
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.d.ts.map +0 -1
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.js +0 -23
- package/dist/functions/stockClass/getStockIssuanceEventAsOcf.js.map +0 -1
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.d.ts +0 -22
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.d.ts.map +0 -1
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.js +0 -23
- package/dist/functions/stockClass/getStockRepurchaseEventAsOcf.js.map +0 -1
- package/dist/functions/stockClass/getStockTransferEventAsOcf.d.ts +0 -23
- package/dist/functions/stockClass/getStockTransferEventAsOcf.d.ts.map +0 -1
- package/dist/functions/stockClass/getStockTransferEventAsOcf.js +0 -24
- package/dist/functions/stockClass/getStockTransferEventAsOcf.js.map +0 -1
- package/dist/functions/stockPlan/createEquityCompensationExercise.d.ts.map +0 -1
- package/dist/functions/stockPlan/createEquityCompensationExercise.js.map +0 -1
- package/dist/functions/stockPlan/createEquityCompensationIssuance.d.ts.map +0 -1
- package/dist/functions/stockPlan/createEquityCompensationIssuance.js +0 -42
- package/dist/functions/stockPlan/createEquityCompensationIssuance.js.map +0 -1
- package/dist/functions/stockPlan/getEquityCompensationExerciseEventAsOcf.d.ts.map +0 -1
- package/dist/functions/stockPlan/getEquityCompensationExerciseEventAsOcf.js.map +0 -1
- package/dist/functions/stockPlan/getEquityCompensationIssuanceEventAsOcf.d.ts.map +0 -1
- package/dist/functions/stockPlan/getEquityCompensationIssuanceEventAsOcf.js.map +0 -1
- package/dist/functions/valuation/archiveValuationByIssuer.d.ts +0 -16
- package/dist/functions/valuation/archiveValuationByIssuer.d.ts.map +0 -1
- package/dist/functions/valuation/archiveValuationByIssuer.js +0 -32
- package/dist/functions/valuation/archiveValuationByIssuer.js.map +0 -1
- package/dist/functions/valuation/getValuationAsOcf.d.ts +0 -28
- package/dist/functions/valuation/getValuationAsOcf.d.ts.map +0 -1
- package/dist/functions/valuation/getValuationAsOcf.js +0 -35
- package/dist/functions/valuation/getValuationAsOcf.js.map +0 -1
- package/dist/functions/valuation/index.d.ts +0 -4
- package/dist/functions/valuation/index.d.ts.map +0 -1
- package/dist/functions/valuation/index.js.map +0 -1
- package/dist/types/contractDetails.d.ts +0 -18
- package/dist/types/contractDetails.d.ts.map +0 -1
- package/dist/types/contractDetails.js +0 -3
- package/dist/types/contractDetails.js.map +0 -1
- package/dist/utils/TransactionBatch.d.ts +0 -23
- package/dist/utils/TransactionBatch.d.ts.map +0 -1
- package/dist/utils/TransactionBatch.js +0 -54
- package/dist/utils/TransactionBatch.js.map +0 -1
- package/dist/utils/findCreatedEvent.d.ts +0 -20
- package/dist/utils/findCreatedEvent.d.ts.map +0 -1
- package/dist/utils/findCreatedEvent.js +0 -32
- package/dist/utils/findCreatedEvent.js.map +0 -1
- /package/dist/functions/{stockPlan → equityCompensationExercise}/getEquityCompensationExerciseEventAsOcf.d.ts +0 -0
- /package/dist/functions/{stockPlan → equityCompensationExercise}/getEquityCompensationExerciseEventAsOcf.js +0 -0
- /package/dist/functions/{issuer → issuerAuthorization}/authorizeIssuer.d.ts +0 -0
- /package/dist/functions/{issuer → issuerAuthorization}/authorizeIssuer.js +0 -0
|
@@ -1,52 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Utility functions to convert between DAML types and TypeScript-native types
|
|
4
|
+
*
|
|
5
|
+
* This file contains ONLY shared helper functions used by multiple entity conversion files.
|
|
6
|
+
* Entity-specific conversions have been moved to their respective function files.
|
|
4
7
|
*/
|
|
5
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
9
|
exports.dateStringToDAMLTime = dateStringToDAMLTime;
|
|
7
10
|
exports.damlTimeToDateString = damlTimeToDateString;
|
|
8
|
-
exports.emailTypeToDaml = emailTypeToDaml;
|
|
9
|
-
exports.damlEmailTypeToNative = damlEmailTypeToNative;
|
|
10
|
-
exports.addressTypeToDaml = addressTypeToDaml;
|
|
11
|
-
exports.damlAddressTypeToNative = damlAddressTypeToNative;
|
|
12
|
-
exports.stockClassTypeToDaml = stockClassTypeToDaml;
|
|
13
|
-
exports.damlStockClassTypeToNative = damlStockClassTypeToNative;
|
|
14
11
|
exports.monetaryToDaml = monetaryToDaml;
|
|
15
12
|
exports.damlMonetaryToNative = damlMonetaryToNative;
|
|
16
|
-
exports.phoneTypeToDaml = phoneTypeToDaml;
|
|
17
|
-
exports.damlPhoneTypeToNative = damlPhoneTypeToNative;
|
|
18
|
-
exports.phoneToDaml = phoneToDaml;
|
|
19
|
-
exports.damlPhoneToNative = damlPhoneToNative;
|
|
20
|
-
exports.emailToDaml = emailToDaml;
|
|
21
|
-
exports.damlEmailToNative = damlEmailToNative;
|
|
22
13
|
exports.addressToDaml = addressToDaml;
|
|
23
14
|
exports.damlAddressToNative = damlAddressToNative;
|
|
24
|
-
exports.stakeholderTypeToDaml = stakeholderTypeToDaml;
|
|
25
|
-
exports.damlStakeholderTypeToNative = damlStakeholderTypeToNative;
|
|
26
|
-
exports.contactInfoToDaml = contactInfoToDaml;
|
|
27
|
-
exports.damlContactInfoToNative = damlContactInfoToNative;
|
|
28
|
-
exports.contactInfoWithoutNameToDaml = contactInfoWithoutNameToDaml;
|
|
29
|
-
exports.damlContactInfoWithoutNameToNative = damlContactInfoWithoutNameToNative;
|
|
30
|
-
exports.issuerDataToDaml = issuerDataToDaml;
|
|
31
|
-
exports.damlIssuerDataToNative = damlIssuerDataToNative;
|
|
32
|
-
exports.stockClassDataToDaml = stockClassDataToDaml;
|
|
33
|
-
exports.damlStockClassDataToNative = damlStockClassDataToNative;
|
|
34
|
-
exports.stakeholderDataToDaml = stakeholderDataToDaml;
|
|
35
|
-
exports.damlStakeholderDataToNative = damlStakeholderDataToNative;
|
|
36
|
-
exports.stockLegendTemplateDataToDaml = stockLegendTemplateDataToDaml;
|
|
37
|
-
exports.damlStockLegendTemplateDataToNative = damlStockLegendTemplateDataToNative;
|
|
38
|
-
exports.documentDataToDaml = documentDataToDaml;
|
|
39
|
-
exports.damlDocumentDataToNative = damlDocumentDataToNative;
|
|
40
|
-
exports.stockIssuanceDataToDaml = stockIssuanceDataToDaml;
|
|
41
|
-
exports.damlStockIssuanceDataToNative = damlStockIssuanceDataToNative;
|
|
42
|
-
exports.valuationDataToDaml = valuationDataToDaml;
|
|
43
|
-
exports.damlValuationDataToNative = damlValuationDataToNative;
|
|
44
|
-
exports.vestingTermsDataToDaml = vestingTermsDataToDaml;
|
|
45
|
-
exports.damlVestingTermsDataToNative = damlVestingTermsDataToNative;
|
|
46
|
-
exports.stockPlanDataToDaml = stockPlanDataToDaml;
|
|
47
|
-
exports.damlStockPlanDataToNative = damlStockPlanDataToNative;
|
|
48
|
-
exports.equityCompIssuanceDataToDaml = equityCompIssuanceDataToDaml;
|
|
49
|
-
exports.damlEquityCompIssuanceDataToNative = damlEquityCompIssuanceDataToNative;
|
|
50
15
|
// ===== Date Conversion Helpers =====
|
|
51
16
|
/**
|
|
52
17
|
* Convert a date string (YYYY-MM-DD) to DAML Time format (ISO string with 0 timestamp)
|
|
@@ -69,32 +34,20 @@ function damlTimeToDateString(timeString) {
|
|
|
69
34
|
// Extract just the date portion (YYYY-MM-DD)
|
|
70
35
|
return timeString.split('T')[0];
|
|
71
36
|
}
|
|
72
|
-
// =====
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return 'OcfEmailTypeBusiness';
|
|
79
|
-
case 'OTHER':
|
|
80
|
-
return 'OcfEmailTypeOther';
|
|
81
|
-
default:
|
|
82
|
-
throw new Error(`Unknown email type: ${emailType}`);
|
|
83
|
-
}
|
|
37
|
+
// ===== Monetary Value Conversions =====
|
|
38
|
+
function monetaryToDaml(monetary) {
|
|
39
|
+
return {
|
|
40
|
+
amount: typeof monetary.amount === 'number' ? monetary.amount.toString() : monetary.amount,
|
|
41
|
+
currency: monetary.currency
|
|
42
|
+
};
|
|
84
43
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return 'BUSINESS';
|
|
91
|
-
case 'OcfEmailTypeOther':
|
|
92
|
-
return 'OTHER';
|
|
93
|
-
default:
|
|
94
|
-
throw new Error(`Unknown DAML email type: ${damlType}`);
|
|
95
|
-
}
|
|
44
|
+
function damlMonetaryToNative(damlMonetary) {
|
|
45
|
+
return {
|
|
46
|
+
amount: damlMonetary.amount,
|
|
47
|
+
currency: damlMonetary.currency
|
|
48
|
+
};
|
|
96
49
|
}
|
|
97
|
-
// ===== Address
|
|
50
|
+
// ===== Address Conversions =====
|
|
98
51
|
function addressTypeToDaml(addressType) {
|
|
99
52
|
switch (addressType) {
|
|
100
53
|
case 'LEGAL':
|
|
@@ -119,84 +72,6 @@ function damlAddressTypeToNative(damlType) {
|
|
|
119
72
|
throw new Error(`Unknown DAML address type: ${damlType}`);
|
|
120
73
|
}
|
|
121
74
|
}
|
|
122
|
-
// ===== Stock Class Type Conversions =====
|
|
123
|
-
function stockClassTypeToDaml(stockClassType) {
|
|
124
|
-
switch (stockClassType) {
|
|
125
|
-
case 'PREFERRED':
|
|
126
|
-
return 'OcfStockClassTypePreferred';
|
|
127
|
-
case 'COMMON':
|
|
128
|
-
return 'OcfStockClassTypeCommon';
|
|
129
|
-
default:
|
|
130
|
-
throw new Error(`Unknown stock class type: ${stockClassType}`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
function damlStockClassTypeToNative(damlType) {
|
|
134
|
-
switch (damlType) {
|
|
135
|
-
case 'OcfStockClassTypePreferred':
|
|
136
|
-
return 'PREFERRED';
|
|
137
|
-
case 'OcfStockClassTypeCommon':
|
|
138
|
-
return 'COMMON';
|
|
139
|
-
default:
|
|
140
|
-
throw new Error(`Unknown DAML stock class type: ${damlType}`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
// ===== Monetary Value Conversions =====
|
|
144
|
-
function monetaryToDaml(monetary) {
|
|
145
|
-
return {
|
|
146
|
-
amount: typeof monetary.amount === 'number' ? monetary.amount.toString() : monetary.amount,
|
|
147
|
-
currency: monetary.currency
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
function damlMonetaryToNative(damlMonetary) {
|
|
151
|
-
return {
|
|
152
|
-
amount: damlMonetary.amount,
|
|
153
|
-
currency: damlMonetary.currency
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
// ===== Phone Type Conversions =====
|
|
157
|
-
function phoneTypeToDaml(phoneType) {
|
|
158
|
-
switch (phoneType) {
|
|
159
|
-
case 'HOME': return 'OcfPhoneHome';
|
|
160
|
-
case 'MOBILE': return 'OcfPhoneMobile';
|
|
161
|
-
case 'BUSINESS': return 'OcfPhoneBusiness';
|
|
162
|
-
case 'OTHER': return 'OcfPhoneOther';
|
|
163
|
-
default: throw new Error(`Unknown phone type: ${phoneType}`);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
function damlPhoneTypeToNative(damlType) {
|
|
167
|
-
switch (damlType) {
|
|
168
|
-
case 'OcfPhoneHome': return 'HOME';
|
|
169
|
-
case 'OcfPhoneMobile': return 'MOBILE';
|
|
170
|
-
case 'OcfPhoneBusiness': return 'BUSINESS';
|
|
171
|
-
case 'OcfPhoneOther': return 'OTHER';
|
|
172
|
-
default: throw new Error(`Unknown DAML phone type: ${damlType}`);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function phoneToDaml(phone) {
|
|
176
|
-
return {
|
|
177
|
-
phone_type: phoneTypeToDaml(phone.phone_type),
|
|
178
|
-
phone_number: phone.phone_number
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function damlPhoneToNative(phone) {
|
|
182
|
-
return {
|
|
183
|
-
phone_type: damlPhoneTypeToNative(phone.phone_type),
|
|
184
|
-
phone_number: phone.phone_number
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
// ===== Complex Object Conversions =====
|
|
188
|
-
function emailToDaml(email) {
|
|
189
|
-
return {
|
|
190
|
-
email_type: emailTypeToDaml(email.email_type),
|
|
191
|
-
email_address: email.email_address
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function damlEmailToNative(damlEmail) {
|
|
195
|
-
return {
|
|
196
|
-
email_type: damlEmailTypeToNative(damlEmail.email_type),
|
|
197
|
-
email_address: damlEmail.email_address
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
75
|
function addressToDaml(address) {
|
|
201
76
|
return {
|
|
202
77
|
address_type: addressTypeToDaml(address.address_type),
|
|
@@ -217,1188 +92,4 @@ function damlAddressToNative(damlAddress) {
|
|
|
217
92
|
...(damlAddress.postal_code && { postal_code: damlAddress.postal_code })
|
|
218
93
|
};
|
|
219
94
|
}
|
|
220
|
-
// ===== Stakeholder Type Conversions =====
|
|
221
|
-
function stakeholderTypeToDaml(stakeholderType) {
|
|
222
|
-
switch (stakeholderType) {
|
|
223
|
-
case 'INDIVIDUAL':
|
|
224
|
-
return 'OcfStakeholderTypeIndividual';
|
|
225
|
-
case 'INSTITUTION':
|
|
226
|
-
return 'OcfStakeholderTypeInstitution';
|
|
227
|
-
default:
|
|
228
|
-
throw new Error(`Unknown stakeholder type: ${stakeholderType}`);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
function damlStakeholderTypeToNative(damlType) {
|
|
232
|
-
switch (damlType) {
|
|
233
|
-
case 'OcfStakeholderTypeIndividual':
|
|
234
|
-
return 'INDIVIDUAL';
|
|
235
|
-
case 'OcfStakeholderTypeInstitution':
|
|
236
|
-
return 'INSTITUTION';
|
|
237
|
-
default:
|
|
238
|
-
throw new Error(`Unknown DAML stakeholder type: ${damlType}`);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
// ===== Contact Info Conversions =====
|
|
242
|
-
function nameToDaml(n) {
|
|
243
|
-
return {
|
|
244
|
-
legal_name: n.legal_name,
|
|
245
|
-
first_name: n.first_name || null,
|
|
246
|
-
last_name: n.last_name || null
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
function contactInfoToDaml(info) {
|
|
250
|
-
return {
|
|
251
|
-
name: nameToDaml(info.name),
|
|
252
|
-
phone_numbers: (info.phone_numbers || []).map(phoneToDaml),
|
|
253
|
-
emails: (info.emails || []).map(emailToDaml)
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function damlContactInfoToNative(damlInfo) {
|
|
257
|
-
const name = {
|
|
258
|
-
legal_name: damlInfo.name.legal_name || '',
|
|
259
|
-
...(damlInfo.name.first_name ? { first_name: damlInfo.name.first_name } : {}),
|
|
260
|
-
...(damlInfo.name.last_name ? { last_name: damlInfo.name.last_name } : {})
|
|
261
|
-
};
|
|
262
|
-
const phones = (damlInfo.phone_numbers || []).map(damlPhoneToNative);
|
|
263
|
-
const emails = (damlInfo.emails || []).map(damlEmailToNative);
|
|
264
|
-
return {
|
|
265
|
-
name,
|
|
266
|
-
phone_numbers: phones,
|
|
267
|
-
emails
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
function contactInfoWithoutNameToDaml(info) {
|
|
271
|
-
const phones = (info.phone_numbers || []).map(phoneToDaml);
|
|
272
|
-
const emails = (info.emails || []).map(emailToDaml);
|
|
273
|
-
if (phones.length === 0 && emails.length === 0) {
|
|
274
|
-
return null;
|
|
275
|
-
}
|
|
276
|
-
return {
|
|
277
|
-
phone_numbers: phones,
|
|
278
|
-
emails: emails
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
function damlContactInfoWithoutNameToNative(damlInfo) {
|
|
282
|
-
const phones = (damlInfo.phone_numbers || []).map(damlPhoneToNative);
|
|
283
|
-
const emails = (damlInfo.emails || []).map(damlEmailToNative);
|
|
284
|
-
return {
|
|
285
|
-
phone_numbers: phones,
|
|
286
|
-
emails
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
// ===== Main Data Structure Conversions =====
|
|
290
|
-
function issuerDataToDaml(issuerData) {
|
|
291
|
-
if (!issuerData.id)
|
|
292
|
-
throw new Error('issuerData.id is required');
|
|
293
|
-
return {
|
|
294
|
-
id: issuerData.id,
|
|
295
|
-
legal_name: issuerData.legal_name,
|
|
296
|
-
country_of_formation: issuerData.country_of_formation,
|
|
297
|
-
dba: issuerData.dba || null,
|
|
298
|
-
formation_date: dateStringToDAMLTime(issuerData.formation_date),
|
|
299
|
-
country_subdivision_of_formation: issuerData.country_subdivision_of_formation || null,
|
|
300
|
-
country_subdivision_name_of_formation: issuerData.country_subdivision_name_of_formation || null,
|
|
301
|
-
tax_ids: issuerData.tax_ids || [],
|
|
302
|
-
email: issuerData.email ? emailToDaml(issuerData.email) : null,
|
|
303
|
-
phone: issuerData.phone ? phoneToDaml(issuerData.phone) : null,
|
|
304
|
-
address: issuerData.address ? addressToDaml(issuerData.address) : null,
|
|
305
|
-
// Map to DAML union: OcfInitialSharesAuthorized = Numeric | Enum
|
|
306
|
-
initial_shares_authorized: issuerData.initial_shares_authorized !== undefined && issuerData.initial_shares_authorized !== null
|
|
307
|
-
? (() => {
|
|
308
|
-
const v = issuerData.initial_shares_authorized;
|
|
309
|
-
if (typeof v === 'number' || (typeof v === 'string' && /^\d+(\.\d+)?$/.test(v))) {
|
|
310
|
-
return { tag: 'OcfInitialSharesNumeric', value: typeof v === 'number' ? v.toString() : v };
|
|
311
|
-
}
|
|
312
|
-
if (v === 'UNLIMITED') {
|
|
313
|
-
return { tag: 'OcfInitialSharesEnum', value: 'OcfAuthorizedSharesUnlimited' };
|
|
314
|
-
}
|
|
315
|
-
// Treat NOT_APPLICABLE and others as NotApplicable enum
|
|
316
|
-
return { tag: 'OcfInitialSharesEnum', value: 'OcfAuthorizedSharesNotApplicable' };
|
|
317
|
-
})()
|
|
318
|
-
: null,
|
|
319
|
-
comments: issuerData.comments || []
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
function damlIssuerDataToNative(damlData) {
|
|
323
|
-
const normalizeInitialShares = (v) => {
|
|
324
|
-
if (typeof v === 'string' || typeof v === 'number')
|
|
325
|
-
return String(v);
|
|
326
|
-
if (v && typeof v === 'object' && 'tag' in v) {
|
|
327
|
-
const i = v;
|
|
328
|
-
if (i.tag === 'OcfInitialSharesNumeric' && typeof i.value === 'string')
|
|
329
|
-
return i.value;
|
|
330
|
-
if (i.tag === 'OcfInitialSharesEnum' && typeof i.value === 'string') {
|
|
331
|
-
return i.value === 'OcfAuthorizedSharesUnlimited' ? 'UNLIMITED' : 'NOT_APPLICABLE';
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
return undefined;
|
|
335
|
-
};
|
|
336
|
-
const out = {
|
|
337
|
-
id: damlData.id,
|
|
338
|
-
legal_name: damlData.legal_name,
|
|
339
|
-
country_of_formation: damlData.country_of_formation,
|
|
340
|
-
formation_date: damlTimeToDateString(damlData.formation_date),
|
|
341
|
-
tax_ids: [],
|
|
342
|
-
comments: []
|
|
343
|
-
};
|
|
344
|
-
if (damlData.dba)
|
|
345
|
-
out.dba = damlData.dba;
|
|
346
|
-
if (damlData.country_subdivision_of_formation)
|
|
347
|
-
out.country_subdivision_of_formation = damlData.country_subdivision_of_formation;
|
|
348
|
-
if (damlData.country_subdivision_name_of_formation)
|
|
349
|
-
out.country_subdivision_name_of_formation = damlData.country_subdivision_name_of_formation;
|
|
350
|
-
if (damlData.tax_ids && damlData.tax_ids.length)
|
|
351
|
-
out.tax_ids = damlData.tax_ids;
|
|
352
|
-
if (damlData.email)
|
|
353
|
-
out.email = damlEmailToNative(damlData.email);
|
|
354
|
-
if (damlData.phone)
|
|
355
|
-
out.phone = damlPhoneToNative(damlData.phone);
|
|
356
|
-
if (damlData.address)
|
|
357
|
-
out.address = damlAddressToNative(damlData.address);
|
|
358
|
-
if (damlData.comments)
|
|
359
|
-
out.comments = damlData.comments;
|
|
360
|
-
const isa = damlData.initial_shares_authorized;
|
|
361
|
-
const normalizedIsa = normalizeInitialShares(isa);
|
|
362
|
-
if (normalizedIsa !== undefined)
|
|
363
|
-
out.initial_shares_authorized = normalizedIsa;
|
|
364
|
-
return out;
|
|
365
|
-
}
|
|
366
|
-
function stockClassDataToDaml(stockClassData) {
|
|
367
|
-
if (!stockClassData.id)
|
|
368
|
-
throw new Error('stockClassData.id is required');
|
|
369
|
-
return {
|
|
370
|
-
id: stockClassData.id,
|
|
371
|
-
name: stockClassData.name,
|
|
372
|
-
class_type: stockClassTypeToDaml(stockClassData.class_type),
|
|
373
|
-
default_id_prefix: stockClassData.default_id_prefix,
|
|
374
|
-
// Support DAML Decimal (as string) payload
|
|
375
|
-
initial_shares_authorized: typeof stockClassData.initial_shares_authorized === 'number'
|
|
376
|
-
? stockClassData.initial_shares_authorized.toString()
|
|
377
|
-
: stockClassData.initial_shares_authorized,
|
|
378
|
-
votes_per_share: typeof stockClassData.votes_per_share === 'number' ?
|
|
379
|
-
stockClassData.votes_per_share.toString() : stockClassData.votes_per_share,
|
|
380
|
-
seniority: typeof stockClassData.seniority === 'number' ?
|
|
381
|
-
stockClassData.seniority.toString() : stockClassData.seniority,
|
|
382
|
-
board_approval_date: stockClassData.board_approval_date ? dateStringToDAMLTime(stockClassData.board_approval_date) : null,
|
|
383
|
-
stockholder_approval_date: stockClassData.stockholder_approval_date ? dateStringToDAMLTime(stockClassData.stockholder_approval_date) : null,
|
|
384
|
-
par_value: stockClassData.par_value ? monetaryToDaml(stockClassData.par_value) : null,
|
|
385
|
-
price_per_share: stockClassData.price_per_share ? monetaryToDaml(stockClassData.price_per_share) : null,
|
|
386
|
-
conversion_rights: (stockClassData.conversion_rights || []).map((right) => {
|
|
387
|
-
// Mechanism mapping
|
|
388
|
-
const mechanism = right.conversion_mechanism === 'RATIO_CONVERSION'
|
|
389
|
-
? 'OcfConversionMechanismRatioConversion'
|
|
390
|
-
: right.conversion_mechanism === 'PERCENT_CONVERSION'
|
|
391
|
-
? 'OcfConversionMechanismPercentCapitalizationConversion'
|
|
392
|
-
: 'OcfConversionMechanismFixedAmountConversion';
|
|
393
|
-
// Trigger mapping - collapse to Automatic/Optional as per DAML type
|
|
394
|
-
const trigger = (() => {
|
|
395
|
-
switch (right.conversion_trigger) {
|
|
396
|
-
case 'AUTOMATIC_ON_CONDITION':
|
|
397
|
-
return 'OcfTriggerTypeAutomaticOnCondition';
|
|
398
|
-
case 'AUTOMATIC_ON_DATE':
|
|
399
|
-
return 'OcfTriggerTypeAutomaticOnDate';
|
|
400
|
-
case 'ELECTIVE_AT_WILL':
|
|
401
|
-
return 'OcfTriggerTypeElectiveAtWill';
|
|
402
|
-
case 'ELECTIVE_ON_CONDITION':
|
|
403
|
-
return 'OcfTriggerTypeElectiveOnCondition';
|
|
404
|
-
case 'ELECTIVE_ON_DATE':
|
|
405
|
-
// Map to closest supported DAML trigger
|
|
406
|
-
return 'OcfTriggerTypeElectiveAtWill';
|
|
407
|
-
default:
|
|
408
|
-
return 'OcfTriggerTypeAutomaticOnCondition';
|
|
409
|
-
}
|
|
410
|
-
})();
|
|
411
|
-
// Ratio mapping if provided
|
|
412
|
-
let ratio = null;
|
|
413
|
-
const numerator = right.ratio_numerator ?? (right.ratio !== undefined ? right.ratio : undefined);
|
|
414
|
-
const denominator = right.ratio_denominator ?? (right.ratio !== undefined ? 1 : undefined);
|
|
415
|
-
if (numerator !== undefined && denominator !== undefined) {
|
|
416
|
-
ratio = { numerator: typeof numerator === 'number' ? numerator.toString() : String(numerator), denominator: typeof denominator === 'number' ? denominator.toString() : String(denominator) };
|
|
417
|
-
}
|
|
418
|
-
return {
|
|
419
|
-
type_: right.type,
|
|
420
|
-
conversion_mechanism: mechanism,
|
|
421
|
-
conversion_trigger: trigger,
|
|
422
|
-
converts_to_stock_class_id: right.converts_to_stock_class_id,
|
|
423
|
-
ratio: ratio ? { tag: 'Some', value: ratio } : null,
|
|
424
|
-
percent_of_capitalization: right.percent_of_capitalization !== undefined ? { tag: 'Some', value: typeof right.percent_of_capitalization === 'number' ? right.percent_of_capitalization.toString() : String(right.percent_of_capitalization) } : null,
|
|
425
|
-
conversion_price: right.conversion_price ? { tag: 'Some', value: monetaryToDaml(right.conversion_price) } : null,
|
|
426
|
-
reference_share_price: right.reference_share_price ? { tag: 'Some', value: monetaryToDaml(right.reference_share_price) } : null,
|
|
427
|
-
reference_valuation_price_per_share: right.reference_valuation_price_per_share ? { tag: 'Some', value: monetaryToDaml(right.reference_valuation_price_per_share) } : null,
|
|
428
|
-
discount_rate: right.discount_rate !== undefined ? { tag: 'Some', value: typeof right.discount_rate === 'number' ? right.discount_rate.toString() : String(right.discount_rate) } : null,
|
|
429
|
-
valuation_cap: right.valuation_cap ? { tag: 'Some', value: monetaryToDaml(right.valuation_cap) } : null,
|
|
430
|
-
floor_price_per_share: right.floor_price_per_share ? { tag: 'Some', value: monetaryToDaml(right.floor_price_per_share) } : null,
|
|
431
|
-
ceiling_price_per_share: right.ceiling_price_per_share ? { tag: 'Some', value: monetaryToDaml(right.ceiling_price_per_share) } : null,
|
|
432
|
-
custom_description: right.custom_description ? { tag: 'Some', value: right.custom_description } : null,
|
|
433
|
-
expires_at: right.expires_at ? dateStringToDAMLTime(right.expires_at) : null
|
|
434
|
-
};
|
|
435
|
-
}),
|
|
436
|
-
liquidation_preference_multiple: stockClassData.liquidation_preference_multiple ?
|
|
437
|
-
(typeof stockClassData.liquidation_preference_multiple === 'number' ?
|
|
438
|
-
stockClassData.liquidation_preference_multiple.toString() : stockClassData.liquidation_preference_multiple) : null,
|
|
439
|
-
participation_cap_multiple: stockClassData.participation_cap_multiple ?
|
|
440
|
-
(typeof stockClassData.participation_cap_multiple === 'number' ?
|
|
441
|
-
stockClassData.participation_cap_multiple.toString() : stockClassData.participation_cap_multiple) : null,
|
|
442
|
-
comments: stockClassData.comments || []
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
function damlStockClassDataToNative(damlData) {
|
|
446
|
-
const dAny = damlData;
|
|
447
|
-
// Handle either union-shaped or plain decimal-shaped initial_shares_authorized
|
|
448
|
-
let initialShares = '0';
|
|
449
|
-
const isa = dAny.initial_shares_authorized;
|
|
450
|
-
if (typeof isa === 'string' || typeof isa === 'number') {
|
|
451
|
-
initialShares = String(isa);
|
|
452
|
-
}
|
|
453
|
-
else if (isa && typeof isa === 'object' && 'tag' in isa) {
|
|
454
|
-
const tagged = isa;
|
|
455
|
-
if (tagged.tag === 'OcfInitialSharesNumeric' && typeof tagged.value === 'string') {
|
|
456
|
-
initialShares = tagged.value;
|
|
457
|
-
}
|
|
458
|
-
else if (tagged.tag === 'OcfInitialSharesEnum' && typeof tagged.value === 'string') {
|
|
459
|
-
initialShares = tagged.value === 'OcfAuthorizedSharesUnlimited' ? 'Unlimited' : 'N/A';
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
return {
|
|
463
|
-
id: (typeof dAny.id === 'string' ? dAny.id : ''),
|
|
464
|
-
name: damlData.name || '',
|
|
465
|
-
class_type: damlStockClassTypeToNative(damlData.class_type),
|
|
466
|
-
default_id_prefix: damlData.default_id_prefix || '',
|
|
467
|
-
initial_shares_authorized: initialShares,
|
|
468
|
-
votes_per_share: damlData.votes_per_share || '0',
|
|
469
|
-
seniority: damlData.seniority || '0',
|
|
470
|
-
conversion_rights: [],
|
|
471
|
-
comments: [],
|
|
472
|
-
...(damlData.board_approval_date && { board_approval_date: damlTimeToDateString(damlData.board_approval_date) }),
|
|
473
|
-
...(damlData.stockholder_approval_date && { stockholder_approval_date: damlTimeToDateString(damlData.stockholder_approval_date) }),
|
|
474
|
-
...(damlData.par_value && { par_value: damlMonetaryToNative(damlData.par_value) }),
|
|
475
|
-
...(damlData.price_per_share && { price_per_share: damlMonetaryToNative(damlData.price_per_share) }),
|
|
476
|
-
...(damlData.conversion_rights && damlData.conversion_rights.length > 0 && {
|
|
477
|
-
conversion_rights: damlData.conversion_rights.map((right) => {
|
|
478
|
-
const mechanism = right.conversion_mechanism === 'OcfConversionMechanismRatioConversion'
|
|
479
|
-
? 'RATIO_CONVERSION'
|
|
480
|
-
: right.conversion_mechanism === 'OcfConversionMechanismPercentCapitalizationConversion'
|
|
481
|
-
? 'PERCENT_CONVERSION'
|
|
482
|
-
: 'FIXED_AMOUNT_CONVERSION';
|
|
483
|
-
const rt = right.conversion_trigger;
|
|
484
|
-
let tag;
|
|
485
|
-
if (typeof rt === 'string')
|
|
486
|
-
tag = rt;
|
|
487
|
-
else if (rt && typeof rt === 'object' && 'tag' in rt)
|
|
488
|
-
tag = rt.tag;
|
|
489
|
-
const trigger = tag === 'OcfTriggerTypeAutomaticOnDate' ? 'AUTOMATIC_ON_DATE' :
|
|
490
|
-
tag === 'OcfTriggerTypeElectiveAtWill' ? 'ELECTIVE_AT_WILL' :
|
|
491
|
-
tag === 'OcfTriggerTypeElectiveOnCondition' ? 'ELECTIVE_ON_CONDITION' :
|
|
492
|
-
tag === 'OcfTriggerTypeElectiveInRange' ? 'ELECTIVE_ON_CONDITION' :
|
|
493
|
-
tag === 'OcfTriggerTypeUnspecified' ? 'ELECTIVE_AT_WILL' : 'AUTOMATIC_ON_CONDITION';
|
|
494
|
-
let ratioValue;
|
|
495
|
-
const ratioRaw = right.ratio;
|
|
496
|
-
if (ratioRaw && typeof ratioRaw === 'object') {
|
|
497
|
-
if ('tag' in ratioRaw && ratioRaw.tag === 'Some' && 'value' in ratioRaw) {
|
|
498
|
-
const r = ratioRaw.value;
|
|
499
|
-
const num = parseFloat(r.numerator || '1');
|
|
500
|
-
const den = parseFloat(r.denominator || '1');
|
|
501
|
-
ratioValue = den !== 0 ? num / den : undefined;
|
|
502
|
-
}
|
|
503
|
-
else if ('numerator' in ratioRaw && 'denominator' in ratioRaw) {
|
|
504
|
-
const r = ratioRaw;
|
|
505
|
-
const num = parseFloat(r.numerator || '1');
|
|
506
|
-
const den = parseFloat(r.denominator || '1');
|
|
507
|
-
ratioValue = den !== 0 ? num / den : undefined;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
return {
|
|
511
|
-
type: right.type_,
|
|
512
|
-
conversion_mechanism: mechanism,
|
|
513
|
-
conversion_trigger: trigger,
|
|
514
|
-
converts_to_stock_class_id: right.converts_to_stock_class_id,
|
|
515
|
-
...(ratioValue !== undefined ? { ratio: ratioValue } : {}),
|
|
516
|
-
...(() => {
|
|
517
|
-
const out = {};
|
|
518
|
-
const cv = right.conversion_price;
|
|
519
|
-
if (cv && typeof cv === 'object' && 'tag' in cv && cv.tag === 'Some' && 'value' in cv) {
|
|
520
|
-
out.conversion_price = damlMonetaryToNative(cv.value);
|
|
521
|
-
}
|
|
522
|
-
const rsp = right.reference_share_price;
|
|
523
|
-
if (rsp && typeof rsp === 'object' && 'tag' in rsp && rsp.tag === 'Some' && 'value' in rsp) {
|
|
524
|
-
out.reference_share_price = damlMonetaryToNative(rsp.value);
|
|
525
|
-
}
|
|
526
|
-
const rvps = right.reference_valuation_price_per_share;
|
|
527
|
-
if (rvps && typeof rvps === 'object' && 'tag' in rvps && rvps.tag === 'Some' && 'value' in rvps) {
|
|
528
|
-
out.reference_valuation_price_per_share = damlMonetaryToNative(rvps.value);
|
|
529
|
-
}
|
|
530
|
-
const poc = right.percent_of_capitalization;
|
|
531
|
-
if (poc && typeof poc === 'object' && 'tag' in poc && poc.tag === 'Some' && 'value' in poc) {
|
|
532
|
-
out.percent_of_capitalization = parseFloat(poc.value);
|
|
533
|
-
}
|
|
534
|
-
const dr = right.discount_rate;
|
|
535
|
-
if (dr && typeof dr === 'object' && 'tag' in dr && dr.tag === 'Some' && 'value' in dr) {
|
|
536
|
-
out.discount_rate = parseFloat(dr.value);
|
|
537
|
-
}
|
|
538
|
-
const vc = right.valuation_cap;
|
|
539
|
-
if (vc && typeof vc === 'object' && 'tag' in vc && vc.tag === 'Some' && 'value' in vc) {
|
|
540
|
-
out.valuation_cap = damlMonetaryToNative(vc.value);
|
|
541
|
-
}
|
|
542
|
-
const fps = right.floor_price_per_share;
|
|
543
|
-
if (fps && typeof fps === 'object' && 'tag' in fps && fps.tag === 'Some' && 'value' in fps) {
|
|
544
|
-
out.floor_price_per_share = damlMonetaryToNative(fps.value);
|
|
545
|
-
}
|
|
546
|
-
const cps = right.ceiling_price_per_share;
|
|
547
|
-
if (cps && typeof cps === 'object' && 'tag' in cps && cps.tag === 'Some' && 'value' in cps) {
|
|
548
|
-
out.ceiling_price_per_share = damlMonetaryToNative(cps.value);
|
|
549
|
-
}
|
|
550
|
-
const cd = right.custom_description;
|
|
551
|
-
if (cd && typeof cd === 'object' && 'tag' in cd && cd.tag === 'Some' && 'value' in cd) {
|
|
552
|
-
out.custom_description = cd.value;
|
|
553
|
-
}
|
|
554
|
-
return out;
|
|
555
|
-
})(),
|
|
556
|
-
...(right.expires_at && { expires_at: damlTimeToDateString(right.expires_at) })
|
|
557
|
-
};
|
|
558
|
-
})
|
|
559
|
-
}),
|
|
560
|
-
...(damlData.liquidation_preference_multiple && {
|
|
561
|
-
liquidation_preference_multiple: damlData.liquidation_preference_multiple
|
|
562
|
-
}),
|
|
563
|
-
...(damlData.participation_cap_multiple && {
|
|
564
|
-
participation_cap_multiple: damlData.participation_cap_multiple
|
|
565
|
-
}),
|
|
566
|
-
...(Array.isArray(dAny.comments) ? { comments: dAny.comments } : {})
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
// ===== Stakeholder Data Conversions =====
|
|
570
|
-
function stakeholderDataToDaml(data) {
|
|
571
|
-
if (!data.id)
|
|
572
|
-
throw new Error('stakeholder.id is required');
|
|
573
|
-
const payload = {
|
|
574
|
-
id: data.id,
|
|
575
|
-
name: nameToDaml(data.name),
|
|
576
|
-
stakeholder_type: stakeholderTypeToDaml(data.stakeholder_type),
|
|
577
|
-
issuer_assigned_id: data.issuer_assigned_id || null,
|
|
578
|
-
primary_contact: data.primary_contact ? contactInfoToDaml(data.primary_contact) : null,
|
|
579
|
-
contact_info: data.contact_info ? contactInfoWithoutNameToDaml(data.contact_info) : null,
|
|
580
|
-
addresses: (data.addresses || []).map(addressToDaml),
|
|
581
|
-
tax_ids: (data.tax_ids || []),
|
|
582
|
-
comments: data.comments || []
|
|
583
|
-
};
|
|
584
|
-
// Handle both current_relationship (singular, from API) and current_relationships (plural, from SDK)
|
|
585
|
-
const dataWithSingular = data;
|
|
586
|
-
const relationships = data.current_relationships
|
|
587
|
-
|| (dataWithSingular.current_relationship ? [dataWithSingular.current_relationship] : []);
|
|
588
|
-
if (relationships && relationships.length) {
|
|
589
|
-
const mapRel = (r) => {
|
|
590
|
-
const v = r.toUpperCase();
|
|
591
|
-
if (v.includes('EMPLOYEE'))
|
|
592
|
-
return 'OcfRelEmployee';
|
|
593
|
-
if (v.includes('ADVISOR'))
|
|
594
|
-
return 'OcfRelAdvisor';
|
|
595
|
-
if (v.includes('INVESTOR'))
|
|
596
|
-
return 'OcfRelInvestor';
|
|
597
|
-
if (v.includes('FOUNDER'))
|
|
598
|
-
return 'OcfRelFounder';
|
|
599
|
-
if (v.includes('BOARD'))
|
|
600
|
-
return 'OcfRelBoardMember';
|
|
601
|
-
if (v.includes('OFFICER'))
|
|
602
|
-
return 'OcfRelOfficer';
|
|
603
|
-
return 'OcfRelOther';
|
|
604
|
-
};
|
|
605
|
-
payload.current_relationships = relationships.map(mapRel);
|
|
606
|
-
}
|
|
607
|
-
if (data.current_status) {
|
|
608
|
-
const status = (data.current_status === 'ACTIVE' ? 'OcfStakeholderStatusActive' :
|
|
609
|
-
data.current_status === 'LEAVE_OF_ABSENCE' ? 'OcfStakeholderStatusLeaveOfAbsence' :
|
|
610
|
-
data.current_status === 'TERMINATION_VOLUNTARY_OTHER' ? 'OcfStakeholderStatusTerminationVoluntaryOther' :
|
|
611
|
-
data.current_status === 'TERMINATION_VOLUNTARY_GOOD_CAUSE' ? 'OcfStakeholderStatusTerminationVoluntaryGoodCause' :
|
|
612
|
-
data.current_status === 'TERMINATION_VOLUNTARY_RETIREMENT' ? 'OcfStakeholderStatusTerminationVoluntaryRetirement' :
|
|
613
|
-
data.current_status === 'TERMINATION_INVOLUNTARY_OTHER' ? 'OcfStakeholderStatusTerminationInvoluntaryOther' :
|
|
614
|
-
data.current_status === 'TERMINATION_INVOLUNTARY_DEATH' ? 'OcfStakeholderStatusTerminationInvoluntaryDeath' :
|
|
615
|
-
data.current_status === 'TERMINATION_INVOLUNTARY_DISABILITY' ? 'OcfStakeholderStatusTerminationInvoluntaryDisability' :
|
|
616
|
-
'OcfStakeholderStatusTerminationInvoluntaryWithCause');
|
|
617
|
-
payload.current_status = status;
|
|
618
|
-
}
|
|
619
|
-
return payload;
|
|
620
|
-
}
|
|
621
|
-
function damlStakeholderDataToNative(damlData) {
|
|
622
|
-
const dAny = damlData;
|
|
623
|
-
const name = {
|
|
624
|
-
legal_name: (dAny.name?.legal_name || ''),
|
|
625
|
-
...(dAny.name?.first_name ? { first_name: dAny.name.first_name } : {}),
|
|
626
|
-
...(dAny.name?.last_name ? { last_name: dAny.name.last_name } : {})
|
|
627
|
-
};
|
|
628
|
-
const mapRelBack = (s) => {
|
|
629
|
-
switch (s) {
|
|
630
|
-
case 'OcfRelEmployee': return 'EMPLOYEE';
|
|
631
|
-
case 'OcfRelAdvisor': return 'ADVISOR';
|
|
632
|
-
case 'OcfRelInvestor': return 'INVESTOR';
|
|
633
|
-
case 'OcfRelFounder': return 'FOUNDER';
|
|
634
|
-
case 'OcfRelBoardMember': return 'BOARD_MEMBER';
|
|
635
|
-
case 'OcfRelOfficer': return 'OFFICER';
|
|
636
|
-
case 'OcfRelOther': return 'OTHER';
|
|
637
|
-
default: return undefined;
|
|
638
|
-
}
|
|
639
|
-
};
|
|
640
|
-
const relationships = Array.isArray(dAny.current_relationships)
|
|
641
|
-
? dAny.current_relationships.map(r => mapRelBack(r) || 'OTHER')
|
|
642
|
-
: [];
|
|
643
|
-
const native = {
|
|
644
|
-
...(dAny.id ? { id: dAny.id } : {}),
|
|
645
|
-
name,
|
|
646
|
-
stakeholder_type: damlStakeholderTypeToNative(damlData.stakeholder_type),
|
|
647
|
-
...(damlData.issuer_assigned_id && { issuer_assigned_id: damlData.issuer_assigned_id }),
|
|
648
|
-
current_relationships: relationships,
|
|
649
|
-
...(dAny.current_status && { current_status: (() => {
|
|
650
|
-
const s = dAny.current_status;
|
|
651
|
-
switch (s) {
|
|
652
|
-
case 'OcfStakeholderStatusActive': return 'ACTIVE';
|
|
653
|
-
case 'OcfStakeholderStatusLeaveOfAbsence': return 'LEAVE_OF_ABSENCE';
|
|
654
|
-
case 'OcfStakeholderStatusTerminationVoluntaryOther': return 'TERMINATION_VOLUNTARY_OTHER';
|
|
655
|
-
case 'OcfStakeholderStatusTerminationVoluntaryGoodCause': return 'TERMINATION_VOLUNTARY_GOOD_CAUSE';
|
|
656
|
-
case 'OcfStakeholderStatusTerminationVoluntaryRetirement': return 'TERMINATION_VOLUNTARY_RETIREMENT';
|
|
657
|
-
case 'OcfStakeholderStatusTerminationInvoluntaryOther': return 'TERMINATION_INVOLUNTARY_OTHER';
|
|
658
|
-
case 'OcfStakeholderStatusTerminationInvoluntaryDeath': return 'TERMINATION_INVOLUNTARY_DEATH';
|
|
659
|
-
case 'OcfStakeholderStatusTerminationInvoluntaryDisability': return 'TERMINATION_INVOLUNTARY_DISABILITY';
|
|
660
|
-
case 'OcfStakeholderStatusTerminationInvoluntaryWithCause': return 'TERMINATION_INVOLUNTARY_WITH_CAUSE';
|
|
661
|
-
default: return undefined;
|
|
662
|
-
}
|
|
663
|
-
})() }),
|
|
664
|
-
...(damlData.primary_contact && { primary_contact: damlContactInfoToNative(damlData.primary_contact) }),
|
|
665
|
-
...(damlData.contact_info && { contact_info: damlContactInfoWithoutNameToNative(damlData.contact_info) }),
|
|
666
|
-
addresses: (damlData.addresses || []).map(damlAddressToNative),
|
|
667
|
-
tax_ids: (damlData.tax_ids || []),
|
|
668
|
-
comments: (Array.isArray(dAny.comments) ? dAny.comments : [])
|
|
669
|
-
};
|
|
670
|
-
return native;
|
|
671
|
-
}
|
|
672
|
-
// ===== Stock Legend Template Conversions =====
|
|
673
|
-
function stockLegendTemplateDataToDaml(data) {
|
|
674
|
-
if (!data.id)
|
|
675
|
-
throw new Error('stockLegendTemplate.id is required');
|
|
676
|
-
return {
|
|
677
|
-
id: data.id,
|
|
678
|
-
name: data.name,
|
|
679
|
-
text: data.text,
|
|
680
|
-
comments: data.comments || []
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
function damlStockLegendTemplateDataToNative(damlData) {
|
|
684
|
-
return {
|
|
685
|
-
id: damlData.id,
|
|
686
|
-
name: damlData.name || '',
|
|
687
|
-
text: damlData.text || '',
|
|
688
|
-
comments: (Array.isArray(damlData.comments)
|
|
689
|
-
? damlData.comments
|
|
690
|
-
: [])
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
// ===== Document Conversions =====
|
|
694
|
-
function objectTypeToDaml(t) {
|
|
695
|
-
switch (t) {
|
|
696
|
-
case 'ISSUER': return 'OcfObjIssuer';
|
|
697
|
-
case 'STAKEHOLDER': return 'OcfObjStakeholder';
|
|
698
|
-
case 'STOCK_CLASS': return 'OcfObjStockClass';
|
|
699
|
-
case 'STOCK_LEGEND_TEMPLATE': return 'OcfObjStockLegendTemplate';
|
|
700
|
-
case 'STOCK_PLAN': return 'OcfObjStockPlan';
|
|
701
|
-
case 'VALUATION': return 'OcfObjValuation';
|
|
702
|
-
case 'VESTING_TERMS': return 'OcfObjVestingTerms';
|
|
703
|
-
case 'FINANCING': return 'OcfObjFinancing';
|
|
704
|
-
case 'DOCUMENT': return 'OcfObjDocument';
|
|
705
|
-
case 'CE_STAKEHOLDER_RELATIONSHIP': return 'OcfObjCeStakeholderRelationship';
|
|
706
|
-
case 'CE_STAKEHOLDER_STATUS': return 'OcfObjCeStakeholderStatus';
|
|
707
|
-
case 'TX_ISSUER_AUTHORIZED_SHARES_ADJUSTMENT': return 'OcfObjTxIssuerAuthorizedSharesAdjustment';
|
|
708
|
-
case 'TX_STOCK_CLASS_CONVERSION_RATIO_ADJUSTMENT': return 'OcfObjTxStockClassConversionRatioAdjustment';
|
|
709
|
-
case 'TX_STOCK_CLASS_AUTHORIZED_SHARES_ADJUSTMENT': return 'OcfObjTxStockClassAuthorizedSharesAdjustment';
|
|
710
|
-
case 'TX_STOCK_CLASS_SPLIT': return 'OcfObjTxStockClassSplit';
|
|
711
|
-
case 'TX_STOCK_PLAN_POOL_ADJUSTMENT': return 'OcfObjTxStockPlanPoolAdjustment';
|
|
712
|
-
case 'TX_STOCK_PLAN_RETURN_TO_POOL': return 'OcfObjTxStockPlanReturnToPool';
|
|
713
|
-
case 'TX_CONVERTIBLE_ACCEPTANCE': return 'OcfObjTxConvertibleAcceptance';
|
|
714
|
-
case 'TX_CONVERTIBLE_CANCELLATION': return 'OcfObjTxConvertibleCancellation';
|
|
715
|
-
case 'TX_CONVERTIBLE_CONVERSION': return 'OcfObjTxConvertibleConversion';
|
|
716
|
-
case 'TX_CONVERTIBLE_ISSUANCE': return 'OcfObjTxConvertibleIssuance';
|
|
717
|
-
case 'TX_CONVERTIBLE_RETRACTION': return 'OcfObjTxConvertibleRetraction';
|
|
718
|
-
case 'TX_CONVERTIBLE_TRANSFER': return 'OcfObjTxConvertibleTransfer';
|
|
719
|
-
case 'TX_EQUITY_COMPENSATION_ACCEPTANCE': return 'OcfObjTxEquityCompensationAcceptance';
|
|
720
|
-
case 'TX_EQUITY_COMPENSATION_CANCELLATION': return 'OcfObjTxEquityCompensationCancellation';
|
|
721
|
-
case 'TX_EQUITY_COMPENSATION_EXERCISE': return 'OcfObjTxEquityCompensationExercise';
|
|
722
|
-
case 'TX_EQUITY_COMPENSATION_ISSUANCE': return 'OcfObjTxEquityCompensationIssuance';
|
|
723
|
-
case 'TX_EQUITY_COMPENSATION_RELEASE': return 'OcfObjTxEquityCompensationRelease';
|
|
724
|
-
case 'TX_EQUITY_COMPENSATION_RETRACTION': return 'OcfObjTxEquityCompensationRetraction';
|
|
725
|
-
case 'TX_EQUITY_COMPENSATION_TRANSFER': return 'OcfObjTxEquityCompensationTransfer';
|
|
726
|
-
case 'TX_EQUITY_COMPENSATION_REPRICING': return 'OcfObjTxEquityCompensationRepricing';
|
|
727
|
-
case 'TX_PLAN_SECURITY_ACCEPTANCE': return 'OcfObjTxPlanSecurityAcceptance';
|
|
728
|
-
case 'TX_PLAN_SECURITY_CANCELLATION': return 'OcfObjTxPlanSecurityCancellation';
|
|
729
|
-
case 'TX_PLAN_SECURITY_EXERCISE': return 'OcfObjTxPlanSecurityExercise';
|
|
730
|
-
case 'TX_PLAN_SECURITY_ISSUANCE': return 'OcfObjTxPlanSecurityIssuance';
|
|
731
|
-
case 'TX_PLAN_SECURITY_RELEASE': return 'OcfObjTxPlanSecurityRelease';
|
|
732
|
-
case 'TX_PLAN_SECURITY_RETRACTION': return 'OcfObjTxPlanSecurityRetraction';
|
|
733
|
-
case 'TX_PLAN_SECURITY_TRANSFER': return 'OcfObjTxPlanSecurityTransfer';
|
|
734
|
-
case 'TX_STOCK_ACCEPTANCE': return 'OcfObjTxStockAcceptance';
|
|
735
|
-
case 'TX_STOCK_CANCELLATION': return 'OcfObjTxStockCancellation';
|
|
736
|
-
case 'TX_STOCK_CONVERSION': return 'OcfObjTxStockConversion';
|
|
737
|
-
case 'TX_STOCK_ISSUANCE': return 'OcfObjTxStockIssuance';
|
|
738
|
-
case 'TX_STOCK_REISSUANCE': return 'OcfObjTxStockReissuance';
|
|
739
|
-
case 'TX_STOCK_CONSOLIDATION': return 'OcfObjTxStockConsolidation';
|
|
740
|
-
case 'TX_STOCK_REPURCHASE': return 'OcfObjTxStockRepurchase';
|
|
741
|
-
case 'TX_STOCK_RETRACTION': return 'OcfObjTxStockRetraction';
|
|
742
|
-
case 'TX_STOCK_TRANSFER': return 'OcfObjTxStockTransfer';
|
|
743
|
-
case 'TX_WARRANT_ACCEPTANCE': return 'OcfObjTxWarrantAcceptance';
|
|
744
|
-
case 'TX_WARRANT_CANCELLATION': return 'OcfObjTxWarrantCancellation';
|
|
745
|
-
case 'TX_WARRANT_EXERCISE': return 'OcfObjTxWarrantExercise';
|
|
746
|
-
case 'TX_WARRANT_ISSUANCE': return 'OcfObjTxWarrantIssuance';
|
|
747
|
-
case 'TX_WARRANT_RETRACTION': return 'OcfObjTxWarrantRetraction';
|
|
748
|
-
case 'TX_WARRANT_TRANSFER': return 'OcfObjTxWarrantTransfer';
|
|
749
|
-
case 'TX_VESTING_ACCELERATION': return 'OcfObjTxVestingAcceleration';
|
|
750
|
-
case 'TX_VESTING_START': return 'OcfObjTxVestingStart';
|
|
751
|
-
case 'TX_VESTING_EVENT': return 'OcfObjTxVestingEvent';
|
|
752
|
-
default: throw new Error(`Unsupported object reference type: ${t}`);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
function objectTypeToNative(t) {
|
|
756
|
-
switch (t) {
|
|
757
|
-
case 'OcfObjIssuer': return 'ISSUER';
|
|
758
|
-
case 'OcfObjStakeholder': return 'STAKEHOLDER';
|
|
759
|
-
case 'OcfObjStockClass': return 'STOCK_CLASS';
|
|
760
|
-
case 'OcfObjStockLegendTemplate': return 'STOCK_LEGEND_TEMPLATE';
|
|
761
|
-
case 'OcfObjStockPlan': return 'STOCK_PLAN';
|
|
762
|
-
case 'OcfObjValuation': return 'VALUATION';
|
|
763
|
-
case 'OcfObjVestingTerms': return 'VESTING_TERMS';
|
|
764
|
-
case 'OcfObjFinancing': return 'FINANCING';
|
|
765
|
-
case 'OcfObjDocument': return 'DOCUMENT';
|
|
766
|
-
case 'OcfObjCeStakeholderRelationship': return 'CE_STAKEHOLDER_RELATIONSHIP';
|
|
767
|
-
case 'OcfObjCeStakeholderStatus': return 'CE_STAKEHOLDER_STATUS';
|
|
768
|
-
case 'OcfObjTxIssuerAuthorizedSharesAdjustment': return 'TX_ISSUER_AUTHORIZED_SHARES_ADJUSTMENT';
|
|
769
|
-
case 'OcfObjTxStockClassConversionRatioAdjustment': return 'TX_STOCK_CLASS_CONVERSION_RATIO_ADJUSTMENT';
|
|
770
|
-
case 'OcfObjTxStockClassAuthorizedSharesAdjustment': return 'TX_STOCK_CLASS_AUTHORIZED_SHARES_ADJUSTMENT';
|
|
771
|
-
case 'OcfObjTxStockClassSplit': return 'TX_STOCK_CLASS_SPLIT';
|
|
772
|
-
case 'OcfObjTxStockPlanPoolAdjustment': return 'TX_STOCK_PLAN_POOL_ADJUSTMENT';
|
|
773
|
-
case 'OcfObjTxStockPlanReturnToPool': return 'TX_STOCK_PLAN_RETURN_TO_POOL';
|
|
774
|
-
case 'OcfObjTxConvertibleAcceptance': return 'TX_CONVERTIBLE_ACCEPTANCE';
|
|
775
|
-
case 'OcfObjTxConvertibleCancellation': return 'TX_CONVERTIBLE_CANCELLATION';
|
|
776
|
-
case 'OcfObjTxConvertibleConversion': return 'TX_CONVERTIBLE_CONVERSION';
|
|
777
|
-
case 'OcfObjTxConvertibleIssuance': return 'TX_CONVERTIBLE_ISSUANCE';
|
|
778
|
-
case 'OcfObjTxConvertibleRetraction': return 'TX_CONVERTIBLE_RETRACTION';
|
|
779
|
-
case 'OcfObjTxConvertibleTransfer': return 'TX_CONVERTIBLE_TRANSFER';
|
|
780
|
-
case 'OcfObjTxEquityCompensationAcceptance': return 'TX_EQUITY_COMPENSATION_ACCEPTANCE';
|
|
781
|
-
case 'OcfObjTxEquityCompensationCancellation': return 'TX_EQUITY_COMPENSATION_CANCELLATION';
|
|
782
|
-
case 'OcfObjTxEquityCompensationExercise': return 'TX_EQUITY_COMPENSATION_EXERCISE';
|
|
783
|
-
case 'OcfObjTxEquityCompensationIssuance': return 'TX_EQUITY_COMPENSATION_ISSUANCE';
|
|
784
|
-
case 'OcfObjTxEquityCompensationRelease': return 'TX_EQUITY_COMPENSATION_RELEASE';
|
|
785
|
-
case 'OcfObjTxEquityCompensationRetraction': return 'TX_EQUITY_COMPENSATION_RETRACTION';
|
|
786
|
-
case 'OcfObjTxEquityCompensationTransfer': return 'TX_EQUITY_COMPENSATION_TRANSFER';
|
|
787
|
-
case 'OcfObjTxEquityCompensationRepricing': return 'TX_EQUITY_COMPENSATION_REPRICING';
|
|
788
|
-
case 'OcfObjTxPlanSecurityAcceptance': return 'TX_PLAN_SECURITY_ACCEPTANCE';
|
|
789
|
-
case 'OcfObjTxPlanSecurityCancellation': return 'TX_PLAN_SECURITY_CANCELLATION';
|
|
790
|
-
case 'OcfObjTxPlanSecurityExercise': return 'TX_PLAN_SECURITY_EXERCISE';
|
|
791
|
-
case 'OcfObjTxPlanSecurityIssuance': return 'TX_PLAN_SECURITY_ISSUANCE';
|
|
792
|
-
case 'OcfObjTxPlanSecurityRelease': return 'TX_PLAN_SECURITY_RELEASE';
|
|
793
|
-
case 'OcfObjTxPlanSecurityRetraction': return 'TX_PLAN_SECURITY_RETRACTION';
|
|
794
|
-
case 'OcfObjTxPlanSecurityTransfer': return 'TX_PLAN_SECURITY_TRANSFER';
|
|
795
|
-
case 'OcfObjTxStockAcceptance': return 'TX_STOCK_ACCEPTANCE';
|
|
796
|
-
case 'OcfObjTxStockCancellation': return 'TX_STOCK_CANCELLATION';
|
|
797
|
-
case 'OcfObjTxStockConversion': return 'TX_STOCK_CONVERSION';
|
|
798
|
-
case 'OcfObjTxStockIssuance': return 'TX_STOCK_ISSUANCE';
|
|
799
|
-
case 'OcfObjTxStockReissuance': return 'TX_STOCK_REISSUANCE';
|
|
800
|
-
case 'OcfObjTxStockConsolidation': return 'TX_STOCK_CONSOLIDATION';
|
|
801
|
-
case 'OcfObjTxStockRepurchase': return 'TX_STOCK_REPURCHASE';
|
|
802
|
-
case 'OcfObjTxStockRetraction': return 'TX_STOCK_RETRACTION';
|
|
803
|
-
case 'OcfObjTxStockTransfer': return 'TX_STOCK_TRANSFER';
|
|
804
|
-
case 'OcfObjTxWarrantAcceptance': return 'TX_WARRANT_ACCEPTANCE';
|
|
805
|
-
case 'OcfObjTxWarrantCancellation': return 'TX_WARRANT_CANCELLATION';
|
|
806
|
-
case 'OcfObjTxWarrantExercise': return 'TX_WARRANT_EXERCISE';
|
|
807
|
-
case 'OcfObjTxWarrantIssuance': return 'TX_WARRANT_ISSUANCE';
|
|
808
|
-
case 'OcfObjTxWarrantRetraction': return 'TX_WARRANT_RETRACTION';
|
|
809
|
-
case 'OcfObjTxWarrantTransfer': return 'TX_WARRANT_TRANSFER';
|
|
810
|
-
case 'OcfObjTxVestingAcceleration': return 'TX_VESTING_ACCELERATION';
|
|
811
|
-
case 'OcfObjTxVestingStart': return 'TX_VESTING_START';
|
|
812
|
-
case 'OcfObjTxVestingEvent': return 'TX_VESTING_EVENT';
|
|
813
|
-
default: throw new Error(`Unknown DAML object reference type: ${t}`);
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
function documentDataToDaml(d) {
|
|
817
|
-
if (!d.id)
|
|
818
|
-
throw new Error('document.id is required');
|
|
819
|
-
if (!d.md5)
|
|
820
|
-
throw new Error('document.md5 is required');
|
|
821
|
-
if (!d.path && !d.uri)
|
|
822
|
-
throw new Error('document requires path or uri');
|
|
823
|
-
return {
|
|
824
|
-
id: d.id,
|
|
825
|
-
path: d.path ?? null,
|
|
826
|
-
uri: d.uri ?? null,
|
|
827
|
-
md5: d.md5,
|
|
828
|
-
related_objects: (d.related_objects || []).map(r => ({
|
|
829
|
-
object_type: objectTypeToDaml(r.object_type),
|
|
830
|
-
object_id: r.object_id
|
|
831
|
-
})),
|
|
832
|
-
comments: d.comments || []
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
function damlDocumentDataToNative(d) {
|
|
836
|
-
return {
|
|
837
|
-
id: d.id,
|
|
838
|
-
...(d.path ? { path: d.path || undefined } : {}),
|
|
839
|
-
...(d.uri ? { uri: d.uri || undefined } : {}),
|
|
840
|
-
md5: d.md5,
|
|
841
|
-
related_objects: (d.related_objects || []).map(r => ({
|
|
842
|
-
object_type: objectTypeToNative(r.object_type),
|
|
843
|
-
object_id: r.object_id
|
|
844
|
-
})),
|
|
845
|
-
comments: (Array.isArray(d.comments)
|
|
846
|
-
? d.comments
|
|
847
|
-
: [])
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
// ===== Stock Issuance Conversions =====
|
|
851
|
-
function securityExemptionToDaml(e) {
|
|
852
|
-
return {
|
|
853
|
-
description: e.description,
|
|
854
|
-
jurisdiction: e.jurisdiction
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
|
-
function damlSecurityExemptionToNative(e) {
|
|
858
|
-
return { description: e.description, jurisdiction: e.jurisdiction };
|
|
859
|
-
}
|
|
860
|
-
function shareNumberRangeToDaml(r) {
|
|
861
|
-
return {
|
|
862
|
-
starting_share_number: typeof r.starting_share_number === 'number' ? r.starting_share_number.toString() : r.starting_share_number,
|
|
863
|
-
ending_share_number: typeof r.ending_share_number === 'number' ? r.ending_share_number.toString() : r.ending_share_number
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
function damlShareNumberRangeToNative(r) {
|
|
867
|
-
return {
|
|
868
|
-
starting_share_number: r.starting_share_number,
|
|
869
|
-
ending_share_number: r.ending_share_number
|
|
870
|
-
};
|
|
871
|
-
}
|
|
872
|
-
function stockIssuanceTypeToDaml(t) {
|
|
873
|
-
if (!t)
|
|
874
|
-
return null;
|
|
875
|
-
switch (t) {
|
|
876
|
-
case 'RSA': return 'OcfStockIssuanceRSA';
|
|
877
|
-
case 'FOUNDERS_STOCK': return 'OcfStockIssuanceFounders';
|
|
878
|
-
default: throw new Error(`Unknown stock issuance type: ${t}`);
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
function damlStockIssuanceTypeToNative(t) {
|
|
882
|
-
switch (t) {
|
|
883
|
-
case 'OcfStockIssuanceRSA': return 'RSA';
|
|
884
|
-
case 'OcfStockIssuanceFounders': return 'FOUNDERS_STOCK';
|
|
885
|
-
default: return undefined;
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
function stockIssuanceDataToDaml(d) {
|
|
889
|
-
if (!d.id)
|
|
890
|
-
throw new Error('stockIssuance.id is required');
|
|
891
|
-
if (!d.security_id)
|
|
892
|
-
throw new Error('stockIssuance.security_id is required');
|
|
893
|
-
if (!d.custom_id)
|
|
894
|
-
throw new Error('stockIssuance.custom_id is required');
|
|
895
|
-
if (!d.stakeholder_id)
|
|
896
|
-
throw new Error('stockIssuance.stakeholder_id is required');
|
|
897
|
-
if (!d.stock_class_id)
|
|
898
|
-
throw new Error('stockIssuance.stock_class_id is required');
|
|
899
|
-
// Allow empty array for stock_legend_ids per OCF schema (no minItems)
|
|
900
|
-
return {
|
|
901
|
-
id: d.id,
|
|
902
|
-
date: dateStringToDAMLTime(d.date),
|
|
903
|
-
security_id: d.security_id,
|
|
904
|
-
custom_id: d.custom_id,
|
|
905
|
-
stakeholder_id: d.stakeholder_id,
|
|
906
|
-
board_approval_date: d.board_approval_date ? dateStringToDAMLTime(d.board_approval_date) : null,
|
|
907
|
-
stockholder_approval_date: d.stockholder_approval_date ? dateStringToDAMLTime(d.stockholder_approval_date) : null,
|
|
908
|
-
consideration_text: (d.consideration_text && d.consideration_text != '') ? d.consideration_text : null,
|
|
909
|
-
security_law_exemptions: (d.security_law_exemptions || []).map(securityExemptionToDaml),
|
|
910
|
-
stock_class_id: d.stock_class_id,
|
|
911
|
-
stock_plan_id: d.stock_plan_id ?? null,
|
|
912
|
-
share_numbers_issued: (d.share_numbers_issued || [])
|
|
913
|
-
.filter(range => !(range.starting_share_number === '0' && range.ending_share_number === '0'))
|
|
914
|
-
.map(shareNumberRangeToDaml),
|
|
915
|
-
share_price: monetaryToDaml(d.share_price),
|
|
916
|
-
quantity: typeof d.quantity === 'number' ? d.quantity.toString() : d.quantity,
|
|
917
|
-
vesting_terms_id: d.vesting_terms_id ?? null,
|
|
918
|
-
vestings: (d.vestings || []).map(v => ({ date: dateStringToDAMLTime(v.date), amount: typeof v.amount === 'number' ? v.amount.toString() : v.amount })),
|
|
919
|
-
cost_basis: d.cost_basis ? monetaryToDaml(d.cost_basis) : null,
|
|
920
|
-
stock_legend_ids: d.stock_legend_ids,
|
|
921
|
-
issuance_type: stockIssuanceTypeToDaml(d.issuance_type),
|
|
922
|
-
comments: d.comments || []
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
function damlStockIssuanceDataToNative(d) {
|
|
926
|
-
const anyD = d;
|
|
927
|
-
return {
|
|
928
|
-
id: d.id,
|
|
929
|
-
date: damlTimeToDateString(d.date),
|
|
930
|
-
security_id: d.security_id,
|
|
931
|
-
custom_id: d.custom_id,
|
|
932
|
-
stakeholder_id: d.stakeholder_id,
|
|
933
|
-
...(d.board_approval_date && { board_approval_date: damlTimeToDateString(d.board_approval_date) }),
|
|
934
|
-
...(d.stockholder_approval_date && { stockholder_approval_date: damlTimeToDateString(d.stockholder_approval_date) }),
|
|
935
|
-
...(d.consideration_text && { consideration_text: d.consideration_text }),
|
|
936
|
-
security_law_exemptions: (Array.isArray(anyD.security_law_exemptions)
|
|
937
|
-
? anyD.security_law_exemptions
|
|
938
|
-
: []).map(damlSecurityExemptionToNative),
|
|
939
|
-
stock_class_id: d.stock_class_id,
|
|
940
|
-
...(d.stock_plan_id && { stock_plan_id: d.stock_plan_id }),
|
|
941
|
-
share_numbers_issued: (Array.isArray(anyD.share_numbers_issued)
|
|
942
|
-
? anyD.share_numbers_issued.map(damlShareNumberRangeToNative)
|
|
943
|
-
: []),
|
|
944
|
-
share_price: damlMonetaryToNative(d.share_price),
|
|
945
|
-
quantity: d.quantity,
|
|
946
|
-
...(d.vesting_terms_id && { vesting_terms_id: d.vesting_terms_id }),
|
|
947
|
-
vestings: (Array.isArray(anyD.vestings)
|
|
948
|
-
? (anyD.vestings).map((v) => ({ date: damlTimeToDateString(v.date), amount: v.amount }))
|
|
949
|
-
: []),
|
|
950
|
-
...(d.cost_basis && { cost_basis: damlMonetaryToNative(d.cost_basis) }),
|
|
951
|
-
stock_legend_ids: Array.isArray(d.stock_legend_ids) ? d.stock_legend_ids : [],
|
|
952
|
-
...((anyD.issuance_type !== undefined) && { issuance_type: damlStockIssuanceTypeToNative(anyD.issuance_type) }),
|
|
953
|
-
comments: (anyD.comments !== undefined && Array.isArray(anyD.comments))
|
|
954
|
-
? anyD.comments
|
|
955
|
-
: []
|
|
956
|
-
};
|
|
957
|
-
}
|
|
958
|
-
// ===== Valuation Conversions =====
|
|
959
|
-
function valuationTypeToDaml(t) {
|
|
960
|
-
switch (t) {
|
|
961
|
-
case '409A':
|
|
962
|
-
return 'OcfValuationType409A';
|
|
963
|
-
default:
|
|
964
|
-
throw new Error(`Unknown valuation type: ${t}`);
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
function damlValuationTypeToNative(t) {
|
|
968
|
-
switch (t) {
|
|
969
|
-
case 'OcfValuationType409A':
|
|
970
|
-
return '409A';
|
|
971
|
-
default:
|
|
972
|
-
throw new Error(`Unknown DAML valuation type: ${t}`);
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
function valuationDataToDaml(data) {
|
|
976
|
-
if (!data.id)
|
|
977
|
-
throw new Error('valuation.id is required');
|
|
978
|
-
if (!('stock_class_id' in data) || !data.stock_class_id)
|
|
979
|
-
throw new Error('valuation.stock_class_id is required');
|
|
980
|
-
return {
|
|
981
|
-
id: data.id,
|
|
982
|
-
stock_class_id: data.stock_class_id || '',
|
|
983
|
-
provider: data.provider || null,
|
|
984
|
-
board_approval_date: data.board_approval_date ? dateStringToDAMLTime(data.board_approval_date) : null,
|
|
985
|
-
stockholder_approval_date: data.stockholder_approval_date ? dateStringToDAMLTime(data.stockholder_approval_date) : null,
|
|
986
|
-
comments: data.comments || [],
|
|
987
|
-
price_per_share: monetaryToDaml(data.price_per_share),
|
|
988
|
-
effective_date: dateStringToDAMLTime(data.effective_date),
|
|
989
|
-
valuation_type: valuationTypeToDaml(data.valuation_type)
|
|
990
|
-
};
|
|
991
|
-
}
|
|
992
|
-
function damlValuationDataToNative(d) {
|
|
993
|
-
return {
|
|
994
|
-
id: d.id,
|
|
995
|
-
stock_class_id: ('stock_class_id' in d ? d.stock_class_id || '' : ''),
|
|
996
|
-
...(d.provider && { provider: d.provider }),
|
|
997
|
-
...(d.board_approval_date && { board_approval_date: damlTimeToDateString(d.board_approval_date) }),
|
|
998
|
-
...(d.stockholder_approval_date && { stockholder_approval_date: damlTimeToDateString(d.stockholder_approval_date) }),
|
|
999
|
-
...(d.comments && { comments: d.comments }),
|
|
1000
|
-
price_per_share: damlMonetaryToNative(d.price_per_share),
|
|
1001
|
-
effective_date: damlTimeToDateString(d.effective_date),
|
|
1002
|
-
valuation_type: damlValuationTypeToNative(d.valuation_type)
|
|
1003
|
-
};
|
|
1004
|
-
}
|
|
1005
|
-
// ===== Vesting Terms Conversions =====
|
|
1006
|
-
function allocationTypeToDaml(t) {
|
|
1007
|
-
switch (t) {
|
|
1008
|
-
case 'CUMULATIVE_ROUNDING': return 'OcfAllocationCumulativeRounding';
|
|
1009
|
-
case 'CUMULATIVE_ROUND_DOWN': return 'OcfAllocationCumulativeRoundDown';
|
|
1010
|
-
case 'FRONT_LOADED': return 'OcfAllocationFrontLoaded';
|
|
1011
|
-
case 'BACK_LOADED': return 'OcfAllocationBackLoaded';
|
|
1012
|
-
case 'FRONT_LOADED_SINGLE_TRANCHE': return 'OcfAllocationFrontLoadedToSingleTranche';
|
|
1013
|
-
case 'BACK_LOADED_SINGLE_TRANCHE': return 'OcfAllocationBackLoadedToSingleTranche';
|
|
1014
|
-
case 'FRACTIONAL': return 'OcfAllocationFractional';
|
|
1015
|
-
default: throw new Error(`Unknown allocation type: ${t}`);
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
function damlAllocationTypeToNative(t) {
|
|
1019
|
-
switch (t) {
|
|
1020
|
-
case 'OcfAllocationCumulativeRounding': return 'CUMULATIVE_ROUNDING';
|
|
1021
|
-
case 'OcfAllocationCumulativeRoundDown': return 'CUMULATIVE_ROUND_DOWN';
|
|
1022
|
-
case 'OcfAllocationFrontLoaded': return 'FRONT_LOADED';
|
|
1023
|
-
case 'OcfAllocationBackLoaded': return 'BACK_LOADED';
|
|
1024
|
-
case 'OcfAllocationFrontLoadedToSingleTranche': return 'FRONT_LOADED_SINGLE_TRANCHE';
|
|
1025
|
-
case 'OcfAllocationBackLoadedToSingleTranche': return 'BACK_LOADED_SINGLE_TRANCHE';
|
|
1026
|
-
case 'OcfAllocationFractional': return 'FRACTIONAL';
|
|
1027
|
-
default: throw new Error(`Unknown DAML allocation type: ${t}`);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
function mapOcfDayOfMonthToDaml(day) {
|
|
1031
|
-
const d = (day || '').toString().toUpperCase();
|
|
1032
|
-
const table = {
|
|
1033
|
-
'01': 'OcfVestingDay01', '02': 'OcfVestingDay02', '03': 'OcfVestingDay03', '04': 'OcfVestingDay04', '05': 'OcfVestingDay05',
|
|
1034
|
-
'06': 'OcfVestingDay06', '07': 'OcfVestingDay07', '08': 'OcfVestingDay08', '09': 'OcfVestingDay09', '10': 'OcfVestingDay10',
|
|
1035
|
-
'11': 'OcfVestingDay11', '12': 'OcfVestingDay12', '13': 'OcfVestingDay13', '14': 'OcfVestingDay14', '15': 'OcfVestingDay15',
|
|
1036
|
-
'16': 'OcfVestingDay16', '17': 'OcfVestingDay17', '18': 'OcfVestingDay18', '19': 'OcfVestingDay19', '20': 'OcfVestingDay20',
|
|
1037
|
-
'21': 'OcfVestingDay21', '22': 'OcfVestingDay22', '23': 'OcfVestingDay23', '24': 'OcfVestingDay24', '25': 'OcfVestingDay25',
|
|
1038
|
-
'26': 'OcfVestingDay26', '27': 'OcfVestingDay27', '28': 'OcfVestingDay28',
|
|
1039
|
-
'29_OR_LAST_DAY_OF_MONTH': 'OcfVestingDay29OrLast',
|
|
1040
|
-
'30_OR_LAST_DAY_OF_MONTH': 'OcfVestingDay30OrLast',
|
|
1041
|
-
'31_OR_LAST_DAY_OF_MONTH': 'OcfVestingDay31OrLast',
|
|
1042
|
-
'VESTING_START_DAY_OR_LAST_DAY_OF_MONTH': 'OcfVestingStartDayOrLast'
|
|
1043
|
-
};
|
|
1044
|
-
return table[d] || 'OcfVestingStartDayOrLast';
|
|
1045
|
-
}
|
|
1046
|
-
function mapDamlDayOfMonthToOcf(day) {
|
|
1047
|
-
const table = {
|
|
1048
|
-
OcfVestingDay01: '01', OcfVestingDay02: '02', OcfVestingDay03: '03', OcfVestingDay04: '04', OcfVestingDay05: '05',
|
|
1049
|
-
OcfVestingDay06: '06', OcfVestingDay07: '07', OcfVestingDay08: '08', OcfVestingDay09: '09', OcfVestingDay10: '10',
|
|
1050
|
-
OcfVestingDay11: '11', OcfVestingDay12: '12', OcfVestingDay13: '13', OcfVestingDay14: '14', OcfVestingDay15: '15',
|
|
1051
|
-
OcfVestingDay16: '16', OcfVestingDay17: '17', OcfVestingDay18: '18', OcfVestingDay19: '19', OcfVestingDay20: '20',
|
|
1052
|
-
OcfVestingDay21: '21', OcfVestingDay22: '22', OcfVestingDay23: '23', OcfVestingDay24: '24', OcfVestingDay25: '25',
|
|
1053
|
-
OcfVestingDay26: '26', OcfVestingDay27: '27', OcfVestingDay28: '28',
|
|
1054
|
-
OcfVestingDay29OrLast: '29_OR_LAST_DAY_OF_MONTH',
|
|
1055
|
-
OcfVestingDay30OrLast: '30_OR_LAST_DAY_OF_MONTH',
|
|
1056
|
-
OcfVestingDay31OrLast: '31_OR_LAST_DAY_OF_MONTH',
|
|
1057
|
-
OcfVestingStartDayOrLast: 'VESTING_START_DAY_OR_LAST_DAY_OF_MONTH'
|
|
1058
|
-
};
|
|
1059
|
-
return table[day] || 'VESTING_START_DAY_OR_LAST_DAY_OF_MONTH';
|
|
1060
|
-
}
|
|
1061
|
-
// Legacy helper for old native type VestingPeriod
|
|
1062
|
-
function damlVestingPeriodToNative(p) {
|
|
1063
|
-
if (p.tag === 'OcfVestingPeriodDays') {
|
|
1064
|
-
const v = p.value || {};
|
|
1065
|
-
const occRaw = v.occurrences;
|
|
1066
|
-
if (occRaw === undefined || occRaw === null)
|
|
1067
|
-
throw new Error('Missing vesting period occurrences');
|
|
1068
|
-
const occ = Number(occRaw);
|
|
1069
|
-
if (!Number.isFinite(occ) || occ < 1)
|
|
1070
|
-
throw new Error('Invalid vesting period occurrences');
|
|
1071
|
-
return {
|
|
1072
|
-
tag: 'DAYS',
|
|
1073
|
-
length: Number(v.length_),
|
|
1074
|
-
occurrences: occ,
|
|
1075
|
-
...(v.cliff_installment !== null && v.cliff_installment !== undefined ? { cliff_installment: Number(v.cliff_installment) } : {})
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
if (p.tag === 'OcfVestingPeriodMonths') {
|
|
1079
|
-
const v = p.value || {};
|
|
1080
|
-
const occRaw = v.occurrences;
|
|
1081
|
-
if (occRaw === undefined || occRaw === null)
|
|
1082
|
-
throw new Error('Missing vesting period occurrences');
|
|
1083
|
-
const occ = Number(occRaw);
|
|
1084
|
-
if (!Number.isFinite(occ) || occ < 1)
|
|
1085
|
-
throw new Error('Invalid vesting period occurrences');
|
|
1086
|
-
if (v.day_of_month === undefined || v.day_of_month === null)
|
|
1087
|
-
throw new Error('Missing vesting period day_of_month for MONTHS');
|
|
1088
|
-
return {
|
|
1089
|
-
tag: 'MONTHS',
|
|
1090
|
-
length: Number(v.length_),
|
|
1091
|
-
occurrences: occ,
|
|
1092
|
-
day_of_month: mapDamlDayOfMonthToOcf(v.day_of_month),
|
|
1093
|
-
...(v.cliff_installment !== null && v.cliff_installment !== undefined ? { cliff_installment: Number(v.cliff_installment) } : {})
|
|
1094
|
-
};
|
|
1095
|
-
}
|
|
1096
|
-
throw new Error('Unknown DAML vesting period');
|
|
1097
|
-
}
|
|
1098
|
-
function vestingTriggerToDaml(t) {
|
|
1099
|
-
const type = typeof t?.type === 'string' ? t.type.toUpperCase() : undefined;
|
|
1100
|
-
// Map schema 'type' to DAML
|
|
1101
|
-
if (type === 'VESTING_START_DATE')
|
|
1102
|
-
return { tag: 'OcfVestingStartTrigger', value: {} };
|
|
1103
|
-
if (type === 'VESTING_EVENT')
|
|
1104
|
-
return { tag: 'OcfVestingEventTrigger', value: {} };
|
|
1105
|
-
if (type === 'VESTING_SCHEDULE_ABSOLUTE') {
|
|
1106
|
-
const date = t?.date || t?.at;
|
|
1107
|
-
if (!date)
|
|
1108
|
-
throw new Error('Vesting absolute trigger requires date');
|
|
1109
|
-
return { tag: 'OcfVestingScheduleAbsoluteTrigger', value: dateStringToDAMLTime(date) };
|
|
1110
|
-
}
|
|
1111
|
-
if (type === 'VESTING_SCHEDULE_RELATIVE') {
|
|
1112
|
-
const p = t?.period || {};
|
|
1113
|
-
const pType = ((p?.type || '').toString().toUpperCase()) === 'MONTHS' ? 'MONTHS' : 'DAYS';
|
|
1114
|
-
const lengthVal = p?.length ?? p?.value;
|
|
1115
|
-
const occurrencesVal = p?.occurrences;
|
|
1116
|
-
const cliffVal = p?.cliff_installment;
|
|
1117
|
-
const lengthNum = Number(lengthVal);
|
|
1118
|
-
if (occurrencesVal === undefined || occurrencesVal === null)
|
|
1119
|
-
throw new Error('Missing vesting relative period occurrences');
|
|
1120
|
-
const occurrencesNum = Number(occurrencesVal);
|
|
1121
|
-
if (!Number.isFinite(lengthNum) || lengthNum <= 0)
|
|
1122
|
-
throw new Error('Invalid vesting relative period length');
|
|
1123
|
-
if (!Number.isFinite(occurrencesNum) || occurrencesNum < 1)
|
|
1124
|
-
throw new Error('Invalid vesting relative period occurrences');
|
|
1125
|
-
let period;
|
|
1126
|
-
if (pType === 'DAYS') {
|
|
1127
|
-
period = { tag: 'OcfVestingPeriodDays', value: { length_: String(lengthNum), occurrences: String(occurrencesNum), cliff_installment: cliffVal === undefined ? null : String(Number(cliffVal)) } };
|
|
1128
|
-
}
|
|
1129
|
-
else {
|
|
1130
|
-
if (p?.day_of_month === undefined || p?.day_of_month === null)
|
|
1131
|
-
throw new Error('Missing vesting relative period day_of_month for MONTHS');
|
|
1132
|
-
period = { tag: 'OcfVestingPeriodMonths', value: { length_: String(lengthNum), occurrences: String(occurrencesNum), day_of_month: mapOcfDayOfMonthToDaml(p?.day_of_month), cliff_installment: cliffVal === undefined ? null : String(Number(cliffVal)) } };
|
|
1133
|
-
}
|
|
1134
|
-
return {
|
|
1135
|
-
tag: 'OcfVestingScheduleRelativeTrigger',
|
|
1136
|
-
value: {
|
|
1137
|
-
period: period,
|
|
1138
|
-
relative_to_condition_id: t?.relative_to_condition_id
|
|
1139
|
-
}
|
|
1140
|
-
};
|
|
1141
|
-
}
|
|
1142
|
-
throw new Error('Unknown vesting trigger');
|
|
1143
|
-
}
|
|
1144
|
-
function damlVestingTriggerToNative(t) {
|
|
1145
|
-
// Emit schema-compliant trigger objects
|
|
1146
|
-
const tag = typeof t === 'string' ? t : t?.tag;
|
|
1147
|
-
if (tag === 'OcfVestingStartTrigger') {
|
|
1148
|
-
return { type: 'VESTING_START_DATE' };
|
|
1149
|
-
}
|
|
1150
|
-
if (tag === 'OcfVestingEventTrigger') {
|
|
1151
|
-
return { type: 'VESTING_EVENT' };
|
|
1152
|
-
}
|
|
1153
|
-
if (tag === 'OcfVestingScheduleAbsoluteTrigger') {
|
|
1154
|
-
const value = typeof t === 'string' ? undefined : t?.value;
|
|
1155
|
-
if (!value)
|
|
1156
|
-
throw new Error('Missing value for OcfVestingScheduleAbsoluteTrigger');
|
|
1157
|
-
return { type: 'VESTING_SCHEDULE_ABSOLUTE', date: damlTimeToDateString(value) };
|
|
1158
|
-
}
|
|
1159
|
-
if (tag === 'OcfVestingScheduleRelativeTrigger') {
|
|
1160
|
-
const value = typeof t === 'string' ? undefined : t?.value;
|
|
1161
|
-
if (!value)
|
|
1162
|
-
throw new Error('Missing value for OcfVestingScheduleRelativeTrigger');
|
|
1163
|
-
const p = damlVestingPeriodToNative(value.period);
|
|
1164
|
-
if (p.tag === 'MONTHS') {
|
|
1165
|
-
return {
|
|
1166
|
-
type: 'VESTING_SCHEDULE_RELATIVE',
|
|
1167
|
-
period: {
|
|
1168
|
-
type: 'MONTHS',
|
|
1169
|
-
length: p.length,
|
|
1170
|
-
occurrences: p.occurrences,
|
|
1171
|
-
day_of_month: p.day_of_month || 'VESTING_START_DAY_OR_LAST_DAY_OF_MONTH',
|
|
1172
|
-
...(p.cliff_installment !== undefined ? { cliff_installment: p.cliff_installment } : {})
|
|
1173
|
-
},
|
|
1174
|
-
relative_to_condition_id: value.relative_to_condition_id
|
|
1175
|
-
};
|
|
1176
|
-
}
|
|
1177
|
-
return {
|
|
1178
|
-
type: 'VESTING_SCHEDULE_RELATIVE',
|
|
1179
|
-
period: {
|
|
1180
|
-
type: 'DAYS',
|
|
1181
|
-
length: p.length,
|
|
1182
|
-
occurrences: p.occurrences,
|
|
1183
|
-
...(p.cliff_installment !== undefined ? { cliff_installment: p.cliff_installment } : {})
|
|
1184
|
-
},
|
|
1185
|
-
relative_to_condition_id: value.relative_to_condition_id
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
throw new Error('Unknown DAML vesting trigger');
|
|
1189
|
-
}
|
|
1190
|
-
function vestingConditionPortionToDaml(p) {
|
|
1191
|
-
return {
|
|
1192
|
-
numerator: typeof p.numerator === 'number' ? p.numerator.toString() : p.numerator,
|
|
1193
|
-
denominator: typeof p.denominator === 'number' ? p.denominator.toString() : p.denominator,
|
|
1194
|
-
remainder: p.remainder
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
function damlVestingConditionPortionToNative(p) {
|
|
1198
|
-
return {
|
|
1199
|
-
numerator: p.numerator,
|
|
1200
|
-
denominator: p.denominator,
|
|
1201
|
-
remainder: p.remainder
|
|
1202
|
-
};
|
|
1203
|
-
}
|
|
1204
|
-
function vestingConditionToDaml(c) {
|
|
1205
|
-
return {
|
|
1206
|
-
id: c.id,
|
|
1207
|
-
description: c.description || null,
|
|
1208
|
-
portion: c.portion ? { tag: 'Some', value: vestingConditionPortionToDaml(c.portion) } : null,
|
|
1209
|
-
quantity: c.quantity !== undefined ? (typeof c.quantity === 'number' ? c.quantity.toString() : c.quantity) : null,
|
|
1210
|
-
trigger: vestingTriggerToDaml(c.trigger),
|
|
1211
|
-
next_condition_ids: c.next_condition_ids
|
|
1212
|
-
};
|
|
1213
|
-
}
|
|
1214
|
-
function damlVestingConditionToNative(c) {
|
|
1215
|
-
const native = {
|
|
1216
|
-
id: c.id || '',
|
|
1217
|
-
...(c.description && { description: c.description }),
|
|
1218
|
-
...(c.quantity && { quantity: c.quantity }),
|
|
1219
|
-
trigger: damlVestingTriggerToNative(c.trigger),
|
|
1220
|
-
next_condition_ids: c.next_condition_ids || []
|
|
1221
|
-
};
|
|
1222
|
-
const portionUnknown = c.portion;
|
|
1223
|
-
if (portionUnknown) {
|
|
1224
|
-
// Handle Optional encoded as { tag: 'Some', value: {...} }
|
|
1225
|
-
if (typeof portionUnknown === 'object' &&
|
|
1226
|
-
'tag' in portionUnknown &&
|
|
1227
|
-
portionUnknown.tag === 'Some' &&
|
|
1228
|
-
'value' in portionUnknown) {
|
|
1229
|
-
const value = portionUnknown.value;
|
|
1230
|
-
native.portion = damlVestingConditionPortionToNative(value);
|
|
1231
|
-
}
|
|
1232
|
-
else if (typeof portionUnknown === 'object') {
|
|
1233
|
-
// Handle Optional normalized to direct value (no tag), as produced in JSON API command normalization
|
|
1234
|
-
native.portion = damlVestingConditionPortionToNative(portionUnknown);
|
|
1235
|
-
}
|
|
1236
|
-
}
|
|
1237
|
-
return native;
|
|
1238
|
-
}
|
|
1239
|
-
function vestingTermsDataToDaml(d) {
|
|
1240
|
-
if (!d.id)
|
|
1241
|
-
throw new Error('vestingTerms.id is required');
|
|
1242
|
-
return {
|
|
1243
|
-
id: d.id,
|
|
1244
|
-
name: d.name,
|
|
1245
|
-
description: d.description,
|
|
1246
|
-
allocation_type: allocationTypeToDaml(d.allocation_type),
|
|
1247
|
-
vesting_conditions: d.vesting_conditions.map(vestingConditionToDaml),
|
|
1248
|
-
comments: d.comments || []
|
|
1249
|
-
};
|
|
1250
|
-
}
|
|
1251
|
-
function damlVestingTermsDataToNative(d) {
|
|
1252
|
-
return {
|
|
1253
|
-
id: d.id,
|
|
1254
|
-
name: d.name || '',
|
|
1255
|
-
description: d.description || '',
|
|
1256
|
-
allocation_type: damlAllocationTypeToNative(d.allocation_type),
|
|
1257
|
-
vesting_conditions: (d.vesting_conditions || []).map(damlVestingConditionToNative),
|
|
1258
|
-
comments: (Array.isArray(d.comments)
|
|
1259
|
-
? d.comments
|
|
1260
|
-
: [])
|
|
1261
|
-
};
|
|
1262
|
-
}
|
|
1263
|
-
// ===== Stock Plan Conversions =====
|
|
1264
|
-
function cancellationBehaviorToDaml(b) {
|
|
1265
|
-
if (!b)
|
|
1266
|
-
return null;
|
|
1267
|
-
switch (b) {
|
|
1268
|
-
case 'RETIRE': return 'OcfPlanCancelRetire';
|
|
1269
|
-
case 'RETURN_TO_POOL': return 'OcfPlanCancelReturnToPool';
|
|
1270
|
-
case 'HOLD_AS_CAPITAL_STOCK': return 'OcfPlanCancelHoldAsCapitalStock';
|
|
1271
|
-
case 'DEFINED_PER_PLAN_SECURITY': return 'OcfPlanCancelDefinedPerPlanSecurity';
|
|
1272
|
-
default: throw new Error('Unknown cancellation behavior');
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
function damlCancellationBehaviorToNative(b) {
|
|
1276
|
-
switch (b) {
|
|
1277
|
-
case 'OcfPlanCancelRetire': return 'RETIRE';
|
|
1278
|
-
case 'OcfPlanCancelReturnToPool': return 'RETURN_TO_POOL';
|
|
1279
|
-
case 'OcfPlanCancelHoldAsCapitalStock': return 'HOLD_AS_CAPITAL_STOCK';
|
|
1280
|
-
case 'OcfPlanCancelDefinedPerPlanSecurity': return 'DEFINED_PER_PLAN_SECURITY';
|
|
1281
|
-
default: return undefined;
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
function stockPlanDataToDaml(d) {
|
|
1285
|
-
if (!d.id)
|
|
1286
|
-
throw new Error('stockPlan.id is required');
|
|
1287
|
-
return {
|
|
1288
|
-
id: d.id,
|
|
1289
|
-
plan_name: d.plan_name,
|
|
1290
|
-
board_approval_date: d.board_approval_date ? dateStringToDAMLTime(d.board_approval_date) : null,
|
|
1291
|
-
stockholder_approval_date: d.stockholder_approval_date ? dateStringToDAMLTime(d.stockholder_approval_date) : null,
|
|
1292
|
-
initial_shares_reserved: typeof d.initial_shares_reserved === 'number' ? d.initial_shares_reserved.toString() : d.initial_shares_reserved,
|
|
1293
|
-
default_cancellation_behavior: cancellationBehaviorToDaml(d.default_cancellation_behavior),
|
|
1294
|
-
stock_class_ids: d.stock_class_ids,
|
|
1295
|
-
comments: d.comments || []
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
function damlStockPlanDataToNative(d) {
|
|
1299
|
-
return {
|
|
1300
|
-
id: d.id,
|
|
1301
|
-
plan_name: d.plan_name || '',
|
|
1302
|
-
...(d.board_approval_date && { board_approval_date: damlTimeToDateString(d.board_approval_date) }),
|
|
1303
|
-
...(d.stockholder_approval_date && { stockholder_approval_date: damlTimeToDateString(d.stockholder_approval_date) }),
|
|
1304
|
-
initial_shares_reserved: d.initial_shares_reserved || '0',
|
|
1305
|
-
...(d.default_cancellation_behavior && { default_cancellation_behavior: damlCancellationBehaviorToNative(d.default_cancellation_behavior) }),
|
|
1306
|
-
stock_class_ids: Array.isArray(d.stock_class_ids) ? d.stock_class_ids : [],
|
|
1307
|
-
comments: (Array.isArray(d.comments)
|
|
1308
|
-
? d.comments
|
|
1309
|
-
: [])
|
|
1310
|
-
};
|
|
1311
|
-
}
|
|
1312
|
-
// ===== Equity Compensation Issuance Conversions =====
|
|
1313
|
-
function compensationTypeToDaml(t) {
|
|
1314
|
-
switch (t) {
|
|
1315
|
-
case 'OPTION_NSO': return 'OcfCompensationTypeOptionNSO';
|
|
1316
|
-
case 'OPTION_ISO': return 'OcfCompensationTypeOptionISO';
|
|
1317
|
-
case 'OPTION': return 'OcfCompensationTypeOption';
|
|
1318
|
-
case 'RSU': return 'OcfCompensationTypeRSU';
|
|
1319
|
-
case 'CSAR': return 'OcfCompensationTypeCSAR';
|
|
1320
|
-
case 'SSAR': return 'OcfCompensationTypeSSAR';
|
|
1321
|
-
default: throw new Error('Unknown compensation type');
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
function damlCompensationTypeToNative(t) {
|
|
1325
|
-
switch (t) {
|
|
1326
|
-
case 'OcfCompensationTypeOptionNSO': return 'OPTION_NSO';
|
|
1327
|
-
case 'OcfCompensationTypeOptionISO': return 'OPTION_ISO';
|
|
1328
|
-
case 'OcfCompensationTypeOption': return 'OPTION';
|
|
1329
|
-
case 'OcfCompensationTypeRSU': return 'RSU';
|
|
1330
|
-
case 'OcfCompensationTypeCSAR': return 'CSAR';
|
|
1331
|
-
case 'OcfCompensationTypeSSAR': return 'SSAR';
|
|
1332
|
-
default: throw new Error('Unknown DAML compensation type');
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
function terminationWindowToDaml(w) {
|
|
1336
|
-
const reasonMap = {
|
|
1337
|
-
VOLUNTARY_OTHER: 'OcfTermVoluntaryOther',
|
|
1338
|
-
VOLUNTARY_GOOD_CAUSE: 'OcfTermVoluntaryGoodCause',
|
|
1339
|
-
VOLUNTARY_RETIREMENT: 'OcfTermVoluntaryRetirement',
|
|
1340
|
-
INVOLUNTARY_OTHER: 'OcfTermInvoluntaryOther',
|
|
1341
|
-
INVOLUNTARY_DEATH: 'OcfTermInvoluntaryDeath',
|
|
1342
|
-
INVOLUNTARY_DISABILITY: 'OcfTermInvoluntaryDisability',
|
|
1343
|
-
INVOLUNTARY_WITH_CAUSE: 'OcfTermInvoluntaryWithCause'
|
|
1344
|
-
};
|
|
1345
|
-
const periodTypeMap = {
|
|
1346
|
-
DAYS: 'OcfPeriodDays',
|
|
1347
|
-
MONTHS: 'OcfPeriodMonths'
|
|
1348
|
-
};
|
|
1349
|
-
return {
|
|
1350
|
-
reason: reasonMap[w.reason],
|
|
1351
|
-
period: typeof w.period === 'number' ? w.period.toString() : String(w.period),
|
|
1352
|
-
period_type: periodTypeMap[w.period_type]
|
|
1353
|
-
};
|
|
1354
|
-
}
|
|
1355
|
-
function damlTerminationWindowToNative(w) {
|
|
1356
|
-
const reasonMap = {
|
|
1357
|
-
OcfTermVoluntaryOther: 'VOLUNTARY_OTHER',
|
|
1358
|
-
OcfTermVoluntaryGoodCause: 'VOLUNTARY_GOOD_CAUSE',
|
|
1359
|
-
OcfTermVoluntaryRetirement: 'VOLUNTARY_RETIREMENT',
|
|
1360
|
-
OcfTermInvoluntaryOther: 'INVOLUNTARY_OTHER',
|
|
1361
|
-
OcfTermInvoluntaryDeath: 'INVOLUNTARY_DEATH',
|
|
1362
|
-
OcfTermInvoluntaryDisability: 'INVOLUNTARY_DISABILITY',
|
|
1363
|
-
OcfTermInvoluntaryWithCause: 'INVOLUNTARY_WITH_CAUSE'
|
|
1364
|
-
};
|
|
1365
|
-
const periodTypeMap = {
|
|
1366
|
-
OcfPeriodDays: 'DAYS',
|
|
1367
|
-
OcfPeriodMonths: 'MONTHS'
|
|
1368
|
-
};
|
|
1369
|
-
return {
|
|
1370
|
-
reason: reasonMap[w.reason],
|
|
1371
|
-
period: Number(w.period),
|
|
1372
|
-
period_type: periodTypeMap[w.period_type]
|
|
1373
|
-
};
|
|
1374
|
-
}
|
|
1375
|
-
function equityCompIssuanceDataToDaml(d) {
|
|
1376
|
-
return {
|
|
1377
|
-
compensation_type: compensationTypeToDaml(d.compensation_type),
|
|
1378
|
-
quantity: typeof d.quantity === 'number' ? d.quantity.toString() : d.quantity,
|
|
1379
|
-
exercise_price: d.exercise_price ? monetaryToDaml(d.exercise_price) : null,
|
|
1380
|
-
base_price: d.base_price ? monetaryToDaml(d.base_price) : null,
|
|
1381
|
-
early_exercisable: d.early_exercisable === undefined ? null : d.early_exercisable,
|
|
1382
|
-
vestings: (d.vestings || []).map(v => ({ date: dateStringToDAMLTime(v.date), amount: typeof v.amount === 'number' ? v.amount.toString() : v.amount })),
|
|
1383
|
-
expiration_date: d.expiration_date ? dateStringToDAMLTime(d.expiration_date) : null,
|
|
1384
|
-
termination_exercise_windows: d.termination_exercise_windows.map(terminationWindowToDaml),
|
|
1385
|
-
comments: d.comments || []
|
|
1386
|
-
};
|
|
1387
|
-
}
|
|
1388
|
-
function damlEquityCompIssuanceDataToNative(d) {
|
|
1389
|
-
return {
|
|
1390
|
-
compensation_type: damlCompensationTypeToNative(d.compensation_type),
|
|
1391
|
-
quantity: d.quantity,
|
|
1392
|
-
...(d.exercise_price && { exercise_price: damlMonetaryToNative(d.exercise_price) }),
|
|
1393
|
-
...(d.base_price && { base_price: damlMonetaryToNative(d.base_price) }),
|
|
1394
|
-
...(d.early_exercisable !== null && d.early_exercisable !== undefined && { early_exercisable: d.early_exercisable }),
|
|
1395
|
-
vestings: d.vestings?.map((v) => ({ date: damlTimeToDateString(v.date), amount: v.amount })) || [],
|
|
1396
|
-
...(d.expiration_date && { expiration_date: damlTimeToDateString(d.expiration_date) }),
|
|
1397
|
-
termination_exercise_windows: d.termination_exercise_windows.map(damlTerminationWindowToNative),
|
|
1398
|
-
security_law_exemptions: [],
|
|
1399
|
-
comments: (d.comments !== undefined && Array.isArray(d.comments))
|
|
1400
|
-
? d.comments
|
|
1401
|
-
: []
|
|
1402
|
-
};
|
|
1403
|
-
}
|
|
1404
95
|
//# sourceMappingURL=typeConversions.js.map
|