@d19n/youfibre-odin-sdk 2.0.338 → 2.0.340

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 (39) hide show
  1. package/README.md +10 -2
  2. package/dist/EntityRegistry.d.ts +2 -0
  3. package/dist/EntityRegistry.js +2 -0
  4. package/dist/OdinApiClient.d.ts +4 -0
  5. package/dist/OdinApiClient.js +8 -0
  6. package/dist/OdinDbClient.d.ts +4 -0
  7. package/dist/OdinDbClient.js +8 -0
  8. package/dist/accessors-v2/AiRouteRequestAccessor.d.ts +112 -0
  9. package/dist/accessors-v2/AiRouteRequestAccessor.js +191 -0
  10. package/dist/accessors-v2/index.d.ts +1 -0
  11. package/dist/accessors-v2/index.js +5 -3
  12. package/dist/actions-v2/CreateAiRouteRequestDto.d.ts +165 -0
  13. package/dist/actions-v2/CreateAiRouteRequestDto.js +57 -0
  14. package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +1 -1
  15. package/dist/actions-v2/UpdateAppointmentSalesAppDto.d.ts +129 -0
  16. package/dist/actions-v2/UpdateAppointmentSalesAppDto.js +56 -0
  17. package/dist/api-sdk-v2/AiRouteRequestApi.d.ts +45 -0
  18. package/dist/api-sdk-v2/AiRouteRequestApi.js +151 -0
  19. package/dist/db-accessors-v2/AiRouteRequestDbAccessor.d.ts +180 -0
  20. package/dist/db-accessors-v2/AiRouteRequestDbAccessor.js +265 -0
  21. package/dist/db-accessors-v2/index.d.ts +1 -0
  22. package/dist/db-accessors-v2/index.js +5 -3
  23. package/dist/db-sdk-v2/AiRouteRequestDb.d.ts +117 -0
  24. package/dist/db-sdk-v2/AiRouteRequestDb.js +200 -0
  25. package/dist/entities-v2/AiRouteRequest.d.ts +248 -0
  26. package/dist/entities-v2/AiRouteRequest.js +162 -0
  27. package/dist/entities-v2/Appointment.d.ts +16 -16
  28. package/dist/entities-v2/Appointment.js +4 -4
  29. package/dist/entities-v2/Lead.d.ts +2 -0
  30. package/dist/entities-v2/Lead.js +2 -0
  31. package/dist/entities-v2/Order.d.ts +23 -1
  32. package/dist/entities-v2/Order.js +18 -2
  33. package/dist/records-v2/AiRouteRequestRecord.d.ts +186 -0
  34. package/dist/records-v2/AiRouteRequestRecord.js +245 -0
  35. package/dist/records-v2/AppointmentRecord.d.ts +28 -0
  36. package/dist/records-v2/AppointmentRecord.js +40 -0
  37. package/dist/records-v2/index.d.ts +1 -0
  38. package/dist/records-v2/index.js +8 -4
  39. package/package.json +1 -1
@@ -46,8 +46,6 @@ var AppointmentPropertyKeys;
46
46
  AppointmentPropertyKeys["Longitude"] = "Longitude";
47
47
  /** email address (Sales - Appointment) */
48
48
  AppointmentPropertyKeys["EmailAddress"] = "EmailAddress";
49
- /** Contact information field for Appointment. Used by Sales team for communication. */
50
- AppointmentPropertyKeys["Address"] = "Address";
51
49
  /** Reference identifier for Appointment relationships. Used for data integrity. */
52
50
  AppointmentPropertyKeys["AddressId"] = "AddressId";
53
51
  /** Contact information field for Appointment. Used by Sales team for communication. */
@@ -58,8 +56,6 @@ var AppointmentPropertyKeys;
58
56
  AppointmentPropertyKeys["ImportId"] = "ImportId";
59
57
  /** Date field for Appointment records. Used by Sales team. */
60
58
  AppointmentPropertyKeys["Date"] = "Date";
61
- /** The title of the appointment (Sales - Appointment) */
62
- AppointmentPropertyKeys["MeetingTitle"] = "MeetingTitle";
63
59
  /** Additional appointment information (Sales - Appointment) */
64
60
  AppointmentPropertyKeys["Comment"] = "Comment";
65
61
  /** Display name/title for Appointment records. Primary identifier for Sales team. */
@@ -68,6 +64,10 @@ var AppointmentPropertyKeys;
68
64
  AppointmentPropertyKeys["LastName"] = "LastName";
69
65
  /** Appointment type (Sales - Appointment) */
70
66
  AppointmentPropertyKeys["Type"] = "Type";
67
+ /** Contact information field for Appointment. Used by Sales team for communication. */
68
+ AppointmentPropertyKeys["Address"] = "Address";
69
+ /** The title of the appointment (Sales - Appointment) */
70
+ AppointmentPropertyKeys["MeetingTitle"] = "MeetingTitle";
71
71
  })(AppointmentPropertyKeys = exports.AppointmentPropertyKeys || (exports.AppointmentPropertyKeys = {}));
