@itwin/core-common 5.0.0-dev.37 → 5.0.0-dev.39

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ElementProps.d.ts","sourceRoot":"","sources":["../../src/ElementProps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAQ,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EACzH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,EAAE,EAAE,UAAU,CAAC;IACf,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,wGAAwG;IACxG,KAAK,EAAE,UAAU,CAAC;IAClB,yEAAyE;IACzE,IAAI,EAAE,SAAS,CAAC;IAChB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uHAAuH;IACvH,cAAc,CAAC,EAA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MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,YAAY;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;EAEE;AACF,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,0FAA0F;IAC1F,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,2EAA2E;IAC3E,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,iEAAiE;IACjE,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B"}
@@ -30,7 +30,7 @@ class RelatedElement {
30
30
  if ((typeof json === "object") && ("id" in json)) {
31
31
  const r = RelatedElement.fromJSON(json);
32
32
  if (r === undefined)
33
- throw new IModelError_1.IModelError(IModelError_1.IModelStatus.BadArg, "Problem parsing Id64 from json");
33
+ throw new IModelError_1.IModelError(core_bentley_1.IModelStatus.BadArg, "Problem parsing Id64 from json");
34
34
  return r.id;
35
35
  }
36
36
  return core_bentley_1.Id64.fromJSON(json);
@@ -1 +1 @@
1
- {"version":3,"file":"ElementProps.js","sourceRoot":"","sources":["../../src/ElementProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA4IH,gDAEC;AAKD,gDAEC;AAnJD,sDAAmE;AAQnE,+CAA0D;AAqC1D;;GAEG;AACH,MAAa,cAAc;IAOzB,YAAY,KAA0B;QACpC,IAAI,CAAC,EAAE,GAAG,mBAA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;;;GAGG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,iDAAU,CAAA;IACV,uDAAa,CAAA;IACb,6CAAQ,CAAA;AACV,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAmRD;;GAEG;AACH,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,gEAAgE;IAChE,mGAAkB,CAAA;IAClB,0EAA0E;IAC1E,6FAAe,CAAA;AACjB,CAAC,EALW,4BAA4B,4CAA5B,4BAA4B,QAKvC;AAyCD;;;GAGG;AACH,IAAY,IASX;AATD,WAAY,IAAI;IACd,gDAAgD;IAChD,mCAAU,CAAA;IACV,4GAA4G;IAC5G,mCAAU,CAAA;IACV,6HAA6H;IAC7H,6CAAe,CAAA;IACf,mIAAmI;IACnI,+BAAQ,CAAA;AACV,CAAC,EATW,IAAI,oBAAJ,IAAI,QASf","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Entities\n */\n\nimport { GuidString, Id64, Id64String } from \"@itwin/core-bentley\";\nimport {\n AngleProps, ClipVectorProps, LowAndHighXYProps, LowAndHighXYZProps, TransformProps, XYProps, XYZProps, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { CodeProps } from \"./Code\";\nimport { EntityProps } from \"./EntityProps\";\nimport { ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart } from \"./geometry/ElementGeometry\";\nimport { GeometryStreamProps } from \"./geometry/GeometryStream\";\nimport { IModelError, IModelStatus } from \"./IModelError\";\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\nimport { TextAnnotationProps } from \"./annotation/TextAnnotation\";\n\n/** Properties of a NavigationProperty.\n * @public\n * @extensions\n */\nexport interface RelatedElementProps {\n /** The Id of the element to which this element is related. */\n id: Id64String;\n /** The full className of the relationship class. */\n relClassName?: string;\n}\n\n/** Properties of an [Element]($docs/bis/guide/fundamentals/element-fundamentals)\n * @public\n * @extensions\n */\nexport interface ElementProps extends EntityProps {\n /** The Id of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\n model: Id64String;\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\n code: CodeProps;\n /** The Parent of this element, if defined. */\n parent?: RelatedElementProps;\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element.\n * @note On insert, if this is a valid Guid, the value is preserved. If it is `undefined`, a new Guid is created. If it is an invalid Guid (e.g. Guid.empty), the\n * resultant element will have a `null` federationGuid. For update, `undefined` means \"don't change.\"\n */\n federationGuid?: GuidString;\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\n userLabel?: string;\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\n jsonProperties?: any;\n}\n\n/** The Id and relationship class of an Element that is somehow related to another Element\n * @public\n */\nexport class RelatedElement implements RelatedElementProps {\n /** The Id of the element to which this element is related. */\n public readonly id: Id64String;\n\n /** The full className of the relationship class. */\n public readonly relClassName?: string;\n\n constructor(props: RelatedElementProps) {\n this.id = Id64.fromJSON(props.id);\n this.relClassName = props.relClassName;\n }\n\n public static fromJSON(json?: RelatedElementProps): RelatedElement | undefined {\n return json ? new RelatedElement(json) : undefined;\n }\n\n /** Used to *null out* an existing navigation relationship. */\n public static readonly none = new RelatedElement({ id: Id64.invalid });\n\n /** Accept the value of a navigation property that might be in the shortened format of just an id or might be in the full RelatedElement format. */\n public static idFromJson(json: any): Id64String {\n if ((typeof json === \"object\") && (\"id\" in json)) {\n const r = RelatedElement.fromJSON(json);\n if (r === undefined)\n throw new IModelError(IModelStatus.BadArg, \"Problem parsing Id64 from json\");\n return r.id;\n }\n return Id64.fromJSON(json);\n }\n\n public toJSON(): RelatedElementProps {\n return {\n id: this.id,\n relClassName: this.relClassName,\n };\n }\n}\n\n/** A [RelatedElement]($common) relationship that describes the [TypeDefinitionElement]($backend) of an element.\n * @public\n */\nexport class TypeDefinition extends RelatedElement {\n}\n\n/** Properties of a [GeometricElement]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElementProps extends ElementProps {\n /** The id of the category for this geometric element. */\n category: Id64String;\n /** The geometry stream properties */\n geom?: GeometryStreamProps;\n /** Describes how to build the element's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent element.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParams;\n /** The placement properties */\n placement?: PlacementProps;\n}\n\n/** Properties of a [[Placement3d]]\n * @public\n * @extensions\n */\nexport interface Placement3dProps {\n origin: XYZProps;\n angles: YawPitchRollProps;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties of a [[Placement2d]]\n * @public\n * @extensions\n */\nexport interface Placement2dProps {\n origin: XYProps;\n angle: AngleProps;\n bbox?: LowAndHighXYProps;\n}\n\n/**\n * @public\n * @extensions\n */\nexport type PlacementProps = Placement2dProps | Placement3dProps;\n\n/** determine if this is Placement2dProps\n * @public\n */\nexport function isPlacement2dProps(props: PlacementProps): props is Placement2dProps {\n return (props as Placement2dProps).angle !== undefined;\n}\n\n/** determine if this is Placement3dProps\n * @public\n */\nexport function isPlacement3dProps(props: PlacementProps): props is Placement3dProps {\n return !isPlacement2dProps(props);\n}\n\n/** Properties that define a [GeometricElement3d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement3dProps extends GeometricElementProps {\n placement?: Placement3dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation3d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation3dProps extends GeometricElement3dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties that define a [PhysicalElement]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalElementProps extends GeometricElement3dProps {\n physicalMaterial?: RelatedElementProps;\n}\n\n/** An enumeration of the different types of [SectionDrawing]($backend)s.\n * @public\n * @extensions\n */\nexport enum SectionType {\n Section = 3,\n Detail = 4,\n Elevation = 5,\n Plan = 6,\n}\n\n/** Properties that define a [SectionDrawing]($backend).\n * @public\n * @extensions\n */\nexport interface SectionDrawingProps extends ElementProps {\n /** The type of section used to generate the drawing. Default: Section. */\n sectionType?: SectionType;\n /** The spatial view from which the section was generated. */\n spatialView?: RelatedElementProps;\n jsonProperties?: {\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\n drawingToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), a transform from the sheet's coordinates to spatial coordinates. */\n sheetToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), JSON representation of a [ClipVector]($geometry) to apply to\n * the sheet graphics when drawn in the context of the spatial view.\n * The ClipVector is in spatial coordinates.\n */\n drawingBoundaryClip?: ClipVectorProps;\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\n displaySpatialView?: true;\n };\n}\n\n/** Properties that define a [SectionDrawingLocation]($backend)\n * @public\n * @extensions\n */\nexport interface SectionDrawingLocationProps extends GeometricElement3dProps {\n /** The [ViewDefinition]($backend) to which this location refers. */\n sectionView?: RelatedElementProps;\n}\n\n/** Properties that define a [GeometricElement2d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement2dProps extends GeometricElementProps {\n placement?: Placement2dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation2d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation2dProps extends GeometricElement2dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties of a [GeometryPart]($backend)\n * @public\n * @extensions\n */\nexport interface GeometryPartProps extends ElementProps {\n geom?: GeometryStreamProps;\n /** Describes how to build the part's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent part.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties for a [ViewAttachment]($backend)\n * @public\n * @extensions\n */\nexport interface ViewAttachmentProps extends GeometricElement2dProps {\n view: RelatedElementProps;\n jsonProperties?: {\n /** Integer priority in [-500,500]. Where two attachments overlap, the one with the higher priority draws in front of the other. Default: 0. */\n displayPriority?: number;\n /** JSON representation of a [ClipVector]($core-geometry] in sheet coordinate space, used to clip the attachment's graphics on the sheet. */\n clip?: ClipVectorProps;\n /** Options for customizing how the view attachment is displayed on the sheet. */\n displayOptions?: {\n /** If true, the view attachment is always drawn as a raster image. By default, only 3d perspective views are drawn this way (they always *must* be). Default: false. */\n drawAsRaster?: boolean;\n /** If true, and the view attachment is drawn as a raster image, the background color of the view will be preserved. By default the background color of the\n * sheet is used and any background pixels become transparent, allowing the contents of the sheet to show through. Default: false.\n */\n preserveBackground?: boolean;\n };\n };\n}\n\n/** Properties of a [Subject]($backend)\n * @public\n * @extensions\n */\nexport interface SubjectProps extends ElementProps {\n description?: string;\n}\n\n/** Properties of a [SheetBorderTemplate]($backend)\n * @beta\n */\nexport interface SheetBorderTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n}\n\n/** Properties of a [SheetTemplate]($backend)\n * @beta\n */\nexport interface SheetTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n border?: Id64String;\n}\n\n/** Properties of a [Sheet]($backend).\n * @public\n * @extensions\n */\nexport interface SheetProps extends ElementProps {\n width?: number;\n height?: number;\n scale?: number;\n sheetTemplate?: Id64String;\n attachments?: Id64String[];\n}\n\n/** Properties of a [DefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface DefinitionElementProps extends ElementProps {\n isPrivate?: boolean;\n}\n\n/** Properties of a [TypeDefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface TypeDefinitionElementProps extends DefinitionElementProps {\n recipe?: RelatedElementProps;\n}\n\n/** Properties of a [PhysicalType]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalTypeProps extends TypeDefinitionElementProps {\n /** The [PhysicalMaterial]($backend) that makes up this physical type. */\n physicalMaterial?: RelatedElementProps;\n}\n\n/** Properties of a [InformationPartitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface InformationPartitionElementProps extends ElementProps {\n description?: string;\n}\n\n/** Options controlling which properties are included or excluded when querying [[DisplayStyleProps]].\n * @see [[ViewStateLoadProps]] and [[ElementLoadOptions]].\n * @public\n * @extensions\n */\nexport interface DisplayStyleLoadProps {\n /** If true, the lists of element Ids in the display style's schedule script will be empty.\n * The element Ids are not required on the frontend for display and can be quite large.\n */\n omitScheduleScriptElementIds?: boolean;\n /** If true, [[DisplayStyleSettingsProps.excludedElements]] will be compressed into a single compact string; otherwise they will be expanded into an array of strings.\n * The number of Ids may be quite large, so the compressed format is preferred, especially when communicating between the backend and frontend.\n */\n compressExcludedElementIds?: boolean;\n}\n\n/** Options controlling which properties are included or excluded when querying [[RenderTimelineProps]].\n * @see [[ElementLoadOptions.renderTimeline]].\n * @public\n * @extensions\n */\nexport interface RenderTimelineLoadProps {\n /** If true, the lists of element Ids in the schedule script will be empty.\n * The element Ids can be extremely numerous and are not required on the frontend for display, so they are omitted by default by [DisplayStyleState.load]($frontend).\n */\n omitScriptElementIds?: boolean;\n}\n\n/** Options used to specify properties to include or exclude when querying [[ElementProps]] with functions like\n * [IModelDb.Elements.getElementProps]($backend) and [IModelConnection.Elements.loadProps]($frontend).\n * @public\n * @extensions\n */\nexport interface ElementLoadOptions {\n /** if true, only load the members of [[ElementProps]], and no members from subclasses */\n onlyBaseProperties?: boolean;\n /** If true, include the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * Geometry streams can consist of many megabytes worth of JSON, so they are omitted by default.\n */\n wantGeometry?: boolean;\n /** When including a geometry stream containing brep entries, whether to return the raw brep data or proxy geometry, false when undefined */\n /** If true, include [[BRepEntity.DataProps.data]] in the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * The data is a potentially large base-64-encoded opaque binary blob that cannot be directly inspected or manipulated on the frontend, so it is omitted by default.\n */\n wantBRepData?: boolean;\n /** Options controlling which properties of [[DisplayStyleProps]] to include or exclude. */\n displayStyle?: DisplayStyleLoadProps;\n /** Options controlling which properties of [[RenderTimelineProps]] to include or exclude. */\n renderTimeline?: RenderTimelineLoadProps;\n}\n\n/** Parameters to specify what element to load for functions like [IModelDb.Elements.getElementProps]($backend).\n * @public\n * @extensions\n */\nexport interface ElementLoadProps extends ElementLoadOptions {\n id?: Id64String;\n /** The properties of the Code of the element to load.\n * @note the Value member is required even though it is not declared so here. If no value is supplied, no element will ever be loaded.\n * TODO: change to Required<CodeProps> in Version 4.0\n */\n code?: CodeProps;\n federationGuid?: GuidString;\n}\n\n/** Properties of an [ElementAspect]($backend)\n * @public\n * @extensions\n */\nexport interface ElementAspectProps extends EntityProps {\n element: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSourceAspect]($backend) that stores synchronization information for an element originating from an external source.\n * @public\n * @extensions\n */\nexport interface ExternalSourceAspectProps extends ElementAspectProps {\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n scope: RelatedElementProps;\n /** The identifier of the object in the source repository. */\n identifier: string;\n /** The kind of object within the source repository. */\n kind: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n version?: string;\n /** The optional cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n checksum?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: if defined, jsonProperties must be a *string*, specifically a valid JSON string.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n jsonProperties?: any;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n source?: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSource]($backend)\n * @beta\n */\nexport interface ExternalSourceProps extends ElementProps {\n repository?: RelatedElementProps;\n connectorName?: string;\n connectorVersion?: string;\n}\n\n/** The role that an attached [ExternalSource]($backend) plays.\n * @beta\n */\nexport enum ExternalSourceAttachmentRole {\n /** The attached [ExternalSource]($backend) provides context. */\n SpecifyContext = 0,\n /** The attached [ExternalSource]($backend) models a part of the whole. */\n SpecifyPart = 1,\n}\n\n/** Properties of an [ExternalSourceAttachment]($backend)\n * @beta\n */\nexport interface ExternalSourceAttachmentProps extends ElementProps {\n attaches?: RelatedElementProps;\n role?: ExternalSourceAttachmentRole;\n translation?: XYZProps;\n yaw?: number;\n pitch?: number;\n roll?: number;\n scale?: XYZProps;\n}\n\n/** Properties of an [ChannelRootAspect]($backend) that identifies an Element as the root of a *channel* which is a subset of the overall iModel hierarchy that is independently maintained.\n * @public\n * @extensions\n */\nexport interface ChannelRootAspectProps extends ElementAspectProps {\n /** The owner of the channel */\n owner: string;\n}\n\n/** Properties of a [LineStyle]($backend)\n * @public\n * @extensions\n */\nexport interface LineStyleProps extends DefinitionElementProps {\n description?: string;\n /** The JSON string line style definition element data [LineStyleDefinition.StyleProps]($backend) */\n data: string;\n}\n\n/** Properties of a [LightLocation]($backend)\n * @internal\n */\nexport interface LightLocationProps extends GeometricElement3dProps {\n enabled?: boolean;\n}\n\n/** The *rank* for a Category\n * @public\n * @extensions\n */\nexport enum Rank {\n /** This category is predefined by the system */\n System = 0,\n /** This category is defined by a schema. Elements in this category are not recognized by system classes. */\n Domain = 1,\n /** This category is defined by an application. Elements in this category are not recognized by system and schema classes. */\n Application = 2,\n /** This category is defined by a user. Elements in this category are not recognized by system, schema, and application classes. */\n User = 3,\n}\n\n/** Parameters of a [Category]($backend)\n * @public\n * @extensions\n */\nexport interface CategoryProps extends DefinitionElementProps {\n rank?: Rank;\n description?: string;\n}\n\n/** Parameters of a [SubCategory]($backend)\n * @public\n * @extensions\n */\nexport interface SubCategoryProps extends DefinitionElementProps {\n appearance?: SubCategoryAppearance.Props;\n description?: string;\n}\n\n/** Parameters of a [UrlLink]($backend)\n * @public\n * @extensions\n */\nexport interface UrlLinkProps extends ElementProps {\n description?: string;\n url?: string;\n}\n\n/** Parameters of a [RepositoryLink]($backend)\n * @public\n * @extensions\n */\nexport interface RepositoryLinkProps extends UrlLinkProps {\n repositoryGuid?: GuidString;\n format?: string;\n}\n\n/** The properties of a [SynchronizationConfigLink]($backend)\n * @beta\n */\nexport interface SynchronizationConfigLinkProps extends UrlLinkProps {\n lastSuccessfulRun?: string;\n}\n\n/** Wire format describing a [RenderTimeline]($backend).\n * @public\n * @extensions\n */\nexport interface RenderTimelineProps extends ElementProps {\n /** An optional human-readable description of the timeline. */\n description?: string;\n /** The stringified JSON representation of the instructions for visualizing change over time.\n * @see [[RenderSchedule.ScriptProps]] for the JSON interface.\n */\n script: string;\n}\n\n/** Properties of a [SheetIndexEntry]($backend).\n * @beta\n*/\nexport interface SheetIndexEntryProps extends ElementProps {\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\n entryPriority: number;\n}\n\n/** Properties of a [SheetIndexFolder]($backend)\n * @beta\n */\nexport type SheetIndexFolderProps = SheetIndexEntryProps;\n\n/** Properties of a [SheetIndexReference]($backend)\n * @beta\n */\nexport interface SheetIndexReferenceProps extends SheetIndexEntryProps {\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\n sheetIndex?: RelatedElementProps;\n}\n\n/** Properties of a [SheetReference]($backend)\n * @beta\n */\nexport interface SheetReferenceProps extends SheetIndexEntryProps {\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\n sheet?: RelatedElementProps;\n}\n"]}
1
+ {"version":3,"file":"ElementProps.js","sourceRoot":"","sources":["../../src/ElementProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA4IH,gDAEC;AAKD,gDAEC;AAnJD,sDAAiF;AAQjF,+CAA4C;AAqC5C;;GAEG;AACH,MAAa,cAAc;IAOzB,YAAY,KAA0B;QACpC,IAAI,CAAC,EAAE,GAAG,mBAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACzC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA0B;QAC/C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,CAAC;IAED,8DAA8D;aACvC,SAAI,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,EAAE,mBAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAEvE,mJAAmJ;IAC5I,MAAM,CAAC,UAAU,CAAC,IAAS;QAChC,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YACjD,MAAM,CAAC,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,SAAS;gBACjB,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;YAC/E,OAAO,CAAC,CAAC,EAAE,CAAC;QACd,CAAC;QACD,OAAO,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAEM,MAAM;QACX,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC;IACJ,CAAC;;AAnCH,wCAoCC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,cAAc;CACjD;AADD,wCACC;AA6CD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,OAAQ,KAA0B,CAAC,KAAK,KAAK,SAAS,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AA+BD;;;GAGG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,iDAAU,CAAA;IACV,uDAAa,CAAA;IACb,6CAAQ,CAAA;AACV,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAmRD;;GAEG;AACH,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,gEAAgE;IAChE,mGAAkB,CAAA;IAClB,0EAA0E;IAC1E,6FAAe,CAAA;AACjB,CAAC,EALW,4BAA4B,4CAA5B,4BAA4B,QAKvC;AAyCD;;;GAGG;AACH,IAAY,IASX;AATD,WAAY,IAAI;IACd,gDAAgD;IAChD,mCAAU,CAAA;IACV,4GAA4G;IAC5G,mCAAU,CAAA;IACV,6HAA6H;IAC7H,6CAAe,CAAA;IACf,mIAAmI;IACnI,+BAAQ,CAAA;AACV,CAAC,EATW,IAAI,oBAAJ,IAAI,QASf","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Entities\n */\n\nimport { GuidString, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n AngleProps, ClipVectorProps, LowAndHighXYProps, LowAndHighXYZProps, TransformProps, XYProps, XYZProps, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { CodeProps } from \"./Code\";\nimport { EntityProps } from \"./EntityProps\";\nimport { ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart } from \"./geometry/ElementGeometry\";\nimport { GeometryStreamProps } from \"./geometry/GeometryStream\";\nimport { IModelError } from \"./IModelError\";\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\nimport { TextAnnotationProps } from \"./annotation/TextAnnotation\";\n\n/** Properties of a NavigationProperty.\n * @public\n * @extensions\n */\nexport interface RelatedElementProps {\n /** The Id of the element to which this element is related. */\n id: Id64String;\n /** The full className of the relationship class. */\n relClassName?: string;\n}\n\n/** Properties of an [Element]($docs/bis/guide/fundamentals/element-fundamentals)\n * @public\n * @extensions\n */\nexport interface ElementProps extends EntityProps {\n /** The Id of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\n model: Id64String;\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\n code: CodeProps;\n /** The Parent of this element, if defined. */\n parent?: RelatedElementProps;\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element.\n * @note On insert, if this is a valid Guid, the value is preserved. If it is `undefined`, a new Guid is created. If it is an invalid Guid (e.g. Guid.empty), the\n * resultant element will have a `null` federationGuid. For update, `undefined` means \"don't change.\"\n */\n federationGuid?: GuidString;\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\n userLabel?: string;\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\n jsonProperties?: any;\n}\n\n/** The Id and relationship class of an Element that is somehow related to another Element\n * @public\n */\nexport class RelatedElement implements RelatedElementProps {\n /** The Id of the element to which this element is related. */\n public readonly id: Id64String;\n\n /** The full className of the relationship class. */\n public readonly relClassName?: string;\n\n constructor(props: RelatedElementProps) {\n this.id = Id64.fromJSON(props.id);\n this.relClassName = props.relClassName;\n }\n\n public static fromJSON(json?: RelatedElementProps): RelatedElement | undefined {\n return json ? new RelatedElement(json) : undefined;\n }\n\n /** Used to *null out* an existing navigation relationship. */\n public static readonly none = new RelatedElement({ id: Id64.invalid });\n\n /** Accept the value of a navigation property that might be in the shortened format of just an id or might be in the full RelatedElement format. */\n public static idFromJson(json: any): Id64String {\n if ((typeof json === \"object\") && (\"id\" in json)) {\n const r = RelatedElement.fromJSON(json);\n if (r === undefined)\n throw new IModelError(IModelStatus.BadArg, \"Problem parsing Id64 from json\");\n return r.id;\n }\n return Id64.fromJSON(json);\n }\n\n public toJSON(): RelatedElementProps {\n return {\n id: this.id,\n relClassName: this.relClassName,\n };\n }\n}\n\n/** A [RelatedElement]($common) relationship that describes the [TypeDefinitionElement]($backend) of an element.\n * @public\n */\nexport class TypeDefinition extends RelatedElement {\n}\n\n/** Properties of a [GeometricElement]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElementProps extends ElementProps {\n /** The id of the category for this geometric element. */\n category: Id64String;\n /** The geometry stream properties */\n geom?: GeometryStreamProps;\n /** Describes how to build the element's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent element.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParams;\n /** The placement properties */\n placement?: PlacementProps;\n}\n\n/** Properties of a [[Placement3d]]\n * @public\n * @extensions\n */\nexport interface Placement3dProps {\n origin: XYZProps;\n angles: YawPitchRollProps;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties of a [[Placement2d]]\n * @public\n * @extensions\n */\nexport interface Placement2dProps {\n origin: XYProps;\n angle: AngleProps;\n bbox?: LowAndHighXYProps;\n}\n\n/**\n * @public\n * @extensions\n */\nexport type PlacementProps = Placement2dProps | Placement3dProps;\n\n/** determine if this is Placement2dProps\n * @public\n */\nexport function isPlacement2dProps(props: PlacementProps): props is Placement2dProps {\n return (props as Placement2dProps).angle !== undefined;\n}\n\n/** determine if this is Placement3dProps\n * @public\n */\nexport function isPlacement3dProps(props: PlacementProps): props is Placement3dProps {\n return !isPlacement2dProps(props);\n}\n\n/** Properties that define a [GeometricElement3d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement3dProps extends GeometricElementProps {\n placement?: Placement3dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation3d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation3dProps extends GeometricElement3dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties that define a [PhysicalElement]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalElementProps extends GeometricElement3dProps {\n physicalMaterial?: RelatedElementProps;\n}\n\n/** An enumeration of the different types of [SectionDrawing]($backend)s.\n * @public\n * @extensions\n */\nexport enum SectionType {\n Section = 3,\n Detail = 4,\n Elevation = 5,\n Plan = 6,\n}\n\n/** Properties that define a [SectionDrawing]($backend).\n * @public\n * @extensions\n */\nexport interface SectionDrawingProps extends ElementProps {\n /** The type of section used to generate the drawing. Default: Section. */\n sectionType?: SectionType;\n /** The spatial view from which the section was generated. */\n spatialView?: RelatedElementProps;\n jsonProperties?: {\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\n drawingToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), a transform from the sheet's coordinates to spatial coordinates. */\n sheetToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), JSON representation of a [ClipVector]($geometry) to apply to\n * the sheet graphics when drawn in the context of the spatial view.\n * The ClipVector is in spatial coordinates.\n */\n drawingBoundaryClip?: ClipVectorProps;\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\n displaySpatialView?: true;\n };\n}\n\n/** Properties that define a [SectionDrawingLocation]($backend)\n * @public\n * @extensions\n */\nexport interface SectionDrawingLocationProps extends GeometricElement3dProps {\n /** The [ViewDefinition]($backend) to which this location refers. */\n sectionView?: RelatedElementProps;\n}\n\n/** Properties that define a [GeometricElement2d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement2dProps extends GeometricElementProps {\n placement?: Placement2dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation2d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation2dProps extends GeometricElement2dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties of a [GeometryPart]($backend)\n * @public\n * @extensions\n */\nexport interface GeometryPartProps extends ElementProps {\n geom?: GeometryStreamProps;\n /** Describes how to build the part's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent part.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties for a [ViewAttachment]($backend)\n * @public\n * @extensions\n */\nexport interface ViewAttachmentProps extends GeometricElement2dProps {\n view: RelatedElementProps;\n jsonProperties?: {\n /** Integer priority in [-500,500]. Where two attachments overlap, the one with the higher priority draws in front of the other. Default: 0. */\n displayPriority?: number;\n /** JSON representation of a [ClipVector]($core-geometry] in sheet coordinate space, used to clip the attachment's graphics on the sheet. */\n clip?: ClipVectorProps;\n /** Options for customizing how the view attachment is displayed on the sheet. */\n displayOptions?: {\n /** If true, the view attachment is always drawn as a raster image. By default, only 3d perspective views are drawn this way (they always *must* be). Default: false. */\n drawAsRaster?: boolean;\n /** If true, and the view attachment is drawn as a raster image, the background color of the view will be preserved. By default the background color of the\n * sheet is used and any background pixels become transparent, allowing the contents of the sheet to show through. Default: false.\n */\n preserveBackground?: boolean;\n };\n };\n}\n\n/** Properties of a [Subject]($backend)\n * @public\n * @extensions\n */\nexport interface SubjectProps extends ElementProps {\n description?: string;\n}\n\n/** Properties of a [SheetBorderTemplate]($backend)\n * @beta\n */\nexport interface SheetBorderTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n}\n\n/** Properties of a [SheetTemplate]($backend)\n * @beta\n */\nexport interface SheetTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n border?: Id64String;\n}\n\n/** Properties of a [Sheet]($backend).\n * @public\n * @extensions\n */\nexport interface SheetProps extends ElementProps {\n width?: number;\n height?: number;\n scale?: number;\n sheetTemplate?: Id64String;\n attachments?: Id64String[];\n}\n\n/** Properties of a [DefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface DefinitionElementProps extends ElementProps {\n isPrivate?: boolean;\n}\n\n/** Properties of a [TypeDefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface TypeDefinitionElementProps extends DefinitionElementProps {\n recipe?: RelatedElementProps;\n}\n\n/** Properties of a [PhysicalType]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalTypeProps extends TypeDefinitionElementProps {\n /** The [PhysicalMaterial]($backend) that makes up this physical type. */\n physicalMaterial?: RelatedElementProps;\n}\n\n/** Properties of a [InformationPartitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface InformationPartitionElementProps extends ElementProps {\n description?: string;\n}\n\n/** Options controlling which properties are included or excluded when querying [[DisplayStyleProps]].\n * @see [[ViewStateLoadProps]] and [[ElementLoadOptions]].\n * @public\n * @extensions\n */\nexport interface DisplayStyleLoadProps {\n /** If true, the lists of element Ids in the display style's schedule script will be empty.\n * The element Ids are not required on the frontend for display and can be quite large.\n */\n omitScheduleScriptElementIds?: boolean;\n /** If true, [[DisplayStyleSettingsProps.excludedElements]] will be compressed into a single compact string; otherwise they will be expanded into an array of strings.\n * The number of Ids may be quite large, so the compressed format is preferred, especially when communicating between the backend and frontend.\n */\n compressExcludedElementIds?: boolean;\n}\n\n/** Options controlling which properties are included or excluded when querying [[RenderTimelineProps]].\n * @see [[ElementLoadOptions.renderTimeline]].\n * @public\n * @extensions\n */\nexport interface RenderTimelineLoadProps {\n /** If true, the lists of element Ids in the schedule script will be empty.\n * The element Ids can be extremely numerous and are not required on the frontend for display, so they are omitted by default by [DisplayStyleState.load]($frontend).\n */\n omitScriptElementIds?: boolean;\n}\n\n/** Options used to specify properties to include or exclude when querying [[ElementProps]] with functions like\n * [IModelDb.Elements.getElementProps]($backend) and [IModelConnection.Elements.loadProps]($frontend).\n * @public\n * @extensions\n */\nexport interface ElementLoadOptions {\n /** if true, only load the members of [[ElementProps]], and no members from subclasses */\n onlyBaseProperties?: boolean;\n /** If true, include the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * Geometry streams can consist of many megabytes worth of JSON, so they are omitted by default.\n */\n wantGeometry?: boolean;\n /** When including a geometry stream containing brep entries, whether to return the raw brep data or proxy geometry, false when undefined */\n /** If true, include [[BRepEntity.DataProps.data]] in the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * The data is a potentially large base-64-encoded opaque binary blob that cannot be directly inspected or manipulated on the frontend, so it is omitted by default.\n */\n wantBRepData?: boolean;\n /** Options controlling which properties of [[DisplayStyleProps]] to include or exclude. */\n displayStyle?: DisplayStyleLoadProps;\n /** Options controlling which properties of [[RenderTimelineProps]] to include or exclude. */\n renderTimeline?: RenderTimelineLoadProps;\n}\n\n/** Parameters to specify what element to load for functions like [IModelDb.Elements.getElementProps]($backend).\n * @public\n * @extensions\n */\nexport interface ElementLoadProps extends ElementLoadOptions {\n id?: Id64String;\n /** The properties of the Code of the element to load.\n * @note the Value member is required even though it is not declared so here. If no value is supplied, no element will ever be loaded.\n * TODO: change to Required<CodeProps> in Version 4.0\n */\n code?: CodeProps;\n federationGuid?: GuidString;\n}\n\n/** Properties of an [ElementAspect]($backend)\n * @public\n * @extensions\n */\nexport interface ElementAspectProps extends EntityProps {\n element: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSourceAspect]($backend) that stores synchronization information for an element originating from an external source.\n * @public\n * @extensions\n */\nexport interface ExternalSourceAspectProps extends ElementAspectProps {\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n scope: RelatedElementProps;\n /** The identifier of the object in the source repository. */\n identifier: string;\n /** The kind of object within the source repository. */\n kind: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n version?: string;\n /** The optional cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n checksum?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: if defined, jsonProperties must be a *string*, specifically a valid JSON string.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n jsonProperties?: any;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n source?: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSource]($backend)\n * @beta\n */\nexport interface ExternalSourceProps extends ElementProps {\n repository?: RelatedElementProps;\n connectorName?: string;\n connectorVersion?: string;\n}\n\n/** The role that an attached [ExternalSource]($backend) plays.\n * @beta\n */\nexport enum ExternalSourceAttachmentRole {\n /** The attached [ExternalSource]($backend) provides context. */\n SpecifyContext = 0,\n /** The attached [ExternalSource]($backend) models a part of the whole. */\n SpecifyPart = 1,\n}\n\n/** Properties of an [ExternalSourceAttachment]($backend)\n * @beta\n */\nexport interface ExternalSourceAttachmentProps extends ElementProps {\n attaches?: RelatedElementProps;\n role?: ExternalSourceAttachmentRole;\n translation?: XYZProps;\n yaw?: number;\n pitch?: number;\n roll?: number;\n scale?: XYZProps;\n}\n\n/** Properties of an [ChannelRootAspect]($backend) that identifies an Element as the root of a *channel* which is a subset of the overall iModel hierarchy that is independently maintained.\n * @public\n * @extensions\n */\nexport interface ChannelRootAspectProps extends ElementAspectProps {\n /** The owner of the channel */\n owner: string;\n}\n\n/** Properties of a [LineStyle]($backend)\n * @public\n * @extensions\n */\nexport interface LineStyleProps extends DefinitionElementProps {\n description?: string;\n /** The JSON string line style definition element data [LineStyleDefinition.StyleProps]($backend) */\n data: string;\n}\n\n/** Properties of a [LightLocation]($backend)\n * @internal\n */\nexport interface LightLocationProps extends GeometricElement3dProps {\n enabled?: boolean;\n}\n\n/** The *rank* for a Category\n * @public\n * @extensions\n */\nexport enum Rank {\n /** This category is predefined by the system */\n System = 0,\n /** This category is defined by a schema. Elements in this category are not recognized by system classes. */\n Domain = 1,\n /** This category is defined by an application. Elements in this category are not recognized by system and schema classes. */\n Application = 2,\n /** This category is defined by a user. Elements in this category are not recognized by system, schema, and application classes. */\n User = 3,\n}\n\n/** Parameters of a [Category]($backend)\n * @public\n * @extensions\n */\nexport interface CategoryProps extends DefinitionElementProps {\n rank?: Rank;\n description?: string;\n}\n\n/** Parameters of a [SubCategory]($backend)\n * @public\n * @extensions\n */\nexport interface SubCategoryProps extends DefinitionElementProps {\n appearance?: SubCategoryAppearance.Props;\n description?: string;\n}\n\n/** Parameters of a [UrlLink]($backend)\n * @public\n * @extensions\n */\nexport interface UrlLinkProps extends ElementProps {\n description?: string;\n url?: string;\n}\n\n/** Parameters of a [RepositoryLink]($backend)\n * @public\n * @extensions\n */\nexport interface RepositoryLinkProps extends UrlLinkProps {\n repositoryGuid?: GuidString;\n format?: string;\n}\n\n/** The properties of a [SynchronizationConfigLink]($backend)\n * @beta\n */\nexport interface SynchronizationConfigLinkProps extends UrlLinkProps {\n lastSuccessfulRun?: string;\n}\n\n/** Wire format describing a [RenderTimeline]($backend).\n * @public\n * @extensions\n */\nexport interface RenderTimelineProps extends ElementProps {\n /** An optional human-readable description of the timeline. */\n description?: string;\n /** The stringified JSON representation of the instructions for visualizing change over time.\n * @see [[RenderSchedule.ScriptProps]] for the JSON interface.\n */\n script: string;\n}\n\n/** Properties of a [SheetIndexEntry]($backend).\n * @beta\n*/\nexport interface SheetIndexEntryProps extends ElementProps {\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\n entryPriority: number;\n}\n\n/** Properties of a [SheetIndexFolder]($backend)\n * @beta\n */\nexport type SheetIndexFolderProps = SheetIndexEntryProps;\n\n/** Properties of a [SheetIndexReference]($backend)\n * @beta\n */\nexport interface SheetIndexReferenceProps extends SheetIndexEntryProps {\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\n sheetIndex?: RelatedElementProps;\n}\n\n/** Properties of a [SheetReference]($backend)\n * @beta\n */\nexport interface SheetReferenceProps extends SheetIndexEntryProps {\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\n sheet?: RelatedElementProps;\n}\n"]}
@@ -2,8 +2,6 @@
2
2
  * @module iModels
3
3
  */
4
4
  import { BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelStatus, LoggingMetaData } from "@itwin/core-bentley";
5
- export { BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus, } from "@itwin/core-bentley";
6
- export type { GetMetaDataFunction, LogFunction, LoggingMetaData } from "@itwin/core-bentley";
7
5
  /** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].
8
6
  * The values within each of these `enum`s are guaranteed not to conflict with one another.
9
7
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAmB,YAAY,EAAE,eAAe,EACxH,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,eAAe,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EAAE,eAAe;CAIrG;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;;CAI9C"}
@@ -7,15 +7,8 @@
7
7
  * @module iModels
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.NoContentError = exports.BackendError = exports.ServerTimeoutError = exports.ServerError = exports.ConflictingLocksError = exports.LockState = exports.IModelError = exports.ChangeSetStatus = exports.DbResult = exports.BriefcaseStatus = exports.IModelStatus = exports.BentleyError = exports.BentleyStatus = void 0;
10
+ exports.NoContentError = exports.BackendError = exports.ServerTimeoutError = exports.ServerError = exports.ConflictingLocksError = exports.LockState = exports.IModelError = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
- var core_bentley_2 = require("@itwin/core-bentley");
13
- Object.defineProperty(exports, "BentleyStatus", { enumerable: true, get: function () { return core_bentley_2.BentleyStatus; } });
14
- Object.defineProperty(exports, "BentleyError", { enumerable: true, get: function () { return core_bentley_2.BentleyError; } });
15
- Object.defineProperty(exports, "IModelStatus", { enumerable: true, get: function () { return core_bentley_2.IModelStatus; } });
16
- Object.defineProperty(exports, "BriefcaseStatus", { enumerable: true, get: function () { return core_bentley_2.BriefcaseStatus; } });
17
- Object.defineProperty(exports, "DbResult", { enumerable: true, get: function () { return core_bentley_2.DbResult; } });
18
- Object.defineProperty(exports, "ChangeSetStatus", { enumerable: true, get: function () { return core_bentley_2.ChangeSetStatus; } });
19
12
  /** The error type thrown by this module.
20
13
  * Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].
21
14
  * @see [[ITwinError]]
@@ -1 +1 @@
1
- {"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAE6B;AAE7B,oDAE6B;AAD3B,6GAAA,aAAa,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,4GAAA,YAAY,OAAA;AAAE,+GAAA,eAAe,OAAA;AAAE,wGAAA,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W,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AALD,oCAKC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,2BAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF;AAJD,wCAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData,\n} from \"@itwin/core-bentley\";\n\nexport {\n BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus,\n} from \"@itwin/core-bentley\";\n\nexport type { GetMetaDataFunction, LogFunction, LoggingMetaData } from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].\n * @see [[ITwinError]]\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @public @deprecated in 4.10 Use [InUseLock]($common) instead.\n*/\nexport interface ConflictingLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @public @deprecated in 4.10 Use [InUseLocksError]($common) instead.\n*/\nexport class ConflictingLocksError extends IModelError {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public conflictingLocks?: ConflictingLock[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\n this.conflictingLocks = conflictingLocks;\n }\n\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"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3C,YAAmB,WAAmB,EAAE,IAAY,EAAE,OAAe,EAAE,WAA6B;QAClG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AALD,oCAKC;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,2BAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF;AAJD,wCAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData,\n} from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].\n * @see [[ITwinError]]\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @public @deprecated in 4.10 Use [InUseLock]($common) instead.\n*/\nexport interface ConflictingLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @public @deprecated in 4.10 Use [InUseLocksError]($common) instead.\n*/\nexport class ConflictingLocksError extends IModelError {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public conflictingLocks?: ConflictingLock[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\n this.conflictingLocks = conflictingLocks;\n }\n\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"No Content\");\n }\n}\n"]}
@@ -141,7 +141,7 @@ async function handleNotFound(request, status, dispatch) {
141
141
  let resubmitted = false;
142
142
  RpcRequest_1.RpcRequest.notFoundHandlers.raiseEvent(request, status.responseValue, async () => {
143
143
  if (resubmitted) {
144
- throw new IModelError_1.IModelError(IModelError_1.BentleyStatus.ERROR, `Already resubmitted using this handler.`);
144
+ throw new IModelError_1.IModelError(core_bentley_1.BentleyStatus.ERROR, `Already resubmitted using this handler.`);
145
145
  }
146
146
  resubmitted = true;
147
147
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"RpcInterface.js","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,kEAAyF;AACzF,wDAAyD;AACzD,sDAAkE;AAClE,gEAA6D;AAC7D,iDAAqE;AAGrE,+CAA2E;AAC3E,0DAA4E;AAC5E,sDAAiD;AAyBjD;;;GAGG;AACH,MAAsB,YAAY;IAExB,MAAM,CAAC,QAAQ,CAAC,OAAmB,EAAE,QAAoB;QAC/D,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBAC1C,OAAO,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;wBACzD,MAAM,CAAC;IACjB,CAAC;IAEO,MAAM,CAAC,QAAQ,CAAC,OAAe;QACrC,+CAA+C;QAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpC,sDAAsD;QACtD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEnC,MAAM,GAAG,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,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,uBAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,aAAoC,EAAE,KAAK,IAAI,EAAE;YACtG,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,IAAI,yBAAW,CAAC,2BAAa,CAAC,KAAK,EAAE,yCAAyC,CAAC,CAAC;YACxF,CAAC;YAED,WAAW,GAAG,IAAI,CAAC;YAEnB,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAC;gBAClC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,sEAAsE;YACrF,CAAC;QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,4BAAc,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { RpcConfiguration, RpcConfigurationSupplier } from \"./rpc/core/RpcConfiguration\";\nimport { CURRENT_REQUEST } from \"./rpc/core/RpcRegistry\";\nimport { aggregateLoad, RpcRequest } from \"./rpc/core/RpcRequest\";\nimport { RpcRoutingToken } from \"./rpc/core/RpcRoutingToken\";\nimport { InterceptedRpcRequest, IpcSession } from \"./ipc/IpcSession\";\nimport { RpcSerializedValue } from \"./rpc/core/RpcMarshaling\";\nimport { RpcManagedStatus } from \"./rpc/core/RpcProtocol\";\nimport { BentleyStatus, IModelError, NoContentError } from \"./IModelError\";\nimport { RpcRequestEvent, RpcRequestStatus } from \"./rpc/core/RpcConstants\";\nimport { BeDuration } from \"@itwin/core-bentley\";\nimport { RpcNotFoundResponse } from \"./rpc/core/RpcControl\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * Specifies the required static properties of an RpcInterface class.\n * These properties are used to identify RPC requests and responses.\n * @beta\n */\nexport interface RpcInterfaceDefinition<T extends RpcInterface = RpcInterface> { prototype: T, interfaceName: string, interfaceVersion: string }\n\n/**\n * A class that implements the operations of an RPC interface.\n * @beta\n */\nexport type RpcInterfaceImplementation<T extends RpcInterface = RpcInterface> = new () => T;\n\ninterface SemverType {\n major: number;\n minor: number;\n patch: number;\n prerelease?: string;\n}\n\n/** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,\n * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.\n * @public\n */\nexport abstract class RpcInterface {\n\n private static findDiff(backend: SemverType, frontend: SemverType) {\n return backend.major !== frontend.major ? \"major\" :\n backend.minor !== frontend.minor ? \"minor\" :\n backend.patch !== frontend.patch ? \"patch\" :\n backend.prerelease !== frontend.prerelease ? \"prerelease\" :\n \"same\";\n }\n\n private static parseVer(version: string): SemverType {\n // separate the version from the prerelease tag\n const parts = version.split(/[:-]/);\n // Split the major.minor.path into separate components\n const prefix = parts[0].split(\".\");\n\n const ver: SemverType = { major: Number(prefix[0]), minor: Number(prefix[1]), patch: Number(prefix[2]) };\n if (parts.length > 1)\n ver.prerelease = parts[1];\n return ver;\n }\n\n /** Determines whether the backend version of an RPC interface is compatible (according to semantic versioning) with the frontend version of the interface. */\n public static isVersionCompatible(backend: string, frontend: string): boolean {\n if (backend === frontend)\n return true; // most common case, versions are identical\n\n const backendSemver = this.parseVer(backend);\n const frontendSemver = this.parseVer(frontend);\n\n // if either has a prerelease tag, they are not compatible unless version strings are identical\n if (backendSemver.prerelease || frontendSemver.prerelease)\n return false;\n\n const difference = this.findDiff(backendSemver, frontendSemver);\n // If the major versions are different, the versions are not compatible\n if (difference === \"major\")\n return false;\n\n // special case for major version 0. If patch difference, backend patch must be greater than frontend patch\n if (backendSemver.major === 0)\n return (difference === \"patch\" && frontendSemver.patch < backendSemver.patch);\n\n // patch difference is fine. If minor versions differ, compatible as long as backend minor version is greater\n return difference === \"patch\" || (difference === \"minor\" && frontendSemver.minor < backendSemver.minor);\n }\n\n /** The configuration for the RPC interface.\n * @internal\n */\n public readonly configuration: RpcConfiguration;\n\n /** @internal */\n public readonly routing: RpcRoutingToken;\n\n /** @beta */\n public constructor(routing: RpcRoutingToken = RpcRoutingToken.default) {\n this.routing = routing;\n this.configuration = RpcConfiguration.supply(this);\n }\n\n /** Obtains the implementation result for an RPC operation. */\n public async forward<T = any>(parameters: IArguments): Promise<T> {\n const parametersCompat = (arguments.length === 1 && typeof (parameters) === \"object\") ? parameters : arguments;\n const parametersArray = Array.isArray(parametersCompat) ? parametersCompat : Array.prototype.slice.call(parametersCompat);\n const operationName = parametersArray.pop();\n\n const session = IpcSession.active;\n if (session) {\n return intercept(session, this, operationName, parametersArray);\n } else {\n const request = new (this.configuration.protocol.requestType as any)(this, operationName, parametersArray) as RpcRequest;\n request.submit(); // eslint-disable-line @typescript-eslint/no-floating-promises\n (this as any)[CURRENT_REQUEST] = request;\n return request.response;\n }\n }\n\n /** @internal */\n public configurationSupplier: RpcConfigurationSupplier | undefined;\n}\n\nRpcInterface.prototype.configurationSupplier = undefined;\n\nclass InterceptedRequest extends RpcRequest {\n protected override async load(): Promise<RpcSerializedValue> { throw new Error(); }\n protected override async send(): Promise<number> { throw new Error(); }\n protected override setHeader(_name: string, _value: string): void { throw new Error(); }\n}\n\nasync function intercept(session: IpcSession, client: RpcInterface, operation: string, parameters: any[]) {\n const request = new InterceptedRequest(client, operation, []);\n (client as any)[CURRENT_REQUEST] = request;\n\n const context = await client.configuration.protocol.serialize(request);\n request.parameters = parameters;\n\n const info: InterceptedRpcRequest = {\n definition: {\n interfaceName: context.operation.interfaceDefinition,\n interfaceVersion: context.operation.interfaceVersion,\n },\n operation,\n parameters,\n context: {\n applicationId: context.applicationId,\n applicationVersion: context.applicationVersion,\n id: context.id,\n sessionId: context.sessionId,\n protocolVersion: (context.protocolVersion || 0).toString(),\n },\n };\n\n const dispatch = async () => {\n aggregateLoad.lastRequest = new Date().getTime();\n\n const response = await session.handleRpc(info);\n\n aggregateLoad.lastResponse = new Date().getTime();\n\n if (typeof (response) === \"object\" && response.hasOwnProperty(\"iTwinRpcCoreResponse\") && response.hasOwnProperty(\"managedStatus\")) {\n const status: RpcManagedStatus = response;\n\n if (status.managedStatus === \"pending\") {\n return handlePending(request, status, dispatch);\n } else if (status.managedStatus === \"notFound\") {\n return handleNotFound(request, status, dispatch);\n } else if (status.managedStatus === \"noContent\") {\n return handleNoContent();\n }\n } else {\n return response;\n }\n };\n\n return dispatch();\n}\n\nasync function handlePending(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n request._status = RpcRequestStatus.Pending;\n request._extendedStatus = (status.responseValue as { message: string }).message;\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, request);\n\n const delay = request.operation.policy.retryInterval(request.client.configuration);\n\n await BeDuration.wait(delay);\n return dispatch();\n}\n\nasync function handleNotFound(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n return new Promise((resolve, reject) => {\n let resubmitted = false;\n\n RpcRequest.notFoundHandlers.raiseEvent(request, status.responseValue as RpcNotFoundResponse, async () => {\n if (resubmitted) {\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n }\n\n resubmitted = true;\n\n try {\n const response = await dispatch();\n resolve(response);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n }, reject);\n });\n}\n\nasync function handleNoContent() {\n throw new NoContentError();\n}\n"]}
1
+ {"version":3,"file":"RpcInterface.js","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,kEAAy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AC,QAAQ,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,sEAAsE;YACrF,CAAC;QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,4BAAc,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { RpcConfiguration, RpcConfigurationSupplier } from \"./rpc/core/RpcConfiguration\";\nimport { CURRENT_REQUEST } from \"./rpc/core/RpcRegistry\";\nimport { aggregateLoad, RpcRequest } from \"./rpc/core/RpcRequest\";\nimport { RpcRoutingToken } from \"./rpc/core/RpcRoutingToken\";\nimport { InterceptedRpcRequest, IpcSession } from \"./ipc/IpcSession\";\nimport { RpcSerializedValue } from \"./rpc/core/RpcMarshaling\";\nimport { RpcManagedStatus } from \"./rpc/core/RpcProtocol\";\nimport { IModelError, NoContentError } from \"./IModelError\";\nimport { RpcRequestEvent, RpcRequestStatus } from \"./rpc/core/RpcConstants\";\nimport { BeDuration, BentleyStatus } from \"@itwin/core-bentley\";\nimport { RpcNotFoundResponse } from \"./rpc/core/RpcControl\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * Specifies the required static properties of an RpcInterface class.\n * These properties are used to identify RPC requests and responses.\n * @beta\n */\nexport interface RpcInterfaceDefinition<T extends RpcInterface = RpcInterface> { prototype: T, interfaceName: string, interfaceVersion: string }\n\n/**\n * A class that implements the operations of an RPC interface.\n * @beta\n */\nexport type RpcInterfaceImplementation<T extends RpcInterface = RpcInterface> = new () => T;\n\ninterface SemverType {\n major: number;\n minor: number;\n patch: number;\n prerelease?: string;\n}\n\n/** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,\n * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.\n * @public\n */\nexport abstract class RpcInterface {\n\n private static findDiff(backend: SemverType, frontend: SemverType) {\n return backend.major !== frontend.major ? \"major\" :\n backend.minor !== frontend.minor ? \"minor\" :\n backend.patch !== frontend.patch ? \"patch\" :\n backend.prerelease !== frontend.prerelease ? \"prerelease\" :\n \"same\";\n }\n\n private static parseVer(version: string): SemverType {\n // separate the version from the prerelease tag\n const parts = version.split(/[:-]/);\n // Split the major.minor.path into separate components\n const prefix = parts[0].split(\".\");\n\n const ver: SemverType = { major: Number(prefix[0]), minor: Number(prefix[1]), patch: Number(prefix[2]) };\n if (parts.length > 1)\n ver.prerelease = parts[1];\n return ver;\n }\n\n /** Determines whether the backend version of an RPC interface is compatible (according to semantic versioning) with the frontend version of the interface. */\n public static isVersionCompatible(backend: string, frontend: string): boolean {\n if (backend === frontend)\n return true; // most common case, versions are identical\n\n const backendSemver = this.parseVer(backend);\n const frontendSemver = this.parseVer(frontend);\n\n // if either has a prerelease tag, they are not compatible unless version strings are identical\n if (backendSemver.prerelease || frontendSemver.prerelease)\n return false;\n\n const difference = this.findDiff(backendSemver, frontendSemver);\n // If the major versions are different, the versions are not compatible\n if (difference === \"major\")\n return false;\n\n // special case for major version 0. If patch difference, backend patch must be greater than frontend patch\n if (backendSemver.major === 0)\n return (difference === \"patch\" && frontendSemver.patch < backendSemver.patch);\n\n // patch difference is fine. If minor versions differ, compatible as long as backend minor version is greater\n return difference === \"patch\" || (difference === \"minor\" && frontendSemver.minor < backendSemver.minor);\n }\n\n /** The configuration for the RPC interface.\n * @internal\n */\n public readonly configuration: RpcConfiguration;\n\n /** @internal */\n public readonly routing: RpcRoutingToken;\n\n /** @beta */\n public constructor(routing: RpcRoutingToken = RpcRoutingToken.default) {\n this.routing = routing;\n this.configuration = RpcConfiguration.supply(this);\n }\n\n /** Obtains the implementation result for an RPC operation. */\n public async forward<T = any>(parameters: IArguments): Promise<T> {\n const parametersCompat = (arguments.length === 1 && typeof (parameters) === \"object\") ? parameters : arguments;\n const parametersArray = Array.isArray(parametersCompat) ? parametersCompat : Array.prototype.slice.call(parametersCompat);\n const operationName = parametersArray.pop();\n\n const session = IpcSession.active;\n if (session) {\n return intercept(session, this, operationName, parametersArray);\n } else {\n const request = new (this.configuration.protocol.requestType as any)(this, operationName, parametersArray) as RpcRequest;\n request.submit(); // eslint-disable-line @typescript-eslint/no-floating-promises\n (this as any)[CURRENT_REQUEST] = request;\n return request.response;\n }\n }\n\n /** @internal */\n public configurationSupplier: RpcConfigurationSupplier | undefined;\n}\n\nRpcInterface.prototype.configurationSupplier = undefined;\n\nclass InterceptedRequest extends RpcRequest {\n protected override async load(): Promise<RpcSerializedValue> { throw new Error(); }\n protected override async send(): Promise<number> { throw new Error(); }\n protected override setHeader(_name: string, _value: string): void { throw new Error(); }\n}\n\nasync function intercept(session: IpcSession, client: RpcInterface, operation: string, parameters: any[]) {\n const request = new InterceptedRequest(client, operation, []);\n (client as any)[CURRENT_REQUEST] = request;\n\n const context = await client.configuration.protocol.serialize(request);\n request.parameters = parameters;\n\n const info: InterceptedRpcRequest = {\n definition: {\n interfaceName: context.operation.interfaceDefinition,\n interfaceVersion: context.operation.interfaceVersion,\n },\n operation,\n parameters,\n context: {\n applicationId: context.applicationId,\n applicationVersion: context.applicationVersion,\n id: context.id,\n sessionId: context.sessionId,\n protocolVersion: (context.protocolVersion || 0).toString(),\n },\n };\n\n const dispatch = async () => {\n aggregateLoad.lastRequest = new Date().getTime();\n\n const response = await session.handleRpc(info);\n\n aggregateLoad.lastResponse = new Date().getTime();\n\n if (typeof (response) === \"object\" && response.hasOwnProperty(\"iTwinRpcCoreResponse\") && response.hasOwnProperty(\"managedStatus\")) {\n const status: RpcManagedStatus = response;\n\n if (status.managedStatus === \"pending\") {\n return handlePending(request, status, dispatch);\n } else if (status.managedStatus === \"notFound\") {\n return handleNotFound(request, status, dispatch);\n } else if (status.managedStatus === \"noContent\") {\n return handleNoContent();\n }\n } else {\n return response;\n }\n };\n\n return dispatch();\n}\n\nasync function handlePending(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n request._status = RpcRequestStatus.Pending;\n request._extendedStatus = (status.responseValue as { message: string }).message;\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, request);\n\n const delay = request.operation.policy.retryInterval(request.client.configuration);\n\n await BeDuration.wait(delay);\n return dispatch();\n}\n\nasync function handleNotFound(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n return new Promise((resolve, reject) => {\n let resubmitted = false;\n\n RpcRequest.notFoundHandlers.raiseEvent(request, status.responseValue as RpcNotFoundResponse, async () => {\n if (resubmitted) {\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n }\n\n resubmitted = true;\n\n try {\n const response = await dispatch();\n resolve(response);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n }, reject);\n });\n}\n\nasync function handleNoContent() {\n throw new NoContentError();\n}\n"]}
@@ -1,6 +1,3 @@
1
- /** @packageDocumentation
2
- * @module RpcInterface
3
- */
4
1
  import { BackendReadable } from "../../BackendTypes";
