@coast/core-api-types 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/models/activity-feed/CreateUserRelation.d.ts +2 -1
  2. package/dist/models/activity-feed/ListActivityFeedItems.d.ts +2 -1
  3. package/dist/models/auth/CreateChannelMembership.d.ts +2 -1
  4. package/dist/models/auth/SamlUser.d.ts +2 -1
  5. package/dist/models/automations/Automation.d.ts +2 -1
  6. package/dist/models/automations/AutomationContext.d.ts +2 -1
  7. package/dist/models/automations/action/settings/SendPushNotificationActionSettings.d.ts +2 -1
  8. package/dist/models/billing/Billing.d.ts +4 -2
  9. package/dist/models/billing/CreateCustomer.d.ts +4 -2
  10. package/dist/models/billing/Customer.d.ts +2 -1
  11. package/dist/models/business/Business.d.ts +2 -1
  12. package/dist/models/business/BusinessEventJob.d.ts +4 -2
  13. package/dist/models/business/BusinessMembership.d.ts +4 -2
  14. package/dist/models/business/UpdateBusinessV2.d.ts +2 -1
  15. package/dist/models/card/Card.d.ts +2 -1
  16. package/dist/models/card/CreateNonRecurringCard.d.ts +3 -2
  17. package/dist/models/card/ExternalCardBatchEvent.d.ts +4 -2
  18. package/dist/models/card/ExternalCardEventPayload.d.ts +4 -2
  19. package/dist/models/card/NotificationEvent.d.ts +3 -2
  20. package/dist/models/card/UpdateCard.d.ts +2 -1
  21. package/dist/models/card/client-event/ClientEvent.d.ts +2 -1
  22. package/dist/models/card/client-event/CreateClientEvent.d.ts +2 -1
  23. package/dist/models/card/list-cards/ListCards.d.ts +3 -2
  24. package/dist/models/channel/Channel.d.ts +2 -1
  25. package/dist/models/channel/ChannelEventJob.d.ts +2 -1
  26. package/dist/models/channel/CreateChannel.d.ts +2 -1
  27. package/dist/models/channel/ListChannels.d.ts +2 -1
  28. package/dist/models/common/WithBusinessId.d.ts +2 -1
  29. package/dist/models/dashboard/Dashboard.d.ts +2 -1
  30. package/dist/models/dashboard/UserEntityWidgetAssociation.d.ts +2 -1
  31. package/dist/models/export/BulkExportRequest.d.ts +2 -1
  32. package/dist/models/integration/CreateAppIntegration.d.ts +2 -1
  33. package/dist/models/integration/Integration.d.ts +4 -2
  34. package/dist/models/integration/IntegrationVerification.d.ts +2 -1
  35. package/dist/models/integration/ListIntegrations.d.ts +2 -1
  36. package/dist/models/messaging/CreateLegacyMessage.d.ts +2 -1
  37. package/dist/models/messaging/CreateThreadMessage.d.ts +2 -1
  38. package/dist/models/messaging/ThreadMessage.d.ts +2 -1
  39. package/dist/models/messaging/ThreadMessageMeta.d.ts +2 -1
  40. package/dist/models/messaging/ThreadMessageMetaInput.d.ts +2 -1
  41. package/dist/models/messaging/ThreadMessageReaction.d.ts +2 -1
  42. package/dist/models/messaging/Token.d.ts +2 -1
  43. package/dist/models/metrics/CreateUsageMetric.d.ts +4 -2
  44. package/dist/models/metrics/MessageEventJob.d.ts +4 -2
  45. package/dist/models/metrics/StorageEventJob.d.ts +4 -2
  46. package/dist/models/metrics/UsageMetric.d.ts +4 -2
  47. package/dist/models/search/Indexable.d.ts +3 -2
  48. package/dist/models/search/SearchResult.d.ts +3 -2
  49. package/dist/models/shared-link/SharedCardLink.d.ts +2 -1
  50. package/dist/models/user/CreateUserV2.d.ts +2 -1
  51. package/dist/models/user/ListUsers.d.ts +2 -1
  52. package/dist/models/user/User.d.ts +2 -1
  53. package/dist/models/user/UserEventJob.d.ts +5 -3
  54. package/dist/models/user/UserId.d.ts +2 -0
  55. package/dist/models/user/UserId.js +2 -0
  56. package/dist/models/user/group/CreateUserGroup.d.ts +3 -0
  57. package/dist/models/user/group/CreateUserGroup.js +2 -0
  58. package/dist/models/user/group/ListUserGroupAssociations.d.ts +5 -0
  59. package/dist/models/user/group/ListUserGroupAssociations.js +2 -0
  60. package/dist/models/user/group/ListUserGroupAssociationsResult.d.ts +5 -0
  61. package/dist/models/user/group/ListUserGroupAssociationsResult.js +2 -0
  62. package/dist/models/user/group/UpdateUserGroup.d.ts +3 -0
  63. package/dist/models/user/group/UpdateUserGroup.js +2 -0
  64. package/dist/models/user/group/UserGroup.d.ts +9 -0
  65. package/dist/models/user/group/UserGroup.js +2 -0
  66. package/dist/models/user/group/UserGroupAssociation.d.ts +6 -0
  67. package/dist/models/user/group/UserGroupAssociation.js +2 -0
  68. package/dist/models/user/group/UserGroupId.d.ts +2 -0
  69. package/dist/models/user/group/UserGroupId.js +2 -0
  70. package/dist/models/workflow-template/ListWorkflowTemplates.d.ts +2 -1
  71. package/dist/models/workflow-template/WorkflowTemplate.d.ts +4 -2
  72. package/dist/models/workflow-template/components/geo-location/GeolocationComponentDataValue.d.ts +2 -1
  73. package/dist/models/workflow-template/components/person/PersonComponentData.d.ts +2 -1
  74. package/dist/models/workflow-template/components/person/PersonComponentDefault.d.ts +2 -1
  75. package/dist/models/workflow-template/components/time-tracker/TimeTrackerGeolocation.d.ts +2 -1
  76. package/dist/models/workflow-template/entities/CreateWorkflowEntity.d.ts +2 -1
  77. package/dist/models/workflow-template/entities/ListWorkflowEntitiesContext.d.ts +2 -1
  78. package/dist/models/workflow-template/entities/audit-trail/EntityAuditTrailEvent.d.ts +2 -1
  79. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import { UserId } from '../user/UserId';
