@i2analyze/notebook-sdk 1.1.0-dev.25 → 1.1.0-dev.28

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @i2analyze/notebook-sdk
2
2
 
3
+ ## 1.1.0-dev.28
4
+
5
+ ### Minor Changes
6
+
7
+ - Add mutation response handler API.
8
+
9
+ ## 1.1.0-dev.27
10
+
11
+ ### Minor Changes
12
+
13
+ - Add options parameter to IApplication.runTrackedMutation and IApplication.runUntrackedMutation.
14
+
15
+ ## 1.1.0-dev.26
16
+
17
+ ### Minor Changes
18
+
19
+ - Add "baseUrl" property to the IServerComponents interface
20
+
3
21
  ## 1.1.0-dev.25
4
22
 
5
23
  ### Minor Changes
@@ -75,9 +75,37 @@ export declare namespace app {
75
75
  * A successful set of tracked mutations is added as a single entry to the undo stack.
76
76
  *
77
77
  * @param mutationHandler - A function that performs one or more tracked mutations and reports on their success as a whole.
78
+ * @param options - An object that can control the transaction.
79
+ * @returns A promise that is fulfilled if the work completes successfully, or rejected if there is a problem performing it.
80
+ * @i2since 1.1
81
+ */
82
+ runTrackedMutations(mutationHandler: TrackedMutationHandler, options?: ITransactionOptions): void;
83
+ /**
84
+ * Queues a function that performs tracked mutations on the application contents at the next available opportunity.
85
+ *
86
+ * @remarks
87
+ * A mutation is an operation that can read or modify the contents of the application.
88
+ * A successful set of tracked mutations is added as a single entry to the undo stack.
89
+ *
90
+ * @param mutationHandler - A function that performs one or more tracked mutations and reports on their success as a whole.
91
+ * @param responseHandler - A callback that receives the changes produced by the mutation.
92
+ * @param options - An object that can control the transaction.
93
+ * @returns A promise that is fulfilled if the work completes successfully, or rejected if there is a problem performing it.
94
+ * @i2since 1.1
95
+ */
96
+ runTrackedMutations(mutationHandler: TrackedMutationHandler, responseHandler?: MutationResponseHandler, options?: ITransactionOptions): void;
97
+ /**
98
+ * Queues a function that performs untracked mutations on the application contents at the next available opportunity.
99
+ *
100
+ * @remarks
101
+ * A mutation is an operation that can read or modify the contents of the application.
102
+ * Untracked mutations are not added to the undo stack, and therefore cannot be undone.
103
+ *
104
+ * @param mutationHandler - A function that performs one or more untracked mutations and reports on their success as a whole.
105
+ * @param options - An object that can control the transaction.
78
106
  * @i2since 1.1
79
107
  */
80
- runTrackedMutations(mutationHandler: TrackedMutationHandler): void;
108
+ runUntrackedMutations(mutationHandler: UntrackedMutationHandler, options?: ITransactionOptions): void;
81
109
  /**
82
110
  * Queues a function that performs untracked mutations on the application contents at the next available opportunity.
83
111
  *
@@ -86,9 +114,11 @@ export declare namespace app {
86
114
  * Untracked mutations are not added to the undo stack, and therefore cannot be undone.
87
115
  *
88
116
  * @param mutationHandler - A function that performs one or more untracked mutations and reports on their success as a whole.
117
+ * @param responseHandler - A callback that receives the changes produced by the mutation.
118
+ * @param options - An object that can control the transaction.
89
119
  * @i2since 1.1
90
120
  */
91
- runUntrackedMutations(mutationHandler: UntrackedMutationHandler): void;
121
+ runUntrackedMutations(mutationHandler: UntrackedMutationHandler, responseHandler?: MutationResponseHandler, options?: ITransactionOptions): void;
92
122
  }
93
123
  /**
94
124
  * A report on the result of one or more mutations.
@@ -217,6 +247,26 @@ export declare namespace app {
217
247
  * @i2since 1.1
218
248
  */
219
249
  export type TrackedMutationHandler = (application: IApplicationContents, mutations: ITrackedMutations, cancelation: ICancelation) => ITrackedMutationInfo | Promise<ITrackedMutationInfo>;
250
+ /**
251
+ * A function that receives the results of a mutation.
252
+ *
253
+ * @param error - The error thrown if a mutation failed or was aborted.
254
+ * @param result - The results of the mutation.
255
+ * @param application - The contents of the application after the mutation was performed.
256
+ * @i2since 1.1
257
+ */
258
+ export type MutationResponseHandler = (error: Error | null, result: IMutationResult, application: IApplicationContents) => void;
259
+ /**
260
+ * A result from a mutation.
261
+ * @i2since 1.1
262
+ */
263
+ export interface IMutationResult {
264
+ /**
265
+ * Gets the changes that were the result of a mutation .
266
+ * @i2since 1.1
267
+ */
268
+ change: chart.IChartChange;
269
+ }
220
270
  /**
221
271
  * A collection of methods and properties for handling the situation when a user cancels an operation.
222
272
  *
@@ -729,7 +779,7 @@ export declare namespace app {
729
779
  * Removes records from the chart.
730
780
  *
731
781
  * @param records - The record or records to be removed.
732
- * @returns Returns true if one or more records existed on the chart and has been removed, or false if none of the records existed.
782
+ * @returns `true` if one or more records were successfully removed from the chart; `false` if none of the records existed.
733
783
  * @i2since 1.1
734
784
  */