5
2
  import { RpcProtocol } from "./RpcProtocol";
6
3
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;A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M,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACZ,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,kBAAkB;IAe1F,4BAA4B;WACd,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,GAAG;CAoB7F"}
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RpcMarshaling = exports.RpcSerializedValue = exports.MarshalingBinaryMarker = void 0;
2
4
  /*---------------------------------------------------------------------------------------------
3
5
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
6
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -6,8 +8,7 @@
6
8
  /** @packageDocumentation
7
9
  * @module RpcInterface
8
10
  */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.RpcMarshaling = exports.RpcSerializedValue = exports.MarshalingBinaryMarker = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
11
12
  const IModelError_1 = require("../../IModelError");
12
13
  // cspell:ignore unmarshal
13
14
  /* eslint-disable @typescript-eslint/no-deprecated */
@@ -60,7 +61,7 @@ class RpcMarshaling {
60
61
  }
61
62
  catch (error) {
62
63
  if (error instanceof SyntaxError)
63
- throw new IModelError_1.IModelError(IModelError_1.BentleyStatus.ERROR, `Invalid JSON: "${value.objects}"`);
64
+ throw new IModelError_1.IModelError(core_bentley_1.BentleyStatus.ERROR, `Invalid JSON: "${value.objects}"`);
64
65
  throw error;
65
66
  }
