forked from crisfervil/DynamicsNode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamicsnode.d.ts
138 lines (127 loc) · 4.7 KB
/
dynamicsnode.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
declare module 'dynamicsnode' {
export class EntityReference {
Id: string;
LogicalName: string;
__typeName: string;
constructor(Id: string, LogicalName: string);
}
export class WhoAmIRequest {
__typeName: string;
}
export class WhoAmIResponse {
BusinessUnitId: string;
OrganizationId: string;
UserId: string;
}
export class AssignRequest {
__typeName: string;
Assignee: EntityReference;
Target: EntityReference;
}
export class AssignResponse {
}
export class Guid {
private static EMPTY;
private static validator;
private value;
constructor(guid?: string);
private static gen(count);
equals(other: Guid | string): boolean;
isEmpty(): boolean;
toString(): string;
toJSON(): string;
getValue(): string;
static isGuid(value: string | Guid): boolean;
static create(): Guid;
static raw(): string;
static empty(): Guid;
}
export class DataTable {
rows: Array<any>;
constructor(rows?: Array<any>);
lookup(columnName: string, updater: (row: any) => any): void;
save(fileName: string): void;
static load(fileName: string): DataTable;
private static parseNumbers(str);
private static parseBooleans(str);
private static parseDates(str);
private static parseValue(str);
private static JSONDataReviver(key, str);
private static parseXml(xmlContent);
private serializeXml(data);
private serializeValue(value);
}
export class Fetch {
entityName: string;
filter: Filter;
attributes: string[];
constructor(entityName?: string, attr?: string | boolean | string[], filterConditions?: any);
toString(): string;
private serializeAttributes(value, writer);
setFilter(filterConditions: any): void;
setAttributes(attributes: boolean | string | string[]): void;
private serializeValue(value);
private serializeConditions(filter, writer);
private operatorNames;
private operatorJsonNames;
private convert(conditionExpression);
}
export enum FilterTypes {
And = 0,
Or = 1,
}
export class Filter {
conditions: Array<Condition>;
filterType: FilterTypes;
constructor(conditions?: Array<Condition>, filterType?: FilterTypes);
}
export enum Operators {
Equal = 0,
NotEqual = 1,
GreaterThan = 2,
GreaterEqual = 3,
LessEqual = 4,
LessThan = 5,
Like = 6,
NotLike = 7,
In = 8,
NotIn = 9,
Between = 10,
NotBetween = 11,
Null = 12,
NotNull = 13,
}
export class Condition {
attribute: string;
operator: Operators;
values: Array<any>;
constructor(attribute?: string, operator?: Operators, values?: Array<any>);
}
/**
* @class Allows to access to CRM functions.
* @param {string} connectionString Optional. A valid connection string or connection string name
*/
export class CRMClient {
constructor(connectionString?: string, version?: string);
whoAmI(): WhoAmIResponse;
testConnection(): void;
retrieve(entityName: string, idOrConditions: string | Guid | Object, pColumns?: string | string[] | boolean): any;
retrieveMultiple(fetchXml: string): DataTable;
retrieveMultiple(entityName: string, conditions?: any, attributes?: boolean | string | string[]): DataTable;
retrieveAll(entityName: string): DataTable;
create(entityName: string, attributes: any): string;
delete(entityName: string, idsOrConditions: any): number;
update(entityName: string, attributes: any, conditions?: any): number;
getIdField(entityName: string): string;
createOrUpdate(entityName: string, attributes: any, matchFields: string[]): void;
associateData(data: DataTable): void;
associate(fromEntityName: string, fromEntityId: string | Guid, relationshipName: string, toEntityName: string, toEntityId: string | Guid): void;
disassociateData(data: DataTable): void;
disassociate(fromEntityName: string, fromEntityId: string | Guid, relationshipName: string, toEntityName: string, toEntityId: string | Guid): void;
getEntityMetadata(entityName: string): any;
execute(request: any): any;
assign(targetId: Guid | string, targetType: string, assigneeId: Guid | string, assigneeType?: string): void;
export(entityName: string, fileName: string): void;
import(fileName: string): void;
}
}