735
785
  removeRecords(records: RecordSpecifier | Iterable<RecordSpecifier>): boolean;
@@ -737,12 +787,12 @@ export declare namespace app {
737
787
  * Removes elements from the chart.
738
788
  *
739
789
  * @param elements - The element or elements to be removed.
740
- * @returns Returns true if one or more elements existed on the chart and has been removed, or false if none of the elements existed.
790
+ * @returns `true` if one or more elements were successfully removed from the chart; `false` if none of the elements existed.
741
791
  * @i2since 1.1
742
792
  */
743
793
  removeElements(elements: ElementSpecifier | Iterable<ElementSpecifier>): boolean;
744
794
  /**
745
- * Removes the selected records from the chart.
795
+ * Removes the currently selected records from the chart.
746
796
  * @i2since 1.1
747
797
  */
748
798
  removeSelectedRecords(): void;
@@ -850,6 +900,14 @@ export declare namespace app {
850
900
  * @i2since 1.0
851
901
  */
852
902
  export interface IServerComponents {
903
+ /**
904
+ * Gets the base URL of the i2 Analyze server. For example, `http://localhost:3000/opal/`.
905
+ *
906
+ * @remarks
907
+ * The base URL always ends with a forward slash, and never contains query parameters.
908
+ * @i2since 1.1
909
+ */
910
+ readonly baseUrl: string;
853
911
  /**
854
912
  * Indicates whether the i2 Connect gateway is available on the application server.
855
913
  * @i2since 1.0
@@ -1974,7 +2032,7 @@ export declare namespace commands {
1974
2032
  */
1975
2033
  readonly toggleVisualQuery: CommandId;
1976
2034
  /**
1977
- * Gets the identifier of the system command that toggles the Expand UI.
2035
+ * Gets the identifier of the system command that toggles the Expand-with-conditions UI.
1978
2036
  * @i2since 1.0
1979
2037
  */
1980
2038
  readonly toggleExpand: CommandId;
@@ -2029,7 +2087,7 @@ export declare namespace commands {
2029
2087
  */
2030
2088
  readonly saveChart: CommandId;
2031
2089
  /**
2032
- * Gets the identifier of the system command that expands the current selection.
2090
+ * Gets the identifier of the system command that performs an expand operation on the current selection.
2033
2091
  * @i2since 1.1
2034
2092
  */
2035
2093
  readonly expand: CommandId;
@@ -3359,17 +3417,17 @@ export declare namespace schema {
3359
3417
  */
3360
3418
  readonly maximumSourceIdentifiers: number;
3361
3419
  /**
3362
- * Gets the maximum string length of a source identifier key.
3420
+ * Gets the maximum number of characters for a source identifier key.
3363
3421
  * @i2since 1.1
3364
3422
  */
3365
3423
  readonly maxKeyStringLength: data.ICharLimit;
3366
3424
  /**
3367
- * Gets the maximum string length of a source identifier type.
3425
+ * Gets the maximum number of characters for a source identifier type.
3368
3426
  * @i2since 1.1
3369
3427
  */
3370
3428
  readonly maxTypeStringLength: data.ICharLimit;
3371
3429
  /**
3372
- * Gets a collection of reserved source identifier types.
3430
+ * Gets the source identifier types that are reserved for system use.
3373
3431
  * @i2since 1.1
3374
3432
  */
3375
3433
  readonly reservedTypes: data.IReadOnlyCollection<string>;
@@ -3550,7 +3608,7 @@ export declare namespace schema {
3550
3608
  */
3551
3609
  readonly isOrphaned: boolean;
3552
3610
  /**
3553
- * Indicates whether the item type exists in the Information Store.
3611
+ * Indicates whether the item type is defined in the Information Store schema.
3554
3612
  * @i2since 1.1
3555
3613
  */
3556
3614
  readonly isInfoStore: boolean;
@@ -3576,7 +3634,7 @@ export declare namespace schema {
3576
3634
  */
3577
3635
  export type AnalyzePropertyTypeId = string;
3578
3636
  /**
3579
- * A specifier for a property type.
3637
+ * A common specifier for a property type.
3580
3638
  * @i2since 1.1
3581
3639
  */
3582
3640
  export type PropertyTypeSpecifier = ChartPropertyTypeId | IChartPropertyType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i2analyze/notebook-sdk",
3
- "version": "1.1.0-dev.25",
3
+ "version": "1.1.0-dev.28",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {