@d19n/youfibre-odin-sdk 2.0.382 → 2.0.384

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 (53) hide show
  1. package/README.md +24 -1
  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/TaskAccessor.d.ts +112 -0
  9. package/dist/accessors-v2/TaskAccessor.js +191 -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/CreateCaseWithDpaDto.d.ts +8 -1
  13. package/dist/actions-v2/CreateOtsGainingMatchRequestConfirmedDto.d.ts +135 -0
  14. package/dist/actions-v2/CreateOtsGainingMatchRequestConfirmedDto.js +59 -0
  15. package/dist/actions-v2/CreateOtsGainingMatchRequestFailedDto.d.ts +135 -0
  16. package/dist/actions-v2/CreateOtsGainingMatchRequestFailedDto.js +59 -0
  17. package/dist/actions-v2/MoveTaskToDoneDto.d.ts +67 -0
  18. package/dist/actions-v2/MoveTaskToDoneDto.js +59 -0
  19. package/dist/actions-v2/MoveTaskToInProgressDto.d.ts +67 -0
  20. package/dist/actions-v2/MoveTaskToInProgressDto.js +59 -0
  21. package/dist/actions-v2/MoveTaskToOnHoldDto.d.ts +67 -0
  22. package/dist/actions-v2/MoveTaskToOnHoldDto.js +59 -0
  23. package/dist/actions-v2/MoveTaskToStopDto.d.ts +67 -0
  24. package/dist/actions-v2/MoveTaskToStopDto.js +59 -0
  25. package/dist/actions-v2/MoveTaskToTodoDto.d.ts +67 -0
  26. package/dist/actions-v2/MoveTaskToTodoDto.js +59 -0
  27. package/dist/actions-v2/UpdateAddressAvailabilityChecksDto.d.ts +79 -0
  28. package/dist/actions-v2/UpdateAddressAvailabilityChecksDto.js +56 -0
  29. package/dist/api-sdk-v2/RouterPingSnapshotApi.d.ts +2 -2
  30. package/dist/api-sdk-v2/RouterPingSnapshotApi.js +4 -4
  31. package/dist/db-accessors-v2/TaskDbAccessor.d.ts +180 -0
  32. package/dist/db-accessors-v2/TaskDbAccessor.js +265 -0
  33. package/dist/db-accessors-v2/index.d.ts +1 -0
  34. package/dist/db-accessors-v2/index.js +3 -1
  35. package/dist/db-sdk-v2/RouterPingSnapshotDb.d.ts +2 -2
  36. package/dist/db-sdk-v2/RouterPingSnapshotDb.js +4 -4
  37. package/dist/entities-v2/Address.d.ts +17 -1
  38. package/dist/entities-v2/Address.js +4 -0
  39. package/dist/entities-v2/Case.d.ts +17 -1
  40. package/dist/entities-v2/Case.js +2 -0
  41. package/dist/entities-v2/OrderItem.d.ts +5 -1
  42. package/dist/entities-v2/OrderItem.js +5 -1
  43. package/dist/records-v2/AddressRecord.d.ts +28 -0
  44. package/dist/records-v2/AddressRecord.js +37 -0
  45. package/dist/records-v2/EmailRecord.d.ts +58 -0
  46. package/dist/records-v2/EmailRecord.js +72 -0
  47. package/dist/records-v2/NoteRecord.d.ts +20 -0
  48. package/dist/records-v2/NoteRecord.js +33 -0
  49. package/dist/records-v2/TaskRecord.d.ts +283 -0
  50. package/dist/records-v2/TaskRecord.js +370 -0
  51. package/dist/records-v2/index.d.ts +1 -0
  52. package/dist/records-v2/index.js +5 -2
  53. package/package.json +1 -1
@@ -26,6 +26,7 @@ import { AddressUpdateProperties } from '../actions-v2/AddressUpdateDto';
26
26
  import { BulkUpdateSalesStatusProperties } from '../actions-v2/BulkUpdateSalesStatusDto';
27
27
  import { CreateLeadProperties } from '../actions-v2/CreateLeadFromAddressDto';
