@carbonbox/domain 0.49.0 → 0.50.0
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/build/carbonbox/company-resources/events/domain/entity/Event.js +11 -2
- package/build/carbonbox/company-resources/events/editions/domain/entity/EventEdition.js +11 -2
- package/build/carbonbox/company-resources/products/domain/entity/Product.js +11 -2
- package/build/carbonbox/shared/domain/enums/ErrorCode.js +9 -1
- package/build/carbonbox/shared/domain/enums/SemanticUuidPrefix.js +2 -0
- package/build/carbonbox/shared/domain/exceptions/InvalidCrossTenantReferenceError.js +36 -0
- package/build/carbonbox/shared/domain/policies/CarbonClientOwnershipPolicy.js +55 -0
- package/build/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientPermissions.js +18 -0
- package/build/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorPermissions.js +18 -0
- package/build/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerPermissions.js +18 -0
- package/build/carbonbox/stakeholders/shared/domain/constants/CARBON_CLIENT_PERMISSION_CEILING.js +87 -0
- package/build/carbonbox/stakeholders/shared/domain/constants/CARBON_COORDINATOR_PERMISSION_CEILING.js +88 -0
- package/build/carbonbox/stakeholders/shared/domain/constants/CARBON_MANAGER_PERMISSION_CEILING.js +29 -0
- package/build/carbonbox/stakeholders/shared/domain/exceptions/PermissionAboveRoleCeilingError.js +33 -0
- package/build/carbonbox/stakeholders/shared/domain/policies/RolePermissionCeilingPolicy.js +55 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/constants/USER_INVITATION_VALIDITY_IN_DAYS.js +11 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/entity/IUserInvitation.js +2 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/entity/UserInvitation.js +229 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationAlreadyConsumedError.js +31 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationExpiredError.js +31 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationRevokedError.js +31 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/repository/IUserInvitationRepository.js +2 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationIssueProps.js +2 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationPrimitives.js +2 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationProps.js +2 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationConsumedAt.js +21 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationEmail.js +24 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationEvaluatedAt.js +29 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationExpiresAt.js +37 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationId.js +44 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationInvitedByStakeholder.js +50 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationIssuedAt.js +24 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationRevokedAt.js +21 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationTokenHash.js +37 -0
- package/build/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationUserId.js +47 -0
- package/build/main/index.js +54 -6
- package/build/types/carbonbox/company-resources/events/domain/entity/Event.d.ts +2 -0
- package/build/types/carbonbox/company-resources/events/domain/entity/Event.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/domain/entity/IEvent.d.ts +2 -0
- package/build/types/carbonbox/company-resources/events/domain/entity/IEvent.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/domain/types/EventPrimitives.d.ts +1 -0
- package/build/types/carbonbox/company-resources/events/domain/types/EventPrimitives.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/domain/types/EventProps.d.ts +1 -0
- package/build/types/carbonbox/company-resources/events/domain/types/EventProps.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/editions/domain/entity/EventEdition.d.ts +2 -0
- package/build/types/carbonbox/company-resources/events/editions/domain/entity/EventEdition.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/editions/domain/entity/IEventEdition.d.ts +2 -0
- package/build/types/carbonbox/company-resources/events/editions/domain/entity/IEventEdition.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/editions/domain/types/EventEditionPrimitives.d.ts +1 -0
- package/build/types/carbonbox/company-resources/events/editions/domain/types/EventEditionPrimitives.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/editions/domain/types/EventEditionProps.d.ts +1 -0
- package/build/types/carbonbox/company-resources/events/editions/domain/types/EventEditionProps.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/products/domain/entity/IProduct.d.ts +2 -0
- package/build/types/carbonbox/company-resources/products/domain/entity/IProduct.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/products/domain/entity/Product.d.ts +2 -0
- package/build/types/carbonbox/company-resources/products/domain/entity/Product.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/products/domain/types/ProductPrimitives.d.ts +1 -0
- package/build/types/carbonbox/company-resources/products/domain/types/ProductPrimitives.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/products/domain/types/ProductProps.d.ts +1 -0
- package/build/types/carbonbox/company-resources/products/domain/types/ProductProps.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/enums/ErrorCode.d.ts +7 -2
- package/build/types/carbonbox/shared/domain/enums/ErrorCode.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/enums/SemanticUuidPrefix.d.ts +1 -0
- package/build/types/carbonbox/shared/domain/enums/SemanticUuidPrefix.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/exceptions/InvalidCrossTenantReferenceError.d.ts +16 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidCrossTenantReferenceError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/policies/CarbonClientOwnershipPolicy.d.ts +36 -0
- package/build/types/carbonbox/shared/domain/policies/CarbonClientOwnershipPolicy.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientPermissions.d.ts +7 -0
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientPermissions.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorPermissions.d.ts +7 -0
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorPermissions.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerPermissions.d.ts +7 -0
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerPermissions.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/shared/domain/constants/CARBON_CLIENT_PERMISSION_CEILING.d.ts +14 -0
- package/build/types/carbonbox/stakeholders/shared/domain/constants/CARBON_CLIENT_PERMISSION_CEILING.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/shared/domain/constants/CARBON_COORDINATOR_PERMISSION_CEILING.d.ts +14 -0
- package/build/types/carbonbox/stakeholders/shared/domain/constants/CARBON_COORDINATOR_PERMISSION_CEILING.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/shared/domain/constants/CARBON_MANAGER_PERMISSION_CEILING.d.ts +14 -0
- package/build/types/carbonbox/stakeholders/shared/domain/constants/CARBON_MANAGER_PERMISSION_CEILING.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/shared/domain/exceptions/PermissionAboveRoleCeilingError.d.ts +12 -0
- package/build/types/carbonbox/stakeholders/shared/domain/exceptions/PermissionAboveRoleCeilingError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/shared/domain/policies/RolePermissionCeilingPolicy.d.ts +26 -0
- package/build/types/carbonbox/stakeholders/shared/domain/policies/RolePermissionCeilingPolicy.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/constants/USER_INVITATION_VALIDITY_IN_DAYS.d.ts +9 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/constants/USER_INVITATION_VALIDITY_IN_DAYS.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/entity/IUserInvitation.d.ts +20 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/entity/IUserInvitation.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/entity/UserInvitation.d.ts +67 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/entity/UserInvitation.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationAlreadyConsumedError.d.ts +12 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationAlreadyConsumedError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationExpiredError.d.ts +12 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationExpiredError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationRevokedError.d.ts +12 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationRevokedError.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/repository/IUserInvitationRepository.d.ts +35 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/repository/IUserInvitationRepository.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationIssueProps.d.ts +36 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationIssueProps.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationPrimitives.d.ts +48 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationPrimitives.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationProps.d.ts +43 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationProps.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationConsumedAt.d.ts +9 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationConsumedAt.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationEmail.d.ts +9 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationEmail.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationEvaluatedAt.d.ts +14 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationEvaluatedAt.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationExpiresAt.d.ts +18 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationExpiresAt.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationId.d.ts +18 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationId.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationInvitedByStakeholder.d.ts +16 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationInvitedByStakeholder.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationIssuedAt.d.ts +9 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationIssuedAt.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationRevokedAt.d.ts +9 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationRevokedAt.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationTokenHash.d.ts +17 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationTokenHash.d.ts.map +1 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationUserId.d.ts +19 -0
- package/build/types/carbonbox/stakeholders/user-invitations/domain/value-objects/UserInvitationUserId.d.ts.map +1 -0
- package/build/types/main/index.d.ts +27 -0
- package/build/types/main/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorCode.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/enums/ErrorCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,SAAS;IAEnB,mBAAmB,iBAAiB;IACpC,aAAa,iBAAiB;IAC9B,aAAa,iBAAiB;IAC9B,mBAAmB,iBAAiB;IACpC,cAAc,iBAAiB;IAC/B,kBAAkB,iBAAiB;IACnC,sBAAsB,iBAAiB;IAGvC,kBAAkB,gBAAgB;IAClC,uBAAuB,gBAAgB;IACvC,qBAAqB,gBAAgB;IACrC,oBAAoB,gBAAgB;IACpC,eAAe,gBAAgB;IAC/B,gBAAgB,gBAAgB;IAChC,yBAAyB,gBAAgB;IAGzC,qBAAqB,gBAAgB;IACrC,6BAA6B,gBAAgB;IAC7C,wBAAwB,gBAAgB;IACxC,gBAAgB,gBAAgB;IAGhC,8BAA8B,gBAAgB;IAC9C,6BAA6B,gBAAgB;IAC7C,wBAAwB,gBAAgB;IACxC,sBAAsB,gBAAgB;IACtC,sBAAsB,gBAAgB;IACtC,wBAAwB,gBAAgB;IACxC,6BAA6B,gBAAgB;IAC7C,uBAAuB,gBAAgB;IAGvC,+BAA+B,gBAAgB;IAC/C,mBAAmB,gBAAgB;IACnC,gCAAgC,gBAAgB;IAChD,8BAA8B,gBAAg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;IAC/C,wCAAwC,gBAAgB;IACxD,wCAAwC,gBAAgB;IACxD,iDAAiD,gBAAgB;IACjE,kDAAkD,gBAAgB;IAGlE,iCAAiC,gBAAgB;IACjD,iCAAiC,gBAAgB;IAGjD,qBAAqB,gBAAgB;IACrC,qCAAqC,gBAAgB;IACrD,4BAA4B,gBAAgB;IAC5C,mBAAmB,gBAAgB;IACnC,uBAAuB,gBAAgB;IACvC,wBAAwB,gBAAgB;IACxC,iCAAiC,gBAAgB;IAGjD,8BAA8B,gBAAgB;CAC/C"}
|
|
@@ -55,6 +55,7 @@ export declare enum SemanticUuidPrefix {
|
|
|
55
55
|
USR_STH_COORDINATOR = "USR-STH-CRD",
|
|
56
56
|
USR_STH_HOST = "USR-STH-CHO",
|
|
57
57
|
USR_STH_MANAGER = "USR-STH-MGR",
|
|
58
|
+
USR_INVITATION = "USR-INV",
|
|
58
59
|
PMS_SERVICE_CATALOG = "PMS-SC",
|
|
59
60
|
PMS_SERVICE_PRICING = "PMS-SP",
|
|
60
61
|
PMS_PURCHASE_CONTRACT = "PMS-PC",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SemanticUuidPrefix.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/enums/SemanticUuidPrefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,kBAAkB;IAE5B,GAAG,QAAQ,CAAE,0CAA0C;IAGvD,eAAe,YAAY;IAC3B,UAAU,YAAY;IACtB,SAAS,YAAY;IACrB,UAAU,YAAY;IACtB,SAAS,YAAY;IACrB,eAAe,YAAY;IAC3B,oBAAoB,YAAY;IAGhC,aAAa,YAAY;IACzB,qBAAqB,gBAAgB;IACrC,wBAAwB,gBAAgB;IACxC,SAAS,YAAY;IACrB,mBAAmB,gBAAgB;IACnC,oBAAoB,gBAAgB;IACpC,WAAW,YAAY;IACvB,mBAAmB,gBAAgB;IACnC,sBAAsB,gBAAgB;IACtC,oBAAoB,gBAAgB;IACpC,aAAa,YAAY;IACzB,WAAW,YAAY;IACvB,cAAc,YAAY;IAG1B,UAAU,YAAY;IACtB,iBAAiB,gBAAgB;IACjC,cAAc,YAAY;IAC1B,YAAY,YAAY;IAGxB,WAAW,gBAAgB;IAC3B,aAAa,YAAY;IACzB,WAAW,YAAY;IACvB,OAAO,YAAY;IAGnB,QAAQ,YAAY;IACpB,aAAa,YAAY;IACzB,aAAa,YAAY;IAGzB,gBAAgB,YAAY;IAC5B,gBAAgB,YAAY;IAC5B,eAAe,YAAY;IAG3B,GAAG,QAAQ,CAAE,0BAA0B;IAGvC,cAAc,gBAAgB;IAC9B,mBAAmB,gBAAgB;IACnC,YAAY,gBAAgB;IAC5B,eAAe,gBAAgB;IAG/B,mBAAmB,WAAW;IAC9B,mBAAmB,WAAW;IAC9B,qBAAqB,WAAW;IAChC,kBAAkB,WAAW;IAC7B,uBAAuB,WAAW;IAGlC,UAAU,YAAY;IACtB,UAAU,YAAY;IAGtB,YAAY,YAAY;IACxB,YAAY,YAAY;IACxB,aAAa,YAAY;IACzB,WAAW,YAAY;IACvB,SAAS,YAAY;IACrB,6BAA6B,YAAY;IACzC,wBAAwB,gBAAgB;IACxC,0BAA0B,YAAY;CAMvC"}
|
|
1
|
+
{"version":3,"file":"SemanticUuidPrefix.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/enums/SemanticUuidPrefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,oBAAY,kBAAkB;IAE5B,GAAG,QAAQ,CAAE,0CAA0C;IAGvD,eAAe,YAAY;IAC3B,UAAU,YAAY;IACtB,SAAS,YAAY;IACrB,UAAU,YAAY;IACtB,SAAS,YAAY;IACrB,eAAe,YAAY;IAC3B,oBAAoB,YAAY;IAGhC,aAAa,YAAY;IACzB,qBAAqB,gBAAgB;IACrC,wBAAwB,gBAAgB;IACxC,SAAS,YAAY;IACrB,mBAAmB,gBAAgB;IACnC,oBAAoB,gBAAgB;IACpC,WAAW,YAAY;IACvB,mBAAmB,gBAAgB;IACnC,sBAAsB,gBAAgB;IACtC,oBAAoB,gBAAgB;IACpC,aAAa,YAAY;IACzB,WAAW,YAAY;IACvB,cAAc,YAAY;IAG1B,UAAU,YAAY;IACtB,iBAAiB,gBAAgB;IACjC,cAAc,YAAY;IAC1B,YAAY,YAAY;IAGxB,WAAW,gBAAgB;IAC3B,aAAa,YAAY;IACzB,WAAW,YAAY;IACvB,OAAO,YAAY;IAGnB,QAAQ,YAAY;IACpB,aAAa,YAAY;IACzB,aAAa,YAAY;IAGzB,gBAAgB,YAAY;IAC5B,gBAAgB,YAAY;IAC5B,eAAe,YAAY;IAG3B,GAAG,QAAQ,CAAE,0BAA0B;IAGvC,cAAc,gBAAgB;IAC9B,mBAAmB,gBAAgB;IACnC,YAAY,gBAAgB;IAC5B,eAAe,gBAAgB;IAG/B,cAAc,YAAY;IAG1B,mBAAmB,WAAW;IAC9B,mBAAmB,WAAW;IAC9B,qBAAqB,WAAW;IAChC,kBAAkB,WAAW;IAC7B,uBAAuB,WAAW;IAGlC,UAAU,YAAY;IACtB,UAAU,YAAY;IAGtB,YAAY,YAAY;IACxB,YAAY,YAAY;IACxB,aAAa,YAAY;IACzB,WAAW,YAAY;IACvB,SAAS,YAAY;IACrB,6BAA6B,YAAY;IACzC,wBAAwB,gBAAgB;IACxC,0BAA0B,YAAY;CAMvC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CodedRootError } from './CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* AIS-D03 (tenant isolation): a resource references another one that belongs to a different
|
|
4
|
+
* Carbon Client (a product footprint over another client's product, an event edition under
|
|
5
|
+
* another client's event, ...).
|
|
6
|
+
*
|
|
7
|
+
* The message is generic on purpose: it never includes the foreign resource's data or ids, so it
|
|
8
|
+
* cannot be used to probe other tenants. The backend answers it exactly like "the referenced
|
|
9
|
+
* resource does not exist".
|
|
10
|
+
*/
|
|
11
|
+
export declare class InvalidCrossTenantReferenceError extends CodedRootError {
|
|
12
|
+
private constructor();
|
|
13
|
+
static create(referenceName: string): InvalidCrossTenantReferenceError;
|
|
14
|
+
logError(): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=InvalidCrossTenantReferenceError.d.ts.map
|
package/build/types/carbonbox/shared/domain/exceptions/InvalidCrossTenantReferenceError.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvalidCrossTenantReferenceError.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/exceptions/InvalidCrossTenantReferenceError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;;;GAQG;AACH,qBAAa,gCAAiC,SAAQ,cAAc;IAClE,OAAO;WAiBgB,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,gCAAgC;IAItE,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Event } from '../../../company-resources/events/domain/entity/Event';
|
|
2
|
+
import { EventEdition } from '../../../company-resources/events/editions/domain/entity/EventEdition';
|
|
3
|
+
import { Product } from '../../../company-resources/products/domain/entity/Product';
|
|
4
|
+
import { EventCarbonFootprintConfiguration } from '../../../carbon-footprint-configurations/event-configurations/domain/entity/EventCarbonFootprintConfiguration';
|
|
5
|
+
import { ProductCarbonFootprintConfiguration } from '../../../carbon-footprint-configurations/product-configurations/domain/entity/ProductCarbonFootprintConfiguration';
|
|
6
|
+
/**
|
|
7
|
+
* AIS-D03 (tenant isolation): references between resources stay inside one Carbon Client.
|
|
8
|
+
*
|
|
9
|
+
* Reference snapshots (`ProductReference`, `EventEditionReference`, `EventReference`) carry only
|
|
10
|
+
* `{ id, code, name }`, so the rule cannot live inside a single aggregate: the caller loads both
|
|
11
|
+
* aggregates and asks this policy. Static-only, like the footprint activation and completion
|
|
12
|
+
* policies; unlike them it throws, because every caller must stop on the first violation.
|
|
13
|
+
*
|
|
14
|
+
* A mismatch of the referenced id and a mismatch of the owner raise the same
|
|
15
|
+
* `InvalidCrossTenantReferenceError`, so "wrong reference" and "someone else's resource" are
|
|
16
|
+
* indistinguishable (anti-enumeration, AIS principle "not found ≡ out of scope").
|
|
17
|
+
*
|
|
18
|
+
* It lives in `shared` because it spans two bounded contexts (company resources and carbon
|
|
19
|
+
* footprint configurations).
|
|
20
|
+
*/
|
|
21
|
+
export declare class CarbonClientOwnershipPolicy {
|
|
22
|
+
private constructor();
|
|
23
|
+
/**
|
|
24
|
+
* The edition is one of `event`'s editions and has the same owner.
|
|
25
|
+
*/
|
|
26
|
+
static assertEventEditionBelongsToParentEvent(eventEdition: EventEdition, event: Event): void;
|
|
27
|
+
/**
|
|
28
|
+
* The footprint references `product` and both belong to the same Carbon Client.
|
|
29
|
+
*/
|
|
30
|
+
static assertProductCarbonFootprintConfigurationReferencesOwnProduct(configuration: ProductCarbonFootprintConfiguration, product: Product): void;
|
|
31
|
+
/**
|
|
32
|
+
* The footprint references `eventEdition` and both belong to the same Carbon Client.
|
|
33
|
+
*/
|
|
34
|
+
static assertEventCarbonFootprintConfigurationReferencesOwnEventEdition(configuration: EventCarbonFootprintConfiguration, eventEdition: EventEdition): void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=CarbonClientOwnershipPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarbonClientOwnershipPolicy.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/policies/CarbonClientOwnershipPolicy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,uDAAuD,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,uEAAuE,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,2DAA2D,CAAC;AACpF,OAAO,EAAE,iCAAiC,EAAE,MAAM,+GAA+G,CAAC;AAClK,OAAO,EAAE,mCAAmC,EAAE,MAAM,mHAAmH,CAAC;AAExK;;;;;;;;;;;;;;GAcG;AACH,qBAAa,2BAA2B;IACtC,OAAO;IAIP;;OAEG;WACW,sCAAsC,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IASpG;;OAEG;WACW,6DAA6D,CACzE,aAAa,EAAE,mCAAmC,EAClD,OAAO,EAAE,OAAO,GACf,IAAI;IASP;;OAEG;WACW,gEAAgE,CAC5E,aAAa,EAAE,iCAAiC,EAChD,YAAY,EAAE,YAAY,GACzB,IAAI;CAQR"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { StakeholderPermissions } from '../../../shared/domain/value-objects/StakeholderPermissions';
|
|
2
|
+
/**
|
|
3
|
+
* Permissions of a Carbon Client. `create` rejects permissions outside the Carbon Client
|
|
4
|
+
* ceiling (AIS-D01, `PermissionAboveRoleCeilingError`); `fromPrimitives` loads stored records as is.
|
|
5
|
+
*/
|
|
2
6
|
export declare class CarbonClientPermissions extends StakeholderPermissions {
|
|
7
|
+
private constructor();
|
|
8
|
+
static create(value: string[]): CarbonClientPermissions;
|
|
9
|
+
static fromPrimitives(primitives: string[]): CarbonClientPermissions;
|
|
3
10
|
}
|
|
4
11
|
//# sourceMappingURL=CarbonClientPermissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarbonClientPermissions.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientPermissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CarbonClientPermissions.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientPermissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6DAA6D,CAAC;AAGrG;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,sBAAsB;IACjE,OAAO;WAIgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,uBAAuB;WAQhD,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,uBAAuB;CAKrF"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { StakeholderPermissions } from '../../../shared/domain/value-objects/StakeholderPermissions';
|
|
2
|
+
/**
|
|
3
|
+
* Permissions of a Carbon Coordinator. `create` rejects permissions outside the Carbon Coordinator
|
|
4
|
+
* ceiling (AIS-D01, `PermissionAboveRoleCeilingError`); `fromPrimitives` loads stored records as is.
|
|
5
|
+
*/
|
|
2
6
|
export declare class CarbonCoordinatorPermissions extends StakeholderPermissions {
|
|
7
|
+
private constructor();
|
|
8
|
+
static create(value: string[]): CarbonCoordinatorPermissions;
|
|
9
|
+
static fromPrimitives(primitives: string[]): CarbonCoordinatorPermissions;
|
|
3
10
|
}
|
|
4
11
|
//# sourceMappingURL=CarbonCoordinatorPermissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarbonCoordinatorPermissions.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorPermissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CarbonCoordinatorPermissions.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorPermissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6DAA6D,CAAC;AAGrG;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,sBAAsB;IACtE,OAAO;WAIgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,4BAA4B;WAQrD,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,4BAA4B;CAK1F"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { StakeholderPermissions } from '../../../shared/domain/value-objects/StakeholderPermissions';
|
|
2
|
+
/**
|
|
3
|
+
* Permissions of a Carbon Manager. `create` rejects permissions outside the Carbon Manager
|
|
4
|
+
* ceiling (AIS-D01, `PermissionAboveRoleCeilingError`); `fromPrimitives` loads stored records as is.
|
|
5
|
+
*/
|
|
2
6
|
export declare class CarbonManagerPermissions extends StakeholderPermissions {
|
|
7
|
+
private constructor();
|
|
8
|
+
static create(value: string[]): CarbonManagerPermissions;
|
|
9
|
+
static fromPrimitives(primitives: string[]): CarbonManagerPermissions;
|
|
3
10
|
}
|
|
4
11
|
//# sourceMappingURL=CarbonManagerPermissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarbonManagerPermissions.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerPermissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CarbonManagerPermissions.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerPermissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6DAA6D,CAAC;AAGrG;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,sBAAsB;IAClE,OAAO;WAIgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,wBAAwB;WAQjD,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,wBAAwB;CAKtF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Permission } from '../../../../shared/domain/authorization/enums/Permission';
|
|
2
|
+
/**
|
|
3
|
+
* Carbon Client permission ceiling (AIS-D01, decision D9).
|
|
4
|
+
*
|
|
5
|
+
* The most a Carbon Client can ever hold: a validated `CarbonClientPermissions` rejects anything
|
|
6
|
+
* outside this list, whoever grants it (the host included). Initially it equals the backend
|
|
7
|
+
* `CARBON_CLIENT_PERMISSION_PRESET` (2026-10-22). The host may grant LESS (remove permissions
|
|
8
|
+
* within the ceiling), never more.
|
|
9
|
+
*
|
|
10
|
+
* Raising a ceiling is a deliberate decision that requires publishing the domain package. The
|
|
11
|
+
* backend presets must stay ⊆ ceiling, or creating a user with the default preset fails.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CARBON_CLIENT_PERMISSION_CEILING: ReadonlyArray<Permission>;
|
|
14
|
+
//# sourceMappingURL=CARBON_CLIENT_PERMISSION_CEILING.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CARBON_CLIENT_PERMISSION_CEILING.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/shared/domain/constants/CARBON_CLIENT_PERMISSION_CEILING.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AAEtF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gCAAgC,EAAE,aAAa,CAAC,UAAU,CA6EtE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Permission } from '../../../../shared/domain/authorization/enums/Permission';
|
|
2
|
+
/**
|
|
3
|
+
* Carbon Coordinator permission ceiling (AIS-D01, decision D9).
|
|
4
|
+
*
|
|
5
|
+
* The most a Carbon Coordinator can ever hold: a validated `CarbonCoordinatorPermissions` rejects
|
|
6
|
+
* anything outside this list, whoever grants it (the host included). Initially it equals the
|
|
7
|
+
* backend `CARBON_COORDINATOR_PERMISSION_PRESET` (2026-10-22). The host may grant LESS, never more.
|
|
8
|
+
*
|
|
9
|
+
* Raising a ceiling is a deliberate decision that requires publishing the domain package. The
|
|
10
|
+
* backend presets must stay ⊆ ceiling, or creating a user with the default preset fails. The
|
|
11
|
+
* manager ceiling is derived from this one (`CARBON_MANAGER_PERMISSION_CEILING`).
|
|
12
|
+
*/
|
|
13
|
+
export declare const CARBON_COORDINATOR_PERMISSION_CEILING: ReadonlyArray<Permission>;
|
|
14
|
+
//# sourceMappingURL=CARBON_COORDINATOR_PERMISSION_CEILING.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CARBON_COORDINATOR_PERMISSION_CEILING.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/shared/domain/constants/CARBON_COORDINATOR_PERMISSION_CEILING.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AAEtF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qCAAqC,EAAE,aAAa,CAAC,UAAU,CA8E3E,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Permission } from '../../../../shared/domain/authorization/enums/Permission';
|
|
2
|
+
/**
|
|
3
|
+
* Carbon Manager permission ceiling (AIS-D01, decision D9).
|
|
4
|
+
*
|
|
5
|
+
* = CARBON_COORDINATOR_PERMISSION_CEILING + team management, mirroring how the backend
|
|
6
|
+
* `CARBON_MANAGER_PERMISSION_PRESET` derives from the coordinator preset (2026-10-22).
|
|
7
|
+
* Granting and removing permissions (STAKEHOLDERS_ASSIGN/REMOVE_PERMISSIONS*) stays host-only.
|
|
8
|
+
*
|
|
9
|
+
* Raising a ceiling is a deliberate decision that requires publishing the domain package. The
|
|
10
|
+
* backend presets must stay ⊆ ceiling, or creating a user with the default preset fails. Do not
|
|
11
|
+
* repeat coordinator entries here: `UserPermissions` rejects duplicates.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CARBON_MANAGER_PERMISSION_CEILING: ReadonlyArray<Permission>;
|
|
14
|
+
//# sourceMappingURL=CARBON_MANAGER_PERMISSION_CEILING.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CARBON_MANAGER_PERMISSION_CEILING.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/shared/domain/constants/CARBON_MANAGER_PERMISSION_CEILING.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AAGtF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iCAAiC,EAAE,aAAa,CAAC,UAAU,CAavE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
import { StakeholderRole } from '../../../../shared/domain/enums/StakeholderRole';
|
|
3
|
+
/**
|
|
4
|
+
* AIS-D01: a stakeholder of `role` was given permissions outside the role's ceiling
|
|
5
|
+
* (`RolePermissionCeilingPolicy`). Raised whoever grants them, the host included.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PermissionAboveRoleCeilingError extends CodedRootError {
|
|
8
|
+
private constructor();
|
|
9
|
+
static create(role: StakeholderRole, permissionsAboveCeiling: readonly string[]): PermissionAboveRoleCeilingError;
|
|
10
|
+
logError(): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=PermissionAboveRoleCeilingError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionAboveRoleCeilingError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/shared/domain/exceptions/PermissionAboveRoleCeilingError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAErF,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAElF;;;GAGG;AACH,qBAAa,+BAAgC,SAAQ,cAAc;IACjE,OAAO;WAmBgB,MAAM,CAC3B,IAAI,EAAE,eAAe,EACrB,uBAAuB,EAAE,SAAS,MAAM,EAAE,GACzC,+BAA+B;IAIlB,QAAQ,IAAI,MAAM;CAGnC"}
|
package/build/types/carbonbox/stakeholders/shared/domain/policies/RolePermissionCeilingPolicy.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Permission } from '../../../../shared/domain/authorization/enums/Permission';
|
|
2
|
+
import { StakeholderRole } from '../../../../shared/domain/enums/StakeholderRole';
|
|
3
|
+
/**
|
|
4
|
+
* Pure domain policy with the permission ceiling of each stakeholder role (AIS-D01, D9).
|
|
5
|
+
*
|
|
6
|
+
* Why this exists: before the ceiling, any actor able to grant permissions could fabricate power
|
|
7
|
+
* (a client with host permissions). The ceiling is the most a role can ever hold; the backend adds
|
|
8
|
+
* the actor-relative rules on top (grantor ⊇ granted, target within the grantor's scope).
|
|
9
|
+
*
|
|
10
|
+
* The validated path of `CarbonClientPermissions`, `CarbonCoordinatorPermissions` and
|
|
11
|
+
* `CarbonManagerPermissions` (`create`) calls `assertWithinCeiling`; `fromPrimitives` does not, so
|
|
12
|
+
* existing records still load. `CARBON_HOST` has no ceiling.
|
|
13
|
+
*/
|
|
14
|
+
export declare class RolePermissionCeilingPolicy {
|
|
15
|
+
private static readonly CEILINGS_BY_ROLE;
|
|
16
|
+
private constructor();
|
|
17
|
+
static hasCeiling(role: StakeholderRole): boolean;
|
|
18
|
+
/** The ceiling of the role, or `null` when the role has none (host). */
|
|
19
|
+
static findCeiling(role: StakeholderRole): ReadonlyArray<Permission> | null;
|
|
20
|
+
/** The given permissions that fall outside the role's ceiling (empty when the role has none). */
|
|
21
|
+
static findPermissionsAboveCeiling(role: StakeholderRole, permissions: ReadonlyArray<Permission>): Permission[];
|
|
22
|
+
static isWithinCeiling(role: StakeholderRole, permissions: ReadonlyArray<Permission>): boolean;
|
|
23
|
+
/** Throws `PermissionAboveRoleCeilingError` listing every permission outside the role's ceiling. */
|
|
24
|
+
static assertWithinCeiling(role: StakeholderRole, permissions: ReadonlyArray<Permission>): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=RolePermissionCeilingPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RolePermissionCeilingPolicy.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/shared/domain/policies/RolePermissionCeilingPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0DAA0D,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAMlF;;;;;;;;;;GAUG;AACH,qBAAa,2BAA2B;IACtC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAIrC;IAEH,OAAO;WAIO,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO;IAIxD,wEAAwE;WAC1D,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,aAAa,CAAC,UAAU,CAAC,GAAG,IAAI;IAIlF,iGAAiG;WACnF,2BAA2B,CACvC,IAAI,EAAE,eAAe,EACrB,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,GACrC,UAAU,EAAE;WAUD,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,OAAO;IAIrG,oGAAoG;WACtF,mBAAmB,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,IAAI;CAOvG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Days an invitation stays valid after it is issued (AIS-D04, decision D3).
|
|
3
|
+
*
|
|
4
|
+
* The domain does not read the clock: whoever issues the invitation computes
|
|
5
|
+
* `expiresAt = issuedAt + USER_INVITATION_VALIDITY_IN_DAYS` and `UserInvitation.issue`
|
|
6
|
+
* rejects an expiry that is not after the issue moment.
|
|
7
|
+
*/
|
|
8
|
+
export declare const USER_INVITATION_VALIDITY_IN_DAYS = 7;
|
|
9
|
+
//# sourceMappingURL=USER_INVITATION_VALIDITY_IN_DAYS.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"USER_INVITATION_VALIDITY_IN_DAYS.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/constants/USER_INVITATION_VALIDITY_IN_DAYS.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,IAAI,CAAC"}
|
package/build/types/carbonbox/stakeholders/user-invitations/domain/entity/IUserInvitation.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IAggregateRoot } from '../../../../shared/domain/entities/IAggregateRoot';
|
|
2
|
+
import { UserInvitationUserId } from '../value-objects/UserInvitationUserId';
|
|
3
|
+
import { UserInvitationEmail } from '../value-objects/UserInvitationEmail';
|
|
4
|
+
import { UserInvitationTokenHash } from '../value-objects/UserInvitationTokenHash';
|
|
5
|
+
import { UserInvitationIssuedAt } from '../value-objects/UserInvitationIssuedAt';
|
|
6
|
+
import { UserInvitationExpiresAt } from '../value-objects/UserInvitationExpiresAt';
|
|
7
|
+
import { UserInvitationConsumedAt } from '../value-objects/UserInvitationConsumedAt';
|
|
8
|
+
import { UserInvitationRevokedAt } from '../value-objects/UserInvitationRevokedAt';
|
|
9
|
+
import { UserInvitationInvitedByStakeholder } from '../value-objects/UserInvitationInvitedByStakeholder';
|
|
10
|
+
export interface IUserInvitation extends IAggregateRoot {
|
|
11
|
+
userId: UserInvitationUserId;
|
|
12
|
+
email: UserInvitationEmail;
|
|
13
|
+
tokenHash: UserInvitationTokenHash;
|
|
14
|
+
issuedAt: UserInvitationIssuedAt;
|
|
15
|
+
expiresAt: UserInvitationExpiresAt;
|
|
16
|
+
consumedAt: UserInvitationConsumedAt;
|
|
17
|
+
revokedAt: UserInvitationRevokedAt;
|
|
18
|
+
invitedByStakeholder: UserInvitationInvitedByStakeholder;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=IUserInvitation.d.ts.map
|
package/build/types/carbonbox/stakeholders/user-invitations/domain/entity/IUserInvitation.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUserInvitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/entity/IUserInvitation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qDAAqD,CAAC;AAEzG,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,MAAM,EAAE,oBAAoB,CAAC;IAC7B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,SAAS,EAAE,uBAAuB,CAAC;IACnC,QAAQ,EAAE,sBAAsB,CAAC;IACjC,SAAS,EAAE,uBAAuB,CAAC;IACnC,UAAU,EAAE,wBAAwB,CAAC;IACrC,SAAS,EAAE,uBAAuB,CAAC;IACnC,oBAAoB,EAAE,kCAAkC,CAAC;CAC1D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { AggregateRoot } from '../../../../shared/domain/entities/AggregateRoot';
|
|
2
|
+
import { UserInvitationPrimitives } from '../types/UserInvitationPrimitives';
|
|
3
|
+
import { UserInvitationProps } from '../types/UserInvitationProps';
|
|
4
|
+
import { UserInvitationIssueProps } from '../types/UserInvitationIssueProps';
|
|
5
|
+
import { UserInvitationUserId } from '../value-objects/UserInvitationUserId';
|
|
6
|
+
import { UserInvitationEmail } from '../value-objects/UserInvitationEmail';
|
|
7
|
+
import { UserInvitationTokenHash } from '../value-objects/UserInvitationTokenHash';
|
|
8
|
+
import { UserInvitationIssuedAt } from '../value-objects/UserInvitationIssuedAt';
|
|
9
|
+
import { UserInvitationExpiresAt } from '../value-objects/UserInvitationExpiresAt';
|
|
10
|
+
import { UserInvitationConsumedAt } from '../value-objects/UserInvitationConsumedAt';
|
|
11
|
+
import { UserInvitationRevokedAt } from '../value-objects/UserInvitationRevokedAt';
|
|
12
|
+
import { UserInvitationInvitedByStakeholder } from '../value-objects/UserInvitationInvitedByStakeholder';
|
|
13
|
+
import { IUserInvitation } from './IUserInvitation';
|
|
14
|
+
/**
|
|
15
|
+
* UserInvitation aggregate (AIS-D04, decision D3): a stakeholder created by someone else sets
|
|
16
|
+
* its own password by accepting a single-use, time-bound invitation. The creator never knows
|
|
17
|
+
* the password.
|
|
18
|
+
*
|
|
19
|
+
* Only the SHA-256 of the token is kept. The domain does not read the clock: issuing, accepting
|
|
20
|
+
* and revoking receive the current moment (`DD/MM/YYYY HH:mm:ss`). Changes return a new instance.
|
|
21
|
+
*
|
|
22
|
+
* Lifecycle: pending → consumed (accepted) | revoked (replaced by a resent invitation). Expiry is
|
|
23
|
+
* not a stored state: it is evaluated against the moment given (`isExpiredAt`).
|
|
24
|
+
*/
|
|
25
|
+
export declare class UserInvitation extends AggregateRoot<UserInvitationPrimitives> implements IUserInvitation {
|
|
26
|
+
#private;
|
|
27
|
+
private constructor();
|
|
28
|
+
static create(props: UserInvitationProps): UserInvitation;
|
|
29
|
+
/**
|
|
30
|
+
* Issues a new pending invitation (neither consumed nor revoked). The caller computes
|
|
31
|
+
* `expiresAt = issuedAt + USER_INVITATION_VALIDITY_IN_DAYS`; an expiry that is not after the
|
|
32
|
+
* issue moment is rejected (InvalidDateRangeError).
|
|
33
|
+
*/
|
|
34
|
+
static issue(props: UserInvitationIssueProps): UserInvitation;
|
|
35
|
+
static fromPrimitives(primitives: UserInvitationPrimitives): UserInvitation;
|
|
36
|
+
get toPrimitives(): UserInvitationPrimitives;
|
|
37
|
+
get userId(): UserInvitationUserId;
|
|
38
|
+
get email(): UserInvitationEmail;
|
|
39
|
+
get tokenHash(): UserInvitationTokenHash;
|
|
40
|
+
get issuedAt(): UserInvitationIssuedAt;
|
|
41
|
+
get expiresAt(): UserInvitationExpiresAt;
|
|
42
|
+
get consumedAt(): UserInvitationConsumedAt;
|
|
43
|
+
get revokedAt(): UserInvitationRevokedAt;
|
|
44
|
+
get invitedByStakeholder(): UserInvitationInvitedByStakeholder;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the invitation is neither consumed nor revoked. Expiry is checked separately with
|
|
47
|
+
* `isExpiredAt`, since it depends on the moment.
|
|
48
|
+
*/
|
|
49
|
+
isPending(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the validity ended at the given moment (`DD/MM/YYYY HH:mm:ss`).
|
|
52
|
+
*/
|
|
53
|
+
isExpiredAt(now: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the invitation accepted at `now`. Checked in this order: revoked
|
|
56
|
+
* (UserInvitationRevokedError), already consumed (UserInvitationAlreadyConsumedError) and
|
|
57
|
+
* expired (UserInvitationExpiredError).
|
|
58
|
+
*/
|
|
59
|
+
consume(now: string): UserInvitation;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the invitation revoked at `now` (resending replaces the previous invitation).
|
|
62
|
+
* Revoking an already revoked invitation returns it unchanged; a consumed invitation cannot be
|
|
63
|
+
* revoked (UserInvitationAlreadyConsumedError).
|
|
64
|
+
*/
|
|
65
|
+
revoke(now: string): UserInvitation;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=UserInvitation.d.ts.map
|
package/build/types/carbonbox/stakeholders/user-invitations/domain/entity/UserInvitation.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserInvitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/entity/UserInvitation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAGjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACn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AAE,MAAM,GAAG,OAAO;IAIxC;;;;OAIG;IACI,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc;IAqB3C;;;;OAIG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc;CA8C3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* The invitation was already accepted; an invitation is single use.
|
|
4
|
+
* Raised on an anonymous flow: the message and context never identify the invitation, the user
|
|
5
|
+
* or the email (no account enumeration).
|
|
6
|
+
*/
|
|
7
|
+
export declare class UserInvitationAlreadyConsumedError extends CodedRootError {
|
|
8
|
+
private constructor();
|
|
9
|
+
static create(): UserInvitationAlreadyConsumedError;
|
|
10
|
+
logError(): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=UserInvitationAlreadyConsumedError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserInvitationAlreadyConsumedError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationAlreadyConsumedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF;;;;GAIG;AACH,qBAAa,kCAAmC,SAAQ,cAAc;IACpE,OAAO;WAgBgB,MAAM,IAAI,kCAAkC;IAInD,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* The invitation can no longer be accepted because its validity ended.
|
|
4
|
+
* Raised on an anonymous flow: the message and context never identify the invitation, the user
|
|
5
|
+
* or the email (no account enumeration).
|
|
6
|
+
*/
|
|
7
|
+
export declare class UserInvitationExpiredError extends CodedRootError {
|
|
8
|
+
private constructor();
|
|
9
|
+
static create(): UserInvitationExpiredError;
|
|
10
|
+
logError(): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=UserInvitationExpiredError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserInvitationExpiredError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationExpiredError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,cAAc;IAC5D,OAAO;WAgBgB,MAAM,IAAI,0BAA0B;IAI3C,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CodedRootError } from '../../../../shared/domain/exceptions/CodedRootError';
|
|
2
|
+
/**
|
|
3
|
+
* The invitation was revoked (for example, replaced by a newer one when it was resent).
|
|
4
|
+
* Raised on an anonymous flow: the message and context never identify the invitation, the user
|
|
5
|
+
* or the email (no account enumeration).
|
|
6
|
+
*/
|
|
7
|
+
export declare class UserInvitationRevokedError extends CodedRootError {
|
|
8
|
+
private constructor();
|
|
9
|
+
static create(): UserInvitationRevokedError;
|
|
10
|
+
logError(): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=UserInvitationRevokedError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserInvitationRevokedError.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/exceptions/UserInvitationRevokedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAGrF;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,cAAc;IAC5D,OAAO;WAgBgB,MAAM,IAAI,0BAA0B;IAI3C,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Nullable } from '../../../../shared/domain/types/Nullable';
|
|
2
|
+
import { UserInvitation } from '../entity/UserInvitation';
|
|
3
|
+
import { UserInvitationId } from '../value-objects/UserInvitationId';
|
|
4
|
+
import { UserInvitationTokenHash } from '../value-objects/UserInvitationTokenHash';
|
|
5
|
+
import { UserInvitationUserId } from '../value-objects/UserInvitationUserId';
|
|
6
|
+
/**
|
|
7
|
+
* Repository interface for the UserInvitation aggregate.
|
|
8
|
+
*/
|
|
9
|
+
export interface IUserInvitationRepository {
|
|
10
|
+
/**
|
|
11
|
+
* Persists the invitation, creating the record when it does not exist yet (upsert by id)
|
|
12
|
+
* @param userInvitation - The user invitation aggregate to save
|
|
13
|
+
*/
|
|
14
|
+
save(userInvitation: UserInvitation): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Finds an invitation by its id
|
|
17
|
+
* @param id - The invitation id
|
|
18
|
+
* @returns The invitation, or null when it does not exist
|
|
19
|
+
*/
|
|
20
|
+
findById(id: UserInvitationId): Promise<Nullable<UserInvitation>>;
|
|
21
|
+
/**
|
|
22
|
+
* Finds an invitation by the hash of its token (the accept flow hashes the received token)
|
|
23
|
+
* @param tokenHash - SHA-256 of the token
|
|
24
|
+
* @returns The invitation, or null when no invitation has that hash
|
|
25
|
+
*/
|
|
26
|
+
findByTokenHash(tokenHash: UserInvitationTokenHash): Promise<Nullable<UserInvitation>>;
|
|
27
|
+
/**
|
|
28
|
+
* Finds the pending invitation of a user (neither consumed nor revoked; it may be expired).
|
|
29
|
+
* At most one pending invitation exists per user: resending revokes the previous one.
|
|
30
|
+
* @param userId - The id of the invited user
|
|
31
|
+
* @returns The pending invitation, or null when the user has none
|
|
32
|
+
*/
|
|
33
|
+
findPendingByUserId(userId: UserInvitationUserId): Promise<Nullable<UserInvitation>>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=IUserInvitationRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUserInvitationRepository.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/repository/IUserInvitationRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAElE;;;;OAIG;IACH,eAAe,CAAC,SAAS,EAAE,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAEvF;;;;;OAKG;IACH,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;CACtF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StakeholderReferencePrimitives } from '../../../../shared/domain/types/StakeholderReferencePrimitives';
|
|
2
|
+
/**
|
|
3
|
+
* UserInvitationIssueProps - Props to issue a new invitation (`UserInvitation.issue`).
|
|
4
|
+
* A new invitation is neither consumed nor revoked.
|
|
5
|
+
*/
|
|
6
|
+
export type UserInvitationIssueProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Aggregate identity (`USR-INV_<id>`)
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Id of the invited stakeholder user
|
|
13
|
+
*/
|
|
14
|
+
userId: string;
|
|
15
|
+
/**
|
|
16
|
+
* Email the invitation is sent to
|
|
17
|
+
*/
|
|
18
|
+
email: string;
|
|
19
|
+
/**
|
|
20
|
+
* SHA-256 of the invitation token (64 lowercase hexadecimal characters)
|
|
21
|
+
*/
|
|
22
|
+
tokenHash: string;
|
|
23
|
+
/**
|
|
24
|
+
* Moment the invitation is issued (the current moment, provided by the caller)
|
|
25
|
+
*/
|
|
26
|
+
issuedAt: string;
|
|
27
|
+
/**
|
|
28
|
+
* `issuedAt + USER_INVITATION_VALIDITY_IN_DAYS`, computed by the caller
|
|
29
|
+
*/
|
|
30
|
+
expiresAt: string;
|
|
31
|
+
/**
|
|
32
|
+
* Stakeholder who issues the invitation
|
|
33
|
+
*/
|
|
34
|
+
invitedByStakeholder: StakeholderReferencePrimitives;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=UserInvitationIssueProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserInvitationIssueProps.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationIssueProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,gEAAgE,CAAC;AAEhH;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,oBAAoB,EAAE,8BAA8B,CAAC;CACtD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { StakeholderReferencePrimitives } from '../../../../shared/domain/types/StakeholderReferencePrimitives';
|
|
2
|
+
/**
|
|
3
|
+
* UserInvitationPrimitives - Primitives representation of the UserInvitation aggregate (AIS-D04)
|
|
4
|
+
*
|
|
5
|
+
* A stakeholder created by someone else starts as an invitation: the creator never knows the
|
|
6
|
+
* password, the invited user sets it when accepting. Dates use the domain datetime format
|
|
7
|
+
* (`DD/MM/YYYY HH:mm:ss`).
|
|
8
|
+
*/
|
|
9
|
+
export type UserInvitationPrimitives = {
|
|
10
|
+
/**
|
|
11
|
+
* Aggregate identity (`USR-INV_<id>`)
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* Id of the invited stakeholder user (client, coordinator or manager)
|
|
16
|
+
*/
|
|
17
|
+
userId: string;
|
|
18
|
+
/**
|
|
19
|
+
* Email the invitation was sent to
|
|
20
|
+
*/
|
|
21
|
+
email: string;
|
|
22
|
+
/**
|
|
23
|
+
* SHA-256 of the invitation token, 64 lowercase hexadecimal characters. The raw token is only
|
|
24
|
+
* in the email link and never reaches the domain or the database.
|
|
25
|
+
*/
|
|
26
|
+
tokenHash: string;
|
|
27
|
+
/**
|
|
28
|
+
* Moment the invitation was issued
|
|
29
|
+
*/
|
|
30
|
+
issuedAt: string;
|
|
31
|
+
/**
|
|
32
|
+
* Moment from which the invitation can no longer be accepted
|
|
33
|
+
*/
|
|
34
|
+
expiresAt: string;
|
|
35
|
+
/**
|
|
36
|
+
* Moment the invited user accepted it, or null while not accepted
|
|
37
|
+
*/
|
|
38
|
+
consumedAt: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Moment it was revoked (for example, replaced by a resent invitation), or null
|
|
41
|
+
*/
|
|
42
|
+
revokedAt: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Stakeholder who issued the invitation
|
|
45
|
+
*/
|
|
46
|
+
invitedByStakeholder: StakeholderReferencePrimitives;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=UserInvitationPrimitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserInvitationPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/stakeholders/user-invitations/domain/types/UserInvitationPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,gEAAgE,CAAC;AAEhH;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,oBAAoB,EAAE,8BAA8B,CAAC;CACtD,CAAC"}
|