@d19n/youfibre-odin-sdk 2.0.122 → 2.0.124

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 (60) hide show
  1. package/README.md +6 -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/YfFieldServiceVisitAccessor.d.ts +111 -0
  9. package/dist/accessors-v2/YfFieldServiceVisitAccessor.js +190 -0
  10. package/dist/accessors-v2/index.d.ts +1 -0
  11. package/dist/accessors-v2/index.js +3 -1
  12. package/dist/actions-v2/CompleteServiceWorkOrderFlowDto.d.ts +1026 -3
  13. package/dist/actions-v2/CompleteServiceWorkOrderFlowDto.js +115 -2
  14. package/dist/actions-v2/CreateContactDto.d.ts +7 -7
  15. package/dist/actions-v2/CreateInboundCallDto.d.ts +33 -1
  16. package/dist/actions-v2/CreateLeadFromAddressDto.d.ts +7 -7
  17. package/dist/actions-v2/MoveCaseToClosedWithAdditionalNoteDto.d.ts +172 -0
  18. package/dist/actions-v2/MoveCaseToClosedWithAdditionalNoteDto.js +122 -0
  19. package/dist/actions-v2/UpdateAdditionalCareDto.d.ts +28 -29
  20. package/dist/actions-v2/UpdateAdditionalNoteDto.d.ts +73 -0
  21. package/dist/actions-v2/UpdateAdditionalNoteDto.js +56 -0
  22. package/dist/actions-v2/UpdateContactDto.d.ts +28 -29
  23. package/dist/api-sdk-v2/AddressApi.d.ts +2 -0
  24. package/dist/api-sdk-v2/AddressApi.js +6 -0
  25. package/dist/api-sdk-v2/ContactApi.d.ts +2 -2
  26. package/dist/api-sdk-v2/ContactApi.js +6 -6
  27. package/dist/api-sdk-v2/YfFieldServiceVisitApi.d.ts +2 -0
  28. package/dist/api-sdk-v2/YfFieldServiceVisitApi.js +6 -0
  29. package/dist/db-accessors-v2/YfFieldServiceVisitDbAccessor.d.ts +149 -0
  30. package/dist/db-accessors-v2/YfFieldServiceVisitDbAccessor.js +227 -0
  31. package/dist/db-accessors-v2/index.d.ts +1 -0
  32. package/dist/db-accessors-v2/index.js +3 -1
  33. package/dist/db-sdk-v2/AddressDb.d.ts +2 -0
  34. package/dist/db-sdk-v2/AddressDb.js +6 -0
  35. package/dist/db-sdk-v2/ContactDb.d.ts +2 -2
  36. package/dist/db-sdk-v2/ContactDb.js +6 -6
  37. package/dist/db-sdk-v2/YfFieldServiceVisitDb.d.ts +2 -0
  38. package/dist/db-sdk-v2/YfFieldServiceVisitDb.js +6 -0
  39. package/dist/entities-v2/Address.d.ts +3 -0
  40. package/dist/entities-v2/Contact.d.ts +88 -89
  41. package/dist/entities-v2/Contact.js +58 -59
  42. package/dist/entities-v2/YfFieldServiceVisit.d.ts +20 -13
  43. package/dist/entities-v2/YfFieldServiceVisit.js +7 -3
  44. package/dist/records-v2/AddressRecord.d.ts +20 -0
  45. package/dist/records-v2/AddressRecord.js +33 -0
  46. package/dist/records-v2/CaseRecord.d.ts +113 -0
  47. package/dist/records-v2/CaseRecord.js +164 -1
  48. package/dist/records-v2/ContactRecord.d.ts +20 -20
  49. package/dist/records-v2/ContactRecord.js +33 -33
  50. package/dist/records-v2/FileRecord.d.ts +20 -0
  51. package/dist/records-v2/FileRecord.js +33 -0
  52. package/dist/records-v2/NoteRecord.d.ts +20 -0
  53. package/dist/records-v2/NoteRecord.js +33 -0
  54. package/dist/records-v2/WorkOrderRecord.d.ts +98 -8
  55. package/dist/records-v2/WorkOrderRecord.js +169 -10
  56. package/dist/records-v2/YfFieldServiceVisitRecord.d.ts +265 -0
  57. package/dist/records-v2/YfFieldServiceVisitRecord.js +379 -0
  58. package/dist/records-v2/index.d.ts +1 -0
  59. package/dist/records-v2/index.js +8 -5
  60. package/package.json +1 -1
@@ -47,6 +47,7 @@ const OneTouchSwitchRecord_1 = require("./OneTouchSwitchRecord");
47
47
  const CaseRecord_1 = require("./CaseRecord");
48
48
  const CrmDatasetRecord_1 = require("./CrmDatasetRecord");
49
49
  const AddressInteractionRecord_1 = require("./AddressInteractionRecord");