28
28
  import { CreateContactProperties } from '../actions-v2/CreateLeadFromAddressDto';
29
+ import { UpdateAddressAvailabilityChecksProperties } from '../actions-v2/UpdateAddressAvailabilityChecksDto';
29
30
  import { UpdateExternalServiceIdProperties } from '../actions-v2/UpdateExternalServiceIdDto';
30
31
  import { FileRecord } from './FileRecord';
31
32
  import { NoteRecord } from './NoteRecord';
@@ -732,6 +733,33 @@ export declare class AddressRecord<TProps = AddressProperties> {
732
733
  createLeadFromAddress(options?: {
733
734
  journeyId?: string;
734
735
  }): CreateLeadFromAddressFlowBuilder;
736
+ /**
737
+ * UpdateAddressAvailabilityChecks
738
+ *
739
+ * Updates this Address record.
740
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
741
+ *
742
+ * @param propertiesOrOptions - Properties to update, or options object
743
+ * @param options - Optional settings (journeyId, stageKey)
744
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
745
+ * @throws Error if called on a new (unsaved) record
746
+ *
747
+ * @example
748
+ * ```typescript
749
+ * const record = await odinClient.addresss.get(id);
750
+ * await record.updateAddressAvailabilityChecks({ ... }).execute();
751
+ *
752
+ * // Dry run (for debugging)
753
+ * const payload = record.updateAddressAvailabilityChecks({ ... }).dryRun();
754
+ * ```
755
+ */
756
+ updateAddressAvailabilityChecks(propertiesOrOptions?: UpdateAddressAvailabilityChecksProperties | {
757
+ journeyId?: string;
758
+ stageKey?: string;
759
+ }, options?: {
760
+ journeyId?: string;
761
+ stageKey?: string;
762
+ }): ActionBuilder;
735
763
  /**
736
764
  * UpdateExternalServiceId
737
765
  *
@@ -1089,6 +1089,43 @@ class AddressRecord {
1089
1089
  createLeadFromAddress(options) {
1090
1090
  return new CreateLeadFromAddressFlowBuilder(this, this._provider, this._pendingLinks, options);
1091
1091
  }
1092
+ /**
1093
+ * UpdateAddressAvailabilityChecks
1094
+ *
1095
+ * Updates this Address record.
1096
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
1097
+ *
1098
+ * @param propertiesOrOptions - Properties to update, or options object
1099
+ * @param options - Optional settings (journeyId, stageKey)
1100
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
1101
+ * @throws Error if called on a new (unsaved) record
1102
+ *
1103
+ * @example
1104
+ * ```typescript
1105
+ * const record = await odinClient.addresss.get(id);
1106
+ * await record.updateAddressAvailabilityChecks({ ... }).execute();
1107
+ *
1108
+ * // Dry run (for debugging)
1109
+ * const payload = record.updateAddressAvailabilityChecks({ ... }).dryRun();
1110
+ * ```
1111
+ */
1112
+ updateAddressAvailabilityChecks(propertiesOrOptions, options) {
1113
+ var _a;
1114
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
1115
+ throw new Error('updateAddressAvailabilityChecks requires an existing record. Use accessor.get() first.');
1116
+ let properties = {};
1117
+ let opts = options;
1118
+ if (propertiesOrOptions) {
1119
+ if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
1120
+ opts = propertiesOrOptions;
1121
+ }
1122
+ else {
1123
+ properties = propertiesOrOptions;
1124
+ }
1125
+ }
1126
+ const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateAddressAvailabilityChecks', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
1127
+ return new ActionBuilder(this._provider, 'CrmModule', 'Address', payload, () => { this._pendingLinks = []; });
1128
+ }
1092
1129
  /**
1093
1130
  * UpdateExternalServiceId
1094
1131
  *
@@ -61,6 +61,8 @@ import { CreateOrderReferralReferrerNotQualifiedEmailProperties } from '../actio
61
61
  import { CreateOrderReferralReferrerPendingEmailProperties } from '../actions-v2/CreateOrderReferralReferrerPendingEmailDto';
62
62
  import { CreateOrderReferralReferrerQualifiedEmailProperties } from '../actions-v2/CreateOrderReferralReferrerQualifiedEmailDto';
63
63
  import { CreateOtsGainingCancellationIssueProperties } from '../actions-v2/CreateOtsGainingCancellationIssueDto';
64
+ import { CreateOtsGainingMatchRequestConfirmedProperties } from '../actions-v2/CreateOtsGainingMatchRequestConfirmedDto';
65
+ import { CreateOtsGainingMatchRequestFailedProperties } from '../actions-v2/CreateOtsGainingMatchRequestFailedDto';
64
66
  import { CreateOtsGainingSwitchCancelledProperties } from '../actions-v2/CreateOtsGainingSwitchCancelledDto';
65
67
  import { CreateOtsGainingSwitchCompleteProperties } from '../actions-v2/CreateOtsGainingSwitchCompleteDto';
66
68
  import { CreateOtsLosingSwitchConfirmationProperties } from '../actions-v2/CreateOtsLosingSwitchConfirmationDto';
@@ -1488,6 +1490,62 @@ export declare class EmailRecord<TProps = EmailProperties> {
1488
1490
  journeyId?: string;
1489
1491
  stageKey?: string;
1490
1492
  }): ActionBuilder;
1493
+ /**
1494
+ * CreateOtsGainingMatchRequestConfirmed
1495
+ *
1496
+ * Creates a new Email record with the specified properties.
1497
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
1498
+ *
1499
+ * @remarks Record type: TRANSACTIONAL
1500
+ *
1501
+ * @param properties - The properties for the new record
1502
+ * @param options - Optional settings
1503
+ * @param options.journeyId - Associate with a journey
1504
+ * @param options.stageKey - Set initial pipeline stage
1505
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
1506
+ *
1507
+ * @example
1508
+ * ```typescript
1509
+ * // Create with properties
1510
+ * const record = odinClient.emails.new();
1511
+ * await record.createOtsGainingMatchRequestConfirmed({ ... }).execute();
1512
+ *
1513
+ * // Dry run (for debugging)
1514
+ * const payload = record.createOtsGainingMatchRequestConfirmed({ ... }).dryRun();
1515
+ * ```
1516
+ */
1517
+ createOtsGainingMatchRequestConfirmed(properties?: CreateOtsGainingMatchRequestConfirmedProperties, options?: {
1518
+ journeyId?: string;
1519
+ stageKey?: string;
1520
+ }): ActionBuilder;
1521
+ /**
1522
+ * CreateOtsGainingMatchRequestFailed
1523
+ *
1524
+ * Creates a new Email record with the specified properties.
1525
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
1526
+ *
1527
+ * @remarks Record type: TRANSACTIONAL
1528
+ *
1529
+ * @param properties - The properties for the new record
1530
+ * @param options - Optional settings
1531
+ * @param options.journeyId - Associate with a journey
1532
+ * @param options.stageKey - Set initial pipeline stage
1533
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
1534
+ *
1535
+ * @example
1536
+ * ```typescript
1537
+ * // Create with properties
1538
+ * const record = odinClient.emails.new();
1539
+ * await record.createOtsGainingMatchRequestFailed({ ... }).execute();
1540
+ *
1541
+ * // Dry run (for debugging)
1542
+ * const payload = record.createOtsGainingMatchRequestFailed({ ... }).dryRun();
1543
+ * ```
1544
+ */
1545
+ createOtsGainingMatchRequestFailed(properties?: CreateOtsGainingMatchRequestFailedProperties, options?: {
1546
+ journeyId?: string;
1547
+ stageKey?: string;
1548
+ }): ActionBuilder;
1491
1549
  /**
1492
1550
  * CreateOtsGainingSwitchCancelled
1493
1551
  *
@@ -1859,6 +1859,78 @@ class EmailRecord {
1859
1859
  };
1860
1860
  return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
1861
1861
  }
1862
+ /**
1863
+ * CreateOtsGainingMatchRequestConfirmed
1864
+ *
1865
+ * Creates a new Email record with the specified properties.
1866
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
1867
+ *
1868
+ * @remarks Record type: TRANSACTIONAL
1869
+ *
1870
+ * @param properties - The properties for the new record
1871
+ * @param options - Optional settings
1872
+ * @param options.journeyId - Associate with a journey
1873
+ * @param options.stageKey - Set initial pipeline stage
1874
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
1875
+ *
1876
+ * @example
1877
+ * ```typescript
1878
+ * // Create with properties
1879
+ * const record = odinClient.emails.new();
1880
+ * await record.createOtsGainingMatchRequestConfirmed({ ... }).execute();
1881
+ *
1882
+ * // Dry run (for debugging)
1883
+ * const payload = record.createOtsGainingMatchRequestConfirmed({ ... }).dryRun();
1884
+ * ```
1885
+ */
1886
+ createOtsGainingMatchRequestConfirmed(properties, options) {
1887
+ const payload = {
1888
+ entity: 'NotificationModule:Email',
1889
+ type: 'TRANSACTIONAL',
1890
+ actionName: 'CreateOtsGainingMatchRequestConfirmed',
1891
+ properties: properties || {},
1892
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
1893
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
1894
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
1895
+ };
1896
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
1897
+ }
1898
+ /**
1899
+ * CreateOtsGainingMatchRequestFailed
1900
+ *
1901
+ * Creates a new Email record with the specified properties.
1902
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
1903
+ *
1904
+ * @remarks Record type: TRANSACTIONAL
1905
+ *
1906
+ * @param properties - The properties for the new record
1907
+ * @param options - Optional settings
1908
+ * @param options.journeyId - Associate with a journey
1909
+ * @param options.stageKey - Set initial pipeline stage
1910
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
1911
+ *
1912
+ * @example
1913
+ * ```typescript
1914
+ * // Create with properties
1915
+ * const record = odinClient.emails.new();
1916
+ * await record.createOtsGainingMatchRequestFailed({ ... }).execute();
1917
+ *
1918
+ * // Dry run (for debugging)
1919
+ * const payload = record.createOtsGainingMatchRequestFailed({ ... }).dryRun();
1920
+ * ```
1921
+ */
1922
+ createOtsGainingMatchRequestFailed(properties, options) {
1923
+ const payload = {
1924
+ entity: 'NotificationModule:Email',
1925
+ type: 'TRANSACTIONAL',
1926
+ actionName: 'CreateOtsGainingMatchRequestFailed',
1927
+ properties: properties || {},
1928
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
1929
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
1930
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
1931
+ };
1932
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
1933
+ }
1862
1934
  /**
1863
1935
  * CreateOtsGainingSwitchCancelled
1864
1936
  *
@@ -33,6 +33,7 @@ import { WorkOrderRecord } from './WorkOrderRecord';
33
33
  import { AppointmentRecord } from './AppointmentRecord';
34
34
  import { WayleaveAuditRecord } from './WayleaveAuditRecord';
35
35
  import { AccountRecord } from './AccountRecord';
36
+ import { TaskRecord } from './TaskRecord';
36
37
  import { FileRecord } from './FileRecord';
37
38
  import { DiscountRecord } from './DiscountRecord';
38
39
  import { BillingAdjustmentRecord } from './BillingAdjustmentRecord';
@@ -141,6 +142,7 @@ export declare class NoteRecord<TProps = NoteProperties> {
141
142
  private _appointments?;
142
143
  private _wayleaveAudits?;
143
144
  private _accounts?;
145
+ private _tasks?;
144
146
  private _files?;
145
147
  private _discounts?;
146
148
  private _billingAdjustments?;
@@ -313,6 +315,24 @@ export declare class NoteRecord<TProps = NoteProperties> {
313
315
  * ```
314
316
  */
