@d19n/youfibre-odin-sdk 2.0.358 → 2.0.360
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 +3 -2
- package/dist/actions-v2/CreateCollectionAmcoFollowOnWorkOrderDto.d.ts +105 -20
- package/dist/actions-v2/CreateCollectionAmcoFollowOnWorkOrderDto.js +14 -16
- package/dist/api-sdk-v2/AiRouteRequestApi.d.ts +45 -0
- package/dist/api-sdk-v2/AiRouteRequestApi.js +151 -0
- package/dist/db-sdk-v2/AiRouteRequestDb.d.ts +117 -0
- package/dist/db-sdk-v2/AiRouteRequestDb.js +200 -0
- package/dist/entities-v2/AiRouteRequest.d.ts +260 -0
- package/dist/entities-v2/AiRouteRequest.js +174 -0
- package/dist/entities-v2/WorkOrder.d.ts +99 -1
- package/dist/entities-v2/WorkOrder.js +2 -0
- package/dist/records-v2/WorkOrderRecord.d.ts +28 -27
- package/dist/records-v2/WorkOrderRecord.js +36 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ await workOrder.completeWorkOrder({ ... });
|
|
|
124
124
|
|
|
125
125
|
## Entities
|
|
126
126
|
|
|
127
|
-
This SDK includes **
|
|
127
|
+
This SDK includes **202** entities across **13** modules.
|
|
128
128
|
|
|
129
129
|
### CrmModule
|
|
130
130
|
|
|
@@ -205,6 +205,7 @@ This SDK includes **201** entities across **13** modules.
|
|
|
205
205
|
|--------|-------------|-------|
|
|
206
206
|
| **AgentStatus** | AgentStatus Entity Definition | DEFAULT |
|
|
207
207
|
| **AgentStatusHistory** | AgentStatusHistory Entity Definition | DEFAULT |
|
|
208
|
+
| **AiRouteRequest** | AiRouteRequest Entity Definition | DEFAULT |
|
|
208
209
|
| **AiTagItem** | AiTagItem Entity Definition | DEFAULT |
|
|
209
210
|
| **AiTagSet** | AiTagSet Entity Definition | DEFAULT |
|
|
210
211
|
| **Case** | Case Entity Definition | OUTAGE |
|
|
@@ -502,7 +503,7 @@ This SDK includes **933** actions.
|
|
|
502
503
|
| `CompleteServiceWorkOrderFlow` | STAGE_TRANSITION | k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Update.CompleteServiceWorkOrder |
|
|
503
504
|
| `CompleteServiceWorkOrderFlowSupplier` | STAGE_TRANSITION | k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Transition.CompleteServiceWorkOrderFlowSupplier |
|
|
504
505
|
| `CreateCancelCollectionAmco` | CREATE | k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCancelCollectionAmco |
|
|
505
|
-
| `CreateCollectionAmcoFollowOnWorkOrder` |
|
|
506
|
+
| `CreateCollectionAmcoFollowOnWorkOrder` | CREATE | k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder |
|
|
506
507
|
| `CreateCollectionAmcoReplacementWorkOrder` | CREATE | k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoReplacementWorkOrder |
|
|
507
508
|
| `CreateCollectionAmcoReplacementWorkOrderFromWorkOrder` | CREATE | k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoReplacementWorkOrder |
|
|
508
509
|
| `CreateCollectionAmcoWorkOrder` | CREATE | k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoWorkOrder |
|
|
@@ -1,68 +1,153 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CreateCollectionAmcoFollowOnWorkOrder Action DTO
|
|
3
3
|
*
|
|
4
|
-
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices
|
|
4
|
+
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices; the first one then moves to Complete.
|
|
5
5
|
*
|
|
6
6
|
* @module FieldServiceModule
|
|
7
7
|
* @entity WorkOrder
|
|
8
8
|
* @entityType COLLECTION_AMCO
|
|
9
9
|
* @actionKey CreateCollectionAmcoFollowOnWorkOrder
|
|
10
|
-
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.
|
|
10
|
+
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder
|
|
11
11
|
*
|
|
12
12
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
|
|
15
15
|
/**
|
|
16
|
-
* RabbitMQ message payload for CreateCollectionAmcoFollowOnWorkOrder
|
|
16
|
+
* RabbitMQ message payload for CreateCollectionAmcoFollowOnWorkOrder created events
|
|
17
17
|
*
|
|
18
|
-
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.
|
|
18
|
+
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder
|
|
19
19
|
*/
|
|
20
|
-
export interface CreateCollectionAmcoFollowOnWorkOrderMessage extends
|
|
20
|
+
export interface CreateCollectionAmcoFollowOnWorkOrderMessage extends OdinRecordCreatedEvent<CreateCollectionAmcoFollowOnWorkOrderDto, CreateCollectionAmcoFollowOnWorkOrderProperties> {
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Properties for CreateCollectionAmcoFollowOnWorkOrder action
|
|
24
24
|
*
|
|
25
|
+
* @property Required fields: 0
|
|
26
|
+
* @property Optional fields: 11
|
|
25
27
|
*/
|
|
26
28
|
export interface CreateCollectionAmcoFollowOnWorkOrderProperties {
|
|
29
|
+
/**
|
|
30
|
+
* FollowOnOfWorkOrderId
|
|
31
|
+
*
|
|
32
|
+
* On a follow-on COLLECTION_AMCO (a second bag for a partial return): the id of the collection whose missing devices it collects. Set from that collection by CreateCollectionAmcoFollowOnWorkOrder. Null on every other work order
|
|
33
|
+
* @type {UUID}
|
|
34
|
+
* @default Dynamic: {source_record_id}
|
|
35
|
+
*/
|
|
36
|
+
FollowOnOfWorkOrderId?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* OrderId
|
|
39
|
+
*
|
|
40
|
+
* Reference identifier for WorkOrder relationships. Used for data integrity.
|
|
41
|
+
* @type {LOOKUP}
|
|
42
|
+
* @default Dynamic: {source_record_properties_OrderId}
|
|
43
|
+
*/
|
|
44
|
+
OrderId?: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* UseAlternativeAddress
|
|
47
|
+
*
|
|
48
|
+
* Use an Alternative Address instead of the linked order's address (Field Operations - WorkOrder)
|
|
49
|
+
* @type {BOOLEAN}
|
|
50
|
+
* @default Dynamic: {source_record_properties_UseAlternativeAddress}
|
|
51
|
+
*/
|
|
52
|
+
UseAlternativeAddress?: boolean | null;
|
|
53
|
+
/**
|
|
54
|
+
* UseAlternativeAddressManual
|
|
55
|
+
*
|
|
56
|
+
* UseAlternativeAddressManual (Field Operations - WorkOrder)
|
|
57
|
+
* @type {BOOLEAN}
|
|
58
|
+
* @default Dynamic: {source_record_properties_UseAlternativeAddressManual}
|
|
59
|
+
*/
|
|
60
|
+
UseAlternativeAddressManual?: boolean | null;
|
|
61
|
+
/**
|
|
62
|
+
* AlternativeAddress
|
|
63
|
+
*
|
|
64
|
+
* Alternative Address (Field Operations - WorkOrder)
|
|
65
|
+
* @type {LOOKUP}
|
|
66
|
+
* @default Dynamic: {source_record_properties_AlternativeAddress}
|
|
67
|
+
*/
|
|
68
|
+
AlternativeAddress?: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* AlternativeAddressLine1
|
|
71
|
+
*
|
|
72
|
+
* Contact information field for WorkOrder. Used by Field Operations team for communication.
|
|
73
|
+
* @type {TEXT}
|
|
74
|
+
* @default Dynamic: {source_record_properties_AlternativeAddressLine1}
|
|
75
|
+
*/
|
|
76
|
+
AlternativeAddressLine1?: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* AlternativeAddressLine2
|
|
79
|
+
*
|
|
80
|
+
* Contact information field for WorkOrder. Used by Field Operations team for communication.
|
|
81
|
+
* @type {TEXT}
|
|
82
|
+
* @default Dynamic: {source_record_properties_AlternativeAddressLine2}
|
|
83
|
+
*/
|
|
84
|
+
AlternativeAddressLine2?: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* AlternativeAddressCityTown
|
|
87
|
+
*
|
|
88
|
+
* Contact information field for WorkOrder. Used by Field Operations team for communication.
|
|
89
|
+
* @type {TEXT}
|
|
90
|
+
* @default Dynamic: {source_record_properties_AlternativeAddressCityTown}
|
|
91
|
+
*/
|
|
92
|
+
AlternativeAddressCityTown?: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* AlternativeAddressPostCode
|
|
95
|
+
*
|
|
96
|
+
* Contact information field for WorkOrder. Used by Field Operations team for communication.
|
|
97
|
+
* @type {TEXT}
|
|
98
|
+
* @default Dynamic: {source_record_properties_AlternativeAddressPostCode}
|
|
99
|
+
*/
|
|
100
|
+
AlternativeAddressPostCode?: string | null;
|
|
101
|
+
/**
|
|
102
|
+
* UseAlternativeContact
|
|
103
|
+
*
|
|
104
|
+
* Use Alternative Contact (Field Operations - WorkOrder)
|
|
105
|
+
* @type {BOOLEAN}
|
|
106
|
+
* @default Dynamic: {source_record_properties_UseAlternativeContact}
|
|
107
|
+
*/
|
|
108
|
+
UseAlternativeContact?: boolean | null;
|
|
109
|
+
/**
|
|
110
|
+
* AlternativeContact
|
|
111
|
+
*
|
|
112
|
+
* Alternative Contact (Field Operations - WorkOrder)
|
|
113
|
+
* @type {LOOKUP}
|
|
114
|
+
* @default Dynamic: {source_record_properties_AlternativeContact}
|
|
115
|
+
*/
|
|
116
|
+
AlternativeContact?: string | null;
|
|
27
117
|
}
|
|
28
118
|
/**
|
|
29
119
|
* Send Another Bag
|
|
30
120
|
*
|
|
31
|
-
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices
|
|
121
|
+
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices; the first one then moves to Complete.
|
|
32
122
|
*
|
|
33
|
-
* @actionType
|
|
123
|
+
* @actionType CREATE - Creates a new WorkOrder record
|
|
34
124
|
* @module FieldServiceModule
|
|
35
125
|
* @entity WorkOrder
|
|
36
126
|
* @entityType COLLECTION_AMCO ( 3PL Collection)
|
|
37
|
-
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.
|
|
127
|
+
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder
|
|
38
128
|
* @permission schema.action.createcollectionamcofollowonworkorder.trigger
|
|
39
129
|
* @benchmark This action is tracked for performance benchmarks
|
|
40
130
|
*/
|
|
41
|
-
export declare class CreateCollectionAmcoFollowOnWorkOrderDto extends
|
|
131
|
+
export declare class CreateCollectionAmcoFollowOnWorkOrderDto extends OdinRecordCreateDto<CreateCollectionAmcoFollowOnWorkOrderProperties> {
|
|
42
132
|
/** Used by SDK generators to identify action type */
|
|
43
|
-
static readonly ACTION_TYPE = "
|
|
133
|
+
static readonly ACTION_TYPE = "CREATE";
|
|
44
134
|
static readonly ACTION_KEY = "CreateCollectionAmcoFollowOnWorkOrder";
|
|
45
135
|
static readonly MODULE_NAME = "FieldServiceModule";
|
|
46
136
|
static readonly ENTITIES: string[];
|
|
47
137
|
static readonly ENTITY_TYPE = "COLLECTION_AMCO";
|
|
48
|
-
static readonly EVENT_NAME = "k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.
|
|
138
|
+
static readonly EVENT_NAME = "k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder";
|
|
49
139
|
static readonly PERMISSION = "schema.action.createcollectionamcofollowonworkorder.trigger";
|
|
50
140
|
/** Step metadata - entity this action targets */
|
|
51
141
|
static readonly STEP_ENTITY = "FieldServiceModule:WorkOrder";
|
|
52
142
|
static readonly STEP_SCHEMA_ID = "966bf5d9-163e-4132-85e2-56a5f801c9de";
|
|
53
|
-
static readonly STEP_SCHEMA_ACTION_ID = "
|
|
143
|
+
static readonly STEP_SCHEMA_ACTION_ID = "54b76d67-a8ea-410a-b157-3f0dc20ab092";
|
|
54
144
|
static readonly STEP_SCHEMA_TYPE_ID = "0bf773b2-9054-457e-a282-5ae8fdfa7f7c";
|
|
55
145
|
static readonly STEP_TYPE = "COLLECTION_AMCO";
|
|
56
|
-
static readonly AUTO_LINK_PARENT =
|
|
146
|
+
static readonly AUTO_LINK_PARENT = true;
|
|
57
147
|
readonly actionName: string;
|
|
58
148
|
readonly schemaActionId: string;
|
|
59
149
|
readonly entity: string;
|
|
60
|
-
constructor(
|
|
61
|
-
id: string;
|
|
62
|
-
entity: string;
|
|
63
|
-
type?: string;
|
|
64
|
-
}, properties: CreateCollectionAmcoFollowOnWorkOrderProperties, options?: {
|
|
150
|
+
constructor(properties: CreateCollectionAmcoFollowOnWorkOrderProperties, options?: {
|
|
65
151
|
journeyId?: string;
|
|
66
|
-
stageKey?: string;
|
|
67
152
|
});
|
|
68
153
|
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* CreateCollectionAmcoFollowOnWorkOrder Action DTO
|
|
4
4
|
*
|
|
5
|
-
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices
|
|
5
|
+
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices; the first one then moves to Complete.
|
|
6
6
|
*
|
|
7
7
|
* @module FieldServiceModule
|
|
8
8
|
* @entity WorkOrder
|
|
9
9
|
* @entityType COLLECTION_AMCO
|
|
10
10
|
* @actionKey CreateCollectionAmcoFollowOnWorkOrder
|
|
11
|
-
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.
|
|
11
|
+
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder
|
|
12
12
|
*
|
|
13
13
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
14
14
|
*/
|
|
@@ -18,44 +18,42 @@ const core_1 = require("@d19n/odin-types/dist/core");
|
|
|
18
18
|
/**
|
|
19
19
|
* Send Another Bag
|
|
20
20
|
*
|
|
21
|
-
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices
|
|
21
|
+
* Send the customer another bag for the devices a failed inspection found missing. Creates a linked 3PL collection for only those devices; the first one then moves to Complete.
|
|
22
22
|
*
|
|
23
|
-
* @actionType
|
|
23
|
+
* @actionType CREATE - Creates a new WorkOrder record
|
|
24
24
|
* @module FieldServiceModule
|
|
25
25
|
* @entity WorkOrder
|
|
26
26
|
* @entityType COLLECTION_AMCO ( 3PL Collection)
|
|
27
|
-
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.
|
|
27
|
+
* @event k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder
|
|
28
28
|
* @permission schema.action.createcollectionamcofollowonworkorder.trigger
|
|
29
29
|
* @benchmark This action is tracked for performance benchmarks
|
|
30
30
|
*/
|
|
31
|
-
class CreateCollectionAmcoFollowOnWorkOrderDto extends core_1.
|
|
32
|
-
constructor(
|
|
31
|
+
class CreateCollectionAmcoFollowOnWorkOrderDto extends core_1.OdinRecordCreateDto {
|
|
32
|
+
constructor(properties, options) {
|
|
33
33
|
super({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type: record.type,
|
|
34
|
+
entity: 'FieldServiceModule:WorkOrder',
|
|
35
|
+
type: 'COLLECTION_AMCO',
|
|
37
36
|
properties,
|
|
38
37
|
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
39
|
-
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
40
38
|
});
|
|
41
39
|
this.actionName = 'CreateCollectionAmcoFollowOnWorkOrder';
|
|
42
|
-
this.schemaActionId = '
|
|
40
|
+
this.schemaActionId = '54b76d67-a8ea-410a-b157-3f0dc20ab092';
|
|
43
41
|
this.entity = 'FieldServiceModule:WorkOrder';
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
exports.CreateCollectionAmcoFollowOnWorkOrderDto = CreateCollectionAmcoFollowOnWorkOrderDto;
|
|
47
45
|
/** Used by SDK generators to identify action type */
|
|
48
|
-
CreateCollectionAmcoFollowOnWorkOrderDto.ACTION_TYPE = '
|
|
46
|
+
CreateCollectionAmcoFollowOnWorkOrderDto.ACTION_TYPE = 'CREATE';
|
|
49
47
|
CreateCollectionAmcoFollowOnWorkOrderDto.ACTION_KEY = 'CreateCollectionAmcoFollowOnWorkOrder';
|
|
50
48
|
CreateCollectionAmcoFollowOnWorkOrderDto.MODULE_NAME = 'FieldServiceModule';
|
|
51
49
|
CreateCollectionAmcoFollowOnWorkOrderDto.ENTITIES = ['WorkOrder'];
|
|
52
50
|
CreateCollectionAmcoFollowOnWorkOrderDto.ENTITY_TYPE = 'COLLECTION_AMCO';
|
|
53
|
-
CreateCollectionAmcoFollowOnWorkOrderDto.EVENT_NAME = 'k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.
|
|
51
|
+
CreateCollectionAmcoFollowOnWorkOrderDto.EVENT_NAME = 'k1.t-hEOJjsDb.FieldServiceModule.WorkOrder.Create.CreateCollectionAmcoFollowOnWorkOrder';
|
|
54
52
|
CreateCollectionAmcoFollowOnWorkOrderDto.PERMISSION = 'schema.action.createcollectionamcofollowonworkorder.trigger';
|
|
55
53
|
/** Step metadata - entity this action targets */
|
|
56
54
|
CreateCollectionAmcoFollowOnWorkOrderDto.STEP_ENTITY = 'FieldServiceModule:WorkOrder';
|
|
57
55
|
CreateCollectionAmcoFollowOnWorkOrderDto.STEP_SCHEMA_ID = '966bf5d9-163e-4132-85e2-56a5f801c9de';
|
|
58
|
-
CreateCollectionAmcoFollowOnWorkOrderDto.STEP_SCHEMA_ACTION_ID = '
|
|
56
|
+
CreateCollectionAmcoFollowOnWorkOrderDto.STEP_SCHEMA_ACTION_ID = '54b76d67-a8ea-410a-b157-3f0dc20ab092';
|
|
59
57
|
CreateCollectionAmcoFollowOnWorkOrderDto.STEP_SCHEMA_TYPE_ID = '0bf773b2-9054-457e-a282-5ae8fdfa7f7c';
|
|
60
58
|
CreateCollectionAmcoFollowOnWorkOrderDto.STEP_TYPE = 'COLLECTION_AMCO';
|
|
61
|
-
CreateCollectionAmcoFollowOnWorkOrderDto.AUTO_LINK_PARENT =
|
|
59
|
+
CreateCollectionAmcoFollowOnWorkOrderDto.AUTO_LINK_PARENT = true;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { OauthParams } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
2
|
+
import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
|
|
3
|
+
import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
|
|
4
|
+
import { AiRouteRequestProperties } from '../entities-v2/AiRouteRequest';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinApiClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new AiRouteRequestApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.airouterequest.get(id)
|
|
11
|
+
*
|
|
12
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AiRouteRequestApi extends ApiProvider {
|
|
15
|
+
protected readonly authToken?: string;
|
|
16
|
+
private readonly moduleName;
|
|
17
|
+
private readonly entityName;
|
|
18
|
+
private sourceRecord;
|
|
19
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
20
|
+
setRecord(sourceRecord: any): void;
|
|
21
|
+
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
22
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<AiRouteRequestProperties>>>;
|
|
23
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<AiRouteRequestProperties>>>;
|
|
24
|
+
reIndex(body: {
|
|
25
|
+
id: string;
|
|
26
|
+
schemaId: string;
|
|
27
|
+
}[]): Promise<any>;
|
|
28
|
+
get(aiRouteRequestId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AiRouteRequestProperties>>;
|
|
29
|
+
getMany(aiRouteRequestIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AiRouteRequestProperties>[]>;
|
|
30
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
31
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
32
|
+
update(updateDto: OdinRecordUpdateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
33
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
34
|
+
delete(aiRouteRequestId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
35
|
+
deleteMany(aiRouteRequestIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
36
|
+
restore(aiRouteRequestIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinRestoreResponse[]>;
|
|
37
|
+
applyAction(dto: any): Promise<any[]>;
|
|
38
|
+
bulkApplyActions(dtos: any[]): Promise<any[]>;
|
|
39
|
+
getVersions(): Promise<{
|
|
40
|
+
[key: string]: Record<string, any>;
|
|
41
|
+
}>;
|
|
42
|
+
getRevisionTimeline(): Promise<{
|
|
43
|
+
[key: string]: Record<string, any>[];
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
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.AiRouteRequestApi = void 0;
|
|
13
|
+
const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use OdinApiClient.
|
|
16
|
+
*
|
|
17
|
+
* Migration:
|
|
18
|
+
* - Old: new AiRouteRequestApi(authParams).get(id)
|
|
19
|
+
* - New: new odin.airouterequest.get(id)
|
|
20
|
+
*
|
|
21
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
22
|
+
*/
|
|
23
|
+
class AiRouteRequestApi extends api_provider_1.ApiProvider {
|
|
24
|
+
// ============================================
|
|
25
|
+
// PRIVATE BACKING FIELDS (Lazy Loading)
|
|
26
|
+
// ============================================
|
|
27
|
+
constructor(authParams, authToken) {
|
|
28
|
+
super(authParams, authToken);
|
|
29
|
+
this.authToken = authToken;
|
|
30
|
+
this.moduleName = 'SupportModule';
|
|
31
|
+
this.entityName = 'AiRouteRequest';
|
|
32
|
+
// Link managers are lazy-loaded on first access
|
|
33
|
+
}
|
|
34
|
+
// ============================================
|
|
35
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
36
|
+
// ============================================
|
|
37
|
+
// Usage remains identical: api.address.list(recordId)
|
|
38
|
+
// ============================================
|
|
39
|
+
// STANDARD METHODS (Unchanged API)
|
|
40
|
+
// ============================================
|
|
41
|
+
setRecord(sourceRecord) {
|
|
42
|
+
this.sourceRecord = sourceRecord;
|
|
43
|
+
}
|
|
44
|
+
schema() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
50
|
+
search(params) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Use this function when you want paginating through the results to be handled
|
|
56
|
+
searchAndPaginate(params) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// Use this function to re-index records in elastic search
|
|
62
|
+
reIndex(body) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
return yield this._reIndexRecords(body);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// Use this function when you want to return a single record
|
|
68
|
+
get(aiRouteRequestId) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, aiRouteRequestId);
|
|
71
|
+
if (res)
|
|
72
|
+
this.setRecord(res);
|
|
73
|
+
return res;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// Use this function when you want to return many records by primaryKeys
|
|
77
|
+
getMany(aiRouteRequestIds) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, aiRouteRequestIds);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Use this function when you want to upsert one record
|
|
83
|
+
upsert(upsertDto) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
86
|
+
return res[0];
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// Use this function when you want to upsert many records
|
|
90
|
+
upsertMany(upsertDtos) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Use this function when you want to update one record
|
|
96
|
+
update(updateDto) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
99
|
+
return res[0];
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// Use this function when you want to update many records
|
|
103
|
+
updateMany(updateDtos) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// Use this function when you want to delete one record
|
|
109
|
+
delete(aiRouteRequestId) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
return yield this._delete(this.moduleName, this.entityName, [aiRouteRequestId]);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Use this function when you want to delete many records
|
|
115
|
+
deleteMany(aiRouteRequestIds) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
return yield this._delete(this.moduleName, this.entityName, aiRouteRequestIds);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// Use this function when you want to restore one or many records
|
|
121
|
+
restore(aiRouteRequestIds) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
return yield this._restore(this.moduleName, this.entityName, aiRouteRequestIds);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// Use this function when you want to apply a single action
|
|
127
|
+
applyAction(dto) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// Use this function when you want to bulk apply actions
|
|
133
|
+
bulkApplyActions(dtos) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// Use this function when you want to return the versions for a single record
|
|
139
|
+
getVersions() {
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// Use this function when you want to return the change history for a single record
|
|
145
|
+
getRevisionTimeline() {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
exports.AiRouteRequestApi = AiRouteRequestApi;
|
|
@@ -0,0 +1,117 @@
|
|
|
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 { AiRouteRequestProperties } from '../entities-v2/AiRouteRequest';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use OdinDbClient.
|
|
6
|
+
*
|
|
7
|
+
* Migration:
|
|
8
|
+
* - Old: new AiRouteRequestApi(authParams).get(id)
|
|
9
|
+
* - New: new odin.airouterequest.get(id)
|
|
10
|
+
*
|
|
11
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
12
|
+
*
|
|
13
|
+
* Supports separate query options and provider options:
|
|
14
|
+
* - Constructor level: new AiRouteRequestDb(principal, dbService, { omitPermissionsCheck: true })
|
|
15
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
16
|
+
*/
|
|
17
|
+
export declare class AiRouteRequestDb extends DbProvider {
|
|
18
|
+
protected readonly principal: any;
|
|
19
|
+
protected readonly dbService: any;
|
|
20
|
+
private readonly moduleName;
|
|
21
|
+
private readonly entityName;
|
|
22
|
+
private sourceRecord;
|
|
23
|
+
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
24
|
+
setRecord(sourceRecord: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Search records with manual pagination control
|
|
27
|
+
* @param params - Search parameters
|
|
28
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
29
|
+
*/
|
|
30
|
+
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<AiRouteRequestProperties>>>;
|
|
31
|
+
/**
|
|
32
|
+
* Search all records with automatic pagination
|
|
33
|
+
* @param params - Search parameters
|
|
34
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
35
|
+
*/
|
|
36
|
+
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<AiRouteRequestProperties>>>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a single record by primary key
|
|
39
|
+
* @param aiRouteRequestId - Record ID
|
|
40
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
41
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Simple get
|
|
45
|
+
* const record = await db.getByPrimaryKey(id);
|
|
46
|
+
*
|
|
47
|
+
* // With related entities
|
|
48
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
49
|
+
*
|
|
50
|
+
* // With permissions bypass
|
|
51
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
52
|
+
*
|
|
53
|
+
* // Both options
|
|
54
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
55
|
+
*/
|
|
56
|
+
getByPrimaryKey(aiRouteRequestId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AiRouteRequestProperties>>;
|
|
57
|
+
/**
|
|
58
|
+
* Get multiple records by primary keys
|
|
59
|
+
* @param aiRouteRequestIds - Array of record IDs
|
|
60
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
61
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
62
|
+
*/
|
|
63
|
+
getManyByPrimaryKey(aiRouteRequestIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<AiRouteRequestProperties>[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Upsert a single record
|
|
66
|
+
* @param upsertDto - Record to upsert
|
|
67
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
68
|
+
*/
|
|
69
|
+
upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
70
|
+
/**
|
|
71
|
+
* Upsert multiple records
|
|
72
|
+
* @param upsertDtos - Records to upsert
|
|
73
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
74
|
+
*/
|
|
75
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Update a single record
|
|
78
|
+
* @param updateDto - Record to update
|
|
79
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
80
|
+
*/
|
|
81
|
+
update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
82
|
+
/**
|
|
83
|
+
* Update multiple records
|
|
84
|
+
* @param updateDtos - Records to update
|
|
85
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
86
|
+
*/
|
|
87
|
+
updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
88
|
+
/**
|
|
89
|
+
* Delete one or many records
|
|
90
|
+
* @param aiRouteRequestIds - Record IDs to delete
|
|
91
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
92
|
+
*/
|
|
93
|
+
delete(aiRouteRequestIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Restore one or many deleted records
|
|
96
|
+
* @param aiRouteRequestIds - Record IDs to restore
|
|
97
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
98
|
+
*/
|
|
99
|
+
restore(aiRouteRequestIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Apply an action to a record
|
|
102
|
+
* @param actionName - The action key
|
|
103
|
+
* @param dto - The action DTO
|
|
104
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
105
|
+
*/
|
|
106
|
+
applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Get version history for the current source record
|
|
109
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
110
|
+
*/
|
|
111
|
+
getVersions(providerOptions?: DbProviderOptions): Promise<any>;
|
|
112
|
+
/**
|
|
113
|
+
* Get revision timeline for the current source record
|
|
114
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
115
|
+
*/
|
|
116
|
+
getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
|
|
117
|
+
}
|