50
+ const YfFieldServiceVisitRecord_1 = require("./YfFieldServiceVisitRecord");
50
51
  /**
51
52
  * Builder for action execution with dryRun support
52
53
  *
@@ -788,6 +789,36 @@ class AddressRecord {
788
789
  }
789
790
  return this._addressInteractions;
790
791
  }
792
+ /**
793
+ * Access linked YfFieldServiceVisit records
794
+ * @remarks Available labels: YfFieldServiceVisit__ Address
795
+ * @throws Error if called on a new (unsaved) record
796
+ *
797
+ * @example
798
+ * ```typescript
799
+ * // Get all linked YfFieldServiceVisit records
800
+ * const items = await record.yfFieldServiceVisits.list();
801
+ * const first = await record.yfFieldServiceVisits.first();
802
+ *
803
+ * // Filter by label
804
+ * const specific = await record.yfFieldServiceVisits.first({ label: 'YfFieldServiceVisit__ Address' });
805
+ * ```
806
+ */
807
+ get yfFieldServiceVisits() {
808
+ var _a;
809
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
810
+ throw new Error('Cannot access links on a new (unsaved) record');
811
+ if (!this._yfFieldServiceVisits) {
812
+ this._yfFieldServiceVisits = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
813
+ sourceEntity: 'CrmModule:Address',
814
+ targetEntity: 'FieldServiceModule:YfFieldServiceVisit',
815
+ targetModuleName: 'FieldServiceModule',
816
+ targetEntityName: 'YfFieldServiceVisit',
817
+ labels: ['YfFieldServiceVisit__ Address'],
818
+ }, YfFieldServiceVisitRecord_1.YfFieldServiceVisitRecord);
819
+ }
820
+ return this._yfFieldServiceVisits;
821
+ }
791
822
  // ============================================
792
823
  // LINK MANAGEMENT
793
824
  // ============================================
@@ -1031,6 +1062,8 @@ AddressRecord.casesLabels = ['Case__Address'];
1031
1062
  AddressRecord.crmDatasetsLabels = ['CrmDataset__Address'];
1032
1063
  /** Valid labels for AddressInteraction associations */
1033
1064
  AddressRecord.addressInteractionsLabels = ['AddressInteraction__Address'];
1065
+ /** Valid labels for YfFieldServiceVisit associations */
1066
+ AddressRecord.yfFieldServiceVisitsLabels = ['YfFieldServiceVisit__ Address'];
1034
1067
  /** Type guard to check if an object is a AddressRecord */