66
67
  marshalingTarget = undefined;
@@ -121,7 +122,7 @@ class WireFormat {
121
122
  }
122
123
  static unmarshalBinary(value) {
123
124
  if (value.index >= marshalingTarget.data.length) {
124
- throw new IModelError_1.IModelError(IModelError_1.BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);
125
+ throw new IModelError_1.IModelError(core_bentley_1.BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);
125
126
  }
126
127
  if (value.chunks === 0) {
127
128
  return new Uint8Array();
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mDAA+D;AAI/D,0BAA0B;AAC1B,qDAAqD;AAErD,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,UAAU,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9I,CAAC;AAED,IAAI,gBAAoC,CAAC;AACzC,IAAI,cAAc,GAAG,CAAC,CAAC;AAUvB,gBAAgB;AAChB,IAAiB,sBAAsB,CAItC;AAJD,WAAiB,sBAAsB;IACrC,SAAgB,aAAa;QAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC;IAFe,oCAAa,gBAE5B,CAAA;AACH,CAAC,EAJgB,sBAAsB,sCAAtB,sBAAsB,QAItC;AAUD,gBAAgB;AAChB,IAAiB,kBAAkB,CAIlC;AAJD,WAAiB,kBAAkB;IACjC,SAAgB,MAAM,CAAC,OAAO,GAAG,EAAE,EAAE,OAAqB,EAAE;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAA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E,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACzF,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/F,KAAK,CAAC,KAAK,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus, IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (value === undefined)\n return serialized;\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: Uint8Array): MarshalingBinaryMarker | undefined {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): Uint8Array {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: unknown) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAoD;AACpD,mDAAgD;AAIhD,0BAA0B;AAC1B,qDAAqD;AAErD,SAAS,QAAQ,CAAC,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QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (value === undefined)\n return serialized;\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: Uint8Array): MarshalingBinaryMarker | undefined {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): Uint8Array {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: unknown) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMultipart.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI7D,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrF;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,wDAAwD;WAC1C,UAAU,C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C,YAAY,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIrF,gBAAgB;WACF,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,kBAAkB;IAQ9E,gBAAgB;IAChB,OAAc,QAAQ;6BACC,kBAAkB,GAAG,gBAAgB;2BAGjC,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;wBAGxD,MAAM,QAAQ,cAAc,SAAS,kBAAkB,GAAG,IAAI;MAG9E;CACH"}
@@ -8,6 +8,7 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.RpcMultipart = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
11
12
  const IModelError_1 = require("../../IModelError");
