@settlemint/dalp-cli 2.1.7-main.25385496889 → 2.1.7-main.25386311161

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.
Files changed (2) hide show
  1. package/dist/dalp.js +105 -65
  2. package/package.json +1 -1
package/dist/dalp.js CHANGED
@@ -56047,9 +56047,9 @@ var DAPI_ROUTE_ERROR_ENTRIES = [
56047
56047
  id: "DALP-0462",
56048
56048
  category: "domain",
56049
56049
  status: 422,
56050
- message: "Compliance template includes controls only available for legacy asset types.",
56051
- why: "The selected compliance controls are only supported by legacy asset types, but the template targets the current module set.",
56052
- fix: "Enable Legacy template for this policy, or remove the legacy-only controls and save again.",
56050
+ message: "Compliance template modules and controls must match the selected module set.",
56051
+ why: "The template contains configured modules or required controls from a different compliance module generation.",
56052
+ fix: "Remove the incompatible controls or create a template with the matching legacy/current module set.",
56053
56053
  retryable: false,
56054
56054
  expectedClientError: true,
56055
56055
  data: exports_external.object({
@@ -62268,6 +62268,10 @@ var AssetFactoryTypeIdSetSchema = exports_external.set(AssetFactoryTypeIdSchema)
62268
62268
  description: "Set of unique asset factory typeIds",
62269
62269
  examples: [["bond", "equity"]]
62270
62270
  });
62271
+ var ASSET_TYPES_WITH_CATEGORIES = new Set(["equity", "fund", "real-estate"]);
62272
+ function hasCategoriesForType(type2) {
62273
+ return type2 !== undefined && ASSET_TYPES_WITH_CATEGORIES.has(type2);
62274
+ }
62271
62275
  var DEPLOYABLE_TYPE_SET = new Set(assetTypes);
62272
62276
  var claimValue = exports_external.object({
62273
62277
  key: exports_external.string().meta({
@@ -62349,34 +62353,53 @@ var ClaimTopicSchema = exports_external.enum(claimTopics).meta({
62349
62353
  var claimTopicSchema = () => ClaimTopicSchema;
62350
62354
  var topicNameToIdCache = new Map;
62351
62355
  var idToTopicNameCache = new Map;
62356
+ var complianceModuleSetVersions = [1, 2];
62352
62357
  var complianceModuleRegistry = [
62353
- { id: "address-block-list", category: "identity" },
62354
- { id: "address-block-list-v2", category: "identity" },
62355
- { id: "capital-raise-limit", category: "limits" },
62356
- { id: "capped", category: "limits" },
62357
- { id: "capped-v2", category: "limits" },
62358
- { id: "collateral", category: "collateral" },
62359
- { id: "collateral-v2", category: "collateral" },
62360
- { id: "country-allow-list", category: "geographic" },
62361
- { id: "country-allow-list-v2", category: "geographic" },
62362
- { id: "country-block-list", category: "geographic" },
62363
- { id: "country-block-list-v2", category: "geographic" },
62364
- { id: "identity-allow-list", category: "identity" },
62365
- { id: "identity-allow-list-v2", category: "identity" },
62366
- { id: "identity-block-list", category: "identity" },
62367
- { id: "identity-block-list-v2", category: "identity" },
62368
- { id: "identity-verification", category: "identity" },
62369
- { id: "identity-verification-v2", category: "identity" },
62370
- { id: "investor-count", category: "limits" },
62371
- { id: "investor-count-v2", category: "limits" },
62372
- { id: "issuance-volume-limit", category: "limits" },
62373
- { id: "time-lock", category: "transfer" },
62374
- { id: "time-lock-v2", category: "transfer" },
62375
- { id: "token-supply-limit", category: "limits" },
62376
- { id: "transfer-approval", category: "transfer" },
62377
- { id: "transfer-approval-v2", category: "transfer" }
62358
+ { id: "address-block-list", category: "identity", moduleSetVersion: 1 },
62359
+ { id: "address-block-list-v2", category: "identity", moduleSetVersion: 2 },
62360
+ { id: "capital-raise-limit", category: "limits", moduleSetVersion: 2 },
62361
+ { id: "capped", category: "limits", moduleSetVersion: 1 },
62362
+ { id: "capped-v2", category: "limits", moduleSetVersion: 2 },
62363
+ { id: "collateral", category: "collateral", moduleSetVersion: 1 },
62364
+ { id: "collateral-v2", category: "collateral", moduleSetVersion: 2 },
62365
+ { id: "country-allow-list", category: "geographic", moduleSetVersion: 1 },
62366
+ { id: "country-allow-list-v2", category: "geographic", moduleSetVersion: 2 },
62367
+ { id: "country-block-list", category: "geographic", moduleSetVersion: 1 },
62368
+ { id: "country-block-list-v2", category: "geographic", moduleSetVersion: 2 },
62369
+ { id: "identity-allow-list", category: "identity", moduleSetVersion: 1 },
62370
+ { id: "identity-allow-list-v2", category: "identity", moduleSetVersion: 2 },
62371
+ { id: "identity-block-list", category: "identity", moduleSetVersion: 1 },
62372
+ { id: "identity-block-list-v2", category: "identity", moduleSetVersion: 2 },
62373
+ { id: "identity-verification", category: "identity", moduleSetVersion: 1 },
62374
+ { id: "identity-verification-v2", category: "identity", moduleSetVersion: 2 },
62375
+ { id: "investor-count", category: "limits", moduleSetVersion: 1 },
62376
+ { id: "investor-count-v2", category: "limits", moduleSetVersion: 2 },
62377
+ { id: "issuance-volume-limit", category: "limits", moduleSetVersion: 1 },
62378
+ { id: "time-lock", category: "transfer", moduleSetVersion: 1 },
62379
+ { id: "time-lock-v2", category: "transfer", moduleSetVersion: 2 },
62380
+ { id: "token-supply-limit", category: "limits", moduleSetVersion: 1 },
62381
+ { id: "transfer-approval", category: "transfer", moduleSetVersion: 1 },
62382
+ { id: "transfer-approval-v2", category: "transfer", moduleSetVersion: 2 }
62378
62383
  ];
62379
62384
  var enrichmentById = new Map(complianceModuleRegistry.map((m) => [m.id, m]));
62385
+ function getComplianceModuleEnrichment(typeId) {
62386
+ return enrichmentById.get(typeId);
62387
+ }
62388
+ function getComplianceModuleSetVersion(typeId) {
62389
+ return getComplianceModuleEnrichment(typeId)?.moduleSetVersion;
62390
+ }
62391
+ function isSupportedComplianceModuleSetVersion(moduleSetVersion) {
62392
+ return complianceModuleSetVersions.includes(moduleSetVersion);
62393
+ }
62394
+ function isComplianceModuleCompatibleWithVersion(typeId, moduleSetVersion) {
62395
+ if (moduleSetVersion === undefined) {
62396
+ return true;
62397
+ }
62398
+ if (!isSupportedComplianceModuleSetVersion(moduleSetVersion)) {
62399
+ return false;
62400
+ }
62401
+ return getComplianceModuleSetVersion(typeId) === moduleSetVersion;
62402
+ }
62380
62403
  var expressionTypes = [0, 1, 2, 3];
62381
62404
  var expressionTypeKeys = ["TOPIC", "AND", "OR", "NOT"];
62382
62405
  var ExpressionTypeKeySchema = exports_external.literal(expressionTypeKeys).meta({ description: "Expression type key identifier", examples: ["TOPIC", "AND", "OR", "NOT"] });
@@ -63377,6 +63400,7 @@ var global = v1Contract.route({
63377
63400
  tags: [V1_TAG.search]
63378
63401
  }).input(GlobalSearchInputSchema).output(GlobalSearchOutputSchema);
63379
63402
  var CURRENT_MODULE_SET_VERSION = 2;
63403
+ var ComplianceModuleSetVersionSchema = exports_external.union([exports_external.literal(1), exports_external.literal(CURRENT_MODULE_SET_VERSION)]);
63380
63404
  var V1_ONLY_COMPLIANCE_TYPE_IDS = [
63381
63405
  "issuance-volume-limit",
63382
63406
  "token-supply-limit"
@@ -63565,28 +63589,6 @@ var TemplateModuleConfigSchema = exports_external.discriminatedUnion("typeId", [
63565
63589
  description: "Module configuration within a compliance template",
63566
63590
  examples: [{ parameters: { typeId: "country-allow-list", values: [840, 826] } }]
63567
63591
  });
63568
- function isLegacyModuleSetVersion(moduleSetVersion) {
63569
- return moduleSetVersion !== undefined && moduleSetVersion < CURRENT_MODULE_SET_VERSION;
63570
- }
63571
- function isV1OnlyComplianceTypeId(typeId) {
63572
- return V1_ONLY_COMPLIANCE_TYPE_ID_SET.has(typeId);
63573
- }
63574
- function uniqueV1OnlyTypeIds(typeIds) {
63575
- return [...new Set(typeIds.filter((typeId) => isV1OnlyComplianceTypeId(typeId)))];
63576
- }
63577
- function getV1OnlyTypeIdsByFieldForNonLegacyTemplate({
63578
- moduleSetVersion,
63579
- modules = [],
63580
- requiredControls = []
63581
- }) {
63582
- if (moduleSetVersion === undefined || isLegacyModuleSetVersion(moduleSetVersion)) {
63583
- return { modules: [], requiredControls: [] };
63584
- }
63585
- return {
63586
- modules: uniqueV1OnlyTypeIds(modules.map((module) => module.typeId)),
63587
- requiredControls: uniqueV1OnlyTypeIds(requiredControls)
63588
- };
63589
- }
63590
63592
  var ComplianceTemplateSchema = exports_external.object({
63591
63593
  id: exports_external.string().min(1),
63592
63594
  name: exports_external.string().min(1).max(255),
@@ -63612,7 +63614,7 @@ var ComplianceTemplateCreateInputSchema = exports_external.object({
63612
63614
  name: exports_external.string().trim().min(1).max(255),
63613
63615
  description: exports_external.string().optional(),
63614
63616
  jurisdictions: JurisdictionsArraySchema.default([]),
63615
- moduleSetVersion: exports_external.number().int().min(1).optional(),
63617
+ moduleSetVersion: ComplianceModuleSetVersionSchema.optional(),
63616
63618
  legacy: exports_external.boolean().optional().describe("Deprecated. Use `moduleSetVersion` instead."),
63617
63619
  modules: exports_external.array(TemplateModuleConfigSchema).default([]),
63618
63620
  requiredControls: exports_external.array(complianceTypeId()).default([])
@@ -63625,18 +63627,25 @@ var ComplianceTemplateCreateInputSchema = exports_external.object({
63625
63627
  }
63626
63628
  return { ...rest, moduleSetVersion: CURRENT_MODULE_SET_VERSION };
63627
63629
  }).superRefine((value22, ctx) => {
63628
- const invalidTypeIdsByField = getV1OnlyTypeIdsByFieldForNonLegacyTemplate(value22);
63629
- for (const [path4, invalidTypeIds] of [
63630
- ["modules", invalidTypeIdsByField.modules],
63631
- ["requiredControls", invalidTypeIdsByField.requiredControls]
63632
- ]) {
63633
- if (invalidTypeIds.length > 0) {
63634
- ctx.addIssue({
63635
- code: "custom",
63636
- path: [path4],
63637
- message: `Legacy-only compliance controls require a legacy template: ${invalidTypeIds.join(", ")}`
63638
- });
63630
+ for (const [index2, module] of value22.modules.entries()) {
63631
+ if (isComplianceModuleCompatibleWithVersion(module.typeId, value22.moduleSetVersion)) {
63632
+ continue;
63633
+ }
63634
+ ctx.addIssue({
63635
+ code: "custom",
63636
+ message: "Module typeId is not compatible with the selected module set version",
63637
+ path: ["modules", index2, "typeId"]
63638
+ });
63639
+ }
63640
+ for (const [index2, typeId] of value22.requiredControls.entries()) {
63641
+ if (isComplianceModuleCompatibleWithVersion(typeId, value22.moduleSetVersion)) {
63642
+ continue;
63639
63643
  }
63644
+ ctx.addIssue({
63645
+ code: "custom",
63646
+ message: "Required control is not compatible with the selected module set version",
63647
+ path: ["requiredControls", index2]
63648
+ });
63640
63649
  }
63641
63650
  }).meta({
63642
63651
  description: "Input schema for creating a compliance template"
@@ -66244,7 +66253,37 @@ var ClaimDataSchema = exports_external.discriminatedUnion("topic", [
66244
66253
  topic: exports_external.literal("assetClassification"),
66245
66254
  data: exports_external.object({
66246
66255
  type: assetType().meta({ description: "Asset type", examples: ["equity", "bond", "fund"] }),
66247
- category: exports_external.union([equityCategory(), fundCategory(), realEstatePropertyUse()]).meta({ description: "Asset category", examples: ["common_stock", "open_end", "residential"] })
66256
+ category: exports_external.union([equityCategory(), fundCategory(), realEstatePropertyUse()]).optional().meta({
66257
+ description: "Asset category. Required for equity, fund, and real-estate; omitted for other types.",
66258
+ examples: ["COMMON_EQUITY", "OPEN_END", "RESIDENTIAL"]
66259
+ })
66260
+ }).superRefine((value22, ctx) => {
66261
+ if (!hasCategoriesForType(value22.type)) {
66262
+ return;
66263
+ }
66264
+ if (value22.category === undefined) {
66265
+ ctx.addIssue({
66266
+ code: "custom",
66267
+ path: ["category"],
66268
+ message: `Asset category is required for instrument type "${value22.type}".`
66269
+ });
66270
+ return;
66271
+ }
66272
+ let expected;
66273
+ if (value22.type === "equity") {
66274
+ expected = equityCategory();
66275
+ } else if (value22.type === "fund") {
66276
+ expected = fundCategory();
66277
+ } else {
66278
+ expected = realEstatePropertyUse();
66279
+ }
66280
+ if (!expected.safeParse(value22.category).success) {
66281
+ ctx.addIssue({
66282
+ code: "custom",
66283
+ path: ["category"],
66284
+ message: `Category "${value22.category}" is not a valid ${value22.type} category.`
66285
+ });
66286
+ }
66248
66287
  })
66249
66288
  }),
66250
66289
  exports_external.object({
@@ -77954,7 +77993,7 @@ function normalizeDalpBaseUrl(url3) {
77954
77993
  }
77955
77994
  var package_default = {
77956
77995
  name: "@settlemint/dalp-sdk",
77957
- version: "2.1.7-main.25385496889",
77996
+ version: "2.1.7-main.25386311161",
77958
77997
  private: false,
77959
77998
  description: "Fully typed SDK for the DALP tokenization platform API",
77960
77999
  homepage: "https://settlemint.com",
@@ -78505,7 +78544,7 @@ function trimConfigValue(name, value3) {
78505
78544
  // package.json
78506
78545
  var package_default2 = {
78507
78546
  name: "@settlemint/dalp-cli",
78508
- version: "2.1.7-main.25385496889",
78547
+ version: "2.1.7-main.25386311161",
78509
78548
  private: false,
78510
78549
  description: "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
78511
78550
  homepage: "https://settlemint.com",
@@ -78801,6 +78840,7 @@ var AssetFactoryTypeIdSetSchema2 = exports_external.set(AssetFactoryTypeIdSchema
78801
78840
  description: "Set of unique asset factory typeIds",
78802
78841
  examples: [["bond", "equity"]]
78803
78842
  });
78843
+ var ASSET_TYPES_WITH_CATEGORIES2 = new Set(["equity", "fund", "real-estate"]);
78804
78844
  var DEPLOYABLE_TYPE_SET2 = new Set(assetTypes2);
78805
78845
 
78806
78846
  // src/commands/asset-type-templates.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@settlemint/dalp-cli",
3
- "version": "2.1.7-main.25385496889",
3
+ "version": "2.1.7-main.25386311161",
4
4
  "private": false,
5
5
  "description": "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
6
6
  "homepage": "https://settlemint.com",