@punks/backend-entity-manager 0.0.323 → 0.0.325

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/dist/cjs/index.js CHANGED
@@ -23546,6 +23546,7 @@ class PipelineStepOperationOptionsBuilder {
23546
23546
  }
23547
23547
  build() {
23548
23548
  return {
23549
+ key: this.operation.key,
23549
23550
  name: this.operation.name,
23550
23551
  operation: this.operation,
23551
23552
  rollbackOperations: this.rollbackOperations,
@@ -34321,32 +34322,32 @@ const buildCompletedStepsSequence = (step) => {
34321
34322
  };
34322
34323
  class PipelineUtils {
34323
34324
  constructor() {
34324
- this.getStepByKey = (step, key) => {
34325
- const sequence = buildCompletedStepsSequence(step);
34325
+ this.getStepByKey = (state, key) => {
34326
+ const sequence = buildCompletedStepsSequence(state);
34326
34327
  const matchingStep = sequence.find((x) => x.reference.key === key);
34327
34328
  if (!matchingStep) {
34328
34329
  throw new Error(`Step key ${key} not found`);
34329
34330
  }
34330
34331
  return matchingStep;
34331
34332
  };
34332
- this.getStepInputByKey = (step, key) => {
34333
- return this.getStepByKey(step, key).stepInput;
34333
+ this.getStepInputByKey = (state, key) => {
34334
+ return this.getStepByKey(state, key).stepInput;
34334
34335
  };
34335
- this.getStepOutputByKey = (step, key) => {
34336
- return this.getStepByKey(step, key).stepOutput;
34336
+ this.getStepOutputByKey = (state, key) => {
34337
+ return this.getStepByKey(state, key).stepOutput;
34337
34338
  };
34338
- this.getStep = (step, index) => {
34339
- const sequence = buildCompletedStepsSequence(step);
34339
+ this.getStep = (state, index) => {
34340
+ const sequence = buildCompletedStepsSequence(state);
34340
34341
  if (index >= sequence.length) {
34341
34342
  throw new Error(`Step index ${index} is out of range`);
34342
34343
  }
34343
34344
  return sequence[index];
34344
34345
  };
34345
- this.getStepInput = (step, index) => {
34346
- return this.getStep(step, index).stepInput;
34346
+ this.getStepInput = (state, index) => {
34347
+ return this.getStep(state, index).stepInput;
34347
34348
  };
34348
- this.getStepOutput = (step, index) => {
34349
- return this.getStep(step, index).stepOutput;
34349
+ this.getStepOutput = (state, index) => {
34350
+ return this.getStep(state, index).stepOutput;
34350
34351
  };
34351
34352
  }
34352
34353
  }
@@ -43669,6 +43670,53 @@ exports.AwsSecretsModule = AwsSecretsModule_1 = __decorate([
43669
43670
  })
43670
43671
  ], exports.AwsSecretsModule);
43671
43672
 
43673
+ exports.InMemorySecretsProvider = class InMemorySecretsProvider {
43674
+ constructor() {
43675
+ this.secrets = new Map();
43676
+ }
43677
+ async getSecrets(pageName) {
43678
+ return Object.values(this.secrets.get(pageName).secrets).map((secret) => secret.value);
43679
+ }
43680
+ async setSecret(pageName, secret) {
43681
+ this.secrets.get(pageName).secrets[secret.key] = {
43682
+ definition: {
43683
+ key: secret.key,
43684
+ type: secret.type,
43685
+ hidden: secret.hidden,
43686
+ defaultValue: secret.value,
43687
+ },
43688
+ value: secret,
43689
+ };
43690
+ }
43691
+ async defineSecret(pageName, definition) {
43692
+ this.secrets.get(pageName).secrets[definition.key] = {
43693
+ definition,
43694
+ value: {
43695
+ key: definition.key,
43696
+ value: definition.defaultValue,
43697
+ type: definition.type,
43698
+ hidden: definition.hidden,
43699
+ timestamp: Date.now(),
43700
+ },
43701
+ };
43702
+ }
43703
+ async pageInitialize(pageName, metadata) {
43704
+ this.secrets.set(pageName, { metadata, secrets: {} });
43705
+ }
43706
+ async pageEnsure(pageName, metadata) {
43707
+ if (this.secrets.has(pageName)) {
43708
+ return;
43709
+ }
43710
+ this.secrets.set(pageName, { metadata, secrets: {} });
43711
+ }
43712
+ async pageExists(pageName) {
43713
+ return this.secrets.has(pageName);
43714
+ }
43715
+ };
43716
+ exports.InMemorySecretsProvider = __decorate([
43717
+ WpSecretsProvider("inMemorySecretsManager")
43718
+ ], exports.InMemorySecretsProvider);
43719
+
43672
43720
  exports.AUTHENTICATION_EVENTS_NAMESPACE = AUTHENTICATION_EVENTS_NAMESPACE;
43673
43721
  exports.ApiKeyAccess = ApiKeyAccess;
43674
43722
  exports.AppExceptionsFilterBase = AppExceptionsFilterBase;