@d19n/youfibre-odin-sdk 2.0.33 → 2.0.35

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.
Files changed (46) hide show
  1. package/README.md +8 -1
  2. package/dist/EntityRegistry.d.ts +2 -0
  3. package/dist/EntityRegistry.js +2 -0
  4. package/dist/OdinApiClient.d.ts +4 -0
  5. package/dist/OdinApiClient.js +8 -0
  6. package/dist/OdinDbClient.d.ts +4 -0
  7. package/dist/OdinDbClient.js +8 -0
  8. package/dist/accessors-v2/ExchangeAccessor.d.ts +111 -0
  9. package/dist/accessors-v2/ExchangeAccessor.js +190 -0
  10. package/dist/accessors-v2/index.d.ts +1 -0
  11. package/dist/accessors-v2/index.js +5 -3
  12. package/dist/actions-v2/CaseDefaultStageEscalatedDto.d.ts +9 -1
  13. package/dist/actions-v2/CreateExchangeDto.d.ts +90 -0
  14. package/dist/actions-v2/CreateExchangeDto.js +54 -0
  15. package/dist/actions-v2/EditProvidersDto.d.ts +71 -0
  16. package/dist/actions-v2/EditProvidersDto.js +54 -0
  17. package/dist/actions-v2/EscalateCaseActionDto.d.ts +9 -1
  18. package/dist/actions-v2/EscalateCaseTransitionDto.d.ts +9 -1
  19. package/dist/actions-v2/OverlayA55UpdateDto.d.ts +54 -0
  20. package/dist/actions-v2/UpdateTeamDto.d.ts +8 -1
  21. package/dist/db-accessors-v2/ExchangeDbAccessor.d.ts +149 -0
  22. package/dist/db-accessors-v2/ExchangeDbAccessor.js +227 -0
  23. package/dist/db-accessors-v2/index.d.ts +1 -0
  24. package/dist/db-accessors-v2/index.js +5 -3
  25. package/dist/entities-v2/Case.d.ts +5 -0
  26. package/dist/entities-v2/Case.js +5 -0
  27. package/dist/entities-v2/Config.d.ts +8 -8
  28. package/dist/entities-v2/Config.js +4 -4
  29. package/dist/entities-v2/Exchange.d.ts +7 -0
  30. package/dist/entities-v2/Exchange.js +2 -0
  31. package/dist/entities-v2/OhInstallationAudit.d.ts +12 -12
  32. package/dist/entities-v2/OhInstallationAudit.js +2 -2
  33. package/dist/entities-v2/Order.d.ts +1 -0
  34. package/dist/entities-v2/OverlayRealA55.d.ts +286 -202
  35. package/dist/entities-v2/OverlayRealA55.js +109 -95
  36. package/dist/entities-v2/Team.d.ts +22 -1
  37. package/dist/entities-v2/Team.js +17 -1
  38. package/dist/records-v2/CaseRecord.d.ts +28 -0
  39. package/dist/records-v2/CaseRecord.js +37 -0
  40. package/dist/records-v2/ExchangeRecord.d.ts +185 -0
  41. package/dist/records-v2/ExchangeRecord.js +259 -0
  42. package/dist/records-v2/SalesTerritoryRecord.d.ts +20 -0
  43. package/dist/records-v2/SalesTerritoryRecord.js +33 -0
  44. package/dist/records-v2/index.d.ts +1 -0
  45. package/dist/records-v2/index.js +6 -3
  46. package/package.json +1 -1
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * CreateExchange Action DTO
4
+ *
5
+ * Create new Exchange
6
+ *
7
+ * @module ProjectModule
8
+ * @entity Exchange
9
+ * @actionKey CreateExchange
10
+ * @event k1.t-hEOJjsDb.ProjectModule.Exchange.Create.CreateExchange
11
+ *
12
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.CreateExchangeDto = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * CreateExchange
19
+ *
20
+ * Create new Exchange
21
+ *
22
+ * @actionType CREATE - Creates a new Exchange record
23
+ * @module ProjectModule
24
+ * @entity Exchange
25
+ * @event k1.t-hEOJjsDb.ProjectModule.Exchange.Create.CreateExchange
26
+ * @permission schema.action.createexchange.trigger
27
+ * @benchmark This action is tracked for performance benchmarks
28
+ */
29
+ class CreateExchangeDto extends core_1.OdinRecordCreateDto {
30
+ constructor(properties, options) {
31
+ super({
32
+ entity: 'ProjectModule:Exchange',
33
+ type: undefined,
34
+ properties,
35
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
36
+ });
37
+ this.actionName = 'CreateExchange';
38
+ this.schemaActionId = '311ea5ad-5b4b-4b5e-b631-c235a2501c0e';
39
+ this.entity = 'ProjectModule:Exchange';
40
+ }
41
+ }
42
+ exports.CreateExchangeDto = CreateExchangeDto;
43
+ /** Used by SDK generators to identify action type */
44
+ CreateExchangeDto.ACTION_TYPE = 'CREATE';
45
+ CreateExchangeDto.ACTION_KEY = 'CreateExchange';
46
+ CreateExchangeDto.MODULE_NAME = 'ProjectModule';
47
+ CreateExchangeDto.ENTITIES = ['Exchange'];
48
+ CreateExchangeDto.EVENT_NAME = 'k1.t-hEOJjsDb.ProjectModule.Exchange.Create.CreateExchange';
49
+ CreateExchangeDto.PERMISSION = 'schema.action.createexchange.trigger';
50
+ /** Step metadata - entity this action targets */
51
+ CreateExchangeDto.STEP_ENTITY = 'ProjectModule:Exchange';
52
+ CreateExchangeDto.STEP_SCHEMA_ID = 'e8162e52-c785-4094-a812-83b7b86e587e';
53
+ CreateExchangeDto.STEP_SCHEMA_ACTION_ID = '311ea5ad-5b4b-4b5e-b631-c235a2501c0e';
54
+ CreateExchangeDto.AUTO_LINK_PARENT = true;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * EditProviders Action DTO
3
+ *
4
+ * EditProviders
5
+ *
6
+ * @module SupportModule
7
+ * @entity Case
8
+ * @actionKey EditProviders
9
+ * @event k1.t-hEOJjsDb.SupportModule.Case.Update.EditProviders
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 EditProviders updated events
16
+ *
17
+ * @event k1.t-hEOJjsDb.SupportModule.Case.Update.EditProviders
18
+ */
19
+ export interface EditProvidersMessage extends OdinRecordUpdatedEvent<EditProvidersDto, EditProvidersProperties> {
20
+ }
21
+ /**
22
+ * Properties for EditProviders action
23
+ *
24
+ * @property Required fields: 0
25
+ * @property Optional fields: 1
26
+ */
27
+ export interface EditProvidersProperties {
28
+ /**
29
+ * Providers
30
+ *
31
+ * Providers
32
+ * @type {ENUM}
33
+ * @validWhen Providers eq ["Brsk","Netomnia"]
34
+ */
35
+ Providers?: string | null;
36
+ }
37
+ /**
38
+ * EditProviders
39
+ *
40
+ * @actionType UPDATE - Updates an existing Case record
41
+ * @module SupportModule
42
+ * @entity Case
43
+ * @event k1.t-hEOJjsDb.SupportModule.Case.Update.EditProviders
44
+ * @permission schema.action.editproviders.trigger
45
+ * @benchmark This action is tracked for performance benchmarks
46
+ */
47
+ export declare class EditProvidersDto extends OdinRecordUpdateDto<EditProvidersProperties> {
48
+ /** Used by SDK generators to identify action type */
49
+ static readonly ACTION_TYPE = "UPDATE";
50
+ static readonly ACTION_KEY = "EditProviders";
51
+ static readonly MODULE_NAME = "SupportModule";
52
+ static readonly ENTITIES: string[];
53
+ static readonly EVENT_NAME = "k1.t-hEOJjsDb.SupportModule.Case.Update.EditProviders";
54
+ static readonly PERMISSION = "schema.action.editproviders.trigger";
55
+ /** Step metadata - entity this action targets */
56
+ static readonly STEP_ENTITY = "SupportModule:Case";
57
+ static readonly STEP_SCHEMA_ID = "be8173eb-269b-4a67-be0c-11ce6af5d561";
58
+ static readonly STEP_SCHEMA_ACTION_ID = "4d433b1d-1810-4ed5-83df-6dab18f45ca5";
59
+ static readonly AUTO_LINK_PARENT = false;
60
+ readonly actionName: string;
61
+ readonly schemaActionId: string;
62
+ readonly entity: string;
63
+ constructor(record: OdinRecord<any> | {
64
+ id: string;
65
+ entity: string;
66
+ type?: string;
67
+ }, properties: EditProvidersProperties, options?: {
68
+ journeyId?: string;
69
+ stageKey?: string;
70
+ });
71
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * EditProviders Action DTO
4
+ *
5
+ * EditProviders
6
+ *
7
+ * @module SupportModule
8
+ * @entity Case
9
+ * @actionKey EditProviders
10
+ * @event k1.t-hEOJjsDb.SupportModule.Case.Update.EditProviders
11
+ *
12
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.EditProvidersDto = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * EditProviders
19
+ *
20
+ * @actionType UPDATE - Updates an existing Case record
21
+ * @module SupportModule
22
+ * @entity Case
23
+ * @event k1.t-hEOJjsDb.SupportModule.Case.Update.EditProviders
24
+ * @permission schema.action.editproviders.trigger
25
+ * @benchmark This action is tracked for performance benchmarks
26
+ */
27
+ class EditProvidersDto 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 = 'EditProviders';
38
+ this.schemaActionId = '4d433b1d-1810-4ed5-83df-6dab18f45ca5';
39
+ this.entity = 'SupportModule:Case';
40
+ }
41
+ }
42
+ exports.EditProvidersDto = EditProvidersDto;
43
+ /** Used by SDK generators to identify action type */
44
+ EditProvidersDto.ACTION_TYPE = 'UPDATE';
45
+ EditProvidersDto.ACTION_KEY = 'EditProviders';
46
+ EditProvidersDto.MODULE_NAME = 'SupportModule';
47
+ EditProvidersDto.ENTITIES = ['Case'];
48
+ EditProvidersDto.EVENT_NAME = 'k1.t-hEOJjsDb.SupportModule.Case.Update.EditProviders';
49
+ EditProvidersDto.PERMISSION = 'schema.action.editproviders.trigger';
50
+ /** Step metadata - entity this action targets */
51
+ EditProvidersDto.STEP_ENTITY = 'SupportModule:Case';
52
+ EditProvidersDto.STEP_SCHEMA_ID = 'be8173eb-269b-4a67-be0c-11ce6af5d561';
53
+ EditProvidersDto.STEP_SCHEMA_ACTION_ID = '4d433b1d-1810-4ed5-83df-6dab18f45ca5';
54
+ EditProvidersDto.AUTO_LINK_PARENT = false;
@@ -22,7 +22,7 @@ export interface EscalateCaseActionMessage extends OdinRecordUpdatedEvent<Escala
22
22
  * Properties for EscalateCaseAction action