1035
1068
  function isAddressRecord(obj) {
1036
1069
  return obj instanceof AddressRecord;
@@ -42,6 +42,7 @@ import { MarkCaseClosedProperties } from '../actions-v2/MarkCaseClosedDto';
42
42
  import { MarkCaseResolvedProperties } from '../actions-v2/MarkCaseResolvedDto';
43
43
  import { MoveCaseOutageToSolvedAction2Properties } from '../actions-v2/MoveCaseOutageToSolvedAction2Dto';
44
44
  import { MoveCaseOutageToSolvedActionProperties } from '../actions-v2/MoveCaseOutageToSolvedActionDto';
45
+ import { UpdateAdditionalNoteProperties } from '../actions-v2/MoveCaseToClosedWithAdditionalNoteDto';
45
46
  import { MoveCaseToSolvedActionProperties } from '../actions-v2/MoveCaseToSolvedActionDto';
46
47
  import { RemoveAssignmentFromCaseProperties } from '../actions-v2/RemoveAssignmentFromCaseDto';
47
48
  import { UpdateCaseCsatProperties } from '../actions-v2/UpdateCaseCsatDto';
@@ -1104,6 +1105,68 @@ export declare class MoveCaseToBlockedTransitionFlowBuilder {
1104
1105
  private _buildRequestPayload;
1105
1106
  }
1106
1107
  /** Options for a flow step */
1108
+ export interface MoveCaseToClosedWithAdditionalNoteFlowBuilderStepOptions {
1109
+ /** Associations to create with this step */
1110
+ associations?: Array<{
1111
+ recordId?: string;
1112
+ entity?: string;
1113
+ }>;
1114
+ /** Groups for this step */
1115
+ groups?: string[];
1116
+ }
1117
+ /**
1118
+ * FlowBuilder for MoveCaseToClosedWithAdditionalNote multi-step action
1119
+ *
1120
+ * Use method chaining to add steps, then call execute() to run the flow.
1121
+ * Transitions to stage: CaseDefaultStageClosed
1122
+ */
1123
+ export declare class MoveCaseToClosedWithAdditionalNoteFlowBuilder {
1124
+ private _record;
1125
+ private _provider;
1126
+ private _pendingLinks;
1127
+ private _options?;
1128
+ private _groups;
1129
+ private _steps;
1130
+ constructor(record: CaseRecord<any>, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
1131
+ journeyId?: string;
1132
+ });
1133
+ /**
1134
+ * Add a group to the main action
1135
+ * @param group - Group name to add
1136
+ * @returns this (for method chaining)
1137
+ */
1138
+ addGroup(group: string): this;
1139
+ /**
1140
+ * Add UpdateAdditionalNote step to the flow
1141
+ * @param id - ID of the record to update
1142
+ * @param properties - Properties for this step
1143
+ * @param options - Optional step settings
1144
+ * @returns this (for method chaining)
1145
+ */
1146
+ updateAdditionalNote(id: string, properties: UpdateAdditionalNoteProperties, options?: MoveCaseToClosedWithAdditionalNoteFlowBuilderStepOptions): this;
1147
+ /**
1148
+ * Execute the flow
1149
+ * @returns The result from the API
1150
+ */
1151
+ execute(): Promise<IDbRecordCreateUpdateRes[]>;
1152
+ /**
1153
+ * Returns the request payload without executing (for debugging)
1154
+ * @returns The request payload that would be sent to the API
1155
+ */
1156
+ dryRun(): Record<string, any>;
1157
+ /**
1158
+ * Prevents accidental `await flowBuilder` without .execute()
1159
+ * Forces developers to explicitly call .execute()
1160
+ * @throws Error always - use .execute() or .dryRun() instead
1161
+ */
1162
+ then(): never;
1163
+ /**
1164
+ * Build the request payload for the action
1165
+ * @private
1166
+ */
1167
+ private _buildRequestPayload;
1168
+ }
1169
+ /** Options for a flow step */
1107
1170
  export interface MoveDefaultCaseFromOpenToClosedFlowBuilderStepOptions {
1108
1171
  /** Associations to create with this step */
1109
1172
  associations?: Array<{
@@ -2488,6 +2551,56 @@ export declare class CaseRecord<TProps = CaseProperties> {
2488
2551
  moveCaseToBlockedTransition(options?: {
2489
2552
  journeyId?: string;
2490
2553
  }): MoveCaseToBlockedTransitionFlowBuilder;
2554
+ /**
2555
+ * UpdateAdditionalNote
2556
+ *
2557
+ * Updates this Case record with the specified properties.
2558
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
2559
+ *
2560
+ * @param properties - Required properties for this action
2561
+ * @param options - Optional settings
2562
+ * @param options.journeyId - Associate with a journey
2563
+ * @param options.stageKey - Transition to pipeline stage
2564
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
2565
+ * @throws Error if called on a new (unsaved) record
2566
+ *
2567
+ * @example
2568
+ * ```typescript
2569
+ * const record = await odinClient.cases.get(id);
2570
+ * await record.updateAdditionalNote({ ... }).execute();
2571
+ *
2572
+ * // Dry run (for debugging)
2573
+ * const payload = record.updateAdditionalNote({ ... }).dryRun();
2574
+ * ```
2575
+ */
2576
+ updateAdditionalNote(properties: UpdateAdditionalNoteProperties, options?: {
2577
+ journeyId?: string;
2578
+ stageKey?: string;
2579
+ }): ActionBuilder;
2580
+ /**
2581
+ * MoveCaseToClosedWithAdditionalNote
2582
+ *
2583
+ * Starts a stage transition flow on this Case record.
2584
+ * Chain step methods and call .execute() to run the flow.
2585
+ *
2586
+ * @remarks Transitions to stage: CaseDefaultStageClosed
2587
+ *
2588
+ * @param options - Optional settings
2589
+ * @param options.journeyId - Associate with a journey
2590
+ * @returns FlowBuilder for chaining step methods
2591
+ * @throws Error if called on a new (unsaved) record
2592
+ *
2593
+ * @example
2594
+ * ```typescript
2595
+ * const record = await odinClient.cases.get(id);
2596
+ * await record.moveCaseToClosedWithAdditionalNote()
2597
+ * .updateAdditionalNote(recordId, { ... })
2598
+ * .execute();
2599
+ * ```
2600
+ */
2601
+ moveCaseToClosedWithAdditionalNote(options?: {
2602
+ journeyId?: string;
2603
+ }): MoveCaseToClosedWithAdditionalNoteFlowBuilder;
2491
2604
  /**
2492
2605
  * MoveCaseToPendingAgentTransition
2493
2606
  *
@@ -28,7 +28,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
28
28
  });
29
29
  };
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.isCaseRecord = exports.CaseRecord = exports.MoveDefaultCaseFromOpenToClosedFlowBuilder = exports.MoveCaseToBlockedTransitionFlowBuilder = exports.EscalateCaseTransitionFlowBuilder = exports.CasteTransitionOpenToEscalatedFlowBuilder = exports.CasedefaultstageblockedFlowBuilder = exports.CaseTransitionSolvedToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToBlockedFlowBuilder = exports.CaseTransitionPendingAgentToEscalatedFlowBuilder = exports.CaseTransitionPendingAgentToBlockedFlowBuilder = exports.CaseTransitionOpenToBlockedFlowBuilder = exports.CaseTransitionEscalatedToEscalatedFlowBuilder = exports.CaseTransitionEscalatedToBlockedFlowBuilder = exports.CaseTransitionBlockedToEscalatedFlowBuilder = exports.CaseDefaultStageEscalatedFlowBuilder = exports.AssignCaseWithNoteFlowFlowBuilder = void 0;
31
+ exports.isCaseRecord = exports.CaseRecord = exports.MoveDefaultCaseFromOpenToClosedFlowBuilder = exports.MoveCaseToClosedWithAdditionalNoteFlowBuilder = exports.MoveCaseToBlockedTransitionFlowBuilder = exports.EscalateCaseTransitionFlowBuilder = exports.CasteTransitionOpenToEscalatedFlowBuilder = exports.CasedefaultstageblockedFlowBuilder = exports.CaseTransitionSolvedToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToEscalatedFlowBuilder = exports.CaseTransitionPendingReplyToBlockedFlowBuilder = exports.CaseTransitionPendingAgentToEscalatedFlowBuilder = exports.CaseTransitionPendingAgentToBlockedFlowBuilder = exports.CaseTransitionOpenToBlockedFlowBuilder = exports.CaseTransitionEscalatedToEscalatedFlowBuilder = exports.CaseTransitionEscalatedToBlockedFlowBuilder = exports.CaseTransitionBlockedToEscalatedFlowBuilder = exports.CaseDefaultStageEscalatedFlowBuilder = exports.AssignCaseWithNoteFlowFlowBuilder = void 0;
32
32
  const uuid_1 = require("uuid");
33
33
  const core_1 = require("@d19n/odin-types/dist/core");
34
34
  const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
@@ -1869,6 +1869,113 @@ class MoveCaseToBlockedTransitionFlowBuilder {
1869
1869
  }
1870
1870
  }
1871
1871
  exports.MoveCaseToBlockedTransitionFlowBuilder = MoveCaseToBlockedTransitionFlowBuilder;
1872
+ /**
1873
+ * FlowBuilder for MoveCaseToClosedWithAdditionalNote multi-step action
1874
+ *
1875
+ * Use method chaining to add steps, then call execute() to run the flow.
1876
+ * Transitions to stage: CaseDefaultStageClosed
1877
+ */
1878
+ class MoveCaseToClosedWithAdditionalNoteFlowBuilder {
1879
+ constructor(record, provider, pendingLinks, options) {
1880
+ this._groups = [];
1881
+ this._steps = [];
1882
+ this._record = record;
1883
+ this._provider = provider;
1884
+ this._pendingLinks = pendingLinks;
1885
+ this._options = options;
1886
+ }
1887
+ /**
1888
+ * Add a group to the main action
1889
+ * @param group - Group name to add
1890
+ * @returns this (for method chaining)
1891
+ */
1892
+ addGroup(group) {
1893
+ this._groups.push(group);
1894
+ return this;
1895
+ }
1896
+ /**
1897
+ * Add UpdateAdditionalNote step to the flow
1898
+ * @param id - ID of the record to update
1899
+ * @param properties - Properties for this step
1900
+ * @param options - Optional step settings
1901
+ * @returns this (for method chaining)
1902
+ */
1903
+ updateAdditionalNote(id, properties, options) {
1904
+ var _a;
1905
+ this._steps.push({
1906
+ actionName: 'UpdateAdditionalNote',
1907
+ properties,
1908
+ id,
1909
+ entity: 'SupportModule:Case',
1910
+ autoLinkParent: false,
1911
+ associations: (_a = options === null || options === void 0 ? void 0 : options.associations) === null || _a === void 0 ? void 0 : _a.map(a => (Object.assign(Object.assign({}, a), { linkType: null, relationType: undefined }))),
1912
+ groups: options === null || options === void 0 ? void 0 : options.groups,
1913
+ });
1914
+ return this;
1915
+ }
1916
+ /**
1917
+ * Execute the flow
1918
+ * @returns The result from the API
1919
+ */
1920
+ execute() {
1921
+ return __awaiter(this, void 0, void 0, function* () {
1922
+ const payload = this._buildRequestPayload();
1923
+ const result = yield this._provider._applyAction('SupportModule', 'Case', payload);
1924
+ // Clear pending links on the record after execution
1925
+ this._record.clearPendingLinks();
1926
+ return result;
1927
+ });
1928
+ }
1929
+ /**
1930
+ * Returns the request payload without executing (for debugging)
1931
+ * @returns The request payload that would be sent to the API
1932
+ */
1933
+ dryRun() {
1934
+ return this._buildRequestPayload();
1935
+ }
1936
+ /**
1937
+ * Prevents accidental `await flowBuilder` without .execute()
1938
+ * Forces developers to explicitly call .execute()
1939
+ * @throws Error always - use .execute() or .dryRun() instead
1940
+ */
1941
+ then() {
1942
+ throw new Error('FlowBuilder cannot be awaited directly. Call .execute() to run the flow or .dryRun() to get the payload.');
1943
+ }
1944
+ /**
1945
+ * Build the request payload for the action
1946
+ * @private
1947
+ */
1948
+ _buildRequestPayload() {
1949
+ const record = this._record.record;
1950
+ if (!(record === null || record === void 0 ? void 0 : record.id))
1951
+ throw new Error('Cannot execute flow on unsaved record');
1952
+ // Build steps with parent associations
1953
+ const stepsWithAssociations = this._steps.map(step => {
1954
+ const stepAssociations = [...(step.associations || [])];
1955
+ // Auto-add parent association if step requires it
1956
+ if (step.autoLinkParent) {
1957
+ stepAssociations.push({
1958
+ entity: record.entity,
1959
+ recordId: record.id,
1960
+ linkType: null,
1961
+ relationType: 'PARENT',
1962
+ });
1963
+ }
1964
+ return {
1965
+ entity: step.entity,
1966
+ type: step.type,
1967
+ actionName: step.actionName,
1968
+ properties: step.properties,
1969
+ title: step.title,
1970
+ id: step.id,
1971
+ associations: stepAssociations.length > 0 ? stepAssociations : undefined,
1972
+ groups: step.groups,
1973
+ };
1974
+ });
1975
+ return Object.assign({ id: record.id, entity: record.entity, type: record.type, actionName: 'MoveCaseToClosedWithAdditionalNote', steps: stepsWithAssociations, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, groups: this._groups.length > 0 ? this._groups : undefined, stageKey: 'CaseDefaultStageClosed' }, this._options);
1976
+ }
1977
+ }
1978
+ exports.MoveCaseToClosedWithAdditionalNoteFlowBuilder = MoveCaseToClosedWithAdditionalNoteFlowBuilder;
1872
1979
  /**
1873
1980
  * FlowBuilder for MoveDefaultCaseFromOpenToClosed multi-step action
1874
1981
  *
@@ -3699,6 +3806,62 @@ class CaseRecord {
3699
3806
  throw new Error('moveCaseToBlockedTransition requires an existing record. Use accessor.get() first.');
3700
3807
  return new MoveCaseToBlockedTransitionFlowBuilder(this, this._provider, this._pendingLinks, options);
3701
3808
  }
3809
+ /**
3810
+ * UpdateAdditionalNote
3811
+ *
3812
+ * Updates this Case record with the specified properties.
3813
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
3814
+ *
3815
+ * @param properties - Required properties for this action
3816
+ * @param options - Optional settings
3817
+ * @param options.journeyId - Associate with a journey
3818
+ * @param options.stageKey - Transition to pipeline stage
3819
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
3820
+ * @throws Error if called on a new (unsaved) record
3821
+ *
3822
+ * @example
3823
+ * ```typescript
3824
+ * const record = await odinClient.cases.get(id);
3825
+ * await record.updateAdditionalNote({ ... }).execute();
3826
+ *
3827
+ * // Dry run (for debugging)
3828
+ * const payload = record.updateAdditionalNote({ ... }).dryRun();
3829
+ * ```
3830
+ */
3831
+ updateAdditionalNote(properties, options) {
3832
+ var _a;
3833
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
3834
+ throw new Error('updateAdditionalNote requires an existing record. Use accessor.get() first.');
3835
+ const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateAdditionalNote', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options);
3836
+ return new ActionBuilder(this._provider, 'SupportModule', 'Case', payload, () => { this._pendingLinks = []; });
3837
+ }
3838
+ /**
3839
+ * MoveCaseToClosedWithAdditionalNote
3840
+ *
3841
+ * Starts a stage transition flow on this Case record.
3842
+ * Chain step methods and call .execute() to run the flow.
3843
+ *
3844
+ * @remarks Transitions to stage: CaseDefaultStageClosed
3845
+ *
3846
+ * @param options - Optional settings
3847
+ * @param options.journeyId - Associate with a journey
3848
+ * @returns FlowBuilder for chaining step methods
3849
+ * @throws Error if called on a new (unsaved) record
3850
+ *
3851
+ * @example
3852
+ * ```typescript
3853
+ * const record = await odinClient.cases.get(id);
3854
+ * await record.moveCaseToClosedWithAdditionalNote()
3855
+ * .updateAdditionalNote(recordId, { ... })
3856
+ * .execute();
3857
+ * ```
3858
+ */
3859
+ moveCaseToClosedWithAdditionalNote(options) {
3860
+ var _a;
3861
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
3862
+ throw new Error('moveCaseToClosedWithAdditionalNote requires an existing record. Use accessor.get() first.');
3863
+ return new MoveCaseToClosedWithAdditionalNoteFlowBuilder(this, this._provider, this._pendingLinks, options);
3864
+ }
3702
3865
  /**
3703
3866
  * MoveCaseToPendingAgentTransition
3704
3867
  *
@@ -40,7 +40,6 @@ import { InvoiceRecord } from './InvoiceRecord';
40
40
  import { ContactIdentityRecord } from './ContactIdentityRecord';
41
41
  import { AppointmentRecord } from './AppointmentRecord';
42
42
  import { CaseRecord } from './CaseRecord';
43
- import { AffiliateCodeRecord } from './AffiliateCodeRecord';
44
43
  import { AddressRecord } from './AddressRecord';
45
44
  import { SmsMessageRecord } from './SmsMessageRecord';
46
45
  import { BillingRequestRecord } from './BillingRequestRecord';
@@ -52,6 +51,7 @@ import { ContractBuyOutRecord } from './ContractBuyOutRecord';
52
51
  import { WorkOrderRecord } from './WorkOrderRecord';
53
52
  import { ImpersonationTrackerRecord } from './ImpersonationTrackerRecord';
54
53
  import { AccountCreditRecord } from './AccountCreditRecord';
54
+ import { AffiliateCodeRecord } from './AffiliateCodeRecord';
55
55
  /**
56
56
  * Builder for action execution with dryRun support
57
57
  *
@@ -190,7 +190,6 @@ export declare class ContactRecord<TProps = ContactProperties> {
190
190
  private _contactIdentities?;
191
191
  private _appointments?;
192
192
  private _cases?;
193
- private _affiliateCodes?;
194
193
  private _addresses?;
195
194
  private _smsMessages?;
196
195
  private _billingRequests?;
@@ -203,6 +202,7 @@ export declare class ContactRecord<TProps = ContactProperties> {
203
202
  private _workOrders?;
204
203
  private _impersonationTrackers?;
205
204
  private _accountCredits?;
205
+ private _affiliateCodes?;
206
206
  /**
207
207
  * Create a record wrapper.
208
208
  * @param record - The underlying record, or null for create operations
@@ -480,24 +480,6 @@ export declare class ContactRecord<TProps = ContactProperties> {
480
480
  * ```
481
481
  */
482
482
  get cases(): RecordLinkManager<CaseRecord, typeof ContactRecord['casesLabels'][number]>;
483
- /** Valid labels for AffiliateCode associations */
484
- static readonly affiliateCodesLabels: readonly ["ContactAffiliateCodes"];
485
- /**
486
- * Access linked AffiliateCode records
487
- * @remarks Available labels: ContactAffiliateCodes
488
- * @throws Error if called on a new (unsaved) record
489
- *
490
- * @example
491
- * ```typescript
492
- * // Get all linked AffiliateCode records
493
- * const items = await record.affiliateCodes.list();
494
- * const first = await record.affiliateCodes.first();
495
- *
496
- * // Filter by label
497
- * const specific = await record.affiliateCodes.first({ label: 'ContactAffiliateCodes' });
498
- * ```
499
- */
500
- get affiliateCodes(): RecordLinkManager<AffiliateCodeRecord, typeof ContactRecord['affiliateCodesLabels'][number]>;
501
483
  /** Valid labels for Address associations */
502
484
  static readonly addressesLabels: readonly ["Contact__Address"];
503
485
  /**
@@ -714,6 +696,24 @@ export declare class ContactRecord<TProps = ContactProperties> {
714
696
  * ```
715
697
  */
716
698
  get accountCredits(): RecordLinkManager<AccountCreditRecord, typeof ContactRecord['accountCreditsLabels'][number]>;
699
+ /** Valid labels for AffiliateCode associations */
700
+ static readonly affiliateCodesLabels: readonly ["ContactAffiliateCodes"];
701
+ /**
702
+ * Access linked AffiliateCode records
703
+ * @remarks Available labels: ContactAffiliateCodes
704
+ * @throws Error if called on a new (unsaved) record
705
+ *
706
+ * @example
707
+ * ```typescript
708
+ * // Get all linked AffiliateCode records
709
+ * const items = await record.affiliateCodes.list();
710
+ * const first = await record.affiliateCodes.first();
711
+ *
712
+ * // Filter by label
713
+ * const specific = await record.affiliateCodes.first({ label: 'ContactAffiliateCodes' });
714
+ * ```
715
+ */
716
+ get affiliateCodes(): RecordLinkManager<AffiliateCodeRecord, typeof ContactRecord['affiliateCodesLabels'][number]>;
717
717
  /**
718
718
  * Queue a link to be created with the next action.
719
719
  * Works for both create and update actions.
@@ -44,7 +44,6 @@ const InvoiceRecord_1 = require("./InvoiceRecord");
44
44
  const ContactIdentityRecord_1 = require("./ContactIdentityRecord");
45
45
  const AppointmentRecord_1 = require("./AppointmentRecord");
46
46
  const CaseRecord_1 = require("./CaseRecord");
47
- const AffiliateCodeRecord_1 = require("./AffiliateCodeRecord");
48
47
  const AddressRecord_1 = require("./AddressRecord");
49
48
  const SmsMessageRecord_1 = require("./SmsMessageRecord");
50
49
  const BillingRequestRecord_1 = require("./BillingRequestRecord");
@@ -56,6 +55,7 @@ const ContractBuyOutRecord_1 = require("./ContractBuyOutRecord");
56
55
  const WorkOrderRecord_1 = require("./WorkOrderRecord");
57
56
  const ImpersonationTrackerRecord_1 = require("./ImpersonationTrackerRecord");
58
57
  const AccountCreditRecord_1 = require("./AccountCreditRecord");
58
+ const AffiliateCodeRecord_1 = require("./AffiliateCodeRecord");
59
59
  /**
60
60
  * Builder for action execution with dryRun support
61
61
  *
@@ -689,36 +689,6 @@ class ContactRecord {
689
689
  }
690
690
  return this._cases;
691
691
  }
692
- /**
693
- * Access linked AffiliateCode records
694
- * @remarks Available labels: ContactAffiliateCodes
695
- * @throws Error if called on a new (unsaved) record
696
- *
697
- * @example
698
- * ```typescript
699
- * // Get all linked AffiliateCode records
700
- * const items = await record.affiliateCodes.list();
701
- * const first = await record.affiliateCodes.first();
702
- *
703
- * // Filter by label
704
- * const specific = await record.affiliateCodes.first({ label: 'ContactAffiliateCodes' });
705
- * ```
706
- */
707
- get affiliateCodes() {
708
- var _a;
709
- if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
710
- throw new Error('Cannot access links on a new (unsaved) record');
711
- if (!this._affiliateCodes) {
712
- this._affiliateCodes = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
713
- sourceEntity: 'CrmModule:Contact',
714
- targetEntity: 'CrmModule:AffiliateCode',
715
- targetModuleName: 'CrmModule',
716
- targetEntityName: 'AffiliateCode',
717
- labels: ['ContactAffiliateCodes'],
718
- }, AffiliateCodeRecord_1.AffiliateCodeRecord);
719
- }
720
- return this._affiliateCodes;
721
- }
722
692
  /**
723
693
  * Access linked Address records
724
694
  * @remarks Available labels: Contact__Address
@@ -1079,6 +1049,36 @@ class ContactRecord {
1079
1049
  }
1080
1050
  return this._accountCredits;
1081
1051
  }
1052
+ /**
1053
+ * Access linked AffiliateCode records
1054
+ * @remarks Available labels: ContactAffiliateCodes
1055
+ * @throws Error if called on a new (unsaved) record
1056
+ *
1057
+ * @example
1058
+ * ```typescript
1059
+ * // Get all linked AffiliateCode records
1060
+ * const items = await record.affiliateCodes.list();
1061
+ * const first = await record.affiliateCodes.first();
1062
+ *
1063
+ * // Filter by label
1064
+ * const specific = await record.affiliateCodes.first({ label: 'ContactAffiliateCodes' });
1065
+ * ```
1066
+ */
1067
+ get affiliateCodes() {
1068
+ var _a;
1069
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
1070
+ throw new Error('Cannot access links on a new (unsaved) record');
1071
+ if (!this._affiliateCodes) {
1072
+ this._affiliateCodes = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
1073
+ sourceEntity: 'CrmModule:Contact',
1074
+ targetEntity: 'CrmModule:AffiliateCode',
1075
+ targetModuleName: 'CrmModule',
1076
+ targetEntityName: 'AffiliateCode',
1077
+ labels: ['ContactAffiliateCodes'],
1078
+ }, AffiliateCodeRecord_1.AffiliateCodeRecord);
1079
+ }
1080
+ return this._affiliateCodes;
1081
+ }
1082
1082
  // ============================================