315
317
  get accounts(): RecordLinkManager<AccountRecord, typeof NoteRecord['accountsLabels'][number]>;
318
+ /** Valid labels for Task associations */
319
+ static readonly tasksLabels: readonly ["Task__Note"];
320
+ /**
321
+ * Access linked Task records
322
+ * @remarks Available labels: Task__Note
323
+ * @throws Error if called on a new (unsaved) record
324
+ *
325
+ * @example
326
+ * ```typescript
327
+ * // Get all linked Task records
328
+ * const items = await record.tasks.list();
329
+ * const first = await record.tasks.first();
330
+ *
331
+ * // Filter by label
332
+ * const specific = await record.tasks.first({ label: 'Task__Note' });
333
+ * ```
334
+ */
335
+ get tasks(): RecordLinkManager<TaskRecord, typeof NoteRecord['tasksLabels'][number]>;
316
336
  /** Valid labels for File associations */
317
337
  static readonly filesLabels: readonly ["File__Note", "Note__File"];
318
338
  /**
@@ -37,6 +37,7 @@ const WorkOrderRecord_1 = require("./WorkOrderRecord");
37
37
  const AppointmentRecord_1 = require("./AppointmentRecord");
38
38
  const WayleaveAuditRecord_1 = require("./WayleaveAuditRecord");
39
39
  const AccountRecord_1 = require("./AccountRecord");
40
+ const TaskRecord_1 = require("./TaskRecord");
40
41
  const FileRecord_1 = require("./FileRecord");
41
42
  const DiscountRecord_1 = require("./DiscountRecord");
42
43
  const BillingAdjustmentRecord_1 = require("./BillingAdjustmentRecord");
@@ -356,6 +357,36 @@ class NoteRecord {
356
357
  }
357
358
  return this._accounts;
358
359
  }
360
+ /**
361
+ * Access linked Task records
362
+ * @remarks Available labels: Task__Note
363
+ * @throws Error if called on a new (unsaved) record
364
+ *
365
+ * @example
366
+ * ```typescript
367
+ * // Get all linked Task records
368
+ * const items = await record.tasks.list();
369
+ * const first = await record.tasks.first();
370
+ *
371
+ * // Filter by label
372
+ * const specific = await record.tasks.first({ label: 'Task__Note' });
373
+ * ```
374
+ */
375
+ get tasks() {
376
+ var _a;
377
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
378
+ throw new Error('Cannot access links on a new (unsaved) record');
379
+ if (!this._tasks) {
380
+ this._tasks = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
381
+ sourceEntity: 'SupportModule:Note',
382
+ targetEntity: 'ProjectModule:Task',
383
+ targetModuleName: 'ProjectModule',
384
+ targetEntityName: 'Task',
385
+ labels: ['Task__Note'],
386
+ }, TaskRecord_1.TaskRecord);
387
+ }
388
+ return this._tasks;
389
+ }
359
390
  /**
360
391
  * Access linked File records
361
392
  * @remarks Available labels: File__Note, Note__File
@@ -1763,6 +1794,8 @@ NoteRecord.appointmentsLabels = ['Appointment__Note'];
1763
1794
  NoteRecord.wayleaveAuditsLabels = ['WayleaveAudit_Note'];
1764
1795
  /** Valid labels for Account associations */
