@slicemachine/manager 0.17.8-beta.5 → 0.17.8
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/_node_modules/@amplitude/analytics-core/lib/esm/config.cjs +91 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/config.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/config.js +91 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/config.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/constants.cjs +17 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/constants.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/constants.js +17 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/constants.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/core-client.cjs +190 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/core-client.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/core-client.js +190 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/core-client.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/identify.cjs +90 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/identify.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/identify.js +90 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/identify.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/logger.cjs +64 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/logger.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/logger.js +64 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/logger.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/messages.cjs +17 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/messages.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/messages.js +17 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/messages.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.cjs +323 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +323 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/revenue.cjs +55 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/revenue.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/revenue.js +55 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/revenue.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/timeline.cjs +251 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/timeline.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/timeline.js +251 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/timeline.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/transports/base.cjs +103 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/transports/base.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +103 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/transports/base.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.cjs +15 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js +15 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/debug.cjs +126 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/debug.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js +126 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.cjs +34 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js +34 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.cjs +14 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js +14 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.cjs +9 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js +9 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.cjs +25 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js +25 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.cjs +58 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js +58 -0
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/config.cjs +21 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/config.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/config.js +21 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/config.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/index.cjs +23 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/index.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/index.js +24 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/index.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/node-client.cjs +81 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/node-client.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/node-client.js +81 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/node-client.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/plugins/context.cjs +37 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/plugins/context.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js +37 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.cjs +85 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js +67 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/version.cjs +5 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/version.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/version.js +5 -0
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/version.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/event.cjs +30 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/event.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/event.js +33 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/event.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/index.cjs +41 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/index.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/index.js +17 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/index.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/logger.cjs +11 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/logger.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/logger.js +12 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/logger.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/plugin.cjs +9 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/plugin.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/plugin.js +10 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/plugin.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/server-zone.cjs +9 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/server-zone.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/server-zone.js +10 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/server-zone.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/status.cjs +15 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/status.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/status.js +16 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/status.js.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/transport.cjs +9 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/transport.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/transport.js +10 -0
- package/dist/_node_modules/@amplitude/analytics-types/lib/esm/transport.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.cjs +1247 -0
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js +1247 -0
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/gen/version.cjs +7 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/gen/version.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/gen/version.js +8 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/gen/version.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-filter.cjs +29 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-filter.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-filter.js +30 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-filter.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-service.cjs +92 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-service.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-service.js +91 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-service.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment.cjs +25 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment.js +26 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/cookie.cjs +84 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/cookie.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/cookie.js +85 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/cookie.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/factory.cjs +37 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/factory.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/factory.js +38 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/factory.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/index.cjs +61 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/index.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/index.js +60 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/index.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/cache.cjs +87 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/cache.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/cache.js +88 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/cache.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.cjs +204 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js +205 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/fetcher.cjs +82 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/fetcher.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/fetcher.js +83 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/fetcher.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/poller.cjs +121 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/poller.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/poller.js +122 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/poller.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.cjs +166 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.js +167 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs +105 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js +106 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/types/config.cjs +38 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/types/config.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/types/config.js +39 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/types/config.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.cjs +51 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.js +52 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/cache.cjs +92 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/cache.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/cache.js +93 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/cache.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/hash.cjs +18 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/hash.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/hash.js +19 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/hash.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/logger.cjs +20 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/logger.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/logger.js +21 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/logger.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/time.cjs +13 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/time.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/time.js +14 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/time.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/user.cjs +44 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/user.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/user.js +45 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/user.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/variant.cjs +39 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/variant.cjs.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/variant.js +38 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/variant.js.map +1 -0
- package/dist/_node_modules/cross-spawn/index.cjs +1 -1
- package/dist/_node_modules/cross-spawn/index.js +1 -1
- package/dist/_node_modules/execa/_node_modules/get-stream/index.cjs +1 -1
- package/dist/_node_modules/execa/_node_modules/get-stream/index.js +1 -1
- package/dist/_node_modules/path-key/index.cjs +1 -1
- package/dist/_node_modules/path-key/index.js +1 -1
- package/dist/_node_modules/signal-exit/index.cjs +1 -1
- package/dist/_node_modules/signal-exit/index.js +1 -1
- package/dist/_node_modules/tslib/tslib.es6.cjs +206 -0
- package/dist/_node_modules/tslib/tslib.es6.cjs.map +1 -0
- package/dist/_node_modules/tslib/tslib.es6.js +207 -0
- package/dist/_node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.cjs +30 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +30 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/assignment-filter.cjs +5 -0
- package/dist/_virtual/assignment-filter.cjs.map +1 -0
- package/dist/_virtual/assignment-filter.js +5 -0
- package/dist/_virtual/assignment-filter.js.map +1 -0
- package/dist/_virtual/assignment-service.cjs +5 -0
- package/dist/_virtual/assignment-service.cjs.map +1 -0
- package/dist/_virtual/assignment-service.js +5 -0
- package/dist/_virtual/assignment-service.js.map +1 -0
- package/dist/_virtual/assignment.cjs +5 -0
- package/dist/_virtual/assignment.cjs.map +1 -0
- package/dist/_virtual/assignment.js +5 -0
- package/dist/_virtual/assignment.js.map +1 -0
- package/dist/_virtual/backoff.cjs +5 -0
- package/dist/_virtual/backoff.cjs.map +1 -0
- package/dist/_virtual/backoff.js +5 -0
- package/dist/_virtual/backoff.js.map +1 -0
- package/dist/_virtual/cache.cjs +5 -0
- package/dist/_virtual/cache.cjs.map +1 -0
- package/dist/_virtual/cache.js +5 -0
- package/dist/_virtual/cache.js.map +1 -0
- package/dist/_virtual/cache2.cjs +5 -0
- package/dist/_virtual/cache2.cjs.map +1 -0
- package/dist/_virtual/cache2.js +5 -0
- package/dist/_virtual/cache2.js.map +1 -0
- package/dist/_virtual/client.cjs +5 -0
- package/dist/_virtual/client.cjs.map +1 -0
- package/dist/_virtual/client.js +5 -0
- package/dist/_virtual/client.js.map +1 -0
- package/dist/_virtual/client2.cjs +5 -0
- package/dist/_virtual/client2.cjs.map +1 -0
- package/dist/_virtual/client2.js +5 -0
- package/dist/_virtual/client2.js.map +1 -0
- package/dist/_virtual/config.cjs +5 -0
- package/dist/_virtual/config.cjs.map +1 -0
- package/dist/_virtual/config.js +5 -0
- package/dist/_virtual/config.js.map +1 -0
- package/dist/_virtual/cookie.cjs +5 -0
- package/dist/_virtual/cookie.cjs.map +1 -0
- package/dist/_virtual/cookie.js +5 -0
- package/dist/_virtual/cookie.js.map +1 -0
- package/dist/_virtual/experiment-core.esm.cjs +6 -0
- package/dist/_virtual/experiment-core.esm.cjs.map +1 -0
- package/dist/_virtual/experiment-core.esm.js +7 -0
- package/dist/_virtual/experiment-core.esm.js.map +1 -0
- package/dist/_virtual/factory.cjs +5 -0
- package/dist/_virtual/factory.cjs.map +1 -0
- package/dist/_virtual/factory.js +5 -0
- package/dist/_virtual/factory.js.map +1 -0
- package/dist/_virtual/fetcher.cjs +5 -0
- package/dist/_virtual/fetcher.cjs.map +1 -0
- package/dist/_virtual/fetcher.js +5 -0
- package/dist/_virtual/fetcher.js.map +1 -0
- package/dist/_virtual/hash.cjs +5 -0
- package/dist/_virtual/hash.cjs.map +1 -0
- package/dist/_virtual/hash.js +5 -0
- package/dist/_virtual/hash.js.map +1 -0
- package/dist/_virtual/http.cjs +5 -0
- package/dist/_virtual/http.cjs.map +1 -0
- package/dist/_virtual/http.js +5 -0
- package/dist/_virtual/http.js.map +1 -0
- package/dist/_virtual/index.cjs +2 -2
- package/dist/_virtual/index.js +2 -2
- package/dist/_virtual/index2.cjs +4 -3
- package/dist/_virtual/index2.cjs.map +1 -1
- package/dist/_virtual/index2.js +4 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.cjs +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.cjs +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.cjs +5 -0
- package/dist/_virtual/index5.cjs.map +1 -0
- package/dist/_virtual/index5.js +5 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.cjs +5 -0
- package/dist/_virtual/index6.cjs.map +1 -0
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/logger.cjs +5 -0
- package/dist/_virtual/logger.cjs.map +1 -0
- package/dist/_virtual/logger.js +5 -0
- package/dist/_virtual/logger.js.map +1 -0
- package/dist/_virtual/poller.cjs +5 -0
- package/dist/_virtual/poller.cjs.map +1 -0
- package/dist/_virtual/poller.js +5 -0
- package/dist/_virtual/poller.js.map +1 -0
- package/dist/_virtual/time.cjs +5 -0
- package/dist/_virtual/time.cjs.map +1 -0
- package/dist/_virtual/time.js +5 -0
- package/dist/_virtual/time.js.map +1 -0
- package/dist/_virtual/user.cjs +5 -0
- package/dist/_virtual/user.cjs.map +1 -0
- package/dist/_virtual/user.js +5 -0
- package/dist/_virtual/user.js.map +1 -0
- package/dist/_virtual/variant.cjs +5 -0
- package/dist/_virtual/variant.cjs.map +1 -0
- package/dist/_virtual/variant.js +5 -0
- package/dist/_virtual/variant.js.map +1 -0
- package/dist/_virtual/version.cjs +5 -0
- package/dist/_virtual/version.cjs.map +1 -0
- package/dist/_virtual/version.js +5 -0
- package/dist/_virtual/version.js.map +1 -0
- package/dist/constants/API_TOKENS.cjs +8 -2
- package/dist/constants/API_TOKENS.cjs.map +1 -1
- package/dist/constants/API_TOKENS.d.ts +1 -0
- package/dist/constants/API_TOKENS.js +8 -2
- package/dist/constants/API_TOKENS.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/managers/telemetry/TelemetryManager.cjs +28 -0
- package/dist/managers/telemetry/TelemetryManager.cjs.map +1 -1
- package/dist/managers/telemetry/TelemetryManager.d.ts +4 -0
- package/dist/managers/telemetry/TelemetryManager.js +28 -0
- package/dist/managers/telemetry/TelemetryManager.js.map +1 -1
- package/dist/managers/telemetry/types.cjs +8 -2
- package/dist/managers/telemetry/types.cjs.map +1 -1
- package/dist/managers/telemetry/types.d.ts +11 -2
- package/dist/managers/telemetry/types.js +8 -2
- package/dist/managers/telemetry/types.js.map +1 -1
- package/package.json +4 -4
- package/src/constants/API_TOKENS.ts +9 -2
- package/src/index.ts +2 -0
- package/src/managers/telemetry/TelemetryManager.ts +42 -1
- package/src/managers/telemetry/types.ts +27 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _commonjsHelpers = require("../../../../../../_virtual/_commonjsHelpers.cjs");
|
|
3
|
+
const http = require("../../../../../../_virtual/http.cjs");
|
|
4
|
+
const require$$0 = require("http");
|
|
5
|
+
const require$$1 = require("https");
|
|
6
|
+
const require$$2 = require("url");
|
|
7
|
+
var __awaiter = _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) {
|
|
9
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
14
|
+
function fulfilled(value) {
|
|
15
|
+
try {
|
|
16
|
+
step(generator.next(value));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
reject(e);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function rejected(value) {
|
|
22
|
+
try {
|
|
23
|
+
step(generator["throw"](value));
|
|
24
|
+
} catch (e) {
|
|
25
|
+
reject(e);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function step(result) {
|
|
29
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
30
|
+
}
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__importDefault || function(mod) {
|
|
35
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(http.__exports, "__esModule", { value: true });
|
|
38
|
+
http.__exports.WrapperClient = http.__exports.FetchHttpClient = void 0;
|
|
39
|
+
const http_1 = __importDefault(require$$0);
|
|
40
|
+
const https_1 = __importDefault(require$$1);
|
|
41
|
+
const url_1 = __importDefault(require$$2);
|
|
42
|
+
const defaultHttpAgent = new https_1.default.Agent({
|
|
43
|
+
keepAlive: true
|
|
44
|
+
});
|
|
45
|
+
class FetchHttpClient {
|
|
46
|
+
constructor(httpAgent) {
|
|
47
|
+
this.httpAgent = httpAgent || defaultHttpAgent;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Wraps the http and https libraries in a fetch()-like interface
|
|
51
|
+
* @param requestUrl
|
|
52
|
+
* @param method HTTP Method (GET, POST, etc.)
|
|
53
|
+
* @param headers HTTP Headers
|
|
54
|
+
* @param Request body
|
|
55
|
+
*/
|
|
56
|
+
request(requestUrl, method, headers, body, timeoutMillis) {
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
if (timeoutMillis === 0) {
|
|
59
|
+
reject(Error("Response timed out"));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const urlParams = url_1.default.parse(requestUrl);
|
|
63
|
+
const options = Object.assign(Object.assign({}, urlParams), { method, headers, body, agent: this.httpAgent, timeout: timeoutMillis });
|
|
64
|
+
const protocol = urlParams.protocol === "http:" ? http_1.default : https_1.default;
|
|
65
|
+
const req = protocol.request(options);
|
|
66
|
+
req.on("response", (res) => {
|
|
67
|
+
res.setEncoding("utf-8");
|
|
68
|
+
let responseBody = "";
|
|
69
|
+
res.on("data", (chunk) => {
|
|
70
|
+
responseBody += chunk;
|
|
71
|
+
});
|
|
72
|
+
res.on("end", () => {
|
|
73
|
+
resolve({
|
|
74
|
+
status: res.statusCode,
|
|
75
|
+
body: responseBody
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
req.on("timeout", () => {
|
|
80
|
+
req.destroy(Error("Socket connection timed out"));
|
|
81
|
+
});
|
|
82
|
+
req.on("error", (e) => {
|
|
83
|
+
reject(e);
|
|
84
|
+
});
|
|
85
|
+
if (method !== "GET" && body) {
|
|
86
|
+
req.write(body);
|
|
87
|
+
}
|
|
88
|
+
req.end();
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
http.__exports.FetchHttpClient = FetchHttpClient;
|
|
93
|
+
class WrapperClient {
|
|
94
|
+
constructor(client) {
|
|
95
|
+
this.client = client;
|
|
96
|
+
}
|
|
97
|
+
request(request) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
http.__exports.WrapperClient = WrapperClient;
|
|
104
|
+
module.exports = http.__exports;
|
|
105
|
+
//# sourceMappingURL=http.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.cjs","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WrapperClient = exports.FetchHttpClient = void 0;\nconst http_1 = __importDefault(require(\"http\"));\nconst https_1 = __importDefault(require(\"https\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst defaultHttpAgent = new https_1.default.Agent({\n keepAlive: true,\n});\nclass FetchHttpClient {\n constructor(httpAgent) {\n this.httpAgent = httpAgent || defaultHttpAgent;\n }\n /**\n * Wraps the http and https libraries in a fetch()-like interface\n * @param requestUrl\n * @param method HTTP Method (GET, POST, etc.)\n * @param headers HTTP Headers\n * @param Request body\n */\n request(requestUrl, method, headers, body, timeoutMillis) {\n return new Promise((resolve, reject) => {\n if (timeoutMillis === 0) {\n reject(Error('Response timed out'));\n return;\n }\n const urlParams = url_1.default.parse(requestUrl);\n const options = Object.assign(Object.assign({}, urlParams), { method: method, headers: headers, body: body, agent: this.httpAgent, timeout: timeoutMillis });\n const protocol = urlParams.protocol === 'http:' ? http_1.default : https_1.default;\n const req = protocol.request(options);\n req.on('response', (res) => {\n res.setEncoding('utf-8');\n let responseBody = '';\n res.on('data', (chunk) => {\n responseBody += chunk;\n });\n res.on('end', () => {\n resolve({\n status: res.statusCode,\n body: responseBody,\n });\n });\n });\n req.on('timeout', () => {\n req.destroy(Error('Socket connection timed out'));\n });\n req.on('error', (e) => {\n reject(e);\n });\n if (method !== 'GET' && body) {\n req.write(body);\n }\n req.end();\n });\n }\n}\nexports.FetchHttpClient = FetchHttpClient;\n/**\n * Wrap the exposed HttpClient in a CoreClient implementation to work with\n * FlagApi and EvaluationApi.\n */\nclass WrapperClient {\n constructor(client) {\n this.client = client;\n }\n request(request) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);\n });\n }\n}\nexports.WrapperClient = WrapperClient;\n"],"names":["this","http"],"mappings":";;;;;;AACA,IAAI,YAAaA,iBAAI,kBAAIA,gCAAK,aAAc,SAAU,SAAS,YAAY,GAAG,WAAW;AACrF,WAAS,MAAM,OAAO;AAAE,WAAO,iBAAiB,IAAI,QAAQ,IAAI,EAAE,SAAU,SAAS;AAAE,cAAQ,KAAK;AAAA,IAAE,CAAE;AAAA,EAAI;AAC5G,SAAO,KAAK,MAAM,IAAI,UAAU,SAAU,SAAS,QAAQ;AACvD,aAAS,UAAU,OAAO;AAAE,UAAI;AAAE,aAAK,UAAU,KAAK,KAAK,CAAC;AAAA,MAAE,SAAU,GAAP;AAAY,eAAO,CAAC;AAAA;IAAM;AAC3F,aAAS,SAAS,OAAO;AAAE,UAAI;AAAE,aAAK,UAAU,OAAO,EAAE,KAAK,CAAC;AAAA,MAAI,SAAQ,GAAP;AAAY,eAAO,CAAC;AAAA;IAAM;AAC9F,aAAS,KAAK,QAAQ;AAAE,aAAO,OAAO,QAAQ,OAAO,KAAK,IAAI,MAAM,OAAO,KAAK,EAAE,KAAK,WAAW,QAAQ;AAAA,IAAI;AAC9G,UAAM,YAAY,UAAU,MAAM,SAAS,cAAc,CAAE,CAAA,GAAG,KAAI,CAAE;AAAA,EAC5E,CAAK;AACL;AACA,IAAI,kBAAmBA,iBAAI,kBAAIA,iBAAI,eAAC,mBAAoB,SAAU,KAAK;AACnE,SAAQ,OAAO,IAAI,aAAc,MAAM,EAAE,WAAW;AACxD;AACA,OAAO,eAAeC,KAAAA,WAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AAC5DA,KAAA,UAAA,gBAAwBA,KAAAA,UAAA,kBAA0B;AAClD,MAAM,SAAS,gBAAgB,UAAe;AAC9C,MAAM,UAAU,gBAAgB,UAAgB;AAChD,MAAM,QAAQ,gBAAgB,UAAc;AAC5C,MAAM,mBAAm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EAChB,YAAY,QAAQ;AAChB,SAAK,SAAS;AAAA,EACjB;AAAA,EACD,QAAQ,SAAS;AACb,WAAO,UAAU,MAAM,QAAQ,QAAQ,aAAa;AAChD,aAAO,MAAM,KAAK,OAAO,QAAQ,QAAQ,YAAY,QAAQ,QAAQ,QAAQ,SAAS,MAAM,QAAQ,aAAa;AAAA,IAC7H,CAAS;AAAA,EACJ;AACL;AACAA,KAAA,UAAA,gBAAwB;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { commonjsGlobal } from "../../../../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __exports as http } from "../../../../../../_virtual/http.js";
|
|
3
|
+
import require$$0__default from "http";
|
|
4
|
+
import require$$1__default from "https";
|
|
5
|
+
import require$$2 from "url";
|
|
6
|
+
var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
7
|
+
function adopt(value) {
|
|
8
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
9
|
+
resolve(value);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
13
|
+
function fulfilled(value) {
|
|
14
|
+
try {
|
|
15
|
+
step(generator.next(value));
|
|
16
|
+
} catch (e) {
|
|
17
|
+
reject(e);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function rejected(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator["throw"](value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function step(result) {
|
|
28
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
|
+
}
|
|
30
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function(mod) {
|
|
34
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(http, "__esModule", { value: true });
|
|
37
|
+
http.WrapperClient = http.FetchHttpClient = void 0;
|
|
38
|
+
const http_1 = __importDefault(require$$0__default);
|
|
39
|
+
const https_1 = __importDefault(require$$1__default);
|
|
40
|
+
const url_1 = __importDefault(require$$2);
|
|
41
|
+
const defaultHttpAgent = new https_1.default.Agent({
|
|
42
|
+
keepAlive: true
|
|
43
|
+
});
|
|
44
|
+
class FetchHttpClient {
|
|
45
|
+
constructor(httpAgent) {
|
|
46
|
+
this.httpAgent = httpAgent || defaultHttpAgent;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Wraps the http and https libraries in a fetch()-like interface
|
|
50
|
+
* @param requestUrl
|
|
51
|
+
* @param method HTTP Method (GET, POST, etc.)
|
|
52
|
+
* @param headers HTTP Headers
|
|
53
|
+
* @param Request body
|
|
54
|
+
*/
|
|
55
|
+
request(requestUrl, method, headers, body, timeoutMillis) {
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
if (timeoutMillis === 0) {
|
|
58
|
+
reject(Error("Response timed out"));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const urlParams = url_1.default.parse(requestUrl);
|
|
62
|
+
const options = Object.assign(Object.assign({}, urlParams), { method, headers, body, agent: this.httpAgent, timeout: timeoutMillis });
|
|
63
|
+
const protocol = urlParams.protocol === "http:" ? http_1.default : https_1.default;
|
|
64
|
+
const req = protocol.request(options);
|
|
65
|
+
req.on("response", (res) => {
|
|
66
|
+
res.setEncoding("utf-8");
|
|
67
|
+
let responseBody = "";
|
|
68
|
+
res.on("data", (chunk) => {
|
|
69
|
+
responseBody += chunk;
|
|
70
|
+
});
|
|
71
|
+
res.on("end", () => {
|
|
72
|
+
resolve({
|
|
73
|
+
status: res.statusCode,
|
|
74
|
+
body: responseBody
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
req.on("timeout", () => {
|
|
79
|
+
req.destroy(Error("Socket connection timed out"));
|
|
80
|
+
});
|
|
81
|
+
req.on("error", (e) => {
|
|
82
|
+
reject(e);
|
|
83
|
+
});
|
|
84
|
+
if (method !== "GET" && body) {
|
|
85
|
+
req.write(body);
|
|
86
|
+
}
|
|
87
|
+
req.end();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
http.FetchHttpClient = FetchHttpClient;
|
|
92
|
+
class WrapperClient {
|
|
93
|
+
constructor(client) {
|
|
94
|
+
this.client = client;
|
|
95
|
+
}
|
|
96
|
+
request(request) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
http.WrapperClient = WrapperClient;
|
|
103
|
+
export {
|
|
104
|
+
http as default
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WrapperClient = exports.FetchHttpClient = void 0;\nconst http_1 = __importDefault(require(\"http\"));\nconst https_1 = __importDefault(require(\"https\"));\nconst url_1 = __importDefault(require(\"url\"));\nconst defaultHttpAgent = new https_1.default.Agent({\n keepAlive: true,\n});\nclass FetchHttpClient {\n constructor(httpAgent) {\n this.httpAgent = httpAgent || defaultHttpAgent;\n }\n /**\n * Wraps the http and https libraries in a fetch()-like interface\n * @param requestUrl\n * @param method HTTP Method (GET, POST, etc.)\n * @param headers HTTP Headers\n * @param Request body\n */\n request(requestUrl, method, headers, body, timeoutMillis) {\n return new Promise((resolve, reject) => {\n if (timeoutMillis === 0) {\n reject(Error('Response timed out'));\n return;\n }\n const urlParams = url_1.default.parse(requestUrl);\n const options = Object.assign(Object.assign({}, urlParams), { method: method, headers: headers, body: body, agent: this.httpAgent, timeout: timeoutMillis });\n const protocol = urlParams.protocol === 'http:' ? http_1.default : https_1.default;\n const req = protocol.request(options);\n req.on('response', (res) => {\n res.setEncoding('utf-8');\n let responseBody = '';\n res.on('data', (chunk) => {\n responseBody += chunk;\n });\n res.on('end', () => {\n resolve({\n status: res.statusCode,\n body: responseBody,\n });\n });\n });\n req.on('timeout', () => {\n req.destroy(Error('Socket connection timed out'));\n });\n req.on('error', (e) => {\n reject(e);\n });\n if (method !== 'GET' && body) {\n req.write(body);\n }\n req.end();\n });\n }\n}\nexports.FetchHttpClient = FetchHttpClient;\n/**\n * Wrap the exposed HttpClient in a CoreClient implementation to work with\n * FlagApi and EvaluationApi.\n */\nclass WrapperClient {\n constructor(client) {\n this.client = client;\n }\n request(request) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.client.request(request.requestUrl, request.method, request.headers, null, request.timeoutMillis);\n });\n }\n}\nexports.WrapperClient = WrapperClient;\n"],"names":["this","require$$0","require$$1"],"mappings":";;;;;AACA,IAAI,YAAaA,kBAAQA,eAAK,aAAc,SAAU,SAAS,YAAY,GAAG,WAAW;AACrF,WAAS,MAAM,OAAO;AAAE,WAAO,iBAAiB,IAAI,QAAQ,IAAI,EAAE,SAAU,S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1
|
+
"use strict";
|
|
2
|
+
const config = require("../../../../../../_virtual/config.cjs");
|
|
3
|
+
Object.defineProperty(config.__exports, "__esModule", { value: true });
|
|
4
|
+
config.__exports.AssignmentConfigDefaults = config.__exports.LocalEvaluationDefaults = config.__exports.Defaults = config.__exports.RemoteEvaluationDefaults = void 0;
|
|
5
|
+
config.__exports.RemoteEvaluationDefaults = {
|
|
6
|
+
debug: false,
|
|
7
|
+
serverUrl: "https://api.lab.amplitude.com",
|
|
8
|
+
fetchTimeoutMillis: 1e4,
|
|
9
|
+
fetchRetries: 8,
|
|
10
|
+
fetchRetryBackoffMinMillis: 500,
|
|
11
|
+
fetchRetryBackoffMaxMillis: 1e4,
|
|
12
|
+
fetchRetryBackoffScalar: 1.5,
|
|
13
|
+
fetchRetryTimeoutMillis: 1e4,
|
|
14
|
+
httpAgent: null
|
|
15
|
+
};
|
|
16
|
+
config.__exports.Defaults = {
|
|
17
|
+
debug: false,
|
|
18
|
+
serverUrl: "https://api.lab.amplitude.com",
|
|
19
|
+
fetchTimeoutMillis: 1e4,
|
|
20
|
+
fetchRetries: 8,
|
|
21
|
+
fetchRetryBackoffMinMillis: 500,
|
|
22
|
+
fetchRetryBackoffMaxMillis: 1e4,
|
|
23
|
+
fetchRetryBackoffScalar: 1.5,
|
|
24
|
+
fetchRetryTimeoutMillis: 1e4,
|
|
25
|
+
httpAgent: null
|
|
26
|
+
};
|
|
27
|
+
config.__exports.LocalEvaluationDefaults = {
|
|
28
|
+
debug: false,
|
|
29
|
+
serverUrl: "https://api.lab.amplitude.com",
|
|
30
|
+
bootstrap: {},
|
|
31
|
+
flagConfigPollingIntervalMillis: 3e4,
|
|
32
|
+
httpAgent: null
|
|
33
|
+
};
|
|
34
|
+
config.__exports.AssignmentConfigDefaults = {
|
|
35
|
+
cacheCapacity: 65536
|
|
36
|
+
};
|
|
37
|
+
module.exports = config.__exports;
|
|
38
|
+
//# sourceMappingURL=config.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.cjs","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/types/config.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssignmentConfigDefaults = exports.LocalEvaluationDefaults = exports.Defaults = exports.RemoteEvaluationDefaults = void 0;\n/**\n Defaults for Experiment Config options\n\n | **Option** | **Default** |\n |----------------|---------------------------------|\n | **debug** | false |\n | **serverUrl** | `\"https://api.lab.amplitude.com\"` |\n | **fetchTimeoutMillis** | `10000` |\n | **fetchRetries** | `8` |\n | **fetchRetryBackoffMinMillis** | `500` |\n | **fetchRetryBackoffMaxMillis** | `10000` |\n | **fetchRetryBackoffScalar** | `1.5` |\n | **fetchRetryTimeoutMillis** | `10000` |\n | **httpAgent** | null |\n\n *\n * @category Configuration\n */\nexports.RemoteEvaluationDefaults = {\n debug: false,\n serverUrl: 'https://api.lab.amplitude.com',\n fetchTimeoutMillis: 10000,\n fetchRetries: 8,\n fetchRetryBackoffMinMillis: 500,\n fetchRetryBackoffMaxMillis: 10000,\n fetchRetryBackoffScalar: 1.5,\n fetchRetryTimeoutMillis: 10000,\n httpAgent: null,\n};\n/**\n * @deprecated use {@link RemoteEvaluationDefaults}\n */\nexports.Defaults = {\n debug: false,\n serverUrl: 'https://api.lab.amplitude.com',\n fetchTimeoutMillis: 10000,\n fetchRetries: 8,\n fetchRetryBackoffMinMillis: 500,\n fetchRetryBackoffMaxMillis: 10000,\n fetchRetryBackoffScalar: 1.5,\n fetchRetryTimeoutMillis: 10000,\n httpAgent: null,\n};\n/**\n Defaults for {@link LocalEvaluationConfig} options.\n\n | **Option** | **Default** |\n |----------------|---------------------------------|\n | **debug** | false |\n | **serverUrl** | `\"https://api.lab.amplitude.com\"` |\n | **flagConfigPollingIntervalMillis** | `30000` |\n | **httpAgent** | null |\n\n * @category Configuration\n */\nexports.LocalEvaluationDefaults = {\n debug: false,\n serverUrl: 'https://api.lab.amplitude.com',\n bootstrap: {},\n flagConfigPollingIntervalMillis: 30000,\n httpAgent: null,\n};\nexports.AssignmentConfigDefaults = {\n cacheCapacity: 65536,\n};\n"],"names":["config"],"mappings":";;AACA,OAAO,eAAeA,OAAAA,WAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AAC5BA,OAAAA,UAAA,sEAAqCA,OAAAA,UAAA,WAAmDA,OAAA,UAAA,2BAAG;AAmB3HA,OAAA,UAAA,2BAAmC;AAAA,EAC/B,OAAO;AAAA,EACP,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,4BAA4B;AAAA,EAC5B,4BAA4B;AAAA,EAC5B,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,WAAW;AACf;AAIAA,OAAA,UAAA,WAAmB;AAAA,EACf,OAAO;AAAA,EACP,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,4BAA4B;AAAA,EAC5B,4BAA4B;AAAA,EAC5B,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,WAAW;AACf;AAaAA,OAAA,UAAA,0BAAkC;AAAA,EAC9B,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW,CAAE;AAAA,EACb,iCAAiC;AAAA,EACjC,WAAW;AACf;AACAA,OAAA,UAAA,2BAAmC;AAAA,EAC/B,eAAe;AACnB;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __exports as config } from "../../../../../../_virtual/config.js";
|
|
2
|
+
Object.defineProperty(config, "__esModule", { value: true });
|
|
3
|
+
config.AssignmentConfigDefaults = config.LocalEvaluationDefaults = config.Defaults = config.RemoteEvaluationDefaults = void 0;
|
|
4
|
+
config.RemoteEvaluationDefaults = {
|
|
5
|
+
debug: false,
|
|
6
|
+
serverUrl: "https://api.lab.amplitude.com",
|
|
7
|
+
fetchTimeoutMillis: 1e4,
|
|
8
|
+
fetchRetries: 8,
|
|
9
|
+
fetchRetryBackoffMinMillis: 500,
|
|
10
|
+
fetchRetryBackoffMaxMillis: 1e4,
|
|
11
|
+
fetchRetryBackoffScalar: 1.5,
|
|
12
|
+
fetchRetryTimeoutMillis: 1e4,
|
|
13
|
+
httpAgent: null
|
|
14
|
+
};
|
|
15
|
+
config.Defaults = {
|
|
16
|
+
debug: false,
|
|
17
|
+
serverUrl: "https://api.lab.amplitude.com",
|
|
18
|
+
fetchTimeoutMillis: 1e4,
|
|
19
|
+
fetchRetries: 8,
|
|
20
|
+
fetchRetryBackoffMinMillis: 500,
|
|
21
|
+
fetchRetryBackoffMaxMillis: 1e4,
|
|
22
|
+
fetchRetryBackoffScalar: 1.5,
|
|
23
|
+
fetchRetryTimeoutMillis: 1e4,
|
|
24
|
+
httpAgent: null
|
|
25
|
+
};
|
|
26
|
+
config.LocalEvaluationDefaults = {
|
|
27
|
+
debug: false,
|
|
28
|
+
serverUrl: "https://api.lab.amplitude.com",
|
|
29
|
+
bootstrap: {},
|
|
30
|
+
flagConfigPollingIntervalMillis: 3e4,
|
|
31
|
+
httpAgent: null
|
|
32
|
+
};
|
|
33
|
+
config.AssignmentConfigDefaults = {
|
|
34
|
+
cacheCapacity: 65536
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
config as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/types/config.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AssignmentConfigDefaults = exports.LocalEvaluationDefaults = exports.Defaults = exports.RemoteEvaluationDefaults = void 0;\n/**\n Defaults for Experiment Config options\n\n | **Option** | **Default** |\n |----------------|---------------------------------|\n | **debug** | false |\n | **serverUrl** | `\"https://api.lab.amplitude.com\"` |\n | **fetchTimeoutMillis** | `10000` |\n | **fetchRetries** | `8` |\n | **fetchRetryBackoffMinMillis** | `500` |\n | **fetchRetryBackoffMaxMillis** | `10000` |\n | **fetchRetryBackoffScalar** | `1.5` |\n | **fetchRetryTimeoutMillis** | `10000` |\n | **httpAgent** | null |\n\n *\n * @category Configuration\n */\nexports.RemoteEvaluationDefaults = {\n debug: false,\n serverUrl: 'https://api.lab.amplitude.com',\n fetchTimeoutMillis: 10000,\n fetchRetries: 8,\n fetchRetryBackoffMinMillis: 500,\n fetchRetryBackoffMaxMillis: 10000,\n fetchRetryBackoffScalar: 1.5,\n fetchRetryTimeoutMillis: 10000,\n httpAgent: null,\n};\n/**\n * @deprecated use {@link RemoteEvaluationDefaults}\n */\nexports.Defaults = {\n debug: false,\n serverUrl: 'https://api.lab.amplitude.com',\n fetchTimeoutMillis: 10000,\n fetchRetries: 8,\n fetchRetryBackoffMinMillis: 500,\n fetchRetryBackoffMaxMillis: 10000,\n fetchRetryBackoffScalar: 1.5,\n fetchRetryTimeoutMillis: 10000,\n httpAgent: null,\n};\n/**\n Defaults for {@link LocalEvaluationConfig} options.\n\n | **Option** | **Default** |\n |----------------|---------------------------------|\n | **debug** | false |\n | **serverUrl** | `\"https://api.lab.amplitude.com\"` |\n | **flagConfigPollingIntervalMillis** | `30000` |\n | **httpAgent** | null |\n\n * @category Configuration\n */\nexports.LocalEvaluationDefaults = {\n debug: false,\n serverUrl: 'https://api.lab.amplitude.com',\n bootstrap: {},\n flagConfigPollingIntervalMillis: 30000,\n httpAgent: null,\n};\nexports.AssignmentConfigDefaults = {\n cacheCapacity: 65536,\n};\n"],"names":[],"mappings":";AACA,OAAO,eAAe,QAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AAC5B,OAAA,4DAAqC,OAAA,WAAmD,OAAA,2BAAG;AAmB3H,OAAA,2BAAmC;AAAA,EAC/B,OAAO;AAAA,EACP,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,4BAA4B;AAAA,EAC5B,4BAA4B;AAAA,EAC5B,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,WAAW;AACf;AAIA,OAAA,WAAmB;AAAA,EACf,OAAO;AAAA,EACP,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,4BAA4B;AAAA,EAC5B,4BAA4B;AAAA,EAC5B,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,WAAW;AACf;AAaA,OAAA,0BAAkC;AAAA,EAC9B,OAAO;AAAA,EACP,WAAW;AAAA,EACX,WAAW,CAAE;AAAA,EACb,iCAAiC;AAAA,EACjC,WAAW;AACf;AACA,OAAA,2BAAmC;AAAA,EAC/B,eAAe;AACnB;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _commonjsHelpers = require("../../../../../../_virtual/_commonjsHelpers.cjs");
|
|
3
|
+
const backoff = require("../../../../../../_virtual/backoff.cjs");
|
|
4
|
+
require("./time.cjs");
|
|
5
|
+
const time = require("../../../../../../_virtual/time.cjs");
|
|
6
|
+
var __awaiter = _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
7
|
+
function adopt(value) {
|
|
8
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
9
|
+
resolve(value);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
13
|
+
function fulfilled(value) {
|
|
14
|
+
try {
|
|
15
|
+
step(generator.next(value));
|
|
16
|
+
} catch (e) {
|
|
17
|
+
reject(e);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function rejected(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator["throw"](value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function step(result) {
|
|
28
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
|
+
}
|
|
30
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(backoff.__exports, "__esModule", { value: true });
|
|
34
|
+
backoff.__exports.doWithBackoff = void 0;
|
|
35
|
+
const time_1 = time.__exports;
|
|
36
|
+
function doWithBackoff(action, backoffPolicy) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
let delay = backoffPolicy.min;
|
|
39
|
+
for (let i = 0; i < backoffPolicy.attempts; i++) {
|
|
40
|
+
try {
|
|
41
|
+
return yield action();
|
|
42
|
+
} catch (e) {
|
|
43
|
+
yield (0, time_1.sleep)(delay);
|
|
44
|
+
delay = Math.min(delay * backoffPolicy.scalar, backoffPolicy.max);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
backoff.__exports.doWithBackoff = doWithBackoff;
|
|
50
|
+
module.exports = backoff.__exports;
|
|
51
|
+
//# sourceMappingURL=backoff.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backoff.cjs","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.doWithBackoff = void 0;\nconst time_1 = require(\"./time\");\nfunction doWithBackoff(action, backoffPolicy) {\n return __awaiter(this, void 0, void 0, function* () {\n let delay = backoffPolicy.min;\n for (let i = 0; i < backoffPolicy.attempts; i++) {\n try {\n return yield action();\n }\n catch (e) {\n yield (0, time_1.sleep)(delay);\n delay = Math.min(delay * backoffPolicy.scalar, backoffPolicy.max);\n }\n }\n });\n}\nexports.doWithBackoff = doWithBackoff;\n"],"names":["this","backoff","require$$0"],"mappings":";;;;;AACA,IAAI,YAAaA,iBAAI,kBAAIA,gCAAK,aAAc,SAAU,SAAS,YAAY,GAAG,WAAW;AACrF,WAAS,MAAM,OAAO;AAAE,WAAO,iBAAiB,IAAI,QAAQ,IAAI,EAAE,SAAU,SAAS;AAAE,cAAQ,KAAK;AAAA,IAAE,CAAE;AAAA,EAAI;AAC5G,SAAO,KAAK,MAAM,IAAI,UAAU,SAAU,SAAS,QAAQ;AACvD,aAAS,UAAU,OAAO;AAAE,UAAI;AAAE,aAAK,UAAU,KAAK,KAAK,CAAC;AAAA,MAAE,SAAU,GAAP;AAAY,eAAO,CAAC;AAAA;IAAM;AAC3F,aAAS,SAAS,OAAO;AAAE,UAAI;AAAE,aAAK,UAAU,OAAO,EAAE,KAAK,CAAC;AAAA,MAAI,SAAQ,GAAP;AAAY,eAAO,CAAC;AAAA;IAAM;AAC9F,aAAS,KAAK,QAAQ;AAAE,aAAO,OAAO,QAAQ,OAAO,KAAK,IAAI,MAAM,OAAO,KAAK,EAAE,KAAK,WAAW,QAAQ;AAAA,IAAI;AAC9G,UAAM,YAAY,UAAU,MAAM,SAAS,cAAc,CAAE,CAAA,GAAG,KAAI,CAAE;AAAA,EAC5E,CAAK;AACL;AACA,OAAO,eAAeC,QAAAA,WAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AACvCA,QAAAA,UAAA,gBAAG;AACxB,MAAM,SAASC,KAAAA;AACf,SAAS,cAAc,QAAQ,eAAe;AAC1C,SAAO,UAAU,MAAM,QAAQ,QAAQ,aAAa;AAChD,QAAI,QAAQ,cAAc;AAC1B,aAAS,IAAI,GAAG,IAAI,cAAc,UAAU,KAAK;AAC7C,UAAI;AACA,eAAO,MAAM,OAAM;AAAA,MACtB,SACM,GAAP;AACI,kBAAU,OAAO,OAAO,KAAK;AAC7B,gBAAQ,KAAK,IAAI,QAAQ,cAAc,QAAQ,cAAc,GAAG;AAAA,MACnE;AAAA,IACJ;AAAA,EACT,CAAK;AACL;AACAD,QAAA,UAAA,gBAAwB;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { commonjsGlobal } from "../../../../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __exports as backoff } from "../../../../../../_virtual/backoff.js";
|
|
3
|
+
import "./time.js";
|
|
4
|
+
import { __exports as time } from "../../../../../../_virtual/time.js";
|
|
5
|
+
var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) {
|
|
7
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
8
|
+
resolve(value);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
12
|
+
function fulfilled(value) {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.next(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function rejected(value) {
|
|
20
|
+
try {
|
|
21
|
+
step(generator["throw"](value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function step(result) {
|
|
27
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
28
|
+
}
|
|
29
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(backoff, "__esModule", { value: true });
|
|
33
|
+
backoff.doWithBackoff = void 0;
|
|
34
|
+
const time_1 = time;
|
|
35
|
+
function doWithBackoff(action, backoffPolicy) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
let delay = backoffPolicy.min;
|
|
38
|
+
for (let i = 0; i < backoffPolicy.attempts; i++) {
|
|
39
|
+
try {
|
|
40
|
+
return yield action();
|
|
41
|
+
} catch (e) {
|
|
42
|
+
yield (0, time_1.sleep)(delay);
|
|
43
|
+
delay = Math.min(delay * backoffPolicy.scalar, backoffPolicy.max);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
backoff.doWithBackoff = doWithBackoff;
|
|
49
|
+
export {
|
|
50
|
+
backoff as default
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=backoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backoff.js","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.js"],"sourcesContent":["\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.doWithBackoff = void 0;\nconst time_1 = require(\"./time\");\nfunction doWithBackoff(action, backoffPolicy) {\n return __awaiter(this, void 0, void 0, function* () {\n let delay = backoffPolicy.min;\n for (let i = 0; i < backoffPolicy.attempts; i++) {\n try {\n return yield action();\n }\n catch (e) {\n yield (0, time_1.sleep)(delay);\n delay = Math.min(delay * backoffPolicy.scalar, backoffPolicy.max);\n }\n }\n });\n}\nexports.doWithBackoff = doWithBackoff;\n"],"names":["this","require$$0"],"mappings":";;;;AACA,IAAI,YAAaA,kBAAQA,eAAK,aAA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
+
const cache = require("../../../../../../_virtual/cache2.cjs");
|
|
3
|
+
Object.defineProperty(cache.__exports, "__esModule", { value: true });
|
|
4
|
+
cache.__exports.Cache = void 0;
|
|
5
|
+
class ListNode {
|
|
6
|
+
constructor(data) {
|
|
7
|
+
this.prev = void 0;
|
|
8
|
+
this.next = void 0;
|
|
9
|
+
this.data = data;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
class Cache {
|
|
13
|
+
constructor(capacity, ttlMillis) {
|
|
14
|
+
this.capacity = capacity;
|
|
15
|
+
this.ttlMillis = ttlMillis;
|
|
16
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
17
|
+
this.head = void 0;
|
|
18
|
+
this.tail = void 0;
|
|
19
|
+
}
|
|
20
|
+
put(key, value) {
|
|
21
|
+
if (this.cache.has(key)) {
|
|
22
|
+
this.removeFromList(key);
|
|
23
|
+
} else if (this.cache.size >= this.capacity) {
|
|
24
|
+
this.evictLRU();
|
|
25
|
+
}
|
|
26
|
+
const cacheItem = {
|
|
27
|
+
key,
|
|
28
|
+
value,
|
|
29
|
+
createdAt: Date.now()
|
|
30
|
+
};
|
|
31
|
+
const node = new ListNode(cacheItem);
|
|
32
|
+
this.cache.set(key, node);
|
|
33
|
+
this.insertToList(node);
|
|
34
|
+
}
|
|
35
|
+
get(key) {
|
|
36
|
+
const node = this.cache.get(key);
|
|
37
|
+
if (node) {
|
|
38
|
+
const timeElapsed = Date.now() - node.data.createdAt;
|
|
39
|
+
if (timeElapsed > this.ttlMillis) {
|
|
40
|
+
this.remove(key);
|
|
41
|
+
return void 0;
|
|
42
|
+
}
|
|
43
|
+
this.removeFromList(key);
|
|
44
|
+
this.insertToList(node);
|
|
45
|
+
return node.data.value;
|
|
46
|
+
}
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
remove(key) {
|
|
50
|
+
this.removeFromList(key);
|
|
51
|
+
this.cache.delete(key);
|
|
52
|
+
}
|
|
53
|
+
clear() {
|
|
54
|
+
this.cache.clear();
|
|
55
|
+
this.head = void 0;
|
|
56
|
+
this.tail = void 0;
|
|
57
|
+
}
|
|
58
|
+
evictLRU() {
|
|
59
|
+
if (this.head) {
|
|
60
|
+
this.remove(this.head.data.key);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
removeFromList(key) {
|
|
64
|
+
const node = this.cache.get(key);
|
|
65
|
+
if (node) {
|
|
66
|
+
if (node.prev) {
|
|
67
|
+
node.prev.next = node.next;
|
|
68
|
+
} else {
|
|
69
|
+
this.head = node.next;
|
|
70
|
+
}
|
|
71
|
+
if (node.next) {
|
|
72
|
+
node.next.prev = node.prev;
|
|
73
|
+
} else {
|
|
74
|
+
this.tail = node.prev;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
insertToList(node) {
|
|
79
|
+
if (this.tail) {
|
|
80
|
+
this.tail.next = node;
|
|
81
|
+
node.prev = this.tail;
|
|
82
|
+
node.next = void 0;
|
|
83
|
+
this.tail = node;
|
|
84
|
+
} else {
|
|
85
|
+
this.head = node;
|
|
86
|
+
this.tail = node;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
cache.__exports.Cache = Cache;
|
|
91
|
+
module.exports = cache.__exports;
|
|
92
|
+
//# sourceMappingURL=cache.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.cjs","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/util/cache.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Cache = void 0;\nclass ListNode {\n constructor(data) {\n this.prev = undefined;\n this.next = undefined;\n this.data = data;\n }\n}\nclass Cache {\n constructor(capacity, ttlMillis) {\n this.capacity = capacity;\n this.ttlMillis = ttlMillis;\n this.cache = new Map();\n this.head = undefined;\n this.tail = undefined;\n }\n put(key, value) {\n if (this.cache.has(key)) {\n this.removeFromList(key);\n }\n else if (this.cache.size >= this.capacity) {\n this.evictLRU();\n }\n const cacheItem = {\n key,\n value,\n createdAt: Date.now(),\n };\n const node = new ListNode(cacheItem);\n this.cache.set(key, node);\n this.insertToList(node);\n }\n get(key) {\n const node = this.cache.get(key);\n if (node) {\n const timeElapsed = Date.now() - node.data.createdAt;\n if (timeElapsed > this.ttlMillis) {\n this.remove(key);\n return undefined;\n }\n this.removeFromList(key);\n this.insertToList(node);\n return node.data.value;\n }\n return undefined;\n }\n remove(key) {\n this.removeFromList(key);\n this.cache.delete(key);\n }\n clear() {\n this.cache.clear();\n this.head = undefined;\n this.tail = undefined;\n }\n evictLRU() {\n if (this.head) {\n this.remove(this.head.data.key);\n }\n }\n removeFromList(key) {\n const node = this.cache.get(key);\n if (node) {\n if (node.prev) {\n node.prev.next = node.next;\n }\n else {\n this.head = node.next;\n }\n if (node.next) {\n node.next.prev = node.prev;\n }\n else {\n this.tail = node.prev;\n }\n }\n }\n insertToList(node) {\n if (this.tail) {\n this.tail.next = node;\n node.prev = this.tail;\n node.next = undefined;\n this.tail = node;\n }\n else {\n this.head = node;\n this.tail = node;\n }\n }\n}\nexports.Cache = Cache;\n"],"names":["cache"],"mappings":";;AACA,OAAO,eAAeA,MAAAA,WAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AAC/CA,MAAAA,UAAA,QAAG;AAChB,MAAM,SAAS;AAAA,EACX,YAAY,MAAM;AACd,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACf;AACL;AACA,MAAM,MAAM;AAAA,EACR,YAAY,UAAU,WAAW;AAC7B,SAAK,WAAW;AAChB,SAAK,YAAY;AACjB,SAAK,QAAQ,oBAAI;AACjB,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACf;AAAA,EACD,IAAI,KAAK,OAAO;AACZ,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACrB,WAAK,eAAe,GAAG;AAAA,IAC1B,WACQ,KAAK,MAAM,QAAQ,KAAK,UAAU;AACvC,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WAAK,OAAO;AAAA,IACf,OACI;AACD,WAAK,OAAO;AACZ,WAAK,OAAO;AAAA,IACf;AAAA,EACJ;AACL;AACAA,MAAA,UAAA,QAAgB;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { __exports as cache } from "../../../../../../_virtual/cache2.js";
|
|
2
|
+
Object.defineProperty(cache, "__esModule", { value: true });
|
|
3
|
+
cache.Cache = void 0;
|
|
4
|
+
class ListNode {
|
|
5
|
+
constructor(data) {
|
|
6
|
+
this.prev = void 0;
|
|
7
|
+
this.next = void 0;
|
|
8
|
+
this.data = data;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class Cache {
|
|
12
|
+
constructor(capacity, ttlMillis) {
|
|
13
|
+
this.capacity = capacity;
|
|
14
|
+
this.ttlMillis = ttlMillis;
|
|
15
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
16
|
+
this.head = void 0;
|
|
17
|
+
this.tail = void 0;
|
|
18
|
+
}
|
|
19
|
+
put(key, value) {
|
|
20
|
+
if (this.cache.has(key)) {
|
|
21
|
+
this.removeFromList(key);
|
|
22
|
+
} else if (this.cache.size >= this.capacity) {
|
|
23
|
+
this.evictLRU();
|
|
24
|
+
}
|
|
25
|
+
const cacheItem = {
|
|
26
|
+
key,
|
|
27
|
+
value,
|
|
28
|
+
createdAt: Date.now()
|
|
29
|
+
};
|
|
30
|
+
const node = new ListNode(cacheItem);
|
|
31
|
+
this.cache.set(key, node);
|
|
32
|
+
this.insertToList(node);
|
|
33
|
+
}
|
|
34
|
+
get(key) {
|
|
35
|
+
const node = this.cache.get(key);
|
|
36
|
+
if (node) {
|
|
37
|
+
const timeElapsed = Date.now() - node.data.createdAt;
|
|
38
|
+
if (timeElapsed > this.ttlMillis) {
|
|
39
|
+
this.remove(key);
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
this.removeFromList(key);
|
|
43
|
+
this.insertToList(node);
|
|
44
|
+
return node.data.value;
|
|
45
|
+
}
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
remove(key) {
|
|
49
|
+
this.removeFromList(key);
|
|
50
|
+
this.cache.delete(key);
|
|
51
|
+
}
|
|
52
|
+
clear() {
|
|
53
|
+
this.cache.clear();
|
|
54
|
+
this.head = void 0;
|
|
55
|
+
this.tail = void 0;
|
|
56
|
+
}
|
|
57
|
+
evictLRU() {
|
|
58
|
+
if (this.head) {
|
|
59
|
+
this.remove(this.head.data.key);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
removeFromList(key) {
|
|
63
|
+
const node = this.cache.get(key);
|
|
64
|
+
if (node) {
|
|
65
|
+
if (node.prev) {
|
|
66
|
+
node.prev.next = node.next;
|
|
67
|
+
} else {
|
|
68
|
+
this.head = node.next;
|
|
69
|
+
}
|
|
70
|
+
if (node.next) {
|
|
71
|
+
node.next.prev = node.prev;
|
|
72
|
+
} else {
|
|
73
|
+
this.tail = node.prev;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
insertToList(node) {
|
|
78
|
+
if (this.tail) {
|
|
79
|
+
this.tail.next = node;
|
|
80
|
+
node.prev = this.tail;
|
|
81
|
+
node.next = void 0;
|
|
82
|
+
this.tail = node;
|
|
83
|
+
} else {
|
|
84
|
+
this.head = node;
|
|
85
|
+
this.tail = node;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
cache.Cache = Cache;
|
|
90
|
+
export {
|
|
91
|
+
cache as default
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=cache.js.map
|