@d19n/youfibre-odin-sdk 2.0.76 → 2.0.78

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 (141) hide show
  1. package/README.md +10 -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/RegionAccessor.d.ts +111 -0
  9. package/dist/accessors-v2/RegionAccessor.js +190 -0
  10. package/dist/accessors-v2/index.d.ts +1 -0
  11. package/dist/accessors-v2/index.js +4 -2
  12. package/dist/actions-v2/CaseCreateNoteDto.d.ts +7 -0
  13. package/dist/actions-v2/CreateActivityLogEntryDto.d.ts +8 -0
  14. package/dist/actions-v2/CreateAppointmentDto.d.ts +8 -0
  15. package/dist/actions-v2/CreateBillingRequestTransactionDto.d.ts +9 -0
  16. package/dist/actions-v2/CreateBundleProductActionDto.d.ts +8 -0
  17. package/dist/actions-v2/CreateInstallDto.d.ts +9 -10
  18. package/dist/actions-v2/CreateInternetProductActionDto.d.ts +8 -0
  19. package/dist/actions-v2/CreateLaborProductActionDto.d.ts +8 -0
  20. package/dist/actions-v2/CreateLandlineProductActionDto.d.ts +8 -0
  21. package/dist/actions-v2/CreateLeadDto.d.ts +8 -0
  22. package/dist/actions-v2/CreateLeadFromAddressDto.d.ts +8 -0
  23. package/dist/actions-v2/CreateMeshProductActionDto.d.ts +8 -0
  24. package/dist/actions-v2/CreateMessageDto.d.ts +8 -0
  25. package/dist/actions-v2/CreateMobileProductActionDto.d.ts +8 -0
  26. package/dist/actions-v2/CreateOtpTransactionDto.d.ts +9 -0
  27. package/dist/actions-v2/CreatePgContactDto.d.ts +1 -1
  28. package/dist/actions-v2/CreateRegionDto.d.ts +65 -0
  29. package/dist/actions-v2/CreateRegionDto.js +52 -0
  30. package/dist/actions-v2/CreateTelevisionProductActionDto.d.ts +8 -0
  31. package/dist/actions-v2/CreateTransactionalEmailDto.d.ts +14 -0
  32. package/dist/actions-v2/NewAppointmentDto.d.ts +8 -0
  33. package/dist/actions-v2/SendDirectDebitCreatedEmailDto.d.ts +114 -0
  34. package/dist/actions-v2/SendDirectDebitCreatedEmailDto.js +59 -0
  35. package/dist/actions-v2/SendDirectDebitSetupConfirmationEmailDto.d.ts +114 -0
  36. package/dist/actions-v2/SendDirectDebitSetupConfirmationEmailDto.js +59 -0
  37. package/dist/actions-v2/SendRefundTransactionEmailDto.d.ts +109 -0
  38. package/dist/actions-v2/SendRefundTransactionEmailDto.js +54 -0
  39. package/dist/actions-v2/SendTlosNinjaCaseEmailDto.d.ts +7 -0
  40. package/dist/actions-v2/TransactionCreateDto.d.ts +8 -0
  41. package/dist/actions-v2/UpdateBundleProductActionDto.d.ts +8 -0
  42. package/dist/actions-v2/UpdateEmailDto.d.ts +14 -0
  43. package/dist/actions-v2/UpdateInternetProductActionDto.d.ts +8 -0
  44. package/dist/actions-v2/UpdateLaborProductActionDto.d.ts +8 -0
  45. package/dist/actions-v2/UpdateLandlineProductActionDto.d.ts +8 -0
  46. package/dist/actions-v2/UpdateLeadDto.d.ts +8 -0
  47. package/dist/actions-v2/UpdateMeshProductActionDto.d.ts +8 -0
  48. package/dist/actions-v2/UpdateMobileProductActionDto.d.ts +8 -0
  49. package/dist/actions-v2/UpdatePgContactDto.d.ts +1 -1
  50. package/dist/actions-v2/UpdateServiceDto.d.ts +8 -0
  51. package/dist/actions-v2/UpdateSupportEmailDto.d.ts +7 -0
  52. package/dist/actions-v2/UpdateTelevisionProductActionDto.d.ts +8 -0
  53. package/dist/api-sdk-v2/TeamApi.d.ts +2 -2
  54. package/dist/api-sdk-v2/TeamApi.js +6 -6
  55. package/dist/api-sdk-v2/UserApi.d.ts +4 -4
  56. package/dist/api-sdk-v2/UserApi.js +12 -12
  57. package/dist/db-accessors-v2/RegionDbAccessor.d.ts +149 -0
  58. package/dist/db-accessors-v2/RegionDbAccessor.js +227 -0
  59. package/dist/db-accessors-v2/index.d.ts +1 -0
  60. package/dist/db-accessors-v2/index.js +4 -2
  61. package/dist/db-sdk-v2/TeamDb.d.ts +2 -2
  62. package/dist/db-sdk-v2/TeamDb.js +6 -6
  63. package/dist/db-sdk-v2/UserDb.d.ts +4 -4
  64. package/dist/db-sdk-v2/UserDb.js +12 -12
  65. package/dist/entities-v2/Account.d.ts +60 -1
  66. package/dist/entities-v2/Account.js +20 -2
  67. package/dist/entities-v2/ActivityLog.d.ts +26 -1
  68. package/dist/entities-v2/ActivityLog.js +21 -1
  69. package/dist/entities-v2/Address.d.ts +23 -1
  70. package/dist/entities-v2/Address.js +17 -1
  71. package/dist/entities-v2/Appointment.d.ts +22 -1
  72. package/dist/entities-v2/Appointment.js +17 -1
  73. package/dist/entities-v2/Call.d.ts +15 -1
  74. package/dist/entities-v2/Call.js +4 -0
  75. package/dist/entities-v2/ConsumptionSchedule.d.ts +23 -1
  76. package/dist/entities-v2/ConsumptionSchedule.js +17 -1
  77. package/dist/entities-v2/Email.d.ts +45 -1
  78. package/dist/entities-v2/Email.js +4 -0
  79. package/dist/entities-v2/InvoiceItem.d.ts +26 -1
  80. package/dist/entities-v2/InvoiceItem.js +19 -1
  81. package/dist/entities-v2/KnowledgeArticle.d.ts +3 -1
  82. package/dist/entities-v2/KnowledgeArticle.js +2 -0
  83. package/dist/entities-v2/Lead.d.ts +31 -1
  84. package/dist/entities-v2/Lead.js +21 -1
  85. package/dist/entities-v2/Message.d.ts +23 -1
  86. package/dist/entities-v2/Message.js +2 -0
  87. package/dist/entities-v2/Milestone.d.ts +15 -1
  88. package/dist/entities-v2/Milestone.js +11 -1
  89. package/dist/entities-v2/Note.d.ts +8 -1
  90. package/dist/entities-v2/Note.js +2 -0
  91. package/dist/entities-v2/PaymentMethod.d.ts +43 -1
  92. package/dist/entities-v2/PaymentMethod.js +31 -1
  93. package/dist/entities-v2/PgContact.d.ts +8 -8
  94. package/dist/entities-v2/PgContact.js +2 -2
  95. package/dist/entities-v2/Product.d.ts +118 -1
  96. package/dist/entities-v2/Product.js +24 -2
  97. package/dist/entities-v2/ProductComponent.d.ts +27 -1
  98. package/dist/entities-v2/ProductComponent.js +21 -1
  99. package/dist/entities-v2/Program.d.ts +15 -1
  100. package/dist/entities-v2/Program.js +11 -1
  101. package/dist/entities-v2/Project.d.ts +15 -1
  102. package/dist/entities-v2/Project.js +11 -1
  103. package/dist/entities-v2/Restriction.d.ts +23 -1
  104. package/dist/entities-v2/Restriction.js +17 -1
  105. package/dist/entities-v2/Service.d.ts +22 -1
  106. package/dist/entities-v2/Service.js +17 -1
  107. package/dist/entities-v2/ServiceAppointment.d.ts +8 -1
  108. package/dist/entities-v2/ServiceAppointment.js +2 -0
  109. package/dist/entities-v2/ServiceVisitAudit.d.ts +13 -13
  110. package/dist/entities-v2/ServiceVisitAudit.js +2 -2
  111. package/dist/entities-v2/SmsMessage.d.ts +18 -1
  112. package/dist/entities-v2/SmsMessage.js +2 -0
  113. package/dist/entities-v2/Subtask.d.ts +15 -1
  114. package/dist/entities-v2/Subtask.js +11 -1
  115. package/dist/entities-v2/Task.d.ts +15 -1
  116. package/dist/entities-v2/Task.js +11 -1
  117. package/dist/entities-v2/Team.d.ts +3 -3
  118. package/dist/entities-v2/Transaction.d.ts +27 -1
  119. package/dist/entities-v2/Transaction.js +21 -1
  120. package/dist/entities-v2/User.d.ts +6 -6
  121. package/dist/entities-v2/Vendor.d.ts +22 -1
  122. package/dist/entities-v2/Vendor.js +17 -1
  123. package/dist/entities-v2/WorkOrder.d.ts +99 -1
  124. package/dist/entities-v2/WorkOrder.js +2 -0
  125. package/dist/entities-v2/YfStockCount.d.ts +9 -1
  126. package/dist/entities-v2/YfStockCount.js +8 -0
  127. package/dist/records-v2/EmailRecord.d.ts +87 -0
  128. package/dist/records-v2/EmailRecord.js +108 -0
  129. package/dist/records-v2/ExchangeRecord.d.ts +20 -0
  130. package/dist/records-v2/ExchangeRecord.js +33 -0
  131. package/dist/records-v2/RegionRecord.d.ts +205 -0
  132. package/dist/records-v2/RegionRecord.js +292 -0
  133. package/dist/records-v2/ServiceAppointmentConfigRecord.d.ts +20 -0
  134. package/dist/records-v2/ServiceAppointmentConfigRecord.js +33 -0
  135. package/dist/records-v2/TeamRecord.d.ts +20 -20
  136. package/dist/records-v2/TeamRecord.js +33 -33
  137. package/dist/records-v2/UserRecord.d.ts +40 -40
  138. package/dist/records-v2/UserRecord.js +66 -66
  139. package/dist/records-v2/index.d.ts +1 -0
  140. package/dist/records-v2/index.js +5 -2
  141. package/package.json +2 -2
