@valentine-efagene/qshelter-common 2.0.86 → 2.0.88
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/dist/generated/client/browser.d.ts +25 -0
- package/dist/generated/client/client.d.ts +25 -0
- package/dist/generated/client/commonInputTypes.d.ts +30 -0
- package/dist/generated/client/enums.d.ts +18 -0
- package/dist/generated/client/enums.js +17 -0
- package/dist/generated/client/internal/class.d.ts +55 -0
- package/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +469 -42
- package/dist/generated/client/internal/prismaNamespace.js +118 -40
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +129 -41
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +118 -40
- package/dist/generated/client/models/Contract.d.ts +303 -1574
- package/dist/generated/client/models/ContractInstallment.d.ts +77 -77
- package/dist/generated/client/models/ContractPhase.d.ts +339 -1376
- package/dist/generated/client/models/DocumentationPhase.d.ts +1649 -0
- package/dist/generated/client/models/DocumentationPhase.js +1 -0
- package/dist/generated/client/models/DocumentationStep.d.ts +126 -387
- package/dist/generated/client/models/PaymentMethodPhaseField.d.ts +1378 -0
- package/dist/generated/client/models/PaymentMethodPhaseField.js +1 -0
- package/dist/generated/client/models/PaymentPhase.d.ts +1566 -0
- package/dist/generated/client/models/PaymentPhase.js +1 -0
- package/dist/generated/client/models/PaymentPlan.d.ts +53 -53
- package/dist/generated/client/models/PropertyPaymentMethodPhase.d.ts +171 -0
- package/dist/generated/client/models/PropertyTransferRequest.d.ts +196 -70
- package/dist/generated/client/models/QuestionnaireField.d.ts +1495 -0
- package/dist/generated/client/models/QuestionnaireField.js +1 -0
- package/dist/generated/client/models/QuestionnairePhase.d.ts +1383 -0
- package/dist/generated/client/models/QuestionnairePhase.js +1 -0
- package/dist/generated/client/models/index.d.ts +5 -0
- package/dist/generated/client/models/index.js +5 -0
- package/dist/generated/client/models.d.ts +5 -0
- package/dist/src/events/index.d.ts +2 -0
- package/dist/src/events/index.js +3 -0
- package/dist/src/events/policies/index.d.ts +2 -0
- package/dist/src/events/policies/index.js +2 -0
- package/dist/src/events/policies/policy-event.d.ts +89 -0
- package/dist/src/events/policies/policy-event.js +22 -0
- package/dist/src/events/policies/policy-publisher.d.ts +60 -0
- package/dist/src/events/policies/policy-publisher.js +128 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,6 +12,7 @@ export * from './ContractTermination';
|
|
|
12
12
|
export * from './DeviceEndpoint';
|
|
13
13
|
export * from './DocumentRequirementRule';
|
|
14
14
|
export * from './DocumentTemplate';
|
|
15
|
+
export * from './DocumentationPhase';
|
|
15
16
|
export * from './DocumentationStep';
|
|
16
17
|
export * from './DocumentationStepApproval';
|
|
17
18
|
export * from './DocumentationStepDocument';
|
|
@@ -26,7 +27,9 @@ export * from './OfferLetter';
|
|
|
26
27
|
export * from './PasswordReset';
|
|
27
28
|
export * from './PaymentMethodChangeRequest';
|
|
28
29
|
export * from './PaymentMethodPhaseDocument';
|
|
30
|
+
export * from './PaymentMethodPhaseField';
|
|
29
31
|
export * from './PaymentMethodPhaseStep';
|
|
32
|
+
export * from './PaymentPhase';
|
|
30
33
|
export * from './PaymentPlan';
|
|
31
34
|
export * from './Permission';
|
|
32
35
|
export * from './Property';
|
|
@@ -41,6 +44,8 @@ export * from './PropertyUnit';
|
|
|
41
44
|
export * from './PropertyVariant';
|
|
42
45
|
export * from './PropertyVariantAmenity';
|
|
43
46
|
export * from './PropertyVariantMedia';
|
|
47
|
+
export * from './QuestionnaireField';
|
|
48
|
+
export * from './QuestionnairePhase';
|
|
44
49
|
export * from './RefreshToken';
|
|
45
50
|
export * from './Role';
|
|
46
51
|
export * from './RolePermission';
|
|
@@ -12,6 +12,7 @@ export * from './ContractTermination';
|
|
|
12
12
|
export * from './DeviceEndpoint';
|
|
13
13
|
export * from './DocumentRequirementRule';
|
|
14
14
|
export * from './DocumentTemplate';
|
|
15
|
+
export * from './DocumentationPhase';
|
|
15
16
|
export * from './DocumentationStep';
|
|
16
17
|
export * from './DocumentationStepApproval';
|
|
17
18
|
export * from './DocumentationStepDocument';
|
|
@@ -26,7 +27,9 @@ export * from './OfferLetter';
|
|
|
26
27
|
export * from './PasswordReset';
|
|
27
28
|
export * from './PaymentMethodChangeRequest';
|
|
28
29
|
export * from './PaymentMethodPhaseDocument';
|
|
30
|
+
export * from './PaymentMethodPhaseField';
|
|
29
31
|
export * from './PaymentMethodPhaseStep';
|
|
32
|
+
export * from './PaymentPhase';
|
|
30
33
|
export * from './PaymentPlan';
|
|
31
34
|
export * from './Permission';
|
|
32
35
|
export * from './Property';
|
|
@@ -41,6 +44,8 @@ export * from './PropertyUnit';
|
|
|
41
44
|
export * from './PropertyVariant';
|
|
42
45
|
export * from './PropertyVariantAmenity';
|
|
43
46
|
export * from './PropertyVariantMedia';
|
|
47
|
+
export * from './QuestionnaireField';
|
|
48
|
+
export * from './QuestionnairePhase';
|
|
44
49
|
export * from './RefreshToken';
|
|
45
50
|
export * from './Role';
|
|
46
51
|
export * from './RolePermission';
|
|
@@ -31,9 +31,14 @@ export type * from './models/PropertyPaymentMethodPhase.js';
|
|
|
31
31
|
export type * from './models/PaymentMethodPhaseStep.js';
|
|
32
32
|
export type * from './models/StepEventAttachment.js';
|
|
33
33
|
export type * from './models/PaymentMethodPhaseDocument.js';
|
|
34
|
+
export type * from './models/PaymentMethodPhaseField.js';
|
|
34
35
|
export type * from './models/Contract.js';
|
|
35
36
|
export type * from './models/ContractRefund.js';
|
|
36
37
|
export type * from './models/ContractPhase.js';
|
|
38
|
+
export type * from './models/QuestionnairePhase.js';
|
|
39
|
+
export type * from './models/DocumentationPhase.js';
|
|
40
|
+
export type * from './models/PaymentPhase.js';
|
|
41
|
+
export type * from './models/QuestionnaireField.js';
|
|
37
42
|
export type * from './models/ContractEvent.js';
|
|
38
43
|
export type * from './models/DocumentationStep.js';
|
|
39
44
|
export type * from './models/DocumentationStepDocument.js';
|
|
@@ -3,5 +3,7 @@ export * from './notifications/notification-event';
|
|
|
3
3
|
export * from './notifications/event-publisher';
|
|
4
4
|
export * from './payments/payment-event';
|
|
5
5
|
export * from './payments/payment-publisher';
|
|
6
|
+
export * from './policies/policy-event';
|
|
7
|
+
export * from './policies/policy-publisher';
|
|
6
8
|
export * from './bus/event-bus.types';
|
|
7
9
|
export * from './bus/event-bus.service';
|
package/dist/src/events/index.js
CHANGED
|
@@ -5,6 +5,9 @@ export * from './notifications/event-publisher';
|
|
|
5
5
|
// Payment events and publisher (SNS-based)
|
|
6
6
|
export * from './payments/payment-event';
|
|
7
7
|
export * from './payments/payment-publisher';
|
|
8
|
+
// Policy sync events and publisher (SNS-based)
|
|
9
|
+
export * from './policies/policy-event';
|
|
10
|
+
export * from './policies/policy-publisher';
|
|
8
11
|
// Event bus (multi-transport delivery)
|
|
9
12
|
export * from './bus/event-bus.types';
|
|
10
13
|
export * from './bus/event-bus.service';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy Sync Event Types
|
|
3
|
+
*
|
|
4
|
+
* These events are published when role/permission data changes in RDS,
|
|
5
|
+
* triggering synchronization to DynamoDB for the authorizer.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum PolicyEventType {
|
|
8
|
+
ROLE_CREATED = "POLICY.ROLE_CREATED",
|
|
9
|
+
ROLE_UPDATED = "POLICY.ROLE_UPDATED",
|
|
10
|
+
ROLE_DELETED = "POLICY.ROLE_DELETED",
|
|
11
|
+
PERMISSION_CREATED = "POLICY.PERMISSION_CREATED",
|
|
12
|
+
PERMISSION_UPDATED = "POLICY.PERMISSION_UPDATED",
|
|
13
|
+
PERMISSION_DELETED = "POLICY.PERMISSION_DELETED",
|
|
14
|
+
ROLE_PERMISSION_ASSIGNED = "POLICY.ROLE_PERMISSION_ASSIGNED",
|
|
15
|
+
ROLE_PERMISSION_REVOKED = "POLICY.ROLE_PERMISSION_REVOKED",
|
|
16
|
+
FULL_SYNC_REQUESTED = "POLICY.FULL_SYNC_REQUESTED"
|
|
17
|
+
}
|
|
18
|
+
export interface RoleData {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface PermissionData {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string | null;
|
|
27
|
+
resource: string;
|
|
28
|
+
action: string;
|
|
29
|
+
}
|
|
30
|
+
export interface RolePermissionData {
|
|
31
|
+
roleId: string;
|
|
32
|
+
roleName: string;
|
|
33
|
+
permissions: Array<{
|
|
34
|
+
id: string;
|
|
35
|
+
resource: string;
|
|
36
|
+
action: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export interface PolicyEventMeta {
|
|
40
|
+
source: string;
|
|
41
|
+
timestamp: string;
|
|
42
|
+
correlationId?: string;
|
|
43
|
+
userId?: string;
|
|
44
|
+
tenantId?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface PolicyEvent<T = unknown> {
|
|
47
|
+
eventType: PolicyEventType;
|
|
48
|
+
eventId: string;
|
|
49
|
+
timestamp: string;
|
|
50
|
+
tenantId?: string;
|
|
51
|
+
source: string;
|
|
52
|
+
data: T;
|
|
53
|
+
metadata?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export interface RoleCreatedEvent extends PolicyEvent<RoleData> {
|
|
56
|
+
eventType: PolicyEventType.ROLE_CREATED;
|
|
57
|
+
}
|
|
58
|
+
export interface RoleUpdatedEvent extends PolicyEvent<RoleData> {
|
|
59
|
+
eventType: PolicyEventType.ROLE_UPDATED;
|
|
60
|
+
}
|
|
61
|
+
export interface RoleDeletedEvent extends PolicyEvent<{
|
|
62
|
+
roleId: string;
|
|
63
|
+
roleName: string;
|
|
64
|
+
}> {
|
|
65
|
+
eventType: PolicyEventType.ROLE_DELETED;
|
|
66
|
+
}
|
|
67
|
+
export interface PermissionCreatedEvent extends PolicyEvent<PermissionData> {
|
|
68
|
+
eventType: PolicyEventType.PERMISSION_CREATED;
|
|
69
|
+
}
|
|
70
|
+
export interface PermissionUpdatedEvent extends PolicyEvent<PermissionData> {
|
|
71
|
+
eventType: PolicyEventType.PERMISSION_UPDATED;
|
|
72
|
+
}
|
|
73
|
+
export interface PermissionDeletedEvent extends PolicyEvent<{
|
|
74
|
+
permissionId: string;
|
|
75
|
+
}> {
|
|
76
|
+
eventType: PolicyEventType.PERMISSION_DELETED;
|
|
77
|
+
}
|
|
78
|
+
export interface RolePermissionAssignedEvent extends PolicyEvent<RolePermissionData> {
|
|
79
|
+
eventType: PolicyEventType.ROLE_PERMISSION_ASSIGNED;
|
|
80
|
+
}
|
|
81
|
+
export interface RolePermissionRevokedEvent extends PolicyEvent<RolePermissionData> {
|
|
82
|
+
eventType: PolicyEventType.ROLE_PERMISSION_REVOKED;
|
|
83
|
+
}
|
|
84
|
+
export interface FullSyncRequestedEvent extends PolicyEvent<{
|
|
85
|
+
requestedBy: string;
|
|
86
|
+
}> {
|
|
87
|
+
eventType: PolicyEventType.FULL_SYNC_REQUESTED;
|
|
88
|
+
}
|
|
89
|
+
export type AnyPolicyEvent = RoleCreatedEvent | RoleUpdatedEvent | RoleDeletedEvent | PermissionCreatedEvent | PermissionUpdatedEvent | PermissionDeletedEvent | RolePermissionAssignedEvent | RolePermissionRevokedEvent | FullSyncRequestedEvent;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy Sync Event Types
|
|
3
|
+
*
|
|
4
|
+
* These events are published when role/permission data changes in RDS,
|
|
5
|
+
* triggering synchronization to DynamoDB for the authorizer.
|
|
6
|
+
*/
|
|
7
|
+
export var PolicyEventType;
|
|
8
|
+
(function (PolicyEventType) {
|
|
9
|
+
// Role events
|
|
10
|
+
PolicyEventType["ROLE_CREATED"] = "POLICY.ROLE_CREATED";
|
|
11
|
+
PolicyEventType["ROLE_UPDATED"] = "POLICY.ROLE_UPDATED";
|
|
12
|
+
PolicyEventType["ROLE_DELETED"] = "POLICY.ROLE_DELETED";
|
|
13
|
+
// Permission events
|
|
14
|
+
PolicyEventType["PERMISSION_CREATED"] = "POLICY.PERMISSION_CREATED";
|
|
15
|
+
PolicyEventType["PERMISSION_UPDATED"] = "POLICY.PERMISSION_UPDATED";
|
|
16
|
+
PolicyEventType["PERMISSION_DELETED"] = "POLICY.PERMISSION_DELETED";
|
|
17
|
+
// Role-Permission association events
|
|
18
|
+
PolicyEventType["ROLE_PERMISSION_ASSIGNED"] = "POLICY.ROLE_PERMISSION_ASSIGNED";
|
|
19
|
+
PolicyEventType["ROLE_PERMISSION_REVOKED"] = "POLICY.ROLE_PERMISSION_REVOKED";
|
|
20
|
+
// Bulk sync events
|
|
21
|
+
PolicyEventType["FULL_SYNC_REQUESTED"] = "POLICY.FULL_SYNC_REQUESTED";
|
|
22
|
+
})(PolicyEventType || (PolicyEventType = {}));
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { PolicyEventType, PolicyEventMeta, RoleData, PermissionData, RolePermissionData } from './policy-event';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for the policy event publisher
|
|
4
|
+
*/
|
|
5
|
+
interface PolicyPublisherConfig {
|
|
6
|
+
region?: string;
|
|
7
|
+
endpoint?: string;
|
|
8
|
+
topicArn?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Policy Event Publisher for sending policy sync events to SNS
|
|
12
|
+
* Used by user-service to notify policy-sync-service of changes
|
|
13
|
+
*/
|
|
14
|
+
export declare class PolicyEventPublisher {
|
|
15
|
+
private readonly snsClient;
|
|
16
|
+
private readonly topicArn;
|
|
17
|
+
private readonly serviceName;
|
|
18
|
+
constructor(serviceName: string, config?: PolicyPublisherConfig);
|
|
19
|
+
/**
|
|
20
|
+
* Publish a policy event to SNS
|
|
21
|
+
*/
|
|
22
|
+
publish<T>(eventType: PolicyEventType, data: T, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Publish role created event
|
|
25
|
+
*/
|
|
26
|
+
publishRoleCreated(role: RoleData, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Publish role updated event
|
|
29
|
+
*/
|
|
30
|
+
publishRoleUpdated(role: RoleData, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Publish role deleted event
|
|
33
|
+
*/
|
|
34
|
+
publishRoleDeleted(roleId: string, roleName: string, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Publish permission created event
|
|
37
|
+
*/
|
|
38
|
+
publishPermissionCreated(permission: PermissionData, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Publish permission updated event
|
|
41
|
+
*/
|
|
42
|
+
publishPermissionUpdated(permission: PermissionData, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Publish permission deleted event
|
|
45
|
+
*/
|
|
46
|
+
publishPermissionDeleted(permissionId: string, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Publish role permission assigned event
|
|
49
|
+
*/
|
|
50
|
+
publishRolePermissionAssigned(data: RolePermissionData, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
51
|
+
/**
|
|
52
|
+
* Publish role permission revoked event
|
|
53
|
+
*/
|
|
54
|
+
publishRolePermissionRevoked(data: RolePermissionData, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Publish full sync requested event
|
|
57
|
+
*/
|
|
58
|
+
publishFullSyncRequested(requestedBy: string, meta?: Partial<PolicyEventMeta>): Promise<string>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { SNSClient, PublishCommand } from '@aws-sdk/client-sns';
|
|
2
|
+
import { PolicyEventType, } from './policy-event';
|
|
3
|
+
/**
|
|
4
|
+
* Get SNS client configured for LocalStack or AWS
|
|
5
|
+
*/
|
|
6
|
+
function createSNSClient(config) {
|
|
7
|
+
const endpoint = config.endpoint || process.env.LOCALSTACK_ENDPOINT;
|
|
8
|
+
const region = config.region || process.env.AWS_REGION || 'us-east-1';
|
|
9
|
+
const clientConfig = { region };
|
|
10
|
+
// For LocalStack, set custom endpoint
|
|
11
|
+
if (endpoint) {
|
|
12
|
+
clientConfig.endpoint = endpoint;
|
|
13
|
+
}
|
|
14
|
+
return new SNSClient(clientConfig);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Policy Event Publisher for sending policy sync events to SNS
|
|
18
|
+
* Used by user-service to notify policy-sync-service of changes
|
|
19
|
+
*/
|
|
20
|
+
export class PolicyEventPublisher {
|
|
21
|
+
snsClient;
|
|
22
|
+
topicArn;
|
|
23
|
+
serviceName;
|
|
24
|
+
constructor(serviceName, config) {
|
|
25
|
+
this.serviceName = serviceName;
|
|
26
|
+
this.snsClient = createSNSClient(config || {});
|
|
27
|
+
// Topic ARN can be passed directly or constructed from env vars
|
|
28
|
+
const stage = process.env.STAGE || process.env.NODE_ENV || 'test';
|
|
29
|
+
const region = config?.region || process.env.AWS_REGION || 'us-east-1';
|
|
30
|
+
const accountId = process.env.AWS_ACCOUNT_ID || '000000000000';
|
|
31
|
+
this.topicArn = config?.topicArn ||
|
|
32
|
+
process.env.POLICY_SYNC_TOPIC_ARN ||
|
|
33
|
+
`arn:aws:sns:${region}:${accountId}:qshelter-${stage}-policy-sync`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Publish a policy event to SNS
|
|
37
|
+
*/
|
|
38
|
+
async publish(eventType, data, meta) {
|
|
39
|
+
const eventId = crypto.randomUUID();
|
|
40
|
+
const event = {
|
|
41
|
+
eventType,
|
|
42
|
+
eventId,
|
|
43
|
+
timestamp: new Date().toISOString(),
|
|
44
|
+
source: this.serviceName,
|
|
45
|
+
tenantId: meta?.tenantId,
|
|
46
|
+
data,
|
|
47
|
+
metadata: {
|
|
48
|
+
correlationId: meta?.correlationId || eventId,
|
|
49
|
+
userId: meta?.userId,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const command = new PublishCommand({
|
|
53
|
+
TopicArn: this.topicArn,
|
|
54
|
+
Message: JSON.stringify(event),
|
|
55
|
+
MessageAttributes: {
|
|
56
|
+
eventType: {
|
|
57
|
+
DataType: 'String',
|
|
58
|
+
StringValue: eventType,
|
|
59
|
+
},
|
|
60
|
+
source: {
|
|
61
|
+
DataType: 'String',
|
|
62
|
+
StringValue: this.serviceName,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
const result = await this.snsClient.send(command);
|
|
67
|
+
console.log(`[PolicyEventPublisher] Published ${eventType} event to SNS`, {
|
|
68
|
+
topicArn: this.topicArn,
|
|
69
|
+
messageId: result.MessageId,
|
|
70
|
+
eventId,
|
|
71
|
+
});
|
|
72
|
+
return result.MessageId || '';
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Publish role created event
|
|
76
|
+
*/
|
|
77
|
+
async publishRoleCreated(role, meta) {
|
|
78
|
+
return this.publish(PolicyEventType.ROLE_CREATED, role, meta);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Publish role updated event
|
|
82
|
+
*/
|
|
83
|
+
async publishRoleUpdated(role, meta) {
|
|
84
|
+
return this.publish(PolicyEventType.ROLE_UPDATED, role, meta);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Publish role deleted event
|
|
88
|
+
*/
|
|
89
|
+
async publishRoleDeleted(roleId, roleName, meta) {
|
|
90
|
+
return this.publish(PolicyEventType.ROLE_DELETED, { roleId, roleName }, meta);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Publish permission created event
|
|
94
|
+
*/
|
|
95
|
+
async publishPermissionCreated(permission, meta) {
|
|
96
|
+
return this.publish(PolicyEventType.PERMISSION_CREATED, permission, meta);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Publish permission updated event
|
|
100
|
+
*/
|
|
101
|
+
async publishPermissionUpdated(permission, meta) {
|
|
102
|
+
return this.publish(PolicyEventType.PERMISSION_UPDATED, permission, meta);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Publish permission deleted event
|
|
106
|
+
*/
|
|
107
|
+
async publishPermissionDeleted(permissionId, meta) {
|
|
108
|
+
return this.publish(PolicyEventType.PERMISSION_DELETED, { permissionId }, meta);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Publish role permission assigned event
|
|
112
|
+
*/
|
|
113
|
+
async publishRolePermissionAssigned(data, meta) {
|
|
114
|
+
return this.publish(PolicyEventType.ROLE_PERMISSION_ASSIGNED, data, meta);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Publish role permission revoked event
|
|
118
|
+
*/
|
|
119
|
+
async publishRolePermissionRevoked(data, meta) {
|
|
120
|
+
return this.publish(PolicyEventType.ROLE_PERMISSION_REVOKED, data, meta);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Publish full sync requested event
|
|
124
|
+
*/
|
|
125
|
+
async publishFullSyncRequested(requestedBy, meta) {
|
|
126
|
+
return this.publish(PolicyEventType.FULL_SYNC_REQUESTED, { requestedBy }, meta);
|
|
127
|
+
}
|
|
128
|
+
}
|
package/package.json
CHANGED