@aptly-as/types 1.12.1 → 1.12.2
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,10 +1,16 @@
|
|
|
1
1
|
import { AptlyDocumentSchema, AptlyOrderSchema, AptlyUnitSchema } from '../models/index.js';
|
|
2
2
|
export declare namespace AptlyWebhookEventData {
|
|
3
|
-
|
|
4
|
-
interface NewUnitOrderSignedSchema<ID, DATE> {
|
|
5
|
-
order: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'orderNumber' | 'receipt' | 'period'>;
|
|
3
|
+
interface UnitWebhookSchema<ID, DATE> {
|
|
6
4
|
unit: Pick<AptlyUnitSchema<ID, DATE>, '_id' | 'name'>;
|
|
5
|
+
}
|
|
6
|
+
interface UnitDocumentWebhookSchema<ID, DATE> {
|
|
7
7
|
document: AptlyDocumentSchema<ID, DATE>;
|
|
8
8
|
documentUrl: string;
|
|
9
9
|
}
|
|
10
|
+
type NewUnitDocument = NewUnitDocumentSchema<string, string>;
|
|
11
|
+
type NewUnitDocumentSchema<ID, DATE> = UnitWebhookSchema<ID, DATE> & UnitDocumentWebhookSchema<ID, DATE>;
|
|
12
|
+
type NewUnitOrder = NewUnitOrderSchema<string, string>;
|
|
13
|
+
interface NewUnitOrderSchema<ID, DATE> extends NewUnitDocumentSchema<ID, DATE> {
|
|
14
|
+
order: Pick<AptlyOrderSchema<ID, DATE>, '_id' | 'orderNumber' | 'receipt' | 'period'>;
|
|
15
|
+
}
|
|
10
16
|
}
|
package/enums/webhook.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ export declare enum AptlyWebhookType {
|
|
|
5
5
|
UnitUpdated = "aptly.unit.updated",
|
|
6
6
|
UnitMessageNew = "aptly.unit.message.new",
|
|
7
7
|
UnitMessageReply = "aptly.unit.message.reply",
|
|
8
|
+
UnitOrderCreated = "aptly.unit.order.created",
|
|
8
9
|
UnitOrderSigned = "aptly.unit.order.signed",
|
|
10
|
+
UnitReportFinal = "aptly.unit.report.final",
|
|
9
11
|
OrganizationAppUpdated = "aptly.organization.app.updated",
|
|
10
12
|
OrganizationAppDeleted = "aptly.organization.app.deleted"
|
|
11
13
|
}
|
package/enums/webhook.js
CHANGED
|
@@ -6,7 +6,9 @@ export var AptlyWebhookType;
|
|
|
6
6
|
AptlyWebhookType["UnitUpdated"] = "aptly.unit.updated";
|
|
7
7
|
AptlyWebhookType["UnitMessageNew"] = "aptly.unit.message.new";
|
|
8
8
|
AptlyWebhookType["UnitMessageReply"] = "aptly.unit.message.reply";
|
|
9
|
+
AptlyWebhookType["UnitOrderCreated"] = "aptly.unit.order.created";
|
|
9
10
|
AptlyWebhookType["UnitOrderSigned"] = "aptly.unit.order.signed";
|
|
11
|
+
AptlyWebhookType["UnitReportFinal"] = "aptly.unit.report.final";
|
|
10
12
|
AptlyWebhookType["OrganizationAppUpdated"] = "aptly.organization.app.updated";
|
|
11
13
|
AptlyWebhookType["OrganizationAppDeleted"] = "aptly.organization.app.deleted";
|
|
12
14
|
})(AptlyWebhookType || (AptlyWebhookType = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AptlyWebhookEventStatus, AptlyWebhookType } from '../enums/index.js';
|
|
2
2
|
import { AptlyBaseSchema } from './extends.js';
|
|
3
|
-
type ServerKeys = 'run' | '
|
|
3
|
+
type ServerKeys = 'run' | 'status' | 'url' | 'headers' | 'responses';
|
|
4
4
|
export type AptlyWebhookEvent<T = unknown> = Omit<AptlyWebhookEventSchema<string, string, T>, ServerKeys>;
|
|
5
5
|
export interface AptlyWebhookEventSchema<ID, DATE, DATA = unknown> extends Omit<AptlyBaseSchema<ID, DATE>, 'name' | 'archived'> {
|
|
6
6
|
specversion: string;
|