72
72
  /**
73
73
  * Appointment entity from CrmModule
@@ -78,6 +78,7 @@ export declare enum DefaultLeadStageKeys {
78
78
  * - `FIELDSALES` - Field sales
79
79
  * - `GBVS`
80
80
  * - `NETOMNIA` - Netomnia
81
+ * - `ODIN_MOBILE_APP` - Odin Mobile App
81
82
  * - `PAN_MONY` - PAN-MONY
82
83
  * - `PHONE` - Phone
83
84
  * - `REFERRAL` - Referral
@@ -93,6 +94,7 @@ export declare enum LeadSource {
93
94
  FIELD_SALES = "FIELDSALES",
94
95
  GBVS = "GBVS",
95
96
  NETOMNIA = "NETOMNIA",
97
+ ODIN_MOBILE_APP = "ODIN_MOBILE_APP",
96
98
  PAN_MONY = "PAN_MONY",
97
99
  PHONE = "PHONE",
98
100
  REFERRAL = "REFERRAL",
@@ -68,6 +68,7 @@ var DefaultLeadStageKeys;
68
68
  * - `FIELDSALES` - Field sales
69
69
  * - `GBVS`
70
70
  * - `NETOMNIA` - Netomnia
71
+ * - `ODIN_MOBILE_APP` - Odin Mobile App
71
72
  * - `PAN_MONY` - PAN-MONY
72
73
  * - `PHONE` - Phone
73
74
  * - `REFERRAL` - Referral
@@ -84,6 +85,7 @@ var LeadSource;
84
85
  LeadSource["FIELD_SALES"] = "FIELDSALES";
85
86
  LeadSource["GBVS"] = "GBVS";
86
87
  LeadSource["NETOMNIA"] = "NETOMNIA";
88
+ LeadSource["ODIN_MOBILE_APP"] = "ODIN_MOBILE_APP";
87
89
  LeadSource["PAN_MONY"] = "PAN_MONY";
88
90
  LeadSource["PHONE"] = "PHONE";
89
91
  LeadSource["REFERRAL"] = "REFERRAL";
@@ -364,6 +364,19 @@ export declare enum OrderActivationStatus {
364
364
  PROVISIONING = "PROVISIONING",
365
365
  SUSPENDED = "SUSPENDED"
366
366
  }
367
+ /**
368
+ * Valid values for Order.BatteryBackupAnswersSource
369
+ *
370
+ * Front end that last saved the battery backup answers. Set by the customer portal API, copied to the dispatch work order Source by the orders module, then cleared (PORTAPP-3276).
371
+ *
372
+ * @remarks Available options:
373
+ * - `CUSTOMER_APP` - Customer App
374
+ * - `CUSTOMER_PORTAL` - Customer Portal
375
+ */
376
+ export declare enum OrderBatteryBackupAnswersSource {
377
+ CUSTOMER_APP = "CUSTOMER_APP",
378
+ CUSTOMER_PORTAL = "CUSTOMER_PORTAL"
379
+ }
367
380
  /**
368
381
  * Property keys for Order
369
382
  * Use these constants instead of string literals for type safety
@@ -576,7 +589,9 @@ export declare enum OrderPropertyKeys {
576
589
  /** Date the order was recontracted (in place). Discriminator + event date. */
577
590
  RecontractDate = "RecontractDate",
578
591
  /** status of the order (must be activated for billing) (Sales - Order) */
579
- ActivationStatus = "ActivationStatus"
592
+ ActivationStatus = "ActivationStatus",
593
+ /** Front end that last saved the battery backup answers. Set by the customer portal API, copied to the dispatch work order Source by the orders module, then cleared (PORTAPP-3276). */
594
+ BatteryBackupAnswersSource = "BatteryBackupAnswersSource"
580
595
  }
581
596
  /**
582
597
  * Properties for Order records
@@ -1227,6 +1242,13 @@ export interface OrderProperties {
1227
1242
  * @hidden This field is hidden in the UI
1228
1243
  */
1229
1244
  ActivationStatus: OrderActivationStatus;
1245
+ /** Front end that last saved the battery backup answers. Set by the customer portal API, copied to the dispatch work order Source by the orders module, then cleared (PORTAPP-3276).
1246
+ *
1247
+ * @type {ENUM}
1248
+ * @default
1249
+ * @enum {OrderBatteryBackupAnswersSource}
1250
+ */
1251
+ BatteryBackupAnswersSource: OrderBatteryBackupAnswersSource;
1230
1252
  }
