@d19n/youfibre-odin-sdk 2.0.231 → 2.0.232
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.
- package/README.md +12 -2
- package/dist/EntityRegistry.d.ts +2 -0
- package/dist/EntityRegistry.js +2 -0
- package/dist/OdinApiClient.d.ts +4 -0
- package/dist/OdinApiClient.js +8 -0
- package/dist/OdinDbClient.d.ts +4 -0
- package/dist/OdinDbClient.js +8 -0
- package/dist/accessors-v2/ModifyServiceRequestAccessor.d.ts +111 -0
- package/dist/accessors-v2/ModifyServiceRequestAccessor.js +190 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +5 -3
- package/dist/actions-v2/CreateModifyServiceRequestDto.d.ts +56 -0
- package/dist/actions-v2/CreateModifyServiceRequestDto.js +52 -0
- package/dist/actions-v2/CreateOrderConfirmationDto.d.ts +135 -0
- package/dist/actions-v2/CreateOrderConfirmationDto.js +59 -0
- package/dist/actions-v2/CreateOutboundDialCampaignDto.d.ts +5 -0
- package/dist/actions-v2/CreateOutboundDialCampaignDto.js +6 -1
- package/dist/actions-v2/CreateoutbounddialcampaigncaseDto.d.ts +5 -0
- package/dist/actions-v2/CreateoutbounddialcampaigncaseDto.js +6 -1
- package/dist/actions-v2/DefaultCreateOutboundDialCampaignDto.d.ts +112 -0
- package/dist/actions-v2/DefaultCreateOutboundDialCampaignDto.js +57 -0
- package/dist/actions-v2/DefaultUpdateOutboundDialCampaignDto.d.ts +117 -0
- package/dist/actions-v2/DefaultUpdateOutboundDialCampaignDto.js +59 -0
- package/dist/actions-v2/UpdateCallOnOutboundCallAnsweredDto.d.ts +8 -1
- package/dist/api-sdk-v2/ModifyServiceRequestApi.d.ts +45 -0
- package/dist/api-sdk-v2/ModifyServiceRequestApi.js +151 -0
- package/dist/db-accessors-v2/ModifyServiceRequestDbAccessor.d.ts +149 -0
- package/dist/db-accessors-v2/ModifyServiceRequestDbAccessor.js +227 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +5 -3
- package/dist/db-sdk-v2/ModifyServiceRequestDb.d.ts +117 -0
- package/dist/db-sdk-v2/ModifyServiceRequestDb.js +200 -0
- package/dist/entities-v2/ModifyServiceRequest.d.ts +123 -0
- package/dist/entities-v2/ModifyServiceRequest.js +108 -0
- package/dist/records-v2/EmailRecord.d.ts +29 -0
- package/dist/records-v2/EmailRecord.js +36 -0
- package/dist/records-v2/ModifyServiceRequestRecord.d.ts +184 -0
- package/dist/records-v2/ModifyServiceRequestRecord.js +243 -0
- package/dist/records-v2/OutboundDialCampaignCaseRecord.d.ts +2 -2
- package/dist/records-v2/OutboundDialCampaignCaseRecord.js +3 -3
- package/dist/records-v2/OutboundDialCampaignRecord.d.ts +59 -2
- package/dist/records-v2/OutboundDialCampaignRecord.js +76 -3
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +6 -3
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModifyServiceRequest 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.modifyServiceRequests.new();
|
|
13
|
+
* await record.createModifyServiceRequest({ ... }).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 { ModifyServiceRequestProperties } from '../entities-v2/ModifyServiceRequest';
|
|
25
|
+
import { CreateModifyServiceRequestProperties } from '../actions-v2/CreateModifyServiceRequestDto';
|
|
26
|
+
/** Valid entity types for ModifyServiceRequest */
|
|
27
|
+
export declare type ModifyServiceRequestType = '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 ModifyServiceRequestRecord<TProps = ModifyServiceRequestProperties> {
|
|
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(): ModifyServiceRequestType | 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
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
115
|
+
get record(): OdinRecord<TProps> | null;
|
|
116
|
+
/**
|
|
117
|
+
* Type guard: check if this record is of type DEFAULT
|
|
118
|
+
*
|
|
119
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
120
|
+
* giving you access to DEFAULT-specific properties.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* if (record.isDefault()) {
|
|
125
|
+
* // TypeScript knows record.properties is ModifyServiceRequestProperties
|
|
126
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
* @remarks This is the default record type
|
|
130
|
+
*/
|
|
131
|
+
isDefault(): this is ModifyServiceRequestRecord<ModifyServiceRequestProperties>;
|
|
132
|
+
/**
|
|
133
|
+
* Queue a link to be created with the next action.
|
|
134
|
+
* Works for both create and update actions.
|
|
135
|
+
* @returns this (for chaining)
|
|
136
|
+
*/
|
|
137
|
+
link(target: OdinRecord<any> | {
|
|
138
|
+
id: string;
|
|
139
|
+
entity: string;
|
|
140
|
+
}): this;
|
|
141
|
+
/** Get the currently queued links */
|
|
142
|
+
get pendingLinks(): OdinRecordLinkDto[];
|
|
143
|
+
/** Clear pending links without executing an action */
|
|
144
|
+
clearPendingLinks(): this;
|
|
145
|
+
/**
|
|
146
|
+
* Immediately unlink a record (API call).
|
|
147
|
+
* Unlike link(), this executes immediately.
|
|
148
|
+
* @throws Error if called on a new (unsaved) record
|
|
149
|
+
*/
|
|
150
|
+
unlink(target: OdinRecord<any> | {
|
|
151
|
+
id: string;
|
|
152
|
+
} | string): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* CreateModifyServiceRequest
|
|
155
|
+
*
|
|
156
|
+
* Creates a new ModifyServiceRequest record with the specified properties.
|
|
157
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
158
|
+
*
|
|
159
|
+
* @param properties - The properties for the new record
|
|
160
|
+
* @param options - Optional settings
|
|
161
|
+
* @param options.type - Override the record type
|
|
162
|
+
* @param options.journeyId - Associate with a journey
|
|
163
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
164
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* // Create with properties
|
|
169
|
+
* const record = odinClient.modifyServiceRequests.new();
|
|
170
|
+
* await record.createModifyServiceRequest({ ... }).execute();
|
|
171
|
+
*
|
|
172
|
+
* // Dry run (for debugging)
|
|
173
|
+
* const payload = record.createModifyServiceRequest({ ... }).dryRun();
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
createModifyServiceRequest(properties?: CreateModifyServiceRequestProperties, options?: {
|
|
177
|
+
type?: string;
|
|
178
|
+
journeyId?: string;
|
|
179
|
+
stageKey?: string;
|
|
180
|
+
}): ActionBuilder;
|
|
181
|
+
}
|
|
182
|
+
/** Type guard to check if an object is a ModifyServiceRequestRecord */
|
|
183
|
+
export declare function isModifyServiceRequestRecord(obj: any): obj is ModifyServiceRequestRecord;
|
|
184
|
+
export {};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ModifyServiceRequest 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.modifyServiceRequests.new();
|
|
14
|
+
* await record.createModifyServiceRequest({ ... }).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.isModifyServiceRequestRecord = exports.ModifyServiceRequestRecord = 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 ModifyServiceRequestRecord {
|
|
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 : 'ServiceModule:ModifyServiceRequest'; }
|
|
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
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
143
|
+
get record() { return this._record; }
|
|
144
|
+
// ============================================
|
|
145
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
146
|
+
// ============================================
|
|
147
|
+
/**
|
|
148
|
+
* Type guard: check if this record is of type DEFAULT
|
|
149
|
+
*
|
|
150
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
151
|
+
* giving you access to DEFAULT-specific properties.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* if (record.isDefault()) {
|
|
156
|
+
* // TypeScript knows record.properties is ModifyServiceRequestProperties
|
|
157
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
158
|
+
* }
|
|
159
|
+
* ```
|
|
160
|
+
* @remarks This is the default record type
|
|
161
|
+
*/
|
|
162
|
+
isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
|
|
163
|
+
// ============================================
|
|
164
|
+
// LINK MANAGEMENT
|
|
165
|
+
// ============================================
|
|
166
|
+
/**
|
|
167
|
+
* Queue a link to be created with the next action.
|
|
168
|
+
* Works for both create and update actions.
|
|
169
|
+
* @returns this (for chaining)
|
|
170
|
+
*/
|
|
171
|
+
link(target) {
|
|
172
|
+
this._pendingLinks.push(new core_1.OdinRecordLinkDto({ id: target.id, entity: target.entity }));
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
/** Get the currently queued links */
|
|
176
|
+
get pendingLinks() {
|
|
177
|
+
return [...this._pendingLinks];
|
|
178
|
+
}
|
|
179
|
+
/** Clear pending links without executing an action */
|
|
180
|
+
clearPendingLinks() {
|
|
181
|
+
this._pendingLinks = [];
|
|
182
|
+
return this;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Immediately unlink a record (API call).
|
|
186
|
+
* Unlike link(), this executes immediately.
|
|
187
|
+
* @throws Error if called on a new (unsaved) record
|
|
188
|
+
*/
|
|
189
|
+
unlink(target) {
|
|
190
|
+
var _a;
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
193
|
+
throw new Error('Cannot unlink from a new (unsaved) record');
|
|
194
|
+
const targetId = typeof target === 'string' ? target : target.id;
|
|
195
|
+
yield this._provider._deleteLinks('ServiceModule', 'ModifyServiceRequest', this._record.id, targetId);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// ============================================
|
|
199
|
+
// CREATE ACTIONS (no existing record required)
|
|
200
|
+
// ============================================
|
|
201
|
+
/**
|
|
202
|
+
* CreateModifyServiceRequest
|
|
203
|
+
*
|
|
204
|
+
* Creates a new ModifyServiceRequest record with the specified properties.
|
|
205
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
206
|
+
*
|
|
207
|
+
* @param properties - The properties for the new record
|
|
208
|
+
* @param options - Optional settings
|
|
209
|
+
* @param options.type - Override the record type
|
|
210
|
+
* @param options.journeyId - Associate with a journey
|
|
211
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
212
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* // Create with properties
|
|
217
|
+
* const record = odinClient.modifyServiceRequests.new();
|
|
218
|
+
* await record.createModifyServiceRequest({ ... }).execute();
|
|
219
|
+
*
|
|
220
|
+
* // Dry run (for debugging)
|
|
221
|
+
* const payload = record.createModifyServiceRequest({ ... }).dryRun();
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
createModifyServiceRequest(properties, options) {
|
|
225
|
+
var _a, _b;
|
|
226
|
+
const payload = {
|
|
227
|
+
entity: 'ServiceModule:ModifyServiceRequest',
|
|
228
|
+
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,
|
|
229
|
+
actionName: 'CreateModifyServiceRequest',
|
|
230
|
+
properties: properties || {},
|
|
231
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
232
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
233
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
234
|
+
};
|
|
235
|
+
return new ActionBuilder(this._provider, 'ServiceModule', 'ModifyServiceRequest', payload, () => { this._pendingLinks = []; });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
exports.ModifyServiceRequestRecord = ModifyServiceRequestRecord;
|
|
239
|
+
/** Type guard to check if an object is a ModifyServiceRequestRecord */
|
|
240
|
+
function isModifyServiceRequestRecord(obj) {
|
|
241
|
+
return obj instanceof ModifyServiceRequestRecord;
|
|
242
|
+
}
|
|
243
|
+
exports.isModifyServiceRequestRecord = isModifyServiceRequestRecord;
|
|
@@ -220,9 +220,10 @@ export declare class OutboundDialCampaignCaseRecord<TProps = OutboundDialCampaig
|
|
|
220
220
|
* Creates a new OutboundDialCampaignCase record with the specified properties.
|
|
221
221
|
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
222
222
|
*
|
|
223
|
+
* @remarks Record type: DEFAULT
|
|
224
|
+
*
|
|
223
225
|
* @param properties - The properties for the new record
|
|
224
226
|
* @param options - Optional settings
|
|
225
|
-
* @param options.type - Override the record type
|
|
226
227
|
* @param options.journeyId - Associate with a journey
|
|
227
228
|
* @param options.stageKey - Set initial pipeline stage
|
|
228
229
|
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
@@ -238,7 +239,6 @@ export declare class OutboundDialCampaignCaseRecord<TProps = OutboundDialCampaig
|
|
|
238
239
|
* ```
|
|
239
240
|
*/
|
|
240
241
|
createoutbounddialcampaigncase(properties: CreateoutbounddialcampaigncaseProperties, options?: {
|
|
241
|
-
type?: string;
|
|
242
242
|
journeyId?: string;
|
|
243
243
|
stageKey?: string;
|
|
244
244
|
}): ActionBuilder;
|
|
@@ -298,9 +298,10 @@ class OutboundDialCampaignCaseRecord {
|
|
|
298
298
|
* Creates a new OutboundDialCampaignCase record with the specified properties.
|
|
299
299
|
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
300
300
|
*
|
|
301
|
+
* @remarks Record type: DEFAULT
|
|
302
|
+
*
|
|
301
303
|
* @param properties - The properties for the new record
|
|
302
304
|
* @param options - Optional settings
|
|
303
|
-
* @param options.type - Override the record type
|
|
304
305
|
* @param options.journeyId - Associate with a journey
|
|
305
306
|
* @param options.stageKey - Set initial pipeline stage
|
|
306
307
|
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
@@ -316,10 +317,9 @@ class OutboundDialCampaignCaseRecord {
|
|
|
316
317
|
* ```
|
|
317
318
|
*/
|
|
318
319
|
createoutbounddialcampaigncase(properties, options) {
|
|
319
|
-
var _a, _b;
|
|
320
320
|
const payload = {
|
|
321
321
|
entity: 'SupportModule:OutboundDialCampaignCase',
|
|
322
|
-
type:
|
|
322
|
+
type: 'DEFAULT',
|
|
323
323
|
actionName: 'Createoutbounddialcampaigncase',
|
|
324
324
|
properties: properties || {},
|
|
325
325
|
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
@@ -24,6 +24,8 @@ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
|
24
24
|
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
25
25
|
import { OutboundDialCampaignProperties } from '../entities-v2/OutboundDialCampaign';
|
|
26
26
|
import { CreateOutboundDialCampaignProperties } from '../actions-v2/CreateOutboundDialCampaignDto';
|
|
27
|
+
import { DefaultCreateOutboundDialCampaignProperties } from '../actions-v2/DefaultCreateOutboundDialCampaignDto';
|
|
28
|
+
import { DefaultUpdateOutboundDialCampaignProperties } from '../actions-v2/DefaultUpdateOutboundDialCampaignDto';
|
|
27
29
|
import { UpdateoutbounddialcampaignProperties } from '../actions-v2/UpdateoutbounddialcampaignDto';
|
|
28
30
|
import { TeamRecord } from './TeamRecord';
|
|
29
31
|
import { OutboundDialCampaignCaseRecord } from './OutboundDialCampaignCaseRecord';
|
|
@@ -258,9 +260,10 @@ export declare class OutboundDialCampaignRecord<TProps = OutboundDialCampaignPro
|
|
|
258
260
|
* Creates a new OutboundDialCampaign record with the specified properties.
|
|
259
261
|
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
260
262
|
*
|
|
263
|
+
* @remarks Record type: DEFAULT
|
|
264
|
+
*
|
|
261
265
|
* @param properties - The properties for the new record
|
|
262
266
|
* @param options - Optional settings
|
|
263
|
-
* @param options.type - Override the record type
|
|
264
267
|
* @param options.journeyId - Associate with a journey
|
|
265
268
|
* @param options.stageKey - Set initial pipeline stage
|
|
266
269
|
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
@@ -276,7 +279,61 @@ export declare class OutboundDialCampaignRecord<TProps = OutboundDialCampaignPro
|
|
|
276
279
|
* ```
|
|
277
280
|
*/
|
|
278
281
|
createOutboundDialCampaign(properties: CreateOutboundDialCampaignProperties, options?: {
|
|
279
|
-
|
|
282
|
+
journeyId?: string;
|
|
283
|
+
stageKey?: string;
|
|
284
|
+
}): ActionBuilder;
|
|
285
|
+
/**
|
|
286
|
+
* DefaultCreateOutboundDialCampaign
|
|
287
|
+
*
|
|
288
|
+
* Creates a new OutboundDialCampaign record with the specified properties.
|
|
289
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
290
|
+
*
|
|
291
|
+
* @remarks Record type: DEFAULT
|
|
292
|
+
*
|
|
293
|
+
* @param properties - The properties for the new record
|
|
294
|
+
* @param options - Optional settings
|
|
295
|
+
* @param options.journeyId - Associate with a journey
|
|
296
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
297
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* // Create with properties
|
|
302
|
+
* const record = odinClient.outboundDialCampaigns.new();
|
|
303
|
+
* await record.defaultCreateOutboundDialCampaign({ ... }).execute();
|
|
304
|
+
*
|
|
305
|
+
* // Dry run (for debugging)
|
|
306
|
+
* const payload = record.defaultCreateOutboundDialCampaign({ ... }).dryRun();
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
defaultCreateOutboundDialCampaign(properties?: DefaultCreateOutboundDialCampaignProperties, options?: {
|
|
310
|
+
journeyId?: string;
|
|
311
|
+
stageKey?: string;
|
|
312
|
+
}): ActionBuilder;
|
|
313
|
+
/**
|
|
314
|
+
* DefaultUpdateOutboundDialCampaign
|
|
315
|
+
*
|
|
316
|
+
* Updates this OutboundDialCampaign record.
|
|
317
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
318
|
+
*
|
|
319
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
320
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
321
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
322
|
+
* @throws Error if called on a new (unsaved) record
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* ```typescript
|
|
326
|
+
* const record = await odinClient.outboundDialCampaigns.get(id);
|
|
327
|
+
* await record.defaultUpdateOutboundDialCampaign({ ... }).execute();
|
|
328
|
+
*
|
|
329
|
+
* // Dry run (for debugging)
|
|
330
|
+
* const payload = record.defaultUpdateOutboundDialCampaign({ ... }).dryRun();
|
|
331
|
+
* ```
|
|
332
|
+
*/
|
|
333
|
+
defaultUpdateOutboundDialCampaign(propertiesOrOptions?: DefaultUpdateOutboundDialCampaignProperties | {
|
|
334
|
+
journeyId?: string;
|
|
335
|
+
stageKey?: string;
|
|
336
|
+
}, options?: {
|
|
280
337
|
journeyId?: string;
|
|
281
338
|
stageKey?: string;
|
|
282
339
|
}): ActionBuilder;
|
|
@@ -360,9 +360,10 @@ class OutboundDialCampaignRecord {
|
|
|
360
360
|
* Creates a new OutboundDialCampaign record with the specified properties.
|
|
361
361
|
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
362
362
|
*
|
|
363
|
+
* @remarks Record type: DEFAULT
|
|
364
|
+
*
|
|
363
365
|
* @param properties - The properties for the new record
|
|
364
366
|
* @param options - Optional settings
|
|
365
|
-
* @param options.type - Override the record type
|
|
366
367
|
* @param options.journeyId - Associate with a journey
|
|
367
368
|
* @param options.stageKey - Set initial pipeline stage
|
|
368
369
|
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
@@ -378,10 +379,9 @@ class OutboundDialCampaignRecord {
|
|
|
378
379
|
* ```
|
|
379
380
|
*/
|
|
380
381
|
createOutboundDialCampaign(properties, options) {
|
|
381
|
-
var _a, _b;
|
|
382
382
|
const payload = {
|
|
383
383
|
entity: 'SupportModule:OutboundDialCampaign',
|
|
384
|
-
type:
|
|
384
|
+
type: 'DEFAULT',
|
|
385
385
|
actionName: 'CreateOutboundDialCampaign',
|
|
386
386
|
properties: properties || {},
|
|
387
387
|
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
@@ -390,9 +390,82 @@ class OutboundDialCampaignRecord {
|
|
|
390
390
|
};
|
|
391
391
|
return new ActionBuilder(this._provider, 'SupportModule', 'OutboundDialCampaign', payload, () => { this._pendingLinks = []; });
|
|
392
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* DefaultCreateOutboundDialCampaign
|
|
395
|
+
*
|
|
396
|
+
* Creates a new OutboundDialCampaign record with the specified properties.
|
|
397
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
398
|
+
*
|
|
399
|
+
* @remarks Record type: DEFAULT
|
|
400
|
+
*
|
|
401
|
+
* @param properties - The properties for the new record
|
|
402
|
+
* @param options - Optional settings
|
|
403
|
+
* @param options.journeyId - Associate with a journey
|
|
404
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
405
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* ```typescript
|
|
409
|
+
* // Create with properties
|
|
410
|
+
* const record = odinClient.outboundDialCampaigns.new();
|
|
411
|
+
* await record.defaultCreateOutboundDialCampaign({ ... }).execute();
|
|
412
|
+
*
|
|
413
|
+
* // Dry run (for debugging)
|
|
414
|
+
* const payload = record.defaultCreateOutboundDialCampaign({ ... }).dryRun();
|
|
415
|
+
* ```
|
|
416
|
+
*/
|
|
417
|
+
defaultCreateOutboundDialCampaign(properties, options) {
|
|
418
|
+
const payload = {
|
|
419
|
+
entity: 'SupportModule:OutboundDialCampaign',
|
|
420
|
+
type: 'DEFAULT',
|
|
421
|
+
actionName: 'DefaultCreateOutboundDialCampaign',
|
|
422
|
+
properties: properties || {},
|
|
423
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
424
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
425
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
426
|
+
};
|
|
427
|
+
return new ActionBuilder(this._provider, 'SupportModule', 'OutboundDialCampaign', payload, () => { this._pendingLinks = []; });
|
|
428
|
+
}
|
|
393
429
|
// ============================================
|
|
394
430
|
// UPDATE ACTIONS (require existing record)
|
|
395
431
|
// ============================================
|
|
432
|
+
/**
|
|
433
|
+
* DefaultUpdateOutboundDialCampaign
|
|
434
|
+
*
|
|
435
|
+
* Updates this OutboundDialCampaign record.
|
|
436
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
437
|
+
*
|
|
438
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
439
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
440
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
441
|
+
* @throws Error if called on a new (unsaved) record
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* ```typescript
|
|
445
|
+
* const record = await odinClient.outboundDialCampaigns.get(id);
|
|
446
|
+
* await record.defaultUpdateOutboundDialCampaign({ ... }).execute();
|
|
447
|
+
*
|
|
448
|
+
* // Dry run (for debugging)
|
|
449
|
+
* const payload = record.defaultUpdateOutboundDialCampaign({ ... }).dryRun();
|
|
450
|
+
* ```
|
|
451
|
+
*/
|
|
452
|
+
defaultUpdateOutboundDialCampaign(propertiesOrOptions, options) {
|
|
453
|
+
var _a;
|
|
454
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
455
|
+
throw new Error('defaultUpdateOutboundDialCampaign requires an existing record. Use accessor.get() first.');
|
|
456
|
+
let properties = {};
|
|
457
|
+
let opts = options;
|
|
458
|
+
if (propertiesOrOptions) {
|
|
459
|
+
if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
|
|
460
|
+
opts = propertiesOrOptions;
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
properties = propertiesOrOptions;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'DefaultUpdateOutboundDialCampaign', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
|
|
467
|
+
return new ActionBuilder(this._provider, 'SupportModule', 'OutboundDialCampaign', payload, () => { this._pendingLinks = []; });
|
|
468
|
+
}
|
|
396
469
|
/**
|
|
397
470
|
* Updateoutbounddialcampaign
|
|
398
471
|
*
|
|
@@ -65,6 +65,7 @@ export { ImpersonationTrackerRecord, isImpersonationTrackerRecord } from './Impe
|
|
|
65
65
|
export { InvoiceItemRecord, isInvoiceItemRecord } from './InvoiceItemRecord';
|
|
66
66
|
export { LeadRecord, isLeadRecord } from './LeadRecord';
|
|
67
67
|
export { MessageRecord, isMessageRecord } from './MessageRecord';
|
|
68
|
+
export { ModifyServiceRequestRecord, isModifyServiceRequestRecord } from './ModifyServiceRequestRecord';
|
|
68
69
|
export { NetworkDeviceRecord, isNetworkDeviceRecord } from './NetworkDeviceRecord';
|
|
69
70
|
export { ReturnsRecord, isReturnsRecord } from './ReturnsRecord';
|
|
70
71
|
export { OfferTemplateRecord, isOfferTemplateRecord } from './OfferTemplateRecord';
|