@webiny/api-core 6.6.0-alpha.10 → 6.6.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApiCoreFeature.js +4 -0
- package/ApiCoreFeature.js.map +1 -1
- package/exports/api.d.ts +1 -0
- package/exports/api.js +1 -0
- package/features/cdnCache/NullCdnCache.d.ts +8 -0
- package/features/cdnCache/NullCdnCache.js +11 -0
- package/features/cdnCache/NullCdnCache.js.map +1 -0
- package/features/cdnCache/abstractions.d.ts +20 -0
- package/features/cdnCache/abstractions.js +5 -0
- package/features/cdnCache/abstractions.js.map +1 -0
- package/features/cdnCache/feature.d.ts +8 -0
- package/features/cdnCache/feature.js +11 -0
- package/features/cdnCache/feature.js.map +1 -0
- package/features/cdnCache/index.d.ts +2 -0
- package/features/cdnCache/index.js +2 -0
- package/features/requestStorage/abstractions.d.ts +23 -0
- package/features/requestStorage/abstractions.js +5 -0
- package/features/requestStorage/abstractions.js.map +1 -0
- package/features/requestStorage/index.d.ts +1 -0
- package/features/requestStorage/index.js +1 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js +22 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js +22 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js +22 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.js +40 -0
- package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/abstractions.d.ts +21 -0
- package/features/security/roles/NotifyRoleChange/abstractions.js +8 -0
- package/features/security/roles/NotifyRoleChange/abstractions.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/feature.d.ts +5 -0
- package/features/security/roles/NotifyRoleChange/feature.js +17 -0
- package/features/security/roles/NotifyRoleChange/feature.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/index.d.ts +2 -0
- package/features/security/roles/NotifyRoleChange/index.js +2 -0
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +2 -1
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
- package/features/security/roles/feature.js +2 -0
- package/features/security/roles/feature.js.map +1 -1
- package/features/security/shared/definedOnly.d.ts +1 -0
- package/features/security/shared/definedOnly.js +8 -0
- package/features/security/shared/definedOnly.js.map +1 -0
- package/features/security/shared/index.d.ts +1 -0
- package/features/security/shared/index.js +1 -0
- package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.d.ts +29 -0
- package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js +58 -0
- package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.d.ts +11 -0
- package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.js +40 -0
- package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/abstractions.d.ts +21 -0
- package/features/security/teams/NotifyTeamChange/abstractions.js +8 -0
- package/features/security/teams/NotifyTeamChange/abstractions.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/feature.d.ts +5 -0
- package/features/security/teams/NotifyTeamChange/feature.js +15 -0
- package/features/security/teams/NotifyTeamChange/feature.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/index.d.ts +2 -0
- package/features/security/teams/NotifyTeamChange/index.js +2 -0
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +2 -1
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
- package/features/security/teams/feature.js +2 -0
- package/features/security/teams/feature.js.map +1 -1
- package/features/task/TaskService/abstractions.d.ts +7 -0
- package/features/task/TaskService/abstractions.js.map +1 -1
- package/features/websockets/SendToIdentity/NullSendToIdentityUseCase.d.ts +20 -0
- package/features/websockets/SendToIdentity/NullSendToIdentityUseCase.js +24 -0
- package/features/websockets/SendToIdentity/NullSendToIdentityUseCase.js.map +1 -0
- package/features/websockets/SendToIdentity/abstractions.d.ts +19 -0
- package/features/websockets/SendToIdentity/abstractions.js +5 -0
- package/features/websockets/SendToIdentity/abstractions.js.map +1 -0
- package/features/websockets/WebsocketServiceError.d.ts +7 -0
- package/features/websockets/WebsocketServiceError.js +14 -0
- package/features/websockets/WebsocketServiceError.js.map +1 -0
- package/features/websockets/index.d.ts +6 -0
- package/features/websockets/index.js +3 -0
- package/features/websockets/types.d.ts +15 -0
- package/features/websockets/types.js +0 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +11 -11
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TeamAfterCreateEventHandler } from "../../../../features/security/teams/CreateTeam/index.js";
|
|
2
|
+
import { TeamAfterUpdateEventHandler } from "../../../../features/security/teams/UpdateTeam/index.js";
|
|
3
|
+
import { TeamAfterDeleteEventHandler } from "../../../../features/security/teams/DeleteTeam/index.js";
|
|
4
|
+
import { NotifyTeamChangeUseCase } from "./abstractions.js";
|
|
5
|
+
declare class NotifyOnTeamCreatedHandlerImpl implements TeamAfterCreateEventHandler.Interface {
|
|
6
|
+
private notifyTeamChange;
|
|
7
|
+
constructor(notifyTeamChange: NotifyTeamChangeUseCase.Interface);
|
|
8
|
+
handle(event: TeamAfterCreateEventHandler.Event): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const NotifyOnTeamCreatedHandler: typeof NotifyOnTeamCreatedHandlerImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("../../../eventPublisher/abstractions.js").IEventHandler<import("../CreateTeam/events.js").TeamAfterCreateEvent>>;
|
|
12
|
+
};
|
|
13
|
+
declare class NotifyOnTeamUpdatedHandlerImpl implements TeamAfterUpdateEventHandler.Interface {
|
|
14
|
+
private notifyTeamChange;
|
|
15
|
+
constructor(notifyTeamChange: NotifyTeamChangeUseCase.Interface);
|
|
16
|
+
handle(event: TeamAfterUpdateEventHandler.Event): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare const NotifyOnTeamUpdatedHandler: typeof NotifyOnTeamUpdatedHandlerImpl & {
|
|
19
|
+
__abstraction: import("@webiny/di").Abstraction<import("../../../eventPublisher/abstractions.js").IEventHandler<import("~/features/security/teams/UpdateTeam/index.js").TeamAfterUpdateEvent>>;
|
|
20
|
+
};
|
|
21
|
+
declare class NotifyOnTeamDeletedHandlerImpl implements TeamAfterDeleteEventHandler.Interface {
|
|
22
|
+
private notifyTeamChange;
|
|
23
|
+
constructor(notifyTeamChange: NotifyTeamChangeUseCase.Interface);
|
|
24
|
+
handle(event: TeamAfterDeleteEventHandler.Event): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export declare const NotifyOnTeamDeletedHandler: typeof NotifyOnTeamDeletedHandlerImpl & {
|
|
27
|
+
__abstraction: import("@webiny/di").Abstraction<import("../../../eventPublisher/abstractions.js").IEventHandler<import("~/features/security/teams/DeleteTeam/index.js").TeamAfterDeleteEvent>>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TeamAfterCreateEventHandler } from "../CreateTeam/index.js";
|
|
2
|
+
import { TeamAfterUpdateEventHandler } from "../UpdateTeam/index.js";
|
|
3
|
+
import { TeamAfterDeleteEventHandler } from "../DeleteTeam/index.js";
|
|
4
|
+
import { NotifyTeamChangeUseCase } from "./abstractions.js";
|
|
5
|
+
class NotifyOnTeamCreatedHandlerImpl {
|
|
6
|
+
constructor(notifyTeamChange){
|
|
7
|
+
this.notifyTeamChange = notifyTeamChange;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
await this.notifyTeamChange.execute({
|
|
11
|
+
id: event.payload.team.id,
|
|
12
|
+
change: "created"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const NotifyOnTeamCreatedHandler = TeamAfterCreateEventHandler.createImplementation({
|
|
17
|
+
implementation: NotifyOnTeamCreatedHandlerImpl,
|
|
18
|
+
dependencies: [
|
|
19
|
+
NotifyTeamChangeUseCase
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
class NotifyOnTeamUpdatedHandlerImpl {
|
|
23
|
+
constructor(notifyTeamChange){
|
|
24
|
+
this.notifyTeamChange = notifyTeamChange;
|
|
25
|
+
}
|
|
26
|
+
async handle(event) {
|
|
27
|
+
await this.notifyTeamChange.execute({
|
|
28
|
+
id: event.payload.updated.id,
|
|
29
|
+
change: "updated"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const NotifyOnTeamUpdatedHandler = TeamAfterUpdateEventHandler.createImplementation({
|
|
34
|
+
implementation: NotifyOnTeamUpdatedHandlerImpl,
|
|
35
|
+
dependencies: [
|
|
36
|
+
NotifyTeamChangeUseCase
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
class NotifyOnTeamDeletedHandlerImpl {
|
|
40
|
+
constructor(notifyTeamChange){
|
|
41
|
+
this.notifyTeamChange = notifyTeamChange;
|
|
42
|
+
}
|
|
43
|
+
async handle(event) {
|
|
44
|
+
await this.notifyTeamChange.execute({
|
|
45
|
+
id: event.payload.team.id,
|
|
46
|
+
change: "deleted"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const NotifyOnTeamDeletedHandler = TeamAfterDeleteEventHandler.createImplementation({
|
|
51
|
+
implementation: NotifyOnTeamDeletedHandlerImpl,
|
|
52
|
+
dependencies: [
|
|
53
|
+
NotifyTeamChangeUseCase
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
export { NotifyOnTeamCreatedHandler, NotifyOnTeamDeletedHandler, NotifyOnTeamUpdatedHandler };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=NotifyOnTeamChangeHandlers.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IdentityContext } from "../../../../features/security/IdentityContext/abstractions.js";
|
|
2
|
+
import { WebsocketsSendToIdentityUseCase } from "../../../../features/websockets/index.js";
|
|
3
|
+
import { NotifyTeamChangeUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
4
|
+
declare class NotifyTeamChangeUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
private identityContext;
|
|
6
|
+
private sendToIdentity;
|
|
7
|
+
constructor(identityContext: IdentityContext.Interface, sendToIdentity: WebsocketsSendToIdentityUseCase.Interface);
|
|
8
|
+
execute({ id, change }: UseCaseAbstraction.Params): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const NotifyTeamChangeUseCase: import("@webiny/di").Implementation<typeof NotifyTeamChangeUseCaseImpl>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { IdentityContext } from "../../IdentityContext/abstractions.js";
|
|
3
|
+
import { WebsocketsSendToIdentityUseCase } from "../../../websockets/index.js";
|
|
4
|
+
import { NotifyTeamChangeUseCase, TEAM_CREATED_WEBSOCKET_ACTION, TEAM_DELETED_WEBSOCKET_ACTION, TEAM_UPDATED_WEBSOCKET_ACTION } from "./abstractions.js";
|
|
5
|
+
const ACTIONS = {
|
|
6
|
+
created: TEAM_CREATED_WEBSOCKET_ACTION,
|
|
7
|
+
updated: TEAM_UPDATED_WEBSOCKET_ACTION,
|
|
8
|
+
deleted: TEAM_DELETED_WEBSOCKET_ACTION
|
|
9
|
+
};
|
|
10
|
+
class NotifyTeamChangeUseCaseImpl {
|
|
11
|
+
constructor(identityContext, sendToIdentity){
|
|
12
|
+
this.identityContext = identityContext;
|
|
13
|
+
this.sendToIdentity = sendToIdentity;
|
|
14
|
+
}
|
|
15
|
+
async execute({ id, change }) {
|
|
16
|
+
const recipient = this.identityContext.getIdentity()?.id;
|
|
17
|
+
if (!recipient) return;
|
|
18
|
+
try {
|
|
19
|
+
await this.sendToIdentity.execute({
|
|
20
|
+
id: recipient
|
|
21
|
+
}, {
|
|
22
|
+
action: ACTIONS[change],
|
|
23
|
+
data: {
|
|
24
|
+
id
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
} catch {}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const NotifyTeamChangeUseCase_NotifyTeamChangeUseCase = createImplementation({
|
|
31
|
+
abstraction: NotifyTeamChangeUseCase,
|
|
32
|
+
implementation: NotifyTeamChangeUseCaseImpl,
|
|
33
|
+
dependencies: [
|
|
34
|
+
IdentityContext,
|
|
35
|
+
WebsocketsSendToIdentityUseCase
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
export { NotifyTeamChangeUseCase_NotifyTeamChangeUseCase as NotifyTeamChangeUseCase };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=NotifyTeamChangeUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.js","sources":["../../../../../src/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { IdentityContext } from \"~/features/security/IdentityContext/abstractions.js\";\nimport { WebsocketsSendToIdentityUseCase } from \"~/features/websockets/index.js\";\nimport {\n TEAM_CREATED_WEBSOCKET_ACTION,\n TEAM_DELETED_WEBSOCKET_ACTION,\n TEAM_UPDATED_WEBSOCKET_ACTION,\n NotifyTeamChangeUseCase as UseCaseAbstraction\n} from \"./abstractions.js\";\n\nconst ACTIONS: Record<UseCaseAbstraction.Params[\"change\"], string> = {\n created: TEAM_CREATED_WEBSOCKET_ACTION,\n updated: TEAM_UPDATED_WEBSOCKET_ACTION,\n deleted: TEAM_DELETED_WEBSOCKET_ACTION\n};\n\n/*\n * Changes the admin makes itself are announced too: the admin applies them by id, so the tab that\n * made the change ends up where it already was and the user's other tabs catch up.\n *\n * The change is saved whether or not the message goes out, so a failed send is swallowed rather than\n * failing the write. The admin then shows the change after its next reload.\n */\nclass NotifyTeamChangeUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private identityContext: IdentityContext.Interface,\n private sendToIdentity: WebsocketsSendToIdentityUseCase.Interface\n ) {}\n\n async execute({ id, change }: UseCaseAbstraction.Params): Promise<void> {\n const recipient = this.identityContext.getIdentity()?.id;\n if (!recipient) {\n return;\n }\n\n try {\n await this.sendToIdentity.execute(\n { id: recipient },\n { action: ACTIONS[change], data: { id } }\n );\n } catch {\n // See above.\n }\n }\n}\n\nexport const NotifyTeamChangeUseCase = createImplementation({\n abstraction: UseCaseAbstraction,\n implementation: NotifyTeamChangeUseCaseImpl,\n dependencies: [IdentityContext, WebsocketsSendToIdentityUseCase]\n});\n"],"names":["ACTIONS","TEAM_CREATED_WEBSOCKET_ACTION","TEAM_UPDATED_WEBSOCKET_ACTION","TEAM_DELETED_WEBSOCKET_ACTION","NotifyTeamChangeUseCaseImpl","identityContext","sendToIdentity","id","change","recipient","NotifyTeamChangeUseCase","createImplementation","UseCaseAbstraction","IdentityContext","WebsocketsSendToIdentityUseCase"],"mappings":";;;;AAUA,MAAMA,UAA+D;IACjE,SAASC;IACT,SAASC;IACT,SAASC;AACb;AASA,MAAMC;IACF,YACYC,eAA0C,EAC1CC,cAAyD,CACnE;aAFUD,eAAe,GAAfA;aACAC,cAAc,GAAdA;IACT;IAEH,MAAM,QAAQ,EAAEC,EAAE,EAAEC,MAAM,EAA6B,EAAiB;QACpE,MAAMC,YAAY,IAAI,CAAC,eAAe,CAAC,WAAW,IAAI;QACtD,IAAI,CAACA,WACD;QAGJ,IAAI;YACA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B;gBAAE,IAAIA;YAAU,GAChB;gBAAE,QAAQT,OAAO,CAACQ,OAAO;gBAAE,MAAM;oBAAED;gBAAG;YAAE;QAEhD,EAAE,OAAM,CAER;IACJ;AACJ;AAEO,MAAMG,kDAA0BC,qBAAqB;IACxD,aAAaC;IACb,gBAAgBR;IAChB,cAAc;QAACS;QAAiBC;KAAgC;AACpE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sent to the user's open admin tabs when a team changes. The admin keeps its own teams list, and a
|
|
3
|
+
* change made on the server (by the assistant's team tools, for one) never passes through it, so
|
|
4
|
+
* without these the Teams view shows the old list until a reload. Each carries the team id only; the
|
|
5
|
+
* admin reads the team back, or drops it for `deleted`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TEAM_CREATED_WEBSOCKET_ACTION = "security.team.created";
|
|
8
|
+
export declare const TEAM_UPDATED_WEBSOCKET_ACTION = "security.team.updated";
|
|
9
|
+
export declare const TEAM_DELETED_WEBSOCKET_ACTION = "security.team.deleted";
|
|
10
|
+
export interface NotifyTeamChangeParams {
|
|
11
|
+
id: string;
|
|
12
|
+
change: "created" | "updated" | "deleted";
|
|
13
|
+
}
|
|
14
|
+
export interface INotifyTeamChangeUseCase {
|
|
15
|
+
execute(params: NotifyTeamChangeParams): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare const NotifyTeamChangeUseCase: import("@webiny/di").Abstraction<INotifyTeamChangeUseCase>;
|
|
18
|
+
export declare namespace NotifyTeamChangeUseCase {
|
|
19
|
+
type Interface = INotifyTeamChangeUseCase;
|
|
20
|
+
type Params = NotifyTeamChangeParams;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
const TEAM_CREATED_WEBSOCKET_ACTION = "security.team.created";
|
|
3
|
+
const TEAM_UPDATED_WEBSOCKET_ACTION = "security.team.updated";
|
|
4
|
+
const TEAM_DELETED_WEBSOCKET_ACTION = "security.team.deleted";
|
|
5
|
+
const NotifyTeamChangeUseCase = createAbstraction("Security/NotifyTeamChangeUseCase");
|
|
6
|
+
export { NotifyTeamChangeUseCase, TEAM_CREATED_WEBSOCKET_ACTION, TEAM_DELETED_WEBSOCKET_ACTION, TEAM_UPDATED_WEBSOCKET_ACTION };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/security/teams/NotifyTeamChange/abstractions.js","sources":["../../../../../src/features/security/teams/NotifyTeamChange/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\n\n/**\n * Sent to the user's open admin tabs when a team changes. The admin keeps its own teams list, and a\n * change made on the server (by the assistant's team tools, for one) never passes through it, so\n * without these the Teams view shows the old list until a reload. Each carries the team id only; the\n * admin reads the team back, or drops it for `deleted`.\n */\nexport const TEAM_CREATED_WEBSOCKET_ACTION = \"security.team.created\";\nexport const TEAM_UPDATED_WEBSOCKET_ACTION = \"security.team.updated\";\nexport const TEAM_DELETED_WEBSOCKET_ACTION = \"security.team.deleted\";\n\nexport interface NotifyTeamChangeParams {\n id: string;\n change: \"created\" | \"updated\" | \"deleted\";\n}\n\nexport interface INotifyTeamChangeUseCase {\n execute(params: NotifyTeamChangeParams): Promise<void>;\n}\n\nexport const NotifyTeamChangeUseCase = createAbstraction<INotifyTeamChangeUseCase>(\n \"Security/NotifyTeamChangeUseCase\"\n);\n\nexport namespace NotifyTeamChangeUseCase {\n export type Interface = INotifyTeamChangeUseCase;\n export type Params = NotifyTeamChangeParams;\n}\n"],"names":["TEAM_CREATED_WEBSOCKET_ACTION","TEAM_UPDATED_WEBSOCKET_ACTION","TEAM_DELETED_WEBSOCKET_ACTION","NotifyTeamChangeUseCase","createAbstraction"],"mappings":";AAQO,MAAMA,gCAAgC;AACtC,MAAMC,gCAAgC;AACtC,MAAMC,gCAAgC;AAWtC,MAAMC,0BAA0BC,kBACnC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { NotifyTeamChangeUseCase } from "./NotifyTeamChangeUseCase.js";
|
|
3
|
+
import { NotifyOnTeamCreatedHandler, NotifyOnTeamDeletedHandler, NotifyOnTeamUpdatedHandler } from "./NotifyOnTeamChangeHandlers.js";
|
|
4
|
+
const NotifyTeamChangeFeature = createFeature({
|
|
5
|
+
name: "NotifyTeamChange",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(NotifyTeamChangeUseCase);
|
|
8
|
+
container.register(NotifyOnTeamCreatedHandler);
|
|
9
|
+
container.register(NotifyOnTeamUpdatedHandler);
|
|
10
|
+
container.register(NotifyOnTeamDeletedHandler);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export { NotifyTeamChangeFeature };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -7,6 +7,7 @@ import { EventPublisher } from "../../../eventPublisher/index.js";
|
|
|
7
7
|
import { updateTeamValidation } from "./schema.js";
|
|
8
8
|
import { TeamAfterUpdateEvent, TeamBeforeUpdateEvent } from "./events.js";
|
|
9
9
|
import { descriptionOnUpdate } from "../../shared/description.js";
|
|
10
|
+
import { definedOnly } from "../../shared/definedOnly.js";
|
|
10
11
|
import { resolveRoleIdentifiers } from "../shared/resolveRoleIdentifiers.js";
|
|
11
12
|
import { CannotUpdatePluginTeamsError, CannotUpdateSystemTeamsError, NotAuthorizedError, TeamValidationError } from "../shared/errors.js";
|
|
12
13
|
class UpdateTeamUseCase {
|
|
@@ -30,7 +31,7 @@ class UpdateTeamUseCase {
|
|
|
30
31
|
if (existingTeam.plugin) return Result.fail(new CannotUpdatePluginTeamsError());
|
|
31
32
|
const { description, ...rest } = validation.data;
|
|
32
33
|
const changes = {
|
|
33
|
-
...rest,
|
|
34
|
+
...definedOnly(rest),
|
|
34
35
|
...descriptionOnUpdate(description)
|
|
35
36
|
};
|
|
36
37
|
if (changes.roles) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/security/teams/UpdateTeam/UpdateTeamUseCase.js","sources":["../../../../../src/features/security/teams/UpdateTeam/UpdateTeamUseCase.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport { UpdateTeam } from \"./abstractions.js\";\nimport { TeamsRepository } from \"../shared/abstractions.js\";\nimport { RolesRepository } from \"../../roles/shared/abstractions.js\";\nimport { IdentityContext } from \"../../IdentityContext/abstractions.js\";\nimport { EventPublisher } from \"~/features/eventPublisher/index.js\";\nimport { updateTeamValidation } from \"./schema.js\";\nimport { TeamBeforeUpdateEvent, TeamAfterUpdateEvent } from \"./events.js\";\nimport type { Team, UpdateTeamInput } from \"../shared/types.js\";\nimport { descriptionOnUpdate } from \"../../shared/description.js\";\nimport { resolveRoleIdentifiers } from \"../shared/resolveRoleIdentifiers.js\";\nimport {\n NotAuthorizedError,\n CannotUpdatePluginTeamsError,\n CannotUpdateSystemTeamsError,\n TeamValidationError\n} from \"../shared/errors.js\";\n\nexport class UpdateTeamUseCase {\n private repository: TeamsRepository.Interface;\n private identityContext: IdentityContext.Interface;\n private eventPublisher: EventPublisher.Interface;\n private rolesRepository: RolesRepository.Interface;\n\n constructor(\n repository: TeamsRepository.Interface,\n identityContext: IdentityContext.Interface,\n eventPublisher: EventPublisher.Interface,\n rolesRepository: RolesRepository.Interface\n ) {\n this.repository = repository;\n this.identityContext = identityContext;\n this.eventPublisher = eventPublisher;\n this.rolesRepository = rolesRepository;\n }\n\n async execute(id: string, input: UpdateTeamInput): Promise<Result<Team, UpdateTeam.Error>> {\n const hasPermission = await this.identityContext.getPermission(\"security.team\");\n if (!hasPermission) {\n return Result.fail(new NotAuthorizedError());\n }\n\n const validation = updateTeamValidation.safeParse(input);\n if (!validation.success) {\n return Result.fail(new TeamValidationError(validation.error.issues[0].message));\n }\n\n const existingResult = await this.repository.get({ id });\n if (existingResult.isFail()) {\n return Result.fail(existingResult.error);\n }\n\n const existingTeam = existingResult.value;\n\n // Check if team is system team\n if (existingTeam.system) {\n return Result.fail(new CannotUpdateSystemTeamsError());\n }\n\n // Check if team is created via plugin\n if (existingTeam.plugin) {\n return Result.fail(new CannotUpdatePluginTeamsError());\n }\n\n // `description` is pulled out of the spread because it is the one field that accepts null.\n // Normalising it here keeps null out of both the entity and the published events, whose\n // input type declares `description?: string`.\n const { description, ...rest } = validation.data;\n\n const changes: UpdateTeamInput = {\n ...rest,\n ...descriptionOnUpdate(description)\n };\n\n /*\n * Only when the update mentions roles. An update that omits them must leave the stored ones\n * alone, and resolving an absent list would cost a read and write an empty array.\n */\n if (changes.roles) {\n const roleIdsResult = await resolveRoleIdentifiers(this.rolesRepository, changes.roles);\n\n if (roleIdsResult.isFail()) {\n return Result.fail(roleIdsResult.error);\n }\n\n changes.roles = roleIdsResult.value;\n }\n\n const updatedTeam: Team = {\n ...existingTeam,\n ...changes\n };\n\n await this.eventPublisher.publish(\n new TeamBeforeUpdateEvent({\n original: existingTeam,\n updated: updatedTeam,\n input: changes\n })\n );\n\n const result = await this.repository.update(updatedTeam);\n\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n await this.eventPublisher.publish(\n new TeamAfterUpdateEvent({\n original: existingTeam,\n updated: updatedTeam,\n input: changes\n })\n );\n\n return Result.ok(updatedTeam);\n }\n}\n\nexport const UpdateTeamUseCaseImpl = createImplementation({\n abstraction: UpdateTeam,\n implementation: UpdateTeamUseCase,\n dependencies: [TeamsRepository, IdentityContext, EventPublisher, RolesRepository]\n});\n"],"names":["UpdateTeamUseCase","repository","identityContext","eventPublisher","rolesRepository","id","input","hasPermission","Result","NotAuthorizedError","validation","updateTeamValidation","TeamValidationError","existingResult","existingTeam","CannotUpdateSystemTeamsError","CannotUpdatePluginTeamsError","description","rest","changes","descriptionOnUpdate","roleIdsResult","resolveRoleIdentifiers","updatedTeam","TeamBeforeUpdateEvent","result","TeamAfterUpdateEvent","UpdateTeamUseCaseImpl","createImplementation","UpdateTeam","TeamsRepository","IdentityContext","EventPublisher","RolesRepository"],"mappings":"
|
|
1
|
+
{"version":3,"file":"features/security/teams/UpdateTeam/UpdateTeamUseCase.js","sources":["../../../../../src/features/security/teams/UpdateTeam/UpdateTeamUseCase.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport { UpdateTeam } from \"./abstractions.js\";\nimport { TeamsRepository } from \"../shared/abstractions.js\";\nimport { RolesRepository } from \"../../roles/shared/abstractions.js\";\nimport { IdentityContext } from \"../../IdentityContext/abstractions.js\";\nimport { EventPublisher } from \"~/features/eventPublisher/index.js\";\nimport { updateTeamValidation } from \"./schema.js\";\nimport { TeamBeforeUpdateEvent, TeamAfterUpdateEvent } from \"./events.js\";\nimport type { Team, UpdateTeamInput } from \"../shared/types.js\";\nimport { descriptionOnUpdate } from \"../../shared/description.js\";\nimport { definedOnly } from \"../../shared/definedOnly.js\";\nimport { resolveRoleIdentifiers } from \"../shared/resolveRoleIdentifiers.js\";\nimport {\n NotAuthorizedError,\n CannotUpdatePluginTeamsError,\n CannotUpdateSystemTeamsError,\n TeamValidationError\n} from \"../shared/errors.js\";\n\nexport class UpdateTeamUseCase {\n private repository: TeamsRepository.Interface;\n private identityContext: IdentityContext.Interface;\n private eventPublisher: EventPublisher.Interface;\n private rolesRepository: RolesRepository.Interface;\n\n constructor(\n repository: TeamsRepository.Interface,\n identityContext: IdentityContext.Interface,\n eventPublisher: EventPublisher.Interface,\n rolesRepository: RolesRepository.Interface\n ) {\n this.repository = repository;\n this.identityContext = identityContext;\n this.eventPublisher = eventPublisher;\n this.rolesRepository = rolesRepository;\n }\n\n async execute(id: string, input: UpdateTeamInput): Promise<Result<Team, UpdateTeam.Error>> {\n const hasPermission = await this.identityContext.getPermission(\"security.team\");\n if (!hasPermission) {\n return Result.fail(new NotAuthorizedError());\n }\n\n const validation = updateTeamValidation.safeParse(input);\n if (!validation.success) {\n return Result.fail(new TeamValidationError(validation.error.issues[0].message));\n }\n\n const existingResult = await this.repository.get({ id });\n if (existingResult.isFail()) {\n return Result.fail(existingResult.error);\n }\n\n const existingTeam = existingResult.value;\n\n // Check if team is system team\n if (existingTeam.system) {\n return Result.fail(new CannotUpdateSystemTeamsError());\n }\n\n // Check if team is created via plugin\n if (existingTeam.plugin) {\n return Result.fail(new CannotUpdatePluginTeamsError());\n }\n\n // `description` is pulled out of the spread because it is the one field that accepts null.\n // Normalising it here keeps null out of both the entity and the published events, whose\n // input type declares `description?: string`.\n const { description, ...rest } = validation.data;\n\n const changes: UpdateTeamInput = {\n ...definedOnly(rest),\n ...descriptionOnUpdate(description)\n };\n\n /*\n * Only when the update mentions roles. An update that omits them must leave the stored ones\n * alone, and resolving an absent list would cost a read and write an empty array.\n */\n if (changes.roles) {\n const roleIdsResult = await resolveRoleIdentifiers(this.rolesRepository, changes.roles);\n\n if (roleIdsResult.isFail()) {\n return Result.fail(roleIdsResult.error);\n }\n\n changes.roles = roleIdsResult.value;\n }\n\n const updatedTeam: Team = {\n ...existingTeam,\n ...changes\n };\n\n await this.eventPublisher.publish(\n new TeamBeforeUpdateEvent({\n original: existingTeam,\n updated: updatedTeam,\n input: changes\n })\n );\n\n const result = await this.repository.update(updatedTeam);\n\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n await this.eventPublisher.publish(\n new TeamAfterUpdateEvent({\n original: existingTeam,\n updated: updatedTeam,\n input: changes\n })\n );\n\n return Result.ok(updatedTeam);\n }\n}\n\nexport const UpdateTeamUseCaseImpl = createImplementation({\n abstraction: UpdateTeam,\n implementation: UpdateTeamUseCase,\n dependencies: [TeamsRepository, IdentityContext, EventPublisher, RolesRepository]\n});\n"],"names":["UpdateTeamUseCase","repository","identityContext","eventPublisher","rolesRepository","id","input","hasPermission","Result","NotAuthorizedError","validation","updateTeamValidation","TeamValidationError","existingResult","existingTeam","CannotUpdateSystemTeamsError","CannotUpdatePluginTeamsError","description","rest","changes","definedOnly","descriptionOnUpdate","roleIdsResult","resolveRoleIdentifiers","updatedTeam","TeamBeforeUpdateEvent","result","TeamAfterUpdateEvent","UpdateTeamUseCaseImpl","createImplementation","UpdateTeam","TeamsRepository","IdentityContext","EventPublisher","RolesRepository"],"mappings":";;;;;;;;;;;;AAoBO,MAAMA;IAMT,YACIC,UAAqC,EACrCC,eAA0C,EAC1CC,cAAwC,EACxCC,eAA0C,CAC5C;QACE,IAAI,CAAC,UAAU,GAAGH;QAClB,IAAI,CAAC,eAAe,GAAGC;QACvB,IAAI,CAAC,cAAc,GAAGC;QACtB,IAAI,CAAC,eAAe,GAAGC;IAC3B;IAEA,MAAM,QAAQC,EAAU,EAAEC,KAAsB,EAA2C;QACvF,MAAMC,gBAAgB,MAAM,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC;QAC/D,IAAI,CAACA,eACD,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,aAAaC,qBAAqB,SAAS,CAACL;QAClD,IAAI,CAACI,WAAW,OAAO,EACnB,OAAOF,OAAO,IAAI,CAAC,IAAII,oBAAoBF,WAAW,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO;QAGjF,MAAMG,iBAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAER;QAAG;QACtD,IAAIQ,eAAe,MAAM,IACrB,OAAOL,OAAO,IAAI,CAACK,eAAe,KAAK;QAG3C,MAAMC,eAAeD,eAAe,KAAK;QAGzC,IAAIC,aAAa,MAAM,EACnB,OAAON,OAAO,IAAI,CAAC,IAAIO;QAI3B,IAAID,aAAa,MAAM,EACnB,OAAON,OAAO,IAAI,CAAC,IAAIQ;QAM3B,MAAM,EAAEC,WAAW,EAAE,GAAGC,MAAM,GAAGR,WAAW,IAAI;QAEhD,MAAMS,UAA2B;YAC7B,GAAGC,YAAYF,KAAK;YACpB,GAAGG,oBAAoBJ,YAAY;QACvC;QAMA,IAAIE,QAAQ,KAAK,EAAE;YACf,MAAMG,gBAAgB,MAAMC,uBAAuB,IAAI,CAAC,eAAe,EAAEJ,QAAQ,KAAK;YAEtF,IAAIG,cAAc,MAAM,IACpB,OAAOd,OAAO,IAAI,CAACc,cAAc,KAAK;YAG1CH,QAAQ,KAAK,GAAGG,cAAc,KAAK;QACvC;QAEA,MAAME,cAAoB;YACtB,GAAGV,YAAY;YACf,GAAGK,OAAO;QACd;QAEA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIM,sBAAsB;YACtB,UAAUX;YACV,SAASU;YACT,OAAOL;QACX;QAGJ,MAAMO,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAACF;QAE5C,IAAIE,OAAO,MAAM,IACb,OAAOlB,OAAO,IAAI,CAACkB,OAAO,KAAK;QAGnC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIC,qBAAqB;YACrB,UAAUb;YACV,SAASU;YACT,OAAOL;QACX;QAGJ,OAAOX,OAAO,EAAE,CAACgB;IACrB;AACJ;AAEO,MAAMI,wBAAwBC,qBAAqB;IACtD,aAAaC;IACb,gBAAgB9B;IAChB,cAAc;QAAC+B;QAAiBC;QAAiBC;QAAgBC;KAAgB;AACrF"}
|
|
@@ -7,6 +7,7 @@ import { ListTeamsFeature } from "./ListTeams/feature.js";
|
|
|
7
7
|
import { CreateTeamFeature } from "./CreateTeam/feature.js";
|
|
8
8
|
import { UpdateTeamFeature } from "./UpdateTeam/feature.js";
|
|
9
9
|
import { DeleteTeamFeature } from "./DeleteTeam/feature.js";
|
|
10
|
+
import { NotifyTeamChangeFeature } from "./NotifyTeamChange/index.js";
|
|
10
11
|
const TeamsFeature = createFeature({
|
|
11
12
|
name: "Teams",
|
|
12
13
|
register (container) {
|
|
@@ -18,6 +19,7 @@ const TeamsFeature = createFeature({
|
|
|
18
19
|
CreateTeamFeature.register(container);
|
|
19
20
|
UpdateTeamFeature.register(container);
|
|
20
21
|
DeleteTeamFeature.register(container);
|
|
22
|
+
NotifyTeamChangeFeature.register(container);
|
|
21
23
|
}
|
|
22
24
|
});
|
|
23
25
|
export { TeamsFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/security/teams/feature.js","sources":["../../../../src/features/security/teams/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { TeamsRepository } from \"./shared/TeamsRepository.js\";\nimport { TeamProvider } from \"./shared/TeamProvider.js\";\nimport { TeamsRepositoryCachingDecorator } from \"./shared/decorators/TeamsRepositoryCachingDecorator.js\";\nimport { GetTeamFeature } from \"./GetTeam/feature.js\";\nimport { ListTeamsFeature } from \"./ListTeams/feature.js\";\nimport { CreateTeamFeature } from \"./CreateTeam/feature.js\";\nimport { UpdateTeamFeature } from \"./UpdateTeam/feature.js\";\nimport { DeleteTeamFeature } from \"./DeleteTeam/feature.js\";\n\nexport const TeamsFeature = createFeature({\n name: \"Teams\",\n register(container) {\n // Register repository in singleton scope\n container.register(TeamsRepository).inSingletonScope();\n container.register(TeamProvider).inSingletonScope();\n\n // Register caching decorator\n container.registerDecorator(TeamsRepositoryCachingDecorator);\n\n // Register all use cases\n GetTeamFeature.register(container);\n ListTeamsFeature.register(container);\n CreateTeamFeature.register(container);\n UpdateTeamFeature.register(container);\n DeleteTeamFeature.register(container);\n }\n});\n"],"names":["TeamsFeature","createFeature","container","TeamsRepository","TeamProvider","TeamsRepositoryCachingDecorator","GetTeamFeature","ListTeamsFeature","CreateTeamFeature","UpdateTeamFeature","DeleteTeamFeature"],"mappings":"
|
|
1
|
+
{"version":3,"file":"features/security/teams/feature.js","sources":["../../../../src/features/security/teams/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { TeamsRepository } from \"./shared/TeamsRepository.js\";\nimport { TeamProvider } from \"./shared/TeamProvider.js\";\nimport { TeamsRepositoryCachingDecorator } from \"./shared/decorators/TeamsRepositoryCachingDecorator.js\";\nimport { GetTeamFeature } from \"./GetTeam/feature.js\";\nimport { ListTeamsFeature } from \"./ListTeams/feature.js\";\nimport { CreateTeamFeature } from \"./CreateTeam/feature.js\";\nimport { UpdateTeamFeature } from \"./UpdateTeam/feature.js\";\nimport { DeleteTeamFeature } from \"./DeleteTeam/feature.js\";\nimport { NotifyTeamChangeFeature } from \"./NotifyTeamChange/index.js\";\n\nexport const TeamsFeature = createFeature({\n name: \"Teams\",\n register(container) {\n // Register repository in singleton scope\n container.register(TeamsRepository).inSingletonScope();\n container.register(TeamProvider).inSingletonScope();\n\n // Register caching decorator\n container.registerDecorator(TeamsRepositoryCachingDecorator);\n\n // Register all use cases\n GetTeamFeature.register(container);\n ListTeamsFeature.register(container);\n CreateTeamFeature.register(container);\n UpdateTeamFeature.register(container);\n DeleteTeamFeature.register(container);\n NotifyTeamChangeFeature.register(container);\n }\n});\n"],"names":["TeamsFeature","createFeature","container","TeamsRepository","TeamProvider","TeamsRepositoryCachingDecorator","GetTeamFeature","ListTeamsFeature","CreateTeamFeature","UpdateTeamFeature","DeleteTeamFeature","NotifyTeamChangeFeature"],"mappings":";;;;;;;;;;AAWO,MAAMA,eAAeC,cAAc;IACtC,MAAM;IACN,UAASC,SAAS;QAEdA,UAAU,QAAQ,CAACC,iBAAiB,gBAAgB;QACpDD,UAAU,QAAQ,CAACE,cAAc,gBAAgB;QAGjDF,UAAU,iBAAiB,CAACG;QAG5BC,eAAe,QAAQ,CAACJ;QACxBK,iBAAiB,QAAQ,CAACL;QAC1BM,kBAAkB,QAAQ,CAACN;QAC3BO,kBAAkB,QAAQ,CAACP;QAC3BQ,kBAAkB,QAAQ,CAACR;QAC3BS,wBAAwB,QAAQ,CAACT;IACrC;AACJ"}
|
|
@@ -23,6 +23,13 @@ export interface ITaskAbortParams {
|
|
|
23
23
|
id: string;
|
|
24
24
|
message?: string;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Every method returns its failures and never rejects: an unknown definition, an `onBeforeTrigger`
|
|
28
|
+
* hook that throws or a transport that can't send the task all come back as `Result.fail`. Two
|
|
29
|
+
* cases are logged and reported as a success, because the work has already happened: `trigger`
|
|
30
|
+
* when the transport took the task but its event response couldn't be stored, and `abort` when
|
|
31
|
+
* the task is aborted but its `onAbort` hook throws.
|
|
32
|
+
*/
|
|
26
33
|
export interface ITaskService {
|
|
27
34
|
trigger: <T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends IGenericOutput = IGenericOutput>(params: ITaskTriggerParams<T>) => Promise<Result<ITask<T, O>, BaseError>>;
|
|
28
35
|
abort: <T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends IGenericOutput = IGenericOutput>(params: ITaskAbortParams) => Promise<Result<ITask<T, O>, BaseError>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/task/TaskService/abstractions.js","sources":["../../../../src/features/task/TaskService/abstractions.ts"],"sourcesContent":["import { BaseError, createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport { type ITaskOutput, TaskDefinition } from \"~/features/task/TaskDefinition/index.js\";\n\n/** Trigger and manage long-running background tasks. */\nexport const TaskService = createAbstraction<ITaskService>(\"TaskService\");\n\nexport namespace TaskService {\n export type Interface = ITaskService;\n /**\n * This is the output of `trigger` and `abort` actions.\n */\n export type GenericOutput = IGenericOutput;\n\n export type TaskInput = TaskDefinition.TaskInput;\n\n export type Task<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends ITaskOutput = ITaskOutput\n > = ITask<I, O>;\n}\n\n// The service info depends on the implementation.\n// We cannot have a more precise type here, since implementation can be anything (AWS, Azure, etc.).\nexport type IServiceInfo = GenericRecord;\n\nexport interface IResponseError {\n message: string;\n code?: string | null;\n data?: GenericRecord | null;\n stack?: string;\n}\n\nexport interface ITaskAbortParams {\n id: string;\n message?: string;\n}\n\nexport interface ITaskService {\n trigger: <\n T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends IGenericOutput = IGenericOutput\n >(\n params: ITaskTriggerParams<T>\n ) => Promise<Result<ITask<T, O>, BaseError>>;\n abort: <\n T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends IGenericOutput = IGenericOutput\n >(\n params: ITaskAbortParams\n ) => Promise<Result<ITask<T, O>, BaseError>>;\n fetchServiceInfo: (input: ITask<any, any> | string) => Promise<Result<IServiceInfo, BaseError>>;\n}\n\nexport interface IGenericOutput {\n error?: IResponseError;\n [key: string]:\n | string\n | string[]\n | number\n | boolean\n | undefined\n | Record<string, any>\n | IResponseError;\n}\n\nexport interface ITaskTriggerParams<I = TaskDefinition.TaskInput> {\n parent?: Pick<ITask, \"id\">;\n definition: string;\n name?: string;\n input?: I;\n delay?: number;\n}\n\nexport interface ITaskValues<T = GenericRecord, O extends ITaskOutput = ITaskOutput> {\n startedOn?: string;\n finishedOn?: string;\n eventResponse: GenericRecord | undefined;\n iterations: number;\n parentId?: string;\n name: string;\n taskStatus: TaskDataStatus;\n definitionId: string;\n executionName: string;\n input: T;\n output?: O;\n}\n\nexport interface ITask<T = GenericRecord, O extends ITaskOutput = ITaskOutput> extends ITaskValues<\n T,\n O\n> {\n /**\n * ID without the revision number (for example: #0001).\n */\n id: string;\n createdOn: string;\n savedOn: string;\n createdBy: ITaskIdentity;\n}\n\nexport enum TaskDataStatus {\n PENDING = \"pending\",\n RUNNING = \"running\",\n FAILED = \"failed\",\n SUCCESS = \"success\",\n ABORTED = \"aborted\"\n}\n\nexport interface ITaskIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n"],"names":["TaskService","createAbstraction","TaskDataStatus"],"mappings":";AAKO,MAAMA,cAAcC,kBAAgC;
|
|
1
|
+
{"version":3,"file":"features/task/TaskService/abstractions.js","sources":["../../../../src/features/task/TaskService/abstractions.ts"],"sourcesContent":["import { BaseError, createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport { type ITaskOutput, TaskDefinition } from \"~/features/task/TaskDefinition/index.js\";\n\n/** Trigger and manage long-running background tasks. */\nexport const TaskService = createAbstraction<ITaskService>(\"TaskService\");\n\nexport namespace TaskService {\n export type Interface = ITaskService;\n /**\n * This is the output of `trigger` and `abort` actions.\n */\n export type GenericOutput = IGenericOutput;\n\n export type TaskInput = TaskDefinition.TaskInput;\n\n export type Task<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends ITaskOutput = ITaskOutput\n > = ITask<I, O>;\n}\n\n// The service info depends on the implementation.\n// We cannot have a more precise type here, since implementation can be anything (AWS, Azure, etc.).\nexport type IServiceInfo = GenericRecord;\n\nexport interface IResponseError {\n message: string;\n code?: string | null;\n data?: GenericRecord | null;\n stack?: string;\n}\n\nexport interface ITaskAbortParams {\n id: string;\n message?: string;\n}\n\n/**\n * Every method returns its failures and never rejects: an unknown definition, an `onBeforeTrigger`\n * hook that throws or a transport that can't send the task all come back as `Result.fail`. Two\n * cases are logged and reported as a success, because the work has already happened: `trigger`\n * when the transport took the task but its event response couldn't be stored, and `abort` when\n * the task is aborted but its `onAbort` hook throws.\n */\nexport interface ITaskService {\n trigger: <\n T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends IGenericOutput = IGenericOutput\n >(\n params: ITaskTriggerParams<T>\n ) => Promise<Result<ITask<T, O>, BaseError>>;\n abort: <\n T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends IGenericOutput = IGenericOutput\n >(\n params: ITaskAbortParams\n ) => Promise<Result<ITask<T, O>, BaseError>>;\n fetchServiceInfo: (input: ITask<any, any> | string) => Promise<Result<IServiceInfo, BaseError>>;\n}\n\nexport interface IGenericOutput {\n error?: IResponseError;\n [key: string]:\n | string\n | string[]\n | number\n | boolean\n | undefined\n | Record<string, any>\n | IResponseError;\n}\n\nexport interface ITaskTriggerParams<I = TaskDefinition.TaskInput> {\n parent?: Pick<ITask, \"id\">;\n definition: string;\n name?: string;\n input?: I;\n delay?: number;\n}\n\nexport interface ITaskValues<T = GenericRecord, O extends ITaskOutput = ITaskOutput> {\n startedOn?: string;\n finishedOn?: string;\n eventResponse: GenericRecord | undefined;\n iterations: number;\n parentId?: string;\n name: string;\n taskStatus: TaskDataStatus;\n definitionId: string;\n executionName: string;\n input: T;\n output?: O;\n}\n\nexport interface ITask<T = GenericRecord, O extends ITaskOutput = ITaskOutput> extends ITaskValues<\n T,\n O\n> {\n /**\n * ID without the revision number (for example: #0001).\n */\n id: string;\n createdOn: string;\n savedOn: string;\n createdBy: ITaskIdentity;\n}\n\nexport enum TaskDataStatus {\n PENDING = \"pending\",\n RUNNING = \"running\",\n FAILED = \"failed\",\n SUCCESS = \"success\",\n ABORTED = \"aborted\"\n}\n\nexport interface ITaskIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n"],"names":["TaskService","createAbstraction","TaskDataStatus"],"mappings":";AAKO,MAAMA,cAAcC,kBAAgC;AAuGpD,IAAKC,8BAAcA,WAAAA,GAAAA,SAAdA,cAAc;;;;;;WAAdA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
import { Logger } from "../../../features/logger/index.js";
|
|
4
|
+
import { WebsocketsSendToIdentityUseCase } from "./abstractions.js";
|
|
5
|
+
/**
|
|
6
|
+
* The default when no websockets package is installed: there are no connections to send to, so the
|
|
7
|
+
* send succeeds without doing anything. `@webiny/api-websockets` registers after api-core and replaces it.
|
|
8
|
+
*
|
|
9
|
+
* Logged at debug level, so that a handler stack that forgot to register websockets can be told apart
|
|
10
|
+
* from a user who simply has no tab open.
|
|
11
|
+
*/
|
|
12
|
+
declare class NullSendToIdentityUseCaseImpl implements WebsocketsSendToIdentityUseCase.Interface {
|
|
13
|
+
private readonly logger;
|
|
14
|
+
constructor(logger: Logger.Interface);
|
|
15
|
+
execute(identity: WebsocketsSendToIdentityUseCase.Identity, data: WebsocketsSendToIdentityUseCase.Data<GenericRecord>): Promise<Result<void, never>>;
|
|
16
|
+
}
|
|
17
|
+
export declare const NullSendToIdentityUseCase: typeof NullSendToIdentityUseCaseImpl & {
|
|
18
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ISendToIdentityUseCase>;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { Logger } from "../../logger/index.js";
|
|
3
|
+
import { WebsocketsSendToIdentityUseCase } from "./abstractions.js";
|
|
4
|
+
class NullSendToIdentityUseCaseImpl {
|
|
5
|
+
constructor(logger){
|
|
6
|
+
this.logger = logger;
|
|
7
|
+
}
|
|
8
|
+
async execute(identity, data) {
|
|
9
|
+
this.logger.debug({
|
|
10
|
+
identityId: identity.id,
|
|
11
|
+
action: data.action
|
|
12
|
+
}, "No websockets package registered; message not sent.");
|
|
13
|
+
return Result.ok();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const NullSendToIdentityUseCase = WebsocketsSendToIdentityUseCase.createImplementation({
|
|
17
|
+
implementation: NullSendToIdentityUseCaseImpl,
|
|
18
|
+
dependencies: [
|
|
19
|
+
Logger
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
export { NullSendToIdentityUseCase };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=NullSendToIdentityUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/websockets/SendToIdentity/NullSendToIdentityUseCase.js","sources":["../../../../src/features/websockets/SendToIdentity/NullSendToIdentityUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport { Logger } from \"~/features/logger/index.js\";\nimport { WebsocketsSendToIdentityUseCase } from \"./abstractions.js\";\n\n/**\n * The default when no websockets package is installed: there are no connections to send to, so the\n * send succeeds without doing anything. `@webiny/api-websockets` registers after api-core and replaces it.\n *\n * Logged at debug level, so that a handler stack that forgot to register websockets can be told apart\n * from a user who simply has no tab open.\n */\nclass NullSendToIdentityUseCaseImpl implements WebsocketsSendToIdentityUseCase.Interface {\n constructor(private readonly logger: Logger.Interface) {}\n\n async execute(\n identity: WebsocketsSendToIdentityUseCase.Identity,\n data: WebsocketsSendToIdentityUseCase.Data<GenericRecord>\n ) {\n this.logger.debug(\n { identityId: identity.id, action: data.action },\n \"No websockets package registered; message not sent.\"\n );\n return Result.ok();\n }\n}\n\nexport const NullSendToIdentityUseCase = WebsocketsSendToIdentityUseCase.createImplementation({\n implementation: NullSendToIdentityUseCaseImpl,\n dependencies: [Logger]\n});\n"],"names":["NullSendToIdentityUseCaseImpl","logger","identity","data","Result","NullSendToIdentityUseCase","WebsocketsSendToIdentityUseCase","Logger"],"mappings":";;;AAYA,MAAMA;IACF,YAA6BC,MAAwB,CAAE;aAA1BA,MAAM,GAANA;IAA2B;IAExD,MAAM,QACFC,QAAkD,EAClDC,IAAyD,EAC3D;QACE,IAAI,CAAC,MAAM,CAAC,KAAK,CACb;YAAE,YAAYD,SAAS,EAAE;YAAE,QAAQC,KAAK,MAAM;QAAC,GAC/C;QAEJ,OAAOC,OAAO,EAAE;IACpB;AACJ;AAEO,MAAMC,4BAA4BC,gCAAgC,oBAAoB,CAAC;IAC1F,gBAAgBN;IAChB,cAAc;QAACO;KAAO;AAC1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
import type { IWebsocketsIdentity } from "../types.js";
|
|
4
|
+
import type { IWebsocketsTransportSendData } from "../types.js";
|
|
5
|
+
import type { WebsocketServiceError } from "../WebsocketServiceError.js";
|
|
6
|
+
export interface ISendToIdentityUseCase {
|
|
7
|
+
execute<T extends GenericRecord = GenericRecord>(identity: Pick<IWebsocketsIdentity, "id">, data: IWebsocketsTransportSendData<T>): Promise<Result<void, WebsocketServiceError>>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Sends a message to every open websocket connection of an identity. Declared here so that any
|
|
11
|
+
* package can send without depending on a websockets package; `@webiny/api-websockets` implements it.
|
|
12
|
+
* Without that package the send does nothing, see `NullSendToIdentityUseCase`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const WebsocketsSendToIdentityUseCase: import("@webiny/di").Abstraction<ISendToIdentityUseCase>;
|
|
15
|
+
export declare namespace WebsocketsSendToIdentityUseCase {
|
|
16
|
+
type Interface = ISendToIdentityUseCase;
|
|
17
|
+
type Identity = Pick<IWebsocketsIdentity, "id">;
|
|
18
|
+
type Data<T extends GenericRecord> = IWebsocketsTransportSendData<T>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/websockets/SendToIdentity/abstractions.js","sources":["../../../../src/features/websockets/SendToIdentity/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { IWebsocketsIdentity } from \"../types.js\";\nimport type { IWebsocketsTransportSendData } from \"../types.js\";\nimport type { WebsocketServiceError } from \"../WebsocketServiceError.js\";\n\nexport interface ISendToIdentityUseCase {\n execute<T extends GenericRecord = GenericRecord>(\n identity: Pick<IWebsocketsIdentity, \"id\">,\n data: IWebsocketsTransportSendData<T>\n ): Promise<Result<void, WebsocketServiceError>>;\n}\n\n/**\n * Sends a message to every open websocket connection of an identity. Declared here so that any\n * package can send without depending on a websockets package; `@webiny/api-websockets` implements it.\n * Without that package the send does nothing, see `NullSendToIdentityUseCase`.\n */\nexport const WebsocketsSendToIdentityUseCase = createAbstraction<ISendToIdentityUseCase>(\n \"Websockets/SendToIdentity\"\n);\n\nexport namespace WebsocketsSendToIdentityUseCase {\n export type Interface = ISendToIdentityUseCase;\n export type Identity = Pick<IWebsocketsIdentity, \"id\">;\n export type Data<T extends GenericRecord> = IWebsocketsTransportSendData<T>;\n}\n"],"names":["WebsocketsSendToIdentityUseCase","createAbstraction"],"mappings":";AAmBO,MAAMA,kCAAkCC,kBAC3C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseError } from "@webiny/feature/api";
|
|
2
|
+
class WebsocketServiceError extends BaseError {
|
|
3
|
+
constructor(error){
|
|
4
|
+
super({
|
|
5
|
+
message: "WebsocketService encountered an error.",
|
|
6
|
+
data: {
|
|
7
|
+
error
|
|
8
|
+
}
|
|
9
|
+
}), this.code = "Websocket/Service";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export { WebsocketServiceError };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=WebsocketServiceError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/websockets/WebsocketServiceError.js","sources":["../../../src/features/websockets/WebsocketServiceError.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/api\";\n\nexport class WebsocketServiceError extends BaseError<{ error: Error }> {\n override readonly code = \"Websocket/Service\" as const;\n\n constructor(error: Error) {\n super({\n message: \"WebsocketService encountered an error.\",\n data: { error }\n });\n }\n}\n"],"names":["WebsocketServiceError","BaseError","error"],"mappings":";AAEO,MAAMA,8BAA8BC;IAGvC,YAAYC,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS;YACT,MAAM;gBAAEA;YAAM;QAClB,SANc,IAAI,GAAG;IAOzB;AACJ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { WebsocketsSendToIdentityUseCase } from "./SendToIdentity/abstractions.js";
|
|
2
|
+
export { NullSendToIdentityUseCase } from "./SendToIdentity/NullSendToIdentityUseCase.js";
|
|
3
|
+
export { WebsocketServiceError } from "./WebsocketServiceError.js";
|
|
4
|
+
export type { IWebsocketsIdentity } from "./types.js";
|
|
5
|
+
export type { IWebsocketsTransportSendData } from "./types.js";
|
|
6
|
+
export type { IWebsocketsTransportSendDataError } from "./types.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
2
|
+
import type { SecurityIdentity } from "../../types/security.js";
|
|
3
|
+
export type IWebsocketsIdentity = Pick<SecurityIdentity, "id" | "displayName" | "type">;
|
|
4
|
+
export interface IWebsocketsTransportSendDataError {
|
|
5
|
+
message: string;
|
|
6
|
+
code: string;
|
|
7
|
+
data?: GenericRecord;
|
|
8
|
+
stack?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IWebsocketsTransportSendData<T extends GenericRecord> {
|
|
11
|
+
messageId?: string;
|
|
12
|
+
action?: string;
|
|
13
|
+
data?: T;
|
|
14
|
+
error?: IWebsocketsTransportSendDataError;
|
|
15
|
+
}
|
|
File without changes
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { ApiCoreFeature } from "./ApiCoreFeature.js";
|
|
2
2
|
export { ApiCoreStorageOperationsFactory, registerApiCoreStorageOperations } from "./features/storageOperations/abstractions.js";
|
|
3
|
+
export { RequestStorage } from "./features/requestStorage/index.js";
|
|
3
4
|
export { WcpLicenseProvider } from "./features/wcp/WcpLicenseProvider.js";
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { ApiCoreFeature } from "./ApiCoreFeature.js";
|
|
2
2
|
export { ApiCoreStorageOperationsFactory, registerApiCoreStorageOperations } from "./features/storageOperations/abstractions.js";
|
|
3
|
+
export { RequestStorage } from "./features/requestStorage/index.js";
|
|
3
4
|
export { WcpLicenseProvider } from "./features/wcp/WcpLicenseProvider.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-core",
|
|
3
|
-
"version": "6.6.0-alpha.
|
|
3
|
+
"version": "6.6.0-alpha.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"@ai-sdk/google": "4.0.109",
|
|
19
19
|
"@ai-sdk/openai": "4.0.106",
|
|
20
20
|
"@openrouter/ai-sdk-provider": "3.1.0",
|
|
21
|
-
"@webiny/api": "6.6.0-alpha.
|
|
22
|
-
"@webiny/api-graphql": "6.6.0-alpha.
|
|
21
|
+
"@webiny/api": "6.6.0-alpha.11",
|
|
22
|
+
"@webiny/api-graphql": "6.6.0-alpha.11",
|
|
23
23
|
"@webiny/di": "2.0.0",
|
|
24
|
-
"@webiny/error": "6.6.0-alpha.
|
|
25
|
-
"@webiny/event-handler-core": "6.6.0-alpha.
|
|
26
|
-
"@webiny/feature": "6.6.0-alpha.
|
|
27
|
-
"@webiny/feature-flags": "6.6.0-alpha.
|
|
28
|
-
"@webiny/handler": "6.6.0-alpha.
|
|
29
|
-
"@webiny/utils": "6.6.0-alpha.
|
|
30
|
-
"@webiny/wcp": "6.6.0-alpha.
|
|
24
|
+
"@webiny/error": "6.6.0-alpha.11",
|
|
25
|
+
"@webiny/event-handler-core": "6.6.0-alpha.11",
|
|
26
|
+
"@webiny/feature": "6.6.0-alpha.11",
|
|
27
|
+
"@webiny/feature-flags": "6.6.0-alpha.11",
|
|
28
|
+
"@webiny/handler": "6.6.0-alpha.11",
|
|
29
|
+
"@webiny/utils": "6.6.0-alpha.11",
|
|
30
|
+
"@webiny/wcp": "6.6.0-alpha.11",
|
|
31
31
|
"ai": "7.0.159",
|
|
32
32
|
"dataloader": "2.2.3",
|
|
33
33
|
"graphql": "16.14.2",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/jsonwebtoken": "9.0.10",
|
|
43
|
-
"@webiny/build-tools": "6.6.0-alpha.
|
|
43
|
+
"@webiny/build-tools": "6.6.0-alpha.11",
|
|
44
44
|
"rimraf": "6.1.3",
|
|
45
45
|
"typescript": "7.0.2",
|
|
46
46
|
"vitest": "5.0.5"
|