@erxes/core-contract 0.1.0-v2.0 → 0.1.0-v2.2

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 (102) hide show
  1. package/dist/activities.d.ts +1394 -139
  2. package/dist/activities.js +96 -40
  3. package/dist/audit.d.ts +1092 -48
  4. package/dist/audit.js +37 -23
  5. package/dist/auth.d.ts +2867 -61
  6. package/dist/auth.js +55 -25
  7. package/dist/automationRuns.d.ts +12 -13
  8. package/dist/automationRuns.js +15 -30
  9. package/dist/automations.d.ts +2474 -93
  10. package/dist/automations.js +56 -44
  11. package/dist/client.d.ts +30704 -0
  12. package/dist/client.js +62 -0
  13. package/dist/common.d.ts +28 -16
  14. package/dist/common.js +30 -22
  15. package/dist/companies.d.ts +1154 -44
  16. package/dist/companies.js +33 -17
  17. package/dist/contract/routes.json.js +1810 -0
  18. package/dist/customerAuth.d.ts +1661 -0
  19. package/dist/customerAuth.js +197 -0
  20. package/dist/customers.d.ts +1283 -65
  21. package/dist/customers.js +35 -25
  22. package/dist/{automationDefinition.d.ts → db/src/automationDefinition.d.ts} +4 -3
  23. package/dist/{automationDefinition.js → db/src/automationDefinition.js} +10 -32
  24. package/dist/db/src/enums.d.ts +8 -0
  25. package/dist/db/src/enums.js +334 -0
  26. package/dist/db/src/schema/auditStreams.js +6 -14
  27. package/dist/db/src/schema/authTokens.js +4 -6
  28. package/dist/db/src/schema/automations.d.ts +1 -0
  29. package/dist/db/src/schema/automations.js +15 -31
  30. package/dist/db/src/schema/common.d.ts +2 -6
  31. package/dist/db/src/schema/common.js +1 -24
  32. package/dist/db/src/schema/companies.js +6 -5
  33. package/dist/db/src/schema/customerAuth.js +101 -0
  34. package/dist/db/src/schema/customers.js +6 -6
  35. package/dist/db/src/schema/events.js +12 -60
  36. package/dist/db/src/schema/fieldValues.js +2 -2
  37. package/dist/db/src/schema/fields.js +10 -28
  38. package/dist/db/src/schema/index.d.ts +3 -0
  39. package/dist/db/src/schema/index.js +22 -20
  40. package/dist/db/src/schema/leadStages.js +5 -10
  41. package/dist/db/src/schema/leads.js +6 -11
  42. package/dist/db/src/schema/notes.js +92 -0
  43. package/dist/db/src/schema/oauth.js +3 -3
  44. package/dist/db/src/schema/payments.js +13 -23
  45. package/dist/db/src/schema/platform.js +11 -31
  46. package/dist/db/src/schema/plugins.js +10 -5
  47. package/dist/db/src/schema/products.js +7 -8
  48. package/dist/db/src/schema/rateLimits.js +7 -0
  49. package/dist/db/src/schema/saas.js +3 -9
  50. package/dist/db/src/schema/tags.js +6 -5
  51. package/dist/db/src/schema/transfer.js +13 -33
  52. package/dist/db/src/schema/trash.js +6 -7
  53. package/dist/db/src/schema/users.js +6 -10
  54. package/dist/db/src/schema/views.js +5 -13
  55. package/dist/db/src/schema/webhooks.js +7 -14
  56. package/dist/db/src/table.js +16 -2
  57. package/dist/errors.d.ts +516 -0
  58. package/dist/errors.js +218 -0
  59. package/dist/events.d.ts +585 -140
  60. package/dist/events.js +57 -42
  61. package/dist/fields.d.ts +1478 -66
  62. package/dist/fields.js +33 -47
  63. package/dist/files.d.ts +766 -62
  64. package/dist/files.js +34 -22
  65. package/dist/index.d.ts +25707 -902
  66. package/dist/index.js +22 -20
  67. package/dist/leads.d.ts +1108 -22
  68. package/dist/leads.js +39 -20
  69. package/dist/notifications.d.ts +691 -94
  70. package/dist/notifications.js +45 -91
  71. package/dist/organizations.d.ts +263 -5
  72. package/dist/organizations.js +21 -2
  73. package/dist/payments.d.ts +1794 -120
  74. package/dist/payments.js +58 -60
  75. package/dist/platform.d.ts +12 -20
  76. package/dist/platform.js +8 -21
  77. package/dist/plugins.d.ts +808 -71
  78. package/dist/plugins.js +66 -35
  79. package/dist/products.d.ts +1411 -53
  80. package/dist/products.js +40 -23
  81. package/dist/roles.d.ts +560 -8
  82. package/dist/roles.js +25 -11
  83. package/dist/routes.d.ts +8 -0
  84. package/dist/routes.js +13 -0
  85. package/dist/saas.d.ts +164 -8
  86. package/dist/saas.js +14 -29
  87. package/dist/tags.d.ts +344 -8
  88. package/dist/tags.js +16 -8
  89. package/dist/transfer.d.ts +1361 -36
  90. package/dist/transfer.js +47 -49
  91. package/dist/trash.d.ts +299 -23
  92. package/dist/trash.js +27 -20
  93. package/dist/users.d.ts +1233 -59
  94. package/dist/users.js +48 -39
  95. package/dist/values.d.ts +150 -0
  96. package/dist/values.js +139 -0
  97. package/dist/views.d.ts +404 -13
  98. package/dist/views.js +18 -28
  99. package/dist/webhooks.d.ts +791 -29
  100. package/dist/webhooks.js +36 -21
  101. package/package.json +9 -2
  102. package/dist/db/src/schema/jobs.js +0 -44
