@kensio/yulin 1.21.0 → 1.21.2
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/README.md +1 -0
- package/dist/sdk/router/resolve-sim-sdk-command-router.js +4 -0
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +3 -0
- package/dist/service/aws/factory/sim-aws-lambda-collaborators.d.ts +2 -0
- package/dist/service/aws/factory/sim-aws-lambda-collaborators.js +3 -0
- package/dist/service/aws/factory/sim-aws-logs-collaborators.d.ts +7 -0
- package/dist/service/aws/factory/sim-aws-logs-collaborators.js +10 -0
- package/dist/service/aws/factory/sim-aws-self-contained-service-builder.d.ts +3 -0
- package/dist/service/aws/factory/sim-aws-self-contained-service-builder.js +5 -0
- package/dist/service/aws/factory/sim-aws-service-factory.d.ts +3 -0
- package/dist/service/aws/factory/sim-aws-service-factory.js +4 -0
- package/dist/service/aws/sim-aws-account-region-scope.d.ts +3 -0
- package/dist/service/aws/sim-aws-account-region-scope.js +4 -0
- package/dist/service/aws/sim-aws-account.d.ts +3 -0
- package/dist/service/aws/sim-aws-account.js +4 -0
- package/dist/service/aws/sim-aws-region.d.ts +3 -0
- package/dist/service/aws/sim-aws-region.js +4 -0
- package/dist/service/aws/sim-aws-service-accessors.d.ts +3 -0
- package/dist/service/aws/sim-aws-service-accessors.js +4 -0
- package/dist/service/backup/cfn/sim-backup-cfn-plan-creator.d.ts +6 -0
- package/dist/service/backup/cfn/sim-backup-cfn-plan-creator.js +12 -0
- package/dist/service/backup/cfn/sim-backup-cfn-resource-deleter.d.ts +12 -0
- package/dist/service/backup/cfn/sim-backup-cfn-resource-deleter.js +31 -0
- package/dist/service/backup/cfn/sim-backup-cfn-resource-factory.d.ts +15 -0
- package/dist/service/backup/cfn/sim-backup-cfn-resource-factory.js +38 -0
- package/dist/service/backup/cfn/sim-backup-cfn-selection-creator.d.ts +6 -0
- package/dist/service/backup/cfn/sim-backup-cfn-selection-creator.js +17 -0
- package/dist/service/backup/cfn/sim-backup-cfn-vault-creator.d.ts +6 -0
- package/dist/service/backup/cfn/sim-backup-cfn-vault-creator.js +29 -0
- package/dist/service/backup/cfn/sim-cfn-backup-plan-properties.d.ts +11 -0
- package/dist/service/backup/cfn/sim-cfn-backup-plan-properties.js +37 -0
- package/dist/service/backup/cfn/sim-cfn-backup-properties.d.ts +12 -0
- package/dist/service/backup/cfn/sim-cfn-backup-properties.js +37 -0
- package/dist/service/backup/cfn/sim-cfn-backup-property-reader.d.ts +17 -0
- package/dist/service/backup/cfn/sim-cfn-backup-property-reader.js +62 -0
- package/dist/service/backup/cfn/sim-cfn-backup-resource-error.d.ts +7 -0
- package/dist/service/backup/cfn/sim-cfn-backup-resource-error.js +22 -0
- package/dist/service/backup/command/sim-backup-authorizer.d.ts +11 -0
- package/dist/service/backup/command/sim-backup-authorizer.js +24 -0
- package/dist/service/backup/command/sim-backup-command.types.d.ts +238 -0
- package/dist/service/backup/command/sim-backup-command.types.js +1 -0
- package/dist/service/backup/command/sim-backup-configuration-commands.d.ts +32 -0
- package/dist/service/backup/command/sim-backup-configuration-commands.js +138 -0
- package/dist/service/backup/command/sim-backup-job-commands.d.ts +23 -0
- package/dist/service/backup/command/sim-backup-job-commands.js +52 -0
- package/dist/service/backup/command/sim-backup-recovery-point-commands.d.ts +18 -0
- package/dist/service/backup/command/sim-backup-recovery-point-commands.js +38 -0
- package/dist/service/backup/command/sim-backup-request-options.d.ts +4 -0
- package/dist/service/backup/command/sim-backup-request-options.js +1 -0
- package/dist/service/backup/command/sim-backup-required-string.d.ts +2 -0
- package/dist/service/backup/command/sim-backup-required-string.js +8 -0
- package/dist/service/backup/error/sim-backup.error.d.ts +38 -0
- package/dist/service/backup/error/sim-backup.error.js +50 -0
- package/dist/service/backup/index.d.ts +9 -0
- package/dist/service/backup/index.js +7 -0
- package/dist/service/backup/job/sim-backup-job-input.d.ts +11 -0
- package/dist/service/backup/job/sim-backup-job-input.js +1 -0
- package/dist/service/backup/job/sim-backup-job-page.d.ts +22 -0
- package/dist/service/backup/job/sim-backup-job-page.js +54 -0
- package/dist/service/backup/job/sim-backup-job.d.ts +25 -0
- package/dist/service/backup/job/sim-backup-job.factory.d.ts +10 -0
- package/dist/service/backup/job/sim-backup-job.factory.js +24 -0
- package/dist/service/backup/job/sim-backup-job.js +54 -0
- package/dist/service/backup/job/sim-backup-jobs.d.ts +18 -0
- package/dist/service/backup/job/sim-backup-jobs.js +33 -0
- package/dist/service/backup/plan/sim-backup-plan-schedules.d.ts +21 -0
- package/dist/service/backup/plan/sim-backup-plan-schedules.js +66 -0
- package/dist/service/backup/plan/sim-backup-plan.d.ts +22 -0
- package/dist/service/backup/plan/sim-backup-plan.js +37 -0
- package/dist/service/backup/plan/sim-backup-rule.d.ts +9 -0
- package/dist/service/backup/plan/sim-backup-rule.js +71 -0
- package/dist/service/backup/recovery-point/sim-backup-recovery-point.d.ts +28 -0
- package/dist/service/backup/recovery-point/sim-backup-recovery-point.factory.d.ts +9 -0
- package/dist/service/backup/recovery-point/sim-backup-recovery-point.factory.js +23 -0
- package/dist/service/backup/recovery-point/sim-backup-recovery-point.js +62 -0
- package/dist/service/backup/sdk/sim-backup-sdk-command-router.d.ts +9 -0
- package/dist/service/backup/sdk/sim-backup-sdk-command-router.js +37 -0
- package/dist/service/backup/selection/sim-backup-selection.d.ts +22 -0
- package/dist/service/backup/selection/sim-backup-selection.js +43 -0
- package/dist/service/backup/sim-backup-arn.d.ts +7 -0
- package/dist/service/backup/sim-backup-arn.js +12 -0
- package/dist/service/backup/sim-backup-properties.d.ts +8 -0
- package/dist/service/backup/sim-backup-properties.js +1 -0
- package/dist/service/backup/sim-backup-resource-resolver.d.ts +24 -0
- package/dist/service/backup/sim-backup-resource-resolver.js +44 -0
- package/dist/service/backup/sim-backup-store.d.ts +29 -0
- package/dist/service/backup/sim-backup-store.js +80 -0
- package/dist/service/backup/sim-backup.d.ts +48 -0
- package/dist/service/backup/sim-backup.js +139 -0
- package/dist/service/backup/vault/sim-backup-vault-description.d.ts +12 -0
- package/dist/service/backup/vault/sim-backup-vault-description.js +15 -0
- package/dist/service/backup/vault/sim-backup-vault-lock-configuration.d.ts +5 -0
- package/dist/service/backup/vault/sim-backup-vault-lock-configuration.js +31 -0
- package/dist/service/backup/vault/sim-backup-vault-lock.d.ts +15 -0
- package/dist/service/backup/vault/sim-backup-vault-lock.js +23 -0
- package/dist/service/backup/vault/sim-backup-vault-recovery-points.d.ts +12 -0
- package/dist/service/backup/vault/sim-backup-vault-recovery-points.js +30 -0
- package/dist/service/backup/vault/sim-backup-vault-retention.d.ts +4 -0
- package/dist/service/backup/vault/sim-backup-vault-retention.js +20 -0
- package/dist/service/backup/vault/sim-backup-vault.d.ts +33 -0
- package/dist/service/backup/vault/sim-backup-vault.js +49 -0
- package/dist/service/cloudformation/resource/cfn/backup/sim-backup-cfn-value-adapter.d.ts +3 -0
- package/dist/service/cloudformation/resource/cfn/backup/sim-backup-cfn-value-adapter.js +66 -0
- package/dist/service/cloudformation/resource/cfn/logs/sim-logs-cfn-value-adapter.js +6 -0
- package/dist/service/cloudformation/resource/cfn/logs/sim-logs-metric-filter-cfn.d.ts +23 -0
- package/dist/service/cloudformation/resource/cfn/logs/sim-logs-metric-filter-cfn.js +22 -0
- package/dist/service/cloudformation/resource/cfn/sim-cfn-service-value-adapters.js +2 -0
- package/dist/service/cloudformation/resource/ignore/sim-cfn-skipped-properties.d.ts +49 -0
- package/dist/service/cloudformation/resource/ignore/sim-cfn-skipped-properties.js +61 -0
- package/dist/service/cloudformation/resource/ignore/sim-cfn-skipped-property.type.d.ts +51 -0
- package/dist/service/cloudformation/resource/ignore/sim-cfn-skipped-property.type.js +1 -0
- package/dist/service/cloudformation/resource/resolve/service/sim-cfn-service-factories.js +4 -0
- package/dist/service/cloudwatch/index.d.ts +1 -0
- package/dist/service/cloudwatch/index.js +1 -0
- package/dist/service/cloudwatch/sim-cloudwatch-commands.d.ts +2 -0
- package/dist/service/cloudwatch/sim-cloudwatch-commands.js +6 -0
- package/dist/service/cloudwatch/sim-cloudwatch.d.ts +9 -0
- package/dist/service/cloudwatch/sim-cloudwatch.js +10 -0
- package/dist/service/cloudwatch/write/sim-cloudwatch-service-writer.d.ts +58 -0
- package/dist/service/cloudwatch/write/sim-cloudwatch-service-writer.js +53 -0
- package/dist/service/cognito/command/auth/sim-cognito-admin-respond-to-challenge.d.ts +3 -0
- package/dist/service/cognito/command/auth/sim-cognito-admin-respond-to-challenge.js +8 -2
- package/dist/service/cognito/command/auth/sim-cognito-auth-commands.d.ts +3 -0
- package/dist/service/cognito/command/auth/sim-cognito-auth-commands.js +4 -0
- package/dist/service/cognito/command/auth/sim-cognito-auth-flow-runner.d.ts +11 -1
- package/dist/service/cognito/command/auth/sim-cognito-auth-flow-runner.js +13 -1
- package/dist/service/cognito/command/auth/sim-cognito-auth-resolver.d.ts +3 -0
- package/dist/service/cognito/command/auth/sim-cognito-auth-resolver.js +16 -4
- package/dist/service/cognito/command/auth/sim-cognito-get-tokens-from-refresh-token.d.ts +7 -0
- package/dist/service/cognito/command/auth/sim-cognito-get-tokens-from-refresh-token.js +11 -1
- package/dist/service/cognito/command/auth/sim-cognito-respond-to-challenge.d.ts +3 -0
- package/dist/service/cognito/command/auth/sim-cognito-respond-to-challenge.js +8 -2
- package/dist/service/cognito/command/hosted/hosted-auth.command.d.ts +19 -0
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.d.ts +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.js +3 -2
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.d.ts +8 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.js +11 -3
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-passkey-sign-in.d.ts +11 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-passkey-sign-in.js +13 -2
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.d.ts +11 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js +11 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.d.ts +7 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.js +18 -7
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-signed-in.d.ts +20 -3
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-signed-in.js +19 -3
- package/dist/service/cognito/command/hosted/sim-cognito-token-endpoint.d.ts +2 -0
- package/dist/service/cognito/command/hosted/sim-cognito-token-grants.d.ts +8 -0
- package/dist/service/cognito/command/hosted/sim-cognito-token-grants.js +13 -4
- package/dist/service/cognito/command/sim-cognito-commands.d.ts +5 -0
- package/dist/service/cognito/command/sim-cognito-commands.js +22 -2
- package/dist/service/cognito/command/user/sim-cognito-confirm-sign-up-commands.d.ts +74 -0
- package/dist/service/cognito/command/user/sim-cognito-confirm-sign-up-commands.js +110 -0
- package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.d.ts +5 -49
- package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.js +7 -87
- package/dist/service/cognito/command/user/sim-cognito-user-commands.d.ts +4 -0
- package/dist/service/cognito/command/user/sim-cognito-user-commands.js +38 -29
- package/dist/service/cognito/error/sim-cognito-managed-login.error.d.ts +23 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.js +36 -0
- package/dist/service/cognito/error/sim-cognito-throttle.error.d.ts +13 -0
- package/dist/service/cognito/error/sim-cognito-throttle.error.js +15 -0
- package/dist/service/cognito/index.d.ts +2 -0
- package/dist/service/cognito/index.js +2 -0
- package/dist/service/cognito/metric/sim-cognito-counted-request.d.ts +50 -0
- package/dist/service/cognito/metric/sim-cognito-counted-request.js +51 -0
- package/dist/service/cognito/metric/sim-cognito-metrics.d.ts +22 -0
- package/dist/service/cognito/metric/sim-cognito-metrics.js +26 -0
- package/dist/service/cognito/metric/sim-cognito-pool-metrics.d.ts +40 -0
- package/dist/service/cognito/metric/sim-cognito-pool-metrics.js +51 -0
- package/dist/service/cognito/metric/sim-cognito-throttled-request.d.ts +11 -0
- package/dist/service/cognito/metric/sim-cognito-throttled-request.js +15 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.js +6 -1
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.d.ts +4 -1
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.js +6 -2
- package/dist/service/cognito/serve/page/sim-cognito-provider-page.d.ts +35 -0
- package/dist/service/cognito/serve/page/sim-cognito-provider-page.js +50 -0
- package/dist/service/cognito/sim-cognito-identity-provider.d.ts +6 -0
- package/dist/service/cognito/sim-cognito-identity-provider.js +1 -0
- package/dist/service/cognito/sim-cognito-user-directory.js +3 -3
- package/dist/service/cognito/user-pool/auth/sim-cognito-authorization-code.d.ts +9 -0
- package/dist/service/cognito/user-pool/auth/sim-cognito-authorization-code.js +2 -0
- package/dist/service/cognito/user-pool/auth/sim-cognito-pool-auth.d.ts +8 -0
- package/dist/service/cognito/user-pool/auth/sim-cognito-pool-auth.js +8 -0
- package/dist/service/cognito/user-pool/auth/sim-cognito-request-throttle.d.ts +36 -0
- package/dist/service/cognito/user-pool/auth/sim-cognito-request-throttle.js +45 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-sign-in.d.ts +42 -9
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-sign-in.js +56 -27
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-triggers.d.ts +52 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-federated-triggers.js +49 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-presented-external-user.d.ts +48 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-presented-external-user.js +94 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-same-federated-identity.d.ts +13 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-same-federated-identity.js +19 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-user-pool-identity-provider.d.ts +7 -0
- package/dist/service/cognito/user-pool/idp/sim-cognito-user-pool-identity-provider.js +9 -0
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-name.d.ts +3 -2
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-name.js +3 -2
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.d.ts +18 -1
- package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.js +35 -18
- package/dist/service/lambda/command/create-function/create-function.handler.d.ts +3 -0
- package/dist/service/lambda/command/create-function/create-function.handler.js +4 -1
- package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts +2 -0
- package/dist/service/lambda/event-source/poll/kinesis/sim-lambda-kinesis-stream-delivery.js +7 -11
- package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-delivery.js +7 -8
- package/dist/service/lambda/event-source/poll/sim-lambda-stream-iterator-age.d.ts +11 -0
- package/dist/service/lambda/event-source/poll/sim-lambda-stream-iterator-age.js +31 -0
- package/dist/service/lambda/event-source/poll/sim-lambda-stream-sequence-numbers.d.ts +10 -0
- package/dist/service/lambda/event-source/poll/sim-lambda-stream-sequence-numbers.js +12 -0
- package/dist/service/lambda/function/sim-lambda-function.d.ts +3 -0
- package/dist/service/lambda/function/sim-lambda-function.js +6 -2
- package/dist/service/lambda/function/sim-lambda-function.type.d.ts +7 -0
- package/dist/service/lambda/metric/sim-lambda-function-metrics.d.ts +47 -0
- package/dist/service/lambda/metric/sim-lambda-function-metrics.js +83 -0
- package/dist/service/lambda/metric/sim-lambda-iterator-age.d.ts +29 -0
- package/dist/service/lambda/metric/sim-lambda-iterator-age.js +41 -0
- package/dist/service/lambda/metric/sim-lambda-metrics.d.ts +12 -0
- package/dist/service/lambda/metric/sim-lambda-metrics.js +13 -0
- package/dist/service/lambda/sim-lambda-commands.d.ts +2 -0
- package/dist/service/lambda/sim-lambda-commands.js +2 -1
- package/dist/service/logs/cfn/metric/sim-cfn-metric-dimension-values.d.ts +9 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-dimension-values.js +25 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-creator.d.ts +30 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-creator.js +52 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-properties.d.ts +40 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-properties.js +66 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-property-rules.d.ts +19 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-property-rules.js +40 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-unsimulated-properties.d.ts +5 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-unsimulated-properties.js +23 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-value.d.ts +25 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-filter-value.js +58 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-transformation-values.d.ts +6 -0
- package/dist/service/logs/cfn/metric/sim-cfn-metric-transformation-values.js +19 -0
- package/dist/service/logs/cfn/sim-logs-cfn-resource-deleter.d.ts +2 -0
- package/dist/service/logs/cfn/sim-logs-cfn-resource-deleter.js +4 -0
- package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.d.ts +5 -3
- package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.js +12 -3
- package/dist/service/logs/command/event/sim-logs-put-log-events.d.ts +3 -0
- package/dist/service/logs/command/event/sim-logs-put-log-events.js +3 -0
- package/dist/service/logs/command/group/sim-logs-log-group-commands.js +3 -3
- package/dist/service/logs/command/metric/metric-filter.command.d.ts +79 -0
- package/dist/service/logs/command/metric/metric-filter.command.js +1 -0
- package/dist/service/logs/command/metric/sim-logs-metric-filter-commands.d.ts +48 -0
- package/dist/service/logs/command/metric/sim-logs-metric-filter-commands.js +95 -0
- package/dist/service/logs/command/metric/sim-logs-metric-filter-input.d.ts +11 -0
- package/dist/service/logs/command/metric/sim-logs-metric-filter-input.js +79 -0
- package/dist/service/logs/command/sim-logs-command.types.d.ts +1 -0
- package/dist/service/logs/group/sim-logs-log-group.d.ts +6 -0
- package/dist/service/logs/group/sim-logs-log-group.js +6 -0
- package/dist/service/logs/index.d.ts +6 -0
- package/dist/service/logs/index.js +4 -0
- package/dist/service/logs/metric/cloudwatch/sim-aws-logs-metric-filter-metrics.d.ts +40 -0
- package/dist/service/logs/metric/cloudwatch/sim-aws-logs-metric-filter-metrics.js +78 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-datapoints.d.ts +25 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-datapoints.js +81 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-document.d.ts +57 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-document.js +85 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-json.d.ts +24 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-json.js +41 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-values.d.ts +20 -0
- package/dist/service/logs/metric/emf/sim-logs-embedded-metric-values.js +39 -0
- package/dist/service/logs/metric/sim-logs-metric-datapoint.d.ts +25 -0
- package/dist/service/logs/metric/sim-logs-metric-datapoint.js +1 -0
- package/dist/service/logs/metric/sim-logs-metric-fan-out.d.ts +62 -0
- package/dist/service/logs/metric/sim-logs-metric-fan-out.js +116 -0
- package/dist/service/logs/metric/sim-logs-metric-filter-selection.d.ts +17 -0
- package/dist/service/logs/metric/sim-logs-metric-filter-selection.js +17 -0
- package/dist/service/logs/metric/sim-logs-metric-filter-store.d.ts +35 -0
- package/dist/service/logs/metric/sim-logs-metric-filter-store.js +47 -0
- package/dist/service/logs/metric/sim-logs-metric-filter.d.ts +49 -0
- package/dist/service/logs/metric/sim-logs-metric-filter.js +95 -0
- package/dist/service/logs/metric/sim-logs-metric-publication-failure.d.ts +31 -0
- package/dist/service/logs/metric/sim-logs-metric-publication-failure.js +12 -0
- package/dist/service/logs/metric/sim-logs-metric-publications.d.ts +11 -0
- package/dist/service/logs/metric/sim-logs-metric-publications.js +1 -0
- package/dist/service/logs/metric/sim-logs-metric-transformation.d.ts +45 -0
- package/dist/service/logs/metric/sim-logs-metric-transformation.js +127 -0
- package/dist/service/logs/sdk/sim-logs-sdk-command-router.js +12 -0
- package/dist/service/logs/sim-logs-commands.d.ts +12 -0
- package/dist/service/logs/sim-logs-commands.js +17 -0
- package/dist/service/logs/sim-logs-metric-operations.d.ts +31 -0
- package/dist/service/logs/sim-logs-metric-operations.js +37 -0
- package/dist/service/logs/sim-logs.d.ts +4 -3
- package/dist/service/logs/sim-logs.js +4 -3
- package/dist/service/logs/write/sim-logs-service-writer.d.ts +3 -0
- package/dist/service/logs/write/sim-logs-service-writer.js +5 -1
- package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-configuration.d.ts +32 -0
- package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-configuration.js +31 -1
- package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-expiry.d.ts +13 -2
- package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-expiry.js +18 -1
- package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-sweep.d.ts +17 -1
- package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-sweep.js +27 -3
- package/dist/service/s3/bucket/lifecycle/sim-s3-noncurrent-sweep.d.ts +45 -0
- package/dist/service/s3/bucket/lifecycle/sim-s3-noncurrent-sweep.js +90 -0
- package/dist/service/s3/bucket/lock/sim-s3-bucket-object-lock.d.ts +42 -0
- package/dist/service/s3/bucket/lock/sim-s3-bucket-object-lock.js +59 -0
- package/dist/service/s3/bucket/lock/sim-s3-default-retention.d.ts +8 -0
- package/dist/service/s3/bucket/lock/sim-s3-default-retention.js +15 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-lock-configuration.d.ts +49 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-lock-configuration.js +102 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-lock-output.d.ts +14 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-lock-output.js +1 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-lock.d.ts +62 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-lock.js +100 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-retention.d.ts +55 -0
- package/dist/service/s3/bucket/lock/sim-s3-object-retention.js +82 -0
- package/dist/service/s3/bucket/notification/sim-s3-notification-event.d.ts +1 -1
- package/dist/service/s3/bucket/notification/sim-s3-notification-event.js +9 -1
- package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-events.d.ts +1 -1
- package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-events.js +1 -2
- package/dist/service/s3/bucket/sim-s3-bucket-objects.d.ts +114 -0
- package/dist/service/s3/bucket/sim-s3-bucket-objects.js +148 -0
- package/dist/service/s3/bucket/sim-s3-bucket.d.ts +30 -29
- package/dist/service/s3/bucket/sim-s3-bucket.js +42 -45
- package/dist/service/s3/bucket/sim-s3-object-deletion.d.ts +30 -0
- package/dist/service/s3/bucket/sim-s3-object-deletion.js +29 -0
- package/dist/service/s3/bucket/versioning/sim-s3-bucket-versioning.d.ts +61 -0
- package/dist/service/s3/bucket/versioning/sim-s3-bucket-versioning.js +65 -0
- package/dist/service/s3/bucket/versioning/sim-s3-bucket-versions.d.ts +97 -0
- package/dist/service/s3/bucket/versioning/sim-s3-bucket-versions.js +176 -0
- package/dist/service/s3/bucket/versioning/sim-s3-compare-keys.d.ts +10 -0
- package/dist/service/s3/bucket/versioning/sim-s3-compare-keys.js +16 -0
- package/dist/service/s3/bucket/versioning/sim-s3-object-version.d.ts +85 -0
- package/dist/service/s3/bucket/versioning/sim-s3-object-version.js +101 -0
- package/dist/service/s3/bucket/versioning/sim-s3-object-versions.d.ts +52 -0
- package/dist/service/s3/bucket/versioning/sim-s3-object-versions.js +91 -0
- package/dist/service/s3/bucket/versioning/sim-s3-version-page.d.ts +32 -0
- package/dist/service/s3/bucket/versioning/sim-s3-version-page.js +45 -0
- package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-configuration.d.ts +0 -5
- package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-configuration.js +3 -14
- package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-fields.d.ts +18 -1
- package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-fields.js +34 -1
- package/dist/service/s3/cfn/bucket/lock/sim-cfn-s3-bucket-object-lock-configuration.d.ts +37 -0
- package/dist/service/s3/cfn/bucket/lock/sim-cfn-s3-bucket-object-lock-configuration.js +78 -0
- package/dist/service/s3/cfn/bucket/replication/sim-cfn-s3-bucket-replication-rules.d.ts +20 -0
- package/dist/service/s3/cfn/bucket/replication/sim-cfn-s3-bucket-replication-rules.js +107 -0
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-configurator.d.ts +14 -7
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-configurator.js +29 -37
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-declared-configurations.d.ts +62 -0
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-declared-configurations.js +89 -0
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-property-names.d.ts +9 -5
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-property-names.js +16 -16
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-property-rules.d.ts +9 -5
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-property-rules.js +17 -6
- package/dist/service/s3/cfn/bucket/versioning/sim-cfn-s3-bucket-versioning-configuration.d.ts +19 -0
- package/dist/service/s3/cfn/bucket/versioning/sim-cfn-s3-bucket-versioning-configuration.js +28 -0
- package/dist/service/s3/command/authorize/sim-s3-authorize-action.d.ts +24 -0
- package/dist/service/s3/command/authorize/sim-s3-authorize-action.js +30 -0
- package/dist/service/s3/command/complete-multipart-upload/complete-multipart-upload.command.d.ts +2 -0
- package/dist/service/s3/command/complete-multipart-upload/complete-multipart-upload.handler.js +3 -1
- package/dist/service/s3/command/copy-object/copy-object.command.d.ts +3 -1
- package/dist/service/s3/command/copy-object/copy-object.handler.js +3 -1
- package/dist/service/s3/command/delete-object/delete-object-version-removal.d.ts +50 -0
- package/dist/service/s3/command/delete-object/delete-object-version-removal.js +52 -0
- package/dist/service/s3/command/delete-object/delete-object.command.d.ts +19 -2
- package/dist/service/s3/command/delete-object/delete-object.handler.d.ts +7 -1
- package/dist/service/s3/command/delete-object/delete-object.handler.js +28 -16
- package/dist/service/s3/command/delete-object/sim-s3-notify-deleted.d.ts +24 -0
- package/dist/service/s3/command/delete-object/sim-s3-notify-deleted.js +32 -0
- package/dist/service/s3/command/delete-objects/delete-object-attempt.d.ts +6 -2
- package/dist/service/s3/command/delete-objects/delete-object-attempt.js +6 -2
- package/dist/service/s3/command/delete-objects/delete-objects-key-removal.js +10 -9
- package/dist/service/s3/command/delete-objects/delete-objects-outcome.js +9 -1
- package/dist/service/s3/command/delete-objects/delete-objects.command.d.ts +6 -0
- package/dist/service/s3/command/get-bucket-versioning/get-bucket-versioning.command.d.ts +23 -0
- package/dist/service/s3/command/get-bucket-versioning/get-bucket-versioning.command.js +1 -0
- package/dist/service/s3/command/get-bucket-versioning/get-bucket-versioning.handler.d.ts +31 -0
- package/dist/service/s3/command/get-bucket-versioning/get-bucket-versioning.handler.js +40 -0
- package/dist/service/s3/command/get-object/get-object-loader.d.ts +3 -2
- package/dist/service/s3/command/get-object/get-object-loader.js +9 -4
- package/dist/service/s3/command/get-object/get-object.command.d.ts +9 -1
- package/dist/service/s3/command/get-object/get-object.handler.js +1 -1
- package/dist/service/s3/command/get-object-lock-configuration/get-object-lock-configuration.command.d.ts +25 -0
- package/dist/service/s3/command/get-object-lock-configuration/get-object-lock-configuration.command.js +1 -0
- package/dist/service/s3/command/get-object-lock-configuration/get-object-lock-configuration.handler.d.ts +31 -0
- package/dist/service/s3/command/get-object-lock-configuration/get-object-lock-configuration.handler.js +41 -0
- package/dist/service/s3/command/head-object/head-object-loader.d.ts +1 -1
- package/dist/service/s3/command/head-object/head-object-loader.js +7 -3
- package/dist/service/s3/command/head-object/head-object.command.d.ts +9 -1
- package/dist/service/s3/command/head-object/head-object.handler.js +1 -1
- package/dist/service/s3/command/list-object-versions/list-object-versions-listing.d.ts +31 -0
- package/dist/service/s3/command/list-object-versions/list-object-versions-listing.js +55 -0
- package/dist/service/s3/command/list-object-versions/list-object-versions-summaries.d.ts +17 -0
- package/dist/service/s3/command/list-object-versions/list-object-versions-summaries.js +34 -0
- package/dist/service/s3/command/list-object-versions/list-object-versions.command.d.ts +59 -0
- package/dist/service/s3/command/list-object-versions/list-object-versions.command.js +1 -0
- package/dist/service/s3/command/list-object-versions/list-object-versions.handler.d.ts +34 -0
- package/dist/service/s3/command/list-object-versions/list-object-versions.handler.js +62 -0
- package/dist/service/s3/command/object/sim-s3-read-object-version.d.ts +34 -0
- package/dist/service/s3/command/object/sim-s3-read-object-version.js +52 -0
- package/dist/service/s3/command/object-lock/sim-s3-locked-version.d.ts +11 -0
- package/dist/service/s3/command/object-lock/sim-s3-locked-version.js +27 -0
- package/dist/service/s3/command/object-lock/sim-s3-object-lock-authorizer.d.ts +42 -0
- package/dist/service/s3/command/object-lock/sim-s3-object-lock-authorizer.js +66 -0
- package/dist/service/s3/command/object-lock/sim-s3-object-lock-commands.d.ts +30 -0
- package/dist/service/s3/command/object-lock/sim-s3-object-lock-commands.js +41 -0
- package/dist/service/s3/command/put-bucket-versioning/put-bucket-versioning.command.d.ts +21 -0
- package/dist/service/s3/command/put-bucket-versioning/put-bucket-versioning.command.js +1 -0
- package/dist/service/s3/command/put-bucket-versioning/put-bucket-versioning.handler.d.ts +31 -0
- package/dist/service/s3/command/put-bucket-versioning/put-bucket-versioning.handler.js +44 -0
- package/dist/service/s3/command/put-object/put-object.command.d.ts +3 -0
- package/dist/service/s3/command/put-object/put-object.handler.js +10 -10
- package/dist/service/s3/command/put-object-legal-hold/put-object-legal-hold.command.d.ts +24 -0
- package/dist/service/s3/command/put-object-legal-hold/put-object-legal-hold.command.js +1 -0
- package/dist/service/s3/command/put-object-legal-hold/put-object-legal-hold.handler.d.ts +32 -0
- package/dist/service/s3/command/put-object-legal-hold/put-object-legal-hold.handler.js +41 -0
- package/dist/service/s3/command/put-object-lock-configuration/put-object-lock-configuration.command.d.ts +21 -0
- package/dist/service/s3/command/put-object-lock-configuration/put-object-lock-configuration.command.js +1 -0
- package/dist/service/s3/command/put-object-lock-configuration/put-object-lock-configuration.handler.d.ts +32 -0
- package/dist/service/s3/command/put-object-lock-configuration/put-object-lock-configuration.handler.js +47 -0
- package/dist/service/s3/command/put-object-retention/put-object-retention.command.d.ts +29 -0
- package/dist/service/s3/command/put-object-retention/put-object-retention.command.js +1 -0
- package/dist/service/s3/command/put-object-retention/put-object-retention.handler.d.ts +31 -0
- package/dist/service/s3/command/put-object-retention/put-object-retention.handler.js +42 -0
- package/dist/service/s3/command/sim-s3-command.types.d.ts +7 -0
- package/dist/service/s3/command/versioning/sim-s3-versioning-authorizer.d.ts +35 -0
- package/dist/service/s3/command/versioning/sim-s3-versioning-authorizer.js +57 -0
- package/dist/service/s3/command/versioning/sim-s3-versioning-commands.d.ts +26 -0
- package/dist/service/s3/command/versioning/sim-s3-versioning-commands.js +34 -0
- package/dist/service/s3/command/versioning/sim-s3-versioning-configuration-validation.d.ts +13 -0
- package/dist/service/s3/command/versioning/sim-s3-versioning-configuration-validation.js +28 -0
- package/dist/service/s3/error/sim-s3-object-lock.error.d.ts +22 -0
- package/dist/service/s3/error/sim-s3-object-lock.error.js +26 -0
- package/dist/service/s3/error/sim-s3.error.d.ts +22 -0
- package/dist/service/s3/error/sim-s3.error.js +26 -0
- package/dist/service/s3/notification/event/sim-s3-event-records.js +3 -0
- package/dist/service/s3/notification/event/sim-s3-event.type.d.ts +5 -3
- package/dist/service/s3/notification/event/sim-s3-object-event-builder.d.ts +15 -0
- package/dist/service/s3/notification/event/sim-s3-object-event-builder.js +4 -1
- package/dist/service/s3/notification/event/sim-s3-object-event.d.ts +6 -0
- package/dist/service/s3/notification/event/sim-s3-object-event.js +2 -0
- package/dist/service/s3/notification/sim-s3-object-notifier.d.ts +1 -1
- package/dist/service/s3/notification/sim-s3-object-notifier.js +2 -2
- package/dist/service/s3/sdk/sim-s3-sdk-bucket-routes.d.ts +10 -0
- package/dist/service/s3/sdk/sim-s3-sdk-bucket-routes.js +84 -0
- package/dist/service/s3/sdk/sim-s3-sdk-command-router.js +6 -132
- package/dist/service/s3/sdk/sim-s3-sdk-object-lock-routes.d.ts +10 -0
- package/dist/service/s3/sdk/sim-s3-sdk-object-lock-routes.js +28 -0
- package/dist/service/s3/sdk/sim-s3-sdk-object-routes.d.ts +7 -0
- package/dist/service/s3/sdk/sim-s3-sdk-object-routes.js +80 -0
- package/dist/service/s3/sim-s3-commands.d.ts +4 -0
- package/dist/service/s3/sim-s3-commands.js +6 -0
- package/dist/service/s3/sim-s3-operations.d.ts +5 -5
- package/dist/service/s3/sim-s3-operations.js +5 -6
- package/dist/service/s3/sim-s3-version-operations.d.ts +32 -0
- package/dist/service/s3/sim-s3-version-operations.js +45 -0
- package/dist/service/scheduler/command/schedule/schedule.command.d.ts +9 -2
- package/dist/service/scheduler/command/schedule/sim-scheduler-described-schedule.js +2 -0
- package/dist/service/scheduler/command/schedule/sim-scheduler-unsimulated-target.js +0 -6
- package/dist/service/scheduler/command/sim-scheduler-command.types.d.ts +1 -1
- package/dist/service/scheduler/command/sim-scheduler-commands.js +1 -0
- package/dist/service/scheduler/delivery/sim-aws-scheduler-dead-letters.d.ts +17 -0
- package/dist/service/scheduler/delivery/sim-aws-scheduler-dead-letters.js +29 -0
- package/dist/service/scheduler/delivery/sim-aws-scheduler-delivery-targets.d.ts +6 -1
- package/dist/service/scheduler/delivery/sim-aws-scheduler-delivery-targets.js +9 -0
- package/dist/service/scheduler/delivery/sim-scheduler-dead-letter-queue.d.ts +18 -0
- package/dist/service/scheduler/delivery/sim-scheduler-dead-letter-queue.js +62 -0
- package/dist/service/scheduler/delivery/sim-scheduler-delivery-attempt.d.ts +29 -0
- package/dist/service/scheduler/delivery/sim-scheduler-delivery-attempt.js +81 -0
- package/dist/service/scheduler/delivery/sim-scheduler-delivery-function.js +9 -5
- package/dist/service/scheduler/delivery/sim-scheduler-delivery.d.ts +11 -0
- package/dist/service/scheduler/delivery/sim-scheduler-no-delivery-targets.d.ts +5 -1
- package/dist/service/scheduler/delivery/sim-scheduler-no-delivery-targets.js +8 -0
- package/dist/service/scheduler/delivery/sim-scheduler-target-delivery.d.ts +4 -1
- package/dist/service/scheduler/delivery/sim-scheduler-target-delivery.js +20 -15
- package/dist/service/scheduler/index.d.ts +1 -1
- package/dist/service/scheduler/target/sim-scheduler-dead-letter-config.d.ts +15 -0
- package/dist/service/scheduler/target/sim-scheduler-dead-letter-config.js +24 -0
- package/dist/service/scheduler/target/sim-scheduler-retry-policy.d.ts +20 -0
- package/dist/service/scheduler/target/sim-scheduler-retry-policy.js +37 -0
- package/dist/service/scheduler/target/sim-scheduler-target.d.ts +6 -0
- package/dist/service/scheduler/target/sim-scheduler-target.js +12 -0
- package/dist/service/ses/command/configuration-set/sim-ses-configuration-set-commands.js +13 -5
- package/dist/service/ses/command/configuration-set/sim-ses-configuration-set-options.d.ts +1 -1
- package/dist/service/ses/command/configuration-set/sim-ses-configuration-set-options.js +9 -9
- package/dist/service/ses/command/send/send.command.d.ts +10 -1
- package/dist/service/ses/command/send/sim-ses-read-content.d.ts +2 -1
- package/dist/service/ses/command/send/sim-ses-send-email.js +1 -0
- package/dist/service/ses/command/send/sim-ses-service-send.js +1 -0
- package/dist/service/ses/command/send/sim-ses-simple-content.js +26 -5
- package/dist/service/ses/command/send/sim-ses-template-send.js +1 -0
- package/dist/service/ses/command/suppression/suppression.command.d.ts +3 -2
- package/dist/service/ses/configuration-set/sim-ses-configuration-set.d.ts +9 -10
- package/dist/service/ses/configuration-set/sim-ses-configuration-set.js +7 -8
- package/dist/service/ses/email/sim-ses-sent-email-store.d.ts +8 -0
- package/dist/service/ses/email/sim-ses-sent-email-store.js +17 -0
- package/dist/service/ses/email/sim-ses-sent-email.d.ts +18 -0
- package/dist/service/ses/email/sim-ses-sent-email.js +3 -0
- package/dist/service/ses/error/sim-ses.error.d.ts +10 -0
- package/dist/service/ses/error/sim-ses.error.js +10 -0
- package/dist/service/ses/feedback/sim-ses-feedback-recorder.d.ts +34 -0
- package/dist/service/ses/feedback/sim-ses-feedback-recorder.js +55 -0
- package/dist/service/ses/index.d.ts +3 -2
- package/dist/service/ses/index.js +2 -1
- package/dist/service/ses/sim-ses-commands.d.ts +2 -0
- package/dist/service/ses/sim-ses-commands.js +9 -0
- package/dist/service/ses/sim-ses-configuration-sets.d.ts +4 -4
- package/dist/service/ses/sim-ses-configuration-sets.js +4 -4
- package/dist/service/ses/sim-ses-suppression.d.ts +3 -2
- package/dist/service/ses/sim-ses-suppression.js +3 -2
- package/dist/service/ses/sim-ses-v2.d.ts +13 -0
- package/dist/service/ses/sim-ses-v2.js +13 -0
- package/dist/service/ses/suppression/sim-ses-suppressed-destination.d.ts +3 -4
- package/dist/service/ses/suppression/sim-ses-suppressed-destination.js +3 -4
- package/dist/service/ses/suppression/sim-ses-suppression-list.d.ts +4 -4
- package/dist/service/ses/suppression/sim-ses-suppression-list.js +4 -4
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-encryption-rules.d.ts +15 -0
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-encryption-rules.js +33 -0
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-properties.d.ts +16 -0
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-properties.js +33 -1
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-property-names.d.ts +12 -6
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-property-names.js +18 -13
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-property-rules.d.ts +1 -0
- package/dist/service/sqs/cfn/queue/sim-cfn-sqs-queue-property-rules.js +9 -1
- package/dist/terraform/map/sim-tf-map-sqs-redrive.d.ts +4 -3
- package/dist/terraform/map/sim-tf-map-sqs-redrive.js +4 -3
- package/docs/README.md +1 -0
- package/docs/services/backup/README.md +553 -0
- package/docs/services/cloudformation/README.md +16 -6
- package/docs/services/cloudwatch/README.md +159 -3
- package/docs/services/cognito/README.md +370 -7
- package/docs/services/lambda/README.md +28 -0
- package/docs/services/logs/README.md +284 -3
- package/docs/services/s3/README.md +463 -20
- package/docs/services/scheduler/README.md +48 -9
- package/docs/services/ses/README.md +164 -41
- package/docs/services/sqs/README.md +47 -10
- package/llms.txt +1 -0
- package/package.json +7 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { simS3LifecycleReached, simS3ObjectExpiryInstant, simS3UploadAbortInstant, } from "./sim-s3-lifecycle-expiry.js";
|
|
1
|
+
import { simS3LifecycleReached, simS3NoncurrentExpiryInstant, simS3ObjectExpiryInstant, simS3UploadAbortInstant, } from "./sim-s3-lifecycle-expiry.js";
|
|
2
2
|
import { simS3LifecycleRuleSelects } from "./sim-s3-lifecycle-selection.js";
|
|
3
3
|
/**
|
|
4
4
|
* The lifecycle configuration of one simulated S3 Bucket.
|
|
@@ -64,6 +64,36 @@ export class SimS3LifecycleConfiguration {
|
|
|
64
64
|
simS3LifecycleRuleSelects(rule, object) &&
|
|
65
65
|
simS3LifecycleReached(simS3ObjectExpiryInstant(rule.Expiration, object.lastModified), now));
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Whether an enabled rule has expired a noncurrent version by the given
|
|
69
|
+
* instant.
|
|
70
|
+
*
|
|
71
|
+
* `NewerNoncurrentVersions` holds that many of the most recent noncurrent
|
|
72
|
+
* versions back from the rule, whatever their age, so a rule keeping two
|
|
73
|
+
* reaches the third and everything older.
|
|
74
|
+
*/
|
|
75
|
+
expiresNoncurrent(version, now) {
|
|
76
|
+
return this.enabledRules().some((rule) => {
|
|
77
|
+
const expiration = rule.NoncurrentVersionExpiration;
|
|
78
|
+
return (expiration !== undefined &&
|
|
79
|
+
version.newerVersionsAhead >=
|
|
80
|
+
(expiration.NewerNoncurrentVersions ?? 0) &&
|
|
81
|
+
simS3LifecycleRuleSelects(rule, version) &&
|
|
82
|
+
simS3LifecycleReached(simS3NoncurrentExpiryInstant(expiration, version.noncurrentSince), now));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Whether an enabled rule removes a delete marker with nothing left under
|
|
87
|
+
* it.
|
|
88
|
+
*
|
|
89
|
+
* Real S3 calls that an expired object delete marker and takes it away on
|
|
90
|
+
* its next pass, with no period to wait out. The marker is what keeps the
|
|
91
|
+
* key in a listing once its last version has gone.
|
|
92
|
+
*/
|
|
93
|
+
expiresDeleteMarker(key) {
|
|
94
|
+
return this.enabledRules().some((rule) => rule.Expiration?.ExpiredObjectDeleteMarker === true &&
|
|
95
|
+
simS3LifecycleRuleSelects(rule, { key }));
|
|
96
|
+
}
|
|
67
97
|
/**
|
|
68
98
|
* Whether an enabled rule has abandoned a multipart upload by the given
|
|
69
99
|
* instant.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SimS3LifecycleAbortIncompleteMultipartUpload, SimS3LifecycleExpiration } from "../../command/put-bucket-lifecycle-configuration/put-bucket-lifecycle-configuration.command.js";
|
|
1
|
+
import type { SimS3LifecycleAbortIncompleteMultipartUpload, SimS3LifecycleExpiration, SimS3LifecycleNoncurrentVersionExpiration } from "../../command/put-bucket-lifecycle-configuration/put-bucket-lifecycle-configuration.command.js";
|
|
2
2
|
/**
|
|
3
3
|
* The instant an `Expiration` puts an Object written at a given time past.
|
|
4
4
|
*
|
|
@@ -9,9 +9,20 @@ import type { SimS3LifecycleAbortIncompleteMultipartUpload, SimS3LifecycleExpira
|
|
|
9
9
|
*
|
|
10
10
|
* `Days` wins over `Date` when a rule carries both, though real S3 refuses to
|
|
11
11
|
* store such a rule. An `Expiration` carrying only `ExpiredObjectDeleteMarker`
|
|
12
|
-
* has no boundary at all,
|
|
12
|
+
* has no boundary at all, because it names a delete marker to remove rather
|
|
13
|
+
* than a period to wait out.
|
|
13
14
|
*/
|
|
14
15
|
export declare function simS3ObjectExpiryInstant(expiration: SimS3LifecycleExpiration, writtenAt: Date): Date | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The instant a `NoncurrentVersionExpiration` puts a version past, counted
|
|
18
|
+
* from when that version stopped being the current one.
|
|
19
|
+
*
|
|
20
|
+
* A version that is still current has no such instant, and neither has one
|
|
21
|
+
* under a rule stating only `NewerNoncurrentVersions`. Real S3 requires
|
|
22
|
+
* `NoncurrentDays` alongside that count, and a rule without it names no period
|
|
23
|
+
* to measure.
|
|
24
|
+
*/
|
|
25
|
+
export declare function simS3NoncurrentExpiryInstant(expiration: SimS3LifecycleNoncurrentVersionExpiration, noncurrentSince: Date | undefined): Date | undefined;
|
|
15
26
|
/**
|
|
16
27
|
* The instant an `AbortIncompleteMultipartUpload` abandons an upload started
|
|
17
28
|
* at a given time.
|
|
@@ -9,7 +9,8 @@ const millisecondsPerDay = 24 * 60 * 60 * 1000;
|
|
|
9
9
|
*
|
|
10
10
|
* `Days` wins over `Date` when a rule carries both, though real S3 refuses to
|
|
11
11
|
* store such a rule. An `Expiration` carrying only `ExpiredObjectDeleteMarker`
|
|
12
|
-
* has no boundary at all,
|
|
12
|
+
* has no boundary at all, because it names a delete marker to remove rather
|
|
13
|
+
* than a period to wait out.
|
|
13
14
|
*/
|
|
14
15
|
export function simS3ObjectExpiryInstant(expiration, writtenAt) {
|
|
15
16
|
if (expiration.Days !== undefined) {
|
|
@@ -20,6 +21,22 @@ export function simS3ObjectExpiryInstant(expiration, writtenAt) {
|
|
|
20
21
|
}
|
|
21
22
|
return undefined;
|
|
22
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The instant a `NoncurrentVersionExpiration` puts a version past, counted
|
|
26
|
+
* from when that version stopped being the current one.
|
|
27
|
+
*
|
|
28
|
+
* A version that is still current has no such instant, and neither has one
|
|
29
|
+
* under a rule stating only `NewerNoncurrentVersions`. Real S3 requires
|
|
30
|
+
* `NoncurrentDays` alongside that count, and a rule without it names no period
|
|
31
|
+
* to measure.
|
|
32
|
+
*/
|
|
33
|
+
export function simS3NoncurrentExpiryInstant(expiration, noncurrentSince) {
|
|
34
|
+
if (noncurrentSince === undefined ||
|
|
35
|
+
expiration.NoncurrentDays === undefined) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return afterDays(noncurrentSince, expiration.NoncurrentDays);
|
|
39
|
+
}
|
|
23
40
|
/**
|
|
24
41
|
* The instant an `AbortIncompleteMultipartUpload` abandons an upload started
|
|
25
42
|
* at a given time.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SimS3Object } from "../../object/s3-object.js";
|
|
2
2
|
import type { SimS3BucketStorage } from "../../storage/s3-bucket-storage.js";
|
|
3
|
+
import type { SimS3BucketVersions } from "../versioning/sim-s3-bucket-versions.js";
|
|
3
4
|
import type { SimS3LifecycleConfiguration } from "./sim-s3-lifecycle-configuration.js";
|
|
4
5
|
/**
|
|
5
6
|
* One pass over what a Bucket's lifecycle rules have expired.
|
|
@@ -15,12 +16,19 @@ import type { SimS3LifecycleConfiguration } from "./sim-s3-lifecycle-configurati
|
|
|
15
16
|
*
|
|
16
17
|
* Nothing is announced. Real S3 raises `s3:LifecycleExpiration:Delete` for an
|
|
17
18
|
* expiry, and that event family is among the ones simulated S3 leaves out.
|
|
19
|
+
*
|
|
20
|
+
* What an expiry does depends on whether the Bucket keeps versions. Real S3
|
|
21
|
+
* expires the current version of a key on a versioned Bucket by writing a
|
|
22
|
+
* delete marker over it, leaving the version itself for a
|
|
23
|
+
* `NoncurrentVersionExpiration` rule to remove later, so that is what happens
|
|
24
|
+
* here too. A Bucket keeping no versions loses the Object outright.
|
|
18
25
|
*/
|
|
19
26
|
export declare class SimS3LifecycleSweep {
|
|
20
27
|
private readonly storage;
|
|
21
28
|
private readonly lifecycle;
|
|
22
29
|
private readonly now;
|
|
23
|
-
|
|
30
|
+
private readonly versions;
|
|
31
|
+
constructor(storage: SimS3BucketStorage, lifecycle: SimS3LifecycleConfiguration, now: Date, versions: SimS3BucketVersions);
|
|
24
32
|
/**
|
|
25
33
|
* Remove one Object if the rules have expired it.
|
|
26
34
|
*
|
|
@@ -33,5 +41,13 @@ export declare class SimS3LifecycleSweep {
|
|
|
33
41
|
* ones still there.
|
|
34
42
|
*/
|
|
35
43
|
objects(objects: readonly SimS3Object[]): Promise<SimS3Object[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Take one expired key out of what a read of the Bucket can see.
|
|
46
|
+
*
|
|
47
|
+
* A versioned Bucket keeps the bytes and hides them behind a marker, which
|
|
48
|
+
* is what leaves the version there for `NoncurrentVersionExpiration` to
|
|
49
|
+
* find. Everything else loses the Object.
|
|
50
|
+
*/
|
|
51
|
+
private expire;
|
|
36
52
|
private expires;
|
|
37
53
|
}
|
|
@@ -12,15 +12,23 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Nothing is announced. Real S3 raises `s3:LifecycleExpiration:Delete` for an
|
|
14
14
|
* expiry, and that event family is among the ones simulated S3 leaves out.
|
|
15
|
+
*
|
|
16
|
+
* What an expiry does depends on whether the Bucket keeps versions. Real S3
|
|
17
|
+
* expires the current version of a key on a versioned Bucket by writing a
|
|
18
|
+
* delete marker over it, leaving the version itself for a
|
|
19
|
+
* `NoncurrentVersionExpiration` rule to remove later, so that is what happens
|
|
20
|
+
* here too. A Bucket keeping no versions loses the Object outright.
|
|
15
21
|
*/
|
|
16
22
|
export class SimS3LifecycleSweep {
|
|
17
23
|
storage;
|
|
18
24
|
lifecycle;
|
|
19
25
|
now;
|
|
20
|
-
|
|
26
|
+
versions;
|
|
27
|
+
constructor(storage, lifecycle, now, versions) {
|
|
21
28
|
this.storage = storage;
|
|
22
29
|
this.lifecycle = lifecycle;
|
|
23
30
|
this.now = now;
|
|
31
|
+
this.versions = versions;
|
|
24
32
|
}
|
|
25
33
|
/**
|
|
26
34
|
* Remove one Object if the rules have expired it.
|
|
@@ -32,7 +40,7 @@ export class SimS3LifecycleSweep {
|
|
|
32
40
|
if (object === undefined || !this.expires(object)) {
|
|
33
41
|
return object;
|
|
34
42
|
}
|
|
35
|
-
await this.
|
|
43
|
+
await this.expire(object.key);
|
|
36
44
|
return undefined;
|
|
37
45
|
}
|
|
38
46
|
/**
|
|
@@ -44,9 +52,25 @@ export class SimS3LifecycleSweep {
|
|
|
44
52
|
return [...objects];
|
|
45
53
|
}
|
|
46
54
|
const expiredKeys = new Set(objects.filter((object) => this.expires(object)).map(({ key }) => key));
|
|
47
|
-
await Promise.all(expiredKeys.values().map(async (key) =>
|
|
55
|
+
await Promise.all(expiredKeys.values().map(async (key) => {
|
|
56
|
+
await this.expire(key);
|
|
57
|
+
}));
|
|
48
58
|
return objects.filter((object) => !expiredKeys.has(object.key));
|
|
49
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Take one expired key out of what a read of the Bucket can see.
|
|
62
|
+
*
|
|
63
|
+
* A versioned Bucket keeps the bytes and hides them behind a marker, which
|
|
64
|
+
* is what leaves the version there for `NoncurrentVersionExpiration` to
|
|
65
|
+
* find. Everything else loses the Object.
|
|
66
|
+
*/
|
|
67
|
+
async expire(key) {
|
|
68
|
+
if (this.versions.keepsVersions) {
|
|
69
|
+
await this.versions.markDeleted(this.storage, key, this.now);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
await this.storage.deleteObject(key);
|
|
73
|
+
}
|
|
50
74
|
expires(object) {
|
|
51
75
|
return (!this.lifecycle.isEmpty &&
|
|
52
76
|
this.lifecycle.expires(lifecycleObject(object), this.now));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SimS3BucketVersions } from "../versioning/sim-s3-bucket-versions.js";
|
|
2
|
+
import type { SimS3LifecycleConfiguration } from "./sim-s3-lifecycle-configuration.js";
|
|
3
|
+
/**
|
|
4
|
+
* One pass over what a Bucket's rules have expired in its version history.
|
|
5
|
+
*
|
|
6
|
+
* The Object sweep works on storage, which holds the current Object under each
|
|
7
|
+
* key and nothing else. Everything a `NoncurrentVersionExpiration` reaches is
|
|
8
|
+
* therefore invisible to it, and so is the delete marker an
|
|
9
|
+
* `ExpiredObjectDeleteMarker` removes. Both live in the history alone, which
|
|
10
|
+
* is why removing them touches no storage and this pass is synchronous where
|
|
11
|
+
* the Object sweep cannot be.
|
|
12
|
+
*
|
|
13
|
+
* A Bucket is swept when its versions are read, the way an Object is swept
|
|
14
|
+
* when it is. Nothing runs on a schedule.
|
|
15
|
+
*/
|
|
16
|
+
export declare class SimS3NoncurrentSweep {
|
|
17
|
+
private readonly lifecycle;
|
|
18
|
+
private readonly now;
|
|
19
|
+
constructor(lifecycle: SimS3LifecycleConfiguration, now: Date);
|
|
20
|
+
/**
|
|
21
|
+
* Remove what the rules have expired from a Bucket's history.
|
|
22
|
+
*/
|
|
23
|
+
sweep(versions: SimS3BucketVersions): void;
|
|
24
|
+
/**
|
|
25
|
+
* Remove what the rules have expired of one key.
|
|
26
|
+
*
|
|
27
|
+
* The noncurrent versions go first and a delete marker left bare goes
|
|
28
|
+
* second, so a marker whose last version went in this same pass goes with
|
|
29
|
+
* it. Real S3 orders the two the same way.
|
|
30
|
+
*
|
|
31
|
+
* The head of the list is the current version and no rule for noncurrent
|
|
32
|
+
* ones reaches it, however old it is. Everything after it is counted from
|
|
33
|
+
* the newest, which is the count `NewerNoncurrentVersions` holds back.
|
|
34
|
+
*/
|
|
35
|
+
private sweepKey;
|
|
36
|
+
/**
|
|
37
|
+
* Remove a delete marker the rules have expired, which is one left with no
|
|
38
|
+
* version under it at all.
|
|
39
|
+
*
|
|
40
|
+
* That takes the key out of `ListObjectVersions` altogether, since the
|
|
41
|
+
* marker was the only thing left holding the key there.
|
|
42
|
+
*/
|
|
43
|
+
private sweepDeleteMarker;
|
|
44
|
+
private expires;
|
|
45
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One pass over what a Bucket's rules have expired in its version history.
|
|
3
|
+
*
|
|
4
|
+
* The Object sweep works on storage, which holds the current Object under each
|
|
5
|
+
* key and nothing else. Everything a `NoncurrentVersionExpiration` reaches is
|
|
6
|
+
* therefore invisible to it, and so is the delete marker an
|
|
7
|
+
* `ExpiredObjectDeleteMarker` removes. Both live in the history alone, which
|
|
8
|
+
* is why removing them touches no storage and this pass is synchronous where
|
|
9
|
+
* the Object sweep cannot be.
|
|
10
|
+
*
|
|
11
|
+
* A Bucket is swept when its versions are read, the way an Object is swept
|
|
12
|
+
* when it is. Nothing runs on a schedule.
|
|
13
|
+
*/
|
|
14
|
+
export class SimS3NoncurrentSweep {
|
|
15
|
+
lifecycle;
|
|
16
|
+
now;
|
|
17
|
+
constructor(lifecycle, now) {
|
|
18
|
+
this.lifecycle = lifecycle;
|
|
19
|
+
this.now = now;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Remove what the rules have expired from a Bucket's history.
|
|
23
|
+
*/
|
|
24
|
+
sweep(versions) {
|
|
25
|
+
if (this.lifecycle.isEmpty || !versions.keepsVersions) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
for (const held of byKey(versions.list()).values()) {
|
|
29
|
+
this.sweepKey(versions, held);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Remove what the rules have expired of one key.
|
|
34
|
+
*
|
|
35
|
+
* The noncurrent versions go first and a delete marker left bare goes
|
|
36
|
+
* second, so a marker whose last version went in this same pass goes with
|
|
37
|
+
* it. Real S3 orders the two the same way.
|
|
38
|
+
*
|
|
39
|
+
* The head of the list is the current version and no rule for noncurrent
|
|
40
|
+
* ones reaches it, however old it is. Everything after it is counted from
|
|
41
|
+
* the newest, which is the count `NewerNoncurrentVersions` holds back.
|
|
42
|
+
*/
|
|
43
|
+
sweepKey(versions, held) {
|
|
44
|
+
const kept = [];
|
|
45
|
+
for (const [index, version] of held.entries()) {
|
|
46
|
+
if (index === 0 || !this.expires(version, index - 1)) {
|
|
47
|
+
kept.push(version);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
versions.removeExpired(version.key, version.versionId);
|
|
51
|
+
}
|
|
52
|
+
this.sweepDeleteMarker(versions, kept);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Remove a delete marker the rules have expired, which is one left with no
|
|
56
|
+
* version under it at all.
|
|
57
|
+
*
|
|
58
|
+
* That takes the key out of `ListObjectVersions` altogether, since the
|
|
59
|
+
* marker was the only thing left holding the key there.
|
|
60
|
+
*/
|
|
61
|
+
sweepDeleteMarker(versions, kept) {
|
|
62
|
+
const marker = kept[0];
|
|
63
|
+
if (kept.length === 1 &&
|
|
64
|
+
marker?.isDeleteMarker === true &&
|
|
65
|
+
this.lifecycle.expiresDeleteMarker(marker.key)) {
|
|
66
|
+
versions.removeExpired(marker.key, marker.versionId);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
expires(version, ahead) {
|
|
70
|
+
return this.lifecycle.expiresNoncurrent({
|
|
71
|
+
key: version.key,
|
|
72
|
+
size: version.isDeleteMarker ? 0 : version.object.body.length,
|
|
73
|
+
noncurrentSince: version.noncurrentSince,
|
|
74
|
+
newerVersionsAhead: ahead,
|
|
75
|
+
}, this.now);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The versions of one Bucket, gathered under the key each belongs to.
|
|
80
|
+
*
|
|
81
|
+
* A listing already holds each key's versions together and newest first, so
|
|
82
|
+
* this keeps that order and only groups them.
|
|
83
|
+
*/
|
|
84
|
+
function byKey(listed) {
|
|
85
|
+
const grouped = new Map();
|
|
86
|
+
for (const version of listed) {
|
|
87
|
+
grouped.set(version.key, [...(grouped.get(version.key) ?? []), version]);
|
|
88
|
+
}
|
|
89
|
+
return grouped;
|
|
90
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SimS3ObjectVersion } from "../versioning/sim-s3-object-version.js";
|
|
2
|
+
import type { SimS3ObjectLockConfiguration } from "./sim-s3-object-lock-configuration.js";
|
|
3
|
+
/**
|
|
4
|
+
* The Object Lock of one simulated S3 Bucket.
|
|
5
|
+
*
|
|
6
|
+
* It holds the configuration and applies it, which is two jobs a Bucket needs
|
|
7
|
+
* doing in two different places. A write asks it what retention the new
|
|
8
|
+
* version starts with, and a delete asks it whether the version may go.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SimS3BucketObjectLock {
|
|
11
|
+
private locking;
|
|
12
|
+
/** How this Bucket is locked, or nothing where it has never been. */
|
|
13
|
+
get configuration(): SimS3ObjectLockConfiguration | undefined;
|
|
14
|
+
/** Whether Object Lock is on. */
|
|
15
|
+
get isEnabled(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Turn Object Lock on, or replace the default retention it carries.
|
|
18
|
+
*
|
|
19
|
+
* Real S3 has no request that turns it off, so this only ever arrives at a
|
|
20
|
+
* configuration with it on.
|
|
21
|
+
*/
|
|
22
|
+
configure(configuration: SimS3ObjectLockConfiguration): void;
|
|
23
|
+
/**
|
|
24
|
+
* Give a newly written version the Bucket's default retention, if it has
|
|
25
|
+
* one, and hand the version back.
|
|
26
|
+
*
|
|
27
|
+
* The period is counted from the write, so two versions of one key written a
|
|
28
|
+
* day apart are retained until two different instants. A Bucket keeping no
|
|
29
|
+
* versions wrote none, and gets nothing back.
|
|
30
|
+
*/
|
|
31
|
+
withDefaultRetention(version: SimS3ObjectVersion | undefined, writtenAt: Date): SimS3ObjectVersion | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Refuse a delete Object Lock is holding a version against.
|
|
34
|
+
*
|
|
35
|
+
* Real S3 answers this with `AccessDenied`, the same code it answers a
|
|
36
|
+
* caller with no permission with. The reason says which of the two things
|
|
37
|
+
* holding the version is doing it, since a legal hold and a retention period
|
|
38
|
+
* are got past in different ways. A version that is not there is held
|
|
39
|
+
* against nothing, and the delete goes on to report it missing.
|
|
40
|
+
*/
|
|
41
|
+
assertDeletable(version: SimS3ObjectVersion | undefined, instant: Date, bypassed: boolean): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SimS3AccessDenied } from "../../error/sim-s3.error.js";
|
|
2
|
+
/**
|
|
3
|
+
* The Object Lock of one simulated S3 Bucket.
|
|
4
|
+
*
|
|
5
|
+
* It holds the configuration and applies it, which is two jobs a Bucket needs
|
|
6
|
+
* doing in two different places. A write asks it what retention the new
|
|
7
|
+
* version starts with, and a delete asks it whether the version may go.
|
|
8
|
+
*/
|
|
9
|
+
export class SimS3BucketObjectLock {
|
|
10
|
+
locking;
|
|
11
|
+
/** How this Bucket is locked, or nothing where it has never been. */
|
|
12
|
+
get configuration() {
|
|
13
|
+
return this.locking;
|
|
14
|
+
}
|
|
15
|
+
/** Whether Object Lock is on. */
|
|
16
|
+
get isEnabled() {
|
|
17
|
+
return this.locking !== undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Turn Object Lock on, or replace the default retention it carries.
|
|
21
|
+
*
|
|
22
|
+
* Real S3 has no request that turns it off, so this only ever arrives at a
|
|
23
|
+
* configuration with it on.
|
|
24
|
+
*/
|
|
25
|
+
configure(configuration) {
|
|
26
|
+
this.locking = configuration;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Give a newly written version the Bucket's default retention, if it has
|
|
30
|
+
* one, and hand the version back.
|
|
31
|
+
*
|
|
32
|
+
* The period is counted from the write, so two versions of one key written a
|
|
33
|
+
* day apart are retained until two different instants. A Bucket keeping no
|
|
34
|
+
* versions wrote none, and gets nothing back.
|
|
35
|
+
*/
|
|
36
|
+
withDefaultRetention(version, writtenAt) {
|
|
37
|
+
const retention = this.locking?.retentionAt(writtenAt);
|
|
38
|
+
if (version !== undefined && retention !== undefined) {
|
|
39
|
+
version.lock.setDefaultRetention(retention);
|
|
40
|
+
}
|
|
41
|
+
return version;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Refuse a delete Object Lock is holding a version against.
|
|
45
|
+
*
|
|
46
|
+
* Real S3 answers this with `AccessDenied`, the same code it answers a
|
|
47
|
+
* caller with no permission with. The reason says which of the two things
|
|
48
|
+
* holding the version is doing it, since a legal hold and a retention period
|
|
49
|
+
* are got past in different ways. A version that is not there is held
|
|
50
|
+
* against nothing, and the delete goes on to report it missing.
|
|
51
|
+
*/
|
|
52
|
+
assertDeletable(version, instant, bypassed) {
|
|
53
|
+
const refusal = version?.lock.refusesDeleteAt(instant, bypassed);
|
|
54
|
+
if (version !== undefined && refusal !== undefined) {
|
|
55
|
+
throw new SimS3AccessDenied(`Version ${version.versionId} of S3 Object ${version.key} cannot be ` +
|
|
56
|
+
`deleted because ${refusal}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the mode of a default retention, refusing one real S3 refuses.
|
|
3
|
+
*
|
|
4
|
+
* The same two modes a per-version retention takes. They are read here rather
|
|
5
|
+
* than through `SimS3ObjectRetention.parse`, because a default carries a
|
|
6
|
+
* length where a retention carries an instant.
|
|
7
|
+
*/
|
|
8
|
+
export declare function simS3RetentionMode(mode: string | undefined): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SimS3InvalidRequest } from "../../error/sim-s3.error.js";
|
|
2
|
+
import { simS3ComplianceMode, simS3GovernanceMode, simS3RetentionModeNames, } from "./sim-s3-object-retention.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read the mode of a default retention, refusing one real S3 refuses.
|
|
5
|
+
*
|
|
6
|
+
* The same two modes a per-version retention takes. They are read here rather
|
|
7
|
+
* than through `SimS3ObjectRetention.parse`, because a default carries a
|
|
8
|
+
* length where a retention carries an instant.
|
|
9
|
+
*/
|
|
10
|
+
export function simS3RetentionMode(mode) {
|
|
11
|
+
if (mode === simS3GovernanceMode || mode === simS3ComplianceMode) {
|
|
12
|
+
return mode;
|
|
13
|
+
}
|
|
14
|
+
throw new SimS3InvalidRequest(`Object Lock DefaultRetention Mode has to be ${simS3RetentionModeNames}`);
|
|
15
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SimS3ObjectRetention } from "./sim-s3-object-retention.js";
|
|
2
|
+
/** The one value `ObjectLockEnabled` takes. Real S3 has no way to turn it off. */
|
|
3
|
+
export declare const simS3ObjectLockEnabled = "Enabled";
|
|
4
|
+
/**
|
|
5
|
+
* Structural shape of an S3 ObjectLockConfiguration.
|
|
6
|
+
*
|
|
7
|
+
* Matches the AWS SDK and CloudFormation property shape, so the same object
|
|
8
|
+
* can come from either.
|
|
9
|
+
*/
|
|
10
|
+
export interface SimS3ObjectLockConfigurationInput {
|
|
11
|
+
readonly ObjectLockEnabled?: string | undefined;
|
|
12
|
+
readonly Rule?: {
|
|
13
|
+
readonly DefaultRetention?: {
|
|
14
|
+
readonly Mode?: string | undefined;
|
|
15
|
+
readonly Days?: number | undefined;
|
|
16
|
+
readonly Years?: number | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* How one simulated S3 Bucket is locked, and for how long by default.
|
|
22
|
+
*
|
|
23
|
+
* A Bucket either has Object Lock turned on or has never had it. Real S3 has
|
|
24
|
+
* no request that turns it off again, which is what lets a reader's history be
|
|
25
|
+
* promised rather than merely configured.
|
|
26
|
+
*
|
|
27
|
+
* The default retention is optional. A Bucket with Object Lock on and no
|
|
28
|
+
* default locks nothing on its own, and every version it holds is retained
|
|
29
|
+
* only by the requests that name it. A Bucket with one retains every version
|
|
30
|
+
* written after it, counted from the write.
|
|
31
|
+
*/
|
|
32
|
+
export declare class SimS3ObjectLockConfiguration {
|
|
33
|
+
private readonly defaults;
|
|
34
|
+
private constructor();
|
|
35
|
+
/**
|
|
36
|
+
* Read a configuration a request is setting, refusing one real S3 refuses.
|
|
37
|
+
*/
|
|
38
|
+
static parse(input: SimS3ObjectLockConfigurationInput): SimS3ObjectLockConfiguration;
|
|
39
|
+
/**
|
|
40
|
+
* The retention a version written at an instant is given.
|
|
41
|
+
*
|
|
42
|
+
* Real S3 counts a default retention from the write rather than from the
|
|
43
|
+
* configuration, so two versions of one key written a day apart are retained
|
|
44
|
+
* until two different instants.
|
|
45
|
+
*/
|
|
46
|
+
retentionAt(instant: Date): SimS3ObjectRetention | undefined;
|
|
47
|
+
/** What GetObjectLockConfiguration answers with. */
|
|
48
|
+
get reported(): SimS3ObjectLockConfigurationInput;
|
|
49
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { SimS3InvalidRequest } from "../../error/sim-s3.error.js";
|
|
2
|
+
import { SimS3ObjectRetention } from "./sim-s3-object-retention.js";
|
|
3
|
+
import { simS3RetentionMode } from "./sim-s3-default-retention.js";
|
|
4
|
+
const millisecondsPerDay = 86_400_000;
|
|
5
|
+
const daysPerYear = 365;
|
|
6
|
+
/**
|
|
7
|
+
* The longest default retention real S3 takes, which is a hundred years.
|
|
8
|
+
*
|
|
9
|
+
* An unbounded one would compute a `RetainUntilDate` past the range a
|
|
10
|
+
* JavaScript Date holds, and a version retained until an instant that reads
|
|
11
|
+
* back as `NaN` is a version nothing is holding at all.
|
|
12
|
+
*/
|
|
13
|
+
const maximumRetentionDays = 100 * daysPerYear;
|
|
14
|
+
/** The one value `ObjectLockEnabled` takes. Real S3 has no way to turn it off. */
|
|
15
|
+
export const simS3ObjectLockEnabled = "Enabled";
|
|
16
|
+
/**
|
|
17
|
+
* How one simulated S3 Bucket is locked, and for how long by default.
|
|
18
|
+
*
|
|
19
|
+
* A Bucket either has Object Lock turned on or has never had it. Real S3 has
|
|
20
|
+
* no request that turns it off again, which is what lets a reader's history be
|
|
21
|
+
* promised rather than merely configured.
|
|
22
|
+
*
|
|
23
|
+
* The default retention is optional. A Bucket with Object Lock on and no
|
|
24
|
+
* default locks nothing on its own, and every version it holds is retained
|
|
25
|
+
* only by the requests that name it. A Bucket with one retains every version
|
|
26
|
+
* written after it, counted from the write.
|
|
27
|
+
*/
|
|
28
|
+
export class SimS3ObjectLockConfiguration {
|
|
29
|
+
defaults;
|
|
30
|
+
constructor(defaults) {
|
|
31
|
+
this.defaults = defaults;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Read a configuration a request is setting, refusing one real S3 refuses.
|
|
35
|
+
*/
|
|
36
|
+
static parse(input) {
|
|
37
|
+
if (input.ObjectLockEnabled !== simS3ObjectLockEnabled) {
|
|
38
|
+
throw new SimS3InvalidRequest(`ObjectLockEnabled has to be ${simS3ObjectLockEnabled}`);
|
|
39
|
+
}
|
|
40
|
+
const declared = input.Rule?.DefaultRetention;
|
|
41
|
+
if (declared === undefined) {
|
|
42
|
+
return new SimS3ObjectLockConfiguration();
|
|
43
|
+
}
|
|
44
|
+
return new SimS3ObjectLockConfiguration({
|
|
45
|
+
mode: simS3RetentionMode(declared.Mode),
|
|
46
|
+
days: simS3DefaultRetentionDays(declared),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The retention a version written at an instant is given.
|
|
51
|
+
*
|
|
52
|
+
* Real S3 counts a default retention from the write rather than from the
|
|
53
|
+
* configuration, so two versions of one key written a day apart are retained
|
|
54
|
+
* until two different instants.
|
|
55
|
+
*/
|
|
56
|
+
retentionAt(instant) {
|
|
57
|
+
const defaults = this.defaults;
|
|
58
|
+
if (defaults === undefined) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
return new SimS3ObjectRetention({
|
|
62
|
+
mode: defaults.mode,
|
|
63
|
+
retainUntil: new Date(instant.getTime() + defaults.days * millisecondsPerDay),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** What GetObjectLockConfiguration answers with. */
|
|
67
|
+
get reported() {
|
|
68
|
+
const defaults = this.defaults;
|
|
69
|
+
return {
|
|
70
|
+
ObjectLockEnabled: simS3ObjectLockEnabled,
|
|
71
|
+
...(defaults !== undefined && {
|
|
72
|
+
Rule: {
|
|
73
|
+
DefaultRetention: { Mode: defaults.mode, Days: defaults.days },
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The length of a default retention, in days.
|
|
81
|
+
*
|
|
82
|
+
* Real S3 takes it as either `Days` or `Years` and refuses both together. A
|
|
83
|
+
* year is 365 days here, which is what S3 documents its own arithmetic as.
|
|
84
|
+
*/
|
|
85
|
+
function simS3DefaultRetentionDays(declared) {
|
|
86
|
+
const { Days, Years } = declared;
|
|
87
|
+
if ((Days === undefined) === (Years === undefined)) {
|
|
88
|
+
throw new SimS3InvalidRequest("Object Lock DefaultRetention requires either Days or Years, and " +
|
|
89
|
+
"refuses both together");
|
|
90
|
+
}
|
|
91
|
+
const period = Days ?? Years;
|
|
92
|
+
if (period === undefined || period < 1 || !Number.isSafeInteger(period)) {
|
|
93
|
+
throw new SimS3InvalidRequest(`Object Lock DefaultRetention period ${String(period)} has to be a ` +
|
|
94
|
+
`whole number of at least 1`);
|
|
95
|
+
}
|
|
96
|
+
const days = Days === undefined ? period * daysPerYear : period;
|
|
97
|
+
if (days > maximumRetentionDays) {
|
|
98
|
+
throw new SimS3InvalidRequest(`Object Lock DefaultRetention period ${String(period)} is longer than ` +
|
|
99
|
+
`the hundred years real S3 retains a version for`);
|
|
100
|
+
}
|
|
101
|
+
return days;
|
|
102
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a read of an Object says about the Object Lock holding it.
|
|
3
|
+
*
|
|
4
|
+
* `GetObject` and `HeadObject` both report these, and a version nothing is
|
|
5
|
+
* holding leaves all three out rather than reporting them empty.
|
|
6
|
+
*/
|
|
7
|
+
export interface SimS3ObjectLockOutput {
|
|
8
|
+
/** The mode of the retention period on the version, if it has one. */
|
|
9
|
+
readonly ObjectLockMode?: string;
|
|
10
|
+
/** When that period lapses. */
|
|
11
|
+
readonly ObjectLockRetainUntilDate?: Date;
|
|
12
|
+
/** `ON` while a legal hold is on the version, and absent otherwise. */
|
|
13
|
+
readonly ObjectLockLegalHoldStatus?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|