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

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 +69 -64
  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({
@@ -62349,34 +62349,53 @@ var ClaimTopicSchema = exports_external.enum(claimTopics).meta({
62349
62349
  var claimTopicSchema = () => ClaimTopicSchema;
62350
62350
  var topicNameToIdCache = new Map;
62351
62351
  var idToTopicNameCache = new Map;
62352
+ var complianceModuleSetVersions = [1, 2];
62352
62353
  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" }
62354
+ { id: "address-block-list", category: "identity", moduleSetVersion: 1 },
62355
+ { id: "address-block-list-v2", category: "identity", moduleSetVersion: 2 },
62356
+ { id: "capital-raise-limit", category: "limits", moduleSetVersion: 2 },
62357
+ { id: "capped", category: "limits", moduleSetVersion: 1 },
62358
+ { id: "capped-v2", category: "limits", moduleSetVersion: 2 },
62359
+ { id: "collateral", category: "collateral", moduleSetVersion: 1 },
62360
+ { id: "collateral-v2", category: "collateral", moduleSetVersion: 2 },
62361
+ { id: "country-allow-list", category: "geographic", moduleSetVersion: 1 },
62362
+ { id: "country-allow-list-v2", category: "geographic", moduleSetVersion: 2 },
62363
+ { id: "country-block-list", category: "geographic", moduleSetVersion: 1 },
62364
+ { id: "country-block-list-v2", category: "geographic", moduleSetVersion: 2 },
62365
+ { id: "identity-allow-list", category: "identity", moduleSetVersion: 1 },
62366
+ { id: "identity-allow-list-v2", category: "identity", moduleSetVersion: 2 },
62367
+ { id: "identity-block-list", category: "identity", moduleSetVersion: 1 },
62368
+ { id: "identity-block-list-v2", category: "identity", moduleSetVersion: 2 },
62369
+ { id: "identity-verification", category: "identity", moduleSetVersion: 1 },
62370
+ { id: "identity-verification-v2", category: "identity", moduleSetVersion: 2 },
62371
+ { id: "investor-count", category: "limits", moduleSetVersion: 1 },
62372
+ { id: "investor-count-v2", category: "limits", moduleSetVersion: 2 },
62373
+ { id: "issuance-volume-limit", category: "limits", moduleSetVersion: 1 },
62374
+ { id: "time-lock", category: "transfer", moduleSetVersion: 1 },
62375
+ { id: "time-lock-v2", category: "transfer", moduleSetVersion: 2 },
62376
+ { id: "token-supply-limit", category: "limits", moduleSetVersion: 1 },
62377
+ { id: "transfer-approval", category: "transfer", moduleSetVersion: 1 },
62378
+ { id: "transfer-approval-v2", category: "transfer", moduleSetVersion: 2 }
62378
62379
  ];
62379
62380
  var enrichmentById = new Map(complianceModuleRegistry.map((m) => [m.id, m]));
62381
+ function getComplianceModuleEnrichment(typeId) {
62382
+ return enrichmentById.get(typeId);
62383
+ }
62384
+ function getComplianceModuleSetVersion(typeId) {
62385
+ return getComplianceModuleEnrichment(typeId)?.moduleSetVersion;
62386
+ }
62387
+ function isSupportedComplianceModuleSetVersion(moduleSetVersion) {
62388
+ return complianceModuleSetVersions.includes(moduleSetVersion);
62389
+ }
62390
+ function isComplianceModuleCompatibleWithVersion(typeId, moduleSetVersion) {
62391
+ if (moduleSetVersion === undefined) {
62392
+ return true;
62393
+ }
62394
+ if (!isSupportedComplianceModuleSetVersion(moduleSetVersion)) {
62395
+ return false;
62396
+ }
62397
+ return getComplianceModuleSetVersion(typeId) === moduleSetVersion;
62398
+ }
62380
62399
  var expressionTypes = [0, 1, 2, 3];
62381
62400
  var expressionTypeKeys = ["TOPIC", "AND", "OR", "NOT"];
62382
62401
  var ExpressionTypeKeySchema = exports_external.literal(expressionTypeKeys).meta({ description: "Expression type key identifier", examples: ["TOPIC", "AND", "OR", "NOT"] });
@@ -63377,6 +63396,7 @@ var global = v1Contract.route({
63377
63396
  tags: [V1_TAG.search]
63378
63397
  }).input(GlobalSearchInputSchema).output(GlobalSearchOutputSchema);
63379
63398
  var CURRENT_MODULE_SET_VERSION = 2;
63399
+ var ComplianceModuleSetVersionSchema = exports_external.union([exports_external.literal(1), exports_external.literal(CURRENT_MODULE_SET_VERSION)]);
63380
63400
  var V1_ONLY_COMPLIANCE_TYPE_IDS = [
63381
63401
  "issuance-volume-limit",
63382
63402
  "token-supply-limit"
@@ -63565,28 +63585,6 @@ var TemplateModuleConfigSchema = exports_external.discriminatedUnion("typeId", [
63565
63585
  description: "Module configuration within a compliance template",
63566
63586
  examples: [{ parameters: { typeId: "country-allow-list", values: [840, 826] } }]
63567
63587
  });
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
63588
  var ComplianceTemplateSchema = exports_external.object({
63591
63589
  id: exports_external.string().min(1),
63592
63590
  name: exports_external.string().min(1).max(255),
@@ -63612,7 +63610,7 @@ var ComplianceTemplateCreateInputSchema = exports_external.object({
63612
63610
  name: exports_external.string().trim().min(1).max(255),
63613
63611
  description: exports_external.string().optional(),
63614
63612
  jurisdictions: JurisdictionsArraySchema.default([]),
63615
- moduleSetVersion: exports_external.number().int().min(1).optional(),
63613
+ moduleSetVersion: ComplianceModuleSetVersionSchema.optional(),
63616
63614
  legacy: exports_external.boolean().optional().describe("Deprecated. Use `moduleSetVersion` instead."),
63617
63615
  modules: exports_external.array(TemplateModuleConfigSchema).default([]),
63618
63616
  requiredControls: exports_external.array(complianceTypeId()).default([])
@@ -63625,18 +63623,25 @@ var ComplianceTemplateCreateInputSchema = exports_external.object({
63625
63623
  }
63626
63624
  return { ...rest, moduleSetVersion: CURRENT_MODULE_SET_VERSION };
63627
63625
  }).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
- });
63626
+ for (const [index2, module] of value22.modules.entries()) {
63627
+ if (isComplianceModuleCompatibleWithVersion(module.typeId, value22.moduleSetVersion)) {
63628
+ continue;
63629
+ }
63630
+ ctx.addIssue({
63631
+ code: "custom",
63632
+ message: "Module typeId is not compatible with the selected module set version",
63633
+ path: ["modules", index2, "typeId"]
63634
+ });
63635
+ }
63636
+ for (const [index2, typeId] of value22.requiredControls.entries()) {
63637
+ if (isComplianceModuleCompatibleWithVersion(typeId, value22.moduleSetVersion)) {
63638
+ continue;
63639
63639
  }
63640
+ ctx.addIssue({
63641
+ code: "custom",
63642
+ message: "Required control is not compatible with the selected module set version",
63643
+ path: ["requiredControls", index2]
63644
+ });
63640
63645
  }
63641
63646
  }).meta({
63642
63647
  description: "Input schema for creating a compliance template"
@@ -77954,7 +77959,7 @@ function normalizeDalpBaseUrl(url3) {
77954
77959
  }
77955
77960
  var package_default = {
77956
77961
  name: "@settlemint/dalp-sdk",
77957
- version: "2.1.7-main.25385496889",
77962
+ version: "2.1.7-main.25386260189",
77958
77963
  private: false,
77959
77964
  description: "Fully typed SDK for the DALP tokenization platform API",
77960
77965
  homepage: "https://settlemint.com",
@@ -78505,7 +78510,7 @@ function trimConfigValue(name, value3) {
78505
78510
  // package.json
78506
78511
  var package_default2 = {
78507
78512
  name: "@settlemint/dalp-cli",
78508
- version: "2.1.7-main.25385496889",
78513
+ version: "2.1.7-main.25386260189",
78509
78514
  private: false,
78510
78515
  description: "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
78511
78516
  homepage: "https://settlemint.com",
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.25386260189",
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",