@albanian-xrm/cif-types 0.1.3 → 0.1.5

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 CHANGED
@@ -1,6 +1,29 @@
1
- # @albanian-xrm/cif-types
1
+ # @albanian-xrm/cif-types ![NPM Downloads](https://img.shields.io/npm/dt/@albanian-xrm%2Fcif-types)
2
+
2
3
  Microsoft.CIFramework types from the community (us).
3
4
 
4
- Read more about Channel Integration Framework on the Microsoft Docs [here](https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/channel-integration-framework).
5
+ Read more about Channel Integration Framework on the [Microsoft Docs](https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/channel-integration-framework).
6
+
7
+ These types are based on the api documentation on the [Microsoft Docs](https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework).
8
+
9
+ To use the types install `@albanian-xrm/cif-types` and add the following to your `tsconfig.json`:
10
+
11
+ ```json
12
+ "compilerOptions": {
13
+ "types": [
14
+ "@albanian-xrm/cif-types/v1.0"
15
+ ]
16
+ }
17
+ ```
18
+
19
+ If you want CIFv2 then use the following configuration:
20
+
21
+ ```json
22
+ "compilerOptions": {
23
+ "types": [
24
+ "@albanian-xrm/cif-types"
25
+ ]
26
+ }
27
+ ```
5
28
 
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).
29
+ You will get the Intellisense in your IDE with the global `Microsoft.CIFramework` types.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@albanian-xrm/cif-types",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Microsoft.CIFramework types from the community (us).",
5
5
  "repository": {
6
6
  "type": "git",
package/v1.0/CRUD.d.ts CHANGED
@@ -5,7 +5,7 @@ declare namespace Microsoft {
5
5
  * @param entityLogicalName Logical name of the entity you want to create. For example: "account".
6
6
  * @param data String defining the attributes and values for the new entity record.
7
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}
8
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/createrecord External Link: createRecord}
9
9
  * @example
10
10
  * var entityLogicalName = "contact";
