@offnominal/ndb2-api-types 0.2.3 → 0.3.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.
@@ -50,7 +50,7 @@ export type Prediction = {
50
50
  check_date: string;
51
51
  closed: boolean;
52
52
  closed_at: string | null;
53
- votes: {
53
+ values: {
54
54
  day: number;
55
55
  week: number;
56
56
  month: number;
@@ -2,4 +2,5 @@ import * as Entities from "./entities";
2
2
  import * as Endpoints from "./endpoints";
3
3
  import { Errors, NDB2APIError } from "./errors";
4
4
  import * as Utils from "./utils";
5
- export { Entities, Endpoints, Errors, NDB2APIError, Utils };
5
+ import * as Webhooks from "./webhooks";
6
+ export { Entities, Endpoints, Errors, NDB2APIError, Utils, Webhooks };
package/dist/v2/index.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Utils = exports.Errors = exports.Endpoints = exports.Entities = void 0;
36
+ exports.Webhooks = exports.Utils = exports.Errors = exports.Endpoints = exports.Entities = void 0;
37
37
  const Entities = __importStar(require("./entities"));
38
38
  exports.Entities = Entities;
39
39
  const Endpoints = __importStar(require("./endpoints"));
@@ -42,4 +42,6 @@ const errors_1 = require("./errors");
42
42
  Object.defineProperty(exports, "Errors", { enumerable: true, get: function () { return errors_1.Errors; } });
43
43
  const Utils = __importStar(require("./utils"));
44
44
  exports.Utils = Utils;
45
+ const Webhooks = __importStar(require("./webhooks"));
46
+ exports.Webhooks = Webhooks;
45
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAK9B,4BAAQ;AAJjB,uDAAyC;AAItB,8BAAS;AAH5B,qCAAgD;AAGlB,uFAHrB,eAAM,OAGqB;AAFpC,+CAAiC;AAEmB,sBAAK"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAM9B,4BAAQ;AALjB,uDAAyC;AAKtB,8BAAS;AAJ5B,qCAAgD;AAIlB,uFAJrB,eAAM,OAIqB;AAHpC,+CAAiC;AAGmB,sBAAK;AAFzD,qDAAuC;AAEoB,4BAAQ"}
@@ -0,0 +1,14 @@
1
+ import { Prediction } from "./entities/predictions";
2
+ export type WebhookEvent = "untriggered_prediction";
3
+ export type BasePayload<E extends WebhookEvent, D> = {
4
+ event_name: E;
5
+ version: 2;
6
+ date: Date;
7
+ data: D;
8
+ };
9
+ export declare namespace Events {
10
+ type UntriggeredPrediction = BasePayload<"untriggered_prediction", {
11
+ prediction: Prediction;
12
+ }>;
13
+ }
14
+ export type Payload = Events.UntriggeredPrediction;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/v2/webhooks.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@offnominal/ndb2-api-types",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "author": "Jake Robins",
5
5
  "types": "./src/v2/index.ts",
6
6
  "main": "./dist/v2/index.js",
@@ -58,7 +58,7 @@ export type Prediction = {
58
58
  check_date: string;
59
59
  closed: boolean;
60
60
  closed_at: string | null;
61
- votes: {
61
+ values: {
62
62
  day: number;
63
63
  week: number;
64
64
  month: number;
package/src/v2/index.ts CHANGED
@@ -2,5 +2,6 @@ import * as Entities from "./entities";
2
2
  import * as Endpoints from "./endpoints";
3
3
  import { Errors, NDB2APIError } from "./errors";
4
4
  import * as Utils from "./utils";
5
+ import * as Webhooks from "./webhooks";
5
6
 
6
- export { Entities, Endpoints, Errors, NDB2APIError, Utils };
7
+ export { Entities, Endpoints, Errors, NDB2APIError, Utils, Webhooks };
@@ -0,0 +1,21 @@
1
+ import { Prediction } from "./entities/predictions";
2
+
3
+ export type WebhookEvent = "untriggered_prediction";
4
+
5
+ export type BasePayload<E extends WebhookEvent, D> = {
6
+ event_name: E;
7
+ version: 2;
8
+ date: Date;
9
+ data: D;
10
+ };
11
+
12
+ export namespace Events {
13
+ export type UntriggeredPrediction = BasePayload<
14
+ "untriggered_prediction",
15
+ {
16
+ prediction: Prediction;
17
+ }
18
+ >;
19
+ }
20
+
21
+ export type Payload = Events.UntriggeredPrediction;