@@ -1003,6 +1003,114 @@ class EmailRecord {
1003
1003
  };
1004
1004
  return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
1005
1005
  }
1006
+ /**
1007
+ * SendDirectDebitCreatedEmail
1008
+ *
1009
+ * Creates a new Email record with the specified properties.
1010
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
1011
+ *
1012
+ * @remarks Record type: TRANSACTIONAL
1013
+ *
1014
+ * @param properties - The properties for the new record
1015
+ * @param options - Optional settings
1016
+ * @param options.journeyId - Associate with a journey
1017
+ * @param options.stageKey - Set initial pipeline stage
1018
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
1019
+ *
1020
+ * @example
1021
+ * ```typescript
1022
+ * // Create with properties
1023
+ * const record = odinClient.emails.new();
1024
+ * await record.sendDirectDebitCreatedEmail({ ... }).execute();
1025
+ *
1026
+ * // Dry run (for debugging)
1027
+ * const payload = record.sendDirectDebitCreatedEmail({ ... }).dryRun();
1028
+ * ```
1029
+ */
1030
+ sendDirectDebitCreatedEmail(properties, options) {
1031
+ const payload = {
1032
+ entity: 'NotificationModule:Email',
1033
+ type: 'TRANSACTIONAL',
1034
+ actionName: 'SendDirectDebitCreatedEmail',
1035
+ properties: properties || {},
1036
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
1037
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
1038
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
1039
+ };
1040
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
1041
+ }
1042
+ /**
1043
+ * SendDirectDebitSetupConfirmationEmail
1044
+ *
1045
+ * Creates a new Email record with the specified properties.
1046
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
1047
+ *
1048
+ * @remarks Record type: TRANSACTIONAL
1049
+ *
1050
+ * @param properties - The properties for the new record
1051
+ * @param options - Optional settings
1052
+ * @param options.journeyId - Associate with a journey
1053
+ * @param options.stageKey - Set initial pipeline stage
1054
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
1055
+ *
1056
+ * @example
1057
+ * ```typescript
1058
+ * // Create with properties
1059
+ * const record = odinClient.emails.new();
1060
+ * await record.sendDirectDebitSetupConfirmationEmail({ ... }).execute();
1061
+ *
1062
+ * // Dry run (for debugging)
1063
+ * const payload = record.sendDirectDebitSetupConfirmationEmail({ ... }).dryRun();
1064
+ * ```
1065
+ */
1066
+ sendDirectDebitSetupConfirmationEmail(properties, options) {
1067
+ const payload = {
1068
+ entity: 'NotificationModule:Email',
1069
+ type: 'TRANSACTIONAL',
1070
+ actionName: 'SendDirectDebitSetupConfirmationEmail',
1071
+ properties: properties || {},
1072
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
1073
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
1074
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
1075
+ };
1076
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
1077
+ }
1078
+ /**
1079
+ * SendRefundTransactionEmail
1080
+ *
1081
+ * Creates a new Email record with the specified properties.
1082
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
1083
+ *
1084
+ * @param properties - The properties for the new record
1085
+ * @param options - Optional settings
1086
+ * @param options.type - Override the record type
1087
+ * @param options.journeyId - Associate with a journey
1088
+ * @param options.stageKey - Set initial pipeline stage
1089
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
1090
+ *
1091
+ * @example
1092
+ * ```typescript
1093
+ * // Create with properties
1094
+ * const record = odinClient.emails.new();
1095
+ * await record.sendRefundTransactionEmail({ ... }).execute();
1096
+ *
1097
+ * // Dry run (for debugging)
1098
+ * const payload = record.sendRefundTransactionEmail({ ... }).dryRun();
1099
+ * ```
1100
+ */
1101
+ sendRefundTransactionEmail(properties, options) {
1102
+ var _a, _b;
1103
+ const payload = {
1104
+ entity: 'NotificationModule:Email',
1105
+ type: (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : (_b = this._record) === null || _b === void 0 ? void 0 : _b.type,
1106
+ actionName: 'SendRefundTransactionEmail',
1107
+ properties: properties || {},
1108
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
1109
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
1110
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
1111
+ };
1112
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
1113
+ }
1006
1114
  /**
1007
1115
  * SendTlosNinjaCaseEmail
1008
1116
  *
@@ -23,6 +23,7 @@ import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-man
23
23
  import { ExchangeProperties } from '../entities-v2/Exchange';
24
24
  import { CreateExchangeProperties } from '../actions-v2/CreateExchangeDto';
25
25
  import { UpdateExchangeProperties } from '../actions-v2/UpdateExchangeDto';
26
+ import { RegionRecord } from './RegionRecord';
26
27
  import { CrmDatasetRecord } from './CrmDatasetRecord';
27
28
  import { SalesTerritoryRecord } from './SalesTerritoryRecord';
28
29
  /**
@@ -88,6 +89,7 @@ export declare class ExchangeRecord<TProps = ExchangeProperties> {
88
89
  private _provider;
89
90
  private _pendingLinks;
90
91
  private _preGeneratedId;
92
+ private _regions?;
91
93
  private _crmDatasets?;
92
94
  private _salesTerritories?;
93
95
  /**
@@ -115,6 +117,24 @@ export declare class ExchangeRecord<TProps = ExchangeProperties> {
115
117
  get groups(): string[];
116
118
  /** Access the underlying OdinRecord (null for new records) */
117
119
  get record(): OdinRecord<TProps> | null;
120
+ /** Valid labels for Region associations */
121
+ static readonly regionsLabels: readonly ["Region__Exchange"];
122
+ /**
123
+ * Access linked Region records
124
+ * @remarks Available labels: Region__Exchange
125
+ * @throws Error if called on a new (unsaved) record
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * // Get all linked Region records
130
+ * const items = await record.regions.list();
131
+ * const first = await record.regions.first();
132
+ *
133
+ * // Filter by label
134
+ * const specific = await record.regions.first({ label: 'Region__Exchange' });
135
+ * ```
136
+ */
137
+ get regions(): RecordLinkManager<RegionRecord, typeof ExchangeRecord['regionsLabels'][number]>;
118
138
  /** Valid labels for CrmDataset associations */
119
139
  static readonly crmDatasetsLabels: readonly ["Exchange__CrmDataset"];
120
140
  /**
@@ -30,6 +30,7 @@ exports.isExchangeRecord = exports.ExchangeRecord = void 0;
30
30
  const uuid_1 = require("uuid");
31
31
  const core_1 = require("@d19n/odin-types/dist/core");
32
32
  const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
33
+ const RegionRecord_1 = require("./RegionRecord");
33
34
  const CrmDatasetRecord_1 = require("./CrmDatasetRecord");
34
35
  const SalesTerritoryRecord_1 = require("./SalesTerritoryRecord");
35
36
  /**
@@ -142,6 +143,36 @@ class ExchangeRecord {
142
143
  get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
143
144
  /** Access the underlying OdinRecord (null for new records) */
144
145
  get record() { return this._record; }
146
+ /**
147
+ * Access linked Region records
148
+ * @remarks Available labels: Region__Exchange
149
+ * @throws Error if called on a new (unsaved) record
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * // Get all linked Region records
154
+ * const items = await record.regions.list();
155
+ * const first = await record.regions.first();
156
+ *
157
+ * // Filter by label
158
+ * const specific = await record.regions.first({ label: 'Region__Exchange' });
159
+ * ```
160
+ */
161
+ get regions() {
162
+ var _a;
163
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
164
+ throw new Error('Cannot access links on a new (unsaved) record');
165
+ if (!this._regions) {
166
+ this._regions = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
167
+ sourceEntity: 'ProjectModule:Exchange',
168
+ targetEntity: 'ProjectModule:Region',
169
+ targetModuleName: 'ProjectModule',
170
+ targetEntityName: 'Region',
171
+ labels: ['Region__Exchange'],
172
+ }, RegionRecord_1.RegionRecord);
173
+ }
174
+ return this._regions;
175
+ }
145
176
  /**
146
177
  * Access linked CrmDataset records
147
178
  * @remarks Available labels: Exchange__CrmDataset
@@ -313,6 +344,8 @@ exports.ExchangeRecord = ExchangeRecord;
313
344
  // ============================================
314
345
  // TYPED LINK ACCESSORS
315
346
  // ============================================
347
+ /** Valid labels for Region associations */
348
+ ExchangeRecord.regionsLabels = ['Region__Exchange'];
316
349
  /** Valid labels for CrmDataset associations */