1231
1253
  /**
1232
1254
  * Order entity from OrderModule
@@ -12,8 +12,8 @@
12
12
  * Generated from Odin schema definition
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ROUTING_KEY_LINK_ORDER_APPOINTMENT_DELETED = exports.ROUTING_KEY_LINK_ORDER_APPOINTMENT_CREATED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ROUTER_DELETED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ROUTER_CREATED = exports.ROUTING_KEY_LINK_ORDER_SMS_MESSAGE_DELETED = exports.ROUTING_KEY_LINK_ORDER_SMS_MESSAGE_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_CREATED = exports.ROUTING_KEY_LINK_ORDER_FILE_DELETED = exports.ROUTING_KEY_LINK_ORDER_FILE_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_ITEM_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_ITEM_CREATED = exports.ROUTING_KEY_LINK_ORDER_BILLING_ADJUSTMENT_DELETED = exports.ROUTING_KEY_LINK_ORDER_BILLING_ADJUSTMENT_CREATED = exports.ROUTING_KEY_LINK_ORDER_PUSH_NOTIFICATION_DELETED = exports.ROUTING_KEY_LINK_ORDER_PUSH_NOTIFICATION_CREATED = exports.ROUTING_KEY_LINK_ORDER_DISCOUNT_DELETED = exports.ROUTING_KEY_LINK_ORDER_DISCOUNT_CREATED = exports.ROUTING_KEY_LINK_ORDER_ADDRESS_DELETED = exports.ROUTING_KEY_LINK_ORDER_ADDRESS_CREATED = exports.ROUTING_KEY_LINK_ORDER_PHONE_NUMBER_DELETED = exports.ROUTING_KEY_LINK_ORDER_PHONE_NUMBER_CREATED = exports.ROUTING_KEY_LINK_ORDER_NOTE_DELETED = exports.ROUTING_KEY_LINK_ORDER_NOTE_CREATED = exports.ROUTING_KEY_ORDER_DEFAULT_DELETED = exports.ROUTING_KEY_ORDER_DEFAULT_UPDATED = exports.ROUTING_KEY_ORDER_DEFAULT_CREATED = exports.ROUTING_KEY_ORDER_DELETED = exports.ROUTING_KEY_ORDER_UPDATED = exports.ROUTING_KEY_ORDER_CREATED = exports.Order = exports.OrderPropertyKeys = exports.OrderActivationStatus = exports.OrderSupplierOrderType = exports.OrderOtsNotRequiredReason = exports.OrderBatteryPackRequired = exports.OrderMobileCoverage = exports.OrderAltContactMethod = exports.OrderProvider = exports.OrderBillingTerms = exports.OrderDeactivationReason = exports.OrderDiscountType = exports.OrderWithholdCommissionReason = exports.OrderDiscountUnit = exports.OrderTrialUnit = exports.OrderContractType = exports.OrderCurrencyCode = exports.DefaultOrderStageKeys = exports.DefaultOrderStageNames = exports.OrderEntityTypes = void 0;
16
- exports.ROUTING_KEY_LINK_ORDER_EMAIL_DELETED = exports.ROUTING_KEY_LINK_ORDER_EMAIL_CREATED = exports.ROUTING_KEY_LINK_ORDER_WORK_ORDER_DELETED = exports.ROUTING_KEY_LINK_ORDER_WORK_ORDER_CREATED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_DELETED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ORDER_INVOICE_DELETED = exports.ROUTING_KEY_LINK_ORDER_INVOICE_CREATED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_LOG_DELETED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_LOG_CREATED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_DELETED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_CHECK_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_CHECK_CREATED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ONT_DELETED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ONT_CREATED = exports.ROUTING_KEY_LINK_ORDER_VISIT_DELETED = exports.ROUTING_KEY_LINK_ORDER_VISIT_CREATED = exports.ROUTING_KEY_LINK_ORDER_COMMISSION_DELETED = exports.ROUTING_KEY_LINK_ORDER_COMMISSION_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_KCI_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_KCI_CREATED = exports.ROUTING_KEY_LINK_ORDER_REFERRAL_DELETED = exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CREATED = exports.ROUTING_KEY_LINK_ORDER_CONTRACT_BUY_OUT_DELETED = exports.ROUTING_KEY_LINK_ORDER_CONTRACT_BUY_OUT_CREATED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_IDENTITY_DELETED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_IDENTITY_CREATED = void 0;
15
+ exports.ROUTING_KEY_LINK_ORDER_APPOINTMENT_CREATED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ROUTER_DELETED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ROUTER_CREATED = exports.ROUTING_KEY_LINK_ORDER_SMS_MESSAGE_DELETED = exports.ROUTING_KEY_LINK_ORDER_SMS_MESSAGE_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_CREATED = exports.ROUTING_KEY_LINK_ORDER_FILE_DELETED = exports.ROUTING_KEY_LINK_ORDER_FILE_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_ITEM_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_ITEM_CREATED = exports.ROUTING_KEY_LINK_ORDER_BILLING_ADJUSTMENT_DELETED = exports.ROUTING_KEY_LINK_ORDER_BILLING_ADJUSTMENT_CREATED = exports.ROUTING_KEY_LINK_ORDER_PUSH_NOTIFICATION_DELETED = exports.ROUTING_KEY_LINK_ORDER_PUSH_NOTIFICATION_CREATED = exports.ROUTING_KEY_LINK_ORDER_DISCOUNT_DELETED = exports.ROUTING_KEY_LINK_ORDER_DISCOUNT_CREATED = exports.ROUTING_KEY_LINK_ORDER_ADDRESS_DELETED = exports.ROUTING_KEY_LINK_ORDER_ADDRESS_CREATED = exports.ROUTING_KEY_LINK_ORDER_PHONE_NUMBER_DELETED = exports.ROUTING_KEY_LINK_ORDER_PHONE_NUMBER_CREATED = exports.ROUTING_KEY_LINK_ORDER_NOTE_DELETED = exports.ROUTING_KEY_LINK_ORDER_NOTE_CREATED = exports.ROUTING_KEY_ORDER_DEFAULT_DELETED = exports.ROUTING_KEY_ORDER_DEFAULT_UPDATED = exports.ROUTING_KEY_ORDER_DEFAULT_CREATED = exports.ROUTING_KEY_ORDER_DELETED = exports.ROUTING_KEY_ORDER_UPDATED = exports.ROUTING_KEY_ORDER_CREATED = exports.Order = exports.OrderPropertyKeys = exports.OrderBatteryBackupAnswersSource = exports.OrderActivationStatus = exports.OrderSupplierOrderType = exports.OrderOtsNotRequiredReason = exports.OrderBatteryPackRequired = exports.OrderMobileCoverage = exports.OrderAltContactMethod = exports.OrderProvider = exports.OrderBillingTerms = exports.OrderDeactivationReason = exports.OrderDiscountType = exports.OrderWithholdCommissionReason = exports.OrderDiscountUnit = exports.OrderTrialUnit = exports.OrderContractType = exports.OrderCurrencyCode = exports.DefaultOrderStageKeys = exports.DefaultOrderStageNames = exports.OrderEntityTypes = void 0;
16
+ exports.ROUTING_KEY_LINK_ORDER_EMAIL_DELETED = exports.ROUTING_KEY_LINK_ORDER_EMAIL_CREATED = exports.ROUTING_KEY_LINK_ORDER_WORK_ORDER_DELETED = exports.ROUTING_KEY_LINK_ORDER_WORK_ORDER_CREATED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_DELETED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ORDER_INVOICE_DELETED = exports.ROUTING_KEY_LINK_ORDER_INVOICE_CREATED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_LOG_DELETED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_LOG_CREATED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_DELETED = exports.ROUTING_KEY_LINK_ORDER_ACTIVITY_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_CHECK_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_CHECK_CREATED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ONT_DELETED = exports.ROUTING_KEY_LINK_ORDER_CUSTOMER_DEVICE_ONT_CREATED = exports.ROUTING_KEY_LINK_ORDER_VISIT_DELETED = exports.ROUTING_KEY_LINK_ORDER_VISIT_CREATED = exports.ROUTING_KEY_LINK_ORDER_COMMISSION_DELETED = exports.ROUTING_KEY_LINK_ORDER_COMMISSION_CREATED = exports.ROUTING_KEY_LINK_ORDER_ORDER_KCI_DELETED = exports.ROUTING_KEY_LINK_ORDER_ORDER_KCI_CREATED = exports.ROUTING_KEY_LINK_ORDER_REFERRAL_DELETED = exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CREATED = exports.ROUTING_KEY_LINK_ORDER_CONTRACT_BUY_OUT_DELETED = exports.ROUTING_KEY_LINK_ORDER_CONTRACT_BUY_OUT_CREATED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_IDENTITY_DELETED = exports.ROUTING_KEY_LINK_ORDER_CONTACT_IDENTITY_CREATED = exports.ROUTING_KEY_LINK_ORDER_APPOINTMENT_DELETED = void 0;
17
17
  const core_1 = require("@d19n/odin-types/dist/core");
18
18
  /**
19
19
  * Available types for Order records
@@ -346,6 +346,20 @@ var OrderActivationStatus;
346
346
  OrderActivationStatus["PROVISIONING"] = "PROVISIONING";
347
347
  OrderActivationStatus["SUSPENDED"] = "SUSPENDED";
348
348
  })(OrderActivationStatus = exports.OrderActivationStatus || (exports.OrderActivationStatus = {}));
349
+ /**
350
+ * Valid values for Order.BatteryBackupAnswersSource
351
+ *
352
+ * Front end that last saved the battery backup answers. Set by the customer portal API, copied to the dispatch work order Source by the orders module, then cleared (PORTAPP-3276).
353
+ *
354
+ * @remarks Available options:
355
+ * - `CUSTOMER_APP` - Customer App
356
+ * - `CUSTOMER_PORTAL` - Customer Portal
357
+ */
358
+ var OrderBatteryBackupAnswersSource;
359
+ (function (OrderBatteryBackupAnswersSource) {
360
+ OrderBatteryBackupAnswersSource["CUSTOMER_APP"] = "CUSTOMER_APP";
361
+ OrderBatteryBackupAnswersSource["CUSTOMER_PORTAL"] = "CUSTOMER_PORTAL";
362
+ })(OrderBatteryBackupAnswersSource = exports.OrderBatteryBackupAnswersSource || (exports.OrderBatteryBackupAnswersSource = {}));
349
363
  /**
350
364
  * Property keys for Order
351
365
  * Use these constants instead of string literals for type safety
@@ -560,6 +574,8 @@ var OrderPropertyKeys;
560
574
  OrderPropertyKeys["RecontractDate"] = "RecontractDate";
561
575
  /** status of the order (must be activated for billing) (Sales - Order) */