package/dist/index.js CHANGED
@@ -1,36 +1,36 @@
1
- import { CONDITION_OPERATORS } from "./db/src/schema/common.js";
2
- import { Activity, ActivityInput, ActivityTarget, CORE_ACTIVITY_TYPES, NoteInput, TimelineKind, TimelineTarget, activitiesContract } from "./activities.js";
3
- import { Automation, AutomationFieldPath, AutomationStatus, DryRunStep, automationsContract } from "./automations.js";
4
- import { AuditEntry, AuditStream, AuditStreamFormat, auditContract } from "./audit.js";
5
- import { NewPassword, Session, authContract } from "./auth.js";
1
+ import { CONDITION_OPERATORS } from "./db/src/enums.js";
2
+ import { Activity, ActivityInput, ActivityTarget, CORE_ACTIVITY_TYPES, Note, NoteInput, NoteVersion, TimelineKind, TimelineTarget, activitiesContract } from "./activities.js";
3
+ import { Automation, AutomationFieldPath, DryRunStep, automationsContract } from "./automations.js";
4
+ import { AuditEntry, AuditStream, auditContract } from "./audit.js";
5
+ import { Session, authContract } from "./auth.js";
6
6
  import { Company, CompanyFields, PersonRef, companiesContract } from "./companies.js";
7
7
  import { CoreEvent, EventFailure, EventFailureStatus, EventInput, EventNotify, eventsContract } from "./events.js";
8
- import { CompanyRef, ContactLink, ContactLinkInput, Customer, CustomerFields, CustomerSex, CustomerState, customersContract } from "./customers.js";
9
- import { FIELD_TYPE_FAMILIES, Field, FieldGroup, FieldType, FieldUsage, FieldValidation, OPTION_FIELD_TYPES, fieldGroupsContract, fieldsContract } from "./fields.js";
8
+ import { CompanyRef, ContactLink, ContactLinkInput, Customer, CustomerFields, CustomerState, customersContract } from "./customers.js";
9
+ import { CustomerLogin, CustomerProfile, CustomerSession, CustomerTokens, customerAccountContract, customerAuthContract } from "./customerAuth.js";
10
+ import { Field, FieldGroup, FieldUsage, fieldGroupsContract, fieldsContract } from "./fields.js";
10
11
  import { FileInfo, FileSettings, UploadTarget, filesContract } from "./files.js";
11
- import { CORE_NOTIFICATION_GROUPS, CORE_NOTIFICATION_KINDS, Notification, NotificationDelivery, NotificationGroupSetting, NotificationInput, NotificationSettings, UNMUTABLE_NOTIFICATION_KINDS, notificationGroupOf, notificationsContract } from "./notifications.js";
12
+ import { CORE_NOTIFICATION_KINDS, Notification, NotificationGroupSetting, NotificationInput, NotificationSettings, notificationsContract } from "./notifications.js";
12
13
  import { Organization, OrganizationRegion, organizationsContract } from "./organizations.js";
13
- import { GatewayConfig, Invoice, InvoiceLine, InvoiceLineInput, InvoiceMetadata, InvoiceStatus, PAYMENT_GATEWAYS, PaymentGateway, PaymentGatewayKind, PluginPaymentSettings, Refund, gatewayTakes, paymentsContract } from "./payments.js";
14
- import { LiveTopic, PLUGIN_SCOPES, Plugin, PluginManifest, PluginName, PluginScope, TokenResponse, pluginsContract } from "./plugins.js";
15
- import { Product, ProductCategory, ProductKind, ProductStatus, productCategoriesContract, productsContract } from "./products.js";
16
- import { CORE_PERMISSIONS, OWNER_ONLY_PERMISSIONS, PermissionAction, PermissionInfo, Role, RoleKey, rolesContract } from "./roles.js";
14
+ import { GatewayConfig, Invoice, InvoiceLine, InvoiceLineInput, InvoiceMetadata, PaymentGateway, PluginPaymentSettings, Refund, paymentsContract } from "./payments.js";
15
+ import { LiveTopic, PLUGIN_SCOPES, Plugin, PluginInstallation, PluginManifest, PluginName, PluginScope, TokenResponse, pluginsContract } from "./plugins.js";
16
+ import { Product, ProductCategory, ProductStatus, productCategoriesContract, productsContract } from "./products.js";
17
+ import { CORE_PERMISSIONS, OWNER_ONLY_PERMISSIONS, PermissionAction, PermissionInfo, Role, rolesContract } from "./roles.js";
17
18
  import { Tag, tagsContract } from "./tags.js";
18
19
  import { TrashItem, trashContract } from "./trash.js";
19
- import { DateOnly, USER_LINK_NAMES, User, UserLinkName, UserLinks, UserRole, UserStatus, usersContract } from "./users.js";
20
+ import { DateOnly, User, UserLinks, UserStatus, usersContract } from "./users.js";
20
21
  import { CORE_EVENT_TYPES, EventPattern, EventTypeInfo, Webhook, WebhookDelivery, webhooksContract } from "./webhooks.js";
21
22
  import { EntitlementStatus, OrganizationStatus, PluginAccess, PluginPlan, PluginTier, SaasWorkspace, SubscriptionInfo, saasContract } from "./saas.js";
22
23
  import { FilterField, RecordFilter, View, ViewRecordType, ViewSort, viewsContract } from "./views.js";
23
24
  import { Export, ExportQuery, Import, ImportOptions, ImportRow, ImportStatus, TransferColumn, TransferRecordType, transferContract } from "./transfer.js";
24
25
  import { ContactState, LEAD_SOURCES, LIFECYCLE_COLUMNS, LIFECYCLE_INPUT_COLUMNS, LeadEvent, LeadRecordType, LeadReport, LeadSource, LeadStage, LeadStageKind, SourceDetails, leadsContract, lifecycleInput, lifecycleRow } from "./leads.js";
25
- import { ActionInput, Audience, AutomationDefinition, AutomationStep, AutomationTrigger, ConditionGroup, ConditionOperator, ConditionRule, ContextPath, Reentry, RelativeAmount } from "./automationDefinition.js";
26
+ import { ActionInput, Audience, AutomationDefinition, AutomationStep, AutomationTrigger, ConditionGroup, ConditionOperator, ConditionRule, ContextPath, Reentry, RelativeAmount } from "./db/src/automationDefinition.js";
26
27
  import { ActionField, ActionInfo, AutomationRun, RunStatus, RunStep } from "./automationRuns.js";
27
- import { ContentType, CursorQuery, CustomFields, CustomFieldsPatch, CustomValue, EmailAddress, ErrorBody, FieldContentType, Id, IdList, ImageAddress, PageInfo, PhoneNumber, QueryBoolean, cursorPageOf, isoDate } from "./common.js";
28
+ import { ContentType, CursorQuery, CustomFields, CustomFieldsPatch, CustomValue, DESCRIPTION_MAX, EmailAddress, FieldContentType, Id, IdList, ImageAddress, InvalidInput, LIST_MAX, PageInfo, PhoneNumber, QueryBoolean, QueryFlag, cursorPageOf, isoDate, listOf } from "./common.js";
29
+ import { COMMON_ERRORS, ERRORS } from "./errors.js";
28
30
  import { COUNTRIES, Country, Currency, currencyDigits, currencyOfCountry } from "./money.js";
29
- import { ActorRef, AppLink, DedupeKey, EntityRef, EventType } from "./platform.js";
31
+ import { ActorType, AppLink, DedupeKey, EntityType, EventType } from "./platform.js";
32
+ import { AuditStreamFormat, AutomationStatus, CORE_API_PREFIX, CORE_API_VERSION, CORE_NOTIFICATION_GROUPS, CustomerSex, FIELD_TYPE_FAMILIES, FieldType, FieldValidation, InviteRole, InvoiceStatus, LiveMode, NewPassword, NotificationDelivery, OPTION_FIELD_TYPES, PAYMENT_GATEWAYS, PaymentGatewayKind, ProductKind, RoleKey, UNMUTABLE_NOTIFICATION_KINDS, USER_LINK_NAMES, UserLinkName, gatewayTakes, notificationGroupOf } from "./values.js";
30
33
  // src/index.ts
31
- const CORE_API_VERSION = "v1";
32
- /** Every path in the contract is under this prefix (`/core/v1/customers`, …). */
33
- const CORE_API_PREFIX = "/core/v1";
34
34
  /** The whole core API. Core implements it; plugins call it with a typed client. */
35
35
  const coreContract = {
36
36
  activities: activitiesContract,
@@ -39,6 +39,8 @@ const coreContract = {
39
39
  auth: authContract,
40
40
  companies: companiesContract,
41
41
  customers: customersContract,
42
+ customerAccount: customerAccountContract,
43
+ customerAuth: customerAuthContract,
42
44
  events: eventsContract,
43
45
  fieldGroups: fieldGroupsContract,
44
46
  fields: fieldsContract,
@@ -59,4 +61,4 @@ const coreContract = {
59
61
  views: viewsContract,
60
62
  webhooks: webhooksContract
61
63
  };
62
- export { ActionField, ActionInfo, ActionInput, Activity, ActivityInput, ActivityTarget, ActorRef, AppLink, Audience, AuditEntry, AuditStream, AuditStreamFormat, Automation, AutomationDefinition, AutomationFieldPath, AutomationRun, AutomationStatus, AutomationStep, AutomationTrigger, CONDITION_OPERATORS, CORE_ACTIVITY_TYPES, CORE_API_PREFIX, CORE_API_VERSION, CORE_EVENT_TYPES, CORE_NOTIFICATION_GROUPS, CORE_NOTIFICATION_KINDS, CORE_PERMISSIONS, COUNTRIES, Company, CompanyFields, CompanyRef, ConditionGroup, ConditionOperator, ConditionRule, ContactLink, ContactLinkInput, ContactState, ContentType, ContextPath, CoreEvent, Country, Currency, CursorQuery, CustomFields, CustomFieldsPatch, CustomValue, Customer, CustomerFields, CustomerSex, CustomerState, DateOnly, DedupeKey, DryRunStep, EmailAddress, EntitlementStatus, EntityRef, ErrorBody, EventFailure, EventFailureStatus, EventInput, EventNotify, EventPattern, EventType, EventTypeInfo, Export, ExportQuery, FIELD_TYPE_FAMILIES, Field, FieldContentType, FieldGroup, FieldType, FieldUsage, FieldValidation, FileInfo, FileSettings, FilterField, GatewayConfig, Id, IdList, ImageAddress, Import, ImportOptions, ImportRow, ImportStatus, Invoice, InvoiceLine, InvoiceLineInput, InvoiceMetadata, InvoiceStatus, LEAD_SOURCES, LIFECYCLE_COLUMNS, LIFECYCLE_INPUT_COLUMNS, LeadEvent, LeadRecordType, LeadReport, LeadSource, LeadStage, LeadStageKind, LiveTopic, NewPassword, NoteInput, Notification, NotificationDelivery, NotificationGroupSetting, NotificationInput, NotificationSettings, OPTION_FIELD_TYPES, OWNER_ONLY_PERMISSIONS, Organization, OrganizationRegion, OrganizationStatus, PAYMENT_GATEWAYS, PLUGIN_SCOPES, PageInfo, PaymentGateway, PaymentGatewayKind, PermissionAction, PermissionInfo, PersonRef, PhoneNumber, Plugin, PluginAccess, PluginManifest, PluginName, PluginPaymentSettings, PluginPlan, PluginScope, PluginTier, Product, ProductCategory, ProductKind, ProductStatus, QueryBoolean, RecordFilter, Reentry, Refund, RelativeAmount, Role, RoleKey, RunStatus, RunStep, SaasWorkspace, Session, SourceDetails, SubscriptionInfo, Tag, TimelineKind, TimelineTarget, TokenResponse, TransferColumn, TransferRecordType, TrashItem, UNMUTABLE_NOTIFICATION_KINDS, USER_LINK_NAMES, UploadTarget, User, UserLinkName, UserLinks, UserRole, UserStatus, View, ViewRecordType, ViewSort, Webhook, WebhookDelivery, activitiesContract, auditContract, authContract, automationsContract, companiesContract, coreContract, currencyDigits, currencyOfCountry, cursorPageOf, customersContract, eventsContract, fieldGroupsContract, fieldsContract, filesContract, gatewayTakes, isoDate, leadsContract, lifecycleInput, lifecycleRow, notificationGroupOf, notificationsContract, organizationsContract, paymentsContract, pluginsContract, productCategoriesContract, productsContract, rolesContract, saasContract, tagsContract, transferContract, trashContract, usersContract, viewsContract, webhooksContract };
64
+ export { ActionField, ActionInfo, ActionInput, Activity, ActivityInput, ActivityTarget, ActorType, AppLink, Audience, AuditEntry, AuditStream, AuditStreamFormat, Automation, AutomationDefinition, AutomationFieldPath, AutomationRun, AutomationStatus, AutomationStep, AutomationTrigger, COMMON_ERRORS, CONDITION_OPERATORS, CORE_ACTIVITY_TYPES, CORE_API_PREFIX, CORE_API_VERSION, CORE_EVENT_TYPES, CORE_NOTIFICATION_GROUPS, CORE_NOTIFICATION_KINDS, CORE_PERMISSIONS, COUNTRIES, Company, CompanyFields, CompanyRef, ConditionGroup, ConditionOperator, ConditionRule, ContactLink, ContactLinkInput, ContactState, ContentType, ContextPath, CoreEvent, Country, Currency, CursorQuery, CustomFields, CustomFieldsPatch, CustomValue, Customer, CustomerFields, CustomerLogin, CustomerProfile, CustomerSession, CustomerSex, CustomerState, CustomerTokens, DESCRIPTION_MAX, DateOnly, DedupeKey, DryRunStep, ERRORS, EmailAddress, EntitlementStatus, EntityType, EventFailure, EventFailureStatus, EventInput, EventNotify, EventPattern, EventType, EventTypeInfo, Export, ExportQuery, FIELD_TYPE_FAMILIES, Field, FieldContentType, FieldGroup, FieldType, FieldUsage, FieldValidation, FileInfo, FileSettings, FilterField, GatewayConfig, Id, IdList, ImageAddress, Import, ImportOptions, ImportRow, ImportStatus, InvalidInput, InviteRole, Invoice, InvoiceLine, InvoiceLineInput, InvoiceMetadata, InvoiceStatus, LEAD_SOURCES, LIFECYCLE_COLUMNS, LIFECYCLE_INPUT_COLUMNS, LIST_MAX, LeadEvent, LeadRecordType, LeadReport, LeadSource, LeadStage, LeadStageKind, LiveMode, LiveTopic, NewPassword, Note, NoteInput, NoteVersion, Notification, NotificationDelivery, NotificationGroupSetting, NotificationInput, NotificationSettings, OPTION_FIELD_TYPES, OWNER_ONLY_PERMISSIONS, Organization, OrganizationRegion, OrganizationStatus, PAYMENT_GATEWAYS, PLUGIN_SCOPES, PageInfo, PaymentGateway, PaymentGatewayKind, PermissionAction, PermissionInfo, PersonRef, PhoneNumber, Plugin, PluginAccess, PluginInstallation, PluginManifest, PluginName, PluginPaymentSettings, PluginPlan, PluginScope, PluginTier, Product, ProductCategory, ProductKind, ProductStatus, QueryBoolean, QueryFlag, RecordFilter, Reentry, Refund, RelativeAmount, Role, RoleKey, RunStatus, RunStep, SaasWorkspace, Session, SourceDetails, SubscriptionInfo, Tag, TimelineKind, TimelineTarget, TokenResponse, TransferColumn, TransferRecordType, TrashItem, UNMUTABLE_NOTIFICATION_KINDS, USER_LINK_NAMES, UploadTarget, User, UserLinkName, UserLinks, UserStatus, View, ViewRecordType, ViewSort, Webhook, WebhookDelivery, activitiesContract, auditContract, authContract, automationsContract, companiesContract, coreContract, currencyDigits, currencyOfCountry, cursorPageOf, customerAccountContract, customerAuthContract, customersContract, eventsContract, fieldGroupsContract, fieldsContract, filesContract, gatewayTakes, isoDate, leadsContract, lifecycleInput, lifecycleRow, listOf, notificationGroupOf, notificationsContract, organizationsContract, paymentsContract, pluginsContract, productCategoriesContract, productsContract, rolesContract, saasContract, tagsContract, transferContract, trashContract, usersContract, viewsContract, webhooksContract };