@amplitude/analytics-types 0.8.0 → 0.8.1

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,5 +1,5 @@
1
1
  import { AmplitudeReturn } from '../amplitude-promise';
2
- import { BrowserOptions, ReactNativeOptions } from '../config';
2
+ import { AdditionalBrowserOptions, AdditionalReactNativeOptions, BrowserOptions, ReactNativeOptions } from '../config';
3
3
  import { TransportType } from '../transport';
4
4
  import { BaseClient } from './base-client';
5
5
  interface Client extends BaseClient {
@@ -79,7 +79,7 @@ export interface BrowserClient extends Client {
79
79
  * await init(API_KEY, options).promise;
80
80
  * ```
81
81
  */
82
- init(apiKey: string, userId?: string, options?: BrowserOptions): AmplitudeReturn<void>;
82
+ init(apiKey: string, userId?: string, options?: BrowserOptions & AdditionalBrowserOptions): AmplitudeReturn<void>;
83
83
  /**
84
84
  * Sets the network transport type for events.
85
85
  *
@@ -105,7 +105,7 @@ export interface ReactNativeClient extends Client {
105
105
  * await init(API_KEY, options).promise;
106
106
  * ```
107
107
  */
108
- init(apiKey: string, userId?: string, options?: ReactNativeOptions): AmplitudeReturn<void>;
108
+ init(apiKey: string, userId?: string, options?: ReactNativeOptions & AdditionalReactNativeOptions): AmplitudeReturn<void>;
109
109
  }
110
110
  export {};
111
111
  //# sourceMappingURL=web-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-client.d.ts","sourceRoot":"","sources":["../../src/client/web-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,UAAU,MAAO,SAAQ,UAAU;IACjC;;;;;;OAMG;IACH,SAAS,IAAI,MAAM,GAAG,SAAS,CAA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;;;;;;OAMG;IACH,SAAS,IAAI,MAAM,GAAG,SAAS,CAAC;IAEhC;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;;OAMG;IACH,WAAW,IAAI,MAAM,GAAG,SAAS,CAAC;IAElC;;;;;;;;OAQG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;;;;;OAMG;IACH,YAAY,IAAI,MAAM,GAAG,SAAS,CAAC;IAEnC;;;;;;;OAOG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C;;;;;;;OAOG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,wBAAwB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAElH;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,iBAAkB,SAAQ,MAAM;IAC/C;;;;;;;OAOG;IACH,IAAI,CACF,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,GAAG,4BAA4B,GAC1D,eAAe,CAAC,IAAI,CAAC,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"web-client.js","sourceRoot":"","sources":["../../src/client/web-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { BrowserOptions, ReactNativeOptions } from '../config';\nimport { TransportType } from '../transport';\nimport { BaseClient } from './base-client';\n\ninterface Client extends BaseClient {\n /**\n * Returns current user ID.\n *\n * ```typescript\n * const userId = getUserId();\n * ```\n */\n getUserId(): string | undefined;\n\n /**\n * Sets a new user ID.\n *\n * ```typescript\n * setUserId('userId');\n * ```\n */\n setUserId(userId: string): void;\n\n /**\n * Returns current device ID.\n *\n * ```typescript\n * const deviceId = getDeviceId();\n * ```\n */\n getDeviceId(): string | undefined;\n\n /**\n * Sets a new device ID.\n * When setting a custom device ID, make sure the value is sufficiently unique.\n * A uuid is recommended.\n *\n * ```typescript\n * setDeviceId('deviceId');\n * ```\n */\n setDeviceId(deviceId: string): void;\n\n /**\n * Returns current session ID.\n *\n * ```typescript\n * const sessionId = getSessionId();\n * ```\n */\n getSessionId(): number | undefined;\n\n /**\n * Sets a new session ID.\n * When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).\n *\n * ```typescript\n * setSessionId(Date.now());\n * ```\n */\n setSessionId(sessionId: number): void;\n\n /**\n * Anonymizes users after they log out, by:\n *\n * * setting userId to undefined\n * * setting deviceId to a new uuid value\n *\n * With an undefined userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.\n *\n * ```typescript\n * import { reset } from '@amplitude/analytics-browser';\n *\n * reset();\n * ```\n */\n reset(): void;\n}\n\nexport interface BrowserClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, userId?: string, options?: BrowserOptions): AmplitudeReturn<void>;\n\n /**\n * Sets the network transport type for events.\n *\n * ```typescript\n * // Use Fetch API\n * setTransport('fetch');\n *\n * // Use XMLHttpRequest API\n * setTransport('xhr');\n *\n * // Use navigator.sendBeacon API\n * setTransport('beacon');\n * ```\n */\n setTransport(transport: TransportType): void;\n}\n\nexport interface ReactNativeClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, userId?: string, options?: ReactNativeOptions): AmplitudeReturn<void>;\n}\n"]}
1
+ {"version":3,"file":"web-client.js","sourceRoot":"","sources":["../../src/client/web-client.ts"],"names":[],"mappings":"","sourcesContent":["import { AmplitudeReturn } from '../amplitude-promise';\nimport { AdditionalBrowserOptions, AdditionalReactNativeOptions, BrowserOptions, ReactNativeOptions } from '../config';\nimport { TransportType } from '../transport';\nimport { BaseClient } from './base-client';\n\ninterface Client extends BaseClient {\n /**\n * Returns current user ID.\n *\n * ```typescript\n * const userId = getUserId();\n * ```\n */\n getUserId(): string | undefined;\n\n /**\n * Sets a new user ID.\n *\n * ```typescript\n * setUserId('userId');\n * ```\n */\n setUserId(userId: string): void;\n\n /**\n * Returns current device ID.\n *\n * ```typescript\n * const deviceId = getDeviceId();\n * ```\n */\n getDeviceId(): string | undefined;\n\n /**\n * Sets a new device ID.\n * When setting a custom device ID, make sure the value is sufficiently unique.\n * A uuid is recommended.\n *\n * ```typescript\n * setDeviceId('deviceId');\n * ```\n */\n setDeviceId(deviceId: string): void;\n\n /**\n * Returns current session ID.\n *\n * ```typescript\n * const sessionId = getSessionId();\n * ```\n */\n getSessionId(): number | undefined;\n\n /**\n * Sets a new session ID.\n * When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).\n *\n * ```typescript\n * setSessionId(Date.now());\n * ```\n */\n setSessionId(sessionId: number): void;\n\n /**\n * Anonymizes users after they log out, by:\n *\n * * setting userId to undefined\n * * setting deviceId to a new uuid value\n *\n * With an undefined userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.\n *\n * ```typescript\n * import { reset } from '@amplitude/analytics-browser';\n *\n * reset();\n * ```\n */\n reset(): void;\n}\n\nexport interface BrowserClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(apiKey: string, userId?: string, options?: BrowserOptions & AdditionalBrowserOptions): AmplitudeReturn<void>;\n\n /**\n * Sets the network transport type for events.\n *\n * ```typescript\n * // Use Fetch API\n * setTransport('fetch');\n *\n * // Use XMLHttpRequest API\n * setTransport('xhr');\n *\n * // Use navigator.sendBeacon API\n * setTransport('beacon');\n * ```\n */\n setTransport(transport: TransportType): void;\n}\n\nexport interface ReactNativeClient extends Client {\n /**\n * Initializes the Amplitude SDK with your apiKey, optional configurations.\n * This method must be called before any other operations.\n *\n * ```typescript\n * await init(API_KEY, options).promise;\n * ```\n */\n init(\n apiKey: string,\n userId?: string,\n options?: ReactNativeOptions & AdditionalReactNativeOptions,\n ): AmplitudeReturn<void>;\n}\n"]}
package/lib/response.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Status } from './status';
3
2
  export interface SuccessBody {
4
3
  eventsIngested: number;
@@ -74,14 +73,9 @@ export interface TimeoutResponse {
74
73
  status: Status.Timeout;
75
74
  statusCode: number;
76
75
  }
77
- export interface SystemErrorResponse {
78
- status: Status.SystemError;
79
- statusCode: 0;
80
- error: NodeJS.ErrnoException;
81
- }
82
76
  export interface OtherReponse {
83
77
  status: Exclude<Status, StatusWithResponseBody>;
84
78
  statusCode: number;
85
79
  }
86
- export declare type Response = SuccessResponse | InvalidResponse | PayloadTooLargeResponse | RateLimitResponse | TimeoutResponse | SystemErrorResponse | OtherReponse;
80
+ export declare type Response = SuccessResponse | InvalidResponse | PayloadTooLargeResponse | RateLimitResponse | TimeoutResponse | OtherReponse;
87
81
  //# sourceMappingURL=response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB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E,MAAM,EAAE,CAAC;CAC3B;AAED,oBAAY,sBAAsB,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;AAEjH,oBAAY,YAAY,GAAG,WAAW,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAElG,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAChD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oBAAY,QAAQ,GAChB,eAAe,GACf,eAAe,GACf,uBAAuB,GACvB,iBAAiB,GACjB,eAAe,GACf,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"response.js","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"","sourcesContent":["import { Status } from './status';\n\nexport interface SuccessBody {\n eventsIngested: number;\n payloadSizeBytes: number;\n serverUploadTime: number;\n}\n\nexport interface InvalidRequestBody {\n error: string;\n missingField: string;\n eventsWithInvalidFields: { [eventField: string]: number[] };\n eventsWithMissingFields: { [eventField: string]: number[] };\n eventsWithInvalidIdLengths: { [eventField: string]: number[] };\n epsThreshold: 0;\n exceededDailyQuotaDevices: { [deviceId: string]: number };\n silencedDevices: string[];\n silencedEvents: number[];\n throttledDevices: { [deviceId: string]: number };\n throttledEvents: number[];\n}\nexport interface PayloadTooLargeBody {\n error: string;\n}\nexport interface RateLimitBody {\n error: string;\n epsThreshold: number;\n throttledDevices: { [deviceId: string]: number };\n throttledUsers: { [userId: string]: number };\n exceededDailyQuotaDevices: { [deviceId: string]: number };\n exceededDailyQuotaUsers: { [userId: string]: number };\n throttledEvents: number[];\n}\n\nexport type StatusWithResponseBody = Status.Invalid | Status.PayloadTooLarge | Status.RateLimit | Status.Success;\n\nexport type ResponseBody = SuccessBody | InvalidRequestBody | PayloadTooLargeBody | RateLimitBody;\n\nexport interface SuccessResponse {\n status: Status.Success;\n statusCode: number;\n body: SuccessBody;\n}\n\nexport interface InvalidResponse {\n status: Status.Invalid;\n statusCode: number;\n body: InvalidRequestBody;\n}\n\nexport interface PayloadTooLargeResponse {\n status: Status.PayloadTooLarge;\n statusCode: number;\n body: PayloadTooLargeBody;\n}\n\nexport interface RateLimitResponse {\n status: Status.RateLimit;\n statusCode: number;\n body: RateLimitBody;\n}\n\nexport interface TimeoutResponse {\n status: Status.Timeout;\n statusCode: number;\n}\n\nexport interface SystemErrorResponse {\n status: Status.SystemError;\n statusCode: 0;\n error: NodeJS.ErrnoException;\n}\n\nexport interface OtherReponse {\n status: Exclude<Status, StatusWithResponseBody>;\n statusCode: number;\n}\n\nexport type Response =\n | SuccessResponse\n | InvalidResponse\n | PayloadTooLargeResponse\n | RateLimitResponse\n | TimeoutResponse\n | SystemErrorResponse\n | OtherReponse;\n"]}
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"","sourcesContent":["import { Status } from './status';\n\nexport interface SuccessBody {\n eventsIngested: number;\n payloadSizeBytes: number;\n serverUploadTime: number;\n}\n\nexport interface InvalidRequestBody {\n error: string;\n missingField: string;\n eventsWithInvalidFields: { [eventField: string]: number[] };\n eventsWithMissingFields: { [eventField: string]: number[] };\n eventsWithInvalidIdLengths: { [eventField: string]: number[] };\n epsThreshold: 0;\n exceededDailyQuotaDevices: { [deviceId: string]: number };\n silencedDevices: string[];\n silencedEvents: number[];\n throttledDevices: { [deviceId: string]: number };\n throttledEvents: number[];\n}\nexport interface PayloadTooLargeBody {\n error: string;\n}\nexport interface RateLimitBody {\n error: string;\n epsThreshold: number;\n throttledDevices: { [deviceId: string]: number };\n throttledUsers: { [userId: string]: number };\n exceededDailyQuotaDevices: { [deviceId: string]: number };\n exceededDailyQuotaUsers: { [userId: string]: number };\n throttledEvents: number[];\n}\n\nexport type StatusWithResponseBody = Status.Invalid | Status.PayloadTooLarge | Status.RateLimit | Status.Success;\n\nexport type ResponseBody = SuccessBody | InvalidRequestBody | PayloadTooLargeBody | RateLimitBody;\n\nexport interface SuccessResponse {\n status: Status.Success;\n statusCode: number;\n body: SuccessBody;\n}\n\nexport interface InvalidResponse {\n status: Status.Invalid;\n statusCode: number;\n body: InvalidRequestBody;\n}\n\nexport interface PayloadTooLargeResponse {\n status: Status.PayloadTooLarge;\n statusCode: number;\n body: PayloadTooLargeBody;\n}\n\nexport interface RateLimitResponse {\n status: Status.RateLimit;\n statusCode: number;\n body: RateLimitBody;\n}\n\nexport interface TimeoutResponse {\n status: Status.Timeout;\n statusCode: number;\n}\n\nexport interface OtherReponse {\n status: Exclude<Status, StatusWithResponseBody>;\n statusCode: number;\n}\n\nexport type Response =\n | SuccessResponse\n | InvalidResponse\n | PayloadTooLargeResponse\n | RateLimitResponse\n | TimeoutResponse\n | OtherReponse;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-types",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "",
5
5
  "author": "Amplitude Inc",
6
6
  "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
@@ -31,5 +31,5 @@
31
31
  "files": [
32
32
  "lib"
33
33
  ],
34
- "gitHead": "c701a2b7ada6c8817bf28894f4d68cfa5dd0c403"
34
+ "gitHead": "404f81a1cdcf1cce9bd35d04561016a65dab635a"
35
35
  }