@d19n/youfibre-odin-sdk 1.0.296-beta.2 → 1.0.296-beta.3
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 +2 -1
- package/dist/actions-v2/AssignCaseByUserDto.d.ts +65 -0
- package/dist/actions-v2/AssignCaseByUserDto.js +49 -0
- package/dist/actions-v2/CreateCashbackRewardDto.d.ts +25 -4
- package/dist/actions-v2/CreateCashbackRewardDto.js +5 -2
- package/dist/records-v2/CaseRecord.d.ts +24 -0
- package/dist/records-v2/CaseRecord.js +36 -0
- package/dist/records-v2/RewardRecord.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -444,7 +444,7 @@ This SDK includes **256** entities across **12** modules.
|
|
|
444
444
|
|
|
445
445
|
## Actions
|
|
446
446
|
|
|
447
|
-
This SDK includes **
|
|
447
|
+
This SDK includes **481** actions.
|
|
448
448
|
|
|
449
449
|
### Action Types
|
|
450
450
|
|
|
@@ -805,6 +805,7 @@ This SDK includes **480** actions.
|
|
|
805
805
|
|
|
806
806
|
| Action | Type | Event |
|
|
807
807
|
|--------|------|-------|
|
|
808
|
+
| `AssignCaseByUser` | UPDATE | SupportModule.Case.Update.AssignCaseByUser |
|
|
808
809
|
| `AssignCase` | UPDATE | SupportModule.Case.Update.AssignCase |
|
|
809
810
|
| `AssignCaseWithNoteFlow` | MULTI_STEP_FLOW | SupportModule.Case.Update.AssignCase |
|
|
810
811
|
| `CaseDefaultStageEscalated` | STAGE_TRANSITION | SupportModule.Case.Update.EscalateCaseAction |
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AssignCaseByUser Action DTO
|
|
3
|
+
*
|
|
4
|
+
* AssignCaseByUser
|
|
5
|
+
*
|
|
6
|
+
* @module SupportModule
|
|
7
|
+
* @entity Case
|
|
8
|
+
* @actionKey AssignCaseByUser
|
|
9
|
+
* @event AssignCaseByUser
|
|
10
|
+
*
|
|
11
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
|
+
*/
|
|
13
|
+
import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent } from '@d19n/odin-types/dist/core';
|
|
14
|
+
/**
|
|
15
|
+
* RabbitMQ message payload for AssignCaseByUser updated events
|
|
16
|
+
*
|
|
17
|
+
* @event SupportModule.Case.Update.AssignCaseByUser
|
|
18
|
+
*/
|
|
19
|
+
export interface AssignCaseByUserMessage extends OdinRecordUpdatedEvent<AssignCaseByUserDto, AssignCaseByUserProperties> {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Properties for AssignCaseByUser action
|
|
23
|
+
*
|
|
24
|
+
* @property Required fields: 0
|
|
25
|
+
* @property Optional fields: 1
|
|
26
|
+
*/
|
|
27
|
+
export interface AssignCaseByUserProperties {
|
|
28
|
+
/**
|
|
29
|
+
* Owner
|
|
30
|
+
*
|
|
31
|
+
* Reference identifier for Case relationships. Used for data integrity.
|
|
32
|
+
* @type {LOOKUP}
|
|
33
|
+
*/
|
|
34
|
+
OwnerId?: string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Assign by user
|
|
38
|
+
*
|
|
39
|
+
* @actionType UPDATE - Updates an existing Case record
|
|
40
|
+
* @module SupportModule
|
|
41
|
+
* @entity Case
|
|
42
|
+
* @event SupportModule.Case.Update.AssignCaseByUser
|
|
43
|
+
* @permission schema.action.assigncasebyuser.trigger
|
|
44
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
45
|
+
*/
|
|
46
|
+
export declare class AssignCaseByUserDto extends OdinRecordUpdateDto<AssignCaseByUserProperties> {
|
|
47
|
+
/** Used by SDK generators to identify action type */
|
|
48
|
+
static readonly ACTION_TYPE = "UPDATE";
|
|
49
|
+
static readonly ACTION_KEY = "AssignCaseByUser";
|
|
50
|
+
static readonly MODULE_NAME = "SupportModule";
|
|
51
|
+
static readonly ENTITIES: string[];
|
|
52
|
+
static readonly EVENT_NAME = "SupportModule.Case.Update.AssignCaseByUser";
|
|
53
|
+
static readonly PERMISSION = "schema.action.assigncasebyuser.trigger";
|
|
54
|
+
readonly actionName: string;
|
|
55
|
+
readonly schemaActionId: string;
|
|
56
|
+
readonly entity: string;
|
|
57
|
+
constructor(record: OdinRecord<any> | {
|
|
58
|
+
id: string;
|
|
59
|
+
entity: string;
|
|
60
|
+
type?: string;
|
|
61
|
+
}, properties: AssignCaseByUserProperties, options?: {
|
|
62
|
+
journeyId?: string;
|
|
63
|
+
stageKey?: string;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AssignCaseByUser Action DTO
|
|
4
|
+
*
|
|
5
|
+
* AssignCaseByUser
|
|
6
|
+
*
|
|
7
|
+
* @module SupportModule
|
|
8
|
+
* @entity Case
|
|
9
|
+
* @actionKey AssignCaseByUser
|
|
10
|
+
* @event AssignCaseByUser
|
|
11
|
+
*
|
|
12
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AssignCaseByUserDto = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* Assign by user
|
|
19
|
+
*
|
|
20
|
+
* @actionType UPDATE - Updates an existing Case record
|
|
21
|
+
* @module SupportModule
|
|
22
|
+
* @entity Case
|
|
23
|
+
* @event SupportModule.Case.Update.AssignCaseByUser
|
|
24
|
+
* @permission schema.action.assigncasebyuser.trigger
|
|
25
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
26
|
+
*/
|
|
27
|
+
class AssignCaseByUserDto extends core_1.OdinRecordUpdateDto {
|
|
28
|
+
constructor(record, properties, options) {
|
|
29
|
+
super({
|
|
30
|
+
id: record.id,
|
|
31
|
+
entity: record.entity,
|
|
32
|
+
type: record.type,
|
|
33
|
+
properties,
|
|
34
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
35
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
36
|
+
});
|
|
37
|
+
this.actionName = 'AssignCaseByUser';
|
|
38
|
+
this.schemaActionId = 'd9e73b2b-3b0f-4822-a5a5-ce9d524b03af';
|
|
39
|
+
this.entity = 'SupportModule:Case';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.AssignCaseByUserDto = AssignCaseByUserDto;
|
|
43
|
+
/** Used by SDK generators to identify action type */
|
|
44
|
+
AssignCaseByUserDto.ACTION_TYPE = 'UPDATE';
|
|
45
|
+
AssignCaseByUserDto.ACTION_KEY = 'AssignCaseByUser';
|
|
46
|
+
AssignCaseByUserDto.MODULE_NAME = 'SupportModule';
|
|
47
|
+
AssignCaseByUserDto.ENTITIES = ['Case'];
|
|
48
|
+
AssignCaseByUserDto.EVENT_NAME = 'SupportModule.Case.Update.AssignCaseByUser';
|
|
49
|
+
AssignCaseByUserDto.PERMISSION = 'schema.action.assigncasebyuser.trigger';
|
|
@@ -22,8 +22,26 @@ export interface CreateCashbackRewardMessage extends OdinRecordCreatedEvent<Crea
|
|
|
22
22
|
/**
|
|
23
23
|
* Properties for CreateCashbackReward action
|
|
24
24
|
*
|
|
25
|
+
* @property Required fields: 2
|
|
26
|
+
* @property Optional fields: 0
|
|
25
27
|
*/
|
|
26
28
|
export interface CreateCashbackRewardProperties {
|
|
29
|
+
/**
|
|
30
|
+
* Amount
|
|
31
|
+
*
|
|
32
|
+
* Reward amount value
|
|
33
|
+
* @type {NUMBER}
|
|
34
|
+
* @required
|
|
35
|
+
*/
|
|
36
|
+
Amount: number;
|
|
37
|
+
/**
|
|
38
|
+
* Currency
|
|
39
|
+
*
|
|
40
|
+
* Currency of the rewarded amount
|
|
41
|
+
* @type {TEXT}
|
|
42
|
+
* @required
|
|
43
|
+
*/
|
|
44
|
+
Currency: string;
|
|
27
45
|
}
|
|
28
46
|
/**
|
|
29
47
|
* Builder for CreateCashbackReward action
|
|
@@ -51,6 +69,7 @@ export declare class CreateCashbackRewardBuilder {
|
|
|
51
69
|
/**
|
|
52
70
|
* Link CampaignRewards
|
|
53
71
|
* @schemaAssociationId f25593e0-9ade-4c4d-84ac-8db3e62be61c
|
|
72
|
+
* @required
|
|
54
73
|
* @param target - The record to link
|
|
55
74
|
* @returns this (for method chaining)
|
|
56
75
|
*/
|
|
@@ -61,6 +80,7 @@ export declare class CreateCashbackRewardBuilder {
|
|
|
61
80
|
/**
|
|
62
81
|
* Link AffiliateCodeRewards
|
|
63
82
|
* @schemaAssociationId 90515d9f-b58c-4171-a370-f1d885c7ad7f
|
|
83
|
+
* @required
|
|
64
84
|
* @param target - The record to link
|
|
65
85
|
* @returns this (for method chaining)
|
|
66
86
|
*/
|
|
@@ -71,6 +91,7 @@ export declare class CreateCashbackRewardBuilder {
|
|
|
71
91
|
/**
|
|
72
92
|
* Link ContactReward
|
|
73
93
|
* @schemaAssociationId 636e8951-0c1a-4e87-a6d3-3329586635d3
|
|
94
|
+
* @required
|
|
74
95
|
* @param target - The record to link
|
|
75
96
|
* @returns this (for method chaining)
|
|
76
97
|
*/
|
|
@@ -125,22 +146,22 @@ export declare class CreateCashbackRewardDto extends OdinRecordCreateDto<CreateC
|
|
|
125
146
|
static readonly EVENT_NAME = "CrmModule.Reward.Create.CreateCashbackReward";
|
|
126
147
|
static readonly PERMISSION = "schema.action.createcashbackreward.trigger";
|
|
127
148
|
static readonly HAS_ASSOCIATIONS = true;
|
|
128
|
-
static readonly HAS_REQUIRED_ASSOCIATIONS =
|
|
149
|
+
static readonly HAS_REQUIRED_ASSOCIATIONS = true;
|
|
129
150
|
static readonly BUILDER_CLASS = "CreateCashbackRewardBuilder";
|
|
130
151
|
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
131
152
|
readonly name: "CampaignRewards";
|
|
132
153
|
readonly methodName: "linkCampaignRewards";
|
|
133
|
-
readonly required:
|
|
154
|
+
readonly required: true;
|
|
134
155
|
readonly schemaAssociationId: "f25593e0-9ade-4c4d-84ac-8db3e62be61c";
|
|
135
156
|
}, {
|
|
136
157
|
readonly name: "AffiliateCodeRewards";
|
|
137
158
|
readonly methodName: "linkAffiliateCodeRewards";
|
|
138
|
-
readonly required:
|
|
159
|
+
readonly required: true;
|
|
139
160
|
readonly schemaAssociationId: "90515d9f-b58c-4171-a370-f1d885c7ad7f";
|
|
140
161
|
}, {
|
|
141
162
|
readonly name: "ContactReward";
|
|
142
163
|
readonly methodName: "linkContactReward";
|
|
143
|
-
readonly required:
|
|
164
|
+
readonly required: true;
|
|
144
165
|
readonly schemaAssociationId: "636e8951-0c1a-4e87-a6d3-3329586635d3";
|
|
145
166
|
}, {
|
|
146
167
|
readonly name: "RewardPaymentMethodRefund";
|
|
@@ -39,6 +39,7 @@ class CreateCashbackRewardBuilder {
|
|
|
39
39
|
/**
|
|
40
40
|
* Link CampaignRewards
|
|
41
41
|
* @schemaAssociationId f25593e0-9ade-4c4d-84ac-8db3e62be61c
|
|
42
|
+
* @required
|
|
42
43
|
* @param target - The record to link
|
|
43
44
|
* @returns this (for method chaining)
|
|
44
45
|
*/
|
|
@@ -52,6 +53,7 @@ class CreateCashbackRewardBuilder {
|
|
|
52
53
|
/**
|
|
53
54
|
* Link AffiliateCodeRewards
|
|
54
55
|
* @schemaAssociationId 90515d9f-b58c-4171-a370-f1d885c7ad7f
|
|
56
|
+
* @required
|
|
55
57
|
* @param target - The record to link
|
|
56
58
|
* @returns this (for method chaining)
|
|
57
59
|
*/
|
|
@@ -65,6 +67,7 @@ class CreateCashbackRewardBuilder {
|
|
|
65
67
|
/**
|
|
66
68
|
* Link ContactReward
|
|
67
69
|
* @schemaAssociationId 636e8951-0c1a-4e87-a6d3-3329586635d3
|
|
70
|
+
* @required
|
|
68
71
|
* @param target - The record to link
|
|
69
72
|
* @returns this (for method chaining)
|
|
70
73
|
*/
|
|
@@ -143,6 +146,6 @@ CreateCashbackRewardDto.ENTITY_TYPE = 'CASHBACK';
|
|
|
143
146
|
CreateCashbackRewardDto.EVENT_NAME = 'CrmModule.Reward.Create.CreateCashbackReward';
|
|
144
147
|
CreateCashbackRewardDto.PERMISSION = 'schema.action.createcashbackreward.trigger';
|
|
145
148
|
CreateCashbackRewardDto.HAS_ASSOCIATIONS = true;
|
|
146
|
-
CreateCashbackRewardDto.HAS_REQUIRED_ASSOCIATIONS =
|
|
149
|
+
CreateCashbackRewardDto.HAS_REQUIRED_ASSOCIATIONS = true;
|
|
147
150
|
CreateCashbackRewardDto.BUILDER_CLASS = 'CreateCashbackRewardBuilder';
|
|
148
|
-
CreateCashbackRewardDto.ASSOCIATION_FIELDS = [{ "name": "CampaignRewards", "methodName": "linkCampaignRewards", "required":
|
|
151
|
+
CreateCashbackRewardDto.ASSOCIATION_FIELDS = [{ "name": "CampaignRewards", "methodName": "linkCampaignRewards", "required": true, "schemaAssociationId": "f25593e0-9ade-4c4d-84ac-8db3e62be61c" }, { "name": "AffiliateCodeRewards", "methodName": "linkAffiliateCodeRewards", "required": true, "schemaAssociationId": "90515d9f-b58c-4171-a370-f1d885c7ad7f" }, { "name": "ContactReward", "methodName": "linkContactReward", "required": true, "schemaAssociationId": "636e8951-0c1a-4e87-a6d3-3329586635d3" }, { "name": "RewardPaymentMethodRefund", "methodName": "linkRewardPaymentMethodRefund", "required": false, "schemaAssociationId": "8598b653-c4e8-4e8b-a9e4-28b7f534cdcd" }];
|
|
@@ -20,6 +20,7 @@ import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/
|
|
|
20
20
|
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
21
21
|
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
22
22
|
import { CaseProperties, OutageCaseProperties } from '../entities-v2/Case';
|
|
23
|
+
import { AssignCaseByUserProperties } from '../actions-v2/AssignCaseByUserDto';
|
|
23
24
|
import { AssignCaseProperties } from '../actions-v2/AssignCaseDto';
|
|
24
25
|
import { CreateNoteForCaseAssignmentProperties } from '../actions-v2/AssignCaseWithNoteFlowDto';
|
|
25
26
|
import { EscalateCaseActionProperties } from '../actions-v2/CaseDefaultStageEscalatedDto';
|
|
@@ -898,6 +899,29 @@ export declare class CaseRecord<TProps = CaseProperties> {
|
|
|
898
899
|
journeyId?: string;
|
|
899
900
|
stageKey?: string;
|
|
900
901
|
}): Promise<IDbRecordCreateUpdateRes[]>;
|
|
902
|
+
/**
|
|
903
|
+
* AssignCaseByUser
|
|
904
|
+
*
|
|
905
|
+
* Updates this Case record.
|
|
906
|
+
*
|
|
907
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
908
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
909
|
+
* @returns The updated record(s)
|
|
910
|
+
* @throws Error if called on a new (unsaved) record
|
|
911
|
+
*
|
|
912
|
+
* @example
|
|
913
|
+
* ```typescript
|
|
914
|
+
* const record = await odinClient.cases.get(id);
|
|
915
|
+
* await record.assignCaseByUser({ ... });
|
|
916
|
+
* ```
|
|
917
|
+
*/
|
|
918
|
+
assignCaseByUser(propertiesOrOptions?: AssignCaseByUserProperties | {
|
|
919
|
+
journeyId?: string;
|
|
920
|
+
stageKey?: string;
|
|
921
|
+
}, options?: {
|
|
922
|
+
journeyId?: string;
|
|
923
|
+
stageKey?: string;
|
|
924
|
+
}): Promise<IDbRecordCreateUpdateRes[]>;
|
|
901
925
|
/**
|
|
902
926
|
* AssignCase
|
|
903
927
|
*
|
|
@@ -1207,6 +1207,42 @@ class CaseRecord {
|
|
|
1207
1207
|
// ============================================
|
|
1208
1208
|
// UPDATE ACTIONS (require existing record)
|
|
1209
1209
|
// ============================================
|
|
1210
|
+
/**
|
|
1211
|
+
* AssignCaseByUser
|
|
1212
|
+
*
|
|
1213
|
+
* Updates this Case record.
|
|
1214
|
+
*
|
|
1215
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
1216
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
1217
|
+
* @returns The updated record(s)
|
|
1218
|
+
* @throws Error if called on a new (unsaved) record
|
|
1219
|
+
*
|
|
1220
|
+
* @example
|
|
1221
|
+
* ```typescript
|
|
1222
|
+
* const record = await odinClient.cases.get(id);
|
|
1223
|
+
* await record.assignCaseByUser({ ... });
|
|
1224
|
+
* ```
|
|
1225
|
+
*/
|
|
1226
|
+
assignCaseByUser(propertiesOrOptions, options) {
|
|
1227
|
+
var _a;
|
|
1228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1229
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
1230
|
+
throw new Error('assignCaseByUser requires an existing record. Use accessor.get() first.');
|
|
1231
|
+
let properties = {};
|
|
1232
|
+
let opts = options;
|
|
1233
|
+
if (propertiesOrOptions) {
|
|
1234
|
+
if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
|
|
1235
|
+
opts = propertiesOrOptions;
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
properties = propertiesOrOptions;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
const result = yield this._provider._applyAction('SupportModule', 'Case', Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'AssignCaseByUser', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts));
|
|
1242
|
+
this._pendingLinks = [];
|
|
1243
|
+
return result;
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1210
1246
|
/**
|
|
1211
1247
|
* AssignCase
|
|
1212
1248
|
*
|
|
@@ -192,7 +192,7 @@ export declare class RewardRecord<TProps = RewardProperties> {
|
|
|
192
192
|
* .createCashbackReward({ ... });
|
|
193
193
|
* ```
|
|
194
194
|
*/
|
|
195
|
-
createCashbackReward(properties
|
|
195
|
+
createCashbackReward(properties: CreateCashbackRewardProperties, options?: {
|
|
196
196
|
type?: string;
|
|
197
197
|
journeyId?: string;
|
|
198
198
|
stageKey?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d19n/youfibre-odin-sdk",
|
|
3
|
-
"version": "1.0.296-beta.
|
|
3
|
+
"version": "1.0.296-beta.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "@d19n",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typescript": "4.8.4"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@d19n/odin-sdk-generator": "^3.0.
|
|
14
|
+
"@d19n/odin-sdk-generator": "^3.0.189",
|
|
15
15
|
"@d19n/odin-types": "^3.0.18",
|
|
16
16
|
"@d19n/youfibre-odin-sdk": "^1.0.219"
|
|
17
17
|
},
|