11
11
  * var data = {
@@ -49,7 +49,7 @@ declare namespace Microsoft {
49
49
  * ?$select=name&$expand=primarycontactid($select=contactid,fullname)
50
50
  * ```
51
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}
52
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/retrieverecord External Link: retrieveRecord}
53
53
  * @example
54
54
  * // retrieve contact record
55
55
  * var id = "b44d31ac-5fd1-e811-8158-000d3af97055";
@@ -78,7 +78,7 @@ declare namespace Microsoft {
78
78
  * @param id GUID of the entity record you want to update.
79
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
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}
81
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/updaterecord External Link: deleteRecord}
82
82
  * @example
83
83
  * //// define the data to update a record
84
84
  * var entityLogicalName = "contact";
@@ -117,7 +117,7 @@ declare namespace Microsoft {
117
117
  * @param entityLogicalName The entity logical name of the record you want to delete. For example: "account".
118
118
  * @param id GUID of the entity record you want to delete.
119
119
  * @returns On success, returns a promise containing a string with the attributes and their values.
120
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/deleterecord External Link: deleteRecord}
120
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/deleterecord External Link: deleteRecord}
121
121
  * @example
122
122
  * // delete contact record with the id=b44d31ac-5fd1-e811-8158-000d3af97055d
123
123
  * var id = "b44d31ac-5fd1-e811-8158-000d3af97055";
@@ -3,7 +3,7 @@ declare namespace Microsoft {
3
3
  /**
4
4
  * Returns a Boolean value to indicate whether the outbound communication (ClickToAct) is enabled or not.
5
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}
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/getclicktoact External Link: getClickToAct}
7
7
  */
8
8
  export function getClickToAct(): Promise<boolean>;
9
9
 
@@ -11,7 +11,7 @@ declare namespace Microsoft {
11
11
  * Sets a Boolean value to enable or disable the outbound communication (ClickToAct).
12
12
  * @param value Sets the value to enable or disable ClickToAct.
13
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}
14
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/setclicktoact External Link: setClickToAct}
15
15
  */
16
16
  export function setClickToAct(value: boolean): Promise<boolean>;
17
17
  }
@@ -3,7 +3,7 @@ declare namespace Microsoft {
3
3
  /**
4
4
  * Returns the entity metadata for the specified entity.
5
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}
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/getentitymetadata External Link: getEntityMetadata}
7
7
  */
8
8
  export function getEntityMetadata(
9
9
  entityName: string,
@@ -3,7 +3,7 @@ declare namespace Microsoft {
3
3
  /**
4
4
  * Gets the current Unified Interface app and page details.
5
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}
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/getenvironment External Link: getEnvironment}
7
7
  */
8
8
  export function getEnvironment(): Promise<string>;
9
9
 
package/v1.0/Events.d.ts CHANGED
@@ -13,7 +13,7 @@ declare namespace Microsoft {
13
13
  * You can also pass custom events in the `eventName` parameter.
14
14
  * @param handlerFunction The handler function is invoked when any of the supported events are triggered.
15
15
  * @returns Promise with a value as Boolean.
16
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
16
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
17
17
  * @example
18
18
  * handlerFunction = function(eventData) {
19
19
  * console.log(eventData)
@@ -33,7 +33,7 @@ declare namespace Microsoft {
33
33
  * @param eventName Name of the event for which the handler is set. The event is invoked when the outbound communication (ClickToAct) field is enabled.
34
34
  * @param handlerFunction The handler function is invoked when any of the supported events are triggered.
35
35
  * @returns Promise with a value as Boolean.
36
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
36
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
37
37
  */
38
38
  export function addHandler(
39
39
  eventName: "onclicktoact",
@@ -46,7 +46,7 @@ declare namespace Microsoft {
46
46
  * @param eventName Name of the event for which the handler is set. The 'OnModeChanged' event is invoked when the panel mode is manually toggled between Minimized (0) and Docked (1).
47
47
  * @param handlerFunction The handler function is invoked when any of the supported events are triggered.
48
48
  * @returns Promise with a value as Boolean.
49
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
49
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
50
50
  * @example
51
51
  * handlerFunction = function(eventData) {
52
52
  * console.log(eventData)
@@ -66,7 +66,7 @@ declare namespace Microsoft {
66
66
  * @param eventName Name of the event for which the handler is set.
67
67
  * @param handlerFunction The handler function is invoked when any of the supported events are triggered.
68
68
  * @returns Promise with a value as Boolean.
69
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
69
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
70
70
  */
71
71
  export function addHandler(
72
72
  eventName: "onpagenavigate",
@@ -79,7 +79,7 @@ declare namespace Microsoft {
79
79
  * @param eventName Name of the event for which the handler is set.
80
80
  * @param handlerFunction The handler function is invoked when any of the supported events are triggered.
81
81
  * @returns Promise with a value as Boolean.
82
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
82
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
83
83
  */
84
84
  export function addHandler(
85
85
  eventName: "onsendkbarticle",
@@ -92,7 +92,7 @@ declare namespace Microsoft {
92
92
  * @param eventName Name of the event for which the handler is set.
93
93
  * @param handlerFunction The handler function is invoked when any of the supported events are triggered.
94
94
  * @returns Promise with a value as Boolean.
95
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
95
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
96
96
  */
97
97
  export function addHandler(
98
98
  eventName: "onsizechanged",
@@ -106,7 +106,7 @@ declare namespace Microsoft {
106
106
  * @param correlationId Is used to group all related API calls together for diagnostic telemetry.
107
107
  * @remark If you've created custom events using the {@link addHandler} method, then you can raise those events by passing the event name as parameter in this method.
108
108
  * @returns Promise with a value as Boolean.
109
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
109
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
110
110
  * @example
111
111
  * // Let there be an event registered to a subscriber.
112
112
  * handlerFunction = function(eventInput)
@@ -152,7 +152,7 @@ declare namespace Microsoft {
152
152
  *
153
153
  * You can also pass custom events in the `eventName` parameter.
154
154
  * @param handlerFunction The handler function that is to removed.
155
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
155
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/raiseevent External Link: raiseEvent}
156
156
  */
157
157
  export function removeHandler(
158
158
  eventName: string,
package/v1.0/Form.d.ts ADDED
@@ -0,0 +1,178 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * Opens an entity form or a quick create form.
5
+ * @param entityFormOptions Entity form options for opening the form. This parameter is a serialized from {@link Microsoft.CIFramework.EntityFormOptions EntityFormOptions}
6
+ * @param formParameters A dictionary object that passes extra parameters to the form. Invalid parameters will cause an error. For information about passing parameters to a form, see {@link https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/set-field-values-using-parameters-passed-form External Link: Set field values using parameters passed to a form} and {@link https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/configure-form-accept-custom-querystring-parameters External Link: Configure a form to accept custom querystring parameters}
7
+ * @returns On success, returns a Promise object containing string.
8
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/openform External Link: openForm}
9
+ * @example
10
+ * var id = "5af02e2a-d0d1-e811-8158-000d3af97055"
11
+ * var title = "Sample Case Form"
12
+ * var entityFormOptions = {};
13
+ * entityFormOptions["entityName"] = "incident";
14
+ *
15
+ * var formParameters = {};
16
+ * //pre-populate some fields based on the context
17
+ * formParameters["title"] = title;
18
+ * formParameters["customerid"] = id;
19
+ * formParameters["customeridtype"] = "contact";
20
+ * formParameters["caseorigincode"] = 1;
21
+ * formParameters["description"] = "Opened the form with pre-populated details like title, contact id, and description.";
22
+ *
23
+ * //Open the form
24
+ * Microsoft.CIFramework.openForm(JSON.stringify(entityFormOptions), JSON.stringify(formParameters)).then(
25
+ * function (success) {
26
+ * console.log(success);
27
+ * },
28
+ * function (error) {
29
+ * console.log(error);
30
+ * }
31
+ * );
32
+ */
33
+ export function openForm(
34
+ entityFormOptions: string,
35
+ formParameters?: string
36
+ ): Promise<string>;
37
+
38
+ export interface EntityFormOptions {
39
+ /**
40
+ * Indicates whether to display the command bar. If you do not specify this parameter, the command bar is displayed by default.
41
+ */
42
+ cmdBar?: boolean;
43
+
44
+ /**
45
+ * Indicates a record that will provide default values based on mapped attribute values.
46
+ */
47
+ createFromEntity?: LookupValue;
48
+
49
+ /**
50
+ * String Identifier of the entity record to display the form for.
51
+ */
52
+ entityId?: string;
53
+
54
+ /**
55
+ * Logical name of the entity to display the form for.
56
+ */
57
+ entityName: string;
58
+
59
+ /**
60
+ * Identifier of the form instance to be displayed.
61
+ */
62
+ formId?: string;
63
+
64
+ /**
65
+ * Height of the form window to be displayed in pixels.
66
+ */
67
+ height?: number;
68
+
69
+ /**
70
+ * Controls whether the navigation bar is displayed and whether application navigation is available using the areas and subareas defined in the site map.
71
+ */
72
+ navBar?: EntityFormNavBar;
73
+
74
+ /**
75
+ * Indicates whether to display the form in a new window.
76
+ */
77
+ openInNewWindow?: boolean;
78
+
79
+ /**
80
+ * Indicates the position of the form on the window.
81
+ */
82
+ windowPosition?: WindowPosition;
83
+
84
+ /**
85
+ * Identifier of the business process to be displayed on the form.
86
+ */
87
+ processId?: string;
88
+
89
+ /**
90
+ * Identifier of the business process instance to be displayed on the form.
91
+ */
92
+ processInstanceId?: string;
93
+
94
+ /**
95
+ * Indicates a relationship object to display the related records on the form.
96
+ */
97
+ relationship?: Relationship;
98
+
99
+ /**
100
+ * Identifier of the selected stage in business process instance.
101
+ */
102
+ selectStageId?: string;
103
+
104
+ useQuickCreateForm?: boolean;
105
+
106
+ /**
107
+ * Width of the form window to be displayed in pixels.
108
+ */
109
+ width?: number;
110
+ }
111
+
112
+ /**
113
+ * The following interface describes the attributes of the {@link Microsoft.CIFramework.EntityFormOptions.relationship relationship} object attribute of the {@link Microsoft.CIFramework.openForm entityFormOptions} parameter.
114
+ */
115
+ export interface Relationship {
116
+ /**
117
+ * Name of the attribute used for relationship.
118
+ */
119
+ attributeName?: string;
120
+
121
+ /**
122
+ * Name of the relationship.
123
+ */
124
+ name?: string;
125
+
126
+ /**
127
+ * Name of the navigation property for the relationship.
128
+ */
129
+ navigationProperty?: string;
130
+
131
+ /**
132
+ * Relationship type.
133
+ */
134
+ relationshipType?: RelationshipType;
135
+
136
+ /**
137
+ * Role type in the relationship.
138
+ */
139
+ roleType?: RoleType;
140
+ }
141
+
142
+ export const enum EntityFormNavBar {
143
+ /**
144
+ * The navigation bar is displayed. This is the default behavior if the navBar parameter is not used.
145
+ */
146
+ on = "on",
147
+ /**
148
+ * The navigation bar is not displayed. The user can navigate using other user interface elements or the back and forward buttons.
149
+ */
150
+ off = "off",
151
+ /**
152
+ * On an entity form, only the navigation options for related entities are available. After navigating to a related entity, a back button is displayed on the navigation bar to allow returning to the original record.
153
+ */
154
+ entity = "entity",
155
+ }
156
+
157
+ export const enum WindowPosition {
158
+ Center = 1,
159
+ Side = 2,
160
+ }
161
+
162
+ export const enum RelationshipType {
163
+ OneToMany = 0,
164
+ ManyToMany = 1,
165
+ }
166
+
167
+ export const enum RoleType {
168
+ Referencing = 1,
169
+ AssociationEntity = 2,
170
+ }
171
+
172
+ export interface LookupValue {
173
+ entityType: string;
174
+ id: string;
175
+ name?: string;
176
+ }
177
+ }
178
+ }
@@ -1,6 +1,20 @@
1
1
  declare namespace Microsoft {
2
2
  namespace CIFramework {
3
3
  /**
4
+ * Gets the current state of the panel.
5
+ * @returns Promise object with the value (current state of the panel). Values are defined in {@link PanelMode}
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/getmode External Link: getMode}
7
+ */
8
+ export function getMode(): Promise<PanelMode>;
9
+
10
+ /**
11
+ * Sets the state of the panel.
12
+ * @param value The value to set the mode of the panel.
13
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/setmode External Link: setMode}
14
+ */
15
+ export function setMode(value: PanelMode): Promise<void>;
16
+
17
+ /**
4
18
  * The value to set the mode of the panel.
5
19
  */
6
20
  export const enum PanelMode {
@@ -13,19 +27,5 @@ declare namespace Microsoft {
13
27
  */
14
28
  Docked = 1,
15
29
  }
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
30
  }
31
31
  }
@@ -3,7 +3,7 @@ declare namespace Microsoft {
3
3
  /**
4
4
  * Gets the panel width in pixels.
5
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}
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/getwidth External Link: getWidth}
7
7
  */
8
8
  export function getWidth(): Promise<number>;
9
9
 
@@ -14,7 +14,7 @@ declare namespace Microsoft {
14
14
  * - If the value parameter passed for setWidth is greater than half of screen width, the side panel will collapse.
15
15
  * - The width should be greater than or equal to 300. The API doesn't consider any value less than 300.
16
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}
17
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/setwidth External Link: setWidth}
18
18
  */
19
19
  export function setWidth(value: number): Promise<void>;
20
20
  }
package/v1.0/Search.d.ts CHANGED
@@ -1,5 +1,17 @@
1
1
  declare namespace Microsoft {
2
2
  namespace CIFramework {
3
+ /**
4
+ * 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.
5
+ * @param entityLogicalName The entity logical name of the record you want to query such as "account".
6
+ * @param searchString String to search among the attributes of the entity records.
7
+ * @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}.
8
+ */
9
+ export function renderSearchPage(
10
+ entityLogicalName: string,
11
+ searchString: string,
12
+ searchType?: SearchType
13
+ ): Promise<void>;
14
+
3
15
  /**
4
16
  * The method searches for the record from the communication widget during the inbound communication and opens the record.
5
17
  * @param entityLogicalName Name of the entity to search and open.
@@ -20,7 +32,7 @@ declare namespace Microsoft {
20
32
  * @returns Returns a Promise object of type String. On success, the method returns the search results as per the search query.
21
33
  * @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
34
  * @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}
35
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v1/develop/reference/microsoft-ciframework/searchandopenrecords External Link: searchAndOpenRecords}
24
36
  * @example
25
37
  * // retrieve contact record
26
38
  * Microsoft.CIFramework.searchAndOpenRecords("contact", "?$select=fullname,telephone1", false).
@@ -61,17 +73,8 @@ declare namespace Microsoft {
61
73
  ): Promise<string>;
62
74
 
63
75
  /**
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}.
76
+ * 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.
68
77
  */
69
- export function renderSearchPage(
70
- entityLogicalName: string,
71
- searchString: string,
72
- searchType?: SearchType
73
- ): Promise<void>;
74
-
75
78
  export const enum SearchType {
76
79
  RelevanceSearch = 0,
77
80
  CategorizedSearch = 1,
package/v1.0/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /// <reference path="./ClickToAct.d.ts" />
2
- /// <reference path="./Context.d.ts" />
3
2
  /// <reference path="./CRUD.d.ts" />
4
3
  /// <reference path="./EntityMetadata.d.ts" />
5
4
  /// <reference path="./Environment.d.ts" />
6
5
  /// <reference path="./Events.d.ts" />
6
+ /// <reference path="./Form.d.ts" />
7
7
  /// <reference path="./PanelMode.d.ts" />
8
8
  /// <reference path="./PanelWidth.d.ts" />
9
9
  /// <reference path="./Search.d.ts" />
@@ -0,0 +1,23 @@
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
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
6
+ * @returns Returns Promise object with the value. `true` if ClickToAct is enabled; `false` otherwise.
7
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/getclicktoact External Link: getClickToAct}
8
+ */
9
+ export function getClickToAct(correlationId?: string): Promise<boolean>;
10
+
11
+ /**
12
+ * Sets a Boolean value to enable or disable the outbound communication (ClickToAct).
13
+ * @param value Sets the value to enable or disable ClickToAct.
14
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
15
+ * @returns Returns Promise object without value.
16
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/setclicktoact External Link: setClickToAct}
17
+ */
18
+ export function setClickToAct(
19
+ value: boolean,
20
+ correlationId?: string
21
+ ): Promise<boolean>;
22
+ }
23
+ }
@@ -7,7 +7,7 @@ declare namespace Microsoft {
7
7
  * @param isDelete Set isDelete to `true` if the list of parameters in input JSON are to be deleted. If isDelete is set to `true`, the slug values will be deleted and will no longer be available for subsequent macro invocations.
8
8
  * @param correlationId Used to group all related API calls together for diagnostic telemetry
9
9
  * @returns Returns a promise with string value.
10
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/reference/microsoft-ciframework/updatecontext External Link: updateContext}
10
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/updatecontext External Link: updateContext}
11
11
  * @example
12
12
  * var input = { "customerName" : "Contosso" };
13
13
  * Microsoft.CIFramework.updateContext(input).then(
@@ -23,7 +23,7 @@ declare namespace Microsoft {
23
23
  */
24
24
  export function updateContext(
25
25
  input: string,
26
- sessionId?: string,
26
+ sessionId: string,
27
27
  isDelete?: boolean,
28
28
  correlationId?: string
29
29
  ): Promise<string>;
@@ -0,0 +1,35 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * This method allows you to update a Conversation(msdyn_ocliveworkitem) record.
5
+ * @param id Unique identifier of the conversation returned by {@link Microsoft.CIFramework.getSession Microsoft.CIFramework.getSession} API.
6
+ * @param data JSON string
7
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
8
+ * @returns Returns a promise with string value.
9
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/updateconversation External Link: updateConversation}
10
+ * @example
11
+ * var data = {
12
+ * "subject": "Troubleshooting printer malfunction",
13
+ * "prioritycode": 2
14
+ * }
15
+ * var conversationId = "05145e77-ce40-ea11-a812-000d3a579805";
16
+ * var jsonData = JSON.stringify(data);
17
+ * Microsoft.CIFramework.updateConversation(conversationId, jsonData).then(
18
+ * function success (response) {
19
+ * var result = JSON.parse(response);
20
+ * console.log("Conversation updated with ID: " + result.id);
21
+ * //the Conversation is updated
22
+ * },
23
+ * function (error) {
24
+ * console.log(error);
25
+ * //handle errors
26
+ * }
27
+ * );
28
+ */
29
+ export function updateConversation(
30
+ id: string,
31
+ data: string,
32
+ correlationId?: string
33
+ ): Promise<string>;
34
+ }
35
+ }
@@ -5,7 +5,7 @@ declare namespace Microsoft {
5
5
  * @param cancellationToken Unique string that was provided in the {@link notifyEvent} method to display notifications about incoming conversations.
6
6
  * @param correlationId Used to group all related API calls together for diagnostic telemetry.
7
7
  * @returns Returns the cancellation token.
8
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/v2/reference/microsoft-ciframework/cancelevent External Link: cancelEvent}
8
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/cancelevent External Link: cancelEvent}
9
9
  * @example
10
10
  * // Trying to cancel a notification, use the same cancelToken passed during creation of notification in notifyEvent
11
11
  * Microsoft.CIFramework.cancelEvent(CancelToken).then(
@@ -30,7 +30,7 @@ declare namespace Microsoft {
30
30
  * @param correlationId Used to group all related API calls together for diagnostic telemetry.
31
31
  * @param cancellationToken Is the unique string that's used by the {@link cancelEvent} method to cancel notifications about incoming conversations.
32
32
  * @returns Returns a Boolean value of success.
33
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/v2/reference/microsoft-ciframework/notifyevent External Link: notifyEvent}
33
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/notifyevent External Link: notifyEvent}
34
34
  * @example
35
35
  * var canceltoken = "cancellationtoken"+ Math.ceil(Math.random() * 100000 + 100000).toString();
36
36
  *
@@ -51,9 +51,20 @@ declare namespace Microsoft {
51
51
  * );
52
52
  */
53
53
  export function notifyEvent(
54
- input: string,
55
- correlationId?: string,
56
- cancellationToken?: string
54
+ input: NotifyEventArgs,
55
+ correlationId?: string
57
56
  ): Promise<string>;
57
+
58
+ export interface NotifyEventArgs {
59
+ eventType?: string;
60
+ templateName: string;
61
+ templateParameters: object;
62
+ templateNameResolver?: string;
63
+ additionalParametersObject?: string;
64
+ messageNotificationType?: string;
65
+ notificationAction?: string;
66
+ cancellationToken?: string;
67
+ notificationUXObject?: string;
68
+ }
58
69
  }
59
70
  }
@@ -3,7 +3,7 @@ declare namespace Microsoft {
3
3
  /**
4
4
  * Returns the presence text of the agent in the client session.
5
5
  * @returns Promise with the presence text of the current agent, as String.
6
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/v2/reference/microsoft-ciframework/getpresence External Link: getPresence}
6
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/getpresence External Link: getPresence}
7
7
  * @example
8
8
  * function getPresence() {
9
9
  * return new Promise((resolve, reject) => {
@@ -27,7 +27,7 @@ declare namespace Microsoft {
27
27
  * Sets the presence text of the agent in the client session.
28
28
  * @param presenceText Presence text for current agent in Omnichannel for Customer Service. For the presence to be set correctly, the string should exactly match the text used in the admin app. To create custom presence, see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/presence-custom-presence External Link: Configure and manage custom presence} .
29
29
  * @returns Returns a Boolean value of success.
30
- * @see {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/v2/reference/microsoft-ciframework/setpresence External Link: setPresence}
30
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/setpresence External Link: setPresence}
31
31
  * @example
32
32
  * Microsoft.CIFramework.setPresence(custompresence).then(
33
33
  * function (result) {
@@ -0,0 +1,94 @@
1
+ declare namespace Microsoft {
2
+ namespace CIFramework {
3
+ /**
4
+ * Allows you to check if a new session can be created.
5
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
6
+ * @returns Promise with the value as Boolean.
7
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/cancreatesession External Link: canCreateSession}
8
+ */
9
+ export function canCreateSession(correlationId?: string): Promise<boolean>;
10
+
11
+ /**
12
+ * Creates a new session based on the session template name and returns the unique identifier of the session that was created.
13
+ *
14
+ * If your organization uses single or multiple channel providers, then you can use this method to start a default session. More information: {@link https://learn.microsoft.com/en-us/dynamics365/customer-service/channel-integration-framework/v2/support-multiple-providers External Link: Configure support for single and multiple channel providers}
15
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
16
+ * @returns Promise with the value as Boolean.
17
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/cancreatesession External Link: canCreateSession}
18
+ * @example
19
+ * var input = {
20
+ * // unique name of the configured template
21
+ * templateName: "msdyn_chat_session",
22
+ * templateParameters: {
23
+ * customer: "Contoso",
24
+ * } // Global and application tab template parameters, these values will override configured values
25
+ * };
26
+ * Microsoft.CIFramework.createSession(input).then(function success(sessionId) {
27
+ * console.log(sessionId);
28
+ * // perform operations on session Id retrieved
29
+ * }, function(error) {
30
+ * console.log(error.message);
31
+ * // handle error conditions
32
+ * });
33
+ */
34
+ export function createSession(
35
+ input: CreateSessionInput,
36
+ correlationId?: string
37
+ ): Promise<boolean>;
38
+
39
+ /**
40
+ * Input for {@link Microsoft.CIFramework.createSession createSession}
41
+ */
42
+ interface CreateSessionInput {
43
+ /**
44
+ * Unique name of session template
45
+ */
46
+ templateName: string;
47
+ /**
48
+ * Global and application tab template parameters, these values will override configured values
49
+ */
50
+ templateParameters: {
51
+ [key: string]: number | boolean | string;
52
+ };
53
+ }
54
+
55
+ /**
56
+ * Returns an array of session identifiers for a provider.
57
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
58
+ * @returns Promise with the value as array of strings.
59
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/getallsessions External Link: getAllSessions}
60
+ */
61
+ export function getAllSessions(correlationId?: string): Promise<string[]>;
62
+
63
+ /**
64
+ * Returns the unique identifier of the session that is in focus, if it belongs to the channel provider else returns null. The session ID is null if the connector attempts to retrieve a focused session created using a different connector.
65
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
66
+ * @returns Promise with the value as a string.
67
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/getfocusedsession External Link: getAllSessions}
68
+ */
69
+ export function getFocusedSession(): Promise<string>;
70
+
71
+ /**
72
+ * Returns an object containing the unique identifier of the session, unique identifier of the conversation, context and the value of isFocused parameter, in case the session belongs to the channel provider.
73
+ * @param sessionId Id of the current session.
74
+ * @param correlationId Used to group all related API calls together for diagnostic telemetry
75
+ * @returns Object containing session Id, conversation Id, context and isFocused parameter
76
+ * @see {@link https://learn.microsoft.com/en-us/dynamics365/channel-integration-framework/v2/develop/reference/microsoft-ciframework/getsession External Link: getSession}
77
+ * @example
78
+ * Microsoft.CIFramework.getSession("session-id-1").then(
79
+ * function success(result) {
80
+ * console.log(result);
81
+ * // perform operations on session info
82
+ * },
83
+ * function (error) {
84
+ * console.log(error.message);
85
+ * // handle error conditions
86
+ * }
87
+ * );
88
+ */
89
+ export function getSession(
90
+ sessionId: string,
91
+ correlationId?: string
92
+ ): Promise<string>;
93
+ }
94
+ }
package/v2.0/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
- /// <reference path="../v1.0/ClickToAct.d.ts" />
2
- /// <reference path="../v1.0/Context.d.ts" />
1
+ /// <reference path="./ClickToAct.d.ts" />
2
+ /// <reference path="./Context.d.ts" />
3
+ /// <reference path="./Conversation.d.ts" />
3
4
  /// <reference path="../v1.0/CRUD.d.ts" />
4
5
  /// <reference path="../v1.0/EntityMetadata.d.ts" />
5
6
  /// <reference path="../v1.0/Environment.d.ts" />
6
7
  /// <reference path="../v1.0/Events.d.ts" />
8
+ /// <reference path="./Notification.d.ts" />
7
9
  /// <reference path="./PanelMode.d.ts" />
8
10
  /// <reference path="../v1.0/PanelWidth.d.ts" />
9
11
  /// <reference path="./Presence.d.ts" />
10
12
  /// <reference path="../v1.0/Search.d.ts" />
13
+ /// <reference path="./Session.d.ts" />