@i2analyze/notebook-sdk 1.5.1-dev.0 → 1.6.0-dev.10

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.
@@ -952,6 +952,30 @@ export declare namespace app {
952
952
  * @i2since 1.1
953
953
  */
954
954
  removeSelectedRecords(): void;
955
+ /**
956
+ * Creates a custom entity type that is added to the chart on committal.
957
+ *
958
+ * @param typeTemplate - The data for creating the custom entity type.
959
+ * @returns The new, pending item type.
960
+ * @i2since 1.6
961
+ */
962
+ addEntityType(typeTemplate: schema.IChartEntityTypeData): schema.IPendingItemType;
963
+ /**
964
+ * Creates a custom link type that is added to the chart on committal.
965
+ *
966
+ * @param typeTemplate - The data for creating the custom link type.
967
+ * @returns The new, pending item type.
968
+ * @i2since 1.6
969
+ */
970
+ addLinkType(typeTemplate: schema.IChartLinkTypeData): schema.IPendingItemType;
971
+ /**
972
+ * Gets an object with methods for editing a schema or custom item type.
973
+ *
974
+ * @param itemType - The item type to be edited.
975
+ * @returns The type-editing object.
976
+ * @i2since 1.6
977
+ */
978
+ editItemType(itemType: schema.ItemTypeSpecifier): schema.IItemTypeEditor | schema.IPropertyTypeFactory;
955
979
  }
956
980
  /**
957
981
  * A collection of elements and records that together represent a selection on the chart surface.
@@ -3559,7 +3583,7 @@ export declare interface NotebookStatic {
3559
3583
  * @public
3560
3584
  * @i2since 1.0
3561
3585
  */
3562
- getEntryPointApi(pluginId: string, apiVersion: '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5'): Promise<IEntryPointApi>;
3586
+ getEntryPointApi(pluginId: string, apiVersion: '1.0' | '1.1' | '1.2' | '1.3' | '1.4' | '1.5' | '1.6'): Promise<IEntryPointApi>;
3563
3587
  }
3564
3588
 
3565
3589
  /**
@@ -4040,6 +4064,11 @@ export declare namespace schema {
4040
4064
  * @i2since 1.0
4041
4065
  */
4042
4066
  readonly sourceIdentifiersSchema: ISourceIdentifiersSchema;
4067
+ /**
4068
+ * Gets the maximum length for the names of custom types.
4069
+ * @i2since 1.6
4070
+ */
4071
+ readonly maxCustomTypeNameLength: data.ICharLimit;
4043
4072
  }
4044
4073
  /**
4045
4074
  * A schema for source identifiers, which places constraints on their use.
@@ -4270,6 +4299,11 @@ export declare namespace schema {
4270
4299
  * @i2since 1.1
4271
4300
  */
4272
4301
  readonly isInfoStore: boolean;
4302
+ /**
4303
+ * Indicates whether the item type is a custom type.
4304
+ * @i2since 1.6
4305
+ */
4306
+ readonly isCustom: boolean;
4273
4307
  /**
4274
4308
  * Gets the label definition for the item type, which describes how record labels are formed.
4275
4309
  * @i2since 1.0
@@ -4307,18 +4341,217 @@ export declare namespace schema {
4307
4341
  */
4308
4342
  readonly name?: string;
4309
4343
  }
4344
+ /**
4345
+ * A set of data that is common to creating all custom item types.
4346
+ * @i2since 1.6
4347
+ */
4348
+ export interface IChartItemTypeDataBase {
4349
+ /**
4350
+ * Gets the display name for the custom item type.
4351
+ * @i2since 1.6
4352
+ */
4353
+ readonly displayName: string;
4354
+ /**
4355
+ * Gets the property types for the custom item type.
4356
+ * @i2since 1.6
4357
+ */
4358
+ readonly propertyTypes?: Iterable<IPropertyTypeData>;
4359
+ /**
4360
+ * Gets the label definition for the custom item type.
4361
+ * @i2since 1.6
4362
+ */
4363
+ readonly labelDefinition?: Iterable<ILabelPartData>;
4364
+ }
4365
+ /**
4366
+ * A set of data for creating a custom entity type.
4367
+ * @i2since 1.6
4368
+ */
4369
+ export interface IChartEntityTypeData extends IChartItemTypeDataBase {
4370
+ /**
4371
+ * Gets the name of the icon for the custom entity type.
4372
+ * @i2since 1.6
4373
+ */
4374
+ readonly icon: string;
4375
+ }
4376
+ /**
4377
+ * A set of data for creating a custom link type.
4378
+ * @i2since 1.6
4379
+ */
4380
+ export interface IChartLinkTypeData extends IChartItemTypeDataBase {
4381
+ }
4382
+ /**
4383
+ * A set of data for creating a label definition.
4384
+ * @i2since 1.6
4385
+ */
4386
+ export type ILabelPartData = ILiteralLabelPart | IChartPropertyLabelPart | IPendingPropertyLabelPart;
4387
+ /**
4388
+ * A part of a label that consists of a pending custom property type.
4389
+ * @i2since 1.6
4390
+ */
4391
+ export interface IPendingPropertyLabelPart {
4392
+ /**
4393
+ * Gets the type of the property whose value is used for the label part.
4394
+ * @i2since 1.6
4395
+ */
4396
+ readonly propertyType: IPendingPropertyType;
4397
+ /**
4398
+ * Gets the type of label part.
4399
+ * @i2since 1.6
4400
+ */
4401
+ readonly type: 'chartProperty';
4402
+ }
4403
+ /**
4404
+ * A set of data for creating a custom property type.
4405
+ * @i2since 1.6
4406
+ */
4407
+ export interface IPropertyTypeData {
4408
+ /**
4409
+ * Gets the display name of the custom property type.
4410
+ * @i2since 1.6
4411
+ */
4412
+ readonly displayName: string;
4413
+ /**
4414
+ * Gets the logical type of the custom property type.
4415
+ * @i2since 1.6
4416
+ */
4417
+ readonly logicalType: CustomLogicalType;
4418
+ }
4419
+ /**
4420
+ * An item type that has been created in a transaction handler, but has not yet been added to a chart's schema.
4421
+ * @i2since 1.6
4422
+ */
4423
+ export interface IPendingItemType extends IItemTypeEditor {
4424
+ /**
4425
+ * Gets the identifier of the item type.
4426
+ * @i2since 1.6
4427
+ */
4428
+ readonly typeId: AnalyzeItemTypeId;
4429
+ }
4430
+ /**
4431
+ * A set of methods for modifying a custom item type.
4432
+ * @i2since 1.6
4433
+ */
4434
+ export interface IItemTypeEditor extends IPropertyTypeFactory {
4435
+ /**
4436
+ * Indicates that the item type is a custom type.
4437
+ * @i2since 1.6
4438
+ */
4439
+ readonly isCustomType: true;
4440
+ /**
4441
+ * Sets the display name of the item type.
4442
+ *
4443
+ * @param displayName - The display name to set.
4444
+ * @returns This item type, with the new display name in place.
4445
+ * @i2since 1.6
4446
+ */
4447
+ setDisplayName(displayName: string): this;
4448
+ /**
4449
+ * Sets the label definition of the item type.
4450
+ *
4451
+ * @param labelDefinition - The label definition to set.
4452
+ * @returns This item type, with the new label definition in place.
4453
+ * @i2since 1.6
4454
+ */
4455
+ setLabelDefinition(labelDefinition: Iterable<ILabelPartData>): this;
4456
+ }
4457
+ /**
4458
+ * A set of methods for adding and editing custom property types on schema and custom item types.
4459
+ * @i2since 1.6
4460
+ */
4461
+ export interface IPropertyTypeFactory {
4462
+ /**
4463
+ * Indicates whether the item type is a custom type.
4464
+ * @i2since 1.6
4465
+ */
4466
+ isCustomType: boolean;
4467
+ /**
4468
+ * Creates a custom property type that is added to the chart schema on committal.
4469
+ *
4470
+ * @param propertyTypeTemplate - The data for creating the custom property type.
4471
+ * @param insertAfter - The position of the new property type. If this is not provided, the new property type is added at the end of the list.
4472
+ * @returns The new, pending property type.
4473
+ * @i2since 1.6
4474
+ */
4475
+ addPropertyType(propertyTypeTemplate: IPropertyTypeData, insertAfter?: CustomPropertyTypeSpecifier): IPendingPropertyType;
4476
+ /**
4477
+ * Gets an object with methods for editing a custom property type.
4478
+ *
4479
+ * @param propertyType - The custom property type to be edited.
4480
+ * @returns The type-editing object.
4481
+ * @i2since 1.6
4482
+ */
4483
+ editPropertyType(propertyType: CustomPropertyTypeSpecifier): IPropertyTypeEditor;
4484
+ /**
4485
+ * Gets an object with methods for editing a custom property type.
4486
+ *
4487
+ * @param typeId - The identifier of the property type to be edited.
4488
+ * @param logicalType - The logical type of the property type to be edited.
4489
+ * @returns The type-editing object.
4490
+ * @i2since 1.6
4491
+ */
4492
+ editPropertyType(typeId: AnalyzePropertyTypeId, logicalType: CustomLogicalType): IPropertyTypeEditor;
4493
+ }
4494
+ /**
4495
+ * A common specifier for a custom property type.
4496
+ * @i2since 1.6
4497
+ */
4498
+ export type CustomPropertyTypeSpecifier = IChartPropertyType | IPendingPropertyType;
4499
+ /**
4500
+ * A custom property type that has been created in a transaction handler, but has not yet been added to a chart schema.
4501
+ * @i2since 1.6
4502
+ */
4503
+ export interface IPendingPropertyType extends IPropertyTypeEditor {
4504
+ /**
4505
+ * Gets or sets the identifier of the property type.
4506
+ * @i2since 1.6
4507
+ */
4508
+ typeId: AnalyzePropertyTypeId;
4509
+ /**
4510
+ * Gets or sets the logical type of the property type.
4511
+ * @i2since 1.6
4512
+ */
4513
+ logicalType: CustomLogicalType;
4514
+ }
4515
+ /**
4516
+ * A set of methods for modifying a custom property type.
4517
+ * @i2since 1.6
4518
+ */
4519
+ export interface IPropertyTypeEditor {
4520
+ /**
4521
+ * Sets the display name of the property type.
4522
+ *
4523
+ * @param displayName - The display name to set.
4524
+ * @returns This property type, with the new display name in place.
4525
+ * @i2since 1.6
4526
+ */
4527
+ setDisplayName(displayName: string): this;
4528
+ /**
4529
+ * Moves the property type after the specified property type.
4530
+ *
4531
+ * @param propertyType - The property type that serves as the reference for positioning. Null moves the property type to the beginning of the list.
4532
+ * @returns This property type editor, with the edited properties in place.
4533
+ * @i2since 1.6
4534
+ */
4535
+ moveAfter(propertyType: CustomPropertyTypeSpecifier | null): this;
4536
+ }
4310
4537
  /**
4311
4538
  * The type of a schema.
4312
4539
  * @i2since 1.5
4313
4540
  *
4314
4541
  * @remarks
4315
4542
  * The possible values are:
4316
- * - `infostore`: The Information Store schema.
4317
- * - `gateway`: A gateway schema.
4318
- * - `connector`: A connector schema.
4319
- * - `unknown`: An unknown schema, which can denote an orphaned item type.
4543
+ * `infostore` - The Information Store schema.
4544
+ * `gateway` - A gateway schema.
4545
+ * `connector` - A connector schema.
4546
+ * `unknown` - An unknown schema, which can denote an orphaned item type.
4547
+ * `custom` - A schema that contains user-created types.
4548
+ */
4549
+ export type SchemaType = 'infostore' | 'gateway' | 'connector' | 'unknown' | 'custom';
4550
+ /**
4551
+ * A common specifier for an item type.
4552
+ * @i2since 1.6
4320
4553
  */
4321
- export type SchemaType = 'infostore' | 'gateway' | 'connector' | 'unknown';
4554
+ export type ItemTypeSpecifier = AnalyzeItemTypeId | IChartItemType | IPendingItemType;
4322
4555
  /**
4323
4556
  * An identifier of a property type in a chart schema.
4324
4557
  * @i2since 1.0
@@ -4379,6 +4612,11 @@ export declare namespace schema {
4379
4612
  * @i2since 1.0
4380
4613
  */
4381
4614
  readonly isOrphaned: boolean;
4615
+ /**
4616
+ * Indicates whether the property type is a custom type.
4617
+ * @i2since 1.6
4618
+ */
4619
+ readonly isCustomType: boolean;
4382
4620
  /**
4383
4621
  * Gets the maximum string length for the value of a property that has the property type.
4384
4622
  *
@@ -4423,6 +4661,11 @@ export declare namespace schema {
4423
4661
  */
4424
4662
  readonly description?: string;
4425
4663
  }
4664
+ /**
4665
+ * A logical type for the value of a custom record property.
4666
+ * @i2since 1.6
4667
+ */
4668
+ export type CustomLogicalType = Omit<data.LogicalType, 'selectedFromList' | 'suggestedFromList'>;
4426
4669
  /**
4427
4670
  * A schema for notes, which places constraints on their use.
4428
4671
  * @i2since 1.0
@@ -4585,6 +4828,11 @@ export declare namespace schema {
4585
4828
  * @i2since 1.5
4586
4829
  */
4587
4830
  readonly changedTypes: data.IReadOnlyCollection<IChartItemType>;
4831
+ /**
4832
+ * Gets the identifiers of the item types that were removed from the schema.
4833
+ * @i2since 1.6
4834
+ */
4835
+ readonly removedTypes: data.IReadOnlyCollection<ChartItemTypeId>;
4588
4836
  }
4589
4837
  }
4590
4838
 
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * i2, i2 Group, the i2 Group logo, and i2group.com are trademarks of N.Harris Computer Corporation.
3
3
  * © N.Harris Computer Corporation (2022)
4
4
  */
5
- const apiVersion = '1.5';
5
+ const apiVersion = '1.6';
6
6
  /**
7
7
  * Retrieves the plug-in entry point API.
8
8
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i2analyze/notebook-sdk",
3
- "version": "1.5.1-dev.0",
3
+ "version": "1.6.0-dev.10",
4
4
  "description": "i2 Notebook SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {