@epilot/entity-client
Version:
JavaScript client library for the epilot Core Entity API
1,294 lines (1,292 loc) • 551 kB
TypeScript
/* eslint-disable */
import type {
OpenAPIClient,
Parameters,
UnknownParamsObject,
OperationResponse,
AxiosRequestConfig,
} from 'openapi-client-axios';
declare namespace Components {
namespace Parameters {
export type ActivityIdPathParam = /**
* See https://github.com/ulid/spec
* example:
* 01F130Q52Q6MWSNS8N2AVXV4JN
*/
Schemas.ActivityId /* ulid ^01[0-9a-zA-Z]{24}$ */;
export type ActivityIdQueryParam = /**
* See https://github.com/ulid/spec
* example:
* 01F130Q52Q6MWSNS8N2AVXV4JN
*/
Schemas.ActivityId /* ulid ^01[0-9a-zA-Z]{24}$ */ | ("" | null);
export type AsyncOperationQueryParam = boolean;
export type DryRunQueryParam = boolean;
export type EntityIdPathParam = Schemas.EntityId /* uuid */;
export type EntityRelationsModeQueryParam = "direct" | "reverse" | "both";
export type EntitySlugPathParam = /**
* URL-friendly identifier for the entity schema
* example:
* contact
*/
Schemas.EntitySlug /* ^[a-zA-Z0-9_-]+$ */;
/**
* URL-friendly identifier for the entity schema
* example:
* price
*/
export type EntitySlugPathPriceParam = string; // ^[a-zA-Z0-9_-]+$
export type ExcludeSchemasQueryParam = /**
* URL-friendly identifier for the entity schema
* example:
* contact
*/
Schemas.EntitySlug /* ^[a-zA-Z0-9_-]+$ */[];
export type FillActivityQueryParam = boolean;
export type FromPageQueryParam = number;
export type HydrateEntitiesQueryParam = boolean;
export type IncludeReverseDeprecatedQueryParam = boolean;
export type IncludeReverseQueryParam = boolean;
export type IncludeSchemasQueryParam = /**
* URL-friendly identifier for the entity schema
* example:
* contact
*/
Schemas.EntitySlug /* ^[a-zA-Z0-9_-]+$ */[];
export type SavedViewIdPathParam = /* Generated uuid for a saved view */ Schemas.SavedViewId /* uuid */;
export type TaxonomyClassificationSlugPathParam = string;
export type TaxonomySlugPathParam = string;
export type TaxonomySlugQueryParam = string;
export type TaxonomySlugQueryParamOptional = string;
export type ValidateEntityQueryParam = boolean;
}
export interface PathParameters {
EntityIdPathParam?: Parameters.EntityIdPathParam;
EntitySlugPathParam?: Parameters.EntitySlugPathParam;
EntitySlugPathPriceParam?: /**
* URL-friendly identifier for the entity schema
* example:
* price
*/
Parameters.EntitySlugPathPriceParam /* ^[a-zA-Z0-9_-]+$ */;
TaxonomySlugPathParam?: Parameters.TaxonomySlugPathParam;
TaxonomyClassificationSlugPathParam?: Parameters.TaxonomyClassificationSlugPathParam;
SavedViewIdPathParam?: Parameters.SavedViewIdPathParam;
ActivityIdPathParam?: Parameters.ActivityIdPathParam;
}
export interface QueryParameters {
TaxonomySlugQueryParam?: Parameters.TaxonomySlugQueryParam;
TaxonomySlugQueryParamOptional?: Parameters.TaxonomySlugQueryParamOptional;
AsyncOperationQueryParam?: Parameters.AsyncOperationQueryParam;
HydrateEntitiesQueryParam?: Parameters.HydrateEntitiesQueryParam;
ActivityIdQueryParam?: Parameters.ActivityIdQueryParam;
FromPageQueryParam?: Parameters.FromPageQueryParam;
IncludeReverseDeprecatedQueryParam?: Parameters.IncludeReverseDeprecatedQueryParam;
IncludeReverseQueryParam?: Parameters.IncludeReverseQueryParam;
IncludeSchemasQueryParam?: Parameters.IncludeSchemasQueryParam;
ExcludeSchemasQueryParam?: Parameters.ExcludeSchemasQueryParam;
EntityRelationsModeQueryParam?: Parameters.EntityRelationsModeQueryParam;
DryRunQueryParam?: Parameters.DryRunQueryParam;
FillActivityQueryParam?: Parameters.FillActivityQueryParam;
ValidateEntityQueryParam?: Parameters.ValidateEntityQueryParam;
}
namespace Responses {
/**
* A generic error returned by the API
* example:
* {
* "status": 400,
* "error": "Bad Request"
* }
*/
export interface BadRequestError {
/**
* The HTTP status code of the error
* example:
* 400
*/
status?: number;
/**
* The error message
* example:
* Bad Request
*/
error?: string;
}
/**
* A generic error returned by the API
* example:
* {
* "status": 404,
* "error": "Not Found"
* }
*/
export interface NotFoundError {
/**
* The HTTP status code of the error
* example:
* 400
*/
status?: number;
/**
* The error message
* example:
* Bad Request
*/
error?: string;
}
/**
* A generic error returned by the API
* example:
* {
* "status": 429,
* "error": "Too many requests. Try again later."
* }
*/
export interface TooManyRequestsError {
/**
* The HTTP status code of the error
* example:
* 400
*/
status?: number;
/**
* The error message
* example:
* Bad Request
*/
error?: string;
}
}
namespace Schemas {
export interface Activity {
type: /**
* A type for the activity. Used to categorize activities in the activity feed and for event subscriptions.
*
* Built-in entity activity types (custom activities can be defined as well):
* - EntityCreated
* - EntityUpdated
* - EntityDeleted
* - EntitySoftDeleted
* - EntityRestored
* - RelationsAdded
* - RelationsRemoved
* - RelationsSoftDeleted
* - RelationsRestored
* - RelationsDeleted
*
*/
ActivityType;
/**
* Title for activity. Supports handlebars syntax.
* example:
* My custom activity
*/
title: string;
/**
* Message for activity. Supports handlebars syntax.
* example:
* {{caller}} did something with {{entity payload.entity.id}}.
*/
message: string;
/**
* example:
* {
* "entity": {
* "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
* "schema": "contact"
* }
* }
*/
payload?: {
[name: string]: any;
};
/**
* Indicates whether the activity is in the pending state.
* Pending activities are not yet visible in the activity feed and events are not yet dispatched.
*
*/
pending?: boolean;
}
export interface ActivityCallerContext {
[name: string]: any;
EpilotAuth?: {
/**
* example:
* {
* "sub": "476e9b48-42f4-4234-a2b0-4668b34626ce",
* "cognito:groups": [
* "Administrator"
* ],
* "cognito:preferred_role": "arn:aws:iam::912468240823:role/base-administrator-role",
* "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-1_6lZSgmU6D",
* "custom:ivy_org_id": "739224",
* "cognito:username": "n.ahmad@epilot.cloud",
* "custom:ivy_user_id": "10006129",
* "cognito:roles": [
* "arn:aws:iam::912468240823:role/base-administrator-role"
* ],
* "aud": "6e0jbdnger7nmoktaaflarue1l",
* "event_id": "cd5f5583-d90c-4db5-8e99-5f5dd29a4d75",
* "token_use": "id",
* "auth_time": 1614333023,
* "exp": 1614336623,
* "iat": 1614333023,
* "email": "n.ahmad@epilot.cloud"
* }
*/
token?: {
/**
* example:
* 476e9b48-42f4-4234-a2b0-4668b34626ce
*/
sub?: string;
/**
* example:
* example@epilot.cloud
*/
email?: string;
/**
* example:
* example@epilot.cloud
*/
"cognito:username"?: string;
/**
* example:
* 10006129
*/
"custom:ivy_user_id"?: string;
};
};
}
/**
* See https://github.com/ulid/spec
* example:
* 01F130Q52Q6MWSNS8N2AVXV4JN
*/
export type ActivityId = string; // ulid ^01[0-9a-zA-Z]{24}$
export interface ActivityItem {
_id?: /**
* See https://github.com/ulid/spec
* example:
* 01F130Q52Q6MWSNS8N2AVXV4JN
*/
ActivityId /* ulid ^01[0-9a-zA-Z]{24}$ */;
timestamp?: string; // date-time
type: /**
* A type for the activity. Used to categorize activities in the activity feed and for event subscriptions.
*
* Built-in entity activity types (custom activities can be defined as well):
* - EntityCreated
* - EntityUpdated
* - EntityDeleted
* - EntitySoftDeleted
* - EntityRestored
* - RelationsAdded
* - RelationsRemoved
* - RelationsSoftDeleted
* - RelationsRestored
* - RelationsDeleted
*
*/
ActivityType;
/**
* Title for activity. Supports handlebars syntax.
* example:
* My custom activity
*/
title: string;
/**
* Message for activity. Supports handlebars syntax.
* example:
* {{caller}} did something with {{entity payload.entity.id}}.
*/
message: string;
/**
* example:
* {
* "entity": {
* "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
* "schema": "contact"
* }
* }
*/
payload?: {
[name: string]: any;
};
/**
* Indicates whether the activity is in the pending state.
* Pending activities are not yet visible in the activity feed and events are not yet dispatched.
*
*/
pending?: boolean;
caller?: ActivityCallerContext;
/**
* Count of total operations attached to this activity
* example:
* 1
*/
operations_total?: number;
operations?: EntityOperation[];
}
/**
* A type for the activity. Used to categorize activities in the activity feed and for event subscriptions.
*
* Built-in entity activity types (custom activities can be defined as well):
* - EntityCreated
* - EntityUpdated
* - EntityDeleted
* - EntitySoftDeleted
* - EntityRestored
* - RelationsAdded
* - RelationsRemoved
* - RelationsSoftDeleted
* - RelationsRestored
* - RelationsDeleted
*
*/
export type ActivityType = string;
/**
* Address attribute
*/
export interface AddressAttribute {
/**
* ID for the entity attribute
* example:
* d5839b94-ba20-4225-a78e-76951d352bd6
*/
id?: string;
name: string;
label: string;
placeholder?: string;
/**
* Do not render attribute in entity views
*/
hidden?: boolean;
/**
* Render as a column in table views. When defined, overrides `hidden`
*/
show_in_table?: boolean;
/**
* Allow sorting by this attribute in table views if `show_in_table` is true
*/
sortable?: boolean;
required?: boolean;
readonly?: boolean;
deprecated?: boolean;
default_value?: any;
/**
* Which group the attribute should appear in. Accepts group ID or group name
*/
group?: string;
/**
* Attribute sort order (ascending) in group
* example:
* 0
*/
order?: number;
/**
* example:
* full_width
*/
layout?: string;
/**
* When set to true, will hide the label of the field.
*/
hide_label?: boolean;
/**
* Code name of the icon to used to represent this attribute.
* The value must be a valid @epilot/base-elements Icon name
*
*/
icon?: string;
/**
* Defines the conditional rendering expression for showing this field.
* When a valid expression is parsed, their evaluation defines the visibility of this attribute.
* Note: Empty or invalid expression have no effect on the field visibility.
*
*/
render_condition?: string;
_purpose?: /**
* example:
* taxonomy-slug:classification-slug
*/
ClassificationId[];
/**
* Manifest ID used to create/update the schema attribute
*/
_manifest?: string /* uuid */[] | null;
/**
* A set of constraints applicable to the attribute.
* These constraints should and will be enforced by the attribute renderer.
*
* example:
* {
* "disablePast": true
* }
*/
constraints?: {
[key: string]: any;
};
/**
* This attribute should only be active when the feature flag is enabled
* example:
* FF_MY_FEATURE_FLAG
*/
feature_flag?: string;
/**
* This attribute should only be active when one of the provided settings have the correct value
*/
settings_flag?: SettingFlag[];
value_formatter?: string;
preview_value_formatter?: string;
/**
* Setting to `true` disables editing the attribute on the entity builder UI
*/
entity_builder_disable_edit?: boolean;
/**
* Setting to `true` prevents the attribute from being modified / deleted
*/
protected?: boolean;
/**
* A set of configurations meant to document and assist the user in filling the attribute.
*/
info_helpers?: {
/**
* The text to be displayed in the attribute hint helper.
* When specified it overrides the `hint_text_key` configuration.
*
*/
hint_text?: string;
/**
* The key of the hint text to be displayed in the attribute hint helper.
* The key should be a valid i18n key.
*
*/
hint_text_key?: string;
/**
* The name of the custom component to be used as the hint helper.
* The component should be registered in the `@epilot360/entity-ui` on the index of the components directory.
* When specified it overrides the `hint_text` or `hint_text_key` configuration.
*
*/
hint_custom_component?: string;
/**
* The placement of the hint tooltip.
* The value should be a valid `@mui/core` tooltip placement.
*
* example:
* top
*/
hint_tooltip_placement?: string;
};
/**
* When set to true, this attribute will always be searchable regardless of
* the ELASTIC_MAX_SEARCH_FIELDS limit. Use this for critical search fields
* that must always be included in search operations.
*
*/
explicit_searchable?: boolean;
/**
* The attribute is a repeatable
*/
repeatable?: boolean;
has_primary?: boolean;
type: "address";
default_address_fields?: /**
* Default fields visible on addresses
*
* Valid values are:
* - postal_code (default)
* - city (default)
* - street (default)
* - street_number (default)
* - plot_area
* - plot_of_land
* - suburb
* - country
* - additional_info
* - coordinates
* - start_date
* - end_date
* - salutation
* - title
* - first_name
* - last_name
* - company_name
*
*/
DefaultAddressFields;
}
/**
* Reference to an address attribute of another entity
*/
export interface AddressRelationAttribute {
/**
* ID for the entity attribute
* example:
* d5839b94-ba20-4225-a78e-76951d352bd6
*/
id?: string;
name: string;
label: string;
placeholder?: string;
/**
* Do not render attribute in entity views
*/
hidden?: boolean;
/**
* Render as a column in table views. When defined, overrides `hidden`
*/
show_in_table?: boolean;
/**
* Allow sorting by this attribute in table views if `show_in_table` is true
*/
sortable?: boolean;
required?: boolean;
readonly?: boolean;
deprecated?: boolean;
default_value?: any;
/**
* Which group the attribute should appear in. Accepts group ID or group name
*/
group?: string;
/**
* Attribute sort order (ascending) in group
* example:
* 0
*/
order?: number;
/**
* example:
* full_width
*/
layout?: string;
/**
* When set to true, will hide the label of the field.
*/
hide_label?: boolean;
/**
* Code name of the icon to used to represent this attribute.
* The value must be a valid @epilot/base-elements Icon name
*
*/
icon?: string;
/**
* Defines the conditional rendering expression for showing this field.
* When a valid expression is parsed, their evaluation defines the visibility of this attribute.
* Note: Empty or invalid expression have no effect on the field visibility.
*
*/
render_condition?: string;
_purpose?: /**
* example:
* taxonomy-slug:classification-slug
*/
ClassificationId[];
/**
* Manifest ID used to create/update the schema attribute
*/
_manifest?: string /* uuid */[] | null;
/**
* A set of constraints applicable to the attribute.
* These constraints should and will be enforced by the attribute renderer.
*
* example:
* {
* "disablePast": true
* }
*/
constraints?: {
[key: string]: any;
};
/**
* This attribute should only be active when the feature flag is enabled
* example:
* FF_MY_FEATURE_FLAG
*/
feature_flag?: string;
/**
* This attribute should only be active when one of the provided settings have the correct value
*/
settings_flag?: SettingFlag[];
value_formatter?: string;
preview_value_formatter?: string;
/**
* Setting to `true` disables editing the attribute on the entity builder UI
*/
entity_builder_disable_edit?: boolean;
/**
* Setting to `true` prevents the attribute from being modified / deleted
*/
protected?: boolean;
/**
* A set of configurations meant to document and assist the user in filling the attribute.
*/
info_helpers?: {
/**
* The text to be displayed in the attribute hint helper.
* When specified it overrides the `hint_text_key` configuration.
*
*/
hint_text?: string;
/**
* The key of the hint text to be displayed in the attribute hint helper.
* The key should be a valid i18n key.
*
*/
hint_text_key?: string;
/**
* The name of the custom component to be used as the hint helper.
* The component should be registered in the `@epilot360/entity-ui` on the index of the components directory.
* When specified it overrides the `hint_text` or `hint_text_key` configuration.
*
*/
hint_custom_component?: string;
/**
* The placement of the hint tooltip.
* The value should be a valid `@mui/core` tooltip placement.
*
* example:
* top
*/
hint_tooltip_placement?: string;
};
/**
* When set to true, this attribute will always be searchable regardless of
* the ELASTIC_MAX_SEARCH_FIELDS limit. Use this for critical search fields
* that must always be included in search operations.
*
*/
explicit_searchable?: boolean;
/**
* The attribute is a repeatable
*/
repeatable?: boolean;
has_primary?: boolean;
type: "relation_address";
default_address_fields?: /**
* Default fields visible on addresses
*
* Valid values are:
* - postal_code (default)
* - city (default)
* - street (default)
* - street_number (default)
* - plot_area
* - plot_of_land
* - suburb
* - country
* - additional_info
* - coordinates
* - start_date
* - end_date
* - salutation
* - title
* - first_name
* - last_name
* - company_name
*
*/
DefaultAddressFields;
}
export type Attribute = /* Textarea or text input */ TextAttribute | /* Link with title and href */ LinkAttribute | /* Date or Datetime picker */ DateAttribute | /* Country picker */ CountryAttribute | /* Yes / No Toggle */ BooleanAttribute | /* Dropdown select */ SelectAttribute | /* Multi Choice Selection */ MultiSelectAttribute | /* Status select */ StatusAttribute | /* Sequence of unique identifiers */ SequenceAttribute | /* Entity Relationship */ RelationAttribute | /* User Relationship */ UserRelationAttribute | /* Address attribute */ AddressAttribute | /* Reference to an address attribute of another entity */ AddressRelationAttribute | /* Reference to a payment method attribute of another entity */ PaymentMethodRelationAttribute | /* Currency input */ CurrencyAttribute | /* Tags */ TagsAttribute | /* Message emil address */ MessageEmailAddressAttribute | /* Numeric input */ NumberAttribute | /* Consent Management */ ConsentAttribute | /* No UI representation */ InternalAttribute | /* Type of attribute to render N number of ordered fields */ OrderedListAttribute | /* File or Image Attachment */ FileAttribute | /* An attribute that is computed from the entity data. For more details on how to use them, check the docs [here](https://e-pilot.atlassian.net/wiki/spaces/EO/pages/5642977476/How+To+Computed+Schema+Attributes) */ ComputedAttribute | /* Partner Status */ PartnerStatusAttribute | /* Email address for send invitation */ InvitationEmailAttribute | /* Automation entity */ AutomationAttribute | /* Epilot internal user info */ InternalUserAttribute | /* Entity Taxonomy */ PurposeAttribute | /* Shared Partner Organisations */ PartnerOrganisationAttribute | /* Portal access configuration */ PortalAccessAttribute | /* Phone number */ PhoneAttribute | /* Email address */ EmailAttribute | /* Payment method */ PaymentAttribute | /* Price component */ PriceComponentAttribute;
/**
* a readonly computed ID for the attribute including schema slug and the attribute ID
*/
export type AttributeWithCompositeID = {
/**
* example:
* contact:97644baa-083f-4e49-9188-fcff2ecaad7d
*/
composite_id?: string;
/**
* Schema slug the attribute belongs to
* example:
* contact
*/
schema?: string;
} & (/* a readonly computed ID for the attribute including schema slug and the attribute ID */ /* Textarea or text input */ TextAttribute | /* Link with title and href */ LinkAttribute | /* Date or Datetime picker */ DateAttribute | /* Country picker */ CountryAttribute | /* Yes / No Toggle */ BooleanAttribute | /* Dropdown select */ SelectAttribute | /* Multi Choice Selection */ MultiSelectAttribute | /* Status select */ StatusAttribute | /* Sequence of unique identifiers */ SequenceAttribute | /* Entity Relationship */ RelationAttribute | /* User Relationship */ UserRelationAttribute | /* Address attribute */ AddressAttribute | /* Reference to an address attribute of another entity */ AddressRelationAttribute | /* Reference to a payment method attribute of another entity */ PaymentMethodRelationAttribute | /* Currency input */ CurrencyAttribute | /* Tags */ TagsAttribute | /* Message emil address */ MessageEmailAddressAttribute | /* Numeric input */ NumberAttribute | /* Consent Management */ ConsentAttribute | /* No UI representation */ InternalAttribute | /* Type of attribute to render N number of ordered fields */ OrderedListAttribute | /* File or Image Attachment */ FileAttribute | /* An attribute that is computed from the entity data. For more details on how to use them, check the docs [here](https://e-pilot.atlassian.net/wiki/spaces/EO/pages/5642977476/How+To+Computed+Schema+Attributes) */ ComputedAttribute | /* Partner Status */ PartnerStatusAttribute | /* Email address for send invitation */ InvitationEmailAttribute | /* Automation entity */ AutomationAttribute | /* Epilot internal user info */ InternalUserAttribute | /* Entity Taxonomy */ PurposeAttribute | /* Shared Partner Organisations */ PartnerOrganisationAttribute | /* Portal access configuration */ PortalAccessAttribute | /* Phone number */ PhoneAttribute | /* Email address */ EmailAttribute | /* Payment method */ PaymentAttribute | /* Price component */ PriceComponentAttribute);
/**
* Automation entity
*/
export interface AutomationAttribute {
/**
* ID for the entity attribute
* example:
* d5839b94-ba20-4225-a78e-76951d352bd6
*/
id?: string;
name: string;
label: string;
placeholder?: string;
/**
* Do not render attribute in entity views
*/
hidden?: boolean;
/**
* Render as a column in table views. When defined, overrides `hidden`
*/
show_in_table?: boolean;
/**
* Allow sorting by this attribute in table views if `show_in_table` is true
*/
sortable?: boolean;
required?: boolean;
readonly?: boolean;
deprecated?: boolean;
default_value?: any;
/**
* Which group the attribute should appear in. Accepts group ID or group name
*/
group?: string;
/**
* Attribute sort order (ascending) in group
* example:
* 0
*/
order?: number;
/**
* example:
* full_width
*/
layout?: string;
/**
* When set to true, will hide the label of the field.
*/
hide_label?: boolean;
/**
* Code name of the icon to used to represent this attribute.
* The value must be a valid @epilot/base-elements Icon name
*
*/
icon?: string;
/**
* Defines the conditional rendering expression for showing this field.
* When a valid expression is parsed, their evaluation defines the visibility of this attribute.
* Note: Empty or invalid expression have no effect on the field visibility.
*
*/
render_condition?: string;
_purpose?: /**
* example:
* taxonomy-slug:classification-slug
*/
ClassificationId[];
/**
* Manifest ID used to create/update the schema attribute
*/
_manifest?: string /* uuid */[] | null;
/**
* A set of constraints applicable to the attribute.
* These constraints should and will be enforced by the attribute renderer.
*
* example:
* {
* "disablePast": true
* }
*/
constraints?: {
[key: string]: any;
};
/**
* This attribute should only be active when the feature flag is enabled
* example:
* FF_MY_FEATURE_FLAG
*/
feature_flag?: string;
/**
* This attribute should only be active when one of the provided settings have the correct value
*/
settings_flag?: SettingFlag[];
value_formatter?: string;
preview_value_formatter?: string;
/**
* Setting to `true` disables editing the attribute on the entity builder UI
*/
entity_builder_disable_edit?: boolean;
/**
* Setting to `true` prevents the attribute from being modified / deleted
*/
protected?: boolean;
/**
* A set of configurations meant to document and assist the user in filling the attribute.
*/
info_helpers?: {
/**
* The text to be displayed in the attribute hint helper.
* When specified it overrides the `hint_text_key` configuration.
*
*/
hint_text?: string;
/**
* The key of the hint text to be displayed in the attribute hint helper.
* The key should be a valid i18n key.
*
*/
hint_text_key?: string;
/**
* The name of the custom component to be used as the hint helper.
* The component should be registered in the `@epilot360/entity-ui` on the index of the components directory.
* When specified it overrides the `hint_text` or `hint_text_key` configuration.
*
*/
hint_custom_component?: string;
/**
* The placement of the hint tooltip.
* The value should be a valid `@mui/core` tooltip placement.
*
* example:
* top
*/
hint_tooltip_placement?: string;
};
/**
* When set to true, this attribute will always be searchable regardless of
* the ELASTIC_MAX_SEARCH_FIELDS limit. Use this for critical search fields
* that must always be included in search operations.
*
*/
explicit_searchable?: boolean;
/**
* The attribute is a repeatable
*/
repeatable?: boolean;
has_primary?: boolean;
type: "automation";
}
export interface BaseActivityItem {
_id?: /**
* See https://github.com/ulid/spec
* example:
* 01F130Q52Q6MWSNS8N2AVXV4JN
*/
ActivityId /* ulid ^01[0-9a-zA-Z]{24}$ */;
timestamp?: string; // date-time
type: /**
* A type for the activity. Used to categorize activities in the activity feed and for event subscriptions.
*
* Built-in entity activity types (custom activities can be defined as well):
* - EntityCreated
* - EntityUpdated
* - EntityDeleted
* - EntitySoftDeleted
* - EntityRestored
* - RelationsAdded
* - RelationsRemoved
* - RelationsSoftDeleted
* - RelationsRestored
* - RelationsDeleted
*
*/
ActivityType;
/**
* Title for activity. Supports handlebars syntax.
* example:
* My custom activity
*/
title: string;
/**
* Message for activity. Supports handlebars syntax.
* example:
* {{caller}} did something with {{entity payload.entity.id}}.
*/
message: string;
/**
* example:
* {
* "entity": {
* "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
* "schema": "contact"
* }
* }
*/
payload?: {
[name: string]: any;
};
/**
* Indicates whether the activity is in the pending state.
* Pending activities are not yet visible in the activity feed and events are not yet dispatched.
*
*/
pending?: boolean;
caller?: ActivityCallerContext;
}
export interface BaseAttribute {
/**
* ID for the entity attribute
* example:
* d5839b94-ba20-4225-a78e-76951d352bd6
*/
id?: string;
name: string;
label: string;
placeholder?: string;
/**
* Do not render attribute in entity views
*/
hidden?: boolean;
/**
* Render as a column in table views. When defined, overrides `hidden`
*/
show_in_table?: boolean;
/**
* Allow sorting by this attribute in table views if `show_in_table` is true
*/
sortable?: boolean;
required?: boolean;
readonly?: boolean;
deprecated?: boolean;
default_value?: any;
/**
* Which group the attribute should appear in. Accepts group ID or group name
*/
group?: string;
/**
* Attribute sort order (ascending) in group
* example:
* 0
*/
order?: number;
/**
* example:
* full_width
*/
layout?: string;
/**
* When set to true, will hide the label of the field.
*/
hide_label?: boolean;
/**
* Code name of the icon to used to represent this attribute.
* The value must be a valid @epilot/base-elements Icon name
*
*/
icon?: string;
/**
* Defines the conditional rendering expression for showing this field.
* When a valid expression is parsed, their evaluation defines the visibility of this attribute.
* Note: Empty or invalid expression have no effect on the field visibility.
*
*/
render_condition?: string;
_purpose?: /**
* example:
* taxonomy-slug:classification-slug
*/
ClassificationId[];
/**
* Manifest ID used to create/update the schema attribute
*/
_manifest?: string /* uuid */[] | null;
/**
* A set of constraints applicable to the attribute.
* These constraints should and will be enforced by the attribute renderer.
*
* example:
* {
* "disablePast": true
* }
*/
constraints?: {
[key: string]: any;
};
/**
* This attribute should only be active when the feature flag is enabled
* example:
* FF_MY_FEATURE_FLAG
*/
feature_flag?: string;
/**
* This attribute should only be active when one of the provided settings have the correct value
*/
settings_flag?: SettingFlag[];
value_formatter?: string;
preview_value_formatter?: string;
/**
* Setting to `true` disables editing the attribute on the entity builder UI
*/
entity_builder_disable_edit?: boolean;
/**
* Setting to `true` prevents the attribute from being modified / deleted
*/
protected?: boolean;
/**
* A set of configurations meant to document and assist the user in filling the attribute.
*/
info_helpers?: {
/**
* The text to be displayed in the attribute hint helper.
* When specified it overrides the `hint_text_key` configuration.
*
*/
hint_text?: string;
/**
* The key of the hint text to be displayed in the attribute hint helper.
* The key should be a valid i18n key.
*
*/
hint_text_key?: string;
/**
* The name of the custom component to be used as the hint helper.
* The component should be registered in the `@epilot360/entity-ui` on the index of the components directory.
* When specified it overrides the `hint_text` or `hint_text_key` configuration.
*
*/
hint_custom_component?: string;
/**
* The placement of the hint tooltip.
* The value should be a valid `@mui/core` tooltip placement.
*
* example:
* top
*/
hint_tooltip_placement?: string;
};
/**
* When set to true, this attribute will always be searchable regardless of
* the ELASTIC_MAX_SEARCH_FIELDS limit. Use this for critical search fields
* that must always be included in search operations.
*
*/
explicit_searchable?: boolean;
/**
* The attribute is a repeatable
*/
repeatable?: boolean;
has_primary?: boolean;
}
/**
* example:
* {
* "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
* "_org": "123",
* "_owners": [
* {
* "org_id": "123",
* "user_id": "123"
* }
* ],
* "_schema": "contact",
* "_tags": [
* "example",
* "mock"
* ],
* "_created_at": "2021-02-09T12:41:43.662Z",
* "_updated_at": "2021-02-09T12:41:43.662Z",
* "_acl": {
* "view": [
* "org:456",
* "org:789"
* ],
* "edit": [
* "org:456"
* ],
* "delete": [
* "org:456"
* ]
* },
* "_manifest": [
* "123e4567-e89b-12d3-a456-426614174000"
* ]
* }
*/
export interface BaseEntity {
[name: string]: any;
_id: string; // uuid
/**
* Organization Id the entity belongs to
*/
_org: string;
_owners?: /**
* The user / organization owning this entity.
*
* Note: Owner implicitly has access to the entity regardless of ACLs.
*
*/
EntityOwner[];
_schema: /**
* URL-friendly identifier for the entity schema
* example:
* contact
*/
EntitySlug /* ^[a-zA-Z0-9_-]+$ */;
/**
* Title of entity
*/
_title: string | null;
_tags?: string[] | null;
_created_at: string | null; // date-time
_updated_at: string | null; // date-time
_deleted_at?: string | null; // date-time
/**
* Access control list (ACL) for an entity. Defines sharing access to external orgs or users.
*/
_acl?: {
[name: string]: any;
view?: string[];
edit?: string[];
delete?: string[];
};
_purpose?: string[] | null;
/**
* Manifest ID used to create/update the entity
*/
_manifest?: string /* uuid */[] | null;
}
/**
* Reference to blueprint
*/
export type BlueprintEntityId = string; // uuid
/**
* Yes / No Toggle
*/
export interface BooleanAttribute {
/**
* ID for the entity attribute
* example:
* d5839b94-ba20-4225-a78e-76951d352bd6
*/
id?: string;
name: string;
label: string;
placeholder?: string;
/**
* Do not render attribute in entity views
*/
hidden?: boolean;
/**
* Render as a column in table views. When defined, overrides `hidden`
*/
show_in_table?: boolean;
/**
* Allow sorting by this attribute in table views if `show_in_table` is true
*/
sortable?: boolean;
required?: boolean;
readonly?: boolean;
deprecated?: boolean;
default_value?: any;
/**
* Which group the attribute should appear in. Accepts group ID or group name
*/
group?: string;
/**
* Attribute sort order (ascending) in group
* example:
* 0
*/
order?: number;
/**
* example:
* full_width
*/
layout?: string;
/**
* When set to true, will hide the label of the field.
*/
hide_label?: boolean;
/**
* Code name of the icon to used to represent this attribute.
* The value must be a valid @epilot/base-elements Icon name
*
*/
icon?: string;
/**
* Defines the conditional rendering expression for showing this field.
* When a valid expression is parsed, their evaluation defines the visibility of this attribute.
* Note: Empty or invalid expression have no effect on the field visibility.
*
*/
render_condition?: string;
_purpose?: /**
* example:
* taxonomy-slug:classification-slug
*/
ClassificationId[];
/**
* Manifest ID used to create/update the schema attribute
*/
_manifest?: string /* uuid */[] | null;
/**
* A set of constraints applicable to the attribute.
* These constraints should and will be enforced by the attribute renderer.
*
* example:
* {
* "disablePast": true
* }
*/
constraints?: {
[key: string]: any;
};
/**
* This attribute should only be active when the feature flag is enabled
* example:
* FF_MY_FEATURE_FLAG
*/
feature_flag?: string;
/**
* This attribute should only be active when one of the provided settings have the correct value
*/
settings_flag?: SettingFlag[];
value_formatter?: string;
preview_value_formatter?: string;
/**
* Setting to `true` disables editing the attribute on the entity builder UI
*/
entity_builder_disable_edit?: boolean;
/**
* Setting to `true` prevents the attribute from being modified / deleted
*/
protected?: boolean;
/**
* A set of configurations meant to document and assist the user in filling the attribute.
*/
info_helpers?: {
/**
* The text to be displayed in the attribute hint helper.
* When specified it overrides the `hint_text_key` configuration.
*
*/
hint_text?: string;
/**
* The key of the hint text to be displayed in the attribute hint helper.
* The key should be a valid i18n key.
*
*/
hint_text_key?: string;
/**
* The name of the custom component to be used as the hint helper.
* The component should be registered in the `@epilot360/entity-ui` on the index of the components directory.
* When specified it overrides the `hint_text` or `hint_text_key` configuration.
*
*/
hint_custom_component?: string;
/**
* The placement of the hint tooltip.
* The value should be a valid `@mui/core` tooltip placement.
*
* example:
* top
*/
hint_tooltip_placement?: string;
};
/**
* When set to true, this attribute will always be searchable regardless of
* the ELASTIC_MAX_SEARCH_FIELDS limit. Use this for critical search fields
* that must always be included in search operations.
*
*/
explicit_searchable?: boolean;
/**
* The attribute is a repeatable
*/
repeatable?: boolean;
has_primary?: boolean;
type: "boolean";
display_type?: "switch" | "checkbox";
}
/**
* example:
* taxonomy-slug:classi