@webiny/webhooks 0.0.0-unstable.7be00a75a9 → 0.0.0-unstable.9609e4e0c9
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/admin/WebhookRoutes.js +27 -17
- package/admin/WebhookRoutes.js.map +1 -1
- package/admin/Webhooks.js +0 -3
- package/admin/Webhooks.js.map +1 -1
- package/admin/features/ListWebhooks/ListWebhooksGateway.js +8 -2
- package/admin/features/ListWebhooks/ListWebhooksGateway.js.map +1 -1
- package/admin/features/ListWebhooks/abstractions.d.ts +1 -0
- package/admin/features/ListWebhooks/abstractions.js.map +1 -1
- package/admin/features/permissions/feature.d.ts +1 -1
- package/admin/presentation/{WebhookDeliveries → WebhookDeliveriesPage}/WebhookDeliveriesDataSource.d.ts +2 -3
- package/admin/presentation/{WebhookDeliveries → WebhookDeliveriesPage}/WebhookDeliveriesDataSource.js +5 -7
- package/admin/presentation/WebhookDeliveriesPage/WebhookDeliveriesDataSource.js.map +1 -0
- package/admin/presentation/WebhookDeliveriesPage/WebhookDeliveriesPagePresenter.d.ts +9 -5
- package/admin/presentation/WebhookDeliveriesPage/WebhookDeliveriesPagePresenter.js +67 -40
- package/admin/presentation/WebhookDeliveriesPage/WebhookDeliveriesPagePresenter.js.map +1 -1
- package/admin/presentation/WebhookDeliveriesPage/abstractions.d.ts +6 -3
- package/admin/presentation/WebhookDeliveriesPage/abstractions.js.map +1 -1
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryAccordionRow.js.map +1 -0
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryBottomInfoBar.d.ts +2 -2
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryDetailContent.js.map +1 -0
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.d.ts +2 -2
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.js +50 -18
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.js.map +1 -1
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryList.d.ts +2 -2
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryList.js +24 -8
- package/admin/presentation/WebhookDeliveriesPage/components/DeliveryList.js.map +1 -1
- package/admin/presentation/WebhookDeliveriesPage/components/WebhookDefinitionsButton.d.ts +2 -0
- package/admin/presentation/WebhookDeliveriesPage/components/WebhookDefinitionsButton.js +16 -0
- package/admin/presentation/WebhookDeliveriesPage/components/WebhookDefinitionsButton.js.map +1 -0
- package/admin/presentation/WebhookDeliveriesPage/components/WebhookDeliveriesPage.js +26 -17
- package/admin/presentation/WebhookDeliveriesPage/components/WebhookDeliveriesPage.js.map +1 -1
- package/admin/presentation/WebhookDeliveriesPage/components/statusVariant.d.ts +1 -0
- package/admin/presentation/WebhookDeliveriesPage/components/statusVariant.js.map +1 -0
- package/admin/presentation/WebhookForm/WebhookFormPresenter.d.ts +1 -4
- package/admin/presentation/WebhookForm/WebhookFormPresenter.js +8 -12
- package/admin/presentation/WebhookForm/WebhookFormPresenter.js.map +1 -1
- package/admin/presentation/WebhookForm/abstractions.d.ts +1 -4
- package/admin/presentation/WebhookForm/abstractions.js.map +1 -1
- package/admin/presentation/WebhookForm/components/SigningSecret.d.ts +2 -2
- package/admin/presentation/WebhookForm/components/WebhookFormView.js +34 -36
- package/admin/presentation/WebhookForm/components/WebhookFormView.js.map +1 -1
- package/admin/presentation/WebhookList/WebhookListDataSource.d.ts +7 -8
- package/admin/presentation/WebhookList/WebhookListDataSource.js +23 -50
- package/admin/presentation/WebhookList/WebhookListDataSource.js.map +1 -1
- package/admin/presentation/WebhookList/components/WebhookDeliveriesButton.d.ts +2 -0
- package/admin/presentation/WebhookList/components/WebhookDeliveriesButton.js +16 -0
- package/admin/presentation/WebhookList/components/WebhookDeliveriesButton.js.map +1 -0
- package/admin/presentation/WebhookList/components/WebhookListContent.d.ts +2 -2
- package/admin/presentation/WebhookList/components/WebhookListContent.js +20 -8
- package/admin/presentation/WebhookList/components/WebhookListContent.js.map +1 -1
- package/admin/presentation/WebhookList/components/WebhookListView.js +4 -1
- package/admin/presentation/WebhookList/components/WebhookListView.js.map +1 -1
- package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.js +3 -1
- package/admin/presentation/WebhookSettings/WebhookSettingsPresenter.js.map +1 -1
- package/admin/routes.d.ts +3 -1
- package/admin/routes.js +4 -1
- package/admin/routes.js.map +1 -1
- package/api/features/DeleteWebhook/DeleteWebhookRepository.js +2 -1
- package/api/features/DeleteWebhook/DeleteWebhookRepository.js.map +1 -1
- package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesRepository.js +7 -4
- package/api/features/ListWebhookDeliveries/ListWebhookDeliveriesRepository.js.map +1 -1
- package/api/features/ListWebhooks/ListWebhooksRepository.js +7 -4
- package/api/features/ListWebhooks/ListWebhooksRepository.js.map +1 -1
- package/api/features/SendWebhookTask/SendWebhookTask.d.ts +11 -6
- package/api/features/SendWebhookTask/SendWebhookTask.js +21 -12
- package/api/features/SendWebhookTask/SendWebhookTask.js.map +1 -1
- package/api/features/UpdateWebhook/UpdateWebhookRepository.js +3 -1
- package/api/features/UpdateWebhook/UpdateWebhookRepository.js.map +1 -1
- package/api/features/UpdateWebhookDelivery/UpdateWebhookDeliveryRepository.js +3 -1
- package/api/features/UpdateWebhookDelivery/UpdateWebhookDeliveryRepository.js.map +1 -1
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js +3 -1
- package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js.map +1 -1
- package/api/graphql/WebhookCrudSchema.d.ts +3 -2
- package/api/graphql/WebhookCrudSchema.js +17 -2
- package/api/graphql/WebhookCrudSchema.js.map +1 -1
- package/api/graphql/WebhookDeliverySchema.d.ts +3 -2
- package/api/graphql/WebhookDeliverySchema.js +6 -2
- package/api/graphql/WebhookDeliverySchema.js.map +1 -1
- package/api/graphql/WebhookEventSchema.d.ts +3 -2
- package/api/graphql/WebhookEventSchema.js +6 -2
- package/api/graphql/WebhookEventSchema.js.map +1 -1
- package/api/graphql/WebhookSettingsSchema.d.ts +3 -2
- package/api/graphql/WebhookSettingsSchema.js +6 -2
- package/api/graphql/WebhookSettingsSchema.js.map +1 -1
- package/api/graphql/WebhookTriggerSchema.d.ts +3 -2
- package/api/graphql/WebhookTriggerSchema.js +6 -2
- package/api/graphql/WebhookTriggerSchema.js.map +1 -1
- package/api/index.d.ts +3 -0
- package/api/index.js +6 -2
- package/api/index.js.map +1 -1
- package/api/models/WebhookDeliveryModel.d.ts +1 -1
- package/api/models/WebhookDeliveryModel.js +3 -3
- package/api/models/WebhookDeliveryModel.js.map +1 -1
- package/api/models/WebhookModel.d.ts +1 -1
- package/api/models/WebhookModel.js +4 -4
- package/api/models/WebhookModel.js.map +1 -1
- package/api/models/WebhookSettingsModel.d.ts +1 -1
- package/api/models/WebhookSettingsModel.js +3 -3
- package/api/models/WebhookSettingsModel.js.map +1 -1
- package/api/utils/isValidEndpointUrl.js +1 -1
- package/api/utils/isValidEndpointUrl.js.map +1 -1
- package/package.json +26 -25
- package/admin/presentation/WebhookDeliveries/WebhookDeliveriesDataSource.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/WebhookDeliveriesPresenter.d.ts +0 -21
- package/admin/presentation/WebhookDeliveries/WebhookDeliveriesPresenter.js +0 -57
- package/admin/presentation/WebhookDeliveries/WebhookDeliveriesPresenter.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/abstractions.d.ts +0 -18
- package/admin/presentation/WebhookDeliveries/abstractions.js +0 -5
- package/admin/presentation/WebhookDeliveries/abstractions.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/components/DeliveryAccordionRow.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/components/DeliveryDetail.d.ts +0 -11
- package/admin/presentation/WebhookDeliveries/components/DeliveryDetail.js +0 -32
- package/admin/presentation/WebhookDeliveries/components/DeliveryDetail.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/components/DeliveryDetailContent.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/components/DeliveryDetailPanel.d.ts +0 -9
- package/admin/presentation/WebhookDeliveries/components/DeliveryDetailPanel.js +0 -22
- package/admin/presentation/WebhookDeliveries/components/DeliveryDetailPanel.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/components/WebhookDeliveriesDrawer.d.ts +0 -8
- package/admin/presentation/WebhookDeliveries/components/WebhookDeliveriesDrawer.js +0 -119
- package/admin/presentation/WebhookDeliveries/components/WebhookDeliveriesDrawer.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/components/statusVariant.d.ts +0 -1
- package/admin/presentation/WebhookDeliveries/components/statusVariant.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/feature.d.ts +0 -3
- package/admin/presentation/WebhookDeliveries/feature.js +0 -17
- package/admin/presentation/WebhookDeliveries/feature.js.map +0 -1
- package/admin/presentation/WebhookDeliveries/index.d.ts +0 -2
- package/admin/presentation/WebhookDeliveries/index.js +0 -2
- /package/admin/presentation/{WebhookDeliveries → WebhookDeliveriesPage}/components/DeliveryAccordionRow.d.ts +0 -0
- /package/admin/presentation/{WebhookDeliveries → WebhookDeliveriesPage}/components/DeliveryAccordionRow.js +0 -0
- /package/admin/presentation/{WebhookDeliveries → WebhookDeliveriesPage}/components/DeliveryDetailContent.d.ts +0 -0
- /package/admin/presentation/{WebhookDeliveries → WebhookDeliveriesPage}/components/DeliveryDetailContent.js +0 -0
- /package/admin/presentation/{WebhookDeliveries → WebhookDeliveriesPage}/components/statusVariant.js +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
2
|
-
import {
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, ListErrorResponse, ListResponse, Response } from "@webiny/api-graphql";
|
|
3
4
|
import { ListWebhooksUseCase } from "../features/ListWebhooks/abstractions.js";
|
|
4
5
|
import { GetWebhookUseCase } from "../features/GetWebhook/abstractions.js";
|
|
5
6
|
import { CreateWebhookUseCase } from "../features/CreateWebhook/abstractions.js";
|
|
@@ -12,6 +13,7 @@ class WebhookCrudSchema_ {
|
|
|
12
13
|
code: String
|
|
13
14
|
message: String
|
|
14
15
|
data: JSON
|
|
16
|
+
stack: String
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
type WebhookListMeta {
|
|
@@ -66,9 +68,19 @@ class WebhookCrudSchema_ {
|
|
|
66
68
|
enabled: Boolean
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
enum ListWebhooksSort {
|
|
72
|
+
createdOn_ASC
|
|
73
|
+
createdOn_DESC
|
|
74
|
+
modifiedOn_ASC
|
|
75
|
+
modifiedOn_DESC
|
|
76
|
+
name_ASC
|
|
77
|
+
name_DESC
|
|
78
|
+
}
|
|
79
|
+
|
|
69
80
|
type WebhookQuery {
|
|
70
81
|
listWebhooks(
|
|
71
82
|
where: ListWebhooksWhereInput
|
|
83
|
+
sort: [ListWebhooksSort!]
|
|
72
84
|
limit: Int
|
|
73
85
|
after: String
|
|
74
86
|
): WebhookListResponse!
|
|
@@ -156,6 +168,9 @@ class WebhookCrudSchema_ {
|
|
|
156
168
|
});
|
|
157
169
|
return builder;
|
|
158
170
|
}
|
|
171
|
+
constructor(){
|
|
172
|
+
this.getSchemaKey = staticSchemaKey("webhooks/WebhookCrudSchema_");
|
|
173
|
+
}
|
|
159
174
|
}
|
|
160
175
|
const WebhookCrudSchema = GraphQLSchemaFactory.createImplementation({
|
|
161
176
|
implementation: WebhookCrudSchema_,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/graphql/WebhookCrudSchema.js","sources":["../../../src/api/graphql/WebhookCrudSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"api/graphql/WebhookCrudSchema.js","sources":["../../../src/api/graphql/WebhookCrudSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { Response } from \"@webiny/api-graphql\";\nimport { ErrorResponse } from \"@webiny/api-graphql\";\nimport { ListResponse } from \"@webiny/api-graphql\";\nimport { ListErrorResponse } from \"@webiny/api-graphql\";\nimport { ListWebhooksUseCase } from \"~/api/features/ListWebhooks/abstractions.js\";\nimport type { IListWebhooksInput } from \"~/api/features/ListWebhooks/abstractions.js\";\nimport { GetWebhookUseCase } from \"~/api/features/GetWebhook/abstractions.js\";\nimport { CreateWebhookUseCase } from \"~/api/features/CreateWebhook/abstractions.js\";\nimport { UpdateWebhookUseCase } from \"~/api/features/UpdateWebhook/abstractions.js\";\nimport { DeleteWebhookUseCase } from \"~/api/features/DeleteWebhook/abstractions.js\";\n\ninterface IIdArgs {\n id: string;\n}\n\ninterface ICreateWebhookArgs {\n input: CreateWebhookUseCase.Input;\n}\n\ninterface IUpdateWebhookArgs {\n id: string;\n input: UpdateWebhookUseCase.Input;\n}\n\nclass WebhookCrudSchema_ implements GraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"webhooks/WebhookCrudSchema_\");\n\n async execute(\n builder: GraphQLSchemaFactory.SchemaBuilder\n ): Promise<GraphQLSchemaFactory.SchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type WebhookError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type WebhookListMeta {\n cursor: String\n hasMoreItems: Boolean!\n totalCount: Int!\n }\n\n type Webhook {\n id: ID!\n name: String!\n slug: String!\n endpointUrl: String!\n description: String\n enabled: Boolean!\n events: [String!]!\n signingSecret: String\n createdOn: DateTime\n modifiedOn: DateTime\n }\n\n type WebhookResponse {\n data: Webhook\n error: WebhookError\n }\n\n type WebhookListResponse {\n data: [Webhook!]\n meta: WebhookListMeta\n error: WebhookError\n }\n\n input CreateWebhookInput {\n name: String!\n slug: String\n endpointUrl: String!\n description: String\n enabled: Boolean\n events: [String!]!\n signingSecret: String\n }\n\n input UpdateWebhookInput {\n name: String\n endpointUrl: String\n description: String\n enabled: Boolean\n events: [String!]\n }\n\n input ListWebhooksWhereInput {\n enabled: Boolean\n }\n\n enum ListWebhooksSort {\n createdOn_ASC\n createdOn_DESC\n modifiedOn_ASC\n modifiedOn_DESC\n name_ASC\n name_DESC\n }\n\n type WebhookQuery {\n listWebhooks(\n where: ListWebhooksWhereInput\n sort: [ListWebhooksSort!]\n limit: Int\n after: String\n ): WebhookListResponse!\n getWebhook(id: ID!): WebhookResponse!\n }\n\n type WebhookMutation {\n createWebhook(input: CreateWebhookInput!): WebhookResponse!\n updateWebhook(id: ID!, input: UpdateWebhookInput!): WebhookResponse!\n deleteWebhook(id: ID!): BooleanResponse!\n }\n\n extend type Query {\n webhooks: WebhookQuery!\n }\n\n extend type Mutation {\n webhooks: WebhookMutation!\n }\n `);\n\n builder.addResolver({\n path: \"Query.webhooks\",\n dependencies: [],\n resolver: () => () => ({})\n });\n\n builder.addResolver({\n path: \"Mutation.webhooks\",\n dependencies: [],\n resolver: () => () => ({})\n });\n\n builder.addResolver<IListWebhooksInput>({\n path: \"WebhookQuery.listWebhooks\",\n dependencies: [ListWebhooksUseCase],\n resolver: (listWebhooks: ListWebhooksUseCase.Interface) => {\n return async ({ args }) => {\n const result = await listWebhooks.execute(args);\n if (result.isFail()) {\n return new ListErrorResponse(result.error);\n }\n return new ListResponse(result.value.items, result.value.meta);\n };\n }\n });\n\n builder.addResolver<IIdArgs>({\n path: \"WebhookQuery.getWebhook\",\n dependencies: [GetWebhookUseCase],\n resolver: (getWebhook: GetWebhookUseCase.Interface) => {\n return async ({ args }) => {\n const result = await getWebhook.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver<ICreateWebhookArgs>({\n path: \"WebhookMutation.createWebhook\",\n dependencies: [CreateWebhookUseCase],\n resolver: (createWebhook: CreateWebhookUseCase.Interface) => {\n return async ({ args }) => {\n const result = await createWebhook.execute(args.input);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver<IUpdateWebhookArgs>({\n path: \"WebhookMutation.updateWebhook\",\n dependencies: [UpdateWebhookUseCase],\n resolver: (updateWebhook: UpdateWebhookUseCase.Interface) => {\n return async ({ args }) => {\n const result = await updateWebhook.execute(args.id, args.input);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver<IIdArgs>({\n path: \"WebhookMutation.deleteWebhook\",\n dependencies: [DeleteWebhookUseCase],\n resolver: (deleteWebhook: DeleteWebhookUseCase.Interface) => {\n return async ({ args }) => {\n const result = await deleteWebhook.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(true);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const WebhookCrudSchema = GraphQLSchemaFactory.createImplementation({\n implementation: WebhookCrudSchema_,\n dependencies: []\n});\n"],"names":["WebhookCrudSchema_","builder","ListWebhooksUseCase","listWebhooks","args","result","ListErrorResponse","ListResponse","GetWebhookUseCase","getWebhook","ErrorResponse","Response","CreateWebhookUseCase","createWebhook","UpdateWebhookUseCase","updateWebhook","DeleteWebhookUseCase","deleteWebhook","staticSchemaKey","WebhookCrudSchema","GraphQLSchemaFactory"],"mappings":";;;;;;;;AA0BA,MAAMA;IAGF,MAAM,QACFC,OAA2C,EACA;QAC3CA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4FnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc,EAAE;YAChB,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc,EAAE;YAChB,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAqB;YACpC,MAAM;YACN,cAAc;gBAACC;aAAoB;YACnC,UAAU,CAACC,eACA,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMF,aAAa,OAAO,CAACC;oBAC1C,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIC,kBAAkBD,OAAO,KAAK;oBAE7C,OAAO,IAAIE,aAAaF,OAAO,KAAK,CAAC,KAAK,EAAEA,OAAO,KAAK,CAAC,IAAI;gBACjE;QAER;QAEAJ,QAAQ,WAAW,CAAU;YACzB,MAAM;YACN,cAAc;gBAACO;aAAkB;YACjC,UAAU,CAACC,aACA,OAAO,EAAEL,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMI,WAAW,OAAO,CAACL,KAAK,EAAE;oBAC/C,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIK,cAAcL,OAAO,KAAK;oBAEzC,OAAO,IAAIM,SAASN,OAAO,KAAK;gBACpC;QAER;QAEAJ,QAAQ,WAAW,CAAqB;YACpC,MAAM;YACN,cAAc;gBAACW;aAAqB;YACpC,UAAU,CAACC,gBACA,OAAO,EAAET,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMQ,cAAc,OAAO,CAACT,KAAK,KAAK;oBACrD,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIK,cAAcL,OAAO,KAAK;oBAEzC,OAAO,IAAIM,SAASN,OAAO,KAAK;gBACpC;QAER;QAEAJ,QAAQ,WAAW,CAAqB;YACpC,MAAM;YACN,cAAc;gBAACa;aAAqB;YACpC,UAAU,CAACC,gBACA,OAAO,EAAEX,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMU,cAAc,OAAO,CAACX,KAAK,EAAE,EAAEA,KAAK,KAAK;oBAC9D,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIK,cAAcL,OAAO,KAAK;oBAEzC,OAAO,IAAIM,SAASN,OAAO,KAAK;gBACpC;QAER;QAEAJ,QAAQ,WAAW,CAAU;YACzB,MAAM;YACN,cAAc;gBAACe;aAAqB;YACpC,UAAU,CAACC,gBACA,OAAO,EAAEb,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMY,cAAc,OAAO,CAACb,KAAK,EAAE;oBAClD,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIK,cAAcL,OAAO,KAAK;oBAEzC,OAAO,IAAIM,SAAS;gBACxB;QAER;QAEA,OAAOV;IACX;;aAtLO,YAAY,GAAGiB,gBAAgB;;AAuL1C;AAEO,MAAMC,oBAAoBC,qBAAqB,oBAAoB,CAAC;IACvE,gBAAgBpB;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
2
|
declare class WebhookDeliverySchema_ implements GraphQLSchemaFactory.Interface {
|
|
3
|
+
getSchemaKey: () => string;
|
|
3
4
|
execute(builder: GraphQLSchemaFactory.SchemaBuilder): Promise<GraphQLSchemaFactory.SchemaBuilder>;
|
|
4
5
|
}
|
|
5
6
|
export declare const WebhookDeliverySchema: typeof WebhookDeliverySchema_ & {
|
|
6
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
7
8
|
};
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
2
|
-
import {
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, ListErrorResponse, ListResponse, Response } from "@webiny/api-graphql";
|
|
3
4
|
import { ListWebhookDeliveriesUseCase } from "../features/ListWebhookDeliveries/abstractions.js";
|
|
4
5
|
import { GetWebhookDeliveryUseCase } from "../features/GetWebhookDelivery/abstractions.js";
|
|
5
6
|
import { ResendWebhookDeliveryUseCase } from "../features/ResendWebhookDelivery/abstractions.js";
|
|
@@ -90,6 +91,9 @@ class WebhookDeliverySchema_ {
|
|
|
90
91
|
});
|
|
91
92
|
return builder;
|
|
92
93
|
}
|
|
94
|
+
constructor(){
|
|
95
|
+
this.getSchemaKey = staticSchemaKey("webhooks/WebhookDeliverySchema_");
|
|
96
|
+
}
|
|
93
97
|
}
|
|
94
98
|
const WebhookDeliverySchema = GraphQLSchemaFactory.createImplementation({
|
|
95
99
|
implementation: WebhookDeliverySchema_,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/graphql/WebhookDeliverySchema.js","sources":["../../../src/api/graphql/WebhookDeliverySchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"api/graphql/WebhookDeliverySchema.js","sources":["../../../src/api/graphql/WebhookDeliverySchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { Response } from \"@webiny/api-graphql\";\nimport { ErrorResponse } from \"@webiny/api-graphql\";\nimport { ListResponse } from \"@webiny/api-graphql\";\nimport { ListErrorResponse } from \"@webiny/api-graphql\";\nimport { ListWebhookDeliveriesUseCase } from \"~/api/features/ListWebhookDeliveries/abstractions.js\";\nimport { GetWebhookDeliveryUseCase } from \"~/api/features/GetWebhookDelivery/abstractions.js\";\nimport { ResendWebhookDeliveryUseCase } from \"~/api/features/ResendWebhookDelivery/abstractions.js\";\n\ninterface IListDeliveriesArgs {\n where?: {\n webhookId_eq?: string;\n eventType_in?: string[];\n status_in?: string[];\n };\n limit?: number;\n after?: string;\n}\n\ninterface IIdArgs {\n id: string;\n}\n\nclass WebhookDeliverySchema_ implements GraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"webhooks/WebhookDeliverySchema_\");\n\n async execute(\n builder: GraphQLSchemaFactory.SchemaBuilder\n ): Promise<GraphQLSchemaFactory.SchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type WebhookDelivery {\n id: ID!\n webhookId: ID!\n backgroundTaskId: String\n eventType: String!\n status: String!\n payload: JSON\n requestHeaders: JSON\n responseHeaders: JSON\n responseTime: Int\n responseStatus: Int\n responseBody: String\n createdOn: DateTime!\n }\n\n input WebhookDeliveryListWhereInput {\n webhookId_eq: ID\n eventType_in: [String!]\n status_in: [String!]\n }\n\n type WebhookDeliveryResponse {\n data: WebhookDelivery\n error: WebhookError\n }\n\n type WebhookDeliveryListResponse {\n data: [WebhookDelivery!]\n meta: WebhookListMeta\n error: WebhookError\n }\n\n extend type WebhookQuery {\n listWebhookDeliveries(\n where: WebhookDeliveryListWhereInput\n limit: Int\n after: String\n ): WebhookDeliveryListResponse!\n getWebhookDelivery(id: ID!): WebhookDeliveryResponse!\n }\n\n extend type WebhookMutation {\n resendWebhookDelivery(id: ID!): BooleanResponse!\n }\n `);\n\n builder.addResolver<IListDeliveriesArgs>({\n path: \"WebhookQuery.listWebhookDeliveries\",\n dependencies: [ListWebhookDeliveriesUseCase],\n resolver: (listDeliveries: ListWebhookDeliveriesUseCase.Interface) => {\n return async ({ args }) => {\n const result = await listDeliveries.execute({\n where: args.where,\n limit: args.limit,\n after: args.after\n });\n if (result.isFail()) {\n return new ListErrorResponse(result.error);\n }\n return new ListResponse(result.value.items, result.value.meta);\n };\n }\n });\n\n builder.addResolver<IIdArgs>({\n path: \"WebhookQuery.getWebhookDelivery\",\n dependencies: [GetWebhookDeliveryUseCase],\n resolver: (getDelivery: GetWebhookDeliveryUseCase.Interface) => {\n return async ({ args }) => {\n const result = await getDelivery.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver<IIdArgs>({\n path: \"WebhookMutation.resendWebhookDelivery\",\n dependencies: [ResendWebhookDeliveryUseCase],\n resolver: (resend: ResendWebhookDeliveryUseCase.Interface) => {\n return async ({ args }) => {\n const result = await resend.execute(args.id);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(true);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const WebhookDeliverySchema = GraphQLSchemaFactory.createImplementation({\n implementation: WebhookDeliverySchema_,\n dependencies: []\n});\n"],"names":["WebhookDeliverySchema_","builder","ListWebhookDeliveriesUseCase","listDeliveries","args","result","ListErrorResponse","ListResponse","GetWebhookDeliveryUseCase","getDelivery","ErrorResponse","Response","ResendWebhookDeliveryUseCase","resend","staticSchemaKey","WebhookDeliverySchema","GraphQLSchemaFactory"],"mappings":";;;;;;AAwBA,MAAMA;IAGF,MAAM,QACFC,OAA2C,EACA;QAC3CA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6CnC,CAAC;QAEDA,QAAQ,WAAW,CAAsB;YACrC,MAAM;YACN,cAAc;gBAACC;aAA6B;YAC5C,UAAU,CAACC,iBACA,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMF,eAAe,OAAO,CAAC;wBACxC,OAAOC,KAAK,KAAK;wBACjB,OAAOA,KAAK,KAAK;wBACjB,OAAOA,KAAK,KAAK;oBACrB;oBACA,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIC,kBAAkBD,OAAO,KAAK;oBAE7C,OAAO,IAAIE,aAAaF,OAAO,KAAK,CAAC,KAAK,EAAEA,OAAO,KAAK,CAAC,IAAI;gBACjE;QAER;QAEAJ,QAAQ,WAAW,CAAU;YACzB,MAAM;YACN,cAAc;gBAACO;aAA0B;YACzC,UAAU,CAACC,cACA,OAAO,EAAEL,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMI,YAAY,OAAO,CAACL,KAAK,EAAE;oBAChD,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIK,cAAcL,OAAO,KAAK;oBAEzC,OAAO,IAAIM,SAASN,OAAO,KAAK;gBACpC;QAER;QAEAJ,QAAQ,WAAW,CAAU;YACzB,MAAM;YACN,cAAc;gBAACW;aAA6B;YAC5C,UAAU,CAACC,SACA,OAAO,EAAET,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMQ,OAAO,OAAO,CAACT,KAAK,EAAE;oBAC3C,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIK,cAAcL,OAAO,KAAK;oBAEzC,OAAO,IAAIM,SAAS;gBACxB;QAER;QAEA,OAAOV;IACX;;aAnGO,YAAY,GAAGa,gBAAgB;;AAoG1C;AAEO,MAAMC,wBAAwBC,qBAAqB,oBAAoB,CAAC;IAC3E,gBAAgBhB;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
2
|
declare class WebhookEventSchema_ implements GraphQLSchemaFactory.Interface {
|
|
3
|
+
getSchemaKey: () => string;
|
|
3
4
|
execute(builder: GraphQLSchemaFactory.SchemaBuilder): Promise<GraphQLSchemaFactory.SchemaBuilder>;
|
|
4
5
|
}
|
|
5
6
|
export declare const WebhookEventSchema: typeof WebhookEventSchema_ & {
|
|
6
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
7
8
|
};
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
2
|
-
import {
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, Response } from "@webiny/api-graphql";
|
|
3
4
|
import { ListAvailableWebhookEventsUseCase } from "../features/ListAvailableWebhookEvents/abstractions.js";
|
|
4
5
|
class WebhookEventSchema_ {
|
|
5
6
|
async execute(builder) {
|
|
@@ -35,6 +36,9 @@ class WebhookEventSchema_ {
|
|
|
35
36
|
});
|
|
36
37
|
return builder;
|
|
37
38
|
}
|
|
39
|
+
constructor(){
|
|
40
|
+
this.getSchemaKey = staticSchemaKey("webhooks/WebhookEventSchema_");
|
|
41
|
+
}
|
|
38
42
|
}
|
|
39
43
|
const WebhookEventSchema = GraphQLSchemaFactory.createImplementation({
|
|
40
44
|
implementation: WebhookEventSchema_,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/graphql/WebhookEventSchema.js","sources":["../../../src/api/graphql/WebhookEventSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"api/graphql/WebhookEventSchema.js","sources":["../../../src/api/graphql/WebhookEventSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { Response } from \"@webiny/api-graphql\";\nimport { ErrorResponse } from \"@webiny/api-graphql\";\nimport { ListAvailableWebhookEventsUseCase } from \"~/api/features/ListAvailableWebhookEvents/abstractions.js\";\n\nclass WebhookEventSchema_ implements GraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"webhooks/WebhookEventSchema_\");\n\n async execute(\n builder: GraphQLSchemaFactory.SchemaBuilder\n ): Promise<GraphQLSchemaFactory.SchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type WebhookEvent {\n app: String!\n appLabel: String!\n entity: String!\n entityLabel: String!\n eventName: String!\n label: String!\n }\n\n type WebhookEventListResponse {\n data: [WebhookEvent!]\n error: WebhookError\n }\n\n extend type WebhookQuery {\n listAvailableWebhookEvents: WebhookEventListResponse!\n }\n `);\n\n builder.addResolver({\n path: \"WebhookQuery.listAvailableWebhookEvents\",\n dependencies: [ListAvailableWebhookEventsUseCase],\n resolver: (listEvents: ListAvailableWebhookEventsUseCase.Interface) => {\n return async () => {\n const result = await listEvents.execute();\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const WebhookEventSchema = GraphQLSchemaFactory.createImplementation({\n implementation: WebhookEventSchema_,\n dependencies: []\n});\n"],"names":["WebhookEventSchema_","builder","ListAvailableWebhookEventsUseCase","listEvents","result","ErrorResponse","Response","staticSchemaKey","WebhookEventSchema","GraphQLSchemaFactory"],"mappings":";;;;AAMA,MAAMA;IAGF,MAAM,QACFC,OAA2C,EACA;QAC3CA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;QAkBnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;aAAkC;YACjD,UAAU,CAACC,aACA;oBACH,MAAMC,SAAS,MAAMD,WAAW,OAAO;oBACvC,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;oBAEzC,OAAO,IAAIE,SAASF,OAAO,KAAK;gBACpC;QAER;QAEA,OAAOH;IACX;;aAxCO,YAAY,GAAGM,gBAAgB;;AAyC1C;AAEO,MAAMC,qBAAqBC,qBAAqB,oBAAoB,CAAC;IACxE,gBAAgBT;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
2
|
declare class WebhookSettingsSchema_ implements GraphQLSchemaFactory.Interface {
|
|
3
|
+
getSchemaKey: () => string;
|
|
3
4
|
execute(builder: GraphQLSchemaFactory.SchemaBuilder): Promise<GraphQLSchemaFactory.SchemaBuilder>;
|
|
4
5
|
}
|
|
5
6
|
export declare const WebhookSettingsSchema: typeof WebhookSettingsSchema_ & {
|
|
6
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
7
8
|
};
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
2
|
-
import {
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, Response } from "@webiny/api-graphql";
|
|
3
4
|
import { GetWebhookSettingsRepository } from "../features/GetWebhookSettings/abstractions.js";
|
|
4
5
|
import { UpdateWebhookSettingsUseCase } from "../features/UpdateWebhookSettings/abstractions.js";
|
|
5
6
|
class WebhookSettingsSchema_ {
|
|
@@ -52,6 +53,9 @@ class WebhookSettingsSchema_ {
|
|
|
52
53
|
});
|
|
53
54
|
return builder;
|
|
54
55
|
}
|
|
56
|
+
constructor(){
|
|
57
|
+
this.getSchemaKey = staticSchemaKey("webhooks/WebhookSettingsSchema_");
|
|
58
|
+
}
|
|
55
59
|
}
|
|
56
60
|
const WebhookSettingsSchema = GraphQLSchemaFactory.createImplementation({
|
|
57
61
|
implementation: WebhookSettingsSchema_,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/graphql/WebhookSettingsSchema.js","sources":["../../../src/api/graphql/WebhookSettingsSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"api/graphql/WebhookSettingsSchema.js","sources":["../../../src/api/graphql/WebhookSettingsSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { Response } from \"@webiny/api-graphql\";\nimport { ErrorResponse } from \"@webiny/api-graphql\";\nimport { GetWebhookSettingsRepository } from \"~/api/features/GetWebhookSettings/abstractions.js\";\nimport { UpdateWebhookSettingsUseCase } from \"~/api/features/UpdateWebhookSettings/abstractions.js\";\nimport type { IUpdateWebhookSettingsInput } from \"~/api/features/UpdateWebhookSettings/abstractions.js\";\n\ninterface IUpdateWebhookSettingsArgs {\n input: IUpdateWebhookSettingsInput;\n}\n\nclass WebhookSettingsSchema_ implements GraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"webhooks/WebhookSettingsSchema_\");\n\n async execute(\n builder: GraphQLSchemaFactory.SchemaBuilder\n ): Promise<GraphQLSchemaFactory.SchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type WebhookSettings {\n signingSecret: String\n deliveryRetentionDays: Int\n }\n\n type WebhookSettingsResponse {\n data: WebhookSettings\n error: WebhookError\n }\n\n input UpdateWebhookSettingsInput {\n signingSecret: String\n deliveryRetentionDays: Int\n }\n\n extend type WebhookQuery {\n getSettings: WebhookSettingsResponse\n }\n\n extend type WebhookMutation {\n updateSettings(input: UpdateWebhookSettingsInput!): WebhookSettingsResponse\n }\n `);\n\n builder.addResolver({\n path: \"WebhookQuery.getSettings\",\n dependencies: [GetWebhookSettingsRepository],\n resolver: (getSettings: GetWebhookSettingsRepository.Interface) => {\n return async () => {\n const result = await getSettings.execute();\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n builder.addResolver<IUpdateWebhookSettingsArgs>({\n path: \"WebhookMutation.updateSettings\",\n dependencies: [UpdateWebhookSettingsUseCase],\n resolver: (updateSettings: UpdateWebhookSettingsUseCase.Interface) => {\n return async ({ args }) => {\n const result = await updateSettings.execute(args.input);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const WebhookSettingsSchema = GraphQLSchemaFactory.createImplementation({\n implementation: WebhookSettingsSchema_,\n dependencies: []\n});\n"],"names":["WebhookSettingsSchema_","builder","GetWebhookSettingsRepository","getSettings","result","ErrorResponse","Response","UpdateWebhookSettingsUseCase","updateSettings","args","staticSchemaKey","WebhookSettingsSchema","GraphQLSchemaFactory"],"mappings":";;;;;AAYA,MAAMA;IAGF,MAAM,QACFC,OAA2C,EACA;QAC3CA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;QAuBnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;aAA6B;YAC5C,UAAU,CAACC,cACA;oBACH,MAAMC,SAAS,MAAMD,YAAY,OAAO;oBACxC,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;oBAEzC,OAAO,IAAIE,SAASF,OAAO,KAAK;gBACpC;QAER;QAEAH,QAAQ,WAAW,CAA6B;YAC5C,MAAM;YACN,cAAc;gBAACM;aAA6B;YAC5C,UAAU,CAACC,iBACA,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAML,SAAS,MAAMI,eAAe,OAAO,CAACC,KAAK,KAAK;oBACtD,IAAIL,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;oBAEzC,OAAO,IAAIE,SAASF,OAAO,KAAK;gBACpC;QAER;QAEA,OAAOH;IACX;;aA3DO,YAAY,GAAGS,gBAAgB;;AA4D1C;AAEO,MAAMC,wBAAwBC,qBAAqB,oBAAoB,CAAC;IAC3E,gBAAgBZ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
2
|
declare class WebhookTriggerSchema_ implements GraphQLSchemaFactory.Interface {
|
|
3
|
+
getSchemaKey: () => string;
|
|
3
4
|
execute(builder: GraphQLSchemaFactory.SchemaBuilder): Promise<GraphQLSchemaFactory.SchemaBuilder>;
|
|
4
5
|
}
|
|
5
6
|
export declare const WebhookTriggerSchema: typeof WebhookTriggerSchema_ & {
|
|
6
|
-
__abstraction: import("@webiny/di").Abstraction<import("@webiny/
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
|
|
7
8
|
};
|
|
8
9
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GraphQLSchemaFactory } from "@webiny/
|
|
2
|
-
import {
|
|
1
|
+
import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, Response } from "@webiny/api-graphql";
|
|
3
4
|
import { TriggerWebhookUseCase } from "../features/TriggerWebhook/abstractions.js";
|
|
4
5
|
class WebhookTriggerSchema_ {
|
|
5
6
|
async execute(builder) {
|
|
@@ -26,6 +27,9 @@ class WebhookTriggerSchema_ {
|
|
|
26
27
|
});
|
|
27
28
|
return builder;
|
|
28
29
|
}
|
|
30
|
+
constructor(){
|
|
31
|
+
this.getSchemaKey = staticSchemaKey("webhooks/WebhookTriggerSchema_");
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
const WebhookTriggerSchema = GraphQLSchemaFactory.createImplementation({
|
|
31
35
|
implementation: WebhookTriggerSchema_,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/graphql/WebhookTriggerSchema.js","sources":["../../../src/api/graphql/WebhookTriggerSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/
|
|
1
|
+
{"version":3,"file":"api/graphql/WebhookTriggerSchema.js","sources":["../../../src/api/graphql/WebhookTriggerSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { Response } from \"@webiny/api-graphql\";\nimport { ErrorResponse } from \"@webiny/api-graphql\";\nimport { TriggerWebhookUseCase } from \"~/api/features/TriggerWebhook/abstractions.js\";\n\ninterface ITriggerWebhookArgs {\n id: string;\n payload: Record<string, unknown>;\n}\n\nclass WebhookTriggerSchema_ implements GraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"webhooks/WebhookTriggerSchema_\");\n\n async execute(\n builder: GraphQLSchemaFactory.SchemaBuilder\n ): Promise<GraphQLSchemaFactory.SchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type WebhookTriggerResponse {\n data: WebhookDelivery\n error: WebhookError\n }\n\n extend type WebhookMutation {\n triggerWebhook(id: ID!, payload: JSON!): WebhookTriggerResponse!\n }\n `);\n\n builder.addResolver<ITriggerWebhookArgs>({\n path: \"WebhookMutation.triggerWebhook\",\n dependencies: [TriggerWebhookUseCase],\n resolver: (triggerWebhook: TriggerWebhookUseCase.Interface) => {\n return async ({ args }) => {\n const result = await triggerWebhook.execute(args.id, args.payload);\n if (result.isFail()) {\n return new ErrorResponse(result.error);\n }\n return new Response(result.value);\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const WebhookTriggerSchema = GraphQLSchemaFactory.createImplementation({\n implementation: WebhookTriggerSchema_,\n dependencies: []\n});\n"],"names":["WebhookTriggerSchema_","builder","TriggerWebhookUseCase","triggerWebhook","args","result","ErrorResponse","Response","staticSchemaKey","WebhookTriggerSchema","GraphQLSchemaFactory"],"mappings":";;;;AAWA,MAAMA;IAGF,MAAM,QACFC,OAA2C,EACA;QAC3CA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;QASnC,CAAC;QAEDA,QAAQ,WAAW,CAAsB;YACrC,MAAM;YACN,cAAc;gBAACC;aAAsB;YACrC,UAAU,CAACC,iBACA,OAAO,EAAEC,IAAI,EAAE;oBAClB,MAAMC,SAAS,MAAMF,eAAe,OAAO,CAACC,KAAK,EAAE,EAAEA,KAAK,OAAO;oBACjE,IAAIC,OAAO,MAAM,IACb,OAAO,IAAIC,cAAcD,OAAO,KAAK;oBAEzC,OAAO,IAAIE,SAASF,OAAO,KAAK;gBACpC;QAER;QAEA,OAAOJ;IACX;;aA/BO,YAAY,GAAGO,gBAAgB;;AAgC1C;AAEO,MAAMC,uBAAuBC,qBAAqB,oBAAoB,CAAC;IAC1E,gBAAgBV;IAChB,cAAc,EAAE;AACpB"}
|
package/api/index.d.ts
CHANGED
package/api/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { WebhooksFeature } from "./WebhooksFeature.js";
|
|
2
2
|
import { createRegisterExtensionPlugin } from "@webiny/handler";
|
|
3
|
-
const createWebhooks = ()=>
|
|
3
|
+
const createWebhooks = ()=>{
|
|
4
|
+
const plugin = createRegisterExtensionPlugin(async (context)=>{
|
|
4
5
|
WebhooksFeature.register(context.container);
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
+
plugin.name = "webhooks.extension";
|
|
8
|
+
return plugin;
|
|
9
|
+
};
|
|
10
|
+
export { WebhooksFeature, createWebhooks };
|
|
7
11
|
|
|
8
12
|
//# sourceMappingURL=index.js.map
|
package/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/index.js","sources":["../../src/api/index.ts"],"sourcesContent":["import { WebhooksFeature } from \"./WebhooksFeature.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\n\nexport const createWebhooks = () => {\n
|
|
1
|
+
{"version":3,"file":"api/index.js","sources":["../../src/api/index.ts"],"sourcesContent":["import { WebhooksFeature } from \"./WebhooksFeature.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\n\nexport { WebhooksFeature };\n\n/** @deprecated use WebhooksFeature instead */\nexport const createWebhooks = () => {\n const plugin = createRegisterExtensionPlugin(async context => {\n WebhooksFeature.register(context.container);\n });\n\n plugin.name = \"webhooks.extension\";\n\n return plugin;\n};\n"],"names":["createWebhooks","plugin","createRegisterExtensionPlugin","context","WebhooksFeature"],"mappings":";;AAMO,MAAMA,iBAAiB;IAC1B,MAAMC,SAASC,8BAA8B,OAAMC;QAC/CC,gBAAgB,QAAQ,CAACD,QAAQ,SAAS;IAC9C;IAEAF,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
2
|
declare class WebhookDeliveryModelFactory implements ModelFactory.Interface {
|
|
3
|
-
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").
|
|
3
|
+
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").PrivateModelBuilder[]>;
|
|
4
4
|
}
|
|
5
5
|
export declare const WebhookDeliveryModel: typeof WebhookDeliveryModelFactory & {
|
|
6
6
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/modelBuilder/abstractions").IModelFactory>;
|
|
@@ -2,11 +2,11 @@ import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/ind
|
|
|
2
2
|
import { WEBHOOK_DELIVERY_MODEL_ID } from "../domain/constants.js";
|
|
3
3
|
class WebhookDeliveryModelFactory {
|
|
4
4
|
async execute(builder) {
|
|
5
|
-
const model = builder.
|
|
5
|
+
const model = builder.private({
|
|
6
6
|
modelId: WEBHOOK_DELIVERY_MODEL_ID,
|
|
7
7
|
name: "Webhook Delivery",
|
|
8
|
-
|
|
9
|
-
}).
|
|
8
|
+
lifecycleEvents: false
|
|
9
|
+
}).tags([
|
|
10
10
|
"$publishing:false",
|
|
11
11
|
"$hidden:true"
|
|
12
12
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/models/WebhookDeliveryModel.js","sources":["../../../src/api/models/WebhookDeliveryModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WEBHOOK_DELIVERY_MODEL_ID } from \"~/api/domain/constants.js\";\n\nclass WebhookDeliveryModelFactory implements ModelFactory.Interface {\n async execute(builder: ModelFactory.Builder) {\n const model = builder\n .
|
|
1
|
+
{"version":3,"file":"api/models/WebhookDeliveryModel.js","sources":["../../../src/api/models/WebhookDeliveryModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WEBHOOK_DELIVERY_MODEL_ID } from \"~/api/domain/constants.js\";\n\nclass WebhookDeliveryModelFactory implements ModelFactory.Interface {\n async execute(builder: ModelFactory.Builder) {\n const model = builder\n .private({\n modelId: WEBHOOK_DELIVERY_MODEL_ID,\n name: \"Webhook Delivery\",\n lifecycleEvents: false\n })\n .tags([\"$publishing:false\", \"$hidden:true\"]);\n\n model.fields(fields => ({\n webhookId: fields.text().label(\"Webhook ID\").required(),\n backgroundTaskId: fields.text().label(\"Background Task ID\"),\n eventType: fields.text().label(\"Event Type\").required(),\n status: fields.text().label(\"Status\").required(),\n payload: fields.text().compress().label(\"Payload\"),\n requestHeaders: fields.text().compress().label(\"Request Headers\"),\n responseTime: fields.number().label(\"Response Time (ms)\"),\n responseStatus: fields.number().label(\"Response Status\"),\n responseHeaders: fields.text().compress().label(\"Response Headers\"),\n responseBody: fields.text().compress().label(\"Response Body\")\n }));\n\n return [model];\n }\n}\n\nexport const WebhookDeliveryModel = ModelFactory.createImplementation({\n implementation: WebhookDeliveryModelFactory,\n dependencies: []\n});\n"],"names":["WebhookDeliveryModelFactory","builder","model","WEBHOOK_DELIVERY_MODEL_ID","fields","WebhookDeliveryModel","ModelFactory"],"mappings":";;AAGA,MAAMA;IACF,MAAM,QAAQC,OAA6B,EAAE;QACzC,MAAMC,QAAQD,QACT,OAAO,CAAC;YACL,SAASE;YACT,MAAM;YACN,iBAAiB;QACrB,GACC,IAAI,CAAC;YAAC;YAAqB;SAAe;QAE/CD,MAAM,MAAM,CAACE,CAAAA,SAAW;gBACpB,WAAWA,OAAO,IAAI,GAAG,KAAK,CAAC,cAAc,QAAQ;gBACrD,kBAAkBA,OAAO,IAAI,GAAG,KAAK,CAAC;gBACtC,WAAWA,OAAO,IAAI,GAAG,KAAK,CAAC,cAAc,QAAQ;gBACrD,QAAQA,OAAO,IAAI,GAAG,KAAK,CAAC,UAAU,QAAQ;gBAC9C,SAASA,OAAO,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC;gBACxC,gBAAgBA,OAAO,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC;gBAC/C,cAAcA,OAAO,MAAM,GAAG,KAAK,CAAC;gBACpC,gBAAgBA,OAAO,MAAM,GAAG,KAAK,CAAC;gBACtC,iBAAiBA,OAAO,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC;gBAChD,cAAcA,OAAO,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC;YACjD;QAEA,OAAO;YAACF;SAAM;IAClB;AACJ;AAEO,MAAMG,uBAAuBC,aAAa,oBAAoB,CAAC;IAClE,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
2
|
declare class WebhookModelFactory implements ModelFactory.Interface {
|
|
3
|
-
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").
|
|
3
|
+
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").PrivateModelBuilder[]>;
|
|
4
4
|
}
|
|
5
5
|
export declare const WebhookModel: typeof WebhookModelFactory & {
|
|
6
6
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/modelBuilder/abstractions").IModelFactory>;
|
|
@@ -2,16 +2,16 @@ import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/ind
|
|
|
2
2
|
import { WEBHOOK_MODEL_ID } from "../domain/constants.js";
|
|
3
3
|
class WebhookModelFactory {
|
|
4
4
|
async execute(builder) {
|
|
5
|
-
const model = builder.
|
|
5
|
+
const model = builder.private({
|
|
6
6
|
modelId: WEBHOOK_MODEL_ID,
|
|
7
7
|
name: "Webhook",
|
|
8
|
-
|
|
9
|
-
}).
|
|
8
|
+
lifecycleEvents: false
|
|
9
|
+
}).tags([
|
|
10
10
|
"$publishing:false",
|
|
11
11
|
"$hidden:true"
|
|
12
12
|
]);
|
|
13
13
|
model.fields((fields)=>({
|
|
14
|
-
name: fields.text().label("Name").required()
|
|
14
|
+
name: fields.text().label("Name").required(),
|
|
15
15
|
slug: fields.text().label("Slug").required().description("URL-safe identifier, unique per tenant.").minLength(3, "Slug must be at least 3 characters long.").pattern("^[a-z0-9]+(?:-[a-z0-9]+)*$", "", "Slug can only contain lowercase letters, numbers, and hyphens, and must start and end with a letter or number."),
|
|
16
16
|
endpointUrl: fields.text().label("Endpoint URL").required().description("HTTPS destination for POST requests.").url("Must be a valid URL starting with https://").minLength(8, "Endpoint URL must be at least 8 characters long.").pattern("^(https:\\/\\/.+|http:\\/\\/localhost.*)", "", "Endpoint URL must start with https://"),
|
|
17
17
|
description: fields.longText().label("Description"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/models/WebhookModel.js","sources":["../../../src/api/models/WebhookModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WEBHOOK_MODEL_ID } from \"~/api/domain/constants.js\";\n\nclass WebhookModelFactory implements ModelFactory.Interface {\n async execute(builder: ModelFactory.Builder) {\n const model = builder\n .
|
|
1
|
+
{"version":3,"file":"api/models/WebhookModel.js","sources":["../../../src/api/models/WebhookModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport { WEBHOOK_MODEL_ID } from \"~/api/domain/constants.js\";\n\nclass WebhookModelFactory implements ModelFactory.Interface {\n async execute(builder: ModelFactory.Builder) {\n const model = builder\n .private({ modelId: WEBHOOK_MODEL_ID, name: \"Webhook\", lifecycleEvents: false })\n .tags([\"$publishing:false\", \"$hidden:true\"]);\n\n model.fields(fields => ({\n name: fields.text().label(\"Name\").required(),\n slug: fields\n .text()\n .label(\"Slug\")\n .required()\n .description(\"URL-safe identifier, unique per tenant.\")\n .minLength(3, \"Slug must be at least 3 characters long.\")\n .pattern(\n \"^[a-z0-9]+(?:-[a-z0-9]+)*$\",\n \"\",\n \"Slug can only contain lowercase letters, numbers, and hyphens, and must start and end with a letter or number.\"\n ),\n endpointUrl: fields\n .text()\n .label(\"Endpoint URL\")\n .required()\n .description(\"HTTPS destination for POST requests.\")\n .url(\"Must be a valid URL starting with https://\")\n .minLength(8, \"Endpoint URL must be at least 8 characters long.\")\n .pattern(\n \"^(https:\\\\/\\\\/.+|http:\\\\/\\\\/localhost.*)\",\n \"\",\n \"Endpoint URL must start with https://\"\n ),\n description: fields.longText().label(\"Description\"),\n enabled: fields.boolean().label(\"Enabled\").defaultValue(false),\n events: fields\n .text()\n .list()\n .label(\"Events\")\n .defaultValue([])\n .listMinLength(1, \"At least one event must be selected.\"),\n signingSecret: fields\n .text()\n .encrypt()\n .label(\"Signing Secret\")\n .description(\"Signing secret - will be encrypted in the database.\")\n }));\n\n return [model];\n }\n}\n\nexport const WebhookModel = ModelFactory.createImplementation({\n implementation: WebhookModelFactory,\n dependencies: []\n});\n"],"names":["WebhookModelFactory","builder","model","WEBHOOK_MODEL_ID","fields","WebhookModel","ModelFactory"],"mappings":";;AAGA,MAAMA;IACF,MAAM,QAAQC,OAA6B,EAAE;QACzC,MAAMC,QAAQD,QACT,OAAO,CAAC;YAAE,SAASE;YAAkB,MAAM;YAAW,iBAAiB;QAAM,GAC7E,IAAI,CAAC;YAAC;YAAqB;SAAe;QAE/CD,MAAM,MAAM,CAACE,CAAAA,SAAW;gBACpB,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,QAAQ,QAAQ;gBAC1C,MAAMA,OACD,IAAI,GACJ,KAAK,CAAC,QACN,QAAQ,GACR,WAAW,CAAC,2CACZ,SAAS,CAAC,GAAG,4CACb,OAAO,CACJ,8BACA,IACA;gBAER,aAAaA,OACR,IAAI,GACJ,KAAK,CAAC,gBACN,QAAQ,GACR,WAAW,CAAC,wCACZ,GAAG,CAAC,8CACJ,SAAS,CAAC,GAAG,oDACb,OAAO,CACJ,4CACA,IACA;gBAER,aAAaA,OAAO,QAAQ,GAAG,KAAK,CAAC;gBACrC,SAASA,OAAO,OAAO,GAAG,KAAK,CAAC,WAAW,YAAY,CAAC;gBACxD,QAAQA,OACH,IAAI,GACJ,IAAI,GACJ,KAAK,CAAC,UACN,YAAY,CAAC,EAAE,EACf,aAAa,CAAC,GAAG;gBACtB,eAAeA,OACV,IAAI,GACJ,OAAO,GACP,KAAK,CAAC,kBACN,WAAW,CAAC;YACrB;QAEA,OAAO;YAACF;SAAM;IAClB;AACJ;AAEO,MAAMG,eAAeC,aAAa,oBAAoB,CAAC;IAC1D,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
2
|
declare class WebhookSettingsModelFactory implements ModelFactory.Interface {
|
|
3
|
-
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").
|
|
3
|
+
execute(builder: ModelFactory.Builder): Promise<import("@webiny/api-headless-cms/features/modelBuilder/index.js").PrivateModelBuilder[]>;
|
|
4
4
|
}
|
|
5
5
|
export declare const WebhookSettingsModel: typeof WebhookSettingsModelFactory & {
|
|
6
6
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/modelBuilder/abstractions").IModelFactory>;
|
|
@@ -2,11 +2,11 @@ import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/ind
|
|
|
2
2
|
import { WEBHOOK_DELIVERY_MAX_RETENTION_DAYS, WEBHOOK_SETTINGS_MODEL_ID } from "../domain/constants.js";
|
|
3
3
|
class WebhookSettingsModelFactory {
|
|
4
4
|
async execute(builder) {
|
|
5
|
-
const model = builder.
|
|
5
|
+
const model = builder.private({
|
|
6
6
|
modelId: WEBHOOK_SETTINGS_MODEL_ID,
|
|
7
7
|
name: "Webhook Settings",
|
|
8
|
-
|
|
9
|
-
}).
|
|
8
|
+
lifecycleEvents: false
|
|
9
|
+
}).tags([
|
|
10
10
|
"$publishing:false",
|
|
11
11
|
"$hidden:true"
|
|
12
12
|
]).singleEntry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/models/WebhookSettingsModel.js","sources":["../../../src/api/models/WebhookSettingsModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport {\n WEBHOOK_SETTINGS_MODEL_ID,\n WEBHOOK_DELIVERY_MAX_RETENTION_DAYS\n} from \"~/api/domain/constants.js\";\n\nclass WebhookSettingsModelFactory implements ModelFactory.Interface {\n async execute(builder: ModelFactory.Builder) {\n const model = builder\n .
|
|
1
|
+
{"version":3,"file":"api/models/WebhookSettingsModel.js","sources":["../../../src/api/models/WebhookSettingsModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\nimport {\n WEBHOOK_SETTINGS_MODEL_ID,\n WEBHOOK_DELIVERY_MAX_RETENTION_DAYS\n} from \"~/api/domain/constants.js\";\n\nclass WebhookSettingsModelFactory implements ModelFactory.Interface {\n async execute(builder: ModelFactory.Builder) {\n const model = builder\n .private({\n modelId: WEBHOOK_SETTINGS_MODEL_ID,\n name: \"Webhook Settings\",\n lifecycleEvents: false\n })\n .tags([\"$publishing:false\", \"$hidden:true\"])\n .singleEntry();\n\n model.fields(fields => ({\n signingSecret: fields\n .text()\n .label(\"Signing Secret\")\n .encrypt()\n .description(\"Global signing secret used for all webhook deliveries.\"),\n deliveryRetentionDays: fields\n .number()\n .label(\"Delivery Retention (days)\")\n .gte(0, \"Must be 0 or greater.\")\n .lte(\n WEBHOOK_DELIVERY_MAX_RETENTION_DAYS,\n `Must be at most ${WEBHOOK_DELIVERY_MAX_RETENTION_DAYS}.`\n )\n .description(\n `How long to keep delivery logs. 0 = delete immediately. Max ${WEBHOOK_DELIVERY_MAX_RETENTION_DAYS} days.`\n )\n }));\n\n return [model];\n }\n}\n\nexport const WebhookSettingsModel = ModelFactory.createImplementation({\n implementation: WebhookSettingsModelFactory,\n dependencies: []\n});\n"],"names":["WebhookSettingsModelFactory","builder","model","WEBHOOK_SETTINGS_MODEL_ID","fields","WEBHOOK_DELIVERY_MAX_RETENTION_DAYS","WebhookSettingsModel","ModelFactory"],"mappings":";;AAMA,MAAMA;IACF,MAAM,QAAQC,OAA6B,EAAE;QACzC,MAAMC,QAAQD,QACT,OAAO,CAAC;YACL,SAASE;YACT,MAAM;YACN,iBAAiB;QACrB,GACC,IAAI,CAAC;YAAC;YAAqB;SAAe,EAC1C,WAAW;QAEhBD,MAAM,MAAM,CAACE,CAAAA,SAAW;gBACpB,eAAeA,OACV,IAAI,GACJ,KAAK,CAAC,kBACN,OAAO,GACP,WAAW,CAAC;gBACjB,uBAAuBA,OAClB,MAAM,GACN,KAAK,CAAC,6BACN,GAAG,CAAC,GAAG,yBACP,GAAG,CACAC,qCACA,CAAC,gBAAgB,EAAEA,oCAAoC,CAAC,CAAC,EAE5D,WAAW,CACR,CAAC,4DAA4D,EAAEA,oCAAoC,MAAM,CAAC;YAEtH;QAEA,OAAO;YAACH;SAAM;IAClB;AACJ;AAEO,MAAMI,uBAAuBC,aAAa,oBAAoB,CAAC;IAClE,gBAAgBP;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -2,7 +2,7 @@ const isValidEndpointUrl = (url)=>{
|
|
|
2
2
|
try {
|
|
3
3
|
const parsed = new URL(url);
|
|
4
4
|
if ("https:" === parsed.protocol) return true;
|
|
5
|
-
if ("http:" === parsed.protocol && ("localhost" === parsed.hostname || "127.0.0.1" === parsed.hostname)) return true;
|
|
5
|
+
else if ("http:" === parsed.protocol && ("localhost" === parsed.hostname || "127.0.0.1" === parsed.hostname)) return true;
|
|
6
6
|
return false;
|
|
7
7
|
} catch {
|
|
8
8
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/utils/isValidEndpointUrl.js","sources":["../../../src/api/utils/isValidEndpointUrl.ts"],"sourcesContent":["export const isValidEndpointUrl = (url: string): boolean => {\n try {\n const parsed = new URL(url);\n if (parsed.protocol === \"https:\") {\n return true;\n } else if (\n parsed.protocol === \"http:\" &&\n (parsed.hostname === \"localhost\" || parsed.hostname === \"127.0.0.1\")\n ) {\n return true;\n }\n return false;\n } catch {\n return false;\n }\n};\n"],"names":["isValidEndpointUrl","url","parsed","URL"],"mappings":"AAAO,MAAMA,qBAAqB,CAACC;IAC/B,IAAI;QACA,MAAMC,SAAS,IAAIC,IAAIF;QACvB,IAAIC,AAAoB,aAApBA,OAAO,QAAQ,EACf,OAAO;
|
|
1
|
+
{"version":3,"file":"api/utils/isValidEndpointUrl.js","sources":["../../../src/api/utils/isValidEndpointUrl.ts"],"sourcesContent":["export const isValidEndpointUrl = (url: string): boolean => {\n try {\n const parsed = new URL(url);\n if (parsed.protocol === \"https:\") {\n return true;\n } else if (\n parsed.protocol === \"http:\" &&\n (parsed.hostname === \"localhost\" || parsed.hostname === \"127.0.0.1\")\n ) {\n return true;\n }\n return false;\n } catch {\n return false;\n }\n};\n"],"names":["isValidEndpointUrl","url","parsed","URL"],"mappings":"AAAO,MAAMA,qBAAqB,CAACC;IAC/B,IAAI;QACA,MAAMC,SAAS,IAAIC,IAAIF;QACvB,IAAIC,AAAoB,aAApBA,OAAO,QAAQ,EACf,OAAO;aACJ,IACHA,AAAoB,YAApBA,OAAO,QAAQ,IACdA,CAAAA,AAAoB,gBAApBA,OAAO,QAAQ,IAAoBA,AAAoB,gBAApBA,OAAO,QAAQ,AAAe,GAElE,OAAO;QAEX,OAAO;IACX,EAAE,OAAM;QACJ,OAAO;IACX;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/webhooks",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.9609e4e0c9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -19,35 +19,36 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@webiny/admin-ui": "0.0.0-unstable.
|
|
23
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
24
|
-
"@webiny/api-
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/app
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/
|
|
32
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
22
|
+
"@webiny/admin-ui": "0.0.0-unstable.9609e4e0c9",
|
|
23
|
+
"@webiny/api-core": "0.0.0-unstable.9609e4e0c9",
|
|
24
|
+
"@webiny/api-graphql": "0.0.0-unstable.9609e4e0c9",
|
|
25
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.9609e4e0c9",
|
|
26
|
+
"@webiny/app": "0.0.0-unstable.9609e4e0c9",
|
|
27
|
+
"@webiny/app-admin": "0.0.0-unstable.9609e4e0c9",
|
|
28
|
+
"@webiny/background-tasks": "0.0.0-unstable.9609e4e0c9",
|
|
29
|
+
"@webiny/feature": "0.0.0-unstable.9609e4e0c9",
|
|
30
|
+
"@webiny/icons": "0.0.0-unstable.9609e4e0c9",
|
|
31
|
+
"@webiny/sdk": "0.0.0-unstable.9609e4e0c9",
|
|
32
|
+
"@webiny/utils": "0.0.0-unstable.9609e4e0c9",
|
|
33
|
+
"graphql": "16.14.2",
|
|
33
34
|
"lodash": "4.18.1",
|
|
34
|
-
"mobx": "
|
|
35
|
-
"mobx-react-lite": "
|
|
35
|
+
"mobx": "7.1.3",
|
|
36
|
+
"mobx-react-lite": "5.1.2",
|
|
36
37
|
"react": "18.3.1",
|
|
37
38
|
"react-dom": "18.3.1",
|
|
38
|
-
"standardwebhooks": "1.
|
|
39
|
-
"zod": "4.
|
|
39
|
+
"standardwebhooks": "1.1.1",
|
|
40
|
+
"zod": "4.6.7"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
|
-
"@webiny/api": "0.0.0-unstable.
|
|
43
|
-
"@webiny/
|
|
44
|
-
"@webiny/
|
|
45
|
-
"@webiny/
|
|
46
|
-
"@webiny/handler-
|
|
47
|
-
"@webiny/
|
|
48
|
-
"@webiny/
|
|
49
|
-
"typescript": "
|
|
50
|
-
"vitest": "
|
|
43
|
+
"@webiny/api": "0.0.0-unstable.9609e4e0c9",
|
|
44
|
+
"@webiny/api-core-testing": "0.0.0-unstable.9609e4e0c9",
|
|
45
|
+
"@webiny/build-tools": "0.0.0-unstable.9609e4e0c9",
|
|
46
|
+
"@webiny/di": "2.0.0",
|
|
47
|
+
"@webiny/event-handler-core": "0.0.0-unstable.9609e4e0c9",
|
|
48
|
+
"@webiny/handler": "0.0.0-unstable.9609e4e0c9",
|
|
49
|
+
"@webiny/wcp": "0.0.0-unstable.9609e4e0c9",
|
|
50
|
+
"typescript": "7.0.2",
|
|
51
|
+
"vitest": "5.0.5"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"admin/presentation/WebhookDeliveries/WebhookDeliveriesDataSource.js","sources":["../../../../src/admin/presentation/WebhookDeliveries/WebhookDeliveriesDataSource.ts"],"sourcesContent":["import { makeAutoObservable, runInAction, computed } from \"mobx\";\nimport type {\n IDataSource,\n IDataSourceQuery,\n IDataSourceMeta\n} from \"@webiny/app-admin/presentation/listPresenter/abstractions.js\";\nimport type { WebhookDelivery } from \"~/admin/shared/types.js\";\nimport type {\n IListWebhookDeliveriesUseCase,\n ListWebhookDeliveriesWhere\n} from \"~/admin/features/listWebhookDeliveries/abstractions.js\";\n\nexport class WebhookDeliveriesDataSource implements IDataSource<WebhookDelivery> {\n private _rows: WebhookDelivery[] = [];\n private _meta: IDataSourceMeta = { cursor: null, hasMoreItems: false, totalCount: 0 };\n private _loading = false;\n\n constructor(\n private readonly listDeliveriesUseCase: IListWebhookDeliveriesUseCase,\n private readonly where: ListWebhookDeliveriesWhere\n ) {\n makeAutoObservable<WebhookDeliveriesDataSource, \"listDeliveriesUseCase\">(this, {\n listDeliveriesUseCase: false,\n rows: computed\n });\n }\n\n get rows(): WebhookDelivery[] {\n return this._rows;\n }\n\n get meta(): IDataSourceMeta {\n return this._meta;\n }\n\n get loading(): boolean {\n return this._loading;\n }\n\n async query(params: IDataSourceQuery): Promise<void> {\n this._loading = true;\n const result = await this.listDeliveriesUseCase.execute({\n where: this.where,\n limit: params.limit,\n after: params.cursor\n });\n runInAction(() => {\n this._rows = result.data;\n this._meta = {\n cursor: result.meta.cursor,\n hasMoreItems: result.meta.hasMoreItems,\n totalCount: result.meta.totalCount\n };\n this._loading = false;\n });\n }\n\n async loadMore(params: IDataSourceQuery): Promise<void> {\n if (!this._meta.hasMoreItems || this._loading) {\n return;\n }\n this._loading = true;\n const result = await this.listDeliveriesUseCase.execute({\n where: this.where,\n limit: params.limit,\n after: this._meta.cursor ?? undefined\n });\n runInAction(() => {\n this._rows = [...this._rows, ...result.data];\n this._meta = {\n cursor: result.meta.cursor,\n hasMoreItems: result.meta.hasMoreItems,\n totalCount: result.meta.totalCount\n };\n this._loading = false;\n });\n }\n}\n"],"names":["WebhookDeliveriesDataSource","listDeliveriesUseCase","where","makeAutoObservable","computed","params","result","runInAction","undefined"],"mappings":";AAYO,MAAMA;IAKT,YACqBC,qBAAoD,EACpDC,KAAiC,CACpD;aAFmBD,qBAAqB,GAArBA;aACAC,KAAK,GAALA;aANb,KAAK,GAAsB,EAAE;aAC7B,KAAK,GAAoB;YAAE,QAAQ;YAAM,cAAc;YAAO,YAAY;QAAE;aAC5E,QAAQ,GAAG;QAMfC,mBAAyE,IAAI,EAAE;YAC3E,uBAAuB;YACvB,MAAMC;QACV;IACJ;IAEA,IAAI,OAA0B;QAC1B,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,IAAI,OAAwB;QACxB,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,IAAI,UAAmB;QACnB,OAAO,IAAI,CAAC,QAAQ;IACxB;IAEA,MAAM,MAAMC,MAAwB,EAAiB;QACjD,IAAI,CAAC,QAAQ,GAAG;QAChB,MAAMC,SAAS,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC;YACpD,OAAO,IAAI,CAAC,KAAK;YACjB,OAAOD,OAAO,KAAK;YACnB,OAAOA,OAAO,MAAM;QACxB;QACAE,YAAY;YACR,IAAI,CAAC,KAAK,GAAGD,OAAO,IAAI;YACxB,IAAI,CAAC,KAAK,GAAG;gBACT,QAAQA,OAAO,IAAI,CAAC,MAAM;gBAC1B,cAAcA,OAAO,IAAI,CAAC,YAAY;gBACtC,YAAYA,OAAO,IAAI,CAAC,UAAU;YACtC;YACA,IAAI,CAAC,QAAQ,GAAG;QACpB;IACJ;IAEA,MAAM,SAASD,MAAwB,EAAiB;QACpD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,EACzC;QAEJ,IAAI,CAAC,QAAQ,GAAG;QAChB,MAAMC,SAAS,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC;YACpD,OAAO,IAAI,CAAC,KAAK;YACjB,OAAOD,OAAO,KAAK;YACnB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAIG;QAChC;QACAD,YAAY;YACR,IAAI,CAAC,KAAK,GAAG;mBAAI,IAAI,CAAC,KAAK;mBAAKD,OAAO,IAAI;aAAC;YAC5C,IAAI,CAAC,KAAK,GAAG;gBACT,QAAQA,OAAO,IAAI,CAAC,MAAM;gBAC1B,cAAcA,OAAO,IAAI,CAAC,YAAY;gBACtC,YAAYA,OAAO,IAAI,CAAC,UAAU;YACtC;YACA,IAAI,CAAC,QAAQ,GAAG;QACpB;IACJ;AACJ"}
|