@trii/types 2.10.743 → 2.10.744

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.
@@ -1,8 +1,9 @@
1
1
  import { ChannelType } from "../Common/Channels/ChannelType";
2
- import { ITicketAuditedEntity, ITicketProperty, TicketPriority } from "./Common";
2
+ import { ITicketAuditedEntity, ITicketProperty, TicketPriority, TicketPropertyValue } from "./Common";
3
3
  import { ITicketMessageReference } from "./Conversation";
4
4
  import type { ITicketCursorResponse } from "./Api";
5
5
  import type { ITicketAttachmentUploadSession } from "./AdvancedApi";
6
+ import type { ITicketFieldOption, ITicketFieldValidation, ITicketObjectField, TicketFieldType } from "./Fields";
6
7
  export declare enum TicketPortalAuthenticationMode {
7
8
  PUBLIC = "PUBLIC",
8
9
  OPTIONAL = "OPTIONAL",
@@ -509,6 +510,76 @@ export interface ISubmitTicketRequestDto {
509
510
  formSubmissionId: string;
510
511
  idempotencyKey: string;
511
512
  }
513
+ /** Just enough of the category to render a grouped catalog: a heading, its order,
514
+ * and the id the portal has to send back in ICreateCustomerTicketDto. */
515
+ export interface ICustomerRequestTypeCategoryView {
516
+ id: string;
517
+ name: string;
518
+ description?: string;
519
+ order: number;
520
+ }
521
+ /**
522
+ * One entry of the portal's catalog.
523
+ *
524
+ * A customer-safe projection of ITicketRequestType, built as an allowlist rather
525
+ * than by removing keys: the agent shape carries defaultAssignedGroupId (which
526
+ * internal group handles what), workflowId, slaPolicyId, audiencePolicyId,
527
+ * fieldDefinitionIds, layoutIds and the createdBy/updatedBy uuids of agents,
528
+ * none of which belong on a public surface.
529
+ *
530
+ * `formId` / `formVersion` travel because the portal renders the form.
531
+ * `defaultPriority` is a hint for preselection; the create endpoint applies its
532
+ * own default regardless.
533
+ */
534
+ export interface ICustomerRequestTypeView {
535
+ id: string;
536
+ name: string;
537
+ description?: string;
538
+ icon?: string;
539
+ formId: string;
540
+ formVersion?: number;
541
+ defaultPriority?: TicketPriority;
542
+ category: ICustomerRequestTypeCategoryView;
543
+ }
544
+ /**
545
+ * One field of the portal's create form.
546
+ *
547
+ * Allowlist over ITicketFieldDefinition: classification, maskingStrategy,
548
+ * containsPii, readRoleIds, writeRoleIds, retentionPolicyId, conditions and the
549
+ * scope arrays stay server-side. `validation`, `options` and `objectFields` do
550
+ * travel — without them the portal cannot render a select or give the customer
551
+ * feedback before a round trip that ends in a 422.
552
+ *
553
+ * `required` is the EFFECTIVE value for the creation context, not the field's
554
+ * own flag: it already folds in requiredForStatusIds for the initial status and
555
+ * any condition that makes the field mandatory.
556
+ */
557
+ export interface ICustomerFormFieldView {
558
+ nameKey: string;
559
+ label: string;
560
+ description?: string;
561
+ placeholder?: string;
562
+ type: TicketFieldType;
563
+ required: boolean;
564
+ defaultValue?: TicketPropertyValue;
565
+ options?: ITicketFieldOption[];
566
+ objectFields?: ITicketObjectField[];
567
+ validation?: ITicketFieldValidation;
568
+ }
569
+ /**
570
+ * What the portal renders so a customer can fill in `properties` on
571
+ * ICreateCustomerTicketDto.
572
+ *
573
+ * NO LAYOUT, unlike the agent form schema: layouts are selected by roleIds and a
574
+ * contact has no role, so "the effective layout for a customer" is not a
575
+ * question the layout model can answer. Presentation belongs to the portal; this
576
+ * answers membership, obligation and shape.
577
+ */
578
+ export interface ICustomerFormSchemaView {
579
+ requestTypeId: string;
580
+ categoryId: string;
581
+ fields: ICustomerFormFieldView[];
582
+ }
512
583
  /**
513
584
  * One file the portal declares BEFORE any byte exists in storage.
514
585
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.743",
3
+ "version": "2.10.744",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",