@d19n/youfibre-odin-sdk 2.0.36 → 2.0.37
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/CreateExchangeDto.d.ts +8 -1
- package/dist/actions-v2/UpdateExchangeDto.d.ts +102 -0
- package/dist/actions-v2/UpdateExchangeDto.js +56 -0
- package/dist/entities-v2/Exchange.d.ts +7 -0
- package/dist/entities-v2/Exchange.js +2 -0
- package/dist/records-v2/ExchangeRecord.d.ts +27 -0
- package/dist/records-v2/ExchangeRecord.js +32 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -352,7 +352,7 @@ This SDK includes **164** entities across **12** modules.
|
|
|
352
352
|
|
|
353
353
|
## Actions
|
|
354
354
|
|
|
355
|
-
This SDK includes **
|
|
355
|
+
This SDK includes **598** actions.
|
|
356
356
|
|
|
357
357
|
### Action Types
|
|
358
358
|
|
|
@@ -1232,6 +1232,7 @@ This SDK includes **597** actions.
|
|
|
1232
1232
|
| Action | Type | Event |
|
|
1233
1233
|
|--------|------|-------|
|
|
1234
1234
|
| `CreateExchange` | CREATE | k1.t-hEOJjsDb.ProjectModule.Exchange.Create.CreateExchange |
|
|
1235
|
+
| `UpdateExchange` | UPDATE | k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange |
|
|
1235
1236
|
|
|
1236
1237
|
#### FieldServiceDispatchedProduct
|
|
1237
1238
|
|
|
@@ -22,7 +22,7 @@ export interface CreateExchangeMessage extends OdinRecordCreatedEvent<CreateExch
|
|
|
22
22
|
* Properties for CreateExchange action
|
|
23
23
|
*
|
|
24
24
|
* @property Required fields: 2
|
|
25
|
-
* @property Optional fields:
|
|
25
|
+
* @property Optional fields: 3
|
|
26
26
|
*/
|
|
27
27
|
export interface CreateExchangeProperties {
|
|
28
28
|
/**
|
|
@@ -55,6 +55,13 @@ export interface CreateExchangeProperties {
|
|
|
55
55
|
* @type {TEXT}
|
|
56
56
|
*/
|
|
57
57
|
Borough?: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* SalesTerritoryId
|
|
60
|
+
*
|
|
61
|
+
* Related SalesTerritory
|
|
62
|
+
* @type {LOOKUP}
|
|
63
|
+
*/
|
|
64
|
+
SalesTerritoryId?: string | null;
|
|
58
65
|
}
|
|
59
66
|
/**
|
|
60
67
|
* CreateExchange
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UpdateExchange Action DTO
|
|
3
|
+
*
|
|
4
|
+
* Update Exchange
|
|
5
|
+
*
|
|
6
|
+
* @module ProjectModule
|
|
7
|
+
* @entity Exchange
|
|
8
|
+
* @actionKey UpdateExchange
|
|
9
|
+
* @event k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange
|
|
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 UpdateExchange updated events
|
|
16
|
+
*
|
|
17
|
+
* @event k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange
|
|
18
|
+
*/
|
|
19
|
+
export interface UpdateExchangeMessage extends OdinRecordUpdatedEvent<UpdateExchangeDto, UpdateExchangeProperties> {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Properties for UpdateExchange action
|
|
23
|
+
*
|
|
24
|
+
* @property Required fields: 2
|
|
25
|
+
* @property Optional fields: 3
|
|
26
|
+
*/
|
|
27
|
+
export interface UpdateExchangeProperties {
|
|
28
|
+
/**
|
|
29
|
+
* ExPolygonId
|
|
30
|
+
*
|
|
31
|
+
* ExPolygonId (Project Management - Exchange)
|
|
32
|
+
* @type {NUMBER}
|
|
33
|
+
* @required
|
|
34
|
+
*/
|
|
35
|
+
ExPolygonId: number;
|
|
36
|
+
/**
|
|
37
|
+
* ExternalRef
|
|
38
|
+
*
|
|
39
|
+
* ID of the exchange in the cosmos table (Project Management - Exchange)
|
|
40
|
+
* @type {NUMBER}
|
|
41
|
+
* @required
|
|
42
|
+
*/
|
|
43
|
+
ExternalRef: number;
|
|
44
|
+
/**
|
|
45
|
+
* Name
|
|
46
|
+
*
|
|
47
|
+
* Name of exchange
|
|
48
|
+
* @type {TEXT}
|
|
49
|
+
*/
|
|
50
|
+
Name?: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Borough
|
|
53
|
+
*
|
|
54
|
+
* Data field for Exchange records. Used by Project Management team.
|
|
55
|
+
* @type {TEXT}
|
|
56
|
+
*/
|
|
57
|
+
Borough?: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* SalesTerritoryId
|
|
60
|
+
*
|
|
61
|
+
* Related SalesTerritory
|
|
62
|
+
* @type {LOOKUP}
|
|
63
|
+
*/
|
|
64
|
+
SalesTerritoryId?: string | null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* UpdateExchange
|
|
68
|
+
*
|
|
69
|
+
* Update Exchange
|
|
70
|
+
*
|
|
71
|
+
* @actionType UPDATE - Updates an existing Exchange record
|
|
72
|
+
* @module ProjectModule
|
|
73
|
+
* @entity Exchange
|
|
74
|
+
* @event k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange
|
|
75
|
+
* @permission schema.action.updateexchange.trigger
|
|
76
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
77
|
+
*/
|
|
78
|
+
export declare class UpdateExchangeDto extends OdinRecordUpdateDto<UpdateExchangeProperties> {
|
|
79
|
+
/** Used by SDK generators to identify action type */
|
|
80
|
+
static readonly ACTION_TYPE = "UPDATE";
|
|
81
|
+
static readonly ACTION_KEY = "UpdateExchange";
|
|
82
|
+
static readonly MODULE_NAME = "ProjectModule";
|
|
83
|
+
static readonly ENTITIES: string[];
|
|
84
|
+
static readonly EVENT_NAME = "k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange";
|
|
85
|
+
static readonly PERMISSION = "schema.action.updateexchange.trigger";
|
|
86
|
+
/** Step metadata - entity this action targets */
|
|
87
|
+
static readonly STEP_ENTITY = "ProjectModule:Exchange";
|
|
88
|
+
static readonly STEP_SCHEMA_ID = "e8162e52-c785-4094-a812-83b7b86e587e";
|
|
89
|
+
static readonly STEP_SCHEMA_ACTION_ID = "38c072b5-e881-47db-b641-df2b1c61b3db";
|
|
90
|
+
static readonly AUTO_LINK_PARENT = false;
|
|
91
|
+
readonly actionName: string;
|
|
92
|
+
readonly schemaActionId: string;
|
|
93
|
+
readonly entity: string;
|
|
94
|
+
constructor(record: OdinRecord<any> | {
|
|
95
|
+
id: string;
|
|
96
|
+
entity: string;
|
|
97
|
+
type?: string;
|
|
98
|
+
}, properties: UpdateExchangeProperties, options?: {
|
|
99
|
+
journeyId?: string;
|
|
100
|
+
stageKey?: string;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* UpdateExchange Action DTO
|
|
4
|
+
*
|
|
5
|
+
* Update Exchange
|
|
6
|
+
*
|
|
7
|
+
* @module ProjectModule
|
|
8
|
+
* @entity Exchange
|
|
9
|
+
* @actionKey UpdateExchange
|
|
10
|
+
* @event k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange
|
|
11
|
+
*
|
|
12
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.UpdateExchangeDto = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* UpdateExchange
|
|
19
|
+
*
|
|
20
|
+
* Update Exchange
|
|
21
|
+
*
|
|
22
|
+
* @actionType UPDATE - Updates an existing Exchange record
|
|
23
|
+
* @module ProjectModule
|
|
24
|
+
* @entity Exchange
|
|
25
|
+
* @event k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange
|
|
26
|
+
* @permission schema.action.updateexchange.trigger
|
|
27
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
28
|
+
*/
|
|
29
|
+
class UpdateExchangeDto extends core_1.OdinRecordUpdateDto {
|
|
30
|
+
constructor(record, properties, options) {
|
|
31
|
+
super({
|
|
32
|
+
id: record.id,
|
|
33
|
+
entity: record.entity,
|
|
34
|
+
type: record.type,
|
|
35
|
+
properties,
|
|
36
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
37
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
38
|
+
});
|
|
39
|
+
this.actionName = 'UpdateExchange';
|
|
40
|
+
this.schemaActionId = '38c072b5-e881-47db-b641-df2b1c61b3db';
|
|
41
|
+
this.entity = 'ProjectModule:Exchange';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.UpdateExchangeDto = UpdateExchangeDto;
|
|
45
|
+
/** Used by SDK generators to identify action type */
|
|
46
|
+
UpdateExchangeDto.ACTION_TYPE = 'UPDATE';
|
|
47
|
+
UpdateExchangeDto.ACTION_KEY = 'UpdateExchange';
|
|
48
|
+
UpdateExchangeDto.MODULE_NAME = 'ProjectModule';
|
|
49
|
+
UpdateExchangeDto.ENTITIES = ['Exchange'];
|
|
50
|
+
UpdateExchangeDto.EVENT_NAME = 'k1.t-hEOJjsDb.ProjectModule.Exchange.Update.UpdateExchange';
|
|
51
|
+
UpdateExchangeDto.PERMISSION = 'schema.action.updateexchange.trigger';
|
|
52
|
+
/** Step metadata - entity this action targets */
|
|
53
|
+
UpdateExchangeDto.STEP_ENTITY = 'ProjectModule:Exchange';
|
|
54
|
+
UpdateExchangeDto.STEP_SCHEMA_ID = 'e8162e52-c785-4094-a812-83b7b86e587e';
|
|
55
|
+
UpdateExchangeDto.STEP_SCHEMA_ACTION_ID = '38c072b5-e881-47db-b641-df2b1c61b3db';
|
|
56
|
+
UpdateExchangeDto.AUTO_LINK_PARENT = false;
|
|
@@ -27,6 +27,8 @@ export declare enum ExchangeEntityTypes {
|
|
|
27
27
|
export declare enum ExchangePropertyKeys {
|
|
28
28
|
/** Name of exchange */
|
|
29
29
|
Name = "Name",
|
|
30
|
+
/** Related SalesTerritory */
|
|
31
|
+
SalesTerritoryId = "SalesTerritoryId",
|
|
30
32
|
/** Data field for Exchange records. Used by Project Management team. */
|
|
31
33
|
Borough = "Borough",
|
|
32
34
|
/** ExPolygonId (Project Management - Exchange) */
|
|
@@ -45,6 +47,11 @@ export interface ExchangeProperties {
|
|
|
45
47
|
* @type {TEXT}
|
|
46
48
|
*/
|
|
47
49
|
Name: string;
|
|
50
|
+
/** Related SalesTerritory
|
|
51
|
+
*
|
|
52
|
+
* @type {LOOKUP}
|
|
53
|
+
*/
|
|
54
|
+
SalesTerritoryId: string;
|
|
48
55
|
/** Data field for Exchange records. Used by Project Management team.
|
|
49
56
|
*
|
|
50
57
|
* @type {TEXT}
|
|
@@ -30,6 +30,8 @@ var ExchangePropertyKeys;
|
|
|
30
30
|
(function (ExchangePropertyKeys) {
|
|
31
31
|
/** Name of exchange */
|
|
32
32
|
ExchangePropertyKeys["Name"] = "Name";
|
|
33
|
+
/** Related SalesTerritory */
|
|
34
|
+
ExchangePropertyKeys["SalesTerritoryId"] = "SalesTerritoryId";
|
|
33
35
|
/** Data field for Exchange records. Used by Project Management team. */
|
|
34
36
|
ExchangePropertyKeys["Borough"] = "Borough";
|
|
35
37
|
/** ExPolygonId (Project Management - Exchange) */
|
|
@@ -22,6 +22,7 @@ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
|
22
22
|
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
23
23
|
import { ExchangeProperties } from '../entities-v2/Exchange';
|
|
24
24
|
import { CreateExchangeProperties } from '../actions-v2/CreateExchangeDto';
|
|
25
|
+
import { UpdateExchangeProperties } from '../actions-v2/UpdateExchangeDto';
|
|
25
26
|
import { SalesTerritoryRecord } from './SalesTerritoryRecord';
|
|
26
27
|
/**
|
|
27
28
|
* Builder for action execution with dryRun support
|
|
@@ -179,6 +180,32 @@ export declare class ExchangeRecord<TProps = ExchangeProperties> {
|
|
|
179
180
|
journeyId?: string;
|
|
180
181
|
stageKey?: string;
|
|
181
182
|
}): ActionBuilder;
|
|
183
|
+
/**
|
|
184
|
+
* UpdateExchange
|
|
185
|
+
*
|
|
186
|
+
* Updates this Exchange record with the specified properties.
|
|
187
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
188
|
+
*
|
|
189
|
+
* @param properties - Required properties for this action
|
|
190
|
+
* @param options - Optional settings
|
|
191
|
+
* @param options.journeyId - Associate with a journey
|
|
192
|
+
* @param options.stageKey - Transition to pipeline stage
|
|
193
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
194
|
+
* @throws Error if called on a new (unsaved) record
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* const record = await odinClient.exchanges.get(id);
|
|
199
|
+
* await record.updateExchange({ ... }).execute();
|
|
200
|
+
*
|
|
201
|
+
* // Dry run (for debugging)
|
|
202
|
+
* const payload = record.updateExchange({ ... }).dryRun();
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
updateExchange(properties: UpdateExchangeProperties, options?: {
|
|
206
|
+
journeyId?: string;
|
|
207
|
+
stageKey?: string;
|
|
208
|
+
}): ActionBuilder;
|
|
182
209
|
}
|
|
183
210
|
/** Type guard to check if an object is a ExchangeRecord */
|
|
184
211
|
export declare function isExchangeRecord(obj: any): obj is ExchangeRecord;
|
|
@@ -245,6 +245,38 @@ class ExchangeRecord {
|
|
|
245
245
|
};
|
|
246
246
|
return new ActionBuilder(this._provider, 'ProjectModule', 'Exchange', payload, () => { this._pendingLinks = []; });
|
|
247
247
|
}
|
|
248
|
+
// ============================================
|
|
249
|
+
// UPDATE ACTIONS (require existing record)
|
|
250
|
+
// ============================================
|
|
251
|
+
/**
|
|
252
|
+
* UpdateExchange
|
|
253
|
+
*
|
|
254
|
+
* Updates this Exchange record with the specified properties.
|
|
255
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
256
|
+
*
|
|
257
|
+
* @param properties - Required properties for this action
|
|
258
|
+
* @param options - Optional settings
|
|
259
|
+
* @param options.journeyId - Associate with a journey
|
|
260
|
+
* @param options.stageKey - Transition to pipeline stage
|
|
261
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
262
|
+
* @throws Error if called on a new (unsaved) record
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```typescript
|
|
266
|
+
* const record = await odinClient.exchanges.get(id);
|
|
267
|
+
* await record.updateExchange({ ... }).execute();
|
|
268
|
+
*
|
|
269
|
+
* // Dry run (for debugging)
|
|
270
|
+
* const payload = record.updateExchange({ ... }).dryRun();
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
updateExchange(properties, options) {
|
|
274
|
+
var _a;
|
|
275
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
276
|
+
throw new Error('updateExchange requires an existing record. Use accessor.get() first.');
|
|
277
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateExchange', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options);
|
|
278
|
+
return new ActionBuilder(this._provider, 'ProjectModule', 'Exchange', payload, () => { this._pendingLinks = []; });
|
|
279
|
+
}
|
|
248
280
|
}
|
|
249
281
|
exports.ExchangeRecord = ExchangeRecord;
|
|
250
282
|
// ============================================
|