@mohsinonxrm/dataverse-sdk-metadata 1.0.0 → 2.0.0-beta.1
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 +366 -77
- package/dist/index.d.ts +2588 -11530
- package/dist/index.js +1160 -890
- package/dist/index.js.map +1 -1
- package/package.json +13 -9
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { odataKey, DataverseInvalidRequestError, odataLiteral, parseODataError } from '@mohsinonxrm/dataverse-sdk-core';
|
|
2
|
+
|
|
1
3
|
// src/MetadataClient.ts
|
|
2
4
|
var MetadataClient = class {
|
|
3
5
|
client;
|
|
6
|
+
entitySetNames;
|
|
7
|
+
entitySetNamesLoad;
|
|
4
8
|
constructor(client) {
|
|
5
9
|
this.client = client;
|
|
6
10
|
}
|
|
@@ -18,17 +22,7 @@ var MetadataClient = class {
|
|
|
18
22
|
* ```
|
|
19
23
|
*/
|
|
20
24
|
async getEntityDefinitions(options) {
|
|
21
|
-
|
|
22
|
-
if (options?.select) {
|
|
23
|
-
builder = builder.select(...options.select);
|
|
24
|
-
}
|
|
25
|
-
if (options?.filter) {
|
|
26
|
-
builder = builder.filter(options.filter);
|
|
27
|
-
}
|
|
28
|
-
if (options?.expand) {
|
|
29
|
-
builder = builder.expand(options.expand);
|
|
30
|
-
}
|
|
31
|
-
const response = await builder.get();
|
|
25
|
+
const response = await this.query("/EntityDefinitions", options).get();
|
|
32
26
|
return response.value;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
@@ -44,116 +38,225 @@ var MetadataClient = class {
|
|
|
44
38
|
* ```
|
|
45
39
|
*/
|
|
46
40
|
async getEntityDefinition(logicalName, options) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
return await this.query(
|
|
42
|
+
`/EntityDefinitions(${odataKey({ LogicalName: logicalName })})`,
|
|
43
|
+
options
|
|
44
|
+
).get();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The entity set name of a table, e.g. `"accounts"` for `"account"`, from metadata.
|
|
48
|
+
*
|
|
49
|
+
* The first call reads `EntityDefinitions?$select=LogicalName,EntitySetName` once and caches
|
|
50
|
+
* the whole map on this `MetadataClient`; a table missing from the cache (created later) is
|
|
51
|
+
* looked up on its own and added. Use {@link clearEntitySetNameCache} after renaming or
|
|
52
|
+
* deleting tables.
|
|
53
|
+
* @param logicalName Entity logical name
|
|
54
|
+
* @returns The entity set name used in Web API URLs
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const set = await metadataClient.getEntitySetName("account"); // "accounts"
|
|
58
|
+
* await client.api(`${set}(${id})`).get();
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
async getEntitySetName(logicalName) {
|
|
62
|
+
const name = logicalName.toLowerCase();
|
|
63
|
+
const cached = (await this.loadEntitySetNames()).get(name);
|
|
64
|
+
if (cached) return cached;
|
|
65
|
+
const def = await this.getEntityDefinition(name, { select: ["LogicalName", "EntitySetName"] });
|
|
66
|
+
if (!def.EntitySetName) {
|
|
67
|
+
throw DataverseInvalidRequestError.invalidParameter(
|
|
68
|
+
"logicalName",
|
|
69
|
+
`table '${logicalName}' has no entity set name`
|
|
70
|
+
);
|
|
53
71
|
}
|
|
54
|
-
|
|
72
|
+
this.entitySetNames?.set(name, def.EntitySetName);
|
|
73
|
+
return def.EntitySetName;
|
|
74
|
+
}
|
|
75
|
+
/** Forget the entity set names cached by {@link getEntitySetName}. */
|
|
76
|
+
clearEntitySetNameCache() {
|
|
77
|
+
this.entitySetNamesLoad = void 0;
|
|
78
|
+
this.entitySetNames = void 0;
|
|
55
79
|
}
|
|
56
80
|
/**
|
|
57
|
-
* Create a new entity definition
|
|
81
|
+
* Create a new entity definition (a table).
|
|
82
|
+
*
|
|
83
|
+
* A table create needs `SchemaName`, `DisplayName`, `DisplayCollectionName`, `OwnershipType`,
|
|
84
|
+
* `IsActivity`, `HasActivities` and `HasNotes`, and its primary name column: a text column with
|
|
85
|
+
* `IsPrimaryName: true`, first in `Attributes`. Other columns may follow it; lookups are created
|
|
86
|
+
* with their relationship ({@link createOneToManyRelationship}) once the table exists.
|
|
58
87
|
* @param entity Entity metadata to create
|
|
59
|
-
* @
|
|
88
|
+
* @param options Solution to add the new component to
|
|
89
|
+
* @returns Metadata ID of the created entity (GUID), read from the `OData-EntityId` response header
|
|
60
90
|
* @example
|
|
61
91
|
* ```typescript
|
|
62
92
|
* const metadataId = await metadataClient.createEntityDefinition({
|
|
63
|
-
*
|
|
64
|
-
* SchemaName:
|
|
65
|
-
* DisplayName: {
|
|
66
|
-
*
|
|
67
|
-
* },
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
93
|
+
* "@odata.type": "Microsoft.Dynamics.CRM.EntityMetadata",
|
|
94
|
+
* SchemaName: "new_CustomEntity",
|
|
95
|
+
* DisplayName: { LocalizedLabels: [{ Label: "Custom Entity", LanguageCode: 1033 }] },
|
|
96
|
+
* DisplayCollectionName: { LocalizedLabels: [{ Label: "Custom Entities", LanguageCode: 1033 }] },
|
|
97
|
+
* Description: { LocalizedLabels: [{ Label: "A custom table", LanguageCode: 1033 }] },
|
|
98
|
+
* OwnershipType: "UserOwned",
|
|
99
|
+
* IsActivity: false,
|
|
100
|
+
* HasActivities: true,
|
|
101
|
+
* HasNotes: false,
|
|
102
|
+
* Attributes: [
|
|
103
|
+
* {
|
|
104
|
+
* "@odata.type": "Microsoft.Dynamics.CRM.StringAttributeMetadata",
|
|
105
|
+
* SchemaName: "new_Name",
|
|
106
|
+
* DisplayName: { LocalizedLabels: [{ Label: "Name", LanguageCode: 1033 }] },
|
|
107
|
+
* RequiredLevel: { Value: "ApplicationRequired" },
|
|
108
|
+
* MaxLength: 100,
|
|
109
|
+
* IsPrimaryName: true,
|
|
110
|
+
* },
|
|
111
|
+
* ],
|
|
73
112
|
* });
|
|
74
113
|
* ```
|
|
75
114
|
*/
|
|
76
|
-
async createEntityDefinition(
|
|
77
|
-
|
|
78
|
-
if (!response.MetadataId) {
|
|
79
|
-
throw new Error("Failed to retrieve entity metadata ID from response");
|
|
80
|
-
}
|
|
81
|
-
return response.MetadataId;
|
|
115
|
+
async createEntityDefinition(entity2, options) {
|
|
116
|
+
return this.createDefinition("/EntityDefinitions", entity2, options);
|
|
82
117
|
}
|
|
83
118
|
/**
|
|
84
|
-
* Update an existing entity definition
|
|
119
|
+
* Update an existing entity definition.
|
|
120
|
+
*
|
|
121
|
+
* Metadata updates use `PUT`, which **replaces** the definition: a property you leave out is
|
|
122
|
+
* reset to its default. Send the complete definition, with its `@odata.type` (retrieve it,
|
|
123
|
+
* change it, send it back), or use {@link mergeAndUpdateEntityDefinition}, which does that for
|
|
124
|
+
* you. Labels are merged (`MSCRM.MergeLabels: true`), so labels in other languages are kept.
|
|
85
125
|
* @param logicalName Entity logical name
|
|
86
|
-
* @param entity
|
|
126
|
+
* @param entity The complete entity definition
|
|
127
|
+
* @param options Solution to add the change to
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const current = await metadataClient.getEntityDefinition("new_project");
|
|
131
|
+
* await metadataClient.updateEntityDefinition("new_project", {
|
|
132
|
+
* ...current,
|
|
133
|
+
* "@odata.type": "Microsoft.Dynamics.CRM.EntityMetadata",
|
|
134
|
+
* HasNotes: true,
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
87
137
|
*/
|
|
88
|
-
async updateEntityDefinition(logicalName,
|
|
89
|
-
await this.
|
|
138
|
+
async updateEntityDefinition(logicalName, entity2, options) {
|
|
139
|
+
await this.updateDefinition(
|
|
140
|
+
`/EntityDefinitions(${odataKey({ LogicalName: logicalName })})`,
|
|
141
|
+
entity2,
|
|
142
|
+
options
|
|
143
|
+
);
|
|
90
144
|
}
|
|
91
145
|
/**
|
|
92
|
-
*
|
|
146
|
+
* Retrieve an entity definition, apply `changes` to it, and `PUT` the result back, so the
|
|
147
|
+
* properties you don't change keep their current values.
|
|
148
|
+
*
|
|
149
|
+
* The retrieve sends `Consistency: Strong`, so it reads the latest definition rather than a
|
|
150
|
+
* cached copy (up to ~30 seconds old) that would undo a recent change.
|
|
93
151
|
* @param logicalName Entity logical name
|
|
152
|
+
* @param changes The properties to change
|
|
153
|
+
* @param options Solution to add the change to
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* await metadataClient.mergeAndUpdateEntityDefinition("new_project", {
|
|
157
|
+
* Description: {
|
|
158
|
+
* LocalizedLabels: [{ Label: "Tracks projects", LanguageCode: 1033 }],
|
|
159
|
+
* },
|
|
160
|
+
* });
|
|
161
|
+
* ```
|
|
94
162
|
*/
|
|
95
|
-
async
|
|
96
|
-
|
|
163
|
+
async mergeAndUpdateEntityDefinition(logicalName, changes, options) {
|
|
164
|
+
const path = `/EntityDefinitions(${odataKey({ LogicalName: logicalName })})`;
|
|
165
|
+
await this.mergeAndUpdate(
|
|
166
|
+
path,
|
|
167
|
+
path,
|
|
168
|
+
"Microsoft.Dynamics.CRM.EntityMetadata",
|
|
169
|
+
changes,
|
|
170
|
+
options
|
|
171
|
+
);
|
|
97
172
|
}
|
|
98
|
-
// ==================== Attribute Definitions ====================
|
|
99
173
|
/**
|
|
100
|
-
*
|
|
101
|
-
* @param
|
|
102
|
-
* @param options Query options (select, filter)
|
|
103
|
-
* @returns Array of attribute metadata
|
|
174
|
+
* Delete an entity definition
|
|
175
|
+
* @param logicalName Entity logical name
|
|
104
176
|
*/
|
|
177
|
+
async deleteEntityDefinition(logicalName) {
|
|
178
|
+
await this.client.api(`/EntityDefinitions(${odataKey({ LogicalName: logicalName })})`).delete();
|
|
179
|
+
}
|
|
105
180
|
async getAttributeDefinitions(entityLogicalName, options) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
);
|
|
109
|
-
if (options?.select) {
|
|
110
|
-
builder = builder.select(...options.select);
|
|
111
|
-
}
|
|
112
|
-
if (options?.filter) {
|
|
113
|
-
builder = builder.filter(options.filter);
|
|
114
|
-
}
|
|
115
|
-
const response = await builder.get();
|
|
181
|
+
const path = `/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/Attributes${castSegment(options?.cast)}`;
|
|
182
|
+
const response = await this.query(path, options).get();
|
|
116
183
|
return response.value;
|
|
117
184
|
}
|
|
185
|
+
async getAttributeDefinition(entityLogicalName, attributeLogicalName, options) {
|
|
186
|
+
const path = `/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/Attributes(${odataKey({ LogicalName: attributeLogicalName })})${castSegment(options?.cast)}`;
|
|
187
|
+
return await this.query(path, options).get();
|
|
188
|
+
}
|
|
118
189
|
/**
|
|
119
|
-
*
|
|
190
|
+
* Create a new attribute definition. A lookup column is not created here: create it with its
|
|
191
|
+
* relationship, as the `Lookup` of {@link createOneToManyRelationship}.
|
|
120
192
|
* @param entityLogicalName Entity logical name
|
|
121
|
-
* @param
|
|
122
|
-
* @param options
|
|
123
|
-
* @returns
|
|
193
|
+
* @param attribute Attribute metadata to create
|
|
194
|
+
* @param options Solution to add the new component to
|
|
195
|
+
* @returns Metadata ID of the created attribute (GUID), read from the `OData-EntityId` response header
|
|
124
196
|
*/
|
|
125
|
-
async
|
|
126
|
-
|
|
127
|
-
`/EntityDefinitions(
|
|
197
|
+
async createAttributeDefinition(entityLogicalName, attribute, options) {
|
|
198
|
+
return this.createDefinition(
|
|
199
|
+
`/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/Attributes`,
|
|
200
|
+
attribute,
|
|
201
|
+
options
|
|
128
202
|
);
|
|
129
|
-
if (options?.select) {
|
|
130
|
-
builder = builder.select(...options.select);
|
|
131
|
-
}
|
|
132
|
-
return await builder.get();
|
|
133
203
|
}
|
|
134
204
|
/**
|
|
135
|
-
*
|
|
205
|
+
* Update an existing attribute definition.
|
|
206
|
+
*
|
|
207
|
+
* Like every metadata update this is a `PUT`, which **replaces** the definition: send the
|
|
208
|
+
* complete attribute definition, including its `@odata.type`, not just the changed properties
|
|
209
|
+
* (a property you leave out is reset to its default). Retrieve the column cast to its type,
|
|
210
|
+
* change it and send it back, or use {@link mergeAndUpdateAttributeDefinition}.
|
|
136
211
|
* @param entityLogicalName Entity logical name
|
|
137
|
-
* @param
|
|
138
|
-
* @
|
|
212
|
+
* @param attributeLogicalName Attribute logical name
|
|
213
|
+
* @param attribute The complete attribute definition
|
|
214
|
+
* @param options Solution to add the change to
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const current = await metadataClient.getAttributeDefinition("new_project", "new_note", {
|
|
218
|
+
* cast: "StringAttributeMetadata",
|
|
219
|
+
* });
|
|
220
|
+
* await metadataClient.updateAttributeDefinition("new_project", "new_note", {
|
|
221
|
+
* ...current,
|
|
222
|
+
* "@odata.type": "Microsoft.Dynamics.CRM.StringAttributeMetadata",
|
|
223
|
+
* MaxLength: 500,
|
|
224
|
+
* });
|
|
225
|
+
* ```
|
|
139
226
|
*/
|
|
140
|
-
async
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
227
|
+
async updateAttributeDefinition(entityLogicalName, attributeLogicalName, attribute, options) {
|
|
228
|
+
await this.updateDefinition(
|
|
229
|
+
attributePath(entityLogicalName, attributeLogicalName),
|
|
230
|
+
attribute,
|
|
231
|
+
options
|
|
232
|
+
);
|
|
146
233
|
}
|
|
147
234
|
/**
|
|
148
|
-
*
|
|
235
|
+
* Retrieve an attribute definition, apply `changes` to it, and `PUT` the result back, so the
|
|
236
|
+
* properties you don't change keep their current values.
|
|
237
|
+
*
|
|
238
|
+
* `changes` names the column's `@odata.type`; the retrieve is cast to that type
|
|
239
|
+
* (`…/Attributes(LogicalName='…')/Microsoft.Dynamics.CRM.<Type>`) so it returns the type's own
|
|
240
|
+
* properties, such as `MaxLength`, and Dataverse answers 404 if the column is of another type.
|
|
241
|
+
* The retrieve sends `Consistency: Strong`, so it reads the latest definition rather than a
|
|
242
|
+
* cached copy that would undo a recent change. Options of a choice column are not part of the
|
|
243
|
+
* definition: use {@link insertOptionValue} and the other option actions.
|
|
149
244
|
* @param entityLogicalName Entity logical name
|
|
150
245
|
* @param attributeLogicalName Attribute logical name
|
|
151
|
-
* @param
|
|
246
|
+
* @param changes The properties to change, with the column's `@odata.type`
|
|
247
|
+
* @param options Solution to add the change to
|
|
248
|
+
* @example
|
|
249
|
+
* ```typescript
|
|
250
|
+
* await metadataClient.mergeAndUpdateAttributeDefinition("new_project", "new_note", {
|
|
251
|
+
* "@odata.type": "Microsoft.Dynamics.CRM.StringAttributeMetadata",
|
|
252
|
+
* DisplayName: { LocalizedLabels: [{ Label: "Comment", LanguageCode: 1033 }] },
|
|
253
|
+
* });
|
|
254
|
+
* ```
|
|
152
255
|
*/
|
|
153
|
-
async
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
256
|
+
async mergeAndUpdateAttributeDefinition(entityLogicalName, attributeLogicalName, changes, options) {
|
|
257
|
+
const path = attributePath(entityLogicalName, attributeLogicalName);
|
|
258
|
+
const type = metadataType(changes);
|
|
259
|
+
await this.mergeAndUpdate(`${path}/${type}`, path, type, changes, options);
|
|
157
260
|
}
|
|
158
261
|
/**
|
|
159
262
|
* Delete an attribute definition
|
|
@@ -162,28 +265,25 @@ var MetadataClient = class {
|
|
|
162
265
|
*/
|
|
163
266
|
async deleteAttributeDefinition(entityLogicalName, attributeLogicalName) {
|
|
164
267
|
await this.client.api(
|
|
165
|
-
`/EntityDefinitions(
|
|
268
|
+
`/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/Attributes(${odataKey({ LogicalName: attributeLogicalName })})`
|
|
166
269
|
).delete();
|
|
167
270
|
}
|
|
168
271
|
// ==================== Relationship Definitions ====================
|
|
169
272
|
/**
|
|
170
273
|
* Create a one-to-many relationship
|
|
171
274
|
* @param relationship Relationship metadata to create
|
|
172
|
-
* @
|
|
275
|
+
* @param options Solution to add the new component to
|
|
276
|
+
* @returns Metadata ID of the created relationship (GUID), read from the `OData-EntityId` response header
|
|
173
277
|
*/
|
|
174
|
-
async createOneToManyRelationship(relationship) {
|
|
175
|
-
|
|
176
|
-
if (!response.MetadataId) {
|
|
177
|
-
throw new Error("Failed to retrieve relationship metadata ID from response");
|
|
178
|
-
}
|
|
179
|
-
return response.MetadataId;
|
|
278
|
+
async createOneToManyRelationship(relationship, options) {
|
|
279
|
+
return this.createDefinition("/RelationshipDefinitions", relationship, options);
|
|
180
280
|
}
|
|
181
281
|
/**
|
|
182
282
|
* Delete a relationship definition
|
|
183
283
|
* @param metadataId Relationship metadata ID (GUID)
|
|
184
284
|
*/
|
|
185
285
|
async deleteRelationship(metadataId) {
|
|
186
|
-
await this.client.api(`/RelationshipDefinitions(${metadataId})`).delete();
|
|
286
|
+
await this.client.api(`/RelationshipDefinitions(${odataLiteral.guid(metadataId)})`).delete();
|
|
187
287
|
}
|
|
188
288
|
/**
|
|
189
289
|
* Get one-to-many relationships for an entity
|
|
@@ -192,16 +292,10 @@ var MetadataClient = class {
|
|
|
192
292
|
* @returns Array of one-to-many relationships
|
|
193
293
|
*/
|
|
194
294
|
async getOneToManyRelationships(entityLogicalName, options) {
|
|
195
|
-
|
|
196
|
-
`/EntityDefinitions(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
builder = builder.select(...options.select);
|
|
200
|
-
}
|
|
201
|
-
if (options?.filter) {
|
|
202
|
-
builder = builder.filter(options.filter);
|
|
203
|
-
}
|
|
204
|
-
const response = await builder.get();
|
|
295
|
+
const response = await this.query(
|
|
296
|
+
`/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/OneToManyRelationships`,
|
|
297
|
+
options
|
|
298
|
+
).get();
|
|
205
299
|
return response.value;
|
|
206
300
|
}
|
|
207
301
|
/**
|
|
@@ -211,16 +305,10 @@ var MetadataClient = class {
|
|
|
211
305
|
* @returns Array of many-to-one relationships
|
|
212
306
|
*/
|
|
213
307
|
async getManyToOneRelationships(entityLogicalName, options) {
|
|
214
|
-
|
|
215
|
-
`/EntityDefinitions(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
builder = builder.select(...options.select);
|
|
219
|
-
}
|
|
220
|
-
if (options?.filter) {
|
|
221
|
-
builder = builder.filter(options.filter);
|
|
222
|
-
}
|
|
223
|
-
const response = await builder.get();
|
|
308
|
+
const response = await this.query(
|
|
309
|
+
`/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/ManyToOneRelationships`,
|
|
310
|
+
options
|
|
311
|
+
).get();
|
|
224
312
|
return response.value;
|
|
225
313
|
}
|
|
226
314
|
/**
|
|
@@ -230,16 +318,10 @@ var MetadataClient = class {
|
|
|
230
318
|
* @returns Array of many-to-many relationships
|
|
231
319
|
*/
|
|
232
320
|
async getManyToManyRelationships(entityLogicalName, options) {
|
|
233
|
-
|
|
234
|
-
`/EntityDefinitions(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
builder = builder.select(...options.select);
|
|
238
|
-
}
|
|
239
|
-
if (options?.filter) {
|
|
240
|
-
builder = builder.filter(options.filter);
|
|
241
|
-
}
|
|
242
|
-
const response = await builder.get();
|
|
321
|
+
const response = await this.query(
|
|
322
|
+
`/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/ManyToManyRelationships`,
|
|
323
|
+
options
|
|
324
|
+
).get();
|
|
243
325
|
return response.value;
|
|
244
326
|
}
|
|
245
327
|
/**
|
|
@@ -249,35 +331,21 @@ var MetadataClient = class {
|
|
|
249
331
|
* @returns Relationship metadata
|
|
250
332
|
*/
|
|
251
333
|
async getRelationshipBySchemaName(schemaName, options) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (options?.expand) {
|
|
257
|
-
builder = builder.expand(options.expand);
|
|
258
|
-
}
|
|
259
|
-
return await builder.get();
|
|
334
|
+
return await this.query(
|
|
335
|
+
`/RelationshipDefinitions(${odataKey({ SchemaName: schemaName })})`,
|
|
336
|
+
options
|
|
337
|
+
).get();
|
|
260
338
|
}
|
|
261
|
-
/**
|
|
262
|
-
* Get a relationship by metadata ID
|
|
263
|
-
* @param metadataId Relationship metadata ID
|
|
264
|
-
* @param options Query options
|
|
265
|
-
* @returns Relationship metadata
|
|
266
|
-
*/
|
|
267
339
|
async getRelationshipByMetadataId(metadataId, options) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
if (options?.expand) {
|
|
273
|
-
builder = builder.expand(options.expand);
|
|
274
|
-
}
|
|
275
|
-
return await builder.get();
|
|
340
|
+
const { cast, ...query } = options ?? {};
|
|
341
|
+
const path = `/RelationshipDefinitions(${odataLiteral.guid(metadataId)})${cast ? `/Microsoft.Dynamics.CRM.${cast}` : ""}`;
|
|
342
|
+
return await this.query(path, query).get();
|
|
276
343
|
}
|
|
277
344
|
/**
|
|
278
345
|
* Create a many-to-many relationship
|
|
279
346
|
* @param relationship Relationship metadata to create
|
|
280
|
-
* @
|
|
347
|
+
* @param options Solution to add the new component to
|
|
348
|
+
* @returns Metadata ID of the created relationship (GUID), read from the `OData-EntityId` response header
|
|
281
349
|
* @example
|
|
282
350
|
* ```typescript
|
|
283
351
|
* const metadataId = await metadataClient.createManyToManyRelationship({
|
|
@@ -289,35 +357,69 @@ var MetadataClient = class {
|
|
|
289
357
|
* });
|
|
290
358
|
* ```
|
|
291
359
|
*/
|
|
292
|
-
async createManyToManyRelationship(relationship) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
360
|
+
async createManyToManyRelationship(relationship, options) {
|
|
361
|
+
return this.createDefinition("/RelationshipDefinitions", relationship, options);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Update an existing one-to-many relationship.
|
|
365
|
+
* A `PUT` that **replaces** the definition: send the complete relationship definition, with its
|
|
366
|
+
* `@odata.type`, or use {@link mergeAndUpdateRelationship}.
|
|
367
|
+
* @param schemaName Relationship schema name
|
|
368
|
+
* @param relationship The complete relationship definition
|
|
369
|
+
* @param options Solution to add the change to
|
|
370
|
+
*/
|
|
371
|
+
async updateOneToManyRelationship(schemaName, relationship, options) {
|
|
372
|
+
await this.updateDefinition(
|
|
373
|
+
`/RelationshipDefinitions(${odataKey({ SchemaName: schemaName })})`,
|
|
374
|
+
relationship,
|
|
375
|
+
options
|
|
376
|
+
);
|
|
298
377
|
}
|
|
299
378
|
/**
|
|
300
|
-
* Update an existing
|
|
379
|
+
* Update an existing many-to-many relationship.
|
|
380
|
+
* A `PUT` that **replaces** the definition: send the complete relationship definition, with its
|
|
381
|
+
* `@odata.type`, or use {@link mergeAndUpdateRelationship}.
|
|
301
382
|
* @param schemaName Relationship schema name
|
|
302
|
-
* @param relationship
|
|
383
|
+
* @param relationship The complete relationship definition
|
|
384
|
+
* @param options Solution to add the change to
|
|
303
385
|
*/
|
|
304
|
-
async
|
|
305
|
-
await this.
|
|
386
|
+
async updateManyToManyRelationship(schemaName, relationship, options) {
|
|
387
|
+
await this.updateDefinition(
|
|
388
|
+
`/RelationshipDefinitions(${odataKey({ SchemaName: schemaName })})`,
|
|
389
|
+
relationship,
|
|
390
|
+
options
|
|
391
|
+
);
|
|
306
392
|
}
|
|
307
393
|
/**
|
|
308
|
-
*
|
|
394
|
+
* Retrieve a 1:N or N:N relationship definition, apply `changes` to it, and `PUT` the result
|
|
395
|
+
* back, so the properties you don't change keep their current values.
|
|
396
|
+
*
|
|
397
|
+
* `changes` names the relationship's `@odata.type` (`OneToManyRelationshipMetadata` or
|
|
398
|
+
* `ManyToManyRelationshipMetadata`); the retrieve is cast to that type so it returns the type's
|
|
399
|
+
* own properties, such as `CascadeConfiguration`. It sends `Consistency: Strong`, so it reads
|
|
400
|
+
* the latest definition rather than a cached copy that would undo a recent change.
|
|
309
401
|
* @param schemaName Relationship schema name
|
|
310
|
-
* @param
|
|
402
|
+
* @param changes The properties to change, with the relationship's `@odata.type`
|
|
403
|
+
* @param options Solution to add the change to
|
|
404
|
+
* @example
|
|
405
|
+
* ```typescript
|
|
406
|
+
* await metadataClient.mergeAndUpdateRelationship("new_account_project", {
|
|
407
|
+
* "@odata.type": "Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata",
|
|
408
|
+
* IsValidForAdvancedFind: false,
|
|
409
|
+
* });
|
|
410
|
+
* ```
|
|
311
411
|
*/
|
|
312
|
-
async
|
|
313
|
-
|
|
412
|
+
async mergeAndUpdateRelationship(schemaName, changes, options) {
|
|
413
|
+
const path = `/RelationshipDefinitions(${odataKey({ SchemaName: schemaName })})`;
|
|
414
|
+
const type = metadataType(changes);
|
|
415
|
+
await this.mergeAndUpdate(`${path}/${type}`, path, type, changes, options);
|
|
314
416
|
}
|
|
315
417
|
/**
|
|
316
418
|
* Delete a relationship by schema name
|
|
317
419
|
* @param schemaName Relationship schema name
|
|
318
420
|
*/
|
|
319
421
|
async deleteRelationshipBySchemaName(schemaName) {
|
|
320
|
-
await this.client.api(`/RelationshipDefinitions(
|
|
422
|
+
await this.client.api(`/RelationshipDefinitions(${odataKey({ SchemaName: schemaName })})`).delete();
|
|
321
423
|
}
|
|
322
424
|
// ==================== Global Option Sets ====================
|
|
323
425
|
/**
|
|
@@ -326,17 +428,7 @@ var MetadataClient = class {
|
|
|
326
428
|
* @returns Array of global option set metadata
|
|
327
429
|
*/
|
|
328
430
|
async getGlobalOptionSets(options) {
|
|
329
|
-
|
|
330
|
-
if (options?.select) {
|
|
331
|
-
builder = builder.select(...options.select);
|
|
332
|
-
}
|
|
333
|
-
if (options?.filter) {
|
|
334
|
-
builder = builder.filter(options.filter);
|
|
335
|
-
}
|
|
336
|
-
if (options?.expand) {
|
|
337
|
-
builder = builder.expand(options.expand);
|
|
338
|
-
}
|
|
339
|
-
const response = await builder.get();
|
|
431
|
+
const response = await this.query("/GlobalOptionSetDefinitions", options).get();
|
|
340
432
|
return response.value;
|
|
341
433
|
}
|
|
342
434
|
/**
|
|
@@ -346,23 +438,16 @@ var MetadataClient = class {
|
|
|
346
438
|
* @returns Option set metadata
|
|
347
439
|
*/
|
|
348
440
|
async getGlobalOptionSet(nameOrMetadataId, options) {
|
|
349
|
-
|
|
350
|
-
nameOrMetadataId
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
let builder = this.client.api(path);
|
|
354
|
-
if (options?.select) {
|
|
355
|
-
builder = builder.select(...options.select);
|
|
356
|
-
}
|
|
357
|
-
if (options?.expand) {
|
|
358
|
-
builder = builder.expand(options.expand);
|
|
359
|
-
}
|
|
360
|
-
return await builder.get();
|
|
441
|
+
return await this.query(
|
|
442
|
+
globalOptionSetPath(nameOrMetadataId),
|
|
443
|
+
options
|
|
444
|
+
).get();
|
|
361
445
|
}
|
|
362
446
|
/**
|
|
363
447
|
* Create a global option set
|
|
364
448
|
* @param optionSet Option set metadata to create
|
|
365
|
-
* @
|
|
449
|
+
* @param options Solution to add the new component to
|
|
450
|
+
* @returns Metadata ID of the created option set (GUID), read from the `OData-EntityId` response header
|
|
366
451
|
* @example
|
|
367
452
|
* ```typescript
|
|
368
453
|
* const metadataId = await metadataClient.createGlobalOptionSet({
|
|
@@ -378,35 +463,51 @@ var MetadataClient = class {
|
|
|
378
463
|
* });
|
|
379
464
|
* ```
|
|
380
465
|
*/
|
|
381
|
-
async createGlobalOptionSet(optionSet) {
|
|
382
|
-
|
|
383
|
-
if (!response.MetadataId) {
|
|
384
|
-
throw new Error("Failed to retrieve option set metadata ID from response");
|
|
385
|
-
}
|
|
386
|
-
return response.MetadataId;
|
|
466
|
+
async createGlobalOptionSet(optionSet, options) {
|
|
467
|
+
return this.createDefinition("/GlobalOptionSetDefinitions", optionSet, options);
|
|
387
468
|
}
|
|
388
469
|
/**
|
|
389
|
-
* Update a global option set
|
|
470
|
+
* Update a global option set.
|
|
471
|
+
* A `PUT` that **replaces** the definition: send the complete option set definition, with its
|
|
472
|
+
* `@odata.type`, or use {@link mergeAndUpdateGlobalOptionSet}. A `PUT` doesn't change the
|
|
473
|
+
* options: to add, change, remove or reorder them, use {@link insertOptionValue},
|
|
474
|
+
* {@link updateOptionValue}, {@link deleteOptionValue} or {@link orderOptions}.
|
|
390
475
|
* @param nameOrMetadataId Option set name or metadata ID
|
|
391
|
-
* @param optionSet
|
|
476
|
+
* @param optionSet The complete option set definition
|
|
477
|
+
* @param options Solution to add the change to
|
|
392
478
|
*/
|
|
393
|
-
async updateGlobalOptionSet(nameOrMetadataId, optionSet) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
479
|
+
async updateGlobalOptionSet(nameOrMetadataId, optionSet, options) {
|
|
480
|
+
await this.updateDefinition(globalOptionSetPath(nameOrMetadataId), optionSet, options);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Retrieve a global option set, apply `changes` to it, and `PUT` the result back, so the
|
|
484
|
+
* properties you don't change keep their current values.
|
|
485
|
+
*
|
|
486
|
+
* The retrieve is cast to `OptionSetMetadata` and sends `Consistency: Strong`, so it reads the
|
|
487
|
+
* latest definition rather than a cached copy that would undo a recent change. The options are
|
|
488
|
+
* left out of the `PUT`, which doesn't change them: use {@link insertOptionValue} and the other
|
|
489
|
+
* option actions for that.
|
|
490
|
+
* @param nameOrMetadataId Option set name or metadata ID
|
|
491
|
+
* @param changes The properties to change
|
|
492
|
+
* @param options Solution to add the change to
|
|
493
|
+
* @example
|
|
494
|
+
* ```typescript
|
|
495
|
+
* await metadataClient.mergeAndUpdateGlobalOptionSet("new_colors", {
|
|
496
|
+
* Description: { LocalizedLabels: [{ Label: "Paint colors", LanguageCode: 1033 }] },
|
|
497
|
+
* });
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
500
|
+
async mergeAndUpdateGlobalOptionSet(nameOrMetadataId, changes, options) {
|
|
501
|
+
const path = globalOptionSetPath(nameOrMetadataId);
|
|
502
|
+
const type = "Microsoft.Dynamics.CRM.OptionSetMetadata";
|
|
503
|
+
await this.mergeAndUpdate(`${path}/${type}`, path, type, changes, options, ["Options"]);
|
|
399
504
|
}
|
|
400
505
|
/**
|
|
401
506
|
* Delete a global option set
|
|
402
507
|
* @param nameOrMetadataId Option set name or metadata ID
|
|
403
508
|
*/
|
|
404
509
|
async deleteGlobalOptionSet(nameOrMetadataId) {
|
|
405
|
-
|
|
406
|
-
nameOrMetadataId
|
|
407
|
-
);
|
|
408
|
-
const path = isGuid ? `/GlobalOptionSetDefinitions(${nameOrMetadataId})` : `/GlobalOptionSetDefinitions(Name='${nameOrMetadataId}')`;
|
|
409
|
-
await this.client.api(path).delete();
|
|
510
|
+
await this.client.api(globalOptionSetPath(nameOrMetadataId)).delete();
|
|
410
511
|
}
|
|
411
512
|
// ==================== Option Value Operations ====================
|
|
412
513
|
/**
|
|
@@ -432,35 +533,44 @@ var MetadataClient = class {
|
|
|
432
533
|
* ```
|
|
433
534
|
*/
|
|
434
535
|
async insertOptionValue(params) {
|
|
536
|
+
checkOptionSetTarget(params);
|
|
435
537
|
return await this.client.api("/InsertOptionValue").post(params);
|
|
436
538
|
}
|
|
437
539
|
/**
|
|
438
540
|
* Update an option value in a local or global option set
|
|
439
|
-
* @param params Update option value parameters
|
|
541
|
+
* @param params Update option value parameters: the choice (`OptionSetName`, or
|
|
542
|
+
* `EntityLogicalName` and `AttributeLogicalName`), the option's `Value` and `MergeLabels`
|
|
440
543
|
*/
|
|
441
544
|
async updateOptionValue(params) {
|
|
545
|
+
checkOptionSetTarget(params);
|
|
442
546
|
await this.client.api("/UpdateOptionValue").post(params);
|
|
443
547
|
}
|
|
444
548
|
/**
|
|
445
549
|
* Delete an option value from a local or global option set
|
|
446
|
-
* @param params Delete option value parameters
|
|
550
|
+
* @param params Delete option value parameters: the choice (`OptionSetName`, or
|
|
551
|
+
* `EntityLogicalName` and `AttributeLogicalName`) and the option's `Value`
|
|
447
552
|
*/
|
|
448
553
|
async deleteOptionValue(params) {
|
|
554
|
+
checkOptionSetTarget(params);
|
|
449
555
|
await this.client.api("/DeleteOptionValue").post(params);
|
|
450
556
|
}
|
|
451
557
|
/**
|
|
452
558
|
* Reorder options in a local or global option set
|
|
453
|
-
* @param params Order option parameters
|
|
559
|
+
* @param params Order option parameters: the choice (`OptionSetName`, or `EntityLogicalName`
|
|
560
|
+
* and `AttributeLogicalName`) and every option value in the new order
|
|
454
561
|
*/
|
|
455
562
|
async orderOptions(params) {
|
|
563
|
+
checkOptionSetTarget(params);
|
|
456
564
|
await this.client.api("/OrderOption").post(params);
|
|
457
565
|
}
|
|
458
566
|
/**
|
|
459
|
-
* Insert a status value (statuscode option)
|
|
567
|
+
* Insert a status value (statuscode option). Status reasons belong to a table's `statuscode`
|
|
568
|
+
* column, so the target is always `EntityLogicalName` and `AttributeLogicalName`.
|
|
460
569
|
* @param params Insert status value parameters
|
|
461
570
|
* @returns New option value
|
|
462
571
|
*/
|
|
463
572
|
async insertStatusValue(params) {
|
|
573
|
+
checkOptionSetTarget(params, { localOnly: true });
|
|
464
574
|
return await this.client.api("/InsertStatusValue").post(params);
|
|
465
575
|
}
|
|
466
576
|
// ==================== Polymorphic Lookups ====================
|
|
@@ -496,31 +606,34 @@ var MetadataClient = class {
|
|
|
496
606
|
}
|
|
497
607
|
// ==================== Relationship Eligibility ====================
|
|
498
608
|
/**
|
|
499
|
-
* Check if an entity can be
|
|
609
|
+
* Check if an entity can be the primary (referenced) table in a 1:N relationship.
|
|
610
|
+
* Sends the `CanBeReferenced` action: `POST /CanBeReferenced` with `{ "EntityName": … }`.
|
|
500
611
|
* @param entityName Entity logical name
|
|
501
612
|
* @returns Whether the entity can be referenced
|
|
502
613
|
*/
|
|
503
614
|
async canBeReferenced(entityName) {
|
|
504
|
-
const response = await this.client.api(
|
|
505
|
-
return response
|
|
615
|
+
const response = await this.client.api("/CanBeReferenced").post({ EntityName: entityName });
|
|
616
|
+
return response?.CanBeReferenced ?? false;
|
|
506
617
|
}
|
|
507
618
|
/**
|
|
508
|
-
* Check if an entity can be
|
|
619
|
+
* Check if an entity can be the related (referencing) table in a 1:N relationship.
|
|
620
|
+
* Sends the `CanBeReferencing` action: `POST /CanBeReferencing` with `{ "EntityName": … }`.
|
|
509
621
|
* @param entityName Entity logical name
|
|
510
622
|
* @returns Whether the entity can be referencing
|
|
511
623
|
*/
|
|
512
624
|
async canBeReferencing(entityName) {
|
|
513
|
-
const response = await this.client.api(
|
|
514
|
-
return response
|
|
625
|
+
const response = await this.client.api("/CanBeReferencing").post({ EntityName: entityName });
|
|
626
|
+
return response?.CanBeReferencing ?? false;
|
|
515
627
|
}
|
|
516
628
|
/**
|
|
517
|
-
* Check if an entity can
|
|
629
|
+
* Check if an entity can take part in a many-to-many relationship.
|
|
630
|
+
* Sends the `CanManyToMany` action: `POST /CanManyToMany` with `{ "EntityName": … }`.
|
|
518
631
|
* @param entityName Entity logical name
|
|
519
632
|
* @returns Whether the entity can participate in N:N
|
|
520
633
|
*/
|
|
521
634
|
async canManyToMany(entityName) {
|
|
522
|
-
const response = await this.client.api(
|
|
523
|
-
return response
|
|
635
|
+
const response = await this.client.api("/CanManyToMany").post({ EntityName: entityName });
|
|
636
|
+
return response?.CanManyToMany ?? false;
|
|
524
637
|
}
|
|
525
638
|
/**
|
|
526
639
|
* Get entities that can reference the specified entity
|
|
@@ -528,7 +641,9 @@ var MetadataClient = class {
|
|
|
528
641
|
* @returns Array of entity names that can reference the specified entity
|
|
529
642
|
*/
|
|
530
643
|
async getValidReferencingEntities(referencedEntityName) {
|
|
531
|
-
const response = await this.client.api(
|
|
644
|
+
const response = await this.client.api(
|
|
645
|
+
`/GetValidReferencingEntities(${odataKey({ ReferencedEntityName: referencedEntityName })})`
|
|
646
|
+
).get();
|
|
532
647
|
return response.EntityNames ?? [];
|
|
533
648
|
}
|
|
534
649
|
/**
|
|
@@ -537,7 +652,9 @@ var MetadataClient = class {
|
|
|
537
652
|
* @returns Array of entity names that can be referenced
|
|
538
653
|
*/
|
|
539
654
|
async getValidReferencedEntities(referencingEntityName) {
|
|
540
|
-
const response = await this.client.api(
|
|
655
|
+
const response = await this.client.api(
|
|
656
|
+
`/GetValidReferencedEntities(${odataKey({ ReferencingEntityName: referencingEntityName })})`
|
|
657
|
+
).get();
|
|
541
658
|
return response.EntityNames ?? [];
|
|
542
659
|
}
|
|
543
660
|
/**
|
|
@@ -550,738 +667,891 @@ var MetadataClient = class {
|
|
|
550
667
|
}
|
|
551
668
|
// ==================== Metadata Change Tracking ====================
|
|
552
669
|
/**
|
|
553
|
-
* Retrieve metadata changes since
|
|
670
|
+
* Retrieve metadata, or the changes to it since an earlier call.
|
|
671
|
+
*
|
|
672
|
+
* `RetrieveMetadataChanges` is a Web API **function**, so this sends a GET with parameter
|
|
673
|
+
* aliases: `GET /RetrieveMetadataChanges(Query=@p1,ClientVersionStamp=@p2,…)?@p1=<json>`.
|
|
674
|
+
* Keep the returned `ServerVersionStamp` and pass it as `clientVersionStamp` next time to get
|
|
675
|
+
* only what changed since then.
|
|
676
|
+
*
|
|
677
|
+
* Dataverse reads the enum members in the query (`FilterOperator`, `ConditionOperator`) only
|
|
678
|
+
* by name (`"And"`, `"Equals"`), so numeric values are sent as their names. A condition's
|
|
679
|
+
* `Value` is `{ Type, Value }`, e.g. `{ Type: "System.String", Value: "account" }`.
|
|
680
|
+
*
|
|
554
681
|
* @param query Entity query expression
|
|
555
|
-
* @param clientVersionStamp
|
|
556
|
-
* @param deletedMetadataFilters
|
|
557
|
-
*
|
|
682
|
+
* @param clientVersionStamp `ServerVersionStamp` from a previous call
|
|
683
|
+
* @param deletedMetadataFilters With a version stamp, which deleted metadata to return: a
|
|
684
|
+
* member name (`"Default"`, `"Attribute"`, `"Relationship"`, `"Label"`, `"OptionSet"`,
|
|
685
|
+
* `"All"`, or a `DeletedMetadataFilters` member), a comma-separated list of names, or the
|
|
686
|
+
* numeric flag value
|
|
687
|
+
* @returns The matching metadata, any deleted metadata, and the new `ServerVersionStamp`
|
|
558
688
|
* @example
|
|
559
689
|
* ```typescript
|
|
560
|
-
* const
|
|
690
|
+
* const query = {
|
|
561
691
|
* Criteria: {
|
|
562
|
-
* FilterOperator:
|
|
692
|
+
* FilterOperator: "And",
|
|
563
693
|
* Conditions: [
|
|
564
694
|
* {
|
|
565
|
-
* PropertyName:
|
|
566
|
-
* ConditionOperator:
|
|
567
|
-
* Value:
|
|
568
|
-
* }
|
|
569
|
-
* ]
|
|
695
|
+
* PropertyName: "LogicalName",
|
|
696
|
+
* ConditionOperator: "Equals",
|
|
697
|
+
* Value: { Type: "System.String", Value: "account" },
|
|
698
|
+
* },
|
|
699
|
+
* ],
|
|
570
700
|
* },
|
|
571
|
-
* Properties: {
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
* // Store result.ServerVersionStamp for next call
|
|
701
|
+
* Properties: { AllProperties: false, PropertyNames: ["LogicalName", "SchemaName"] },
|
|
702
|
+
* };
|
|
703
|
+
* const first = await metadataClient.retrieveMetadataChanges(query);
|
|
704
|
+
* // Later: only what changed since the first call
|
|
705
|
+
* const changes = await metadataClient.retrieveMetadataChanges(query, first.ServerVersionStamp);
|
|
577
706
|
* ```
|
|
578
707
|
*/
|
|
579
708
|
async retrieveMetadataChanges(query, clientVersionStamp, deletedMetadataFilters) {
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
};
|
|
709
|
+
const aliases = ["Query=@p1"];
|
|
710
|
+
const values = [`@p1=${encodeURIComponent(JSON.stringify(query, enumNameReplacer))}`];
|
|
583
711
|
if (clientVersionStamp) {
|
|
584
|
-
|
|
712
|
+
aliases.push("ClientVersionStamp=@p2");
|
|
713
|
+
values.push(`@p2=${encodeURIComponent(odataLiteral.string(clientVersionStamp))}`);
|
|
714
|
+
}
|
|
715
|
+
if (deletedMetadataFilters !== void 0) {
|
|
716
|
+
aliases.push("DeletedMetadataFilters=@p3");
|
|
717
|
+
const literal = odataLiteral.enum(
|
|
718
|
+
"Microsoft.Dynamics.CRM.DeletedMetadataFilters",
|
|
719
|
+
String(deletedMetadataFilters).split(",").map((member) => member.trim())
|
|
720
|
+
);
|
|
721
|
+
values.push(`@p3=${encodeURIComponent(literal)}`);
|
|
585
722
|
}
|
|
586
|
-
|
|
587
|
-
|
|
723
|
+
return await this.client.api(`/RetrieveMetadataChanges(${aliases.join(",")})?${values.join("&")}`).get();
|
|
724
|
+
}
|
|
725
|
+
// ==================== Internals ====================
|
|
726
|
+
/**
|
|
727
|
+
* POST a metadata definition and return its MetadataId. Dataverse answers a metadata create
|
|
728
|
+
* with `204 No Content` and the new id in the `OData-EntityId` header
|
|
729
|
+
* (`…/EntityDefinitions(<id>)`); a `MetadataId` in a JSON body is the fallback.
|
|
730
|
+
*/
|
|
731
|
+
async createDefinition(path, body, options) {
|
|
732
|
+
const res = await this.writeBuilder(path, options).response("POST", body);
|
|
733
|
+
if (!res.ok) throw await parseODataError(res);
|
|
734
|
+
const fromHeader = GUID_AT_END.exec(res.headers.get("odata-entityid") ?? "")?.[1];
|
|
735
|
+
if (fromHeader) {
|
|
736
|
+
res.body?.cancel().catch(() => void 0);
|
|
737
|
+
return fromHeader;
|
|
588
738
|
}
|
|
589
|
-
|
|
739
|
+
const text = res.status === 204 ? "" : await res.text();
|
|
740
|
+
const fromBody = text.trim() ? JSON.parse(text).MetadataId : "";
|
|
741
|
+
if (typeof fromBody === "string" && fromBody) return fromBody;
|
|
742
|
+
throw DataverseInvalidRequestError.missingParameter("OData-EntityId response header");
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Retrieve the definition at `getPath` (with `Consistency: Strong`, so not a cached copy that
|
|
746
|
+
* would undo a recent change), drop its OData annotations and the `omit` properties, apply
|
|
747
|
+
* `changes`, set `@odata.type`, and `PUT` the result to `putPath`.
|
|
748
|
+
*/
|
|
749
|
+
async mergeAndUpdate(getPath, putPath, odataType, changes, options, omit = []) {
|
|
750
|
+
const current = await this.client.api(getPath).header("Consistency", "Strong").get();
|
|
751
|
+
const kept = Object.fromEntries(
|
|
752
|
+
Object.entries(withoutAnnotations(current)).filter(([key]) => !omit.includes(key))
|
|
753
|
+
);
|
|
754
|
+
const merged = { ...kept, ...changes, "@odata.type": odataType };
|
|
755
|
+
await this.updateDefinition(putPath, merged, options);
|
|
756
|
+
}
|
|
757
|
+
/** PUT a complete metadata definition, merging labels. */
|
|
758
|
+
async updateDefinition(path, body, options) {
|
|
759
|
+
await this.writeBuilder(path, options).header("MSCRM.MergeLabels", "true").put(body);
|
|
760
|
+
}
|
|
761
|
+
writeBuilder(path, options) {
|
|
762
|
+
const builder = this.client.api(path).header("Content-Type", "application/json");
|
|
763
|
+
return options?.solutionUniqueName ? builder.header("MSCRM.SolutionUniqueName", options.solutionUniqueName) : builder;
|
|
764
|
+
}
|
|
765
|
+
// ==================== Internals ====================
|
|
766
|
+
/** A GET builder for `path` with the query options applied. */
|
|
767
|
+
query(path, options) {
|
|
768
|
+
const languages = options?.labelLanguages === void 0 ? [] : [options.labelLanguages].flat();
|
|
769
|
+
const url = languages.length > 0 ? `${path}?LabelLanguages=${languages.join(",")}` : path;
|
|
770
|
+
let builder = this.client.api(url);
|
|
771
|
+
if (options?.select?.length) builder = builder.select(...options.select);
|
|
772
|
+
if (options?.filter) builder = builder.filter(options.filter);
|
|
773
|
+
if (options?.expand?.length) builder = builder.expand(...[options.expand].flat());
|
|
774
|
+
return builder;
|
|
775
|
+
}
|
|
776
|
+
/** Load every table's entity set name once; a failed load is not cached. */
|
|
777
|
+
loadEntitySetNames() {
|
|
778
|
+
this.entitySetNamesLoad ??= this.query("/EntityDefinitions", {
|
|
779
|
+
select: ["LogicalName", "EntitySetName"]
|
|
780
|
+
}).get().then((response) => {
|
|
781
|
+
const names = /* @__PURE__ */ new Map();
|
|
782
|
+
for (const e of response.value) {
|
|
783
|
+
if (e.LogicalName && e.EntitySetName) names.set(e.LogicalName, e.EntitySetName);
|
|
784
|
+
}
|
|
785
|
+
this.entitySetNames = names;
|
|
786
|
+
return names;
|
|
787
|
+
}).catch((err) => {
|
|
788
|
+
this.entitySetNamesLoad = void 0;
|
|
789
|
+
throw err;
|
|
790
|
+
});
|
|
791
|
+
return this.entitySetNamesLoad;
|
|
590
792
|
}
|
|
591
793
|
};
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
794
|
+
function checkOptionSetTarget(params, { localOnly = false } = {}) {
|
|
795
|
+
const global = params.OptionSetName != null;
|
|
796
|
+
const local = params.EntityLogicalName != null || params.AttributeLogicalName != null;
|
|
797
|
+
if (global && (local || localOnly)) {
|
|
798
|
+
throw DataverseInvalidRequestError.invalidParameter(
|
|
799
|
+
"OptionSetName",
|
|
800
|
+
localOnly ? "status values belong to a table's statuscode column; pass EntityLogicalName and AttributeLogicalName" : "pass either OptionSetName (a global choice) or EntityLogicalName and AttributeLogicalName (a local choice), not both"
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
if (global) return;
|
|
804
|
+
if (!local) {
|
|
805
|
+
throw DataverseInvalidRequestError.missingParameter(
|
|
806
|
+
localOnly ? "EntityLogicalName and AttributeLogicalName" : "OptionSetName, or EntityLogicalName and AttributeLogicalName"
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
if (params.EntityLogicalName == null) {
|
|
810
|
+
throw DataverseInvalidRequestError.missingParameter("EntityLogicalName");
|
|
811
|
+
}
|
|
812
|
+
if (params.AttributeLogicalName == null) {
|
|
813
|
+
throw DataverseInvalidRequestError.missingParameter("AttributeLogicalName");
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
function attributePath(entityLogicalName, attributeLogicalName) {
|
|
817
|
+
return `/EntityDefinitions(${odataKey({ LogicalName: entityLogicalName })})/Attributes(${odataKey({ LogicalName: attributeLogicalName })})`;
|
|
818
|
+
}
|
|
819
|
+
var GUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
820
|
+
function globalOptionSetPath(nameOrMetadataId) {
|
|
821
|
+
return GUID.test(nameOrMetadataId) ? `/GlobalOptionSetDefinitions(${nameOrMetadataId})` : `/GlobalOptionSetDefinitions(${odataKey({ Name: nameOrMetadataId })})`;
|
|
822
|
+
}
|
|
823
|
+
function metadataType(changes) {
|
|
824
|
+
const type = changes["@odata.type"];
|
|
825
|
+
if (type == null) throw DataverseInvalidRequestError.missingParameter("@odata.type");
|
|
826
|
+
const name = typeof type === "string" ? type.replace(/^#/, "") : "";
|
|
827
|
+
if (!/^Microsoft\.Dynamics\.CRM\.\w+$/.test(name)) {
|
|
828
|
+
throw DataverseInvalidRequestError.invalidParameter(
|
|
829
|
+
"@odata.type",
|
|
830
|
+
`expected "Microsoft.Dynamics.CRM.<Type>", got ${JSON.stringify(type)}`
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
return name;
|
|
834
|
+
}
|
|
835
|
+
function castSegment(cast) {
|
|
836
|
+
return cast ? `/Microsoft.Dynamics.CRM.${cast}` : "";
|
|
837
|
+
}
|
|
838
|
+
var GUID_AT_END = /\(([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\)\s*$/i;
|
|
839
|
+
function withoutAnnotations(definition) {
|
|
840
|
+
return Object.fromEntries(Object.entries(definition).filter(([key]) => !key.includes("@odata.")));
|
|
841
|
+
}
|
|
842
|
+
var LOGICAL_OPERATORS = ["And", "Or"];
|
|
843
|
+
var CONDITION_OPERATORS = ["Equals", "NotEquals", "In", "NotIn", "GreaterThan", "LessThan"];
|
|
844
|
+
function enumNameReplacer(key, value) {
|
|
845
|
+
if (typeof value !== "number") return value;
|
|
846
|
+
if (key === "FilterOperator") return LOGICAL_OPERATORS[value] ?? value;
|
|
847
|
+
if (key === "ConditionOperator") return CONDITION_OPERATORS[value] ?? value;
|
|
848
|
+
return value;
|
|
849
|
+
}
|
|
850
|
+
var Metadata = {
|
|
851
|
+
label,
|
|
852
|
+
entity,
|
|
853
|
+
primaryName,
|
|
854
|
+
string,
|
|
855
|
+
memo,
|
|
856
|
+
integer,
|
|
857
|
+
decimal,
|
|
858
|
+
double,
|
|
859
|
+
money,
|
|
860
|
+
dateTime,
|
|
861
|
+
boolean,
|
|
862
|
+
picklist,
|
|
863
|
+
multiSelectPicklist,
|
|
864
|
+
file,
|
|
865
|
+
image,
|
|
866
|
+
lookup,
|
|
867
|
+
manyToMany,
|
|
868
|
+
globalOptionSet
|
|
869
|
+
};
|
|
870
|
+
var DEFAULT_LANGUAGE = 1033;
|
|
871
|
+
function label(textOrTexts, languageCode) {
|
|
872
|
+
if (typeof textOrTexts === "string") {
|
|
873
|
+
return makeLabel([[textOrTexts, checkLanguage(languageCode ?? DEFAULT_LANGUAGE)]], "text");
|
|
874
|
+
}
|
|
875
|
+
if (languageCode !== void 0) {
|
|
876
|
+
throw invalid("languageCode", "give the languages as the keys of the texts, not separately");
|
|
877
|
+
}
|
|
878
|
+
const entries = Object.entries(textOrTexts).map(([lcid, text]) => [
|
|
879
|
+
text,
|
|
880
|
+
checkLanguage(Number(lcid))
|
|
881
|
+
]);
|
|
882
|
+
if (entries.length === 0) throw invalid("texts", "a label needs a text in at least one language");
|
|
883
|
+
return makeLabel(entries, "texts");
|
|
884
|
+
}
|
|
885
|
+
function makeLabel(entries, param) {
|
|
886
|
+
for (const [text] of entries) {
|
|
887
|
+
const value = text;
|
|
888
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
889
|
+
throw invalid(param, "a label's text can't be empty");
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return {
|
|
893
|
+
"@odata.type": "Microsoft.Dynamics.CRM.Label",
|
|
894
|
+
LocalizedLabels: entries.map(([text, LanguageCode]) => ({
|
|
895
|
+
"@odata.type": "Microsoft.Dynamics.CRM.LocalizedLabel",
|
|
896
|
+
Label: text,
|
|
897
|
+
LanguageCode
|
|
898
|
+
}))
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
function checkLanguage(languageCode) {
|
|
902
|
+
if (!Number.isInteger(languageCode) || languageCode <= 0 || languageCode > 65535) {
|
|
903
|
+
throw invalid(
|
|
904
|
+
"languageCode",
|
|
905
|
+
`${String(languageCode)} isn't a language code (LCID), e.g. 1033`
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
return languageCode;
|
|
909
|
+
}
|
|
910
|
+
function toLabel(input, languageCode, param) {
|
|
911
|
+
if (typeof input !== "string") return input;
|
|
912
|
+
return makeLabel([[input, checkLanguage(languageCode ?? DEFAULT_LANGUAGE)]], param);
|
|
913
|
+
}
|
|
914
|
+
function string(schemaName, options) {
|
|
915
|
+
return {
|
|
916
|
+
...column("StringAttributeMetadata", schemaName, options),
|
|
917
|
+
MaxLength: checkRange("maxLength", options.maxLength ?? 100, 1, 4e3, true),
|
|
918
|
+
FormatName: { Value: options.format ?? "Text" }
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
function primaryName(schemaName, options) {
|
|
922
|
+
return {
|
|
923
|
+
...column("StringAttributeMetadata", schemaName, options),
|
|
924
|
+
IsPrimaryName: true,
|
|
925
|
+
MaxLength: checkRange("maxLength", options.maxLength ?? 100, 1, 4e3, true),
|
|
926
|
+
FormatName: { Value: "Text" }
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
function memo(schemaName, options) {
|
|
930
|
+
return {
|
|
931
|
+
...column("MemoAttributeMetadata", schemaName, options),
|
|
932
|
+
MaxLength: checkRange("maxLength", options.maxLength ?? 2e3, 1, 1048576, true),
|
|
933
|
+
Format: "TextArea"
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
function integer(schemaName, options) {
|
|
937
|
+
return {
|
|
938
|
+
...column("IntegerAttributeMetadata", schemaName, options),
|
|
939
|
+
Format: options.format ?? "None",
|
|
940
|
+
...minMax(options, -2147483648, 2147483647, true)
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
function decimal(schemaName, options) {
|
|
944
|
+
return {
|
|
945
|
+
...column("DecimalAttributeMetadata", schemaName, options),
|
|
946
|
+
Precision: checkRange("precision", options.precision ?? 2, 0, 10, true),
|
|
947
|
+
...minMax(options, -1e11, 1e11, false)
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
function double(schemaName, options) {
|
|
951
|
+
return {
|
|
952
|
+
...column("DoubleAttributeMetadata", schemaName, options),
|
|
953
|
+
Precision: checkRange("precision", options.precision ?? 2, 0, 5, true),
|
|
954
|
+
...minMax(options, -1e11, 1e11, false)
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
function money(schemaName, options) {
|
|
958
|
+
const precision = options.precision ?? "currency";
|
|
959
|
+
return {
|
|
960
|
+
...column("MoneyAttributeMetadata", schemaName, options),
|
|
961
|
+
...precision === "currency" ? { PrecisionSource: 2 } : precision === "pricing" ? { PrecisionSource: 1 } : { PrecisionSource: 0, Precision: checkRange("precision", precision, 0, 4, true) },
|
|
962
|
+
...minMax(options, -922337203685477, 922337203685477, false)
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
function dateTime(schemaName, options) {
|
|
966
|
+
const format = options.format ?? "DateAndTime";
|
|
967
|
+
if (options.behavior === "DateOnly" && format !== "DateOnly") {
|
|
968
|
+
throw invalid("behavior", 'the "DateOnly" behavior needs the "DateOnly" format');
|
|
969
|
+
}
|
|
970
|
+
return {
|
|
971
|
+
...column("DateTimeAttributeMetadata", schemaName, options),
|
|
972
|
+
Format: format,
|
|
973
|
+
...options.behavior !== void 0 && { DateTimeBehavior: { Value: options.behavior } }
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
function boolean(schemaName, options) {
|
|
977
|
+
const lang = options.languageCode;
|
|
978
|
+
return {
|
|
979
|
+
...column("BooleanAttributeMetadata", schemaName, options),
|
|
980
|
+
DefaultValue: options.defaultValue ?? false,
|
|
981
|
+
OptionSet: {
|
|
982
|
+
"@odata.type": "Microsoft.Dynamics.CRM.BooleanOptionSetMetadata",
|
|
983
|
+
OptionSetType: "Boolean",
|
|
984
|
+
TrueOption: { Value: 1, Label: toLabel(options.trueLabel ?? "Yes", lang, "trueLabel") },
|
|
985
|
+
FalseOption: { Value: 0, Label: toLabel(options.falseLabel ?? "No", lang, "falseLabel") }
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
function picklist(schemaName, options) {
|
|
990
|
+
return {
|
|
991
|
+
...column("PicklistAttributeMetadata", schemaName, options),
|
|
992
|
+
...choice(options)
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function multiSelectPicklist(schemaName, options) {
|
|
996
|
+
return {
|
|
997
|
+
...column("MultiSelectPicklistAttributeMetadata", schemaName, options),
|
|
998
|
+
...choice(options)
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
function file(schemaName, options) {
|
|
1002
|
+
return {
|
|
1003
|
+
...column("FileAttributeMetadata", schemaName, options),
|
|
1004
|
+
MaxSizeInKB: checkRange("maxSizeInKB", options.maxSizeInKB ?? 32768, 1, 10485760, true)
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
function image(schemaName, options) {
|
|
1008
|
+
return {
|
|
1009
|
+
...column("ImageAttributeMetadata", schemaName, options),
|
|
1010
|
+
MaxSizeInKB: checkRange("maxSizeInKB", options.maxSizeInKB ?? 10240, 1, 30720, true),
|
|
1011
|
+
CanStoreFullImage: options.canStoreFullImage ?? false
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
function lookup(schemaName, options) {
|
|
1015
|
+
return {
|
|
1016
|
+
"@odata.type": "Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata",
|
|
1017
|
+
SchemaName: checkSchemaName("relationshipSchemaName", options.relationshipSchemaName),
|
|
1018
|
+
ReferencedEntity: checkLogicalName("referencedEntity", options.referencedEntity),
|
|
1019
|
+
ReferencingEntity: checkLogicalName("referencingEntity", options.referencingEntity),
|
|
1020
|
+
...options.referencedAttribute !== void 0 && {
|
|
1021
|
+
ReferencedAttribute: checkLogicalName("referencedAttribute", options.referencedAttribute)
|
|
1022
|
+
},
|
|
1023
|
+
...options.cascade !== void 0 && { CascadeConfiguration: options.cascade },
|
|
1024
|
+
Lookup: column("LookupAttributeMetadata", schemaName, options)
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
function manyToMany(schemaName, options) {
|
|
1028
|
+
const name = checkSchemaName("schemaName", schemaName);
|
|
1029
|
+
return {
|
|
1030
|
+
"@odata.type": "Microsoft.Dynamics.CRM.ManyToManyRelationshipMetadata",
|
|
1031
|
+
SchemaName: name,
|
|
1032
|
+
Entity1LogicalName: checkLogicalName("entity1LogicalName", options.entity1LogicalName),
|
|
1033
|
+
Entity2LogicalName: checkLogicalName("entity2LogicalName", options.entity2LogicalName),
|
|
1034
|
+
IntersectEntityName: checkSchemaName(
|
|
1035
|
+
"intersectEntityName",
|
|
1036
|
+
options.intersectEntityName ?? name.toLowerCase()
|
|
1037
|
+
)
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
function entity(schemaName, options) {
|
|
1041
|
+
const lang = options.languageCode;
|
|
1042
|
+
if (options.primaryName.IsPrimaryName !== true) {
|
|
1043
|
+
throw invalid("primaryName", "use Metadata.primaryName(...) for the primary name column");
|
|
1044
|
+
}
|
|
1045
|
+
const attributes = options.attributes ?? [];
|
|
1046
|
+
if (attributes.some((a) => a.IsPrimaryName === true)) {
|
|
1047
|
+
throw invalid("attributes", "a table has one primary name column: pass it as primaryName");
|
|
1048
|
+
}
|
|
1049
|
+
return {
|
|
1050
|
+
"@odata.type": "Microsoft.Dynamics.CRM.EntityMetadata",
|
|
1051
|
+
SchemaName: checkSchemaName("schemaName", schemaName),
|
|
1052
|
+
DisplayName: toLabel(options.displayName, lang, "displayName"),
|
|
1053
|
+
DisplayCollectionName: toLabel(options.displayCollectionName, lang, "displayCollectionName"),
|
|
1054
|
+
...options.description !== void 0 && {
|
|
1055
|
+
Description: toLabel(options.description, lang, "description")
|
|
1056
|
+
},
|
|
1057
|
+
OwnershipType: options.ownershipType ?? "UserOwned",
|
|
1058
|
+
IsActivity: false,
|
|
1059
|
+
HasActivities: options.hasActivities ?? false,
|
|
1060
|
+
HasNotes: options.hasNotes ?? false,
|
|
1061
|
+
Attributes: [options.primaryName, ...attributes]
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
function globalOptionSet(name, options) {
|
|
1065
|
+
const lang = options.languageCode;
|
|
1066
|
+
return {
|
|
1067
|
+
"@odata.type": "Microsoft.Dynamics.CRM.OptionSetMetadata",
|
|
1068
|
+
Name: checkSchemaName("name", name),
|
|
1069
|
+
DisplayName: toLabel(options.displayName, lang, "displayName"),
|
|
1070
|
+
...options.description !== void 0 && {
|
|
1071
|
+
Description: toLabel(options.description, lang, "description")
|
|
1072
|
+
},
|
|
1073
|
+
IsGlobal: true,
|
|
1074
|
+
OptionSetType: "Picklist",
|
|
1075
|
+
Options: toOptions(options.options, lang)
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
function column(type, schemaName, options) {
|
|
1079
|
+
const lang = options.languageCode;
|
|
1080
|
+
const requiredLevel = options.requiredLevel ?? "None";
|
|
1081
|
+
if (!REQUIRED_LEVELS.includes(requiredLevel)) {
|
|
1082
|
+
throw invalid("requiredLevel", `use one of ${REQUIRED_LEVELS.join(", ")}`);
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
"@odata.type": `Microsoft.Dynamics.CRM.${type}`,
|
|
1086
|
+
SchemaName: checkSchemaName("schemaName", schemaName),
|
|
1087
|
+
DisplayName: toLabel(options.displayName, lang, "displayName"),
|
|
1088
|
+
...options.description !== void 0 && {
|
|
1089
|
+
Description: toLabel(options.description, lang, "description")
|
|
1090
|
+
},
|
|
1091
|
+
RequiredLevel: { Value: requiredLevel }
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
var REQUIRED_LEVELS = ["None", "Recommended", "ApplicationRequired"];
|
|
1095
|
+
function choice(options) {
|
|
1096
|
+
const hasLocal = options.options !== void 0;
|
|
1097
|
+
const hasGlobal = options.globalOptionSetId !== void 0;
|
|
1098
|
+
if (hasLocal === hasGlobal) {
|
|
1099
|
+
throw invalid(
|
|
1100
|
+
"options",
|
|
1101
|
+
"give the column its own options or a globalOptionSetId, not both or neither"
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
const defaultValue = options.defaultValue === void 0 ? {} : {
|
|
1105
|
+
DefaultFormValue: checkRange(
|
|
1106
|
+
"defaultValue",
|
|
1107
|
+
options.defaultValue,
|
|
1108
|
+
-2147483648,
|
|
1109
|
+
2147483647,
|
|
1110
|
+
true
|
|
1111
|
+
)
|
|
1112
|
+
};
|
|
1113
|
+
if (options.globalOptionSetId !== void 0) {
|
|
1114
|
+
const id = options.globalOptionSetId;
|
|
1115
|
+
if (!GUID2.test(id)) {
|
|
1116
|
+
throw invalid(
|
|
1117
|
+
"globalOptionSetId",
|
|
1118
|
+
"use the global choice's MetadataId (a GUID); Dataverse binds by id only"
|
|
1119
|
+
);
|
|
1120
|
+
}
|
|
1121
|
+
return { "GlobalOptionSet@odata.bind": `/GlobalOptionSetDefinitions(${id})`, ...defaultValue };
|
|
1122
|
+
}
|
|
1123
|
+
const opts = toOptions(options.options, options.languageCode);
|
|
1124
|
+
if (options.defaultValue !== void 0 && opts.every((o) => o.Value !== void 0) && !opts.some((o) => o.Value === options.defaultValue)) {
|
|
1125
|
+
throw invalid(
|
|
1126
|
+
"defaultValue",
|
|
1127
|
+
`${String(options.defaultValue)} isn't one of the options' values`
|
|
1128
|
+
);
|
|
1129
|
+
}
|
|
1130
|
+
return {
|
|
1131
|
+
OptionSet: {
|
|
1132
|
+
"@odata.type": "Microsoft.Dynamics.CRM.OptionSetMetadata",
|
|
1133
|
+
IsGlobal: false,
|
|
1134
|
+
OptionSetType: "Picklist",
|
|
1135
|
+
Options: opts
|
|
1136
|
+
},
|
|
1137
|
+
...defaultValue
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
function toOptions(inputs, languageCode) {
|
|
1141
|
+
if (inputs.length === 0) throw invalid("options", "a choice needs at least one option");
|
|
1142
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1143
|
+
return inputs.map((input, i) => {
|
|
1144
|
+
const o = typeof input === "string" ? { label: input } : input;
|
|
1145
|
+
const param = `options[${String(i)}]`;
|
|
1146
|
+
if (o.value !== void 0) {
|
|
1147
|
+
checkRange(`${param}.value`, o.value, -2147483648, 2147483647, true);
|
|
1148
|
+
if (seen.has(o.value)) throw invalid(`${param}.value`, `${String(o.value)} is used twice`);
|
|
1149
|
+
seen.add(o.value);
|
|
1150
|
+
}
|
|
1151
|
+
return {
|
|
1152
|
+
...o.value !== void 0 && { Value: o.value },
|
|
1153
|
+
Label: toLabel(o.label, languageCode, `${param}.label`),
|
|
1154
|
+
...o.description !== void 0 && {
|
|
1155
|
+
Description: toLabel(o.description, languageCode, `${param}.description`)
|
|
1156
|
+
},
|
|
1157
|
+
...o.color !== void 0 && { Color: o.color }
|
|
1158
|
+
};
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
function minMax(options, lowest, highest, integerOnly) {
|
|
1162
|
+
const { minValue, maxValue } = options;
|
|
1163
|
+
if (minValue !== void 0) checkRange("minValue", minValue, lowest, highest, integerOnly);
|
|
1164
|
+
if (maxValue !== void 0) checkRange("maxValue", maxValue, lowest, highest, integerOnly);
|
|
1165
|
+
if (minValue !== void 0 && maxValue !== void 0 && minValue > maxValue) {
|
|
1166
|
+
throw invalid("minValue", `${String(minValue)} is greater than maxValue ${String(maxValue)}`);
|
|
1167
|
+
}
|
|
1168
|
+
return {
|
|
1169
|
+
...minValue !== void 0 && { MinValue: minValue },
|
|
1170
|
+
...maxValue !== void 0 && { MaxValue: maxValue }
|
|
1171
|
+
};
|
|
1172
|
+
}
|
|
1173
|
+
function checkRange(param, value, lowest, highest, integerOnly) {
|
|
1174
|
+
const n = value;
|
|
1175
|
+
if (typeof n !== "number" || !Number.isFinite(n) || integerOnly && !Number.isInteger(n) || n < lowest || n > highest) {
|
|
1176
|
+
throw invalid(
|
|
1177
|
+
param,
|
|
1178
|
+
`${String(value)} must be ${integerOnly ? "a whole number" : "a number"} from ${String(lowest)} to ${String(highest)}`
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1181
|
+
return value;
|
|
1182
|
+
}
|
|
1183
|
+
var SCHEMA_NAME = /^[A-Za-z][A-Za-z0-9]*_[A-Za-z0-9_]+$/;
|
|
1184
|
+
var LOGICAL_NAME = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
1185
|
+
var GUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1186
|
+
function checkSchemaName(param, name) {
|
|
1187
|
+
const value = name;
|
|
1188
|
+
if (typeof value !== "string" || !SCHEMA_NAME.test(value)) {
|
|
1189
|
+
throw invalid(
|
|
1190
|
+
param,
|
|
1191
|
+
`'${String(value)}' needs the customization prefix and only letters, digits and underscores, e.g. "new_Name"`
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
return name;
|
|
1195
|
+
}
|
|
1196
|
+
function checkLogicalName(param, name) {
|
|
1197
|
+
const value = name;
|
|
1198
|
+
if (typeof value !== "string" || !LOGICAL_NAME.test(value)) {
|
|
1199
|
+
throw invalid(param, `'${String(value)}' isn't a logical name, e.g. "account"`);
|
|
1200
|
+
}
|
|
1201
|
+
return name;
|
|
1202
|
+
}
|
|
1203
|
+
function invalid(param, reason) {
|
|
1204
|
+
return DataverseInvalidRequestError.invalidParameter(param, reason);
|
|
1205
|
+
}
|
|
606
1206
|
|
|
607
1207
|
// src/types/AssociatedMenuBehavior.ts
|
|
608
|
-
var AssociatedMenuBehavior =
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
1208
|
+
var AssociatedMenuBehavior = {
|
|
1209
|
+
/** 0 */
|
|
1210
|
+
UseCollectionName: "UseCollectionName",
|
|
1211
|
+
/** 1 */
|
|
1212
|
+
UseLabel: "UseLabel",
|
|
1213
|
+
/** 2 */
|
|
1214
|
+
DoNotDisplay: "DoNotDisplay"
|
|
1215
|
+
};
|
|
614
1216
|
|
|
615
1217
|
// src/types/AssociatedMenuGroup.ts
|
|
616
|
-
var AssociatedMenuGroup =
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
1218
|
+
var AssociatedMenuGroup = {
|
|
1219
|
+
/** 0 */
|
|
1220
|
+
Details: "Details",
|
|
1221
|
+
/** 1 */
|
|
1222
|
+
Sales: "Sales",
|
|
1223
|
+
/** 2 */
|
|
1224
|
+
Service: "Service",
|
|
1225
|
+
/** 3 */
|
|
1226
|
+
Marketing: "Marketing"
|
|
1227
|
+
};
|
|
623
1228
|
|
|
624
1229
|
// src/types/AttributeRequiredLevel.ts
|
|
625
|
-
var AttributeRequiredLevel =
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
1230
|
+
var AttributeRequiredLevel = {
|
|
1231
|
+
/** 0 */
|
|
1232
|
+
None: "None",
|
|
1233
|
+
/** 1 */
|
|
1234
|
+
SystemRequired: "SystemRequired",
|
|
1235
|
+
/** 2 */
|
|
1236
|
+
ApplicationRequired: "ApplicationRequired",
|
|
1237
|
+
/** 3 */
|
|
1238
|
+
Recommended: "Recommended"
|
|
1239
|
+
};
|
|
632
1240
|
|
|
633
1241
|
// src/types/AttributeTypeCode.ts
|
|
634
|
-
var AttributeTypeCode =
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
1242
|
+
var AttributeTypeCode = {
|
|
1243
|
+
/** 0 */
|
|
1244
|
+
Boolean: "Boolean",
|
|
1245
|
+
/** 1 */
|
|
1246
|
+
Customer: "Customer",
|
|
1247
|
+
/** 2 */
|
|
1248
|
+
DateTime: "DateTime",
|
|
1249
|
+
/** 3 */
|
|
1250
|
+
Decimal: "Decimal",
|
|
1251
|
+
/** 4 */
|
|
1252
|
+
Double: "Double",
|
|
1253
|
+
/** 5 */
|
|
1254
|
+
Integer: "Integer",
|
|
1255
|
+
/** 6 */
|
|
1256
|
+
Lookup: "Lookup",
|
|
1257
|
+
/** 7 */
|
|
1258
|
+
Memo: "Memo",
|
|
1259
|
+
/** 8 */
|
|
1260
|
+
Money: "Money",
|
|
1261
|
+
/** 9 */
|
|
1262
|
+
Owner: "Owner",
|
|
1263
|
+
/** 10 */
|
|
1264
|
+
PartyList: "PartyList",
|
|
1265
|
+
/** 11 */
|
|
1266
|
+
Picklist: "Picklist",
|
|
1267
|
+
/** 12 */
|
|
1268
|
+
State: "State",
|
|
1269
|
+
/** 13 */
|
|
1270
|
+
Status: "Status",
|
|
1271
|
+
/** 14 */
|
|
1272
|
+
String: "String",
|
|
1273
|
+
/** 15 */
|
|
1274
|
+
Uniqueidentifier: "Uniqueidentifier",
|
|
1275
|
+
/** 16 */
|
|
1276
|
+
CalendarRules: "CalendarRules",
|
|
1277
|
+
/** 17 */
|
|
1278
|
+
Virtual: "Virtual",
|
|
1279
|
+
/** 18 */
|
|
1280
|
+
BigInt: "BigInt",
|
|
1281
|
+
/** 19 */
|
|
1282
|
+
ManagedProperty: "ManagedProperty",
|
|
1283
|
+
/** 20 */
|
|
1284
|
+
EntityName: "EntityName"
|
|
1285
|
+
};
|
|
676
1286
|
|
|
677
1287
|
// src/types/CascadeType.ts
|
|
678
|
-
var CascadeType =
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
ChannelAccessProfilePrivilegeDepth2[ChannelAccessProfilePrivilegeDepth2["ParentEntityReference"] = 2] = "ParentEntityReference";
|
|
693
|
-
ChannelAccessProfilePrivilegeDepth2[ChannelAccessProfilePrivilegeDepth2["Global"] = 8] = "Global";
|
|
694
|
-
return ChannelAccessProfilePrivilegeDepth2;
|
|
695
|
-
})(ChannelAccessProfilePrivilegeDepth || {});
|
|
696
|
-
|
|
697
|
-
// src/types/ConditionOperator.ts
|
|
698
|
-
var ConditionOperator = /* @__PURE__ */ ((ConditionOperator2) => {
|
|
699
|
-
ConditionOperator2[ConditionOperator2["Equal"] = 0] = "Equal";
|
|
700
|
-
ConditionOperator2[ConditionOperator2["NotEqual"] = 1] = "NotEqual";
|
|
701
|
-
ConditionOperator2[ConditionOperator2["GreaterThan"] = 2] = "GreaterThan";
|
|
702
|
-
ConditionOperator2[ConditionOperator2["LessThan"] = 3] = "LessThan";
|
|
703
|
-
ConditionOperator2[ConditionOperator2["GreaterEqual"] = 4] = "GreaterEqual";
|
|
704
|
-
ConditionOperator2[ConditionOperator2["LessEqual"] = 5] = "LessEqual";
|
|
705
|
-
ConditionOperator2[ConditionOperator2["Like"] = 6] = "Like";
|
|
706
|
-
ConditionOperator2[ConditionOperator2["NotLike"] = 7] = "NotLike";
|
|
707
|
-
ConditionOperator2[ConditionOperator2["In"] = 8] = "In";
|
|
708
|
-
ConditionOperator2[ConditionOperator2["NotIn"] = 9] = "NotIn";
|
|
709
|
-
ConditionOperator2[ConditionOperator2["Between"] = 10] = "Between";
|
|
710
|
-
ConditionOperator2[ConditionOperator2["NotBetween"] = 11] = "NotBetween";
|
|
711
|
-
ConditionOperator2[ConditionOperator2["Null"] = 12] = "Null";
|
|
712
|
-
ConditionOperator2[ConditionOperator2["NotNull"] = 13] = "NotNull";
|
|
713
|
-
ConditionOperator2[ConditionOperator2["Yesterday"] = 14] = "Yesterday";
|
|
714
|
-
ConditionOperator2[ConditionOperator2["Today"] = 15] = "Today";
|
|
715
|
-
ConditionOperator2[ConditionOperator2["Tomorrow"] = 16] = "Tomorrow";
|
|
716
|
-
ConditionOperator2[ConditionOperator2["Last7Days"] = 17] = "Last7Days";
|
|
717
|
-
ConditionOperator2[ConditionOperator2["Next7Days"] = 18] = "Next7Days";
|
|
718
|
-
ConditionOperator2[ConditionOperator2["LastWeek"] = 19] = "LastWeek";
|
|
719
|
-
ConditionOperator2[ConditionOperator2["ThisWeek"] = 20] = "ThisWeek";
|
|
720
|
-
ConditionOperator2[ConditionOperator2["NextWeek"] = 21] = "NextWeek";
|
|
721
|
-
ConditionOperator2[ConditionOperator2["LastMonth"] = 22] = "LastMonth";
|
|
722
|
-
ConditionOperator2[ConditionOperator2["ThisMonth"] = 23] = "ThisMonth";
|
|
723
|
-
ConditionOperator2[ConditionOperator2["NextMonth"] = 24] = "NextMonth";
|
|
724
|
-
ConditionOperator2[ConditionOperator2["On"] = 25] = "On";
|
|
725
|
-
ConditionOperator2[ConditionOperator2["OnOrBefore"] = 26] = "OnOrBefore";
|
|
726
|
-
ConditionOperator2[ConditionOperator2["OnOrAfter"] = 27] = "OnOrAfter";
|
|
727
|
-
ConditionOperator2[ConditionOperator2["LastYear"] = 28] = "LastYear";
|
|
728
|
-
ConditionOperator2[ConditionOperator2["ThisYear"] = 29] = "ThisYear";
|
|
729
|
-
ConditionOperator2[ConditionOperator2["NextYear"] = 30] = "NextYear";
|
|
730
|
-
ConditionOperator2[ConditionOperator2["LastXHours"] = 31] = "LastXHours";
|
|
731
|
-
ConditionOperator2[ConditionOperator2["NextXHours"] = 32] = "NextXHours";
|
|
732
|
-
ConditionOperator2[ConditionOperator2["LastXDays"] = 33] = "LastXDays";
|
|
733
|
-
ConditionOperator2[ConditionOperator2["NextXDays"] = 34] = "NextXDays";
|
|
734
|
-
ConditionOperator2[ConditionOperator2["LastXWeeks"] = 35] = "LastXWeeks";
|
|
735
|
-
ConditionOperator2[ConditionOperator2["NextXWeeks"] = 36] = "NextXWeeks";
|
|
736
|
-
ConditionOperator2[ConditionOperator2["LastXMonths"] = 37] = "LastXMonths";
|
|
737
|
-
ConditionOperator2[ConditionOperator2["NextXMonths"] = 38] = "NextXMonths";
|
|
738
|
-
ConditionOperator2[ConditionOperator2["LastXYears"] = 39] = "LastXYears";
|
|
739
|
-
ConditionOperator2[ConditionOperator2["NextXYears"] = 40] = "NextXYears";
|
|
740
|
-
ConditionOperator2[ConditionOperator2["EqualUserId"] = 41] = "EqualUserId";
|
|
741
|
-
ConditionOperator2[ConditionOperator2["NotEqualUserId"] = 42] = "NotEqualUserId";
|
|
742
|
-
ConditionOperator2[ConditionOperator2["EqualBusinessId"] = 43] = "EqualBusinessId";
|
|
743
|
-
ConditionOperator2[ConditionOperator2["NotEqualBusinessId"] = 44] = "NotEqualBusinessId";
|
|
744
|
-
ConditionOperator2[ConditionOperator2["ChildOf"] = 45] = "ChildOf";
|
|
745
|
-
ConditionOperator2[ConditionOperator2["Mask"] = 46] = "Mask";
|
|
746
|
-
ConditionOperator2[ConditionOperator2["NotMask"] = 47] = "NotMask";
|
|
747
|
-
ConditionOperator2[ConditionOperator2["MasksSelect"] = 48] = "MasksSelect";
|
|
748
|
-
ConditionOperator2[ConditionOperator2["Contains"] = 49] = "Contains";
|
|
749
|
-
ConditionOperator2[ConditionOperator2["DoesNotContain"] = 50] = "DoesNotContain";
|
|
750
|
-
ConditionOperator2[ConditionOperator2["EqualUserLanguage"] = 51] = "EqualUserLanguage";
|
|
751
|
-
ConditionOperator2[ConditionOperator2["NotOn"] = 52] = "NotOn";
|
|
752
|
-
ConditionOperator2[ConditionOperator2["OlderThanXMonths"] = 53] = "OlderThanXMonths";
|
|
753
|
-
ConditionOperator2[ConditionOperator2["BeginsWith"] = 54] = "BeginsWith";
|
|
754
|
-
ConditionOperator2[ConditionOperator2["DoesNotBeginWith"] = 55] = "DoesNotBeginWith";
|
|
755
|
-
ConditionOperator2[ConditionOperator2["EndsWith"] = 56] = "EndsWith";
|
|
756
|
-
ConditionOperator2[ConditionOperator2["DoesNotEndWith"] = 57] = "DoesNotEndWith";
|
|
757
|
-
ConditionOperator2[ConditionOperator2["ThisFiscalYear"] = 58] = "ThisFiscalYear";
|
|
758
|
-
ConditionOperator2[ConditionOperator2["ThisFiscalPeriod"] = 59] = "ThisFiscalPeriod";
|
|
759
|
-
ConditionOperator2[ConditionOperator2["NextFiscalYear"] = 60] = "NextFiscalYear";
|
|
760
|
-
ConditionOperator2[ConditionOperator2["NextFiscalPeriod"] = 61] = "NextFiscalPeriod";
|
|
761
|
-
ConditionOperator2[ConditionOperator2["LastFiscalYear"] = 62] = "LastFiscalYear";
|
|
762
|
-
ConditionOperator2[ConditionOperator2["LastFiscalPeriod"] = 63] = "LastFiscalPeriod";
|
|
763
|
-
ConditionOperator2[ConditionOperator2["LastXFiscalYears"] = 64] = "LastXFiscalYears";
|
|
764
|
-
ConditionOperator2[ConditionOperator2["LastXFiscalPeriods"] = 65] = "LastXFiscalPeriods";
|
|
765
|
-
ConditionOperator2[ConditionOperator2["NextXFiscalYears"] = 66] = "NextXFiscalYears";
|
|
766
|
-
ConditionOperator2[ConditionOperator2["NextXFiscalPeriods"] = 67] = "NextXFiscalPeriods";
|
|
767
|
-
ConditionOperator2[ConditionOperator2["InFiscalYear"] = 68] = "InFiscalYear";
|
|
768
|
-
ConditionOperator2[ConditionOperator2["InFiscalPeriod"] = 69] = "InFiscalPeriod";
|
|
769
|
-
ConditionOperator2[ConditionOperator2["InFiscalPeriodAndYear"] = 70] = "InFiscalPeriodAndYear";
|
|
770
|
-
ConditionOperator2[ConditionOperator2["InOrBeforeFiscalPeriodAndYear"] = 71] = "InOrBeforeFiscalPeriodAndYear";
|
|
771
|
-
ConditionOperator2[ConditionOperator2["InOrAfterFiscalPeriodAndYear"] = 72] = "InOrAfterFiscalPeriodAndYear";
|
|
772
|
-
ConditionOperator2[ConditionOperator2["EqualUserTeams"] = 73] = "EqualUserTeams";
|
|
773
|
-
ConditionOperator2[ConditionOperator2["EqualUserOrUserTeams"] = 74] = "EqualUserOrUserTeams";
|
|
774
|
-
ConditionOperator2[ConditionOperator2["Under"] = 75] = "Under";
|
|
775
|
-
ConditionOperator2[ConditionOperator2["NotUnder"] = 76] = "NotUnder";
|
|
776
|
-
ConditionOperator2[ConditionOperator2["UnderOrEqual"] = 77] = "UnderOrEqual";
|
|
777
|
-
ConditionOperator2[ConditionOperator2["Above"] = 78] = "Above";
|
|
778
|
-
ConditionOperator2[ConditionOperator2["AboveOrEqual"] = 79] = "AboveOrEqual";
|
|
779
|
-
ConditionOperator2[ConditionOperator2["EqualUserOrUserHierarchy"] = 80] = "EqualUserOrUserHierarchy";
|
|
780
|
-
ConditionOperator2[ConditionOperator2["EqualUserOrUserHierarchyAndTeams"] = 81] = "EqualUserOrUserHierarchyAndTeams";
|
|
781
|
-
ConditionOperator2[ConditionOperator2["OlderThanXYears"] = 82] = "OlderThanXYears";
|
|
782
|
-
ConditionOperator2[ConditionOperator2["OlderThanXWeeks"] = 83] = "OlderThanXWeeks";
|
|
783
|
-
ConditionOperator2[ConditionOperator2["OlderThanXDays"] = 84] = "OlderThanXDays";
|
|
784
|
-
ConditionOperator2[ConditionOperator2["OlderThanXHours"] = 85] = "OlderThanXHours";
|
|
785
|
-
ConditionOperator2[ConditionOperator2["OlderThanXMinutes"] = 86] = "OlderThanXMinutes";
|
|
786
|
-
ConditionOperator2[ConditionOperator2["ContainValues"] = 87] = "ContainValues";
|
|
787
|
-
ConditionOperator2[ConditionOperator2["DoesNotContainValues"] = 88] = "DoesNotContainValues";
|
|
788
|
-
ConditionOperator2[ConditionOperator2["EqualRoleBusinessId"] = 89] = "EqualRoleBusinessId";
|
|
789
|
-
return ConditionOperator2;
|
|
790
|
-
})(ConditionOperator || {});
|
|
1288
|
+
var CascadeType = {
|
|
1289
|
+
/** 0 */
|
|
1290
|
+
NoCascade: "NoCascade",
|
|
1291
|
+
/** 1 */
|
|
1292
|
+
Cascade: "Cascade",
|
|
1293
|
+
/** 2 */
|
|
1294
|
+
Active: "Active",
|
|
1295
|
+
/** 3 */
|
|
1296
|
+
UserOwned: "UserOwned",
|
|
1297
|
+
/** 4 */
|
|
1298
|
+
RemoveLink: "RemoveLink",
|
|
1299
|
+
/** 5 */
|
|
1300
|
+
Restrict: "Restrict"
|
|
1301
|
+
};
|
|
791
1302
|
|
|
792
1303
|
// src/types/DateTimeFormat.ts
|
|
793
|
-
var DateTimeFormat =
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
1304
|
+
var DateTimeFormat = {
|
|
1305
|
+
/** 0 */
|
|
1306
|
+
DateOnly: "DateOnly",
|
|
1307
|
+
/** 1 */
|
|
1308
|
+
DateAndTime: "DateAndTime"
|
|
1309
|
+
};
|
|
798
1310
|
|
|
799
1311
|
// src/types/DeletedMetadataFilters.ts
|
|
800
|
-
var DeletedMetadataFilters =
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
DependencyDepth2[DependencyDepth2["OnDemandWithoutContext"] = 2] = "OnDemandWithoutContext";
|
|
815
|
-
DependencyDepth2[DependencyDepth2["OnDemandContextOnly"] = 3] = "OnDemandContextOnly";
|
|
816
|
-
DependencyDepth2[DependencyDepth2["Offline"] = 4] = "Offline";
|
|
817
|
-
DependencyDepth2[DependencyDepth2["Mobile"] = 5] = "Mobile";
|
|
818
|
-
DependencyDepth2[DependencyDepth2["UserContext"] = 6] = "UserContext";
|
|
819
|
-
DependencyDepth2[DependencyDepth2["NoDependency"] = 7] = "NoDependency";
|
|
820
|
-
return DependencyDepth2;
|
|
821
|
-
})(DependencyDepth || {});
|
|
822
|
-
|
|
823
|
-
// src/types/EndpointAccessType.ts
|
|
824
|
-
var EndpointAccessType = /* @__PURE__ */ ((EndpointAccessType2) => {
|
|
825
|
-
EndpointAccessType2[EndpointAccessType2["Default"] = 0] = "Default";
|
|
826
|
-
EndpointAccessType2[EndpointAccessType2["Internet"] = 1] = "Internet";
|
|
827
|
-
EndpointAccessType2[EndpointAccessType2["Intranet"] = 2] = "Intranet";
|
|
828
|
-
return EndpointAccessType2;
|
|
829
|
-
})(EndpointAccessType || {});
|
|
830
|
-
|
|
831
|
-
// src/types/EndpointType.ts
|
|
832
|
-
var EndpointType = /* @__PURE__ */ ((EndpointType2) => {
|
|
833
|
-
EndpointType2[EndpointType2["OrganizationService"] = 0] = "OrganizationService";
|
|
834
|
-
EndpointType2[EndpointType2["OrganizationDataService"] = 1] = "OrganizationDataService";
|
|
835
|
-
EndpointType2[EndpointType2["WebApplication"] = 2] = "WebApplication";
|
|
836
|
-
return EndpointType2;
|
|
837
|
-
})(EndpointType || {});
|
|
1312
|
+
var DeletedMetadataFilters = {
|
|
1313
|
+
/** 1 */
|
|
1314
|
+
Default: "Default",
|
|
1315
|
+
/** 2 */
|
|
1316
|
+
Attribute: "Attribute",
|
|
1317
|
+
/** 4 */
|
|
1318
|
+
Relationship: "Relationship",
|
|
1319
|
+
/** 8 */
|
|
1320
|
+
Label: "Label",
|
|
1321
|
+
/** 16 */
|
|
1322
|
+
OptionSet: "OptionSet",
|
|
1323
|
+
/** 31 */
|
|
1324
|
+
All: "All"
|
|
1325
|
+
};
|
|
838
1326
|
|
|
839
1327
|
// src/types/EntityClusterMode.ts
|
|
840
|
-
var EntityClusterMode =
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
EntityFilters2[EntityFilters2["Entity"] = 1] = "Entity";
|
|
851
|
-
EntityFilters2[EntityFilters2["Attributes"] = 2] = "Attributes";
|
|
852
|
-
EntityFilters2[EntityFilters2["Privileges"] = 4] = "Privileges";
|
|
853
|
-
EntityFilters2[EntityFilters2["Relationships"] = 8] = "Relationships";
|
|
854
|
-
EntityFilters2[EntityFilters2["All"] = 15] = "All";
|
|
855
|
-
return EntityFilters2;
|
|
856
|
-
})(EntityFilters || {});
|
|
1328
|
+
var EntityClusterMode = {
|
|
1329
|
+
/** 0 */
|
|
1330
|
+
Partitioned: "Partitioned",
|
|
1331
|
+
/** 1 */
|
|
1332
|
+
Replicated: "Replicated",
|
|
1333
|
+
/** 2 */
|
|
1334
|
+
Local: "Local",
|
|
1335
|
+
/** 3 */
|
|
1336
|
+
Inherited: "Inherited"
|
|
1337
|
+
};
|
|
857
1338
|
|
|
858
1339
|
// src/types/EntityKeyIndexStatus.ts
|
|
859
|
-
var EntityKeyIndexStatus =
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
ErrorType2[ErrorType2["Error"] = 1] = "Error";
|
|
870
|
-
ErrorType2[ErrorType2["Warning"] = 2] = "Warning";
|
|
871
|
-
return ErrorType2;
|
|
872
|
-
})(ErrorType || {});
|
|
1340
|
+
var EntityKeyIndexStatus = {
|
|
1341
|
+
/** 0 */
|
|
1342
|
+
Pending: "Pending",
|
|
1343
|
+
/** 1 */
|
|
1344
|
+
InProgress: "InProgress",
|
|
1345
|
+
/** 2 */
|
|
1346
|
+
Active: "Active",
|
|
1347
|
+
/** 3 */
|
|
1348
|
+
Failed: "Failed"
|
|
1349
|
+
};
|
|
873
1350
|
|
|
874
1351
|
// src/types/ImeMode.ts
|
|
875
|
-
var ImeMode =
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
ImportDecision2[ImportDecision2["Import"] = 0] = "Import";
|
|
886
|
-
ImportDecision2[ImportDecision2["Skip"] = 1] = "Skip";
|
|
887
|
-
return ImportDecision2;
|
|
888
|
-
})(ImportDecision || {});
|
|
1352
|
+
var ImeMode = {
|
|
1353
|
+
/** 0 */
|
|
1354
|
+
Auto: "Auto",
|
|
1355
|
+
/** 1 */
|
|
1356
|
+
Inactive: "Inactive",
|
|
1357
|
+
/** 2 */
|
|
1358
|
+
Active: "Active",
|
|
1359
|
+
/** 3 */
|
|
1360
|
+
Disabled: "Disabled"
|
|
1361
|
+
};
|
|
889
1362
|
|
|
890
1363
|
// src/types/IntegerFormat.ts
|
|
891
|
-
var IntegerFormat =
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
JoinOperator2[JoinOperator2["LeftOuter"] = 1] = "LeftOuter";
|
|
904
|
-
JoinOperator2[JoinOperator2["Natural"] = 2] = "Natural";
|
|
905
|
-
JoinOperator2[JoinOperator2["MatchFirstRowUsingCrossApply"] = 3] = "MatchFirstRowUsingCrossApply";
|
|
906
|
-
JoinOperator2[JoinOperator2["In"] = 4] = "In";
|
|
907
|
-
JoinOperator2[JoinOperator2["Exists"] = 5] = "Exists";
|
|
908
|
-
JoinOperator2[JoinOperator2["Any"] = 6] = "Any";
|
|
909
|
-
JoinOperator2[JoinOperator2["NotAny"] = 7] = "NotAny";
|
|
910
|
-
JoinOperator2[JoinOperator2["All"] = 8] = "All";
|
|
911
|
-
JoinOperator2[JoinOperator2["NotAll"] = 9] = "NotAll";
|
|
912
|
-
return JoinOperator2;
|
|
913
|
-
})(JoinOperator || {});
|
|
914
|
-
|
|
915
|
-
// src/types/LayerDesiredOrderType.ts
|
|
916
|
-
var LayerDesiredOrderType = /* @__PURE__ */ ((LayerDesiredOrderType2) => {
|
|
917
|
-
LayerDesiredOrderType2[LayerDesiredOrderType2["Below"] = 0] = "Below";
|
|
918
|
-
LayerDesiredOrderType2[LayerDesiredOrderType2["Above"] = 1] = "Above";
|
|
919
|
-
LayerDesiredOrderType2[LayerDesiredOrderType2["Base"] = 2] = "Base";
|
|
920
|
-
return LayerDesiredOrderType2;
|
|
921
|
-
})(LayerDesiredOrderType || {});
|
|
1364
|
+
var IntegerFormat = {
|
|
1365
|
+
/** 0 */
|
|
1366
|
+
None: "None",
|
|
1367
|
+
/** 1 */
|
|
1368
|
+
Duration: "Duration",
|
|
1369
|
+
/** 2 */
|
|
1370
|
+
TimeZone: "TimeZone",
|
|
1371
|
+
/** 3 */
|
|
1372
|
+
Language: "Language",
|
|
1373
|
+
/** 4 */
|
|
1374
|
+
Locale: "Locale"
|
|
1375
|
+
};
|
|
922
1376
|
|
|
923
1377
|
// src/types/LogicalOperator.ts
|
|
924
|
-
var LogicalOperator =
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1378
|
+
var LogicalOperator = {
|
|
1379
|
+
/** 0 */
|
|
1380
|
+
And: "And",
|
|
1381
|
+
/** 1 */
|
|
1382
|
+
Or: "Or"
|
|
1383
|
+
};
|
|
929
1384
|
|
|
930
1385
|
// src/types/LookupFormat.ts
|
|
931
|
-
var LookupFormat =
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1386
|
+
var LookupFormat = {
|
|
1387
|
+
/** 0 */
|
|
1388
|
+
None: "None",
|
|
1389
|
+
/** 1 */
|
|
1390
|
+
Connection: "Connection",
|
|
1391
|
+
/** 2 */
|
|
1392
|
+
Regarding: "Regarding",
|
|
1393
|
+
/** 3 */
|
|
1394
|
+
Text: "Text"
|
|
1395
|
+
};
|
|
938
1396
|
|
|
939
1397
|
// src/types/ManagedPropertyEvaluationPriority.ts
|
|
940
|
-
var ManagedPropertyEvaluationPriority =
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
1398
|
+
var ManagedPropertyEvaluationPriority = {
|
|
1399
|
+
/** 0 */
|
|
1400
|
+
None: "None",
|
|
1401
|
+
/** 1 */
|
|
1402
|
+
Low: "Low",
|
|
1403
|
+
/** 2 */
|
|
1404
|
+
Normal: "Normal",
|
|
1405
|
+
/** 3 */
|
|
1406
|
+
High: "High",
|
|
1407
|
+
/** 4 */
|
|
1408
|
+
Essential: "Essential"
|
|
1409
|
+
};
|
|
948
1410
|
|
|
949
1411
|
// src/types/ManagedPropertyOperation.ts
|
|
950
|
-
var ManagedPropertyOperation =
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1412
|
+
var ManagedPropertyOperation = {
|
|
1413
|
+
/** 0 */
|
|
1414
|
+
None: "None",
|
|
1415
|
+
/** 1 */
|
|
1416
|
+
Create: "Create",
|
|
1417
|
+
/** 2 */
|
|
1418
|
+
Update: "Update",
|
|
1419
|
+
/** 3 */
|
|
1420
|
+
CreateUpdate: "CreateUpdate",
|
|
1421
|
+
/** 4 */
|
|
1422
|
+
Delete: "Delete",
|
|
1423
|
+
/** 6 */
|
|
1424
|
+
UpdateDelete: "UpdateDelete",
|
|
1425
|
+
/** 7 */
|
|
1426
|
+
All: "All"
|
|
1427
|
+
};
|
|
960
1428
|
|
|
961
1429
|
// src/types/ManagedPropertyType.ts
|
|
962
|
-
var ManagedPropertyType =
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1430
|
+
var ManagedPropertyType = {
|
|
1431
|
+
/** 0 */
|
|
1432
|
+
Operation: "Operation",
|
|
1433
|
+
/** 1 */
|
|
1434
|
+
Attribute: "Attribute",
|
|
1435
|
+
/** 2 */
|
|
1436
|
+
CustomEvaluator: "CustomEvaluator",
|
|
1437
|
+
/** 3 */
|
|
1438
|
+
Custom: "Custom"
|
|
1439
|
+
};
|
|
969
1440
|
|
|
970
1441
|
// src/types/MetadataConditionOperator.ts
|
|
971
|
-
var MetadataConditionOperator =
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
MissingPackageResolutionAction2[MissingPackageResolutionAction2["Ignore"] = 2] = "Ignore";
|
|
986
|
-
return MissingPackageResolutionAction2;
|
|
987
|
-
})(MissingPackageResolutionAction || {});
|
|
1442
|
+
var MetadataConditionOperator = {
|
|
1443
|
+
/** 0 */
|
|
1444
|
+
Equals: "Equals",
|
|
1445
|
+
/** 1 */
|
|
1446
|
+
NotEquals: "NotEquals",
|
|
1447
|
+
/** 2 */
|
|
1448
|
+
In: "In",
|
|
1449
|
+
/** 3 */
|
|
1450
|
+
NotIn: "NotIn",
|
|
1451
|
+
/** 4 */
|
|
1452
|
+
GreaterThan: "GreaterThan",
|
|
1453
|
+
/** 5 */
|
|
1454
|
+
LessThan: "LessThan"
|
|
1455
|
+
};
|
|
988
1456
|
|
|
989
1457
|
// src/types/OptionSetType.ts
|
|
990
|
-
var OptionSetType =
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
OrderType2[OrderType2["Ascending"] = 0] = "Ascending";
|
|
1001
|
-
OrderType2[OrderType2["Descending"] = 1] = "Descending";
|
|
1002
|
-
return OrderType2;
|
|
1003
|
-
})(OrderType || {});
|
|
1004
|
-
|
|
1005
|
-
// src/types/OrganizationState.ts
|
|
1006
|
-
var OrganizationState = /* @__PURE__ */ ((OrganizationState2) => {
|
|
1007
|
-
OrganizationState2[OrganizationState2["Enabled"] = 0] = "Enabled";
|
|
1008
|
-
OrganizationState2[OrganizationState2["Disabled"] = 1] = "Disabled";
|
|
1009
|
-
return OrganizationState2;
|
|
1010
|
-
})(OrganizationState || {});
|
|
1011
|
-
|
|
1012
|
-
// src/types/OrganizationType.ts
|
|
1013
|
-
var OrganizationType = /* @__PURE__ */ ((OrganizationType2) => {
|
|
1014
|
-
OrganizationType2[OrganizationType2["Customer"] = 0] = "Customer";
|
|
1015
|
-
OrganizationType2[OrganizationType2["Monitoring"] = 1] = "Monitoring";
|
|
1016
|
-
OrganizationType2[OrganizationType2["Support"] = 2] = "Support";
|
|
1017
|
-
OrganizationType2[OrganizationType2["BackEnd"] = 3] = "BackEnd";
|
|
1018
|
-
OrganizationType2[OrganizationType2["Secondary"] = 4] = "Secondary";
|
|
1019
|
-
OrganizationType2[OrganizationType2["CustomerTest"] = 5] = "CustomerTest";
|
|
1020
|
-
OrganizationType2[OrganizationType2["CustomerFreeTest"] = 6] = "CustomerFreeTest";
|
|
1021
|
-
OrganizationType2[OrganizationType2["CustomerPreview"] = 7] = "CustomerPreview";
|
|
1022
|
-
OrganizationType2[OrganizationType2["Placeholder"] = 8] = "Placeholder";
|
|
1023
|
-
OrganizationType2[OrganizationType2["TestDrive"] = 9] = "TestDrive";
|
|
1024
|
-
OrganizationType2[OrganizationType2["MsftInvestigation"] = 10] = "MsftInvestigation";
|
|
1025
|
-
OrganizationType2[OrganizationType2["EmailTrial"] = 11] = "EmailTrial";
|
|
1026
|
-
OrganizationType2[OrganizationType2["Default"] = 12] = "Default";
|
|
1027
|
-
OrganizationType2[OrganizationType2["Developer"] = 13] = "Developer";
|
|
1028
|
-
OrganizationType2[OrganizationType2["Trial"] = 14] = "Trial";
|
|
1029
|
-
OrganizationType2[OrganizationType2["Teams"] = 15] = "Teams";
|
|
1030
|
-
OrganizationType2[OrganizationType2["Platform"] = 16] = "Platform";
|
|
1031
|
-
return OrganizationType2;
|
|
1032
|
-
})(OrganizationType || {});
|
|
1458
|
+
var OptionSetType = {
|
|
1459
|
+
/** 0 */
|
|
1460
|
+
Picklist: "Picklist",
|
|
1461
|
+
/** 1 */
|
|
1462
|
+
State: "State",
|
|
1463
|
+
/** 2 */
|
|
1464
|
+
Status: "Status",
|
|
1465
|
+
/** 3 */
|
|
1466
|
+
Boolean: "Boolean"
|
|
1467
|
+
};
|
|
1033
1468
|
|
|
1034
1469
|
// src/types/OwnershipTypes.ts
|
|
1035
|
-
var OwnershipTypes =
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
return PresentInOrg2;
|
|
1052
|
-
})(PresentInOrg || {});
|
|
1053
|
-
|
|
1054
|
-
// src/types/PrivilegeDepth.ts
|
|
1055
|
-
var PrivilegeDepth = /* @__PURE__ */ ((PrivilegeDepth2) => {
|
|
1056
|
-
PrivilegeDepth2[PrivilegeDepth2["Basic"] = 0] = "Basic";
|
|
1057
|
-
PrivilegeDepth2[PrivilegeDepth2["Local"] = 1] = "Local";
|
|
1058
|
-
PrivilegeDepth2[PrivilegeDepth2["Deep"] = 2] = "Deep";
|
|
1059
|
-
PrivilegeDepth2[PrivilegeDepth2["Global"] = 3] = "Global";
|
|
1060
|
-
PrivilegeDepth2[PrivilegeDepth2["RecordFilter"] = 4] = "RecordFilter";
|
|
1061
|
-
return PrivilegeDepth2;
|
|
1062
|
-
})(PrivilegeDepth || {});
|
|
1470
|
+
var OwnershipTypes = {
|
|
1471
|
+
/** 0 */
|
|
1472
|
+
None: "None",
|
|
1473
|
+
/** 1 */
|
|
1474
|
+
UserOwned: "UserOwned",
|
|
1475
|
+
/** 2 */
|
|
1476
|
+
TeamOwned: "TeamOwned",
|
|
1477
|
+
/** 4 */
|
|
1478
|
+
BusinessOwned: "BusinessOwned",
|
|
1479
|
+
/** 8 */
|
|
1480
|
+
OrganizationOwned: "OrganizationOwned",
|
|
1481
|
+
/** 16 */
|
|
1482
|
+
BusinessParented: "BusinessParented",
|
|
1483
|
+
/** 32 */
|
|
1484
|
+
Filtered: "Filtered"
|
|
1485
|
+
};
|
|
1063
1486
|
|
|
1064
1487
|
// src/types/PrivilegeType.ts
|
|
1065
|
-
var PrivilegeType =
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
}
|
|
1085
|
-
|
|
1086
|
-
// src/types/ProvisionLanguageForUserStatusType.ts
|
|
1087
|
-
var ProvisionLanguageForUserStatusType = /* @__PURE__ */ ((ProvisionLanguageForUserStatusType2) => {
|
|
1088
|
-
ProvisionLanguageForUserStatusType2[ProvisionLanguageForUserStatusType2["Queued"] = 0] = "Queued";
|
|
1089
|
-
ProvisionLanguageForUserStatusType2[ProvisionLanguageForUserStatusType2["Completed"] = 1] = "Completed";
|
|
1090
|
-
ProvisionLanguageForUserStatusType2[ProvisionLanguageForUserStatusType2["Skipped"] = 2] = "Skipped";
|
|
1091
|
-
return ProvisionLanguageForUserStatusType2;
|
|
1092
|
-
})(ProvisionLanguageForUserStatusType || {});
|
|
1093
|
-
|
|
1094
|
-
// src/types/RecentlyViewedRecordType.ts
|
|
1095
|
-
var RecentlyViewedRecordType = /* @__PURE__ */ ((RecentlyViewedRecordType2) => {
|
|
1096
|
-
RecentlyViewedRecordType2[RecentlyViewedRecordType2["Entity"] = 0] = "Entity";
|
|
1097
|
-
RecentlyViewedRecordType2[RecentlyViewedRecordType2["Grid"] = 1] = "Grid";
|
|
1098
|
-
RecentlyViewedRecordType2[RecentlyViewedRecordType2["Isv"] = 2] = "Isv";
|
|
1099
|
-
RecentlyViewedRecordType2[RecentlyViewedRecordType2["Invalid"] = -1] = "Invalid";
|
|
1100
|
-
return RecentlyViewedRecordType2;
|
|
1101
|
-
})(RecentlyViewedRecordType || {});
|
|
1488
|
+
var PrivilegeType = {
|
|
1489
|
+
/** 0 */
|
|
1490
|
+
None: "None",
|
|
1491
|
+
/** 1 */
|
|
1492
|
+
Create: "Create",
|
|
1493
|
+
/** 2 */
|
|
1494
|
+
Read: "Read",
|
|
1495
|
+
/** 3 */
|
|
1496
|
+
Write: "Write",
|
|
1497
|
+
/** 4 */
|
|
1498
|
+
Delete: "Delete",
|
|
1499
|
+
/** 5 */
|
|
1500
|
+
Assign: "Assign",
|
|
1501
|
+
/** 6 */
|
|
1502
|
+
Share: "Share",
|
|
1503
|
+
/** 7 */
|
|
1504
|
+
Append: "Append",
|
|
1505
|
+
/** 8 */
|
|
1506
|
+
AppendTo: "AppendTo"
|
|
1507
|
+
};
|
|
1102
1508
|
|
|
1103
1509
|
// src/types/RelationshipType.ts
|
|
1104
|
-
var RelationshipType =
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
// src/types/ResultCode.ts
|
|
1111
|
-
var ResultCode = /* @__PURE__ */ ((ResultCode2) => {
|
|
1112
|
-
ResultCode2[ResultCode2["Successful"] = 0] = "Successful";
|
|
1113
|
-
ResultCode2[ResultCode2["Failed"] = 1] = "Failed";
|
|
1114
|
-
ResultCode2[ResultCode2["Skipped"] = 2] = "Skipped";
|
|
1115
|
-
return ResultCode2;
|
|
1116
|
-
})(ResultCode || {});
|
|
1117
|
-
|
|
1118
|
-
// src/types/RibbonLocationFilters.ts
|
|
1119
|
-
var RibbonLocationFilters = /* @__PURE__ */ ((RibbonLocationFilters2) => {
|
|
1120
|
-
RibbonLocationFilters2[RibbonLocationFilters2["Form"] = 1] = "Form";
|
|
1121
|
-
RibbonLocationFilters2[RibbonLocationFilters2["HomepageGrid"] = 2] = "HomepageGrid";
|
|
1122
|
-
RibbonLocationFilters2[RibbonLocationFilters2["SubGrid"] = 4] = "SubGrid";
|
|
1123
|
-
RibbonLocationFilters2[RibbonLocationFilters2["All"] = 7] = "All";
|
|
1124
|
-
return RibbonLocationFilters2;
|
|
1125
|
-
})(RibbonLocationFilters || {});
|
|
1126
|
-
|
|
1127
|
-
// src/types/RollupType.ts
|
|
1128
|
-
var RollupType = /* @__PURE__ */ ((RollupType2) => {
|
|
1129
|
-
RollupType2[RollupType2["None"] = 0] = "None";
|
|
1130
|
-
RollupType2[RollupType2["Related"] = 1] = "Related";
|
|
1131
|
-
RollupType2[RollupType2["Extended"] = 2] = "Extended";
|
|
1132
|
-
return RollupType2;
|
|
1133
|
-
})(RollupType || {});
|
|
1134
|
-
|
|
1135
|
-
// src/types/SearchDirection.ts
|
|
1136
|
-
var SearchDirection = /* @__PURE__ */ ((SearchDirection2) => {
|
|
1137
|
-
SearchDirection2[SearchDirection2["Forward"] = 0] = "Forward";
|
|
1138
|
-
SearchDirection2[SearchDirection2["Backward"] = 1] = "Backward";
|
|
1139
|
-
return SearchDirection2;
|
|
1140
|
-
})(SearchDirection || {});
|
|
1510
|
+
var RelationshipType = {
|
|
1511
|
+
/** 0 */
|
|
1512
|
+
OneToManyRelationship: "OneToManyRelationship",
|
|
1513
|
+
/** 1 */
|
|
1514
|
+
ManyToManyRelationship: "ManyToManyRelationship"
|
|
1515
|
+
};
|
|
1141
1516
|
|
|
1142
1517
|
// src/types/SecurityTypes.ts
|
|
1143
|
-
var SecurityTypes =
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
ShareAccessRights2[ShareAccessRights2["ReadAccess"] = 1] = "ReadAccess";
|
|
1156
|
-
ShareAccessRights2[ShareAccessRights2["WriteAccess"] = 2] = "WriteAccess";
|
|
1157
|
-
ShareAccessRights2[ShareAccessRights2["AppendAccess"] = 4] = "AppendAccess";
|
|
1158
|
-
ShareAccessRights2[ShareAccessRights2["AppendToAccess"] = 16] = "AppendToAccess";
|
|
1159
|
-
ShareAccessRights2[ShareAccessRights2["CreateAccess"] = 32] = "CreateAccess";
|
|
1160
|
-
ShareAccessRights2[ShareAccessRights2["DeleteAccess"] = 65536] = "DeleteAccess";
|
|
1161
|
-
ShareAccessRights2[ShareAccessRights2["ShareAccess"] = 262144] = "ShareAccess";
|
|
1162
|
-
ShareAccessRights2[ShareAccessRights2["AssignAccess"] = 524288] = "AssignAccess";
|
|
1163
|
-
return ShareAccessRights2;
|
|
1164
|
-
})(ShareAccessRights || {});
|
|
1165
|
-
|
|
1166
|
-
// src/types/SolutionOperationStatus.ts
|
|
1167
|
-
var SolutionOperationStatus = /* @__PURE__ */ ((SolutionOperationStatus2) => {
|
|
1168
|
-
SolutionOperationStatus2[SolutionOperationStatus2["Failed"] = 0] = "Failed";
|
|
1169
|
-
SolutionOperationStatus2[SolutionOperationStatus2["Passed"] = 1] = "Passed";
|
|
1170
|
-
return SolutionOperationStatus2;
|
|
1171
|
-
})(SolutionOperationStatus || {});
|
|
1172
|
-
|
|
1173
|
-
// src/types/SolutionOperationType.ts
|
|
1174
|
-
var SolutionOperationType = /* @__PURE__ */ ((SolutionOperationType2) => {
|
|
1175
|
-
SolutionOperationType2[SolutionOperationType2["Import"] = 0] = "Import";
|
|
1176
|
-
return SolutionOperationType2;
|
|
1177
|
-
})(SolutionOperationType || {});
|
|
1178
|
-
|
|
1179
|
-
// src/types/SolutionValidationResultType.ts
|
|
1180
|
-
var SolutionValidationResultType = /* @__PURE__ */ ((SolutionValidationResultType2) => {
|
|
1181
|
-
SolutionValidationResultType2[SolutionValidationResultType2["Info"] = 0] = "Info";
|
|
1182
|
-
SolutionValidationResultType2[SolutionValidationResultType2["Warning"] = 1] = "Warning";
|
|
1183
|
-
SolutionValidationResultType2[SolutionValidationResultType2["Error"] = 2] = "Error";
|
|
1184
|
-
return SolutionValidationResultType2;
|
|
1185
|
-
})(SolutionValidationResultType || {});
|
|
1186
|
-
|
|
1187
|
-
// src/types/StageSolutionStatus.ts
|
|
1188
|
-
var StageSolutionStatus = /* @__PURE__ */ ((StageSolutionStatus2) => {
|
|
1189
|
-
StageSolutionStatus2[StageSolutionStatus2["Failed"] = 0] = "Failed";
|
|
1190
|
-
StageSolutionStatus2[StageSolutionStatus2["Passed"] = 1] = "Passed";
|
|
1191
|
-
return StageSolutionStatus2;
|
|
1192
|
-
})(StageSolutionStatus || {});
|
|
1518
|
+
var SecurityTypes = {
|
|
1519
|
+
/** 0 */
|
|
1520
|
+
None: "None",
|
|
1521
|
+
/** 1 */
|
|
1522
|
+
Append: "Append",
|
|
1523
|
+
/** 2 */
|
|
1524
|
+
ParentChild: "ParentChild",
|
|
1525
|
+
/** 4 */
|
|
1526
|
+
Pointer: "Pointer",
|
|
1527
|
+
/** 8 */
|
|
1528
|
+
Inheritance: "Inheritance"
|
|
1529
|
+
};
|
|
1193
1530
|
|
|
1194
1531
|
// src/types/StringFormat.ts
|
|
1195
|
-
var StringFormat =
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
SubCode2[SubCode2["Vacation"] = 6] = "Vacation";
|
|
1218
|
-
SubCode2[SubCode2["Appointment"] = 7] = "Appointment";
|
|
1219
|
-
SubCode2[SubCode2["ResourceStartTime"] = 8] = "ResourceStartTime";
|
|
1220
|
-
SubCode2[SubCode2["ResourceServiceRestriction"] = 9] = "ResourceServiceRestriction";
|
|
1221
|
-
SubCode2[SubCode2["ResourceCapacity"] = 10] = "ResourceCapacity";
|
|
1222
|
-
SubCode2[SubCode2["ServiceRestriction"] = 11] = "ServiceRestriction";
|
|
1223
|
-
SubCode2[SubCode2["ServiceCost"] = 12] = "ServiceCost";
|
|
1224
|
-
return SubCode2;
|
|
1225
|
-
})(SubCode || {});
|
|
1226
|
-
|
|
1227
|
-
// src/types/SubstitutionStatus.ts
|
|
1228
|
-
var SubstitutionStatus = /* @__PURE__ */ ((SubstitutionStatus2) => {
|
|
1229
|
-
SubstitutionStatus2[SubstitutionStatus2["Success"] = 0] = "Success";
|
|
1230
|
-
SubstitutionStatus2[SubstitutionStatus2["Error"] = 1] = "Error";
|
|
1231
|
-
SubstitutionStatus2[SubstitutionStatus2["Warning"] = 2] = "Warning";
|
|
1232
|
-
return SubstitutionStatus2;
|
|
1233
|
-
})(SubstitutionStatus || {});
|
|
1234
|
-
|
|
1235
|
-
// src/types/TargetFieldType.ts
|
|
1236
|
-
var TargetFieldType = /* @__PURE__ */ ((TargetFieldType2) => {
|
|
1237
|
-
TargetFieldType2[TargetFieldType2["All"] = 0] = "All";
|
|
1238
|
-
TargetFieldType2[TargetFieldType2["ValidForCreate"] = 1] = "ValidForCreate";
|
|
1239
|
-
TargetFieldType2[TargetFieldType2["ValidForUpdate"] = 2] = "ValidForUpdate";
|
|
1240
|
-
TargetFieldType2[TargetFieldType2["ValidForRead"] = 3] = "ValidForRead";
|
|
1241
|
-
return TargetFieldType2;
|
|
1242
|
-
})(TargetFieldType || {});
|
|
1243
|
-
|
|
1244
|
-
// src/types/TimeCode.ts
|
|
1245
|
-
var TimeCode = /* @__PURE__ */ ((TimeCode2) => {
|
|
1246
|
-
TimeCode2[TimeCode2["Available"] = 0] = "Available";
|
|
1247
|
-
TimeCode2[TimeCode2["Busy"] = 1] = "Busy";
|
|
1248
|
-
TimeCode2[TimeCode2["Unavailable"] = 2] = "Unavailable";
|
|
1249
|
-
TimeCode2[TimeCode2["Filter"] = 3] = "Filter";
|
|
1250
|
-
return TimeCode2;
|
|
1251
|
-
})(TimeCode || {});
|
|
1252
|
-
|
|
1253
|
-
// src/types/ValidateSolutionStatus.ts
|
|
1254
|
-
var ValidateSolutionStatus = /* @__PURE__ */ ((ValidateSolutionStatus2) => {
|
|
1255
|
-
ValidateSolutionStatus2[ValidateSolutionStatus2["Failed"] = 0] = "Failed";
|
|
1256
|
-
ValidateSolutionStatus2[ValidateSolutionStatus2["Passed"] = 1] = "Passed";
|
|
1257
|
-
return ValidateSolutionStatus2;
|
|
1258
|
-
})(ValidateSolutionStatus || {});
|
|
1259
|
-
|
|
1260
|
-
// src/types/XrmAggregateType.ts
|
|
1261
|
-
var XrmAggregateType = /* @__PURE__ */ ((XrmAggregateType2) => {
|
|
1262
|
-
XrmAggregateType2[XrmAggregateType2["None"] = 0] = "None";
|
|
1263
|
-
XrmAggregateType2[XrmAggregateType2["Count"] = 1] = "Count";
|
|
1264
|
-
XrmAggregateType2[XrmAggregateType2["CountColumn"] = 2] = "CountColumn";
|
|
1265
|
-
XrmAggregateType2[XrmAggregateType2["Sum"] = 3] = "Sum";
|
|
1266
|
-
XrmAggregateType2[XrmAggregateType2["Avg"] = 4] = "Avg";
|
|
1267
|
-
XrmAggregateType2[XrmAggregateType2["Min"] = 5] = "Min";
|
|
1268
|
-
XrmAggregateType2[XrmAggregateType2["Max"] = 6] = "Max";
|
|
1269
|
-
return XrmAggregateType2;
|
|
1270
|
-
})(XrmAggregateType || {});
|
|
1271
|
-
|
|
1272
|
-
// src/types/XrmDateTimeGrouping.ts
|
|
1273
|
-
var XrmDateTimeGrouping = /* @__PURE__ */ ((XrmDateTimeGrouping2) => {
|
|
1274
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["None"] = 0] = "None";
|
|
1275
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["Day"] = 1] = "Day";
|
|
1276
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["Week"] = 2] = "Week";
|
|
1277
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["Month"] = 3] = "Month";
|
|
1278
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["Quarter"] = 4] = "Quarter";
|
|
1279
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["Year"] = 5] = "Year";
|
|
1280
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["FiscalPeriod"] = 6] = "FiscalPeriod";
|
|
1281
|
-
XrmDateTimeGrouping2[XrmDateTimeGrouping2["FiscalYear"] = 7] = "FiscalYear";
|
|
1282
|
-
return XrmDateTimeGrouping2;
|
|
1283
|
-
})(XrmDateTimeGrouping || {});
|
|
1532
|
+
var StringFormat = {
|
|
1533
|
+
/** 0 */
|
|
1534
|
+
Email: "Email",
|
|
1535
|
+
/** 1 */
|
|
1536
|
+
Text: "Text",
|
|
1537
|
+
/** 2 */
|
|
1538
|
+
TextArea: "TextArea",
|
|
1539
|
+
/** 3 */
|
|
1540
|
+
Url: "Url",
|
|
1541
|
+
/** 4 */
|
|
1542
|
+
TickerSymbol: "TickerSymbol",
|
|
1543
|
+
/** 5 */
|
|
1544
|
+
PhoneticGuide: "PhoneticGuide",
|
|
1545
|
+
/** 6 */
|
|
1546
|
+
VersionNumber: "VersionNumber",
|
|
1547
|
+
/** 7 */
|
|
1548
|
+
Phone: "Phone",
|
|
1549
|
+
/** 8 */
|
|
1550
|
+
Json: "Json",
|
|
1551
|
+
/** 9 */
|
|
1552
|
+
RichText: "RichText"
|
|
1553
|
+
};
|
|
1284
1554
|
|
|
1285
|
-
export {
|
|
1555
|
+
export { AssociatedMenuBehavior, AssociatedMenuGroup, AttributeRequiredLevel, AttributeTypeCode, CascadeType, DateTimeFormat, DeletedMetadataFilters, EntityClusterMode, EntityKeyIndexStatus, ImeMode, IntegerFormat, LogicalOperator, LookupFormat, ManagedPropertyEvaluationPriority, ManagedPropertyOperation, ManagedPropertyType, Metadata, MetadataClient, MetadataConditionOperator, OptionSetType, OwnershipTypes, PrivilegeType, RelationshipType, SecurityTypes, StringFormat };
|
|
1286
1556
|
//# sourceMappingURL=index.js.map
|
|
1287
1557
|
//# sourceMappingURL=index.js.map
|