@albanian-xrm/cif-types 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 AlbanianXrm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # @albanian-xrm/cif-types
2
+ Microsoft.CIFramework types from the community (us).
3
+
4
+ Read more about Channel Integration Framework on the Microsoft Docs [here](https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework).
5
+
6
+ These types are based on the api documentation on the Microsoft Docs [here](https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework).
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ /// <reference path="./v2.0/index.d.ts" />
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@albanian-xrm/cif-types",
3
+ "version": "0.1.0",
4
+ "description": "Microsoft.CIFramework types from the community (us).",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/albanian-xrm/cif-types.git"
8
+ },
9
+ "keywords": [
10
+ "cif",
11
+ "channel-integration-framework",
12
+ "dataverse"
13
+ ],
14
+ "author": "AlbanianXrm",
15
+ "license": "MIT",
16
+ "types": "./index.d.ts",
17
+ "bugs": {
18
+ "url": "https://github.com/albanian-xrm/cif-types/issues"
19
+ },
20
+ "homepage": "https://github.com/albanian-xrm/cif-types#readme"
21
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "compilerOptions": {
3
+ "typeRoots": ["./index.d.ts"]
4
+ }
5
+ }
package/v1.0/CRUD.d.ts ADDED
@@ -0,0 +1,142 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * Creates an entity record.
5
+ * @param entityLogicalName Logical name of the entity you want to create. For example: "account".
6
+ * @param data String defining the attributes and values for the new entity record.
7
+ * @returns On success, returns a promise containing a string with the attributes and their values.
8
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/createrecord External Link: createRecord}
9
+ * @example
10
+ * var entityLogicalName = "contact";
11
+ * var data = {
12
+ * "firstname": "Sample",
13
+ * "lastname": "Contact",
14
+ * "fullname": "Sample Contact",
15
+ * "emailaddress1": "contact@contoso.com",
16
+ * "jobtitle": "Sr. Marketing Manager",
17
+ * "telephone1": "555-0109",
18
+ * "description": "Default values for this record were set programmatically."
19
+ * }
20
+ * // create contact record
21
+ * var jsonData = JSON.stringify(data);
22
+ * Microsoft.CIFramework.createRecord(entityLogicalName,jsonData).then(
23
+ * function success (result) {
24
+ * res=JSON.parse(result);
25
+ * console.log("Contact created with ID: " + res.id);
26
+ * //perform operations on record creation
27
+ * },
28
+ * function (error) {
29
+ * console.log(error);
30
+ * //handle error conditions
31
+ * }
32
+ * );
33
+ */
34
+ export function createRecord(
35
+ entityLogicalName: string,
36
+ data: string
37
+ ): Promise<string>;
38
+
39
+ /**
40
+ * Retrieves an entity record.
41
+ * @param entityLogicalName The entity logical name of the record you want to retrieve. For example: "account".
42
+ * @param id GUID of the entity record you want to retrieve.
43
+ * @param options OData system query options, `$select` and `$expand`, to retrieve your data.
44
+ * * Use the `$select` system query option to limit the properties returned by including a comma-separated list of property names. This is an important performance best practice. If properties aren’t specified using `$select`, all properties will be returned.
45
+ * * Use the `$expand` system query option to control what data from related entities is returned. If you just include the name of the navigation property, you’ll receive all the properties for related records. You can limit the properties returned for related records using the `$select` system query option in parentheses after the navigation property name. Use this for both single-valued and collection-valued navigation properties.
46
+ *
47
+ * You specify the query options starting with `?`. You can also specify multiple query options by using `&` to separate the query options. For example:
48
+ * ```text
49
+ * ?$select=name&$expand=primarycontactid($select=contactid,fullname)
50
+ * ```
51
+ * @returns On success, returns a promise containing a string with the retrieved attributes and their values.
52
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/retrieverecord External Link: retrieveRecord}
53
+ * @example
54
+ * // retrieve contact record
55
+ * var id = "b44d31ac-5fd1-e811-8158-000d3af97055";
56
+ * var entityLogicalName = "contact";
57
+ * Microsoft.CIFramework.retrieveRecord(entityLogicalName, id, "?$select=fullname,telephone1").then(
58
+ * function success(result) {
59
+ * res=JSON.parse(result);
60
+ * console.log(`Retrieved values: Full Name: ${res.fullname}, Telephone Number: ${res.telephone1}`);
61
+ * // perform operations on record retrieval
62
+ * },
63
+ * function (error) {
64
+ * console.log(error.message);
65
+ * // handle error conditions
66
+ * }
67
+ * );
68
+ */
69
+ export function retrieveRecord(
70
+ entityLogicalName: string,
71
+ id: string,
72
+ options?: string
73
+ ): Promise<string>;
74
+
75
+ /**
76
+ * Updates an entity record.
77
+ * @param entityLogicalName The entity logical name of the record you want to update. For example: "account".
78
+ * @param id GUID of the entity record you want to update.
79
+ * @param data String containing key: value pairs, where key is the property of the entity and value is the value of the property you want to update.
80
+ * @returns On success, returns a promise containing a string with the updated attributes and their values.
81
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/updaterecord External Link: deleteRecord}
82
+ * @example
83
+ * //// define the data to update a record
84
+ * var entityLogicalName = "contact";
85
+ * var data = {
86
+ * "firstname": "Updated Sample",
87
+ * "lastname": "Contact",
88
+ * "fullname": "Updated Sample Contact",
89
+ * "emailaddress1": "contact@contoso.com",
90
+ * "jobtitle": "Sr. Marketing Manager",
91
+ * "telephone1": "555-0109",
92
+ * "description": "Updated values for this record were set programmatically."
93
+ * }
94
+ * // update contact record
95
+ * var id = "b44d31ac-5fd1-e811-8158-000d3af97055";
96
+ * var jsonData = JSON.stringify(data);
97
+ * Microsoft.CIFramework.updateRecord(entityLogicalName,id,jsonData).then(
98
+ * function success (result) {
99
+ * res=JSON.parse(result);
100
+ * console.log("Contact updated with ID: " + res.id);
101
+ * //the record is updated
102
+ * },
103
+ * function (error) {
104
+ * console.log(error);
105
+ * //handle error conditions
106
+ * }
107
+ * );
108
+ */
109
+ export function updateRecord(
110
+ entityLogicalName: string,
111
+ id: string,
112
+ data: string
113
+ ): Promise<string>;
114
+ }
115
+
116
+ /**
117
+ * Deletes an entity record.
118
+ * @param entityLogicalName The entity logical name of the record you want to delete. For example: "account".
119
+ * @param id GUID of the entity record you want to delete.
120
+ * @returns On success, returns a promise containing a string with the attributes and their values.
121
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/deleterecord External Link: deleteRecord}
122
+ * @example
123
+ * // delete contact record with the id=b44d31ac-5fd1-e811-8158-000d3af97055d
124
+ * var id = "b44d31ac-5fd1-e811-8158-000d3af97055";
125
+ * var entityLogicalName = "contact";
126
+ * Microsoft.CIFramework.deleteRecord(entityLogicalName, id).then(
127
+ * function success(result) {
128
+ * res=JSON.parse(result);
129
+ * console.log("Contact deleted with ID: " + res.contactid);
130
+ * // the record is deleted
131
+ * },
132
+ * function (error) {
133
+ * console.log(error.message);
134
+ * // handle error conditions
135
+ * }
136
+ * );
137
+ */
138
+ export function deleteRecord(
139
+ entityLogicalName: string,
140
+ id: string
141
+ ): Promise<string>;
142
+ }
@@ -0,0 +1,18 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * Returns a Boolean value to indicate whether the outbound communication (ClickToAct) is enabled or not.
5
+ * @returns Returns Promise object with the value. `true` if ClickToAct is enabled; `false` otherwise.
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/getclicktoact External Link: getClickToAct}
7
+ */
8
+ export function getClickToAct(): Promise<boolean>;
9
+
10
+ /**
11
+ * Sets a Boolean value to enable or disable the outbound communication (ClickToAct).
12
+ * @param value Sets the value to enable or disable ClickToAct.
13
+ * @returns Returns Promise object without value.
14
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/setclicktoact External Link: setClickToAct}
15
+ */
16
+ export function setClickToAct(value: boolean): Promise<boolean>;
17
+ }
18
+ }
@@ -0,0 +1,501 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * Returns the entity metadata for the specified entity.
5
+ * @returns An object containing the entity metadata information with the following form {@link EntityMetadata}.
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/getentitymetadata External Link: getEntityMetadata}
7
+ */
8
+ export function getEntityMetadata(
9
+ entityName: string,
10
+ attributes?: string[]
11
+ ): Promise<EntityMetadata>;
12
+
13
+ export interface EntityMetadata {
14
+ /**
15
+ * Whether a custom activity should appear in the activity menus in the Web application.
16
+ * - `0` indicates that the custom activity doesn't appear
17
+ * - `1` indicates that it does appear.
18
+ */
19
+ ActivityTypeMask: 0 | 1;
20
+
21
+ /**
22
+ * Indicates whether to automatically move records to the owner’s default queue when a record of this type is created or assigned.
23
+ */
24
+ AutoRouteToOwnerQueue: boolean;
25
+
26
+ /**
27
+ * @warning For internal use only.
28
+ */
29
+ CanEnableSyncToExternalSearchIndex: boolean;
30
+
31
+ /**
32
+ * Indicates whether the entity can trigger a workflow process.
33
+ */
34
+ CanTriggerWorkflow: boolean;
35
+
36
+ /**
37
+ * Description for the entity.
38
+ */
39
+ Description: string;
40
+
41
+ /**
42
+ * Plural display name for the entity.
43
+ */
44
+ DisplayCollectionName: string;
45
+
46
+ /**
47
+ * Display name for the entity.
48
+ */
49
+ DisplayName: string;
50
+
51
+ /**
52
+ * Indicates whether the entity will enforce custom state transitions.
53
+ */
54
+ EnforceStateTransitions: boolean;
55
+
56
+ /**
57
+ * The hexadecimal code to represent the color to be used for this entity in the application.
58
+ */
59
+ EntityColor: string;
60
+
61
+ /**
62
+ * The name of the Web API entity set for this entity.
63
+ */
64
+ EntitySetName: string;
65
+
66
+ /**
67
+ * Indicates whether activities are associated with this entity.
68
+ */
69
+ HasActivities: boolean;
70
+
71
+ /**
72
+ * Indicates whether the entity is an activity.
73
+ */
74
+ IsActivity: boolean;
75
+
76
+ /**
77
+ * Indicates whether the email messages can be sent to an email address stored in a record of this type.
78
+ */
79
+ IsActivityParty: boolean;
80
+
81
+ /**
82
+ * Indicates whether the entity is enabled for business process flows.
83
+ */
84
+ IsBusinessProcessEnabled: boolean;
85
+
86
+ /**
87
+ * Indicates whether the entity is a business process flow entity.
88
+ */
89
+ IsBPFEntity: boolean;
90
+
91
+ /**
92
+ * Indicates whether the entity is a child entity.
93
+ */
94
+ IsChildEntity: boolean;
95
+
96
+ /**
97
+ * Indicates whether connections are enabled for this entity.
98
+ */
99
+ IsConnectionsEnabled: boolean;
100
+
101
+ /**
102
+ * Indicates whether the entity is a custom entity.
103
+ */
104
+ IsCustomEntity: boolean;
105
+
106
+ /**
107
+ * Indicates whether the entity is customizable.
108
+ */
109
+ IsCustomizable: boolean;
110
+
111
+ /**
112
+ * Indicates whether document management is enabled.
113
+ */
114
+ IsDocumentManagementEnabled: boolean;
115
+
116
+ /**
117
+ * Indicates whether the document recommendations are enabled.
118
+ */
119
+ IsDocumentRecommendationsEnabled: boolean;
120
+
121
+ /**
122
+ * Indicates whether duplicate detection is enabled.
123
+ */
124
+ IsDuplicateDetectionEnabled: boolean;
125
+
126
+ /**
127
+ * Indicates whether charts are enabled.
128
+ */
129
+ IsEnabledForCharts: boolean;
130
+
131
+ /**
132
+ * Indicates whether the entity can be imported using the Import Wizard.
133
+ */
134
+ IsImportable: boolean;
135
+
136
+ /**
137
+ * Indicates the entity is enabled for interactive experience.
138
+ */
139
+ IsInteractionCentricEnabled: boolean;
140
+
141
+ /**
142
+ * Indicates whether knowledge management is enabled for the entity.
143
+ */
144
+ IsKnowledgeManagementEnabled: boolean;
145
+
146
+ /**
147
+ * Indicates whether mail merge is enabled for this entity.
148
+ */
149
+ IsMailMergeEnabled: boolean;
150
+
151
+ /**
152
+ * Indicates whether the entity is part of a managed solution.
153
+ */
154
+ IsManaged: boolean;
155
+
156
+ /**
157
+ * Indicates whether OneNote integration is enabled for the entity.
158
+ */
159
+ IsOneNoteIntegrationEnabled: boolean;
160
+
161
+ /**
162
+ * Indicates whether optimistic concurrency is enabled for the entity.
163
+ */
164
+ IsOptimisticConcurrencyEnabled: boolean;
165
+
166
+ /**
167
+ * Indicates whether the entity is enabled for quick create forms.
168
+ */
169
+ IsQuickCreateEnabled: boolean;
170
+
171
+ /**
172
+ * Indicates whether the entity supports setting custom state transitions.
173
+ */
174
+ IsStateModelAware: boolean;
175
+
176
+ /**
177
+ * Indicates whether the entity is shown in Advanced Find.
178
+ */
179
+ IsValidForAdvancedFind: boolean;
180
+
181
+ /**
182
+ * Indicates whether Microsoft Dynamics 365 for tablets users can see data for this entity.
183
+ */
184
+ IsVisibleInMobileClient: boolean;
185
+
186
+ /**
187
+ * Indicates whether the entity is enabled for Unified Interface.
188
+ */
189
+ IsEnabledInUnifiedInterface: boolean;
190
+
191
+ /**
192
+ * The logical collection name.
193
+ */
194
+ LogicalCollectionName: string;
195
+
196
+ /**
197
+ * The logical name for the entity.
198
+ */
199
+ LogicalName: string;
200
+
201
+ /**
202
+ * The entity type code.
203
+ */
204
+ ObjectTypeCode: number;
205
+
206
+ /**
207
+ * The ownership type for the entity: `UserOwned` or `OrganizationOwned`.
208
+ */
209
+ OwnershipType: "UserOwned" | "OrganizationOwned";
210
+
211
+ /**
212
+ * The name of the attribute that is the primary ID for the entity.
213
+ */
214
+ PrimaryIdAttribute: string;
215
+
216
+ /**
217
+ * The name of the primary image attribute for an entity.
218
+ */
219
+ PrimaryImageAttribute: string;
220
+
221
+ /**
222
+ * The name of the primary attribute for an entity.
223
+ */
224
+ PrimaryNameAttribute: string;
225
+
226
+ /**
227
+ * The privilege metadata for the entity where each object contains the following attributes to define the security privilege for access to an entity
228
+ */
229
+ Privileges: EntityPrivilege[];
230
+
231
+ /**
232
+ * A collection of attribute metadata objects. The object returned depends on the type of attribute metadata.
233
+ */
234
+ Attributes: (
235
+ | Attributes.BaseAttribute
236
+ | Attributes.BooleanAttribute
237
+ | Attributes.EnumAttribute
238
+ | Attributes.PicklistAttribute
239
+ | Attributes.StateAttribute
240
+ | Attributes.StatusAttribute
241
+ )[];
242
+ }
243
+
244
+ namespace Attributes {
245
+ export interface BaseAttribute {
246
+ /**
247
+ * Type of an attribute. For a list of attribute type values, see {@link AttributeTypeCode}
248
+ */
249
+ AttributeType: AttributeTypeCode;
250
+
251
+ /**
252
+ * Display name for the attribute.
253
+ */
254
+ DisplayName: string;
255
+
256
+ /**
257
+ * Logical name of the entity that contains the attribute.
258
+ */
259
+ EntityLogicalName: string;
260
+
261
+ /**
262
+ * Logical name for the attribute.
263
+ */
264
+ LogicalName: string;
265
+ }
266
+
267
+ export interface BooleanAttribute extends BaseAttribute {
268
+ /**
269
+ * Default value for a Boolean option set.
270
+ */
271
+ DefaultFormValue: boolean;
272
+
273
+ /**
274
+ * Options for the boolean attribute where each option is a key:value pair.
275
+ */
276
+ OptionSet: { [key in 0 | 1]: string };
277
+ }
278
+
279
+ export interface EnumAttribute extends BaseAttribute {
280
+ /**
281
+ * Options for the attribute where each option is a key:value pair.
282
+ */
283
+ OptionSet: { [key: number]: string };
284
+ }
285
+
286
+ export interface PicklistAttribute extends BaseAttribute {
287
+ /**
288
+ * Default form value for the attribute.
289
+ */
290
+ DefaultFormValue: number;
291
+
292
+ /**
293
+ * Options for the attribute where each option is a key:value pair.
294
+ */
295
+ OptionSet: { [key: number]: string };
296
+ }
297
+
298
+ export interface StateAttribute extends BaseAttribute {
299
+ /**
300
+ * Options for the attribute where each option is a key:value pair.
301
+ */
302
+ OptionSet: { [key: number]: string };
303
+
304
+ /**
305
+ * @param arg state value
306
+ * @returns default status (number) based on the passed in state value for an entity
307
+ * @remarks For default state and status values for an entity, see entity metadata information of the entity in {@link External Link: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/reference/about-entity-reference entity reference}.
308
+ */
309
+ getDefaultStatus(arg: number): number;
310
+
311
+ /**
312
+ * @param arg state value
313
+ * @returns possible status values (array of numbers) for a specified state value
314
+ * @remarks For state and status values for an entity, see entity metadata information of the entity in {@link External Link: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/reference/about-entity-reference entity reference}.
315
+ */
316
+ getStatusValuesForState(arg: number): number[];
317
+ }
318
+
319
+ export interface StatusAttribute extends BaseAttribute {
320
+ /**
321
+ * Options for the attribute where each option is a key:value pair.
322
+ */
323
+ OptionSet: { [key: number]: string };
324
+
325
+ /**
326
+ * @param arg status value
327
+ * @returns the state value (number) for the specified status value (number).
328
+ * @remarks For default state and status values for an entity, see entity metadata information of the entity in {@link External Link: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/reference/about-entity-reference entity reference}.
329
+ */
330
+ getState(arg: number): number;
331
+ }
332
+
333
+ /**
334
+ * Describes the type of an attribute.
335
+ * @see {@link https://learn.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.metadata.attributetypecode External Link: Microsoft.Xrm.Sdk.Metadata.AttributeTypeCode}
336
+ */
337
+ export const enum AttributeTypeCode {
338
+ /**
339
+ * A big integer attribute.
340
+ */
341
+ BigInt = 18,
342
+ /**
343
+ * A Boolean attribute.
344
+ */
345
+ Boolean = 0,
346
+ /**
347
+ * An attribute that contains calendar rules.
348
+ */
349
+ CalendarRules = 16,
350
+
351
+ /**
352
+ * An attribute that represents a customer.
353
+ */
354
+ Customer = 1,
355
+ /**
356
+ * A date/time attribute.
357
+ */
358
+ DateTime = 2,
359
+
360
+ /**
361
+ * A decimal attribute.
362
+ */
363
+ Decimal = 3,
364
+
365
+ /**
366
+ * A double attribute.
367
+ */
368
+ Double = 4,
369
+
370
+ /**
371
+ * An entity name attribute.
372
+ */
373
+ EntityName = 20,
374
+
375
+ /**
376
+ * An integer attribute.
377
+ */
378
+ Integer = 5,
379
+
380
+ /**
381
+ * A lookup attribute.
382
+ */
383
+ Lookup = 6,
384
+
385
+ /**
386
+ * A managed property attribute.
387
+ */
388
+ ManagedProperty = 19,
389
+
390
+ /**
391
+ * A memo attribute.
392
+ */
393
+ Memo = 7,
394
+
395
+ /**
396
+ * A money attribute.
397
+ */
398
+ Money = 8,
399
+
400
+ /**
401
+ * An owner attribute.
402
+ */
403
+ Owner = 9,
404
+
405
+ /**
406
+ * A partylist attribute.
407
+ */
408
+ PartyList = 10,
409
+
410
+ /**
411
+ * A picklist attribute.
412
+ */
413
+ Picklist = 11,
414
+
415
+ /**
416
+ * A state attribute.
417
+ */
418
+ State = 12,
419
+
420
+ /**
421
+ * A status attribute.
422
+ */
423
+ Status = 13,
424
+
425
+ /**
426
+ * A string attribute.
427
+ */
428
+ String = 14,
429
+
430
+ /**
431
+ * An attribute that is an ID.
432
+ */
433
+ Uniqueidentifier = 15,
434
+
435
+ /**
436
+ * An attribute that is created by the system at run time.
437
+ */
438
+ Virtual = 17,
439
+ }
440
+ }
441
+
442
+ export interface EntityPrivilege {
443
+ /**
444
+ * Whether the privilege can be basic access level.
445
+ */
446
+ CanBeBasic: boolean;
447
+
448
+ /**
449
+ * Whether the privilege can be deep access level.
450
+ */
451
+ CanBeDeep: boolean;
452
+
453
+ /**
454
+ * Whether the privilege for an external party can be basic access level.
455
+ */
456
+ CanBeEntityReference: boolean;
457
+
458
+ /**
459
+ * Whether the privilege can be global access level.
460
+ */
461
+ CanBeGlobal: boolean;
462
+
463
+ /**
464
+ * Whether the privilege can be local access level.
465
+ */
466
+ CanBeLocal: boolean;
467
+
468
+ /**
469
+ * Whether the privilege for an external party can be parent access level.
470
+ */
471
+ CanBeParentEntityReference: boolean;
472
+
473
+ /**
474
+ * The name of the privilege.
475
+ */
476
+ Name: string;
477
+
478
+ /**
479
+ * The ID of the privilege.
480
+ */
481
+ PrivilegeId: string;
482
+
483
+ /**
484
+ * The type of privilege, which is one of the following: {@link EntityPrivilegeType}
485
+ */
486
+ PrivilegeType: EntityPrivilegeType;
487
+ }
488
+
489
+ export const enum EntityPrivilegeType {
490
+ None = 0,
491
+ Create = 1,
492
+ Read = 2,
493
+ Write = 3,
494
+ Delete = 4,
495
+ Assign = 5,
496
+ Share = 6,
497
+ Append = 7,
498
+ AppendTo = 8,
499
+ }
500
+ }
501
+ }
@@ -0,0 +1,25 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * Gets the current Unified Interface app and page details.
5
+ * @returns Returns a Promise object of type String with details of the current Unified Interface app and page. See {@link Environment}
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/getenvironment External Link: getEnvironment}
7
+ */
8
+ export function getEnvironment(): Promise<string>;
9
+
10
+ export interface Environment {
11
+ /**
12
+ * Application ID
13
+ */
14
+ appid: string;
15
+ /**
16
+ * Page type
17
+ */
18
+ pagetype: string;
19
+ /**
20
+ * Record ID
21
+ */
22
+ id: string;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,31 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * The value to set the mode of the panel.
5
+ */
6
+ export const enum PanelMode {
7
+ /**
8
+ * Enter 0 to minimize the panel.
9
+ */
10
+ Minimized = 0,
11
+ /**
12
+ * Enter 1 to dock the panel.
13
+ */
14
+ Docked = 1,
15
+ }
16
+
17
+ /**
18
+ * Gets the current state of the panel.
19
+ * @returns Promise object with the value (current state of the panel). Values are defined in {@link PanelMode}
20
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/getmode External Link: getMode}
21
+ */
22
+ export function getMode(): Promise<PanelMode>;
23
+
24
+ /**
25
+ * Sets the state of the panel.
26
+ * @param value The value to set the mode of the panel.
27
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/setmode External Link: setMode}
28
+ */
29
+ export function setMode(value: PanelMode): Promise<void>;
30
+ }
31
+ }
@@ -0,0 +1,21 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * Gets the panel width in pixels.
5
+ * @returns Returns a promise object containing the width of the panel, in pixels.
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/getwidth External Link: getWidth}
7
+ */
8
+ export function getWidth(): Promise<number>;
9
+
10
+ /**
11
+ * Sets the panel width for all the sessions.
12
+ * @param value The width of the panel in pixels.
13
+ * @remarks
14
+ * - If the value parameter passed for setWidth is greater than half of screen width, the side panel will collapse.
15
+ * - The width should be greater than or equal to 300. The API doesn't consider any value less than 300.
16
+ * @returns Returns a promise object with a value.
17
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/setwidth External Link: setWidth}
18
+ */
19
+ export function setWidth(value: number): Promise<void>;
20
+ }
21
+ }
@@ -0,0 +1,80 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * The method searches for the record from the communication widget during the inbound communication and opens the record.
5
+ * @param entityLogicalName Name of the entity to search and open.
6
+ * @param queryParameters OData system query options, `$select` and `$expand`, to retrieve your data.
7
+ * * Use the `$select` system query option to limit the properties returned by including a comma-separated list of property names. This is an important performance best practice. If properties aren’t specified using `$select`, all properties will be returned.
8
+ * * Use the `$expand` system query option to control what data from related entities is returned. If you just include the name of the navigation property, you’ll receive all the properties for related records. You can limit the properties returned for related records using the `$select` system query option in parentheses after the navigation property name. Use this for both single-valued and collection-valued navigation properties.
9
+ *
10
+ * You specify the query options starting with `?`. You can also specify multiple query options by using `&` to separate the query options. For example:
11
+ * ```text
12
+ * ?$select=name&$expand=primarycontactid($select=contactid,fullname)
13
+ * ```
14
+ * @param searchOnly Set the searchOnly to false when you want the search to display a single record based on the search context.
15
+ * If the search result has multiple records and if you've used queryParameters to indicate the search option, then setting
16
+ * searchOnly to false opens and populates the search page with the search option.
17
+ * `Note:` If the search result has multiple records, then records for `Account`, `Contact`, and `Activity` entities only are opened.
18
+ * @param correlationId Is used to group all related API calls together for diagnostic telemetry. GUID.
19
+ * @param searchType Type of search page to open. `0` for relevance search and `1` for categorized search. If no parameter is provided, the records are searched by category.
20
+ * @returns Returns a Promise object of type String. On success, the method returns the search results as per the search query.
21
+ * @remarks You can fetch a maximum of 5000 records at once (if more than 5000 records exist). You can narrow down the results by using query options such as `$filter`, `$select`, and `$top` in the method parameters. See {@link https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview External Link: Query options overview}
22
+ * @remarks To search based on relevance, you must configure relevance search. If relevance search isn't enabled, then the search will be performed based on category. See {@link https://learn.microsoft.com/en-us/power-platform/admin/configure-relevance-search-organization External Link: Configure Relevance Seach}
23
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/searchandopenrecords External Link: searchAndOpenRecords}
24
+ * @example
25
+ * // retrieve contact record
26
+ * Microsoft.CIFramework.searchAndOpenRecords("contact", "?$select=fullname,telephone1", false).
27
+ * then(
28
+ * function success(result) {
29
+ * res=JSON.parse(result);
30
+ * console.log(`Record values: Full Name: ${res[0].fullname}, Telephone Number: ${res[0].telephone1}`);
31
+ * // perform operations on record retrieval and opening
32
+ * },
33
+ * function (error) {
34
+ * console.log(error.message);
35
+ * // handle error conditions
36
+ * }
37
+ * );
38
+ *
39
+ * @example
40
+ * // Retrieve Contact entity record
41
+ * // Change searchOnly parameter to true, if you do not want to open the search results page
42
+ * Microsoft.CIFramework.searchAndOpenRecords("contact", "?$select=fullname,telephone1&$filter=firstname eq 'Contoso'&$search=Contoso", false).
43
+ * then(
44
+ * function success(result) {
45
+ * res=JSON.parse(result);
46
+ * console.log(`The caller name is: ${res[0].fullname}, Telephone Number: ${res[0].telephone1}`);
47
+ * // perform operations on record retrieval and opening
48
+ * },
49
+ * function (error) {
50
+ * console.log(error.message);
51
+ * // handle error conditions
52
+ * }
53
+ * );
54
+ */
55
+ export function searchAndOpenRecords(
56
+ entityLogicalName: string,
57
+ queryParameters: string,
58
+ searchOnly: boolean,
59
+ correlationId?: string,
60
+ searchType?: SearchType
61
+ ): Promise<string>;
62
+
63
+ /**
64
+ * Allows you to search among the records of a particular entity type. This API opens the Unified Interface entity page with the search field on it prepopulated with the search string that is passed as a parameter.
65
+ * @param entityLogicalName The entity logical name of the record you want to query such as "account".
66
+ * @param searchString String to search among the attributes of the entity records.
67
+ * @param Type of search page to open. `0` for relevance search and `1` for categorized search. If no parameter is provided, the records are searched by category. For information on relevance search, see {@link https://learn.microsoft.com/en-us/power-platform/admin/configure-relevance-search-organization External Link: Configure Dataverse search}.
68
+ */
69
+ export function renderSearchPage(
70
+ entityLogicalName: string,
71
+ searchString: string,
72
+ searchType?: SearchType
73
+ ): Promise<void>;
74
+
75
+ export const enum SearchType {
76
+ RelevanceSearch = 0,
77
+ CategorizedSearch = 1,
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference path="./ClickToAct.d.ts" />
2
+ /// <reference path="./CRUD.d.ts" />
3
+ /// <reference path="./EntityMetadata.d.ts" />
4
+ /// <reference path="./Environment.d.ts" />
5
+ /// <reference path="./PanelMode.d.ts" />
6
+ /// <reference path="./PanelWidth.d.ts" />
7
+ /// <reference path="./Search.d.ts" />
@@ -0,0 +1,5 @@
1
+ {
2
+ "compilerOptions": {
3
+ "typeRoots": ["./index.d.ts"]
4
+ }
5
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference path="../v1.0/PanelMode.d.ts" />
2
+ declare namespace Microsoft {
3
+ namespace CIFramework {
4
+ export const enum PanelMode {
5
+ /**
6
+ * Enter 2 to hide the panel.
7
+ */
8
+ Hidden = 2,
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference path="../v1.0/ClickToAct.d.ts" />
2
+ /// <reference path="../v1.0/CRUD.d.ts" />
3
+ /// <reference path="../v1.0/EntityMetadata.d.ts" />
4
+ /// <reference path="../v1.0/Environment.d.ts" />
5
+ /// <reference path="./PanelMode.d.ts" />
6
+ /// <reference path="../v1.0/PanelWidth.d.ts" />
7
+ /// <reference path="../v1.0/Search.d.ts" />
@@ -0,0 +1,5 @@
1
+ {
2
+ "compilerOptions": {
3
+ "typeRoots": ["./index.d.ts"]
4
+ }
5
+ }