1765
1796
  NoteRecord.accountsLabels = ['Account__Note'];
1797
+ /** Valid labels for Task associations */
1798
+ NoteRecord.tasksLabels = ['Task__Note'];
1766
1799
  /** Valid labels for File associations */
1767
1800
  NoteRecord.filesLabels = ['File__Note', 'Note__File'];
1768
1801
  /** Valid labels for Discount associations */
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Task 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.tasks.new();
13
+ * await record.createTask({ ... }).execute();
14
+ * ```
15
+ *
16
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
17
+ */
18
+ import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
19
+ import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
20
+ import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
21
+ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
22
+ import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
23
+ import { TaskProperties } from '../entities-v2/Task';
24
+ import { NoteRecord } from './NoteRecord';
25
+ /**
26
+ * Builder for action execution with dryRun support
27
+ *
28
+ * Provides a consistent API across all action types:
29
+ * - `.execute()` - Execute the action and return results
30
+ * - `.dryRun()` - Return the payload without executing (for debugging)
31
+ */
32
+ declare class ActionBuilder<T = IDbRecordCreateUpdateRes[]> {
33
+ private _provider;
34
+ private _moduleName;
35
+ private _entityName;
36
+ private _payload;
37
+ private _clearPendingLinks;
38
+ constructor(provider: IOdinProvider, moduleName: string, entityName: string, payload: Record<string, any>, clearPendingLinks: () => void);
39
+ /**
40
+ * Set an external system identifier for this record.
41
+ * Links the record to a corresponding entry in an external application.
42
+ *
43
+ * @param externalId - The ID in the external system
44
+ * @param externalAppId - The external application identifier
45
+ * @returns this (for chaining)
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
50
+ * ```
51
+ */
52
+ withExternalId(externalId: string, externalAppId: string): this;
53
+ /**
54
+ * Set security/access groups for this record.
55
+ * Controls which user groups can access the record.
56
+ *
57
+ * @param groups - Array of group names
58
+ * @returns this (for chaining)
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
63
+ * ```
64
+ */
65
+ withGroups(groups: string[]): this;
66
+ /**
67
+ * Execute the action
68
+ * @returns The result from the API
69
+ */
70
+ execute(): Promise<T>;
71
+ /**
72
+ * Returns the request payload without executing (for debugging)
73
+ * @returns The request payload that would be sent to the API
74
+ */
75
+ dryRun(): Record<string, any>;
76
+ /**
77
+ * Prevents accidental `await actionBuilder` without .execute()
78
+ * Forces developers to explicitly call .execute()
79
+ * @throws Error always - use .execute() or .dryRun() instead
80
+ */
81
+ then(): never;
82
+ }
83
+ export declare class TaskRecord<TProps = TaskProperties> {
84
+ private _record;
85
+ private _provider;
86
+ private _pendingLinks;
87
+ private _preGeneratedId;
88
+ private _notes?;
89
+ /**
90
+ * Create a record wrapper.
91
+ * @param record - The underlying record, or null for create operations
92
+ * @param provider - The API or DB provider
93
+ * @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
94
+ */
95
+ constructor(record: OdinRecord<TProps> | null, provider: IOdinProvider, preGeneratedId?: string);
96
+ /** Returns true if this is a new (unsaved) record */
97
+ get isNew(): boolean;
98
+ /** Record ID - always available (pre-generated for new records) */
99
+ get id(): string;
100
+ get entity(): string;
101
+ get type(): string | undefined;
102
+ /** Record properties - empty object for new (unsaved) records */
103
+ get properties(): TProps;
104
+ get title(): string | undefined;
105
+ get recordNumber(): string | undefined;
106
+ get stage(): PipelineStageEntity | undefined;
107
+ get createdAt(): string | undefined;
108
+ get updatedAt(): string | undefined;
109
+ get externalId(): string | undefined;
110
+ get externalAppId(): string | undefined;
111
+ get groups(): string[];
112
+ /** Link metadata - populated only when the read passed withLinks (empty otherwise) */
113
+ get links(): OdinRecord<TProps>['links'];
114
+ /** Access the underlying OdinRecord (null for new records) */
115
+ get record(): OdinRecord<TProps> | null;
116
+ /** Valid labels for Note associations */
117
+ static readonly notesLabels: readonly ["Task__Note"];
118
+ /**
119
+ * Access linked Note records
120
+ * @remarks Available labels: Task__Note
121
+ * @throws Error if called on a new (unsaved) record
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * // Get all linked Note records
126
+ * const items = await record.notes.list();
127
+ * const first = await record.notes.first();
128
+ *
129
+ * // Filter by label
130
+ * const specific = await record.notes.first({ label: 'Task__Note' });
131
+ * ```
132
+ */
133
+ get notes(): RecordLinkManager<NoteRecord, typeof TaskRecord['notesLabels'][number]>;
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
+ * MoveTaskToDone
157
+ *
158
+ * Transitions this Task record to a new pipeline stage.
159
+ * Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
160
+ *
161
+ * @remarks Transitions to stage: TaskStageDone
162
+ *
163
+ * @param options - Optional settings
164
+ * @param options.journeyId - Associate with a journey
165
+ * @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
166
+ * @throws Error if called on a new (unsaved) record
167
+ *
168
+ * @example
169
+ * ```typescript
170
+ * const record = await odinClient.tasks.get(id);
171
+ * await record.moveTaskToDone().execute();
172
+ *
173
+ * // Dry run (for debugging)
174
+ * const payload = record.moveTaskToDone().dryRun();
175
+ * ```
176
+ */
177
+ moveTaskToDone(options?: {
178
+ journeyId?: string;
179
+ }): ActionBuilder;
180
+ /**
181
+ * MoveTaskToInProgress
182
+ *
183
+ * Transitions this Task record to a new pipeline stage.
184
+ * Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
185
+ *
186
+ * @remarks Transitions to stage: TaskStageInProgress
187
+ *
188
+ * @param options - Optional settings
189
+ * @param options.journeyId - Associate with a journey
190
+ * @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
191
+ * @throws Error if called on a new (unsaved) record
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * const record = await odinClient.tasks.get(id);
196
+ * await record.moveTaskToInProgress().execute();
197
+ *
198
+ * // Dry run (for debugging)
199
+ * const payload = record.moveTaskToInProgress().dryRun();
200
+ * ```
201
+ */
202
+ moveTaskToInProgress(options?: {
203
+ journeyId?: string;
204
+ }): ActionBuilder;
205
+ /**
206
+ * MoveTaskToOnHold
207
+ *
208
+ * Transitions this Task record to a new pipeline stage.
209
+ * Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
210
+ *
211
+ * @remarks Transitions to stage: TaskStageOnHold
212
+ *
213
+ * @param options - Optional settings
214
+ * @param options.journeyId - Associate with a journey
215
+ * @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
216
+ * @throws Error if called on a new (unsaved) record
217
+ *
218
+ * @example
219
+ * ```typescript
220
+ * const record = await odinClient.tasks.get(id);
221
+ * await record.moveTaskToOnHold().execute();
222
+ *
223
+ * // Dry run (for debugging)
224
+ * const payload = record.moveTaskToOnHold().dryRun();
225
+ * ```
226
+ */
227
+ moveTaskToOnHold(options?: {
228
+ journeyId?: string;
229
+ }): ActionBuilder;
230
+ /**
231
+ * MoveTaskToStop
232
+ *
233
+ * Transitions this Task record to a new pipeline stage.
234
+ * Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
235
+ *
236
+ * @remarks Transitions to stage: ProjectStageStop
237
+ *
238
+ * @param options - Optional settings
239
+ * @param options.journeyId - Associate with a journey
240
+ * @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
241
+ * @throws Error if called on a new (unsaved) record
242
+ *
243
+ * @example
244
+ * ```typescript
245
+ * const record = await odinClient.tasks.get(id);
246
+ * await record.moveTaskToStop().execute();
247
+ *
248
+ * // Dry run (for debugging)
249
+ * const payload = record.moveTaskToStop().dryRun();
250
+ * ```
251
+ */
252
+ moveTaskToStop(options?: {
253
+ journeyId?: string;
254
+ }): ActionBuilder;
255
+ /**
256
+ * MoveTaskToTodo
257
+ *
258
+ * Transitions this Task record to a new pipeline stage.
259
+ * Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
260
+ *
261
+ * @remarks Transitions to stage: TaskStageTodo
262
+ *
263
+ * @param options - Optional settings
264
+ * @param options.journeyId - Associate with a journey
265
+ * @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
266
+ * @throws Error if called on a new (unsaved) record
267
+ *
268
+ * @example
269
+ * ```typescript
270
+ * const record = await odinClient.tasks.get(id);
271
+ * await record.moveTaskToTodo().execute();
272
+ *
273
+ * // Dry run (for debugging)
274
+ * const payload = record.moveTaskToTodo().dryRun();
275
+ * ```
276
+ */
277
+ moveTaskToTodo(options?: {
278
+ journeyId?: string;
279
+ }): ActionBuilder;
280
+ }
281
+ /** Type guard to check if an object is a TaskRecord */
282
+ export declare function isTaskRecord(obj: any): obj is TaskRecord;
283
+ export {};