@webiny/webhooks 0.0.0-unstable.b6d7105cee → 0.0.0-unstable.eb81deee7e

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.
Files changed (46) hide show
  1. package/admin/WebhookRoutes.js +20 -4
  2. package/admin/WebhookRoutes.js.map +1 -1
  3. package/admin/features/permissions/feature.d.ts +1 -1
  4. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryBottomInfoBar.d.ts +2 -2
  5. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.d.ts +2 -2
  6. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.js +37 -24
  7. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryFilters.js.map +1 -1
  8. package/admin/presentation/WebhookDeliveriesPage/components/DeliveryList.d.ts +2 -2
  9. package/admin/presentation/WebhookDeliveriesPage/components/WebhookDeliveriesPage.js +3 -3
  10. package/admin/presentation/WebhookDeliveriesPage/components/WebhookDeliveriesPage.js.map +1 -1
  11. package/admin/presentation/WebhookForm/components/SigningSecret.d.ts +2 -2
  12. package/admin/presentation/WebhookList/components/WebhookListContent.d.ts +2 -2
  13. package/api/features/SendWebhookTask/SendWebhookTask.d.ts +10 -5
  14. package/api/features/SendWebhookTask/SendWebhookTask.js +20 -11
  15. package/api/features/SendWebhookTask/SendWebhookTask.js.map +1 -1
  16. package/api/features/UpdateWebhook/UpdateWebhookRepository.js +3 -1
  17. package/api/features/UpdateWebhook/UpdateWebhookRepository.js.map +1 -1
  18. package/api/features/UpdateWebhookDelivery/UpdateWebhookDeliveryRepository.js +3 -1
  19. package/api/features/UpdateWebhookDelivery/UpdateWebhookDeliveryRepository.js.map +1 -1
  20. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js +3 -1
  21. package/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js.map +1 -1
  22. package/api/graphql/WebhookCrudSchema.d.ts +3 -2
  23. package/api/graphql/WebhookCrudSchema.js +6 -2
  24. package/api/graphql/WebhookCrudSchema.js.map +1 -1
  25. package/api/graphql/WebhookDeliverySchema.d.ts +3 -2
  26. package/api/graphql/WebhookDeliverySchema.js +6 -2
  27. package/api/graphql/WebhookDeliverySchema.js.map +1 -1
  28. package/api/graphql/WebhookEventSchema.d.ts +3 -2
  29. package/api/graphql/WebhookEventSchema.js +6 -2
  30. package/api/graphql/WebhookEventSchema.js.map +1 -1
  31. package/api/graphql/WebhookSettingsSchema.d.ts +3 -2
  32. package/api/graphql/WebhookSettingsSchema.js +6 -2
  33. package/api/graphql/WebhookSettingsSchema.js.map +1 -1
  34. package/api/graphql/WebhookTriggerSchema.d.ts +3 -2
  35. package/api/graphql/WebhookTriggerSchema.js +6 -2
  36. package/api/graphql/WebhookTriggerSchema.js.map +1 -1
  37. package/api/index.d.ts +3 -0
  38. package/api/index.js +1 -1
  39. package/api/index.js.map +1 -1
  40. package/api/models/WebhookDeliveryModel.js +2 -1
  41. package/api/models/WebhookDeliveryModel.js.map +1 -1
  42. package/api/models/WebhookModel.js +2 -1
  43. package/api/models/WebhookModel.js.map +1 -1
  44. package/api/models/WebhookSettingsModel.js +2 -1
  45. package/api/models/WebhookSettingsModel.js.map +1 -1
  46. package/package.json +23 -22
@@ -29,12 +29,14 @@ class UpdateWebhookSettingsRepositoryImpl {
29
29
  id: entryId
30
30
  });
31
31
  if (entryResult.isFail()) return Result.fail(WebhookPersistenceError.from(entryResult.error));