562
576
  OrderPropertyKeys["ActivationStatus"] = "ActivationStatus";
577
+ /** Front end that last saved the battery backup answers. Set by the customer portal API, copied to the dispatch work order Source by the orders module, then cleared (PORTAPP-3276). */
578
+ OrderPropertyKeys["BatteryBackupAnswersSource"] = "BatteryBackupAnswersSource";
563
579
  })(OrderPropertyKeys = exports.OrderPropertyKeys || (exports.OrderPropertyKeys = {}));
564
580
  /**
565
581
  * Order entity from OrderModule
@@ -0,0 +1,186 @@
1
+ /**
2
+ * AiRouteRequest Record Wrapper
3
+ *
4
+ * Provides typed action methods and link management.
5
+ * Works with both ApiProvider and DbProvider.
6
+ *
7
+ * All action methods return an ActionBuilder or FlowBuilder.
8
+ * Call .execute() to run or .dryRun() to get the payload for debugging.
9
+ *
10
+ * Can be instantiated with null record for create operations:
11
+ * ```typescript
12
+ * const record = odinClient.aiRouteRequests.new();
13
+ * await record.createAiRouteRequest({ ... }).execute();
14
+ * ```
15
+ *
16
+ * Entity Types: DEFAULT
17
+ *
18
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
19
+ */
20
+ import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
21
+ import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
22
+ import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
23
+ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
24
+ import { AiRouteRequestProperties } from '../entities-v2/AiRouteRequest';
25
+ import { CreateAiRouteRequestProperties } from '../actions-v2/CreateAiRouteRequestDto';
26
+ /** Valid entity types for AiRouteRequest */
27
+ export declare type AiRouteRequestType = 'DEFAULT';
28
+ /**
29
+ * Builder for action execution with dryRun support
30
+ *
31
+ * Provides a consistent API across all action types:
32
+ * - `.execute()` - Execute the action and return results
33
+ * - `.dryRun()` - Return the payload without executing (for debugging)
34
+ */
35
+ declare class ActionBuilder<T = IDbRecordCreateUpdateRes[]> {
36
+ private _provider;
37
+ private _moduleName;
38
+ private _entityName;
39
+ private _payload;
40
+ private _clearPendingLinks;
41
+ constructor(provider: IOdinProvider, moduleName: string, entityName: string, payload: Record<string, any>, clearPendingLinks: () => void);
42
+ /**
43
+ * Set an external system identifier for this record.
44
+ * Links the record to a corresponding entry in an external application.
45
+ *
46
+ * @param externalId - The ID in the external system
47
+ * @param externalAppId - The external application identifier
48
+ * @returns this (for chaining)
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
53
+ * ```
54
+ */
55
+ withExternalId(externalId: string, externalAppId: string): this;
56
+ /**
57
+ * Set security/access groups for this record.
58
+ * Controls which user groups can access the record.
59
+ *
60
+ * @param groups - Array of group names
61
+ * @returns this (for chaining)
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
66
+ * ```
67
+ */
68
+ withGroups(groups: string[]): this;
69
+ /**
70
+ * Execute the action
71
+ * @returns The result from the API
72
+ */
73
+ execute(): Promise<T>;
74
+ /**
75
+ * Returns the request payload without executing (for debugging)
76
+ * @returns The request payload that would be sent to the API
77
+ */
78
+ dryRun(): Record<string, any>;
79
+ /**
80
+ * Prevents accidental `await actionBuilder` without .execute()
81
+ * Forces developers to explicitly call .execute()
82
+ * @throws Error always - use .execute() or .dryRun() instead
83
+ */
84
+ then(): never;
85
+ }
86
+ export declare class AiRouteRequestRecord<TProps = AiRouteRequestProperties> {
87
+ private _record;
88
+ private _provider;
89
+ private _pendingLinks;
90
+ private _preGeneratedId;
91
+ /**
92
+ * Create a record wrapper.
93
+ * @param record - The underlying record, or null for create operations
94
+ * @param provider - The API or DB provider
95
+ * @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
96
+ */
97
+ constructor(record: OdinRecord<TProps> | null, provider: IOdinProvider, preGeneratedId?: string);
98
+ /** Returns true if this is a new (unsaved) record */
99
+ get isNew(): boolean;
100
+ /** Record ID - always available (pre-generated for new records) */
101
+ get id(): string;
102
+ get entity(): string;
103
+ get type(): AiRouteRequestType | undefined;
104
+ /** Record properties - empty object for new (unsaved) records */
105
+ get properties(): TProps;
106
+ get title(): string | undefined;
107
+ get recordNumber(): string | undefined;
108
+ get stage(): PipelineStageEntity | undefined;
109
+ get createdAt(): string | undefined;
110
+ get updatedAt(): string | undefined;
111
+ get externalId(): string | undefined;
112
+ get externalAppId(): string | undefined;
113
+ get groups(): string[];
114
+ /** Link metadata - populated only when the read passed withLinks (empty otherwise) */
115
+ get links(): OdinRecord<TProps>['links'];
116
+ /** Access the underlying OdinRecord (null for new records) */
117
+ get record(): OdinRecord<TProps> | null;
118
+ /**
119
+ * Type guard: check if this record is of type DEFAULT
120
+ *
121
+ * When this returns true, TypeScript automatically narrows the type,
122
+ * giving you access to DEFAULT-specific properties.
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * if (record.isDefault()) {
127
+ * // TypeScript knows record.properties is AiRouteRequestProperties
128
+ * console.log(record.properties.SomeTypeSpecificField);
129
+ * }
130
+ * ```
131
+ * @remarks This is the default record type
132
+ */
133
+ isDefault(): this is AiRouteRequestRecord<AiRouteRequestProperties>;
134
+ /**
135
+ * Queue a link to be created with the next action.
136
+ * Works for both create and update actions.
137
+ * @returns this (for chaining)
138
+ */
139
+ link(target: OdinRecord<any> | {
140
+ id: string;
141
+ entity: string;
142
+ }): this;
143
+ /** Get the currently queued links */
144
+ get pendingLinks(): OdinRecordLinkDto[];
145
+ /** Clear pending links without executing an action */
146
+ clearPendingLinks(): this;
147
+ /**
148
+ * Immediately unlink a record (API call).
149
+ * Unlike link(), this executes immediately.
150
+ * @throws Error if called on a new (unsaved) record
151
+ */
152
+ unlink(target: OdinRecord<any> | {
153
+ id: string;
154
+ } | string): Promise<void>;
155
+ /**
156
+ * CreateAiRouteRequest
157
+ *
158
+ * Creates a new AiRouteRequest record with the specified properties.
159
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
160
+ *
161
+ * @remarks Record type: DEFAULT
162
+ *
163
+ * @param properties - The properties for the new record
164
+ * @param options - Optional settings
165
+ * @param options.journeyId - Associate with a journey
166
+ * @param options.stageKey - Set initial pipeline stage
167
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * // Create with properties
172
+ * const record = odinClient.aiRouteRequests.new();
173
+ * await record.createAiRouteRequest({ ... }).execute();
174
+ *
175
+ * // Dry run (for debugging)
176
+ * const payload = record.createAiRouteRequest({ ... }).dryRun();
177
+ * ```
178
+ */
179
+ createAiRouteRequest(properties: CreateAiRouteRequestProperties, options?: {
180
+ journeyId?: string;
181
+ stageKey?: string;
182
+ }): ActionBuilder;
183
+ }
184
+ /** Type guard to check if an object is a AiRouteRequestRecord */
185
+ export declare function isAiRouteRequestRecord(obj: any): obj is AiRouteRequestRecord;
186
+ export {};
@@ -0,0 +1,245 @@
1
+ "use strict";
2
+ /**
3
+ * AiRouteRequest Record Wrapper
4
+ *
5
+ * Provides typed action methods and link management.
6
+ * Works with both ApiProvider and DbProvider.
7
+ *
8
+ * All action methods return an ActionBuilder or FlowBuilder.
9
+ * Call .execute() to run or .dryRun() to get the payload for debugging.
10
+ *
11
+ * Can be instantiated with null record for create operations:
12
+ * ```typescript
13
+ * const record = odinClient.aiRouteRequests.new();
14
+ * await record.createAiRouteRequest({ ... }).execute();
15
+ * ```
16
+ *
17
+ * Entity Types: DEFAULT
18
+ *
19
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
20
+ */
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.isAiRouteRequestRecord = exports.AiRouteRequestRecord = void 0;
32
+ const uuid_1 = require("uuid");
33
+ const core_1 = require("@d19n/odin-types/dist/core");
34
+ /**
35
+ * Builder for action execution with dryRun support
36
+ *
37
+ * Provides a consistent API across all action types:
38
+ * - `.execute()` - Execute the action and return results
39
+ * - `.dryRun()` - Return the payload without executing (for debugging)
40
+ */
41
+ class ActionBuilder {
42
+ constructor(provider, moduleName, entityName, payload, clearPendingLinks) {
43
+ this._provider = provider;
44
+ this._moduleName = moduleName;
45
+ this._entityName = entityName;
46
+ this._payload = payload;
47
+ this._clearPendingLinks = clearPendingLinks;
48
+ }
49
+ /**
50
+ * Set an external system identifier for this record.
51
+ * Links the record to a corresponding entry in an external application.
52
+ *
53
+ * @param externalId - The ID in the external system
54
+ * @param externalAppId - The external application identifier
55
+ * @returns this (for chaining)
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
60
+ * ```
61
+ */
62
+ withExternalId(externalId, externalAppId) {
63
+ this._payload.externalId = externalId;
64
+ this._payload.externalAppId = externalAppId;
65
+ return this;
66
+ }
67
+ /**
68
+ * Set security/access groups for this record.
69
+ * Controls which user groups can access the record.
70
+ *
71
+ * @param groups - Array of group names
72
+ * @returns this (for chaining)
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
77
+ * ```
78
+ */
79
+ withGroups(groups) {
80
+ this._payload.groups = groups;
81
+ return this;
82
+ }
83
+ /**
84
+ * Execute the action
85
+ * @returns The result from the API
86
+ */
87
+ execute() {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ const result = yield this._provider._applyAction(this._moduleName, this._entityName, this._payload);
90
+ this._clearPendingLinks();
91
+ return result;
92
+ });
93
+ }
94
+ /**
95
+ * Returns the request payload without executing (for debugging)
96
+ * @returns The request payload that would be sent to the API
97
+ */
98
+ dryRun() {
99
+ return this._payload;
100
+ }
101
+ /**
102
+ * Prevents accidental `await actionBuilder` without .execute()
103
+ * Forces developers to explicitly call .execute()
104
+ * @throws Error always - use .execute() or .dryRun() instead
105
+ */
106
+ then() {
107
+ throw new Error('ActionBuilder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
108
+ }
109
+ }
110
+ class AiRouteRequestRecord {
111
+ /**
112
+ * Create a record wrapper.
113
+ * @param record - The underlying record, or null for create operations
114
+ * @param provider - The API or DB provider
115
+ * @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
116
+ */
117
+ constructor(record, provider, preGeneratedId) {
118
+ this._pendingLinks = [];
119
+ this._record = record;
120
+ this._provider = provider;
121
+ this._preGeneratedId = preGeneratedId !== null && preGeneratedId !== void 0 ? preGeneratedId : (0, uuid_1.v4)();
122
+ }
123
+ // ============================================
124
+ // CORE PROPERTIES
125
+ // ============================================
126
+ /** Returns true if this is a new (unsaved) record */
127
+ get isNew() { var _a; return !((_a = this._record) === null || _a === void 0 ? void 0 : _a.id); }
128
+ /** Record ID - always available (pre-generated for new records) */
129
+ get id() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this._preGeneratedId; }
130
+ get entity() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.entity) !== null && _b !== void 0 ? _b : 'SupportModule:AiRouteRequest'; }
131
+ get type() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.type; }
132
+ /** Record properties - empty object for new (unsaved) records */
133
+ get properties() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.properties) || {}; }
134
+ get title() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.title; }
135
+ get recordNumber() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.recordNumber; }
136
+ get stage() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.stage; }
137
+ get createdAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.createdAt; }
138
+ get updatedAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.updatedAt; }
139
+ get externalId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalId; }
140
+ get externalAppId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalAppId; }
141
+ get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
142
+ /** Link metadata - populated only when the read passed withLinks (empty otherwise) */
143
+ get links() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.links) !== null && _b !== void 0 ? _b : []; }
144
+ /** Access the underlying OdinRecord (null for new records) */
145
+ get record() { return this._record; }
146
+ // ============================================
147
+ // TYPE GUARDS (with TypeScript type predicates)
148
+ // ============================================
149
+ /**
150
+ * Type guard: check if this record is of type DEFAULT
151
+ *
152
+ * When this returns true, TypeScript automatically narrows the type,
153
+ * giving you access to DEFAULT-specific properties.
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * if (record.isDefault()) {
158
+ * // TypeScript knows record.properties is AiRouteRequestProperties
159
+ * console.log(record.properties.SomeTypeSpecificField);
160
+ * }
161
+ * ```
162
+ * @remarks This is the default record type
163
+ */
164
+ isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
165
+ // ============================================
166
+ // LINK MANAGEMENT
167
+ // ============================================
168
+ /**
169
+ * Queue a link to be created with the next action.
170
+ * Works for both create and update actions.
171
+ * @returns this (for chaining)
172
+ */
173
+ link(target) {
174
+ this._pendingLinks.push(new core_1.OdinRecordLinkDto({ id: target.id, entity: target.entity }));
175
+ return this;
176
+ }
177
+ /** Get the currently queued links */
178
+ get pendingLinks() {
179
+ return [...this._pendingLinks];
180
+ }
181
+ /** Clear pending links without executing an action */
182
+ clearPendingLinks() {
183
+ this._pendingLinks = [];
184
+ return this;
185
+ }
186
+ /**
187
+ * Immediately unlink a record (API call).
188
+ * Unlike link(), this executes immediately.
189
+ * @throws Error if called on a new (unsaved) record
190
+ */
191
+ unlink(target) {
192
+ var _a;
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
195
+ throw new Error('Cannot unlink from a new (unsaved) record');
196
+ const targetId = typeof target === 'string' ? target : target.id;
197
+ yield this._provider._deleteLinks('SupportModule', 'AiRouteRequest', this._record.id, targetId);
198
+ });
199
+ }
200
+ // ============================================
201
+ // CREATE ACTIONS (no existing record required)
202
+ // ============================================
203
+ /**
204
+ * CreateAiRouteRequest
205
+ *
206
+ * Creates a new AiRouteRequest record with the specified properties.
207
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
208
+ *
209
+ * @remarks Record type: DEFAULT
210
+ *
211
+ * @param properties - The properties for the new record
212
+ * @param options - Optional settings
213
+ * @param options.journeyId - Associate with a journey
214
+ * @param options.stageKey - Set initial pipeline stage
215
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * // Create with properties
220
+ * const record = odinClient.aiRouteRequests.new();
221
+ * await record.createAiRouteRequest({ ... }).execute();
222
+ *
223
+ * // Dry run (for debugging)
224
+ * const payload = record.createAiRouteRequest({ ... }).dryRun();
225
+ * ```
226
+ */
227
+ createAiRouteRequest(properties, options) {
228
+ const payload = {
229
+ entity: 'SupportModule:AiRouteRequest',
230
+ type: 'DEFAULT',
231
+ actionName: 'CreateAiRouteRequest',
232
+ properties: properties || {},
233
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
234
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
235
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
236
+ };
237
+ return new ActionBuilder(this._provider, 'SupportModule', 'AiRouteRequest', payload, () => { this._pendingLinks = []; });
238
+ }
239
+ }
240
+ exports.AiRouteRequestRecord = AiRouteRequestRecord;
241
+ /** Type guard to check if an object is a AiRouteRequestRecord */
242
+ function isAiRouteRequestRecord(obj) {
243
+ return obj instanceof AiRouteRequestRecord;
244
+ }
245
+ exports.isAiRouteRequestRecord = isAiRouteRequestRecord;
@@ -22,6 +22,7 @@ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
22
22
  import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
