@d19n/youfibre-odin-sdk 2.0.288 → 2.0.290
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 +25 -22
- package/dist/actions-v2/AssignAutoResolutionStatusDto.d.ts +73 -0
- package/dist/actions-v2/AssignAutoResolutionStatusDto.js +56 -0
- package/dist/api-sdk-v2/AgentStatusApi.d.ts +48 -0
- package/dist/api-sdk-v2/AgentStatusApi.js +155 -0
- package/dist/api-sdk-v2/AgentStatusHistoryApi.d.ts +48 -0
- package/dist/api-sdk-v2/AgentStatusHistoryApi.js +155 -0
- package/dist/api-sdk-v2/UserApi.d.ts +4 -0
- package/dist/api-sdk-v2/UserApi.js +12 -0
- package/dist/db-sdk-v2/AgentStatusDb.d.ts +120 -0
- package/dist/db-sdk-v2/AgentStatusDb.js +204 -0
- package/dist/db-sdk-v2/AgentStatusHistoryDb.d.ts +120 -0
- package/dist/db-sdk-v2/AgentStatusHistoryDb.js +204 -0
- package/dist/db-sdk-v2/UserDb.d.ts +4 -0
- package/dist/db-sdk-v2/UserDb.js +12 -0
- package/dist/entities-v2/AgentStatus.d.ts +205 -0
- package/dist/entities-v2/AgentStatus.js +164 -0
- package/dist/entities-v2/AgentStatusHistory.d.ts +205 -0
- package/dist/entities-v2/AgentStatusHistory.js +164 -0
- package/dist/entities-v2/Case.d.ts +33 -0
- package/dist/entities-v2/Case.js +22 -2
- package/dist/entities-v2/User.d.ts +6 -0
- package/dist/entities-v2/WorkOrder.d.ts +294 -0
- package/dist/entities-v2/WorkOrder.js +6 -0
- package/dist/records-v2/CaseRecord.d.ts +27 -0
- package/dist/records-v2/CaseRecord.js +29 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
|
|
2
|
+
import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
|
|
3
|
+
import { DbRecordLinkManager } from '@d19n/odin-sdk-generator/dist/db.record.link.manager';
|
|
4
|
+
import { AgentStatusProperties } from '../entities-v2/AgentStatus';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinDbClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new AgentStatusApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.agentstatus.get(id)
|
|
11
|
+
*
|
|
12
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
13
|
+
*
|
|
14
|
+
* Supports separate query options and provider options:
|
|
15
|
+
* - Constructor level: new AgentStatusDb(principal, dbService, { omitPermissionsCheck: true })
|
|
16
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
17
|
+
*/
|
|
18
|
+
export declare class AgentStatusDb extends DbProvider {
|
|
19
|
+
protected readonly principal: any;
|
|
20
|
+
protected readonly dbService: any;
|
|
21
|
+
private readonly moduleName;
|
|
22
|
+
private readonly entityName;
|
|
23
|
+
private sourceRecord;
|
|
24
|
+
private _user?;
|
|
25
|
+
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
26
|
+
get user(): DbRecordLinkManager;
|
|
27
|
+
setRecord(sourceRecord: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* Search records with manual pagination control
|
|
30
|
+
* @param params - Search parameters
|
|
31
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
32
|
+
*/
|
|
33
|
+
searchRecords(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusProperties>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Search all records with automatic pagination
|
|
36
|
+
* @param params - Search parameters
|
|
37
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
38
|
+
*/
|
|
39
|
+
searchAllRecordsAndPaginate(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusProperties>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a single record by primary key
|
|
42
|
+
* @param agentStatusId - Record ID
|
|
43
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
44
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Simple get
|
|
48
|
+
* const record = await db.getByPrimaryKey(id);
|
|
49
|
+
*
|
|
50
|
+
* // With related entities
|
|
51
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
52
|
+
*
|
|
53
|
+
* // With permissions bypass
|
|
54
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
55
|
+
*
|
|
56
|
+
* // Both options
|
|
57
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
58
|
+
*/
|
|
59
|
+
getByPrimaryKey(agentStatusId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusProperties>>;
|
|
60
|
+
/**
|
|
61
|
+
* Get multiple records by primary keys
|
|
62
|
+
* @param agentStatusIds - Array of record IDs
|
|
63
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
64
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
65
|
+
*/
|
|
66
|
+
getManyByPrimaryKey(agentStatusIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusProperties>[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Upsert a single record
|
|
69
|
+
* @param upsertDto - Record to upsert
|
|
70
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
71
|
+
*/
|
|
72
|
+
upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
|
|
73
|
+
/**
|
|
74
|
+
* Upsert multiple records
|
|
75
|
+
* @param upsertDtos - Records to upsert
|
|
76
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
77
|
+
*/
|
|
78
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Update a single record
|
|
81
|
+
* @param updateDto - Record to update
|
|
82
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
83
|
+
*/
|
|
84
|
+
update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
|
|
85
|
+
/**
|
|
86
|
+
* Update multiple records
|
|
87
|
+
* @param updateDtos - Records to update
|
|
88
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
89
|
+
*/
|
|
90
|
+
updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Delete one or many records
|
|
93
|
+
* @param agentStatusIds - Record IDs to delete
|
|
94
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
95
|
+
*/
|
|
96
|
+
delete(agentStatusIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Restore one or many deleted records
|
|
99
|
+
* @param agentStatusIds - Record IDs to restore
|
|
100
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
101
|
+
*/
|
|
102
|
+
restore(agentStatusIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Apply an action to a record
|
|
105
|
+
* @param actionName - The action key
|
|
106
|
+
* @param dto - The action DTO
|
|
107
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
108
|
+
*/
|
|
109
|
+
applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Get version history for the current source record
|
|
112
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
113
|
+
*/
|
|
114
|
+
getVersions(providerOptions?: DbProviderOptions): Promise<any>;
|
|
115
|
+
/**
|
|
116
|
+
* Get revision timeline for the current source record
|
|
117
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
118
|
+
*/
|
|
119
|
+
getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
|
|
120
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentStatusDb = void 0;
|
|
13
|
+
const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
|
|
14
|
+
const db_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/db.record.link.manager");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use OdinDbClient.
|
|
17
|
+
*
|
|
18
|
+
* Migration:
|
|
19
|
+
* - Old: new AgentStatusApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.agentstatus.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
23
|
+
*
|
|
24
|
+
* Supports separate query options and provider options:
|
|
25
|
+
* - Constructor level: new AgentStatusDb(principal, dbService, { omitPermissionsCheck: true })
|
|
26
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
27
|
+
*/
|
|
28
|
+
class AgentStatusDb extends db_provider_1.DbProvider {
|
|
29
|
+
constructor(principal, dbService, defaultOptions) {
|
|
30
|
+
super(principal, dbService, defaultOptions);
|
|
31
|
+
this.moduleName = 'SupportModule';
|
|
32
|
+
this.entityName = 'AgentStatus';
|
|
33
|
+
this.principal = principal;
|
|
34
|
+
this.dbService = dbService;
|
|
35
|
+
// Link managers are lazy-loaded on first access
|
|
36
|
+
}
|
|
37
|
+
// ============================================
|
|
38
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
39
|
+
// ============================================
|
|
40
|
+
// Usage remains identical: db.address.list(recordId)
|
|
41
|
+
get user() {
|
|
42
|
+
if (!this._user) {
|
|
43
|
+
this._user = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:AgentStatus', 'IdentityModule:User', 'AgentStatus__User');
|
|
44
|
+
}
|
|
45
|
+
return this._user;
|
|
46
|
+
}
|
|
47
|
+
// ============================================
|
|
48
|
+
// STANDARD METHODS
|
|
49
|
+
// ============================================
|
|
50
|
+
// Methods support separate query options and provider options for clean API
|
|
51
|
+
setRecord(sourceRecord) {
|
|
52
|
+
this.sourceRecord = sourceRecord;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Search records with manual pagination control
|
|
56
|
+
* @param params - Search parameters
|
|
57
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
58
|
+
*/
|
|
59
|
+
searchRecords(params, providerOptions) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Search all records with automatic pagination
|
|
66
|
+
* @param params - Search parameters
|
|
67
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
68
|
+
*/
|
|
69
|
+
searchAllRecordsAndPaginate(params, providerOptions) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get a single record by primary key
|
|
76
|
+
* @param agentStatusId - Record ID
|
|
77
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
78
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Simple get
|
|
82
|
+
* const record = await db.getByPrimaryKey(id);
|
|
83
|
+
*
|
|
84
|
+
* // With related entities
|
|
85
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
86
|
+
*
|
|
87
|
+
* // With permissions bypass
|
|
88
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
89
|
+
*
|
|
90
|
+
* // Both options
|
|
91
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
92
|
+
*/
|
|
93
|
+
getByPrimaryKey(agentStatusId, queryOptions, providerOptions) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, agentStatusId, queryOptions, providerOptions);
|
|
96
|
+
if (res)
|
|
97
|
+
this.setRecord(res);
|
|
98
|
+
return res;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get multiple records by primary keys
|
|
103
|
+
* @param agentStatusIds - Array of record IDs
|
|
104
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
105
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
106
|
+
*/
|
|
107
|
+
getManyByPrimaryKey(agentStatusIds, queryOptions, providerOptions) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, agentStatusIds, queryOptions, providerOptions);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Upsert a single record
|
|
114
|
+
* @param upsertDto - Record to upsert
|
|
115
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
116
|
+
*/
|
|
117
|
+
upsert(upsertDto, providerOptions) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
|
|
120
|
+
return res[0];
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Upsert multiple records
|
|
125
|
+
* @param upsertDtos - Records to upsert
|
|
126
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
127
|
+
*/
|
|
128
|
+
upsertMany(upsertDtos, providerOptions) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Update a single record
|
|
135
|
+
* @param updateDto - Record to update
|
|
136
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
137
|
+
*/
|
|
138
|
+
update(updateDto, providerOptions) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
|
|
141
|
+
return res[0];
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Update multiple records
|
|
146
|
+
* @param updateDtos - Records to update
|
|
147
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
148
|
+
*/
|
|
149
|
+
updateMany(updateDtos, providerOptions) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Delete one or many records
|
|
156
|
+
* @param agentStatusIds - Record IDs to delete
|
|
157
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
158
|
+
*/
|
|
159
|
+
delete(agentStatusIds, providerOptions) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
return yield this._delete(this.moduleName, this.entityName, agentStatusIds, providerOptions);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Restore one or many deleted records
|
|
166
|
+
* @param agentStatusIds - Record IDs to restore
|
|
167
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
168
|
+
*/
|
|
169
|
+
restore(agentStatusIds, providerOptions) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
return yield this._restore(this.moduleName, this.entityName, agentStatusIds, providerOptions);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Apply an action to a record
|
|
176
|
+
* @param actionName - The action key
|
|
177
|
+
* @param dto - The action DTO
|
|
178
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
179
|
+
*/
|
|
180
|
+
applyAction(actionName, dto, providerOptions) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get version history for the current source record
|
|
187
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
188
|
+
*/
|
|
189
|
+
getVersions(providerOptions) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get revision timeline for the current source record
|
|
196
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
197
|
+
*/
|
|
198
|
+
getRevisionTimeline(providerOptions) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.AgentStatusDb = AgentStatusDb;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
|
|
2
|
+
import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
|
|
3
|
+
import { DbRecordLinkManager } from '@d19n/odin-sdk-generator/dist/db.record.link.manager';
|
|
4
|
+
import { AgentStatusHistoryProperties } from '../entities-v2/AgentStatusHistory';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinDbClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new AgentStatusHistoryApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.agentstatushistory.get(id)
|
|
11
|
+
*
|
|
12
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
13
|
+
*
|
|
14
|
+
* Supports separate query options and provider options:
|
|
15
|
+
* - Constructor level: new AgentStatusHistoryDb(principal, dbService, { omitPermissionsCheck: true })
|
|
16
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
17
|
+
*/
|
|
18
|
+
export declare class AgentStatusHistoryDb extends DbProvider {
|
|
19
|
+
protected readonly principal: any;
|
|
20
|
+
protected readonly dbService: any;
|
|
21
|
+
private readonly moduleName;
|
|
22
|
+
private readonly entityName;
|
|
23
|
+
private sourceRecord;
|
|
24
|
+
private _user?;
|
|
25
|
+
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
26
|
+
get user(): DbRecordLinkManager;
|
|
27
|
+
setRecord(sourceRecord: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* Search records with manual pagination control
|
|
30
|
+
* @param params - Search parameters
|
|
31
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
32
|
+
*/
|
|
33
|
+
searchRecords(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusHistoryProperties>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Search all records with automatic pagination
|
|
36
|
+
* @param params - Search parameters
|
|
37
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
38
|
+
*/
|
|
39
|
+
searchAllRecordsAndPaginate(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusHistoryProperties>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a single record by primary key
|
|
42
|
+
* @param agentStatusHistoryId - Record ID
|
|
43
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
44
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Simple get
|
|
48
|
+
* const record = await db.getByPrimaryKey(id);
|
|
49
|
+
*
|
|
50
|
+
* // With related entities
|
|
51
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
52
|
+
*
|
|
53
|
+
* // With permissions bypass
|
|
54
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
55
|
+
*
|
|
56
|
+
* // Both options
|
|
57
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
58
|
+
*/
|
|
59
|
+
getByPrimaryKey(agentStatusHistoryId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusHistoryProperties>>;
|
|
60
|
+
/**
|
|
61
|
+
* Get multiple records by primary keys
|
|
62
|
+
* @param agentStatusHistoryIds - Array of record IDs
|
|
63
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
64
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
65
|
+
*/
|
|
66
|
+
getManyByPrimaryKey(agentStatusHistoryIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AgentStatusHistoryProperties>[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Upsert a single record
|
|
69
|
+
* @param upsertDto - Record to upsert
|
|
70
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
71
|
+
*/
|
|
72
|
+
upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
|
|
73
|
+
/**
|
|
74
|
+
* Upsert multiple records
|
|
75
|
+
* @param upsertDtos - Records to upsert
|
|
76
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
77
|
+
*/
|
|
78
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Update a single record
|
|
81
|
+
* @param updateDto - Record to update
|
|
82
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
83
|
+
*/
|
|
84
|
+
update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
|
|
85
|
+
/**
|
|
86
|
+
* Update multiple records
|
|
87
|
+
* @param updateDtos - Records to update
|
|
88
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
89
|
+
*/
|
|
90
|
+
updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Delete one or many records
|
|
93
|
+
* @param agentStatusHistoryIds - Record IDs to delete
|
|
94
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
95
|
+
*/
|
|
96
|
+
delete(agentStatusHistoryIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Restore one or many deleted records
|
|
99
|
+
* @param agentStatusHistoryIds - Record IDs to restore
|
|
100
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
101
|
+
*/
|
|
102
|
+
restore(agentStatusHistoryIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Apply an action to a record
|
|
105
|
+
* @param actionName - The action key
|
|
106
|
+
* @param dto - The action DTO
|
|
107
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
108
|
+
*/
|
|
109
|
+
applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Get version history for the current source record
|
|
112
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
113
|
+
*/
|
|
114
|
+
getVersions(providerOptions?: DbProviderOptions): Promise<any>;
|
|
115
|
+
/**
|
|
116
|
+
* Get revision timeline for the current source record
|
|
117
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
118
|
+
*/
|
|
119
|
+
getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
|
|
120
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentStatusHistoryDb = void 0;
|
|
13
|
+
const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
|
|
14
|
+
const db_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/db.record.link.manager");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use OdinDbClient.
|
|
17
|
+
*
|
|
18
|
+
* Migration:
|
|
19
|
+
* - Old: new AgentStatusHistoryApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.agentstatushistory.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
23
|
+
*
|
|
24
|
+
* Supports separate query options and provider options:
|
|
25
|
+
* - Constructor level: new AgentStatusHistoryDb(principal, dbService, { omitPermissionsCheck: true })
|
|
26
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
27
|
+
*/
|
|
28
|
+
class AgentStatusHistoryDb extends db_provider_1.DbProvider {
|
|
29
|
+
constructor(principal, dbService, defaultOptions) {
|
|
30
|
+
super(principal, dbService, defaultOptions);
|
|
31
|
+
this.moduleName = 'SupportModule';
|
|
32
|
+
this.entityName = 'AgentStatusHistory';
|
|
33
|
+
this.principal = principal;
|
|
34
|
+
this.dbService = dbService;
|
|
35
|
+
// Link managers are lazy-loaded on first access
|
|
36
|
+
}
|
|
37
|
+
// ============================================
|
|
38
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
39
|
+
// ============================================
|
|
40
|
+
// Usage remains identical: db.address.list(recordId)
|
|
41
|
+
get user() {
|
|
42
|
+
if (!this._user) {
|
|
43
|
+
this._user = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:AgentStatusHistory', 'IdentityModule:User', 'AgentStatusHistory__User');
|
|
44
|
+
}
|
|
45
|
+
return this._user;
|
|
46
|
+
}
|
|
47
|
+
// ============================================
|
|
48
|
+
// STANDARD METHODS
|
|
49
|
+
// ============================================
|
|
50
|
+
// Methods support separate query options and provider options for clean API
|
|
51
|
+
setRecord(sourceRecord) {
|
|
52
|
+
this.sourceRecord = sourceRecord;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Search records with manual pagination control
|
|
56
|
+
* @param params - Search parameters
|
|
57
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
58
|
+
*/
|
|
59
|
+
searchRecords(params, providerOptions) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Search all records with automatic pagination
|
|
66
|
+
* @param params - Search parameters
|
|
67
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
68
|
+
*/
|
|
69
|
+
searchAllRecordsAndPaginate(params, providerOptions) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get a single record by primary key
|
|
76
|
+
* @param agentStatusHistoryId - Record ID
|
|
77
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
78
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Simple get
|
|
82
|
+
* const record = await db.getByPrimaryKey(id);
|
|
83
|
+
*
|
|
84
|
+
* // With related entities
|
|
85
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
86
|
+
*
|
|
87
|
+
* // With permissions bypass
|
|
88
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
89
|
+
*
|
|
90
|
+
* // Both options
|
|
91
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
92
|
+
*/
|
|
93
|
+
getByPrimaryKey(agentStatusHistoryId, queryOptions, providerOptions) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, agentStatusHistoryId, queryOptions, providerOptions);
|
|
96
|
+
if (res)
|
|
97
|
+
this.setRecord(res);
|
|
98
|
+
return res;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get multiple records by primary keys
|
|
103
|
+
* @param agentStatusHistoryIds - Array of record IDs
|
|
104
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
105
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
106
|
+
*/
|
|
107
|
+
getManyByPrimaryKey(agentStatusHistoryIds, queryOptions, providerOptions) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, agentStatusHistoryIds, queryOptions, providerOptions);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Upsert a single record
|
|
114
|
+
* @param upsertDto - Record to upsert
|
|
115
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
116
|
+
*/
|
|
117
|
+
upsert(upsertDto, providerOptions) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
|
|
120
|
+
return res[0];
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Upsert multiple records
|
|
125
|
+
* @param upsertDtos - Records to upsert
|
|
126
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
127
|
+
*/
|
|
128
|
+
upsertMany(upsertDtos, providerOptions) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Update a single record
|
|
135
|
+
* @param updateDto - Record to update
|
|
136
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
137
|
+
*/
|
|
138
|
+
update(updateDto, providerOptions) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
|
|
141
|
+
return res[0];
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Update multiple records
|
|
146
|
+
* @param updateDtos - Records to update
|
|
147
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
148
|
+
*/
|
|
149
|
+
updateMany(updateDtos, providerOptions) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Delete one or many records
|
|
156
|
+
* @param agentStatusHistoryIds - Record IDs to delete
|
|
157
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
158
|
+
*/
|
|
159
|
+
delete(agentStatusHistoryIds, providerOptions) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
return yield this._delete(this.moduleName, this.entityName, agentStatusHistoryIds, providerOptions);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Restore one or many deleted records
|
|
166
|
+
* @param agentStatusHistoryIds - Record IDs to restore
|
|
167
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
168
|
+
*/
|
|
169
|
+
restore(agentStatusHistoryIds, providerOptions) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
return yield this._restore(this.moduleName, this.entityName, agentStatusHistoryIds, providerOptions);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Apply an action to a record
|
|
176
|
+
* @param actionName - The action key
|
|
177
|
+
* @param dto - The action DTO
|
|
178
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
179
|
+
*/
|
|
180
|
+
applyAction(actionName, dto, providerOptions) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get version history for the current source record
|
|
187
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
188
|
+
*/
|
|
189
|
+
getVersions(providerOptions) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get revision timeline for the current source record
|
|
196
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
197
|
+
*/
|
|
198
|
+
getRevisionTimeline(providerOptions) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.AgentStatusHistoryDb = AgentStatusHistoryDb;
|
|
@@ -50,6 +50,8 @@ export declare class UserDb extends DbProvider {
|
|
|
50
50
|
private _twilioworker?;
|
|
51
51
|
private _outbounddialcampaign?;
|
|
52
52
|
private _outbounddialsession?;
|
|
53
|
+
private _agentstatus?;
|
|
54
|
+
private _agentstatushistory?;
|
|
53
55
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
54
56
|
get blockagea55(): DbRecordLinkManager;
|
|
55
57
|
get timeslot(): DbRecordLinkManager;
|
|
@@ -80,6 +82,8 @@ export declare class UserDb extends DbProvider {
|
|
|
80
82
|
get twilioworker(): DbRecordLinkManager;
|
|
81
83
|
get outbounddialcampaign(): DbRecordLinkManager;
|
|
82
84
|
get outbounddialsession(): DbRecordLinkManager;
|
|
85
|
+
get agentstatus(): DbRecordLinkManager;
|
|
86
|
+
get agentstatushistory(): DbRecordLinkManager;
|
|
83
87
|
setRecord(sourceRecord: any): void;
|
|
84
88
|
/**
|
|
85
89
|
* Search records with manual pagination control
|