12
13
  /** Support for transporting RPC values using the HTTP multipart content type.
13
14
  * @internal
@@ -37,10 +38,10 @@ class RpcMultipart {
37
38
  /** @internal */
38
39
  static { this.platform = {
39
40
  createStream(_value) {
40
- throw new IModelError_1.IModelError(IModelError_1.BentleyStatus.ERROR, "Not bound.");
41
+ throw new IModelError_1.IModelError(core_bentley_1.BentleyStatus.ERROR, "Not bound.");
41
42
  },
42
43
  async parseRequest(_req) {
43
- throw new IModelError_1.IModelError(IModelError_1.BentleyStatus.ERROR, "Not bound.");
44
+ throw new IModelError_1.IModelError(core_bentley_1.BentleyStatus.ERROR, "Not bound.");
44
45
  },
45
46
  appendToForm(i, form, value) {
46
47
  form.append(`data-${i}`, new Blob([value.data[i]], { type: "application/octet-stream" }));
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMultipart.js","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mDAA+D;AAiB/D;;GAEG;AACH,MAAa,YAAY;IACvB,wDAAwD;IACjD,MAAM,CAAC,UAAU,CAAC,KAAyB;QAChD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC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AC5F,CAAC;KACF,CAAC;;AAtCJ,oCAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus, IModelError } from \"../../IModelError\";\nimport { BackendBuffer, BackendReadable } from \"../../BackendTypes\";\nimport { RpcSerializedValue } from \"../core/RpcMarshaling\";\nimport { HttpServerRequest } from \"../web/WebAppRpcProtocol\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nexport interface FormDataCommon {\n append(name: string, value: string | Blob | BackendBuffer, fileName?: string): void;\n}\n\n/** @internal */\nexport interface ReadableFormData extends BackendReadable {\n getHeaders(): { [key: string]: any };\n}\n\n/** Support for transporting RPC values using the HTTP multipart content type.\n * @internal\n */\nexport class RpcMultipart {\n /** Creates a multipart form object for an RPC value. */\n public static createForm(value: RpcSerializedValue): FormData {\n const form = new FormData();\n RpcMultipart.writeValueToForm(form, value);\n return form;\n }\n\n /** Creates a multipart stream for an RPC value. */\n public static createStream(value: RpcSerializedValue): ReadableFormData {\n return this.platform.createStream(value);\n }\n\n /** Obtains the RPC value from a multipart HTTP request. */\n public static async parseRequest(req: HttpServerRequest): Promise<RpcSerializedValue> {\n return this.platform.parseRequest(req);\n }\n\n /** @internal */\n public static writeValueToForm(form: FormDataCommon, value: RpcSerializedValue) {\n form.append(\"objects\", value.objects);\n\n for (let i = 0; i !== value.data.length; ++i) {\n this.platform.appendToForm(i, form, value);\n }\n }\n\n /** @internal */\n public static platform = {\n createStream(_value: RpcSerializedValue): ReadableFormData {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n async parseRequest(_req: HttpServerRequest): Promise<RpcSerializedValue> {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n appendToForm(i: number, form: FormDataCommon, value: RpcSerializedValue): void {\n form.append(`data-${i}`, new Blob([value.data[i]], { type: \"application/octet-stream\" }));\n },\n };\n}\n\n"]}
1
+ {"version":3,"file":"RpcMultipart.js","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,mDAAgD;AAiBhD;;GAEG;AACH,MAAa,YAAY;IACvB,wDAAwD;IACjD,MAAM,CAAC,UAAU,CAAC,KAAyB;QAChD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mDAAmD;IAC5C,MAAM,CAAC,YAAY,CAAC,KAAyB;QAClD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,2DAA2D;IACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,GAAsB;QACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,gBAAgB,CAAC,IAAoB,EAAE,KAAyB;QAC5E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gBAAgB;aACF,aAAQ,GAAG;QACvB,YAAY,CAAC,MAA0B;YACrC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,KAAK,CAAC,YAAY,CAAC,IAAuB;YACxC,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,YAAY,CAAC,CAAS,EAAE,IAAoB,EAAE,KAAyB;YACrE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC;QAC5F,CAAC;KACF,CAAC;;AAtCJ,oCAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendBuffer, BackendReadable } from \"../../BackendTypes\";\nimport { RpcSerializedValue } from \"../core/RpcMarshaling\";\nimport { HttpServerRequest } from \"../web/WebAppRpcProtocol\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nexport interface FormDataCommon {\n append(name: string, value: string | Blob | BackendBuffer, fileName?: string): void;\n}\n\n/** @internal */\nexport interface ReadableFormData extends BackendReadable {\n getHeaders(): { [key: string]: any };\n}\n\n/** Support for transporting RPC values using the HTTP multipart content type.\n * @internal\n */\nexport class RpcMultipart {\n /** Creates a multipart form object for an RPC value. */\n public static createForm(value: RpcSerializedValue): FormData {\n const form = new FormData();\n RpcMultipart.writeValueToForm(form, value);\n return form;\n }\n\n /** Creates a multipart stream for an RPC value. */\n public static createStream(value: RpcSerializedValue): ReadableFormData {\n return this.platform.createStream(value);\n }\n\n /** Obtains the RPC value from a multipart HTTP request. */\n public static async parseRequest(req: HttpServerRequest): Promise<RpcSerializedValue> {\n return this.platform.parseRequest(req);\n }\n\n /** @internal */\n public static writeValueToForm(form: FormDataCommon, value: RpcSerializedValue) {\n form.append(\"objects\", value.objects);\n\n for (let i = 0; i !== value.data.length; ++i) {\n this.platform.appendToForm(i, form, value);\n }\n }\n\n /** @internal */\n public static platform = {\n createStream(_value: RpcSerializedValue): ReadableFormData {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n async parseRequest(_req: HttpServerRequest): Promise<RpcSerializedValue> {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n appendToForm(i: number, form: FormDataCommon, value: RpcSerializedValue): void {\n form.append(`data-${i}`, new Blob([value.data[i]], { type: \"application/octet-stream\" }));\n },\n };\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ElementProps.d.ts","sourceRoot":"","sources":["../../src/ElementProps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAQ,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EACzH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,4BAA4B,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,EAAE,EAAE,UAAU,CAAC;IACf,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG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AsB;IAC9D,UAAU,CAAC,EAAE,qBAAqB,CAAC,KAAK,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,YAAY;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;EAEE;AACF,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,0FAA0F;IAC1F,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB;IACpE,2EAA2E;IAC3E,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,iEAAiE;IACjE,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B"}
@@ -5,8 +5,8 @@
5
5
  /** @packageDocumentation
6
6
  * @module Entities
7
7
  */
8
- import { Id64 } from "@itwin/core-bentley";
9
- import { IModelError, IModelStatus } from "./IModelError";
8
+ import { Id64, IModelStatus } from "@itwin/core-bentley";
9
+ import { IModelError } from "./IModelError";
10
10
  /** The Id and relationship class of an Element that is somehow related to another Element
11
11
  * @public
12
12
  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CAAC;IACJ,CAAC;;AAGH;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,cAAc;CACjD;AA6CD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAqB;IACtD,OAAQ,KAA0B,CAAC,KAAK,KAAK,SAAS,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAqB;IACtD,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AA+BD;;;GAGG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,iDAAU,CAAA;IACV,uDAAa,CAAA;IACb,6CAAQ,CAAA;AACV,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAmRD;;GAEG;AACH,MAAM,CAAN,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,gEAAgE;IAChE,mGAAkB,CAAA;IAClB,0EAA0E;IAC1E,6FAAe,CAAA;AACjB,CAAC,EALW,4BAA4B,KAA5B,4BAA4B,QAKvC;AAyCD;;;GAGG;AACH,MAAM,CAAN,IAAY,IASX;AATD,WAAY,IAAI;IACd,gDAAgD;IAChD,mCAAU,CAAA;IACV,4GAA4G;IAC5G,mCAAU,CAAA;IACV,6HAA6H;IAC7H,6CAAe,CAAA;IACf,mIAAmI;IACnI,+BAAQ,CAAA;AACV,CAAC,EATW,IAAI,KAAJ,IAAI,QASf","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Entities\n */\n\nimport { GuidString, Id64, Id64String } from \"@itwin/core-bentley\";\nimport {\n AngleProps, ClipVectorProps, LowAndHighXYProps, LowAndHighXYZProps, TransformProps, XYProps, XYZProps, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { CodeProps } from \"./Code\";\nimport { EntityProps } from \"./EntityProps\";\nimport { ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart } from \"./geometry/ElementGeometry\";\nimport { GeometryStreamProps } from \"./geometry/GeometryStream\";\nimport { IModelError, IModelStatus } from \"./IModelError\";\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\nimport { TextAnnotationProps } from \"./annotation/TextAnnotation\";\n\n/** Properties of a NavigationProperty.\n * @public\n * @extensions\n */\nexport interface RelatedElementProps {\n /** The Id of the element to which this element is related. */\n id: Id64String;\n /** The full className of the relationship class. */\n relClassName?: string;\n}\n\n/** Properties of an [Element]($docs/bis/guide/fundamentals/element-fundamentals)\n * @public\n * @extensions\n */\nexport interface ElementProps extends EntityProps {\n /** The Id of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\n model: Id64String;\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\n code: CodeProps;\n /** The Parent of this element, if defined. */\n parent?: RelatedElementProps;\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element.\n * @note On insert, if this is a valid Guid, the value is preserved. If it is `undefined`, a new Guid is created. If it is an invalid Guid (e.g. Guid.empty), the\n * resultant element will have a `null` federationGuid. For update, `undefined` means \"don't change.\"\n */\n federationGuid?: GuidString;\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\n userLabel?: string;\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\n jsonProperties?: any;\n}\n\n/** The Id and relationship class of an Element that is somehow related to another Element\n * @public\n */\nexport class RelatedElement implements RelatedElementProps {\n /** The Id of the element to which this element is related. */\n public readonly id: Id64String;\n\n /** The full className of the relationship class. */\n public readonly relClassName?: string;\n\n constructor(props: RelatedElementProps) {\n this.id = Id64.fromJSON(props.id);\n this.relClassName = props.relClassName;\n }\n\n public static fromJSON(json?: RelatedElementProps): RelatedElement | undefined {\n return json ? new RelatedElement(json) : undefined;\n }\n\n /** Used to *null out* an existing navigation relationship. */\n public static readonly none = new RelatedElement({ id: Id64.invalid });\n\n /** Accept the value of a navigation property that might be in the shortened format of just an id or might be in the full RelatedElement format. */\n public static idFromJson(json: any): Id64String {\n if ((typeof json === \"object\") && (\"id\" in json)) {\n const r = RelatedElement.fromJSON(json);\n if (r === undefined)\n throw new IModelError(IModelStatus.BadArg, \"Problem parsing Id64 from json\");\n return r.id;\n }\n return Id64.fromJSON(json);\n }\n\n public toJSON(): RelatedElementProps {\n return {\n id: this.id,\n relClassName: this.relClassName,\n };\n }\n}\n\n/** A [RelatedElement]($common) relationship that describes the [TypeDefinitionElement]($backend) of an element.\n * @public\n */\nexport class TypeDefinition extends RelatedElement {\n}\n\n/** Properties of a [GeometricElement]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElementProps extends ElementProps {\n /** The id of the category for this geometric element. */\n category: Id64String;\n /** The geometry stream properties */\n geom?: GeometryStreamProps;\n /** Describes how to build the element's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent element.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParams;\n /** The placement properties */\n placement?: PlacementProps;\n}\n\n/** Properties of a [[Placement3d]]\n * @public\n * @extensions\n */\nexport interface Placement3dProps {\n origin: XYZProps;\n angles: YawPitchRollProps;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties of a [[Placement2d]]\n * @public\n * @extensions\n */\nexport interface Placement2dProps {\n origin: XYProps;\n angle: AngleProps;\n bbox?: LowAndHighXYProps;\n}\n\n/**\n * @public\n * @extensions\n */\nexport type PlacementProps = Placement2dProps | Placement3dProps;\n\n/** determine if this is Placement2dProps\n * @public\n */\nexport function isPlacement2dProps(props: PlacementProps): props is Placement2dProps {\n return (props as Placement2dProps).angle !== undefined;\n}\n\n/** determine if this is Placement3dProps\n * @public\n */\nexport function isPlacement3dProps(props: PlacementProps): props is Placement3dProps {\n return !isPlacement2dProps(props);\n}\n\n/** Properties that define a [GeometricElement3d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement3dProps extends GeometricElementProps {\n placement?: Placement3dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation3d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation3dProps extends GeometricElement3dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties that define a [PhysicalElement]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalElementProps extends GeometricElement3dProps {\n physicalMaterial?: RelatedElementProps;\n}\n\n/** An enumeration of the different types of [SectionDrawing]($backend)s.\n * @public\n * @extensions\n */\nexport enum SectionType {\n Section = 3,\n Detail = 4,\n Elevation = 5,\n Plan = 6,\n}\n\n/** Properties that define a [SectionDrawing]($backend).\n * @public\n * @extensions\n */\nexport interface SectionDrawingProps extends ElementProps {\n /** The type of section used to generate the drawing. Default: Section. */\n sectionType?: SectionType;\n /** The spatial view from which the section was generated. */\n spatialView?: RelatedElementProps;\n jsonProperties?: {\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\n drawingToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), a transform from the sheet's coordinates to spatial coordinates. */\n sheetToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), JSON representation of a [ClipVector]($geometry) to apply to\n * the sheet graphics when drawn in the context of the spatial view.\n * The ClipVector is in spatial coordinates.\n */\n drawingBoundaryClip?: ClipVectorProps;\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\n displaySpatialView?: true;\n };\n}\n\n/** Properties that define a [SectionDrawingLocation]($backend)\n * @public\n * @extensions\n */\nexport interface SectionDrawingLocationProps extends GeometricElement3dProps {\n /** The [ViewDefinition]($backend) to which this location refers. */\n sectionView?: RelatedElementProps;\n}\n\n/** Properties that define a [GeometricElement2d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement2dProps extends GeometricElementProps {\n placement?: Placement2dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation2d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation2dProps extends GeometricElement2dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties of a [GeometryPart]($backend)\n * @public\n * @extensions\n */\nexport interface GeometryPartProps extends ElementProps {\n geom?: GeometryStreamProps;\n /** Describes how to build the part's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent part.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties for a [ViewAttachment]($backend)\n * @public\n * @extensions\n */\nexport interface ViewAttachmentProps extends GeometricElement2dProps {\n view: RelatedElementProps;\n jsonProperties?: {\n /** Integer priority in [-500,500]. Where two attachments overlap, the one with the higher priority draws in front of the other. Default: 0. */\n displayPriority?: number;\n /** JSON representation of a [ClipVector]($core-geometry] in sheet coordinate space, used to clip the attachment's graphics on the sheet. */\n clip?: ClipVectorProps;\n /** Options for customizing how the view attachment is displayed on the sheet. */\n displayOptions?: {\n /** If true, the view attachment is always drawn as a raster image. By default, only 3d perspective views are drawn this way (they always *must* be). Default: false. */\n drawAsRaster?: boolean;\n /** If true, and the view attachment is drawn as a raster image, the background color of the view will be preserved. By default the background color of the\n * sheet is used and any background pixels become transparent, allowing the contents of the sheet to show through. Default: false.\n */\n preserveBackground?: boolean;\n };\n };\n}\n\n/** Properties of a [Subject]($backend)\n * @public\n * @extensions\n */\nexport interface SubjectProps extends ElementProps {\n description?: string;\n}\n\n/** Properties of a [SheetBorderTemplate]($backend)\n * @beta\n */\nexport interface SheetBorderTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n}\n\n/** Properties of a [SheetTemplate]($backend)\n * @beta\n */\nexport interface SheetTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n border?: Id64String;\n}\n\n/** Properties of a [Sheet]($backend).\n * @public\n * @extensions\n */\nexport interface SheetProps extends ElementProps {\n width?: number;\n height?: number;\n scale?: number;\n sheetTemplate?: Id64String;\n attachments?: Id64String[];\n}\n\n/** Properties of a [DefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface DefinitionElementProps extends ElementProps {\n isPrivate?: boolean;\n}\n\n/** Properties of a [TypeDefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface TypeDefinitionElementProps extends DefinitionElementProps {\n recipe?: RelatedElementProps;\n}\n\n/** Properties of a [PhysicalType]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalTypeProps extends TypeDefinitionElementProps {\n /** The [PhysicalMaterial]($backend) that makes up this physical type. */\n physicalMaterial?: RelatedElementProps;\n}\n\n/** Properties of a [InformationPartitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface InformationPartitionElementProps extends ElementProps {\n description?: string;\n}\n\n/** Options controlling which properties are included or excluded when querying [[DisplayStyleProps]].\n * @see [[ViewStateLoadProps]] and [[ElementLoadOptions]].\n * @public\n * @extensions\n */\nexport interface DisplayStyleLoadProps {\n /** If true, the lists of element Ids in the display style's schedule script will be empty.\n * The element Ids are not required on the frontend for display and can be quite large.\n */\n omitScheduleScriptElementIds?: boolean;\n /** If true, [[DisplayStyleSettingsProps.excludedElements]] will be compressed into a single compact string; otherwise they will be expanded into an array of strings.\n * The number of Ids may be quite large, so the compressed format is preferred, especially when communicating between the backend and frontend.\n */\n compressExcludedElementIds?: boolean;\n}\n\n/** Options controlling which properties are included or excluded when querying [[RenderTimelineProps]].\n * @see [[ElementLoadOptions.renderTimeline]].\n * @public\n * @extensions\n */\nexport interface RenderTimelineLoadProps {\n /** If true, the lists of element Ids in the schedule script will be empty.\n * The element Ids can be extremely numerous and are not required on the frontend for display, so they are omitted by default by [DisplayStyleState.load]($frontend).\n */\n omitScriptElementIds?: boolean;\n}\n\n/** Options used to specify properties to include or exclude when querying [[ElementProps]] with functions like\n * [IModelDb.Elements.getElementProps]($backend) and [IModelConnection.Elements.loadProps]($frontend).\n * @public\n * @extensions\n */\nexport interface ElementLoadOptions {\n /** if true, only load the members of [[ElementProps]], and no members from subclasses */\n onlyBaseProperties?: boolean;\n /** If true, include the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * Geometry streams can consist of many megabytes worth of JSON, so they are omitted by default.\n */\n wantGeometry?: boolean;\n /** When including a geometry stream containing brep entries, whether to return the raw brep data or proxy geometry, false when undefined */\n /** If true, include [[BRepEntity.DataProps.data]] in the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * The data is a potentially large base-64-encoded opaque binary blob that cannot be directly inspected or manipulated on the frontend, so it is omitted by default.\n */\n wantBRepData?: boolean;\n /** Options controlling which properties of [[DisplayStyleProps]] to include or exclude. */\n displayStyle?: DisplayStyleLoadProps;\n /** Options controlling which properties of [[RenderTimelineProps]] to include or exclude. */\n renderTimeline?: RenderTimelineLoadProps;\n}\n\n/** Parameters to specify what element to load for functions like [IModelDb.Elements.getElementProps]($backend).\n * @public\n * @extensions\n */\nexport interface ElementLoadProps extends ElementLoadOptions {\n id?: Id64String;\n /** The properties of the Code of the element to load.\n * @note the Value member is required even though it is not declared so here. If no value is supplied, no element will ever be loaded.\n * TODO: change to Required<CodeProps> in Version 4.0\n */\n code?: CodeProps;\n federationGuid?: GuidString;\n}\n\n/** Properties of an [ElementAspect]($backend)\n * @public\n * @extensions\n */\nexport interface ElementAspectProps extends EntityProps {\n element: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSourceAspect]($backend) that stores synchronization information for an element originating from an external source.\n * @public\n * @extensions\n */\nexport interface ExternalSourceAspectProps extends ElementAspectProps {\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n scope: RelatedElementProps;\n /** The identifier of the object in the source repository. */\n identifier: string;\n /** The kind of object within the source repository. */\n kind: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n version?: string;\n /** The optional cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n checksum?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: if defined, jsonProperties must be a *string*, specifically a valid JSON string.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n jsonProperties?: any;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n source?: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSource]($backend)\n * @beta\n */\nexport interface ExternalSourceProps extends ElementProps {\n repository?: RelatedElementProps;\n connectorName?: string;\n connectorVersion?: string;\n}\n\n/** The role that an attached [ExternalSource]($backend) plays.\n * @beta\n */\nexport enum ExternalSourceAttachmentRole {\n /** The attached [ExternalSource]($backend) provides context. */\n SpecifyContext = 0,\n /** The attached [ExternalSource]($backend) models a part of the whole. */\n SpecifyPart = 1,\n}\n\n/** Properties of an [ExternalSourceAttachment]($backend)\n * @beta\n */\nexport interface ExternalSourceAttachmentProps extends ElementProps {\n attaches?: RelatedElementProps;\n role?: ExternalSourceAttachmentRole;\n translation?: XYZProps;\n yaw?: number;\n pitch?: number;\n roll?: number;\n scale?: XYZProps;\n}\n\n/** Properties of an [ChannelRootAspect]($backend) that identifies an Element as the root of a *channel* which is a subset of the overall iModel hierarchy that is independently maintained.\n * @public\n * @extensions\n */\nexport interface ChannelRootAspectProps extends ElementAspectProps {\n /** The owner of the channel */\n owner: string;\n}\n\n/** Properties of a [LineStyle]($backend)\n * @public\n * @extensions\n */\nexport interface LineStyleProps extends DefinitionElementProps {\n description?: string;\n /** The JSON string line style definition element data [LineStyleDefinition.StyleProps]($backend) */\n data: string;\n}\n\n/** Properties of a [LightLocation]($backend)\n * @internal\n */\nexport interface LightLocationProps extends GeometricElement3dProps {\n enabled?: boolean;\n}\n\n/** The *rank* for a Category\n * @public\n * @extensions\n */\nexport enum Rank {\n /** This category is predefined by the system */\n System = 0,\n /** This category is defined by a schema. Elements in this category are not recognized by system classes. */\n Domain = 1,\n /** This category is defined by an application. Elements in this category are not recognized by system and schema classes. */\n Application = 2,\n /** This category is defined by a user. Elements in this category are not recognized by system, schema, and application classes. */\n User = 3,\n}\n\n/** Parameters of a [Category]($backend)\n * @public\n * @extensions\n */\nexport interface CategoryProps extends DefinitionElementProps {\n rank?: Rank;\n description?: string;\n}\n\n/** Parameters of a [SubCategory]($backend)\n * @public\n * @extensions\n */\nexport interface SubCategoryProps extends DefinitionElementProps {\n appearance?: SubCategoryAppearance.Props;\n description?: string;\n}\n\n/** Parameters of a [UrlLink]($backend)\n * @public\n * @extensions\n */\nexport interface UrlLinkProps extends ElementProps {\n description?: string;\n url?: string;\n}\n\n/** Parameters of a [RepositoryLink]($backend)\n * @public\n * @extensions\n */\nexport interface RepositoryLinkProps extends UrlLinkProps {\n repositoryGuid?: GuidString;\n format?: string;\n}\n\n/** The properties of a [SynchronizationConfigLink]($backend)\n * @beta\n */\nexport interface SynchronizationConfigLinkProps extends UrlLinkProps {\n lastSuccessfulRun?: string;\n}\n\n/** Wire format describing a [RenderTimeline]($backend).\n * @public\n * @extensions\n */\nexport interface RenderTimelineProps extends ElementProps {\n /** An optional human-readable description of the timeline. */\n description?: string;\n /** The stringified JSON representation of the instructions for visualizing change over time.\n * @see [[RenderSchedule.ScriptProps]] for the JSON interface.\n */\n script: string;\n}\n\n/** Properties of a [SheetIndexEntry]($backend).\n * @beta\n*/\nexport interface SheetIndexEntryProps extends ElementProps {\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\n entryPriority: number;\n}\n\n/** Properties of a [SheetIndexFolder]($backend)\n * @beta\n */\nexport type SheetIndexFolderProps = SheetIndexEntryProps;\n\n/** Properties of a [SheetIndexReference]($backend)\n * @beta\n */\nexport interface SheetIndexReferenceProps extends SheetIndexEntryProps {\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\n sheetIndex?: RelatedElementProps;\n}\n\n/** Properties of a [SheetReference]($backend)\n * @beta\n */\nexport interface SheetReferenceProps extends SheetIndexEntryProps {\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\n sheet?: RelatedElementProps;\n}\n"]}