32
- const { entry } = await this.updateEntryDataFactory.create(model, {
32
+ const dataResult = await this.updateEntryDataFactory.create(model, {
33
33
  values: {
34
34
  signingSecret: input.signingSecret,
35
35
  deliveryRetentionDays: input.deliveryRetentionDays
36
36
  }
37
37
  }, entryResult.value);
38
+ if (dataResult.isFail()) return Result.fail(WebhookPersistenceError.from(dataResult.error));
39
+ const { entry } = dataResult.value;
38
40
  const updateResult = await this.updateEntryRepository.execute(model, entry);
39
41
  if (updateResult.isFail()) return Result.fail(WebhookPersistenceError.from(updateResult.error));
40
42
  const settings = {
@@ -1 +1 @@
1
- {"version":3,"file":"api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js","sources":["../../../../src/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createCacheKey } from \"@webiny/utils\";\nimport { GetModelRepository } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { GetLatestRevisionByEntryIdRepository } from \"@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js\";\nimport { UpdateEntryRepository } from \"@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js\";\nimport { UpdateEntryDataFactory } from \"@webiny/api-headless-cms/exports/api/cms/entry.js\";\nimport { GetWebhookSettingsRepository } from \"~/api/features/GetWebhookSettings/abstractions.js\";\nimport {\n UpdateWebhookSettingsRepository as RepositoryAbstraction,\n type IUpdateWebhookSettingsInput\n} from \"./abstractions.js\";\nimport { WebhookModelNotFoundError, WebhookPersistenceError } from \"~/api/domain/errors.js\";\nimport { WEBHOOK_SETTINGS_MODEL_ID } from \"~/api/domain/constants.js\";\nimport type { IWebhookSettings } from \"~/api/domain/WebhookSettings.js\";\n\ninterface WebhookSettingsValues {\n signingSecret?: string;\n deliveryRetentionDays?: number;\n}\n\nclass UpdateWebhookSettingsRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private readonly getModelRepository: GetModelRepository.Interface,\n private readonly getWebhookSettingsRepository: GetWebhookSettingsRepository.Interface,\n private readonly getLatestRevisionRepository: GetLatestRevisionByEntryIdRepository.Interface,\n private readonly updateEntryRepository: UpdateEntryRepository.Interface,\n private readonly updateEntryDataFactory: UpdateEntryDataFactory.Interface\n ) {}\n\n async execute(\n input: IUpdateWebhookSettingsInput\n ): Promise<Result<IWebhookSettings, RepositoryAbstraction.Error>> {\n try {\n /* Ensure the singleton entry exists (creates if missing). */\n const getResult = await this.getWebhookSettingsRepository.execute();\n if (getResult.isFail()) {\n return getResult;\n }\n\n const modelResult = await this.getModelRepository.execute(WEBHOOK_SETTINGS_MODEL_ID);\n if (modelResult.isFail()) {\n return Result.fail(new WebhookModelNotFoundError(WEBHOOK_SETTINGS_MODEL_ID));\n }\n\n const model = modelResult.value;\n const singletonId = createCacheKey(model.modelId);\n const entryId = `${singletonId}#0001`;\n\n const entryResult =\n await this.getLatestRevisionRepository.execute<WebhookSettingsValues>(model, {\n id: entryId\n });\n\n if (entryResult.isFail()) {\n return Result.fail(WebhookPersistenceError.from(entryResult.error));\n }\n\n const { entry } = await this.updateEntryDataFactory.create<WebhookSettingsValues>(\n model,\n {\n values: {\n signingSecret: input.signingSecret,\n deliveryRetentionDays: input.deliveryRetentionDays\n }\n },\n entryResult.value\n );\n\n const updateResult = await this.updateEntryRepository.execute(model, entry);\n if (updateResult.isFail()) {\n return Result.fail(WebhookPersistenceError.from(updateResult.error));\n }\n\n const settings: IWebhookSettings = {\n signingSecret: entry.values.signingSecret,\n deliveryRetentionDays: entry.values.deliveryRetentionDays\n };\n\n return Result.ok(settings);\n } catch (error) {\n return Result.fail(WebhookPersistenceError.from(error));\n }\n }\n}\n\nexport const UpdateWebhookSettingsRepository = RepositoryAbstraction.createImplementation({\n implementation: UpdateWebhookSettingsRepositoryImpl,\n dependencies: [\n GetModelRepository,\n GetWebhookSettingsRepository,\n GetLatestRevisionByEntryIdRepository,\n UpdateEntryRepository,\n UpdateEntryDataFactory\n ]\n});\n"],"names":["UpdateWebhookSettingsRepositoryImpl","getModelRepository","getWebhookSettingsRepository","getLatestRevisionRepository","updateEntryRepository","updateEntryDataFactory","input","getResult","modelResult","WEBHOOK_SETTINGS_MODEL_ID","Result","WebhookModelNotFoundError","model","singletonId","createCacheKey","entryId","entryResult","WebhookPersistenceError","entry","updateResult","settings","error","UpdateWebhookSettingsRepository","RepositoryAbstraction","GetModelRepository","GetWebhookSettingsRepository","GetLatestRevisionByEntryIdRepository","UpdateEntryRepository","UpdateEntryDataFactory"],"mappings":";;;;;;;;;;AAoBA,MAAMA;IACF,YACqBC,kBAAgD,EAChDC,4BAAoE,EACpEC,2BAA2E,EAC3EC,qBAAsD,EACtDC,sBAAwD,CAC3E;aALmBJ,kBAAkB,GAAlBA;aACAC,4BAA4B,GAA5BA;aACAC,2BAA2B,GAA3BA;aACAC,qBAAqB,GAArBA;aACAC,sBAAsB,GAAtBA;IAClB;IAEH,MAAM,QACFC,KAAkC,EAC4B;QAC9D,IAAI;YAEA,MAAMC,YAAY,MAAM,IAAI,CAAC,4BAA4B,CAAC,OAAO;YACjE,IAAIA,UAAU,MAAM,IAChB,OAAOA;YAGX,MAAMC,cAAc,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAACC;YAC1D,IAAID,YAAY,MAAM,IAClB,OAAOE,OAAO,IAAI,CAAC,IAAIC,0BAA0BF;YAGrD,MAAMG,QAAQJ,YAAY,KAAK;YAC/B,MAAMK,cAAcC,eAAeF,MAAM,OAAO;YAChD,MAAMG,UAAU,GAAGF,YAAY,KAAK,CAAC;YAErC,MAAMG,cACF,MAAM,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAwBJ,OAAO;gBACzE,IAAIG;YACR;YAEJ,IAAIC,YAAY,MAAM,IAClB,OAAON,OAAO,IAAI,CAACO,wBAAwB,IAAI,CAACD,YAAY,KAAK;YAGrE,MAAM,EAAEE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,MAAM,CACtDN,OACA;gBACI,QAAQ;oBACJ,eAAeN,MAAM,aAAa;oBAClC,uBAAuBA,MAAM,qBAAqB;gBACtD;YACJ,GACAU,YAAY,KAAK;YAGrB,MAAMG,eAAe,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAACP,OAAOM;YACrE,IAAIC,aAAa,MAAM,IACnB,OAAOT,OAAO,IAAI,CAACO,wBAAwB,IAAI,CAACE,aAAa,KAAK;YAGtE,MAAMC,WAA6B;gBAC/B,eAAeF,MAAM,MAAM,CAAC,aAAa;gBACzC,uBAAuBA,MAAM,MAAM,CAAC,qBAAqB;YAC7D;YAEA,OAAOR,OAAO,EAAE,CAACU;QACrB,EAAE,OAAOC,OAAO;YACZ,OAAOX,OAAO,IAAI,CAACO,wBAAwB,IAAI,CAACI;QACpD;IACJ;AACJ;AAEO,MAAMC,kEAAkCC,gCAAAA,oBAA0C,CAAC;IACtF,gBAAgBvB;IAChB,cAAc;QACVwB;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
1
+ {"version":3,"file":"api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.js","sources":["../../../../src/api/features/UpdateWebhookSettings/UpdateWebhookSettingsRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { createCacheKey } from \"@webiny/utils\";\nimport { GetModelRepository } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { GetLatestRevisionByEntryIdRepository } from \"@webiny/api-headless-cms/features/contentEntry/GetLatestRevisionByEntryId/index.js\";\nimport { UpdateEntryRepository } from \"@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js\";\nimport { UpdateEntryDataFactory } from \"@webiny/api-headless-cms/exports/api/cms/entry.js\";\nimport { GetWebhookSettingsRepository } from \"~/api/features/GetWebhookSettings/abstractions.js\";\nimport {\n UpdateWebhookSettingsRepository as RepositoryAbstraction,\n type IUpdateWebhookSettingsInput\n} from \"./abstractions.js\";\nimport { WebhookModelNotFoundError, WebhookPersistenceError } from \"~/api/domain/errors.js\";\nimport { WEBHOOK_SETTINGS_MODEL_ID } from \"~/api/domain/constants.js\";\nimport type { IWebhookSettings } from \"~/api/domain/WebhookSettings.js\";\n\ninterface WebhookSettingsValues {\n signingSecret?: string;\n deliveryRetentionDays?: number;\n}\n\nclass UpdateWebhookSettingsRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private readonly getModelRepository: GetModelRepository.Interface,\n private readonly getWebhookSettingsRepository: GetWebhookSettingsRepository.Interface,\n private readonly getLatestRevisionRepository: GetLatestRevisionByEntryIdRepository.Interface,\n private readonly updateEntryRepository: UpdateEntryRepository.Interface,\n private readonly updateEntryDataFactory: UpdateEntryDataFactory.Interface\n ) {}\n\n async execute(\n input: IUpdateWebhookSettingsInput\n ): Promise<Result<IWebhookSettings, RepositoryAbstraction.Error>> {\n try {\n /* Ensure the singleton entry exists (creates if missing). */\n const getResult = await this.getWebhookSettingsRepository.execute();\n if (getResult.isFail()) {\n return getResult;\n }\n\n const modelResult = await this.getModelRepository.execute(WEBHOOK_SETTINGS_MODEL_ID);\n if (modelResult.isFail()) {\n return Result.fail(new WebhookModelNotFoundError(WEBHOOK_SETTINGS_MODEL_ID));\n }\n\n const model = modelResult.value;\n const singletonId = createCacheKey(model.modelId);\n const entryId = `${singletonId}#0001`;\n\n const entryResult =\n await this.getLatestRevisionRepository.execute<WebhookSettingsValues>(model, {\n id: entryId\n });\n\n if (entryResult.isFail()) {\n return Result.fail(WebhookPersistenceError.from(entryResult.error));\n }\n\n const dataResult = await this.updateEntryDataFactory.create<WebhookSettingsValues>(\n model,\n {\n values: {\n signingSecret: input.signingSecret,\n deliveryRetentionDays: input.deliveryRetentionDays\n }\n },\n entryResult.value\n );\n if (dataResult.isFail()) {\n return Result.fail(WebhookPersistenceError.from(dataResult.error));\n }\n const { entry } = dataResult.value;\n\n const updateResult = await this.updateEntryRepository.execute(model, entry);\n if (updateResult.isFail()) {\n return Result.fail(WebhookPersistenceError.from(updateResult.error));\n }\n\n const settings: IWebhookSettings = {\n signingSecret: entry.values.signingSecret,\n deliveryRetentionDays: entry.values.deliveryRetentionDays\n };\n\n return Result.ok(settings);\n } catch (error) {\n return Result.fail(WebhookPersistenceError.from(error));\n }\n }\n}\n\nexport const UpdateWebhookSettingsRepository = RepositoryAbstraction.createImplementation({\n implementation: UpdateWebhookSettingsRepositoryImpl,\n dependencies: [\n GetModelRepository,\n GetWebhookSettingsRepository,\n GetLatestRevisionByEntryIdRepository,\n UpdateEntryRepository,\n UpdateEntryDataFactory\n ]\n});\n"],"names":["UpdateWebhookSettingsRepositoryImpl","getModelRepository","getWebhookSettingsRepository","getLatestRevisionRepository","updateEntryRepository","updateEntryDataFactory","input","getResult","modelResult","WEBHOOK_SETTINGS_MODEL_ID","Result","WebhookModelNotFoundError","model","singletonId","createCacheKey","entryId","entryResult","WebhookPersistenceError","dataResult","entry","updateResult","settings","error","UpdateWebhookSettingsRepository","RepositoryAbstraction","GetModelRepository","GetWebhookSettingsRepository","GetLatestRevisionByEntryIdRepository","UpdateEntryRepository","UpdateEntryDataFactory"],"mappings":";;;;;;;;;;AAoBA,MAAMA;IACF,YACqBC,kBAAgD,EAChDC,4BAAoE,EACpEC,2BAA2E,EAC3EC,qBAAsD,EACtDC,sBAAwD,CAC3E;aALmBJ,kBAAkB,GAAlBA;aACAC,4BAA4B,GAA5BA;aACAC,2BAA2B,GAA3BA;aACAC,qBAAqB,GAArBA;aACAC,sBAAsB,GAAtBA;IAClB;IAEH,MAAM,QACFC,KAAkC,EAC4B;QAC9D,IAAI;YAEA,MAAMC,YAAY,MAAM,IAAI,CAAC,4BAA4B,CAAC,OAAO;YACjE,IAAIA,UAAU,MAAM,IAChB,OAAOA;YAGX,MAAMC,cAAc,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAACC;YAC1D,IAAID,YAAY,MAAM,IAClB,OAAOE,OAAO,IAAI,CAAC,IAAIC,0BAA0BF;YAGrD,MAAMG,QAAQJ,YAAY,KAAK;YAC/B,MAAMK,cAAcC,eAAeF,MAAM,OAAO;YAChD,MAAMG,UAAU,GAAGF,YAAY,KAAK,CAAC;YAErC,MAAMG,cACF,MAAM,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAwBJ,OAAO;gBACzE,IAAIG;YACR;YAEJ,IAAIC,YAAY,MAAM,IAClB,OAAON,OAAO,IAAI,CAACO,wBAAwB,IAAI,CAACD,YAAY,KAAK;YAGrE,MAAME,aAAa,MAAM,IAAI,CAAC,sBAAsB,CAAC,MAAM,CACvDN,OACA;gBACI,QAAQ;oBACJ,eAAeN,MAAM,aAAa;oBAClC,uBAAuBA,MAAM,qBAAqB;gBACtD;YACJ,GACAU,YAAY,KAAK;YAErB,IAAIE,WAAW,MAAM,IACjB,OAAOR,OAAO,IAAI,CAACO,wBAAwB,IAAI,CAACC,WAAW,KAAK;YAEpE,MAAM,EAAEC,KAAK,EAAE,GAAGD,WAAW,KAAK;YAElC,MAAME,eAAe,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAACR,OAAOO;YACrE,IAAIC,aAAa,MAAM,IACnB,OAAOV,OAAO,IAAI,CAACO,wBAAwB,IAAI,CAACG,aAAa,KAAK;YAGtE,MAAMC,WAA6B;gBAC/B,eAAeF,MAAM,MAAM,CAAC,aAAa;gBACzC,uBAAuBA,MAAM,MAAM,CAAC,qBAAqB;YAC7D;YAEA,OAAOT,OAAO,EAAE,CAACW;QACrB,EAAE,OAAOC,OAAO;YACZ,OAAOZ,OAAO,IAAI,CAACO,wBAAwB,IAAI,CAACK;QACpD;IACJ;AACJ;AAEO,MAAMC,kEAAkCC,gCAAAA,oBAA0C,CAAC;IACtF,gBAAgBxB;IAChB,cAAc;QACVyB;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -1,8 +1,9 @@
1
- import { GraphQLSchemaFactory } from "@webiny/handler-graphql/graphql/abstractions.js";
1
+ import { GraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
2
2
  declare class WebhookCrudSchema_ implements GraphQLSchemaFactory.Interface {
3
+ getSchemaKey: () => string;
3
4
  execute(builder: GraphQLSchemaFactory.SchemaBuilder): Promise<GraphQLSchemaFactory.SchemaBuilder>;
4
5
  }
5
6
  export declare const WebhookCrudSchema: typeof WebhookCrudSchema_ & {
6
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
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/handler-graphql/graphql/abstractions.js";
2
- import { ErrorResponse, ListErrorResponse, ListResponse, Response } from "@webiny/handler-graphql";
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";
@@ -167,6 +168,9 @@ class WebhookCrudSchema_ {
167
168
  });
168
169
  return builder;
169
170
  }
171
+ constructor(){
172
+ this.getSchemaKey = staticSchemaKey("webhooks/WebhookCrudSchema_");
173
+ }
170
174
  }
171
175
  const WebhookCrudSchema = GraphQLSchemaFactory.createImplementation({
172
176
  implementation: WebhookCrudSchema_,
@@ -1 +1 @@
1
- {"version":3,"file":"api/graphql/WebhookCrudSchema.js","sources":["../../../src/api/graphql/WebhookCrudSchema.ts"],"sourcesContent":["import { GraphQLSchemaFactory } from \"@webiny/handler-graphql/graphql/abstractions.js\";\nimport { Response } from \"@webiny/handler-graphql\";\nimport { ErrorResponse } from \"@webiny/handler-graphql\";\nimport { ListResponse } from \"@webiny/handler-graphql\";\nimport { ListErrorResponse } from \"@webiny/handler-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 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","WebhookCrudSchema","GraphQLSchemaFactory"],"mappings":";;;;;;;AAyBA,MAAMA;IACF,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;AACJ;AAEO,MAAMiB,oBAAoBC,qBAAqB,oBAAoB,CAAC;IACvE,gBAAgBnB;IAChB,cAAc,EAAE;AACpB"}
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/handler-graphql/graphql/abstractions.js";
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/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
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/handler-graphql/graphql/abstractions.js";
2
- import { ErrorResponse, ListErrorResponse, ListResponse, Response } from "@webiny/handler-graphql";
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/handler-graphql/graphql/abstractions.js\";\nimport { Response } from \"@webiny/handler-graphql\";\nimport { ErrorResponse } from \"@webiny/handler-graphql\";\nimport { ListResponse } from \"@webiny/handler-graphql\";\nimport { ListErrorResponse } from \"@webiny/handler-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 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","WebhookDeliverySchema","GraphQLSchemaFactory"],"mappings":";;;;;AAuBA,MAAMA;IACF,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;AACJ;AAEO,MAAMa,wBAAwBC,qBAAqB,oBAAoB,CAAC;IAC3E,gBAAgBf;IAChB,cAAc,EAAE;AACpB"}
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/handler-graphql/graphql/abstractions.js";
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/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
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/handler-graphql/graphql/abstractions.js";
2
- import { ErrorResponse, Response } from "@webiny/handler-graphql";
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/handler-graphql/graphql/abstractions.js\";\nimport { Response } from \"@webiny/handler-graphql\";\nimport { ErrorResponse } from \"@webiny/handler-graphql\";\nimport { ListAvailableWebhookEventsUseCase } from \"~/api/features/ListAvailableWebhookEvents/abstractions.js\";\n\nclass WebhookEventSchema_ implements GraphQLSchemaFactory.Interface {\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","WebhookEventSchema","GraphQLSchemaFactory"],"mappings":";;;AAKA,MAAMA;IACF,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;AACJ;AAEO,MAAMM,qBAAqBC,qBAAqB,oBAAoB,CAAC;IACxE,gBAAgBR;IAChB,cAAc,EAAE;AACpB"}
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/handler-graphql/graphql/abstractions.js";
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/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
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/handler-graphql/graphql/abstractions.js";
2
- import { ErrorResponse, Response } from "@webiny/handler-graphql";
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/handler-graphql/graphql/abstractions.js\";\nimport { Response } from \"@webiny/handler-graphql\";\nimport { ErrorResponse } from \"@webiny/handler-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 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","WebhookSettingsSchema","GraphQLSchemaFactory"],"mappings":";;;;AAWA,MAAMA;IACF,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;AACJ;AAEO,MAAMS,wBAAwBC,qBAAqB,oBAAoB,CAAC;IAC3E,gBAAgBX;IAChB,cAAc,EAAE;AACpB"}
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/handler-graphql/graphql/abstractions.js";
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/handler-graphql/graphql/abstractions.public").IGraphQLSchemaFactory>;
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/handler-graphql/graphql/abstractions.js";
2
- import { ErrorResponse, Response } from "@webiny/handler-graphql";
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/handler-graphql/graphql/abstractions.js\";\nimport { Response } from \"@webiny/handler-graphql\";\nimport { ErrorResponse } from \"@webiny/handler-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 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","WebhookTriggerSchema","GraphQLSchemaFactory"],"mappings":";;;AAUA,MAAMA;IACF,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;AACJ;AAEO,MAAMO,uBAAuBC,qBAAqB,oBAAoB,CAAC;IAC1E,gBAAgBT;IAChB,cAAc,EAAE;AACpB"}
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
@@ -1 +1,4 @@
1
+ import { WebhooksFeature } from "./WebhooksFeature.js";
2
+ export { WebhooksFeature };
3
+ /** @deprecated use WebhooksFeature instead */
1
4
  export declare const createWebhooks: () => import("@webiny/handler").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>;
