@slicemachine/manager 0.17.8-beta.4 → 0.17.8-beta.6
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 +3 -2
- 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,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const cookie = require("../../../../../_virtual/cookie.cjs");
|
|
3
|
+
require("./util/logger.cjs");
|
|
4
|
+
const logger = require("../../../../../_virtual/logger.cjs");
|
|
5
|
+
Object.defineProperty(cookie.__exports, "__esModule", { value: true });
|
|
6
|
+
cookie.__exports.AmplitudeCookie = void 0;
|
|
7
|
+
const logger_1 = logger.__exports;
|
|
8
|
+
class AmplitudeCookie {
|
|
9
|
+
/**
|
|
10
|
+
* @param amplitudeApiKey The Amplitude API Key
|
|
11
|
+
* @param newFormat True if the cookie is in the Browser SDK 2.0 format
|
|
12
|
+
* @returns The cookie name that Amplitude sets for the provided
|
|
13
|
+
* Amplitude API Key
|
|
14
|
+
*/
|
|
15
|
+
static cookieName(amplitudeApiKey, newFormat = false) {
|
|
16
|
+
if (newFormat) {
|
|
17
|
+
if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 10) {
|
|
18
|
+
throw Error("Invalid Amplitude API Key");
|
|
19
|
+
} else {
|
|
20
|
+
return "AMP_" + amplitudeApiKey.substring(0, 10);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 6) {
|
|
24
|
+
throw Error("Invalid Amplitude API Key");
|
|
25
|
+
}
|
|
26
|
+
return "amp_" + amplitudeApiKey.substring(0, 6);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @param amplitudeCookie A string from the amplitude cookie
|
|
30
|
+
* @param newFormat True if the cookie is in the Browser SDK 2.0 format
|
|
31
|
+
* @returns a ExperimentUser context containing a device_id and user_id
|
|
32
|
+
* (if available)
|
|
33
|
+
*/
|
|
34
|
+
static parse(amplitudeCookie, newFormat = false) {
|
|
35
|
+
if (newFormat) {
|
|
36
|
+
const decoding = Buffer.from(amplitudeCookie, "base64").toString("utf-8");
|
|
37
|
+
try {
|
|
38
|
+
const userSession = JSON.parse(decodeURIComponent(decoding));
|
|
39
|
+
return {
|
|
40
|
+
device_id: userSession.deviceId,
|
|
41
|
+
user_id: userSession.userId
|
|
42
|
+
};
|
|
43
|
+
} catch (e) {
|
|
44
|
+
const logger2 = new logger_1.ConsoleLogger(true);
|
|
45
|
+
logger2.error(`Error parsing the Amplitude cookie: ${e.message}`);
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const values = amplitudeCookie.split(".");
|
|
50
|
+
let user_id = void 0;
|
|
51
|
+
if (values[1]) {
|
|
52
|
+
try {
|
|
53
|
+
user_id = Buffer.from(values[1], "base64").toString("utf-8");
|
|
54
|
+
} catch (e) {
|
|
55
|
+
user_id = void 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
device_id: values[0],
|
|
60
|
+
user_id
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Generates a cookie string to set for the Amplitude Javascript SDK
|
|
65
|
+
* @param deviceId A device id to set
|
|
66
|
+
* @param newFormat True if the cookie is in the Browser SDK 2.0 format
|
|
67
|
+
* @returns A cookie string to set for the Amplitude Javascript SDK to read
|
|
68
|
+
*/
|
|
69
|
+
static generate(deviceId, newFormat = false) {
|
|
70
|
+
if (!newFormat) {
|
|
71
|
+
return deviceId + "..........";
|
|
72
|
+
}
|
|
73
|
+
const userSessionHash = {
|
|
74
|
+
deviceId
|
|
75
|
+
};
|
|
76
|
+
const json_data = JSON.stringify(userSessionHash);
|
|
77
|
+
const encoded_json = encodeURIComponent(json_data);
|
|
78
|
+
const base64Encoded = Buffer.from(encoded_json).toString("base64");
|
|
79
|
+
return base64Encoded;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
cookie.__exports.AmplitudeCookie = AmplitudeCookie;
|
|
83
|
+
module.exports = cookie.__exports;
|
|
84
|
+
//# sourceMappingURL=cookie.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookie.cjs","sources":["../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/cookie.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AmplitudeCookie = void 0;\nconst logger_1 = require(\"./util/logger\");\n/**\n * This class provides utility functions for parsing and handling identity\n * from Amplitude cookies.\n */\nclass AmplitudeCookie {\n /**\n * @param amplitudeApiKey The Amplitude API Key\n * @param newFormat True if the cookie is in the Browser SDK 2.0 format\n * @returns The cookie name that Amplitude sets for the provided\n * Amplitude API Key\n */\n static cookieName(amplitudeApiKey, newFormat = false) {\n if (newFormat) {\n if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 10) {\n throw Error('Invalid Amplitude API Key');\n }\n else {\n return 'AMP_' + amplitudeApiKey.substring(0, 10);\n }\n }\n if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 6) {\n throw Error('Invalid Amplitude API Key');\n }\n return 'amp_' + amplitudeApiKey.substring(0, 6);\n }\n /**\n * @param amplitudeCookie A string from the amplitude cookie\n * @param newFormat True if the cookie is in the Browser SDK 2.0 format\n * @returns a ExperimentUser context containing a device_id and user_id\n * (if available)\n */\n static parse(amplitudeCookie, newFormat = false) {\n if (newFormat) {\n const decoding = Buffer.from(amplitudeCookie, 'base64').toString('utf-8');\n try {\n const userSession = JSON.parse(decodeURIComponent(decoding));\n return {\n device_id: userSession.deviceId,\n user_id: userSession.userId,\n };\n }\n catch (e) {\n const logger = new logger_1.ConsoleLogger(true);\n logger.error(`Error parsing the Amplitude cookie: ${e.message}`);\n return {};\n }\n }\n const values = amplitudeCookie.split('.');\n let user_id = undefined;\n if (values[1]) {\n try {\n user_id = Buffer.from(values[1], 'base64').toString('utf-8');\n }\n catch (e) {\n user_id = undefined;\n }\n }\n return {\n device_id: values[0],\n user_id,\n };\n }\n /**\n * Generates a cookie string to set for the Amplitude Javascript SDK\n * @param deviceId A device id to set\n * @param newFormat True if the cookie is in the Browser SDK 2.0 format\n * @returns A cookie string to set for the Amplitude Javascript SDK to read\n */\n static generate(deviceId, newFormat = false) {\n if (!newFormat) {\n return deviceId + '..........';\n }\n const userSessionHash = {\n deviceId: deviceId,\n };\n const json_data = JSON.stringify(userSessionHash);\n const encoded_json = encodeURIComponent(json_data);\n const base64Encoded = Buffer.from(encoded_json).toString('base64');\n return base64Encoded;\n }\n}\nexports.AmplitudeCookie = AmplitudeCookie;\n"],"names":["cookie","require$$0","logger"],"mappings":";;;;AACA,OAAO,eAAeA,OAAAA,WAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AACrCA,OAAAA,UAAA,kBAAG;AAC1B,MAAM,WAAWC,OAAAA;AAKjB,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlB,OAAO,WAAW,iBAAiB,YAAY,OAAO;AAClD,QAAI,WAAW;AACX,WAAK,oBAAoB,QAAQ,oBAAoB,SAAS,SAAS,gBAAgB,UAAU,IAAI;AACjG,cAAM,MAAM,2BAA2B;AAAA,MAC1C,OACI;AAC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KAAK,YAAY,EAAE,SAAS,QAAQ;AACjE,WAAO;AAAA,EACV;AACL;AACAF,OAAA,UAAA,kBAA0B;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { __exports as cookie } from "../../../../../_virtual/cookie.js";
|
|
2
|
+
import "./util/logger.js";
|
|
3
|
+
import { __exports as logger } from "../../../../../_virtual/logger.js";
|
|
4
|
+
Object.defineProperty(cookie, "__esModule", { value: true });
|
|
5
|
+
cookie.AmplitudeCookie = void 0;
|
|
6
|
+
const logger_1 = logger;
|
|
7
|
+
class AmplitudeCookie {
|
|
8
|
+
/**
|
|
9
|
+
* @param amplitudeApiKey The Amplitude API Key
|
|
10
|
+
* @param newFormat True if the cookie is in the Browser SDK 2.0 format
|
|
11
|
+
* @returns The cookie name that Amplitude sets for the provided
|
|
12
|
+
* Amplitude API Key
|
|
13
|
+
*/
|
|
14
|
+
static cookieName(amplitudeApiKey, newFormat = false) {
|
|
15
|
+
if (newFormat) {
|
|
16
|
+
if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 10) {
|
|
17
|
+
throw Error("Invalid Amplitude API Key");
|
|
18
|
+
} else {
|
|
19
|
+
return "AMP_" + amplitudeApiKey.substring(0, 10);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 6) {
|
|
23
|
+
throw Error("Invalid Amplitude API Key");
|
|
24
|
+
}
|
|
25
|
+
return "amp_" + amplitudeApiKey.substring(0, 6);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @param amplitudeCookie A string from the amplitude cookie
|
|
29
|
+
* @param newFormat True if the cookie is in the Browser SDK 2.0 format
|
|
30
|
+
* @returns a ExperimentUser context containing a device_id and user_id
|
|
31
|
+
* (if available)
|
|
32
|
+
*/
|
|
33
|
+
static parse(amplitudeCookie, newFormat = false) {
|
|
34
|
+
if (newFormat) {
|
|
35
|
+
const decoding = Buffer.from(amplitudeCookie, "base64").toString("utf-8");
|
|
36
|
+
try {
|
|
37
|
+
const userSession = JSON.parse(decodeURIComponent(decoding));
|
|
38
|
+
return {
|
|
39
|
+
device_id: userSession.deviceId,
|
|
40
|
+
user_id: userSession.userId
|
|
41
|
+
};
|
|
42
|
+
} catch (e) {
|
|
43
|
+
const logger2 = new logger_1.ConsoleLogger(true);
|
|
44
|
+
logger2.error(`Error parsing the Amplitude cookie: ${e.message}`);
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const values = amplitudeCookie.split(".");
|
|
49
|
+
let user_id = void 0;
|
|
50
|
+
if (values[1]) {
|
|
51
|
+
try {
|
|
52
|
+
user_id = Buffer.from(values[1], "base64").toString("utf-8");
|
|
53
|
+
} catch (e) {
|
|
54
|
+
user_id = void 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
device_id: values[0],
|
|
59
|
+
user_id
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Generates a cookie string to set for the Amplitude Javascript SDK
|
|
64
|
+
* @param deviceId A device id to set
|
|
65
|
+
* @param newFormat True if the cookie is in the Browser SDK 2.0 format
|
|
66
|
+
* @returns A cookie string to set for the Amplitude Javascript SDK to read
|
|
67
|
+
*/
|
|
68
|
+
static generate(deviceId, newFormat = false) {
|
|
69
|
+
if (!newFormat) {
|
|
70
|
+
return deviceId + "..........";
|
|
71
|
+
}
|
|
72
|
+
const userSessionHash = {
|
|
73
|
+
deviceId
|
|
74
|
+
};
|
|
75
|
+
const json_data = JSON.stringify(userSessionHash);
|
|
76
|
+
const encoded_json = encodeURIComponent(json_data);
|
|
77
|
+
const base64Encoded = Buffer.from(encoded_json).toString("base64");
|
|
78
|
+
return base64Encoded;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
cookie.AmplitudeCookie = AmplitudeCookie;
|
|
82
|
+
export {
|
|
83
|
+
cookie as default
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=cookie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookie.js","sources":["../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/cookie.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AmplitudeCookie = void 0;\nconst logger_1 = require(\"./util/logger\");\n/**\n * This class provides utility functions for parsing and handling identity\n * from Amplitude cookies.\n */\nclass AmplitudeCookie {\n /**\n * @param amplitudeApiKey The Amplitude API Key\n * @param newFormat True if the cookie is in the Browser SDK 2.0 format\n * @returns The cookie name that Amplitude sets for the provided\n * Amplitude API Key\n */\n static cookieName(amplitudeApiKey, newFormat = false) {\n if (newFormat) {\n if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 10) {\n throw Error('Invalid Amplitude API Key');\n }\n else {\n return 'AMP_' + amplitudeApiKey.substring(0, 10);\n }\n }\n if ((amplitudeApiKey === null || amplitudeApiKey === void 0 ? void 0 : amplitudeApiKey.length) < 6) {\n throw Error('Invalid Amplitude API Key');\n }\n return 'amp_' + amplitudeApiKey.substring(0, 6);\n }\n /**\n * @param amplitudeCookie A string from the amplitude cookie\n * @param newFormat True if the cookie is in the Browser SDK 2.0 format\n * @returns a ExperimentUser context containing a device_id and user_id\n * (if available)\n */\n static parse(amplitudeCookie, newFormat = false) {\n if (newFormat) {\n const decoding = Buffer.from(amplitudeCookie, 'base64').toString('utf-8');\n try {\n const userSession = JSON.parse(decodeURIComponent(decoding));\n return {\n device_id: userSession.deviceId,\n user_id: userSession.userId,\n };\n }\n catch (e) {\n const logger = new logger_1.ConsoleLogger(true);\n logger.error(`Error parsing the Amplitude cookie: ${e.message}`);\n return {};\n }\n }\n const values = amplitudeCookie.split('.');\n let user_id = undefined;\n if (values[1]) {\n try {\n user_id = Buffer.from(values[1], 'base64').toString('utf-8');\n }\n catch (e) {\n user_id = undefined;\n }\n }\n return {\n device_id: values[0],\n user_id,\n };\n }\n /**\n * Generates a cookie string to set for the Amplitude Javascript SDK\n * @param deviceId A device id to set\n * @param newFormat True if the cookie is in the Browser SDK 2.0 format\n * @returns A cookie string to set for the Amplitude Javascript SDK to read\n */\n static generate(deviceId, newFormat = false) {\n if (!newFormat) {\n return deviceId + '..........';\n }\n const userSessionHash = {\n deviceId: deviceId,\n };\n const json_data = JSON.stringify(userSessionHash);\n const encoded_json = encodeURIComponent(json_data);\n const base64Encoded = Buffer.from(encoded_json).toString('base64');\n return base64Encoded;\n }\n}\nexports.AmplitudeCookie = AmplitudeCookie;\n"],"names":["require$$0","logger"],"mappings":";;;AACA,OAAO,eAAe,QAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AACrC,OAAA,kBAAG;AAC1B,MAAM,WAAWA;AAKjB,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlB,OAAO,WAAW,iBAAiB,YAAY,OAAO;AAClD,QAAI,WAAW;AACX,WAAK,oBAAoB,QAAQ,oBAAoB,SAAS,SAAS,gBAAgB,UAAU,IAAI;AACjG,cAAM,MAAM,2BAA2B;AAAA,MAC1C,OACI;AACD,eAAO,SAAS,gBAAgB,UAAU,GAAG,EAAE;AAAA,MAClD;AAAA,IACJ;AACD,SAAK,oBAAoB,QAAQ,oBAAoB,SAAS,SAAS,gBAAgB,UAAU,GAAG;AAChG,YAAM,MAAM,2BAA2B;AAAA,IAC1C;AACD,WAAO,SAAS,gBAAgB,UAAU,GAAG,CAAC;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,OAAO,MAAM,iBAAiB,YAAY,OAAO;AAC7C,QAAI,WAAW;AACX,YAAM,WAAW,OAAO,KAAK,iBAAiB,QAAQ,EAAE,SAAS,OAAO;AACxE,UAAI;AACA,cAAM,cAAc,KAAK,MAAM,mBAAmB,QAAQ,CAAC;AAC3D,eAAO;AAAA,UACH,WAAW,YAAY;AAAA,UACvB,SAAS,YAAY;AAAA,QACzC;AAAA,MACa,SACM,GAAP;AACI,cAAMC,UAAS,IAAI,SAAS,cAAc,IAAI;AAC9C,QAAAA,QAAO,MAAM,uCAAuC,EAAE,SAAS;AAC/D,eAAO;MACV;AAAA,IACJ;AACD,UAAM,SAAS,gBAAgB,MAAM,GAAG;AACxC,QAAI,UAAU;AACd,QAAI,OAAO,CAAC,GAAG;AACX,UAAI;AACA,kBAAU,OAAO,KAAK,OAAO,CAAC,GAAG,QAAQ,EAAE,SAAS,OAAO;AAAA,MAC9D,SACM,GAAP;AACI,kBAAU;AAAA,MACb;AAAA,IACJ;AACD,WAAO;AAAA,MACH,WAAW,OAAO,CAAC;AAAA,MACnB;AAAA,IACZ;AAAA,EACK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,OAAO,SAAS,UAAU,YAAY,OAAO;AACzC,QAAI,CAAC,WAAW;AACZ,aAAO,WAAW;AAAA,IACrB;AACD,UAAM,kBAAkB;AAAA,MACpB;AAAA,IACZ;AACQ,UAAM,YAAY,KAAK,UAAU,eAAe;AAChD,UAAM,eAAe,mBAAmB,SAAS;AACjD,UAAM,gBAAgB,OAAO,KAAK,YAAY,EAAE,SAAS,QAAQ;AACjE,WAAO;AAAA,EACV;AACL;AACA,OAAA,kBAA0B;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const factory = require("../../../../../_virtual/factory.cjs");
|
|
3
|
+
require("./local/cache.cjs");
|
|
4
|
+
require("./local/client.cjs");
|
|
5
|
+
require("./remote/client.cjs");
|
|
6
|
+
const cache = require("../../../../../_virtual/cache.cjs");
|
|
7
|
+
const client = require("../../../../../_virtual/client2.cjs");
|
|
8
|
+
const client$1 = require("../../../../../_virtual/client.cjs");
|
|
9
|
+
Object.defineProperty(factory.__exports, "__esModule", { value: true });
|
|
10
|
+
factory.__exports.Experiment = void 0;
|
|
11
|
+
const cache_1 = cache.__exports;
|
|
12
|
+
const client_1 = client.__exports;
|
|
13
|
+
const client_2 = client$1.__exports;
|
|
14
|
+
const remoteEvaluationInstances = {};
|
|
15
|
+
const localEvaluationInstances = {};
|
|
16
|
+
const initialize = (apiKey, config) => {
|
|
17
|
+
return initializeRemote(apiKey, config);
|
|
18
|
+
};
|
|
19
|
+
const initializeRemote = (apiKey, config) => {
|
|
20
|
+
if (!remoteEvaluationInstances[apiKey]) {
|
|
21
|
+
remoteEvaluationInstances[apiKey] = new client_2.RemoteEvaluationClient(apiKey, config);
|
|
22
|
+
}
|
|
23
|
+
return remoteEvaluationInstances[apiKey];
|
|
24
|
+
};
|
|
25
|
+
const initializeLocal = (apiKey, config) => {
|
|
26
|
+
if (!localEvaluationInstances[apiKey]) {
|
|
27
|
+
localEvaluationInstances[apiKey] = new client_1.LocalEvaluationClient(apiKey, config, new cache_1.InMemoryFlagConfigCache());
|
|
28
|
+
}
|
|
29
|
+
return localEvaluationInstances[apiKey];
|
|
30
|
+
};
|
|
31
|
+
factory.__exports.Experiment = {
|
|
32
|
+
initialize,
|
|
33
|
+
initializeRemote,
|
|
34
|
+
initializeLocal
|
|
35
|
+
};
|
|
36
|
+
module.exports = factory.__exports;
|
|
37
|
+
//# sourceMappingURL=factory.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.cjs","sources":["../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/factory.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Experiment = void 0;\nconst cache_1 = require(\"./local/cache\");\nconst client_1 = require(\"./local/client\");\nconst client_2 = require(\"./remote/client\");\nconst remoteEvaluationInstances = {};\nconst localEvaluationInstances = {};\n/**\n * Initializes a singleton {@link ExperimentClient} for remote evaluation.\n *\n * @param apiKey The environment API Key\n * @param config See {@link ExperimentConfig} for config options\n * @deprecated use initializeRemote\n */\nconst initialize = (apiKey, config) => {\n return initializeRemote(apiKey, config);\n};\n/**\n * Initializes a remote evaluation client.\n *\n * @param apiKey The environment API Key\n * @param config See {@link ExperimentConfig} for config options\n */\nconst initializeRemote = (apiKey, config) => {\n if (!remoteEvaluationInstances[apiKey]) {\n remoteEvaluationInstances[apiKey] = new client_2.RemoteEvaluationClient(apiKey, config);\n }\n return remoteEvaluationInstances[apiKey];\n};\n/**\n * Initialize a local evaluation client.\n *\n * A local evaluation client can evaluate local flags or experiments for a user\n * without requiring a remote call to the amplitude evaluation server. In order\n * to best leverage local evaluation, all flags and experiments being evaluated\n * server side should be configured as local.\n *\n * @param apiKey The environment API Key\n * @param config See {@link ExperimentConfig} for config options\n * @returns The local evaluation client.\n */\nconst initializeLocal = (apiKey, config) => {\n if (!localEvaluationInstances[apiKey]) {\n localEvaluationInstances[apiKey] = new client_1.LocalEvaluationClient(apiKey, config, new cache_1.InMemoryFlagConfigCache());\n }\n return localEvaluationInstances[apiKey];\n};\n/**\n * Provides factory methods for storing singleton instances of\n * {@link ExperimentClient}.\n *\n * @category Core Usage\n */\nexports.Experiment = {\n initialize,\n initializeRemote,\n initializeLocal,\n};\n"],"names":["factory","require$$0","require$$1","require$$2"],"mappings":";;;;;;;;AACA,OAAO,eAAeA,QAAAA,WAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AAC1CA,QAAAA,UAAA,aAAG;AACrB,MAAM,UAAUC,MAAAA;AAChB,MAAM,WAAWC,OAAAA;AACjB,MAAM,WAAWC,SAAAA;AACjB,MAAM,4BAA4B,CAAA;AAClC,MAAM,2BAA2B,CAAA;AAQjC,MAAM,aAAa,CAAC,QAAQ,WAAW;AACnC,SAAO,iBAAiB,QAAQ,MAAM;AAC1C;AAOA,MAAM,mBAAmB,CAAC,QAAQ,WAAW;AACzC,MAAI,CAAC,0BAA0B,MAAM,GAAG;AACpC,8BAA0B,MAAM,IAAI,IAAI,SAAS,uBAAuB,QAAQ,MAAM;AAAA,EACzF;AACD,SAAO,0BAA0B,MAAM;AAC3C;AAaA,MAAM,kBAAkB,CAAC,QAAQ,WAAW;AACxC,MAAI,CAAC,yBAAyB,MAAM,GAAG;AACnC,6BAAyB,MAAM,IAAI,IAAI,SAAS,sBAAsB,QAAQ,QAAQ,IAAI,QAAQ,wBAAuB,CAAE;AAAA,EAC9H;AACD,SAAO,yBAAyB,MAAM;AAC1C;AAOAH,QAAA,UAAA,aAAqB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AACJ;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { __exports as factory } from "../../../../../_virtual/factory.js";
|
|
2
|
+
import "./local/cache.js";
|
|
3
|
+
import "./local/client.js";
|
|
4
|
+
import "./remote/client.js";
|
|
5
|
+
import { __exports as cache } from "../../../../../_virtual/cache.js";
|
|
6
|
+
import { __exports as client } from "../../../../../_virtual/client2.js";
|
|
7
|
+
import { __exports as client$1 } from "../../../../../_virtual/client.js";
|
|
8
|
+
Object.defineProperty(factory, "__esModule", { value: true });
|
|
9
|
+
factory.Experiment = void 0;
|
|
10
|
+
const cache_1 = cache;
|
|
11
|
+
const client_1 = client;
|
|
12
|
+
const client_2 = client$1;
|
|
13
|
+
const remoteEvaluationInstances = {};
|
|
14
|
+
const localEvaluationInstances = {};
|
|
15
|
+
const initialize = (apiKey, config) => {
|
|
16
|
+
return initializeRemote(apiKey, config);
|
|
17
|
+
};
|
|
18
|
+
const initializeRemote = (apiKey, config) => {
|
|
19
|
+
if (!remoteEvaluationInstances[apiKey]) {
|
|
20
|
+
remoteEvaluationInstances[apiKey] = new client_2.RemoteEvaluationClient(apiKey, config);
|
|
21
|
+
}
|
|
22
|
+
return remoteEvaluationInstances[apiKey];
|
|
23
|
+
};
|
|
24
|
+
const initializeLocal = (apiKey, config) => {
|
|
25
|
+
if (!localEvaluationInstances[apiKey]) {
|
|
26
|
+
localEvaluationInstances[apiKey] = new client_1.LocalEvaluationClient(apiKey, config, new cache_1.InMemoryFlagConfigCache());
|
|
27
|
+
}
|
|
28
|
+
return localEvaluationInstances[apiKey];
|
|
29
|
+
};
|
|
30
|
+
factory.Experiment = {
|
|
31
|
+
initialize,
|
|
32
|
+
initializeRemote,
|
|
33
|
+
initializeLocal
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
factory as default
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sources":["../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/factory.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Experiment = void 0;\nconst cache_1 = require(\"./local/cache\");\nconst client_1 = require(\"./local/client\");\nconst client_2 = require(\"./remote/client\");\nconst remoteEvaluationInstances = {};\nconst localEvaluationInstances = {};\n/**\n * Initializes a singleton {@link ExperimentClient} for remote evaluation.\n *\n * @param apiKey The environment API Key\n * @param config See {@link ExperimentConfig} for config options\n * @deprecated use initializeRemote\n */\nconst initialize = (apiKey, config) => {\n return initializeRemote(apiKey, config);\n};\n/**\n * Initializes a remote evaluation client.\n *\n * @param apiKey The environment API Key\n * @param config See {@link ExperimentConfig} for config options\n */\nconst initializeRemote = (apiKey, config) => {\n if (!remoteEvaluationInstances[apiKey]) {\n remoteEvaluationInstances[apiKey] = new client_2.RemoteEvaluationClient(apiKey, config);\n }\n return remoteEvaluationInstances[apiKey];\n};\n/**\n * Initialize a local evaluation client.\n *\n * A local evaluation client can evaluate local flags or experiments for a user\n * without requiring a remote call to the amplitude evaluation server. In order\n * to best leverage local evaluation, all flags and experiments being evaluated\n * server side should be configured as local.\n *\n * @param apiKey The environment API Key\n * @param config See {@link ExperimentConfig} for config options\n * @returns The local evaluation client.\n */\nconst initializeLocal = (apiKey, config) => {\n if (!localEvaluationInstances[apiKey]) {\n localEvaluationInstances[apiKey] = new client_1.LocalEvaluationClient(apiKey, config, new cache_1.InMemoryFlagConfigCache());\n }\n return localEvaluationInstances[apiKey];\n};\n/**\n * Provides factory methods for storing singleton instances of\n * {@link ExperimentClient}.\n *\n * @category Core Usage\n */\nexports.Experiment = {\n initialize,\n initializeRemote,\n initializeLocal,\n};\n"],"names":["require$$0","require$$1","require$$2"],"mappings":";;;;;;;AACA,OAAO,eAAe,SAAS,cAAc,EAAE,OAAO,KAAI,CAAE;AAC1C,QAAA,aAAG;AACrB,MAAM,UAAUA;AAChB,MAAM,WAAWC;AACjB,MAAM,WAAWC;AACjB,MAAM,4BAA4B,CAAA;AAClC,MAAM,2BAA2B,CAAA;AAQjC,MAAM,aAAa,CAAC,QAAQ,WAAW;AACnC,SAAO,iBAAiB,QAAQ,MAAM;AAC1C;AAOA,MAAM,mBAAmB,CAAC,QAAQ,WAAW;AACzC,MAAI,CAAC,0BAA0B,MAAM,GAAG;AACpC,8BAA0B,MAAM,IAAI,IAAI,SAAS,uBAAuB,QAAQ,MAAM;AAAA,EACzF;AACD,SAAO,0BAA0B,MAAM;AAC3C;AAaA,MAAM,kBAAkB,CAAC,QAAQ,WAAW;AACxC,MAAI,CAAC,yBAAyB,MAAM,GAAG;AACnC,6BAAyB,MAAM,IAAI,IAAI,SAAS,sBAAsB,QAAQ,QAAQ,IAAI,QAAQ,wBAAuB,CAAE;AAAA,EAC9H;AACD,SAAO,yBAAyB,MAAM;AAC1C;AAOA,QAAA,aAAqB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AACJ;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const index = require("../../../../../_virtual/index.cjs");
|
|
3
|
+
require("./cookie.cjs");
|
|
4
|
+
require("./remote/client.cjs");
|
|
5
|
+
require("./types/config.cjs");
|
|
6
|
+
require("./factory.cjs");
|
|
7
|
+
require("./local/client.cjs");
|
|
8
|
+
require("./local/fetcher.cjs");
|
|
9
|
+
require("./local/poller.cjs");
|
|
10
|
+
require("./local/cache.cjs");
|
|
11
|
+
const cookie = require("../../../../../_virtual/cookie.cjs");
|
|
12
|
+
const client = require("../../../../../_virtual/client.cjs");
|
|
13
|
+
const config = require("../../../../../_virtual/config.cjs");
|
|
14
|
+
const factory = require("../../../../../_virtual/factory.cjs");
|
|
15
|
+
const client$1 = require("../../../../../_virtual/client2.cjs");
|
|
16
|
+
const fetcher = require("../../../../../_virtual/fetcher.cjs");
|
|
17
|
+
const poller = require("../../../../../_virtual/poller.cjs");
|
|
18
|
+
const cache = require("../../../../../_virtual/cache.cjs");
|
|
19
|
+
(function(exports2) {
|
|
20
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
21
|
+
exports2.InMemoryFlagConfigCache = exports2.FlagConfigPoller = exports2.FlagConfigFetcher = exports2.LocalEvaluationClient = exports2.Experiment = exports2.RemoteEvaluationDefaults = exports2.Defaults = exports2.RemoteEvaluationClient = exports2.ExperimentClient = exports2.AmplitudeCookie = void 0;
|
|
22
|
+
var cookie_1 = cookie.__exports;
|
|
23
|
+
Object.defineProperty(exports2, "AmplitudeCookie", { enumerable: true, get: function() {
|
|
24
|
+
return cookie_1.AmplitudeCookie;
|
|
25
|
+
} });
|
|
26
|
+
var client_1 = client.__exports;
|
|
27
|
+
Object.defineProperty(exports2, "ExperimentClient", { enumerable: true, get: function() {
|
|
28
|
+
return client_1.ExperimentClient;
|
|
29
|
+
} });
|
|
30
|
+
Object.defineProperty(exports2, "RemoteEvaluationClient", { enumerable: true, get: function() {
|
|
31
|
+
return client_1.RemoteEvaluationClient;
|
|
32
|
+
} });
|
|
33
|
+
var config_1 = config.__exports;
|
|
34
|
+
Object.defineProperty(exports2, "Defaults", { enumerable: true, get: function() {
|
|
35
|
+
return config_1.Defaults;
|
|
36
|
+
} });
|
|
37
|
+
Object.defineProperty(exports2, "RemoteEvaluationDefaults", { enumerable: true, get: function() {
|
|
38
|
+
return config_1.RemoteEvaluationDefaults;
|
|
39
|
+
} });
|
|
40
|
+
var factory_1 = factory.__exports;
|
|
41
|
+
Object.defineProperty(exports2, "Experiment", { enumerable: true, get: function() {
|
|
42
|
+
return factory_1.Experiment;
|
|
43
|
+
} });
|
|
44
|
+
var client_2 = client$1.__exports;
|
|
45
|
+
Object.defineProperty(exports2, "LocalEvaluationClient", { enumerable: true, get: function() {
|
|
46
|
+
return client_2.LocalEvaluationClient;
|
|
47
|
+
} });
|
|
48
|
+
var fetcher_1 = fetcher.__exports;
|
|
49
|
+
Object.defineProperty(exports2, "FlagConfigFetcher", { enumerable: true, get: function() {
|
|
50
|
+
return fetcher_1.FlagConfigFetcher;
|
|
51
|
+
} });
|
|
52
|
+
var poller_1 = poller.__exports;
|
|
53
|
+
Object.defineProperty(exports2, "FlagConfigPoller", { enumerable: true, get: function() {
|
|
54
|
+
return poller_1.FlagConfigPoller;
|
|
55
|
+
} });
|
|
56
|
+
var cache_1 = cache.__exports;
|
|
57
|
+
Object.defineProperty(exports2, "InMemoryFlagConfigCache", { enumerable: true, get: function() {
|
|
58
|
+
return cache_1.InMemoryFlagConfigCache;
|
|
59
|
+
} });
|
|
60
|
+
})(index.__exports);
|
|
61
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/index.js"],"sourcesContent":["\"use strict\";\n/**\n * This is the API Reference for the Experiment Node.js Server SDK.\n * For more details on implementing this SDK, view the [documentation]\n * (https://docs.developers.amplitude.com/experiment/sdks/nodejs-sdk).\n * @module experiment-node-server\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InMemoryFlagConfigCache = exports.FlagConfigPoller = exports.FlagConfigFetcher = exports.LocalEvaluationClient = exports.Experiment = exports.RemoteEvaluationDefaults = exports.Defaults = exports.RemoteEvaluationClient = exports.ExperimentClient = exports.AmplitudeCookie = void 0;\nvar cookie_1 = require(\"./cookie\");\nObject.defineProperty(exports, \"AmplitudeCookie\", { enumerable: true, get: function () { return cookie_1.AmplitudeCookie; } });\nvar client_1 = require(\"./remote/client\");\nObject.defineProperty(exports, \"ExperimentClient\", { enumerable: true, get: function () { return client_1.ExperimentClient; } });\nObject.defineProperty(exports, \"RemoteEvaluationClient\", { enumerable: true, get: function () { return client_1.RemoteEvaluationClient; } });\nvar config_1 = require(\"./types/config\");\nObject.defineProperty(exports, \"Defaults\", { enumerable: true, get: function () { return config_1.Defaults; } });\nObject.defineProperty(exports, \"RemoteEvaluationDefaults\", { enumerable: true, get: function () { return config_1.RemoteEvaluationDefaults; } });\nvar factory_1 = require(\"./factory\");\nObject.defineProperty(exports, \"Experiment\", { enumerable: true, get: function () { return factory_1.Experiment; } });\nvar client_2 = require(\"./local/client\");\nObject.defineProperty(exports, \"LocalEvaluationClient\", { enumerable: true, get: function () { return client_2.LocalEvaluationClient; } });\nvar fetcher_1 = require(\"./local/fetcher\");\nObject.defineProperty(exports, \"FlagConfigFetcher\", { enumerable: true, get: function () { return fetcher_1.FlagConfigFetcher; } });\nvar poller_1 = require(\"./local/poller\");\nObject.defineProperty(exports, \"FlagConfigPoller\", { enumerable: true, get: function () { return poller_1.FlagConfigPoller; } });\nvar cache_1 = require(\"./local/cache\");\nObject.defineProperty(exports, \"InMemoryFlagConfigCache\", { enumerable: true, get: function () { return cache_1.InMemoryFlagConfigCache; } });\n"],"names":["exports","require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,SAAO,eAAcA,UAAU,cAAc,EAAE,OAAO,KAAI,CAAE;AAC5D,EAAAA,SAAkC,0BAAAA,SAAA,mBAA2BA,SAA4B,oBAAAA,SAAA,wBAAgCA,SAAqB,aAAAA,SAAA,2BAAmCA,SAAmB,WAAAA,SAAA,yBAAiCA,SAA2B,mBAAAA,SAAA,kBAA0B;AAC1R,MAAI,WAAWC,OAAAA;AACf,SAAO,eAAeD,UAAS,mBAAmB,EAAE,YAAY,MAAM,KAAK,WAAY;AAAE,WAAO,SAAS;AAAA,EAAg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../../../../../_virtual/index.js";
|
|
2
|
+
import "./cookie.js";
|
|
3
|
+
import "./remote/client.js";
|
|
4
|
+
import "./types/config.js";
|
|
5
|
+
import "./factory.js";
|
|
6
|
+
import "./local/client.js";
|
|
7
|
+
import "./local/fetcher.js";
|
|
8
|
+
import "./local/poller.js";
|
|
9
|
+
import "./local/cache.js";
|
|
10
|
+
import { __exports as cookie } from "../../../../../_virtual/cookie.js";
|
|
11
|
+
import { __exports as client } from "../../../../../_virtual/client.js";
|
|
12
|
+
import { __exports as config } from "../../../../../_virtual/config.js";
|
|
13
|
+
import { __exports as factory } from "../../../../../_virtual/factory.js";
|
|
14
|
+
import { __exports as client$1 } from "../../../../../_virtual/client2.js";
|
|
15
|
+
import { __exports as fetcher } from "../../../../../_virtual/fetcher.js";
|
|
16
|
+
import { __exports as poller } from "../../../../../_virtual/poller.js";
|
|
17
|
+
import { __exports as cache } from "../../../../../_virtual/cache.js";
|
|
18
|
+
(function(exports) {
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.InMemoryFlagConfigCache = exports.FlagConfigPoller = exports.FlagConfigFetcher = exports.LocalEvaluationClient = exports.Experiment = exports.RemoteEvaluationDefaults = exports.Defaults = exports.RemoteEvaluationClient = exports.ExperimentClient = exports.AmplitudeCookie = void 0;
|
|
21
|
+
var cookie_1 = cookie;
|
|
22
|
+
Object.defineProperty(exports, "AmplitudeCookie", { enumerable: true, get: function() {
|
|
23
|
+
return cookie_1.AmplitudeCookie;
|
|
24
|
+
} });
|
|
25
|
+
var client_1 = client;
|
|
26
|
+
Object.defineProperty(exports, "ExperimentClient", { enumerable: true, get: function() {
|
|
27
|
+
return client_1.ExperimentClient;
|
|
28
|
+
} });
|
|
29
|
+
Object.defineProperty(exports, "RemoteEvaluationClient", { enumerable: true, get: function() {
|
|
30
|
+
return client_1.RemoteEvaluationClient;
|
|
31
|
+
} });
|
|
32
|
+
var config_1 = config;
|
|
33
|
+
Object.defineProperty(exports, "Defaults", { enumerable: true, get: function() {
|
|
34
|
+
return config_1.Defaults;
|
|
35
|
+
} });
|
|
36
|
+
Object.defineProperty(exports, "RemoteEvaluationDefaults", { enumerable: true, get: function() {
|
|
37
|
+
return config_1.RemoteEvaluationDefaults;
|
|
38
|
+
} });
|
|
39
|
+
var factory_1 = factory;
|
|
40
|
+
Object.defineProperty(exports, "Experiment", { enumerable: true, get: function() {
|
|
41
|
+
return factory_1.Experiment;
|
|
42
|
+
} });
|
|
43
|
+
var client_2 = client$1;
|
|
44
|
+
Object.defineProperty(exports, "LocalEvaluationClient", { enumerable: true, get: function() {
|
|
45
|
+
return client_2.LocalEvaluationClient;
|
|
46
|
+
} });
|
|
47
|
+
var fetcher_1 = fetcher;
|
|
48
|
+
Object.defineProperty(exports, "FlagConfigFetcher", { enumerable: true, get: function() {
|
|
49
|
+
return fetcher_1.FlagConfigFetcher;
|
|
50
|
+
} });
|
|
51
|
+
var poller_1 = poller;
|
|
52
|
+
Object.defineProperty(exports, "FlagConfigPoller", { enumerable: true, get: function() {
|
|
53
|
+
return poller_1.FlagConfigPoller;
|
|
54
|
+
} });
|
|
55
|
+
var cache_1 = cache;
|
|
56
|
+
Object.defineProperty(exports, "InMemoryFlagConfigCache", { enumerable: true, get: function() {
|
|
57
|
+
return cache_1.InMemoryFlagConfigCache;
|
|
58
|
+
} });
|
|
59
|
+
})(src);
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/index.js"],"sourcesContent":["\"use strict\";\n/**\n * This is the API Reference for the Experiment Node.js Server SDK.\n * For more details on implementing this SDK, view the [documentation]\n * (https://docs.developers.amplitude.com/experiment/sdks/nodejs-sdk).\n * @module experiment-node-server\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InMemoryFlagConfigCache = exports.FlagConfigPoller = exports.FlagConfigFetcher = exports.LocalEvaluationClient = exports.Experiment = exports.RemoteEvaluationDefaults = exports.Defaults = exports.RemoteEvaluationClient = exports.ExperimentClient = exports.AmplitudeCookie = void 0;\nvar cookie_1 = require(\"./cookie\");\nObject.defineProperty(exports, \"AmplitudeCookie\", { enumerable: true, get: function () { return cookie_1.AmplitudeCookie; } });\nvar client_1 = require(\"./remote/client\");\nObject.defineProperty(exports, \"ExperimentClient\", { enumerable: true, get: function () { return client_1.ExperimentClient; } });\nObject.defineProperty(exports, \"RemoteEvaluationClient\", { enumerable: true, get: function () { return client_1.RemoteEvaluationClient; } });\nvar config_1 = require(\"./types/config\");\nObject.defineProperty(exports, \"Defaults\", { enumerable: true, get: function () { return config_1.Defaults; } });\nObject.defineProperty(exports, \"RemoteEvaluationDefaults\", { enumerable: true, get: function () { return config_1.RemoteEvaluationDefaults; } });\nvar factory_1 = require(\"./factory\");\nObject.defineProperty(exports, \"Experiment\", { enumerable: true, get: function () { return factory_1.Experiment; } });\nvar client_2 = require(\"./local/client\");\nObject.defineProperty(exports, \"LocalEvaluationClient\", { enumerable: true, get: function () { return client_2.LocalEvaluationClient; } });\nvar fetcher_1 = require(\"./local/fetcher\");\nObject.defineProperty(exports, \"FlagConfigFetcher\", { enumerable: true, get: function () { return fetcher_1.FlagConfigFetcher; } });\nvar poller_1 = require(\"./local/poller\");\nObject.defineProperty(exports, \"FlagConfigPoller\", { enumerable: true, get: function () { return poller_1.FlagConfigPoller; } });\nvar cache_1 = require(\"./local/cache\");\nObject.defineProperty(exports, \"InMemoryFlagConfigCache\", { enumerable: true, get: function () { return cache_1.InMemoryFlagConfigCache; } });\n"],"names":["require$$0","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7"],"mappings":";;;;;;;;;;;;;;;;;;AAOA,SAAO,eAAc,SAAU,cAAc,EAAE,OAAO,KAAI,CAAE;AAC5D,UAAkC,0BAAA,QAAA,mBAA2B,QAA4B,oBAAA,QAAA,wBAAgC,QAAqB,aAAA,QAAA,2BAAmC,QAAmB,WAAA,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EAAwB,EAAI,CAAA;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _commonjsHelpers = require("../../../../../../_virtual/_commonjsHelpers.cjs");
|
|
3
|
+
const cache = require("../../../../../../_virtual/cache.cjs");
|
|
4
|
+
var __awaiter = _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) {
|
|
6
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
7
|
+
resolve(value);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
11
|
+
function fulfilled(value) {
|
|
12
|
+
try {
|
|
13
|
+
step(generator.next(value));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
reject(e);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function rejected(value) {
|
|
19
|
+
try {
|
|
20
|
+
step(generator["throw"](value));
|
|
21
|
+
} catch (e) {
|
|
22
|
+
reject(e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function step(result) {
|
|
26
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
27
|
+
}
|
|
28
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(cache.__exports, "__esModule", { value: true });
|
|
32
|
+
cache.__exports.InMemoryFlagConfigCache = void 0;
|
|
33
|
+
class InMemoryFlagConfigCache {
|
|
34
|
+
constructor(store, flagConfigs = {}) {
|
|
35
|
+
this.store = store;
|
|
36
|
+
this.cache = flagConfigs;
|
|
37
|
+
}
|
|
38
|
+
getAllCached() {
|
|
39
|
+
return Object.assign({}, this.cache);
|
|
40
|
+
}
|
|
41
|
+
get(flagKey) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return this.cache[flagKey];
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
getAll() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return Object.assign({}, this.cache);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
put(flagKey, flagConfig) {
|
|
52
|
+
var _a;
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
this.cache[flagKey] = flagConfig;
|
|
55
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.put(flagKey, flagConfig);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
putAll(flagConfigs) {
|
|
59
|
+
var _a;
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
for (const key in flagConfigs) {
|
|
62
|
+
const flag = flagConfigs[key];
|
|
63
|
+
if (flag) {
|
|
64
|
+
this.cache[key] = flag;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.putAll(flagConfigs);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
delete(flagKey) {
|
|
71
|
+
var _a;
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
delete this.cache[flagKey];
|
|
74
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.delete(flagKey);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
clear() {
|
|
78
|
+
var _a;
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
this.cache = {};
|
|
81
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.clear();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
cache.__exports.InMemoryFlagConfigCache = InMemoryFlagConfigCache;
|
|
86
|
+
module.exports = cache.__exports;
|
|
87
|
+
//# sourceMappingURL=cache.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.cjs","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/local/cache.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.InMemoryFlagConfigCache = void 0;\nclass InMemoryFlagConfigCache {\n constructor(store, flagConfigs = {}) {\n this.store = store;\n this.cache = flagConfigs;\n }\n getAllCached() {\n return Object.assign({}, this.cache);\n }\n get(flagKey) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.cache[flagKey];\n });\n }\n getAll() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign({}, this.cache);\n });\n }\n put(flagKey, flagConfig) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.cache[flagKey] = flagConfig;\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.put(flagKey, flagConfig));\n });\n }\n putAll(flagConfigs) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n for (const key in flagConfigs) {\n const flag = flagConfigs[key];\n if (flag) {\n this.cache[key] = flag;\n }\n }\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.putAll(flagConfigs));\n });\n }\n delete(flagKey) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n delete this.cache[flagKey];\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.delete(flagKey));\n });\n }\n clear() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.cache = {};\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.clear());\n });\n }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../../../../../_virtual/cache.js";
|
|
3
|
+
var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
6
|
+
resolve(value);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
10
|
+
function fulfilled(value) {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.next(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function rejected(value) {
|
|
18
|
+
try {
|
|
19
|
+
step(generator["throw"](value));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
reject(e);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function step(result) {
|
|
25
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
|
+
}
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(cache, "__esModule", { value: true });
|
|
31
|
+
cache.InMemoryFlagConfigCache = void 0;
|
|
32
|
+
class InMemoryFlagConfigCache {
|
|
33
|
+
constructor(store, flagConfigs = {}) {
|
|
34
|
+
this.store = store;
|
|
35
|
+
this.cache = flagConfigs;
|
|
36
|
+
}
|
|
37
|
+
getAllCached() {
|
|
38
|
+
return Object.assign({}, this.cache);
|
|
39
|
+
}
|
|
40
|
+
get(flagKey) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return this.cache[flagKey];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getAll() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
return Object.assign({}, this.cache);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
put(flagKey, flagConfig) {
|
|
51
|
+
var _a;
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
this.cache[flagKey] = flagConfig;
|
|
54
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.put(flagKey, flagConfig);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
putAll(flagConfigs) {
|
|
58
|
+
var _a;
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
for (const key in flagConfigs) {
|
|
61
|
+
const flag = flagConfigs[key];
|
|
62
|
+
if (flag) {
|
|
63
|
+
this.cache[key] = flag;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.putAll(flagConfigs);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
delete(flagKey) {
|
|
70
|
+
var _a;
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
delete this.cache[flagKey];
|
|
73
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.delete(flagKey);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
clear() {
|
|
77
|
+
var _a;
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
this.cache = {};
|
|
80
|
+
yield (_a = this.store) === null || _a === void 0 ? void 0 : _a.clear();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
cache.InMemoryFlagConfigCache = InMemoryFlagConfigCache;
|
|
85
|
+
export {
|
|
86
|
+
cache as default
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sources":["../../../../../../../../../node_modules/@amplitude/experiment-node-server/dist/src/local/cache.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.InMemoryFlagConfigCache = void 0;\nclass InMemoryFlagConfigCache {\n constructor(store, flagConfigs = {}) {\n this.store = store;\n this.cache = flagConfigs;\n }\n getAllCached() {\n return Object.assign({}, this.cache);\n }\n get(flagKey) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.cache[flagKey];\n });\n }\n getAll() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign({}, this.cache);\n });\n }\n put(flagKey, flagConfig) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.cache[flagKey] = flagConfig;\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.put(flagKey, flagConfig));\n });\n }\n putAll(flagConfigs) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n for (const key in flagConfigs) {\n const flag = flagConfigs[key];\n if (flag) {\n this.cache[key] = flag;\n }\n }\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.putAll(flagConfigs));\n });\n }\n delete(flagKey) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n delete this.cache[flagKey];\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.delete(flagKey));\n });\n }\n clear() {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n this.cache = {};\n yield ((_a = this.store) === null || _a === void 0 ? void 0 : _a.clear());\n });\n }\n}\nexports.InMemoryFlagConfigCache = InMemoryFlagConfigCache;\n"],"names":["this"],"mappings":";;AACA,IAAI,YAAaA,kBAAQA,eAAK,aAAc,SAAU,SAAS,YAAY,GAAG,WAAW;AACrF,WAAS,MAAM,OAAO;AAAE,WAAO,iBAAiB,IAAI,QAAQ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