23
23
  import { AppointmentProperties } from '../entities-v2/Appointment';
24
24
  import { CreateAppointmentProperties } from '../actions-v2/CreateAppointmentDto';
25
+ import { UpdateAppointmentSalesAppProperties } from '../actions-v2/UpdateAppointmentSalesAppDto';
25
26
  import { FileRecord } from './FileRecord';
26
27
  import { NoteRecord } from './NoteRecord';
27
28
  import { LeadRecord } from './LeadRecord';
@@ -301,6 +302,33 @@ export declare class AppointmentRecord<TProps = AppointmentProperties> {
301
302
  journeyId?: string;
302
303
  stageKey?: string;
303
304
  }): ActionBuilder;
305
+ /**
306
+ * UpdateAppointmentSalesApp
307
+ *
308
+ * Updates this Appointment record.
309
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
310
+ *
311
+ * @param propertiesOrOptions - Properties to update, or options object
312
+ * @param options - Optional settings (journeyId, stageKey)
313
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
314
+ * @throws Error if called on a new (unsaved) record
315
+ *
316
+ * @example
317
+ * ```typescript
318
+ * const record = await odinClient.appointments.get(id);
319
+ * await record.updateAppointmentSalesApp({ ... }).execute();
320
+ *
321
+ * // Dry run (for debugging)
322
+ * const payload = record.updateAppointmentSalesApp({ ... }).dryRun();
323
+ * ```
324
+ */
325
+ updateAppointmentSalesApp(propertiesOrOptions?: UpdateAppointmentSalesAppProperties | {
326
+ journeyId?: string;
327
+ stageKey?: string;
328
+ }, options?: {
329
+ journeyId?: string;
330
+ stageKey?: string;
331
+ }): ActionBuilder;
304
332
  }
305
333
  /** Type guard to check if an object is a AppointmentRecord */
306
334
  export declare function isAppointmentRecord(obj: any): obj is AppointmentRecord;