@d19n/youfibre-odin-sdk 2.0.69 → 2.0.70
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 +10 -2
- package/dist/EntityRegistry.d.ts +2 -0
- package/dist/EntityRegistry.js +2 -0
- package/dist/OdinApiClient.d.ts +4 -0
- package/dist/OdinApiClient.js +8 -0
- package/dist/OdinDbClient.d.ts +4 -0
- package/dist/OdinDbClient.js +8 -0
- package/dist/accessors-v2/TwilioTaskQueueAccessor.d.ts +111 -0
- package/dist/accessors-v2/TwilioTaskQueueAccessor.js +190 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +4 -2
- package/dist/actions-v2/CreateTwilioTaskQueueDto.d.ts +56 -0
- package/dist/actions-v2/CreateTwilioTaskQueueDto.js +52 -0
- package/dist/actions-v2/UpdateTwilioTaskQueueDto.d.ts +61 -0
- package/dist/actions-v2/UpdateTwilioTaskQueueDto.js +54 -0
- package/dist/api-sdk-v2/TwilioTaskQueueApi.d.ts +45 -0
- package/dist/api-sdk-v2/TwilioTaskQueueApi.js +151 -0
- package/dist/db-accessors-v2/TwilioTaskQueueDbAccessor.d.ts +149 -0
- package/dist/db-accessors-v2/TwilioTaskQueueDbAccessor.js +227 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +4 -2
- package/dist/db-sdk-v2/TwilioTaskQueueDb.d.ts +117 -0
- package/dist/db-sdk-v2/TwilioTaskQueueDb.js +200 -0
- package/dist/entities-v2/TwilioTaskQueue.d.ts +93 -0
- package/dist/entities-v2/TwilioTaskQueue.js +71 -0
- package/dist/records-v2/TwilioTaskQueueRecord.d.ts +212 -0
- package/dist/records-v2/TwilioTaskQueueRecord.js +283 -0
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +5 -2
- package/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TwilioTaskQueue Entity Definition
|
|
3
|
+
*
|
|
4
|
+
* TwilioTaskQueue
|
|
5
|
+
*
|
|
6
|
+
* @module ServiceModule
|
|
7
|
+
* @entity TwilioTaskQueue
|
|
8
|
+
* @schemaId 8a29f143-e1d1-443f-b38f-8d7c4e5152cc
|
|
9
|
+
*
|
|
10
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
11
|
+
* Generated from Odin schema definition
|
|
12
|
+
*/
|
|
13
|
+
import { OdinRecord } from '@d19n/odin-types/dist/core';
|
|
14
|
+
/**
|
|
15
|
+
* Available types for TwilioTaskQueue records
|
|
16
|
+
*/
|
|
17
|
+
export declare enum TwilioTaskQueueEntityTypes {
|
|
18
|
+
/** This is the default record type */
|
|
19
|
+
DEFAULT = "DEFAULT"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Property keys for TwilioTaskQueue
|
|
23
|
+
* Use these constants instead of string literals for type safety
|
|
24
|
+
*/
|
|
25
|
+
export declare enum TwilioTaskQueuePropertyKeys {
|
|
26
|
+
/** Name */
|
|
27
|
+
Name = "Name",
|
|
28
|
+
/** Sid */
|
|
29
|
+
Sid = "Sid",
|
|
30
|
+
/** TargetWorkerExpression */
|
|
31
|
+
TargetWorkerExpression = "TargetWorkerExpression",
|
|
32
|
+
/** MaximumReservedWorkers */
|
|
33
|
+
MaximumReservedWorkers = "MaximumReservedWorkers"
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Properties for TwilioTaskQueue records
|
|
37
|
+
*
|
|
38
|
+
* @see ServiceModule:TwilioTaskQueue
|
|
39
|
+
*/
|
|
40
|
+
export interface TwilioTaskQueueProperties {
|
|
41
|
+
/** Name
|
|
42
|
+
*
|
|
43
|
+
* @type {TEXT}
|
|
44
|
+
*/
|
|
45
|
+
Name: string;
|
|
46
|
+
/** Sid
|
|
47
|
+
*
|
|
48
|
+
* @type {TEXT}
|
|
49
|
+
*/
|
|
50
|
+
Sid: string;
|
|
51
|
+
/** TargetWorkerExpression
|
|
52
|
+
*
|
|
53
|
+
* @type {TEXT}
|
|
54
|
+
*/
|
|
55
|
+
TargetWorkerExpression: string;
|
|
56
|
+
/** MaximumReservedWorkers
|
|
57
|
+
*
|
|
58
|
+
* @type {TEXT}
|
|
59
|
+
*/
|
|
60
|
+
MaximumReservedWorkers: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* TwilioTaskQueue entity from ServiceModule
|
|
64
|
+
*
|
|
65
|
+
* TwilioTaskQueue
|
|
66
|
+
*
|
|
67
|
+
* @module ServiceModule
|
|
68
|
+
* @entity TwilioTaskQueue
|
|
69
|
+
* @schemaId 8a29f143-e1d1-443f-b38f-8d7c4e5152cc
|
|
70
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
71
|
+
*/
|
|
72
|
+
export declare class TwilioTaskQueue extends OdinRecord<TwilioTaskQueueProperties> {
|
|
73
|
+
entity: 'ServiceModule:TwilioTaskQueue';
|
|
74
|
+
type: TwilioTaskQueueEntityTypes;
|
|
75
|
+
schemaId: '8a29f143-e1d1-443f-b38f-8d7c4e5152cc';
|
|
76
|
+
properties: TwilioTaskQueueProperties;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* RabbitMQ routing keys for TwilioTaskQueue events
|
|
80
|
+
*/
|
|
81
|
+
export declare const ROUTING_KEY_TWILIO_TASK_QUEUE_CREATED = "ServiceModule.TwilioTaskQueue.SubDbRecordCreated";
|
|
82
|
+
export declare const ROUTING_KEY_TWILIO_TASK_QUEUE_UPDATED = "ServiceModule.TwilioTaskQueue.SubDbRecordUpdated";
|
|
83
|
+
export declare const ROUTING_KEY_TWILIO_TASK_QUEUE_DELETED = "ServiceModule.TwilioTaskQueue.SubDbRecordDeleted";
|
|
84
|
+
/**
|
|
85
|
+
* Type-specific routing keys for TwilioTaskQueue events
|
|
86
|
+
* Subscribe to these for events on specific entity types only
|
|
87
|
+
*/
|
|
88
|
+
/** This is the default record type created */
|
|
89
|
+
export declare const ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_CREATED = "ServiceModule.TwilioTaskQueue.DEFAULT.SubDbRecordCreated";
|
|
90
|
+
/** This is the default record type updated */
|
|
91
|
+
export declare const ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_UPDATED = "ServiceModule.TwilioTaskQueue.DEFAULT.SubDbRecordUpdated";
|
|
92
|
+
/** This is the default record type deleted */
|
|
93
|
+
export declare const ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_DELETED = "ServiceModule.TwilioTaskQueue.DEFAULT.SubDbRecordDeleted";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TwilioTaskQueue Entity Definition
|
|
4
|
+
*
|
|
5
|
+
* TwilioTaskQueue
|
|
6
|
+
*
|
|
7
|
+
* @module ServiceModule
|
|
8
|
+
* @entity TwilioTaskQueue
|
|
9
|
+
* @schemaId 8a29f143-e1d1-443f-b38f-8d7c4e5152cc
|
|
10
|
+
*
|
|
11
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
|
+
* Generated from Odin schema definition
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_DELETED = exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_UPDATED = exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_CREATED = exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DELETED = exports.ROUTING_KEY_TWILIO_TASK_QUEUE_UPDATED = exports.ROUTING_KEY_TWILIO_TASK_QUEUE_CREATED = exports.TwilioTaskQueue = exports.TwilioTaskQueuePropertyKeys = exports.TwilioTaskQueueEntityTypes = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* Available types for TwilioTaskQueue records
|
|
19
|
+
*/
|
|
20
|
+
var TwilioTaskQueueEntityTypes;
|
|
21
|
+
(function (TwilioTaskQueueEntityTypes) {
|
|
22
|
+
/** This is the default record type */
|
|
23
|
+
TwilioTaskQueueEntityTypes["DEFAULT"] = "DEFAULT";
|
|
24
|
+
})(TwilioTaskQueueEntityTypes = exports.TwilioTaskQueueEntityTypes || (exports.TwilioTaskQueueEntityTypes = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Property keys for TwilioTaskQueue
|
|
27
|
+
* Use these constants instead of string literals for type safety
|
|
28
|
+
*/
|
|
29
|
+
var TwilioTaskQueuePropertyKeys;
|
|
30
|
+
(function (TwilioTaskQueuePropertyKeys) {
|
|
31
|
+
/** Name */
|
|
32
|
+
TwilioTaskQueuePropertyKeys["Name"] = "Name";
|
|
33
|
+
/** Sid */
|
|
34
|
+
TwilioTaskQueuePropertyKeys["Sid"] = "Sid";
|
|
35
|
+
/** TargetWorkerExpression */
|
|
36
|
+
TwilioTaskQueuePropertyKeys["TargetWorkerExpression"] = "TargetWorkerExpression";
|
|
37
|
+
/** MaximumReservedWorkers */
|
|
38
|
+
TwilioTaskQueuePropertyKeys["MaximumReservedWorkers"] = "MaximumReservedWorkers";
|
|
39
|
+
})(TwilioTaskQueuePropertyKeys = exports.TwilioTaskQueuePropertyKeys || (exports.TwilioTaskQueuePropertyKeys = {}));
|
|
40
|
+
/**
|
|
41
|
+
* TwilioTaskQueue entity from ServiceModule
|
|
42
|
+
*
|
|
43
|
+
* TwilioTaskQueue
|
|
44
|
+
*
|
|
45
|
+
* @module ServiceModule
|
|
46
|
+
* @entity TwilioTaskQueue
|
|
47
|
+
* @schemaId 8a29f143-e1d1-443f-b38f-8d7c4e5152cc
|
|
48
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
49
|
+
*/
|
|
50
|
+
class TwilioTaskQueue extends core_1.OdinRecord {
|
|
51
|
+
}
|
|
52
|
+
exports.TwilioTaskQueue = TwilioTaskQueue;
|
|
53
|
+
// ============================================
|
|
54
|
+
// RABBITMQ EVENT ROUTING KEYS
|
|
55
|
+
// ============================================
|
|
56
|
+
/**
|
|
57
|
+
* RabbitMQ routing keys for TwilioTaskQueue events
|
|
58
|
+
*/
|
|
59
|
+
exports.ROUTING_KEY_TWILIO_TASK_QUEUE_CREATED = 'ServiceModule.TwilioTaskQueue.SubDbRecordCreated';
|
|
60
|
+
exports.ROUTING_KEY_TWILIO_TASK_QUEUE_UPDATED = 'ServiceModule.TwilioTaskQueue.SubDbRecordUpdated';
|
|
61
|
+
exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DELETED = 'ServiceModule.TwilioTaskQueue.SubDbRecordDeleted';
|
|
62
|
+
/**
|
|
63
|
+
* Type-specific routing keys for TwilioTaskQueue events
|
|
64
|
+
* Subscribe to these for events on specific entity types only
|
|
65
|
+
*/
|
|
66
|
+
/** This is the default record type created */
|
|
67
|
+
exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_CREATED = 'ServiceModule.TwilioTaskQueue.DEFAULT.SubDbRecordCreated';
|
|
68
|
+
/** This is the default record type updated */
|
|
69
|
+
exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_UPDATED = 'ServiceModule.TwilioTaskQueue.DEFAULT.SubDbRecordUpdated';
|
|
70
|
+
/** This is the default record type deleted */
|
|
71
|
+
exports.ROUTING_KEY_TWILIO_TASK_QUEUE_DEFAULT_DELETED = 'ServiceModule.TwilioTaskQueue.DEFAULT.SubDbRecordDeleted';
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TwilioTaskQueue Record Wrapper
|
|
3
|
+
*
|
|
4
|
+
* Provides typed action methods and link management.
|
|
5
|
+
* Works with both ApiProvider and DbProvider.
|
|
6
|
+
*
|
|
7
|
+
* All action methods return an ActionBuilder or FlowBuilder.
|
|
8
|
+
* Call .execute() to run or .dryRun() to get the payload for debugging.
|
|
9
|
+
*
|
|
10
|
+
* Can be instantiated with null record for create operations:
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const record = odinClient.twilioTaskQueues.new();
|
|
13
|
+
* await record.createTwilioTaskQueue({ ... }).execute();
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Entity Types: DEFAULT
|
|
17
|
+
*
|
|
18
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
19
|
+
*/
|
|
20
|
+
import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
21
|
+
import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
|
|
22
|
+
import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
|
|
23
|
+
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
24
|
+
import { TwilioTaskQueueProperties } from '../entities-v2/TwilioTaskQueue';
|
|
25
|
+
import { CreateTwilioTaskQueueProperties } from '../actions-v2/CreateTwilioTaskQueueDto';
|
|
26
|
+
import { UpdateTwilioTaskQueueProperties } from '../actions-v2/UpdateTwilioTaskQueueDto';
|
|
27
|
+
/** Valid entity types for TwilioTaskQueue */
|
|
28
|
+
export declare type TwilioTaskQueueType = 'DEFAULT';
|
|
29
|
+
/**
|
|
30
|
+
* Builder for action execution with dryRun support
|
|
31
|
+
*
|
|
32
|
+
* Provides a consistent API across all action types:
|
|
33
|
+
* - `.execute()` - Execute the action and return results
|
|
34
|
+
* - `.dryRun()` - Return the payload without executing (for debugging)
|
|
35
|
+
*/
|
|
36
|
+
declare class ActionBuilder<T = IDbRecordCreateUpdateRes[]> {
|
|
37
|
+
private _provider;
|
|
38
|
+
private _moduleName;
|
|
39
|
+
private _entityName;
|
|
40
|
+
private _payload;
|
|
41
|
+
private _clearPendingLinks;
|
|
42
|
+
constructor(provider: IOdinProvider, moduleName: string, entityName: string, payload: Record<string, any>, clearPendingLinks: () => void);
|
|
43
|
+
/**
|
|
44
|
+
* Set an external system identifier for this record.
|
|
45
|
+
* Links the record to a corresponding entry in an external application.
|
|
46
|
+
*
|
|
47
|
+
* @param externalId - The ID in the external system
|
|
48
|
+
* @param externalAppId - The external application identifier
|
|
49
|
+
* @returns this (for chaining)
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
withExternalId(externalId: string, externalAppId: string): this;
|
|
57
|
+
/**
|
|
58
|
+
* Set security/access groups for this record.
|
|
59
|
+
* Controls which user groups can access the record.
|
|
60
|
+
*
|
|
61
|
+
* @param groups - Array of group names
|
|
62
|
+
* @returns this (for chaining)
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
withGroups(groups: string[]): this;
|
|
70
|
+
/**
|
|
71
|
+
* Execute the action
|
|
72
|
+
* @returns The result from the API
|
|
73
|
+
*/
|
|
74
|
+
execute(): Promise<T>;
|
|
75
|
+
/**
|
|
76
|
+
* Returns the request payload without executing (for debugging)
|
|
77
|
+
* @returns The request payload that would be sent to the API
|
|
78
|
+
*/
|
|
79
|
+
dryRun(): Record<string, any>;
|
|
80
|
+
/**
|
|
81
|
+
* Prevents accidental `await actionBuilder` without .execute()
|
|
82
|
+
* Forces developers to explicitly call .execute()
|
|
83
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
84
|
+
*/
|
|
85
|
+
then(): never;
|
|
86
|
+
}
|
|
87
|
+
export declare class TwilioTaskQueueRecord<TProps = TwilioTaskQueueProperties> {
|
|
88
|
+
private _record;
|
|
89
|
+
private _provider;
|
|
90
|
+
private _pendingLinks;
|
|
91
|
+
private _preGeneratedId;
|
|
92
|
+
/**
|
|
93
|
+
* Create a record wrapper.
|
|
94
|
+
* @param record - The underlying record, or null for create operations
|
|
95
|
+
* @param provider - The API or DB provider
|
|
96
|
+
* @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
|
|
97
|
+
*/
|
|
98
|
+
constructor(record: OdinRecord<TProps> | null, provider: IOdinProvider, preGeneratedId?: string);
|
|
99
|
+
/** Returns true if this is a new (unsaved) record */
|
|
100
|
+
get isNew(): boolean;
|
|
101
|
+
/** Record ID - always available (pre-generated for new records) */
|
|
102
|
+
get id(): string;
|
|
103
|
+
get entity(): string;
|
|
104
|
+
get type(): TwilioTaskQueueType | undefined;
|
|
105
|
+
/** Record properties - empty object for new (unsaved) records */
|
|
106
|
+
get properties(): TProps;
|
|
107
|
+
get title(): string | undefined;
|
|
108
|
+
get recordNumber(): string | undefined;
|
|
109
|
+
get stage(): PipelineStageEntity | undefined;
|
|
110
|
+
get createdAt(): string | undefined;
|
|
111
|
+
get updatedAt(): string | undefined;
|
|
112
|
+
get externalId(): string | undefined;
|
|
113
|
+
get externalAppId(): string | undefined;
|
|
114
|
+
get groups(): string[];
|
|
115
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
116
|
+
get record(): OdinRecord<TProps> | null;
|
|
117
|
+
/**
|
|
118
|
+
* Type guard: check if this record is of type DEFAULT
|
|
119
|
+
*
|
|
120
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
121
|
+
* giving you access to DEFAULT-specific properties.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* if (record.isDefault()) {
|
|
126
|
+
* // TypeScript knows record.properties is TwilioTaskQueueProperties
|
|
127
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
128
|
+
* }
|
|
129
|
+
* ```
|
|
130
|
+
* @remarks This is the default record type
|
|
131
|
+
*/
|
|
132
|
+
isDefault(): this is TwilioTaskQueueRecord<TwilioTaskQueueProperties>;
|
|
133
|
+
/**
|
|
134
|
+
* Queue a link to be created with the next action.
|
|
135
|
+
* Works for both create and update actions.
|
|
136
|
+
* @returns this (for chaining)
|
|
137
|
+
*/
|
|
138
|
+
link(target: OdinRecord<any> | {
|
|
139
|
+
id: string;
|
|
140
|
+
entity: string;
|
|
141
|
+
}): this;
|
|
142
|
+
/** Get the currently queued links */
|
|
143
|
+
get pendingLinks(): OdinRecordLinkDto[];
|
|
144
|
+
/** Clear pending links without executing an action */
|
|
145
|
+
clearPendingLinks(): this;
|
|
146
|
+
/**
|
|
147
|
+
* Immediately unlink a record (API call).
|
|
148
|
+
* Unlike link(), this executes immediately.
|
|
149
|
+
* @throws Error if called on a new (unsaved) record
|
|
150
|
+
*/
|
|
151
|
+
unlink(target: OdinRecord<any> | {
|
|
152
|
+
id: string;
|
|
153
|
+
} | string): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* CreateTwilioTaskQueue
|
|
156
|
+
*
|
|
157
|
+
* Creates a new TwilioTaskQueue record with the specified properties.
|
|
158
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
159
|
+
*
|
|
160
|
+
* @param properties - The properties for the new record
|
|
161
|
+
* @param options - Optional settings
|
|
162
|
+
* @param options.type - Override the record type
|
|
163
|
+
* @param options.journeyId - Associate with a journey
|
|
164
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
165
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* // Create with properties
|
|
170
|
+
* const record = odinClient.twilioTaskQueues.new();
|
|
171
|
+
* await record.createTwilioTaskQueue({ ... }).execute();
|
|
172
|
+
*
|
|
173
|
+
* // Dry run (for debugging)
|
|
174
|
+
* const payload = record.createTwilioTaskQueue({ ... }).dryRun();
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
createTwilioTaskQueue(properties?: CreateTwilioTaskQueueProperties, options?: {
|
|
178
|
+
type?: string;
|
|
179
|
+
journeyId?: string;
|
|
180
|
+
stageKey?: string;
|
|
181
|
+
}): ActionBuilder;
|
|
182
|
+
/**
|
|
183
|
+
* UpdateTwilioTaskQueue
|
|
184
|
+
*
|
|
185
|
+
* Updates this TwilioTaskQueue record.
|
|
186
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
187
|
+
*
|
|
188
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
189
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
190
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
191
|
+
* @throws Error if called on a new (unsaved) record
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* const record = await odinClient.twilioTaskQueues.get(id);
|
|
196
|
+
* await record.updateTwilioTaskQueue({ ... }).execute();
|
|
197
|
+
*
|
|
198
|
+
* // Dry run (for debugging)
|
|
199
|
+
* const payload = record.updateTwilioTaskQueue({ ... }).dryRun();
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
updateTwilioTaskQueue(propertiesOrOptions?: UpdateTwilioTaskQueueProperties | {
|
|
203
|
+
journeyId?: string;
|
|
204
|
+
stageKey?: string;
|
|
205
|
+
}, options?: {
|
|
206
|
+
journeyId?: string;
|
|
207
|
+
stageKey?: string;
|
|
208
|
+
}): ActionBuilder;
|
|
209
|
+
}
|
|
210
|
+
/** Type guard to check if an object is a TwilioTaskQueueRecord */
|
|
211
|
+
export declare function isTwilioTaskQueueRecord(obj: any): obj is TwilioTaskQueueRecord;
|
|
212
|
+
export {};
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TwilioTaskQueue Record Wrapper
|
|
4
|
+
*
|
|
5
|
+
* Provides typed action methods and link management.
|
|
6
|
+
* Works with both ApiProvider and DbProvider.
|
|
7
|
+
*
|
|
8
|
+
* All action methods return an ActionBuilder or FlowBuilder.
|
|
9
|
+
* Call .execute() to run or .dryRun() to get the payload for debugging.
|
|
10
|
+
*
|
|
11
|
+
* Can be instantiated with null record for create operations:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const record = odinClient.twilioTaskQueues.new();
|
|
14
|
+
* await record.createTwilioTaskQueue({ ... }).execute();
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Entity Types: DEFAULT
|
|
18
|
+
*
|
|
19
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
20
|
+
*/
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.isTwilioTaskQueueRecord = exports.TwilioTaskQueueRecord = void 0;
|
|
32
|
+
const uuid_1 = require("uuid");
|
|
33
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
34
|
+
/**
|
|
35
|
+
* Builder for action execution with dryRun support
|
|
36
|
+
*
|
|
37
|
+
* Provides a consistent API across all action types:
|
|
38
|
+
* - `.execute()` - Execute the action and return results
|
|
39
|
+
* - `.dryRun()` - Return the payload without executing (for debugging)
|
|
40
|
+
*/
|
|
41
|
+
class ActionBuilder {
|
|
42
|
+
constructor(provider, moduleName, entityName, payload, clearPendingLinks) {
|
|
43
|
+
this._provider = provider;
|
|
44
|
+
this._moduleName = moduleName;
|
|
45
|
+
this._entityName = entityName;
|
|
46
|
+
this._payload = payload;
|
|
47
|
+
this._clearPendingLinks = clearPendingLinks;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Set an external system identifier for this record.
|
|
51
|
+
* Links the record to a corresponding entry in an external application.
|
|
52
|
+
*
|
|
53
|
+
* @param externalId - The ID in the external system
|
|
54
|
+
* @param externalAppId - The external application identifier
|
|
55
|
+
* @returns this (for chaining)
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
withExternalId(externalId, externalAppId) {
|
|
63
|
+
this._payload.externalId = externalId;
|
|
64
|
+
this._payload.externalAppId = externalAppId;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Set security/access groups for this record.
|
|
69
|
+
* Controls which user groups can access the record.
|
|
70
|
+
*
|
|
71
|
+
* @param groups - Array of group names
|
|
72
|
+
* @returns this (for chaining)
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
withGroups(groups) {
|
|
80
|
+
this._payload.groups = groups;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Execute the action
|
|
85
|
+
* @returns The result from the API
|
|
86
|
+
*/
|
|
87
|
+
execute() {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const result = yield this._provider._applyAction(this._moduleName, this._entityName, this._payload);
|
|
90
|
+
this._clearPendingLinks();
|
|
91
|
+
return result;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Returns the request payload without executing (for debugging)
|
|
96
|
+
* @returns The request payload that would be sent to the API
|
|
97
|
+
*/
|
|
98
|
+
dryRun() {
|
|
99
|
+
return this._payload;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Prevents accidental `await actionBuilder` without .execute()
|
|
103
|
+
* Forces developers to explicitly call .execute()
|
|
104
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
105
|
+
*/
|
|
106
|
+
then() {
|
|
107
|
+
throw new Error('ActionBuilder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
class TwilioTaskQueueRecord {
|
|
111
|
+
/**
|
|
112
|
+
* Create a record wrapper.
|
|
113
|
+
* @param record - The underlying record, or null for create operations
|
|
114
|
+
* @param provider - The API or DB provider
|
|
115
|
+
* @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
|
|
116
|
+
*/
|
|
117
|
+
constructor(record, provider, preGeneratedId) {
|
|
118
|
+
this._pendingLinks = [];
|
|
119
|
+
this._record = record;
|
|
120
|
+
this._provider = provider;
|
|
121
|
+
this._preGeneratedId = preGeneratedId !== null && preGeneratedId !== void 0 ? preGeneratedId : (0, uuid_1.v4)();
|
|
122
|
+
}
|
|
123
|
+
// ============================================
|
|
124
|
+
// CORE PROPERTIES
|
|
125
|
+
// ============================================
|
|
126
|
+
/** Returns true if this is a new (unsaved) record */
|
|
127
|
+
get isNew() { var _a; return !((_a = this._record) === null || _a === void 0 ? void 0 : _a.id); }
|
|
128
|
+
/** Record ID - always available (pre-generated for new records) */
|
|
129
|
+
get id() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this._preGeneratedId; }
|
|
130
|
+
get entity() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.entity) !== null && _b !== void 0 ? _b : 'ServiceModule:TwilioTaskQueue'; }
|
|
131
|
+
get type() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.type; }
|
|
132
|
+
/** Record properties - empty object for new (unsaved) records */
|
|
133
|
+
get properties() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.properties) || {}; }
|
|
134
|
+
get title() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.title; }
|
|
135
|
+
get recordNumber() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.recordNumber; }
|
|
136
|
+
get stage() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.stage; }
|
|
137
|
+
get createdAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.createdAt; }
|
|
138
|
+
get updatedAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.updatedAt; }
|
|
139
|
+
get externalId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalId; }
|
|
140
|
+
get externalAppId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalAppId; }
|
|
141
|
+
get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
|
|
142
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
143
|
+
get record() { return this._record; }
|
|
144
|
+
// ============================================
|
|
145
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
146
|
+
// ============================================
|
|
147
|
+
/**
|
|
148
|
+
* Type guard: check if this record is of type DEFAULT
|
|
149
|
+
*
|
|
150
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
151
|
+
* giving you access to DEFAULT-specific properties.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```typescript
|
|
155
|
+
* if (record.isDefault()) {
|
|
156
|
+
* // TypeScript knows record.properties is TwilioTaskQueueProperties
|
|
157
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
158
|
+
* }
|
|
159
|
+
* ```
|
|
160
|
+
* @remarks This is the default record type
|
|
161
|
+
*/
|
|
162
|
+
isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
|
|
163
|
+
// ============================================
|
|
164
|
+
// LINK MANAGEMENT
|
|
165
|
+
// ============================================
|
|
166
|
+
/**
|
|
167
|
+
* Queue a link to be created with the next action.
|
|
168
|
+
* Works for both create and update actions.
|
|
169
|
+
* @returns this (for chaining)
|
|
170
|
+
*/
|
|
171
|
+
link(target) {
|
|
172
|
+
this._pendingLinks.push(new core_1.OdinRecordLinkDto({ id: target.id, entity: target.entity }));
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
/** Get the currently queued links */
|
|
176
|
+
get pendingLinks() {
|
|
177
|
+
return [...this._pendingLinks];
|
|
178
|
+
}
|
|
179
|
+
/** Clear pending links without executing an action */
|
|
180
|
+
clearPendingLinks() {
|
|
181
|
+
this._pendingLinks = [];
|
|
182
|
+
return this;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Immediately unlink a record (API call).
|
|
186
|
+
* Unlike link(), this executes immediately.
|
|
187
|
+
* @throws Error if called on a new (unsaved) record
|
|
188
|
+
*/
|
|
189
|
+
unlink(target) {
|
|
190
|
+
var _a;
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
193
|
+
throw new Error('Cannot unlink from a new (unsaved) record');
|
|
194
|
+
const targetId = typeof target === 'string' ? target : target.id;
|
|
195
|
+
yield this._provider._deleteLinks('ServiceModule', 'TwilioTaskQueue', this._record.id, targetId);
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// ============================================
|
|
199
|
+
// CREATE ACTIONS (no existing record required)
|
|
200
|
+
// ============================================
|
|
201
|
+
/**
|
|
202
|
+
* CreateTwilioTaskQueue
|
|
203
|
+
*
|
|
204
|
+
* Creates a new TwilioTaskQueue record with the specified properties.
|
|
205
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
206
|
+
*
|
|
207
|
+
* @param properties - The properties for the new record
|
|
208
|
+
* @param options - Optional settings
|
|
209
|
+
* @param options.type - Override the record type
|
|
210
|
+
* @param options.journeyId - Associate with a journey
|
|
211
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
212
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* // Create with properties
|
|
217
|
+
* const record = odinClient.twilioTaskQueues.new();
|
|
218
|
+
* await record.createTwilioTaskQueue({ ... }).execute();
|
|
219
|
+
*
|
|
220
|
+
* // Dry run (for debugging)
|
|
221
|
+
* const payload = record.createTwilioTaskQueue({ ... }).dryRun();
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
createTwilioTaskQueue(properties, options) {
|
|
225
|
+
var _a, _b;
|
|
226
|
+
const payload = {
|
|
227
|
+
entity: 'ServiceModule:TwilioTaskQueue',
|
|
228
|
+
type: (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : (_b = this._record) === null || _b === void 0 ? void 0 : _b.type,
|
|
229
|
+
actionName: 'CreateTwilioTaskQueue',
|
|
230
|
+
properties: properties || {},
|
|
231
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
232
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
233
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
234
|
+
};
|
|
235
|
+
return new ActionBuilder(this._provider, 'ServiceModule', 'TwilioTaskQueue', payload, () => { this._pendingLinks = []; });
|
|
236
|
+
}
|
|
237
|
+
// ============================================
|
|
238
|
+
// UPDATE ACTIONS (require existing record)
|
|
239
|
+
// ============================================
|
|
240
|
+
/**
|
|
241
|
+
* UpdateTwilioTaskQueue
|
|
242
|
+
*
|
|
243
|
+
* Updates this TwilioTaskQueue record.
|
|
244
|
+
* Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
|
|
245
|
+
*
|
|
246
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
247
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
248
|
+
* @returns ActionBuilder - call .execute() to update or .dryRun() for payload
|
|
249
|
+
* @throws Error if called on a new (unsaved) record
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```typescript
|
|
253
|
+
* const record = await odinClient.twilioTaskQueues.get(id);
|
|
254
|
+
* await record.updateTwilioTaskQueue({ ... }).execute();
|
|
255
|
+
*
|
|
256
|
+
* // Dry run (for debugging)
|
|
257
|
+
* const payload = record.updateTwilioTaskQueue({ ... }).dryRun();
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
updateTwilioTaskQueue(propertiesOrOptions, options) {
|
|
261
|
+
var _a;
|
|
262
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
263
|
+
throw new Error('updateTwilioTaskQueue requires an existing record. Use accessor.get() first.');
|
|
264
|
+
let properties = {};
|
|
265
|
+
let opts = options;
|
|
266
|
+
if (propertiesOrOptions) {
|
|
267
|
+
if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
|
|
268
|
+
opts = propertiesOrOptions;
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
properties = propertiesOrOptions;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateTwilioTaskQueue', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
|
|
275
|
+
return new ActionBuilder(this._provider, 'ServiceModule', 'TwilioTaskQueue', payload, () => { this._pendingLinks = []; });
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
exports.TwilioTaskQueueRecord = TwilioTaskQueueRecord;
|
|
279
|
+
/** Type guard to check if an object is a TwilioTaskQueueRecord */
|
|
280
|
+
function isTwilioTaskQueueRecord(obj) {
|
|
281
|
+
return obj instanceof TwilioTaskQueueRecord;
|
|
282
|
+
}
|
|
283
|
+
exports.isTwilioTaskQueueRecord = isTwilioTaskQueueRecord;
|
|
@@ -97,6 +97,7 @@ export { VoiceConfigurationRecord, isVoiceConfigurationRecord } from './VoiceCon
|
|
|
97
97
|
export { SalesTerritoryRecord, isSalesTerritoryRecord } from './SalesTerritoryRecord';
|
|
98
98
|
export { TeamRecord, isTeamRecord } from './TeamRecord';
|
|
99
99
|
export { TimeSlotRecord, isTimeSlotRecord } from './TimeSlotRecord';
|
|
100
|
+
export { TwilioTaskQueueRecord, isTwilioTaskQueueRecord } from './TwilioTaskQueueRecord';
|
|
100
101
|
export { UserRecord, isUserRecord } from './UserRecord';
|
|
101
102
|
export { WayleaveAuditRecord, isWayleaveAuditRecord } from './WayleaveAuditRecord';
|
|
102
103
|
export { WorkOrderStatusUpdateRecord, isWorkOrderStatusUpdateRecord } from './WorkOrderStatusUpdateRecord';
|