@segment/analytics-core
Advanced tools
Comparing version 1.1.3 to 1.1.4
# @segment/analytics-core | ||
## 1.1.4 | ||
### Patch Changes | ||
- [#692](https://github.com/segmentio/analytics-next/pull/692) [`ecb4b8d`](https://github.com/segmentio/analytics-next/commit/ecb4b8db0194e06a3ee3c8cae57d4f327d15dc02) Thanks [@silesky](https://github.com/silesky)! - Move code out of core and into analytics-node. Tweak emitter error contract. | ||
## 1.1.3 | ||
@@ -4,0 +10,0 @@ |
@@ -18,3 +18,2 @@ "use strict"; | ||
tslib_1.__exportStar(require("./analytics/dispatch"), exports); | ||
tslib_1.__exportStar(require("./analytics/dispatch-emit"), exports); | ||
tslib_1.__exportStar(require("./validation/helpers"), exports); | ||
@@ -21,0 +20,0 @@ tslib_1.__exportStar(require("./validation/assertions"), exports); |
@@ -13,3 +13,2 @@ export * from './emitter'; | ||
export * from './analytics/dispatch'; | ||
export * from './analytics/dispatch-emit'; | ||
export * from './validation/helpers'; | ||
@@ -16,0 +15,0 @@ export * from './validation/assertions'; |
import { CoreContext } from '../context'; | ||
export declare type EmittedUnknownError<Ctx extends CoreContext> = { | ||
code: 'unknown'; | ||
message: string; | ||
ctx?: Ctx; | ||
err?: any; | ||
}; | ||
export declare type EmittedDeliveryFailureError<Ctx extends CoreContext> = { | ||
code: 'delivery_failure'; | ||
message: string; | ||
ctx: Ctx; | ||
data?: any; | ||
}; | ||
/** | ||
* Discriminated of all errors with a discriminant key of "code" | ||
* This is the base contract for all emitted errors. This interface may be extended. | ||
*/ | ||
export declare type CoreEmittedError<Ctx extends CoreContext> = EmittedUnknownError<Ctx> | EmittedDeliveryFailureError<Ctx>; | ||
export declare type CoreEmitterContract<Ctx extends CoreContext, AdditionalErrors = CoreEmittedError<Ctx>> = { | ||
export interface CoreEmittedError<Ctx extends CoreContext> { | ||
/** | ||
* e.g. 'delivery_failure' | ||
*/ | ||
code: string; | ||
/** | ||
* Why the error occurred. This can be an actual error object or a just a message. | ||
*/ | ||
reason?: unknown; | ||
ctx?: Ctx; | ||
} | ||
export declare type CoreEmitterContract<Ctx extends CoreContext, Err extends CoreEmittedError<Ctx> = CoreEmittedError<Ctx>> = { | ||
alias: [ctx: Ctx]; | ||
@@ -27,4 +25,4 @@ track: [ctx: Ctx]; | ||
deregister: [pluginNames: string[]]; | ||
error: [CoreEmittedError<Ctx> | AdditionalErrors]; | ||
error: [error: Err]; | ||
}; | ||
//# sourceMappingURL=interface.d.ts.map |
@@ -13,3 +13,2 @@ export * from './emitter'; | ||
export * from './analytics/dispatch'; | ||
export * from './analytics/dispatch-emit'; | ||
export * from './validation/helpers'; | ||
@@ -16,0 +15,0 @@ export * from './validation/assertions'; |
{ | ||
"name": "@segment/analytics-core", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
import { CoreContext } from '../context' | ||
export type EmittedUnknownError<Ctx extends CoreContext> = { | ||
code: 'unknown' | ||
message: string | ||
/** | ||
* This is the base contract for all emitted errors. This interface may be extended. | ||
*/ | ||
export interface CoreEmittedError<Ctx extends CoreContext> { | ||
/** | ||
* e.g. 'delivery_failure' | ||
*/ | ||
code: string | ||
/** | ||
* Why the error occurred. This can be an actual error object or a just a message. | ||
*/ | ||
reason?: unknown | ||
ctx?: Ctx | ||
err?: any | ||
} | ||
export type EmittedDeliveryFailureError<Ctx extends CoreContext> = { | ||
code: 'delivery_failure' | ||
message: string | ||
ctx: Ctx | ||
data?: any | ||
} | ||
/** | ||
* Discriminated of all errors with a discriminant key of "code" | ||
*/ | ||
export type CoreEmittedError<Ctx extends CoreContext> = | ||
| EmittedUnknownError<Ctx> | ||
| EmittedDeliveryFailureError<Ctx> | ||
export type CoreEmitterContract< | ||
Ctx extends CoreContext, | ||
AdditionalErrors = CoreEmittedError<Ctx> | ||
Err extends CoreEmittedError<Ctx> = CoreEmittedError<Ctx> | ||
> = { | ||
@@ -36,3 +30,3 @@ alias: [ctx: Ctx] | ||
deregister: [pluginNames: string[]] | ||
error: [CoreEmittedError<Ctx> | AdditionalErrors] | ||
error: [error: Err] | ||
} |
@@ -13,3 +13,2 @@ export * from './emitter' | ||
export * from './analytics/dispatch' | ||
export * from './analytics/dispatch-emit' | ||
export * from './validation/helpers' | ||
@@ -16,0 +15,0 @@ export * from './validation/assertions' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
261565
207
4545