@webiny/api-core 6.6.0-alpha.11 → 6.6.0-alpha.12

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 (134) hide show
  1. package/ApiCoreFeature.js +2 -1
  2. package/ApiCoreFeature.js.map +1 -1
  3. package/features/ai/AiSdkTools.d.ts +1 -1
  4. package/features/ai/AiSdkTools.js +3 -2
  5. package/features/ai/AiSdkTools.js.map +1 -1
  6. package/features/ai/abstractions.d.ts +9 -1
  7. package/features/ai/abstractions.js.map +1 -1
  8. package/features/ai/index.d.ts +1 -0
  9. package/features/ai/index.js +1 -0
  10. package/features/ai/isReadOnlyTool.d.ts +9 -0
  11. package/features/ai/isReadOnlyTool.js +4 -0
  12. package/features/ai/isReadOnlyTool.js.map +1 -0
  13. package/features/security/CanAccessCurrentTenant/CanAccessCurrentTenantUseCase.d.ts +13 -0
  14. package/features/security/CanAccessCurrentTenant/CanAccessCurrentTenantUseCase.js +25 -0
  15. package/features/security/CanAccessCurrentTenant/CanAccessCurrentTenantUseCase.js.map +1 -0
  16. package/features/security/CanAccessCurrentTenant/abstractions.d.ts +12 -0
  17. package/features/security/CanAccessCurrentTenant/abstractions.js +5 -0
  18. package/features/security/CanAccessCurrentTenant/abstractions.js.map +1 -0
  19. package/features/security/CanAccessCurrentTenant/feature.d.ts +4 -0
  20. package/features/security/CanAccessCurrentTenant/feature.js +11 -0
  21. package/features/security/CanAccessCurrentTenant/feature.js.map +1 -0
  22. package/features/security/CanAccessCurrentTenant/index.d.ts +2 -0
  23. package/features/security/CanAccessCurrentTenant/index.js +2 -0
  24. package/features/security/SecurityFeature.js +4 -0
  25. package/features/security/SecurityFeature.js.map +1 -1
  26. package/features/security/ai/CreateRoleTool.d.ts +54 -0
  27. package/features/security/ai/CreateRoleTool.js +71 -0
  28. package/features/security/ai/CreateRoleTool.js.map +1 -0
  29. package/features/security/ai/CreateTeamTool.d.ts +49 -0
  30. package/features/security/ai/CreateTeamTool.js +56 -0
  31. package/features/security/ai/CreateTeamTool.js.map +1 -0
  32. package/features/security/ai/DeleteRoleTool.d.ts +52 -0
  33. package/features/security/ai/DeleteRoleTool.js +79 -0
  34. package/features/security/ai/DeleteRoleTool.js.map +1 -0
  35. package/features/security/ai/DeleteTeamTool.d.ts +47 -0
  36. package/features/security/ai/DeleteTeamTool.js +56 -0
  37. package/features/security/ai/DeleteTeamTool.js.map +1 -0
  38. package/features/security/ai/ListRolesTool.d.ts +40 -0
  39. package/features/security/ai/ListRolesTool.js +48 -0
  40. package/features/security/ai/ListRolesTool.js.map +1 -0
  41. package/features/security/ai/ListTeamsTool.d.ts +42 -0
  42. package/features/security/ai/ListTeamsTool.js +49 -0
  43. package/features/security/ai/ListTeamsTool.js.map +1 -0
  44. package/features/security/ai/UpdateRoleTool.d.ts +46 -0
  45. package/features/security/ai/UpdateRoleTool.js +53 -0
  46. package/features/security/ai/UpdateRoleTool.js.map +1 -0
  47. package/features/security/ai/UpdateTeamTool.d.ts +53 -0
  48. package/features/security/ai/UpdateTeamTool.js +56 -0
  49. package/features/security/ai/UpdateTeamTool.js.map +1 -0
  50. package/features/security/ai/feature.d.ts +10 -0
  51. package/features/security/ai/feature.js +25 -0
  52. package/features/security/ai/feature.js.map +1 -0
  53. package/features/security/ai/index.d.ts +9 -0
  54. package/features/security/ai/index.js +9 -0
  55. package/features/security/apiKeys/ApiKeyAuthorizer.js +1 -1
  56. package/features/security/apiKeys/ApiKeyAuthorizer.js.map +1 -1
  57. package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.d.ts +3 -3
  58. package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js +7 -5
  59. package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js.map +1 -1
  60. package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.d.ts +3 -3
  61. package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js +7 -5
  62. package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js.map +1 -1
  63. package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.d.ts +3 -3
  64. package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js +7 -5
  65. package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js.map +1 -1
  66. package/features/security/roles/NotifyRoleChange/feature.js +0 -2
  67. package/features/security/roles/NotifyRoleChange/feature.js.map +1 -1
  68. package/features/security/roles/NotifyRoleChange/index.d.ts +1 -1
  69. package/features/security/roles/NotifyRoleChange/index.js +1 -1
  70. package/features/security/roles/NotifyRoleChange/recordType.d.ts +5 -0
  71. package/features/security/roles/NotifyRoleChange/recordType.js +4 -0
  72. package/features/security/roles/NotifyRoleChange/recordType.js.map +1 -0
  73. package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.d.ts +7 -7
  74. package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js +17 -13
  75. package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js.map +1 -1
  76. package/features/security/teams/NotifyTeamChange/feature.js +0 -2
  77. package/features/security/teams/NotifyTeamChange/feature.js.map +1 -1
  78. package/features/security/teams/NotifyTeamChange/index.d.ts +1 -1
  79. package/features/security/teams/NotifyTeamChange/index.js +1 -1
  80. package/features/security/teams/NotifyTeamChange/recordType.d.ts +5 -0
  81. package/features/security/teams/NotifyTeamChange/recordType.js +4 -0
  82. package/features/security/teams/NotifyTeamChange/recordType.js.map +1 -0
  83. package/features/users/AdminUsersFeature.js +4 -0
  84. package/features/users/AdminUsersFeature.js.map +1 -1
  85. package/features/users/CreateUser/CreateUserUseCase.js +1 -1
  86. package/features/users/CreateUser/CreateUserUseCase.js.map +1 -1
  87. package/features/users/NotifyUserChange/NotifyOnUserChangeHandlers.d.ts +29 -0
  88. package/features/users/NotifyUserChange/NotifyOnUserChangeHandlers.js +62 -0
  89. package/features/users/NotifyUserChange/NotifyOnUserChangeHandlers.js.map +1 -0
  90. package/features/users/NotifyUserChange/feature.d.ts +5 -0
  91. package/features/users/NotifyUserChange/feature.js +13 -0
  92. package/features/users/NotifyUserChange/feature.js.map +1 -0
  93. package/features/users/NotifyUserChange/index.d.ts +2 -0
  94. package/features/users/NotifyUserChange/index.js +2 -0
  95. package/features/users/NotifyUserChange/recordType.d.ts +5 -0
  96. package/features/users/NotifyUserChange/recordType.js +4 -0
  97. package/features/users/NotifyUserChange/recordType.js.map +1 -0
  98. package/features/users/ai/ListUsersTool.d.ts +39 -0
  99. package/features/users/ai/ListUsersTool.js +46 -0
  100. package/features/users/ai/ListUsersTool.js.map +1 -0
  101. package/features/users/ai/UpdateUserAccessTool.d.ts +59 -0
  102. package/features/users/ai/UpdateUserAccessTool.js +101 -0
  103. package/features/users/ai/UpdateUserAccessTool.js.map +1 -0
  104. package/features/users/ai/feature.d.ts +11 -0
  105. package/features/users/ai/feature.js +13 -0
  106. package/features/users/ai/feature.js.map +1 -0
  107. package/features/users/ai/index.d.ts +3 -0
  108. package/features/users/ai/index.js +3 -0
  109. package/features/websockets/NotifyRecordChange/NotifyRecordChangeUseCase.d.ts +12 -0
  110. package/features/websockets/NotifyRecordChange/NotifyRecordChangeUseCase.js +38 -0
  111. package/features/websockets/NotifyRecordChange/NotifyRecordChangeUseCase.js.map +1 -0
  112. package/features/websockets/NotifyRecordChange/abstractions.d.ts +39 -0
  113. package/features/websockets/NotifyRecordChange/abstractions.js +6 -0
  114. package/features/websockets/NotifyRecordChange/abstractions.js.map +1 -0
  115. package/features/websockets/NotifyRecordChange/feature.d.ts +5 -0
  116. package/features/websockets/NotifyRecordChange/feature.js +11 -0
  117. package/features/websockets/NotifyRecordChange/feature.js.map +1 -0
  118. package/features/websockets/NotifyRecordChange/index.d.ts +2 -0
  119. package/features/websockets/NotifyRecordChange/index.js +2 -0
  120. package/features/websockets/index.d.ts +1 -0
  121. package/features/websockets/index.js +1 -0
  122. package/package.json +11 -11
  123. package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.d.ts +0 -11
  124. package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.js +0 -40
  125. package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.js.map +0 -1
  126. package/features/security/roles/NotifyRoleChange/abstractions.d.ts +0 -21
  127. package/features/security/roles/NotifyRoleChange/abstractions.js +0 -8
  128. package/features/security/roles/NotifyRoleChange/abstractions.js.map +0 -1
  129. package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.d.ts +0 -11
  130. package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.js +0 -40
  131. package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.js.map +0 -1
  132. package/features/security/teams/NotifyTeamChange/abstractions.d.ts +0 -21
  133. package/features/security/teams/NotifyTeamChange/abstractions.js +0 -8
  134. package/features/security/teams/NotifyTeamChange/abstractions.js.map +0 -1
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ import { AiSdkToolDefinition } from "../../../features/ai/index.js";
3
+ import { AiSdkToolHandler } from "../../../features/ai/index.js";
4
+ import { UpdateTeam } from "../../../features/security/teams/UpdateTeam/index.js";
5
+ declare const inputSchema: z.ZodObject<{
6
+ teamId: z.ZodString;
7
+ name: z.ZodOptional<z.ZodString>;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
10
+ }, z.core.$strip>;
11
+ type Input = z.infer<typeof inputSchema>;
12
+ interface UpdatedTeam {
13
+ id: string;
14
+ name: string;
15
+ slug: string;
16
+ description: string;
17
+ roles: string[];
18
+ }
19
+ declare class UpdateTeamToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {
20
+ private updateTeam;
21
+ constructor(updateTeam: UpdateTeam.Interface);
22
+ execute(input: Input): Promise<UpdatedTeam>;
23
+ }
24
+ /**
25
+ * Changes a team's name, description or roles. The slug cannot change: folder permissions refer to
26
+ * teams by slug.
27
+ *
28
+ * Needs approval for the same reason as `createTeam`: the roles decide what the team's members can
29
+ * do. `roles` replaces the stored list, and the approval shows that whole list, so a role the model
30
+ * left out is visible as missing before anything is written.
31
+ */
32
+ declare class UpdateTeamToolImpl implements AiSdkToolDefinition.Interface<Input> {
33
+ readonly name = "updateTeam";
34
+ readonly title = "Update team";
35
+ readonly description = "Changes a team's name, description or roles. Call listTeams first for the id. `roles` replaces the team's whole role list, so pass every role it should keep; call listRoles to resolve them. System teams and teams defined in code cannot be changed. Requires user approval.";
36
+ readonly inputSchema: z.ZodObject<{
37
+ teamId: z.ZodString;
38
+ name: z.ZodOptional<z.ZodString>;
39
+ description: z.ZodOptional<z.ZodString>;
40
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ }, z.core.$strip>;
42
+ readonly annotations: {
43
+ readOnlyHint: boolean;
44
+ idempotentHint: boolean;
45
+ };
46
+ readonly handler: typeof UpdateTeamToolHandlerImpl & {
47
+ __abstraction: import("@webiny/di").Abstraction<import("../../ai/abstractions").IAiSdkToolHandler<any>>;
48
+ };
49
+ }
50
+ export declare const UpdateTeamTool: typeof UpdateTeamToolImpl & {
51
+ __abstraction: import("@webiny/di").Abstraction<import("../../ai/abstractions").IAiSdkToolDefinition<any>>;
52
+ };
53
+ export {};
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import { AiSdkToolDefinition, AiSdkToolHandler } from "../../ai/index.js";
3
+ import { UpdateTeam } from "../teams/UpdateTeam/index.js";
4
+ const inputSchema = z.object({
5
+ teamId: z.string().describe("Team id as returned by listTeams."),
6
+ name: z.string().min(3).optional().describe("New team name. Omit it to keep the current one."),
7
+ description: z.string().max(500).optional().describe("New description. Omit it to keep the current one; an empty string clears it."),
8
+ roles: z.array(z.string()).optional().describe("The complete list of roles the team should have afterwards. It REPLACES the stored list, so include the roles to keep. Omit it to leave the roles alone. Resolve values with listRoles first.")
9
+ });
10
+ class UpdateTeamToolHandlerImpl {
11
+ constructor(updateTeam){
12
+ this.updateTeam = updateTeam;
13
+ }
14
+ async execute(input) {
15
+ const result = await this.updateTeam.execute(input.teamId, {
16
+ name: input.name,
17
+ description: input.description,
18
+ roles: input.roles
19
+ });
20
+ if (result.isFail()) throw new Error(`Could not update the team: ${result.error.message}`);
21
+ const team = result.value;
22
+ return {
23
+ id: team.id,
24
+ name: team.name,
25
+ slug: team.slug,
26
+ description: team.description,
27
+ roles: team.roles
28
+ };
29
+ }
30
+ }
31
+ const UpdateTeamToolHandler = AiSdkToolHandler.createImplementation({
32
+ implementation: UpdateTeamToolHandlerImpl,
33
+ dependencies: [
34
+ UpdateTeam
35
+ ]
36
+ });
37
+ class UpdateTeamToolImpl {
38
+ constructor(){
39
+ this.name = "updateTeam";
40
+ this.title = "Update team";
41
+ this.description = "Changes a team's name, description or roles. Call listTeams first for the id. `roles` replaces the team's whole role list, so pass every role it should keep; call listRoles to resolve them. System teams and teams defined in code cannot be changed. Requires user approval.";
42
+ this.inputSchema = inputSchema;
43
+ this.annotations = {
44
+ readOnlyHint: false,
45
+ idempotentHint: true
46
+ };
47
+ this.handler = UpdateTeamToolHandler;
48
+ }
49
+ }
50
+ const UpdateTeamTool = AiSdkToolDefinition.createImplementation({
51
+ implementation: UpdateTeamToolImpl,
52
+ dependencies: []
53
+ });
54
+ export { UpdateTeamTool };
55
+
56
+ //# sourceMappingURL=UpdateTeamTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/security/ai/UpdateTeamTool.js","sources":["../../../../src/features/security/ai/UpdateTeamTool.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AiSdkToolDefinition } from \"~/features/ai/index.js\";\nimport { AiSdkToolHandler } from \"~/features/ai/index.js\";\nimport { UpdateTeam } from \"~/features/security/teams/UpdateTeam/index.js\";\n\nconst inputSchema = z.object({\n teamId: z.string().describe(\"Team id as returned by listTeams.\"),\n name: z.string().min(3).optional().describe(\"New team name. Omit it to keep the current one.\"),\n description: z\n .string()\n .max(500)\n .optional()\n .describe(\"New description. Omit it to keep the current one; an empty string clears it.\"),\n roles: z\n .array(z.string())\n .optional()\n .describe(\n \"The complete list of roles the team should have afterwards. It REPLACES the stored list, so include the roles to keep. Omit it to leave the roles alone. Resolve values with listRoles first.\"\n )\n});\n\ntype Input = z.infer<typeof inputSchema>;\n\ninterface UpdatedTeam {\n id: string;\n name: string;\n slug: string;\n description: string;\n roles: string[];\n}\n\nclass UpdateTeamToolHandlerImpl implements AiSdkToolHandler.Interface<Input> {\n constructor(private updateTeam: UpdateTeam.Interface) {}\n\n async execute(input: Input): Promise<UpdatedTeam> {\n // A field the model left out arrives as `undefined`; `UpdateTeam` leaves those alone.\n const result = await this.updateTeam.execute(input.teamId, {\n name: input.name,\n description: input.description,\n roles: input.roles\n });\n\n if (result.isFail()) {\n throw new Error(`Could not update the team: ${result.error.message}`);\n }\n\n const team = result.value;\n\n return {\n id: team.id,\n name: team.name,\n slug: team.slug,\n description: team.description,\n // From the updated team, so the caller sees the resolved ids that were actually stored.\n roles: team.roles\n };\n }\n}\n\nconst UpdateTeamToolHandler = AiSdkToolHandler.createImplementation({\n implementation: UpdateTeamToolHandlerImpl,\n dependencies: [UpdateTeam]\n});\n\n/**\n * Changes a team's name, description or roles. The slug cannot change: folder permissions refer to\n * teams by slug.\n *\n * Needs approval for the same reason as `createTeam`: the roles decide what the team's members can\n * do. `roles` replaces the stored list, and the approval shows that whole list, so a role the model\n * left out is visible as missing before anything is written.\n */\nclass UpdateTeamToolImpl implements AiSdkToolDefinition.Interface<Input> {\n readonly name = \"updateTeam\";\n readonly title = \"Update team\";\n readonly description =\n \"Changes a team's name, description or roles. Call listTeams first for the id. `roles` replaces the team's whole role list, so pass every role it should keep; call listRoles to resolve them. System teams and teams defined in code cannot be changed. Requires user approval.\";\n readonly inputSchema = inputSchema;\n readonly annotations = { readOnlyHint: false, idempotentHint: true };\n readonly handler = UpdateTeamToolHandler;\n}\n\nexport const UpdateTeamTool = AiSdkToolDefinition.createImplementation({\n implementation: UpdateTeamToolImpl,\n dependencies: []\n});\n"],"names":["inputSchema","z","UpdateTeamToolHandlerImpl","updateTeam","input","result","Error","team","UpdateTeamToolHandler","AiSdkToolHandler","UpdateTeam","UpdateTeamToolImpl","UpdateTeamTool","AiSdkToolDefinition"],"mappings":";;;AAKA,MAAMA,cAAcC,EAAE,MAAM,CAAC;IACzB,QAAQA,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,MAAMA,EAAE,MAAM,GAAG,GAAG,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5C,aAAaA,EAAAA,MACF,GACN,GAAG,CAAC,KACJ,QAAQ,GACR,QAAQ,CAAC;IACd,OAAOA,EAAAA,KACG,CAACA,EAAE,MAAM,IACd,QAAQ,GACR,QAAQ,CACL;AAEZ;AAYA,MAAMC;IACF,YAAoBC,UAAgC,CAAE;aAAlCA,UAAU,GAAVA;IAAmC;IAEvD,MAAM,QAAQC,KAAY,EAAwB;QAE9C,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAACD,MAAM,MAAM,EAAE;YACvD,MAAMA,MAAM,IAAI;YAChB,aAAaA,MAAM,WAAW;YAC9B,OAAOA,MAAM,KAAK;QACtB;QAEA,IAAIC,OAAO,MAAM,IACb,MAAM,IAAIC,MAAM,CAAC,2BAA2B,EAAED,OAAO,KAAK,CAAC,OAAO,EAAE;QAGxE,MAAME,OAAOF,OAAO,KAAK;QAEzB,OAAO;YACH,IAAIE,KAAK,EAAE;YACX,MAAMA,KAAK,IAAI;YACf,MAAMA,KAAK,IAAI;YACf,aAAaA,KAAK,WAAW;YAE7B,OAAOA,KAAK,KAAK;QACrB;IACJ;AACJ;AAEA,MAAMC,wBAAwBC,iBAAiB,oBAAoB,CAAC;IAChE,gBAAgBP;IAChB,cAAc;QAACQ;KAAW;AAC9B;AAUA,MAAMC;;aACO,IAAI,GAAG;aACP,KAAK,GAAG;aACR,WAAW,GAChB;aACK,WAAW,GAAGX;aACd,WAAW,GAAG;YAAE,cAAc;YAAO,gBAAgB;QAAK;aAC1D,OAAO,GAAGQ;;AACvB;AAEO,MAAMI,iBAAiBC,oBAAoB,oBAAoB,CAAC;IACnE,gBAAgBF;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Team and role tools for AI callers.
3
+ *
4
+ * The list tools are read-only and run unattended. Creating, changing or deleting a team or a role is
5
+ * a write, so it pauses for the user to approve the exact arguments.
6
+ */
7
+ export declare const SecurityAiToolsFeature: {
8
+ name: string;
9
+ register(container: import("@webiny/di").Container): void;
10
+ };
@@ -0,0 +1,25 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { ListTeamsTool } from "./ListTeamsTool.js";
3
+ import { CreateTeamTool } from "./CreateTeamTool.js";
4
+ import { UpdateTeamTool } from "./UpdateTeamTool.js";
5
+ import { DeleteTeamTool } from "./DeleteTeamTool.js";
6
+ import { ListRolesTool } from "./ListRolesTool.js";
7
+ import { CreateRoleTool } from "./CreateRoleTool.js";
8
+ import { UpdateRoleTool } from "./UpdateRoleTool.js";
9
+ import { DeleteRoleTool } from "./DeleteRoleTool.js";
10
+ const SecurityAiToolsFeature = createFeature({
11
+ name: "Security/AiTools",
12
+ register (container) {
13
+ container.register(ListTeamsTool);
14
+ container.register(CreateTeamTool);
15
+ container.register(UpdateTeamTool);
16
+ container.register(DeleteTeamTool);
17
+ container.register(ListRolesTool);
18
+ container.register(CreateRoleTool);
19
+ container.register(UpdateRoleTool);
20
+ container.register(DeleteRoleTool);
21
+ }
22
+ });
23
+ export { SecurityAiToolsFeature };
24
+
25
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/security/ai/feature.js","sources":["../../../../src/features/security/ai/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListTeamsTool } from \"./ListTeamsTool.js\";\nimport { CreateTeamTool } from \"./CreateTeamTool.js\";\nimport { UpdateTeamTool } from \"./UpdateTeamTool.js\";\nimport { DeleteTeamTool } from \"./DeleteTeamTool.js\";\nimport { ListRolesTool } from \"./ListRolesTool.js\";\nimport { CreateRoleTool } from \"./CreateRoleTool.js\";\nimport { UpdateRoleTool } from \"./UpdateRoleTool.js\";\nimport { DeleteRoleTool } from \"./DeleteRoleTool.js\";\n\n/**\n * Team and role tools for AI callers.\n *\n * The list tools are read-only and run unattended. Creating, changing or deleting a team or a role is\n * a write, so it pauses for the user to approve the exact arguments.\n */\nexport const SecurityAiToolsFeature = createFeature({\n name: \"Security/AiTools\",\n register(container) {\n container.register(ListTeamsTool);\n container.register(CreateTeamTool);\n container.register(UpdateTeamTool);\n container.register(DeleteTeamTool);\n container.register(ListRolesTool);\n container.register(CreateRoleTool);\n container.register(UpdateRoleTool);\n container.register(DeleteRoleTool);\n }\n});\n"],"names":["SecurityAiToolsFeature","createFeature","container","ListTeamsTool","CreateTeamTool","UpdateTeamTool","DeleteTeamTool","ListRolesTool","CreateRoleTool","UpdateRoleTool","DeleteRoleTool"],"mappings":";;;;;;;;;AAgBO,MAAMA,yBAAyBC,cAAc;IAChD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;IACvB;AACJ"}
@@ -0,0 +1,9 @@
1
+ export { SecurityAiToolsFeature } from "./feature.js";
2
+ export { ListTeamsTool } from "./ListTeamsTool.js";
3
+ export { CreateTeamTool } from "./CreateTeamTool.js";
4
+ export { UpdateTeamTool } from "./UpdateTeamTool.js";
5
+ export { DeleteTeamTool } from "./DeleteTeamTool.js";
6
+ export { ListRolesTool } from "./ListRolesTool.js";
7
+ export { CreateRoleTool } from "./CreateRoleTool.js";
8
+ export { UpdateRoleTool } from "./UpdateRoleTool.js";
9
+ export { DeleteRoleTool } from "./DeleteRoleTool.js";
@@ -0,0 +1,9 @@
1
+ export { SecurityAiToolsFeature } from "./feature.js";
2
+ export { ListTeamsTool } from "./ListTeamsTool.js";
3
+ export { CreateTeamTool } from "./CreateTeamTool.js";
4
+ export { UpdateTeamTool } from "./UpdateTeamTool.js";
5
+ export { DeleteTeamTool } from "./DeleteTeamTool.js";
6
+ export { ListRolesTool } from "./ListRolesTool.js";
7
+ export { CreateRoleTool } from "./CreateRoleTool.js";
8
+ export { UpdateRoleTool } from "./UpdateRoleTool.js";
9
+ export { DeleteRoleTool } from "./DeleteRoleTool.js";
@@ -1,7 +1,7 @@
1
1
  import { Authorizer } from "../authorization/Authorizer/abstractions.js";
