@bitblit/ratchet-aws 4.0.99-alpha → 4.0.102-alpha
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/{types/batch → batch}/aws-batch-background-processor.d.ts +1 -5
- package/dist/{es/batch → batch}/aws-batch-background-processor.js +6 -1
- package/dist/batch/aws-batch-background-processor.spec.js +15 -0
- package/dist/{types/batch → batch}/aws-batch-ratchet.d.ts +0 -3
- package/dist/{es/batch → batch}/aws-batch-ratchet.js +5 -1
- package/dist/batch/aws-batch-ratchet.spec.js +33 -0
- package/dist/{types/build → build}/ratchet-aws-info.d.ts +1 -1
- package/dist/{types/cache → cache}/dynamo-db-storage-provider.d.ts +3 -3
- package/dist/{es/cache → cache}/dynamo-db-storage-provider.js +3 -1
- package/dist/{types/cache → cache}/s3-storage-provider.d.ts +3 -3
- package/dist/{es/cache → cache}/s3-storage-provider.js +4 -1
- package/dist/{types/cache → cache}/simple-cache-storage-provider.d.ts +1 -1
- package/dist/{types/cache → cache}/simple-cache.d.ts +3 -3
- package/dist/{es/cache → cache}/simple-cache.js +4 -2
- package/dist/cache/simple-cache.spec.js +67 -0
- package/dist/{es/cloudwatch → cloudwatch}/cloud-watch-log-group-ratchet.js +4 -2
- package/dist/cloudwatch/cloud-watch-log-group-ratchet.spec.js +19 -0
- package/dist/{es/cloudwatch → cloudwatch}/cloud-watch-logs-ratchet.js +6 -5
- package/dist/cloudwatch/cloud-watch-logs-ratchet.spec.js +84 -0
- package/dist/{types/cloudwatch → cloudwatch}/cloud-watch-metrics-ratchet.d.ts +3 -3
- package/dist/{es/cloudwatch → cloudwatch}/cloud-watch-metrics-ratchet.js +3 -2
- package/dist/cloudwatch/cloud-watch-metrics-ratchet.spec.js +23 -0
- package/dist/{types/daemon → daemon}/daemon-like.d.ts +3 -3
- package/dist/{types/daemon → daemon}/daemon-process-state-public-token.d.ts +1 -1
- package/dist/{types/daemon → daemon}/daemon-util.d.ts +5 -11
- package/dist/{es/daemon → daemon}/daemon-util.js +3 -3
- package/dist/daemon/daemon-util.spec.d.ts +4 -0
- package/dist/daemon/daemon-util.spec.js +79 -0
- package/dist/{types/daemon → daemon}/daemon.d.ts +5 -5
- package/dist/{es/daemon → daemon}/daemon.js +12 -6
- package/dist/{types/dao → dao}/prototype-dao-provider.d.ts +1 -1
- package/dist/{types/dao → dao}/prototype-dao.d.ts +2 -2
- package/dist/{es/dao → dao}/prototype-dao.js +13 -9
- package/dist/dao/prototype-dao.spec.d.ts +8 -0
- package/dist/dao/prototype-dao.spec.js +26 -0
- package/dist/{types/dao → dao}/s3-prototype-dao-provider.d.ts +3 -3
- package/dist/{es/dao → dao}/s3-prototype-dao-provider.js +3 -1
- package/dist/{types/dao → dao}/s3-simple-dao.d.ts +2 -2
- package/dist/{es/dao → dao}/s3-simple-dao.js +4 -2
- package/dist/{types/dynamodb → dynamodb}/dynamo-ratchet-like.d.ts +3 -3
- package/dist/{types/dynamodb → dynamodb}/dynamo-ratchet.d.ts +4 -4
- package/dist/{es/dynamodb → dynamodb}/dynamo-ratchet.js +7 -6
- package/dist/dynamodb/dynamo-ratchet.spec.js +156 -0
- package/dist/{es/dynamodb → dynamodb}/dynamo-table-ratchet.js +5 -4
- package/dist/{es/dynamodb → dynamodb}/hash-spreader.js +8 -1
- package/dist/dynamodb/hash-spreader.spec.js +17 -0
- package/dist/{types/ec2 → ec2}/ec2-ratchet.d.ts +0 -11
- package/dist/{es/ec2 → ec2}/ec2-ratchet.js +7 -3
- package/dist/ec2/ec2-ratchet.spec.js +31 -0
- package/dist/{types/environment → environment}/cascade-environment-service-provider.d.ts +1 -4
- package/dist/{es/environment → environment}/cascade-environment-service-provider.js +3 -2
- package/dist/{types/environment → environment}/env-var-environment-service-provider.d.ts +1 -5
- package/dist/{es/environment → environment}/env-var-environment-service-provider.js +5 -4
- package/dist/{types/environment → environment}/environment-service-config.d.ts +0 -3
- package/dist/environment/environment-service-provider.d.ts +3 -0
- package/dist/{types/environment → environment}/environment-service.d.ts +2 -5
- package/dist/{es/environment → environment}/environment-service.js +13 -11
- package/dist/environment/environment-service.spec.js +22 -0
- package/dist/{types/environment → environment}/fixed-environment-service-provider.d.ts +1 -4
- package/dist/{es/environment → environment}/fixed-environment-service-provider.js +3 -2
- package/dist/{types/environment → environment}/s3-environment-service-provider.d.ts +1 -4
- package/dist/{es/environment → environment}/s3-environment-service-provider.js +7 -5
- package/dist/{types/environment → environment}/ssm-environment-service-provider.d.ts +1 -5
- package/dist/{es/environment → environment}/ssm-environment-service-provider.js +9 -6
- package/dist/{types/expiring-code → expiring-code}/dynamo-expiring-code-provider.d.ts +4 -4
- package/dist/{es/expiring-code → expiring-code}/dynamo-expiring-code-provider.js +2 -0
- package/dist/{types/expiring-code → expiring-code}/expiring-code-provider.d.ts +1 -1
- package/dist/{types/expiring-code → expiring-code}/expiring-code-ratchet.d.ts +3 -6
- package/dist/{es/expiring-code → expiring-code}/expiring-code-ratchet.js +3 -2
- package/dist/expiring-code/expiring-code-ratchet.spec.js +7 -0
- package/dist/{types/expiring-code → expiring-code}/s3-expiring-code-provider.d.ts +3 -3
- package/dist/{es/expiring-code → expiring-code}/s3-expiring-code-provider.js +4 -1
- package/dist/expiring-code/s3-expiring-code-provider.spec.js +46 -0
- package/dist/{types/iam → iam}/aws-credentials-ratchet.d.ts +0 -5
- package/dist/{es/iam → iam}/aws-credentials-ratchet.js +2 -1
- package/dist/{es/lambda → lambda}/lambda-event-type-guards.js +1 -1
- package/dist/{types/model → model}/cloud-watch-metrics-minute-level-dynamo-count-request.d.ts +2 -2
- package/dist/model/dynamo/doc-put-item-command-input.js +1 -0
- package/dist/model/dynamo/doc-query-command-input.js +1 -0
- package/dist/model/dynamo/doc-scan-command-input.js +1 -0
- package/dist/model/dynamo/doc-update-item-command-input.js +1 -0
- package/dist/{es/route53 → route53}/route-53-ratchet.js +3 -1
- package/dist/{types/runtime-parameter → runtime-parameter}/cached-stored-runtime-parameter.d.ts +1 -1
- package/dist/runtime-parameter/cached-stored-runtime-parameter.js +1 -0
- package/dist/{types/runtime-parameter → runtime-parameter}/dynamo-runtime-parameter-provider.d.ts +3 -3
- package/dist/{es/runtime-parameter → runtime-parameter}/dynamo-runtime-parameter-provider.js +4 -2
- package/dist/runtime-parameter/dynamo-runtime-parameter-provider.spec.d.ts +1 -0
- package/dist/runtime-parameter/dynamo-runtime-parameter-provider.spec.js +49 -0
- package/dist/{types/runtime-parameter → runtime-parameter}/global-variable-override-runtime-parameter-provider.d.ts +2 -9
- package/dist/{es/runtime-parameter → runtime-parameter}/global-variable-override-runtime-parameter-provider.js +10 -8
- package/dist/runtime-parameter/global-variable-override-runtime-parameter-provider.spec.d.ts +1 -0
- package/dist/runtime-parameter/global-variable-override-runtime-parameter-provider.spec.js +37 -0
- package/dist/{types/runtime-parameter → runtime-parameter}/memory-runtime-parameter-provider.d.ts +2 -6
- package/dist/{es/runtime-parameter → runtime-parameter}/memory-runtime-parameter-provider.js +2 -1
- package/dist/{types/runtime-parameter → runtime-parameter}/runtime-parameter-provider.d.ts +1 -6
- package/dist/runtime-parameter/runtime-parameter-provider.js +1 -0
- package/dist/{types/runtime-parameter → runtime-parameter}/runtime-parameter-ratchet.d.ts +2 -2
- package/dist/{es/runtime-parameter → runtime-parameter}/runtime-parameter-ratchet.js +4 -3
- package/dist/runtime-parameter/runtime-parameter-ratchet.spec.d.ts +1 -0
- package/dist/runtime-parameter/runtime-parameter-ratchet.spec.js +39 -0
- package/dist/runtime-parameter/stored-runtime-parameter.js +1 -0
- package/dist/{types/s3 → s3}/s3-cache-ratchet.d.ts +3 -4
- package/dist/{es/s3 → s3}/s3-cache-ratchet.js +7 -5
- package/dist/s3/s3-cache-ratchet.spec.d.ts +1 -0
- package/dist/s3/s3-cache-ratchet.spec.js +97 -0
- package/dist/{types/s3 → s3}/s3-cache-to-local-disk-ratchet.d.ts +2 -5
- package/dist/{es/s3 → s3}/s3-cache-to-local-disk-ratchet.js +8 -3
- package/dist/s3/s3-cache-to-local-dist-ratchet.spec.d.ts +1 -0
- package/dist/s3/s3-cache-to-local-dist-ratchet.spec.js +22 -0
- package/dist/{es/s3 → s3}/s3-location-sync-ratchet.js +4 -1
- package/dist/{es/s3 → s3}/s3-ratchet.js +1 -1
- package/dist/s3/s3-ratchet.spec.d.ts +1 -0
- package/dist/s3/s3-ratchet.spec.js +20 -0
- package/dist/ses/email-attachment.d.ts +5 -0
- package/dist/ses/email-attachment.js +1 -0
- package/dist/{types/ses → ses}/mailer-config.d.ts +2 -5
- package/dist/ses/mailer-config.js +1 -0
- package/dist/{types/ses → ses}/mailer-like.d.ts +2 -9
- package/dist/ses/mailer-like.js +1 -0
- package/dist/{types/ses → ses}/mailer.d.ts +4 -11
- package/dist/{es/ses → ses}/mailer.js +8 -6
- package/dist/ses/mailer.spec.d.ts +1 -0
- package/dist/ses/mailer.spec.js +104 -0
- package/dist/{types/ses → ses}/ratchet-template-renderer.d.ts +0 -4
- package/dist/ses/ratchet-template-renderer.js +1 -0
- package/dist/ses/ready-to-send-email.d.ts +13 -0
- package/dist/ses/ready-to-send-email.js +1 -0
- package/dist/{types/ses → ses}/remote-handlebars-template-renderer.d.ts +1 -3
- package/dist/{es/ses → ses}/remote-handlebars-template-renderer.js +6 -2
- package/dist/ses/resolved-ready-to-send-email.d.ts +5 -0
- package/dist/ses/resolved-ready-to-send-email.js +1 -0
- package/dist/{es/sns → sns}/sns-ratchet.js +4 -2
- package/dist/sns/sns-ratchet.spec.d.ts +1 -0
- package/dist/sns/sns-ratchet.spec.js +17 -0
- package/dist/{types/sync-lock → sync-lock}/dynamo-db-sync-lock.d.ts +2 -2
- package/dist/{es/sync-lock → sync-lock}/dynamo-db-sync-lock.js +5 -1
- package/dist/sync-lock/dynamo-db-sync-lock.spec.d.ts +1 -0
- package/dist/sync-lock/dynamo-db-sync-lock.spec.js +30 -0
- package/dist/{types/sync-lock → sync-lock}/memory-sync-lock.d.ts +1 -4
- package/dist/{es/sync-lock → sync-lock}/memory-sync-lock.js +3 -4
- package/dist/sync-lock/sync-lock-provider.js +1 -0
- package/package.json +10 -11
- package/dist/cjs/batch/aws-batch-background-processor.js +0 -44
- package/dist/cjs/batch/aws-batch-ratchet.js +0 -55
- package/dist/cjs/build/ratchet-aws-info.js +0 -18
- package/dist/cjs/cache/dynamo-db-storage-provider.js +0 -111
- package/dist/cjs/cache/s3-storage-provider.js +0 -44
- package/dist/cjs/cache/simple-cache-object-wrapper.js +0 -2
- package/dist/cjs/cache/simple-cache-read-options.js +0 -2
- package/dist/cjs/cache/simple-cache-storage-provider.js +0 -2
- package/dist/cjs/cache/simple-cache.js +0 -66
- package/dist/cjs/cloudwatch/cloud-watch-log-group-ratchet.js +0 -73
- package/dist/cjs/cloudwatch/cloud-watch-logs-ratchet.js +0 -173
- package/dist/cjs/cloudwatch/cloud-watch-metrics-ratchet.js +0 -57
- package/dist/cjs/daemon/daemon-like.js +0 -2
- package/dist/cjs/daemon/daemon-process-create-options.js +0 -2
- package/dist/cjs/daemon/daemon-process-state-public-token.js +0 -2
- package/dist/cjs/daemon/daemon-process-state.js +0 -2
- package/dist/cjs/daemon/daemon-util.js +0 -152
- package/dist/cjs/daemon/daemon.js +0 -126
- package/dist/cjs/dao/prototype-dao-config.js +0 -2
- package/dist/cjs/dao/prototype-dao-db.js +0 -2
- package/dist/cjs/dao/prototype-dao-provider.js +0 -2
- package/dist/cjs/dao/prototype-dao.js +0 -88
- package/dist/cjs/dao/s3-prototype-dao-provider.js +0 -28
- package/dist/cjs/dao/s3-simple-dao.js +0 -78
- package/dist/cjs/dao/simple-dao-item.js +0 -2
- package/dist/cjs/dynamodb/dynamo-ratchet-like.js +0 -2
- package/dist/cjs/dynamodb/dynamo-ratchet.js +0 -667
- package/dist/cjs/dynamodb/dynamo-table-ratchet.js +0 -91
- package/dist/cjs/dynamodb/hash-spreader.js +0 -62
- package/dist/cjs/ec2/ec2-ratchet.js +0 -107
- package/dist/cjs/environment/cascade-environment-service-provider.js +0 -27
- package/dist/cjs/environment/env-var-environment-service-provider.js +0 -33
- package/dist/cjs/environment/environment-service-config.js +0 -2
- package/dist/cjs/environment/environment-service-provider.js +0 -2
- package/dist/cjs/environment/environment-service.js +0 -52
- package/dist/cjs/environment/fixed-environment-service-provider.js +0 -24
- package/dist/cjs/environment/s3-environment-service-provider.js +0 -29
- package/dist/cjs/environment/ssm-environment-service-provider.js +0 -61
- package/dist/cjs/expiring-code/dynamo-expiring-code-provider.js +0 -26
- package/dist/cjs/expiring-code/expiring-code-params.js +0 -2
- package/dist/cjs/expiring-code/expiring-code-provider.js +0 -2
- package/dist/cjs/expiring-code/expiring-code-ratchet.js +0 -37
- package/dist/cjs/expiring-code/expiring-code.js +0 -2
- package/dist/cjs/expiring-code/s3-expiring-code-provider.js +0 -49
- package/dist/cjs/iam/aws-credentials-ratchet.js +0 -21
- package/dist/cjs/index.js +0 -81
- package/dist/cjs/lambda/lambda-event-detector.js +0 -42
- package/dist/cjs/lambda/lambda-event-type-guards.js +0 -28
- package/dist/cjs/model/cloud-watch-metrics-minute-level-dynamo-count-request.js +0 -2
- package/dist/cjs/model/cloud-watch-metrics-unit.js +0 -33
- package/dist/cjs/model/dynamo/doc-put-item-command-input.js +0 -2
- package/dist/cjs/model/dynamo/doc-query-command-input.js +0 -2
- package/dist/cjs/model/dynamo/doc-scan-command-input.js +0 -2
- package/dist/cjs/model/dynamo/doc-update-item-command-input.js +0 -2
- package/dist/cjs/model/dynamo-count-result.js +0 -2
- package/dist/cjs/route53/route-53-ratchet.js +0 -57
- package/dist/cjs/runtime-parameter/cached-stored-runtime-parameter.js +0 -2
- package/dist/cjs/runtime-parameter/dynamo-runtime-parameter-provider.js +0 -38
- package/dist/cjs/runtime-parameter/global-variable-override-runtime-parameter-provider.js +0 -54
- package/dist/cjs/runtime-parameter/memory-runtime-parameter-provider.js +0 -30
- package/dist/cjs/runtime-parameter/runtime-parameter-provider.js +0 -2
- package/dist/cjs/runtime-parameter/runtime-parameter-ratchet.js +0 -74
- package/dist/cjs/runtime-parameter/stored-runtime-parameter.js +0 -2
- package/dist/cjs/s3/s3-cache-ratchet.js +0 -332
- package/dist/cjs/s3/s3-cache-to-local-disk-ratchet.js +0 -105
- package/dist/cjs/s3/s3-location-sync-ratchet.js +0 -142
- package/dist/cjs/s3/s3-ratchet.js +0 -26
- package/dist/cjs/ses/email-attachment.js +0 -2
- package/dist/cjs/ses/mailer-config.js +0 -2
- package/dist/cjs/ses/mailer-like.js +0 -2
- package/dist/cjs/ses/mailer.js +0 -208
- package/dist/cjs/ses/ratchet-template-renderer.js +0 -2
- package/dist/cjs/ses/ready-to-send-email.js +0 -2
- package/dist/cjs/ses/remote-handlebars-template-renderer.js +0 -79
- package/dist/cjs/ses/resolved-ready-to-send-email.js +0 -2
- package/dist/cjs/sns/sns-ratchet.js +0 -47
- package/dist/cjs/sync-lock/dynamo-db-sync-lock.js +0 -69
- package/dist/cjs/sync-lock/memory-sync-lock.js +0 -40
- package/dist/cjs/sync-lock/sync-lock-provider.js +0 -2
- package/dist/es/index.js +0 -78
- package/dist/tsconfig.cjs.tsbuildinfo +0 -1
- package/dist/tsconfig.es.tsbuildinfo +0 -1
- package/dist/tsconfig.types.tsbuildinfo +0 -1
- package/dist/types/environment/environment-service-provider.d.ts +0 -7
- package/dist/types/index.d.ts +0 -81
- package/dist/types/ses/email-attachment.d.ts +0 -23
- package/dist/types/ses/ready-to-send-email.d.ts +0 -66
- package/dist/types/ses/resolved-ready-to-send-email.d.ts +0 -16
- /package/dist/{es/cache/simple-cache-object-wrapper.js → batch/aws-batch-background-processor.spec.d.ts} +0 -0
- /package/dist/{es/cache/simple-cache-read-options.js → batch/aws-batch-ratchet.spec.d.ts} +0 -0
- /package/dist/{es/build → build}/ratchet-aws-info.js +0 -0
- /package/dist/{types/cache → cache}/simple-cache-object-wrapper.d.ts +0 -0
- /package/dist/{es/cache/simple-cache-storage-provider.js → cache/simple-cache-object-wrapper.js} +0 -0
- /package/dist/{types/cache → cache}/simple-cache-read-options.d.ts +0 -0
- /package/dist/{es/daemon/daemon-like.js → cache/simple-cache-read-options.js} +0 -0
- /package/dist/{es/daemon/daemon-process-create-options.js → cache/simple-cache-storage-provider.js} +0 -0
- /package/dist/{es/daemon/daemon-process-state-public-token.js → cache/simple-cache.spec.d.ts} +0 -0
- /package/dist/{types/cloudwatch → cloudwatch}/cloud-watch-log-group-ratchet.d.ts +0 -0
- /package/dist/{es/daemon/daemon-process-state.js → cloudwatch/cloud-watch-log-group-ratchet.spec.d.ts} +0 -0
- /package/dist/{types/cloudwatch → cloudwatch}/cloud-watch-logs-ratchet.d.ts +0 -0
- /package/dist/{es/dao/prototype-dao-config.js → cloudwatch/cloud-watch-logs-ratchet.spec.d.ts} +0 -0
- /package/dist/{es/dao/prototype-dao-db.js → cloudwatch/cloud-watch-metrics-ratchet.spec.d.ts} +0 -0
- /package/dist/{es/dao/prototype-dao-provider.js → daemon/daemon-like.js} +0 -0
- /package/dist/{types/daemon → daemon}/daemon-process-create-options.d.ts +0 -0
- /package/dist/{es/dao/simple-dao-item.js → daemon/daemon-process-create-options.js} +0 -0
- /package/dist/{es/dynamodb/dynamo-ratchet-like.js → daemon/daemon-process-state-public-token.js} +0 -0
- /package/dist/{types/daemon → daemon}/daemon-process-state.d.ts +0 -0
- /package/dist/{es/environment/environment-service-config.js → daemon/daemon-process-state.js} +0 -0
- /package/dist/{types/dao → dao}/prototype-dao-config.d.ts +0 -0
- /package/dist/{es/environment/environment-service-provider.js → dao/prototype-dao-config.js} +0 -0
- /package/dist/{types/dao → dao}/prototype-dao-db.d.ts +0 -0
- /package/dist/{es/expiring-code/expiring-code-params.js → dao/prototype-dao-db.js} +0 -0
- /package/dist/{es/expiring-code/expiring-code-provider.js → dao/prototype-dao-provider.js} +0 -0
- /package/dist/{types/dao → dao}/simple-dao-item.d.ts +0 -0
- /package/dist/{es/expiring-code/expiring-code.js → dao/simple-dao-item.js} +0 -0
- /package/dist/{es/model/cloud-watch-metrics-minute-level-dynamo-count-request.js → dynamodb/dynamo-ratchet-like.js} +0 -0
- /package/dist/{es/model/dynamo-count-result.js → dynamodb/dynamo-ratchet.spec.d.ts} +0 -0
- /package/dist/{types/dynamodb → dynamodb}/dynamo-table-ratchet.d.ts +0 -0
- /package/dist/{types/dynamodb → dynamodb}/hash-spreader.d.ts +0 -0
- /package/dist/{es/model/dynamo/doc-put-item-command-input.js → dynamodb/hash-spreader.spec.d.ts} +0 -0
- /package/dist/{es/model/dynamo/doc-query-command-input.js → ec2/ec2-ratchet.spec.d.ts} +0 -0
- /package/dist/{es/model/dynamo/doc-scan-command-input.js → environment/environment-service-config.js} +0 -0
- /package/dist/{es/model/dynamo/doc-update-item-command-input.js → environment/environment-service-provider.js} +0 -0
- /package/dist/{es/runtime-parameter/cached-stored-runtime-parameter.js → environment/environment-service.spec.d.ts} +0 -0
- /package/dist/{types/expiring-code → expiring-code}/expiring-code-params.d.ts +0 -0
- /package/dist/{es/runtime-parameter/runtime-parameter-provider.js → expiring-code/expiring-code-params.js} +0 -0
- /package/dist/{es/runtime-parameter/stored-runtime-parameter.js → expiring-code/expiring-code-provider.js} +0 -0
- /package/dist/{es/ses/email-attachment.js → expiring-code/expiring-code-ratchet.spec.d.ts} +0 -0
- /package/dist/{types/expiring-code → expiring-code}/expiring-code.d.ts +0 -0
- /package/dist/{es/ses/mailer-config.js → expiring-code/expiring-code.js} +0 -0
- /package/dist/{es/ses/mailer-like.js → expiring-code/s3-expiring-code-provider.spec.d.ts} +0 -0
- /package/dist/{es/ses/ratchet-template-renderer.js → index.d.ts} +0 -0
- /package/dist/{es/ses/ready-to-send-email.js → index.js} +0 -0
- /package/dist/{types/lambda → lambda}/lambda-event-detector.d.ts +0 -0
- /package/dist/{es/lambda → lambda}/lambda-event-detector.js +0 -0
- /package/dist/{types/lambda → lambda}/lambda-event-type-guards.d.ts +0 -0
- /package/dist/{es/ses/resolved-ready-to-send-email.js → model/cloud-watch-metrics-minute-level-dynamo-count-request.js} +0 -0
- /package/dist/{types/model → model}/cloud-watch-metrics-unit.d.ts +0 -0
- /package/dist/{es/model → model}/cloud-watch-metrics-unit.js +0 -0
- /package/dist/{types/model → model}/dynamo/doc-put-item-command-input.d.ts +0 -0
- /package/dist/{types/model → model}/dynamo/doc-query-command-input.d.ts +0 -0
- /package/dist/{types/model → model}/dynamo/doc-scan-command-input.d.ts +0 -0
- /package/dist/{types/model → model}/dynamo/doc-update-item-command-input.d.ts +0 -0
- /package/dist/{types/model → model}/dynamo-count-result.d.ts +0 -0
- /package/dist/{es/sync-lock/sync-lock-provider.js → model/dynamo-count-result.js} +0 -0
- /package/dist/{types/route53 → route53}/route-53-ratchet.d.ts +0 -0
- /package/dist/{types/runtime-parameter → runtime-parameter}/stored-runtime-parameter.d.ts +0 -0
- /package/dist/{types/s3 → s3}/s3-location-sync-ratchet.d.ts +0 -0
- /package/dist/{types/s3 → s3}/s3-ratchet.d.ts +0 -0
- /package/dist/{types/sns → sns}/sns-ratchet.d.ts +0 -0
- /package/dist/{types/sync-lock → sync-lock}/sync-lock-provider.d.ts +0 -0
package/dist/cjs/index.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./batch/aws-batch-background-processor"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./batch/aws-batch-ratchet"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./build/ratchet-aws-info"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./cache/dynamo-db-storage-provider"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./cache/s3-storage-provider"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./cache/simple-cache-object-wrapper"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./cache/simple-cache-read-options"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./cache/simple-cache-storage-provider"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./cache/simple-cache"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./cloudwatch/cloud-watch-log-group-ratchet"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./cloudwatch/cloud-watch-logs-ratchet"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./cloudwatch/cloud-watch-metrics-ratchet"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./daemon/daemon-like"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./daemon/daemon-process-create-options"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./daemon/daemon-process-state-public-token"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./daemon/daemon-process-state"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./daemon/daemon-util"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./daemon/daemon"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./dao/prototype-dao-config"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./dao/prototype-dao-db"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./dao/prototype-dao-provider"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./dao/prototype-dao"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./dao/s3-prototype-dao-provider"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./dao/s3-simple-dao"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./dao/simple-dao-item"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./dynamodb/dynamo-ratchet-like"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./dynamodb/dynamo-ratchet"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./dynamodb/dynamo-table-ratchet"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./dynamodb/hash-spreader"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./ec2/ec2-ratchet"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./environment/cascade-environment-service-provider"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./environment/env-var-environment-service-provider"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./environment/environment-service-config"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./environment/environment-service-provider"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./environment/environment-service"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./environment/fixed-environment-service-provider"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./environment/s3-environment-service-provider"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./environment/ssm-environment-service-provider"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./expiring-code/dynamo-expiring-code-provider"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./expiring-code/expiring-code-params"), exports);
|
|
44
|
-
tslib_1.__exportStar(require("./expiring-code/expiring-code-provider"), exports);
|
|
45
|
-
tslib_1.__exportStar(require("./expiring-code/expiring-code-ratchet"), exports);
|
|
46
|
-
tslib_1.__exportStar(require("./expiring-code/expiring-code"), exports);
|
|
47
|
-
tslib_1.__exportStar(require("./expiring-code/s3-expiring-code-provider"), exports);
|
|
48
|
-
tslib_1.__exportStar(require("./iam/aws-credentials-ratchet"), exports);
|
|
49
|
-
tslib_1.__exportStar(require("./lambda/lambda-event-detector"), exports);
|
|
50
|
-
tslib_1.__exportStar(require("./lambda/lambda-event-type-guards"), exports);
|
|
51
|
-
tslib_1.__exportStar(require("./model/cloud-watch-metrics-minute-level-dynamo-count-request"), exports);
|
|
52
|
-
tslib_1.__exportStar(require("./model/cloud-watch-metrics-unit"), exports);
|
|
53
|
-
tslib_1.__exportStar(require("./model/dynamo-count-result"), exports);
|
|
54
|
-
tslib_1.__exportStar(require("./model/dynamo/doc-put-item-command-input"), exports);
|
|
55
|
-
tslib_1.__exportStar(require("./model/dynamo/doc-query-command-input"), exports);
|
|
56
|
-
tslib_1.__exportStar(require("./model/dynamo/doc-scan-command-input"), exports);
|
|
57
|
-
tslib_1.__exportStar(require("./model/dynamo/doc-update-item-command-input"), exports);
|
|
58
|
-
tslib_1.__exportStar(require("./route53/route-53-ratchet"), exports);
|
|
59
|
-
tslib_1.__exportStar(require("./runtime-parameter/cached-stored-runtime-parameter"), exports);
|
|
60
|
-
tslib_1.__exportStar(require("./runtime-parameter/dynamo-runtime-parameter-provider"), exports);
|
|
61
|
-
tslib_1.__exportStar(require("./runtime-parameter/global-variable-override-runtime-parameter-provider"), exports);
|
|
62
|
-
tslib_1.__exportStar(require("./runtime-parameter/memory-runtime-parameter-provider"), exports);
|
|
63
|
-
tslib_1.__exportStar(require("./runtime-parameter/runtime-parameter-provider"), exports);
|
|
64
|
-
tslib_1.__exportStar(require("./runtime-parameter/runtime-parameter-ratchet"), exports);
|
|
65
|
-
tslib_1.__exportStar(require("./runtime-parameter/stored-runtime-parameter"), exports);
|
|
66
|
-
tslib_1.__exportStar(require("./s3/s3-cache-ratchet"), exports);
|
|
67
|
-
tslib_1.__exportStar(require("./s3/s3-cache-to-local-disk-ratchet"), exports);
|
|
68
|
-
tslib_1.__exportStar(require("./s3/s3-location-sync-ratchet"), exports);
|
|
69
|
-
tslib_1.__exportStar(require("./s3/s3-ratchet"), exports);
|
|
70
|
-
tslib_1.__exportStar(require("./ses/email-attachment"), exports);
|
|
71
|
-
tslib_1.__exportStar(require("./ses/mailer-config"), exports);
|
|
72
|
-
tslib_1.__exportStar(require("./ses/mailer-like"), exports);
|
|
73
|
-
tslib_1.__exportStar(require("./ses/mailer"), exports);
|
|
74
|
-
tslib_1.__exportStar(require("./ses/ratchet-template-renderer"), exports);
|
|
75
|
-
tslib_1.__exportStar(require("./ses/ready-to-send-email"), exports);
|
|
76
|
-
tslib_1.__exportStar(require("./ses/remote-handlebars-template-renderer"), exports);
|
|
77
|
-
tslib_1.__exportStar(require("./ses/resolved-ready-to-send-email"), exports);
|
|
78
|
-
tslib_1.__exportStar(require("./sns/sns-ratchet"), exports);
|
|
79
|
-
tslib_1.__exportStar(require("./sync-lock/dynamo-db-sync-lock"), exports);
|
|
80
|
-
tslib_1.__exportStar(require("./sync-lock/memory-sync-lock"), exports);
|
|
81
|
-
tslib_1.__exportStar(require("./sync-lock/sync-lock-provider"), exports);
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LambdaEventDetector = void 0;
|
|
4
|
-
class LambdaEventDetector {
|
|
5
|
-
static isValidCronEvent(event) {
|
|
6
|
-
return event && event.source == 'aws.events' && event.resources && event.resources.length > 0;
|
|
7
|
-
}
|
|
8
|
-
static isValidSnsEvent(event) {
|
|
9
|
-
return event && event.Records && event.Records.length > 0 && event.Records[0].EventSource == 'aws:sns';
|
|
10
|
-
}
|
|
11
|
-
static isValidDynamoDBEvent(event) {
|
|
12
|
-
return event && event.Records && event.Records.length > 0 && event.Records[0].eventSource == 'aws:dynamodb';
|
|
13
|
-
}
|
|
14
|
-
static isValidS3Event(event) {
|
|
15
|
-
return event && event.Records && event.Records.length > 0 && event.Records[0].eventSource == 'aws:s3';
|
|
16
|
-
}
|
|
17
|
-
static isValidApiGatewayV2WithRequestContextEvent(event) {
|
|
18
|
-
return event && event.rawPath && event.requestContext && event.routeKey;
|
|
19
|
-
}
|
|
20
|
-
static isValidApiGatewayEvent(event) {
|
|
21
|
-
return event && event.httpMethod && event.path && event.requestContext;
|
|
22
|
-
}
|
|
23
|
-
static isValidApiGatewayAuthorizerEvent(event) {
|
|
24
|
-
return event && event.authorizationToken && event.methodArn;
|
|
25
|
-
}
|
|
26
|
-
static isSingleCronEvent(event) {
|
|
27
|
-
return this.isValidCronEvent(event) && LambdaEventDetector.isSingleEntryEvent(event, 'resources');
|
|
28
|
-
}
|
|
29
|
-
static isSingleSnsEvent(event) {
|
|
30
|
-
return this.isValidSnsEvent(event) && LambdaEventDetector.isSingleEntryEvent(event);
|
|
31
|
-
}
|
|
32
|
-
static isSingleDynamoDBEvent(event) {
|
|
33
|
-
return this.isValidDynamoDBEvent(event) && LambdaEventDetector.isSingleEntryEvent(event);
|
|
34
|
-
}
|
|
35
|
-
static isSingleS3Event(event) {
|
|
36
|
-
return this.isValidS3Event(event) && LambdaEventDetector.isSingleEntryEvent(event);
|
|
37
|
-
}
|
|
38
|
-
static isSingleEntryEvent(event, entryName = 'Records') {
|
|
39
|
-
return event && event[entryName] && event[entryName] instanceof Array && event[entryName].length === 1;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.LambdaEventDetector = LambdaEventDetector;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LambdaEventTypeGuards = void 0;
|
|
4
|
-
const lambda_event_detector_1 = require("./lambda-event-detector");
|
|
5
|
-
class LambdaEventTypeGuards {
|
|
6
|
-
static isValidCronEvent(event) {
|
|
7
|
-
return lambda_event_detector_1.LambdaEventDetector.isValidCronEvent(event);
|
|
8
|
-
}
|
|
9
|
-
static isValidSnsEvent(event) {
|
|
10
|
-
return lambda_event_detector_1.LambdaEventDetector.isValidSnsEvent(event);
|
|
11
|
-
}
|
|
12
|
-
static isValidDynamoDBEvent(event) {
|
|
13
|
-
return lambda_event_detector_1.LambdaEventDetector.isValidDynamoDBEvent(event);
|
|
14
|
-
}
|
|
15
|
-
static isValidS3Event(event) {
|
|
16
|
-
return lambda_event_detector_1.LambdaEventDetector.isValidS3Event(event);
|
|
17
|
-
}
|
|
18
|
-
static isValidApiGatewayV2WithRequestContextEvent(event) {
|
|
19
|
-
return lambda_event_detector_1.LambdaEventDetector.isValidApiGatewayV2WithRequestContextEvent(event);
|
|
20
|
-
}
|
|
21
|
-
static isValidApiGatewayEvent(event) {
|
|
22
|
-
return lambda_event_detector_1.LambdaEventDetector.isValidApiGatewayEvent(event);
|
|
23
|
-
}
|
|
24
|
-
static isValidApiGatewayAuthorizerEvent(event) {
|
|
25
|
-
return lambda_event_detector_1.LambdaEventDetector.isValidApiGatewayAuthorizerEvent(event);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.LambdaEventTypeGuards = LambdaEventTypeGuards;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CloudWatchMetricsUnit = void 0;
|
|
4
|
-
var CloudWatchMetricsUnit;
|
|
5
|
-
(function (CloudWatchMetricsUnit) {
|
|
6
|
-
CloudWatchMetricsUnit["Seconds"] = "Seconds";
|
|
7
|
-
CloudWatchMetricsUnit["Microseconds"] = "Microseconds";
|
|
8
|
-
CloudWatchMetricsUnit["Milliseconds"] = "Milliseconds";
|
|
9
|
-
CloudWatchMetricsUnit["Bytes"] = "Bytes";
|
|
10
|
-
CloudWatchMetricsUnit["Kilobytes"] = "Kilobytes";
|
|
11
|
-
CloudWatchMetricsUnit["Megabytes"] = "Megabytes";
|
|
12
|
-
CloudWatchMetricsUnit["Gigabytes"] = "Gigabytes";
|
|
13
|
-
CloudWatchMetricsUnit["Terabytes"] = "Terabytes";
|
|
14
|
-
CloudWatchMetricsUnit["Bits"] = "Bits";
|
|
15
|
-
CloudWatchMetricsUnit["Kilobits"] = "Kilobits";
|
|
16
|
-
CloudWatchMetricsUnit["Megabits"] = "Megabits";
|
|
17
|
-
CloudWatchMetricsUnit["Gigabits"] = "Gigabits";
|
|
18
|
-
CloudWatchMetricsUnit["Terabits"] = "Terabits";
|
|
19
|
-
CloudWatchMetricsUnit["Percent"] = "Percent";
|
|
20
|
-
CloudWatchMetricsUnit["Count"] = "Count";
|
|
21
|
-
CloudWatchMetricsUnit["BytesPerSecond"] = "Bytes/Second";
|
|
22
|
-
CloudWatchMetricsUnit["KilobytesPerSecond"] = "Kilobytes/Second";
|
|
23
|
-
CloudWatchMetricsUnit["MegabytesPerSecond"] = "Megabytes/Second";
|
|
24
|
-
CloudWatchMetricsUnit["GigabytesPerSecond"] = "Gigabytes/Second";
|
|
25
|
-
CloudWatchMetricsUnit["TerabytesPerSecond"] = "Terabytes/Second";
|
|
26
|
-
CloudWatchMetricsUnit["BitsPerSecond"] = "Terabytes/Second";
|
|
27
|
-
CloudWatchMetricsUnit["KilobitsPerSecond"] = "Kilobits/Second";
|
|
28
|
-
CloudWatchMetricsUnit["MegabitsPerSecond"] = "Megabits/Second";
|
|
29
|
-
CloudWatchMetricsUnit["GigabitsPerSecond"] = "Gigabits/Second";
|
|
30
|
-
CloudWatchMetricsUnit["TerabitsPerSecond"] = "Terabits/Second";
|
|
31
|
-
CloudWatchMetricsUnit["CountPerSecond"] = "Count/Second";
|
|
32
|
-
CloudWatchMetricsUnit["None"] = "None";
|
|
33
|
-
})(CloudWatchMetricsUnit = exports.CloudWatchMetricsUnit || (exports.CloudWatchMetricsUnit = {}));
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Route53Ratchet = void 0;
|
|
4
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
5
|
-
const client_route_53_1 = require("@aws-sdk/client-route-53");
|
|
6
|
-
const util_waiter_1 = require("@aws-sdk/util-waiter");
|
|
7
|
-
class Route53Ratchet {
|
|
8
|
-
constructor(route53, hostedZoneId) {
|
|
9
|
-
this.route53 = route53;
|
|
10
|
-
this.hostedZoneId = hostedZoneId;
|
|
11
|
-
if (!this.route53) {
|
|
12
|
-
throw 'route53 may not be null';
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
async changeCnameRecordTarget(domainName, target, hostedZoneId = this.hostedZoneId, ttlSeconds = 600) {
|
|
16
|
-
ratchet_common_1.Logger.info('Updating %s to point to %s', domainName, target);
|
|
17
|
-
try {
|
|
18
|
-
const params = {
|
|
19
|
-
ChangeBatch: {
|
|
20
|
-
Changes: [
|
|
21
|
-
{
|
|
22
|
-
Action: 'UPSERT',
|
|
23
|
-
ResourceRecordSet: {
|
|
24
|
-
Name: domainName,
|
|
25
|
-
ResourceRecords: [
|
|
26
|
-
{
|
|
27
|
-
Value: target,
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
TTL: ttlSeconds,
|
|
31
|
-
Type: 'CNAME',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
HostedZoneId: hostedZoneId,
|
|
37
|
-
};
|
|
38
|
-
const result = await this.route53.send(new client_route_53_1.ChangeResourceRecordSetsCommand(params));
|
|
39
|
-
ratchet_common_1.Logger.debug('Updated domain result: %j', result);
|
|
40
|
-
const waitParams = {
|
|
41
|
-
Id: result.ChangeInfo.Id,
|
|
42
|
-
};
|
|
43
|
-
const waitResult = await (0, client_route_53_1.waitUntilResourceRecordSetsChanged)({ client: this.route53, maxWaitTime: 300 }, waitParams);
|
|
44
|
-
ratchet_common_1.Logger.debug('Wait responsed: %j', waitResult);
|
|
45
|
-
if (waitResult.state === util_waiter_1.WaiterState.SUCCESS) {
|
|
46
|
-
ratchet_common_1.Logger.info('Updated %s to point to %s', domainName, hostedZoneId);
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
ratchet_common_1.Logger.warn('Error update CName for %s with value %s: %j', domainName, target, err);
|
|
52
|
-
}
|
|
53
|
-
ratchet_common_1.Logger.info('Cannot update %s to point to %s', domainName, target);
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.Route53Ratchet = Route53Ratchet;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DynamoRuntimeParameterProvider = void 0;
|
|
4
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
5
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
6
|
-
class DynamoRuntimeParameterProvider {
|
|
7
|
-
constructor(dynamo, tableName) {
|
|
8
|
-
this.dynamo = dynamo;
|
|
9
|
-
this.tableName = tableName;
|
|
10
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined(this.dynamo);
|
|
11
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined(this.tableName);
|
|
12
|
-
}
|
|
13
|
-
async readParameter(groupId, paramKey) {
|
|
14
|
-
ratchet_common_2.Logger.silly('Reading %s / %s from underlying db', groupId, paramKey);
|
|
15
|
-
const req = {
|
|
16
|
-
groupId: groupId,
|
|
17
|
-
paramKey: paramKey,
|
|
18
|
-
};
|
|
19
|
-
const rval = await this.dynamo.simpleGet(this.tableName, req);
|
|
20
|
-
return rval;
|
|
21
|
-
}
|
|
22
|
-
async readAllParametersForGroup(groupId) {
|
|
23
|
-
const qry = {
|
|
24
|
-
TableName: this.tableName,
|
|
25
|
-
KeyConditionExpression: 'groupId = :groupId',
|
|
26
|
-
ExpressionAttributeValues: {
|
|
27
|
-
':groupId': groupId,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
const all = await this.dynamo.fullyExecuteQuery(qry);
|
|
31
|
-
return all;
|
|
32
|
-
}
|
|
33
|
-
async writeParameter(toStore) {
|
|
34
|
-
const rval = await this.dynamo.simplePut(this.tableName, toStore);
|
|
35
|
-
return !!rval;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.DynamoRuntimeParameterProvider = DynamoRuntimeParameterProvider;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GlobalVariableOverrideRuntimeParameterProvider = void 0;
|
|
4
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
5
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
6
|
-
class GlobalVariableOverrideRuntimeParameterProvider {
|
|
7
|
-
constructor(wrapped, opts) {
|
|
8
|
-
var _a;
|
|
9
|
-
this.wrapped = wrapped;
|
|
10
|
-
this.options = {
|
|
11
|
-
globalTTL: 1,
|
|
12
|
-
separator: '.',
|
|
13
|
-
prefix: 'RuntimeEnv-',
|
|
14
|
-
suffix: '',
|
|
15
|
-
};
|
|
16
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined(this.wrapped, 'wrapped');
|
|
17
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined((_a = global === null || global === void 0 ? void 0 : global.process) === null || _a === void 0 ? void 0 : _a.env, '"process" not found - this only runs in Node, not the browser');
|
|
18
|
-
if (opts) {
|
|
19
|
-
this.options = opts;
|
|
20
|
-
}
|
|
21
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined(this.options.globalTTL, 'this.options.globalTTL');
|
|
22
|
-
ratchet_common_1.RequireRatchet.notNullOrUndefined(this.options.separator, 'this.options.separator');
|
|
23
|
-
ratchet_common_1.RequireRatchet.true(this.options.globalTTL > 0, 'this.options.globalTTL must be larger than 0');
|
|
24
|
-
}
|
|
25
|
-
generateName(groupId, paramKey) {
|
|
26
|
-
return (ratchet_common_2.StringRatchet.trimToEmpty(this.options.prefix) +
|
|
27
|
-
groupId +
|
|
28
|
-
ratchet_common_2.StringRatchet.trimToEmpty(this.options.separator) +
|
|
29
|
-
paramKey +
|
|
30
|
-
ratchet_common_2.StringRatchet.trimToEmpty(this.options.suffix));
|
|
31
|
-
}
|
|
32
|
-
async readParameter(groupId, paramKey) {
|
|
33
|
-
const asString = ratchet_common_2.StringRatchet.trimToNull(process.env[this.generateName(groupId, paramKey)]);
|
|
34
|
-
if (asString && !ratchet_common_2.StringRatchet.canParseAsJson(asString)) {
|
|
35
|
-
ratchet_common_2.ErrorRatchet.throwFormattedErr('Cannot parse ENV override (%s / %s) as JSON - did you forget the quotes on a string?', groupId, paramKey);
|
|
36
|
-
}
|
|
37
|
-
const rval = asString
|
|
38
|
-
? {
|
|
39
|
-
groupId: groupId,
|
|
40
|
-
paramKey: paramKey,
|
|
41
|
-
paramValue: asString,
|
|
42
|
-
ttlSeconds: this.options.globalTTL,
|
|
43
|
-
}
|
|
44
|
-
: await this.wrapped.readParameter(groupId, paramKey);
|
|
45
|
-
return rval;
|
|
46
|
-
}
|
|
47
|
-
async readAllParametersForGroup(groupId) {
|
|
48
|
-
return this.wrapped.readAllParametersForGroup(groupId);
|
|
49
|
-
}
|
|
50
|
-
async writeParameter(toStore) {
|
|
51
|
-
return this.wrapped.writeParameter(toStore);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.GlobalVariableOverrideRuntimeParameterProvider = GlobalVariableOverrideRuntimeParameterProvider;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MemoryRuntimeParameterProvider = void 0;
|
|
4
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
5
|
-
class MemoryRuntimeParameterProvider {
|
|
6
|
-
constructor(data = Promise.resolve({})) {
|
|
7
|
-
this.data = data;
|
|
8
|
-
}
|
|
9
|
-
async readParameter(groupId, paramKey) {
|
|
10
|
-
ratchet_common_1.Logger.silly('Reading %s / %s from underlying db', groupId, paramKey);
|
|
11
|
-
const d = await this.data;
|
|
12
|
-
return d[groupId + '::' + paramKey];
|
|
13
|
-
}
|
|
14
|
-
async readAllParametersForGroup(groupId) {
|
|
15
|
-
const d = await this.data;
|
|
16
|
-
const out = [];
|
|
17
|
-
Object.keys(d).forEach((k) => {
|
|
18
|
-
if (k.startsWith(groupId)) {
|
|
19
|
-
out.push(d[k]);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return out;
|
|
23
|
-
}
|
|
24
|
-
async writeParameter(toStore) {
|
|
25
|
-
const d = await this.data;
|
|
26
|
-
d[toStore.groupId + '::' + toStore.paramKey] = toStore;
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.MemoryRuntimeParameterProvider = MemoryRuntimeParameterProvider;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RuntimeParameterRatchet = void 0;
|
|
4
|
-
const ratchet_common_1 = require("@bitblit/ratchet-common");
|
|
5
|
-
const ratchet_common_2 = require("@bitblit/ratchet-common");
|
|
6
|
-
class RuntimeParameterRatchet {
|
|
7
|
-
constructor(provider) {
|
|
8
|
-
this.provider = provider;
|
|
9
|
-
this.cache = new Map();
|
|
10
|
-
ratchet_common_2.RequireRatchet.notNullOrUndefined(this.provider);
|
|
11
|
-
}
|
|
12
|
-
async fetchParameter(groupId, paramKey, defaultValue = null, forceFreshRead = false) {
|
|
13
|
-
ratchet_common_1.Logger.debug('Reading parameter %s / %s / Force : %s', groupId, paramKey, forceFreshRead);
|
|
14
|
-
const cached = this.cache.get(RuntimeParameterRatchet.toCacheStoreKey(groupId, paramKey));
|
|
15
|
-
let rval = null;
|
|
16
|
-
const now = new Date().getTime();
|
|
17
|
-
if (!forceFreshRead && !!cached) {
|
|
18
|
-
const oldest = !!cached.ttlSeconds ? now - cached.ttlSeconds * 1000 : 0;
|
|
19
|
-
if (cached.storedEpochMS > oldest) {
|
|
20
|
-
ratchet_common_1.Logger.silly('Fetched %s / %s from cache', groupId, paramKey);
|
|
21
|
-
rval = JSON.parse(cached.paramValue);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (!rval) {
|
|
25
|
-
const temp = await this.readUnderlyingEntry(groupId, paramKey);
|
|
26
|
-
if (!!temp) {
|
|
27
|
-
this.addToCache(temp);
|
|
28
|
-
rval = JSON.parse(temp.paramValue);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
rval = rval || defaultValue;
|
|
32
|
-
return rval;
|
|
33
|
-
}
|
|
34
|
-
async fetchAllParametersForGroup(groupId) {
|
|
35
|
-
const all = await this.readUnderlyingEntries(groupId);
|
|
36
|
-
const rval = new Map();
|
|
37
|
-
all.forEach((t) => {
|
|
38
|
-
rval.set(t.paramKey, JSON.parse(t.paramValue));
|
|
39
|
-
this.addToCache(t);
|
|
40
|
-
});
|
|
41
|
-
return rval;
|
|
42
|
-
}
|
|
43
|
-
async readUnderlyingEntry(groupId, paramKey) {
|
|
44
|
-
return this.provider.readParameter(groupId, paramKey);
|
|
45
|
-
}
|
|
46
|
-
async readUnderlyingEntries(groupId) {
|
|
47
|
-
return this.provider.readAllParametersForGroup(groupId);
|
|
48
|
-
}
|
|
49
|
-
async storeParameter(groupId, paramKey, paramValue, ttlSeconds) {
|
|
50
|
-
const toStore = {
|
|
51
|
-
groupId: groupId,
|
|
52
|
-
paramKey: paramKey,
|
|
53
|
-
paramValue: JSON.stringify(paramValue),
|
|
54
|
-
ttlSeconds: ttlSeconds,
|
|
55
|
-
};
|
|
56
|
-
const wrote = await this.provider.writeParameter(toStore);
|
|
57
|
-
return this.provider.readParameter(groupId, paramKey);
|
|
58
|
-
}
|
|
59
|
-
static toCacheStoreKey(groupId, paramKey) {
|
|
60
|
-
return groupId + ':::' + paramKey;
|
|
61
|
-
}
|
|
62
|
-
addToCache(temp) {
|
|
63
|
-
if (!!temp) {
|
|
64
|
-
const now = new Date().getTime();
|
|
65
|
-
const toStore = Object.assign({ storedEpochMS: now }, temp);
|
|
66
|
-
this.cache.set(RuntimeParameterRatchet.toCacheStoreKey(temp.groupId, temp.paramKey), toStore);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
clearCache() {
|
|
70
|
-
ratchet_common_1.Logger.debug('Clearing runtime parameter cache');
|
|
71
|
-
this.cache = new Map();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.RuntimeParameterRatchet = RuntimeParameterRatchet;
|