23
23
  *
24
24
  * @property Required fields: 1
25
- * @property Optional fields: 3
25
+ * @property Optional fields: 4
26
26
  */
27
27
  export interface EscalateCaseActionProperties {
28
28
  /**
@@ -33,6 +33,14 @@ export interface EscalateCaseActionProperties {
33
33
  * @required
34
34
  */
35
35
  TeamId: string;
36
+ /**
37
+ * Providers
38
+ *
39
+ * Providers
40
+ * @type {ENUM}
41
+ * @validWhen Providers eq ["Netomnia","Brsk"]
42
+ */
43
+ Providers?: string | null;
36
44
  /**
37
45
  * OwnerId
38
46
  *
@@ -16,7 +16,7 @@ import { OdinRecord, OdinRecordCreateDto, OdinRecordUpdateDto, OdinRecordUpdated
16
16
  * Properties for EscalateCaseAction action
17
17
  *
18
18
  * @property Required fields: 1
19
- * @property Optional fields: 3
19
+ * @property Optional fields: 4
20
20
  */
21
21
  export interface EscalateCaseActionProperties {
22
22
  /**
@@ -27,6 +27,14 @@ export interface EscalateCaseActionProperties {
27
27
  * @required
28
28
  */
29
29
  TeamId: string;
30
+ /**
31
+ * Providers
32
+ *
33
+ * Providers
34
+ * @type {ENUM}
35
+ * @validWhen Providers eq ["Netomnia","Brsk"]
36
+ */
37
+ Providers?: string | null;
30
38
  /**
31
39
  * OwnerId
32
40
  *
@@ -81,6 +81,30 @@ export interface OverlayA55UpdateProperties {
81
81
  * @required
82
82
  */
83
83
  PointALocation: string;
84
+ /**
85
+ * PointAImageSurrounding
86
+ *
87
+ * Data field for BlockageA55 records. Used by Field Operations team.
88
+ * @type {FILE_MULTIPLE}
89
+ * @required
90
+ */
91
+ PointAImageSurrounding: string;
92
+ /**
93
+ * PointAImageInternal
94
+ *
95
+ * Data field for BlockageA55 records. Used by Field Operations team.
96
+ * @type {FILE_MULTIPLE}
97
+ * @required
98
+ */
99
+ PointAImageInternal: string;
100
+ /**
101
+ * PointAImageRod
102
+ *
103
+ * Data field for BlockageA55 records. Used by Field Operations team.
104
+ * @type {FILE_MULTIPLE}
105
+ * @required
106
+ */
107
+ PointAImageRod: string;
84
108
  /**
85
109
  * PointBLocation
86
110
  *
@@ -97,6 +121,14 @@ export interface OverlayA55UpdateProperties {
97
121
  * @required
98
122
  */
99
123
  PermissionsRequired: string;
124
+ /**
125
+ * PTDCopy
126
+ *
127
+ * Data field for BlockageA55 records. Used by Field Operations team.
128
+ * @type {FILE_MULTIPLE}
129
+ * @required
130
+ */
131
+ PTDCopy: string;
100
132
  /**
101
133
  * Overview
102
134
  *
@@ -139,6 +171,13 @@ export interface OverlayA55UpdateProperties {
139
171
  * @type {TEXT}
140
172
  */
141
173
  OverlayDetails?: string | null;
174
+ /**
175
+ * OverlayRequiredPerspectiveViewPicture
176
+ *
177
+ * Data field for OverlayRealA55 records. Used by Field Operations team.
178
+ * @type {FILE_MULTIPLE}
179
+ */
180
+ OverlayRequiredPerspectiveViewPicture?: string | null;
142
181
  /**
143
182
  * PointADetails
144
183
  *
@@ -183,6 +222,14 @@ export interface OverlayA55UpdateProperties {
183
222
  * @type {ENUM}
184
223
  */
185
224
  PointBTobyRequired?: string | null;
225
+ /**
226
+ * PointBTobyLocation
227
+ *
228
+ * Data field for OverlayRealA55 records. Used by Field Operations team.
229
+ * @type {FILE_MULTIPLE}
230
+ * @visibleWhen PointBTobyRequired = ["YES"]
231
+ */
232
+ PointBTobyLocation?: string | null;
186
233
  /**
187
234
  * FurtherDetails
188
235
  *
@@ -204,6 +251,13 @@ export interface OverlayA55UpdateProperties {
204
251
  * @type {ENUM}
205
252
  */
206
253
  CarriagewayIncursionRequired?: string | null;
254
+ /**
255
+ * NetomniaOdinImageSuggestedRoute
256
+ *
257
+ * Data field for OverlayRealA55 records. Used by Field Operations team.
258
+ * @type {FILE_MULTIPLE}
259
+ */
260
+ NetomniaOdinImageSuggestedRoute?: string | null;
207
261
  /**
208
262
  * CustomerInformation
209
263
  *
@@ -22,9 +22,16 @@ export interface UpdateTeamMessage extends OdinRecordUpdatedEvent<UpdateTeamDto,
22
22
  * Properties for UpdateTeam action
23
23
  *
24
24
  * @property Required fields: 0
25
- * @property Optional fields: 10
25
+ * @property Optional fields: 11
26
26
  */
27
27
  export interface UpdateTeamProperties {
28
+ /**
29
+ * Providers
30
+ *
31
+ * Providers
32
+ * @type {ENUM}
33
+ */
34
+ Providers?: string | null;
28
35
  /**
29
36
  * SupportTeam
30
37
  *
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Exchange DB Accessor
3
+ *
4
+ * Provides typed access to Exchange records via direct database access.
5
+ * For use in backend services with principal + dbService.
6
+ * Returns wrapped records with typed action methods.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Simple get
11
+ * const record = await accessor.get(id);
12
+ *
13
+ * // With related entities
14
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
15
+ *
16
+ * // With permissions bypass (separate options)
17
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
18
+ *
19
+ * // Silent write (no RabbitMQ events)
20
+ * const result = await accessor.upsert([dto], { omitWriteEvents: true });
21
+ *
22
+ * // Constructor-level default (applies to all calls)
23
+ * const accessor = new ExchangeDbAccessor(principal, dbService, { omitPermissionsCheck: true });
24
+ * ```
25
+ *
26
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
27
+ */
28
+ import { OdinSearchV2 } from '@d19n/odin-types/dist/core';
29
+ import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
30
+ import { QueryBuilder } from '@d19n/odin-sdk-generator/dist/query-builder';
31
+ import { ExchangeProperties } from '../entities-v2/Exchange';
32
+ import { ExchangeRecord } from '../records-v2/ExchangeRecord';
33
+ /** Search response with wrapped records */
34
+ export interface ExchangeDbSearchResponse {
35
+ records: ExchangeRecord[];
36
+ totalRecords: number;
37
+ hasMore: boolean;
38
+ }
39
+ export declare class ExchangeDbAccessor {
40
+ private readonly _provider;
41
+ private readonly _moduleName;
42
+ private readonly _entityName;
43
+ private readonly _defaultOptions?;
44
+ /**
45
+ * Create a new ExchangeDbAccessor
46
+ * @param principal - The authenticated principal
47
+ * @param dbService - The database service instance
48
+ * @param defaultOptions - Default provider options applied to all operations
49
+ */
50
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
51
+ get moduleName(): string;
52
+ get entityName(): string;
53
+ /**
54
+ * Create a new empty Exchange record instance for create operations.
55
+ * Pre-generates an ID that can be referenced before the record is saved.
56
+ *
57
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
58
+ * @returns A new record wrapper with pre-generated ID
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * // Auto-generated ID
63
+ * const note = odinDb.notes.new();
64
+ * console.log(note.id); // UUID available immediately
65
+ *
66
+ * // Custom ID
67
+ * const order = odinDb.orders.new("custom-id-123");
68
+ *
69
+ * // Reference ID before save
70
+ * const account = odinDb.accounts.new();
71
+ * const contact = odinDb.contacts.new();
72
+ * await contact
73
+ * .link({ id: account.id, entity: "CrmModule:Account" })
74
+ * .createContact({ FirstName: "John" });
75
+ * ```
76
+ */
77
+ new(id?: string): ExchangeRecord;
78
+ /**
79
+ * Get a single Exchange record by ID
80
+ *
81
+ * @param id - The record ID
82
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
83
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * // Simple get
88
+ * const record = await accessor.get(id);
89
+ *
90
+ * // With related entities
91
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
92
+ *
93
+ * // With permissions bypass
94
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
95
+ *
96
+ * // Both options
97
+ * const record = await accessor.get(id, { entities: ["Invoice"] }, { omitPermissionsCheck: true });
98
+ * ```
99
+ */
100
+ get(id: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<ExchangeRecord>;
101
+ /**
102
+ * Get multiple Exchange records by IDs
103
+ *
104
+ * @param ids - Array of record IDs
105
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
106
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
107
+ */
108
+ getMany(ids: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<ExchangeRecord[]>;
109
+ /**
110
+ * Search Exchange records
111
+ *
112
+ * @param params - Search parameters
113
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
114
+ */
115
+ search(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<ExchangeDbSearchResponse>;
116
+ /**
117
+ * Search all Exchange records with automatic pagination
118
+ *
119
+ * @param params - Search parameters
120
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
121
+ */
122
+ searchAll(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<ExchangeRecord[]>;
123
+ /**
124
+ * Async generator for paginating through all matching records.
125
+ * Yields batches of wrapped records.
126
+ *
127
+ * @param params - Search parameters
128
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
129
+ */
130
+ paginate(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): AsyncGenerator<ExchangeRecord[]>;
131
+ /**
132
+ * Create a fluent query builder for Exchange records
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * const results = await accessor
137
+ * .query()
138
+ * .where('Status', 'in', ['Active', 'Pending'])
139
+ * .where('CreatedAt', 'gte', '2025-01-01')
140
+ * .select('id', 'title', 'properties.*')
141
+ * .sortBy('createdAt', 'desc')
142
+ * .limit(100)
143
+ * .execute();
144
+ * ```
145
+ */
146
+ query(): QueryBuilder<ExchangeProperties, ExchangeRecord>;
147
+ /** Access the underlying DbProvider */
148
+ get provider(): DbProvider;
149
+ }