2
2
  class ApiKeyAuthorizerImpl {
3
3
  async authorize(identity) {
4
- if (!identity || "api-key" !== identity.type) return null;
4
+ if ("api-key" !== identity.type) return null;
5
5
  const permissions = identity.permissions;
6
6
  return Array.isArray(permissions) ? permissions : [];
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/apiKeys/ApiKeyAuthorizer.js","sources":["../../../../src/features/security/apiKeys/ApiKeyAuthorizer.ts"],"sourcesContent":["import { Authorizer } from \"~/features/security/authorization/Authorizer/abstractions.js\";\nimport type { IAuthorizer } from \"~/features/security/authorization/Authorizer/abstractions.js\";\nimport type { Identity } from \"~/features/security/IdentityContext/Identity.js\";\nimport type { SecurityPermission } from \"~/types/security.js\";\n\nclass ApiKeyAuthorizerImpl implements IAuthorizer {\n async authorize(identity: Identity): Promise<SecurityPermission[] | null> {\n if (!identity || identity.type !== \"api-key\") {\n return null;\n }\n const permissions = (identity as any).permissions;\n return Array.isArray(permissions) ? (permissions as SecurityPermission[]) : [];\n }\n}\n\nexport const ApiKeyAuthorizer = Authorizer.createImplementation({\n implementation: ApiKeyAuthorizerImpl,\n dependencies: []\n});\n"],"names":["ApiKeyAuthorizerImpl","identity","permissions","Array","ApiKeyAuthorizer","Authorizer"],"mappings":";AAKA,MAAMA;IACF,MAAM,UAAUC,QAAkB,EAAwC;QACtE,IAAI,CAACA,YAAYA,AAAkB,cAAlBA,SAAS,IAAI,EAC1B,OAAO;QAEX,MAAMC,cAAeD,SAAiB,WAAW;QACjD,OAAOE,MAAM,OAAO,CAACD,eAAgBA,cAAuC,EAAE;IAClF;AACJ;AAEO,MAAME,mBAAmBC,WAAW,oBAAoB,CAAC;IAC5D,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/security/apiKeys/ApiKeyAuthorizer.js","sources":["../../../../src/features/security/apiKeys/ApiKeyAuthorizer.ts"],"sourcesContent":["import { Authorizer } from \"~/features/security/authorization/Authorizer/abstractions.js\";\nimport type { IAuthorizer } from \"~/features/security/authorization/Authorizer/abstractions.js\";\nimport type { Identity } from \"~/features/security/IdentityContext/Identity.js\";\nimport type { SecurityPermission } from \"~/types/security.js\";\n\nclass ApiKeyAuthorizerImpl implements IAuthorizer {\n async authorize(identity: Identity): Promise<SecurityPermission[] | null> {\n if (identity.type !== \"api-key\") {\n return null;\n }\n const permissions = (identity as any).permissions;\n return Array.isArray(permissions) ? (permissions as SecurityPermission[]) : [];\n }\n}\n\nexport const ApiKeyAuthorizer = Authorizer.createImplementation({\n implementation: ApiKeyAuthorizerImpl,\n dependencies: []\n});\n"],"names":["ApiKeyAuthorizerImpl","identity","permissions","Array","ApiKeyAuthorizer","Authorizer"],"mappings":";AAKA,MAAMA;IACF,MAAM,UAAUC,QAAkB,EAAwC;QACtE,IAAIA,AAAkB,cAAlBA,SAAS,IAAI,EACb,OAAO;QAEX,MAAMC,cAAeD,SAAiB,WAAW;QACjD,OAAOE,MAAM,OAAO,CAACD,eAAgBA,cAAuC,EAAE;IAClF;AACJ;AAEO,MAAME,mBAAmBC,WAAW,oBAAoB,CAAC;IAC5D,gBAAgBL;IAChB,cAAc,EAAE;AACpB"}
@@ -1,8 +1,8 @@
1
1
  import { RoleAfterCreateEventHandler } from "../../../../features/security/roles/CreateRole/index.js";
