Skip to content

Commit f95db67

Browse files
authored
feat: accurate TS types for each App Event payload type (#761)
* feat: accurate TS types for each App Event payload type * chore: format command * refactor: add previous exports back in with new type scheme
1 parent 1aa192b commit f95db67

File tree

7 files changed

+465
-112
lines changed

7 files changed

+465
-112
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"build:docs": "typedoc --options .typedocrc.json src",
4747
"start:docs": "serve ./docs",
4848
"prepublishOnly": "npm run build && npm run build:docs",
49-
"semantic-release": "semantic-release"
49+
"semantic-release": "semantic-release",
50+
"format": "prettier --write ./{src,test}/**/*.ts"
5051
},
5152
"author": "Contentful GmbH",
5253
"license": "MIT",
@@ -87,7 +88,8 @@
8788
},
8889
"lint-staged": {
8990
"*.ts": [
90-
"npm run lint:fix"
91+
"npm run lint:fix",
92+
"npm run format"
9193
]
9294
},
9395
"repository": {

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ export { getManagementToken } from './keys'
22
export { signRequest, verifyRequest, ContentfulHeader, ExpiredRequestException } from './requests'
33

44
export type {
5+
AppEventRequest,
6+
AppEventPayloadMap,
57
AppActionCallContext,
68
CanonicalRequest,
79
SignedRequestHeaders,
810
FunctionEventContext,
911
FunctionEventHandler,
1012
FunctionEventType,
1113
FunctionEvent,
14+
FunctionTypeEnum,
1215
} from './requests'

src/requests/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ export { signRequest } from './sign-request'
33
export { verifyRequest } from './verify-request'
44
export { ContentfulHeader, ContentfulContextHeader } from './typings'
55
export type {
6+
AppEventRequest,
7+
AppEventPayloadMap,
68
AppActionCallContext,
79
CanonicalRequest,
810
FunctionEvent,
911
FunctionEventContext,
1012
FunctionEventHandler,
1113
FunctionEventType,
14+
FunctionTypeEnum,
1215
SignedRequestWithContextHeadersWithApp,
1316
SignedRequestWithContextHeadersWithUser,
1417
SignedRequestWithoutContextHeaders,

0 commit comments

Comments
 (0)