1
+ {"version":3,"file":"ElementProps.js","sourceRoot":"","sources":["../../src/ElementProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,IAAI,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAQjF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAqC5C;;GAEG;AACH,MAAM,OAAO,cAAc;IAOzB,YAAY,KAA0B;QACpC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACzC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,IAA0B;QAC/C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,CAAC;IAED,8DAA8D;aACvC,SAAI,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAEvE,mJAAmJ;IAC5I,MAAM,CAAC,UAAU,CAAC,IAAS;QAChC,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC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AA6H;IAC7H,6CAAe,CAAA;IACf,mIAAmI;IACnI,+BAAQ,CAAA;AACV,CAAC,EATW,IAAI,KAAJ,IAAI,QASf","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Entities\n */\n\nimport { GuidString, Id64, Id64String, IModelStatus } from \"@itwin/core-bentley\";\nimport {\n AngleProps, ClipVectorProps, LowAndHighXYProps, LowAndHighXYZProps, TransformProps, XYProps, XYZProps, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { CodeProps } from \"./Code\";\nimport { EntityProps } from \"./EntityProps\";\nimport { ElementGeometryBuilderParams, ElementGeometryBuilderParamsForPart } from \"./geometry/ElementGeometry\";\nimport { GeometryStreamProps } from \"./geometry/GeometryStream\";\nimport { IModelError } from \"./IModelError\";\nimport { SubCategoryAppearance } from \"./SubCategoryAppearance\";\nimport { TextAnnotationProps } from \"./annotation/TextAnnotation\";\n\n/** Properties of a NavigationProperty.\n * @public\n * @extensions\n */\nexport interface RelatedElementProps {\n /** The Id of the element to which this element is related. */\n id: Id64String;\n /** The full className of the relationship class. */\n relClassName?: string;\n}\n\n/** Properties of an [Element]($docs/bis/guide/fundamentals/element-fundamentals)\n * @public\n * @extensions\n */\nexport interface ElementProps extends EntityProps {\n /** The Id of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\n model: Id64String;\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\n code: CodeProps;\n /** The Parent of this element, if defined. */\n parent?: RelatedElementProps;\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element.\n * @note On insert, if this is a valid Guid, the value is preserved. If it is `undefined`, a new Guid is created. If it is an invalid Guid (e.g. Guid.empty), the\n * resultant element will have a `null` federationGuid. For update, `undefined` means \"don't change.\"\n */\n federationGuid?: GuidString;\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\n userLabel?: string;\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\n jsonProperties?: any;\n}\n\n/** The Id and relationship class of an Element that is somehow related to another Element\n * @public\n */\nexport class RelatedElement implements RelatedElementProps {\n /** The Id of the element to which this element is related. */\n public readonly id: Id64String;\n\n /** The full className of the relationship class. */\n public readonly relClassName?: string;\n\n constructor(props: RelatedElementProps) {\n this.id = Id64.fromJSON(props.id);\n this.relClassName = props.relClassName;\n }\n\n public static fromJSON(json?: RelatedElementProps): RelatedElement | undefined {\n return json ? new RelatedElement(json) : undefined;\n }\n\n /** Used to *null out* an existing navigation relationship. */\n public static readonly none = new RelatedElement({ id: Id64.invalid });\n\n /** Accept the value of a navigation property that might be in the shortened format of just an id or might be in the full RelatedElement format. */\n public static idFromJson(json: any): Id64String {\n if ((typeof json === \"object\") && (\"id\" in json)) {\n const r = RelatedElement.fromJSON(json);\n if (r === undefined)\n throw new IModelError(IModelStatus.BadArg, \"Problem parsing Id64 from json\");\n return r.id;\n }\n return Id64.fromJSON(json);\n }\n\n public toJSON(): RelatedElementProps {\n return {\n id: this.id,\n relClassName: this.relClassName,\n };\n }\n}\n\n/** A [RelatedElement]($common) relationship that describes the [TypeDefinitionElement]($backend) of an element.\n * @public\n */\nexport class TypeDefinition extends RelatedElement {\n}\n\n/** Properties of a [GeometricElement]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElementProps extends ElementProps {\n /** The id of the category for this geometric element. */\n category: Id64String;\n /** The geometry stream properties */\n geom?: GeometryStreamProps;\n /** Describes how to build the element's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent element.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParams;\n /** The placement properties */\n placement?: PlacementProps;\n}\n\n/** Properties of a [[Placement3d]]\n * @public\n * @extensions\n */\nexport interface Placement3dProps {\n origin: XYZProps;\n angles: YawPitchRollProps;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties of a [[Placement2d]]\n * @public\n * @extensions\n */\nexport interface Placement2dProps {\n origin: XYProps;\n angle: AngleProps;\n bbox?: LowAndHighXYProps;\n}\n\n/**\n * @public\n * @extensions\n */\nexport type PlacementProps = Placement2dProps | Placement3dProps;\n\n/** determine if this is Placement2dProps\n * @public\n */\nexport function isPlacement2dProps(props: PlacementProps): props is Placement2dProps {\n return (props as Placement2dProps).angle !== undefined;\n}\n\n/** determine if this is Placement3dProps\n * @public\n */\nexport function isPlacement3dProps(props: PlacementProps): props is Placement3dProps {\n return !isPlacement2dProps(props);\n}\n\n/** Properties that define a [GeometricElement3d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement3dProps extends GeometricElementProps {\n placement?: Placement3dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation3d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation3dProps extends GeometricElement3dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties that define a [PhysicalElement]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalElementProps extends GeometricElement3dProps {\n physicalMaterial?: RelatedElementProps;\n}\n\n/** An enumeration of the different types of [SectionDrawing]($backend)s.\n * @public\n * @extensions\n */\nexport enum SectionType {\n Section = 3,\n Detail = 4,\n Elevation = 5,\n Plan = 6,\n}\n\n/** Properties that define a [SectionDrawing]($backend).\n * @public\n * @extensions\n */\nexport interface SectionDrawingProps extends ElementProps {\n /** The type of section used to generate the drawing. Default: Section. */\n sectionType?: SectionType;\n /** The spatial view from which the section was generated. */\n spatialView?: RelatedElementProps;\n jsonProperties?: {\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\n drawingToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), a transform from the sheet's coordinates to spatial coordinates. */\n sheetToSpatialTransform?: TransformProps;\n /** If the section drawing is placed onto a [Sheet]($backend) via a [ViewAttachment]($backend), JSON representation of a [ClipVector]($geometry) to apply to\n * the sheet graphics when drawn in the context of the spatial view.\n * The ClipVector is in spatial coordinates.\n */\n drawingBoundaryClip?: ClipVectorProps;\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\n displaySpatialView?: true;\n };\n}\n\n/** Properties that define a [SectionDrawingLocation]($backend)\n * @public\n * @extensions\n */\nexport interface SectionDrawingLocationProps extends GeometricElement3dProps {\n /** The [ViewDefinition]($backend) to which this location refers. */\n sectionView?: RelatedElementProps;\n}\n\n/** Properties that define a [GeometricElement2d]($backend)\n * @public\n * @extensions\n */\nexport interface GeometricElement2dProps extends GeometricElementProps {\n placement?: Placement2dProps;\n typeDefinition?: RelatedElementProps;\n}\n\n/** JSON representation of a [TextAnnotation2d]($backend).\n * @public\n * @extensions\n */\nexport interface TextAnnotation2dProps extends GeometricElement2dProps {\n jsonProperties?: {\n [key: string]: any;\n /** @beta */\n annotation?: TextAnnotationProps;\n };\n}\n\n/** Properties of a [GeometryPart]($backend)\n * @public\n * @extensions\n */\nexport interface GeometryPartProps extends ElementProps {\n geom?: GeometryStreamProps;\n /** Describes how to build the part's GeometryStream, as an alternative to [[geom]]. This is used for insert and update operations only.\n * It is not a persistent property - it will always be undefined in the properties returned by functions that read a persistent part.\n */\n elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\n bbox?: LowAndHighXYZProps;\n}\n\n/** Properties for a [ViewAttachment]($backend)\n * @public\n * @extensions\n */\nexport interface ViewAttachmentProps extends GeometricElement2dProps {\n view: RelatedElementProps;\n jsonProperties?: {\n /** Integer priority in [-500,500]. Where two attachments overlap, the one with the higher priority draws in front of the other. Default: 0. */\n displayPriority?: number;\n /** JSON representation of a [ClipVector]($core-geometry] in sheet coordinate space, used to clip the attachment's graphics on the sheet. */\n clip?: ClipVectorProps;\n /** Options for customizing how the view attachment is displayed on the sheet. */\n displayOptions?: {\n /** If true, the view attachment is always drawn as a raster image. By default, only 3d perspective views are drawn this way (they always *must* be). Default: false. */\n drawAsRaster?: boolean;\n /** If true, and the view attachment is drawn as a raster image, the background color of the view will be preserved. By default the background color of the\n * sheet is used and any background pixels become transparent, allowing the contents of the sheet to show through. Default: false.\n */\n preserveBackground?: boolean;\n };\n };\n}\n\n/** Properties of a [Subject]($backend)\n * @public\n * @extensions\n */\nexport interface SubjectProps extends ElementProps {\n description?: string;\n}\n\n/** Properties of a [SheetBorderTemplate]($backend)\n * @beta\n */\nexport interface SheetBorderTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n}\n\n/** Properties of a [SheetTemplate]($backend)\n * @beta\n */\nexport interface SheetTemplateProps extends ElementProps {\n height?: number;\n width?: number;\n border?: Id64String;\n}\n\n/** Properties of a [Sheet]($backend).\n * @public\n * @extensions\n */\nexport interface SheetProps extends ElementProps {\n width?: number;\n height?: number;\n scale?: number;\n sheetTemplate?: Id64String;\n attachments?: Id64String[];\n}\n\n/** Properties of a [DefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface DefinitionElementProps extends ElementProps {\n isPrivate?: boolean;\n}\n\n/** Properties of a [TypeDefinitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface TypeDefinitionElementProps extends DefinitionElementProps {\n recipe?: RelatedElementProps;\n}\n\n/** Properties of a [PhysicalType]($backend)\n * @public\n * @extensions\n */\nexport interface PhysicalTypeProps extends TypeDefinitionElementProps {\n /** The [PhysicalMaterial]($backend) that makes up this physical type. */\n physicalMaterial?: RelatedElementProps;\n}\n\n/** Properties of a [InformationPartitionElement]($backend)\n * @public\n * @extensions\n */\nexport interface InformationPartitionElementProps extends ElementProps {\n description?: string;\n}\n\n/** Options controlling which properties are included or excluded when querying [[DisplayStyleProps]].\n * @see [[ViewStateLoadProps]] and [[ElementLoadOptions]].\n * @public\n * @extensions\n */\nexport interface DisplayStyleLoadProps {\n /** If true, the lists of element Ids in the display style's schedule script will be empty.\n * The element Ids are not required on the frontend for display and can be quite large.\n */\n omitScheduleScriptElementIds?: boolean;\n /** If true, [[DisplayStyleSettingsProps.excludedElements]] will be compressed into a single compact string; otherwise they will be expanded into an array of strings.\n * The number of Ids may be quite large, so the compressed format is preferred, especially when communicating between the backend and frontend.\n */\n compressExcludedElementIds?: boolean;\n}\n\n/** Options controlling which properties are included or excluded when querying [[RenderTimelineProps]].\n * @see [[ElementLoadOptions.renderTimeline]].\n * @public\n * @extensions\n */\nexport interface RenderTimelineLoadProps {\n /** If true, the lists of element Ids in the schedule script will be empty.\n * The element Ids can be extremely numerous and are not required on the frontend for display, so they are omitted by default by [DisplayStyleState.load]($frontend).\n */\n omitScriptElementIds?: boolean;\n}\n\n/** Options used to specify properties to include or exclude when querying [[ElementProps]] with functions like\n * [IModelDb.Elements.getElementProps]($backend) and [IModelConnection.Elements.loadProps]($frontend).\n * @public\n * @extensions\n */\nexport interface ElementLoadOptions {\n /** if true, only load the members of [[ElementProps]], and no members from subclasses */\n onlyBaseProperties?: boolean;\n /** If true, include the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * Geometry streams can consist of many megabytes worth of JSON, so they are omitted by default.\n */\n wantGeometry?: boolean;\n /** When including a geometry stream containing brep entries, whether to return the raw brep data or proxy geometry, false when undefined */\n /** If true, include [[BRepEntity.DataProps.data]] in the [[GeometryStreamProps]] for [[GeometricElementProps]] and [[GeometryPartProps]].\n * The data is a potentially large base-64-encoded opaque binary blob that cannot be directly inspected or manipulated on the frontend, so it is omitted by default.\n */\n wantBRepData?: boolean;\n /** Options controlling which properties of [[DisplayStyleProps]] to include or exclude. */\n displayStyle?: DisplayStyleLoadProps;\n /** Options controlling which properties of [[RenderTimelineProps]] to include or exclude. */\n renderTimeline?: RenderTimelineLoadProps;\n}\n\n/** Parameters to specify what element to load for functions like [IModelDb.Elements.getElementProps]($backend).\n * @public\n * @extensions\n */\nexport interface ElementLoadProps extends ElementLoadOptions {\n id?: Id64String;\n /** The properties of the Code of the element to load.\n * @note the Value member is required even though it is not declared so here. If no value is supplied, no element will ever be loaded.\n * TODO: change to Required<CodeProps> in Version 4.0\n */\n code?: CodeProps;\n federationGuid?: GuidString;\n}\n\n/** Properties of an [ElementAspect]($backend)\n * @public\n * @extensions\n */\nexport interface ElementAspectProps extends EntityProps {\n element: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSourceAspect]($backend) that stores synchronization information for an element originating from an external source.\n * @public\n * @extensions\n */\nexport interface ExternalSourceAspectProps extends ElementAspectProps {\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\n */\n scope: RelatedElementProps;\n /** The identifier of the object in the source repository. */\n identifier: string;\n /** The kind of object within the source repository. */\n kind: string;\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\n * If present, this value must be guaranteed to change when any of the source object's content changes.\n */\n version?: string;\n /** The optional cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\n checksum?: string;\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\n * @note Warning: if defined, jsonProperties must be a *string*, specifically a valid JSON string.\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\n */\n jsonProperties?: any;\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\n source?: RelatedElementProps;\n}\n\n/** Properties of an [ExternalSource]($backend)\n * @beta\n */\nexport interface ExternalSourceProps extends ElementProps {\n repository?: RelatedElementProps;\n connectorName?: string;\n connectorVersion?: string;\n}\n\n/** The role that an attached [ExternalSource]($backend) plays.\n * @beta\n */\nexport enum ExternalSourceAttachmentRole {\n /** The attached [ExternalSource]($backend) provides context. */\n SpecifyContext = 0,\n /** The attached [ExternalSource]($backend) models a part of the whole. */\n SpecifyPart = 1,\n}\n\n/** Properties of an [ExternalSourceAttachment]($backend)\n * @beta\n */\nexport interface ExternalSourceAttachmentProps extends ElementProps {\n attaches?: RelatedElementProps;\n role?: ExternalSourceAttachmentRole;\n translation?: XYZProps;\n yaw?: number;\n pitch?: number;\n roll?: number;\n scale?: XYZProps;\n}\n\n/** Properties of an [ChannelRootAspect]($backend) that identifies an Element as the root of a *channel* which is a subset of the overall iModel hierarchy that is independently maintained.\n * @public\n * @extensions\n */\nexport interface ChannelRootAspectProps extends ElementAspectProps {\n /** The owner of the channel */\n owner: string;\n}\n\n/** Properties of a [LineStyle]($backend)\n * @public\n * @extensions\n */\nexport interface LineStyleProps extends DefinitionElementProps {\n description?: string;\n /** The JSON string line style definition element data [LineStyleDefinition.StyleProps]($backend) */\n data: string;\n}\n\n/** Properties of a [LightLocation]($backend)\n * @internal\n */\nexport interface LightLocationProps extends GeometricElement3dProps {\n enabled?: boolean;\n}\n\n/** The *rank* for a Category\n * @public\n * @extensions\n */\nexport enum Rank {\n /** This category is predefined by the system */\n System = 0,\n /** This category is defined by a schema. Elements in this category are not recognized by system classes. */\n Domain = 1,\n /** This category is defined by an application. Elements in this category are not recognized by system and schema classes. */\n Application = 2,\n /** This category is defined by a user. Elements in this category are not recognized by system, schema, and application classes. */\n User = 3,\n}\n\n/** Parameters of a [Category]($backend)\n * @public\n * @extensions\n */\nexport interface CategoryProps extends DefinitionElementProps {\n rank?: Rank;\n description?: string;\n}\n\n/** Parameters of a [SubCategory]($backend)\n * @public\n * @extensions\n */\nexport interface SubCategoryProps extends DefinitionElementProps {\n appearance?: SubCategoryAppearance.Props;\n description?: string;\n}\n\n/** Parameters of a [UrlLink]($backend)\n * @public\n * @extensions\n */\nexport interface UrlLinkProps extends ElementProps {\n description?: string;\n url?: string;\n}\n\n/** Parameters of a [RepositoryLink]($backend)\n * @public\n * @extensions\n */\nexport interface RepositoryLinkProps extends UrlLinkProps {\n repositoryGuid?: GuidString;\n format?: string;\n}\n\n/** The properties of a [SynchronizationConfigLink]($backend)\n * @beta\n */\nexport interface SynchronizationConfigLinkProps extends UrlLinkProps {\n lastSuccessfulRun?: string;\n}\n\n/** Wire format describing a [RenderTimeline]($backend).\n * @public\n * @extensions\n */\nexport interface RenderTimelineProps extends ElementProps {\n /** An optional human-readable description of the timeline. */\n description?: string;\n /** The stringified JSON representation of the instructions for visualizing change over time.\n * @see [[RenderSchedule.ScriptProps]] for the JSON interface.\n */\n script: string;\n}\n\n/** Properties of a [SheetIndexEntry]($backend).\n * @beta\n*/\nexport interface SheetIndexEntryProps extends ElementProps {\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\n entryPriority: number;\n}\n\n/** Properties of a [SheetIndexFolder]($backend)\n * @beta\n */\nexport type SheetIndexFolderProps = SheetIndexEntryProps;\n\n/** Properties of a [SheetIndexReference]($backend)\n * @beta\n */\nexport interface SheetIndexReferenceProps extends SheetIndexEntryProps {\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\n sheetIndex?: RelatedElementProps;\n}\n\n/** Properties of a [SheetReference]($backend)\n * @beta\n */\nexport interface SheetReferenceProps extends SheetIndexEntryProps {\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\n sheet?: RelatedElementProps;\n}\n"]}
@@ -2,8 +2,6 @@
2
2
  * @module iModels