package/api/index.js CHANGED
@@ -7,6 +7,6 @@ const createWebhooks = ()=>{
7
7
  plugin.name = "webhooks.extension";
8
8
  return plugin;
9
9
  };
10
- export { createWebhooks };
10
+ export { WebhooksFeature, createWebhooks };
11
11
 
12
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 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":";;AAGO,MAAMA,iBAAiB;IAC1B,MAAMC,SAASC,8BAA8B,OAAMC;QAC/CC,gBAAgB,QAAQ,CAACD,QAAQ,SAAS;IAC9C;IAEAF,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
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"}
@@ -4,7 +4,8 @@ class WebhookDeliveryModelFactory {
4
4
  async execute(builder) {
5
5
  const model = builder.private({
6
6
  modelId: WEBHOOK_DELIVERY_MODEL_ID,
7
- name: "Webhook Delivery"
7
+ name: "Webhook Delivery",
8
+ lifecycleEvents: false
8
9
  }).tags([
9
10
  "$publishing:false",
10
11
  "$hidden:true"
@@ -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 .private({\n modelId: WEBHOOK_DELIVERY_MODEL_ID,\n name: \"Webhook Delivery\"\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;QACV,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
+ {"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"}
@@ -4,7 +4,8 @@ class WebhookModelFactory {
4
4
  async execute(builder) {
5
5
  const model = builder.private({
6
6
  modelId: WEBHOOK_MODEL_ID,
7
- name: "Webhook"
7
+ name: "Webhook",
8
+ lifecycleEvents: false
8
9
  }).tags([
9
10
  "$publishing:false",
10
11
  "$hidden:true"
@@ -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 .private({ modelId: WEBHOOK_MODEL_ID, name: \"Webhook\" })\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;QAAU,GACrD,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
+ {"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"}
@@ -4,7 +4,8 @@ class WebhookSettingsModelFactory {
4
4
  async execute(builder) {
5
5
  const model = builder.private({
6
6
  modelId: WEBHOOK_SETTINGS_MODEL_ID,
7
- name: "Webhook Settings"
7
+ name: "Webhook Settings",
8
+ lifecycleEvents: false
8
9
  }).tags([
9
10
  "$publishing:false",
10
11
  "$hidden:true"
@@ -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 .private({\n modelId: WEBHOOK_SETTINGS_MODEL_ID,\n name: \"Webhook Settings\"\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;QACV,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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/webhooks",
3
- "version": "0.0.0-unstable.b6d7105cee",
3
+ "version": "0.0.0-unstable.eb81deee7e",
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.b6d7105cee",
23
- "@webiny/api-core": "0.0.0-unstable.b6d7105cee",
24
- "@webiny/api-headless-cms": "0.0.0-unstable.b6d7105cee",
25
- "@webiny/app": "0.0.0-unstable.b6d7105cee",
26
- "@webiny/app-admin": "0.0.0-unstable.b6d7105cee",
27
- "@webiny/background-tasks": "0.0.0-unstable.b6d7105cee",
28
- "@webiny/feature": "0.0.0-unstable.b6d7105cee",
29
- "@webiny/handler-graphql": "0.0.0-unstable.b6d7105cee",
30
- "@webiny/icons": "0.0.0-unstable.b6d7105cee",
31
- "@webiny/sdk": "0.0.0-unstable.b6d7105cee",
32
- "@webiny/utils": "0.0.0-unstable.b6d7105cee",
22
+ "@webiny/admin-ui": "0.0.0-unstable.eb81deee7e",
23
+ "@webiny/api-core": "0.0.0-unstable.eb81deee7e",
24
+ "@webiny/api-graphql": "0.0.0-unstable.eb81deee7e",
25
+ "@webiny/api-headless-cms": "0.0.0-unstable.eb81deee7e",
26
+ "@webiny/app": "0.0.0-unstable.eb81deee7e",
27
+ "@webiny/app-admin": "0.0.0-unstable.eb81deee7e",
28
+ "@webiny/background-tasks": "0.0.0-unstable.eb81deee7e",
29
+ "@webiny/feature": "0.0.0-unstable.eb81deee7e",
30
+ "@webiny/icons": "0.0.0-unstable.eb81deee7e",
31
+ "@webiny/sdk": "0.0.0-unstable.eb81deee7e",
32
+ "@webiny/utils": "0.0.0-unstable.eb81deee7e",
33
+ "graphql": "16.14.2",
33
34
  "lodash": "4.18.1",
34
- "mobx": "6.16.1",
35
- "mobx-react-lite": "4.1.1",
35
+ "mobx": "7.0.3",
36
+ "mobx-react-lite": "5.0.3",
36
37
  "react": "18.3.1",
37
38
  "react-dom": "18.3.1",
38
39
  "standardwebhooks": "1.0.0",
39
40
  "zod": "4.4.3"
40
41
  },
41
42
  "devDependencies": {
42
- "@webiny/api": "0.0.0-unstable.b6d7105cee",
43
- "@webiny/build-tools": "0.0.0-unstable.b6d7105cee",
44
- "@webiny/di": "1.0.2",
45
- "@webiny/handler": "0.0.0-unstable.b6d7105cee",
46
- "@webiny/handler-aws": "0.0.0-unstable.b6d7105cee",
47
- "@webiny/plugins": "0.0.0-unstable.b6d7105cee",
48
- "@webiny/project-utils": "0.0.0-unstable.b6d7105cee",
43
+ "@webiny/api": "0.0.0-unstable.eb81deee7e",
44
+ "@webiny/api-core-testing": "0.0.0-unstable.eb81deee7e",
45
+ "@webiny/build-tools": "0.0.0-unstable.eb81deee7e",
46
+ "@webiny/di": "1.1.0",
47
+ "@webiny/event-handler-core": "0.0.0-unstable.eb81deee7e",
48
+ "@webiny/handler": "0.0.0-unstable.eb81deee7e",
49
+ "@webiny/wcp": "0.0.0-unstable.eb81deee7e",
49
50
  "typescript": "7.0.2",
50
- "vitest": "4.1.10"
51
+ "vitest": "4.1.11"
51
52
  },
52
53
  "publishConfig": {
53
54
  "access": "public"