@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 +60 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/pipelines/template/utils.d.ts +6 -6
- package/dist/cjs/types/testing/index.d.ts +1 -0
- package/dist/cjs/types/testing/mocks/index.d.ts +1 -0
- package/dist/cjs/types/testing/mocks/secrets.d.ts +10 -0
- package/dist/esm/index.js +61 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/platforms/nest/pipelines/template/utils.d.ts +6 -6
- package/dist/esm/types/testing/index.d.ts +1 -0
- package/dist/esm/types/testing/mocks/index.d.ts +1 -0
- package/dist/esm/types/testing/mocks/secrets.d.ts +10 -0
- package/dist/index.d.ts +17 -7
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PipelineCompletedStepState } from "../../../../types";
|
|
2
2
|
export declare class PipelineUtils<TPipelineInput, TPipelineOutput, TContext> {
|
|
3
|
-
getStepByKey: (
|
|
4
|
-
getStepInputByKey: <TStepInput>(
|
|
5
|
-
getStepOutputByKey: <TStepOutput>(
|
|
6
|
-
getStep: (
|
|
7
|
-
getStepInput: <TStepInput>(
|
|
8
|
-
getStepOutput: <TStepOutput>(
|
|
3
|
+
getStepByKey: (state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
4
|
+
getStepInputByKey: <TStepInput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepInput;
|
|
5
|
+
getStepOutputByKey: <TStepOutput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepOutput;
|
|
6
|
+
getStep: (state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
7
|
+
getStepInput: <TStepInput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepInput;
|
|
8
|
+
getStepOutput: <TStepOutput>(state: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepOutput;
|
|
9
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./mocks";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InMemorySecretsProvider } from "./secrets";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppSecret, AppSecretDefinition, AppSecretsPageMetadata, ISecretsProvider } from "../../abstractions/secrets";
|
|
2
|
+
export declare class InMemorySecretsProvider implements ISecretsProvider {
|
|
3
|
+
private readonly secrets;
|
|
4
|
+
getSecrets(pageName: string): Promise<AppSecret<any>[]>;
|
|
5
|
+
setSecret<TValue>(pageName: string, secret: AppSecret<TValue>): Promise<void>;
|
|
6
|
+
defineSecret(pageName: string, definition: AppSecretDefinition): Promise<void>;
|
|
7
|
+
pageInitialize(pageName: string, metadata: AppSecretsPageMetadata): Promise<void>;
|
|
8
|
+
pageEnsure(pageName: string, metadata: AppSecretsPageMetadata): Promise<void>;
|
|
9
|
+
pageExists(pageName: string): Promise<boolean>;
|
|
10
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -23531,6 +23531,7 @@ class PipelineStepOperationOptionsBuilder {
|
|
|
23531
23531
|
}
|
|
23532
23532
|
build() {
|
|
23533
23533
|
return {
|
|
23534
|
+
key: this.operation.key,
|
|
23534
23535
|
name: this.operation.name,
|
|
23535
23536
|
operation: this.operation,
|
|
23536
23537
|
rollbackOperations: this.rollbackOperations,
|
|
@@ -34306,32 +34307,32 @@ const buildCompletedStepsSequence = (step) => {
|
|
|
34306
34307
|
};
|
|
34307
34308
|
class PipelineUtils {
|
|
34308
34309
|
constructor() {
|
|
34309
|
-
this.getStepByKey = (
|
|
34310
|
-
const sequence = buildCompletedStepsSequence(
|
|
34310
|
+
this.getStepByKey = (state, key) => {
|
|
34311
|
+
const sequence = buildCompletedStepsSequence(state);
|
|
34311
34312
|
const matchingStep = sequence.find((x) => x.reference.key === key);
|
|
34312
34313
|
if (!matchingStep) {
|
|
34313
34314
|
throw new Error(`Step key ${key} not found`);
|
|
34314
34315
|
}
|
|
34315
34316
|
return matchingStep;
|
|
34316
34317
|
};
|
|
34317
|
-
this.getStepInputByKey = (
|
|
34318
|
-
return this.getStepByKey(
|
|
34318
|
+
this.getStepInputByKey = (state, key) => {
|
|
34319
|
+
return this.getStepByKey(state, key).stepInput;
|
|
34319
34320
|
};
|
|
34320
|
-
this.getStepOutputByKey = (
|
|
34321
|
-
return this.getStepByKey(
|
|
34321
|
+
this.getStepOutputByKey = (state, key) => {
|
|
34322
|
+
return this.getStepByKey(state, key).stepOutput;
|
|
34322
34323
|
};
|
|
34323
|
-
this.getStep = (
|
|
34324
|
-
const sequence = buildCompletedStepsSequence(
|
|
34324
|
+
this.getStep = (state, index) => {
|
|
34325
|
+
const sequence = buildCompletedStepsSequence(state);
|
|
34325
34326
|
if (index >= sequence.length) {
|
|
34326
34327
|
throw new Error(`Step index ${index} is out of range`);
|
|
34327
34328
|
}
|
|
34328
34329
|
return sequence[index];
|
|
34329
34330
|
};
|
|
34330
|
-
this.getStepInput = (
|
|
34331
|
-
return this.getStep(
|
|
34331
|
+
this.getStepInput = (state, index) => {
|
|
34332
|
+
return this.getStep(state, index).stepInput;
|
|
34332
34333
|
};
|
|
34333
|
-
this.getStepOutput = (
|
|
34334
|
-
return this.getStep(
|
|
34334
|
+
this.getStepOutput = (state, index) => {
|
|
34335
|
+
return this.getStep(state, index).stepOutput;
|
|
34335
34336
|
};
|
|
34336
34337
|
}
|
|
34337
34338
|
}
|
|
@@ -43654,5 +43655,52 @@ AwsSecretsModule = AwsSecretsModule_1 = __decorate([
|
|
|
43654
43655
|
})
|
|
43655
43656
|
], AwsSecretsModule);
|
|
43656
43657
|
|
|
43657
|
-
|
|
43658
|
+
let InMemorySecretsProvider = class InMemorySecretsProvider {
|
|
43659
|
+
constructor() {
|
|
43660
|
+
this.secrets = new Map();
|
|
43661
|
+
}
|
|
43662
|
+
async getSecrets(pageName) {
|
|
43663
|
+
return Object.values(this.secrets.get(pageName).secrets).map((secret) => secret.value);
|
|
43664
|
+
}
|
|
43665
|
+
async setSecret(pageName, secret) {
|
|
43666
|
+
this.secrets.get(pageName).secrets[secret.key] = {
|
|
43667
|
+
definition: {
|
|
43668
|
+
key: secret.key,
|
|
43669
|
+
type: secret.type,
|
|
43670
|
+
hidden: secret.hidden,
|
|
43671
|
+
defaultValue: secret.value,
|
|
43672
|
+
},
|
|
43673
|
+
value: secret,
|
|
43674
|
+
};
|
|
43675
|
+
}
|
|
43676
|
+
async defineSecret(pageName, definition) {
|
|
43677
|
+
this.secrets.get(pageName).secrets[definition.key] = {
|
|
43678
|
+
definition,
|
|
43679
|
+
value: {
|
|
43680
|
+
key: definition.key,
|
|
43681
|
+
value: definition.defaultValue,
|
|
43682
|
+
type: definition.type,
|
|
43683
|
+
hidden: definition.hidden,
|
|
43684
|
+
timestamp: Date.now(),
|
|
43685
|
+
},
|
|
43686
|
+
};
|
|
43687
|
+
}
|
|
43688
|
+
async pageInitialize(pageName, metadata) {
|
|
43689
|
+
this.secrets.set(pageName, { metadata, secrets: {} });
|
|
43690
|
+
}
|
|
43691
|
+
async pageEnsure(pageName, metadata) {
|
|
43692
|
+
if (this.secrets.has(pageName)) {
|
|
43693
|
+
return;
|
|
43694
|
+
}
|
|
43695
|
+
this.secrets.set(pageName, { metadata, secrets: {} });
|
|
43696
|
+
}
|
|
43697
|
+
async pageExists(pageName) {
|
|
43698
|
+
return this.secrets.has(pageName);
|
|
43699
|
+
}
|
|
43700
|
+
};
|
|
43701
|
+
InMemorySecretsProvider = __decorate([
|
|
43702
|
+
WpSecretsProvider("inMemorySecretsManager")
|
|
43703
|
+
], InMemorySecretsProvider);
|
|
43704
|
+
|
|
43705
|
+
export { AUTHENTICATION_EVENTS_NAMESPACE, ApiKeyAccess, AppExceptionsFilterBase, AppHashingService, AppInMemorySettings, AppSession, AppSessionMiddleware, AppSessionService, AuthGuard, Authenticated, AuthenticationEmailTemplates, AuthenticationError, AuthenticationEvents, AuthenticationExtensionSymbols, AuthenticationModule, AuthenticationService, AwsBucketModule, AwsEmailModule, AwsJobsModule, AwsS3BucketError, AwsS3BucketProvider, AwsS3MediaError, AwsS3MediaModule, AwsS3MediaProvider, AwsSecretsModule, AwsSecretsProvider, AwsSesEmailTemplate, BucketItemType, CacheService, ConnectorMode, CurrentUser, CustomDiscoveryModule, CustomDiscoveryService, EmailService, EntityManagerConfigurationError, EntityManagerException, EntityManagerInitializer, EntityManagerModule, EntityManagerRegistry, EntityManagerService, EntityManagerSymbols, EntityManagerUnauthorizedException, EntityNotFoundException, EntityOperationType, EntityOperationUnauthorizedException, EntitySeeder, EntitySerializationFormat, EntitySerializer, EntitySnapshotService, EntityVersionOperation, EventsService, FilesManager, IEntityVersionsCursor, InMemoryBucketProvider, InMemoryEmailProvider, InMemoryMediaProvider, InMemorySecretsProvider, InvalidCredentialsError, JobConcurrency, JobInstance, JobProviderState, JobRunType, JobSchedule, JobStatus, JobsModule, JobsService, LockNotFoundError, MediaLibraryService, MemberOf, MissingEntityIdError, ModulesContainerProvider, MultiTenancyModule, MultipleEntitiesFoundException, NestEntityActions, NestEntityAuthorizationMiddleware, NestEntityManager, NestEntitySerializer, NestEntitySnapshotService, NestPipelineTemplate, NestTypeOrmEntitySeeder, NestTypeOrmQueryBuilder, NestTypeOrmRepository, OperationLockService, OperationTokenMismatchError, PLATFORM_EVENT_NAMESPACE, Permissions, PipelineController, PipelineErrorType, PipelineInvocationError, PipelineStatus, PipelineStepErrorType, PipelinesBuilder, PipelinesRunner, PlatformEvents, Public, QueryBuilderBase, QueryBuilderOperation, ReplicationMode, Roles, SanityMediaError, SanityMediaModule, SanityMediaProvider, SecretsService, SendgridEmailModule, SendgridEmailTemplate, SortDirection, TrackingService, TypeOrmQueryBuilder, TypeOrmRepository, TypeormCacheInstance, TypeormOperationLockRepository, UserCreationError, UserRegistrationError, WpApiKeysService, WpAppInitializer, WpAwsSesEmailTemplate, WpBucketProvider, WpCacheInstance, WpEmailLogger, WpEmailProvider, WpEmailTemplate, WpEntity, WpEntityActions, WpEntityAdapter, WpEntityAuthMiddleware, WpEntityConnector, WpEntityConnectorMapper, WpEntityConverter, WpEntityManager, WpEntityQueryBuilder, WpEntityRepository, WpEntitySeeder, WpEntitySerializer, WpEntitySnapshotService, WpEntityVersioningProvider, WpEventsTracker, WpFileProvider, WpFileReferenceRepository, WpGlobalAuthenticationMiddleware, WpMediaFolderRepository, WpMediaProvider, WpMediaReferenceRepository, WpPermissionsService, WpPipeline, WpRolesService, WpSendgridEmailTemplate, WpUserRolesService, WpUserService, awsBatchSettings, buildPermissionsGuard, buildProviderToken, buildRolesGuard, createContainer, createExpressFileResponse, getEntityManagerProviderToken, getLocalizedText, newUuid, renderHandlebarsTemplate, sessionStorage, toEntitiesImportInput };
|
|
43658
43706
|
//# sourceMappingURL=index.js.map
|