3
3
  */
4
4
  import { BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelStatus, LoggingMetaData } from "@itwin/core-bentley";
5
- export { BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus, } from "@itwin/core-bentley";
6
- export type { GetMetaDataFunction, LogFunction, LoggingMetaData } from "@itwin/core-bentley";
7
5
  /** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].
8
6
  * The values within each of these `enum`s are guaranteed not to conflict with one another.
9
7
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"IModelError.d.ts","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAmB,YAAY,EAAE,eAAe,EACxH,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE7F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,eAAe,CAAC;AAE5G;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,YAAY;gBACxB,WAAW,EAAE,iBAAiB,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAG3G;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,gCAAgC;IAChC,IAAI,IAAI;IACR,mJAAmJ;IACnJ,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAI;CACd;AAED;;;EAGE;AACF,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;SAGK;IACL,KAAK,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;EAIE;AACF,qBAAa,qBAAsB,SAAQ,WAAW;IAE7C,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;gBAEhC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAE,eAAe,EAAE;CAKjG;AAED,cAAc;AACd,qBAAa,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AC;gBAEhC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAE,eAAe,EAAE;CAKjG;AAED,cAAc;AACd,qBAAa,WAAY,SAAQ,WAAW;gBACvB,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAIxD;AAED,cAAc;AACd,qBAAa,kBAAmB,SAAQ,WAAW;gBAC9B,OAAO,EAAE,MAAM;CAInC;AAED,cAAc;AACd,qBAAa,YAAa,SAAQ,WAAW;gBACxB,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe;CAIrG;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;;CAI9C"}
@@ -6,7 +6,6 @@
6
6
  * @module iModels
7
7
  */
8
8
  import { BentleyError, IModelHubStatus, IModelStatus, } from "@itwin/core-bentley";
9
- export { BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus, } from "@itwin/core-bentley";
10
9
  /** The error type thrown by this module.
11
10
  * Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].
12
11
  * @see [[ITwinError]]
@@ -1 +1 @@
1
- {"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,YAAY,EAA6D,eAAe,EAAE,YAAY,GACvG,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GACtF,MAAM,qBAAqB,CAAC;AAU7B;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,YAAY;IAC3C,YAAmB,WAAuC,EAAE,OAAe,EAAE,WAA6B;QACxG,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;CACF;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------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData,\n} from \"@itwin/core-bentley\";\n\nexport {\n BentleyStatus, BentleyError, IModelStatus, BriefcaseStatus, DbResult, ChangeSetStatus,\n} from \"@itwin/core-bentley\";\n\nexport type { GetMetaDataFunction, LogFunction, LoggingMetaData } from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].\n * @see [[ITwinError]]\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @public @deprecated in 4.10 Use [InUseLock]($common) instead.\n*/\nexport interface ConflictingLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @public @deprecated in 4.10 Use [InUseLocksError]($common) instead.\n*/\nexport class ConflictingLocksError extends IModelError {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public conflictingLocks?: ConflictingLock[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\n this.conflictingLocks = conflictingLocks;\n }\n\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"No Content\");\n }\n}\n"]}
1
+ {"version":3,"file":"IModelError.js","sourceRoot":"","sources":["../../src/IModelError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,YAAY,EAA6D,eAAe,EAAE,YAAY,GACvG,MAAM,qBAAqB,CAAC;AAQ7B;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,YAA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,cAAe,SAAQ,WAAW;IAC7C;QACE,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\nimport {\n BentleyError, BentleyStatus, BriefcaseStatus, ChangeSetStatus, DbResult, IModelHubStatus, IModelStatus, LoggingMetaData,\n} from \"@itwin/core-bentley\";\n\n/** Numeric values for common errors produced by iTwin.js APIs, typically provided by [[IModelError]].\n * The values within each of these `enum`s are guaranteed not to conflict with one another.\n * @public\n */\nexport type IModelErrorNumber = IModelStatus | DbResult | BentleyStatus | BriefcaseStatus | ChangeSetStatus;\n\n/** The error type thrown by this module.\n * Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].\n * @see [[ITwinError]]\n * @see [[IModelErrorNumber]] for commonly-used error codes.\n * @public\n */\nexport class IModelError extends BentleyError {\n public constructor(errorNumber: IModelErrorNumber | number, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n }\n}\n\n/** The state of a lock. See [Acquiring locks on elements.]($docs/learning/backend/ConcurrencyControl.md#acquiring-locks-on-elements).\n * @public\n */\nexport enum LockState {\n /** The element is not locked */\n None = 0,\n /** Holding a shared lock on an element blocks other users from acquiring the Exclusive lock it. More than one user may acquire the shared lock. */\n Shared = 1,\n /** A Lock that permits modifications to an element and blocks other users from making modifications to it.\n * Holding an exclusive lock on an \"owner\" (a model or a parent element), implicitly exclusively locks all its members.\n */\n Exclusive = 2,\n}\n\n/** Detailed information about a particular object Lock that is causing the Lock update conflict.\n * An example of a lock update conflict would be attempting to use [LockControl.acquireLocks]($backend) on an object that is already locked by another Briefcase.\n * @public @deprecated in 4.10 Use [InUseLock]($common) instead.\n*/\nexport interface ConflictingLock {\n /** Id of the object that is causing conflict. */\n objectId: string;\n /**\n * The level of conflicting lock. Possible values are {@link LockState.Shared}, {@link LockState.Exclusive}.\n * See {@link LockState}.\n */\n state: LockState;\n /** An array of Briefcase ids that hold this lock. */\n briefcaseIds: number[];\n}\n\n/**\n * An error raised when there is a lock conflict detected.\n * Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.\n * @public @deprecated in 4.10 Use [InUseLocksError]($common) instead.\n*/\nexport class ConflictingLocksError extends IModelError {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public conflictingLocks?: ConflictingLock[];\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n constructor(message: string, getMetaData?: LoggingMetaData, conflictingLocks?: ConflictingLock[]) {\n super(IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);\n this.conflictingLocks = conflictingLocks;\n }\n\n}\n\n/** @public */\nexport class ServerError extends IModelError {\n public constructor(errorNumber: number, message: string) {\n super(errorNumber, message);\n this.name = `Server error (${errorNumber})`;\n }\n}\n\n/** @public */\nexport class ServerTimeoutError extends ServerError {\n public constructor(message: string) {\n super(IModelStatus.ServerTimeout, message);\n this.name = \"Server timeout error\";\n }\n}\n\n/** @public */\nexport class BackendError extends IModelError {\n public constructor(errorNumber: number, name: string, message: string, getMetaData?: LoggingMetaData) {\n super(errorNumber, message, getMetaData);\n this.name = name;\n }\n}\n\n/** Intended for API \"no content\" semantics where the error case should not trigger application failure monitoring systems.\n * @public\n */\nexport class NoContentError extends IModelError {\n public constructor() {\n super(IModelStatus.NoContent, \"No Content\");\n }\n}\n"]}
@@ -10,9 +10,9 @@ import { CURRENT_REQUEST } from "./rpc/core/RpcRegistry";
10
10
  import { aggregateLoad, RpcRequest } from "./rpc/core/RpcRequest";
