@fulmenhq/tsfulmen 0.3.1 → 0.3.3

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.
@@ -7528,10 +7528,11 @@ function deepFreeze(obj) {
7528
7528
  });
7529
7529
  return obj;
7530
7530
  }
7531
- async function registerEmbeddedIdentity(data) {
7531
+ async function registerEmbeddedIdentity(data, options) {
7532
7532
  if (isRegistered) {
7533
7533
  throw AppIdentityError.alreadyRegistered();
7534
7534
  }
7535
+ const skipValidation = options?.skipValidation ?? false;
7535
7536
  let identity;
7536
7537
  if (typeof data === "string") {
7537
7538
  let parsed;
@@ -7542,15 +7543,19 @@ async function registerEmbeddedIdentity(data) {
7542
7543
  error instanceof Error ? error : new Error(String(error))
7543
7544
  );
7544
7545
  }
7545
- const result = await validateDataBySchemaId(parsed, APP_IDENTITY_SCHEMA_ID);
7546
- if (!result.valid) {
7547
- throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
7546
+ if (!skipValidation) {
7547
+ const result = await validateDataBySchemaId(parsed, APP_IDENTITY_SCHEMA_ID);
7548
+ if (!result.valid) {
7549
+ throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
7550
+ }
7548
7551
  }
7549
7552
  identity = parsed;
7550
7553
  } else {
7551
- const result = await validateDataBySchemaId(data, APP_IDENTITY_SCHEMA_ID);
7552
- if (!result.valid) {
7553
- throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
7554
+ if (!skipValidation) {
7555
+ const result = await validateDataBySchemaId(data, APP_IDENTITY_SCHEMA_ID);
7556
+ if (!result.valid) {
7557
+ throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
7558
+ }
7554
7559
  }
7555
7560
  identity = data;
7556
7561
  }