1
2
  export interface CreateUserRelation {
2
- id: number;
3
+ id: UserId;
3
4
  }
@@ -1,6 +1,7 @@
1
+ import { UserId } from '../user/UserId';
1
2
  export interface ListActivityFeedItems {
2
3
  channelIds?: number[];
3
- excludeUserId?: number;
4
+ excludeUserId?: UserId;
4
5
  limit?: number;
5
6
  cursor?: Date;
6
7
  }
@@ -1,7 +1,8 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { AccessLevelType } from './AccessLevelType';
2
3
  import { ChannelMembership } from './ChannelMembership';
3
4
  export interface CreateChannelMembership extends Partial<ChannelMembership> {
4
5
  accessLevelType: AccessLevelType;
5
6
  channelId: number;
6
- userId: number;
7
+ userId: UserId;
7
8
  }
@@ -1,5 +1,6 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  export interface SamlUser {
2
3
  id: number;
3
4
  email: string;
4
- businessId: number;
5
+ businessId: BusinessId;
5
6
  }
@@ -1,11 +1,12 @@
1
1
  import { Audit } from '../application/Audit';
2
+ import { BusinessId } from '../business/BusinessId';
2
3
  import { AutomationActionRegistry } from './action/AutomationActionRegistry';
3
4
  import { AutomationTriggerType } from './AutomationTriggerType';
4
5
  import { Condition } from './condition/Condition';