11
11
  import { RpcRoutingToken } from "./rpc/core/RpcRoutingToken";
12
12
  import { IpcSession } from "./ipc/IpcSession";
13
- import { BentleyStatus, IModelError, NoContentError } from "./IModelError";
13
+ import { IModelError, NoContentError } from "./IModelError";
14
14
  import { RpcRequestEvent, RpcRequestStatus } from "./rpc/core/RpcConstants";
15
- import { BeDuration } from "@itwin/core-bentley";
15
+ import { BeDuration, BentleyStatus } from "@itwin/core-bentley";
16
16
  /** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,
17
17
  * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.
18
18
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"RpcInterface.js","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAA4B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAyB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAyBjD;;;GAGG;AACH,MAAM,OAAgB,YAAY;IAExB,MAAM,CAAC,QAAQ,CAAC,OAAmB,EAAE,QAAoB;QAC/D,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBAC1C,OAAO,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU,CA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AO,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAEnF,MAAM,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,QAAQ,EAAE,CAAC;AACpB,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,OAA2B,EAAE,MAAwB,EAAE,QAA4B;IAC/G,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,aAAoC,EAAE,KAAK,IAAI,EAAE;YACtG,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,yCAAyC,CAAC,CAAC;YACxF,CAAC;YAED,WAAW,GAAG,IAAI,CAAC;YAEnB,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAC;gBAClC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,sEAAsE;YACrF,CAAC;QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,cAAc,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { RpcConfiguration, RpcConfigurationSupplier } from \"./rpc/core/RpcConfiguration\";\nimport { CURRENT_REQUEST } from \"./rpc/core/RpcRegistry\";\nimport { aggregateLoad, RpcRequest } from \"./rpc/core/RpcRequest\";\nimport { RpcRoutingToken } from \"./rpc/core/RpcRoutingToken\";\nimport { InterceptedRpcRequest, IpcSession } from \"./ipc/IpcSession\";\nimport { RpcSerializedValue } from \"./rpc/core/RpcMarshaling\";\nimport { RpcManagedStatus } from \"./rpc/core/RpcProtocol\";\nimport { BentleyStatus, IModelError, NoContentError } from \"./IModelError\";\nimport { RpcRequestEvent, RpcRequestStatus } from \"./rpc/core/RpcConstants\";\nimport { BeDuration } from \"@itwin/core-bentley\";\nimport { RpcNotFoundResponse } from \"./rpc/core/RpcControl\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * Specifies the required static properties of an RpcInterface class.\n * These properties are used to identify RPC requests and responses.\n * @beta\n */\nexport interface RpcInterfaceDefinition<T extends RpcInterface = RpcInterface> { prototype: T, interfaceName: string, interfaceVersion: string }\n\n/**\n * A class that implements the operations of an RPC interface.\n * @beta\n */\nexport type RpcInterfaceImplementation<T extends RpcInterface = RpcInterface> = new () => T;\n\ninterface SemverType {\n major: number;\n minor: number;\n patch: number;\n prerelease?: string;\n}\n\n/** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,\n * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.\n * @public\n */\nexport abstract class RpcInterface {\n\n private static findDiff(backend: SemverType, frontend: SemverType) {\n return backend.major !== frontend.major ? \"major\" :\n backend.minor !== frontend.minor ? \"minor\" :\n backend.patch !== frontend.patch ? \"patch\" :\n backend.prerelease !== frontend.prerelease ? \"prerelease\" :\n \"same\";\n }\n\n private static parseVer(version: string): SemverType {\n // separate the version from the prerelease tag\n const parts = version.split(/[:-]/);\n // Split the major.minor.path into separate components\n const prefix = parts[0].split(\".\");\n\n const ver: SemverType = { major: Number(prefix[0]), minor: Number(prefix[1]), patch: Number(prefix[2]) };\n if (parts.length > 1)\n ver.prerelease = parts[1];\n return ver;\n }\n\n /** Determines whether the backend version of an RPC interface is compatible (according to semantic versioning) with the frontend version of the interface. */\n public static isVersionCompatible(backend: string, frontend: string): boolean {\n if (backend === frontend)\n return true; // most common case, versions are identical\n\n const backendSemver = this.parseVer(backend);\n const frontendSemver = this.parseVer(frontend);\n\n // if either has a prerelease tag, they are not compatible unless version strings are identical\n if (backendSemver.prerelease || frontendSemver.prerelease)\n return false;\n\n const difference = this.findDiff(backendSemver, frontendSemver);\n // If the major versions are different, the versions are not compatible\n if (difference === \"major\")\n return false;\n\n // special case for major version 0. If patch difference, backend patch must be greater than frontend patch\n if (backendSemver.major === 0)\n return (difference === \"patch\" && frontendSemver.patch < backendSemver.patch);\n\n // patch difference is fine. If minor versions differ, compatible as long as backend minor version is greater\n return difference === \"patch\" || (difference === \"minor\" && frontendSemver.minor < backendSemver.minor);\n }\n\n /** The configuration for the RPC interface.\n * @internal\n */\n public readonly configuration: RpcConfiguration;\n\n /** @internal */\n public readonly routing: RpcRoutingToken;\n\n /** @beta */\n public constructor(routing: RpcRoutingToken = RpcRoutingToken.default) {\n this.routing = routing;\n this.configuration = RpcConfiguration.supply(this);\n }\n\n /** Obtains the implementation result for an RPC operation. */\n public async forward<T = any>(parameters: IArguments): Promise<T> {\n const parametersCompat = (arguments.length === 1 && typeof (parameters) === \"object\") ? parameters : arguments;\n const parametersArray = Array.isArray(parametersCompat) ? parametersCompat : Array.prototype.slice.call(parametersCompat);\n const operationName = parametersArray.pop();\n\n const session = IpcSession.active;\n if (session) {\n return intercept(session, this, operationName, parametersArray);\n } else {\n const request = new (this.configuration.protocol.requestType as any)(this, operationName, parametersArray) as RpcRequest;\n request.submit(); // eslint-disable-line @typescript-eslint/no-floating-promises\n (this as any)[CURRENT_REQUEST] = request;\n return request.response;\n }\n }\n\n /** @internal */\n public configurationSupplier: RpcConfigurationSupplier | undefined;\n}\n\nRpcInterface.prototype.configurationSupplier = undefined;\n\nclass InterceptedRequest extends RpcRequest {\n protected override async load(): Promise<RpcSerializedValue> { throw new Error(); }\n protected override async send(): Promise<number> { throw new Error(); }\n protected override setHeader(_name: string, _value: string): void { throw new Error(); }\n}\n\nasync function intercept(session: IpcSession, client: RpcInterface, operation: string, parameters: any[]) {\n const request = new InterceptedRequest(client, operation, []);\n (client as any)[CURRENT_REQUEST] = request;\n\n const context = await client.configuration.protocol.serialize(request);\n request.parameters = parameters;\n\n const info: InterceptedRpcRequest = {\n definition: {\n interfaceName: context.operation.interfaceDefinition,\n interfaceVersion: context.operation.interfaceVersion,\n },\n operation,\n parameters,\n context: {\n applicationId: context.applicationId,\n applicationVersion: context.applicationVersion,\n id: context.id,\n sessionId: context.sessionId,\n protocolVersion: (context.protocolVersion || 0).toString(),\n },\n };\n\n const dispatch = async () => {\n aggregateLoad.lastRequest = new Date().getTime();\n\n const response = await session.handleRpc(info);\n\n aggregateLoad.lastResponse = new Date().getTime();\n\n if (typeof (response) === \"object\" && response.hasOwnProperty(\"iTwinRpcCoreResponse\") && response.hasOwnProperty(\"managedStatus\")) {\n const status: RpcManagedStatus = response;\n\n if (status.managedStatus === \"pending\") {\n return handlePending(request, status, dispatch);\n } else if (status.managedStatus === \"notFound\") {\n return handleNotFound(request, status, dispatch);\n } else if (status.managedStatus === \"noContent\") {\n return handleNoContent();\n }\n } else {\n return response;\n }\n };\n\n return dispatch();\n}\n\nasync function handlePending(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n request._status = RpcRequestStatus.Pending;\n request._extendedStatus = (status.responseValue as { message: string }).message;\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, request);\n\n const delay = request.operation.policy.retryInterval(request.client.configuration);\n\n await BeDuration.wait(delay);\n return dispatch();\n}\n\nasync function handleNotFound(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n return new Promise((resolve, reject) => {\n let resubmitted = false;\n\n RpcRequest.notFoundHandlers.raiseEvent(request, status.responseValue as RpcNotFoundResponse, async () => {\n if (resubmitted) {\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n }\n\n resubmitted = true;\n\n try {\n const response = await dispatch();\n resolve(response);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n }, reject);\n });\n}\n\nasync function handleNoContent() {\n throw new NoContentError();\n}\n"]}
1
+ {"version":3,"file":"RpcInterface.js","sourceRoot":"","sources":["../../src/RpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAA4B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAyB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAyBhE;;;GAGG;AACH,MAAM,OAAgB,YAAY;IAExB,MAAM,CAAC,QAAQ,CAAC,OAAmB,EAAE,QAAoB;QAC/D,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBAC1C,OAAO,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;wBACzD,MAAM,CAAC;IACjB,CAAC;IAEO,MAAM,CAAC,QAAQ,CAAC,OAAe;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AAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,QAAQ,EAAE,CAAC;AACpB,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,OAA2B,EAAE,MAAwB,EAAE,QAA4B;IAC/G,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,aAAoC,EAAE,KAAK,IAAI,EAAE;YACtG,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,yCAAyC,CAAC,CAAC;YACxF,CAAC;YAED,WAAW,GAAG,IAAI,CAAC;YAEnB,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAC;gBAClC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,sEAAsE;YACrF,CAAC;QACH,CAAC,EAAE,MAAM,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,MAAM,IAAI,cAAc,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { RpcConfiguration, RpcConfigurationSupplier } from \"./rpc/core/RpcConfiguration\";\nimport { CURRENT_REQUEST } from \"./rpc/core/RpcRegistry\";\nimport { aggregateLoad, RpcRequest } from \"./rpc/core/RpcRequest\";\nimport { RpcRoutingToken } from \"./rpc/core/RpcRoutingToken\";\nimport { InterceptedRpcRequest, IpcSession } from \"./ipc/IpcSession\";\nimport { RpcSerializedValue } from \"./rpc/core/RpcMarshaling\";\nimport { RpcManagedStatus } from \"./rpc/core/RpcProtocol\";\nimport { IModelError, NoContentError } from \"./IModelError\";\nimport { RpcRequestEvent, RpcRequestStatus } from \"./rpc/core/RpcConstants\";\nimport { BeDuration, BentleyStatus } from \"@itwin/core-bentley\";\nimport { RpcNotFoundResponse } from \"./rpc/core/RpcControl\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * Specifies the required static properties of an RpcInterface class.\n * These properties are used to identify RPC requests and responses.\n * @beta\n */\nexport interface RpcInterfaceDefinition<T extends RpcInterface = RpcInterface> { prototype: T, interfaceName: string, interfaceVersion: string }\n\n/**\n * A class that implements the operations of an RPC interface.\n * @beta\n */\nexport type RpcInterfaceImplementation<T extends RpcInterface = RpcInterface> = new () => T;\n\ninterface SemverType {\n major: number;\n minor: number;\n patch: number;\n prerelease?: string;\n}\n\n/** An RPC interface is a set of operations exposed by a service that a client can call, using configurable protocols,\n * in a platform-independent way. TheRpcInterface class is the base class for RPC interface definitions and implementations.\n * @public\n */\nexport abstract class RpcInterface {\n\n private static findDiff(backend: SemverType, frontend: SemverType) {\n return backend.major !== frontend.major ? \"major\" :\n backend.minor !== frontend.minor ? \"minor\" :\n backend.patch !== frontend.patch ? \"patch\" :\n backend.prerelease !== frontend.prerelease ? \"prerelease\" :\n \"same\";\n }\n\n private static parseVer(version: string): SemverType {\n // separate the version from the prerelease tag\n const parts = version.split(/[:-]/);\n // Split the major.minor.path into separate components\n const prefix = parts[0].split(\".\");\n\n const ver: SemverType = { major: Number(prefix[0]), minor: Number(prefix[1]), patch: Number(prefix[2]) };\n if (parts.length > 1)\n ver.prerelease = parts[1];\n return ver;\n }\n\n /** Determines whether the backend version of an RPC interface is compatible (according to semantic versioning) with the frontend version of the interface. */\n public static isVersionCompatible(backend: string, frontend: string): boolean {\n if (backend === frontend)\n return true; // most common case, versions are identical\n\n const backendSemver = this.parseVer(backend);\n const frontendSemver = this.parseVer(frontend);\n\n // if either has a prerelease tag, they are not compatible unless version strings are identical\n if (backendSemver.prerelease || frontendSemver.prerelease)\n return false;\n\n const difference = this.findDiff(backendSemver, frontendSemver);\n // If the major versions are different, the versions are not compatible\n if (difference === \"major\")\n return false;\n\n // special case for major version 0. If patch difference, backend patch must be greater than frontend patch\n if (backendSemver.major === 0)\n return (difference === \"patch\" && frontendSemver.patch < backendSemver.patch);\n\n // patch difference is fine. If minor versions differ, compatible as long as backend minor version is greater\n return difference === \"patch\" || (difference === \"minor\" && frontendSemver.minor < backendSemver.minor);\n }\n\n /** The configuration for the RPC interface.\n * @internal\n */\n public readonly configuration: RpcConfiguration;\n\n /** @internal */\n public readonly routing: RpcRoutingToken;\n\n /** @beta */\n public constructor(routing: RpcRoutingToken = RpcRoutingToken.default) {\n this.routing = routing;\n this.configuration = RpcConfiguration.supply(this);\n }\n\n /** Obtains the implementation result for an RPC operation. */\n public async forward<T = any>(parameters: IArguments): Promise<T> {\n const parametersCompat = (arguments.length === 1 && typeof (parameters) === \"object\") ? parameters : arguments;\n const parametersArray = Array.isArray(parametersCompat) ? parametersCompat : Array.prototype.slice.call(parametersCompat);\n const operationName = parametersArray.pop();\n\n const session = IpcSession.active;\n if (session) {\n return intercept(session, this, operationName, parametersArray);\n } else {\n const request = new (this.configuration.protocol.requestType as any)(this, operationName, parametersArray) as RpcRequest;\n request.submit(); // eslint-disable-line @typescript-eslint/no-floating-promises\n (this as any)[CURRENT_REQUEST] = request;\n return request.response;\n }\n }\n\n /** @internal */\n public configurationSupplier: RpcConfigurationSupplier | undefined;\n}\n\nRpcInterface.prototype.configurationSupplier = undefined;\n\nclass InterceptedRequest extends RpcRequest {\n protected override async load(): Promise<RpcSerializedValue> { throw new Error(); }\n protected override async send(): Promise<number> { throw new Error(); }\n protected override setHeader(_name: string, _value: string): void { throw new Error(); }\n}\n\nasync function intercept(session: IpcSession, client: RpcInterface, operation: string, parameters: any[]) {\n const request = new InterceptedRequest(client, operation, []);\n (client as any)[CURRENT_REQUEST] = request;\n\n const context = await client.configuration.protocol.serialize(request);\n request.parameters = parameters;\n\n const info: InterceptedRpcRequest = {\n definition: {\n interfaceName: context.operation.interfaceDefinition,\n interfaceVersion: context.operation.interfaceVersion,\n },\n operation,\n parameters,\n context: {\n applicationId: context.applicationId,\n applicationVersion: context.applicationVersion,\n id: context.id,\n sessionId: context.sessionId,\n protocolVersion: (context.protocolVersion || 0).toString(),\n },\n };\n\n const dispatch = async () => {\n aggregateLoad.lastRequest = new Date().getTime();\n\n const response = await session.handleRpc(info);\n\n aggregateLoad.lastResponse = new Date().getTime();\n\n if (typeof (response) === \"object\" && response.hasOwnProperty(\"iTwinRpcCoreResponse\") && response.hasOwnProperty(\"managedStatus\")) {\n const status: RpcManagedStatus = response;\n\n if (status.managedStatus === \"pending\") {\n return handlePending(request, status, dispatch);\n } else if (status.managedStatus === \"notFound\") {\n return handleNotFound(request, status, dispatch);\n } else if (status.managedStatus === \"noContent\") {\n return handleNoContent();\n }\n } else {\n return response;\n }\n };\n\n return dispatch();\n}\n\nasync function handlePending(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n request._status = RpcRequestStatus.Pending;\n request._extendedStatus = (status.responseValue as { message: string }).message;\n RpcRequest.events.raiseEvent(RpcRequestEvent.PendingUpdateReceived, request);\n\n const delay = request.operation.policy.retryInterval(request.client.configuration);\n\n await BeDuration.wait(delay);\n return dispatch();\n}\n\nasync function handleNotFound(request: InterceptedRequest, status: RpcManagedStatus, dispatch: () => Promise<any>) {\n return new Promise((resolve, reject) => {\n let resubmitted = false;\n\n RpcRequest.notFoundHandlers.raiseEvent(request, status.responseValue as RpcNotFoundResponse, async () => {\n if (resubmitted) {\n throw new IModelError(BentleyStatus.ERROR, `Already resubmitted using this handler.`);\n }\n\n resubmitted = true;\n\n try {\n const response = await dispatch();\n resolve(response);\n } catch (err) {\n reject(err); // eslint-disable-line @typescript-eslint/prefer-promise-reject-errors\n }\n }, reject);\n });\n}\n\nasync function handleNoContent() {\n throw new NoContentError();\n}\n"]}
@@ -1,6 +1,3 @@
1
- /** @packageDocumentation
2
- * @module RpcInterface
3
- */
4
1
  import { BackendReadable } from "../../BackendTypes";
