@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.
- package/dist/v2/entities/predictions.d.ts +1 -1
- package/dist/v2/index.d.ts +2 -1
- package/dist/v2/index.js +3 -1
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/webhooks.d.ts +14 -0
- package/dist/v2/webhooks.js +3 -0
- package/dist/v2/webhooks.js.map +1 -0
- package/package.json +1 -1
- package/src/v2/entities/predictions.ts +1 -1
- package/src/v2/index.ts +2 -1
- package/src/v2/webhooks.ts +21 -0
package/dist/v2/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
package/dist/v2/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/v2/webhooks.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
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;
|