317
350
  ExchangeRecord.crmDatasetsLabels = ['Exchange__CrmDataset'];
318
351
  /** Valid labels for SalesTerritory associations */
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Region 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.regions.new();
13
+ * await record.createRegion({ ... }).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 { RegionProperties } from '../entities-v2/Region';
24
+ import { CreateRegionProperties } from '../actions-v2/CreateRegionDto';
25
+ import { ExchangeRecord } from './ExchangeRecord';
26
+ import { ServiceAppointmentConfigRecord } from './ServiceAppointmentConfigRecord';
27
+ /**
28
+ * Builder for action execution with dryRun support
29
+ *
30
+ * Provides a consistent API across all action types:
31
+ * - `.execute()` - Execute the action and return results
32
+ * - `.dryRun()` - Return the payload without executing (for debugging)
33
+ */
34
+ declare class ActionBuilder<T = IDbRecordCreateUpdateRes[]> {
35
+ private _provider;
36
+ private _moduleName;
37
+ private _entityName;
38
+ private _payload;
39
+ private _clearPendingLinks;
40
+ constructor(provider: IOdinProvider, moduleName: string, entityName: string, payload: Record<string, any>, clearPendingLinks: () => void);
41
+ /**
42
+ * Set an external system identifier for this record.
43
+ * Links the record to a corresponding entry in an external application.
44
+ *
45
+ * @param externalId - The ID in the external system
46
+ * @param externalAppId - The external application identifier
47
+ * @returns this (for chaining)
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
52
+ * ```
53
+ */
54
+ withExternalId(externalId: string, externalAppId: string): this;
55
+ /**
56
+ * Set security/access groups for this record.
57
+ * Controls which user groups can access the record.
58
+ *
59
+ * @param groups - Array of group names
60
+ * @returns this (for chaining)
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
65
+ * ```
66
+ */
67
+ withGroups(groups: string[]): this;
68
+ /**
69
+ * Execute the action
70
+ * @returns The result from the API
71
+ */
72
+ execute(): Promise<T>;
73
+ /**
74
+ * Returns the request payload without executing (for debugging)
75
+ * @returns The request payload that would be sent to the API
76
+ */
77
+ dryRun(): Record<string, any>;
78
+ /**
79
+ * Prevents accidental `await actionBuilder` without .execute()
80
+ * Forces developers to explicitly call .execute()
81
+ * @throws Error always - use .execute() or .dryRun() instead
82
+ */
83
+ then(): never;
84
+ }
85
+ export declare class RegionRecord<TProps = RegionProperties> {
86
+ private _record;
87
+ private _provider;
88
+ private _pendingLinks;
89
+ private _preGeneratedId;
90
+ private _exchanges?;
91
+ private _serviceAppointmentConfigs?;
92
+ /**
93
+ * Create a record wrapper.
94
+ * @param record - The underlying record, or null for create operations
95
+ * @param provider - The API or DB provider
96
+ * @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
97
+ */
98
+ constructor(record: OdinRecord<TProps> | null, provider: IOdinProvider, preGeneratedId?: string);
99
+ /** Returns true if this is a new (unsaved) record */
100
+ get isNew(): boolean;
101
+ /** Record ID - always available (pre-generated for new records) */
102
+ get id(): string;
103
+ get entity(): string;
104
+ get type(): string | undefined;
105
+ /** Record properties - empty object for new (unsaved) records */
106
+ get properties(): TProps;
107
+ get title(): string | undefined;
108
+ get recordNumber(): string | undefined;
109
+ get stage(): PipelineStageEntity | undefined;
110
+ get createdAt(): string | undefined;
111
+ get updatedAt(): string | undefined;
112
+ get externalId(): string | undefined;
113
+ get externalAppId(): string | undefined;
114
+ get groups(): string[];
115
+ /** Access the underlying OdinRecord (null for new records) */
116
+ get record(): OdinRecord<TProps> | null;
117
+ /** Valid labels for Exchange associations */
118
+ static readonly exchangesLabels: readonly ["Region__Exchange"];
119
+ /**
120
+ * Access linked Exchange records
121
+ * @remarks Available labels: Region__Exchange
122
+ * @throws Error if called on a new (unsaved) record
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * // Get all linked Exchange records
127
+ * const items = await record.exchanges.list();
128
+ * const first = await record.exchanges.first();
129
+ *
130
+ * // Filter by label
131
+ * const specific = await record.exchanges.first({ label: 'Region__Exchange' });
132
+ * ```
133
+ */
134
+ get exchanges(): RecordLinkManager<ExchangeRecord, typeof RegionRecord['exchangesLabels'][number]>;
135
+ /** Valid labels for ServiceAppointmentConfig associations */
136
+ static readonly serviceAppointmentConfigsLabels: readonly ["ServiceAppointmentConfig_Region"];
137
+ /**
138
+ * Access linked ServiceAppointmentConfig records
139
+ * @remarks Available labels: ServiceAppointmentConfig_Region
140
+ * @throws Error if called on a new (unsaved) record
141
+ *
142
+ * @example
143
+ * ```typescript
144
+ * // Get all linked ServiceAppointmentConfig records
145
+ * const items = await record.serviceAppointmentConfigs.list();
146
+ * const first = await record.serviceAppointmentConfigs.first();
147
+ *
148
+ * // Filter by label
149
+ * const specific = await record.serviceAppointmentConfigs.first({ label: 'ServiceAppointmentConfig_Region' });
150
+ * ```
151
+ */
152
+ get serviceAppointmentConfigs(): RecordLinkManager<ServiceAppointmentConfigRecord, typeof RegionRecord['serviceAppointmentConfigsLabels'][number]>;
153
+ /**
154
+ * Queue a link to be created with the next action.
155
+ * Works for both create and update actions.
156
+ * @returns this (for chaining)
157
+ */
158
+ link(target: OdinRecord<any> | {
159
+ id: string;
160
+ entity: string;
161
+ }): this;
162
+ /** Get the currently queued links */
163
+ get pendingLinks(): OdinRecordLinkDto[];
164
+ /** Clear pending links without executing an action */
165
+ clearPendingLinks(): this;
166
+ /**
167
+ * Immediately unlink a record (API call).
168
+ * Unlike link(), this executes immediately.
169
+ * @throws Error if called on a new (unsaved) record
170
+ */
171
+ unlink(target: OdinRecord<any> | {
172
+ id: string;
173
+ } | string): Promise<void>;
174
+ /**
175
+ * CreateRegion
176
+ *
177
+ * Creates a new Region record with the specified properties.
178
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
179
+ *
180
+ * @param properties - The properties for the new record
181
+ * @param options - Optional settings
182
+ * @param options.type - Override the record type
183
+ * @param options.journeyId - Associate with a journey
184
+ * @param options.stageKey - Set initial pipeline stage
185
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * // Create with properties
190
+ * const record = odinClient.regions.new();
191
+ * await record.createRegion({ ... }).execute();
192
+ *
193
+ * // Dry run (for debugging)
194
+ * const payload = record.createRegion({ ... }).dryRun();
195
+ * ```
196
+ */
197
+ createRegion(properties?: CreateRegionProperties, options?: {
198
+ type?: string;
199
+ journeyId?: string;
200
+ stageKey?: string;
201
+ }): ActionBuilder;
202
+ }
203
+ /** Type guard to check if an object is a RegionRecord */
204
+ export declare function isRegionRecord(obj: any): obj is RegionRecord;
205
+ export {};