5
2
  import { RpcProtocol } from "./RpcProtocol";
6
3
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,yBAAiB,sBAAsB,CAAC;IACtC,SAAgB,aAAa,IAAI,sBAAsB,CAEtD;CACF;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACZ,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,kBAAkB;IAe1F,4BAA4B;WACd,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,GAAG;CAoB7F"}
1
+ {"version":3,"file":"RpcMarshaling.d.ts","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,gBAAgB;AAChB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,yBAAiB,sBAAsB,CAAC;IACtC,SAAgB,aAAa,IAAI,sBAAsB,CAEtD;CACF;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,gBAAgB;AAChB,yBAAiB,kBAAkB,CAAC;IAClC,SAAgB,MAAM,CAAC,OAAO,SAAK,EAAE,IAAI,GAAE,UAAU,EAAO,GAAG,kBAAkB,CAEhF;CACF;AAED,gBAAgB;AAChB,qBAAa,aAAa;IACxB,OAAO;IAEP,0BAA0B;WACZ,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,kBAAkB;IAe1F,4BAA4B;WACd,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,GAAG;CAoB7F"}
@@ -5,7 +5,8 @@
5
5
  /** @packageDocumentation
6
6
  * @module RpcInterface
7
7
  */
8
- import { BentleyStatus, IModelError } from "../../IModelError";
8
+ import { BentleyStatus } from "@itwin/core-bentley";
9
+ import { IModelError } from "../../IModelError";
9
10
  // cspell:ignore unmarshal
10
11
  /* eslint-disable @typescript-eslint/no-deprecated */
11
12
  function isBuffer(val) {
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAI/D,0BAA0B;AAC1B,qDAAqD;AAErD,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,UAAU,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9I,CAAC;AAED,IAAI,gBAAoC,CAAC;AACzC,IAAI,cAAc,GAAG,CAAC,CAAC;AAUvB,gBAAgB;AAChB,MAAM,KAAW,sBAAsB,CAItC;AAJD,WAAiB,sBAAsB;IACrC,SAAgB,aAAa;QAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC3D,CAAC;IAFe,oCAAa,gBAE5B,CAAA;AACH,CAAC,EAJgB,sBAAsB,KAAtB,sBAAsB,QAItC;AAUD,gBAAgB;AAChB,MAAM,KAAW,kBAAkB,CAIlC;AAJD,WAAiB,kBAAkB;IACjC,SAAgB,MAAM,CAAC,OAAO,GAAG,EAAE,EAAE,OAAqB,EAAE;QAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAFe,yBAAM,SAErB,CAAA;AACH,CAAC,EAJgB,kBAAkB,KAAlB,kBAAkB,QAIlC;AAED,gBAAgB;AAChB,MAAM,OAAO,aAAa;IACxB,gBAAwB,CAAC;IAEzB,0BAA0B;IACnB,MAAM,C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AAE,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/F,KAAK,CAAC,KAAK,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus, IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (value === undefined)\n return serialized;\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: Uint8Array): MarshalingBinaryMarker | undefined {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): Uint8Array {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: unknown) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"RpcMarshaling.js","sourceRoot":"","sources":["../../../../src/rpc/core/RpcMarshaling.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,0BAA0B;AAC1B,qDAAqD;AAErD,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,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AAC;gBACxC,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBACrD,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC;YAC7B,CAAC;YAED,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAc;QACxC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;YACtD,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACtF,KAAK,CAAC,IAAI,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACzF,KAAK,CAAC,OAAO,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YAC/F,KAAK,CAAC,KAAK,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendReadable } from \"../../BackendTypes\";\nimport { RpcProtocol } from \"./RpcProtocol\";\n\n// cspell:ignore unmarshal\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nfunction isBuffer(val: any): boolean {\n return val && typeof (val.constructor) !== \"undefined\" && typeof (val.constructor.isBuffer) === \"function\" && val.constructor.isBuffer(val);\n}\n\nlet marshalingTarget: RpcSerializedValue;\nlet chunkThreshold = 0;\n\n/** @internal */\nexport interface MarshalingBinaryMarker {\n isBinary: true;\n index: number;\n size: number;\n chunks: number;\n}\n\n/** @internal */\nexport namespace MarshalingBinaryMarker {\n export function createDefault(): MarshalingBinaryMarker {\n return { isBinary: true, index: 0, size: -1, chunks: 1 };\n }\n}\n\n/** @internal */\nexport interface RpcSerializedValue {\n objects: string;\n data: Uint8Array[];\n chunks?: number;\n stream?: BackendReadable;\n}\n\n/** @internal */\nexport namespace RpcSerializedValue {\n export function create(objects = \"\", data: Uint8Array[] = []): RpcSerializedValue {\n return { objects, data };\n }\n}\n\n/** @internal */\nexport class RpcMarshaling {\n private constructor() { }\n\n /** Serializes a value. */\n public static serialize(protocol: RpcProtocol | undefined, value: any): RpcSerializedValue {\n const serialized = RpcSerializedValue.create();\n\n if (value === undefined)\n return serialized;\n\n marshalingTarget = serialized;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return serialized;\n }\n\n /** Deserializes a value. */\n public static deserialize(protocol: RpcProtocol | undefined, value: RpcSerializedValue): any {\n if (value.objects === \"\") {\n return undefined;\n }\n\n marshalingTarget = value;\n chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;\n let result;\n try {\n result = JSON.parse(value.objects, (_key, _value) => WireFormat.unmarshal(_key, _value));\n } catch (error) {\n if (error instanceof SyntaxError)\n throw new IModelError(BentleyStatus.ERROR, `Invalid JSON: \"${value.objects}\"`);\n throw error;\n }\n marshalingTarget = undefined as any;\n chunkThreshold = 0;\n\n return result;\n }\n}\n\nclass WireFormat {\n /** JSON.stringify replacer callback. */\n public static marshal(this: any, _key: string, value: any) {\n const asBinary = WireFormat.marshalBinary(value);\n if (asBinary) {\n return asBinary;\n }\n\n const asError = WireFormat.marshalError(value);\n if (asError) {\n return asError;\n }\n\n return value;\n }\n\n /** JSON.parse reviver callback. */\n public static unmarshal(_key: string, value: any) {\n if (typeof (value) === \"object\" && value !== null && value.hasOwnProperty(\"isBinary\") && value.isBinary) {\n return WireFormat.unmarshalBinary(value);\n }\n\n return value;\n }\n\n private static marshalBinary(value: Uint8Array): MarshalingBinaryMarker | undefined {\n if (value instanceof Uint8Array || isBuffer(value)) {\n const marker: MarshalingBinaryMarker = { isBinary: true, index: -1, size: value.byteLength, chunks: 1 };\n\n if (chunkThreshold && value.byteLength > chunkThreshold) {\n marker.index = marshalingTarget.data.length;\n marker.chunks = 0;\n\n let cursor = value.byteOffset;\n const end = cursor + value.byteLength;\n let chunk = chunkThreshold;\n\n for (; ;) {\n if (cursor >= end) {\n break;\n }\n\n marshalingTarget.data.push(new Uint8Array(value.buffer, cursor, chunk));\n ++marker.chunks;\n cursor += chunk;\n\n const consumed = cursor - value.byteOffset;\n const remaining = value.byteLength - consumed;\n chunk = Math.min(chunkThreshold, remaining);\n }\n } else {\n marker.index = marshalingTarget.data.push(value) - 1;\n }\n\n return marker;\n } else {\n return undefined;\n }\n }\n\n private static unmarshalBinary(value: MarshalingBinaryMarker): Uint8Array {\n if (value.index >= marshalingTarget.data.length) {\n throw new IModelError(BentleyStatus.ERROR, `Cannot unmarshal missing binary value.`);\n }\n\n if (value.chunks === 0) {\n return new Uint8Array();\n } else if (value.chunks === 1) {\n return new Uint8Array(marshalingTarget.data[value.index]);\n } else {\n const buffer = new ArrayBuffer(value.size);\n const view = new Uint8Array(buffer);\n\n let cursor = 0;\n for (let c = 0; c !== value.chunks; ++c) {\n const chunk = marshalingTarget.data[value.index + c];\n view.set(chunk, cursor);\n cursor += chunk.byteLength;\n }\n\n return view;\n }\n }\n\n private static marshalError(value: unknown) {\n if (value instanceof Error) {\n const props = Object.getOwnPropertyDescriptors(value);\n props.isError = { configurable: true, enumerable: true, writable: true, value: true };\n props.name = { configurable: true, enumerable: true, writable: true, value: value.name };\n props.message = { configurable: true, enumerable: true, writable: true, value: value.message };\n props.stack = { configurable: true, enumerable: true, writable: true, value: value.stack };\n return Object.create(Object.prototype, props);\n }\n\n return undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMultipart.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI7D,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrF;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,wDAAwD;WAC1C,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,QAAQ;IAM7D,mDAAmD;WACrC,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,gBAAgB;IAIvE,2DAA2D;WACvC,YAAY,C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E,kBAAkB;IAQ9E,gBAAgB;IAChB,OAAc,QAAQ;6BACC,kBAAkB,GAAG,gBAAgB;2BAGjC,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;wBAGxD,MAAM,QAAQ,cAAc,SAAS,kBAAkB,GAAG,IAAI;MAG9E;CACH"}
@@ -5,7 +5,8 @@
5
5
  /** @packageDocumentation
6
6
  * @module RpcInterface
7
7
  */
8
- import { BentleyStatus, IModelError } from "../../IModelError";
8
+ import { BentleyStatus } from "@itwin/core-bentley";
9
+ import { IModelError } from "../../IModelError";
9
10
  /** Support for transporting RPC values using the HTTP multipart content type.
10
11
  * @internal
11
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"RpcMultipart.js","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiB/D;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB,wDAAwD;IACjD,MAAM,CAAC,UAAU,CAAC,KAAyB;QAChD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mDAAmD;IAC5C,MAAM,CAAC,YAAY,CAAC,KAAyB;QAClD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,2DAA2D;IACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,GAAsB;QACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,gBAAgB,CAAC,IAAoB,EAAE,KAAyB;QAC5E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gBAAgB;aACF,aAAQ,GAAG;QACvB,YAAY,CAAC,MAA0B;YACrC,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,KAAK,CAAC,YAAY,CAAC,IAAuB;YACxC,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,YAAY,CAAC,CAAS,EAAE,IAAoB,EAAE,KAAyB;YACrE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC;QAC5F,CAAC;KACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus, IModelError } from \"../../IModelError\";\nimport { BackendBuffer, BackendReadable } from \"../../BackendTypes\";\nimport { RpcSerializedValue } from \"../core/RpcMarshaling\";\nimport { HttpServerRequest } from \"../web/WebAppRpcProtocol\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nexport interface FormDataCommon {\n append(name: string, value: string | Blob | BackendBuffer, fileName?: string): void;\n}\n\n/** @internal */\nexport interface ReadableFormData extends BackendReadable {\n getHeaders(): { [key: string]: any };\n}\n\n/** Support for transporting RPC values using the HTTP multipart content type.\n * @internal\n */\nexport class RpcMultipart {\n /** Creates a multipart form object for an RPC value. */\n public static createForm(value: RpcSerializedValue): FormData {\n const form = new FormData();\n RpcMultipart.writeValueToForm(form, value);\n return form;\n }\n\n /** Creates a multipart stream for an RPC value. */\n public static createStream(value: RpcSerializedValue): ReadableFormData {\n return this.platform.createStream(value);\n }\n\n /** Obtains the RPC value from a multipart HTTP request. */\n public static async parseRequest(req: HttpServerRequest): Promise<RpcSerializedValue> {\n return this.platform.parseRequest(req);\n }\n\n /** @internal */\n public static writeValueToForm(form: FormDataCommon, value: RpcSerializedValue) {\n form.append(\"objects\", value.objects);\n\n for (let i = 0; i !== value.data.length; ++i) {\n this.platform.appendToForm(i, form, value);\n }\n }\n\n /** @internal */\n public static platform = {\n createStream(_value: RpcSerializedValue): ReadableFormData {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n async parseRequest(_req: HttpServerRequest): Promise<RpcSerializedValue> {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n appendToForm(i: number, form: FormDataCommon, value: RpcSerializedValue): void {\n form.append(`data-${i}`, new Blob([value.data[i]], { type: \"application/octet-stream\" }));\n },\n };\n}\n\n"]}
1
+ {"version":3,"file":"RpcMultipart.js","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiBhD;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB,wDAAwD;IACjD,MAAM,CAAC,UAAU,CAAC,KAAyB;QAChD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mDAAmD;IAC5C,MAAM,CAAC,YAAY,CAAC,KAAyB;QAClD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,2DAA2D;IACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,GAAsB;QACrD,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,gBAAgB,CAAC,IAAoB,EAAE,KAAyB;QAC5E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gBAAgB;aACF,aAAQ,GAAG;QACvB,YAAY,CAAC,MAA0B;YACrC,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,KAAK,CAAC,YAAY,CAAC,IAAuB;YACxC,MAAM,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,YAAY,CAAC,CAAS,EAAE,IAAoB,EAAE,KAAyB;YACrE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC;QAC5F,CAAC;KACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\nimport { BentleyStatus } from \"@itwin/core-bentley\";\nimport { IModelError } from \"../../IModelError\";\nimport { BackendBuffer, BackendReadable } from \"../../BackendTypes\";\nimport { RpcSerializedValue } from \"../core/RpcMarshaling\";\nimport { HttpServerRequest } from \"../web/WebAppRpcProtocol\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** @internal */\nexport interface FormDataCommon {\n append(name: string, value: string | Blob | BackendBuffer, fileName?: string): void;\n}\n\n/** @internal */\nexport interface ReadableFormData extends BackendReadable {\n getHeaders(): { [key: string]: any };\n}\n\n/** Support for transporting RPC values using the HTTP multipart content type.\n * @internal\n */\nexport class RpcMultipart {\n /** Creates a multipart form object for an RPC value. */\n public static createForm(value: RpcSerializedValue): FormData {\n const form = new FormData();\n RpcMultipart.writeValueToForm(form, value);\n return form;\n }\n\n /** Creates a multipart stream for an RPC value. */\n public static createStream(value: RpcSerializedValue): ReadableFormData {\n return this.platform.createStream(value);\n }\n\n /** Obtains the RPC value from a multipart HTTP request. */\n public static async parseRequest(req: HttpServerRequest): Promise<RpcSerializedValue> {\n return this.platform.parseRequest(req);\n }\n\n /** @internal */\n public static writeValueToForm(form: FormDataCommon, value: RpcSerializedValue) {\n form.append(\"objects\", value.objects);\n\n for (let i = 0; i !== value.data.length; ++i) {\n this.platform.appendToForm(i, form, value);\n }\n }\n\n /** @internal */\n public static platform = {\n createStream(_value: RpcSerializedValue): ReadableFormData {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n async parseRequest(_req: HttpServerRequest): Promise<RpcSerializedValue> {\n throw new IModelError(BentleyStatus.ERROR, \"Not bound.\");\n },\n appendToForm(i: number, form: FormDataCommon, value: RpcSerializedValue): void {\n form.append(`data-${i}`, new Blob([value.data[i]], { type: \"application/octet-stream\" }));\n },\n };\n}\n\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-common",
3
- "version": "5.0.0-dev.37",
3
+ "version": "5.0.0-dev.39",
4
4
  "description": "iTwin.js components common to frontend and backend",
5
5
  "main": "lib/cjs/core-common.js",
6
6
  "module": "lib/esm/core-common.js",
@@ -27,8 +27,8 @@
27
27
  "js-base64": "^3.6.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "@itwin/core-bentley": "5.0.0-dev.37",
31
- "@itwin/core-geometry": "5.0.0-dev.37"
30
+ "@itwin/core-bentley": "5.0.0-dev.39",
31
+ "@itwin/core-geometry": "5.0.0-dev.39"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@itwin/eslint-plugin": "5.0.0-dev.1",
@@ -42,9 +42,9 @@
42
42
  "rimraf": "^3.0.2",
43
43
  "typescript": "~5.6.2",
44
44
  "vitest": "^2.1.0",
45
- "@itwin/build-tools": "5.0.0-dev.37",
46
- "@itwin/core-bentley": "5.0.0-dev.37",
47
- "@itwin/core-geometry": "5.0.0-dev.37"
45
+ "@itwin/build-tools": "5.0.0-dev.39",
46
+ "@itwin/core-bentley": "5.0.0-dev.39",
47
+ "@itwin/core-geometry": "5.0.0-dev.39"
48
48
  },
49
49
  "nyc": {
50
50
  "extends": "./node_modules/@itwin/build-tools/.nycrc",