5
6
  export interface Automation extends Audit {
6
7
  id: string;
7
8
  parentId?: string;
8
- businessId: number;
9
+ businessId: BusinessId;
9
10
  trigger: AutomationTriggerType;
10
11
  name: string;
11
12
  actions: AutomationActionRegistry.Any[];
@@ -1,3 +1,4 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { EntityFields } from '../workflow-template/entities/EntityFields';
2
3
  import { EntityRefs } from '../workflow-template/entities/refs/EntityRefs';
3
4
  import { WorkflowEntity } from '../workflow-template/entities/WorkflowEntity';
@@ -5,7 +6,7 @@ import { AutomationActionResult } from './action/AutomationActionResult';
5
6
  import { AutomationEventContext } from './AutomationEventContext';
6
7
  import { AutomationId } from './AutomationId';
7
8
  export interface AutomationContext {
8
- businessId: number;
9
+ businessId: BusinessId;
9
10
  workflowEntity: WorkflowEntity;
10
11
  previousWorkflowEntityFields?: EntityFields;
11
12
  refs: EntityRefs;
@@ -1,6 +1,7 @@
1
+ import { UserId } from '../../../user/UserId';
1
2
  import { AutomationActionSettings } from './AutomationActionSettings';
2
3
  export interface SendPushNotificationActionSettings extends AutomationActionSettings {
3
- recipientUserIds?: number[];
4
+ recipientUserIds?: UserId[];
4
5
  recipientsFromPersonComponentIds?: string[];
5
6
  workflowTemplateId: string;
6
7
  title: string;
@@ -1,7 +1,9 @@
1
1
  import { Audit } from '../application/Audit';
2
+ import { BusinessId } from '../business/BusinessId';
3
+ import { UserId } from '../user/UserId';
2
4
  export interface Billing extends Audit {
3
5
  id: number;
4
- businessId: number;
5
- userId: number;
6
+ businessId: BusinessId;
7
+ userId: UserId;
6
8
  stripeCustomerId: string;
7
9
  }
@@ -1,6 +1,8 @@
1
+ import { BusinessId } from '../business/BusinessId';
2
+ import { UserId } from '../user/UserId';
1
3
  export interface CreateCustomer {
2
- businessId: number;
3
- userId: number;
4
+ businessId: BusinessId;
5
+ userId: UserId;
4
6
  email?: string;
5
7
  name?: string;
6
8
  }
@@ -1,8 +1,9 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { BillingSubscription } from './BillingSubscription';
2
3
  export interface Customer {
3
4
  id: string;
4
5
  metadata?: {
5
- userId: number;
6
+ userId: UserId;
6
7
  billingId: number;
7
8
  };
8
9
  email?: string;
@@ -1,6 +1,7 @@
1
1
  import { Audit } from '../application/Audit';
2
+ import { BusinessId } from './BusinessId';
2
3
  export interface Business extends Audit {
3
- id: number;
4
+ id: BusinessId;
4
5
  name: string;
5
6
  slug: string;
6
7
  email?: string;
@@ -1,6 +1,8 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { BusinessEventType } from './BusinessEventType';
3
+ import { BusinessId } from './BusinessId';
2
4
  export interface BusinessEventJob {
3
- userId: number;
4
- businessId: number;
5
+ userId: UserId;
6
+ businessId: BusinessId;
5
7
  type: BusinessEventType;
6
8
  }
@@ -1,8 +1,10 @@
1
1
  import { User } from '../user/User';
2
+ import { UserId } from '../user/UserId';
3
+ import { BusinessId } from './BusinessId';
2
4
  import { BusinessMembershipRole } from './BusinessMembershipRole';
3
5
  export interface BusinessMembership {
4
- userId: number;
5
- businessId: number;
6
+ userId: UserId;
7
+ businessId: BusinessId;
6
8
  creatorId?: number;
7
9
  role?: BusinessMembershipRole;
8
10
  manages?: boolean;
@@ -1,4 +1,5 @@
1
+ import { BusinessId } from './BusinessId';
1
2
  export interface UpdateBusinessV2 {
2
- id: number;
3
+ id: BusinessId;
3
4
  password?: string;
4
5
  }
@@ -3,6 +3,7 @@ import { DataEntity } from '../application/DataEntity';
3
3
  import { PlanLimitEntity } from '../plan-limits/PlanLimitEntity';
4
4
  import { Indexable } from '../search/Indexable';
5
5
  import { User } from '../user/User';
6
+ import { UserId } from '../user/UserId';
6
7
  import { WorkflowEntity } from '../workflow-template/entities/WorkflowEntity';
7
8
  import { CardFieldStringTag } from './card-field-string-tag/CardFieldStringTag';
8
9
  import { CardReminder } from './card-reminder/CardReminder';
@@ -13,7 +14,7 @@ import { RelatedCardSummary } from './related-card/RelatedCardSummary';
13
14
  export interface Card extends DataEntity, Indexable, PlanLimitEntity, WorkflowEntity, Audit {
14
15
  id: string;
15
16
  channelId: number;
16
- userId: number;
17
+ userId: UserId;
17
18
  sequenceNumber?: number;
18
19
  threadId: string;
19
20
  cardReminders: CardReminder[];
@@ -1,10 +1,11 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { DeepPartial } from '../utils/DeepPartial';
2
3
  import { Card } from './Card';
3
4
  import { CreateCardReminder } from './card-reminder/CreateCardReminder';
4
5
  import { CardFields } from './CardFields';
5
6
  export interface CreateNonRecurringCard extends DeepPartial<Card> {
6
7
  channelId: number;
7
- userId?: number;
8
+ userId?: UserId;
8
9
  sequenceNumber?: number;
9
10
  cardDefinitionId?: string;
10
11
  workflowTemplateId?: string;
@@ -15,6 +16,6 @@ export interface CreateNonRecurringCard extends DeepPartial<Card> {
15
16
  endDate?: Date;
16
17
  fields?: CardFields;
17
18
  cardReminders?: CreateCardReminder[];
18
- assigneeIds?: number[];
19
+ assigneeIds?: UserId[];
19
20
  kanbanSortKey: string;
20
21
  }
@@ -1,6 +1,8 @@
1
+ import { BusinessId } from '../business/BusinessId';
2
+ import { UserId } from '../user/UserId';
1
3
  export interface ExternalCardBatchEvent {
2
- userId: number;
3
- businessId: number;
4
+ userId: UserId;
5
+ businessId: BusinessId;
4
6
  channelId: number;
5
7
  count: number;
6
8
  }
@@ -1,10 +1,12 @@
1
+ import { BusinessId } from '../business/BusinessId';
2
+ import { UserId } from '../user/UserId';
1
3
  import { WorkflowAutomationsEvent } from '../workflow-automation/WorkflowAutomationsEvent';
2
4
  import { ComponentSubscriptionEvents } from '../workflow-template/component-subscription/ComponentSubscriptionEvents';
3
5
  import { CreateEntityAuditTrailEvent } from '../workflow-template/entities/audit-trail/CreateEntityAuditTrailEvent';
4
6
  import { Card } from './Card';
5
7
  export interface ExternalCardEventPayload {
6
- userId: number;
7
- businessId: number;
8
+ userId: UserId;
9
+ businessId: BusinessId;
8
10
  channelId: number;
9
11
  card: Partial<Card>;
10
12
  targetEntity: boolean;
@@ -1,7 +1,8 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { CardReminderEventType } from './card-reminder/CardReminderEventType';
2
3
  import { EntityEventType } from './EntityEventType';
3
4
  export interface UnreadCount {
4
- userId: number;
5
+ userId: UserId;
5
6
  unreadCount: number;
6
7
  }
7
8
  export interface Notification extends UnreadCount {
@@ -11,7 +12,7 @@ export interface Notification extends UnreadCount {
11
12
  export interface NotificationEvent {
12
13
  type: EntityEventType | CardReminderEventType;
13
14
  channelId: number;
14
- userId: number;
15
+ userId: UserId;
15
16
  urgent: boolean;
16
17
  cardId?: string;
17
18
  cardName?: string;
@@ -1,3 +1,4 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { DeepPartial } from '../utils/DeepPartial';
2
3
  import { Card } from './Card';
3
4
  import { UpdateCardReminder } from './card-reminder/UpdateCardReminder';
@@ -15,5 +16,5 @@ export interface UpdateCard extends DeepPartial<Card> {
15
16
  entityRecurrence?: UpdateEntityRecurrence;
16
17
  scope?: EntityRecurrenceScope;
17
18
  kanbanSortKey?: string;
18
- assigneeIds?: number[];
19
+ assigneeIds?: UserId[];
19
20
  }
@@ -1,7 +1,8 @@
1
+ import { UserId } from '../../user/UserId';
1
2
  import { ClientEventType } from './ClientEventType';
2
3
  export interface ClientEvent {
3
4
  id: string;
4
- userId: number;
5
+ userId: UserId;
5
6
  cardId?: string;
6
7
  channelId?: number;
7
8
  messageId?: number;
@@ -1,7 +1,8 @@
1
+ import { UserId } from '../../user/UserId';
1
2
  import { ClientEvent } from './ClientEvent';
2
3
  import { ClientEventType } from './ClientEventType';
3
4
  export interface CreateClientEvent extends Partial<ClientEvent> {
4
- userId?: number;
5
+ userId?: UserId;
5
6
  cardId?: string;
6
7
  channelId?: number;
7
8
  messageId?: number;
@@ -1,4 +1,5 @@
1
1
  import { OffsetPaginatedRequest } from '../../pagination/OffsetPaginatedRequest';
2
+ import { UserId } from '../../user/UserId';
2
3
  import { CardStatus } from '../CardStatus';
3
4
  import { CardRelationFilter } from './CardRelationFilter';
4
5
  import { CardTagFilter } from './CardTagFilter';
@@ -16,6 +17,6 @@ export interface ListCards extends OffsetPaginatedRequest {
16
17
  relationFilters?: CardRelationFilter[];
17
18
  legacyRelationFilters?: LegacyCardRelationFilter[];
18
19
  nameQuery?: string;
19
- createdByOrAssignedToUserId?: number;
20
- assigneeIds?: number[];
20
+ createdByOrAssignedToUserId?: UserId;
21
+ assigneeIds?: UserId[];
21
22
  }
@@ -1,12 +1,13 @@
1
1
  import { Audit } from '../application/Audit';
2
2
  import { ChannelMembership } from '../auth/ChannelMembership';
3
+ import { BusinessId } from '../business/BusinessId';
3
4
  import { CardDefinition } from '../card/card-definition/CardDefinition';
4
5
  import { WorkspaceFocus } from '../card/WorkspaceFocus';
5
6
  import { ChannelType } from './ChannelType';
6
7
  import { RelatedChannelAssociation } from './RelatedChannelAssociation';
7
8
  export interface Channel extends Audit {
8
9
  id: number;
9
- businessId: number;
10
+ businessId: BusinessId;
10
11
  parentId: number;
11
12
  updatedBy: number;
12
13
  type: ChannelType;
@@ -1,6 +1,7 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { ChannelEventType } from './ChannelEventType';
2
3
  export interface ChannelEventJob {
3
- userId: number;
4
+ userId: UserId;
4
5
  channelId: number;
5
6
  type: ChannelEventType;
6
7
  }
@@ -1,9 +1,10 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { WorkspaceFocus } from '../card/WorkspaceFocus';
2
3
  import { Channel } from './Channel';
3
4
  import { ChannelType } from './ChannelType';
4
5
  import { CreateChannelChannelMembership } from './CreateChannelChannelMembership';
5
6
  export interface CreateChannel extends Partial<Omit<Channel, 'channelMemberships'>> {
6
- businessId?: number;
7
+ businessId?: BusinessId;
7
8
  type: ChannelType;
8
9
  name: string;
9
10
  slug?: string;
@@ -1,7 +1,8 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { ChannelType } from './ChannelType';
2
3
  export interface ListChannels {
3
4
  type?: ChannelType;
4
- businessId?: number;
5
+ businessId?: BusinessId;
5
6
  autoAddUsers?: boolean;
6
7
  ids?: number[];
7
8
  workflowTemplateId?: string;
@@ -1,3 +1,4 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  export type WithBusinessId<T> = T & {
2
- businessId: number;
3
+ businessId: BusinessId;
3
4
  };
@@ -1,7 +1,8 @@
1
1
  import { Audit } from '../application/Audit';
2
+ import { BusinessId } from '../business/BusinessId';
2
3
  import { EntityWidget } from './EntityWidget';
3
4
  export interface Dashboard extends Audit {
4
5
  id: string;
5
- businessId: number;
6
+ businessId: BusinessId;
6
7
  entityWidgets: EntityWidget[];
7
8
  }
@@ -1,4 +1,5 @@
1
+ import { UserId } from '../user/UserId';
1
2
  export interface UserEntityWidgetAssociation {
2
- userId: number;
3
+ userId: UserId;
3
4
  entityWidgetId: string;
4
5
  }
@@ -1,5 +1,6 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { CreateWorkflowEntitiesExport } from './CreateWorkflowEntitiesExport';
2
3
  export interface BulkExportRequest {
3
4
  createWorkflowEntitiesExport: CreateWorkflowEntitiesExport;
4
- businessId: number;
5
+ businessId: BusinessId;
5
6
  }
@@ -1,9 +1,10 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { App } from './App';
2
3
  import { Integration } from './Integration';
3
4
  import { IntegrationStatus } from './IntegrationStatus';
4
5
  export interface CreateAppIntegration extends Omit<Integration, 'id' | 'createdAt' | 'updatedAt'> {
5
6
  app: App;
6
- businessId: number;
7
+ businessId: BusinessId;
7
8
  status: IntegrationStatus;
8
9
  providerTempCode: string;
9
10
  redirectUrl: string;
@@ -1,13 +1,15 @@
1
1
  import { CardDetailTemplate, CardFormTemplate } from '@coast/schemas';
2
2
  import { Audit } from '../application/Audit';
3
+ import { BusinessId } from '../business/BusinessId';
4
+ import { UserId } from '../user/UserId';
3
5
  import { App } from './App';
4
6
  import { IntegrationStatus } from './IntegrationStatus';
5
7
  export interface Integration extends Audit {
6
8
  id: string;
7
9
  app: App;
8
- businessId: number;
10
+ businessId: BusinessId;
9
11
  channelId?: number;
10
- userId?: number;
12
+ userId?: UserId;
11
13
  status: IntegrationStatus;
12
14
  providerTempCode: string;
13
15
  redirectUrl?: string;
@@ -1,4 +1,5 @@
1
+ import { UserId } from '../user/UserId';
1
2
  export interface IntegrationVerification {
2
- userId: number;
3
+ userId: UserId;
3
4
  authToken: string;
4
5
  }
@@ -1,6 +1,7 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { IntegrationStatus } from './IntegrationStatus';
2
3
  export interface ListIntegrations {
3
4
  channelId?: number;
4
5
  status?: IntegrationStatus;
5
- businessId?: number;
6
+ businessId?: BusinessId;
6
7
  }
@@ -1,4 +1,5 @@
1
1
  import { EntityEventType } from '../card/EntityEventType';
2
+ import { UserId } from '../user/UserId';
2
3
  import { LegacyMessageSubType } from './LegacyMessageSubtype';
3
4
  import { ThreadMessage } from './ThreadMessage';
4
5
  import { ThreadMessageMetaInput } from './ThreadMessageMetaInput';
@@ -6,7 +7,7 @@ import { ThreadMessageType } from './ThreadMessageType';
6
7
  export interface CreateLegacyMessage extends Partial<ThreadMessage> {
7
8
  channelId: number;
8
9
  uuid?: string;
9
- senderId?: number;
10
+ senderId?: UserId;
10
11
  content: string;
11
12
  type: ThreadMessageType;
12
13
  subType?: EntityEventType | LegacyMessageSubType;
@@ -1,11 +1,12 @@
1
1
  import { CardReminderEventType } from '../card/card-reminder/CardReminderEventType';
2
2
  import { EntityEventType } from '../card/EntityEventType';
3
+ import { UserId } from '../user/UserId';
3
4
  import { ThreadMessage } from './ThreadMessage';
4
5
  import { ThreadMessageMetaInput } from './ThreadMessageMetaInput';
5
6
  import { ThreadMessageType } from './ThreadMessageType';
6
7
  export interface CreateThreadMessage extends Partial<ThreadMessage> {
7
8
  threadId: string;
8
- senderId?: number;
9
+ senderId?: UserId;
9
10
  content: string;
10
11
  type: ThreadMessageType;
11
12
  subType?: EntityEventType | CardReminderEventType;
@@ -2,6 +2,7 @@ import { Audit } from '../application/Audit';
2
2
  import { CardReminderEventType } from '../card/card-reminder/CardReminderEventType';
3
3
  import { EntityEventType } from '../card/EntityEventType';
4
4
  import { Indexable } from '../search/Indexable';
5
+ import { UserId } from '../user/UserId';
5
6
  import { LegacyMessageSubType } from './LegacyMessageSubtype';
6
7
  import { Thread } from './Thread';
7
8
  import { ThreadMessageMeta } from './ThreadMessageMeta';
@@ -12,7 +13,7 @@ export interface ThreadMessage extends Indexable, Audit {
12
13
  channelId?: number;
13
14
  threadId?: string;
14
15
  thread?: Promise<Thread>;
15
- senderId: number;
16
+ senderId: UserId;
16
17
  content: string;
17
18
  type: ThreadMessageType;
18
19
  subType?: EntityEventType | CardReminderEventType | LegacyMessageSubType;
@@ -1,3 +1,4 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { ThreadMessageAttachment } from './ThreadMessageAttachment';
2
3
  import { ThreadMessageReaction } from './ThreadMessageReaction';
3
4
  import { Token } from './Token';
@@ -5,7 +6,7 @@ export interface ThreadMessageMeta {
5
6
  attachments?: ThreadMessageAttachment[];
6
7
  reactions?: ThreadMessageReaction[];
7
8
  tokens?: Token[];
8
- userIds?: number[];
9
+ userIds?: UserId[];
9
10
  cardId?: string;
10
11
  uuid?: string;
11
12
  }
@@ -1,3 +1,4 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { ThreadMessageAttachment } from './ThreadMessageAttachment';
2
3
  import { ThreadMessageReaction } from './ThreadMessageReaction';
3
4
  import { Token } from './Token';
@@ -5,7 +6,7 @@ export interface ThreadMessageMetaInput {
5
6
  attachments?: ThreadMessageAttachment[];
6
7
  reactions?: ThreadMessageReaction[];
7
8
  tokens?: Token[];
8
- userIds?: number[];
9
+ userIds?: UserId[];
9
10
  cardId?: string;
10
11
  channelName?: string;
11
12
  uuid?: string;
@@ -1,5 +1,6 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { ThreadMessageReactionType } from './ThreadMessageReactionType';
2
3
  export interface ThreadMessageReaction {
3
4
  type: ThreadMessageReactionType;
4
- userId: number;
5
+ userId: UserId;
5
6
  }
@@ -1,3 +1,4 @@
1
+ import { UserId } from '../user/UserId';
1
2
  import { TokenMentionType } from './TokenMentionType';
2
3
  import { TokenType } from './TokenType';
3
4
  export interface Token {
@@ -6,6 +7,6 @@ export interface Token {
6
7
  index?: number;
7
8
  mentionType?: TokenMentionType;
8
9
  type: TokenType;
9
- userId?: number;
10
+ userId?: UserId;
10
11
  value: string;
11
12
  }
@@ -1,10 +1,12 @@
1
+ import { BusinessId } from '../business/BusinessId';
2
+ import { UserId } from '../user/UserId';
1
3
  import { MetricType } from './MetricType';
2
4
  import { MetricUnit } from './MetricUnit';
3
5
  import { UsageMetric } from './UsageMetric';
4
6
  export interface CreateUsageMetric extends Partial<UsageMetric> {
5
- businessId: number;
7
+ businessId: BusinessId;
6
8
  channelId: number;
7
- userId: number;
9
+ userId: UserId;
8
10
  type: MetricType;
9
11
  unit: MetricUnit;
10
12
  value: number;
@@ -1,8 +1,10 @@
1
+ import { BusinessId } from '../business/BusinessId';
2
+ import { UserId } from '../user/UserId';
1
3
  import { MessageEventType } from './MessageEventType';
2
4
  export interface MessageEventJob {
3
5
  type: MessageEventType;
4
- businessId: number;
6
+ businessId: BusinessId;
5
7
  channelId: number;
6
- userId: number;
8
+ userId: UserId;
7
9
  messageId: number;
8
10
  }
@@ -1,8 +1,10 @@
1
+ import { BusinessId } from '../business/BusinessId';
2
+ import { UserId } from '../user/UserId';
1
3
  import { StorageEventType } from './StorageEventType';
2
4
  export interface StorageEventJob {
3
5
  type: StorageEventType;
4
- businessId: number;
6
+ businessId: BusinessId;
5
7
  channelId: number;
6
- userId: number;
8
+ userId: UserId;
7
9
  url: string;
8
10
  }
@@ -1,10 +1,12 @@
1
+ import { BusinessId } from '../business/BusinessId';
2
+ import { UserId } from '../user/UserId';
1
3
  import { MetricType } from './MetricType';
2
4
  import { MetricUnit } from './MetricUnit';
3
5
  export interface UsageMetric {
4
6
  id: string;
5
- businessId: number;
7
+ businessId: BusinessId;
6
8
  channelId: number;
7
- userId: number;
9
+ userId: UserId;
8
10
  type: MetricType;
9
11
  unit: MetricUnit;
10
12
  value: number;
@@ -1,3 +1,4 @@
1
+ import { UserId } from '../user/UserId';
1
2
  type IndexableField = keyof Indexable;
2
3
  export interface Indexable {
3
4
  readonly FIELDS: IndexableField[];
@@ -5,8 +6,8 @@ export interface Indexable {
5
6
  cardId?: string;
6
7
  channelId?: number;
7
8
  threadId?: string;
8
- authorId?: number;
9
- userId?: number;
9
+ authorId?: UserId;
10
+ userId?: UserId;
10
11
  content?: string;
11
12
  attachments?: string[];
12
13
  urls?: string[];
@@ -1,5 +1,6 @@
1
1
  import { Channel } from '../channel/Channel';
2
2
  import { User } from '../user/User';
3
+ import { UserId } from '../user/UserId';
3
4
  import { Indexable } from './Indexable';
4
5
  import { SearchResultHighlights } from './SearchResultHighlights';
5
6
  import { SearchResultType } from './SearchResultType';
@@ -10,8 +11,8 @@ export interface SearchResult extends Indexable {
10
11
  channelId?: number;
11
12
  channel?: Channel;
12
13
  threadId?: string;
13
- authorId?: number;
14
- userId?: number;
14
+ authorId?: UserId;
15
+ userId?: UserId;
15
16
  user?: User;
16
17
  attachments?: string[];
17
18
  content?: string;
@@ -1,9 +1,10 @@
1
1
  import { Audit } from '../application/Audit';
2
+ import { UserId } from '../user/UserId';
2
3
  import { SharedCardLinkType } from './SharedCardLinkType';
3
4
  export interface SharedCardLink extends Audit {
4
5
  id: string;
5
6
  channelId: number;
6
- userId: number;
7
+ userId: UserId;
7
8
  type: SharedCardLinkType;
8
9
  cardId?: string;
9
10
  viewTemplateId?: string;
@@ -1,3 +1,4 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { UserRole } from './UserRole';
2
3
  export interface CreateUserV2 {
3
4
  username: string;
@@ -9,7 +10,7 @@ export interface CreateUserV2 {
9
10
  img?: string;
10
11
  digestLastSent: Date;
11
12
  isSubscribedToDigest: boolean;
12
- businessId: number;
13
+ businessId: BusinessId;
13
14
  excludeFromAnalytics?: boolean;
14
15
  firstMessageSent?: boolean;
15
16
  firstTaskCompleted?: boolean;
@@ -1,6 +1,7 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { OffsetPaginatedRequest } from '../pagination/OffsetPaginatedRequest';
2
3
  export interface ListUsers extends OffsetPaginatedRequest {
3
4
  ids?: number[];
4
5
  name?: string;
5
- businessId?: number;
6
+ businessId?: BusinessId;
6
7
  }
@@ -4,9 +4,10 @@ import { BusinessMembership } from '../business/BusinessMembership';
4
4
  import { ThreadMembership } from '../messaging/ThreadMembership';
5
5
  import { NotificationsPreference } from './NotificationsPreference';
6
6
  import { UserCreationMethod } from './UserCreationMethod';
7
+ import { UserId } from './UserId';
7
8
  import { UserRole } from './UserRole';
8
9
  export interface User extends Audit {
9
- id: number;
10
+ id: UserId;
10
11
  username: string;
11
12
  firstName: string;
12
13
  lastName: string;
@@ -1,7 +1,9 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { UserEventType } from './UserEventType';
3
+ import { UserId } from './UserId';
2
4
  export interface UserEventJob {
3
- businessId: number;
4
- creatorId?: number;
5
- userIds: number[];
5
+ businessId: BusinessId;
6
+ creatorId?: UserId;
7
+ userIds: UserId[];
6
8
  type: UserEventType;
7
9
  }
@@ -0,0 +1,2 @@
1
+ import { Brand } from '@paradoxical-io/types';
2
+ export type UserId = Brand<number, 'UserId'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { UserGroup } from './UserGroup';
2
+ export interface CreateUserGroup extends Omit<UserGroup, 'id' | 'businessId' | 'createdAt' | 'updatedAt' | 'deletedAt'> {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { Intersection } from 'src/utils/Intersection';
2
+ import { OffsetPaginatedRequest } from '../../pagination/OffsetPaginatedRequest';
3
+ import { UserGroupAssociation } from './UserGroupAssociation';
4
+ export interface ListUserGroupAssociations extends Intersection<Omit<UserGroupAssociation, 'userId'>, OffsetPaginatedRequest> {
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { OffsetPaginatedResult } from '../../pagination/OffsetPaginatedResult';
2
+ import { UserGroupAssociation } from './UserGroupAssociation';
3
+ export interface ListUserGroupAssociationsResult extends OffsetPaginatedResult {
4
+ userGroupAssociations: UserGroupAssociation[];
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { UserGroup } from './UserGroup';
2
+ export interface UpdateUserGroup extends Omit<UserGroup, 'businessId' | 'updatedAt' | 'createdAt' | 'deletedAt'> {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { Audit } from '../../application/Audit';
2
+ import { BusinessId } from '../../business/BusinessId';
3
+ import { UserGroupId } from './UserGroupId';
4
+ export interface UserGroup extends Audit {
5
+ id: UserGroupId;
6
+ name: string;
7
+ businessId: BusinessId;
8
+ deletedAt?: Date | null;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { UserId } from '../UserId';
2
+ import { UserGroupId } from './UserGroupId';
3
+ export interface UserGroupAssociation {
4
+ userId: UserId;
5
+ userGroupId: UserGroupId;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { Brand } from '@paradoxical-io/types';
2
+ export type UserGroupId = Brand<string, 'UserGroupId'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ import { BusinessId } from '../business/BusinessId';
1
2
  import { OffsetPaginatedRequest } from '../pagination/OffsetPaginatedRequest';
2
3
  import { ListWorkflowTemplateSort } from './ListWorkflowTemplateSort';
3
4
  export interface ListWorkflowTemplates extends OffsetPaginatedRequest {
@@ -7,5 +8,5 @@ export interface ListWorkflowTemplates extends OffsetPaginatedRequest {
7
8
  name?: string;
8
9
  relatesToWorkflowTemplateId?: string;
9
10
  sort?: ListWorkflowTemplateSort;
10
- businessId?: number;
11
+ businessId?: BusinessId;
11
12
  }
@@ -1,6 +1,8 @@
1
1
  import { Audit } from '../application/Audit';
2
2
  import { DataEntity } from '../application/DataEntity';
3
+ import { BusinessId } from '../business/BusinessId';
3
4
  import { CardDefinition } from '../card/card-definition/CardDefinition';
5
+ import { UserId } from '../user/UserId';
4
6
  import { WorkflowTemplateBehavior } from './behaviors/WorkflowTemplateBehavior';
5
7
  import { ChannelDefaultConfiguration } from './channel-default-configuration/ChannelDefaultConfiguration';
6
8
  import { ComponentRegistry } from './components/ComponentRegistry';
@@ -8,8 +10,8 @@ import { ViewTemplate } from './view-template/ViewTemplate';
8
10
  import { WorkflowTemplateInstallState } from './WorkflowTemplateInstallState';
9
11
  export interface WorkflowTemplate extends DataEntity, Audit {
10
12
  id: string;
11
- userId: number;
12
- businessId?: number;
13
+ userId: UserId;
14
+ businessId?: BusinessId;
13
15
  name: string;
14
16
  components: ComponentRegistry.Any[];
15
17
  archivedComponents?: ComponentRegistry.Any[];
@@ -1,7 +1,8 @@
1
+ import { UserId } from '../../../user/UserId';
1
2
  import { Coordinates } from '../common/Coordinates';
2
3
  export interface GeolocationComponentDataValue {
3
4
  coords: Coordinates;
4
5
  date: Date;
5
- userId: number;
6
+ userId: UserId;
6
7
  accuracy?: number;
7
8
  }
@@ -1,4 +1,5 @@
1
+ import { UserId } from '../../../user/UserId';
1
2
  import { ComponentData } from '../ComponentData';
2
3
  export interface PersonComponentData extends ComponentData {
3
- personComponentDataValue?: number[];
4
+ personComponentDataValue?: UserId[];
4
5
  }
@@ -1,5 +1,6 @@
1
1
  import { Token } from '@coast/schemas';
2
+ import { UserId } from '../../../user/UserId';
2
3
  export interface PersonComponentDefault {
3
4
  token?: Token;
4
- userIds?: number[];
5
+ userIds?: UserId[];
5
6
  }
@@ -1,6 +1,7 @@
1
+ import { UserId } from '../../../user/UserId';
1
2
  import { Coordinates } from '../common/Coordinates';
2
3
  export interface TimeTrackerGeolocation {
3
4
  coords: Coordinates;
4
- userId: number;
5
+ userId: UserId;
5
6
  accuracy?: number;
6
7
  }
@@ -1,3 +1,4 @@
1
+ import { UserId } from '../../user/UserId';
1
2
  import { WorkflowEntity } from './WorkflowEntity';
2
3
  export interface CreateWorkflowEntity extends Omit<WorkflowEntity, 'id' | 'createdAt' | 'updatedAt' | 'channelId'> {
3
4
  channelId?: number;
@@ -5,5 +6,5 @@ export interface CreateWorkflowEntity extends Omit<WorkflowEntity, 'id' | 'creat
5
6
  name?: string;
6
7
  sequenceNumber?: number;
7
8
  threadId?: string;
8
- userId?: number;
9
+ userId?: UserId;
9
10
  }
@@ -1,4 +1,5 @@
1
+ import { UserId } from '../../user/UserId';
1
2
  export interface ListWorkflowEntitiesContext {
2
- currentUserId: number;
3
+ currentUserId: UserId;
3
4
  personComponentsMustContainCurrentUserId?: boolean;
4
5
  }
@@ -1,8 +1,9 @@
1
+ import { UserId } from '../../../user/UserId';
1
2
  import { EntityAuditTrailEntry } from './EntityAuditTrailEntry';
2
3
  export interface EntityAuditTrailEvent {
3
4
  id: string;
4
5
  timestamp: Date;
5
- userId: number;
6
+ userId: UserId;
6
7
  workflowTemplateId: string;
7
8
  cardId: string;
8
9
  entries: EntityAuditTrailEntry[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coast/core-api-types",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "core-api types package",
5
5
  "main": "./models",
6
6
  "types": "./models",