@laioutr/webhook-types 0.1.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/byos/events.d.ts +2 -0
- package/dist/byos/events.js +0 -0
- package/dist/byos/index.d.ts +3 -0
- package/dist/byos/index.js +0 -0
- package/dist/byos/responses.d.ts +2 -0
- package/dist/byos/responses.js +0 -0
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.js +0 -0
- package/dist/common/types.d.ts +2 -0
- package/dist/common/types.js +0 -0
- package/dist/events-BTJDYtyR.d.ts +94 -0
- package/dist/index-Cf8zm5QQ.d.ts +1 -0
- package/dist/responses-DOwOY64C.d.ts +54 -0
- package/dist/types-CCIq_Zlj.d.ts +42 -0
- package/package.json +45 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ByosDeploymentPromoteEvent, c as ByosDisconnectedEvent, i as ByosDeploymentDeleteEvent, l as ByosEvent, n as ByosDeploymentCancelEvent, o as ByosDeploymentRollbackEvent, r as ByosDeploymentCreatedEvent, s as ByosDescribeEvent, t as ByosConnectedEvent, u as ByosEventBase } from "../events-BTJDYtyR.js";
|
|
2
|
+
export { ByosConnectedEvent, ByosDeploymentCancelEvent, ByosDeploymentCreatedEvent, ByosDeploymentDeleteEvent, ByosDeploymentPromoteEvent, ByosDeploymentRollbackEvent, ByosDescribeEvent, ByosDisconnectedEvent, ByosEvent, ByosEventBase };
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as ByosDeploymentPromoteEvent, c as ByosDisconnectedEvent, i as ByosDeploymentDeleteEvent, l as ByosEvent, n as ByosDeploymentCancelEvent, o as ByosDeploymentRollbackEvent, r as ByosDeploymentCreatedEvent, s as ByosDescribeEvent, t as ByosConnectedEvent, u as ByosEventBase } from "../events-BTJDYtyR.js";
|
|
2
|
+
import { i as ByosDescribeResponseData, n as ByosDeploymentStatusEvent, r as ByosDeploymentStatusValue, t as ByosCapabilities } from "../responses-DOwOY64C.js";
|
|
3
|
+
export { type ByosCapabilities, type ByosConnectedEvent, type ByosDeploymentCancelEvent, type ByosDeploymentCreatedEvent, type ByosDeploymentDeleteEvent, type ByosDeploymentPromoteEvent, type ByosDeploymentRollbackEvent, type ByosDeploymentStatusEvent, type ByosDeploymentStatusValue, type ByosDescribeEvent, type ByosDescribeResponseData, type ByosDisconnectedEvent, type ByosEvent, type ByosEventBase };
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as WebhookSuccessResponse, i as WebhookResponse, n as WebhookErrorResponse, r as WebhookEventBase, t as StandardWebhookHeaders } from "../types-CCIq_Zlj.js";
|
|
2
|
+
export { StandardWebhookHeaders, WebhookErrorResponse, WebhookEventBase, WebhookResponse, WebhookSuccessResponse };
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as WebhookSuccessResponse, i as WebhookResponse, n as WebhookErrorResponse, r as WebhookEventBase, t as StandardWebhookHeaders } from "../types-CCIq_Zlj.js";
|
|
2
|
+
export { StandardWebhookHeaders, WebhookErrorResponse, WebhookEventBase, WebhookResponse, WebhookSuccessResponse };
|
|
File without changes
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { r as WebhookEventBase } from "./types-CCIq_Zlj.js";
|
|
2
|
+
|
|
3
|
+
//#region src/byos/events.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Base for all BYOS events - includes project identifier.
|
|
7
|
+
*/
|
|
8
|
+
interface ByosEventBase extends WebhookEventBase {
|
|
9
|
+
/** Project identifier in format "org-slug/project-slug" */
|
|
10
|
+
project: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Capability discovery event.
|
|
14
|
+
* Sent to fetch hosting capabilities and validate endpoint.
|
|
15
|
+
*/
|
|
16
|
+
interface ByosDescribeEvent extends ByosEventBase {
|
|
17
|
+
event: 'hosting.describe';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Connection established notification.
|
|
21
|
+
* Sent after successful setup.
|
|
22
|
+
*/
|
|
23
|
+
interface ByosConnectedEvent extends ByosEventBase {
|
|
24
|
+
event: 'hosting.connected';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Disconnection notification.
|
|
28
|
+
* Sent when hosting is disconnected.
|
|
29
|
+
*/
|
|
30
|
+
interface ByosDisconnectedEvent extends ByosEventBase {
|
|
31
|
+
event: 'hosting.disconnected';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Deployment created event.
|
|
35
|
+
* Contains files and callback URL for status updates.
|
|
36
|
+
*/
|
|
37
|
+
interface ByosDeploymentCreatedEvent extends ByosEventBase {
|
|
38
|
+
event: 'hosting.deployment.created';
|
|
39
|
+
data: {
|
|
40
|
+
/** Internal deployment ID */
|
|
41
|
+
deploymentId: string;
|
|
42
|
+
/** Target environment */
|
|
43
|
+
environment: 'production' | 'staging';
|
|
44
|
+
/** URL to POST status updates to */
|
|
45
|
+
callbackUrl: string;
|
|
46
|
+
/** Map of filename to file content */
|
|
47
|
+
files: Record<string, string>;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Deployment cancel request.
|
|
52
|
+
*/
|
|
53
|
+
interface ByosDeploymentCancelEvent extends ByosEventBase {
|
|
54
|
+
event: 'hosting.deployment.cancel';
|
|
55
|
+
data: {
|
|
56
|
+
deploymentId: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Deployment promote request.
|
|
61
|
+
*/
|
|
62
|
+
interface ByosDeploymentPromoteEvent extends ByosEventBase {
|
|
63
|
+
event: 'hosting.deployment.promote';
|
|
64
|
+
data: {
|
|
65
|
+
deploymentId: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Deployment rollback request.
|
|
70
|
+
*/
|
|
71
|
+
interface ByosDeploymentRollbackEvent extends ByosEventBase {
|
|
72
|
+
event: 'hosting.deployment.rollback';
|
|
73
|
+
data: {
|
|
74
|
+
/** Deployment to roll back TO */
|
|
75
|
+
deploymentId: string;
|
|
76
|
+
/** Currently active deployment being replaced (optional) */
|
|
77
|
+
fromDeploymentId?: string;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Deployment delete request.
|
|
82
|
+
*/
|
|
83
|
+
interface ByosDeploymentDeleteEvent extends ByosEventBase {
|
|
84
|
+
event: 'hosting.deployment.delete';
|
|
85
|
+
data: {
|
|
86
|
+
deploymentId: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Union of all BYOS outbound events.
|
|
91
|
+
*/
|
|
92
|
+
type ByosEvent = ByosDescribeEvent | ByosConnectedEvent | ByosDisconnectedEvent | ByosDeploymentCreatedEvent | ByosDeploymentCancelEvent | ByosDeploymentPromoteEvent | ByosDeploymentRollbackEvent | ByosDeploymentDeleteEvent;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { ByosDeploymentPromoteEvent as a, ByosDisconnectedEvent as c, ByosDeploymentDeleteEvent as i, ByosEvent as l, ByosDeploymentCancelEvent as n, ByosDeploymentRollbackEvent as o, ByosDeploymentCreatedEvent as r, ByosDescribeEvent as s, ByosConnectedEvent as t, ByosEventBase as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { r as WebhookEventBase } from "./types-CCIq_Zlj.js";
|
|
2
|
+
|
|
3
|
+
//#region src/byos/responses.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hosting adapter capabilities.
|
|
7
|
+
*/
|
|
8
|
+
interface ByosCapabilities {
|
|
9
|
+
/** Can call back with deployment status updates */
|
|
10
|
+
statusUpdates: boolean;
|
|
11
|
+
/** Can cancel a running deployment */
|
|
12
|
+
cancelDeployment: boolean;
|
|
13
|
+
/** Can promote a deployment to live */
|
|
14
|
+
promoteDeployment: boolean;
|
|
15
|
+
/** Can rollback to a previous deployment */
|
|
16
|
+
rollbackDeployment: boolean;
|
|
17
|
+
/** Can delete a deployment */
|
|
18
|
+
deleteDeployment: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Response data for hosting.describe event.
|
|
22
|
+
*/
|
|
23
|
+
interface ByosDescribeResponseData {
|
|
24
|
+
/** Display name for the hosting provider */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Supported capabilities */
|
|
27
|
+
capabilities: ByosCapabilities;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Deployment status values.
|
|
31
|
+
*/
|
|
32
|
+
type ByosDeploymentStatusValue = 'running' | 'success' | 'error' | 'canceled' | 'promoted';
|
|
33
|
+
/**
|
|
34
|
+
* Status update callback event (inbound from customer).
|
|
35
|
+
*/
|
|
36
|
+
interface ByosDeploymentStatusEvent extends WebhookEventBase {
|
|
37
|
+
event: 'hosting.deployment.status';
|
|
38
|
+
data: {
|
|
39
|
+
status: 'running';
|
|
40
|
+
} | {
|
|
41
|
+
status: 'success';
|
|
42
|
+
url: string;
|
|
43
|
+
} | {
|
|
44
|
+
status: 'error';
|
|
45
|
+
error: string;
|
|
46
|
+
} | {
|
|
47
|
+
status: 'canceled';
|
|
48
|
+
} | {
|
|
49
|
+
status: 'promoted';
|
|
50
|
+
url?: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { ByosDescribeResponseData as i, ByosDeploymentStatusEvent as n, ByosDeploymentStatusValue as r, ByosCapabilities as t };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region src/common/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Base structure for all webhook events.
|
|
4
|
+
*/
|
|
5
|
+
interface WebhookEventBase {
|
|
6
|
+
/** Event type identifier */
|
|
7
|
+
event: string;
|
|
8
|
+
/** ISO 8601 timestamp */
|
|
9
|
+
timestamp: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Successful webhook response.
|
|
13
|
+
*/
|
|
14
|
+
interface WebhookSuccessResponse<T = Record<string, unknown>> {
|
|
15
|
+
ok: true;
|
|
16
|
+
data: T;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Error webhook response.
|
|
20
|
+
*/
|
|
21
|
+
interface WebhookErrorResponse {
|
|
22
|
+
ok: false;
|
|
23
|
+
error: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Union of success and error responses.
|
|
27
|
+
*/
|
|
28
|
+
type WebhookResponse<T = Record<string, unknown>> = WebhookSuccessResponse<T> | WebhookErrorResponse;
|
|
29
|
+
/**
|
|
30
|
+
* Standard Webhooks headers for signature verification.
|
|
31
|
+
* @see https://www.standardwebhooks.com/
|
|
32
|
+
*/
|
|
33
|
+
interface StandardWebhookHeaders {
|
|
34
|
+
/** Unique event ID (same across retries for idempotency) */
|
|
35
|
+
'webhook-id': string;
|
|
36
|
+
/** Unix timestamp of when the event was sent */
|
|
37
|
+
'webhook-timestamp': string;
|
|
38
|
+
/** HMAC-SHA256 signature for verification */
|
|
39
|
+
'webhook-signature': string;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { WebhookSuccessResponse as a, WebhookResponse as i, WebhookErrorResponse as n, WebhookEventBase as r, StandardWebhookHeaders as t };
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@laioutr/webhook-types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Webhook type definitions for Laioutr integrations",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/common/index.d.ts",
|
|
10
|
+
"import": "./dist/common/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./byos": {
|
|
13
|
+
"types": "./dist/byos/index.d.ts",
|
|
14
|
+
"import": "./dist/byos/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"lint-staged": {
|
|
21
|
+
"*.{js,mjs,jsx,ts,tsx,vue}": [
|
|
22
|
+
"pnpm lint --fix",
|
|
23
|
+
"prettier --cache --write"
|
|
24
|
+
],
|
|
25
|
+
"*.{css,scss,md,html,json}": "prettier --cache --write"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@laioutr/eslint-config": "^1.8.8",
|
|
29
|
+
"@tsconfig/recommended": "^1.0.8",
|
|
30
|
+
"@types/node": "latest",
|
|
31
|
+
"tsdown": "^0.17.0",
|
|
32
|
+
"typescript": "^5.7.2"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsdown",
|
|
39
|
+
"dev": "tsdown --watch src",
|
|
40
|
+
"lint": "eslint --cache --cache-location ../../.eslintcache",
|
|
41
|
+
"release": "pnpm build && pnpm publish",
|
|
42
|
+
"stub": "tsdown",
|
|
43
|
+
"typecheck": "tsc --pretty --noEmit"
|
|
44
|
+
}
|
|
45
|
+
}
|