@amplitude/analytics-node 0.5.4 → 0.5.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.
@@ -1,7 +1,7 @@
1
1
  import { AmplitudeCore } from '@amplitude/analytics-core';
2
2
  import { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';
3
3
  export declare class AmplitudeNode extends AmplitudeCore<NodeConfig> {
4
- init(apiKey: string, options?: NodeOptions): Promise<void>;
4
+ init(apiKey?: string, options?: NodeOptions): Promise<void>;
5
5
  }
6
6
  export declare const createInstance: () => NodeClient;
7
7
  declare const _default: NodeClient;
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA8B,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIjF,qBAAa,aAAc,SAAQ,aAAa,CAAC,UAAU,CAAC;IACpD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;CAyBjD;AAED,eAAO,MAAM,cAAc,QAAO,UAejC,CAAC;;AAEF,wBAAgC"}
1
+ {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA8B,MAAM,2BAA2B,CAAC;AACtF,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;CAyB9C;AAED,eAAO,MAAM,cAAc,QAAO,UAejC,CAAC;;AAEF,wBAAgC"}
@@ -10,6 +10,7 @@ var AmplitudeNode = /** @class */ (function (_super) {
10
10
  return _super !== null && _super.apply(this, arguments) || this;
11
11
  }
12
12
  AmplitudeNode.prototype.init = function (apiKey, options) {
13
+ if (apiKey === void 0) { apiKey = ''; }
13
14
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
14
15
  var nodeOptions;
15
16
  return (0, tslib_1.__generator)(this, function (_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";;;AAAA,4DAAsF;AAEtF,6CAA4C;AAC5C,mCAAyC;AAEzC;IAAmC,8CAAyB;IAA5D;;IA0BA,CAAC;IAzBO,4BAAI,GAAV,UAAW,MAAc,EAAE,OAAqB;;;;;;wBAC9C,0CAA0C;wBAC1C,IAAI,IAAI,CAAC,YAAY,EAAE;4BACrB,sBAAO;yBACR;wBACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;wBAEnB,WAAW,GAAG,IAAA,sBAAa,EAAC,MAAM,4BACnC,OAAO,EACV,CAAC;wBAEH,qBAAM,iBAAM,KAAK,YAAC,WAAW,CAAC,EAAA;;wBAA9B,SAA8B,CAAC;wBAE/B,qBAAM,IAAI,CAAC,GAAG,CAAC,IAAI,iBAAO,EAAE,CAAC,EAAA;;wBAA7B,SAA6B,CAAC;wBAC9B,qBAAM,IAAI,CAAC,GAAG,CAAC,IAAI,4BAAW,EAAE,CAAC,EAAA;;wBAAjC,SAAiC,CAAC;wBAElC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;wBAE1B,2CAA2C;wBAC3C,sEAAsE;wBACtE,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;wBAC7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;4BACvB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;yBAChC;;;;;KACF;IACH,oBAAC;AAAD,CAAC,AA1BD,CAAmC,8BAAa,GA0B/C;AA1BY,sCAAa;AA4BnB,IAAM,cAAc,GAAG;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'@amplitude/analytics-types';\nimport { Context } from './plugins/context';\nimport { useNodeConfig } from './config';\n\nexport class AmplitudeNode extends AmplitudeCore<NodeConfig> {\n async init(apiKey: string, 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 // Set timeline ready for processing events\n // Send existing events, which might be collected by track before init\n this.timeline.isReady = true;\n if (!this.config.optOut) {\n this.timeline.scheduleApply(0);\n }\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: returnWrapper(client.init.bind(client)),\n add: returnWrapper(client.add.bind(client)),\n remove: returnWrapper(client.remove.bind(client)),\n track: returnWrapper(client.track.bind(client)),\n logEvent: returnWrapper(client.logEvent.bind(client)),\n identify: returnWrapper(client.identify.bind(client)),\n groupIdentify: returnWrapper(client.groupIdentify.bind(client)),\n setGroup: returnWrapper(client.setGroup.bind(client)),\n revenue: returnWrapper(client.revenue.bind(client)),\n flush: returnWrapper(client.flush.bind(client)),\n setOptOut: client.setOptOut.bind(client),\n };\n};\n\nexport default createInstance();\n"]}
1
+ {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";;;AAAA,4DAAsF;AAEtF,6CAA4C;AAC5C,mCAAyC;AAEzC;IAAmC,8CAAyB;IAA5D;;IA0BA,CAAC;IAzBO,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;wBAEnB,WAAW,GAAG,IAAA,sBAAa,EAAC,MAAM,4BACnC,OAAO,EACV,CAAC;wBAEH,qBAAM,iBAAM,KA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EAAE,IAAA,8BAAa,EAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/D,QAAQ,EAAE,IAAA,8BAAa,EAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,OAAO,EAAE,IAAA,8BAAa,EAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,EAAE,IAAA,8BAAa,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;KACzC,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB;AAEF,kBAAe,IAAA,sBAAc,GAAE,CAAC","sourcesContent":["import { AmplitudeCore, Destination, returnWrapper } 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 // Set timeline ready for processing events\n // Send existing events, which might be collected by track before init\n this.timeline.isReady = true;\n if (!this.config.optOut) {\n this.timeline.scheduleApply(0);\n }\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: returnWrapper(client.init.bind(client)),\n add: returnWrapper(client.add.bind(client)),\n remove: returnWrapper(client.remove.bind(client)),\n track: returnWrapper(client.track.bind(client)),\n logEvent: returnWrapper(client.logEvent.bind(client)),\n identify: returnWrapper(client.identify.bind(client)),\n groupIdentify: returnWrapper(client.groupIdentify.bind(client)),\n setGroup: returnWrapper(client.setGroup.bind(client)),\n revenue: returnWrapper(client.revenue.bind(client)),\n flush: returnWrapper(client.flush.bind(client)),\n setOptOut: client.setOptOut.bind(client),\n };\n};\n\nexport default createInstance();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.5.4";
1
+ export declare const VERSION = "0.5.6";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.VERSION = void 0;
3
- exports.VERSION = '0.5.4';
3
+ exports.VERSION = '0.5.6';
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 = '0.5.4';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '0.5.6';\n"]}
@@ -1,7 +1,7 @@
1
1
  import { AmplitudeCore } from '@amplitude/analytics-core';
2
2
  import { NodeClient, NodeConfig, NodeOptions } from '@amplitude/analytics-types';
3
3
  export declare class AmplitudeNode extends AmplitudeCore<NodeConfig> {
4
- init(apiKey: string, options?: NodeOptions): Promise<void>;
4
+ init(apiKey?: string, options?: NodeOptions): Promise<void>;
5
5
  }
6
6
  export declare const createInstance: () => NodeClient;
7
7
  declare const _default: NodeClient;
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA8B,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIjF,qBAAa,aAAc,SAAQ,aAAa,CAAC,UAAU,CAAC;IACpD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW;CAyBjD;AAED,eAAO,MAAM,cAAc,QAAO,UAejC,CAAC;;AAEF,wBAAgC"}
1
+ {"version":3,"file":"node-client.d.ts","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA8B,MAAM,2BAA2B,CAAC;AACtF,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;CAyB9C;AAED,eAAO,MAAM,cAAc,QAAO,UAejC,CAAC;;AAEF,wBAAgC"}
@@ -8,6 +8,7 @@ var AmplitudeNode = /** @class */ (function (_super) {
8
8
  return _super !== null && _super.apply(this, arguments) || this;
9
9
  }
10
10
  AmplitudeNode.prototype.init = function (apiKey, options) {
11
+ if (apiKey === void 0) { apiKey = ''; }
11
12
  return __awaiter(this, void 0, void 0, function () {
12
13
  var nodeOptions;
13
14
  return __generator(this, function (_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;IAAmC,iCAAyB;IAA5D;;IA0BA,CAAC;IAzBO,4BAAI,GAAV,UAAW,MAAc,EAAE,OAAqB;;;;;;wBAC9C,0CAA0C;wBAC1C,IAAI,IAAI,CAAC,YAAY,EAAE;4BACrB,sBAAO;yBACR;wBACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;wBAEnB,WAAW,GAAG,aAAa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D,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/D,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;KACzC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,EAAE,CAAC","sourcesContent":["import { AmplitudeCore, Destination, returnWrapper } 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: string, 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 // Set timeline ready for processing events\n // Send existing events, which might be collected by track before init\n this.timeline.isReady = true;\n if (!this.config.optOut) {\n this.timeline.scheduleApply(0);\n }\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: returnWrapper(client.init.bind(client)),\n add: returnWrapper(client.add.bind(client)),\n remove: returnWrapper(client.remove.bind(client)),\n track: returnWrapper(client.track.bind(client)),\n logEvent: returnWrapper(client.logEvent.bind(client)),\n identify: returnWrapper(client.identify.bind(client)),\n groupIdentify: returnWrapper(client.groupIdentify.bind(client)),\n setGroup: returnWrapper(client.setGroup.bind(client)),\n revenue: returnWrapper(client.revenue.bind(client)),\n flush: returnWrapper(client.flush.bind(client)),\n setOptOut: client.setOptOut.bind(client),\n };\n};\n\nexport default createInstance();\n"]}
1
+ {"version":3,"file":"node-client.js","sourceRoot":"","sources":["../../src/node-client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;IAAmC,iCAAyB;IAA5D;;IA0BA,CAAC;IAzBO,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;wBAEnB,WAAW,GAAG,aAAa,CAAC,MAAM,eACnC,OAAO,EACV,CAAC;wBAEH,qBAAM,iBAAM,KAAK,YAAC,WAAW,CAAC,EAAA;;wBAA9B,SAA8B,CAAC;wBAE/B,qBAAM,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,EAAA;;wBAA7B,SAA6B,CAAC;wBAC9B,qBAAM,IAAI,CAAC,GAAG,CAAC,IAAI,WAAW,EAAE,CAAC,EAAA;;wBAAjC,SAAiC,CAAC;wBAElC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;wBAE1B,2CAA2C;wBAC3C,sEAAsE;wBACtE,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;wBAC7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;4BACvB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;yBAChC;;;;;KACF;IACH,oBAAC;AAAD,CAAC,AA1BD,CAAmC,aAAa,GA0B/C;;AAED,MAAM,CAAC,IAAM,cAAc,GAAG;IAC5B,IAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;IACnC,OAAO;QACL,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/D,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;KACzC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,EAAE,CAAC","sourcesContent":["import { AmplitudeCore, Destination, returnWrapper } 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 // Set timeline ready for processing events\n // Send existing events, which might be collected by track before init\n this.timeline.isReady = true;\n if (!this.config.optOut) {\n this.timeline.scheduleApply(0);\n }\n }\n}\n\nexport const createInstance = (): NodeClient => {\n const client = new AmplitudeNode();\n return {\n init: returnWrapper(client.init.bind(client)),\n add: returnWrapper(client.add.bind(client)),\n remove: returnWrapper(client.remove.bind(client)),\n track: returnWrapper(client.track.bind(client)),\n logEvent: returnWrapper(client.logEvent.bind(client)),\n identify: returnWrapper(client.identify.bind(client)),\n groupIdentify: returnWrapper(client.groupIdentify.bind(client)),\n setGroup: returnWrapper(client.setGroup.bind(client)),\n revenue: returnWrapper(client.revenue.bind(client)),\n flush: returnWrapper(client.flush.bind(client)),\n setOptOut: client.setOptOut.bind(client),\n };\n};\n\nexport default createInstance();\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.5.4";
1
+ export declare const VERSION = "0.5.6";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export var VERSION = '0.5.4';
1
+ export var VERSION = '0.5.6';
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 = '0.5.4';\n"]}
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 = '0.5.6';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-node",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
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.9.4",
40
- "@amplitude/analytics-types": "^0.10.3",
39
+ "@amplitude/analytics-core": "^0.9.5",
40
+ "@amplitude/analytics-types": "^0.11.0",
41
41
  "tslib": "^2.3.1"
42
42
  },
43
43
  "files": [
44
44
  "lib"
45
45
  ],
46
- "gitHead": "66ea9159b61cc2f234b2978116025e5b55af21d2"
46
+ "gitHead": "f556fd2194aebce71de5b2b53c12e611d8c9b5a7"
47
47
  }