@amplitude/analytics-node 1.0.4 → 1.1.0-beta.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,qBAAa,UAAW,SAAQ,MAAO,YAAW,WAAW;gBAC/C,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;CAWlD;AAED,eAAO,MAAM,aAAa,WAAY,MAAM,cAAc,WAAW,KAAG,WAEvE,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,qBAAa,UAAW,SAAQ,MAAO,YAAW,WAAW;gBAC/C,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;CAOlD;AAED,eAAO,MAAM,aAAa,WAAY,MAAM,cAAc,WAAW,KAAG,WAEvE,CAAC"}
package/lib/cjs/config.js CHANGED
@@ -6,10 +6,7 @@ var http_1 = require("./transports/http");
6
6
  var NodeConfig = /** @class */ (function (_super) {
7
7
  tslib_1.__extends(NodeConfig, _super);
8
8
  function NodeConfig(apiKey, options) {
9
- var _a;
10
- var storageProvider = options === null || options === void 0 ? void 0 : options.storageProvider;
11
- var transportProvider = (_a = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _a !== void 0 ? _a : new http_1.Http();
12
- return _super.call(this, tslib_1.__assign(tslib_1.__assign({}, options), { apiKey: apiKey, storageProvider: storageProvider, transportProvider: transportProvider })) || this;
9
+ return _super.call(this, tslib_1.__assign(tslib_1.__assign({ transportProvider: new http_1.Http() }, options), { apiKey: apiKey })) || this;
13
10
  }
14
11
  return NodeConfig;
15
12
  }(analytics_core_1.Config));
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;AACA,4DAAmD;AACnD,0CAAyC;AAEzC;IAAgC,sCAAM;IACpC,oBAAY,MAAc,EAAE,OAAqB;;QAC/C,IAAM,eAAe,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAC;QACjD,IAAM,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,IAAI,WAAI,EAAE,CAAC;eAEnE,wDACK,OAAO,KACV,MAAM,QAAA,EACN,eAAe,iBAAA,EACf,iBAAiB,mBAAA,IACjB;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAZD,CAAgC,uBAAM,GAYrC;AAZY,gCAAU;AAchB,IAAM,aAAa,GAAG,UAAC,MAAc,EAAE,SAAuB;IACnE,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB","sourcesContent":["import { NodeOptions, NodeConfig as INodeConfig } from '@amplitude/analytics-types';\nimport { Config } from '@amplitude/analytics-core';\nimport { Http } from './transports/http';\n\nexport class NodeConfig extends Config implements INodeConfig {\n constructor(apiKey: string, options?: NodeOptions) {\n const storageProvider = options?.storageProvider;\n const transportProvider = options?.transportProvider ?? new Http();\n\n super({\n ...options,\n apiKey,\n storageProvider,\n transportProvider,\n });\n }\n}\n\nexport const useNodeConfig = (apiKey: string, overrides?: NodeOptions): INodeConfig => {\n return new NodeConfig(apiKey, overrides);\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;AACA,4DAAmD;AACnD,0CAAyC;AAEzC;IAAgC,sCAAM;IACpC,oBAAY,MAAc,EAAE,OAAqB;eAC/C,sDACE,iBAAiB,EAAE,IAAI,WAAI,EAAE,IAC1B,OAAO,KACV,MAAM,QAAA,IACN;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AARD,CAAgC,uBAAM,GAQrC;AARY,gCAAU;AAUhB,IAAM,aAAa,GAAG,UAAC,MAAc,EAAE,SAAuB;IACnE,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB","sourcesContent":["import { NodeOptions, NodeConfig as INodeConfig } from '@amplitude/analytics-types';\nimport { Config } from '@amplitude/analytics-core';\nimport { Http } from './transports/http';\n\nexport class NodeConfig extends Config implements INodeConfig {\n constructor(apiKey: string, options?: NodeOptions) {\n super({\n transportProvider: new Http(),\n ...options,\n apiKey,\n });\n }\n}\n\nexport const useNodeConfig = (apiKey: string, overrides?: NodeOptions): INodeConfig => {\n return new NodeConfig(apiKey, overrides);\n};\n"]}
@@ -1,7 +1,11 @@
1
1
  import { AmplitudeCore } from '@amplitude/analytics-core';
2
2
  import { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';
3
- export declare class AmplitudeNode extends AmplitudeCore<NodeConfig> {
4
- init(apiKey?: string, options?: NodeOptions): Promise<void>;
3
+ export declare class AmplitudeNode extends AmplitudeCore {
4
+ config: NodeConfig;
5
+ init(apiKey?: string, options?: NodeOptions): import("@amplitude/analytics-types").AmplitudeReturn<void>;
6
+ protected _init(options: NodeOptions & {
7
+ apiKey: string;
8
+ }): Promise<void>;
5
9
  }
6
10
  export declare const createInstance: () => NodeClient;
7
11
  declare const _default: NodeClient;
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAMd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIjF,qBAAa,aAAc,SAAQ,aAAa,CAAC,UAAU,CAAC;IACpD,IAAI,CAAC,MAAM,SAAK,EAAE,OAAO,CAAC,EAAE,WAAW;CAoB9C;AAED,eAAO,MAAM,cAAc,QAAO,UAsEjC,CAAC;;AAEF,wBAAgC"}
1
+ {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAMd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIjF,qBAAa,aAAc,SAAQ,aAAa;IAG9C,MAAM,EAAE,UAAU,CAAC;IAEnB,IAAI,CAAC,MAAM,SAAK,EAAE,OAAO,CAAC,EAAE,WAAW;cAGvB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAoBhE;AAED,eAAO,MAAM,cAAc,QAAO,UAsEjC,CAAC;;AAEF,wBAAgC"}
@@ -11,6 +11,9 @@ var AmplitudeNode = /** @class */ (function (_super) {
11
11
  }
12
12
  AmplitudeNode.prototype.init = function (apiKey, options) {
13
13
  if (apiKey === void 0) { apiKey = ''; }
14
+ return (0, analytics_core_1.returnWrapper)(this._init(tslib_1.__assign(tslib_1.__assign({}, options), { apiKey: apiKey })));
15
+ };
16
+ AmplitudeNode.prototype._init = function (options) {
14
17
  return tslib_1.__awaiter(this, void 0, void 0, function () {
15
18
  var nodeOptions;
16
19
  return tslib_1.__generator(this, function (_a) {
@@ -21,14 +24,14 @@ var AmplitudeNode = /** @class */ (function (_super) {
21
24
  return [2 /*return*/];
22
25
  }
23
26
  this.initializing = true;
24
- nodeOptions = (0, config_1.useNodeConfig)(apiKey, tslib_1.__assign({}, options));
27
+ nodeOptions = (0, config_1.useNodeConfig)(options.apiKey, tslib_1.__assign({}, options));
25
28
  return [4 /*yield*/, _super.prototype._init.call(this, nodeOptions)];
26
29
  case 1:
27
30
  _a.sent();
28
- return [4 /*yield*/, this.add(new context_1.Context())];
31
+ return [4 /*yield*/, this.add(new analytics_core_1.Destination()).promise];
29
32
  case 2:
30
33
  _a.sent();
31
- return [4 /*yield*/, this.add(new analytics_core_1.Destination())];
34
+ return [4 /*yield*/, this.add(new context_1.Context()).promise];
32
35
  case 3:
33
36
  _a.sent();
34
37
  this.initializing = false;
@@ -46,16 +49,16 @@ exports.AmplitudeNode = AmplitudeNode;
46
49
  var createInstance = function () {
47
50
  var client = new AmplitudeNode();
48
51
  return {
49
- init: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.init.bind(client)), 'init', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
50
- add: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.add.bind(client)), 'add', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.plugins'])),
51
- remove: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.remove.bind(client)), 'remove', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.plugins'])),
52
- track: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.track.bind(client)), 'track', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
53
- logEvent: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.logEvent.bind(client)), 'logEvent', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
54
- identify: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.identify.bind(client)), 'identify', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
55
- groupIdentify: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.groupIdentify.bind(client)), 'groupIdentify', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
56
- setGroup: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.setGroup.bind(client)), 'setGroup', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
57
- revenue: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.revenue.bind(client)), 'revenue', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
58
- flush: (0, analytics_core_1.debugWrapper)((0, analytics_core_1.returnWrapper)(client.flush.bind(client)), 'flush', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
52
+ init: (0, analytics_core_1.debugWrapper)(client.init.bind(client), 'init', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
53
+ add: (0, analytics_core_1.debugWrapper)(client.add.bind(client), 'add', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.plugins'])),
54
+ remove: (0, analytics_core_1.debugWrapper)(client.remove.bind(client), 'remove', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.plugins'])),
55
+ track: (0, analytics_core_1.debugWrapper)(client.track.bind(client), 'track', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
56
+ logEvent: (0, analytics_core_1.debugWrapper)(client.logEvent.bind(client), 'logEvent', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
57
+ identify: (0, analytics_core_1.debugWrapper)(client.identify.bind(client), 'identify', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
58
+ groupIdentify: (0, analytics_core_1.debugWrapper)(client.groupIdentify.bind(client), 'groupIdentify', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
59
+ setGroup: (0, analytics_core_1.debugWrapper)(client.setGroup.bind(client), 'setGroup', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
60
+ revenue: (0, analytics_core_1.debugWrapper)(client.revenue.bind(client), 'revenue', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
61
+ flush: (0, analytics_core_1.debugWrapper)(client.flush.bind(client), 'flush', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config.apiKey', 'timeline.queue.length'])),
59
62
  setOptOut: (0, analytics_core_1.debugWrapper)(client.setOptOut.bind(client), 'setOptOut', (0, analytics_core_1.getClientLogConfig)(client), (0, analytics_core_1.getClientStates)(client, ['config'])),
60
63
  };
61
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";;;AAAA,4DAOmC;AAEnC,6CAA4C;AAC5C,mCAAyC;AAEzC;IAAmC,yCAAyB;IAA5D;;IAqBA,CAAC;IApBO,4BAAI,GAAV,UAAW,MAAW,EAAE,OAAqB;QAAlC,uBAAA,EAAA,WAAW;;;;;;wBACpB,0CAA0C;wBAC1C,IAAI,IAAI,CAAC,YAAY,EAAE;4BACrB,sBAAO;yBACR;wBACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC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,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,OAAO,EAAE,IAAA,6BAAY,EACnB,IAAA,8BAAa,EAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAC1C,SAAS,EACT,IAAA,mCAAkB,EAAC,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,KAAK,EAAE,IAAA,6BAAY,EACjB,IAAA,8BAAa,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EACxC,OAAO,EACP,IAAA,mCAAkB,EAAC,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,SAAS,EAAE,IAAA,6BAAY,EACrB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAC7B,WAAW,EACX,IAAA,mCAAkB,EAAC,MAAM,CAAC,EAC1B,IAAA,gCAAe,EAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;KACF,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,cAAc,kBAsEzB;AAEF,kBAAe,IAAA,sBAAc,GAAE,CAAC","sourcesContent":["import {\n AmplitudeCore,\n Destination,\n returnWrapper,\n debugWrapper,\n getClientLogConfig,\n getClientStates,\n} from '@amplitude/analytics-core';\nimport { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';\nimport { Context } from './plugins/context';\nimport { useNodeConfig } from './config';\n\nexport class AmplitudeNode extends AmplitudeCore<NodeConfig> {\n async init(apiKey = '', options?: NodeOptions) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n const nodeOptions = useNodeConfig(apiKey, {\n ...options,\n });\n\n await super._init(nodeOptions);\n\n await this.add(new Context());\n await this.add(new Destination());\n\n this.initializing = false;\n\n await this.runQueuedFunctions('dispatchQ');\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: debugWrapper(\n returnWrapper(client.init.bind(client)),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n returnWrapper(client.add.bind(client)),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n returnWrapper(client.remove.bind(client)),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n returnWrapper(client.track.bind(client)),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n returnWrapper(client.logEvent.bind(client)),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n returnWrapper(client.identify.bind(client)),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n returnWrapper(client.groupIdentify.bind(client)),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n returnWrapper(client.setGroup.bind(client)),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n returnWrapper(client.revenue.bind(client)),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n returnWrapper(client.flush.bind(client)),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
1
+ {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";;;AAAA,4DAOmC;AAEnC,6CAA4C;AAC5C,mCAAyC;AAEzC;IAAmC,yCAAa;IAAhD;;IA4BA,CAAC;IAvBC,4BAAI,GAAJ,UAAK,MAAW,EAAE,OAAqB;QAAlC,uBAAA,EAAA,WAAW;QACd,OAAO,IAAA,8BAAa,EAAC,IAAI,CAAC,KAAK,uCAAM,OAAO,KAAE,MAAM,QAAA,IAAG,CAAC,CAAC;IAC3D,CAAC;IACe,6BAAK,GAArB,UAAsB,OAAyC;;;;;;wBAC7D,0CAA0C;wBAC1C,IAAI,IAAI,CAAC,YAAY,EAAE;4BACrB,sBAAO;yBACR;wBACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;wBAEnB,WAAW,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,MAAM,uBAC3C,OAAO,EACV,CAAC;wBAEH,qBAAM,iBAAM,KAAK,YAAC,WAAW,CAAC,EAAA;;wBAA9B,SAA8B,CAAC;wBAE/B,qBAAM,IAAI,CAAC,GAAG,CAAC,IAAI,4BAAW,EAAE,CAAC,CAAC,OAAO,EAAA;;wBAAzC,SAAyC,CAAC;wBAC1C,qBAAM,IAAI,CAAC,GAAG,CAAC,IAAI,iBAAO,EAAE,CAAC,CAAC,OAAO,EAAA;;wBAArC,SAAqC,CAAC;wBAEtC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;wBAE1B,qBAAM,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAA;;wBAA1C,SAA0C,CAAC;;;;;KAC5C;IACH,oBAAC;AAAD,CAAC,AA5BD,CAAmC,8BAAa,GA4B/C;AA5BY,sCAAa;AA8BnB,IAAM,cAAc,GAAG;IAC5B,IAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;IACn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,GAAE,CAAC","sourcesContent":["import {\n AmplitudeCore,\n Destination,\n returnWrapper,\n debugWrapper,\n getClientLogConfig,\n getClientStates,\n} from '@amplitude/analytics-core';\nimport { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';\nimport { Context } from './plugins/context';\nimport { useNodeConfig } from './config';\n\nexport class AmplitudeNode extends AmplitudeCore {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n config: NodeConfig;\n\n init(apiKey = '', options?: NodeOptions) {\n return returnWrapper(this._init({ ...options, apiKey }));\n }\n protected async _init(options: NodeOptions & { apiKey: string }) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n const nodeOptions = useNodeConfig(options.apiKey, {\n ...options,\n });\n\n await super._init(nodeOptions);\n\n await this.add(new Destination()).promise;\n await this.add(new Context()).promise;\n\n this.initializing = false;\n\n await this.runQueuedFunctions('dispatchQ');\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: debugWrapper(\n client.init.bind(client),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n client.add.bind(client),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n client.remove.bind(client),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n client.track.bind(client),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n client.logEvent.bind(client),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n client.identify.bind(client),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n client.groupIdentify.bind(client),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n client.setGroup.bind(client),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n client.revenue.bind(client),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n client.flush.bind(client),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.4";
1
+ export declare const VERSION = "1.1.0-beta.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,iBAAiB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.VERSION = void 0;
3
- exports.VERSION = '1.0.4';
3
+ exports.VERSION = '1.1.0-beta.0';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.0.4';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,cAAc,CAAC","sourcesContent":["export const VERSION = '1.1.0-beta.0';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,qBAAa,UAAW,SAAQ,MAAO,YAAW,WAAW;gBAC/C,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;CAWlD;AAED,eAAO,MAAM,aAAa,WAAY,MAAM,cAAc,WAAW,KAAG,WAEvE,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,qBAAa,UAAW,SAAQ,MAAO,YAAW,WAAW;gBAC/C,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;CAOlD;AAED,eAAO,MAAM,aAAa,WAAY,MAAM,cAAc,WAAW,KAAG,WAEvE,CAAC"}
package/lib/esm/config.js CHANGED
@@ -4,10 +4,7 @@ import { Http } from './transports/http';
4
4
  var NodeConfig = /** @class */ (function (_super) {
5
5
  __extends(NodeConfig, _super);
6
6
  function NodeConfig(apiKey, options) {
7
- var _a;
8
- var storageProvider = options === null || options === void 0 ? void 0 : options.storageProvider;
9
- var transportProvider = (_a = options === null || options === void 0 ? void 0 : options.transportProvider) !== null && _a !== void 0 ? _a : new Http();
10
- return _super.call(this, __assign(__assign({}, options), { apiKey: apiKey, storageProvider: storageProvider, transportProvider: transportProvider })) || this;
7
+ return _super.call(this, __assign(__assign({ transportProvider: new Http() }, options), { apiKey: apiKey })) || this;
11
8
  }
12
9
  return NodeConfig;
13
10
  }(Config));
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC;IAAgC,8BAAM;IACpC,oBAAY,MAAc,EAAE,OAAqB;;QAC/C,IAAM,eAAe,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAC;QACjD,IAAM,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,IAAI,IAAI,EAAE,CAAC;eAEnE,wCACK,OAAO,KACV,MAAM,QAAA,EACN,eAAe,iBAAA,EACf,iBAAiB,mBAAA,IACjB;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAZD,CAAgC,MAAM,GAYrC;;AAED,MAAM,CAAC,IAAM,aAAa,GAAG,UAAC,MAAc,EAAE,SAAuB;IACnE,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["import { NodeOptions, NodeConfig as INodeConfig } from '@amplitude/analytics-types';\nimport { Config } from '@amplitude/analytics-core';\nimport { Http } from './transports/http';\n\nexport class NodeConfig extends Config implements INodeConfig {\n constructor(apiKey: string, options?: NodeOptions) {\n const storageProvider = options?.storageProvider;\n const transportProvider = options?.transportProvider ?? new Http();\n\n super({\n ...options,\n apiKey,\n storageProvider,\n transportProvider,\n });\n }\n}\n\nexport const useNodeConfig = (apiKey: string, overrides?: NodeOptions): INodeConfig => {\n return new NodeConfig(apiKey, overrides);\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC;IAAgC,8BAAM;IACpC,oBAAY,MAAc,EAAE,OAAqB;eAC/C,sCACE,iBAAiB,EAAE,IAAI,IAAI,EAAE,IAC1B,OAAO,KACV,MAAM,QAAA,IACN;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AARD,CAAgC,MAAM,GAQrC;;AAED,MAAM,CAAC,IAAM,aAAa,GAAG,UAAC,MAAc,EAAE,SAAuB;IACnE,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["import { NodeOptions, NodeConfig as INodeConfig } from '@amplitude/analytics-types';\nimport { Config } from '@amplitude/analytics-core';\nimport { Http } from './transports/http';\n\nexport class NodeConfig extends Config implements INodeConfig {\n constructor(apiKey: string, options?: NodeOptions) {\n super({\n transportProvider: new Http(),\n ...options,\n apiKey,\n });\n }\n}\n\nexport const useNodeConfig = (apiKey: string, overrides?: NodeOptions): INodeConfig => {\n return new NodeConfig(apiKey, overrides);\n};\n"]}
@@ -1,7 +1,11 @@
1
1
  import { AmplitudeCore } from '@amplitude/analytics-core';
2
2
  import { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';
3
- export declare class AmplitudeNode extends AmplitudeCore<NodeConfig> {
4
- init(apiKey?: string, options?: NodeOptions): Promise<void>;
3
+ export declare class AmplitudeNode extends AmplitudeCore {
4
+ config: NodeConfig;
5
+ init(apiKey?: string, options?: NodeOptions): import("@amplitude/analytics-types").AmplitudeReturn<void>;
6
+ protected _init(options: NodeOptions & {
7
+ apiKey: string;
8
+ }): Promise<void>;
5
9
  }
6
10
  export declare const createInstance: () => NodeClient;
7
11
  declare const _default: NodeClient;
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAMd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIjF,qBAAa,aAAc,SAAQ,aAAa,CAAC,UAAU,CAAC;IACpD,IAAI,CAAC,MAAM,SAAK,EAAE,OAAO,CAAC,EAAE,WAAW;CAoB9C;AAED,eAAO,MAAM,cAAc,QAAO,UAsEjC,CAAC;;AAEF,wBAAgC"}
1
+ {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAMd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIjF,qBAAa,aAAc,SAAQ,aAAa;IAG9C,MAAM,EAAE,UAAU,CAAC;IAEnB,IAAI,CAAC,MAAM,SAAK,EAAE,OAAO,CAAC,EAAE,WAAW;cAGvB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAoBhE;AAED,eAAO,MAAM,cAAc,QAAO,UAsEjC,CAAC;;AAEF,wBAAgC"}
@@ -9,6 +9,9 @@ var AmplitudeNode = /** @class */ (function (_super) {
9
9
  }
10
10
  AmplitudeNode.prototype.init = function (apiKey, options) {
11
11
  if (apiKey === void 0) { apiKey = ''; }
12
+ return returnWrapper(this._init(__assign(__assign({}, options), { apiKey: apiKey })));
13
+ };
14
+ AmplitudeNode.prototype._init = function (options) {
12
15
  return __awaiter(this, void 0, void 0, function () {
13
16
  var nodeOptions;
14
17
  return __generator(this, function (_a) {
@@ -19,14 +22,14 @@ var AmplitudeNode = /** @class */ (function (_super) {
19
22
  return [2 /*return*/];
20
23
  }
21
24
  this.initializing = true;
22
- nodeOptions = useNodeConfig(apiKey, __assign({}, options));
25
+ nodeOptions = useNodeConfig(options.apiKey, __assign({}, options));
23
26
  return [4 /*yield*/, _super.prototype._init.call(this, nodeOptions)];
24
27
  case 1:
25
28
  _a.sent();
26
- return [4 /*yield*/, this.add(new Context())];
29
+ return [4 /*yield*/, this.add(new Destination()).promise];
27
30
  case 2:
28
31
  _a.sent();
29
- return [4 /*yield*/, this.add(new Destination())];
32
+ return [4 /*yield*/, this.add(new Context()).promise];
30
33
  case 3:
31
34
  _a.sent();
32
35
  this.initializing = false;
@@ -44,16 +47,16 @@ export { AmplitudeNode };
44
47
  export var createInstance = function () {
45
48
  var client = new AmplitudeNode();
46
49
  return {
47
- init: debugWrapper(returnWrapper(client.init.bind(client)), 'init', getClientLogConfig(client), getClientStates(client, ['config'])),
48
- add: debugWrapper(returnWrapper(client.add.bind(client)), 'add', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),
49
- remove: debugWrapper(returnWrapper(client.remove.bind(client)), 'remove', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),
50
- track: debugWrapper(returnWrapper(client.track.bind(client)), 'track', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
51
- logEvent: debugWrapper(returnWrapper(client.logEvent.bind(client)), 'logEvent', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
52
- identify: debugWrapper(returnWrapper(client.identify.bind(client)), 'identify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
53
- groupIdentify: debugWrapper(returnWrapper(client.groupIdentify.bind(client)), 'groupIdentify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
54
- setGroup: debugWrapper(returnWrapper(client.setGroup.bind(client)), 'setGroup', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
55
- revenue: debugWrapper(returnWrapper(client.revenue.bind(client)), 'revenue', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
56
- flush: debugWrapper(returnWrapper(client.flush.bind(client)), 'flush', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
50
+ init: debugWrapper(client.init.bind(client), 'init', getClientLogConfig(client), getClientStates(client, ['config'])),
51
+ add: debugWrapper(client.add.bind(client), 'add', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),
52
+ remove: debugWrapper(client.remove.bind(client), 'remove', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.plugins'])),
53
+ track: debugWrapper(client.track.bind(client), 'track', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
54
+ logEvent: debugWrapper(client.logEvent.bind(client), 'logEvent', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
55
+ identify: debugWrapper(client.identify.bind(client), 'identify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
56
+ groupIdentify: debugWrapper(client.groupIdentify.bind(client), 'groupIdentify', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
57
+ setGroup: debugWrapper(client.setGroup.bind(client), 'setGroup', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
58
+ revenue: debugWrapper(client.revenue.bind(client), 'revenue', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
59
+ flush: debugWrapper(client.flush.bind(client), 'flush', getClientLogConfig(client), getClientStates(client, ['config.apiKey', 'timeline.queue.length'])),
57
60
  setOptOut: debugWrapper(client.setOptOut.bind(client), 'setOptOut', getClientLogConfig(client), getClientStates(client, ['config'])),
58
61
  };
59
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;IAAmC,iCAAyB;IAA5D;;IAqBA,CAAC;IApBO,4BAAI,GAAV,UAAW,MAAW,EAAE,O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,CAAC,CACpE;QACD,OAAO,EAAE,YAAY,CACnB,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAC1C,SAAS,EACT,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,KAAK,EAAE,YAAY,CACjB,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EACxC,OAAO,EACP,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,SAAS,EAAE,YAAY,CACrB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAC7B,WAAW,EACX,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,EAAE,CAAC","sourcesContent":["import {\n AmplitudeCore,\n Destination,\n returnWrapper,\n debugWrapper,\n getClientLogConfig,\n getClientStates,\n} from '@amplitude/analytics-core';\nimport { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';\nimport { Context } from './plugins/context';\nimport { useNodeConfig } from './config';\n\nexport class AmplitudeNode extends AmplitudeCore<NodeConfig> {\n async init(apiKey = '', options?: NodeOptions) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n const nodeOptions = useNodeConfig(apiKey, {\n ...options,\n });\n\n await super._init(nodeOptions);\n\n await this.add(new Context());\n await this.add(new Destination());\n\n this.initializing = false;\n\n await this.runQueuedFunctions('dispatchQ');\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: debugWrapper(\n returnWrapper(client.init.bind(client)),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n returnWrapper(client.add.bind(client)),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n returnWrapper(client.remove.bind(client)),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n returnWrapper(client.track.bind(client)),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n returnWrapper(client.logEvent.bind(client)),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n returnWrapper(client.identify.bind(client)),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n returnWrapper(client.groupIdentify.bind(client)),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n returnWrapper(client.setGroup.bind(client)),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n returnWrapper(client.revenue.bind(client)),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n returnWrapper(client.flush.bind(client)),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
1
+ {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,aAAa,EACb,YA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MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,QAAQ,EAAE,YAAY,CACpB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAC5B,UAAU,EACV,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,OAAO,EAAE,YAAY,CACnB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAC3B,SAAS,EACT,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,KAAK,EAAE,YAAY,CACjB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EACzB,OAAO,EACP,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC,CACpE;QACD,SAAS,EAAE,YAAY,CACrB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAC7B,WAAW,EACX,kBAAkB,CAAC,MAAM,CAAC,EAC1B,eAAe,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CACpC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,EAAE,CAAC","sourcesContent":["import {\n AmplitudeCore,\n Destination,\n returnWrapper,\n debugWrapper,\n getClientLogConfig,\n getClientStates,\n} from '@amplitude/analytics-core';\nimport { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';\nimport { Context } from './plugins/context';\nimport { useNodeConfig } from './config';\n\nexport class AmplitudeNode extends AmplitudeCore {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n config: NodeConfig;\n\n init(apiKey = '', options?: NodeOptions) {\n return returnWrapper(this._init({ ...options, apiKey }));\n }\n protected async _init(options: NodeOptions & { apiKey: string }) {\n // Step 0: Block concurrent initialization\n if (this.initializing) {\n return;\n }\n this.initializing = true;\n\n const nodeOptions = useNodeConfig(options.apiKey, {\n ...options,\n });\n\n await super._init(nodeOptions);\n\n await this.add(new Destination()).promise;\n await this.add(new Context()).promise;\n\n this.initializing = false;\n\n await this.runQueuedFunctions('dispatchQ');\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: debugWrapper(\n client.init.bind(client),\n 'init',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n add: debugWrapper(\n client.add.bind(client),\n 'add',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n remove: debugWrapper(\n client.remove.bind(client),\n 'remove',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.plugins']),\n ),\n track: debugWrapper(\n client.track.bind(client),\n 'track',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n logEvent: debugWrapper(\n client.logEvent.bind(client),\n 'logEvent',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n identify: debugWrapper(\n client.identify.bind(client),\n 'identify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n groupIdentify: debugWrapper(\n client.groupIdentify.bind(client),\n 'groupIdentify',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setGroup: debugWrapper(\n client.setGroup.bind(client),\n 'setGroup',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n revenue: debugWrapper(\n client.revenue.bind(client),\n 'revenue',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n flush: debugWrapper(\n client.flush.bind(client),\n 'flush',\n getClientLogConfig(client),\n getClientStates(client, ['config.apiKey', 'timeline.queue.length']),\n ),\n setOptOut: debugWrapper(\n client.setOptOut.bind(client),\n 'setOptOut',\n getClientLogConfig(client),\n getClientStates(client, ['config']),\n ),\n };\n};\n\nexport default createInstance();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.4";
1
+ export declare const VERSION = "1.1.0-beta.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,iBAAiB,CAAC"}
@@ -1,2 +1,2 @@
1
- export var VERSION = '1.0.4';
1
+ export var VERSION = '1.1.0-beta.0';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.0.4';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,cAAc,CAAC","sourcesContent":["export const VERSION = '1.1.0-beta.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-node",
3
- "version": "1.0.4",
3
+ "version": "1.1.0-beta.0",
4
4
  "description": "Official Amplitude SDK for NodeJS",
5
5
  "author": "Amplitude Inc",
6
6
  "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
@@ -36,12 +36,12 @@
36
36
  "url": "https://github.com/amplitude/Amplitude-TypeScript/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@amplitude/analytics-core": "^0.11.3",
40
- "@amplitude/analytics-types": "^0.15.0",
39
+ "@amplitude/analytics-core": "^0.12.0-beta.0",
40
+ "@amplitude/analytics-types": "^0.17.0-beta.0",
41
41
  "tslib": "^2.4.1"
42
42
  },
43
43
  "files": [
44
44
  "lib"
45
45
  ],
46
- "gitHead": "dba664d43a3a7c758b694ce36edc5da61dab29e1"
46
+ "gitHead": "5590f7d77d93362d2f3db6d47116ca502afd1fc4"
47
47
  }