@fulmenhq/tsfulmen 0.3.2 → 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.
@@ -6752,10 +6752,11 @@ function deepFreeze(obj) {
6752
6752
  });
6753
6753
  return obj;
6754
6754
  }
6755
- async function registerEmbeddedIdentity(data) {
6755
+ async function registerEmbeddedIdentity(data, options) {
6756
6756
  if (isRegistered) {
6757
6757
  throw AppIdentityError.alreadyRegistered();
6758
6758
  }
6759
+ const skipValidation = options?.skipValidation ?? false;
6759
6760
  let identity;
6760
6761
  if (typeof data === "string") {
6761
6762
  let parsed;
@@ -6766,15 +6767,19 @@ async function registerEmbeddedIdentity(data) {
6766
6767
  error instanceof Error ? error : new Error(String(error))
6767
6768
  );
6768
6769
  }
6769
- const result = await validateDataBySchemaId(parsed, APP_IDENTITY_SCHEMA_ID);
6770
- if (!result.valid) {
6771
- throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
6770
+ if (!skipValidation) {
6771
+ const result = await validateDataBySchemaId(parsed, APP_IDENTITY_SCHEMA_ID);
6772
+ if (!result.valid) {
6773
+ throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
6774
+ }
6772
6775
  }
6773
6776
  identity = parsed;
6774
6777
  } else {
6775
- const result = await validateDataBySchemaId(data, APP_IDENTITY_SCHEMA_ID);
6776
- if (!result.valid) {
6777
- throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
6778
+ if (!skipValidation) {
6779
+ const result = await validateDataBySchemaId(data, APP_IDENTITY_SCHEMA_ID);
6780
+ if (!result.valid) {
6781
+ throw AppIdentityError.embeddedValidationFailed(result.diagnostics);
6782
+ }
6778
6783
  }
6779
6784
  identity = data;
6780
6785
  }