@offnominal/ndb2-api-types 0.5.0 → 0.6.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,5 +1,5 @@
1
1
  import { Prediction } from "./entities/predictions";
2
- declare const WEBHOOK_EVENTS: readonly ["untriggered_prediction", "triggered_prediction", "retired_prediction"];
2
+ declare const WEBHOOK_EVENTS: readonly ["unjudged_prediction", "untriggered_prediction", "triggered_prediction", "retired_prediction"];
3
3
  export type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
4
4
  export type BasePayload<E extends WebhookEvent, D> = {
5
5
  event_name: E;
@@ -8,6 +8,9 @@ export type BasePayload<E extends WebhookEvent, D> = {
8
8
  data: D;
9
9
  };
10
10
  export declare namespace Events {
11
+ type UnjudgedPrediction = BasePayload<"unjudged_prediction", {
12
+ prediction: Prediction;
13
+ }>;
11
14
  type UntriggeredPrediction = BasePayload<"untriggered_prediction", {
12
15
  prediction: Prediction;
13
16
  }>;
@@ -18,6 +21,6 @@ export declare namespace Events {
18
21
  prediction: Prediction;
19
22
  }>;
20
23
  }
21
- export type Payload = Events.UntriggeredPrediction | Events.TriggeredPrediction | Events.RetiredPrediction;
24
+ export type Payload = Events.UnjudgedPrediction | Events.UntriggeredPrediction | Events.TriggeredPrediction | Events.RetiredPrediction;
22
25
  export declare const isWebhookPayloadV2: (payload: any) => payload is Payload;
23
26
  export {};
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isWebhookPayloadV2 = void 0;
4
4
  // Single source of truth for webhook events
5
5
  const WEBHOOK_EVENTS = [
6
+ "unjudged_prediction",
6
7
  "untriggered_prediction",
7
8
  "triggered_prediction",
8
9
  "retired_prediction",
@@ -1 +1 @@
1
- {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/v2/webhooks.ts"],"names":[],"mappings":";;;AAEA,4CAA4C;AAC5C,MAAM,cAAc,GAAG;IACrB,wBAAwB;IACxB,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,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gDAAgD;IAChD,IACE,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ;QACtC,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,UAA0B,CAAC,EAC5D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,mBAAmB;IACnB,IAAI,OAAO,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yEAAyE;IACzE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,GACR,OAAO,CAAC,IAAI,YAAY,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAjCW,QAAA,kBAAkB,sBAiC7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@offnominal/ndb2-api-types",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "author": "Jake Robins",
5
5
  "types": "./src/v2/index.ts",
6
6
  "main": "./dist/v2/index.js",
@@ -2,6 +2,7 @@ import { Prediction } from "./entities/predictions";
2
2
 
3
3
  // Single source of truth for webhook events
4
4
  const WEBHOOK_EVENTS = [
5
+ "unjudged_prediction",
5
6
  "untriggered_prediction",
6
7
  "triggered_prediction",
7
8
  "retired_prediction",
@@ -18,6 +19,12 @@ export type BasePayload<E extends WebhookEvent, D> = {
18
19
  };
19
20
 
20
21
  export namespace Events {
22
+ export type UnjudgedPrediction = BasePayload<
23
+ "unjudged_prediction",
24
+ {
25
+ prediction: Prediction;
26
+ }
27
+ >;
21
28
  export type UntriggeredPrediction = BasePayload<
22
29
  "untriggered_prediction",
23
30
  {
@@ -39,6 +46,7 @@ export namespace Events {
39
46
  }
40
47
 
41
48
  export type Payload =
49
+ | Events.UnjudgedPrediction
42
50
  | Events.UntriggeredPrediction
43
51
  | Events.TriggeredPrediction
44
52
  | Events.RetiredPrediction;