1083
1083
  // LINK MANAGEMENT
1084
1084
  // ============================================
@@ -1307,8 +1307,6 @@ ContactRecord.contactIdentitiesLabels = ['Contact__ContactIdentity'];
1307
1307
  ContactRecord.appointmentsLabels = ['Contact__Appointment'];
1308
1308
  /** Valid labels for Case associations */
1309
1309
  ContactRecord.casesLabels = ['Case__Contact'];
1310
- /** Valid labels for AffiliateCode associations */
1311
- ContactRecord.affiliateCodesLabels = ['ContactAffiliateCodes'];
1312
1310
  /** Valid labels for Address associations */
1313
1311
  ContactRecord.addressesLabels = ['Contact__Address'];
1314
1312
  /** Valid labels for SmsMessage associations */
@@ -1333,6 +1331,8 @@ ContactRecord.workOrdersLabels = ['WorkOrder__Contact', 'WorkOrder__Alternative_
1333
1331
  ContactRecord.impersonationTrackersLabels = ['ImpersonationTracker__Contact'];
1334
1332
  /** Valid labels for AccountCredit associations */
1335
1333
  ContactRecord.accountCreditsLabels = ['Contact__AccountCredit'];
1334
+ /** Valid labels for AffiliateCode associations */
1335
+ ContactRecord.affiliateCodesLabels = ['ContactAffiliateCodes'];
1336
1336
  /** Type guard to check if an object is a ContactRecord */
1337
1337
  function isContactRecord(obj) {
1338
1338
  return obj instanceof ContactRecord;
@@ -57,6 +57,7 @@ import { OrderRecord } from './OrderRecord';
57
57
  import { CallRecord } from './CallRecord';
58
58
  import { OhExternalAuditRecord } from './OhExternalAuditRecord';
59
59
  import { CustomerDeviceOntRecord } from './CustomerDeviceOntRecord';
60
+ import { YfFieldServiceVisitRecord } from './YfFieldServiceVisitRecord';
60
61
  import { BillingAdjustmentRecord } from './BillingAdjustmentRecord';
61
62
  import { ContactRecord } from './ContactRecord';
62
63
  import { MessageRecord } from './MessageRecord';
@@ -160,6 +161,7 @@ export declare class FileRecord<TProps = FileProperties> {
160
161
  private _calls?;
161
162
  private _ohExternalAudits?;
162
163
  private _customerDeviceOnts?;
164
+ private _yfFieldServiceVisits?;
163
165
  private _billingAdjustments?;
164
166
  private _contacts?;
165
167
  private _messages?;
@@ -928,6 +930,24 @@ export declare class FileRecord<TProps = FileProperties> {
928
930
  * ```
929
931
  */
930
932
  get customerDeviceOnts(): RecordLinkManager<CustomerDeviceOntRecord, typeof FileRecord['customerDeviceOntsLabels'][number]>;
933
+ /** Valid labels for YfFieldServiceVisit associations */
934
+ static readonly yfFieldServiceVisitsLabels: readonly ["YfFieldServiceVisit__File"];
935
+ /**
936
+ * Access linked YfFieldServiceVisit records
937
+ * @remarks Available labels: YfFieldServiceVisit__File
938
+ * @throws Error if called on a new (unsaved) record
939
+ *
940
+ * @example
941
+ * ```typescript
942
+ * // Get all linked YfFieldServiceVisit records
943
+ * const items = await record.yfFieldServiceVisits.list();
944
+ * const first = await record.yfFieldServiceVisits.first();
945
+ *
946
+ * // Filter by label
947
+ * const specific = await record.yfFieldServiceVisits.first({ label: 'YfFieldServiceVisit__File' });
948
+ * ```
949
+ */
950
+ get yfFieldServiceVisits(): RecordLinkManager<YfFieldServiceVisitRecord, typeof FileRecord['yfFieldServiceVisitsLabels'][number]>;
931
951
  /** Valid labels for BillingAdjustment associations */
932
952
  static readonly billingAdjustmentsLabels: readonly ["BillingAdjustment__File"];
933
953
  /**
@@ -65,6 +65,7 @@ const OrderRecord_1 = require("./OrderRecord");
65
65
  const CallRecord_1 = require("./CallRecord");
66
66
  const OhExternalAuditRecord_1 = require("./OhExternalAuditRecord");
67
67
  const CustomerDeviceOntRecord_1 = require("./CustomerDeviceOntRecord");
68
+ const YfFieldServiceVisitRecord_1 = require("./YfFieldServiceVisitRecord");
68
69
  const BillingAdjustmentRecord_1 = require("./BillingAdjustmentRecord");
69
70
  const ContactRecord_1 = require("./ContactRecord");
70
71
  const MessageRecord_1 = require("./MessageRecord");
@@ -1317,6 +1318,36 @@ class FileRecord {
1317
1318
  }
1318
1319
  return this._customerDeviceOnts;
1319
1320
  }
1321
+ /**
1322
+ * Access linked YfFieldServiceVisit records
1323
+ * @remarks Available labels: YfFieldServiceVisit__File
1324
+ * @throws Error if called on a new (unsaved) record
1325
+ *
1326
+ * @example
1327
+ * ```typescript
1328
+ * // Get all linked YfFieldServiceVisit records
1329
+ * const items = await record.yfFieldServiceVisits.list();
1330
+ * const first = await record.yfFieldServiceVisits.first();
1331
+ *
1332
+ * // Filter by label
1333
+ * const specific = await record.yfFieldServiceVisits.first({ label: 'YfFieldServiceVisit__File' });
1334
+ * ```
1335
+ */
1336
+ get yfFieldServiceVisits() {
1337
+ var _a;
1338
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
1339
+ throw new Error('Cannot access links on a new (unsaved) record');
1340
+ if (!this._yfFieldServiceVisits) {
1341
+ this._yfFieldServiceVisits = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
1342
+ sourceEntity: 'SchemaModule:File',
1343
+ targetEntity: 'FieldServiceModule:YfFieldServiceVisit',
1344
+ targetModuleName: 'FieldServiceModule',
1345
+ targetEntityName: 'YfFieldServiceVisit',
1346
+ labels: ['YfFieldServiceVisit__File'],
1347
+ }, YfFieldServiceVisitRecord_1.YfFieldServiceVisitRecord);
1348
+ }
1349
+ return this._yfFieldServiceVisits;
1350
+ }
1320
1351
  /**
1321
1352
  * Access linked BillingAdjustment records
1322
1353
  * @remarks Available labels: BillingAdjustment__File
@@ -1612,6 +1643,8 @@ FileRecord.callsLabels = ['Call__File'];
1612
1643
  FileRecord.ohExternalAuditsLabels = ['OhExternalAudit_File'];
1613
1644
  /** Valid labels for CustomerDeviceOnt associations */
1614
1645
  FileRecord.customerDeviceOntsLabels = ['CustomerDeviceOnt__File'];
1646
+ /** Valid labels for YfFieldServiceVisit associations */
1647
+ FileRecord.yfFieldServiceVisitsLabels = ['YfFieldServiceVisit__File'];
1615
1648
  /** Valid labels for BillingAdjustment associations */
1616
1649
  FileRecord.billingAdjustmentsLabels = ['BillingAdjustment__File'];
1617
1650
  /** Valid labels for Contact associations */