2
- import { NotifyRoleChangeUseCase } from "./abstractions.js";
2
+ import { NotifyRecordChangeUseCase } from "../../../../features/websockets/index.js";
3
3
  declare class NotifyOnRoleCreatedHandlerImpl implements RoleAfterCreateEventHandler.Interface {
4
- private notifyRoleChange;
5
- constructor(notifyRoleChange: NotifyRoleChangeUseCase.Interface);
4
+ private notifyRecordChange;
5
+ constructor(notifyRecordChange: NotifyRecordChangeUseCase.Interface);
6
6
  handle(event: RoleAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const NotifyOnRoleCreatedHandler: typeof NotifyOnRoleCreatedHandlerImpl & {
@@ -1,11 +1,13 @@
1
1
  import { RoleAfterCreateEventHandler } from "../CreateRole/index.js";
2
- import { NotifyRoleChangeUseCase } from "./abstractions.js";
2
+ import { NotifyRecordChangeUseCase } from "../../../websockets/index.js";
3
+ import { ROLE_RECORD_TYPE } from "./recordType.js";
3
4
  class NotifyOnRoleCreatedHandlerImpl {
4
- constructor(notifyRoleChange){
5
- this.notifyRoleChange = notifyRoleChange;
5
+ constructor(notifyRecordChange){
6
+ this.notifyRecordChange = notifyRecordChange;
6
7
  }
7
8
  async handle(event) {
8
- await this.notifyRoleChange.execute({
9
+ await this.notifyRecordChange.execute({
10
+ type: ROLE_RECORD_TYPE,
9
11
  id: event.payload.role.id,
10
12
  change: "created"
11
13
  });
@@ -14,7 +16,7 @@ class NotifyOnRoleCreatedHandlerImpl {
14
16
  const NotifyOnRoleCreatedHandler = RoleAfterCreateEventHandler.createImplementation({
15
17
  implementation: NotifyOnRoleCreatedHandlerImpl,
16
18
  dependencies: [
17
- NotifyRoleChangeUseCase
19
+ NotifyRecordChangeUseCase
18
20
  ]
19
21
  });
20
22
  export { NotifyOnRoleCreatedHandler };
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.ts"],"sourcesContent":["import { RoleAfterCreateEventHandler } from \"~/features/security/roles/CreateRole/index.js\";\nimport { NotifyRoleChangeUseCase } from \"./abstractions.js\";\n\nclass NotifyOnRoleCreatedHandlerImpl implements RoleAfterCreateEventHandler.Interface {\n constructor(private notifyRoleChange: NotifyRoleChangeUseCase.Interface) {}\n\n async handle(event: RoleAfterCreateEventHandler.Event): Promise<void> {\n await this.notifyRoleChange.execute({ id: event.payload.role.id, change: \"created\" });\n }\n}\n\nexport const NotifyOnRoleCreatedHandler = RoleAfterCreateEventHandler.createImplementation({\n implementation: NotifyOnRoleCreatedHandlerImpl,\n dependencies: [NotifyRoleChangeUseCase]\n});\n"],"names":["NotifyOnRoleCreatedHandlerImpl","notifyRoleChange","event","NotifyOnRoleCreatedHandler","RoleAfterCreateEventHandler","NotifyRoleChangeUseCase"],"mappings":";;AAGA,MAAMA;IACF,YAAoBC,gBAAmD,CAAE;aAArDA,gBAAgB,GAAhBA;IAAsD;IAE1E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,IAAIA,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YAAE,QAAQ;QAAU;IACvF;AACJ;AAEO,MAAMC,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBJ;IAChB,cAAc;QAACK;KAAwB;AAC3C"}
1
+ {"version":3,"file":"features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.ts"],"sourcesContent":["import { RoleAfterCreateEventHandler } from \"~/features/security/roles/CreateRole/index.js\";\nimport { NotifyRecordChangeUseCase } from \"~/features/websockets/index.js\";\nimport { ROLE_RECORD_TYPE } from \"./recordType.js\";\n\nclass NotifyOnRoleCreatedHandlerImpl implements RoleAfterCreateEventHandler.Interface {\n constructor(private notifyRecordChange: NotifyRecordChangeUseCase.Interface) {}\n\n async handle(event: RoleAfterCreateEventHandler.Event): Promise<void> {\n await this.notifyRecordChange.execute({\n type: ROLE_RECORD_TYPE,\n id: event.payload.role.id,\n change: \"created\"\n });\n }\n}\n\nexport const NotifyOnRoleCreatedHandler = RoleAfterCreateEventHandler.createImplementation({\n implementation: NotifyOnRoleCreatedHandlerImpl,\n dependencies: [NotifyRecordChangeUseCase]\n});\n"],"names":["NotifyOnRoleCreatedHandlerImpl","notifyRecordChange","event","ROLE_RECORD_TYPE","NotifyOnRoleCreatedHandler","RoleAfterCreateEventHandler","NotifyRecordChangeUseCase"],"mappings":";;;AAIA,MAAMA;IACF,YAAoBC,kBAAuD,CAAE;aAAzDA,kBAAkB,GAAlBA;IAA0D;IAE9E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;YAClC,MAAMC;YACN,IAAID,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ;QACZ;IACJ;AACJ;AAEO,MAAME,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBL;IAChB,cAAc;QAACM;KAA0B;AAC7C"}
@@ -1,8 +1,8 @@
1
1
  import { RoleAfterDeleteEventHandler } from "../../../../features/security/roles/DeleteRole/index.js";
2
- import { NotifyRoleChangeUseCase } from "./abstractions.js";
2
+ import { NotifyRecordChangeUseCase } from "../../../../features/websockets/index.js";
3
3
  declare class NotifyOnRoleDeletedHandlerImpl implements RoleAfterDeleteEventHandler.Interface {
4
- private notifyRoleChange;
5
- constructor(notifyRoleChange: NotifyRoleChangeUseCase.Interface);
4
+ private notifyRecordChange;
5
+ constructor(notifyRecordChange: NotifyRecordChangeUseCase.Interface);
6
6
  handle(event: RoleAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const NotifyOnRoleDeletedHandler: typeof NotifyOnRoleDeletedHandlerImpl & {
@@ -1,11 +1,13 @@
1
1
  import { RoleAfterDeleteEventHandler } from "../DeleteRole/index.js";
2
- import { NotifyRoleChangeUseCase } from "./abstractions.js";
2
+ import { NotifyRecordChangeUseCase } from "../../../websockets/index.js";
3
+ import { ROLE_RECORD_TYPE } from "./recordType.js";
3
4
  class NotifyOnRoleDeletedHandlerImpl {
4
- constructor(notifyRoleChange){
5
- this.notifyRoleChange = notifyRoleChange;
5
+ constructor(notifyRecordChange){
6
+ this.notifyRecordChange = notifyRecordChange;
6
7
  }
7
8
  async handle(event) {
8
- await this.notifyRoleChange.execute({
9
+ await this.notifyRecordChange.execute({
10
+ type: ROLE_RECORD_TYPE,
9
11
  id: event.payload.role.id,
10
12
  change: "deleted"
11
13
  });
@@ -14,7 +16,7 @@ class NotifyOnRoleDeletedHandlerImpl {
14
16
  const NotifyOnRoleDeletedHandler = RoleAfterDeleteEventHandler.createImplementation({
15
17
  implementation: NotifyOnRoleDeletedHandlerImpl,
16
18
  dependencies: [
17
- NotifyRoleChangeUseCase
19
+ NotifyRecordChangeUseCase
18
20
  ]
19
21
  });
20
22
  export { NotifyOnRoleDeletedHandler };
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.ts"],"sourcesContent":["import { RoleAfterDeleteEventHandler } from \"~/features/security/roles/DeleteRole/index.js\";\nimport { NotifyRoleChangeUseCase } from \"./abstractions.js\";\n\nclass NotifyOnRoleDeletedHandlerImpl implements RoleAfterDeleteEventHandler.Interface {\n constructor(private notifyRoleChange: NotifyRoleChangeUseCase.Interface) {}\n\n async handle(event: RoleAfterDeleteEventHandler.Event): Promise<void> {\n await this.notifyRoleChange.execute({ id: event.payload.role.id, change: \"deleted\" });\n }\n}\n\nexport const NotifyOnRoleDeletedHandler = RoleAfterDeleteEventHandler.createImplementation({\n implementation: NotifyOnRoleDeletedHandlerImpl,\n dependencies: [NotifyRoleChangeUseCase]\n});\n"],"names":["NotifyOnRoleDeletedHandlerImpl","notifyRoleChange","event","NotifyOnRoleDeletedHandler","RoleAfterDeleteEventHandler","NotifyRoleChangeUseCase"],"mappings":";;AAGA,MAAMA;IACF,YAAoBC,gBAAmD,CAAE;aAArDA,gBAAgB,GAAhBA;IAAsD;IAE1E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,IAAIA,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YAAE,QAAQ;QAAU;IACvF;AACJ;AAEO,MAAMC,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBJ;IAChB,cAAc;QAACK;KAAwB;AAC3C"}
1
+ {"version":3,"file":"features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.ts"],"sourcesContent":["import { RoleAfterDeleteEventHandler } from \"~/features/security/roles/DeleteRole/index.js\";\nimport { NotifyRecordChangeUseCase } from \"~/features/websockets/index.js\";\nimport { ROLE_RECORD_TYPE } from \"./recordType.js\";\n\nclass NotifyOnRoleDeletedHandlerImpl implements RoleAfterDeleteEventHandler.Interface {\n constructor(private notifyRecordChange: NotifyRecordChangeUseCase.Interface) {}\n\n async handle(event: RoleAfterDeleteEventHandler.Event): Promise<void> {\n await this.notifyRecordChange.execute({\n type: ROLE_RECORD_TYPE,\n id: event.payload.role.id,\n change: \"deleted\"\n });\n }\n}\n\nexport const NotifyOnRoleDeletedHandler = RoleAfterDeleteEventHandler.createImplementation({\n implementation: NotifyOnRoleDeletedHandlerImpl,\n dependencies: [NotifyRecordChangeUseCase]\n});\n"],"names":["NotifyOnRoleDeletedHandlerImpl","notifyRecordChange","event","ROLE_RECORD_TYPE","NotifyOnRoleDeletedHandler","RoleAfterDeleteEventHandler","NotifyRecordChangeUseCase"],"mappings":";;;AAIA,MAAMA;IACF,YAAoBC,kBAAuD,CAAE;aAAzDA,kBAAkB,GAAlBA;IAA0D;IAE9E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;YAClC,MAAMC;YACN,IAAID,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ;QACZ;IACJ;AACJ;AAEO,MAAME,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBL;IAChB,cAAc;QAACM;KAA0B;AAC7C"}
@@ -1,8 +1,8 @@
1
1
  import { RoleAfterUpdateEventHandler } from "../../../../features/security/roles/UpdateRole/index.js";
2
- import { NotifyRoleChangeUseCase } from "./abstractions.js";
2
+ import { NotifyRecordChangeUseCase } from "../../../../features/websockets/index.js";
3
3
  declare class NotifyOnRoleUpdatedHandlerImpl implements RoleAfterUpdateEventHandler.Interface {
4
- private notifyRoleChange;
5
- constructor(notifyRoleChange: NotifyRoleChangeUseCase.Interface);
4
+ private notifyRecordChange;
5
+ constructor(notifyRecordChange: NotifyRecordChangeUseCase.Interface);
6
6
  handle(event: RoleAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const NotifyOnRoleUpdatedHandler: typeof NotifyOnRoleUpdatedHandlerImpl & {
@@ -1,11 +1,13 @@
1
1
  import { RoleAfterUpdateEventHandler } from "../UpdateRole/index.js";
2
- import { NotifyRoleChangeUseCase } from "./abstractions.js";
2
+ import { NotifyRecordChangeUseCase } from "../../../websockets/index.js";
3
+ import { ROLE_RECORD_TYPE } from "./recordType.js";
3
4
  class NotifyOnRoleUpdatedHandlerImpl {
4
- constructor(notifyRoleChange){
5
- this.notifyRoleChange = notifyRoleChange;
5
+ constructor(notifyRecordChange){
6
+ this.notifyRecordChange = notifyRecordChange;
6
7
  }
7
8
  async handle(event) {
8
- await this.notifyRoleChange.execute({
9
+ await this.notifyRecordChange.execute({
10
+ type: ROLE_RECORD_TYPE,
9
11
  id: event.payload.updated.id,
10
12
  change: "updated"
11
13
  });
@@ -14,7 +16,7 @@ class NotifyOnRoleUpdatedHandlerImpl {
14
16
  const NotifyOnRoleUpdatedHandler = RoleAfterUpdateEventHandler.createImplementation({
15
17
  implementation: NotifyOnRoleUpdatedHandlerImpl,
16
18
  dependencies: [
17
- NotifyRoleChangeUseCase
19
+ NotifyRecordChangeUseCase
18
20
  ]
19
21
  });
20
22
  export { NotifyOnRoleUpdatedHandler };
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.ts"],"sourcesContent":["import { RoleAfterUpdateEventHandler } from \"~/features/security/roles/UpdateRole/index.js\";\nimport { NotifyRoleChangeUseCase } from \"./abstractions.js\";\n\nclass NotifyOnRoleUpdatedHandlerImpl implements RoleAfterUpdateEventHandler.Interface {\n constructor(private notifyRoleChange: NotifyRoleChangeUseCase.Interface) {}\n\n async handle(event: RoleAfterUpdateEventHandler.Event): Promise<void> {\n await this.notifyRoleChange.execute({ id: event.payload.updated.id, change: \"updated\" });\n }\n}\n\nexport const NotifyOnRoleUpdatedHandler = RoleAfterUpdateEventHandler.createImplementation({\n implementation: NotifyOnRoleUpdatedHandlerImpl,\n dependencies: [NotifyRoleChangeUseCase]\n});\n"],"names":["NotifyOnRoleUpdatedHandlerImpl","notifyRoleChange","event","NotifyOnRoleUpdatedHandler","RoleAfterUpdateEventHandler","NotifyRoleChangeUseCase"],"mappings":";;AAGA,MAAMA;IACF,YAAoBC,gBAAmD,CAAE;aAArDA,gBAAgB,GAAhBA;IAAsD;IAE1E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,IAAIA,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE;YAAE,QAAQ;QAAU;IAC1F;AACJ;AAEO,MAAMC,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBJ;IAChB,cAAc;QAACK;KAAwB;AAC3C"}
1
+ {"version":3,"file":"features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.ts"],"sourcesContent":["import { RoleAfterUpdateEventHandler } from \"~/features/security/roles/UpdateRole/index.js\";\nimport { NotifyRecordChangeUseCase } from \"~/features/websockets/index.js\";\nimport { ROLE_RECORD_TYPE } from \"./recordType.js\";\n\nclass NotifyOnRoleUpdatedHandlerImpl implements RoleAfterUpdateEventHandler.Interface {\n constructor(private notifyRecordChange: NotifyRecordChangeUseCase.Interface) {}\n\n async handle(event: RoleAfterUpdateEventHandler.Event): Promise<void> {\n await this.notifyRecordChange.execute({\n type: ROLE_RECORD_TYPE,\n id: event.payload.updated.id,\n change: \"updated\"\n });\n }\n}\n\nexport const NotifyOnRoleUpdatedHandler = RoleAfterUpdateEventHandler.createImplementation({\n implementation: NotifyOnRoleUpdatedHandlerImpl,\n dependencies: [NotifyRecordChangeUseCase]\n});\n"],"names":["NotifyOnRoleUpdatedHandlerImpl","notifyRecordChange","event","ROLE_RECORD_TYPE","NotifyOnRoleUpdatedHandler","RoleAfterUpdateEventHandler","NotifyRecordChangeUseCase"],"mappings":";;;AAIA,MAAMA;IACF,YAAoBC,kBAAuD,CAAE;aAAzDA,kBAAkB,GAAlBA;IAA0D;IAE9E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;YAClC,MAAMC;YACN,IAAID,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE;YAC5B,QAAQ;QACZ;IACJ;AACJ;AAEO,MAAME,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBL;IAChB,cAAc;QAACM;KAA0B;AAC7C"}
@@ -1,12 +1,10 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
- import { NotifyRoleChangeUseCase } from "./NotifyRoleChangeUseCase.js";
3
2
  import { NotifyOnRoleCreatedHandler } from "./NotifyOnRoleCreatedHandler.js";
4
3
  import { NotifyOnRoleUpdatedHandler } from "./NotifyOnRoleUpdatedHandler.js";
5
4
  import { NotifyOnRoleDeletedHandler } from "./NotifyOnRoleDeletedHandler.js";
6
5
  const NotifyRoleChangeFeature = createFeature({
7
6
  name: "NotifyRoleChange",
8
7
  register (container) {
9
- container.register(NotifyRoleChangeUseCase);
10
8
  container.register(NotifyOnRoleCreatedHandler);
11
9
  container.register(NotifyOnRoleUpdatedHandler);
12
10
  container.register(NotifyOnRoleDeletedHandler);
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/roles/NotifyRoleChange/feature.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { NotifyRoleChangeUseCase } from \"./NotifyRoleChangeUseCase.js\";\nimport { NotifyOnRoleCreatedHandler } from \"./NotifyOnRoleCreatedHandler.js\";\nimport { NotifyOnRoleUpdatedHandler } from \"./NotifyOnRoleUpdatedHandler.js\";\nimport { NotifyOnRoleDeletedHandler } from \"./NotifyOnRoleDeletedHandler.js\";\n\n/** Tells the user's open admin tabs when a role is created, updated or deleted. */\nexport const NotifyRoleChangeFeature = createFeature({\n name: \"NotifyRoleChange\",\n register(container) {\n container.register(NotifyRoleChangeUseCase);\n container.register(NotifyOnRoleCreatedHandler);\n container.register(NotifyOnRoleUpdatedHandler);\n container.register(NotifyOnRoleDeletedHandler);\n }\n});\n"],"names":["NotifyRoleChangeFeature","createFeature","container","NotifyRoleChangeUseCase","NotifyOnRoleCreatedHandler","NotifyOnRoleUpdatedHandler","NotifyOnRoleDeletedHandler"],"mappings":";;;;;AAOO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;IACvB;AACJ"}
1
+ {"version":3,"file":"features/security/roles/NotifyRoleChange/feature.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { NotifyOnRoleCreatedHandler } from \"./NotifyOnRoleCreatedHandler.js\";\nimport { NotifyOnRoleUpdatedHandler } from \"./NotifyOnRoleUpdatedHandler.js\";\nimport { NotifyOnRoleDeletedHandler } from \"./NotifyOnRoleDeletedHandler.js\";\n\n/** Tells the user's open admin tabs when a role is created, updated or deleted. */\nexport const NotifyRoleChangeFeature = createFeature({\n name: \"NotifyRoleChange\",\n register(container) {\n container.register(NotifyOnRoleCreatedHandler);\n container.register(NotifyOnRoleUpdatedHandler);\n container.register(NotifyOnRoleDeletedHandler);\n }\n});\n"],"names":["NotifyRoleChangeFeature","createFeature","container","NotifyOnRoleCreatedHandler","NotifyOnRoleUpdatedHandler","NotifyOnRoleDeletedHandler"],"mappings":";;;;AAMO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;IACvB;AACJ"}
@@ -1,2 +1,2 @@
1
1
  export { NotifyRoleChangeFeature } from "./feature.js";
2
- export { ROLE_CREATED_WEBSOCKET_ACTION, ROLE_UPDATED_WEBSOCKET_ACTION, ROLE_DELETED_WEBSOCKET_ACTION } from "./abstractions.js";
2
+ export { ROLE_RECORD_TYPE } from "./recordType.js";
@@ -1,2 +1,2 @@
1
1
  export { NotifyRoleChangeFeature } from "./feature.js";
2
- export { ROLE_CREATED_WEBSOCKET_ACTION, ROLE_DELETED_WEBSOCKET_ACTION, ROLE_UPDATED_WEBSOCKET_ACTION } from "./abstractions.js";
2
+ export { ROLE_RECORD_TYPE } from "./recordType.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The `type` of the record-changed message sent when a role changes. The admin's
3
+ * `ApplyRoleChangeToCache` filters on the same string.
4
+ */
5
+ export declare const ROLE_RECORD_TYPE = "security.role";
@@ -0,0 +1,4 @@
1
+ const ROLE_RECORD_TYPE = "security.role";
2
+ export { ROLE_RECORD_TYPE };
3
+
4
+ //# sourceMappingURL=recordType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/security/roles/NotifyRoleChange/recordType.js","sources":["../../../../../src/features/security/roles/NotifyRoleChange/recordType.ts"],"sourcesContent":["/**\n * The `type` of the record-changed message sent when a role changes. The admin's\n * `ApplyRoleChangeToCache` filters on the same string.\n */\nexport const ROLE_RECORD_TYPE = \"security.role\";\n"],"names":["ROLE_RECORD_TYPE"],"mappings":"AAIO,MAAMA,mBAAmB"}
@@ -1,26 +1,26 @@
1
1
  import { TeamAfterCreateEventHandler } from "../../../../features/security/teams/CreateTeam/index.js";
2
2
  import { TeamAfterUpdateEventHandler } from "../../../../features/security/teams/UpdateTeam/index.js";
3
3
  import { TeamAfterDeleteEventHandler } from "../../../../features/security/teams/DeleteTeam/index.js";
4
- import { NotifyTeamChangeUseCase } from "./abstractions.js";
4
+ import { NotifyRecordChangeUseCase } from "../../../../features/websockets/index.js";
5
5
  declare class NotifyOnTeamCreatedHandlerImpl implements TeamAfterCreateEventHandler.Interface {
6
- private notifyTeamChange;
7
- constructor(notifyTeamChange: NotifyTeamChangeUseCase.Interface);
6
+ private notifyRecordChange;
7
+ constructor(notifyRecordChange: NotifyRecordChangeUseCase.Interface);
8
8
  handle(event: TeamAfterCreateEventHandler.Event): Promise<void>;
9
9
  }
10
10
  export declare const NotifyOnTeamCreatedHandler: typeof NotifyOnTeamCreatedHandlerImpl & {
11
11
  __abstraction: import("@webiny/di").Abstraction<import("../../../eventPublisher/abstractions.js").IEventHandler<import("../CreateTeam/events.js").TeamAfterCreateEvent>>;
12
12
  };
13
13
  declare class NotifyOnTeamUpdatedHandlerImpl implements TeamAfterUpdateEventHandler.Interface {
14
- private notifyTeamChange;
15
- constructor(notifyTeamChange: NotifyTeamChangeUseCase.Interface);
14
+ private notifyRecordChange;
15
+ constructor(notifyRecordChange: NotifyRecordChangeUseCase.Interface);
16
16
  handle(event: TeamAfterUpdateEventHandler.Event): Promise<void>;
17
17
  }
18
18
  export declare const NotifyOnTeamUpdatedHandler: typeof NotifyOnTeamUpdatedHandlerImpl & {
19
19
  __abstraction: import("@webiny/di").Abstraction<import("../../../eventPublisher/abstractions.js").IEventHandler<import("~/features/security/teams/UpdateTeam/index.js").TeamAfterUpdateEvent>>;
20
20
  };
21
21
  declare class NotifyOnTeamDeletedHandlerImpl implements TeamAfterDeleteEventHandler.Interface {
22
- private notifyTeamChange;
23
- constructor(notifyTeamChange: NotifyTeamChangeUseCase.Interface);
22
+ private notifyRecordChange;
23
+ constructor(notifyRecordChange: NotifyRecordChangeUseCase.Interface);
24
24
  handle(event: TeamAfterDeleteEventHandler.Event): Promise<void>;
25
25
  }
26
26
  export declare const NotifyOnTeamDeletedHandler: typeof NotifyOnTeamDeletedHandlerImpl & {
@@ -1,13 +1,15 @@
1
1
  import { TeamAfterCreateEventHandler } from "../CreateTeam/index.js";
2
2
  import { TeamAfterUpdateEventHandler } from "../UpdateTeam/index.js";
3
3
  import { TeamAfterDeleteEventHandler } from "../DeleteTeam/index.js";
4
- import { NotifyTeamChangeUseCase } from "./abstractions.js";
4
+ import { NotifyRecordChangeUseCase } from "../../../websockets/index.js";
5
+ import { TEAM_RECORD_TYPE } from "./recordType.js";
5
6
  class NotifyOnTeamCreatedHandlerImpl {
6
- constructor(notifyTeamChange){
7
- this.notifyTeamChange = notifyTeamChange;
7
+ constructor(notifyRecordChange){
8
+ this.notifyRecordChange = notifyRecordChange;
8
9
  }
9
10
  async handle(event) {
10
- await this.notifyTeamChange.execute({
11
+ await this.notifyRecordChange.execute({
12
+ type: TEAM_RECORD_TYPE,
11
13
  id: event.payload.team.id,
12
14
  change: "created"
13
15
  });
@@ -16,15 +18,16 @@ class NotifyOnTeamCreatedHandlerImpl {
16
18
  const NotifyOnTeamCreatedHandler = TeamAfterCreateEventHandler.createImplementation({
17
19
  implementation: NotifyOnTeamCreatedHandlerImpl,
18
20
  dependencies: [
19
- NotifyTeamChangeUseCase
21
+ NotifyRecordChangeUseCase
20
22
  ]
21
23
  });
22
24
  class NotifyOnTeamUpdatedHandlerImpl {
23
- constructor(notifyTeamChange){
24
- this.notifyTeamChange = notifyTeamChange;
25
+ constructor(notifyRecordChange){
26
+ this.notifyRecordChange = notifyRecordChange;
25
27
  }
26
28
  async handle(event) {
27
- await this.notifyTeamChange.execute({
29
+ await this.notifyRecordChange.execute({
30
+ type: TEAM_RECORD_TYPE,
28
31
  id: event.payload.updated.id,
29
32
  change: "updated"
30
33
  });
@@ -33,15 +36,16 @@ class NotifyOnTeamUpdatedHandlerImpl {
33
36
  const NotifyOnTeamUpdatedHandler = TeamAfterUpdateEventHandler.createImplementation({
34
37
  implementation: NotifyOnTeamUpdatedHandlerImpl,
35
38
  dependencies: [
36
- NotifyTeamChangeUseCase
39
+ NotifyRecordChangeUseCase
37
40
  ]
38
41
  });
39
42
  class NotifyOnTeamDeletedHandlerImpl {
40
- constructor(notifyTeamChange){
41
- this.notifyTeamChange = notifyTeamChange;
43
+ constructor(notifyRecordChange){
44
+ this.notifyRecordChange = notifyRecordChange;
42
45
  }
43
46
  async handle(event) {
44
- await this.notifyTeamChange.execute({
47
+ await this.notifyRecordChange.execute({
48
+ type: TEAM_RECORD_TYPE,
45
49
  id: event.payload.team.id,
46
50
  change: "deleted"
47
51
  });
@@ -50,7 +54,7 @@ class NotifyOnTeamDeletedHandlerImpl {
50
54
  const NotifyOnTeamDeletedHandler = TeamAfterDeleteEventHandler.createImplementation({
51
55
  implementation: NotifyOnTeamDeletedHandlerImpl,
52
56
  dependencies: [
53
- NotifyTeamChangeUseCase
57
+ NotifyRecordChangeUseCase
54
58
  ]
55
59
  });
56
60
  export { NotifyOnTeamCreatedHandler, NotifyOnTeamDeletedHandler, NotifyOnTeamUpdatedHandler };
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js","sources":["../../../../../src/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.ts"],"sourcesContent":["import { TeamAfterCreateEventHandler } from \"~/features/security/teams/CreateTeam/index.js\";\nimport { TeamAfterUpdateEventHandler } from \"~/features/security/teams/UpdateTeam/index.js\";\nimport { TeamAfterDeleteEventHandler } from \"~/features/security/teams/DeleteTeam/index.js\";\nimport { NotifyTeamChangeUseCase } from \"./abstractions.js\";\n\nclass NotifyOnTeamCreatedHandlerImpl implements TeamAfterCreateEventHandler.Interface {\n constructor(private notifyTeamChange: NotifyTeamChangeUseCase.Interface) {}\n\n async handle(event: TeamAfterCreateEventHandler.Event): Promise<void> {\n await this.notifyTeamChange.execute({ id: event.payload.team.id, change: \"created\" });\n }\n}\n\nexport const NotifyOnTeamCreatedHandler = TeamAfterCreateEventHandler.createImplementation({\n implementation: NotifyOnTeamCreatedHandlerImpl,\n dependencies: [NotifyTeamChangeUseCase]\n});\n\nclass NotifyOnTeamUpdatedHandlerImpl implements TeamAfterUpdateEventHandler.Interface {\n constructor(private notifyTeamChange: NotifyTeamChangeUseCase.Interface) {}\n\n async handle(event: TeamAfterUpdateEventHandler.Event): Promise<void> {\n await this.notifyTeamChange.execute({ id: event.payload.updated.id, change: \"updated\" });\n }\n}\n\nexport const NotifyOnTeamUpdatedHandler = TeamAfterUpdateEventHandler.createImplementation({\n implementation: NotifyOnTeamUpdatedHandlerImpl,\n dependencies: [NotifyTeamChangeUseCase]\n});\n\nclass NotifyOnTeamDeletedHandlerImpl implements TeamAfterDeleteEventHandler.Interface {\n constructor(private notifyTeamChange: NotifyTeamChangeUseCase.Interface) {}\n\n async handle(event: TeamAfterDeleteEventHandler.Event): Promise<void> {\n await this.notifyTeamChange.execute({ id: event.payload.team.id, change: \"deleted\" });\n }\n}\n\nexport const NotifyOnTeamDeletedHandler = TeamAfterDeleteEventHandler.createImplementation({\n implementation: NotifyOnTeamDeletedHandlerImpl,\n dependencies: [NotifyTeamChangeUseCase]\n});\n"],"names":["NotifyOnTeamCreatedHandlerImpl","notifyTeamChange","event","NotifyOnTeamCreatedHandler","TeamAfterCreateEventHandler","NotifyTeamChangeUseCase","NotifyOnTeamUpdatedHandlerImpl","NotifyOnTeamUpdatedHandler","TeamAfterUpdateEventHandler","NotifyOnTeamDeletedHandlerImpl","NotifyOnTeamDeletedHandler","TeamAfterDeleteEventHandler"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,gBAAmD,CAAE;aAArDA,gBAAgB,GAAhBA;IAAsD;IAE1E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,IAAIA,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YAAE,QAAQ;QAAU;IACvF;AACJ;AAEO,MAAMC,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBJ;IAChB,cAAc;QAACK;KAAwB;AAC3C;AAEA,MAAMC;IACF,YAAoBL,gBAAmD,CAAE;aAArDA,gBAAgB,GAAhBA;IAAsD;IAE1E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,IAAIA,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE;YAAE,QAAQ;QAAU;IAC1F;AACJ;AAEO,MAAMK,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBF;IAChB,cAAc;QAACD;KAAwB;AAC3C;AAEA,MAAMI;IACF,YAAoBR,gBAAmD,CAAE;aAArDA,gBAAgB,GAAhBA;IAAsD;IAE1E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,IAAIA,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YAAE,QAAQ;QAAU;IACvF;AACJ;AAEO,MAAMQ,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBF;IAChB,cAAc;QAACJ;KAAwB;AAC3C"}
1
+ {"version":3,"file":"features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js","sources":["../../../../../src/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.ts"],"sourcesContent":["import { TeamAfterCreateEventHandler } from \"~/features/security/teams/CreateTeam/index.js\";\nimport { TeamAfterUpdateEventHandler } from \"~/features/security/teams/UpdateTeam/index.js\";\nimport { TeamAfterDeleteEventHandler } from \"~/features/security/teams/DeleteTeam/index.js\";\nimport { NotifyRecordChangeUseCase } from \"~/features/websockets/index.js\";\nimport { TEAM_RECORD_TYPE } from \"./recordType.js\";\n\nclass NotifyOnTeamCreatedHandlerImpl implements TeamAfterCreateEventHandler.Interface {\n constructor(private notifyRecordChange: NotifyRecordChangeUseCase.Interface) {}\n\n async handle(event: TeamAfterCreateEventHandler.Event): Promise<void> {\n await this.notifyRecordChange.execute({\n type: TEAM_RECORD_TYPE,\n id: event.payload.team.id,\n change: \"created\"\n });\n }\n}\n\nexport const NotifyOnTeamCreatedHandler = TeamAfterCreateEventHandler.createImplementation({\n implementation: NotifyOnTeamCreatedHandlerImpl,\n dependencies: [NotifyRecordChangeUseCase]\n});\n\nclass NotifyOnTeamUpdatedHandlerImpl implements TeamAfterUpdateEventHandler.Interface {\n constructor(private notifyRecordChange: NotifyRecordChangeUseCase.Interface) {}\n\n async handle(event: TeamAfterUpdateEventHandler.Event): Promise<void> {\n await this.notifyRecordChange.execute({\n type: TEAM_RECORD_TYPE,\n id: event.payload.updated.id,\n change: \"updated\"\n });\n }\n}\n\nexport const NotifyOnTeamUpdatedHandler = TeamAfterUpdateEventHandler.createImplementation({\n implementation: NotifyOnTeamUpdatedHandlerImpl,\n dependencies: [NotifyRecordChangeUseCase]\n});\n\nclass NotifyOnTeamDeletedHandlerImpl implements TeamAfterDeleteEventHandler.Interface {\n constructor(private notifyRecordChange: NotifyRecordChangeUseCase.Interface) {}\n\n async handle(event: TeamAfterDeleteEventHandler.Event): Promise<void> {\n await this.notifyRecordChange.execute({\n type: TEAM_RECORD_TYPE,\n id: event.payload.team.id,\n change: \"deleted\"\n });\n }\n}\n\nexport const NotifyOnTeamDeletedHandler = TeamAfterDeleteEventHandler.createImplementation({\n implementation: NotifyOnTeamDeletedHandlerImpl,\n dependencies: [NotifyRecordChangeUseCase]\n});\n"],"names":["NotifyOnTeamCreatedHandlerImpl","notifyRecordChange","event","TEAM_RECORD_TYPE","NotifyOnTeamCreatedHandler","TeamAfterCreateEventHandler","NotifyRecordChangeUseCase","NotifyOnTeamUpdatedHandlerImpl","NotifyOnTeamUpdatedHandler","TeamAfterUpdateEventHandler","NotifyOnTeamDeletedHandlerImpl","NotifyOnTeamDeletedHandler","TeamAfterDeleteEventHandler"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,kBAAuD,CAAE;aAAzDA,kBAAkB,GAAlBA;IAA0D;IAE9E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;YAClC,MAAMC;YACN,IAAID,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ;QACZ;IACJ;AACJ;AAEO,MAAME,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBL;IAChB,cAAc;QAACM;KAA0B;AAC7C;AAEA,MAAMC;IACF,YAAoBN,kBAAuD,CAAE;aAAzDA,kBAAkB,GAAlBA;IAA0D;IAE9E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;YAClC,MAAMC;YACN,IAAID,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE;YAC5B,QAAQ;QACZ;IACJ;AACJ;AAEO,MAAMM,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBF;IAChB,cAAc;QAACD;KAA0B;AAC7C;AAEA,MAAMI;IACF,YAAoBT,kBAAuD,CAAE;aAAzDA,kBAAkB,GAAlBA;IAA0D;IAE9E,MAAM,OAAOC,KAAwC,EAAiB;QAClE,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;YAClC,MAAMC;YACN,IAAID,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ;QACZ;IACJ;AACJ;AAEO,MAAMS,6BAA6BC,4BAA4B,oBAAoB,CAAC;IACvF,gBAAgBF;IAChB,cAAc;QAACJ;KAA0B;AAC7C"}
@@ -1,10 +1,8 @@
1
1
  import { createFeature } from "@webiny/feature/api";
2
- import { NotifyTeamChangeUseCase } from "./NotifyTeamChangeUseCase.js";
3
2
  import { NotifyOnTeamCreatedHandler, NotifyOnTeamDeletedHandler, NotifyOnTeamUpdatedHandler } from "./NotifyOnTeamChangeHandlers.js";
4
3
  const NotifyTeamChangeFeature = createFeature({
5
4
  name: "NotifyTeamChange",
6
5
  register (container) {
7
- container.register(NotifyTeamChangeUseCase);
8
6
  container.register(NotifyOnTeamCreatedHandler);
9
7
  container.register(NotifyOnTeamUpdatedHandler);
10
8
  container.register(NotifyOnTeamDeletedHandler);
@@ -1 +1 @@
1
- {"version":3,"file":"features/security/teams/NotifyTeamChange/feature.js","sources":["../../../../../src/features/security/teams/NotifyTeamChange/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { NotifyTeamChangeUseCase } from \"./NotifyTeamChangeUseCase.js\";\nimport {\n NotifyOnTeamCreatedHandler,\n NotifyOnTeamDeletedHandler,\n NotifyOnTeamUpdatedHandler\n} from \"./NotifyOnTeamChangeHandlers.js\";\n\n/** Tells the user's open admin tabs when a team is created, updated or deleted. */\nexport const NotifyTeamChangeFeature = createFeature({\n name: \"NotifyTeamChange\",\n register(container) {\n container.register(NotifyTeamChangeUseCase);\n container.register(NotifyOnTeamCreatedHandler);\n container.register(NotifyOnTeamUpdatedHandler);\n container.register(NotifyOnTeamDeletedHandler);\n }\n});\n"],"names":["NotifyTeamChangeFeature","createFeature","container","NotifyTeamChangeUseCase","NotifyOnTeamCreatedHandler","NotifyOnTeamUpdatedHandler","NotifyOnTeamDeletedHandler"],"mappings":";;;AASO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;IACvB;AACJ"}
1
+ {"version":3,"file":"features/security/teams/NotifyTeamChange/feature.js","sources":["../../../../../src/features/security/teams/NotifyTeamChange/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport {\n NotifyOnTeamCreatedHandler,\n NotifyOnTeamDeletedHandler,\n NotifyOnTeamUpdatedHandler\n} from \"./NotifyOnTeamChangeHandlers.js\";\n\n/** Tells the user's open admin tabs when a team is created, updated or deleted. */\nexport const NotifyTeamChangeFeature = createFeature({\n name: \"NotifyTeamChange\",\n register(container) {\n container.register(NotifyOnTeamCreatedHandler);\n container.register(NotifyOnTeamUpdatedHandler);\n container.register(NotifyOnTeamDeletedHandler);\n }\n});\n"],"names":["NotifyTeamChangeFeature","createFeature","container","NotifyOnTeamCreatedHandler","NotifyOnTeamUpdatedHandler","NotifyOnTeamDeletedHandler"],"mappings":";;AAQO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;IACvB;AACJ"}
@@ -1,2 +1,2 @@
1
1
  export { NotifyTeamChangeFeature } from "./feature.js";
2
- export { TEAM_CREATED_WEBSOCKET_ACTION, TEAM_UPDATED_WEBSOCKET_ACTION, TEAM_DELETED_WEBSOCKET_ACTION } from "./abstractions.js";
2
+ export { TEAM_RECORD_TYPE } from "./recordType.js";
@@ -1,2 +1,2 @@
1
1
  export { NotifyTeamChangeFeature } from "./feature.js";
2
- export { TEAM_CREATED_WEBSOCKET_ACTION, TEAM_DELETED_WEBSOCKET_ACTION, TEAM_UPDATED_WEBSOCKET_ACTION } from "./abstractions.js";
2
+ export { TEAM_RECORD_TYPE } from "./recordType.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The `type` of the record-changed message sent when a team changes. The admin's
3
+ * `ApplyTeamChangeToCache` filters on the same string.
4
+ */
5
+ export declare const TEAM_RECORD_TYPE = "security.team";
@@ -0,0 +1,4 @@
1
+ const TEAM_RECORD_TYPE = "security.team";
2
+ export { TEAM_RECORD_TYPE };
3
+
4
+ //# sourceMappingURL=recordType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/security/teams/NotifyTeamChange/recordType.js","sources":["../../../../../src/features/security/teams/NotifyTeamChange/recordType.ts"],"sourcesContent":["/**\n * The `type` of the record-changed message sent when a team changes. The admin's\n * `ApplyTeamChangeToCache` filters on the same string.\n */\nexport const TEAM_RECORD_TYPE = \"security.team\";\n"],"names":["TEAM_RECORD_TYPE"],"mappings":"AAIO,MAAMA,mBAAmB"}