@prismicio/manager 0.0.3-beta.13 → 0.0.3-beta.14
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.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/config.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/core-client.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/core-client.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/identify.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/identify.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/logger.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/logger.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/revenue.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/revenue.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/timeline.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/timeline.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/transports/base.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/config.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/config.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/node-client.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/node-client.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js +2 -2
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js +105 -45
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/gen/version.js +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/gen/version.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-filter.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-service.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-filter.js +35 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-filter.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-service.js +115 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure-service.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure.js +32 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/exposure/exposure.js.map +1 -0
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js +30 -11
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.js +9 -2
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js +9 -7
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/types/config.js +12 -9
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/types/config.js.map +1 -1
- package/dist/_node_modules/common-tags/es/TemplateTag/TemplateTag.js +4 -4
- package/dist/_node_modules/common-tags/es/TemplateTag/TemplateTag.js.map +1 -1
- package/dist/_node_modules/eventsource/lib/eventsource.js +2 -2
- package/dist/_node_modules/eventsource/lib/eventsource.js.map +1 -1
- package/dist/_node_modules/fetch-blob/from.js +1 -1
- package/dist/_node_modules/node-fetch/src/body.js +1 -1
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.js +1 -1
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.js +2 -2
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/response.js +1 -1
- package/dist/_node_modules/node-fetch/src/response.js.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +2 -2
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -1
- package/dist/_virtual/exposure-filter.js +5 -0
- package/dist/_virtual/exposure-filter.js.map +1 -0
- package/dist/_virtual/exposure-service.js +5 -0
- package/dist/_virtual/exposure-service.js.map +1 -0
- package/dist/_virtual/exposure.js +5 -0
- package/dist/_virtual/exposure.js.map +1 -0
- package/dist/_virtual/index3.js +2 -6
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index4.js +6 -2
- package/dist/_virtual/index4.js.map +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-client.js","sources":["../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/node-client.js"],"sourcesContent":["import { __assign, __awaiter, __extends, __generator } from \"tslib\";\nimport { AmplitudeCore, Destination, returnWrapper, debugWrapper, getClientLogConfig, getClientStates, } from '@amplitude/analytics-core';\nimport { Context } from './plugins/context';\nimport { useNodeConfig } from './config';\nvar AmplitudeNode = /** @class */ (function (_super) {\n __extends(AmplitudeNode, _super);\n function AmplitudeNode() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AmplitudeNode.prototype.init = function (apiKey, options) {\n if (apiKey === void 0) { apiKey = ''; }\n return returnWrapper(this._init(__assign(__assign({}, options), { apiKey: apiKey })));\n };\n AmplitudeNode.prototype._init = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var nodeOptions;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return [2 /*return*/];\n }\n this.initializing = true;\n nodeOptions = useNodeConfig(options.apiKey, __assign({}, options));\n return [4 /*yield*/, _super.prototype._init.call(this, nodeOptions)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.add(new Destination()).promise];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.add(new Context()).promise];\n case 3:\n _a.sent();\n this.initializing = false;\n return [4 /*yield*/, this.runQueuedFunctions('dispatchQ')];\n case 4:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n return AmplitudeNode;\n}(AmplitudeCore));\nexport { AmplitudeNode };\nexport var createInstance = function () {\n var client = new AmplitudeNode();\n return {\n init: debugWrapper(client.init.bind(client), 'init', getClientLogConfig(client), getClientStates(client, ['config'])),\n add: debugWrapper(client.add.bind(client), 'add', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),\n remove: debugWrapper(client.remove.bind(client), 'remove', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),\n track: debugWrapper(client.track.bind(client), 'track', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n logEvent: debugWrapper(client.logEvent.bind(client), 'logEvent', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n identify: debugWrapper(client.identify.bind(client), 'identify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n groupIdentify: debugWrapper(client.groupIdentify.bind(client), 'groupIdentify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n setGroup: debugWrapper(client.setGroup.bind(client), 'setGroup', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n revenue: debugWrapper(client.revenue.bind(client), 'revenue', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n flush: debugWrapper(client.flush.bind(client), 'flush', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n setOptOut: debugWrapper(client.setOptOut.bind(client), 'setOptOut', getClientLogConfig(client), getClientStates(client, ['config'])),\n };\n};\nexport default createInstance();\n//# sourceMappingURL=node-client.js.map"],"names":["AmplitudeNode","client"],"mappings":";;;;;;;AAIG,IAAC;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"node-client.js","sources":["../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/node-client.js"],"sourcesContent":["import { __assign, __awaiter, __extends, __generator } from \"tslib\";\nimport { AmplitudeCore, Destination, returnWrapper, debugWrapper, getClientLogConfig, getClientStates, } from '@amplitude/analytics-core';\nimport { Context } from './plugins/context';\nimport { useNodeConfig } from './config';\nvar AmplitudeNode = /** @class */ (function (_super) {\n __extends(AmplitudeNode, _super);\n function AmplitudeNode() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AmplitudeNode.prototype.init = function (apiKey, options) {\n if (apiKey === void 0) { apiKey = ''; }\n return returnWrapper(this._init(__assign(__assign({}, options), { apiKey: apiKey })));\n };\n AmplitudeNode.prototype._init = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var nodeOptions;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return [2 /*return*/];\n }\n this.initializing = true;\n nodeOptions = useNodeConfig(options.apiKey, __assign({}, options));\n return [4 /*yield*/, _super.prototype._init.call(this, nodeOptions)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.add(new Destination()).promise];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.add(new Context()).promise];\n case 3:\n _a.sent();\n this.initializing = false;\n return [4 /*yield*/, this.runQueuedFunctions('dispatchQ')];\n case 4:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n return AmplitudeNode;\n}(AmplitudeCore));\nexport { AmplitudeNode };\nexport var createInstance = function () {\n var client = new AmplitudeNode();\n return {\n init: debugWrapper(client.init.bind(client), 'init', getClientLogConfig(client), getClientStates(client, ['config'])),\n add: debugWrapper(client.add.bind(client), 'add', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),\n remove: debugWrapper(client.remove.bind(client), 'remove', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),\n track: debugWrapper(client.track.bind(client), 'track', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n logEvent: debugWrapper(client.logEvent.bind(client), 'logEvent', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n identify: debugWrapper(client.identify.bind(client), 'identify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n groupIdentify: debugWrapper(client.groupIdentify.bind(client), 'groupIdentify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n setGroup: debugWrapper(client.setGroup.bind(client), 'setGroup', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n revenue: debugWrapper(client.revenue.bind(client), 'revenue', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n flush: debugWrapper(client.flush.bind(client), 'flush', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),\n setOptOut: debugWrapper(client.setOptOut.bind(client), 'setOptOut', getClientLogConfig(client), getClientStates(client, ['config'])),\n };\n};\nexport default createInstance();\n//# sourceMappingURL=node-client.js.map"],"names":["AmplitudeNode","client"],"mappings":";;;;;;;AAIG,IAAC;AAAA;AAAA,GAA+B,SAAU,QAAQ;AACjD,cAAUA,gBAAe,MAAM;AAC/B,aAASA,iBAAgB;AACrB,aAAO,WAAW,QAAQ,OAAO,MAAM,MAAM,SAAS,KAAK;AAAA,IAC/D;AACA,IAAAA,eAAc,UAAU,OAAO,SAAU,QAAQ,SAAS;AACtD,UAAI,WAAW,QAAQ;AAAE,iBAAS;AAAA,MAAI;AACtC,aAAO,cAAc,KAAK,MAAM,SAAS,SAAS,IAAI,OAAO,GAAG,EAAE,OAAc,CAAE,CAAC,CAAC;AAAA,IACxF;AACA,IAAAA,eAAc,UAAU,QAAQ,SAAU,SAAS;AAC/C,aAAO,UAAU,MAAM,QAAQ,QAAQ,WAAY;AAC/C,YAAI;AACJ,eAAO,YAAY,MAAM,SAAU,IAAI;AACnC,kBAAQ,GAAG,OAAK;AAAA,YACZ,KAAK;AAED,kBAAI,KAAK,cAAc;AACnB,uBAAO;AAAA,kBAAC;AAAA;AAAA,gBAAC;AAAA,cACb;AACA,mBAAK,eAAe;AACpB,4BAAc,cAAc,QAAQ,QAAQ,SAAS,CAAA,GAAI,OAAO,CAAC;AACjE,qBAAO,CAAC,GAAa,OAAO,UAAU,MAAM,KAAK,MAAM,WAAW,CAAC;AAAA,YACvE,KAAK;AACD,iBAAG,KAAI;AACP,qBAAO,CAAC,GAAa,KAAK,IAAI,IAAI,YAAW,CAAE,EAAE,OAAO;AAAA,YAC5D,KAAK;AACD,iBAAG,KAAI;AACP,qBAAO,CAAC,GAAa,KAAK,IAAI,IAAI,QAAO,CAAE,EAAE,OAAO;AAAA,YACxD,KAAK;AACD,iBAAG,KAAI;AACP,mBAAK,eAAe;AACpB,qBAAO,CAAC,GAAa,KAAK,mBAAmB,WAAW,CAAC;AAAA,YAC7D,KAAK;AACD,iBAAG,KAAI;AACP,qBAAO;AAAA,gBAAC;AAAA;AAAA,cAAC;AAAA,UACjC;AAAA,QACY,CAAC;AAAA,MACL,CAAC;AAAA,IACL;AACA,WAAOA;AAAA,EACX,GAAE,aAAa;AAAA;AAEL,IAAC,iBAAiB,WAAY;AACpC,MAAIC,UAAS,IAAI,cAAa;AAC9B,SAAO;AAAA,IACH,MAAM,aAAaA,QAAO,KAAK,KAAKA,OAAM,GAAG,QAAQ,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,QAAQ,CAAC,CAAC;AAAA,IACpH,KAAK,aAAaA,QAAO,IAAI,KAAKA,OAAM,GAAG,OAAO,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,kBAAkB,CAAC,CAAC;AAAA,IAC5I,QAAQ,aAAaA,QAAO,OAAO,KAAKA,OAAM,GAAG,UAAU,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,kBAAkB,CAAC,CAAC;AAAA,IACrJ,OAAO,aAAaA,QAAO,MAAM,KAAKA,OAAM,GAAG,SAAS,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,uBAAuB,CAAC,CAAC;AAAA,IACvJ,UAAU,aAAaA,QAAO,SAAS,KAAKA,OAAM,GAAG,YAAY,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,uBAAuB,CAAC,CAAC;AAAA,IAChK,UAAU,aAAaA,QAAO,SAAS,KAAKA,OAAM,GAAG,YAAY,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,uBAAuB,CAAC,CAAC;AAAA,IAChK,eAAe,aAAaA,QAAO,cAAc,KAAKA,OAAM,GAAG,iBAAiB,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,uBAAuB,CAAC,CAAC;AAAA,IAC/K,UAAU,aAAaA,QAAO,SAAS,KAAKA,OAAM,GAAG,YAAY,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,uBAAuB,CAAC,CAAC;AAAA,IAChK,SAAS,aAAaA,QAAO,QAAQ,KAAKA,OAAM,GAAG,WAAW,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,uBAAuB,CAAC,CAAC;AAAA,IAC7J,OAAO,aAAaA,QAAO,MAAM,KAAKA,OAAM,GAAG,SAAS,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,iBAAiB,uBAAuB,CAAC,CAAC;AAAA,IACvJ,WAAW,aAAaA,QAAO,UAAU,KAAKA,OAAM,GAAG,aAAa,mBAAmBA,OAAM,GAAG,gBAAgBA,SAAQ,CAAC,QAAQ,CAAC,CAAC;AAAA,EAC3I;AACA;AACA,MAAA,SAAe,eAAc;","x_google_ignoreList":[0]}
|
|
@@ -4,7 +4,7 @@ import { PluginType } from "../../../../analytics-types/lib/esm/plugin.js";
|
|
|
4
4
|
import { UUID } from "../../../../analytics-core/lib/esm/utils/uuid.js";
|
|
5
5
|
var Context = (
|
|
6
6
|
/** @class */
|
|
7
|
-
function() {
|
|
7
|
+
(function() {
|
|
8
8
|
function Context2() {
|
|
9
9
|
this.name = "context";
|
|
10
10
|
this.type = PluginType.BEFORE;
|
|
@@ -29,7 +29,7 @@ var Context = (
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
return Context2;
|
|
32
|
-
}()
|
|
32
|
+
})()
|
|
33
33
|
);
|
|
34
34
|
export {
|
|
35
35
|
Context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { PluginType } from '@amplitude/analytics-types';\nimport { UUID } from '@amplitude/analytics-core';\nimport { VERSION } from '../version';\nvar Context = /** @class */ (function () {\n function Context() {\n this.name = 'context';\n this.type = PluginType.BEFORE;\n this.eventId = 0;\n this.library = \"amplitude-node-ts/\".concat(VERSION);\n }\n Context.prototype.setup = function (config) {\n this.config = config;\n return Promise.resolve(undefined);\n };\n Context.prototype.execute = function (context) {\n var _this = this;\n return new Promise(function (resolve) {\n var time = new Date().getTime();\n var contextEvent = __assign(__assign(__assign({ time: time, insert_id: UUID(), plan: _this.config.plan }, (_this.config.ingestionMetadata && {\n ingestion_metadata: {\n source_name: _this.config.ingestionMetadata.sourceName,\n source_version: _this.config.ingestionMetadata.sourceVersion,\n },\n })), context), { event_id: _this.eventId++, library: _this.library });\n return resolve(contextEvent);\n });\n };\n return Context;\n}());\nexport { Context };\n//# sourceMappingURL=context.js.map"],"names":["Context"],"mappings":";;;;AAIG,IAAC;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { PluginType } from '@amplitude/analytics-types';\nimport { UUID } from '@amplitude/analytics-core';\nimport { VERSION } from '../version';\nvar Context = /** @class */ (function () {\n function Context() {\n this.name = 'context';\n this.type = PluginType.BEFORE;\n this.eventId = 0;\n this.library = \"amplitude-node-ts/\".concat(VERSION);\n }\n Context.prototype.setup = function (config) {\n this.config = config;\n return Promise.resolve(undefined);\n };\n Context.prototype.execute = function (context) {\n var _this = this;\n return new Promise(function (resolve) {\n var time = new Date().getTime();\n var contextEvent = __assign(__assign(__assign({ time: time, insert_id: UUID(), plan: _this.config.plan }, (_this.config.ingestionMetadata && {\n ingestion_metadata: {\n source_name: _this.config.ingestionMetadata.sourceName,\n source_version: _this.config.ingestionMetadata.sourceVersion,\n },\n })), context), { event_id: _this.eventId++, library: _this.library });\n return resolve(contextEvent);\n });\n };\n return Context;\n}());\nexport { Context };\n//# sourceMappingURL=context.js.map"],"names":["Context"],"mappings":";;;;AAIG,IAAC;AAAA;AAAA,GAAyB,WAAY;AACrC,aAASA,WAAU;AACf,WAAK,OAAO;AACZ,WAAK,OAAO,WAAW;AACvB,WAAK,UAAU;AACf,WAAK,UAAU,qBAAqB,OAAO,OAAO;AAAA,IACtD;AACA,IAAAA,SAAQ,UAAU,QAAQ,SAAU,QAAQ;AACxC,WAAK,SAAS;AACd,aAAO,QAAQ,QAAQ,MAAS;AAAA,IACpC;AACA,IAAAA,SAAQ,UAAU,UAAU,SAAU,SAAS;AAC3C,UAAI,QAAQ;AACZ,aAAO,IAAI,QAAQ,SAAU,SAAS;AAClC,YAAI,QAAO,oBAAI,KAAI,GAAG,QAAO;AAC7B,YAAI,eAAe,SAAS,SAAS,SAAS,EAAE,MAAY,WAAW,KAAI,GAAI,MAAM,MAAM,OAAO,KAAI,GAAK,MAAM,OAAO,qBAAqB;AAAA,UACzI,oBAAoB;AAAA,YAChB,aAAa,MAAM,OAAO,kBAAkB;AAAA,YAC5C,gBAAgB,MAAM,OAAO,kBAAkB;AAAA,UACnE;AAAA,QACA,IAAiB,OAAO,GAAG,EAAE,UAAU,MAAM,WAAW,SAAS,MAAM,SAAS;AACpE,eAAO,QAAQ,YAAY;AAAA,MAC/B,CAAC;AAAA,IACL;AACA,WAAOA;AAAA,EACX,GAAC;AAAA;","x_google_ignoreList":[0]}
|
|
@@ -4,7 +4,7 @@ import * as require$$1 from "https";
|
|
|
4
4
|
import { BaseTransport } from "../../../../analytics-core/lib/esm/transports/base.js";
|
|
5
5
|
var Http = (
|
|
6
6
|
/** @class */
|
|
7
|
-
function(_super) {
|
|
7
|
+
(function(_super) {
|
|
8
8
|
__extends(Http2, _super);
|
|
9
9
|
function Http2() {
|
|
10
10
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -59,7 +59,7 @@ var Http = (
|
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
61
|
return Http2;
|
|
62
|
-
}(BaseTransport)
|
|
62
|
+
})(BaseTransport)
|
|
63
63
|
);
|
|
64
64
|
export {
|
|
65
65
|
Http
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sources":["../../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { BaseTransport } from '@amplitude/analytics-core';\nimport * as http from 'http';\nimport * as https from 'https';\nvar Http = /** @class */ (function (_super) {\n __extends(Http, _super);\n function Http() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Http.prototype.send = function (serverUrl, payload) {\n var _this = this;\n var protocol;\n if (serverUrl.startsWith('http://')) {\n protocol = http;\n }\n else if (serverUrl.startsWith('https://')) {\n protocol = https;\n }\n else {\n throw new Error('Invalid server url');\n }\n var url = new URL(serverUrl);\n var requestPayload = JSON.stringify(payload);\n var options = {\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(requestPayload),\n },\n hostname: url.hostname,\n method: 'POST',\n path: url.pathname,\n port: url.port,\n protocol: url.protocol,\n };\n return new Promise(function (resolve) {\n var req = protocol.request(options, function (res) {\n res.setEncoding('utf8');\n var responsePayload = '';\n res.on('data', function (chunk) {\n responsePayload += chunk;\n });\n res.on('end', function () {\n if (res.complete && responsePayload.length > 0) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n return;\n }\n catch (_a) {\n resolve(null);\n }\n }\n });\n });\n req.on('error', function () { return resolve(null); });\n req.end(requestPayload);\n });\n };\n return Http;\n}(BaseTransport));\nexport { Http };\n//# sourceMappingURL=http.js.map"],"names":["Http","http","https"],"mappings":";;;;AAIG,IAAC;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"http.js","sources":["../../../../../../../../../node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { BaseTransport } from '@amplitude/analytics-core';\nimport * as http from 'http';\nimport * as https from 'https';\nvar Http = /** @class */ (function (_super) {\n __extends(Http, _super);\n function Http() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Http.prototype.send = function (serverUrl, payload) {\n var _this = this;\n var protocol;\n if (serverUrl.startsWith('http://')) {\n protocol = http;\n }\n else if (serverUrl.startsWith('https://')) {\n protocol = https;\n }\n else {\n throw new Error('Invalid server url');\n }\n var url = new URL(serverUrl);\n var requestPayload = JSON.stringify(payload);\n var options = {\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(requestPayload),\n },\n hostname: url.hostname,\n method: 'POST',\n path: url.pathname,\n port: url.port,\n protocol: url.protocol,\n };\n return new Promise(function (resolve) {\n var req = protocol.request(options, function (res) {\n res.setEncoding('utf8');\n var responsePayload = '';\n res.on('data', function (chunk) {\n responsePayload += chunk;\n });\n res.on('end', function () {\n if (res.complete && responsePayload.length > 0) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n var parsedResponsePayload = JSON.parse(responsePayload);\n var result = _this.buildResponse(parsedResponsePayload);\n resolve(result);\n return;\n }\n catch (_a) {\n resolve(null);\n }\n }\n });\n });\n req.on('error', function () { return resolve(null); });\n req.end(requestPayload);\n });\n };\n return Http;\n}(BaseTransport));\nexport { Http };\n//# sourceMappingURL=http.js.map"],"names":["Http","http","https"],"mappings":";;;;AAIG,IAAC;AAAA;AAAA,GAAsB,SAAU,QAAQ;AACxC,cAAUA,OAAM,MAAM;AACtB,aAASA,QAAO;AACZ,aAAO,WAAW,QAAQ,OAAO,MAAM,MAAM,SAAS,KAAK;AAAA,IAC/D;AACA,IAAAA,MAAK,UAAU,OAAO,SAAU,WAAW,SAAS;AAChD,UAAI,QAAQ;AACZ,UAAI;AACJ,UAAI,UAAU,WAAW,SAAS,GAAG;AACjC,mBAAWC;AAAAA,MACf,WACS,UAAU,WAAW,UAAU,GAAG;AACvC,mBAAWC;AAAAA,MACf,OACK;AACD,cAAM,IAAI,MAAM,oBAAoB;AAAA,MACxC;AACA,UAAI,MAAM,IAAI,IAAI,SAAS;AAC3B,UAAI,iBAAiB,KAAK,UAAU,OAAO;AAC3C,UAAI,UAAU;AAAA,QACV,SAAS;AAAA,UACL,gBAAgB;AAAA,UAChB,kBAAkB,OAAO,WAAW,cAAc;AAAA,QAClE;AAAA,QACY,UAAU,IAAI;AAAA,QACd,QAAQ;AAAA,QACR,MAAM,IAAI;AAAA,QACV,MAAM,IAAI;AAAA,QACV,UAAU,IAAI;AAAA,MAC1B;AACQ,aAAO,IAAI,QAAQ,SAAU,SAAS;AAClC,YAAI,MAAM,SAAS,QAAQ,SAAS,SAAU,KAAK;AAC/C,cAAI,YAAY,MAAM;AACtB,cAAI,kBAAkB;AACtB,cAAI,GAAG,QAAQ,SAAU,OAAO;AAC5B,+BAAmB;AAAA,UACvB,CAAC;AACD,cAAI,GAAG,OAAO,WAAY;AACtB,gBAAI,IAAI,YAAY,gBAAgB,SAAS,GAAG;AAC5C,kBAAI;AAEA,oBAAI,wBAAwB,KAAK,MAAM,eAAe;AACtD,oBAAI,SAAS,MAAM,cAAc,qBAAqB;AACtD,wBAAQ,MAAM;AACd;AAAA,cACJ,SACO,IAAI;AACP,wBAAQ,IAAI;AAAA,cAChB;AAAA,YACJ;AAAA,UACJ,CAAC;AAAA,QACL,CAAC;AACD,YAAI,GAAG,SAAS,WAAY;AAAE,iBAAO,QAAQ,IAAI;AAAA,QAAG,CAAC;AACrD,YAAI,IAAI,cAAc;AAAA,MAC1B,CAAC;AAAA,IACL;AACA,WAAOF;AAAA,EACX,GAAE,aAAa;AAAA;","x_google_ignoreList":[0]}
|
|
@@ -62,12 +62,8 @@ function __generator(thisArg, body) {
|
|
|
62
62
|
},
|
|
63
63
|
trys: [],
|
|
64
64
|
ops: []
|
|
65
|
-
}, f, y, t, g;
|
|
66
|
-
return g = {
|
|
67
|
-
next: verb(0),
|
|
68
|
-
"throw": verb(1),
|
|
69
|
-
"return": verb(2)
|
|
70
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
65
|
+
}, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
66
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
71
67
|
return this;
|
|
72
68
|
}), g;
|
|
73
69
|
function verb(n) {
|
|
@@ -341,7 +337,7 @@ var select = function(selectable, selector) {
|
|
|
341
337
|
if (e_1) throw e_1.error;
|
|
342
338
|
}
|
|
343
339
|
}
|
|
344
|
-
if (
|
|
340
|
+
if (selectable === void 0 || selectable === null) {
|
|
345
341
|
return void 0;
|
|
346
342
|
} else {
|
|
347
343
|
return selectable;
|
|
@@ -353,7 +349,7 @@ var PRERELEASE_REGEX = "(-(([-\\w]+\\.?)*))?";
|
|
|
353
349
|
var VERSION_PATTERN = "^".concat(MAJOR_MINOR_REGEX, "(\\.").concat(PATCH_REGEX).concat(PRERELEASE_REGEX, ")?$");
|
|
354
350
|
var SemanticVersion = (
|
|
355
351
|
/** @class */
|
|
356
|
-
function() {
|
|
352
|
+
(function() {
|
|
357
353
|
function SemanticVersion2(major, minor, patch, preRelease) {
|
|
358
354
|
if (preRelease === void 0) {
|
|
359
355
|
preRelease = void 0;
|
|
@@ -407,11 +403,11 @@ var SemanticVersion = (
|
|
|
407
403
|
return 0;
|
|
408
404
|
};
|
|
409
405
|
return SemanticVersion2;
|
|
410
|
-
}()
|
|
406
|
+
})()
|
|
411
407
|
);
|
|
412
408
|
var EvaluationEngine = (
|
|
413
409
|
/** @class */
|
|
414
|
-
function() {
|
|
410
|
+
(function() {
|
|
415
411
|
function EvaluationEngine2() {
|
|
416
412
|
}
|
|
417
413
|
EvaluationEngine2.prototype.evaluate = function(context, flags) {
|
|
@@ -465,7 +461,6 @@ var EvaluationEngine = (
|
|
|
465
461
|
return result;
|
|
466
462
|
};
|
|
467
463
|
EvaluationEngine2.prototype.evaluateSegment = function(target, flag, segment) {
|
|
468
|
-
var e_3, _a, e_4, _b;
|
|
469
464
|
if (!segment.conditions) {
|
|
470
465
|
var variantKey = this.bucket(target, segment);
|
|
471
466
|
if (variantKey !== void 0) {
|
|
@@ -474,13 +469,26 @@ var EvaluationEngine = (
|
|
|
474
469
|
return void 0;
|
|
475
470
|
}
|
|
476
471
|
}
|
|
472
|
+
var match = this.evaluateConditions(target, segment.conditions);
|
|
473
|
+
if (match) {
|
|
474
|
+
var variantKey = this.bucket(target, segment);
|
|
475
|
+
if (variantKey !== void 0) {
|
|
476
|
+
return flag.variants[variantKey];
|
|
477
|
+
} else {
|
|
478
|
+
return void 0;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return void 0;
|
|
482
|
+
};
|
|
483
|
+
EvaluationEngine2.prototype.evaluateConditions = function(target, conditions) {
|
|
484
|
+
var e_3, _a, e_4, _b;
|
|
477
485
|
try {
|
|
478
|
-
for (var
|
|
479
|
-
var
|
|
486
|
+
for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {
|
|
487
|
+
var innerConditions = conditions_1_1.value;
|
|
480
488
|
var match = true;
|
|
481
489
|
try {
|
|
482
|
-
for (var
|
|
483
|
-
var condition =
|
|
490
|
+
for (var innerConditions_1 = (e_4 = void 0, __values(innerConditions)), innerConditions_1_1 = innerConditions_1.next(); !innerConditions_1_1.done; innerConditions_1_1 = innerConditions_1.next()) {
|
|
491
|
+
var condition = innerConditions_1_1.value;
|
|
484
492
|
match = this.matchCondition(target, condition);
|
|
485
493
|
if (!match) {
|
|
486
494
|
break;
|
|
@@ -490,34 +498,29 @@ var EvaluationEngine = (
|
|
|
490
498
|
e_4 = { error: e_4_1 };
|
|
491
499
|
} finally {
|
|
492
500
|
try {
|
|
493
|
-
if (
|
|
501
|
+
if (innerConditions_1_1 && !innerConditions_1_1.done && (_b = innerConditions_1.return)) _b.call(innerConditions_1);
|
|
494
502
|
} finally {
|
|
495
503
|
if (e_4) throw e_4.error;
|
|
496
504
|
}
|
|
497
505
|
}
|
|
498
506
|
if (match) {
|
|
499
|
-
|
|
500
|
-
if (variantKey !== void 0) {
|
|
501
|
-
return flag.variants[variantKey];
|
|
502
|
-
} else {
|
|
503
|
-
return void 0;
|
|
504
|
-
}
|
|
507
|
+
return true;
|
|
505
508
|
}
|
|
506
509
|
}
|
|
507
510
|
} catch (e_3_1) {
|
|
508
511
|
e_3 = { error: e_3_1 };
|
|
509
512
|
} finally {
|
|
510
513
|
try {
|
|
511
|
-
if (
|
|
514
|
+
if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1);
|
|
512
515
|
} finally {
|
|
513
516
|
if (e_3) throw e_3.error;
|
|
514
517
|
}
|
|
515
518
|
}
|
|
516
|
-
return
|
|
519
|
+
return false;
|
|
517
520
|
};
|
|
518
521
|
EvaluationEngine2.prototype.matchCondition = function(target, condition) {
|
|
519
522
|
var propValue = select(target, condition.selector);
|
|
520
|
-
if (
|
|
523
|
+
if (propValue === void 0 || propValue === null) {
|
|
521
524
|
return this.matchNull(condition.op, condition.values);
|
|
522
525
|
} else if (this.isSetOperator(condition.op)) {
|
|
523
526
|
var propValueStringList = this.coerceStringArray(propValue);
|
|
@@ -778,7 +781,7 @@ var EvaluationEngine = (
|
|
|
778
781
|
return (_a = Number(value)) !== null && _a !== void 0 ? _a : void 0;
|
|
779
782
|
};
|
|
780
783
|
EvaluationEngine2.prototype.coerceString = function(value) {
|
|
781
|
-
if (
|
|
784
|
+
if (value === void 0 || value === null) {
|
|
782
785
|
return void 0;
|
|
783
786
|
}
|
|
784
787
|
if (typeof value === "object") {
|
|
@@ -803,10 +806,12 @@ var EvaluationEngine = (
|
|
|
803
806
|
return _this.coerceString(e);
|
|
804
807
|
}).filter(Boolean);
|
|
805
808
|
} else {
|
|
806
|
-
|
|
809
|
+
var s = this.coerceString(stringValue);
|
|
810
|
+
return s ? [s] : void 0;
|
|
807
811
|
}
|
|
808
812
|
} catch (_a) {
|
|
809
|
-
|
|
813
|
+
var s = this.coerceString(stringValue);
|
|
814
|
+
return s ? [s] : void 0;
|
|
810
815
|
}
|
|
811
816
|
};
|
|
812
817
|
EvaluationEngine2.prototype.isSetOperator = function(op) {
|
|
@@ -873,7 +878,7 @@ var EvaluationEngine = (
|
|
|
873
878
|
return false;
|
|
874
879
|
};
|
|
875
880
|
return EvaluationEngine2;
|
|
876
|
-
}()
|
|
881
|
+
})()
|
|
877
882
|
);
|
|
878
883
|
var topologicalSort = function(flags, flagKeys) {
|
|
879
884
|
var e_1, _a;
|
|
@@ -943,10 +948,8 @@ var parentTraversal = function(flagKey, available, path) {
|
|
|
943
948
|
delete available[flag.key];
|
|
944
949
|
return result;
|
|
945
950
|
};
|
|
946
|
-
const version = "3.7.
|
|
951
|
+
const version = "3.7.7";
|
|
947
952
|
const VERSION = version;
|
|
948
|
-
const _hasatob = typeof atob === "function";
|
|
949
|
-
const _hasbtoa = typeof btoa === "function";
|
|
950
953
|
const _hasBuffer = typeof Buffer === "function";
|
|
951
954
|
const _TD = typeof TextDecoder === "function" ? new TextDecoder() : void 0;
|
|
952
955
|
const _TE = typeof TextEncoder === "function" ? new TextEncoder() : void 0;
|
|
@@ -972,7 +975,7 @@ const btoaPolyfill = (bin) => {
|
|
|
972
975
|
}
|
|
973
976
|
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
974
977
|
};
|
|
975
|
-
const _btoa =
|
|
978
|
+
const _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill;
|
|
976
979
|
const _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString("base64") : (u8a) => {
|
|
977
980
|
const maxargs = 4096;
|
|
978
981
|
let strs = [];
|
|
@@ -1020,7 +1023,7 @@ const atobPolyfill = (asc) => {
|
|
|
1020
1023
|
}
|
|
1021
1024
|
return bin;
|
|
1022
1025
|
};
|
|
1023
|
-
const _atob =
|
|
1026
|
+
const _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
|
|
1024
1027
|
const _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
|
|
1025
1028
|
const toUint8Array = (a) => _toUint8Array(_unURI(a));
|
|
1026
1029
|
const _decode = _hasBuffer ? (a) => Buffer.from(a, "base64").toString("utf8") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
|
|
@@ -1097,7 +1100,7 @@ const gBase64 = {
|
|
|
1097
1100
|
};
|
|
1098
1101
|
var FetchError = (
|
|
1099
1102
|
/** @class */
|
|
1100
|
-
function(_super) {
|
|
1103
|
+
(function(_super) {
|
|
1101
1104
|
__extends(FetchError2, _super);
|
|
1102
1105
|
function FetchError2(statusCode, message) {
|
|
1103
1106
|
var _this = _super.call(this, message) || this;
|
|
@@ -1106,11 +1109,23 @@ var FetchError = (
|
|
|
1106
1109
|
return _this;
|
|
1107
1110
|
}
|
|
1108
1111
|
return FetchError2;
|
|
1109
|
-
}(Error)
|
|
1112
|
+
})(Error)
|
|
1113
|
+
);
|
|
1114
|
+
var TimeoutError = (
|
|
1115
|
+
/** @class */
|
|
1116
|
+
(function(_super) {
|
|
1117
|
+
__extends(TimeoutError2, _super);
|
|
1118
|
+
function TimeoutError2(message) {
|
|
1119
|
+
var _this = _super.call(this, message) || this;
|
|
1120
|
+
Object.setPrototypeOf(_this, TimeoutError2.prototype);
|
|
1121
|
+
return _this;
|
|
1122
|
+
}
|
|
1123
|
+
return TimeoutError2;
|
|
1124
|
+
})(Error)
|
|
1110
1125
|
);
|
|
1111
1126
|
var SdkEvaluationApi = (
|
|
1112
1127
|
/** @class */
|
|
1113
|
-
function() {
|
|
1128
|
+
(function() {
|
|
1114
1129
|
function SdkEvaluationApi2(deploymentKey, serverUrl, httpClient) {
|
|
1115
1130
|
this.deploymentKey = deploymentKey;
|
|
1116
1131
|
this.serverUrl = serverUrl;
|
|
@@ -1118,7 +1133,7 @@ var SdkEvaluationApi = (
|
|
|
1118
1133
|
}
|
|
1119
1134
|
SdkEvaluationApi2.prototype.getVariants = function(user, options) {
|
|
1120
1135
|
return __awaiter(this, void 0, void 0, function() {
|
|
1121
|
-
var userJsonBase64, headers, response;
|
|
1136
|
+
var userJsonBase64, headers, url, response;
|
|
1122
1137
|
return __generator(this, function(_a) {
|
|
1123
1138
|
switch (_a.label) {
|
|
1124
1139
|
case 0:
|
|
@@ -1133,8 +1148,18 @@ var SdkEvaluationApi = (
|
|
|
1133
1148
|
if (options === null || options === void 0 ? void 0 : options.trackingOption) {
|
|
1134
1149
|
headers["X-Amp-Exp-Track"] = options.trackingOption;
|
|
1135
1150
|
}
|
|
1151
|
+
if (options === null || options === void 0 ? void 0 : options.exposureTrackingOption) {
|
|
1152
|
+
headers["X-Amp-Exp-Exposure-Track"] = options.exposureTrackingOption;
|
|
1153
|
+
}
|
|
1154
|
+
url = new URL("".concat(this.serverUrl, "/sdk/v2/vardata?v=0"));
|
|
1155
|
+
if (options === null || options === void 0 ? void 0 : options.evaluationMode) {
|
|
1156
|
+
url.searchParams.append("eval_mode", options === null || options === void 0 ? void 0 : options.evaluationMode);
|
|
1157
|
+
}
|
|
1158
|
+
if (options === null || options === void 0 ? void 0 : options.deliveryMethod) {
|
|
1159
|
+
url.searchParams.append("delivery_method", options === null || options === void 0 ? void 0 : options.deliveryMethod);
|
|
1160
|
+
}
|
|
1136
1161
|
return [4, this.httpClient.request({
|
|
1137
|
-
requestUrl:
|
|
1162
|
+
requestUrl: url.toString(),
|
|
1138
1163
|
method: "GET",
|
|
1139
1164
|
headers,
|
|
1140
1165
|
timeoutMillis: options === null || options === void 0 ? void 0 : options.timeoutMillis
|
|
@@ -1150,11 +1175,11 @@ var SdkEvaluationApi = (
|
|
|
1150
1175
|
});
|
|
1151
1176
|
};
|
|
1152
1177
|
return SdkEvaluationApi2;
|
|
1153
|
-
}()
|
|
1178
|
+
})()
|
|
1154
1179
|
);
|
|
1155
1180
|
var SdkFlagApi = (
|
|
1156
1181
|
/** @class */
|
|
1157
|
-
function() {
|
|
1182
|
+
(function() {
|
|
1158
1183
|
function SdkFlagApi2(deploymentKey, serverUrl, httpClient) {
|
|
1159
1184
|
this.deploymentKey = deploymentKey;
|
|
1160
1185
|
this.serverUrl = serverUrl;
|
|
@@ -1172,8 +1197,11 @@ var SdkFlagApi = (
|
|
|
1172
1197
|
if ((options === null || options === void 0 ? void 0 : options.libraryName) && (options === null || options === void 0 ? void 0 : options.libraryVersion)) {
|
|
1173
1198
|
headers["X-Amp-Exp-Library"] = "".concat(options.libraryName, "/").concat(options.libraryVersion);
|
|
1174
1199
|
}
|
|
1200
|
+
if (options === null || options === void 0 ? void 0 : options.user) {
|
|
1201
|
+
headers["X-Amp-Exp-User"] = gBase64.encodeURL(JSON.stringify(options.user));
|
|
1202
|
+
}
|
|
1175
1203
|
return [4, this.httpClient.request({
|
|
1176
|
-
requestUrl: "".concat(this.serverUrl, "/sdk/v2/flags"),
|
|
1204
|
+
requestUrl: "".concat(this.serverUrl, "/sdk/v2/flags") + ((options === null || options === void 0 ? void 0 : options.deliveryMethod) ? "?delivery_method=".concat(options.deliveryMethod) : ""),
|
|
1177
1205
|
method: "GET",
|
|
1178
1206
|
headers,
|
|
1179
1207
|
timeoutMillis: options === null || options === void 0 ? void 0 : options.timeoutMillis
|
|
@@ -1193,12 +1221,41 @@ var SdkFlagApi = (
|
|
|
1193
1221
|
});
|
|
1194
1222
|
};
|
|
1195
1223
|
return SdkFlagApi2;
|
|
1196
|
-
}()
|
|
1224
|
+
})()
|
|
1197
1225
|
);
|
|
1198
1226
|
var safeGlobal = typeof globalThis !== "undefined" ? globalThis : global || self;
|
|
1227
|
+
var getGlobalScope = function() {
|
|
1228
|
+
if (typeof globalThis !== "undefined") {
|
|
1229
|
+
return globalThis;
|
|
1230
|
+
}
|
|
1231
|
+
if (typeof window !== "undefined") {
|
|
1232
|
+
return window;
|
|
1233
|
+
}
|
|
1234
|
+
if (typeof self !== "undefined") {
|
|
1235
|
+
return self;
|
|
1236
|
+
}
|
|
1237
|
+
if (typeof global !== "undefined") {
|
|
1238
|
+
return global;
|
|
1239
|
+
}
|
|
1240
|
+
return void 0;
|
|
1241
|
+
};
|
|
1242
|
+
var isLocalStorageAvailable = function() {
|
|
1243
|
+
var globalScope = getGlobalScope();
|
|
1244
|
+
if (globalScope) {
|
|
1245
|
+
try {
|
|
1246
|
+
var testKey = "EXP_test";
|
|
1247
|
+
globalScope.localStorage.setItem(testKey, testKey);
|
|
1248
|
+
globalScope.localStorage.removeItem(testKey);
|
|
1249
|
+
return true;
|
|
1250
|
+
} catch (e) {
|
|
1251
|
+
return false;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
return false;
|
|
1255
|
+
};
|
|
1199
1256
|
var Poller = (
|
|
1200
1257
|
/** @class */
|
|
1201
|
-
function() {
|
|
1258
|
+
(function() {
|
|
1202
1259
|
function Poller2(action, ms) {
|
|
1203
1260
|
this.poller = void 0;
|
|
1204
1261
|
this.action = action;
|
|
@@ -1219,7 +1276,7 @@ var Poller = (
|
|
|
1219
1276
|
this.poller = void 0;
|
|
1220
1277
|
};
|
|
1221
1278
|
return Poller2;
|
|
1222
|
-
}()
|
|
1279
|
+
})()
|
|
1223
1280
|
);
|
|
1224
1281
|
export {
|
|
1225
1282
|
EvaluationEngine,
|
|
@@ -1228,6 +1285,9 @@ export {
|
|
|
1228
1285
|
Poller,
|
|
1229
1286
|
SdkEvaluationApi,
|
|
1230
1287
|
SdkFlagApi,
|
|
1288
|
+
TimeoutError,
|
|
1289
|
+
getGlobalScope,
|
|
1290
|
+
isLocalStorageAvailable,
|
|
1231
1291
|
safeGlobal,
|
|
1232
1292
|
topologicalSort
|
|
1233
1293
|
};
|