{"version":3,"file":"index.cjs","sources":["../src/api/3d/assetMappings3DApi.ts","../src/api/3d/files3DApi.ts","../src/api/3d/models3DApi.ts","../src/api/3d/nodes3DApi.ts","../src/api/3d/revisions3DApi.ts","../src/api/3d/revealNodes3DApi.ts","../src/api/3d/revealRevisions3DApi.ts","../src/api/3d/revealSectors3DApi.ts","../src/api/3d/unrealRevisions3DApi.ts","../src/api/3d/viewer3DApi.ts","../src/api/annotations/annotationsApi.ts","../src/api/assets/assetUtils.ts","../src/api/assets/assetsApi.ts","../src/api/containers/containersApi.ts","../src/api/dataPoints/dataPointsApi.ts","../src/api/datasets/datasetsApi.ts","../src/api/documents/aggregateApi.ts","../src/api/documents/previewApi.ts","../src/api/documents/documentsApi.ts","../src/api/entityMatching/entityMatchingApi.ts","../src/api/events/eventsAggregateApi.ts","../src/api/events/eventsApi.ts","../src/api/files/errors.ts","../src/api/files/filesMultipartUploadSessionApi.ts","../src/api/files/filesApi.ts","../src/api/functions/functionsApi.ts","../src/api/geospatial/computeAPI.ts","../src/api/geospatial/crsAPI.ts","../src/api/geospatial/featureAPI.ts","../src/api/geospatial/featureTypeAPI.ts","../src/api/geospatial/geospatialAPI.ts","../src/api/groups/groupsApi.ts","../src/api/instances/instancesApi.ts","../src/api/labels/labelsApi.ts","../src/api/models/datamodelsApi.ts","../src/api/projects/projectsApi.ts","../src/api/raw/rawRowsApi.ts","../src/api/raw/rawTablesApi.ts","../src/api/raw/rawApi.ts","../src/api/records/recordsApi.ts","../src/api/relationships/relationshipsApi.ts","../src/api/securityCategories/securityCategoriesApi.ts","../src/api/sequences/sequenceRowsApi.ts","../src/api/sequences/sequencesApi.ts","../src/api/sessions/sessionsApi.ts","../src/api/spaces/spacesApi.ts","../src/api/streams/streamsApi.ts","../src/api/templates/templateGraphQlApi.ts","../src/api/templates/templateGroupVersionsApi.ts","../src/api/templates/templateGroupsApi.ts","../../../node_modules/lodash/fromPairs.js","../../../node_modules/lodash/_arrayMap.js","../../../node_modules/lodash/_baseToPairs.js","../../../node_modules/lodash/_freeGlobal.js","../../../node_modules/lodash/_root.js","../../../node_modules/lodash/_Symbol.js","../../../node_modules/lodash/_getRawTag.js","../../../node_modules/lodash/_objectToString.js","../../../node_modules/lodash/_baseGetTag.js","../../../node_modules/lodash/isObject.js","../../../node_modules/lodash/isFunction.js","../../../node_modules/lodash/_coreJsData.js","../../../node_modules/lodash/_isMasked.js","../../../node_modules/lodash/_toSource.js","../../../node_modules/lodash/_baseIsNative.js","../../../node_modules/lodash/_getValue.js","../../../node_modules/lodash/_getNative.js","../../../node_modules/lodash/_DataView.js","../../../node_modules/lodash/_Map.js","../../../node_modules/lodash/_Promise.js","../../../node_modules/lodash/_Set.js","../../../node_modules/lodash/_WeakMap.js","../../../node_modules/lodash/_getTag.js","../../../node_modules/lodash/_mapToArray.js","../../../node_modules/lodash/_setToPairs.js","../../../node_modules/lodash/_createToPairs.js","../../../node_modules/lodash/_baseTimes.js","../../../node_modules/lodash/isObjectLike.js","../../../node_modules/lodash/_baseIsArguments.js","../../../node_modules/lodash/isArguments.js","../../../node_modules/lodash/isArray.js","../../../node_modules/lodash/stubFalse.js","../../../node_modules/lodash/isBuffer.js","../../../node_modules/lodash/_isIndex.js","../../../node_modules/lodash/isLength.js","../../../node_modules/lodash/_baseIsTypedArray.js","../../../node_modules/lodash/_baseUnary.js","../../../node_modules/lodash/_nodeUtil.js","../../../node_modules/lodash/isTypedArray.js","../../../node_modules/lodash/_arrayLikeKeys.js","../../../node_modules/lodash/_isPrototype.js","../../../node_modules/lodash/_overArg.js","../../../node_modules/lodash/_nativeKeys.js","../../../node_modules/lodash/_baseKeys.js","../../../node_modules/lodash/isArrayLike.js","../../../node_modules/lodash/keys.js","../../../node_modules/lodash/toPairs.js","../src/api/sessions/types.ts","../src/types.ts","../src/api/templates/templateInstancesApi.ts","../src/api/templates/viewsApi.ts","../../../node_modules/lodash/_listCacheClear.js","../../../node_modules/lodash/eq.js","../../../node_modules/lodash/_assocIndexOf.js","../../../node_modules/lodash/_listCacheDelete.js","../../../node_modules/lodash/_listCacheGet.js","../../../node_modules/lodash/_listCacheHas.js","../../../node_modules/lodash/_listCacheSet.js","../../../node_modules/lodash/_ListCache.js","../../../node_modules/lodash/_stackClear.js","../../../node_modules/lodash/_stackDelete.js","../../../node_modules/lodash/_stackGet.js","../../../node_modules/lodash/_stackHas.js","../../../node_modules/lodash/_nativeCreate.js","../../../node_modules/lodash/_hashClear.js","../../../node_modules/lodash/_hashDelete.js","../../../node_modules/lodash/_hashGet.js","../../../node_modules/lodash/_hashHas.js","../../../node_modules/lodash/_hashSet.js","../../../node_modules/lodash/_Hash.js","../../../node_modules/lodash/_mapCacheClear.js","../../../node_modules/lodash/_isKeyable.js","../../../node_modules/lodash/_getMapData.js","../../../node_modules/lodash/_mapCacheDelete.js","../../../node_modules/lodash/_mapCacheGet.js","../../../node_modules/lodash/_mapCacheHas.js","../../../node_modules/lodash/_mapCacheSet.js","../../../node_modules/lodash/_MapCache.js","../../../node_modules/lodash/_stackSet.js","../../../node_modules/lodash/_Stack.js","../../../node_modules/lodash/_arrayEach.js","../../../node_modules/lodash/_defineProperty.js","../../../node_modules/lodash/_baseAssignValue.js","../../../node_modules/lodash/_assignValue.js","../../../node_modules/lodash/_copyObject.js","../../../node_modules/lodash/_baseAssign.js","../../../node_modules/lodash/_nativeKeysIn.js","../../../node_modules/lodash/_baseKeysIn.js","../../../node_modules/lodash/keysIn.js","../../../node_modules/lodash/_baseAssignIn.js","../../../node_modules/lodash/_cloneBuffer.js","../../../node_modules/lodash/_copyArray.js","../../../node_modules/lodash/_arrayFilter.js","../../../node_modules/lodash/stubArray.js","../../../node_modules/lodash/_getSymbols.js","../../../node_modules/lodash/_copySymbols.js","../../../node_modules/lodash/_arrayPush.js","../../../node_modules/lodash/_getPrototype.js","../../../node_modules/lodash/_getSymbolsIn.js","../../../node_modules/lodash/_copySymbolsIn.js","../../../node_modules/lodash/_baseGetAllKeys.js","../../../node_modules/lodash/_getAllKeys.js","../../../node_modules/lodash/_getAllKeysIn.js","../../../node_modules/lodash/_initCloneArray.js","../../../node_modules/lodash/_Uint8Array.js","../../../node_modules/lodash/_cloneArrayBuffer.js","../../../node_modules/lodash/_cloneDataView.js","../../../node_modules/lodash/_cloneRegExp.js","../../../node_modules/lodash/_cloneSymbol.js","../../../node_modules/lodash/_cloneTypedArray.js","../../../node_modules/lodash/_initCloneByTag.js","../../../node_modules/lodash/_baseCreate.js","../../../node_modules/lodash/_initCloneObject.js","../../../node_modules/lodash/_baseIsMap.js","../../../node_modules/lodash/isMap.js","../../../node_modules/lodash/_baseIsSet.js","../../../node_modules/lodash/isSet.js","../../../node_modules/lodash/_baseClone.js","../../../node_modules/lodash/cloneDeepWith.js","../src/api/timeSeries/subscriptions/dataPointSubscriptionsApi.ts","../src/api/timeSeries/syntheticTimeSeriesApi.ts","../src/api/timeSeries/timeSeriesApi.ts","../src/api/units/unitSystemsApi.ts","../src/api/units/unitsApi.ts","../src/api/userProfiles/profilesApi.ts","../src/api/views/viewsApi.ts","../src/api/vision/visionApi.ts","../src/retryValidator.ts","../src/cogniteClient.ts"],"sourcesContent":["// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  AssetMapping3D,\n  AssetMappings3DListFilter,\n  CogniteInternalId,\n  CreateAssetMapping3D,\n  CursorResponse,\n  DeleteAssetMapping3D,\n  Filter3DAssetMappingsQuery,\n} from '../../types';\n\nexport class AssetMappings3DAPI extends BaseResourceAPI<AssetMapping3D> {\n  /**\n   * [List 3D asset mappings](https://doc.cognitedata.com/api/v1/#operation/get3DMappings)\n   *\n   * ```js\n   * const mappings3D = await client.assetMappings3D.list(3244265346345, 32423454353545);\n   * ```\n   */\n  public list = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    scope?: AssetMappings3DListFilter\n  ): CursorAndAsyncIterator<AssetMapping3D> => {\n    const path = this.encodeUrl(modelId, revisionId);\n    return super.listEndpoint(\n      (params) => this.get<CursorResponse<AssetMapping3D[]>>(path, { params }),\n      scope\n    );\n  };\n\n  /**\n   * [Filter 3D asset mappings](https://docs.cognite.com/api/v1/#operation/filter3DAssetMappings)\n   *\n   * ```js\n   * const mappings3D = await client.assetMappings3D.filter(3244265346345, 32423454353545, {\n   *   filter: {\n   *     treeIndexes: [1000, 1001, 1002]\n   *   }\n   * });\n   * ```\n   */\n  public filter = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    query: Filter3DAssetMappingsQuery\n  ): CursorAndAsyncIterator<AssetMapping3D> => {\n    const path = `${this.encodeUrl(modelId, revisionId)}/list`;\n    return super.listEndpoint(\n      (params) =>\n        this.post<CursorResponse<AssetMapping3D[]>>(path, { data: params }),\n      query\n    );\n  };\n\n  /**\n   * [Create 3D asset mappings](https://doc.cognitedata.com/api/v1/#operation/create3DMappings)\n   *\n   * ```js\n   * const assetMappingsToCreate = [\n   *  {\n   *    nodeId: 8252999965991682,\n   *    assetId: 4354399876978078\n   *  },\n   *  {\n   *    nodeId: 9034285498543958,\n   *    assetId: 1042345809544395\n   *  }\n   * ];\n   * const mappings3D = await client.assetMappings3D.create(\n   *  25432542356436,\n   *  33485743958747,\n   *  assetMappingsToCreate\n   * );\n   * ```\n   */\n  public create = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    items: CreateAssetMapping3D[]\n  ): Promise<AssetMapping3D[]> => {\n    const path = this.encodeUrl(modelId, revisionId);\n    return super.createEndpoint(items, path);\n  };\n\n  /**\n   * [Delete a list of asset mappings](https://doc.cognitedata.com/api/v1/#operation/delete3DMappings)\n   *\n   * ```js\n   * const assetMappingsToDelete = [\n   *  {\n   *    nodeId: 8252999965991682,\n   *    assetId: 4354399876978078\n   *  },\n   *  {\n   *    nodeId: 9034285498543958,\n   *    assetId: 1042345809544395\n   *  }\n   * ];\n   * await client.assetMappings3D.delete(8252999965991682, 4190022127342195, assetMappingsToDelete);\n   * ```\n   */\n  public delete = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    ids: DeleteAssetMapping3D[]\n  ): Promise<object> => {\n    const path = `${this.encodeUrl(modelId, revisionId)}/delete`;\n    return super.deleteEndpoint(ids, undefined, path);\n  };\n\n  private encodeUrl(modelId: CogniteInternalId, revisionId: CogniteInternalId) {\n    return this.url(`${modelId}/revisions/${revisionId}/mappings`);\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI, HttpResponseType } from '@cognite/sdk-core';\nimport type { CogniteInternalId } from '../../types';\n\nexport class Files3DAPI extends BaseResourceAPI<unknown> {\n  /**\n   * [Retrieve a 3D file\"](https://doc.cognitedata.com/api/v1/#operation/get3DFile)\n   *\n   * ```js\n   * await client.files3D.retrieve(3744350296805509);\n   * ```\n   */\n  public retrieve = async (fileId: CogniteInternalId): Promise<ArrayBuffer> => {\n    const path = this.url(`${fileId}`);\n    const response = await this.get<ArrayBuffer>(path, {\n      responseType: HttpResponseType.ArrayBuffer,\n    });\n    return this.addToMapAndReturn(response.data, response);\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  CreateModel3D,\n  InternalId,\n  Model3D,\n  Model3DListRequest,\n  UpdateModel3D,\n} from '../../types';\n\nexport class Models3DAPI extends BaseResourceAPI<Model3D> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime']);\n  }\n\n  /**\n   * [Create 3D models](https://doc.cognitedata.com/api/v1/#operation/create3DModels)\n   *\n   * ```js\n   * const modelsToCreate = [\n   *   { name: 'Model 0' },\n   *   { name: 'Model 2' },\n   * ];\n   * const models3D = await client.models3D.create(modelsToCreate);\n   * ```\n   */\n  public create = (models: CreateModel3D[]): Promise<Model3D[]> => {\n    return super.createEndpoint(models);\n  };\n\n  /**\n   * [List 3D models](https://doc.cognitedata.com/api/v1/#operation/get3DModels)\n   *\n   * ```js\n   * const models3D = await client.models3D.list({ published: true });\n   * ```\n   */\n  public list = (\n    scope?: Model3DListRequest\n  ): CursorAndAsyncIterator<Model3D> => {\n    return super.listEndpoint(this.callListEndpointWithGet, scope);\n  };\n\n  /**\n   * [Retrieve a 3D model](https://doc.cognitedata.com/api/v1/#operation/get3DModel)\n   *\n   * ```js\n   * await client.models3D.retrieve(3744350296805509);\n   * ```\n   */\n  public retrieve = async (id: CogniteInternalId): Promise<Model3D> => {\n    const path = this.url(`${id}`);\n    const response = await this.get<Model3D>(path);\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Update 3D models](https://doc.cognitedata.com/api/v1/#operation/update3DModels)\n   *\n   * ```js\n   * const modelsToUpdate = [\n   *   { id: 3744350296805509, update: { name: { set: 'Model 0 updated' }}},\n   *   { id: 8163365893677939, update: { name: { set: 'Model 2 updated' }}},\n   * ];\n   * const models3D = await client.models3D.update(modelsToUpdate);\n   * ```\n   */\n  public update = (changes: UpdateModel3D[]): Promise<Model3D[]> => {\n    return super.updateEndpoint(changes);\n  };\n\n  /**\n   * [Delete 3D models](https://doc.cognitedata.com/api/v1/#operation/delete3DModels)\n   *\n   * ```js\n   * await client.models3D.delete([{ id: 3744350296805509 }, { id: 8163365893677939 }]);\n   * ```\n   */\n  public delete = (ids: InternalId[]) => {\n    return super.deleteEndpoint(ids);\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  CursorResponse,\n  Filter3DNodesQuery,\n  InternalId,\n  List3DNodesQuery,\n  Node3D,\n} from '../../types';\n\nexport class Nodes3DAPI extends BaseResourceAPI<Node3D> {\n  public list(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    scope?: List3DNodesQuery\n  ): CursorAndAsyncIterator<Node3D> {\n    const path = this.url(`${modelId}/revisions/${revisionId}/nodes`);\n    return super.listEndpoint(\n      (params) => this.get<CursorResponse<Node3D[]>>(path, { params }),\n      scope\n    );\n  }\n\n  public filter(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    scope?: Filter3DNodesQuery\n  ): CursorAndAsyncIterator<Node3D> {\n    const path = this.url(`${modelId}/revisions/${revisionId}/nodes/list`);\n    return super.listEndpoint(\n      (params) => this.post<CursorResponse<Node3D[]>>(path, { data: params }),\n      scope\n    );\n  }\n\n  public retrieve = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    ids: InternalId[]\n  ): Promise<Node3D[]> => {\n    const path = this.url(`${modelId}/revisions/${revisionId}/nodes/byids`);\n    return super.retrieveEndpoint(ids, {}, path);\n  };\n\n  public listAncestors(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    nodeId: CogniteInternalId,\n    scope?: List3DNodesQuery\n  ): CursorAndAsyncIterator<Node3D> {\n    const path = this.url(\n      `${modelId}/revisions/${revisionId}/nodes/${nodeId}/ancestors`\n    );\n    return super.listEndpoint(\n      (params) => this.get<CursorResponse<Node3D[]>>(path, { params }),\n      scope\n    );\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CursorAndAsyncIterator,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  CreateRevision3D,\n  Filter3DNodesQuery,\n  InternalId,\n  List3DNodesQuery,\n  Node3D,\n  Revision3D,\n  Revision3DListRequest,\n  UpdateRevision3D,\n} from '../../types';\nimport { Nodes3DAPI } from './nodes3DApi';\n\nexport class Revisions3DAPI extends BaseResourceAPI<Revision3D> {\n  private nodes3DApi: Nodes3DAPI;\n  constructor(\n    resourcePath: string,\n    httpClient: CDFHttpClient,\n    map: MetadataMap\n  ) {\n    super(resourcePath, httpClient, map);\n    this.nodes3DApi = new Nodes3DAPI(resourcePath, httpClient, map);\n  }\n\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime']);\n  }\n\n  /**\n   * [Create 3D revisions](https://doc.cognitedata.com/api/v1/#operation/create3DRevisions)\n   *\n   * ```js\n   * const revisions = await client.revisions3D.create(4234325345643654, [{ fileId: 8252999965991682 }, { fileId: 6305529564379596 }]);\n   * ```\n   */\n  public create = (\n    modelId: CogniteInternalId,\n    items: CreateRevision3D[]\n  ): Promise<Revision3D[]> => {\n    return super.createEndpoint(items, this.url(`${modelId}/revisions`));\n  };\n\n  /**\n   * [List 3D revisions](https://doc.cognitedata.com/api/v1/#operation/get3DRevisions)\n   *\n   * ```js\n   * const revisions3D = await client.revisions3D.list(324566546546346);\n   * ```\n   */\n  public list = (\n    modelId: CogniteInternalId,\n    filter?: Revision3DListRequest\n  ): CursorAndAsyncIterator<Revision3D> => {\n    const path = this.url(`${modelId}/revisions`);\n    return super.listEndpoint((params) => this.get(path, { params }), filter);\n  };\n\n  /**\n   * [Retrieve a 3D revision](https://doc.cognitedata.com/api/v1/#operation/get3DRevision)\n   *\n   * ```js\n   * const revisions3D = await client.revisions3D.retrieve(8252999965991682, 4190022127342195)\n   * ```\n   */\n  public retrieve = async (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId\n  ): Promise<Revision3D> => {\n    const path = this.url(`${modelId}/revisions/${revisionId}`);\n    const response = await this.get<Revision3D>(path);\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Update 3D revisions](https://doc.cognitedata.com/api/v1/#operation/update3DRevisions)\n   *\n   * ```js\n   * const revisionsToUpdate = [{\n   *  id: 6305529564379596,\n   *  update: {\n   *    rotation: {\n   *      set: [1, 2, 3]\n   *    },\n   *    translation: {\n   *      set: [4, 5, 6]\n   *    },\n   *    scale: {\n   *      set: [0.5, 0.3, 0.2]\n   *    }\n   *  }\n   * }];\n   * const updated = await client.revisions3D.update(8252999965991682, revisionsToUpdate);\n   * ```\n   */\n  public update = (\n    modelId: CogniteInternalId,\n    items: UpdateRevision3D[]\n  ): Promise<Revision3D[]> => {\n    const path = this.url(`${modelId}/revisions/update`);\n    return super.updateEndpoint(items, path);\n  };\n\n  /**\n   * [Delete 3D revisions](https://doc.cognitedata.com/api/v1/#operation/delete3DRevisions)\n   *\n   * ```js\n   * await client.revisions3D.delete(8252999965991682, [{ id: 4190022127342195 }]);\n   * ```\n   */\n  public delete = (\n    modelId: CogniteInternalId,\n    ids: InternalId[]\n  ): Promise<object> => {\n    const path = this.url(`${modelId}/revisions/delete`);\n    return super.deleteEndpoint(ids, undefined, path);\n  };\n\n  /**\n   * [Update 3D revision thumbnail](https://docs.cognite.com/api/v1/#operation/updateThumbnail)\n   *\n   * ```js\n   * await client.revisions3D.updateThumbnail(8252999965991682, 4190022127342195, 3243334242324);\n   * ```\n   */\n  public updateThumbnail = async (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    fileId: CogniteInternalId\n  ): Promise<object> => {\n    const path = this.url(`${modelId}/revisions/${revisionId}/thumbnail`);\n    const response = await this.post<object>(path, { data: { fileId } });\n    return this.addToMapAndReturn({}, response);\n  };\n\n  /**\n   * [List 3D nodes](https://doc.cognitedata.com/api/v1/#operation/get3DNodes)\n   *\n   * ```js\n   * const nodes3d = await client.revisions3D.list3DNodes(8252999965991682, 4190022127342195);\n   * ```\n   */\n  public list3DNodes = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    query?: List3DNodesQuery\n  ): CursorAndAsyncIterator<Node3D> => {\n    return this.nodes3DApi.list(modelId, revisionId, query);\n  };\n\n  /**\n   * [Filter 3D nodes](https://docs.cognite.com/api/v1/#operation/filter3DNodes)\n   *\n   * ```js\n   * const query = {\n   *  filter: {\n   *    properties: {\n   *      Items: {\n   *        Type: [\"Cylinder\"]\n   *      }\n   *    }\n   *  },\n   *  partition: \"1/10\"\n   * };\n   * const nodes3d = await client.revisions3D.filter3DNodes(8252999965991682, 4190022127342195, query);\n   * ```\n   */\n  public filter3DNodes = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    query?: Filter3DNodesQuery\n  ): CursorAndAsyncIterator<Node3D> => {\n    return this.nodes3DApi.filter(modelId, revisionId, query);\n  };\n\n  /**\n   * [Get 3D nodes by ID](https://docs.cognite.com/api/v1/#operation/get3DNodesById)\n   *\n   * ```js\n   * const nodes3d = await client.revisions3D.retrieve3DNodes(8252999965991682, 4190022127342195, [{id: 123}, {id: 456}]);\n   * ```\n   */\n  public retrieve3DNodes = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    ids: InternalId[]\n  ): Promise<Node3D[]> => {\n    return this.nodes3DApi.retrieve(modelId, revisionId, ids);\n  };\n\n  /**\n   * [List 3D ancestor nodes](https://doc.cognitedata.com/api/v1/#operation/get3DNodeAncestors)\n   *\n   * ```js\n   * const nodes3d = await client.revisions3D.list3DNodeAncestors(8252999965991682, 4190022127342195, 572413075141081);\n   * ```\n   */\n  public list3DNodeAncestors = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    nodeId: CogniteInternalId,\n    query?: List3DNodesQuery\n  ): CursorAndAsyncIterator<Node3D> => {\n    return this.nodes3DApi.listAncestors(modelId, revisionId, nodeId, query);\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  List3DNodesQuery,\n  RevealNode3D,\n} from '../../types';\n\nexport class RevealNodes3DAPI extends BaseResourceAPI<RevealNode3D> {\n  public list(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    scope?: List3DNodesQuery\n  ): CursorAndAsyncIterator<RevealNode3D> {\n    const path = this.encodeUrl(modelId, revisionId);\n    return super.listEndpoint((params) => this.get(path, { params }), scope);\n  }\n\n  public listAncestors(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    nodeId: CogniteInternalId,\n    scope?: List3DNodesQuery\n  ): CursorAndAsyncIterator<RevealNode3D> {\n    const path = `${this.encodeUrl(modelId, revisionId)}/${nodeId}/ancestors`;\n    return super.listEndpoint((params) => this.get(path, { params }), scope);\n  }\n\n  private encodeUrl(modelId: CogniteInternalId, revisionId: CogniteInternalId) {\n    return this.url(`models/${modelId}/revisions/${revisionId}/nodes`);\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { CogniteInternalId, RevealRevision3D } from '../../types';\n\nexport class RevealRevisions3DAPI extends BaseResourceAPI<RevealRevision3D> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime']);\n  }\n\n  public async retrieve(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId\n  ): Promise<RevealRevision3D> {\n    const path = this.url(`models/${modelId}/revisions/${revisionId}`);\n    const response = await this.get<RevealRevision3D>(path);\n    return this.addToMapAndReturn(response.data, response);\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  ListRevealSectors3DQuery,\n  RevealSector3D,\n} from '../../types';\n\nexport class RevealSectors3DAPI extends BaseResourceAPI<RevealSector3D> {\n  public list(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    scope?: ListRevealSectors3DQuery\n  ): CursorAndAsyncIterator<RevealSector3D> {\n    const path = this.url(`models/${modelId}/revisions/${revisionId}/sectors`);\n    return super.listEndpoint((params) => this.get(path, { params }), scope);\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { CogniteInternalId, UnrealRevision3D } from '../../types';\n\nexport class UnrealRevisions3DAPI extends BaseResourceAPI<UnrealRevision3D> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime']);\n  }\n\n  public async retrieve(\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId\n  ): Promise<UnrealRevision3D> {\n    const path = this.url(`models/${modelId}/revisions/${revisionId}`);\n    const response = await this.get<UnrealRevision3D>(path);\n    return this.addToMapAndReturn(response.data, response);\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CursorAndAsyncIterator,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  List3DNodesQuery,\n  ListRevealSectors3DQuery,\n  RevealNode3D,\n  RevealRevision3D,\n  RevealSector3D,\n} from '../../types';\nimport { RevealNodes3DAPI } from './revealNodes3DApi';\nimport { RevealRevisions3DAPI } from './revealRevisions3DApi';\nimport { RevealSectors3DAPI } from './revealSectors3DApi';\nimport { UnrealRevisions3DAPI } from './unrealRevisions3DApi';\n\nexport class Viewer3DAPI extends BaseResourceAPI<unknown> {\n  private revealRevisions3DAPI: RevealRevisions3DAPI;\n  private revealNodes3DAPI: RevealNodes3DAPI;\n  private revealSectors3DAPI: RevealSectors3DAPI;\n  private unrealRevisions3DAPI: UnrealRevisions3DAPI;\n  /** @hidden */\n  constructor(\n    resourcePath: string,\n    httpClient: CDFHttpClient,\n    map: MetadataMap\n  ) {\n    super(resourcePath, httpClient, map);\n    const revealPath = `${resourcePath}/reveal`;\n    const unrealPath = `${resourcePath}/unreal`;\n    this.revealRevisions3DAPI = new RevealRevisions3DAPI(\n      revealPath,\n      httpClient,\n      map\n    );\n    this.revealNodes3DAPI = new RevealNodes3DAPI(revealPath, httpClient, map);\n    this.revealSectors3DAPI = new RevealSectors3DAPI(\n      revealPath,\n      httpClient,\n      map\n    );\n    this.unrealRevisions3DAPI = new UnrealRevisions3DAPI(\n      unrealPath,\n      httpClient,\n      map\n    );\n  }\n\n  /**\n   * [Retrieve a 3D revision (Reveal)](https://doc.cognitedata.com/api/v1/#operation/getReveal3DRevision)\n   *\n   * ```js\n   * const revisionReveal = await client.viewer3D.retrieveRevealRevision3D(294879032167592, 3247239473298342)\n   * ```\n   */\n  public retrieveRevealRevision3D = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId\n  ): Promise<RevealRevision3D> => {\n    return this.revealRevisions3DAPI.retrieve(modelId, revisionId);\n  };\n\n  /**\n   * [List 3D nodes (Reveal)](https://doc.cognitedata.com/api/v1/#operation/revealGet3DNodes)\n   *\n   * ```js\n   * const nodes3dReveal = await client.viewer3D\n   *  .listRevealNodes3D(8252999965991682, 4190022127342195)\n   *  .autoPagingToArray();\n   * ```\n   */\n  public listRevealNodes3D = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    query?: List3DNodesQuery\n  ): CursorAndAsyncIterator<RevealNode3D> => {\n    return this.revealNodes3DAPI.list(modelId, revisionId, query);\n  };\n\n  /**\n   * [List 3D ancestor nodes (Reveal)](https://doc.cognitedata.com/api/v1/#operation/revealGet3DNodeAncestors)\n   *\n   * ```js\n   * const ancestorsReveal = await client.viewer3D\n   *  .listRevealNode3DAncestors(8252999965991682, 4190022127342195, 120982398890213)\n   *  .autoPagingToArray();\n   * ```\n   */\n  public listRevealNode3DAncestors = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    nodeId: CogniteInternalId,\n    query?: List3DNodesQuery\n  ): CursorAndAsyncIterator<RevealNode3D> => {\n    return this.revealNodes3DAPI.listAncestors(\n      modelId,\n      revisionId,\n      nodeId,\n      query\n    );\n  };\n\n  /**\n   * [List 3D sectors (Reveal)](https://doc.cognitedata.com/api/v1/#operation/revealGet3DSectors)\n   *\n   * ```js\n   * const sectors3D = await client.viewer3D\n   *  .listRevealSectors3D(8252999965991682, 4190022127342195, { limit: 10 })\n   *  .autoPagingToArray();\n   * ```\n   */\n  public listRevealSectors3D = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId,\n    query?: ListRevealSectors3DQuery\n  ): CursorAndAsyncIterator<RevealSector3D> => {\n    return this.revealSectors3DAPI.list(modelId, revisionId, query);\n  };\n\n  /**\n   * [Retrieve a 3D revision (Unreal)](https://doc.cognitedata.com/api/v1/#operation/getUnreal3DRevision)\n   *\n   * ```js\n   * const revisions3DUnreal = await client.viewer3D.retrieveUnrealRevision3D(8252999965991682, 4190022127342195);\n   * ```\n   */\n  public retrieveUnrealRevision3D = (\n    modelId: CogniteInternalId,\n    revisionId: CogniteInternalId\n  ): Promise<RevealRevision3D> => {\n    return this.unrealRevisions3DAPI.retrieve(modelId, revisionId);\n  };\n}\n","// Copyright 2022 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CogniteAsyncIterator,\n  type CursorAndAsyncIterator,\n  type CursorResponse,\n  type InternalId,\n  type ListResponse,\n} from '@cognite/sdk-core';\n\nimport type {\n  AnnotationChangeById,\n  AnnotationCreate,\n  AnnotationFilterRequest,\n  AnnotationModel,\n  AnnotationReverseLookupRequest,\n  AnnotationSuggest,\n  AnnotationsAssetRef,\n} from '../../types';\n\nexport class AnnotationsAPI extends BaseResourceAPI<AnnotationModel> {\n  /**\n   * Specify that dates should be parsed in requests and responses\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  protected get suggestUrl() {\n    return this.url('suggest');\n  }\n\n  /**\n   * [Create annotations](https://docs.cognite.com/api/playground/#operation/annotationsCreate)\n   *\n   * ```js\n   * const data = {\n   *   pageNumber: 7,\n   *   textRegion: { xMin: 0, xMax: 0.1, yMin: 0, yMax: 0.2 },\n   *   extractedText: 'i am your father',\n   * };\n   * const annotation = {\n   *   annotatedResourceType: 'file' as const,\n   *   annotatedResourceId: 1,\n   *   annotationType: 'documents.ExtractedText',\n   *   creatingApp: 'integration-tests',\n   *   creatingAppVersion: '0.0.1',\n   *   creatingUser: 'integration-tests',\n   *   status: 'suggested' as const,\n   *   data,\n   * };\n   * const created = await client.annotations.create([annotation]);\n   * ```\n   */\n  public create = (items: AnnotationCreate[]) => {\n    return this.createEndpoint(items);\n  };\n\n  /**\n   * [Suggest annotations](https://docs.cognite.com/api/playground/#operation/annotationsSuggest)\n   *\n   * ```js\n   * const data = {\n   *   pageNumber: 7,\n   *   textRegion: { xMin: 0, xMax: 0.1, yMin: 0, yMax: 0.2 },\n   *   extractedText: 'i am your father',\n   * };\n   * const partial = {\n   *   annotatedResourceType: 'file' as const,\n   *   annotatedResourceId: 1,\n   *   annotationType: 'documents.ExtractedText',\n   *   creatingApp: 'integration-tests',\n   *   creatingAppVersion: '0.0.1',\n   *   creatingUser: 'integration-tests',\n   *   data,\n   * };\n   *\n   * const created = await client.annotations.suggest([partial]);\n   * ```\n   */\n  public suggest = (items: AnnotationSuggest[]) => {\n    return this.createEndpoint(items, this.suggestUrl);\n  };\n\n  /**\n   * [Retrieve](https://docs.cognite.com/api/playground/#operation/annotationsByids)\n   * or [Get an](https://docs.cognite.com/api/playground/#operation/annotationsGet)\n   * annotation\n   *\n   * ```js\n   * const annotationIds = [{ id: 1 }, { id: 2 }];\n   *\n   * const response = await client.annotations.retrieve(annotationIds);\n   * ```\n   */\n  public retrieve = (ids: InternalId[]) => {\n    return this.retrieveEndpoint(ids);\n  };\n\n  /**\n   * [Advanced list of annotations](https://docs.cognite.com/api/playground/#operation/annotationsFilter)\n   *\n   * ```js\n   * const annotatedFileId = 1;\n   * const limitOne = await client.annotations.list({\n   *   limit: 1,\n   *   filter: {\n   *    annotatedResourceType: 'file',\n   *    annotatedResourceIds: [{ id: 1 }],\n   *  },\n   * });\n   * ```\n   */\n  public list = (\n    filter: AnnotationFilterRequest\n  ): CursorAndAsyncIterator<AnnotationModel> => {\n    return this.listEndpoint(this.callListEndpointWithPost, filter);\n  };\n\n  /**\n   * [Delete annotations](https://docs.cognite.com/api/playground/#operation/annotationsDelete)\n   *\n   * ```js\n   * const annotationIds = [{ id: 1 }, { id: 2 }];\n   * await client.annotations.delete(annotationIds);\n   * ```\n   */\n  public delete = (ids: InternalId[]) => {\n    return this.deleteEndpoint(ids);\n  };\n\n  /**\n   * [Update annotations](https://docs.cognite.com/api/playground/#operation/annotationsUpdate)\n   *\n   * ```js\n   * const data = {\n   *   pageNumber: 8,\n   *   fileRef: { externalId: 'def_file_changed' },\n   *   textRegion: { xMin: 0, xMax: 0.1, yMin: 0, yMax: 0.2 },\n   * };\n   * const changes = [\n   *   {\n   *     id: 1,\n   *     update: {\n   *       data: {\n   *         set: data,\n   *       },\n   *     },\n   *   },\n   * ];\n   *\n   * const updatedResp = await client.annotations.update(changes);\n   * ```\n   */\n  public update = (changes: AnnotationChangeById[]) => {\n    return this.updateEndpoint(changes);\n  };\n\n  /**\n   * [Reverse lookup](https://developer.cognite.com/api/v1-beta/#tag/Annotations/operation/annotationsReverseLookup)\n   *\n   * ```js\n   * const assetQueryData = {\n   *   limit: -1,\n   *   filter: {\n   *     annotatedResourceType: 'file' as const,\n   *     annotationType: 'images.AssetLink',\n   *     data: {\n   *       assetRef: { id: 123 }\n   *     }\n   *   }\n   * };\n   * const resourceIdsResponse = client.annotations.reverseLookup(assetQueryData);\n   * ```\n   */\n  public reverseLookup = (\n    filter: AnnotationReverseLookupRequest\n  ): Promise<ListResponse<AnnotationsAssetRef[]>> &\n    CogniteAsyncIterator<AnnotationsAssetRef> => {\n    const path = this.url('reverselookup');\n    return this.cursorBasedEndpoint(\n      (params) =>\n        this.post<CursorResponse<AnnotationsAssetRef[]>>(path, {\n          data: params,\n        }),\n      filter\n    );\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport { GraphUtils } from '@cognite/sdk-core';\nimport type { ExternalAssetItem } from '../../types';\n\ntype Node<T> = GraphUtils.Node<T>;\n\n/** @hidden */\nexport function enrichAssetsWithTheirParents(\n  assets: ReadonlyArray<ExternalAssetItem>\n): Node<ExternalAssetItem>[] {\n  const externalIdMap = new Map<string, Node<ExternalAssetItem>>();\n  const nodes: Node<ExternalAssetItem>[] = assets.map((asset) => ({\n    data: asset,\n  }));\n\n  // find all new exteralIds and map the new externalId to the asset\n  for (const node of nodes) {\n    const { externalId } = node.data;\n    if (externalId) {\n      externalIdMap.set(externalId, node);\n    }\n  }\n\n  // set correct Node.parentNode\n  for (const node of nodes) {\n    const { parentExternalId } = node.data;\n    // has an internal parent\n    if (parentExternalId && externalIdMap.has(parentExternalId)) {\n      node.parentNode = externalIdMap.get(parentExternalId);\n    }\n  }\n\n  return nodes;\n}\n\n/** @hidden */\nexport function sortAssetCreateItems(\n  assets: ReadonlyArray<ExternalAssetItem>\n): ExternalAssetItem[] {\n  const nodes = enrichAssetsWithTheirParents(assets);\n  const sortedNodes = GraphUtils.topologicalSort(nodes);\n  return sortedNodes.map((node) => node.data);\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport { RevertableArraySorter } from '@cognite/sdk-core';\nimport type {\n  Asset,\n  AssetAggregate,\n  AssetAggregateQuery,\n  AssetChange,\n  AssetIdEither,\n  AssetListScope,\n  AssetRetrieveParams,\n  AssetSearchFilter,\n  ExternalAssetItem,\n  IdEither,\n} from '../../types';\nimport { sortAssetCreateItems } from './assetUtils';\n\nexport class AssetsAPI extends BaseResourceAPI<Asset> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  /**\n   * [Creates new assets](https://doc.cognitedata.com/api/v1/#operation/createAssets)\n   *\n   * ```js\n   * const assets = [\n   *   { name: 'First asset' },\n   *   { name: 'Second asset', description: 'Another asset', externalId: 'anotherAsset' },\n   *   { name: 'Child asset', parentExternalId: 'anotherAsset'},\n   * ];\n   * const createdAssets = await client.assets.create(assets);\n   * ```\n   */\n  public create = (items: ExternalAssetItem[]): Promise<Asset[]> => {\n    const { sort, unsort } = new RevertableArraySorter(sortAssetCreateItems);\n    return super.createEndpoint(items, undefined, sort, unsort);\n  };\n\n  /**\n   * [List assets](https://doc.cognitedata.com/api/v1/#operation/listAssets)\n   * <!-- or [similar](https://doc.cognitedata.com/api/v1/#operation/getAssets) -->\n   *\n   * ```js\n   * const assets = await client.assets.list({ filter: { name: '21PT1019' } });\n   * ```\n   */\n  public list = (scope?: AssetListScope): CursorAndAsyncIterator<Asset> => {\n    return super.listEndpoint(this.callListEndpointWithPost, scope);\n  };\n\n  /**\n   * [Aggregate assets](https://docs.cognite.com/api/v1/#operation/aggregateAssets)\n   *\n   * ```js\n   * const aggregates = await client.assets.aggregate({ filter: { root: true } });\n   * console.log('Number of root assets: ', aggregates[0].count)\n   * ```\n   */\n  public aggregate = (\n    query: AssetAggregateQuery\n  ): Promise<AssetAggregate[]> => {\n    return super.aggregateEndpoint(query);\n  };\n\n  /**\n   * [Retrieve assets](https://doc.cognitedata.com/api/v1/#operation/byIdsAssets)\n   * <!-- or [similar](https://doc.cognitedata.com/api/v1/#operation/getAsset) -->\n   *\n   * ```js\n   * const assets = await client.assets.retrieve([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public retrieve = (\n    ids: IdEither[],\n    params: AssetRetrieveParams = {}\n  ): Promise<Asset[]> => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Update assets](https://doc.cognitedata.com/api/v1/#operation/updateAssets)\n   *\n   * ```js\n   * const assets = await client.assets.update([{id: 123, update: {name: {set: 'New name'}}}]);\n   * ```\n   */\n  public update = (changes: AssetChange[]): Promise<Asset[]> => {\n    return super.updateEndpoint(changes);\n  };\n\n  /**\n   * [Search for assets](https://doc.cognitedata.com/api/v1/#operation/searchAssets)\n   *\n   * ```js\n   * const assets = await client.assets.search({\n   *   filter: {\n   *     parentIds: [1, 2]\n   *   },\n   *   search: {\n   *     query: '21PT1019'\n   *   }\n   * });\n   * ```\n   */\n  public search = (query: AssetSearchFilter): Promise<Asset[]> => {\n    return super.searchEndpoint(query);\n  };\n\n  /**\n   * [Delete assets](https://doc.cognitedata.com/api/v1/#operation/deleteAssets)\n   *\n   * ```js\n   * await client.assets.delete([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public delete = (ids: AssetIdEither[], params: AssetDeleteParams = {}) => {\n    const paramsWithIgnoreUnknownIds = {\n      ...params,\n      ignoreUnknownIds: true,\n    };\n    return super.deleteEndpoint(ids, paramsWithIgnoreUnknownIds);\n  };\n}\n\nexport interface AssetDeleteParams {\n  recursive?: boolean;\n}\n","// Copyright 2023 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type { ContainerListParams } from './types';\nimport type {\n  ContainerCollectionResponse,\n  ContainerCreateDefinition,\n  ContainerDefinition,\n  ListOfSpaceExternalIdsRequest,\n  ListOfSpaceExternalIdsResponse,\n} from './types.gen';\n\nexport class ContainersAPI extends BaseResourceAPI<ContainerDefinition> {\n  /**\n   * [Upsert containers](https://api-docs.cognite.com/20230101/tag/Containers/operation/ApplyContainers)\n   *\n   * ```js\n   * const containerDefinition = {\n   *     \"space\": \"string\",\n   *     \"externalId\": \"string\",\n   *     \"name\": \"string\",\n   *     \"description\": \"string\",\n   *     \"usedFor\": \"node\",\n   *     \"properties\": {\n   *     \"containerPropertyIdentifier1\": {},\n   *     \"containerPropertyIdentifier2\": {}\n   *   },\n   *   \"constraints\": {\n   *     \"constraint-identifier1\": {},\n   *     \"constraint-identifier2\": {}\n   *   },\n   *   \"indexes\": {\n   *     \"index-identifier1\": {},\n   *     \"index-identifier2\": {}\n   *   }\n   * }\n   *  const response = await client.containers.upsert([\n   *   containerDefinition\n   *  ]);\n   * ```\n   */\n  public upsert = async (\n    params: ContainerCreateDefinition[]\n  ): Promise<ContainerCollectionResponse> => {\n    const response = await this.post<ContainerCollectionResponse>(this.url(), {\n      data: { items: params },\n    });\n    return response.data;\n  };\n\n  /**\n   * [Delete containers](https://api-docs.cognite.com/20230101/tag/Containers/operation/deleteContainers)\n   *\n   * ```js\n   *  const response = await client.containers.delete([{\n   *    space: \"my_space\",\n   *    externalId: \"my_external_id\"\n   *  }]);\n   *\n   * ```\n   */\n  public delete = async (\n    params: ListOfSpaceExternalIdsRequest['items']\n  ): Promise<ListOfSpaceExternalIdsResponse> => {\n    const response = await this.post<ListOfSpaceExternalIdsResponse>(\n      this.deleteUrl,\n      {\n        data: { items: params },\n      }\n    );\n    return response.data;\n  };\n\n  /**\n   * [List containers](https://api-docs.cognite.com/20230101/tag/Containers/operation/listContainers)\n   *\n   * ```js\n   *  const response = await client.containers.list({ space: '', includeGlobal: true });\n   *  // List only record containers\n   *  const recordContainers = await client.containers.list({ usedFor: ['record'] });\n   *  // List all container types including records\n   *  const allContainers = await client.containers.list({ usedFor: ['node', 'edge', 'all', 'record'] });\n   * ```\n   */\n  public list = (\n    params: ContainerListParams = { includeGlobal: false }\n  ): CursorAndAsyncIterator<ContainerDefinition> => {\n    return super.listEndpoint(\n      this.callListGetEndpointWithRepeatedQueryParams,\n      params\n    );\n  };\n\n  /**\n   * [Retrieve containers](https://api-docs.cognite.com/20230101/tag/Containers/operation/byExternalIdsContainers)\n   *\n   * ```js\n   *  const response = await client.containers.retrieve([\n   *   {\n   *    space: \"my_space\",\n   *    externalId: \"my_external_id\"\n   *   }\n   * ]);\n   *\n   * ```\n   */\n  public retrieve = async (\n    params: ListOfSpaceExternalIdsRequest['items']\n  ): Promise<ContainerCollectionResponse> => {\n    const response = await this.post<ContainerCollectionResponse>(\n      this.byIdsUrl,\n      {\n        data: { items: params },\n      }\n    );\n    return response.data;\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { ItemsWrapper } from '@cognite/sdk-core';\nimport type { DatapointInfo, IgnoreUnknownIds } from '../../types/common';\nimport type {\n  DatapointAggregates,\n  Datapoints,\n  DatapointsDeleteRequest,\n  DatapointsInsertItem,\n  DatapointsMonthlyGranularityMultiQuery,\n  DatapointsMultiQuery,\n  LatestDataBeforeRequest,\n} from './types';\n\nexport class DataPointsAPI extends BaseResourceAPI<\n  DatapointAggregates | Datapoints\n> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps<DatapointInfo>(\n      ['items', 'datapoints', 'maxDatapoint', 'minDatapoint'],\n      ['timestamp']\n    );\n  }\n\n  /**\n   * [Insert data points](https://doc.cognitedata.com/api/v1/#operation/postMultiTimeSeriesDatapoints)\n   *\n   * ```js\n   * await client.datapoints.insert([{ id: 123, datapoints: [{timestamp: 1557320284000, value: -2}] }]);\n   * ```\n   */\n  public insert = (items: DatapointsInsertItem[]): Promise<object> => {\n    return this.insertEndpoint(items);\n  };\n\n  /**\n   * [Retrieve data points](https://doc.cognitedata.com/api/v1/#operation/getMultiTimeSeriesDatapoints)\n   *\n   * ```js\n   * const data = await client.datapoints.retrieve({ items: [{ id: 123 }] });\n   * ```\n   */\n  public retrieve = (\n    query: DatapointsMultiQuery\n  ): Promise<DatapointAggregates[] | Datapoints[]> => {\n    return this.retrieveDatapointsEndpoint(query);\n  };\n\n  /**\n   * @deprecated Use `retrieve()` with `granularity: '1mo'` instead. Will be removed in next major release.\n   *\n   * ```js\n   * const monthlyAggregatesData = await client.datapoints.retrieve({ items: [{ id: 123 }], granularity: '1mo', aggregates: ['average'] });\n   * ```\n   */\n  public retrieveDatapointMonthlyAggregates = async (\n    query: DatapointsMonthlyGranularityMultiQuery\n  ): Promise<DatapointAggregates[]> => {\n    console.warn(\n      'retrieveDatapointMonthlyAggregates is deprecated. Use retrieve() with granularity \"1mo\" instead. This method will be removed in the next major release.'\n    );\n    return this.retrieveDatapointsEndpoint<DatapointAggregates[]>({\n      ...query,\n      granularity: '1mo',\n    });\n  };\n\n  /**\n   * [Get latest data point in a time series](https://doc.cognitedata.com/api/v1/#operation/getLatest)\n   *\n   * ```js\n   * const datapoints = await client.datapoints.retrieveLatest([\n   *   {\n   *    before: 'now',\n   *    id: 123\n   *  },\n   *  {\n   *    externalId: 'abc',\n   *    before: new Date('21 jan 2018'),\n   *  }\n   * ]);\n   * ```\n   */\n  public retrieveLatest = (\n    items: LatestDataBeforeRequest[],\n    params: IgnoreUnknownIds = {}\n  ): Promise<Datapoints[]> => {\n    return this.retrieveLatestEndpoint(items, params);\n  };\n\n  /**\n   * [Delete data points](https://doc.cognitedata.com/api/v1/#operation/deleteDatapoints)\n   *\n   * ```js\n   * await client.datapoints.delete([{id: 123, inclusiveBegin: new Date('1 jan 2019')}]);\n   * ```\n   */\n  public delete = (items: DatapointsDeleteRequest[]): Promise<object> => {\n    return this.deleteDatapointsEndpoint(items);\n  };\n\n  private async insertEndpoint(items: DatapointsInsertItem[]) {\n    const path = this.url();\n    await this.postInParallelWithAutomaticChunking({ path, items });\n    return {};\n  }\n\n  protected async retrieveDatapointsEndpoint<\n    T extends DatapointAggregates[] | Datapoints[] =\n      | DatapointAggregates[]\n      | Datapoints[],\n  >(query: DatapointsMultiQuery) {\n    const path = this.listPostUrl;\n    const response = await this.post<ItemsWrapper<T>>(path, {\n      data: query,\n    });\n    return this.addToMapAndReturn(response.data.items, response);\n  }\n\n  private async retrieveLatestEndpoint(\n    items: LatestDataBeforeRequest[],\n    params: IgnoreUnknownIds\n  ): Promise<Datapoints[]> {\n    const path = this.url('latest');\n    return this.callEndpointWithMergeAndTransform(items, (request) =>\n      this.postInParallelWithAutomaticChunking({\n        items: request,\n        params,\n        path,\n        chunkSize: 100,\n      })\n    ) as Promise<Datapoints[]>;\n  }\n\n  private async deleteDatapointsEndpoint(items: DatapointsDeleteRequest[]) {\n    await this.postInParallelWithAutomaticChunking({\n      chunkSize: 10000,\n      items,\n      path: this.deleteUrl,\n    });\n    return {};\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  DataSet,\n  DataSetAggregate,\n  DataSetAggregateQuery,\n  DataSetChange,\n  DataSetFilterRequest,\n  ExternalDataSet,\n  IdEither,\n  IgnoreUnknownIds,\n} from '../../types';\n\nexport class DataSetsAPI extends BaseResourceAPI<DataSet> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  /**\n   * [Create datasets](https://docs.cognite.com/api/v1/#operation/createDataSets)\n   *\n   * ```js\n   * const datasets = [\n   *   { externalId: 'sensitiveData' },\n   *   { writeProtected: true }\n   * ];\n   * const createdDatasets = await client.datasets.create(datasets);\n   * ```\n   */\n  public create = (items: ExternalDataSet[]): Promise<DataSet[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [List data sets](https://docs.cognite.com/api/v1/#operation/listDataSets)\n   *\n   * ```js\n   * const dataSets = await client.datasets.list({ filter: { createdTime: { min: new Date('1 jan 2018'), max: new Date('1 jan 2019') }}});\n   * ```\n   */\n  public list = (\n    query?: DataSetFilterRequest\n  ): CursorAndAsyncIterator<DataSet> => {\n    return super.listEndpoint(this.callListEndpointWithPost, query);\n  };\n\n  /**\n   * [Aggregate datasets](https://docs.cognite.com/api/v1/#operation/aggregateDataSets)\n   *\n   * ```js\n   * const aggregates = await client.datasets.aggregate({ filter: { writeProtected: true } });\n   * console.log('Number of write protected datasets: ', aggregates[0].count)\n   * ```\n   */\n  public aggregate = (\n    query: DataSetAggregateQuery\n  ): Promise<DataSetAggregate[]> => {\n    return super.aggregateEndpoint(query);\n  };\n\n  /**\n   * [Retrieve data sets](https://docs.cognite.com/api/v1/#operation/getDataSets)\n   *\n   * ```js\n   * const dataSets = await client.datasets.retrieve([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public retrieve = (\n    ids: IdEither[],\n    params?: IgnoreUnknownIds\n  ): Promise<DataSet[]> => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Update data sets](https://docs.cognite.com/api/v1/#operation/updateDataSets)\n   *\n   * ```js\n   * const dataSets = await client.datasets.update([{id: 123, update: {description: {set: 'New description'}}}]);\n   * ```\n   */\n  public update = (changes: DataSetChange[]): Promise<DataSet[]> => {\n    return super.updateEndpoint(changes);\n  };\n}\n","// Copyright 2022 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorResponse,\n  type FilterQuery,\n  type HttpResponse,\n  type ItemsWrapper,\n} from '@cognite/sdk-core';\nimport type {\n  DocumentsAggregateAllUniquePropertiesItem,\n  DocumentsAggregateAllUniquePropertiesRequest,\n  DocumentsAggregateAllUniquePropertiesResponse,\n  DocumentsAggregateAllUniqueValuesItem,\n  DocumentsAggregateAllUniqueValuesRequest,\n  DocumentsAggregateAllUniqueValuesResponse,\n  DocumentsAggregateCountItem,\n  DocumentsAggregateCountRequest,\n  DocumentsAggregateRequest,\n  DocumentsAggregateUniquePropertiesItem,\n  DocumentsAggregateUniquePropertiesRequest,\n  DocumentsAggregateUniqueValuesItem,\n  DocumentsAggregateUniqueValuesRequest,\n} from '../../types';\n\n/**\n * Documents aggregate API.\n *\n * Note that only \"allUniqueValues\" requires pagination, and we therefore\n * configure the BaseResourceAPI to work for only that feature.\n */\nexport class DocumentsAggregateAPI extends BaseResourceAPI<unknown> {\n  public count = (\n    request: Omit<DocumentsAggregateCountRequest, 'aggregate'>\n  ): Promise<number> => {\n    return this.aggregate<DocumentsAggregateCountItem>({\n      ...request,\n      aggregate: 'count',\n    }).then((response) => response[0].count);\n  };\n\n  public uniqueValues = (\n    request: Omit<DocumentsAggregateUniqueValuesRequest, 'aggregate'>\n  ): Promise<DocumentsAggregateUniqueValuesItem[]> => {\n    return this.aggregate<DocumentsAggregateUniqueValuesItem>({\n      ...request,\n      aggregate: 'uniqueValues',\n    });\n  };\n\n  public allUniqueValues = (\n    request: Omit<DocumentsAggregateAllUniqueValuesRequest, 'aggregate'>\n  ): DocumentsAggregateAllUniqueValuesResponse => {\n    return this.cursorBasedEndpoint<\n      DocumentsAggregateAllUniqueValuesRequest,\n      DocumentsAggregateAllUniqueValuesItem\n    >(this.callAggregateCursorEndpointWithPost, {\n      ...request,\n      aggregate: 'allUniqueValues',\n    });\n  };\n\n  public uniqueProperties = (\n    request: Omit<DocumentsAggregateUniquePropertiesRequest, 'aggregate'>\n  ): Promise<DocumentsAggregateUniquePropertiesItem[]> => {\n    return this.aggregate<DocumentsAggregateUniquePropertiesItem>({\n      ...request,\n      aggregate: 'uniqueProperties',\n    });\n  };\n\n  public allUniqueProperties = (\n    request: Omit<DocumentsAggregateAllUniquePropertiesRequest, 'aggregate'>\n  ): DocumentsAggregateAllUniquePropertiesResponse => {\n    return this.cursorBasedEndpoint<\n      DocumentsAggregateAllUniquePropertiesRequest,\n      DocumentsAggregateAllUniquePropertiesItem\n    >(this.callAggregateCursorEndpointWithPost, {\n      ...request,\n      aggregate: 'allUniqueProperties',\n    });\n  };\n\n  private callAggregateCursorEndpointWithPost = async <\n    QueryType extends FilterQuery,\n    Item,\n  >(\n    scope?: QueryType\n  ): Promise<HttpResponse<CursorResponse<Item[]>>> => {\n    const response = await this.post<CursorResponse<Item[]>>(this.url(), {\n      data: scope,\n    });\n    return response;\n  };\n\n  private async aggregate<Item>(\n    request: DocumentsAggregateRequest\n  ): Promise<Item[]> {\n    const response = await this.post<ItemsWrapper<Item[]>>(this.url(), {\n      data: request,\n    });\n    return this.addToMapAndReturn(response.data.items, response);\n  }\n}\n","// Copyright 2022 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport { HttpResponseType } from '@cognite/sdk-core';\n\nimport type {\n  CogniteInternalId,\n  DocumentsPreviewTemporaryLinkResponse,\n} from '../../types';\n\nexport class PreviewAPI extends BaseResourceAPI<unknown> {\n  public documentAsPdf = (id: CogniteInternalId): Promise<ArrayBuffer> => {\n    return this.pdfPreviewEndpoint<ArrayBuffer>(id);\n  };\n\n  public documentAsImage = (\n    id: CogniteInternalId,\n    page: number\n  ): Promise<ArrayBuffer> => {\n    return this.imagePreviewEndpoint<ArrayBuffer>(id, page);\n  };\n\n  public pdfTemporaryLink = (\n    id: CogniteInternalId\n  ): Promise<DocumentsPreviewTemporaryLinkResponse> => {\n    return this.pdfTemporaryLinkEndpoint<DocumentsPreviewTemporaryLinkResponse>(\n      id\n    );\n  };\n\n  public pdfBuildPreviewURI = (id: CogniteInternalId): string => {\n    return `${this.url()}${id.toString()}/preview/pdf`;\n  };\n\n  private async pdfPreviewEndpoint<ResponseType>(\n    id: CogniteInternalId\n  ): Promise<ResponseType> {\n    const uri = this.pdfBuildPreviewURI(id);\n    const response = await this.get<ResponseType>(uri, {\n      responseType: HttpResponseType.ArrayBuffer,\n      headers: {\n        Accept: 'application/pdf',\n      },\n    });\n\n    return response.data;\n  }\n\n  public imageBuildPreviewURI = (id: CogniteInternalId, page = 1): string => {\n    return `${this.url()}${id.toString()}/preview/image/pages/${page.toString()}`;\n  };\n\n  private async imagePreviewEndpoint<ResponseType>(\n    id: CogniteInternalId,\n    page = 1\n  ): Promise<ResponseType> {\n    const uri = this.imageBuildPreviewURI(id, page);\n    const response = await this.get<ResponseType>(uri, {\n      responseType: HttpResponseType.ArrayBuffer,\n      headers: {\n        Accept: 'image/png',\n      },\n    });\n\n    return response.data;\n  }\n\n  public pdfBuildTemporaryLinkURI = (id: CogniteInternalId): string => {\n    return `${this.url()}${id.toString()}/preview/pdf/temporarylink`;\n  };\n\n  private async pdfTemporaryLinkEndpoint<ResponseType>(\n    id: CogniteInternalId\n  ): Promise<ResponseType> {\n    const uri = this.pdfBuildTemporaryLinkURI(id);\n    const response = await this.get<ResponseType>(uri);\n\n    return response.data;\n  }\n}\n","// Copyright 2022 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CogniteInternalId,\n  type CursorResponse,\n  type MetadataMap,\n} from '@cognite/sdk-core';\n\nimport type {\n  Document,\n  DocumentListRequest,\n  DocumentListResponse,\n  DocumentSearchItem,\n  DocumentSearchRequest,\n  DocumentSearchResponse,\n} from '../../types';\n\nimport { DocumentsAggregateAPI } from './aggregateApi';\nimport { PreviewAPI } from './previewApi';\n\nexport class DocumentsAPI extends BaseResourceAPI<Document> {\n  private readonly previewAPI: PreviewAPI;\n  private readonly aggregateAPI: DocumentsAggregateAPI;\n\n  constructor(...args: [string, CDFHttpClient, MetadataMap]) {\n    super(...args);\n\n    const [baseUrl, httpClient, map] = args;\n    this.previewAPI = new PreviewAPI(baseUrl, httpClient, map);\n    this.aggregateAPI = new DocumentsAggregateAPI(\n      `${baseUrl}/aggregate`,\n      httpClient,\n      map\n    );\n  }\n\n  public get preview() {\n    return this.previewAPI;\n  }\n\n  public get aggregate() {\n    return this.aggregateAPI;\n  }\n\n  /**\n   * [Search for documents](https://docs.cognite.com/api/v1/#operation/documentsSearch)\n   *\n   * ```js\n   * const documents = await client.documents.search({\n   *   search: {\n   *     query: 'Stuck pipe'\n   *   },\n   *   filter: {\n   *     in: {\n   *       property: ['type'],\n   *       values: ['Document', 'PDF']\n   *     }\n   *   },\n   *   limit: 5\n   * });\n   * ```\n   */\n  public search = (query: DocumentSearchRequest): DocumentSearchResponse => {\n    return this.cursorBasedEndpoint<DocumentSearchRequest, DocumentSearchItem>(\n      (scope) =>\n        this.post<CursorResponse<DocumentSearchItem[]>>(this.searchUrl, {\n          data: scope ?? {},\n        }),\n      query\n    );\n  };\n\n  public list = (request: DocumentListRequest): DocumentListResponse => {\n    return this.listEndpoint(this.callListEndpointWithPost, request);\n  };\n\n  public content = (id: CogniteInternalId): Promise<string> => {\n    return this.documentContent(id);\n  };\n\n  private async documentContent(id: CogniteInternalId): Promise<string> {\n    const response = await this.get<string>(this.url(`${id}/content`), {\n      headers: {\n        accept: 'text/plain',\n      },\n    });\n    return response.data;\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type IdEither,\n} from '@cognite/sdk-core';\nimport type {\n  ContextJobId,\n  EntityMatchingChange,\n  EntityMatchingCreateRequest,\n  EntityMatchingCreateResponse,\n  EntityMatchingFilterRequest,\n  EntityMatchingModel,\n  EntityMatchingPredictRequest,\n  EntityMatchingPredictResponse,\n  EntityMatchingPredictions,\n  EntityMatchingRefitRequest,\n  EntityMatchingRefitResponse,\n} from '../../types';\n\nexport class EntityMatchingApi extends BaseResourceAPI<EntityMatchingModel> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(\n      ['items'],\n      ['createdTime', 'startTime', 'statusTime']\n    );\n  }\n\n  /**\n   * [Create entity matcher](https://docs.cognite.com/api/v1/#operation/entityMatchingCreate)\n   *\n   * ```js\n   * const result = await client.entityMatching.create({\n   *  sources: [{externalId: 'asset1', name: 'asset1'}, {externalId: 'asset2', name: 'asset2'}],\n   *  targets: [{externalId: 'ts1', name: 'ts1'}, {externalId: 'ts2', name: 'ts2'}],\n   *  externalId: 'model123',\n   *  name: 'model123',\n   * });\n   * ```\n   */\n  public create = async (\n    scope: EntityMatchingCreateRequest\n  ): Promise<EntityMatchingCreateResponse> => {\n    const path = this.url();\n    const response = await this.post<EntityMatchingCreateResponse>(path, {\n      data: scope,\n    });\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Retrieve entity matching models](https://docs.cognite.com/api/v1/#operation/entityMatchingRetrieve)\n   *\n   * ```js\n   * const [result] = await client.entityMatching.retrieve([{ externalId: 'model123' }]);\n   * ```\n   */\n  public retrieve = (ids: IdEither[]): Promise<EntityMatchingModel[]> => {\n    return super.retrieveEndpoint(ids);\n  };\n\n  /**\n   * [List entity matching models](https://docs.cognite.com/api/v1/#operation/entityMatchingFilter)\n   *\n   * ```js\n   * const { items } = await client.entityMatching.list({ filter: { name: 'model123' }});\n   * ```\n   */\n  public list = (\n    scope?: EntityMatchingFilterRequest\n  ): CursorAndAsyncIterator<EntityMatchingModel> => {\n    return super.listEndpoint(this.callListEndpointWithPost, scope);\n  };\n\n  /**\n   * [Update entity matching models](https://docs.cognite.com/api/v1/#operation/entityMatchingUpdate)\n   *\n   * ```js\n   * const [updated] = await client.entityMatching.update([{\n   *  externalId: 'model123',\n   *  update: { description: { set: 'ø' }}\n   * }]);\n   * ```\n   */\n  public update = (\n    changes: EntityMatchingChange[]\n  ): Promise<EntityMatchingModel[]> => {\n    return super.updateEndpoint(changes);\n  };\n\n  /**\n   * [Delete entity matcher model](https://docs.cognite.com/api/v1/#operation/entityMatchingDelete)\n   *\n   * ```js\n   * await client.entityMatching.delete([{ externalId: 'model123' }]);\n   * ```\n   */\n  public delete = async (ids: IdEither[]): Promise<object> => {\n    return super.deleteEndpoint(ids);\n  };\n\n  /**\n   * [Predict matches](https://docs.cognite.com/api/v1/#operation/entityMatchingPredict)\n   *\n   * ```js\n   * const response = await client.entityMatching.predict({\n   *  externalId: 'model123',\n   *  sources: [{externalId: 'asset1', name: 'asset1'}, {externalId: 'asset2', name: 'asset2'}],\n   *  targets: [{externalId: 'ts1', name: 'ts1'}, {externalId: 'ts2', name: 'ts2'}],\n   * });\n   * ```\n   */\n  public predict = async (\n    scope: EntityMatchingPredictRequest\n  ): Promise<EntityMatchingPredictResponse> => {\n    const path = this.url('predict');\n    const response = await this.post<EntityMatchingPredictResponse>(path, {\n      data: scope,\n    });\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Retrieve entity matcher predict result](https://docs.cognite.com/api/playground/#operation/entityMatchingPredictResults)\n   *\n   * ```js\n   * const { status, items } = await client.entityMatching.predictResult(12345678);\n   * ```\n   */\n  public predictResult = async (\n    jobId: ContextJobId\n  ): Promise<EntityMatchingPredictions> => {\n    const path = this.url(`jobs/${jobId}`);\n    const response = await this.get<EntityMatchingPredictions>(path);\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Re-fit entity matcher model](https://docs.cognite.com/api/v1/#operation/entityMatchingReFit)\n   *\n   * ```js\n   * await client.entityMatching.refit({\n   *  newExternalId: 'newModel123',\n   *  sources: [{externalId: 'asset1', name: 'asset1'}, {externalId: 'asset2', name: 'asset2'}],\n   *  targets: [{externalId: 'ts1', name: 'ts1'}, {externalId: 'ts2', name: 'ts2'}],\n   *  externalId: 'model123',\n   *  trueMatches: [{sourceExternalId: 'asset1', targetExternalId: 'ts1'}]\n   * });\n   * ```\n   */\n  public refit = async (\n    scope: EntityMatchingRefitRequest\n  ): Promise<EntityMatchingRefitResponse> => {\n    const path = this.url('refit');\n    const response = await this.post<EntityMatchingRefitResponse>(path, {\n      data: scope,\n    });\n    return this.addToMapAndReturn(response.data, response);\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type {\n  AggregateResponse,\n  EventAggregateQuery,\n  EventUniqueValuesAggregate,\n  UniqueValuesAggregateResponse,\n} from '../../types';\n\nexport class EventsAggregateAPI extends BaseResourceAPI<unknown> {\n  /**\n   * [Aggregate events](https://docs.cognite.com/api/v1/#operation/aggregateEvents)\n   *\n   * ```js\n   * const aggregates = await client.events.aggregate.count({ filter: { assetIds: [1, 2, 3] } });\n   * console.log('Number of events: ', aggregates[0].count)\n   * ```\n   */\n  public count = (query: EventAggregateQuery): Promise<AggregateResponse[]> => {\n    return super.aggregateEndpoint(query);\n  };\n\n  /**\n   * [Aggregate events](https://docs.cognite.com/api/v1/#operation/aggregateEvents)\n   *\n   * ```js\n   * const uniqueValues = await client.events.aggregate.uniqueValues({ filter: { assetIds: [1, 2, 3] }, fields: ['subtype'] });\n   * console.log('Unique values: ', uniqueValues)\n   * ```\n   */\n  public uniqueValues = (\n    query: EventUniqueValuesAggregate\n  ): Promise<UniqueValuesAggregateResponse[]> => {\n    return super.aggregateEndpoint({\n      ...query,\n      aggregate: 'uniqueValues',\n    });\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CursorAndAsyncIterator,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteEvent,\n  EventChange,\n  EventFilterRequest,\n  EventSearchRequest,\n  EventSort,\n  ExternalEvent,\n  IdEither,\n  IgnoreUnknownIds,\n} from '../../types';\nimport { EventsAggregateAPI } from './eventsAggregateApi';\n\nexport class EventsAPI extends BaseResourceAPI<CogniteEvent> {\n  private aggregateAPI: EventsAggregateAPI;\n\n  constructor(...args: [string, CDFHttpClient, MetadataMap]) {\n    super(...args);\n    this.aggregateAPI = new EventsAggregateAPI(...args);\n  }\n\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  /**\n   * [Create events](https://doc.cognitedata.com/api/v1/#operation/createEvents)\n   *\n   * ```js\n   * const events = [\n   *   { description: 'Workorder pump abc', startTime: new Date('22 jan 2019') },\n   *   { description: 'Broken rule', externalId: 'rule123', startTime: 1557346524667000 },\n   * ];\n   * const createdEvents = await client.events.create(events);\n   * ```\n   */\n  public create = (items: ExternalEvent[]): Promise<CogniteEvent[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [List events](https://doc.cognitedata.com/api/v1/#operation/advancedListEvents)\n   * <!-- or [similar](https://doc.cognitedata.com/api/v1/#operation/listEvents) -->\n   *\n   * ```js\n   * const events = await client.events.list({ filter: { startTime: { min: new Date('1 jan 2018') }, endTime: { max: new Date('1 jan 2019') } } });\n   * ```\n   */\n  public list = (\n    scope?: EventFilterRequest\n  ): CursorAndAsyncIterator<CogniteEvent> => {\n    const { sort: sortObject = {}, ...rest } = scope || {};\n    const query = { sort: this.convertSortObjectToArray(sortObject), ...rest };\n    return super.listEndpoint(this.callListEndpointWithPost, query);\n  };\n\n  /**\n   * [Retrieve events](https://doc.cognitedata.com/api/v1/#operation/byIdsEvents)\n   * <!-- or [similar](https://doc.cognitedata.com/api/v1/#operation/getEventByInternalId) -->\n   *\n   * ```js\n   * const events = await client.events.retrieve([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public retrieve = (ids: IdEither[], params: EventRetrieveParams = {}) => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Update events](https://doc.cognitedata.com/api/v1/#operation/updateEvents)\n   *\n   * ```js\n   * const events = await client.events.update([{id: 123, update: {description: {set: 'New description'}}}]);\n   * ```\n   */\n  public update = (changes: EventChange[]) => {\n    return super.updateEndpoint(changes);\n  };\n\n  /**\n   * [Search for events](https://doc.cognitedata.com/api/v1/#operation/searchEvents)\n   *\n   * ```js\n   * const events = await client.events.search({\n   *   filter: {\n   *     assetIds: [1, 2]\n   *   },\n   *   search: {\n   *     description: 'Pump'\n   *   }\n   * });\n   * ```\n   */\n  public search = (query: EventSearchRequest) => {\n    return super.searchEndpoint(query);\n  };\n\n  /**\n   * [Delete events](https://doc.cognitedata.com/api/v1/#operation/deleteEvents)\n   *\n   * ```js\n   * await client.events.delete([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public delete = (ids: IdEither[]) => {\n    return super.deleteEndpoint(ids);\n  };\n\n  /**\n   * The aggregation API allows you to compute aggregated results on events like getting the count of all events\n   * in a project or checking what are all the different types and subtypes of events in your project,\n   * along with the count of events in each of those aggregations.\n   * By specifying an additional filter, you can also aggregate only among events matching the specified filter.\n   */\n  public get aggregate() {\n    return this.aggregateAPI;\n  }\n\n  private convertSortObjectToArray(sortObject: EventSort) {\n    return Object.entries(sortObject).map(\n      ([prop, order]) => `${prop}:${order}`\n    );\n  }\n}\n\nexport type EventRetrieveParams = IgnoreUnknownIds;\n","export class UploadAlreadyFinishedError extends Error {\n  constructor() {\n    super('Upload has already finished');\n  }\n}\n","import {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type {\n  FileContent,\n  FileInfo,\n  MultiPartFileChunkResponse,\n  MultiPartFileUploadResponse,\n} from '../../types';\nimport { UploadAlreadyFinishedError } from './errors';\n\nexport class FilesMultipartUploadSessionAPI extends BaseResourceAPI<FileInfo> {\n  public multiPartFileUploadResponse: MultiPartFileUploadResponse;\n  private uploadedUrls: boolean[];\n  private finished: boolean;\n\n  constructor(\n    ...args: [string, CDFHttpClient, MetadataMap, MultiPartFileUploadResponse]\n  ) {\n    super(args[0], args[1], args[2]);\n    [, , , this.multiPartFileUploadResponse] = args;\n\n    this.uploadedUrls = this.multiPartFileUploadResponse.uploadUrls.map(\n      (_) => false\n    );\n    this.finished = false;\n  }\n\n  public async uploadPart(\n    partNumber: number,\n    fileContent: FileContent\n  ): Promise<undefined | MultiPartFileChunkResponse> {\n    const hasFileContent = fileContent != null;\n    if (!hasFileContent) {\n      throw Error('you are uploading empty content');\n    }\n    if (\n      partNumber < 0 ||\n      partNumber >= this.multiPartFileUploadResponse.uploadUrls.length\n    ) {\n      throw Error(\n        `part number is outside allowed range 0 to ${\n          this.multiPartFileUploadResponse.uploadUrls.length - 1\n        }`\n      );\n    }\n    if (this.canCompleteUpload()) {\n      await this.completeMultiPartUpload();\n      return;\n    }\n    if (this.alreadyUploadedPart(partNumber)) {\n      return;\n    }\n    if (this.multiPartFileUploadResponse.uploadUrls[partNumber] === null) {\n      throw Error('part number is not valid');\n    }\n    if (fileContent != null) {\n      const response = await this.put(\n        this.multiPartFileUploadResponse.uploadUrls[partNumber],\n        {\n          data: fileContent,\n        }\n      );\n\n      if (response.status === 200 || response.status === 201) {\n        this.uploadedUrls[partNumber] = true;\n        if (this.canCompleteUpload()) {\n          await this.completeMultiPartUpload();\n        }\n        return { partNumber, status: response.status };\n      }\n      return { partNumber, status: response.status };\n    }\n  }\n\n  private alreadyUploadedPart(partNumber: number) {\n    return this.uploadedUrls[partNumber];\n  }\n\n  private canCompleteUpload() {\n    return (\n      this.uploadedUrls.length !== 0 && this.getNotCompletedParts().length === 0\n    );\n  }\n\n  private async completeMultiPartUpload() {\n    if (this.finished) {\n      throw new UploadAlreadyFinishedError();\n    }\n    if (!this.canCompleteUpload()) {\n      return;\n    }\n\n    const path = this.url('completemultipartupload');\n    const requestBody = {\n      id: this.multiPartFileUploadResponse.id,\n      uploadId: this.multiPartFileUploadResponse.uploadId,\n    };\n\n    const response = await this.post<Response>(path, {\n      data: requestBody,\n    });\n    if (response.status !== 200) {\n      throw Error('upload cannot be completed');\n    }\n    this.finished = true;\n  }\n  public getNotCompletedParts(): number[] {\n    return this.uploadedUrls.reduce((acc, curr, index) => {\n      if (curr === false) {\n        acc.push(index);\n      }\n      return acc;\n    }, [] as number[]);\n  }\n  public getMultiPartFileUploadId() {\n    return this.multiPartFileUploadResponse.uploadId;\n  }\n  public getFinished() {\n    return this.finished;\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CursorAndAsyncIterator,\n  type HttpHeaders,\n  type IdEitherWithInstance,\n  type MetadataMap,\n  sleepPromise,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  ExternalFileInfo,\n  FileAggregate,\n  FileAggregateQuery,\n  FileChangeUpdate,\n  FileContent,\n  FileInfo,\n  FileLink,\n  FileRequestFilter,\n  FileUploadResponse,\n  FilesSearchFilter,\n  IdEither,\n  IgnoreUnknownIds,\n  ItemsWrapper,\n  MultiPartFileUploadResponse,\n} from '../../types';\nimport { FilesMultipartUploadSessionAPI } from './filesMultipartUploadSessionApi';\n\nexport class FilesAPI extends BaseResourceAPI<FileInfo> {\n  private limits = {\n    minimumNumberOfParts: 1,\n    maxNumberOfParts: 250,\n  };\n  private _client: CDFHttpClient;\n  private _map: MetadataMap;\n  private _baseUrl: string;\n  constructor(...args: [string, CDFHttpClient, MetadataMap]) {\n    super(...args);\n    [this._baseUrl, this._client, this._map] = args;\n  }\n  /**\n   * Specify that dates should be parsed in requests and responses\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(\n      ['items'],\n      [\n        'createdTime',\n        'lastUpdatedTime',\n        'sourceCreatedTime',\n        'sourceModifiedTime',\n        'uploadedTime',\n      ]\n    );\n  }\n\n  /**\n   * [Upload a file](https://doc.cognitedata.com/api/v1/#operation/initFileUpload)\n   *\n   * ```js\n   * const fileContent = 'file data here'; // can also be of type ArrayBuffer, Buffer, Blob, File or any\n   * // automatic upload:\n   * const file = await client.files.upload({name: 'examplefile.jpg', mimeType: 'image/jpeg'}, fileContent);\n   *\n   * // manual with uploadUrl:\n   * const file2 = await client.files.upload({name: 'examplefile.jpg', mimeType: 'image/jpeg'});\n   * // then upload using the file.uploadUrl\n   * ```\n   */\n  public upload = (\n    fileInfo: ExternalFileInfo,\n    fileContent?: FileContent,\n    overwrite = false,\n    waitUntilAcknowledged = false\n  ): Promise<FileUploadResponse | FileInfo> => {\n    return this.uploadEndpoint(\n      fileInfo,\n      fileContent,\n      overwrite,\n      waitUntilAcknowledged\n    );\n  };\n\n  /**\n   * [List files](https://doc.cognitedata.com/api/v1/#operation/advancedListFiles)\n   * <!-- or [similar](https://doc.cognitedata.com/api/v1/#operation/listFiles) -->\n   *\n   * ```js\n   * const files = await client.files.list({filter: {mimeType: 'image/png'}});\n   * ```\n   */\n  public list = (\n    scope?: FileRequestFilter\n  ): CursorAndAsyncIterator<FileInfo> => {\n    return super.listEndpoint(this.callListEndpointWithPost, scope);\n  };\n\n  /**\n   * [Aggregate files](https://docs.cognite.com/api/v1/#operation/aggregateFiles)\n   *\n   * ```js\n   * const aggregates = await client.files.aggregate({ filter: { uploaded: true } });\n   * console.log('Number of uploaded files: ', aggregates[0].count)\n   * ```\n   */\n  public aggregate = (query: FileAggregateQuery): Promise<FileAggregate[]> => {\n    return super.aggregateEndpoint(query);\n  };\n\n  /**\n   * [Retrieve files](https://doc.cognitedata.com/api/v1/#operation/byIdsFiles)\n   * <!-- or [just one](https://doc.cognitedata.com/api/v1/#operation/getFileByInternalId) -->\n   *\n   * ```js\n   * const files = await client.files.retrieve([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public retrieve = (\n    ids: IdEitherWithInstance[],\n    params: FileRetrieveParams = {}\n  ): Promise<FileInfo[]> => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Update files](https://doc.cognitedata.com/api/v1/#operation/updateFiles)\n   *\n   * ```js\n   * const files = await client.files.update([{\n   *   id: 123,\n   *   update: {\n   *     source: { set: 'new source' }\n   *   }\n   * }]);\n   * ```\n   */\n  public update = (changes: FileChangeUpdate[]) => {\n    return super.updateEndpoint(changes);\n  };\n\n  /**\n   * [Search for files](https://doc.cognitedata.com/api/v1/#operation/searchFiles)\n   *\n   * ```js\n   * const files = await client.files.search({\n   *   filter: {\n   *     mimeType: 'image/jpeg',\n   *   },\n   *   search: {\n   *     name: 'Pump'\n   *   }\n   * });\n   * ```\n   */\n  public search = (query: FilesSearchFilter) => {\n    return super.searchEndpoint(query);\n  };\n\n  /**\n   * [Delete files](https://doc.cognitedata.com/api/v1/#operation/deleteFiles)\n   *\n   * ```js\n   * await client.files.delete([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public delete = (ids: IdEither[]) => {\n    return super.deleteEndpoint(ids);\n  };\n\n  /**\n   * [Get download urls](https://doc.cognitedata.com/api/v1/#operation/downloadLinks)\n   *\n   * ```js\n   * await client.files.getDownloadUrls([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public getDownloadUrls = (\n    ids: IdEitherWithInstance[]\n  ): Promise<(FileLink & IdEitherWithInstance)[]> => {\n    return this.getDownloadUrlsEndpoint(ids);\n  };\n\n  private async uploadEndpoint(\n    fileInfo: ExternalFileInfo,\n    fileContent?: FileContent,\n    overwrite = false,\n    waitUntilAcknowledged = false\n  ) {\n    const hasFileContent = fileContent != null;\n    if (!hasFileContent && waitUntilAcknowledged) {\n      throw Error(\n        \"Don't set waitUntilAcknowledged to true when you are not uploading a file\"\n      );\n    }\n\n    const params = { overwrite };\n    const path = this.url();\n    const response = await this.post<FileUploadResponse>(path, {\n      params,\n      data: fileInfo,\n    });\n    const file = response.data;\n    if (fileContent != null) {\n      await this.uploadFile(file.uploadUrl, fileContent, fileInfo.mimeType);\n    }\n    if (waitUntilAcknowledged) {\n      const uploadedFile = await this.waitUntilFileIsUploaded(file.id);\n      return this.addToMapAndReturn(uploadedFile, response);\n    }\n    return this.addToMapAndReturn(file, response);\n  }\n\n  private uploadFile(url: string, fileContent: FileContent, mimeType?: string) {\n    const headers: HttpHeaders = {\n      'Content-Type': mimeType || 'application/octet-stream',\n    };\n    return this.put(url, {\n      headers,\n      data: fileContent,\n    });\n  }\n\n  // TODO: refactor - similar to RetryableHttpClient.rawRequest\n  private async waitUntilFileIsUploaded(\n    fileId: CogniteInternalId\n  ): Promise<FileInfo> {\n    const MAX_RETRIES = 10;\n    const DELAY_IN_MS = 500;\n    let retryCount = 0;\n    do {\n      const [fileInfo] = await this.retrieve([{ id: fileId }]);\n      if (fileInfo.uploaded) {\n        return fileInfo;\n      }\n      retryCount++;\n      await sleepPromise(DELAY_IN_MS);\n    } while (retryCount < MAX_RETRIES);\n    throw Error(`File never marked as 'uploaded'`);\n  }\n\n  private async getDownloadUrlsEndpoint(items: IdEitherWithInstance[]) {\n    const path = this.url('downloadlink');\n    const response = await this.post<\n      ItemsWrapper<(FileLink & IdEitherWithInstance)[]>\n    >(path, { data: { items } });\n    return this.addToMapAndReturn(response.data.items, response);\n  }\n  /**\n   * [Init a multipart file upload](https://api-docs.cognite.com/20230101/tag/Files/operation/initMultiPartUpload)\n   *\n   * ```js\n   * // Each file part must be larger than 5 MiB, and smaller than 4000 MiB. The file part for the last uploadURL can be smaller than 5 MiB.\n   * const numberOfParts = 5;\n   * // automatic upload:\n   * const multiPartUploadApi = await client.files.multipartUploadSession({name: 'examplefile.jpg', mimeType: 'image/jpeg'}, numberOfParts);\n   * ```\n   */\n  public async multipartUploadSession(\n    fileInfo: ExternalFileInfo,\n    parts: number,\n    overwrite = false\n  ) {\n    const response = await this.getMultipartUploadSession(\n      fileInfo,\n      parts,\n      overwrite\n    );\n    const multipartUploadSession = new FilesMultipartUploadSessionAPI(\n      this._baseUrl,\n      this._client,\n      this._map,\n      response.data\n    );\n    return this.addToMapAndReturn(multipartUploadSession, response);\n  }\n  private async getMultipartUploadSession(\n    fileInfo: ExternalFileInfo,\n    parts: number,\n    overwrite = false\n  ) {\n    if (\n      parts < this.limits.minimumNumberOfParts ||\n      parts > this.limits.maxNumberOfParts\n    ) {\n      throw Error(\n        `parts must be in range ${this.limits.minimumNumberOfParts} <= parts <= ${this.limits.maxNumberOfParts}`\n      );\n    }\n    const path = this.url('initmultipartupload');\n    const params = { overwrite: overwrite, parts: parts };\n    const response = await this.post<MultiPartFileUploadResponse>(path, {\n      params,\n      data: fileInfo,\n    });\n    return response;\n  }\n}\n\nexport type FileRetrieveParams = IgnoreUnknownIds;\n","// Copyright 2025 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { IdEither, ItemsWrapper } from '@cognite/sdk-core';\nimport type { IgnoreUnknownIds } from '../../types';\nimport type {\n  CogniteFunction,\n  ExternalCogniteFunctionItem,\n  FunctionListScope,\n  FunctionsActivationResponse,\n  FunctionsLimits,\n} from './types';\n\nexport class FunctionsAPI extends BaseResourceAPI<CogniteFunction> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastCalled']);\n  }\n\n  /**\n   * [Create functions](https://developer.cognite.com/api#tag/Functions/operation/postFunctions)\n   *\n   * ```js\n   * const functions = await client.functions.create([{\n   *   name: 'My awesome function',\n   *   fileId: 5467347282343\n   * }]);\n   * ```\n   */\n  public create = (\n    items: ExternalCogniteFunctionItem[]\n  ): Promise<CogniteFunction[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [List functions](https://developer.cognite.com/api#tag/Functions/operation/listFunctions)\n   *\n   * ```js\n   * const functions = await client.functions.list();\n   * ```\n   */\n  public list = async (\n    scope?: FunctionListScope\n  ): Promise<CogniteFunction[]> => {\n    const response = await this.post<ItemsWrapper<CogniteFunction[]>>(\n      this.listPostUrl,\n      { data: scope || {} }\n    );\n    return this.addToMapAndReturn(response.data.items, response);\n  };\n\n  /**\n   * [Retrieve a function by its ID](https://developer.cognite.com/api#tag/Functions/operation/getFunction)\n   *\n   * ```js\n   * const func = await client.functions.retrieve([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public retrieve = (\n    ids: IdEither[],\n    params: IgnoreUnknownIds = {}\n  ): Promise<CogniteFunction[]> => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Delete functions](https://developer.cognite.com/api#tag/Functions/operation/deleteFunctions)\n   *\n   * ```js\n   * await client.functions.delete([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public delete = (ids: IdEither[], params: IgnoreUnknownIds = {}) => {\n    return super.deleteEndpoint(ids, params);\n  };\n\n  /**\n   * [Get functions limits](https://developer.cognite.com/api#tag/Functions/operation/functionsLimits)\n   *\n   * Returns the service limits for Cognite Functions.\n   *\n   * ```js\n   * const limits = await client.functions.limits();\n   * ```\n   */\n  public limits = async (): Promise<FunctionsLimits> => {\n    const response = await this.get<FunctionsLimits>(this.url('limits'));\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Activate Cognite Functions](https://developer.cognite.com/api#tag/Functions/operation/postFunctionsStatus)\n   *\n   * Activate Cognite Functions for the project. This will create the necessary backend infrastructure.\n   *\n   * ```js\n   * const status = await client.functions.activate();\n   * ```\n   */\n  public activate = async (): Promise<FunctionsActivationResponse> => {\n    const response = await this.post<FunctionsActivationResponse>(\n      this.url('status')\n    );\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Get activation status](https://developer.cognite.com/api#tag/Functions/operation/getFunctionsStatus)\n   *\n   * Get the activation status of Cognite Functions for the project.\n   *\n   * ```js\n   * const status = await client.functions.status();\n   * ```\n   */\n  public status = async (): Promise<FunctionsActivationResponse> => {\n    const response = await this.get<FunctionsActivationResponse>(\n      this.url('status')\n    );\n    return this.addToMapAndReturn(response.data, response);\n  };\n}\n","import { BaseResourceAPI } from '@cognite/sdk-core';\nimport type {\n  GeospatialComputedItemList,\n  GeospatialJsonComputeOutput,\n} from './types';\n\nexport class ComputeAPI extends BaseResourceAPI<GeospatialComputedItemList> {\n  /**\n   * [Compute custom json output structures or well known binary format responses based on calculation or selection of feature properties or direct values given in the request.](https://docs.cognite.com/api/v1/#operation/compute)\n   *\n   * ```js\n   *\n   * const response = await client.geospatial.compute.compute({\n   *   output: {\n   *     \"output\": {\n   *       stTransform: {\n   *         geometry: {\n   *           ewkt: \"SRID=4326;POLYGON((0 0,10 0,10 10,0 10,0 0))\"\n   *         },\n   *         srid: 4326,\n   *       }\n   *     }\n   *   }\n   * });\n   * ```\n   */\n  public compute = async (\n    request: GeospatialJsonComputeOutput\n  ): Promise<GeospatialComputedItemList> => {\n    const path = this.url();\n    const response = await this.post<GeospatialComputedItemList>(path, {\n      data: request,\n    });\n    return response.data;\n  };\n}\n","import {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  GeospatialCRSResponse,\n  GeospatialCoordinateReferenceSystem,\n  GeospatialSridId,\n} from './types';\n\nexport class CrsAPI extends BaseResourceAPI<GeospatialCRSResponse> {\n  /**\n   * [Create Coordinate Reference Systems](https://docs.cognite.com/api/v1/#operation/createGeospatialCoordinateReferenceSystems)\n   *\n   * ```js\n   * const crsToCreate = [{\n   *  srid: 456789,\n   *  wkt: 'GEOGCS[\\\"WGS 84\\\",DATUM[\\\"WGS_1984\\\",SPHEROID[\\\"WGS 84\\\",6378137,298.257223563,AUTHORITY[\\\"EPSG\\\",\\\"7030\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"6326\\\"]],PRIMEM[\\\"Greenwich\\\",0,AUTHORITY[\\\"EPSG\\\",\\\"8901\\\"]],UNIT[\\\"degree\\\",0.0174532925199433,AUTHORITY[\\\"EPSG\\\",\\\"9122\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"4326\\\"]]',\n   *  projString: '+proj=longlat +datum=WGS84 +no_defs \\\"\\\"'\n   *  }];\n   *\n   * const createdCRS = await client.geospatial.crs.create(crsToCreate);\n   * ```\n   */\n  public create = (\n    crs: GeospatialCoordinateReferenceSystem[]\n  ): Promise<GeospatialCRSResponse[]> => {\n    return this.createEndpoint<GeospatialCoordinateReferenceSystem>(crs);\n  };\n\n  /**\n   * [Get Coordinate Reference Systems](https://docs.cognite.com/api/v1/#operation/getCoordinateReferenceSystem)\n   *\n   * ```js\n   * const retrievedCRS = await client.geospatial.crs.retrieve([{ srid: 4326 }]);\n   * ```\n   */\n  public retrieve = (\n    srids: GeospatialSridId[]\n  ): Promise<GeospatialCRSResponse[]> => {\n    // @ts-ignore geospatial team should accept ids probably to be in synergy with sdk\n    return this.retrieveEndpoint<object, GeospatialSridId>(srids);\n  };\n\n  /**\n   * [List Coordinate Reference Systems](https://docs.cognite.com/api/v1/#operation/listGeospatialCoordinateReferenceSystems)\n   *\n   * ```js\n   * const allCRS = await client.geospatial.crs.list({ filterOnlyCustom : true });\n   * ```\n   */\n  public list = (params?: {\n    filterOnlyCustom?: boolean;\n  }): CursorAndAsyncIterator<GeospatialCRSResponse> => {\n    return this.listEndpoint<{\n      filterOnlyCustom?: boolean;\n      limit?: number; // just to match underlying QueryType, crs doesn't have limit\n    }>(this.callListEndpointWithGet, params);\n  };\n\n  /**\n   * [Delete Coordinate Reference Systems](https://docs.cognite.com/api/v1/#operation/deleteGeospatialCoordinateReferenceSystems)\n   *\n   * ```js\n   * await client.geospatial.crs.delete([{ srid: 4326}]);\n   * ```\n   */\n  public delete = (srids: GeospatialSridId[]) => {\n    return this.deleteEndpoint<object, GeospatialSridId>(srids);\n  };\n}\n","import {\n  BaseResourceAPI,\n  type CogniteExternalId,\n  type ExternalId,\n} from '@cognite/sdk-core';\nimport type {\n  FeatureAggregateParams,\n  GeospatialFeature,\n  GeospatialFeatureListFilter,\n  GeospatialFeatureResponse,\n  GeospatialFeatureSearchFilter,\n  GeospatialFeatureSearchStreamFilter,\n  GeospatialFeatureSearchStreamResponse,\n  GeospatialOutput,\n} from './types';\n\nexport class FeatureAPI extends BaseResourceAPI<GeospatialFeatureResponse> {\n  /**\n   * [Create features](https://docs.cognite.com/api/v1/#operation/createFeatures)\n   *\n   * ```js\n   * const featureTypeExternalId = 'ocean_temperature';\n   * const features = [\n   *   { externalId: 'measurement_point_765', temperature: 5.65, location: { wkt: 'POINT(60.547602 -5.423433)' }},\n   *   { externalId: 'measurement_point_863', temperature: 5.03, location: { wkt: 'POINT(60.585858 -6.474416)' }},\n   * ];\n   * const createdFeatures = await client.geospatial.feature.create(featureTypeExternalId, features);\n   * ```\n   */\n  public create = (\n    featureTypeExternalId: CogniteExternalId,\n    features: GeospatialFeature[]\n  ): Promise<GeospatialFeatureResponse[]> => {\n    return this.createEndpoint<GeospatialFeature>(\n      features,\n      this.url(`${featureTypeExternalId}/features`)\n    );\n  };\n\n  /**\n   * [Retrieve features](https://docs.cognite.com/api/v1/#operation/getFeaturesByIds)\n   *\n   * ```js\n   * const featuresToRetrieve = [{ externalId: 'measurement_point_765' }, { externalId: 'measurement_point_765' }];\n   * const outputParams = { output: { geometryFormat: 'GEOJSON' as const } };\n   *\n   * const retrievedFeatures = await client.geospatial.feature.retrieve('ocean_temperature', featuresToRetrieve, outputParams);\n   * ```\n   */\n  public retrieve = (\n    featureTypeExternalId: CogniteExternalId,\n    externalIds: ExternalId[],\n    params?: GeospatialOutput\n  ): Promise<GeospatialFeatureResponse[]> => {\n    return this.callEndpointWithMergeAndTransform(externalIds, (request) =>\n      this.postInParallelWithAutomaticChunking({\n        path: this.url(`${featureTypeExternalId}/features/byids`),\n        items: request,\n        params,\n      })\n    );\n  };\n\n  /**\n   * [Update features](https://docs.cognite.com/api/v1/#operation/updateFeatures)\n   *\n   * ```js\n   * const featuresToUpdate = [\n   * { externalId: 'measurement_point_765', temperature: 5.65, location: { wkt: 'POINT(60.547602 -5.423433)' } },\n   * { externalId: 'measurement_point_863', temperature: 5.03, location: { wkt: 'POINT(60.585858 -6.474416)' } }\n   * ];\n   *\n   * const updatedFeatures = await client.geospatial.feature.update('ocean_temperature', featuresToUpdate);\n   * ```\n   */\n  public update = (\n    featureTypeExternalId: CogniteExternalId,\n    changes: GeospatialFeature[]\n  ): Promise<GeospatialFeatureResponse[]> => {\n    return this.updateEndpoint(\n      changes,\n      this.url(`${featureTypeExternalId}/features/update`)\n    );\n  };\n\n  /**\n   * [Update features](https://docs.cognite.com/api/v1/#operation/updateFeatures)\n   *\n   * ```js\n   * const featuresToDelete = [{ externalId: 'measurement_point_765' }, { externalId: 'measurement_point_765' }];\n   *\n   * await client.geospatial.feature.delete('ocean_temperature', featuresToDelete);\n   * ```\n   */\n  public delete = (\n    featureTypeExternalId: CogniteExternalId,\n    externalIds: ExternalId[]\n  ) => {\n    return this.deleteEndpoint(\n      externalIds,\n      {},\n      this.url(`${featureTypeExternalId}/features/delete`)\n    );\n  };\n\n  /**\n   * [Search features](https://docs.cognite.com/api/v1/#operation/searchFeatures)\n   *\n   * ```js\n   * const params = {\n   *  filter: {\n   *    and: [\n   *      { range:{ property: 'temperature', gt:4.54 } },\n   *      { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n   *   ]\n   *  },\n   *  limit: 100,\n   *  sort: [ 'temperature:ASC','location']\n   * };\n   *\n   * const searchedFeatures = await client.geospatial.feature.search('ocean_temperature', params);\n   * ```\n   */\n  public search = (\n    featureTypeExternalId: CogniteExternalId,\n    params: GeospatialFeatureSearchFilter = {}\n  ): Promise<GeospatialFeatureResponse[]> => {\n    return this.searchEndpoint(\n      params,\n      this.url(`${featureTypeExternalId}/features/search`)\n    );\n  };\n\n  /**\n   * [Search and stream features](https://docs.cognite.com/api/v1/#operation/searchFeaturesStreaming)\n   *\n   * ```js\n   * const params = {\n   *  filter: {\n   *    and: [\n   *      { range:{ property: 'temperature', gt:4.54 } },\n   *      { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n   *   ]\n   *  },\n   *  limit: 100,\n   *  output: { jsonStreamFormat: 'NEW_LINE_DELIMITED' as const }\n   * };\n   *\n   * const featureStreamString = await client.geospatial.feature.searchStream('ocean_temperature', params);\n   * ```\n   */\n  public searchStream = (\n    featureTypeExternalId: CogniteExternalId,\n    params: GeospatialFeatureSearchStreamFilter = {}\n  ): Promise<GeospatialFeatureSearchStreamResponse> => {\n    return this.callSearchEndpoint<\n      GeospatialFeatureSearchStreamFilter,\n      GeospatialFeatureSearchStreamResponse\n    >(\n      params,\n      this.url(`${featureTypeExternalId}/features/search-streaming`)\n      // not using addToMapAndReturn in then as WeakMap does not accept primitive values as key and we've string as our response\n    ).then((response) => response.data);\n  };\n\n  /**\n   * [Aggregate features](https://docs.cognite.com/api/v1/#operation/aggregateFeatures)\n   *\n   * ```js\n   * const aggregateParams = {\n   *  filter: {\n   *    and: [\n   *      { range:{ property: 'temperature', gt:4.54 } },\n   *      { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n   *   ]\n   *  },\n   *  property: 'temperature',\n   *  aggregates: ['min', 'max', 'average'],\n   *  groupBy: ['category']\n   * };\n   *\n   * const featureStream = await client.geospatial.feature.searchStream('ocean_temperature', aggregateParams);\n   * ```\n   */\n  public aggregate = (\n    featureTypeExternalId: CogniteExternalId,\n    params?: FeatureAggregateParams\n  ) => {\n    return this.aggregateEndpoint(\n      params,\n      this.url(`${featureTypeExternalId}/features/aggregate`)\n    );\n  };\n\n  /**\n   * [List features](https://docs.cognite.com/api/v1/#tag/Geospatial/operation/listFeatures)\n   *\n   * ```js\n   * const params = {\n   *  filter: {\n   *    and: [\n   *      { range:{ property: 'temperature', gt:4.54 } },\n   *      { stWithin: { property:'location', value:'POLYGON((60.547602 -5.423433, 60.547602 -6.474416, 60.585858 -5.423433, 60.547602 -5.423433))' } }\n   *   ]\n   *  },\n   * };\n   *\n   * const allFeaturesList = await client.geospatial.feature.list('ocean_temperature', params);\n   * ```\n   */\n  public list = (\n    featureTypeExternalId: CogniteExternalId,\n    filterParams: GeospatialFeatureListFilter = {}\n  ) => {\n    const path = this.url(`${featureTypeExternalId}/features/list`);\n    return this.listEndpoint(\n      async (params) => this.post(path, { data: params }),\n      filterParams\n    );\n  };\n}\n","import {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type ExternalId,\n} from '@cognite/sdk-core';\nimport type {\n  FeatureType,\n  GeospatialCreateFeatureType,\n  GeospatialRecursiveDelete,\n  GeospatialUpdateFeatureType,\n} from './types';\n\nexport class FeatureTypeAPI extends BaseResourceAPI<FeatureType> {\n  /**\n   * [Create feature types](https://docs.cognite.com/api/v1/#operation/createFeatureTypes)\n   *\n   * ```js\n   * const featureTypes = [\n   *   {\n   *      externalId: 'ocean_temperature',\n   *      properties: { temperature: { type: 'DOUBLE' as const }, location: { type: 'POINT' as const, srid: 4326 } } ,\n   *      searchSpec: { location_idx: { properties : ['location'] } }\n   *   }\n   * ];\n   * const createdFeatureTypes = await client.geospatial.featureType.create(featureTypes);\n   * ```\n   */\n  public create = (\n    featureTypes: GeospatialCreateFeatureType[]\n  ): Promise<FeatureType[]> => {\n    return this.createEndpoint<GeospatialCreateFeatureType>(featureTypes);\n  };\n\n  /**\n   * [Retrieve feature types](https://docs.cognite.com/api/v1/#operation/getFeatureTypesByIds)\n   *\n   * ```js\n   * const retrievedFeatureTypes = await client.geospatial.featureType.retrieve([ { externalId: 'ocean_temperature' } ]);\n   * ```\n   */\n  public retrieve = (externalIds: ExternalId[]): Promise<FeatureType[]> => {\n    return this.retrieveEndpoint(externalIds);\n  };\n\n  /**\n   * [List feature types](https://docs.cognite.com/api/v1/#operation/listFeatureTypes)\n   *\n   * ```js\n   * const allFeatureTypes = await client.geospatial.featureType.list();\n   * ```\n   */\n  public list = (): CursorAndAsyncIterator<FeatureType> => {\n    return this.listEndpoint(this.callListEndpointWithPost);\n  };\n\n  /**\n   * [Delete feature types](https://docs.cognite.com/api/v1/#operation/GeospatialDeleteFeatureTypes)\n   *\n   * ```js\n   * await client.geospatial.featureType.delete([{ externalId: 'ocean_temperature'}], { recursive : true });\n   * ```\n   */\n  public delete = (\n    externalIds: ExternalId[],\n    params: GeospatialRecursiveDelete = {}\n  ) => {\n    return this.deleteEndpoint(externalIds, params);\n  };\n\n  /**\n   * [Update feature types](https://docs.cognite.com/api/v1/#operation/updateFeatureTypes)\n   *\n   * ```js\n   * const featureTypesToUpdate = [\n   *  {\n   *    externalId: 'ocean_temperature',\n   *    update: {\n   *        properties: { add: { depth: { type: 'DOUBLE'} }, remove: ['temperature'] },\n   *        searchSpec: { add: { depth_idx: { properties: ['depth'] } } }\n   *    }\n   *  }\n   * ];\n   * const updatedFeatureTypes = await client.geospatial.featureType.update(featureTypesToUpdate);\n   * ```\n   */\n  public update = (changes: GeospatialUpdateFeatureType[]) => {\n    return this.updateEndpoint<GeospatialUpdateFeatureType>(changes);\n  };\n}\n","import {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type MetadataMap,\n} from '@cognite/sdk-core';\n\nimport { ComputeAPI } from './computeAPI';\nimport { CrsAPI } from './crsAPI';\nimport { FeatureAPI } from './featureAPI';\nimport { FeatureTypeAPI } from './featureTypeAPI';\nimport type { Geospatial } from './types';\n\nexport class GeospatialAPI extends BaseResourceAPI<Geospatial> {\n  private readonly computeAPI: ComputeAPI;\n  private readonly crsAPI: CrsAPI;\n  private readonly featureTypeAPI: FeatureTypeAPI;\n  private readonly featureAPI: FeatureAPI;\n\n  constructor(...args: [string, CDFHttpClient, MetadataMap]) {\n    super(...args);\n\n    const [, httpClient, map] = args;\n\n    this.computeAPI = new ComputeAPI(this.url('compute'), httpClient, map);\n    this.crsAPI = new CrsAPI(this.url('crs'), httpClient, map);\n\n    this.featureTypeAPI = new FeatureTypeAPI(\n      this.url('featuretypes'),\n      httpClient,\n      map\n    );\n\n    this.featureAPI = new FeatureAPI(this.url('featuretypes'), httpClient, map);\n  }\n\n  public get compute() {\n    return this.computeAPI;\n  }\n\n  public get crs() {\n    return this.crsAPI;\n  }\n\n  public get feature() {\n    return this.featureAPI;\n  }\n\n  public get featureType() {\n    return this.featureTypeAPI;\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  Group,\n  GroupSpec,\n  ItemsWrapper,\n  ListGroups,\n} from '../../types';\n\nexport class GroupsAPI extends BaseResourceAPI<Group> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['deletedTime']);\n  }\n\n  /**\n   * [Create groups](https://doc.cognitedata.com/api/v1/#operation/createGroups)\n   *\n   * ```js\n   * const createdGroups = await client.groups.create([{\n   *   name: 'Developers',\n   *   capabilities: [{\n   *     assetsAcl: {\n   *       actions: ['READ'],\n   *       scope: { all: {}}\n   *     }\n   *   }],\n   * }]);\n   * ```\n   */\n  public create = (items: GroupSpec[]): Promise<Group[]> => {\n    return this.createEndpoint(items);\n  };\n\n  /**\n   * [List groups](https://doc.cognitedata.com/api/v1/#operation/getGroups)\n   *\n   * ```js\n   * const groups = await client.groups.list({ all: true });\n   * ```\n   */\n  public list = async (scope?: ListGroups): Promise<Group[]> => {\n    const path = this.url();\n    const response = await this.get<ItemsWrapper<Group[]>>(path, {\n      params: scope,\n    });\n    return this.addToMapAndReturn(response.data.items, response);\n  };\n\n  /**\n   * [Delete groups](https://doc.cognitedata.com/api/v1/#operation/deleteGroups)\n   *\n   * ```js\n   * await client.groups.delete([921923342342323, 871621872721323]);\n   * ```\n   */\n  public delete = (ids: CogniteInternalId[]): Promise<object> => {\n    return super.deleteEndpoint(ids);\n  };\n}\n","// Copyright 2023 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type {\n  AggregationRequest,\n  AggregationResponse,\n  ByIdsResponse,\n  InstanceInspectRequest,\n  InstanceInspectResponse,\n  ListOfSpaceExternalIdsRequestWithTyping,\n  NodeAndEdgeCollectionResponseWithCursorV3Response,\n  NodeAndEdgeCreateCollection,\n  NodeOrEdge,\n  NodeOrEdgeDeleteRequest,\n  NodeOrEdgeListRequestV3,\n  NodeOrEdgeSearchRequest,\n  QueryRequest,\n  QueryResponse,\n  SlimNodeAndEdgeCollectionResponse,\n  SyncRequest,\n} from './types.gen';\n\nexport class InstancesAPI extends BaseResourceAPI<NodeOrEdge> {\n  /**\n   * [Search instances](https://developer.cognite.com/api#tag/Instances/operation/searchInstances)\n   *\n   * ```js\n   *  const response = await client.instances.search({\n   *    view: {\n   *      externalId: 'Describable',\n   *      space: 'cdf_core',\n   *      type: 'view',\n   *      version: 'v1',\n   *    },\n   *    query: 'your_query',\n   *    filter: {\n   *      equals: {\n   *        property: ['title'],\n   *         value: 'your title',\n   *      },\n   *    },\n   *    limit: 1000,\n   *  });\n   * ```\n   */\n  public search = async (\n    params: NodeOrEdgeSearchRequest\n  ): Promise<ByIdsResponse> => {\n    const response = await this.post<ByIdsResponse>(this.searchUrl, {\n      data: params,\n    });\n    return response.data;\n  };\n\n  /**\n   * [List instances](https://developer.cognite.com/api#tag/Instances/operation/advancedListInstance)\n   *\n   * ```js\n   *  const response = await client.instances.list({\n   *    instanceType: 'node',\n   *    sources: [{\n   *      source: {\n   *        externalId: 'Describable',\n   *        space: 'cdf_core',\n   *        type: 'view',\n   *        version: 'v1',\n   *      },\n   *    }],\n   *    filter: {\n   *      equals: {\n   *        property: ['title'],\n   *         value: 'your title',\n   *      },\n   *    },\n   *    sort: [\n   *      { property: ['title'], direction: 'ascending', nullsFirst: false },\n   *    ],\n   *    limit: 1000,\n   *});\n   * ```\n   */\n  public list = async (\n    params: NodeOrEdgeListRequestV3\n  ): Promise<NodeAndEdgeCollectionResponseWithCursorV3Response> => {\n    const response =\n      await this.post<NodeAndEdgeCollectionResponseWithCursorV3Response>(\n        this.listPostUrl,\n        {\n          data: params,\n        }\n      );\n    return response.data;\n  };\n\n  /**\n   * [Retrieve instances](https://developer.cognite.com/api#tag/Instances/operation/byExternalIdsInstances)\n   *\n   * ```js\n   *  const response = await client.instances.retrieve({\n   *    sources: [{ source: {\n   *          externalId: 'Describable',\n   *          space: 'cdf_core',\n   *          type: 'view',\n   *          version: 'v1',\n   *        }\n   *      }],\n   *     items: [\n   *       {\n   *         externalId: \"node-external-id\",\n   *         space: \"node-space\",\n   *         instanceType: 'node',\n   *       },\n   *     ],\n   *   });\n   * ```\n   */\n  public retrieve = async (\n    params: ListOfSpaceExternalIdsRequestWithTyping\n  ): Promise<ByIdsResponse> => {\n    const response = await this.post<ByIdsResponse>(this.byIdsUrl, {\n      data: params,\n    });\n    return response.data;\n  };\n\n  /**\n   * [Upsert instances](https://developer.cognite.com/api#tag/Instances/operation/applyNodeAndEdges)\n   *\n   * ```js\n   *  await client.instances.upsert({\n   *  items: [\n   *    {\n   *       instanceType: 'node',\n   *       externalId: 'node-external-id',\n   *       space: 'node-space',\n   *       sources: [\n   *        {\n   *            source: {\n   *             externalId: 'Describable',\n   *             space: 'cdf_core',\n   *             type: 'view',\n   *             version: 'v1',\n   *          },\n   *            properties: {\n   *             title: 'node-title',\n   *             description: 'node-description',\n   *             labels: 'node-labels',\n   *           },\n   *         },\n   *       ],\n   *     },\n   *   ],\n   * });\n   * ```\n   */\n  public upsert = async (\n    params: NodeAndEdgeCreateCollection\n  ): Promise<SlimNodeAndEdgeCollectionResponse> => {\n    const response = await this.post<SlimNodeAndEdgeCollectionResponse>(\n      this.url(),\n      {\n        data: params,\n      }\n    );\n    return response.data;\n  };\n\n  /**\n   * [Delete instances](https://developer.cognite.com/api#tag/Instances/operation/deleteBulk)\n   *\n   * ```js\n   *  await client.instances.delete([\n   *      {\n   *        instanceType: \"node\",\n   *        externalId: \"node-external-id\",\n   *        space: \"node-space\",\n   *      },\n   *    ]);\n   * ```\n   */\n  public delete = async (items: NodeOrEdgeDeleteRequest['items']) => {\n    return super.deleteEndpoint(items);\n  };\n\n  /**\n   * [Aggregate instances](https://developer.cognite.com/api#tag/Instances/operation/aggregateInstances)\n   *\n   * ```js\n   *  const response = await client.instances.aggregate({\n   *     view: {\n   *        externalId: 'Describable',\n   *        space: 'cdf_core',\n   *        type: 'view',\n   *        version: 'v1',\n   *     },\n   *     groupBy: ['externalId'],\n   *     aggregates: [{ count: { property: 'externalId' } }],\n   *     filter: {\n   *       prefix: {\n   *         property: ['title'],\n   *         value: 'titl',\n   *       },\n   *     },\n   *     limit: 1,\n   *   });\n   * ```\n   */\n  public aggregate = async (\n    params: AggregationRequest\n  ): Promise<AggregationResponse> => {\n    const response = await this.post<AggregationResponse>(this.aggregateUrl, {\n      data: params,\n    });\n    return response.data;\n  };\n\n  /**\n   * [Query instances](https://developer.cognite.com/api#tag/Instances/operation/queryContent)\n   *\n   * ```js\n   *  const response = await client.instances.query({\n   *     with: {\n   *       result_set_1: {\n   *         nodes: {\n   *           filter: {\n   *             equals: {\n   *               property: ['node', 'externalId'],\n   *               value: \"node-external-id\",\n   *             },\n   *           },\n   *         },\n   *       },\n   *     },\n   *     select: {\n   *       result_set_1: {},\n   *     },\n   *   });\n   * ```\n   */\n  public query = async (params: QueryRequest): Promise<QueryResponse> => {\n    const response = await this.post<QueryResponse>(this.url('query'), {\n      data: params,\n    });\n    return response.data;\n  };\n\n  /**\n   * [Sync instances](https://developer.cognite.com/api#tag/Instances/operation/syncContent)\n   *\n   * ```js\n   *  const response = await client.instances.sync({\n   *     with: {\n   *       result_set_1: {\n   *         nodes: {\n   *           filter: {\n   *             equals: {\n   *               property: ['node', 'externalId'],\n   *               value: \"node-external-id\",\n   *             },\n   *           },\n   *         },\n   *       },\n   *     },\n   *     select: {\n   *       result_set_1: {},\n   *     },\n   *   });\n   * ```\n   */\n  public sync = async (params: SyncRequest): Promise<QueryResponse> => {\n    const response = await this.post<QueryResponse>(this.url('sync'), {\n      data: params,\n    });\n    return response.data;\n  };\n\n  /**\n   * [Inspect instances](https://developer.cognite.com/api#tag/Instances/operation/instanceInspect)\n   *\n   * ```js\n   *  const response = await client.instances.inspect({\n   *    inspectionOperations: {\n   *      involvedViews: {\n   *        allVersions: true,\n   *      },\n   *    },\n   *    items: [\n   *      {\n   *        instanceType: 'node',\n   *        externalId: 'my-node-id',\n   *        space: 'my-space',\n   *      },\n   *    ],\n   *  });\n   * ```\n   */\n  public inspect = async (\n    params: InstanceInspectRequest\n  ): Promise<InstanceInspectResponse> => {\n    const response = await this.post<InstanceInspectResponse>(\n      this.url('inspect'),\n      {\n        data: params,\n      }\n    );\n    return response.data;\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  ExternalId,\n  ExternalLabelDefinition,\n  LabelDefinition,\n  LabelDefinitionFilterRequest,\n} from '../../types';\n\nexport class LabelsAPI extends BaseResourceAPI<LabelDefinition> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime']);\n  }\n\n  /**\n   * [Create labels](https://docs.cognite.com/api/v1/#operation/createLabelDefinitions)\n   *\n   * ```js\n   * const labels = [\n   *   { externalId: 'PUMP', name: \"Pump\" },\n   *   { externalId: 'ROTATING_EQUIPMENT', name: 'Rotating equipment', description: 'Asset with rotating parts' }\n   * ];\n   * const createdLabels = await client.labels.create(labels);\n   * ```\n   */\n  public create = (\n    items: ExternalLabelDefinition[]\n  ): Promise<LabelDefinition[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [List labels](https://docs.cognite.com/api/v1/#operation/listLabels)\n   *\n   * ```js\n   * const labels = await client.labels.list({ filter: { externalIdPrefix: 'Pu'}});\n   * ```\n   */\n  public list = (\n    query?: LabelDefinitionFilterRequest\n  ): CursorAndAsyncIterator<LabelDefinition> => {\n    return super.listEndpoint(this.callListEndpointWithPost, query);\n  };\n\n  /**\n   * [Delete labels](https://doc.cognitedata.com/api/v1/#operation/deleteLabels)\n   *\n   * ```js\n   * await client.labels.delete([{externalId: 'PUMP'}, {externalId: 'VALVE'}]);\n   * ```\n   */\n  public delete = (ids: ExternalId[]) => {\n    return super.deleteEndpoint(ids);\n  };\n}\n","// Copyright 2023 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type {\n  AllVersionsQueryParameter,\n  CursorQueryParameter,\n  DataModel,\n  DataModelCollectionResponse,\n  DataModelCollectionResponseWithCursorResponse,\n  DataModelCreate,\n  IncludeGlobalQueryParameter,\n  InlineViewsQueryParameter,\n  ListOfAllVersionsReferences,\n  ListOfVersionReferences,\n  ReducedLimitQueryParameter,\n  SpaceQueryParameter,\n} from './types.gen';\n\nexport class DataModelsAPI extends BaseResourceAPI<DataModel> {\n  /**\n   * [Upsert datamodels](https://api-docs.cognite.com/20230101/tag/Data-models/operation/createDataModels)\n   *\n   * const datamodelDefinition = {\n   *   \"space\": \"string\",\n   *   \"externalId\": \"string\",\n   *   \"name\": \"string\",\n   *   \"description\": \"string\",\n   *   \"version\": \"string\",\n   *   \"views\": []\n   * }\n   *\n   * ```js\n   *  const response = await client.dataModels.upsert([\n   *   datamodelDefinition\n   *  ]);\n   * ```\n   */\n  public upsert = async (\n    params: DataModelCreate[]\n  ): Promise<DataModelCollectionResponse> => {\n    const response = await this.post<DataModelCollectionResponse>(this.url(), {\n      data: { items: params },\n    });\n    return response.data;\n  };\n\n  /**\n   * [Delete data models](https://api-docs.cognite.com/20230101/tag/Data-models/operation/deleteDataModels)\n   *\n   * ```js\n   *  const response = await client.dataModels.delete([{ externalId: \"\", space: \"\", version: \"\"}]);\n   *\n   * ```\n   */\n  public delete = async (\n    params: ListOfVersionReferences['items']\n  ): Promise<ListOfVersionReferences> => {\n    const response = await this.post<ListOfVersionReferences>(this.deleteUrl, {\n      data: { items: params },\n    });\n    return response.data;\n  };\n\n  /**\n   * [List data models](https://api-docs.cognite.com/20230101/tag/Data-models/operation/listDataModels)\n   *\n   * ```js\n   *  const response = await client.dataModels.list();\n   *\n   * ```\n   */\n  public list = (\n    params: IncludeGlobalQueryParameter &\n      SpaceQueryParameter &\n      CursorQueryParameter &\n      ReducedLimitQueryParameter &\n      AllVersionsQueryParameter &\n      InlineViewsQueryParameter = { includeGlobal: false }\n  ): DataModelCollectionResponseWithCursorResponse => {\n    return super.listEndpoint(this.callListEndpointWithGet, params);\n  };\n\n  /**\n   * [Retrieve data models](https://api-docs.cognite.com/20230101/tag/Data-models/operation/byExternalIdsDataModels)\n   *\n   * ```js\n   *  const response = await client.dataModels.retrieve([{ externalId: \"\", space: \"\", version: \"optional\"}]);\n   *\n   * ```\n   */\n  public retrieve = async (\n    params: (ListOfVersionReferences | ListOfAllVersionsReferences)['items'],\n    options: InlineViewsQueryParameter = {}\n  ): Promise<DataModelCollectionResponse> => {\n    const response = await this.post<DataModelCollectionResponse>(\n      this.byIdsUrl,\n      {\n        data: { items: params },\n        params: { ...options },\n      }\n    );\n    return response.data;\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { ProjectResponse } from '../../types';\n\nexport class ProjectsAPI extends BaseResourceAPI<unknown> {\n  /**\n   * [Retrieve a project](https://doc.cognitedata.com/api/v1/#operation/getProject)\n   *\n   * ```js\n   * const projectInfo = await client.projects.retrieve('publicdata');\n   * ```\n   */\n  public retrieve = async (projectName: string): Promise<ProjectResponse> => {\n    const path = this.encodeUrl(projectName);\n    const response = await this.get<ProjectResponse>(path);\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  private encodeUrl(projectName: string) {\n    return this.url(`projects/${encodeURIComponent(projectName)}`);\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type HttpHeaders,\n} from '@cognite/sdk-core';\nimport type {\n  CursorResponse,\n  ListRawRows,\n  RawDBRow,\n  RawDBRowInsert,\n  RawDBRowKey,\n} from '../../types';\n\nexport class RawRowsAPI extends BaseResourceAPI<RawDBRow> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['lastUpdatedTime']);\n  }\n\n  public async insert(\n    databaseName: string,\n    tableName: string,\n    items: RawDBRowInsert[],\n    ensureParent = false\n  ): Promise<object> {\n    const path = `${this.encodeUrl(databaseName, tableName)}/rows`;\n    await this.postInParallelWithAutomaticChunking({\n      path,\n      items,\n      chunkSize: 5000,\n      queryParams: { ensureParent },\n    });\n    return {};\n  }\n\n  public list(\n    databaseName: string,\n    tableName: string,\n    scope: ListRawRows = {}\n  ): CursorAndAsyncIterator<RawDBRow> {\n    const { onlyRowKeys, columns, ...rest } = scope;\n    const query: HttpHeaders = rest as HttpHeaders;\n    if (onlyRowKeys) {\n      query.columns = ',';\n    }\n    if (columns) {\n      query.columns = columns.join(',');\n    }\n\n    const path = `${this.encodeUrl(databaseName, tableName)}/rows`;\n    return super.listEndpoint(\n      async (params) =>\n        this.get<CursorResponse<RawDBRow[]>>(path, {\n          params,\n        }),\n      query\n    );\n  }\n\n  public async retrieve(\n    databaseName: string,\n    tableName: string,\n    rowKey: string\n  ): Promise<RawDBRow> {\n    const path = `${this.encodeUrl(\n      databaseName,\n      tableName\n    )}/rows/${encodeURIComponent(rowKey)}`;\n    const response = await this.get<RawDBRow>(path);\n    return this.addToMapAndReturn(response.data, response);\n  }\n\n  public async delete(\n    databaseName: string,\n    tableName: string,\n    items: RawDBRowKey[]\n  ) {\n    const path = `${this.encodeUrl(databaseName, tableName)}/rows/delete`;\n    await this.postInParallelWithAutomaticChunking({ path, items });\n    return {};\n  }\n\n  private encodeUrl(databaseName: string, tableName: string) {\n    return this.url(\n      `${encodeURIComponent(databaseName)}/tables/${encodeURIComponent(\n        tableName\n      )}`\n    );\n  }\n}\n\nexport interface RawDatabaseDeleteParams {\n  recursive?: boolean;\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  CursorResponse,\n  ListRawTables,\n  RawDBTable,\n  RawDBTableName,\n} from '../../types';\n\nexport class RawTablesAPI extends BaseResourceAPI<RawDBTable> {\n  public async create(\n    databaseName: string,\n    items: RawDBTableName[],\n    ensureParent = false\n  ): Promise<RawDBTable[]> {\n    const path = `${this.encodeUrl(databaseName)}/tables`;\n    const responses = await this.postInParallelWithAutomaticChunking({\n      queryParams: { ensureParent },\n      items,\n      path,\n    });\n    return this.mergeItemsFromItemsResponse(responses);\n  }\n\n  public list(\n    databaseName: string,\n    scope?: ListRawTables\n  ): CursorAndAsyncIterator<RawDBTable> {\n    const path = `${this.encodeUrl(databaseName)}/tables`;\n    return super.listEndpoint(\n      async (params) =>\n        this.get<CursorResponse<RawDBTable[]>>(path, {\n          params,\n        }),\n      scope\n    );\n  }\n\n  public delete(databaseName: string, items: RawDBTableName[]) {\n    const path = `${this.encodeUrl(databaseName)}/tables/delete`;\n    return this.deleteEndpoint(items, {}, path);\n  }\n\n  private encodeUrl(databaseName: string) {\n    return this.url(`${encodeURIComponent(databaseName)}`);\n  }\n}\n\nexport interface RawDatabaseDeleteParams {\n  recursive?: boolean;\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CursorAndAsyncIterator,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type {\n  ListRawDatabases,\n  ListRawRows,\n  ListRawTables,\n  RawDB,\n  RawDBName,\n  RawDBRow,\n  RawDBRowInsert,\n  RawDBRowKey,\n  RawDBTable,\n  RawDBTableName,\n} from '../../types';\nimport { RawRowsAPI } from './rawRowsApi';\nimport { RawTablesAPI } from './rawTablesApi';\n\nexport class RawAPI extends BaseResourceAPI<RawDB> {\n  private rawTablesApi: RawTablesAPI;\n  private rawRowsApi: RawRowsAPI;\n  /** @hidden */\n  constructor(\n    resourcePath: string,\n    httpClient: CDFHttpClient,\n    map: MetadataMap\n  ) {\n    super(resourcePath, httpClient, map);\n    this.rawTablesApi = new RawTablesAPI(resourcePath, httpClient, map);\n    this.rawRowsApi = new RawRowsAPI(resourcePath, httpClient, map);\n  }\n\n  /**\n   * [Create databases](https://doc.cognitedata.com/api/v1/#operation/createDBs)\n   *\n   * ```js\n   * const databases = await client.raw.createDatabases([{ name: 'My company' }]);\n   * ```\n   */\n  public createDatabases = (items: RawDBName[]): Promise<RawDB[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [List databases](https://doc.cognitedata.com/api/v1/#operation/getDBs)\n   *\n   * ```js\n   * const databases = await client.raw.listDatabases();\n   * ```\n   */\n  public listDatabases = (\n    scope?: ListRawDatabases\n  ): CursorAndAsyncIterator<RawDB> => {\n    return super.listEndpoint(this.callListEndpointWithGet, scope);\n  };\n\n  /**\n   * [Delete databases](https://doc.cognitedata.com/api/v1/#operation/deleteDBs)\n   *\n   * ```js\n   * await client.raw.deleteDatabases([{ name: 'My company' }]);\n   * ```\n   */\n  public deleteDatabases = (\n    items: RawDBName[],\n    params?: RawDatabaseDeleteParams\n  ) => {\n    return super.deleteEndpoint<RawDatabaseDeleteParams, RawDBName>(\n      items,\n      params\n    );\n  };\n\n  /**\n   * [Create tables in a database](https://doc.cognitedata.com/api/v1/#operation/createTables)\n   *\n   * ```js\n   * const tables = await client.raw.createTables('My company', [{ name: 'Customers' }]);\n   * ```\n   */\n  public createTables = (\n    databaseName: string,\n    items: RawDBTableName[],\n    ensureParent = false\n  ): Promise<RawDBTable[]> => {\n    return this.rawTablesApi.create(databaseName, items, ensureParent);\n  };\n\n  /**\n   * [List tables in database](https://doc.cognitedata.com/api/v1/#operation/getTables)\n   *\n   * ```js\n   * const tables = await client.raw.listTables('My company');\n   * ```\n   */\n  public listTables = (\n    databaseName: string,\n    scope?: ListRawTables\n  ): CursorAndAsyncIterator<RawDBTable> => {\n    return this.rawTablesApi.list(databaseName, scope);\n  };\n\n  /**\n   * [Delete tables in a database](https://doc.cognitedata.com/api/v1/#operation/deleteTables)\n   *\n   * ```js\n   * await client.raw.deleteTables('My company', [{ name: 'Customers' }]);\n   * ```\n   */\n  public deleteTables = (\n    databaseName: string,\n    items: RawDBTableName[]\n  ): Promise<object> => {\n    return this.rawTablesApi.delete(databaseName, items);\n  };\n\n  /**\n   * [Insert rows into a table](https://doc.cognitedata.com/api/v1/#operation/postRows)\n   *\n   * ```js\n   * await client.raw.insertRows('My company', 'Customers', [{ key: 'customer1', columns: { 'First name': 'Steve', 'Last name': 'Jobs' } }]);\n   * ```\n   */\n  public insertRows = (\n    databaseName: string,\n    tableName: string,\n    items: RawDBRowInsert[],\n    ensureParent = false\n  ): Promise<object> => {\n    return this.rawRowsApi.insert(databaseName, tableName, items, ensureParent);\n  };\n\n  /**\n   * [List rows in a table](https://doc.cognitedata.com/api/v1/#operation/getRows)\n   *\n   * ```js\n   * await client.raw.listRows('My company', 'Employees', { columns: ['last_name'] });\n   * ```\n   */\n  public listRows = (\n    databaseName: string,\n    tableName: string,\n    query?: ListRawRows\n  ): CursorAndAsyncIterator<RawDBRow> => {\n    return this.rawRowsApi.list(databaseName, tableName, query);\n  };\n\n  /**\n   * [Retrieve a single row from a table](https://doc.cognitedata.com/api/v1/#operation/getRow)\n   *\n   * ```js\n   * await client.raw.retrieveRow('My company', 'Customers', 'customer1');\n   * ```\n   */\n  public retrieveRow = (\n    databaseName: string,\n    tableName: string,\n    rowKey: string\n  ): Promise<RawDBRow> => {\n    return this.rawRowsApi.retrieve(databaseName, tableName, rowKey);\n  };\n\n  /**\n   * [Delete rows in a table](https://doc.cognitedata.com/api/v1/#operation/deleteRows)\n   *\n   * ```js\n   * await client.raw.deleteRows('My company', 'Customers', [{key: 'customer1'}]);\n   * ```\n   */\n  public deleteRows = (\n    databaseName: string,\n    tableName: string,\n    items: RawDBRowKey[]\n  ): Promise<object> => {\n    return this.rawRowsApi.delete(databaseName, tableName, items);\n  };\n}\n\nexport interface RawDatabaseDeleteParams {\n  recursive?: boolean;\n}\n","// Copyright 2025 Cognite AS\n\nimport { BaseResourceAPI, makeAutoPaginationMethods } from '@cognite/sdk-core';\nimport type {\n  RecordAggregateRequest,\n  RecordAggregateRequestWithTyping,\n  RecordAggregateRequestWithoutTyping,\n  RecordAggregateResponse,\n  RecordAggregateResults,\n  RecordDelete,\n  RecordFilterRequest,\n  RecordFilterRequestWithTyping,\n  RecordFilterRequestWithoutTyping,\n  RecordFilterResponse,\n  RecordItem,\n  RecordSyncRequest,\n  RecordSyncResponse,\n  RecordWrite,\n  RecordsSyncCursorAndAsyncIterator,\n  RecordsSyncListResponse,\n  SyncRecordItem,\n} from './types';\n\nexport class RecordsAPI extends BaseResourceAPI<RecordItem> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  /**\n   * [Ingest records into a stream](https://developer.cognite.com/api#tag/Records/operation/ingestRecords)\n   *\n   * Ingest records into a stream.\n   *\n   * ```js\n   * await client.records.ingest('my_stream', [\n   *   {\n   *     space: 'mySpace',\n   *     externalId: 'record1',\n   *     sources: [\n   *       {\n   *         source: { type: 'container', space: 'mySpace', externalId: 'myContainer' },\n   *         properties: { temperature: 25.5, timestamp: '2025-01-01T00:00:00Z' }\n   *       }\n   *     ]\n   *   }\n   * ]);\n   * ```\n   */\n  public ingest = async (\n    streamExternalId: string,\n    items: RecordWrite[]\n  ): Promise<void> => {\n    const path = this.url(`${encodeURIComponent(streamExternalId)}/records`);\n    await this.post<object>(path, {\n      data: { items },\n    });\n  };\n\n  /**\n   * [Upsert records into a stream](https://developer.cognite.com/api#tag/Records/operation/upsertRecords)\n   *\n   * Create or update records in a mutable stream. If a record with the same\n   * space + externalId already exists, it will be fully replaced (no partial updates).\n   *\n   * **Note:** This endpoint is only available for mutable streams.\n   *\n   * ```js\n   * await client.records.upsert('my_mutable_stream', [\n   *   {\n   *     space: 'mySpace',\n   *     externalId: 'record1',\n   *     sources: [\n   *       {\n   *         source: { type: 'container', space: 'mySpace', externalId: 'myContainer' },\n   *         properties: { temperature: 30.0, timestamp: '2025-01-01T00:00:00Z' }\n   *       }\n   *     ]\n   *   }\n   * ]);\n   * ```\n   */\n  public upsert = async (\n    streamExternalId: string,\n    items: RecordWrite[]\n  ): Promise<void> => {\n    const path = this.url(\n      `${encodeURIComponent(streamExternalId)}/records/upsert`\n    );\n    await this.post<object>(path, {\n      data: { items },\n    });\n  };\n\n  /**\n   * [Delete records from a stream](https://developer.cognite.com/api#tag/Records/operation/deleteRecords)\n   *\n   * Delete records from a mutable stream. The operation is idempotent - deleting\n   * non-existent records will not cause an error.\n   *\n   * **Note:** This endpoint is only available for mutable streams.\n   *\n   * ```js\n   * await client.records.delete('my_mutable_stream', [\n   *   { space: 'mySpace', externalId: 'record1' },\n   *   { space: 'mySpace', externalId: 'record2' }\n   * ]);\n   * ```\n   */\n  public delete = async (\n    streamExternalId: string,\n    items: RecordDelete[]\n  ): Promise<void> => {\n    const path = this.url(\n      `${encodeURIComponent(streamExternalId)}/records/delete`\n    );\n    await this.post<object>(path, {\n      data: { items },\n    });\n  };\n\n  /**\n   * [Filter records from a stream](https://developer.cognite.com/api#tag/Records/operation/filterRecords)\n   *\n   * Retrieve records from a stream using filters. Pass includeTyping: true to\n   * receive an object with items and typing instead of a bare array.\n   *\n   * ```js\n   * const records = await client.records.filter('my_stream', {\n   *   sources: [\n   *     {\n   *       source: { type: 'container', space: 'mySpace', externalId: 'myContainer' },\n   *       properties: ['*']\n   *     }\n   *   ],\n   *   filter: {\n   *     equals: {\n   *       property: ['mySpace', 'myContainer', 'status'],\n   *       value: 'active'\n   *     }\n   *   },\n   *   limit: 100\n   * });\n   * ```\n   */\n  public filter(\n    streamExternalId: string,\n    request: RecordFilterRequestWithTyping\n  ): Promise<RecordFilterResponse>;\n  public filter(\n    streamExternalId: string,\n    request?: RecordFilterRequestWithoutTyping\n  ): Promise<RecordItem[]>;\n  public async filter(\n    streamExternalId: string,\n    request: RecordFilterRequest = {}\n  ): Promise<RecordItem[] | RecordFilterResponse> {\n    const path = this.url(\n      `${encodeURIComponent(streamExternalId)}/records/filter`\n    );\n    const response = await this.post<RecordFilterResponse>(path, {\n      data: request,\n    });\n    const items = this.addToMapAndReturn(response.data.items, response);\n    if (request.includeTyping === true) {\n      return {\n        items,\n        typing: response.data.typing,\n      };\n    }\n    return items;\n  }\n\n  /**\n   * [Sync records from a stream](https://developer.cognite.com/api#tag/Records/operation/syncRecords)\n   *\n   * Sync records from a stream using a cursor-based approach. Supports both\n   * auto-pagination and manual pagination. The sync API always returns\n   * nextCursor (for resumption) and hasNext (to indicate whether more\n   * data is immediately available). Auto-pagination uses hasNext to\n   * determine when to stop.\n   *\n   * ```js\n   * const response = await client.records.sync('my_stream', {\n   *   initializeCursor: '1d-ago',\n   *   sources: [{ source: { type: 'container', space: 'mySpace', externalId: 'myContainer' }, properties: ['*'] }],\n   * });\n   * console.log(response.items, response.nextCursor, response.hasNext, response.typing);\n   * ```\n   */\n  public sync = (\n    streamExternalId: string,\n    request: RecordSyncRequest\n  ): RecordsSyncCursorAndAsyncIterator<SyncRecordItem> => {\n    const path = this.url(\n      `${encodeURIComponent(streamExternalId)}/records/sync`\n    );\n\n    const callSyncEndpoint = async (params?: RecordSyncRequest) => {\n      let requestData = params;\n      if (params?.cursor && params?.initializeCursor) {\n        const { initializeCursor: _, ...rest } = params;\n        requestData = rest;\n      }\n      const response = await this.post<RecordSyncResponse>(path, {\n        data: requestData,\n      });\n      const items = this.addToMapAndReturn(response.data.items, response);\n      return {\n        items,\n        nextCursor: response.data.nextCursor,\n        hasNext: response.data.hasNext,\n        typing: response.data.typing,\n      };\n    };\n\n    const firstPagePromise: Promise<RecordsSyncListResponse<SyncRecordItem[]>> =\n      callSyncEndpoint(request).then((syncData) =>\n        addSyncNextPageFunction(callSyncEndpoint, syncData, request)\n      );\n\n    const autoPaginationMethods = makeAutoPaginationMethods(firstPagePromise);\n\n    return Object.assign(firstPagePromise, autoPaginationMethods);\n  };\n\n  /**\n   * [Aggregate records from a stream](https://developer.cognite.com/api#tag/Records/operation/aggregateRecords)\n   *\n   * Aggregate data for records from a stream. Pass includeTyping: true to\n   * receive an object with aggregates and typing instead of bare results.\n   *\n   * ```js\n   * const aggregates = await client.records.aggregate('my_stream', {\n   *   aggregates: {\n   *     total_count: { count: {} },\n   *     by_category: {\n   *       uniqueValues: {\n   *         property: ['mySpace', 'myContainer', 'category'],\n   *         aggregates: { total: { sum: { property: ['mySpace', 'myContainer', 'amount'] } } }\n   *       }\n   *     }\n   *   }\n   * });\n   * ```\n   */\n  public aggregate(\n    streamExternalId: string,\n    request: RecordAggregateRequestWithTyping\n  ): Promise<RecordAggregateResponse>;\n  public aggregate(\n    streamExternalId: string,\n    request: RecordAggregateRequestWithoutTyping\n  ): Promise<RecordAggregateResults>;\n  public async aggregate(\n    streamExternalId: string,\n    request: RecordAggregateRequest\n  ): Promise<RecordAggregateResults | RecordAggregateResponse> {\n    const path = this.url(\n      `${encodeURIComponent(streamExternalId)}/records/aggregate`\n    );\n    const response = await this.post<RecordAggregateResponse>(path, {\n      data: request,\n    });\n    if (request.includeTyping === true) {\n      return {\n        aggregates: response.data.aggregates,\n        typing: response.data.typing,\n      };\n    }\n    return response.data.aggregates;\n  }\n}\n\ntype SyncEndpointCaller = (params?: RecordSyncRequest) => Promise<{\n  items: SyncRecordItem[];\n  nextCursor: string;\n  hasNext: boolean;\n  typing?: RecordSyncResponse['typing'];\n}>;\n\nfunction addSyncNextPageFunction(\n  endpoint: SyncEndpointCaller,\n  syncData: {\n    items: SyncRecordItem[];\n    nextCursor: string;\n    hasNext: boolean;\n    typing?: RecordSyncResponse['typing'];\n  },\n  query: RecordSyncRequest\n): RecordsSyncListResponse<SyncRecordItem[]> {\n  const { nextCursor, hasNext } = syncData;\n  const next =\n    hasNext && nextCursor\n      ? () =>\n          endpoint({ ...query, cursor: nextCursor }).then((data) =>\n            addSyncNextPageFunction(endpoint, data, query)\n          )\n      : undefined;\n  return {\n    items: syncData.items,\n    nextCursor,\n    hasNext,\n    typing: syncData.typing,\n    next,\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type ExternalId,\n} from '@cognite/sdk-core';\nimport type {\n  ExternalRelationship,\n  IgnoreUnknownIds,\n  Relationship,\n  RelationshipsFilterRequest,\n  RelationshipsRetrieveParams,\n} from '../../types';\n\nexport class RelationshipsApi extends BaseResourceAPI<Relationship> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  /**\n   * [Create relationship](https://docs.cognite.com/api/v1/#operation/createRelationships)\n   *\n   * ```js\n   * const relationships = [\n   *   {\n   *      externalId: 'some_relationship',\n   *      sourceExternalId: 'some_source_external_id',\n   *      sourceType: 'asset' as const,\n   *      targetExternalId: 'some_target_external_id',\n   *      targetType: 'event' as const\n   *   }\n   * ];\n   * const createdRelationships = await client.relationships.create(relationships);\n   * ```\n   */\n  public create = (items: ExternalRelationship[]): Promise<Relationship[]> => {\n    return this.createEndpoint(items);\n  };\n\n  /**\n   * [List relationships](https://docs.cognite.com/api/v1/#operation/listRelationships)\n   *\n   * ```js\n   * const relationships = await client.relationships.list({ filter: { createdTime: { min: new Date('1 jan 2018'), max: new Date('1 jan 2019') }}});\n   * ```\n   */\n  public list = (\n    query?: RelationshipsFilterRequest\n  ): CursorAndAsyncIterator<Relationship> => {\n    return super.listEndpoint(this.callListEndpointWithPost, query);\n  };\n\n  /**\n   * [Retrieve relationships](https://docs.cognite.com/api/v1/#operation/byidsRelationships)\n   *\n   * ```js\n   * const relationships = await client.relationships.retrieve([{externalId: 'abc'}, {externalId: 'def'}]);\n   * ```\n   */\n  public retrieve = (\n    ids: ExternalId[],\n    params: RelationshipsRetrieveParams = {}\n  ): Promise<Relationship[]> => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Delete relationships](https://doc.cognitedata.com/api/v1/#operation/deleteRelationships)\n   *\n   * ```js\n   * await client.relationships.delete([{externalId: 'abc'}, {externalId: 'def'}]);\n   * ```\n   */\n  public delete = (\n    ids: ExternalId[],\n    params: RelationshipsDeleteParams = {}\n  ) => {\n    return super.deleteEndpoint(ids, params);\n  };\n}\n\nexport type RelationshipsDeleteParams = IgnoreUnknownIds;\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  CogniteInternalId,\n  ListSecurityCategories,\n  SecurityCategory,\n  SecurityCategorySpec,\n} from '../../types';\n\nexport class SecurityCategoriesAPI extends BaseResourceAPI<SecurityCategory> {\n  /**\n   * [Create security categories](https://doc.cognitedata.com/api/v1/#operation/createSecurityCategories)\n   *\n   * ```js\n   * const securityCategories = [\n   *   { name: 'Admins' },\n   *   { name: 'Developers' },\n   * ];\n   * const createdSecurityCategories = await client.securityCategories.create(securityCategories);\n   * ```\n   */\n  public create = (\n    items: SecurityCategorySpec[]\n  ): Promise<SecurityCategory[]> => {\n    return this.createEndpoint(items);\n  };\n\n  /**\n   * [List security categories](https://doc.cognitedata.com/api/v1/#operation/getSecurityCategories)\n   *\n   * ```js\n   * const securityCategories = await client.securityCategories.list({ sort: 'ASC' });\n   * ```\n   */\n  public list = (\n    query?: ListSecurityCategories\n  ): CursorAndAsyncIterator<SecurityCategory> => {\n    return super.listEndpoint(this.callListEndpointWithGet, query);\n  };\n\n  /**\n   * [Delete security categories](https://doc.cognitedata.com/api/v1/#operation/deleteSecurityCategories)\n   *\n   * ```js\n   * await client.securityCategories.delete([123, 456]);\n   * ```\n   */\n  public delete = (ids: CogniteInternalId[]): Promise<object> => {\n    return super.deleteEndpoint(ids);\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type HttpResponse,\n} from '@cognite/sdk-core';\nimport type {\n  CursorResponse,\n  SequenceRow,\n  SequenceRowsDelete,\n  SequenceRowsInsert,\n  SequenceRowsResponseData,\n  SequenceRowsRetrieve,\n} from '../../types';\n\nexport class SequenceRowsAPI extends BaseResourceAPI<SequenceRow> {\n  public async insert(items: SequenceRowsInsert[]): Promise<object> {\n    await this.postInParallelWithAutomaticChunking({\n      path: this.url(),\n      items,\n      chunkSize: 10000,\n    });\n    return {};\n  }\n\n  public retrieve(\n    query: SequenceRowsRetrieve\n  ): CursorAndAsyncIterator<SequenceRow> {\n    return super.listEndpoint(\n      (data) =>\n        this.post<SequenceRowsResponseData>(this.listPostUrl, { data }).then(\n          this.transformRetrieveResponse\n        ),\n      query\n    );\n  }\n\n  public delete(items: SequenceRowsDelete[]): Promise<object> {\n    return this.deleteEndpoint(items);\n  }\n\n  private transformRetrieveResponse(\n    response: HttpResponse<SequenceRowsResponseData>\n  ): HttpResponse<CursorResponse<SequenceRow[]>> {\n    const { rows, nextCursor, columns } = response.data;\n\n    const items = rows.map(({ rowNumber, values }) => {\n      return {\n        columns,\n        rowNumber,\n        values,\n      };\n    });\n\n    return {\n      ...response,\n      data: {\n        items,\n        nextCursor,\n      },\n    };\n  }\n}\n","// Copyright 2020 Cognite AS\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CursorAndAsyncIterator,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type {\n  ExternalSequence,\n  IdEither,\n  IgnoreUnknownIds,\n  Sequence,\n  SequenceAggregate,\n  SequenceChange,\n  SequenceFilter,\n  SequenceListScope,\n  SequenceRow,\n  SequenceRowsDelete,\n  SequenceRowsInsert,\n  SequenceRowsRetrieve,\n  SequenceSearchFilter,\n} from '../../types';\nimport { SequenceRowsAPI } from './sequenceRowsApi';\n\nexport class SequencesAPI extends BaseResourceAPI<Sequence> {\n  private sequenceRowsAPI: SequenceRowsAPI;\n\n  /** @hidden */\n  constructor(\n    resourcePath: string,\n    httpClient: CDFHttpClient,\n    map: MetadataMap\n  ) {\n    super(resourcePath, httpClient, map);\n    this.sequenceRowsAPI = new SequenceRowsAPI(\n      `${this.url()}data`,\n      httpClient,\n      map\n    );\n  }\n\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(\n      ['items', 'columns'],\n      ['createdTime', 'lastUpdatedTime']\n    );\n  }\n\n  /**\n   * [Create sequences](https://docs.cognite.com/api/v1/#operation/createSequence)\n   *\n   * ```js\n   * const sequences = [\n   *  {\n   *   externalId: 'sequence_name',\n   *   columns: [\n   *    {\n   *      externalId: 'one',\n   *      valueType: SequenceValueType.LONG,\n   *    },\n   *    {\n   *      externalId: 'two',\n   *    },\n   *    {\n   *      externalId: 'three',\n   *      valueType: SequenceValueType.STRING,\n   *    }\n   *   ]\n   *  }\n   * ];\n   * const [sequence] = await client.sequences.create(sequences);\n   * ```\n   */\n  public create = (items: ExternalSequence[]): Promise<Sequence[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [List sequences](https://docs.cognite.com/api/v1/#operation/advancedListSequences)\n   * <!-- or [similar](https://docs.cognite.com/api/v1/#operation/listSequences) -->\n   *\n   * ```js\n   * const sequences = await client.sequences.list({ filter: { name: 'sequence_name' } });\n   * ```\n   */\n  public list = (\n    scope?: SequenceListScope\n  ): CursorAndAsyncIterator<Sequence> => {\n    return super.listEndpoint(this.callListEndpointWithPost, scope);\n  };\n\n  /**\n   * [Aggregate sequences](https://docs.cognite.com/api/v1/#operation/aggregateSequences)\n   *\n   * ```js\n   * const aggregates = await client.sequences.aggregate({ filter: { name: \"Well\" } });\n   * console.log('Number of sequences named Well: ', aggregates[0].count)\n   * ```\n   */\n  public aggregate = (query: SequenceFilter): Promise<SequenceAggregate[]> => {\n    return super.aggregateEndpoint(query);\n  };\n\n  /**\n   * [Retrieve sequences](https://docs.cognite.com/api/v1/#operation/getSequenceById)\n   *\n   * ```js\n   * const [sequence1, sequence2] = await client.sequences.retrieve([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public retrieve = (\n    ids: IdEither[],\n    params: SequenceRetrieveParams = {}\n  ): Promise<Sequence[]> => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Update sequences](https://docs.cognite.com/api/v1/#operation/updateSequences)\n   *\n   * ```js\n   * const [updatedSequence] = await client.sequences.update([{id: 123, update: {name: {set: 'New name'}}}]);\n   * ```\n   */\n  public update = (changes: SequenceChange[]): Promise<Sequence[]> => {\n    return super.updateEndpoint(changes);\n  };\n\n  /**\n   * [Search sequences](https://docs.cognite.com/api/v1/#operation/searchSequences)\n   *\n   * ```js\n   * const sequences = await client.sequences.search({\n   *   filter: {\n   *     assetIds: [1, 2]\n   *   },\n   *   search: {\n   *     query: 'n*m* desc*ion'\n   *   }\n   * });\n   * ```\n   */\n  public search = (query: SequenceSearchFilter): Promise<Sequence[]> => {\n    return super.searchEndpoint(query);\n  };\n\n  /**\n   * [Delete sequences](https://docs.cognite.com/api/v1/#operation/deleteSequences)\n   *\n   * ```js\n   * await client.sequences.delete([{id: 123}, {externalId: 'abc'}]);\n   * ```\n   */\n  public delete = (ids: IdEither[]): Promise<object> => {\n    return super.deleteEndpoint(ids);\n  };\n\n  /**\n   * [Insert rows](https://docs.cognite.com/api/v1/#operation/postSequenceData)\n   *\n   * ```js\n   *\n   * const rows = [\n   *  { rowNumber: 0, values: [1, 2.2, 'three'] },\n   *  { rowNumber: 1, values: [4, 5, 'six'] }\n   * ];\n   * await client.sequences.insertRows([{ id: 123, rows, columns: ['one', 'two', 'three'] }]);\n   * ```\n   */\n  public insertRows = (items: SequenceRowsInsert[]): Promise<object> => {\n    return this.sequenceRowsAPI.insert(items);\n  };\n\n  /**\n   * [Retrieve rows](https://docs.cognite.com/api/v1/#operation/getSequenceData)\n   *\n   * ```js\n   * const rows = await client.sequences.retrieveRows({ externalId: 'sequence1' }).autoPagingToArray({ limit: 100 });\n   * ```\n   */\n  public retrieveRows = (\n    query: SequenceRowsRetrieve\n  ): CursorAndAsyncIterator<SequenceRow> => {\n    return this.sequenceRowsAPI.retrieve(query);\n  };\n\n  /**\n   * [Delete rows](https://docs.cognite.com/api/v1/#operation/deleteSequenceData)\n   *\n   * ```js\n   * await client.sequences.deleteRows([{ id: 32423849, rows: [1,2,3] }]);\n   * ```\n   */\n  public deleteRows = (query: SequenceRowsDelete[]): Promise<object> => {\n    return this.sequenceRowsAPI.delete(query);\n  };\n}\n\nexport type SequenceRetrieveParams = IgnoreUnknownIds;\n","import {\n  BaseResourceAPI,\n  type InternalId,\n  type ItemsResponse,\n  type ItemsWrapper,\n} from '@cognite/sdk-core';\nimport type {\n  Session,\n  SessionCreate,\n  SessionCreateResultItem,\n  SessionFilterQuery,\n} from './types';\n\nexport class SessionsApi extends BaseResourceAPI<Session> {\n  /**\n   * [Create a session](https://api-docs.cognite.com/20230101/tag/Sessions/operation/createSessions)\n   *\n   * ```js\n   * client.sessions.create([{ clientId: 'client-id', clientSecret: 'client-secret' }])\n   * ```\n   * */\n  public create = async (\n    items: SessionCreate[]\n  ): Promise<SessionCreateResultItem[]> => {\n    const response = await this.post<ItemsWrapper<SessionCreateResultItem[]>>(\n      this.url(),\n      { data: { items } }\n    );\n    return response.data.items;\n  };\n\n  /**\n   * [List sessions](https://api-docs.cognite.com/20230101/tag/Sessions/operation/listSessions)\n   *\n   * ```js\n   * client.sessions.list({ filter: { status: 'ACTIVE' } })\n   * ```\n   */\n  public list = (query?: SessionFilterQuery) => {\n    const { filter, ...rest } = query || {};\n    return this.listEndpoint(this.callListEndpointWithGet, {\n      ...rest,\n      ...filter,\n    });\n  };\n\n  /**\n   * [Retrieve sessions with given IDs](https://api-docs.cognite.com/20230101/tag/Sessions/operation/getSessionsByIds)\n   *\n   * ```js\n   * client.sessions.retrieve([{ id: 1 }])\n   * ```\n   */\n  public retrieve = (ids: InternalId[]) => {\n    return this.retrieveEndpoint(ids);\n  };\n\n  /**\n   * [Revoke access to a session](https://api-docs.cognite.com/20230101/tag/Sessions/operation/revokeSessions)\n   *\n   * ```js\n   * client.sessions.revoke([{ id: 1 }])\n   * ```\n   */\n  async revoke(ids: InternalId[]) {\n    const url = this.url('revoke');\n    const res = await this.post<ItemsResponse<Session>>(url, {\n      data: { items: ids },\n    });\n    return res.data.items;\n  }\n}\n","// Copyright 2023 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  CursorQueryParameter,\n  IncludeGlobalQueryParameter,\n  ReducedLimitQueryParameter,\n  SpaceCollectionResponseV3Response,\n  SpaceCreateDefinition,\n  SpaceDefinition,\n} from './types.gen';\n\nexport class SpacesAPI extends BaseResourceAPI<SpaceDefinition> {\n  /**\n   * [Upsert spaces](https://api-docs.cognite.com/20230101/tag/Spaces/operation/ApplySpaces)\n   *\n   * const spaceDefinition = {\n   *    space: 'my_space',\n   *    name: 'my_space',\n   *    description: 'My space for data',\n   *   };\n   *\n   * ```js\n   *  const response = await client.spaces.upsert([\n   *   spaceDefinition\n   *  ]);\n   * ```\n   */\n  public upsert = async (\n    params: SpaceCreateDefinition[]\n  ): Promise<SpaceCollectionResponseV3Response> => {\n    const response = await this.post<SpaceCollectionResponseV3Response>(\n      this.url(),\n      {\n        data: { items: params },\n      }\n    );\n    return response.data;\n  };\n\n  /**\n   * [Delete spaces](https://api-docs.cognite.com/20230101/tag/Spaces/operation/deleteSpacesV3)\n   *\n   * ```js\n   *  const response = await client.instances.delete([\"my_space\"]);\n   *\n   * ```\n   */\n  public delete = async (params: string[]): Promise<{ items: string[] }> => {\n    const response = await this.post<{ items: string[] }>(this.deleteUrl, {\n      data: { items: params.map((space) => ({ space })) },\n    });\n    return response.data;\n  };\n\n  /**\n   * [List spaces](https://api-docs.cognite.com/20230101/tag/Spaces/operation/listSpacesV3)\n   *\n   * ```js\n   *  const response = await client.instances.list([\"my_space\"]);\n   *\n   * ```\n   */\n  public list = (\n    params: IncludeGlobalQueryParameter &\n      CursorQueryParameter &\n      ReducedLimitQueryParameter = { includeGlobal: false }\n  ): CursorAndAsyncIterator<SpaceDefinition> => {\n    return super.listEndpoint(this.callListEndpointWithGet, params);\n  };\n\n  /**\n   * [Retrieve spaces](https://api-docs.cognite.com/20230101/tag/Spaces/operation/bySpaceIdsSpaces)\n   *\n   * ```js\n   *  const response = await client.instances.retrieve([\"my_space\"]);\n   *\n   * ```\n   */\n  public retrieve = async (\n    params: string[]\n  ): Promise<SpaceCollectionResponseV3Response> => {\n    const response = await this.post<SpaceCollectionResponseV3Response>(\n      this.byIdsUrl,\n      {\n        data: { items: params.map((space) => ({ space })) },\n      }\n    );\n    return response.data;\n  };\n}\n","// Copyright 2025 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { Stream, StreamRetrieveParams, StreamWrite } from './types';\n\nexport class StreamsAPI extends BaseResourceAPI<Stream> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime']);\n  }\n\n  /**\n   * [Create stream](https://developer.cognite.com/api#tag/Streams/operation/createStream)\n   *\n   * ```js\n   * const stream = await client.streams.create({\n   *   externalId: 'my_stream',\n   *   settings: {\n   *     template: {\n   *       name: 'ImmutableTestStream'\n   *     }\n   *   }\n   * });\n   * ```\n   */\n  public create = async (item: StreamWrite): Promise<Stream> => {\n    const path = this.url();\n    const response = await this.post<{ items: Stream[] }>(path, {\n      data: { items: [item] },\n    });\n    return this.addToMapAndReturn(response.data.items[0], response);\n  };\n\n  /**\n   * [List streams](https://developer.cognite.com/api#tag/Streams/operation/listStreams)\n   *\n   * ```js\n   * const streams = await client.streams.list();\n   * ```\n   */\n  public list = async (): Promise<Stream[]> => {\n    const path = this.url();\n    const response = await this.get<{ items: Stream[] }>(path);\n    return this.addToMapAndReturn(response.data.items, response);\n  };\n\n  /**\n   * [Retrieve a stream](https://developer.cognite.com/api#tag/Streams/operation/getStream)\n   *\n   * ```js\n   * const stream = await client.streams.retrieve({\n   *   externalId: 'my_stream',\n   *   includeStatistics: true\n   * });\n   * ```\n   */\n  public retrieve = async (params: StreamRetrieveParams): Promise<Stream> => {\n    const { externalId, includeStatistics } = params;\n    const path = this.url(externalId);\n    const response = await this.get<Stream>(path, {\n      params: includeStatistics ? { includeStatistics: 'true' } : {},\n    });\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Delete a stream](https://developer.cognite.com/api#tag/Streams/operation/deleteStreams)\n   *\n   * Deletes a stream by its identifier, along with all records stored in the stream.\n   * If the stream does not exist, the operation succeeds without error (idempotent delete).\n   *\n   * ```js\n   * await client.streams.delete('my_stream');\n   * ```\n   */\n  public delete = async (externalId: string): Promise<void> => {\n    const path = this.url('delete');\n    await this.post<object>(path, {\n      data: { items: [{ externalId }] },\n    });\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { GraphQlResponse } from '../../types';\n\nexport class TemplateGraphQlApi extends BaseResourceAPI<unknown> {\n  /**\n   * [Run a GraphQL query](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsVersionGraphql)\n   *\n   * ```js\n   * client.templates.group(\"myGroup\").versions(1).runQuery({ query: `\n   *   wellList {\n   *     name\n   *   }\n   * `});\n   * ```\n   */\n  runQuery = async <TVariables extends Record<string, unknown>>({\n    query,\n    variables,\n    operationName,\n  }: {\n    query: string;\n    variables?: TVariables;\n    operationName?: string;\n  }): Promise<GraphQlResponse> => {\n    const res = await this.post(this.url(), {\n      data: {\n        query,\n        variables,\n        operationName,\n      },\n    });\n    return res.data as GraphQlResponse;\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  ExternalTemplateGroupVersion,\n  TemplateGroupVersion,\n  TemplateGroupVersionFilterQuery,\n} from '../../types';\n\nexport class TemplateGroupVersionsApi extends BaseResourceAPI<TemplateGroupVersion> {\n  /**\n   * [Upsert a Template Group version](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsUpsert)\nCreate or update a Template Group version.\n   *\n   * ```js\n   * const version = { schema: \"type MyType @template { someField: String }\", conflictMode: ConflictMode.Patch };\n   * const newVersion = await client.group(\"myGroup\").versions.upsert(version);\n   * ```\n   */\n  public upsert = (\n    item: ExternalTemplateGroupVersion\n  ): Promise<TemplateGroupVersion> => {\n    return this.post(this.url('upsert'), {\n      data: item,\n    }).then((res) => res.data as TemplateGroupVersion);\n  };\n\n  /**\n   * [List Template Group versions](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsList)\n   *\n   * ```js\n   * const versions = await client.templates.group(\"myGroup\").versions.list( { minVersion: 1, maxVersion: 4 } );\n   * ```\n   */\n  public list = (\n    query?: TemplateGroupVersionFilterQuery\n  ): CursorAndAsyncIterator<TemplateGroupVersion> => {\n    return super.listEndpoint(this.callListEndpointWithPost, query);\n  };\n\n  /**\n   * [Delete a Template Group version](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsDelete)\n   *\n   * ```js\n   * await client.templates.group(\"myGroup\").versions.delete(1);\n   * ```\n   */\n  public delete = (version: number) => {\n    return this.post(this.url('delete'), {\n      data: {\n        version: version,\n      },\n    });\n  };\n}\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type ExternalId,\n} from '@cognite/sdk-core';\nimport type {\n  ExternalTemplateGroup,\n  TemplateGroup,\n  TemplateGroupFilterQuery,\n} from '../../types';\n\nexport class TemplateGroupsApi extends BaseResourceAPI<TemplateGroup> {\n  /**\n   * [Create Template Groups](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroups)\n   *\n   * ```js\n   * const templateGroups = [\n   *   { externalId: 'Wells', description: 'Models a Well system', owners: ['user.name@example.com'] },\n   * ];\n   * const createdTemplateGroups = await client.templates.groups.create(templateGroups);\n   * ```\n   */\n  public create = (\n    items: ExternalTemplateGroup[]\n  ): Promise<TemplateGroup[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [Upsert Template Groups](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsUpsert)\n   *\n   * ```js\n   * const templateGroups = [\n   *   { externalId: 'Wells', description: 'Models a Well system', owners: ['user.name@example.com'] },\n   * ];\n   * const upsertedTemplateGroups = await client.templates.groups.upsert(templateGroups);\n   * ```\n   */\n  public upsert = (\n    items: ExternalTemplateGroup[]\n  ): Promise<TemplateGroup[]> => {\n    return super.createEndpoint(items, this.url('upsert'));\n  };\n\n  /**\n   * [Retrieve Template Groups](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsByids)\n   *\n   * ```js\n   * const templateGroups = await client.templates.groups.retrieve([{externalId: 'abc'}]);\n   * ```\n   */\n  public retrieve = (\n    ids: ExternalId[],\n    options?: { ignoreUnknownIds: boolean }\n  ) => {\n    return super.retrieveEndpoint(ids, options || { ignoreUnknownIds: false });\n  };\n\n  /**\n   * [List Template Groups](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsList)\n   *\n   * ```js\n   * const templateGroups = await client.templates.groups.list({ filter: { owners: [\"user.name@example.com\"] } });\n   * ```\n   */\n  public list = (\n    query?: TemplateGroupFilterQuery\n  ): CursorAndAsyncIterator<TemplateGroup> => {\n    return super.listEndpoint(this.callListEndpointWithPost, query);\n  };\n\n  /**\n   * [Delete Template Groups](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsDelete)\n   *\n   * ```js\n   * await client.templates.groups.delete([{ externalId: \"Wells\" }]);\n   * ```\n   */\n  public delete = (\n    ids: ExternalId[],\n    options?: { ignoreUnknownIds: boolean }\n  ) => {\n    return super.deleteEndpoint(\n      ids,\n      options || {\n        ignoreUnknownIds: false,\n      }\n    );\n  };\n}\n","/**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\nfunction fromPairs(pairs) {\n  var index = -1,\n      length = pairs == null ? 0 : pairs.length,\n      result = {};\n\n  while (++index < length) {\n    var pair = pairs[index];\n    result[pair[0]] = pair[1];\n  }\n  return result;\n}\n\nmodule.exports = fromPairs;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\nmodule.exports = arrayMap;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\nfunction baseToPairs(object, props) {\n  return arrayMap(props, function(key) {\n    return [key, object[key]];\n  });\n}\n\nmodule.exports = baseToPairs;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag),\n      tag = value[symToStringTag];\n\n  try {\n    value[symToStringTag] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag] = tag;\n    } else {\n      delete value[symToStringTag];\n    }\n  }\n  return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n    getRawTag = require('./_getRawTag'),\n    objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n    undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n    isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 9 which returns 'object' for typed arrays and other constructors.\n  var tag = baseGetTag(value);\n  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n    isMasked = require('./_isMasked'),\n    isObject = require('./isObject'),\n    toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n    getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n    Map = require('./_Map'),\n    Promise = require('./_Promise'),\n    Set = require('./_Set'),\n    WeakMap = require('./_WeakMap'),\n    baseGetTag = require('./_baseGetTag'),\n    toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    setTag = '[object Set]',\n    weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = baseGetTag(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : '';\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\nmodule.exports = getTag;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\nfunction setToPairs(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = [value, value];\n  });\n  return result;\n}\n\nmodule.exports = setToPairs;\n","var baseToPairs = require('./_baseToPairs'),\n    getTag = require('./_getTag'),\n    mapToArray = require('./_mapToArray'),\n    setToPairs = require('./_setToPairs');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n    setTag = '[object Set]';\n\n/**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\nfunction createToPairs(keysFunc) {\n  return function(object) {\n    var tag = getTag(object);\n    if (tag == mapTag) {\n      return mapToArray(object);\n    }\n    if (tag == setTag) {\n      return setToPairs(object);\n    }\n    return baseToPairs(object, keysFunc(object));\n  };\n}\n\nmodule.exports = createToPairs;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n  return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n    isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n    !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n  return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n    stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  var type = typeof value;\n  length = length == null ? MAX_SAFE_INTEGER : length;\n\n  return !!length &&\n    (type == 'number' ||\n      (type != 'symbol' && reIsUint.test(value))) &&\n        (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n    isLength = require('./isLength'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    // Use `util.types` for Node.js 10+.\n    var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n    if (types) {\n      return types;\n    }\n\n    // Legacy `process.binding('util')` for Node.js < 10.\n    return freeProcess && freeProcess.binding && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n    isArguments = require('./isArguments'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isIndex = require('./_isIndex'),\n    isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  var isArr = isArray(value),\n      isArg = !isArr && isArguments(value),\n      isBuff = !isArr && !isArg && isBuffer(value),\n      isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n      skipIndexes = isArr || isArg || isBuff || isType,\n      result = skipIndexes ? baseTimes(value.length, String) : [],\n      length = result.length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (\n           // Safari 9 has enumerable `arguments.length` in strict mode.\n           key == 'length' ||\n           // Node.js 0.10 has enumerable non-index properties on buffers.\n           (isBuff && (key == 'offset' || key == 'parent')) ||\n           // PhantomJS 2 has enumerable non-index properties on typed arrays.\n           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n           // Skip index properties.\n           isIndex(key, length)\n        ))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n    nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeys;\n","var isFunction = require('./isFunction'),\n    isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n    baseKeys = require('./_baseKeys'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var createToPairs = require('./_createToPairs'),\n    keys = require('./keys');\n\n/**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\nvar toPairs = createToPairs(keys);\n\nmodule.exports = toPairs;\n","import type { EpochTimestamp, FilterQuery } from '../../types';\n\nexport type SessionStatus =\n  | 'READY'\n  | 'ACTIVE'\n  | 'CANCELLED'\n  | 'EXPIRED'\n  | 'REVOKED'\n  | 'ACCESS_LOST';\n\nexport const SessionStatus = {\n  READY: 'READY' as SessionStatus,\n  ACTIVE: 'ACTIVE' as SessionStatus,\n  CANCELLED: 'CANCELLED' as SessionStatus,\n  EXPIRED: 'EXPIRED' as SessionStatus,\n  REVOKED: 'REVOKED' as SessionStatus,\n  ACCESS_LOST: 'ACCESS_LOST' as SessionStatus,\n};\n\nexport type SessionType =\n  | 'CLIENT_CREDENTIALS'\n  | 'TOKEN_EXCHANGE'\n  | 'ONESHOT_TOKEN_EXCHANGE';\n\nexport const SessionType = {\n  CLIENT_CREDENTIALS: 'CLIENT_CREDENTIALS' as SessionType,\n  TOKEN_EXCHANGE: 'TOKEN_EXCHANGE' as SessionType,\n  ONESHOT_TOKEN_EXCHANGE: 'ONESHOT_TOKEN_EXCHANGE' as SessionType,\n};\n\n/**\n* A response with the ID, nonce and other information related to the session. The nonce\nis short-lived and should be immediately passed to the endpoint that will use\nthe session.\n*/\nexport interface SessionCreateResultItem {\n  /** ID of the session */\n  id: number;\n  /** Client ID in identity provider. Returned only if the session was created using client credentials */\n  clientId?: string;\n  /** Nonce to be passed to the internal service that will bind the session */\n  nonce: string;\n  /** Current status of the session */\n  status: SessionStatus;\n  /** Values reserved for future use */\n  type?: SessionType;\n}\n\n/**\n * Credentials for a session using client credentials from an identity provider.\n */\nexport interface SessionWithClientCredentialsCreate {\n  /** Client ID in identity provider */\n  clientId: string;\n  /** Client secret in identity provider */\n  clientSecret: string;\n}\n/**\n* Credentials for a session using one-shot token exchange to reuse the user's credentials.\nOne-shot sessions are short-lived sessions that are not refreshed and do not require support for token exchange from the identity provider.\n*/\nexport interface SessionWithOneshotTokenExchangeCreate {\n  /** Use one-shot token exchange for the session. Must be `true`. */\n  oneshotTokenExchange: true;\n}\n/**\n * Credentials for a session using token exchange to reuse the user's credentials.\n */\nexport interface SessionWithTokenExchangeCreate {\n  /** Use token exchange for the session. Must be `true`. */\n  tokenExchange: true;\n}\n\nexport type SessionCreate =\n  | SessionWithClientCredentialsCreate\n  | SessionWithTokenExchangeCreate\n  | SessionWithOneshotTokenExchangeCreate;\n\nexport interface SessionFilter {\n  /** Current status of the session */\n  status?:\n    | 'READY'\n    | 'ACTIVE'\n    | 'CANCELLED'\n    | 'EXPIRED'\n    | 'REVOKED'\n    | 'ACCESS_LOST';\n}\n\nexport interface SessionFilterQuery extends FilterQuery {\n  filter?: SessionFilter;\n}\n\nexport interface Session {\n  /** ID of the session */\n  id?: number;\n  /** Client ID in identity provider. Returned only if the session was created using client credentials */\n  clientId?: string;\n  /** Session creation time, in milliseconds since 1970 */\n  creationTime?: EpochTimestamp;\n  /** Session expiry time, in milliseconds since 1970. This value is updated on refreshing a token */\n  expirationTime?: EpochTimestamp;\n  /** Current status of the session */\n  status?: SessionStatus;\n  /** Values reserved for future use */\n  type?: SessionType;\n}\n","// Copyright 2020 Cognite AS\n\nimport type {\n  CogniteExternalId,\n  CogniteInstanceId,\n  CogniteInternalId,\n  Cursor,\n  ExternalId,\n  FilterQuery,\n  IdEither,\n  InstanceId,\n  InternalId,\n  Limit,\n} from '@cognite/sdk-core';\nimport type { AnnotationData } from './api/annotations/types.gen';\nimport type { TimeSeriesFilter } from './api/timeSeries/types';\nimport type {\n  AggregateResponse,\n  ArrayPatchLong,\n  CreatedAndLastUpdatedTime,\n  CreatedAndLastUpdatedTimeFilter,\n  DateRange,\n  ExternalIdPrefix,\n  IgnoreUnknownIds,\n  Metadata,\n  MetadataPatch,\n  NullableSinglePatchLong,\n  ObjectPatch,\n  Partition,\n  Range,\n  Timestamp,\n} from './types/common';\n\nexport * from './types/common';\n\nexport type {\n  ListResponse,\n  CursorResponse,\n  ItemsResponse,\n  ItemsWrapper,\n  FilterQuery,\n  Cursor,\n  Limit,\n  IdEither,\n  IdEitherWithInstance,\n  InternalId,\n  ExternalId,\n  CogniteExternalId,\n  CogniteInternalId,\n  CursorAndAsyncIterator,\n  CogniteAsyncIterator,\n  AutoPagingEachHandler,\n  AutoPagingEach,\n  AutoPagingToArrayOptions,\n  AutoPagingToArray,\n} from '@cognite/sdk-core';\n\nexport * from './exports.gen';\n\nexport * from './api/containers/types';\nexport * from './api/geospatial/types';\nexport * from './api/streams/types';\nexport * from './api/records/types';\nexport * from './api/sessions/types';\nexport * from './api/timeSeries/types';\nexport * from './api/timeSeries/subscriptions/types';\nexport * from './api/dataPoints/types';\nexport * from './api/functions/types';\n\nexport interface Acl<ActionsType, ScopeType> {\n  actions: ActionsType[];\n  scope: ScopeType;\n}\n\nexport type Acl3D = Acl<AclAction3D, AclScope3D>;\n\nexport type AclAction3D = READ | CREATE | UPDATE | DELETE;\n\nexport type AclActionAnalytics = READ | EXECUTE | LIST;\n\nexport type AclActionAssets = READ | WRITE;\n\nexport type AclActionDataSets = READ | WRITE | OWNER;\n\nexport type AclActionDataModelInstances = READ | WRITE | WRITE_PROPERTIES;\n\nexport type AclActionDataProducts = CREATE | DELETE | READ | UPDATE;\n\nexport type AclActionDataModel = READ | WRITE;\n\nexport type AclActionEvents = READ | WRITE;\n\nexport type AclActionFiles = READ | WRITE;\n\nexport type AclActionGroups = LIST | READ | CREATE | UPDATE | DELETE;\n\nexport type AclActionProjects = LIST | READ | CREATE | UPDATE;\n\nexport type AclActionRaw = READ | WRITE | LIST;\n\nexport type AclActionSecurityCategories = MEMBEROF | LIST | CREATE | DELETE;\n\nexport type AclActionSequences = READ | WRITE;\n\nexport type AclActionTemplateGroups = READ | WRITE;\n\nexport type AclActionTemplateInstances = READ | WRITE;\n\nexport type AclActionTimeseries = READ | WRITE;\n\nexport type AclActionUsers = LIST | CREATE | DELETE;\n\nexport type AclActionSessions = LIST | CREATE | DELETE;\n\nexport type AclAnalytics = Acl<AclActionAnalytics, AclScopeAnalytics>;\n\nexport type AclAssets = Acl<AclActionAssets, AclScopeAssets>;\n\nexport type AclDataSets = Acl<AclActionDataSets, AclScopeDatasets>;\n\nexport type AclDataModel = Acl<AclActionDataModel, AclScopeDataModel>;\n\nexport type AclDataModelInstances = Acl<\n  AclActionDataModelInstances,\n  AclScopeDataModelInstances\n>;\n\nexport type AclDataProducts = Acl<AclActionDataProducts, AclScopeDataProducts>;\n\nexport type AclEvents = Acl<AclActionEvents, AclScopeEvents>;\n\nexport type AclFiles = Acl<AclActionFiles, AclScopeFiles>;\n\nexport type AclGroups = Acl<AclActionGroups, AclScopeGroups>;\n\nexport type AclProjects = Acl<AclActionProjects, AclScopeProjects>;\n\nexport type AclRaw = Acl<AclActionRaw, AclScopeRaw>;\n\nexport type AclScope3D = AclScopeAll;\n\nexport type AclTemplateGroups = Acl<\n  AclActionTemplateGroups,\n  AclScopeTemplateGroups\n>;\n\nexport type AclTemplateInstances = Acl<\n  AclActionTemplateInstances,\n  AclScopeTemplateInstances\n>;\n\nexport interface AclScopeAll {\n  all: object;\n}\n\nexport interface AclScopeIds {\n  idScope: {\n    ids: CogniteInternalId[];\n  };\n}\n\nexport interface AclScopeSpaceIds {\n  spaceIdScope: {\n    spaceIds: CogniteExternalId[];\n  };\n}\n\nexport type AclScopeAnalytics = AclScopeAll;\n\nexport type AclScopeAssets = AclScopeAll | AclScopeDatasetsIds;\n\nexport interface AclScopeAssetsId {\n  assetIdScope: {\n    subtreeIds: CogniteInternalId[];\n  };\n}\n\nexport interface AclScopeCurrentUser {\n  currentuserscope: object;\n}\n\nexport type AclScopeDatasets = AclScopeAll | AclScopeIds;\n\nexport interface AclScopeDatasetsIds {\n  datasetScope: {\n    ids: CogniteInternalId[];\n  };\n}\n\nexport type AclScopeDataModel = AclScopeAll | AclScopeSpaceIds;\n\nexport type AclScopeDataModelInstances = AclScopeAll | AclScopeSpaceIds;\n\nexport interface AclScopeDataProductExternalIds {\n  dataProductScope: {\n    externalIds: CogniteExternalId[];\n  };\n}\n\nexport type AclScopeDataProducts = AclScopeAll | AclScopeDataProductExternalIds;\n\nexport type AclScopeEvents = AclScopeAll | AclScopeDatasetsIds;\n\nexport type AclScopeFiles = AclScopeAll | AclScopeDatasetsIds;\n\nexport type AclScopeGroups = AclScopeAll | AclScopeCurrentUser;\n\nexport type AclScopeProjects = AclScopeAll;\n\nexport type AclScopeRaw = AclScopeAll;\n\nexport type AclScopeSecurityCategories = AclScopeAll;\n\nexport type AclScopeSequences = AclScopeAll | AclScopeDatasetsIds;\n\nexport type AclScopeTemplateGroups = AclScopeAll | AclScopeDatasetsIds;\n\nexport type AclScopeTemplateInstances = AclScopeAll | AclScopeDatasetsIds;\n\nexport interface AclScopeTimeSeriesAssetRootIds {\n  assetRootIdScope: {\n    rootIds: CogniteInternalId[];\n  };\n}\n\nexport type AclScopeTimeseries =\n  | AclScopeAll\n  | AclScopeAssetsId\n  | AclScopeTimeSeriesAssetRootIds\n  | AclScopeDatasetsIds;\n\nexport type AclScopeUsers = AclScopeAll;\n\nexport type AclScopeSessions = AclScopeAll;\n\nexport type AclSecurityCategories = Acl<\n  AclActionSecurityCategories,\n  AclScopeSecurityCategories\n>;\n\nexport type AclSequences = Acl<AclActionSequences, AclScopeSequences>;\n\nexport type AclTimeseries = Acl<AclActionTimeseries, AclScopeTimeseries>;\n\nexport type AclUsers = Acl<AclActionUsers, AclScopeUsers>;\n\nexport type AclSessions = Acl<AclActionSessions, AclScopeSessions>;\n\nexport type ArrayPatchString =\n  | { set: string[] }\n  | { add?: string[]; remove?: string[] };\n\nexport interface Asset\n  extends ExternalAsset,\n    AssetInternalId,\n    CreatedAndLastUpdatedTime {\n  /**\n   * The id of the root for the tree this asset belongs to\n   */\n  rootId: CogniteInternalId;\n  /**\n   * Aggregated metrics of the asset\n   */\n  aggregates?: AssetAggregateResult;\n  /**\n   * The parent's externalId if defined\n   */\n  parentExternalId?: CogniteExternalId;\n}\n\nexport interface UniqueValuesAggregateResponse extends AggregateResponse {\n  /**\n   * A unique value from the requested field\n   */\n  value: string | number;\n}\n\n/**\n * Response from asset aggregate endpoint\n */\nexport type AssetAggregate = AggregateResponse;\n\n/**\n * Response from event aggregate endpoint\n */\nexport type EventAggregate = AggregateResponse;\n\n/**\n * Response from file aggregate endpoint\n */\nexport type FileAggregate = AggregateResponse;\n\n/**\n * Response from sequence aggregate endpoint\n */\nexport type SequenceAggregate = AggregateResponse;\n\n/**\n * Query schema for asset aggregate endpoint\n */\nexport interface AssetAggregateQuery {\n  /**\n   * Filter on assets with strict matching.\n   */\n  filter?: AssetFilterProps;\n}\n\n/**\n * Query schema for files aggregate endpoint\n */\nexport interface FileAggregateQuery {\n  /**\n   * Filter on files with strict matching.\n   */\n  filter?: FileFilterProps;\n}\n\nexport interface AssetAggregateResult {\n  /**\n   * Number of direct descendants for the asset\n   */\n  childCount?: number;\n  /**\n   * Asset path depth (number of levels below root node).\n   */\n  depth?: number;\n  /**\n   * IDs of assets on the path to the asset.\n   */\n  path?: AssetIdEither[];\n}\n\nexport type AssetAggregatedProperty = 'childCount' | 'path' | 'depth';\n\nexport type AssetChange = AssetChangeById | AssetChangeByExternalId;\n\nexport interface AssetChangeByExternalId extends AssetPatch, ExternalId {}\n\nexport interface AssetChangeById extends AssetPatch, InternalId {}\n\n/**\n * Description of asset.\n */\nexport type AssetDescription = string;\n\nexport type AssetExternalId = ExternalId;\n\n/**\n * Filter on assets with exact match\n */\nexport interface AssetFilter extends Limit {\n  filter?: AssetFilterProps;\n}\n\nexport interface AssetFilterProps {\n  name?: AssetName;\n  /**\n   * Return only the direct descendants of the specified assets.\n   */\n  parentIds?: CogniteInternalId[];\n  /**\n   * Return only the direct descendants of the specified assets.\n   */\n  parentExternalIds?: CogniteExternalId[];\n  rootIds?: IdEither[];\n  /**\n   * Only include assets that reference these specific dataSet IDs\n   */\n  dataSetIds?: IdEither[];\n  /**\n   * Only include assets in subtrees rooted at the specified assets.\n   * If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.\n   */\n  assetSubtreeIds?: IdEither[];\n  /**\n   * Return only the assets matching the specified label constraints.\n   */\n  labels?: LabelFilter;\n  metadata?: Metadata;\n  source?: AssetSource;\n  createdTime?: DateRange;\n  lastUpdatedTime?: DateRange;\n  /**\n   * Filtered assets are root assets or not\n   */\n  root?: boolean;\n  externalIdPrefix?: ExternalIdPrefix;\n}\n\nexport type AssetIdEither = IdEither;\n\nexport type AssetInternalId = InternalId;\n\nexport interface AssetListScope extends AssetFilter, FilterQuery {\n  /**\n   * Set of aggregated properties to include\n   */\n  aggregatedProperties?: AssetAggregatedProperty[];\n  partition?: Partition;\n}\n\nexport interface AssetMapping3D extends AssetMapping3DBase {\n  /**\n   * A number describing the position of this node in the 3D hierarchy, starting from 0.\n   * The tree is traversed in a depth-first order.\n   * Only present if the asset mapping's node ID is valid.\n   */\n  treeIndex?: number;\n  /**\n   * The number of nodes in the subtree of this node (this number included the node itself).\n   * Only present if the asset mapping's node ID is valid.\n   */\n  subtreeSize?: number;\n}\n\nexport interface AssetMapping3DBase {\n  /**\n   * The ID of the node.\n   */\n  nodeId: CogniteInternalId;\n  /**\n   * The ID of the associated asset (Cognite's Assets API).\n   */\n  assetId: CogniteInternalId;\n  /**\n   * The ID of the associated Cognite Asset instance from Core Data Model.\n   */\n  assetInstanceId?: UnitDMSUniqueIdentifier;\n}\n\nexport interface AssetMappings3DListFilter extends FilterQuery {\n  nodeId?: CogniteInternalId;\n  assetId?: CogniteInternalId;\n  /**\n   * If given, only return asset mappings for assets whose bounding box intersects the given bounding box.\n   */\n  intersectsBoundingBox?: BoundingBox3D;\n  /**\n   * If true, the response will include the mappings with assetInstanceId values, for DM based assets.\n   */\n  getDmsInstances?: boolean;\n}\n\nexport interface AssetMappings3DAssetFilter {\n  assetIds: CogniteInternalId[];\n}\n\nexport interface AssetMappings3DNodeFilter {\n  nodeIds: CogniteInternalId[];\n}\n\nexport interface AssetMappings3DTreeIndexFilter {\n  treeIndexes: CogniteInternalId[];\n}\n\nexport interface Filter3DAssetMappingsQuery extends FilterQuery {\n  /**\n   * A filter for either `assetIds`, `nodeIds` or `treeIndices`.\n   */\n  filter?:\n    | AssetMappings3DAssetFilter\n    | AssetMappings3DNodeFilter\n    | AssetMappings3DTreeIndexFilter;\n}\n\n/**\n * Name of asset. Often referred to as tag.\n */\nexport type AssetName = string;\n\nexport interface AssetPatch {\n  update: {\n    externalId?: SinglePatchString;\n    name?: SinglePatchRequiredString;\n    description?: SinglePatchString;\n    dataSetId?: NullableSinglePatchLong;\n    metadata?: MetadataPatch;\n    labels?: LabelsPatch;\n    source?: SinglePatchString;\n  };\n}\n\nexport interface AssetRetrieveParams extends IgnoreUnknownIds {\n  /**\n   * Set of aggregated properties to include\n   */\n  aggregatedProperties?: AssetAggregatedProperty[];\n}\n\nexport interface AssetSearchFilter extends AssetFilter {\n  search?: {\n    name?: AssetName;\n    query?: AssetName | AssetDescription;\n    description?: AssetDescription;\n  };\n}\n\n/**\n * The source of this asset\n */\nexport type AssetSource = string;\n\n/**\n * The bounding box of the subtree with this sector as the root sector.\n * Is null if there are no geometries in the subtree.\n */\nexport interface BoundingBox3D {\n  /**\n   * The minimal coordinates of the bounding box.\n   */\n  min: Tuple3<number>;\n  /**\n   * The maximal coordinates of the bounding box.\n   */\n  max: Tuple3<number>;\n}\n\nexport type CREATE = 'CREATE';\n\nexport type CogniteCapability = SingleCogniteCapability[];\n\nexport interface CogniteEvent\n  extends ExternalEvent,\n    InternalId,\n    CreatedAndLastUpdatedTime {}\n\nexport type CreateAssetMapping3D = AssetMapping3DBase;\n\nexport interface CreateModel3D {\n  /**\n   * The name of the model.\n   */\n  name: string;\n  metadata?: Metadata;\n  dataSetId?: number;\n}\n\nexport interface CreateRevision3D {\n  /**\n   * True if the revision is marked as published.\n   */\n  published?: boolean;\n  /**\n   * Global rotation to be applied to the entire model.\n   * The rotation is expressed by Euler angles in radians and in XYZ order.\n   */\n  rotation?: Tuple3<number>;\n  camera?: RevisionCameraProperties;\n  /**\n   * The file id to a file uploaded to Cognite's Files API.\n   * Can only be set on revision creation, and can never be updated. _Only FBX files are supported_.\n   */\n  fileId: CogniteInternalId;\n  metadata?: Metadata;\n}\n\nexport interface CreatedTime {\n  createdTime: Date;\n}\n\nexport type DELETE = 'DELETE';\n\nexport interface DataIds {\n  items?: AssetIdEither[];\n}\n\nexport interface DataSet\n  extends ExternalDataSet,\n    InternalId,\n    CreatedAndLastUpdatedTime {\n  writeProtected: DataSetWriteProtected;\n}\n\n/**\n * Response from dataset aggregate endpoint\n */\nexport interface DataSetAggregate {\n  /**\n   * Size of the aggregation group\n   */\n  count: number;\n}\n\n/**\n * Query schema for datasets aggregate endpoint\n */\nexport interface DataSetAggregateQuery {\n  /**\n   * Filter on datasets with strict matching.\n   */\n  filter?: DataSetFilter;\n}\n\nexport type DataSetChange = DataSetChangeById | DataSetChangeByExternalId;\n\nexport interface DataSetChangeByExternalId extends DataSetPatch, ExternalId {}\n\nexport interface DataSetChangeById extends DataSetPatch, InternalId {}\n\nexport type Label = ExternalId;\n\nexport type LabelFilter = LabelContainsAnyFilter | LabelContainsAllFilter;\n\nexport interface LabelContainsAnyFilter {\n  containsAny: Label[];\n}\n\nexport interface LabelContainsAllFilter {\n  containsAll: Label[];\n}\n\nexport interface LabelsPatch {\n  /**\n   * A list of labels to add to the resource\n   */\n  add?: Label[];\n  /**\n   * A list of labels to remove to the resource\n   */\n  remove?: Label[];\n}\n\nexport interface ExternalLabelDefinition extends Label {\n  /**\n   * Name of the label.\n   */\n  name: string;\n\n  /**\n   * Description of the label.\n   */\n  description?: string;\n}\n\nexport interface LabelDefinition extends ExternalLabelDefinition {\n  createdTime: Date;\n}\n\nexport interface LabelDefinitionFilter {\n  /**\n   * Returns the label definitions matching that name.\n   */\n  name?: string;\n\n  /**\n   * Filter external ids starting with the prefix specified\n   */\n  externalIdPrefix?: ExternalIdPrefix;\n}\n\nexport interface LabelDefinitionFilterRequest extends FilterQuery {\n  filter?: LabelDefinitionFilter;\n}\n\n/**\n * Filter on data sets with exact match\n */\nexport interface DataSetFilter extends CreatedAndLastUpdatedTimeFilter {\n  metadata?: Metadata;\n  externalIdPrefix?: ExternalIdPrefix;\n  writeProtected?: DataSetWriteProtected;\n}\n\nexport interface DataSetFilterRequest extends FilterQuery {\n  filter?: DataSetFilter;\n}\n\nexport interface DataSetPatch {\n  update: {\n    externalId?: SinglePatchString;\n    name?: SinglePatchString;\n    description?: SinglePatchString;\n    metadata?: MetadataPatch;\n    writeProtected?: SetField<boolean>;\n  };\n}\n\n/**\n * Write-protected data sets impose additional restrictions on write access to resources inside a data set which can help ensuring data integrity of the data set.\n * For write-protected data set in addition to a writing capability that has given resource data in scope, principal must be an owners of the data set.\n * Note that this does not affect any security categories set for given resource data, both security category membership and data set ownership is required in such case\n */\nexport type DataSetWriteProtected = boolean;\n\nexport type DeleteAssetMapping3D = AssetMapping3DBase;\n\nexport type EXECUTE = 'EXECUTE';\n\n/**\n * Query schema for event aggregate endpoint\n */\nexport interface EventAggregateQuery {\n  /**\n   * Filter on events with strict matching.\n   */\n  filter?: EventFilter;\n}\n\nexport interface EventUniqueValuesAggregate extends EventAggregateQuery {\n  /**\n   * The field name(s) to apply the aggregation on. Currently limited to one field.\n   */\n  fields: ('type' | 'subtype' | 'dataSetId')[];\n}\n\nexport type EventChange = EventChangeById | EventChangeByExternalId;\n\nexport interface EventChangeByExternalId extends EventPatch, ExternalId {}\n\nexport interface EventChangeById extends EventPatch, InternalId {}\n\nexport interface EventFilter extends CreatedAndLastUpdatedTimeFilter {\n  startTime?: DateRange;\n  /**\n   * Date range for event end time.\n   * To filter ongoing events {isNull: true} should be provided instead of Date range\n   */\n  endTime?: NullableProperty<DateRange>;\n  /**\n   * Event is considered active from its startTime to endTime inclusive. If startTime is null, event is never active. If endTime is null, event is active from startTime onwards. activeAtTime filter will match all events that are active at some point from min to max, from min, or to max, depending on which of min and max parameters are specified.\n   */\n  activeAtTime?: DateRange;\n\n  metadata?: Metadata;\n  /**\n   * Asset IDs of related equipment that this event relates to.\n   */\n  assetIds?: CogniteInternalId[];\n  /**\n   * Asset External IDs of related equipment that this event relates to.\n   */\n  assetExternalIds?: CogniteExternalId[];\n  /**\n   * Only include events that reference these specific dataSet IDs\n   */\n  dataSetIds?: IdEither[];\n  /**\n   * Only include events that have a related asset in a subtree rooted at any of these assetIds.\n   * If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.\n   */\n  assetSubtreeIds?: IdEither[];\n  /**\n   * Filter by event source\n   */\n  source?: string;\n  /**\n   * Filter by event type\n   */\n  type?: string;\n  /**\n   * Filter by event subtype\n   */\n  subtype?: string;\n  externalIdPrefix?: ExternalIdPrefix;\n}\n\nexport interface EventFilterRequest extends FilterQuery {\n  filter?: EventFilter;\n  sort?: EventSort;\n  partition?: Partition;\n}\n\nexport interface EventPatch {\n  update: {\n    externalId?: SinglePatchString;\n    startTime?: SinglePatchDate;\n    endTime?: SinglePatchDate;\n    description?: SinglePatchString;\n    metadata?: MetadataPatch;\n    assetIds?: ArrayPatchLong;\n    dataSetId?: NullableSinglePatchLong;\n    source?: SinglePatchString;\n    type?: SinglePatchString;\n    subtype?: SinglePatchString;\n  };\n}\n\nexport interface EventSearch {\n  description?: string;\n}\n\nexport interface EventSearchRequest extends Limit {\n  filter?: EventFilter;\n  search?: EventSearch;\n}\n\n/**\n * Sort by selected fields.\n * Only sorting on 1 field is currently supported.\n * Partitions are done independently of sorting, there is no guarantee on sort order between elements from different partitions.\n */\nexport interface EventSort {\n  startTime?: SortOrder;\n  endTime?: SortOrder;\n  createdTime?: SortOrder;\n  lastUpdatedTime?: SortOrder;\n}\n\nexport interface ExternalAsset {\n  externalId?: CogniteExternalId;\n  name: AssetName;\n  parentId?: CogniteInternalId;\n  description?: AssetDescription;\n  dataSetId?: CogniteInternalId;\n  metadata?: Metadata;\n  source?: AssetSource;\n  labels?: Label[];\n}\n\nexport interface ExternalAssetItem extends ExternalAsset {\n  /**\n   * External id to the parent asset\n   */\n  parentExternalId?: CogniteExternalId;\n}\n\nexport interface ExternalDataSet {\n  externalId?: CogniteExternalId;\n  /**\n   * Name of data set\n   */\n  name?: string;\n  /**\n   * Description of data set\n   */\n  description?: string;\n  metadata?: Metadata;\n  writeProtected?: DataSetWriteProtected;\n}\n\n/**\n * An event represents something that happened at a given interval in time, e.g a failure, a work order etc.\n */\nexport interface ExternalEvent {\n  externalId?: CogniteExternalId;\n  startTime?: Timestamp;\n  endTime?: Timestamp;\n  type?: string;\n  subtype?: string;\n  description?: string;\n  metadata?: Metadata;\n  assetIds?: CogniteInternalId[];\n  dataSetId?: CogniteInternalId;\n  source?: string;\n}\n\nexport interface ExternalFileInfo {\n  externalId?: CogniteExternalId;\n  name: FileName;\n  source?: string;\n  mimeType?: FileMimeType;\n  directory?: string;\n  metadata?: Metadata;\n  assetIds?: CogniteInternalId[];\n  dataSetId?: CogniteInternalId;\n  securityCategories?: CogniteInternalId[];\n  sourceCreatedTime?: Date;\n  sourceModifiedTime?: Date;\n  labels?: Label[];\n  geoLocation?: FileGeoLocation;\n}\n\nexport interface ExternalSequence extends SequenceBase {\n  /**\n   * List of column definitions\n   */\n  columns: ExternalSequenceColumn[];\n}\n\n/**\n * Describes a new column\n */\nexport interface ExternalSequenceColumn\n  extends ExternalSequenceColumnBase,\n    ExternalId {}\n\ninterface ExternalSequenceColumnBase {\n  name?: SequenceColumnName;\n  description?: SequenceColumnDescription;\n  valueType?: SequenceValueType;\n  metadata?: Metadata;\n}\n\nexport type FileChangeCommonProperties = {\n  externalId?: SinglePatchString;\n  metadata?: MetadataPatch;\n  assetIds?: ArrayPatchLong;\n  dataSetId?: NullableSinglePatchLong;\n  labels?: LabelsPatch;\n  geoLocation?: FileGeoLocationPatch;\n};\n\nexport type FileChangeAssetCentricProperties = FileChangeCommonProperties & {\n  source?: SinglePatchString;\n  mimeType?: SinglePatchString;\n  securityCategories?: ArrayPatchLong;\n  sourceCreatedTime?: SinglePatchDate;\n  sourceModifiedTime?: SinglePatchDate;\n};\n\nexport interface FileChange {\n  update: FileChangeAssetCentricProperties;\n}\n\nexport interface FileChangeByInstanceId {\n  update: FileChangeCommonProperties;\n}\n\nexport type FileChangeUpdate =\n  | FileChangeUpdateById\n  | FileChangeUpdateByExternalId\n  | FileChangeUpdateByInstanceId;\n\nexport interface FileChangeUpdateByExternalId extends ExternalId, FileChange {}\n\nexport interface FileChangeUpdateById extends InternalId, FileChange {}\n\nexport interface FileChangeUpdateByInstanceId\n  extends InstanceId,\n    FileChangeByInstanceId {}\n\nexport type FileContent = ArrayBuffer | Buffer | unknown;\n\nexport interface FileFilterProps {\n  name?: FileName;\n  mimeType?: FileMimeType;\n  metadata?: Metadata;\n  /**\n   * Only include files that reference these specific asset IDs.\n   */\n  assetIds?: CogniteInternalId[];\n  /**\n   * Only include files that have a related asset in a tree rooted at any of these root assetIds.\n   */\n  rootAssetIds?: IdEither[];\n  /**\n   * Only include items that reference these specific dataSet IDs\n   */\n  dataSetIds?: IdEither[];\n  /**\n   * Only include files that are related to an asset in a subtree rooted at any of these assetIds.\n   * If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.\n   */\n  assetSubtreeIds?: IdEither[];\n  directoryPrefix?: string;\n  source?: string;\n  createdTime?: DateRange;\n  lastUpdatedTime?: DateRange;\n  uploadedTime?: DateRange;\n  sourceCreatedTime?: DateRange;\n  sourceModifiedTime?: DateRange;\n  externalIdPrefix?: ExternalIdPrefix;\n  uploaded?: boolean;\n  /**\n   * Return only the resource matching the specified label constraints.\n   */\n  labels?: LabelFilter;\n  geoLocation?: FileGeoLocationFilter;\n}\n\nexport interface FileFilter extends Limit {\n  filter?: FileFilterProps;\n}\n\nexport interface FileLink {\n  downloadUrl: string;\n}\n\n/**\n * File type. E.g. text/plain, application/pdf, ...\n */\nexport type FileMimeType = string;\n\n/**\n * Name of the file.\n */\nexport type FileName = string;\n\nexport interface FileRequestFilter extends FilterQuery, FileFilter {}\n\nexport interface FileInfo extends ExternalFileInfo, CreatedAndLastUpdatedTime {\n  id: CogniteInternalId;\n  instanceId?: CogniteInstanceId;\n  /**\n   * Whether or not the actual file is uploaded\n   */\n  uploaded: boolean;\n  uploadedTime?: Date;\n}\n\nexport interface FilesSearchFilter extends FileFilter {\n  search?: {\n    name?: FileName;\n  };\n}\n\nexport type FileGeoLocationType = 'Feature';\nexport type FileGeoLocationGeometryType =\n  | 'Point'\n  | 'MultiPolygon'\n  | 'MultiLineString'\n  | 'MultiPoint'\n  | 'Polygon'\n  | 'LineString';\nexport type FileGeoLocationRelation = 'intersects' | 'disjoint' | 'within';\n\nexport type MultiPolygonCoordinates = PointCoordinates[][][];\nexport type MultiLineStringCoordinates = PointCoordinates[][];\nexport type MultiPointCoordinates = PointCoordinates[];\nexport type PolygonCoordinates = PointCoordinates[][];\nexport type LineStringCoordinates = PointCoordinates[];\nexport type PointCoordinates = Tuple2<number>;\n\nexport interface GeoLocationGeometry<T extends FileGeoLocationGeometryType, K> {\n  type: T;\n  coordinates: K;\n}\n\n/**\n * The geographic metadata of the file\n */\nexport interface FileGeoLocation {\n  /**\n   * One of the GeoJSON types. Currently only the 'Feature' type is supported\n   */\n  type: FileGeoLocationType;\n  /**\n   * Represents the points, curves and surfaces in the coordinate space\n   */\n  geometry: FileGeoLocationGeometry;\n  /**\n   * Additional properties in a String key -> Object value format\n   */\n  properties?: { [key: string]: unknown };\n}\n\nexport type FileGeoLocationGeometry =\n  /**\n   * List of multiple polygons.\n   * Each polygon is defined as a list of one or more linear rings representing a shape.\n   * A linear ring is the boundary of a surface or the boundary of a hole in a surface.\n   * It is defined as a list consisting of 4 or more Points, where the first and last Point is equivalent.\n   * Each Point is defined as an array of 2 numbers, representing coordinates of a point in 2D space.\n   * Example: [[[[30, 20], [45, 40], [10, 40], [30, 20]]], [[[15, 5], [40, 10], [10, 20], [5, 10], [15, 5]]]]\n   */\n  | GeoLocationGeometry<'MultiPolygon', MultiPolygonCoordinates>\n  /**\n   * List of lines where each line (LineString) is defined as a list of two or more points.\n   * Each point is defined as a pair of two numbers in an array, representing coordinates of a point in 2D space.\n   * Example: [[[30, 10], [10, 30]], [[35, 10], [10, 30], [40, 40]]]\n   */\n  | GeoLocationGeometry<'MultiLineString', MultiLineStringCoordinates>\n  /**\n   * List of Points. Each Point is defined as an array of 2 numbers, representing coordinates of a point in 2D space.\n   * Example: [[35, 10], [45, 45]]\n   */\n  | GeoLocationGeometry<'MultiPoint', MultiPointCoordinates>\n  /**\n   * List of one or more linear rings representing a shape.\n   * A linear ring is the boundary of a surface or the boundary of a hole in a surface.\n   * It is defined as a list consisting of 4 or more Points, where the first and last Point is equivalent.\n   * Each Point is defined as an array of 2 numbers, representing coordinates of a point in 2D space.\n   * Example: [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]\n   */\n  | GeoLocationGeometry<'Polygon', PolygonCoordinates>\n  /**\n   * Coordinates of a line described by a list of two or more points.\n   * Each point is defined as a pair of two numbers in an array, representing coordinates of a point in 2D space.\n   * Example: [[30, 10], [10, 30], [40, 40]]\n   */\n  | GeoLocationGeometry<'LineString', LineStringCoordinates>\n  /**\n   * Coordinates of a point in 2D space, described as an array of 2 numbers.\n   * Example: [4.306640625, 60.205710352530346]\n   */\n  | GeoLocationGeometry<'Point', PointCoordinates>;\n\nexport interface FileGeoLocationFilter {\n  /**\n   * One of the supported queries: \"intersects\" \"disjoint\" \"within\"\n   */\n  relation: FileGeoLocationRelation;\n  /**\n   * Represents the points, curves and surfaces in the coordinate space\n   */\n  shape: FileGeoLocationGeometry;\n}\n\nexport type FileGeoLocationPatch = SetField<FileGeoLocation> | RemoveField;\n\nexport type PrincipalId = string;\nexport type GroupMembers = PrincipalId[] | 'allUserAccounts';\n\ninterface BaseGroup {\n  name: GroupName;\n  capabilities?: CogniteCapability;\n  id: number;\n  isDeleted: boolean;\n  deletedTime?: Date;\n}\n\nexport interface ManagedExternallyGroup extends BaseGroup {\n  sourceId?: GroupSourceId;\n}\n\nexport interface ManagedInCDFGroup extends BaseGroup {\n  members: GroupMembers;\n  // We are adding `sourceId: undefined` because this code:\n  // const foo(bar: Group) => console.log(bar.sourceId)\n  // yields the error:\n  // `Property 'sourceId' does not exist on type 'ManagedInCDFGroup'.`\n  // The Group type is defined as `type Group = ManagedInCDFGroup | ManagedExternallyGroup`\n  // and `sourceId` isn't defined on `ManagedInCDFGroup`.\n  // Typescript fails even though `sourceId` is an optional field on `ManagedExternallyGroup`.\n  sourceId: undefined;\n}\n\nexport type Group = ManagedInCDFGroup | ManagedExternallyGroup;\n\nexport function isManagedInCDFGroup(group: Group): group is ManagedInCDFGroup {\n  return (group as ManagedInCDFGroup).members !== undefined;\n}\n\nexport function isManagedExternallyGroup(\n  group: Group\n): group is ManagedExternallyGroup {\n  return !isManagedInCDFGroup(group);\n}\n\n/**\n * Name of the group\n * @example Production Engineers\n */\nexport type GroupName = string;\n\n/**\n * ID of the group in the source. If this is the same ID as a group in the IDP, a user in that group will implicitly be a part of this group as well.\n * @example b7c9a5a4-99c2-4785-bed3-5e6ad9a78603\n */\nexport type GroupSourceId = string;\n\nexport interface GroupSpec {\n  name: GroupName;\n  sourceId?: GroupSourceId;\n  members?: GroupMembers;\n  capabilities?: CogniteCapability;\n}\n\nexport type Groups = CogniteInternalId[];\n\n/**\n * Range between two integers\n */\nexport type IntegerRange = Range<number>;\n\nexport type LIST = 'LIST';\n\nexport interface List3DNodesQuery extends FilterQuery {\n  /**\n   * Get sub nodes up to this many levels below the specified node. Depth 0 is the root node.\n   */\n  depth?: number;\n  /**\n   * ID of a node that are the root of the subtree you request (default is the root node).\n   */\n  nodeId?: CogniteInternalId;\n  /**\n   * Filter for node properties. Only nodes that match all the given properties exactly will be listed. The filter must be a JSON object with the same format as the properties field.\n   */\n  properties?: Node3DProperties;\n  /**\n   * Partition specifier of the form \"n/m\". It will return the n'th (1-indexed) part of the result divided into m parts\n   */\n  partition?: Partition;\n  /**\n   * Enables sorting on node ID as opposed to tree index. This may result in faster response times for certain requests.\n   */\n  sortByNodeId?: boolean;\n}\n\nexport interface Filter3DNodesByNames {\n  /**\n   * Name filter. Nodes satisfy the filter if, the name of the node exists in the provided array.\n   */\n  names: string[];\n}\n\nexport interface Filter3DNodesByProperty {\n  /**\n   * Property filters. Nodes satisfy the filter if, for each property in the nested map(s), they have a value corresponding to that property that is contained within the list associated with that property in the map.\n   */\n  properties: { [key: string]: { [key: string]: string[] } };\n}\n\nexport interface Filter3DNodesQuery extends FilterQuery {\n  /**\n   * List filter\n   */\n  filter: Filter3DNodesByProperty | Filter3DNodesByNames;\n  /**\n   * Partition specifier of the form \"n/m\". It will return the n'th (1-indexed) part of the result divided into m parts.\n   */\n  partition?: Partition;\n}\n\nexport interface ListGroups {\n  /**\n   * Whether to get all groups, only available with the groups:list acl.\n   */\n  all?: boolean;\n}\n\nexport type ListRawDatabases = FilterQuery;\n\nexport interface ListRawRows extends FilterQuery {\n  /**\n   * Set this to true if you only want to fetch row keys\n   */\n  onlyRowKeys?: boolean;\n  /**\n   * Specify this to limit columns to retrieve. Array of column keys\n   */\n  columns?: string[];\n  /**\n   * Exclusive filter for last updated time. When specified only rows updated after this time will be returned\n   */\n  minLastUpdatedTime?: Date;\n  /**\n   * Inclusive filter for last updated time. When specified only rows updated before this time will be returned\n   */\n  maxLastUpdatedTime?: Date;\n}\n\nexport type ListRawTables = FilterQuery;\n\nexport type ListReveal3DNodeAncestors = FilterQuery;\n\nexport interface ListRevealSectors3DQuery extends FilterQuery {\n  /**\n   * Bounding box to restrict search to. If given, only return sectors that intersect the given bounding box. Given as a JSON-encoded object of two arrays \\\"min\\\" and \\\"max\\\" with 3 coordinates each.\n   */\n  boundingBox?: BoundingBox3D;\n}\n\nexport interface ListSecurityCategories extends FilterQuery {\n  sort?: 'ASC' | 'DESC';\n}\n\nexport type MEMBEROF = 'MEMBEROF';\n\nexport interface Model3D {\n  /**\n   * The name of the model.\n   */\n  name: string;\n  /**\n   * The ID of the model.\n   */\n  id: CogniteInternalId;\n  createdTime: Date;\n  metadata?: Metadata;\n  dataSetId?: number;\n}\n\nexport interface Model3DListRequest extends FilterQuery {\n  /**\n   * Filter based on whether or not it has published revisions.\n   */\n  published?: boolean;\n}\n\nexport interface Node3D {\n  /**\n   * The ID of the node.\n   */\n  id: CogniteInternalId;\n  /**\n   * The index of the node in the 3D model hierarchy, starting from 0.\n   * The tree is traversed in a depth-first order.\n   */\n  treeIndex: number;\n  /**\n   * The parent of the node, null if it is the root node.\n   */\n  parentId: CogniteInternalId;\n  /**\n   * The depth of the node in the tree, starting from 0 at the root node.\n   */\n  depth: number;\n  /**\n   * The name of the node.\n   */\n  name: string;\n  /**\n   * The number of descendants of the node, plus one (counting itself).\n   */\n  subtreeSize: number;\n  /**\n   * Properties extracted from 3D model, with property categories containing key/value string pairs.\n   */\n  properties?: Node3DProperties;\n  /**\n   *  The bounding box of the subtree with this sector as the root sector.\n   *  Is null if there are no geometries in the subtree.\n   */\n  boundingBox?: BoundingBox3D;\n}\n\n/**\n * Properties extracted from 3D model, with property categories containing key/value string pairs.\n */\nexport interface Node3DProperties {\n  [category: string]: {\n    [key: string]: string;\n  };\n}\n\nexport type NullableProperty<T> = T | { isNull: boolean };\n\nexport type OWNER = 'OWNER';\n\n/**\n * The display name of the project.\n * @example Open Industrial Data\n */\nexport type ProjectName = string;\n\n/**\n * Information about the project\n */\nexport interface ProjectResponse {\n  name: ProjectName;\n  urlName: UrlName;\n  oidcConfiguration?: OidcConfiguration;\n  userProfilesConfiguration: UserProfilesConfiguration;\n}\n\nexport interface UserProfilesConfiguration {\n  enabled: boolean;\n}\n\nexport interface ClaimName {\n  claimName: string;\n}\n\nexport interface OidcConfiguration {\n  jwksUrl: string;\n  tokenUrl?: string;\n  issuer: string;\n  audience: string;\n  skewMs?: number;\n  accessClaims: ClaimName[];\n  scopeClaims: ClaimName[];\n  logClaims: ClaimName[];\n}\n\nexport type READ = 'READ';\n\nexport interface RawDBName {\n  /**\n   * Unique name of a database.\n   */\n  name: string;\n}\n\n/**\n * A NoSQL database to store customer data.\n */\nexport interface RawDB extends RawDBName {\n  createdTime: Date;\n}\n\nexport interface RawDBRow extends RawDBRowInsert {\n  /**\n   * Time when the row was last updated\n   */\n  lastUpdatedTime: Date;\n}\n\nexport interface RawDBRowInsert extends RawDBRowKey {\n  /**\n   * Row data stored as a JSON object.\n   */\n  columns: Record<string, unknown>;\n}\n\nexport interface RawDBRowKey {\n  /**\n   * Unique row key\n   */\n  key: string;\n}\n\nexport interface RawDBTableName {\n  /**\n   * Unique name of the table\n   */\n  name: string;\n}\n\nexport interface RawDBTable extends RawDBTableName {\n  createdTime: Date;\n}\n\nexport interface RemoveField {\n  setNull: boolean;\n}\n\nexport type RelationshipResourceType =\n  | 'asset'\n  | 'timeSeries'\n  | 'file'\n  | 'event'\n  | 'sequence';\n\nexport interface ExternalRelationship {\n  /**\n   * External id of the relationship, must be unique within the project\n   */\n  externalId: CogniteExternalId;\n  /**\n   * External id of the CDF resource that constitutes the relationship source\n   */\n  sourceExternalId: CogniteExternalId;\n  /**\n   * Enum: \"asset\" \"timeSeries\" \"file\" \"event\" \"sequence\".\n   * The CDF resource type of the relationship source. Must be one of the specified values.\n   */\n  sourceType: RelationshipResourceType;\n  /**\n   * External id of the CDF resource that constitutes the relationship target.\n   */\n  targetExternalId: CogniteExternalId;\n  /**\n   * Enum: \"asset\" \"timeSeries\" \"file\" \"event\" \"sequence\".\n   * The CDF resource type of the relationship target. Must be one of the specified values.\n   */\n  targetType: RelationshipResourceType;\n  /**\n   * Time when the relationship became active.\n   * If there is no startTime, relationship is active from the beginning of time until endTime.\n   */\n  startTime?: Timestamp;\n  /**\n   * Time when the relationship became inactive. If there is no endTime,\n   * relationship is active from startTime until the present or any point in the future.\n   * If endTime and startTime are set, then endTime must be strictly greater than startTime\n   */\n  endTime?: Timestamp;\n  /**\n   * Confidence value of the existence of this relationship.\n   * Generated relationships should provide a realistic score on the likelihood of the existence of the relationship.\n   * Relationships without a confidence value can be interpreted at the discretion of each project.\n   */\n  confidence?: number;\n  /**\n   * The id of the dataset this relationship belongs to\n   */\n  dataSetId?: CogniteInternalId;\n  /**\n   * A list of the labels associated with this resource item\n   */\n  labels?: Label[];\n}\n\nexport interface Relationship\n  extends ExternalRelationship,\n    CreatedAndLastUpdatedTime {}\n\nexport interface RelationshipsFilterRequest extends FilterQuery {\n  /**\n   * Filter on relationships with exact match.\n   * Multiple filter elements in one property, e.g. sourceExternalIds: [ \"a\", \"b\" ],\n   * will return all relationships where the sourceExternalId field is either a or b.\n   * Filters in multiple properties will return the relationships that match all criteria.\n   * If the filter is not specified it default to an empty filter.\n   */\n  filter?: RelationshipsFilter;\n\n  /**\n   * If true, will try to fetch the resources referred to in the relationship,\n   * based on the users access rights. Will silently fail to attatch the resources\n   * if the user lacks access to some of them.\n   */\n  fetchResources?: boolean;\n}\n\nexport interface RelationshipsFilter extends CreatedAndLastUpdatedTimeFilter {\n  /**\n   * Include relationships that have any of these values in their sourceExternalId field\n   */\n  sourceExternalIds?: CogniteExternalId[];\n  /**\n   * Items Enum: \"asset\" \"timeSeries\" \"file\" \"event\" \"sequence\".\n   * Include relationships that have any of these values in their sourceType field\n   */\n  sourceTypes?: RelationshipResourceType[];\n  /**\n   * Include relationships that have any of these values in their targetExternalId field\n   */\n  targetExternalIds?: CogniteExternalId[];\n  /**\n   * Items Enum: \"asset\" \"timeSeries\" \"file\" \"event\" \"sequence\".\n   * Include relationships that have any of these values in their targetType field\n   */\n  targetTypes?: RelationshipResourceType[];\n  /**\n   * Only include relationships that reference these specific dataSet IDs\n   */\n  dataSetIds?: IdEither[];\n  startTime?: DateRange;\n  endTime?: DateRange;\n  /**\n   * Confidence range to filter for\n   */\n  confidence?: Range<number>;\n  /**\n   * Limits results to those active at any point within the given time range, i.e.\n   * if there is any overlap in the intervals [activeAtTime.min, activeAtTime.max] and [startTime, endTime],\n   * where both intervals are inclusive. If a relationship does not have a startTime,\n   * it is regarded as active from the beginning of time by this filter.\n   * If it does not have an endTime is will be regarded as active until the end of time.\n   * Similarly, if a min is not supplied to the filter, the min will be implicitly set to the beginning of time,\n   * and if a max is not supplied, the max will be implicitly set to the end of time.\n   */\n  activeAtTime?: DateRange;\n  /**\n   * Return only the resource matching the specified label constraints\n   */\n  labels?: LabelFilter;\n}\n\nexport interface RevealNode3D extends Node3D {\n  /**\n   * The sector the node is contained in.\n   */\n  sectorId: CogniteInternalId;\n}\n\nexport interface RevealRevision3D extends Revision3D {\n  sceneThreedFiles: Versioned3DFile[];\n}\n\nexport interface RevealSector3D {\n  /**\n   * The id of the sector.\n   */\n  id: CogniteInternalId;\n  /**\n   * The parent of the sector, null if it is the root sector.\n   */\n  parentId: CogniteInternalId;\n  /**\n   * String representing the path to the sector: 0/2/6/ etc.\n   */\n  path: string;\n  /**\n   * The depth of the sector in the sector tree, starting from 0 at the root sector.\n   */\n  depth: number;\n  /**\n   * The bounding box of the subtree with this sector as the root sector. Is null if there are no geometries in the subtree.\n   */\n  boundingBox: BoundingBox3D;\n  /**\n   * The file ID of the data file for this sector, with multiple versions supported. Use /3d/files/{id} to retrieve the file.\n   */\n  threedFiles: Versioned3DFile[];\n}\n\nexport interface Revision3D {\n  /**\n   * The ID of the revision.\n   */\n  id: CogniteInternalId;\n  /**\n   * The file id.\n   */\n  fileId: CogniteInternalId;\n  /**\n   * True if the revision is marked as published.\n   */\n  published: boolean;\n  /**\n   * Global rotation to be applied to the entire model.\n   * The rotation is expressed by Euler angles in radians and in XYZ order.\n   */\n  rotation?: Tuple3<number>;\n  /**\n   * Global translation to be applied to the entire model.\n   * The translation is expressed in meters.\n   */\n  translation?: Tuple3<number>;\n  /**\n   * Global scale to be applied to the entire model.\n   * The scale is expressed as scale along the X, Y and Z axes.\n   */\n  scale?: Tuple3<number>;\n  camera?: RevisionCameraProperties;\n  /**\n   * The status of the revision.\n   */\n  status: Revision3DStatus;\n  /**\n   * The threed file ID of a thumbnail for the revision.\n   * Use /3d/files/{id} to retrieve the file.\n   */\n  thumbnailThreedFileId?: number;\n  /**\n   * The URL of a thumbnail for the revision.\n   */\n  thumbnailURL?: string;\n  /**\n   * The number of asset mappings for this revision.\n   */\n  assetMappingCount: number;\n  /**\n   *\n   */\n  createdTime: Date;\n  metadata?: Metadata;\n}\n\nexport interface Revision3DListRequest extends Limit {\n  /**\n   * Filter based on whether or not it has published revisions.\n   */\n  published?: boolean;\n}\n\nexport type Revision3DStatus = 'Queued' | 'Processing' | 'Done' | 'Failed';\n\nexport interface RevisionCameraProperties {\n  /**\n   * Initial camera target.\n   */\n  target?: Tuple3<number>;\n  /**\n   * Initial camera position.\n   */\n  position?: Tuple3<number>;\n}\n\nexport type RevisionMetadata = { [key: string]: string };\n\nexport type RevisionMetadataUpdate =\n  | RevisionMetadataUpdateSet\n  | RevisionMetadataUpdateAddRemove;\n\nexport interface RevisionMetadataUpdateSet {\n  set: RevisionMetadata;\n}\n\nexport interface RevisionMetadataUpdateAddRemove {\n  /**\n   * Key/value pairs to add\n   */\n  add?: RevisionMetadata;\n  /**\n   * Keys to remove\n   */\n  remove?: string[];\n}\n\nexport interface SecurityCategory {\n  /**\n   * Name of the security category\n   */\n  name: string;\n  /**\n   * Id of the security category\n   */\n  id: number;\n}\n\nexport interface SecurityCategorySpec {\n  /**\n   * Name of the security category\n   */\n  name: string;\n}\n\n/**\n * Information about the sequence stored in the database\n */\nexport interface Sequence\n  extends SequenceBase,\n    InternalId,\n    CreatedAndLastUpdatedTime {\n  columns: SequenceColumn[];\n}\n\n/**\n * A sequence row values with row number and columns information\n */\nexport interface SequenceRow {\n  rowNumber: number;\n  values: SequenceItem[];\n  columns: SequenceColumnBasicInfo[];\n}\n\ninterface SequenceBase {\n  name?: SequenceName;\n  description?: SequenceDescription;\n  /**\n   * Asset this sequence is associated with\n   */\n  assetId?: CogniteInternalId;\n  dataSetId?: CogniteInternalId;\n  externalId?: CogniteExternalId;\n  metadata?: Metadata;\n}\n\nexport type SequenceChange = SequencePatch & IdEither;\n\n/**\n * Information about a column stored in the database\n */\nexport interface SequenceColumn\n  extends ExternalSequenceColumnBase,\n    InternalId,\n    CreatedAndLastUpdatedTime {\n  valueType: SequenceValueType;\n  externalId?: CogniteExternalId;\n}\n\n/**\n * Information about a column stored in the database\n */\nexport interface SequenceColumnBasicInfo {\n  name?: SequenceColumnName;\n  externalId?: CogniteExternalId;\n  valueType?: SequenceValueType;\n}\n\n/**\n * Description of the column\n */\nexport type SequenceColumnDescription = string;\n\n/**\n *  Human readable name of the column\n */\nexport type SequenceColumnName = string;\n\n/**\n * Description of the sequence\n */\nexport type SequenceDescription = string;\n\nexport interface SequenceFilter {\n  filter?: {\n    name?: SequenceName;\n    externalIdPrefix?: ExternalIdPrefix;\n    metadata?: Metadata;\n    assetIds?: CogniteInternalId[];\n    /**\n     * Only include sequences that have a related asset in a tree rooted at any of these root assetIds.\n     */\n    rootAssetIds?: CogniteInternalId[];\n    dataSetIds?: IdEither[];\n    /**\n     * Only include sequences that have a related asset in a subtree rooted at any of these assetIds.\n     * If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.\n     */\n    assetSubtreeIds?: IdEither[];\n    createdTime?: DateRange;\n    lastUpdatedTime?: DateRange;\n  };\n}\n\n/**\n * Element of type corresponding to the column type. May include NULL!\n */\nexport type SequenceItem = number | string | null;\n\nexport interface SequenceListScope extends SequenceFilter, Limit, Cursor {}\n\n/**\n * Name of the sequence\n */\nexport type SequenceName = string;\n\nexport interface SequencePatch {\n  update: {\n    name?: SinglePatchString;\n    description?: SinglePatchString;\n    assetId?: NullableSinglePatchLong;\n    dataSetId?: NullableSinglePatchLong;\n    externalId?: SinglePatchString;\n    endTime?: SinglePatchDate;\n    metadata?: MetadataPatch;\n  };\n}\n\n/**\n * A single row of datapoints\n */\nexport interface SequenceRowData {\n  /**\n   * The row number for this row\n   */\n  rowNumber: number;\n  /**\n   * List of values in order defined in the columns field\n   * (Number of items must match. Null is accepted for missing values)\n   */\n  values: SequenceItem[];\n}\n\nexport interface SequenceRowsData extends InternalId {\n  externalId?: ExternalId;\n  /**\n   * Column external ids in the same order as the values for each row\n   */\n  columns: string[];\n  /**\n   * List of row information\n   */\n  rows: SequenceRowData[];\n}\n\nexport type SequenceRowsDelete = SequenceRowsDeleteData & IdEither;\n\ninterface SequenceRowsDeleteData {\n  /**\n   * Rows to delete from a sequence\n   */\n  rows: number[];\n}\n\nexport type SequenceRowsInsert = SequenceRowsInsertData & IdEither;\n\n/**\n * Data from a sequence\n */\nexport interface SequenceRowsInsertData {\n  /**\n   * Column external ids in the same order as the values for each row\n   */\n  columns: string[];\n  /**\n   * List of row information\n   */\n  rows: SequenceRowData[];\n}\n\nexport interface SequenceRowsResponseData extends InternalId {\n  externalId?: ExternalId;\n  columns: SequenceColumnBasicInfo[];\n  rows: SequenceRowData[];\n  nextCursor?: string;\n}\n\n/**\n * A request for datapoints stored\n */\nexport type SequenceRowsRetrieve = SequenceRowsRetriveData & IdEither;\n\ninterface SequenceRowsRetriveData extends Cursor, Limit {\n  /**\n   * Lowest row number included.\n   * @default 0\n   */\n  start?: number;\n  /**\n   * Get rows up to, but excluding, this row number.\n   * @default \"no limit\"\n   */\n  end?: number;\n  /**\n   * Columns to be included. Specified as list of column externalIds.\n   * In case this filter is not set, all available columns will be returned.\n   */\n  columns?: string[];\n}\n\nexport interface SequenceSearchFilter extends SequenceFilter {\n  search?: {\n    name?: SequenceName;\n    description?: SequenceDescription;\n    /**\n     * Search on name and description using wildcard search on each of the words (separated by spaces).\n     * Retrieves results where at least one word must match. Example: '*some* *other*'\n     */\n    query?: string;\n  };\n}\n\nexport const SequenceValueType = {\n  STRING: 'STRING' as SequenceValueType,\n  DOUBLE: 'DOUBLE' as SequenceValueType,\n  LONG: 'LONG' as SequenceValueType,\n};\n\n/**\n * What type the datapoints in a column will have.\n * DOUBLE is restricted to the range [-1E100, 1E100]\n * @default STRING\n */\nexport type SequenceValueType = 'STRING' | 'DOUBLE' | 'LONG';\n\nexport interface SetField<T> {\n  set: T;\n}\n\nexport type SingleCogniteCapability =\n  | { groupsAcl: AclGroups }\n  | { assetsAcl: AclAssets }\n  | { eventsAcl: AclEvents }\n  | { filesAcl: AclFiles }\n  | { usersAcl: AclUsers }\n  | { projectsAcl: AclProjects }\n  | { securityCategoriesAcl: AclSecurityCategories }\n  | { rawAcl: AclRaw }\n  | { timeSeriesAcl: AclTimeseries }\n  | { threedAcl: Acl3D }\n  | { sequencesAcl: AclSequences }\n  | { analyticsAcl: AclAnalytics }\n  | { datasetsAcl: AclDataSets }\n  | { templateGroupsAcl: AclTemplateGroups }\n  | { templateInstancesAcl: AclTemplateInstances }\n  | { dataModelAcl: AclDataModel }\n  | { dataModelInstancesAcl: AclDataModelInstances }\n  | { dataProductsAcl: AclDataProducts }\n  | { sessionsAcl: AclSessions };\n\nexport type SinglePatch<T> = { set: T } | { setNull: boolean };\nexport type SinglePatchRequired<T> = { set: T };\n\nexport type SinglePatchDate = { set: Timestamp } | { setNull: boolean };\n\nexport interface SinglePatchRequiredString {\n  set: string;\n}\n\nexport type SinglePatchString = SetField<string> | RemoveField;\n\nexport const SortOrder = {\n  ASC: 'asc' as SortOrder,\n  DESC: 'desc' as SortOrder,\n};\n\n/**\n * Items can be sorted in either ascending or descending order\n */\nexport type SortOrder = 'asc' | 'desc';\n\nexport type Tuple3<T> = T[];\n\nexport type Tuple2<T> = [T, T];\n\nexport type UPDATE = 'UPDATE';\n\nexport interface UnrealRevision3D extends Revision3D {\n  sceneThreedFiles: Versioned3DFile[];\n}\n\nexport interface UpdateModel3D extends UpdateModel3DField, InternalId {}\n\nexport interface UpdateModel3DField {\n  update: {\n    name?: SetField<string>;\n    dataSetId?: NullableSinglePatchLong;\n    metadata?: MetadataPatch;\n  };\n}\n\nexport interface UpdateRevision3D {\n  id: CogniteInternalId;\n  update: {\n    /**\n     * True if the revision is marked as published.\n     */\n    published?: SetField<boolean>;\n    /**\n     * Global rotation to be applied to the entire model.\n     * The rotation is expressed by Euler angles in radians and in XYZ order.\n     */\n    rotation?: SetField<Tuple3<number>>;\n    /**\n     * Global translation to be applied to the entire model.\n     * The translation is expressed in meters.\n     */\n    translation?: SetField<Tuple3<number>>;\n    /**\n     * Global scale to be applied to the entire model.\n     * The scale is expressed as scale along the X, Y and Z axes.\n     */\n    scale?: SetField<Tuple3<number>>;\n    /**\n     * Initial camera target.\n     */\n    camera?: SetField<RevisionCameraProperties>;\n    /**\n     * Revision metadata.\n     */\n    metadata?: RevisionMetadataUpdate;\n  };\n}\n\nexport interface FileUploadResponse extends FileInfo {\n  uploadUrl: string;\n}\n\n/**\n * The url name of the project. This is used as part of API calls. It should only contain letters, digits and hyphens, as long as the hyphens are not at the start or end.\n * @example publicdata\n */\nexport type UrlName = string;\n\n/**\n * The file ID of the data file for this resource, with multiple versions supported.\n * Use /3d/files/{id} to retrieve the file.\n */\nexport interface Versioned3DFile {\n  /**\n   * Version of the file format.\n   */\n  version: number;\n  /**\n   * File ID. Use /3d/files/{id} to retrieve the file.\n   */\n  fileId: CogniteInternalId;\n}\n\nexport type WRITE = 'WRITE';\n\nexport type WRITE_PROPERTIES = 'WRITE_PROPERTIES';\n\nexport type ContextJobStatus = 'QUEUED' | 'RUNNING' | 'COMPLETED' | 'FAILED';\n\nexport const ContextJobStatus = {\n  QUEUED: 'QUEUED' as ContextJobStatus,\n  RUNNING: 'RUNNING' as ContextJobStatus,\n  COMPLETED: 'COMPLETED' as ContextJobStatus,\n  FAILED: 'FAILED' as ContextJobStatus,\n};\n\n/**\n * Contextualization job ID.\n */\nexport type ContextJobId = number;\n\nexport interface EntityMatchingResponseBase {\n  /**\n   * User defined name of the model.\n   */\n  name: string;\n  /**\n   * User defined description of the model\n   */\n  description: string;\n  /**\n   * The status of the job.\n   */\n  status: ContextJobStatus;\n  createdTime: Date;\n  startTime: Date;\n  statusTime: Date;\n}\n\nexport interface ExternalEntityToMatch {\n  id?: CogniteInternalId;\n  externalId?: CogniteExternalId;\n  [key: string]: string | number | undefined;\n}\n\nexport type EntityMatchingFeatureType =\n  | 'simple'\n  | 'bigram'\n  | 'frequencyweightedbigram'\n  | 'bigramextratokenizers'\n  | 'bigramcombo';\n\nexport const EntityMatchingFeatureType = {\n  SIMPLE: 'simple' as EntityMatchingFeatureType,\n  BIGRAM: 'bigram' as EntityMatchingFeatureType,\n  FREQUENCY_WEIGHTED_BIGRAM:\n    'frequencyweightedbigram' as EntityMatchingFeatureType,\n  BIGRAM_EXTRA_TOKENIZERS: 'bigramextratokenizers' as EntityMatchingFeatureType,\n  BIGRAM_COMBO: 'bigramcombo' as EntityMatchingFeatureType,\n};\n\nexport type EntityMatchingClassifier =\n  | 'randomforest'\n  | 'decisiontree'\n  | 'logisticregression'\n  | 'augmentedlogisticregression'\n  | 'augmentedrandomforest';\n\nexport const EntityMatchingClassifier = {\n  RANDOM_FOREST: 'randomforest' as EntityMatchingClassifier,\n  DECISION_TREE: 'decisiontree' as EntityMatchingClassifier,\n  LOGISTIC_REGRESSION: 'logisticregression' as EntityMatchingClassifier,\n  AUGMENTED_LOGISTIC_REGRESSION:\n    'augmentedlogisticregression' as EntityMatchingClassifier,\n  AUGMENTED_RANDOM_FOREST: 'augmentedrandomforest' as EntityMatchingClassifier,\n};\n\nexport interface EntityMatchingField {\n  from: string;\n  to: string;\n}\n\nexport type ExternalEntityTrueMatch = ExternalEntityTrueMatchSource &\n  ExternalEntityTrueMatchTarget;\n\ntype ExternalEntityTrueMatchSource =\n  | {\n      /**\n       * The id for the source object of the match.\n       */\n      sourceId: CogniteInternalId;\n    }\n  | {\n      /**\n       * The external id for the source object of the match.\n       */\n      sourceExternalId: CogniteExternalId;\n    };\n\ntype ExternalEntityTrueMatchTarget =\n  | {\n      /**\n       * The id for the target object of the match.\n       */\n      targetId: CogniteInternalId;\n    }\n  | {\n      /**\n       * The external id for the target object of the match.\n       */\n      targetExternalId: CogniteExternalId;\n    };\n\nexport interface EntityMatchingCreateRequest {\n  /**\n   * List of custom source object to match from, for example, time series. String key -> value. Only string values are considered in the matching. Optional id and/or externalId fields.\n   */\n  sources: ExternalEntityToMatch[];\n  /**\n   * List of custom target object to match to, for example, assets. String key -> value. Only string values are considered in the matching. Optional id and/or externalId fields.\n   */\n  targets: ExternalEntityToMatch[];\n  /**\n   * List of objects of pairs of fromId or fromExternalId and toId or toExternalId, that corresponds to entities in matchFrom and matchTo respectively, that indicates a confirmed match used to train the model. If omitted, an unsupervised model is used.\n   */\n  trueMatches?: ExternalEntityTrueMatch[];\n  externalId?: CogniteExternalId;\n  /**\n   * User defined name of the model.\n   */\n  name?: string;\n  /**\n   * User defined description of the model.\n   */\n  description?: string;\n  /**\n   * List of pairs of fields from the target and source items used to calculate features. All source and target items should have all the source and target fields specified here.\n   */\n  matchFields?: EntityMatchingField[];\n  /**\n   * Defines the combination of features used. The options are:\n   * Simple: Calculates a single cosine-distance similarity score for each of the fields defined in keysFromTo. This is the fastest option.\n   * Bigram: Adds similarity score based on the sequence of the terms.\n   * Frequency-Weighted-Bigram: Calculates a similarity score based on the sequence of the terms, giving higher weights to less commonly occurring tokens.\n   * Bigram-Extra-Tokenizers: Similar to bigram, but able to learn that leading zeros and spaces should be ignored in matching.\n   * Bigram-Combo: Calculates all of the above options, relying on the model to determine the appropriate features to use. This is the slowest option.\n   */\n  featureType?: EntityMatchingFeatureType;\n  /**\n   * The classifier used in the model. Only relevant if there are trueMatches/labeled data and a supervised  model is fitted.\n   */\n  classifier?: EntityMatchingClassifier;\n  /**\n   * If True, replaces missing fields in `sources` or `targets` entities, for fields set in set in `matchFields`, with empty strings. Else, returns an error if there are missing data.\n   */\n  ignoreMissingFields?: boolean;\n}\n\nexport interface EntityMatchingCreateResponse\n  extends EntityMatchingResponseBase {\n  id: CogniteInternalId;\n  externalId: CogniteExternalId;\n  /**\n   * Defines the combination of features used in the entity matcher model.\n   */\n  featureType?: EntityMatchingFeatureType;\n  /**\n   * Name of the classifier used in the model, \"Unsupervised\" if unsupervised model.\n   */\n  classifier?: EntityMatchingClassifier;\n  /**\n   * If True, missing fields in sources or targets entities set in matchFields, are replaced with empty strings.\n   */\n  ignoreMissingFields?: boolean;\n  /**\n   * List of pairs of fields from the target and source items used to calculate features. All source and target items should have all the source and target fields specified here.\n   */\n  matchFields?: EntityMatchingField[];\n  /**\n   * The ID of original model, only relevant when the model is a retrained model.\n   */\n  originalId?: CogniteInternalId;\n}\n\nexport interface EntityMatchingModel extends EntityMatchingResponseBase {\n  id: CogniteInternalId;\n  externalId: CogniteExternalId;\n  /**\n   * Defines the combination of features used in the entity matcher model.\n   */\n  featureType?: EntityMatchingFeatureType;\n  /**\n   * Name of the classifier used in the model, \"Unsupervised\" if unsupervised model.\n   */\n  classifier?: EntityMatchingClassifier;\n  /**\n   * Array of objects (MatchFields) List of pairs of fields from the target and source items used to calculate features. All source and target items should have all the source and target fields specified here.\n   */\n  matchFields?: EntityMatchingField[];\n  /**\n   * The ID of original model, only relevant when the model is a retrained model.\n   */\n  originalId?: number;\n}\n\nexport type EntityMatchingChange = IdEither & EntityMatchingPatch;\n\nexport interface EntityMatchingPatch {\n  update: {\n    /**\n     * Set a new value for the model name.\n     */\n    name?: SinglePatchString;\n    /**\n     * Set a new value for the model description.\n     */\n    description: SinglePatchString;\n  };\n}\n\nexport type EntityMatchingPredictRequest = IdEither &\n  EntityMatchingPredictRequestBase;\n\ninterface EntityMatchingPredictRequestBase {\n  /**\n   * List of source entities to predict matches for, for example, time series. If omitted, will use data source fit.\n   */\n  sources?: ExternalEntityToMatch[];\n  /**\n   * LList of potential target entities to match to one or more of the source entities, for example, assets. If omitted, will use data from fit.\n   */\n  targets?: ExternalEntityToMatch[];\n  /**\n   * The maximum number of results to return for each matchFrom.\n   */\n  numMatches?: number;\n  /**\n   * Only return matches with score above this threshold.\n   */\n  scoreThreshold?: number;\n}\n\nexport interface EntityMatchingPredictResponse\n  extends EntityMatchingResponseBase {\n  /**\n   * Contextualization job ID.\n   */\n  jobId: number;\n}\n\nexport type EntityMatchingRefitRequest = IdEither &\n  EntityMatchingRefitRequestBase;\n\ninterface EntityMatchingRefitRequestBase {\n  /**\n   * External ID for the new refitted model provided by client. Should be unique within the project.\n   */\n  newExternalId?: CogniteExternalId;\n  /**\n   * List of additional confirmed matches used to train the model. The new model uses a combination of this and trueMatches from the orginal model. If there are identical match-from ids, the pair from the original model is dropped.\n   */\n  trueMatches: ExternalEntityTrueMatch[];\n  /**\n   * List of source entities, for example, time series. If omitted, will use data from fit.\n   */\n  sources?: ExternalEntityToMatch[];\n  /**\n   * List of target entities, for example, assets. If omitted, will use data from fit.\n   */\n  targets?: ExternalEntityToMatch[];\n}\n\nexport interface EntityMatchingRefitResponse\n  extends EntityMatchingResponseBase {\n  id: CogniteInternalId;\n  externalId: CogniteExternalId;\n  /**\n   * Defines the combination of features used in the entity matcher model.\n   */\n  featureType: EntityMatchingFeatureType;\n  /**\n   * Name of the classifier used in the model, \"Unsupervised\" if unsupervised model.\n   */\n  classifier: EntityMatchingClassifier;\n  /**\n   * If True, missing fields in sources or targets entities set in matchFields, are replaced with empty strings.\n   */\n  ignoreMissingFields?: boolean;\n  /**\n   * List of pairs of fields from the target and source items used to calculate features. All source and target items should have all the source and target fields specified here.\n   */\n  matchFields?: EntityMatchingField[];\n  /**\n   * The ID of original model, only relevant when the model is a retrained model.\n   */\n  originalId: CogniteInternalId;\n}\n\nexport interface EntityMatchingPredictions {\n  jobId: ContextJobId;\n  /**\n   * The status of the job.\n   */\n  status: ContextJobStatus;\n  /**\n   * List of matched entities with confidence score.\n   */\n  items: EntityMatchingPrediction[];\n}\n\nexport interface EntityMatchingPrediction {\n  /**\n   * The matchFrom item given to predict.\n   */\n  matchFrom: ExternalEntityToMatch;\n  /**\n   * Matched items, sorted from highest score to lowest. May be empty.\n   */\n  matches: EntityMatchingPredictedItem[];\n}\n\nexport interface EntityMatchingPredictedItem {\n  /**\n   * The matchTo item given to predict.\n   */\n  matchTo: ExternalEntityToMatch;\n  /**\n   * The model's confidence in the match.\n   */\n  score: number;\n}\n\nexport interface EntityMatchingFilter {\n  /**\n   * User defined name of the model.\n   */\n  name?: string;\n  /**\n   * User defined description of the model.\n   */\n  description?: string;\n  /**\n   * The feature type used to fit the model.\n   */\n  featureType?: EntityMatchingFeatureType;\n  /**\n   * Name of the classifier supervised model, \"Unsupervised\" if unsupervised model\n   */\n  classifier?: string;\n  /**\n   * List of pairs of fields from the matchTo and matchFrom items used to create features.\n   */\n  matchFields?: EntityMatchingField[];\n  /**\n   * The ID of original model, only relevant when the model is a retrained model.\n   */\n  originalModelId?: CogniteInternalId;\n}\n\nexport interface EntityMatchingFilterRequest extends FilterQuery {\n  filter?: EntityMatchingFilter;\n}\n\nexport type Source =\n  | EventsSource\n  | AssetsSource\n  | SequencesSource\n  | TimeSeriesSource\n  | FilesSource;\n\ntype ObjectOrString<T> = { [K in keyof T]: ObjectOrString<T[K]> | string };\n\nexport type EventsSource = {\n  type: 'events';\n  filter?: ObjectOrString<EventFilter>;\n  mappings?: { [K in string]: string };\n};\n\nexport type AssetsSource = {\n  type: 'assets';\n  filter?: ObjectOrString<AssetFilterProps>;\n  mappings?: { [K in string]: string };\n};\n\nexport type SequencesSource = {\n  type: 'sequences';\n  filter?: ObjectOrString<SequenceFilter>;\n  mappings?: { [K in string]: string };\n};\n\nexport type TimeSeriesSource = {\n  type: 'timeSeries';\n  filter?: ObjectOrString<TimeSeriesFilter>;\n  mappings?: { [K in string]: string };\n};\n\nexport type FilesSource = {\n  type: 'files';\n  filter?: ObjectOrString<FileFilter>;\n  mappings?: { [K in string]: string };\n};\n\nexport type ExternalView = {\n  externalId: string;\n  source: Source;\n  dataSetId?: number;\n};\n\nexport type View = ExternalView & {\n  createdTime: Timestamp;\n  lastUpdatedTime: Timestamp;\n};\n\nexport type ViewFilterQuery = FilterQuery;\n\nexport interface ViewResolveRequest extends FilterQuery {\n  externalId: string;\n  input?: { [K in string]: unknown };\n  cursor?: string;\n  limit?: number;\n}\n\nexport interface ExternalTemplateGroup extends ExternalId {\n  /**\n   * The externalId of a Template Group\n   */\n  externalId: CogniteExternalId;\n\n  /**\n   * The description of a Template Group\n   */\n  description?: string;\n\n  /**\n   * The owners of a Template Group\n   */\n  owners?: string[];\n\n  /**\n   * The dataSetId of the template group\n   */\n  dataSetId?: number;\n}\n\nexport type TemplateGroup = ExternalTemplateGroup & {\n  /**\n   * The owners of a Template Group\n   */\n  owners: string[];\n\n  /**\n   * When resource was created\n   */\n  createdTime: Timestamp;\n\n  /**\n   * When resource was last updated\n   */\n  lastUpdatedTime: Timestamp;\n};\n\nexport interface TemplateGroupFilter {\n  /**\n   * Filter on owners.\n   */\n  owners?: string[];\n\n  /**\n   * Filter on dataSetIds\n   */\n  dataSetIds?: number[];\n}\n\nexport interface TemplateGroupFilterQuery extends FilterQuery {\n  filter?: TemplateGroupFilter;\n}\n\nexport interface TemplateGroupVersion {\n  version: number;\n  schema: string;\n\n  /**\n   * When resource was created\n   */\n  createdTime: Timestamp;\n\n  /**\n   * When resource was last updated\n   */\n  lastUpdatedTime: Timestamp;\n}\n\nexport enum ConflictMode {\n  /** Patch the existing version, but will fail if there are breaking changes. */\n  Patch = 'Patch',\n  /** Update the Template Group by bumping the version. */\n  Update = 'Update',\n  /** Force update the existing version even if there are breaking changes. Note, this can break consumers of that version. */\n  Force = 'Force',\n}\n\nexport interface ExternalTemplateGroupVersion {\n  schema: string;\n  /** Specifies the conflict mode to use. By default the mode is 'ConflictMode.Patch'.*/\n  conflictMode?: ConflictMode;\n  version?: number;\n}\n\nexport interface TemplateGroupVersionFilter extends FilterQuery {\n  minVersion?: number;\n  maxVersion?: number;\n}\n\nexport interface TemplateGroupVersionFilterQuery extends FilterQuery {\n  filter?: TemplateGroupVersionFilter;\n}\n\nexport interface ExternalTemplateInstance extends ExternalId {\n  templateName: string;\n  dataSetId?: number;\n  fieldResolvers: { [K in string]: FieldResolver | object };\n}\n\nexport type TemplateInstance = ExternalTemplateInstance & {\n  /**\n   * When resource was created\n   */\n  createdTime: Timestamp;\n\n  /**\n   * When resource was last updated\n   */\n  lastUpdatedTime: Timestamp;\n};\n\nexport interface TemplateInstancePatch extends ExternalId {\n  update: {\n    fieldResolvers: ObjectPatch<FieldResolver | object>;\n  };\n}\n\nexport interface FieldResolver {\n  type: string;\n}\n\nexport class ConstantResolver implements FieldResolver {\n  type = 'constant';\n  value: object;\n\n  constructor(value: object) {\n    this.value = value;\n  }\n}\n\nexport class RawResolver implements FieldResolver {\n  type = 'raw';\n  dbName: string;\n  tableName: string;\n  rowKey?: string;\n  columnName?: string;\n\n  constructor(\n    dbName: string,\n    tableName: string,\n    rowKey?: string,\n    columnName?: string\n  ) {\n    this.dbName = dbName;\n    this.tableName = tableName;\n    this.rowKey = rowKey;\n    this.columnName = columnName;\n  }\n}\n\nexport class SyntheticTimeSeriesResolver implements FieldResolver {\n  type = 'syntheticTimeSeries';\n  expression: string;\n  name?: string;\n  metadata?: { [K in string]: string };\n  description?: string;\n  isStep?: boolean;\n  isString?: boolean;\n  unit?: string;\n\n  constructor(\n    expression: string,\n    name?: string,\n    metadata?: { [K in string]: string },\n    description?: string,\n    isStep?: boolean,\n    isString?: boolean,\n    unit?: string\n  ) {\n    this.expression = expression;\n    this.name = name;\n    this.metadata = metadata;\n    this.description = description;\n    this.isStep = isStep;\n    this.isString = isString;\n    this.unit = unit;\n  }\n}\n\nexport class ViewResolver implements FieldResolver {\n  type = 'view';\n  externalId: string;\n  input: { [K in string]: unknown };\n\n  constructor(externalId: string, input: { [K in string]: unknown }) {\n    this.externalId = externalId;\n    this.input = input;\n  }\n}\n\nexport interface TemplateInstanceFilter {\n  dataSetIds?: number[];\n  templateNames?: string[];\n}\n\nexport interface TemplateInstanceFilterQuery extends FilterQuery {\n  filter?: TemplateInstanceFilter;\n}\n\nexport type GraphQlResponse = {\n  data: unknown;\n  errors: GraphQlError[];\n};\n\nexport type GraphQlError = {\n  message: string;\n  path: string[];\n  locations: { line: number; column: number }[];\n};\n\nexport interface RelationshipsRetrieveParams extends IgnoreUnknownIds {\n  /**\n   * If true, will try to fetch the resources referred to in the relationship,\n   * based on the users access rights. Will silently fail to attatch the resources\n   * if the user lacks access to some of them.\n   */\n  fetchResources?: boolean;\n}\n\nexport type AnnotatedResourceType = 'file' | 'threedmodel';\nexport type AnnotationStatus = 'suggested' | 'approved' | 'rejected';\n\n// TODO [CXT-463] Use annotation-types package definitions\nexport type AnnotationType = string;\n\nexport interface AnnotationModel extends AnnotationCreate {\n  id: CogniteInternalId;\n  createdTime: Date;\n  lastUpdatedTime: Date;\n}\n\nexport interface AnnotationCreate extends AnnotationSuggest {\n  status: AnnotationStatus;\n}\n\nexport interface AnnotationSuggest {\n  annotatedResourceType: AnnotatedResourceType;\n  annotatedResourceId: CogniteInternalId;\n  annotationType: AnnotationType;\n  creatingApp: string;\n  creatingAppVersion: string;\n  creatingUser: string | null;\n  data: AnnotationData;\n}\n\nexport interface AnnotationChangeById extends InternalId, AnnotationUpdate {}\n\nexport interface AnnotationUpdate {\n  update: {\n    annotationType?: SetField<AnnotationType>;\n    data?: SetField<AnnotationData>;\n    status?: SetField<AnnotationStatus>;\n  };\n}\nexport interface AnnotationFilterRequest\n  extends AnnotationFilter,\n    FilterQuery {}\nexport interface AnnotationFilter {\n  filter: AnnotationFilterProps;\n}\n\nexport interface AnnotationFilterProps {\n  annotatedResourceType: AnnotatedResourceType;\n  annotatedResourceIds: IdEither[];\n  annotationType?: AnnotationType;\n  creatingApp?: string;\n  creatingAppVersion?: string;\n  creatingUser?: string | null;\n  status?: AnnotationStatus;\n  data?: Partial<AnnotationData>;\n}\n\nexport interface AnnotationReverseLookupRequest\n  extends AnnotationReverseLookupFilter,\n    FilterQuery {}\n\nexport interface AnnotationReverseLookupFilter {\n  filter: AnnotationReverseLookupFilterProps;\n}\n\nexport interface AnnotationReverseLookupFilterProps {\n  annotatedResourceType: AnnotatedResourceType;\n  annotationType?: AnnotationType;\n  creatingApp?: string;\n  creatingAppVersion?: string;\n  creatingUser?: string;\n  status?: AnnotationStatus;\n  data?: Record<string, unknown>;\n}\n\nexport interface Unit {\n  externalId: CogniteExternalId;\n  name: string;\n  longName: string;\n  symbol: string;\n  aliasNames: string[];\n  quantity: string;\n  conversion: UnitConversion;\n  source?: string;\n  sourceReference?: string;\n}\n\nexport interface UnitConversion {\n  multiplier: number;\n  offset: number;\n}\n\nexport interface UnitSystemQuantity {\n  name: string;\n  unitExternalId: CogniteExternalId;\n}\n\nexport interface UnitSystem {\n  name: string;\n  quantities: UnitSystemQuantity[];\n}\nexport interface MultiPartFileUploadResponse extends FileInfo {\n  uploadUrls: string[];\n  uploadId: string;\n}\n\nexport interface MultiPartFileChunkResponse {\n  partNumber: number;\n  status: number;\n}\n\nexport interface UnitDMSUniqueIdentifier {\n  space: string;\n  externalId: string;\n}\n\nexport type {\n  BtreeIndex,\n  ConstraintDefinition,\n  ContainerCollectionResponse,\n  ContainerCollectionResponseWithCursorResponse,\n  ContainerCorePropertyDefinition,\n  ContainerCreateCollection,\n  ContainerCreateDefinition,\n  ContainerDefinition,\n  ContainerInspectRequest,\n  ContainerInspectResponse,\n  ContainerInspectResultItem,\n  ContainerPropertyDefinition,\n  IndexDefinition,\n  InvertedIndex,\n  ListOfContainerSubObjectIdentifierRequest,\n  ListOfContainerSubObjectIdentifierResponse,\n  ListOfSpaceExternalIdsRequest,\n  ListOfSpaceExternalIdsResponse,\n  RequiresConstraintDefinition,\n  SpaceQueryParameter,\n  UniquenessConstraintDefinition,\n} from './api/containers/types.gen';\n\nexport type {\n  AggregatedHistogramValue,\n  AggregatedNumberValue,\n  AggregatedResultItem,\n  AggregatedResultItemCollection,\n  AggregatedValueItem,\n  AggregationDefinition,\n  AggregationRequest,\n  // Backwards compatibility with service-contracts, remove in next major version\n  AggregationRequest as ViewAggregationRequest,\n  // Backwards compatibility with service-contracts, remove in next major version\n  ByIdsResponse as NodeAndEdgeCollectionResponseV3Response,\n  AggregationResponse,\n  AvgAggregateFunctionV3,\n  ByIdsResponse,\n  CDFExternalIdReference,\n  CommonAggregationRequest,\n  ContainerReference,\n  ContainsAllFilterV3,\n  ContainsAnyFilterV3,\n  CorePropertyDefinition,\n  CountAggregateFunctionV3,\n  DMSExistsFilter,\n  DMSExternalId,\n  DMSFilterProperty,\n  DMSVersion,\n  DataModelsBoolFilter,\n  DataModelsLeafFilter,\n  DataModelsNestedFilter,\n  DirectNodeRelation,\n  DirectRelationReference,\n  EdgeDefinition,\n  EdgeOrNodeData,\n  EdgeWrite,\n  EnumProperty,\n  EnumValueProperties,\n  EqualsFilterV3,\n  FilterDefinition,\n  FilterValue,\n  FilterValueList,\n  FilterValueRange,\n  HasExistingDataFilterV3,\n  HistogramAggregateFunctionV3,\n  InFilterV3,\n  IncludeTyping,\n  InstanceInspectRequest,\n  InstanceInspectResponse,\n  InstanceInspectResultItem,\n  InstanceReferenceFilterV3,\n  InstanceType,\n  LimitWithDefault1000,\n  ListOfSpaceExternalIdsRequestWithTyping,\n  MatchAllFilter,\n  MaxAggregateFunctionV3,\n  MinAggregateFunctionV3,\n  NextCursorV3,\n  NodeAndEdgeCollectionResponseWithCursorV3Response,\n  NodeAndEdgeCreateCollection,\n  NodeDefinition,\n  NodeOrEdge,\n  NodeOrEdgeCreate,\n  NodeOrEdgeDeleteRequest,\n  NodeOrEdgeDeleteResponse,\n  NodeOrEdgeExternalId,\n  NodeOrEdgeListRequestV3,\n  NodeOrEdgeSearchRequest,\n  NodeTableExpressionThrough,\n  NodeWrite,\n  OverlapsFilterV3,\n  ParameterizedPropertyValueV3,\n  PrefixFilterV3,\n  PrimitiveProperty,\n  PropertyIdentifierV3,\n  PropertySortV3,\n  PropertyValueGroupV3,\n  QueryEdgeTableExpressionV3,\n  QueryIntersectionTableExpressionV3,\n  QueryNodeTableExpressionV3,\n  QueryRequest,\n  QueryResponse,\n  QuerySelectV3,\n  QuerySetOperationTableExpressionV3,\n  QueryTableExpressionV3,\n  QueryUnionAllTableExpressionV3,\n  QueryUnionTableExpressionV3,\n  RangeFilterV3,\n  RangeValue,\n  RawPropertyValueListV3,\n  RawPropertyValueV3,\n  ReferencedPropertyValueV3,\n  SearchRequestV3,\n  SearchResponse,\n  SearchSort,\n  SlimEdgeDefinition,\n  SlimNodeAndEdgeCollectionResponse,\n  SlimNodeDefinition,\n  SlimNodeOrEdge,\n  SortV3,\n  SourceReference,\n  SourceSelectorV3,\n  SourceSelectorWithoutPropertiesV3,\n  SpaceSpecification,\n  SumAggregateFunctionV3,\n  SyncEdgeTableExpressionV3,\n  SyncNodeTableExpressionV3,\n  SyncRequest,\n  SyncSelectV3,\n  SyncTableExpressionV3,\n  TableExpressionChainToDefinition,\n  TableExpressionContainsAllFilterV3,\n  TableExpressionContainsAnyFilterV3,\n  TableExpressionDataModelsBoolFilter,\n  TableExpressionEqualsFilterV3,\n  TableExpressionFilterDefinition,\n  TableExpressionFilterValue,\n  TableExpressionFilterValueList,\n  TableExpressionFilterValueRange,\n  TableExpressionInFilterV3,\n  TableExpressionLeafFilter,\n  TableExpressionOverlapsFilterV3,\n  TableExpressionPrefixFilterV3,\n  TableExpressionQueryLimit,\n  TableExpressionRangeFilterV3,\n  TableExpressionSyncLimit,\n  TargetUnit,\n  TargetUnits,\n  TextProperty,\n  TypeInformation,\n  TypeInformationOuter,\n  TypePropertyDefinition,\n  TypingViewOrContainer,\n  UnitReference,\n  UnitSystemReference,\n  UpsertConflict,\n  ViewCorePropertyDefinition,\n  ViewDirectNodeRelation,\n  ViewOrContainer,\n  ViewPropertyReference,\n  ViewReference,\n} from './api/instances/types.gen';\n\nexport type {\n  AllVersionsQueryParameter,\n  ByExternalIdsDataModelsRequest,\n  ConnectionDefinition,\n  ConnectionDefinitionRead,\n  CreateViewProperty,\n  CursorQueryParameter,\n  DataModel,\n  DataModelCollectionResponse,\n  DataModelCollectionResponseWithCursorResponse,\n  DataModelCore,\n  DataModelCreate,\n  DataModelCreateCollection,\n  DataModelCreateProperty,\n  DataModelProperty,\n  EdgeConnection,\n  IncludeGlobalQueryParameter,\n  InlineViewsQueryParameter,\n  ListOfAllVersionsReferences,\n  ListOfVersionReferences,\n  ReducedLimitQueryParameter,\n  ReverseDirectRelationConnection,\n  ReverseDirectRelationConnectionRead,\n  ThroughReference,\n  UsedFor,\n  VersionReferencesCollectionResponse,\n  ViewCommon,\n  ViewCreateDefinition,\n  ViewCreateDefinitionProperty,\n  ViewDefinition,\n  ViewDefinitionProperty,\n  ViewPropertyDefinition,\n} from './api/models/types.gen';\n\nexport type {\n  ByExternalIdsViewsRequest,\n  IncludeInheritedPropertiesQueryParameter,\n  ViewCollectionResponse,\n  ViewCollectionResponseWithCursorResponse,\n  ViewCreateCollection,\n} from './api/views/types.gen';\n","// Copyright 2020 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type ExternalId,\n} from '@cognite/sdk-core';\nimport fromPairs from 'lodash/fromPairs';\nimport toPairs from 'lodash/toPairs';\nimport {\n  ConstantResolver,\n  type ExternalTemplateInstance,\n  type FieldResolver,\n  RawResolver,\n  SyntheticTimeSeriesResolver,\n  type TemplateInstance,\n  type TemplateInstanceFilterQuery,\n  type TemplateInstancePatch,\n  ViewResolver,\n} from '../../types';\n\nexport class TemplateInstancesApi extends BaseResourceAPI<TemplateInstance> {\n  /**\n   * [Create Template Instances](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsVersionInstances)\n   *\n   * ```js\n   * const instances = [\n   *   { externalId: 'Well_a', templateName: \"Well\", fieldResolvers: { name: \"Underwater P23\", pressure: \"21_PT19\" } },\n   *   { externalId: 'Well_b', templateName: \"Well\", fieldResolvers: { name: \"Underwater P01\" } },\n   * ];\n   * const createdInstances = await client.templates.group(\"myGroup\").version(1).create(instances);\n   * ```\n   */\n  public create = (\n    items: ExternalTemplateInstance[]\n  ): Promise<TemplateInstance[]> => {\n    return super\n      .createEndpoint(TemplateInstanceCodec.encodeTemplateInstances(items))\n      .then(TemplateInstanceCodec.decodeTemplateInstances);\n  };\n\n  /**\n   * [Upsert Template Instances](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsVersionInstancesUpsert)\n   *\n   * ```js\n   * const instances = [\n   *   { externalId: \"Well_a\", templateName: \"Well\", fieldResolvers: { name: \"Underwater P23\", pressure: \"21_PT19\" } },\n   *   { externalId: \"Well_b\", templateName: \"Well\", fieldResolvers: { name: \"Underwater P01\" } },\n   * ];\n   * const createdInstances = await client.templates.group(\"myGroup\").version(1).upsert(instances);\n   * ```\n   */\n  public upsert = (\n    items: ExternalTemplateInstance[]\n  ): Promise<TemplateInstance[]> => {\n    return super\n      .createEndpoint(\n        TemplateInstanceCodec.encodeTemplateInstances(items),\n        this.url('upsert')\n      )\n      .then(TemplateInstanceCodec.decodeTemplateInstances);\n  };\n\n  /**\n   * [Update Template Instances](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsVersionInstancesUpdate)\n   *\n   * ```js\n   * const instances = await client.templates.group(\"myGroup\").version(1).update( [{ update: {\n   *   fieldResolvers: {\n   *     set: {\n   *       myStringField: \"My Field\"\n   *     }\n   *   }\n   * }, externalId: 'someExtId' }] );\n   * ```\n   */\n  public update = (changes: TemplateInstancePatch[]) => {\n    return super\n      .updateEndpoint(changes.map(TemplateInstanceCodec.encodePatch))\n      .then(TemplateInstanceCodec.decodeTemplateInstances);\n  };\n\n  /**\n   * [Retrieve Template Instances](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsVersionInstancesByids)\n   *\n   * ```js\n   * const instances = await client.templates.group(\"myGroup\").version(1).retrieve([ { externalId: 'Well } ]);\n   * ```\n   */\n  public retrieve = (\n    ids: ExternalId[],\n    options?: { ignoreUnknownIds: boolean }\n  ) => {\n    return super\n      .retrieveEndpoint(ids, options || { ignoreUnknownIds: false })\n      .then(TemplateInstanceCodec.decodeTemplateInstances);\n  };\n\n  /**\n   * [List Template Instances](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsVersionInstancesList)\n   *\n   * ```js\n   * const instances = await client.templates.group(\"myGroup\").version(1).list( { templateNames: [\"Well\"] } );\n   * ```\n   */\n  public list = (\n    query?: TemplateInstanceFilterQuery\n  ): CursorAndAsyncIterator<TemplateInstance> => {\n    return super.listEndpoint(async (scope) => {\n      const res = await this.callListEndpointWithPost(scope);\n      return {\n        ...res,\n        data: {\n          ...res.data,\n          items: TemplateInstanceCodec.decodeTemplateInstances(res.data.items),\n        },\n      };\n    }, query);\n  };\n\n  /**\n   * [Delete Template Instances](https://pr-1202.specs.preview.cogniteapp.com/v1.json.html#operation/postApiV1ProjectsProjectTemplategroupsExternalidVersionsVersionInstancesDelete)\n   *\n   * ```js\n   * const instances = await client.templates.group(\"myGroup\").version(1).delete([{ externalId: [\"Well_a\"] }]);\n   * ```\n   */\n  public delete = (\n    ids: ExternalId[],\n    options?: { ignoreUnknownIds: boolean }\n  ) => {\n    return super.deleteEndpoint(\n      ids,\n      options || {\n        ignoreUnknownIds: false,\n      }\n    );\n  };\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass: not worth changing\nclass TemplateInstanceCodec {\n  static encodeTemplateInstances(\n    templateInstances: ExternalTemplateInstance[]\n  ): ExternalTemplateInstance[] {\n    return templateInstances.map((item) => {\n      return {\n        ...item,\n        fieldResolvers: TemplateInstanceCodec.encodeFieldResolvers(\n          item.fieldResolvers\n        ),\n      };\n    });\n  }\n\n  static encodePatch(patch: TemplateInstancePatch): TemplateInstancePatch {\n    return {\n      ...patch,\n      update: {\n        fieldResolvers: {\n          add:\n            'add' in patch.update.fieldResolvers\n              ? TemplateInstanceCodec.encodeFieldResolvers(\n                  patch.update.fieldResolvers.add\n                )\n              : // biome-ignore lint/style/noNonNullAssertion: couldn't find correct type definition.\n                undefined!,\n          remove:\n            'remove' in patch.update.fieldResolvers\n              ? patch.update.fieldResolvers.remove\n              : // biome-ignore lint/style/noNonNullAssertion: couldn't find correct type definition.\n                undefined!,\n          set:\n            'set' in patch.update.fieldResolvers\n              ? TemplateInstanceCodec.encodeFieldResolvers(\n                  patch.update.fieldResolvers.set\n                )\n              : // biome-ignore lint/style/noNonNullAssertion: couldn't find correct type definition.\n                undefined!,\n        },\n      },\n    };\n  }\n\n  static encodeFieldResolvers(\n    fieldResolvers: {\n      [K in string]: FieldResolver | object;\n    }\n  ): { [K in string]: FieldResolver } {\n    const mappedResolvers = toPairs(fieldResolvers).map(\n      ([name, fieldResolver]) => {\n        if (\n          fieldResolver !== undefined &&\n          !TemplateInstanceCodec.isFieldResolver(fieldResolver)\n        ) {\n          // Auto-wrap objects, numbers etc. as ConstantResolver.\n          return [name, new ConstantResolver(fieldResolver)];\n        }\n        return [name, fieldResolver];\n      }\n    );\n\n    return fromPairs(mappedResolvers);\n  }\n\n  static decodeTemplateInstances(\n    templateInstances: TemplateInstance[]\n  ): TemplateInstance[] {\n    return templateInstances.map((item) => {\n      return {\n        ...item,\n        fieldResolvers: TemplateInstanceCodec.decodeFieldResolvers(\n          item.fieldResolvers\n        ),\n      };\n    });\n  }\n\n  static decodeFieldResolvers(\n    fieldResolvers: {\n      [K in string]: FieldResolver | object;\n    }\n  ): { [K in string]: FieldResolver | object } {\n    const mappedResolvers = toPairs(fieldResolvers).map(\n      ([name, fieldResolver]) => {\n        return [\n          name,\n          // biome-ignore lint/suspicious/noExplicitAny: couldn't find correct type definition.\n          TemplateInstanceCodec.decodeFieldResolver(fieldResolver as any),\n        ];\n      }\n    );\n\n    return fromPairs(mappedResolvers);\n  }\n\n  // biome-ignore lint/suspicious/noExplicitAny: couldn't find correct type definition.\n  static decodeFieldResolver(fieldResolver: any): FieldResolver | object {\n    switch (fieldResolver.type) {\n      case 'constant':\n        return fieldResolver.value;\n      case 'raw':\n        return new RawResolver(\n          fieldResolver.dbName,\n          fieldResolver.tableName,\n          fieldResolver.rowKey,\n          fieldResolver.columnName\n        );\n      case 'syntheticTimeSeries':\n        return new SyntheticTimeSeriesResolver(\n          fieldResolver.expression,\n          fieldResolver.name,\n          fieldResolver.metadata,\n          fieldResolver.description,\n          fieldResolver.isStep,\n          fieldResolver.isString,\n          fieldResolver.unit\n        );\n      case 'view':\n        return new ViewResolver(fieldResolver.externalId, fieldResolver.input);\n      default:\n        throw new Error('Unknown field resolver type');\n    }\n  }\n\n  // biome-ignore lint/suspicious/noExplicitAny: couldn't find correct type definition.\n  static isFieldResolver(fieldResolver: any) {\n    return (\n      fieldResolver.type === 'constant' ||\n      fieldResolver.type === 'raw' ||\n      fieldResolver.type === 'syntheticTimeSeries' ||\n      fieldResolver.type === 'view'\n    );\n  }\n}\n","import {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type CursorResponse,\n  type ExternalId,\n} from '@cognite/sdk-core';\nimport type {\n  ExternalView,\n  View,\n  ViewFilterQuery,\n  ViewResolveRequest,\n} from '../../types';\n\nexport class ViewsApi extends BaseResourceAPI<View> {\n  public create = (items: ExternalView[]): Promise<View[]> => {\n    return this.createEndpoint(items);\n  };\n\n  public upsert = (items: ExternalView[]): Promise<View[]> => {\n    return this.createEndpoint(items, this.url('upsert'));\n  };\n\n  public list = (query?: ViewFilterQuery): CursorAndAsyncIterator<View> => {\n    return this.listEndpoint(this.callListEndpointWithPost, query);\n  };\n\n  public resolve = <T>(\n    resolveRequest: ViewResolveRequest\n  ): CursorAndAsyncIterator<T> => {\n    const resolveFetch = async (filter?: ViewResolveRequest) => {\n      const response = await this.post<CursorResponse<ResponseType[]>>(\n        this.url('resolve'),\n        {\n          data: filter || {},\n        }\n      );\n      return response;\n    };\n    return this.listEndpoint(\n      // biome-ignore lint/suspicious/noExplicitAny: didn't manage to type this properly within reasonable time\n      resolveFetch as any,\n      resolveRequest\n    ) as unknown as CursorAndAsyncIterator<T>;\n  };\n\n  public delete = (\n    ids: ExternalId[],\n    options?: { ignoreUnknownIds: boolean }\n  ) => {\n    return super.deleteEndpoint(\n      ids,\n      options || {\n        ignoreUnknownIds: false,\n      }\n    );\n  };\n}\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n  this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  --this.size;\n  return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    ++this.size;\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n    listCacheDelete = require('./_listCacheDelete'),\n    listCacheGet = require('./_listCacheGet'),\n    listCacheHas = require('./_listCacheHas'),\n    listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n  this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  var data = this.__data__,\n      result = data['delete'](key);\n\n  this.size = data.size;\n  return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n  this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  var result = this.has(key) && delete this.__data__[key];\n  this.size -= result ? 1 : 0;\n  return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  this.size += this.has(key) ? 0 : 1;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n    hashDelete = require('./_hashDelete'),\n    hashGet = require('./_hashGet'),\n    hashHas = require('./_hashHas'),\n    hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n    ListCache = require('./_ListCache'),\n    Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.size = 0;\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  var result = getMapData(this, key)['delete'](key);\n  this.size -= result ? 1 : 0;\n  return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  var data = getMapData(this, key),\n      size = data.size;\n\n  data.set(key, value);\n  this.size += data.size == size ? 0 : 1;\n  return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n    mapCacheDelete = require('./_mapCacheDelete'),\n    mapCacheGet = require('./_mapCacheGet'),\n    mapCacheHas = require('./_mapCacheHas'),\n    mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n    Map = require('./_Map'),\n    MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var data = this.__data__;\n  if (data instanceof ListCache) {\n    var pairs = data.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      this.size = ++data.size;\n      return this;\n    }\n    data = this.__data__ = new MapCache(pairs);\n  }\n  data.set(key, value);\n  this.size = data.size;\n  return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n    stackClear = require('./_stackClear'),\n    stackDelete = require('./_stackDelete'),\n    stackGet = require('./_stackGet'),\n    stackHas = require('./_stackHas'),\n    stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  var data = this.__data__ = new ListCache(entries);\n  this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (iteratee(array[index], index, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\nmodule.exports = arrayEach;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n  try {\n    var func = getNative(Object, 'defineProperty');\n    func({}, '', {});\n    return func;\n  } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n  if (key == '__proto__' && defineProperty) {\n    defineProperty(object, key, {\n      'configurable': true,\n      'enumerable': true,\n      'value': value,\n      'writable': true\n    });\n  } else {\n    object[key] = value;\n  }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n    eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n  var objValue = object[key];\n  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n      (value === undefined && !(key in object))) {\n    baseAssignValue(object, key, value);\n  }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n    baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n  var isNew = !object;\n  object || (object = {});\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index];\n\n    var newValue = customizer\n      ? customizer(object[key], source[key], key, object, source)\n      : undefined;\n\n    if (newValue === undefined) {\n      newValue = source[key];\n    }\n    if (isNew) {\n      baseAssignValue(object, key, newValue);\n    } else {\n      assignValue(object, key, newValue);\n    }\n  }\n  return object;\n}\n\nmodule.exports = copyObject;\n","var copyObject = require('./_copyObject'),\n    keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n  return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n  var result = [];\n  if (object != null) {\n    for (var key in Object(object)) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n    isPrototype = require('./_isPrototype'),\n    nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n  if (!isObject(object)) {\n    return nativeKeysIn(object);\n  }\n  var isProto = isPrototype(object),\n      result = [];\n\n  for (var key in object) {\n    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n    baseKeysIn = require('./_baseKeysIn'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n    keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n  return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n    allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of  `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n  if (isDeep) {\n    return buffer.slice();\n  }\n  var length = buffer.length,\n      result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n  buffer.copy(result);\n  return result;\n}\n\nmodule.exports = cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n  var index = -1,\n      length = source.length;\n\n  array || (array = Array(length));\n  while (++index < length) {\n    array[index] = source[index];\n  }\n  return array;\n}\n\nmodule.exports = copyArray;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      resIndex = 0,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index];\n    if (predicate(value, index, array)) {\n      result[resIndex++] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n  return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n    stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n  if (object == null) {\n    return [];\n  }\n  object = Object(object);\n  return arrayFilter(nativeGetSymbols(object), function(symbol) {\n    return propertyIsEnumerable.call(object, symbol);\n  });\n};\n\nmodule.exports = getSymbols;\n","var copyObject = require('./_copyObject'),\n    getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n  return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n  var index = -1,\n      length = values.length,\n      offset = array.length;\n\n  while (++index < length) {\n    array[offset + index] = values[index];\n  }\n  return array;\n}\n\nmodule.exports = arrayPush;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var arrayPush = require('./_arrayPush'),\n    getPrototype = require('./_getPrototype'),\n    getSymbols = require('./_getSymbols'),\n    stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n  var result = [];\n  while (object) {\n    arrayPush(result, getSymbols(object));\n    object = getPrototype(object);\n  }\n  return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n    getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n  return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayPush = require('./_arrayPush'),\n    isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n  var result = keysFunc(object);\n  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n    getSymbols = require('./_getSymbols'),\n    keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n  return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n    getSymbolsIn = require('./_getSymbolsIn'),\n    keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n  return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n  var length = array.length,\n      result = new array.constructor(length);\n\n  // Add properties assigned by `RegExp#exec`.\n  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n    result.index = array.index;\n    result.input = array.input;\n  }\n  return result;\n}\n\nmodule.exports = initCloneArray;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n  new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n  return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n  result.lastIndex = regexp.lastIndex;\n  return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n    cloneDataView = require('./_cloneDataView'),\n    cloneRegExp = require('./_cloneRegExp'),\n    cloneSymbol = require('./_cloneSymbol'),\n    cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n  var Ctor = object.constructor;\n  switch (tag) {\n    case arrayBufferTag:\n      return cloneArrayBuffer(object);\n\n    case boolTag:\n    case dateTag:\n      return new Ctor(+object);\n\n    case dataViewTag:\n      return cloneDataView(object, isDeep);\n\n    case float32Tag: case float64Tag:\n    case int8Tag: case int16Tag: case int32Tag:\n    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n      return cloneTypedArray(object, isDeep);\n\n    case mapTag:\n      return new Ctor;\n\n    case numberTag:\n    case stringTag:\n      return new Ctor(object);\n\n    case regexpTag:\n      return cloneRegExp(object);\n\n    case setTag:\n      return new Ctor;\n\n    case symbolTag:\n      return cloneSymbol(object);\n  }\n}\n\nmodule.exports = initCloneByTag;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n  function object() {}\n  return function(proto) {\n    if (!isObject(proto)) {\n      return {};\n    }\n    if (objectCreate) {\n      return objectCreate(proto);\n    }\n    object.prototype = proto;\n    var result = new object;\n    object.prototype = undefined;\n    return result;\n  };\n}());\n\nmodule.exports = baseCreate;\n","var baseCreate = require('./_baseCreate'),\n    getPrototype = require('./_getPrototype'),\n    isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n  return (typeof object.constructor == 'function' && !isPrototype(object))\n    ? baseCreate(getPrototype(object))\n    : {};\n}\n\nmodule.exports = initCloneObject;\n","var getTag = require('./_getTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n  return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n  return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n    arrayEach = require('./_arrayEach'),\n    assignValue = require('./_assignValue'),\n    baseAssign = require('./_baseAssign'),\n    baseAssignIn = require('./_baseAssignIn'),\n    cloneBuffer = require('./_cloneBuffer'),\n    copyArray = require('./_copyArray'),\n    copySymbols = require('./_copySymbols'),\n    copySymbolsIn = require('./_copySymbolsIn'),\n    getAllKeys = require('./_getAllKeys'),\n    getAllKeysIn = require('./_getAllKeysIn'),\n    getTag = require('./_getTag'),\n    initCloneArray = require('./_initCloneArray'),\n    initCloneByTag = require('./_initCloneByTag'),\n    initCloneObject = require('./_initCloneObject'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isMap = require('./isMap'),\n    isObject = require('./isObject'),\n    isSet = require('./isSet'),\n    keys = require('./keys'),\n    keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_FLAT_FLAG = 2,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n *  1 - Deep clone\n *  2 - Flatten inherited properties\n *  4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n  var result,\n      isDeep = bitmask & CLONE_DEEP_FLAG,\n      isFlat = bitmask & CLONE_FLAT_FLAG,\n      isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n  if (customizer) {\n    result = object ? customizer(value, key, object, stack) : customizer(value);\n  }\n  if (result !== undefined) {\n    return result;\n  }\n  if (!isObject(value)) {\n    return value;\n  }\n  var isArr = isArray(value);\n  if (isArr) {\n    result = initCloneArray(value);\n    if (!isDeep) {\n      return copyArray(value, result);\n    }\n  } else {\n    var tag = getTag(value),\n        isFunc = tag == funcTag || tag == genTag;\n\n    if (isBuffer(value)) {\n      return cloneBuffer(value, isDeep);\n    }\n    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n      result = (isFlat || isFunc) ? {} : initCloneObject(value);\n      if (!isDeep) {\n        return isFlat\n          ? copySymbolsIn(value, baseAssignIn(result, value))\n          : copySymbols(value, baseAssign(result, value));\n      }\n    } else {\n      if (!cloneableTags[tag]) {\n        return object ? value : {};\n      }\n      result = initCloneByTag(value, tag, isDeep);\n    }\n  }\n  // Check for circular references and return its corresponding clone.\n  stack || (stack = new Stack);\n  var stacked = stack.get(value);\n  if (stacked) {\n    return stacked;\n  }\n  stack.set(value, result);\n\n  if (isSet(value)) {\n    value.forEach(function(subValue) {\n      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n    });\n  } else if (isMap(value)) {\n    value.forEach(function(subValue, key) {\n      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n    });\n  }\n\n  var keysFunc = isFull\n    ? (isFlat ? getAllKeysIn : getAllKeys)\n    : (isFlat ? keysIn : keys);\n\n  var props = isArr ? undefined : keysFunc(value);\n  arrayEach(props || value, function(subValue, key) {\n    if (props) {\n      key = subValue;\n      subValue = value[key];\n    }\n    // Recursively populate clone (susceptible to call stack limits).\n    assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n  });\n  return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n *   if (_.isElement(value)) {\n *     return value.cloneNode(true);\n *   }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\nfunction cloneDeepWith(value, customizer) {\n  customizer = typeof customizer == 'function' ? customizer : undefined;\n  return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n}\n\nmodule.exports = cloneDeepWith;\n","// Copyright 2026 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n  type CursorResponse,\n} from '@cognite/sdk-core';\nimport cloneDeepWith from 'lodash/cloneDeepWith';\nimport type {\n  DataPointSubscription,\n  DataPointSubscriptionByIdsQuery,\n  DataPointSubscriptionCreate,\n  DataPointSubscriptionListDataQuery,\n  DataPointSubscriptionListDataResponse,\n  DataPointSubscriptionListQuery,\n  DataPointSubscriptionMember,\n  DataPointSubscriptionMembersListQuery,\n  DataPointSubscriptionUpdate,\n  DataPointSubscriptionsDeleteQuery,\n} from './types';\n\nexport class DataPointSubscriptionsAPI extends BaseResourceAPI<DataPointSubscription> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  /**\n   * [Create data point subscriptions](https://docs.cognite.com/api/v1/#operation/postSubscriptions)\n   *\n   * ```js\n   * const subscriptions = await client.timeseries.subscriptions.create([\n   *   { externalId: 'my_subscription', partitionCount: 1, timeSeriesIds: ['ts_external_id'] },\n   * ]);\n   * ```\n   */\n  public create = (\n    items: DataPointSubscriptionCreate[]\n  ): Promise<DataPointSubscription[]> => {\n    return this.createEndpoint(items, this.url());\n  };\n\n  /**\n   * [List data point subscriptions](https://docs.cognite.com/api/v1/#operation/listSubscriptions)\n   *\n   * ```js\n   * const subscriptions = await client.timeseries.subscriptions.list({ limit: 100 });\n   * ```\n   */\n  public list = (\n    query?: DataPointSubscriptionListQuery\n  ): CursorAndAsyncIterator<DataPointSubscription> => {\n    return super.listEndpoint(this.callListEndpointWithGet, query);\n  };\n\n  /**\n   * [Retrieve data point subscriptions](https://docs.cognite.com/api/v1/#operation/getSubscriptionsByIds)\n   *\n   * ```js\n   * const subscriptions = await client.timeseries.subscriptions.retrieve({\n   *   items: [{ externalId: 'my_subscription' }],\n   * });\n   * ```\n   */\n  public retrieve = (\n    query: DataPointSubscriptionByIdsQuery\n  ): Promise<DataPointSubscription[]> => {\n    const { items, ...params } = query;\n    return this.callEndpointWithMergeAndTransform(items, (request) =>\n      this.callRetrieveEndpoint(request, this.url('byids'), params)\n    );\n  };\n\n  /**\n   * [Update data point subscriptions](https://docs.cognite.com/api/v1/#operation/updateSubscriptions)\n   *\n   * ```js\n   * const updated = await client.timeseries.subscriptions.update([\n   *   { externalId: 'my_subscription', update: { name: { set: 'new name' } } },\n   * ]);\n   * ```\n   */\n  public update = (\n    items: DataPointSubscriptionUpdate[]\n  ): Promise<DataPointSubscription[]> => {\n    return this.updateEndpoint(items, this.url('update'));\n  };\n\n  /**\n   * [Delete data point subscriptions](https://docs.cognite.com/api/v1/#operation/deleteSubscriptions)\n   *\n   * ```js\n   * await client.timeseries.subscriptions.delete({\n   *   items: [{ externalId: 'my_subscription' }],\n   * });\n   * ```\n   */\n  public delete = async (\n    query: DataPointSubscriptionsDeleteQuery\n  ): Promise<void> => {\n    const { items, ignoreUnknownIds } = query;\n    await this.callDeleteEndpoint(\n      items,\n      { ignoreUnknownIds },\n      this.url('delete')\n    );\n  };\n\n  /**\n   * [List data point subscription members](https://docs.cognite.com/api/v1/#operation/listSubscriptionMembers)\n   *\n   * ```js\n   * const members = await client.timeseries.subscriptions.listMembers({\n   *   externalId: 'my_subscription',\n   *   limit: 100,\n   * });\n   * ```\n   */\n  private callListMembersEndpointWithGet = async (\n    scope?: DataPointSubscriptionMembersListQuery\n  ) => {\n    return this.get<CursorResponse<DataPointSubscriptionMember[]>>(\n      this.url('members'),\n      { params: scope }\n    );\n  };\n\n  public listMembers = (\n    query: DataPointSubscriptionMembersListQuery\n  ): CursorAndAsyncIterator<DataPointSubscriptionMember> => {\n    return this.cursorBasedEndpoint(this.callListMembersEndpointWithGet, query);\n  };\n\n  /**\n   * [List data point subscription data](https://docs.cognite.com/api/v1/#operation/listSubscriptionData)\n   *\n   * ```js\n   * const data = await client.timeseries.subscriptions.listData({\n   *   externalId: 'my_subscription',\n   *   partitions: [{ index: 0 }],\n   *   limit: 100,\n   *   initializeCursors: 'now',\n   * });\n   * ```\n   */\n  public listData = async (\n    query: DataPointSubscriptionListDataQuery\n  ): Promise<DataPointSubscriptionListDataResponse> => {\n    const response = await this.post<DataPointSubscriptionListDataResponse>(\n      this.url('data/list'),\n      {\n        data: query,\n      }\n    );\n    const parsed = parseSubscriptionListDataDates(response.data);\n    return this.addToMapAndReturn(parsed, response);\n  };\n}\n\nfunction parseSubscriptionListDataDates(\n  data: DataPointSubscriptionListDataResponse\n): DataPointSubscriptionListDataResponse {\n  return cloneDeepWith(data, (value, key) => {\n    if (\n      (key === 'timestamp' ||\n        key === 'inclusiveBegin' ||\n        key === 'exclusiveEnd') &&\n      (typeof value === 'number' || typeof value === 'string')\n    ) {\n      return new Date(value);\n    }\n  });\n}\n","// Copyright 2020 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { DatapointInfo } from '../../types/common';\nimport type { SyntheticQuery, SyntheticQueryResponse } from './types';\n\nexport class SyntheticTimeSeriesAPI extends BaseResourceAPI<SyntheticQueryResponse> {\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps<DatapointInfo>(\n      ['items', 'datapoints'],\n      ['timestamp']\n    );\n  }\n\n  public query = (\n    items: SyntheticQuery[]\n  ): Promise<SyntheticQueryResponse[]> => {\n    return this.querySyntheticEndpoint(items);\n  };\n\n  private async querySyntheticEndpoint(items: SyntheticQuery[]) {\n    const path = this.url('query');\n    return this.callEndpointWithMergeAndTransform(items, (data) =>\n      this.postInParallelWithAutomaticChunking({\n        path,\n        items: data,\n        chunkSize: 10,\n      })\n    );\n  }\n}\n","// Copyright 2020-2026 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type CursorAndAsyncIterator,\n  type IdEitherWithInstance,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type { IdEither, IgnoreUnknownIds } from '../../types';\nimport { DataPointSubscriptionsAPI } from './subscriptions/dataPointSubscriptionsApi';\nimport { SyntheticTimeSeriesAPI } from './syntheticTimeSeriesApi';\nimport type {\n  SyntheticQuery,\n  TimeSeries,\n  TimeSeriesAggregate,\n  TimeSeriesAggregateQuery,\n  TimeSeriesCreate,\n  TimeSeriesFilterQuery,\n  TimeSeriesSearchFilter,\n  TimeSeriesUpdate,\n} from './types';\n\nexport class TimeSeriesAPI extends BaseResourceAPI<TimeSeries> {\n  private syntheticTimeseriesApi: SyntheticTimeSeriesAPI;\n  private readonly dataPointSubscriptionsApi: DataPointSubscriptionsAPI;\n\n  /** @hidden */\n  constructor(resourcePath: string, ...args: [CDFHttpClient, MetadataMap]) {\n    super(resourcePath, ...args);\n    this.syntheticTimeseriesApi = new SyntheticTimeSeriesAPI(\n      this.url('synthetic'),\n      ...args\n    );\n    this.dataPointSubscriptionsApi = new DataPointSubscriptionsAPI(\n      this.url('subscriptions'),\n      ...args\n    );\n  }\n\n  /**\n   * [Data point subscriptions](https://docs.cognite.com/api/v1/#tag/Data-point-subscriptions)\n   */\n  public get subscriptions() {\n    return this.dataPointSubscriptionsApi;\n  }\n\n  /**\n   * @hidden\n   */\n  protected getDateProps() {\n    return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']);\n  }\n\n  /**\n   * [Create time series](https://doc.cognitedata.com/api/v1/#operation/postTimeSeries)\n   *\n   * ```js\n   * const timeseries = [\n   *   { name: 'Pressure sensor', assetId: 123 },\n   *   { name: 'Temperature sensor', description: 'Pump abc', unit: 'C' },\n   * ];\n   * const createdTimeseries = await client.timeseries.create(timeseries);\n   * ```\n   */\n  public create = (items: TimeSeriesCreate[]): Promise<TimeSeries[]> => {\n    return super.createEndpoint(items);\n  };\n\n  /**\n   * [List time series](https://doc.cognitedata.com/api/v1/#operation/getTimeSeries)\n   *\n   * ```js\n   * const timeseries = await client.timeseries.list({ filter: { assetIds: [1, 2] }});\n   * ```\n   */\n  public list = (\n    scope?: TimeSeriesFilterQuery\n  ): CursorAndAsyncIterator<TimeSeries> => {\n    return super.listEndpoint(this.callListEndpointWithPost, scope);\n  };\n\n  /**\n   * [Aggregate timeseries](https://docs.cognite.com/api/v1/#operation/aggregateTimeSeries)\n   *\n   * ```js\n   * const aggregates = await client.timeseries.aggregate({ filter: { isString: true } });\n   * console.log('Number of string timeseries: ', aggregates[0].count)\n   * ```\n   */\n  public aggregate = (\n    query: TimeSeriesAggregateQuery\n  ): Promise<TimeSeriesAggregate[]> => {\n    return super.aggregateEndpoint(query);\n  };\n\n  /**\n   * [Retrieve time series](https://doc.cognitedata.com/api/v1/#operation/getTimeSeriesByIds)\n   *\n   * ```js\n   * const timeseries = await client.timeseries.retrieve([\n   *   { id: 123 },\n   *   { externalId: 'abc' }\n   * ]);\n   * ```\n   */\n  public retrieve = (\n    ids: IdEitherWithInstance[],\n    params: IgnoreUnknownIds = {}\n  ) => {\n    return super.retrieveEndpoint(ids, params);\n  };\n\n  /**\n   * [Update time series](https://doc.cognitedata.com/api/v1/#operation/alterTimeSeries)\n   *\n   * ```js\n   * const timeseries = await client.timeseries.update([{\n   *   id: 3785438579439,\n   *   update: {\n   *     name: { set: 'New name' }\n   *   }\n   * }]);\n   * ```\n   */\n  public update = (changes: TimeSeriesUpdate[]) => {\n    return super.updateEndpoint(changes);\n  };\n\n  /**\n   * [Search for time series](https://doc.cognitedata.com/api/v1/#operation/searchTimeSeries)\n   *\n   * ```js\n   * const timeseries = await client.timeseries.search({\n   *   filter: {\n   *     isString: false,\n   *   },\n   *   search: {\n   *     query: 'Temperature'\n   *   }\n   * });\n   * ```\n   */\n  public search = (query: TimeSeriesSearchFilter) => {\n    return super.searchEndpoint(query);\n  };\n\n  /**\n   * [Delete time series](https://doc.cognitedata.com/api/v1/#operation/deleteTimeSeries)\n   *\n   * ```js\n   * await client.timeseries.delete([\n   *   { id: 123 },\n   *   { externalId: 'abc' }\n   * ]);\n   * ```\n   */\n  public delete = (ids: IdEither[]) => {\n    return super.deleteEndpoint(ids);\n  };\n\n  /**\n   * [Synthetic Query](https://docs.cognite.com/api/v1/#operation/querySyntheticTimeseries)\n   *\n   * ```js\n   * await client.timeseries.syntheticQuery([\n   *   {\n   *     expression: \"24 * TS{externalId='production/hour', aggregate='average', granularity='1d'}\",\n   *     start: '48h-ago',\n   *     end: 'now',\n   *     limit: 100\n   *   }\n   * ]);\n   * ```\n   */\n  public syntheticQuery = (items: SyntheticQuery[]) => {\n    return this.syntheticTimeseriesApi.query(items);\n  };\n}\n","// Copyright 2023 Cognite AS\n\nimport { BaseResourceAPI } from '@cognite/sdk-core';\nimport type { UnitSystem } from '../../types';\n\nexport class UnitSystemsAPI extends BaseResourceAPI<UnitSystem> {\n  public list = async () => {\n    return this.listEndpoint(this.callListEndpointWithGet);\n  };\n}\n","// Copyright 2023 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CDFHttpClient,\n  type ExternalId,\n  type MetadataMap,\n} from '@cognite/sdk-core';\nimport type { Unit } from '../../types';\nimport { UnitSystemsAPI } from './unitSystemsApi';\n\nexport class UnitsAPI extends BaseResourceAPI<Unit> {\n  private unitSystemsApi: UnitSystemsAPI;\n\n  constructor(...args: [string, CDFHttpClient, MetadataMap]) {\n    super(...args);\n    const [resourcePath, client, metadataMap] = args;\n\n    this.unitSystemsApi = new UnitSystemsAPI(\n      `${resourcePath}/systems`,\n      client,\n      metadataMap\n    );\n  }\n\n  /**\n   * [List all supported units](https://developer.cognite.com/api#tag/Units/operation/listUnits)\n   *\n   * ```js\n   * const units = await client.units.list();\n   * ```\n   */\n  public list = async () => {\n    return this.listEndpoint(this.callListEndpointWithGet);\n  };\n\n  /**\n   * [Retrieve one or more units](https://developer.cognite.com/api#tag/Units/operation/byIdsUnits)\n   *\n   * ```js\n   * const units = await client.units.retrieve([{ externalId: 'temperature:deg_c' }, { externalId: 'pressure:bar' }]);\n   * ```\n   */\n  public retrieve = async (ids: ExternalId[]): Promise<Unit[]> => {\n    return this.retrieveEndpoint(ids);\n  };\n\n  /**\n   * [List all supported unit systems](List all supported unit systems <https://developer.cognite.com/api#tag/Unit-Systems/operation/listUnitSystems)\n   *\n   * ```js\n   * const units = await client.units.listUnitSystems();\n   * ```\n   */\n  public listUnitSystems = async () => {\n    return this.unitSystemsApi.list();\n  };\n}\n","// Copyright 2023 Cognite AS\n\nimport { BaseResourceAPI, type FilterQuery } from '@cognite/sdk-core';\nimport type {\n  UserIdentifier,\n  UserProfileItem,\n  UserProfilesListResponse,\n  UserProfilesSearchRequest,\n} from '../../types';\n\nexport class ProfilesAPI extends BaseResourceAPI<UserProfileItem> {\n  /**\n   * [Get the user profile of the principal issuing the request](https://developer.cognite.com/api#tag/User-profiles/operation/getRequesterUserProfile)\n   *\n   * ```js\n   * const response = await client.profiles.me();\n   * ```\n   */\n  public me = async (): Promise<UserProfileItem> => {\n    const path = this.url('me');\n\n    const response = await this.get<UserProfileItem>(path);\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [List all user profiles](https://developer.cognite.com/api#tag/User-profiles/operation/listUserProfiles)\n   *\n   * ```js\n   * const response = await client.profiles.list({ limit: 1000, cursor: 'abc' });\n   * ```\n   */\n  public list = (scope?: FilterQuery): UserProfilesListResponse => {\n    return this.listEndpoint(this.callListEndpointWithGet, scope);\n  };\n\n  /**\n   * [Retrieve one or more user profiles by ID](https://developer.cognite.com/api#tag/User-profiles/operation/getUserProfilesByIds)\n   *\n   * ```js\n   * const response = await client.profiles.retrieve([{ userIdentifier: 'abcd' }]);\n   * ```\n   */\n  public retrieve = async (\n    userIdentifiers: UserIdentifier[]\n  ): Promise<UserProfileItem[]> => {\n    return super.retrieveEndpoint(userIdentifiers);\n  };\n  /**\n   * [Search user profiles](https://developer.cognite.com/api#tag/User-profiles/operation/userProfilesSearch)\n   *\n   * ```js\n   * const response = await client.profiles.search({ search: { name: 'John' } });\n   * ```\n   */\n  public search = async (\n    query: UserProfilesSearchRequest\n  ): Promise<UserProfileItem[]> => {\n    return super.searchEndpoint(query);\n  };\n}\n","// Copyright 2023 Cognite AS\n\nimport {\n  BaseResourceAPI,\n  type CursorAndAsyncIterator,\n} from '@cognite/sdk-core';\nimport type {\n  AllVersionsQueryParameter,\n  CursorQueryParameter,\n  IncludeGlobalQueryParameter,\n  IncludeInheritedPropertiesQueryParameter,\n  ListOfAllVersionsReferences,\n  ListOfVersionReferences,\n  ReducedLimitQueryParameter,\n  SpaceQueryParameter,\n  ViewCollectionResponse,\n  ViewCreateDefinition,\n  ViewDefinition,\n} from './types.gen';\n\nexport class ViewsAPI extends BaseResourceAPI<ViewDefinition> {\n  /**\n   * [Upsert Views](https://api-docs.cognite.com/20230101/tag/Views/operation/ApplyViews)\n   *\n   * ```js\n   * const viewDefinition = {\n   *  \"externalId\": \"string\",\n   *   \"space\": \"string\",\n   *   \"name\": \"string\",\n   *   \"description\": \"string\",\n   *   \"filter\": {\n   *     \"and\": []\n   *   },\n   *   \"implements\": [\n   *     {\n   *       \"type\": \"view\",\n   *       \"space\": \"string\",\n   *       \"externalId\": \"string\",\n   *       \"version\": \"string\"\n   *     }\n   *   ],\n   *   \"version\": \"string\",\n   *   \"properties\": {}\n   *  };\n   *\n   *  const response = await client.views.upsert([\n   *   viewDefinition\n   *  ]);\n   * ```\n   */\n  public upsert = async (\n    params: ViewCreateDefinition[]\n  ): Promise<ViewCollectionResponse> => {\n    const response = await this.post<ViewCollectionResponse>(this.url(), {\n      data: { items: params },\n    });\n    return response.data;\n  };\n\n  /**\n   * [Delete Views](https://api-docs.cognite.com/20230101/tag/Views/operation/deleteViews)\n   *\n   * ```js\n   *  const response = await client.views.delete([{\n   *    space: \"my_space\",\n   *    externalId: \"my_external_id\",\n   *    version: \"my_version\"\n   *  }]);\n   *\n   * ```\n   */\n  public delete = async (\n    params: ListOfVersionReferences['items']\n  ): Promise<ListOfVersionReferences> => {\n    const response = await this.post<ListOfVersionReferences>(this.deleteUrl, {\n      data: { items: params },\n    });\n    return response.data;\n  };\n\n  /**\n   * [List Views](https://api-docs.cognite.com/20230101/tag/Views/operation/listViews)\n   *\n   * ```js\n   *  const response = await client.views.list();\n   *\n   * ```\n   */\n  public list = (\n    params: IncludeGlobalQueryParameter &\n      CursorQueryParameter &\n      ReducedLimitQueryParameter &\n      SpaceQueryParameter &\n      IncludeInheritedPropertiesQueryParameter &\n      AllVersionsQueryParameter = { includeGlobal: false }\n  ): CursorAndAsyncIterator<ViewDefinition> => {\n    return super.listEndpoint(this.callListEndpointWithGet, params);\n  };\n\n  /**\n   * [Retrieve Views](https://api-docs.cognite.com/20230101/tag/Views/operation/byExternalIdsViews)\n   *\n   * ```js\n   *  const response = await client.views.retrieve([\n   *  {\n   *   space: \"my_space\",\n   *   externalId: \"my_external_id\",\n   *   version: \"my_optional_version\"\n   *  }\n   * ]);\n   *\n   * ```\n   */\n  public retrieve = async (\n    params: (ListOfVersionReferences | ListOfAllVersionsReferences)['items'],\n    options: IncludeInheritedPropertiesQueryParameter = {}\n  ): Promise<ViewCollectionResponse> => {\n    const response = await this.post<ViewCollectionResponse>(this.byIdsUrl, {\n      data: { items: params, ...options },\n    });\n    return response.data;\n  };\n}\n","// Copyright 2022 Cognite AS\n\nimport { BaseResourceAPI, sleepPromise } from '@cognite/sdk-core';\nimport type {\n  FeatureParameters,\n  FileReference,\n  JobId,\n  JobStatus,\n  VisionExtractFeature,\n  VisionExtractGetResponse,\n  VisionExtractPostResponse,\n} from '../../types';\n\nconst JOB_COMPLETE_STATES: JobStatus[] = ['Completed', 'Failed'];\n/** @hidden */\nexport const BETA_FEATURES: VisionExtractFeature[] = [\n  'IndustrialObjectDetection',\n  'PersonalProtectiveEquipmentDetection',\n];\n\nexport class VisionAPI extends BaseResourceAPI<VisionExtractGetResponse> {\n  /**\n   * [Extract features from image](https://docs.cognite.com/api/v1/#tag/Vision/operation/postVisionExtract)\n   *\n   * ```js\n   * const job = await client.vision.extract(['TextDetection', 'AssetTagDetection', 'PeopleDetection'], [{ fileId: 1234 }]);\n   * ```\n   * @deprecated Retirement date: 2027-02-17. See https://docs.cognite.com/cdf/deprecated#deprecated-and-retired-features for more details.\n   */\n  public extract = async (\n    features: VisionExtractFeature[],\n    ids: FileReference[],\n    parameters?: FeatureParameters\n  ): Promise<VisionExtractPostResponse> => {\n    const path = this.url('extract');\n\n    let headers = {};\n    const betaFeatures = features.filter((f) => BETA_FEATURES.includes(f));\n    if (betaFeatures.length > 0) {\n      console.warn(\n        `Features '${betaFeatures}' are in beta and are still in development`\n      );\n      headers = { ...headers, 'cdf-version': 'beta' };\n    }\n\n    const response = await this.post<VisionExtractPostResponse>(path, {\n      data: { features: features, items: ids, parameters: parameters },\n      headers: headers,\n    });\n    return this.addToMapAndReturn(response.data, response);\n  };\n\n  /**\n   * [Retrieve extract job](https://docs.cognite.com/api/v1/#tag/Vision/operation/getVisionExtract)\n   *\n   * ```js\n   * const { items } = await client.vision.getExtractJob(12345678, true); // get an existing job, wait for it to complete, and get the results\n   * items.forEach((item) => {\n   *  const predictions = item.predictions // do something with the predictions\n   * });\n   * ```\n   * @deprecated Retirement date: 2027-02-17. See https://docs.cognite.com/cdf/deprecated#deprecated-and-retired-features for more details.\n   */\n  public getExtractJob = async (\n    jobId: JobId,\n    waitForCompletion = true,\n    pollingTimeMs = 1000,\n    maxRetries = 600\n  ): Promise<VisionExtractGetResponse> => {\n    const path = this.url(`extract/${jobId}`);\n    const getJobResult = async () => {\n      const response = await this.get<VisionExtractGetResponse>(path);\n      return this.addToMapAndReturn(response.data, response);\n    };\n    const isJobCompleted = (result: VisionExtractGetResponse) => {\n      return JOB_COMPLETE_STATES.includes(result.status);\n    };\n    return waitForCompletion\n      ? this.waitForJobToCompleteAndReturn(\n          getJobResult,\n          isJobCompleted,\n          pollingTimeMs,\n          maxRetries\n        )\n      : getJobResult();\n  };\n\n  private async waitForJobToCompleteAndReturn<T>(\n    getJobResult: () => Promise<T>,\n    isJobCompleted: (result: T) => boolean,\n    pollingTimeMs: number,\n    maxRetries: number\n  ) {\n    let retryCount = 0;\n    do {\n      // Get newest job result\n      const result = await getJobResult();\n      // Job is in a complete state. We can now exit this loop.\n      if (isJobCompleted(result)) return result;\n      // Wait a bit before retrying..\n      await sleepPromise(pollingTimeMs);\n      retryCount++;\n    } while (retryCount < maxRetries);\n    throw new Error('Timed out while waiting for vision job to complete.');\n  }\n}\n","// Copyright 2020 Cognite AS\n\nimport { type EndpointList, createRetryValidator } from '@cognite/sdk-core';\nimport { HttpMethod } from '@cognite/sdk-core';\n\nconst ENDPOINTS_TO_RETRY: EndpointList = {\n  [HttpMethod.Post]: [\n    '/assets/list',\n    '/assets/byids',\n    '/assets/search',\n    '/events/list',\n    '/events/byids',\n    '/events/search',\n    '/files/list',\n    '/files/byids',\n    '/files/search',\n    '/files/initupload',\n    '/files/downloadlink',\n    '/timeseries/byids',\n    '/timeseries/search',\n    '/timeseries/data',\n    '/timeseries/data/list',\n    '/timeseries/data/latest',\n    '/timeseries/data/delete',\n    '/timeseries/synthetic/query',\n    '/timeseries/subscriptions/data/list',\n    '/records/filter',\n    '/records/sync',\n    '/records/aggregate',\n    '/records/upsert',\n    '/records/delete',\n  ],\n};\n\nexport const retryValidator = createRetryValidator(ENDPOINTS_TO_RETRY);\n","// Copyright 2020 Cognite AS\nimport {\n  BaseCogniteClient,\n  type RetryValidator,\n  accessApi,\n  apiUrl,\n} from '@cognite/sdk-core';\nimport { version } from '../package.json';\nimport { AssetMappings3DAPI } from './api/3d/assetMappings3DApi';\nimport { Files3DAPI } from './api/3d/files3DApi';\nimport { Models3DAPI } from './api/3d/models3DApi';\nimport { Revisions3DAPI } from './api/3d/revisions3DApi';\nimport { Viewer3DAPI } from './api/3d/viewer3DApi';\nimport { AnnotationsAPI } from './api/annotations/annotationsApi';\nimport { AssetsAPI } from './api/assets/assetsApi';\nimport { ContainersAPI } from './api/containers/containersApi';\nimport { DataPointsAPI } from './api/dataPoints/dataPointsApi';\nimport { DataSetsAPI } from './api/datasets/datasetsApi';\nimport { DocumentsAPI } from './api/documents/documentsApi';\nimport { EntityMatchingApi } from './api/entityMatching/entityMatchingApi';\nimport { EventsAPI } from './api/events/eventsApi';\nimport { FilesAPI } from './api/files/filesApi';\nimport { FunctionsAPI } from './api/functions/functionsApi';\nimport { GeospatialAPI } from './api/geospatial/geospatialAPI';\nimport { GroupsAPI } from './api/groups/groupsApi';\nimport { InstancesAPI } from './api/instances/instancesApi';\nimport { LabelsAPI } from './api/labels/labelsApi';\nimport { DataModelsAPI } from './api/models/datamodelsApi';\nimport { ProjectsAPI } from './api/projects/projectsApi';\nimport { RawAPI } from './api/raw/rawApi';\nimport { RecordsAPI } from './api/records/recordsApi';\nimport { RelationshipsApi } from './api/relationships/relationshipsApi';\nimport { SecurityCategoriesAPI } from './api/securityCategories/securityCategoriesApi';\nimport { SequencesAPI } from './api/sequences/sequencesApi';\nimport { SessionsApi } from './api/sessions/sessionsApi';\nimport { SpacesAPI } from './api/spaces/spacesApi';\nimport { StreamsAPI } from './api/streams/streamsApi';\nimport {\n  TemplateGraphQlApi,\n  TemplateGroupVersionsApi,\n  TemplateGroupsApi,\n  TemplateInstancesApi,\n  ViewsApi,\n} from './api/templates';\nimport { TimeSeriesAPI } from './api/timeSeries/timeSeriesApi';\nimport { UnitsAPI } from './api/units/unitsApi';\nimport { ProfilesAPI } from './api/userProfiles/profilesApi';\nimport { ViewsAPI } from './api/views/viewsApi';\nimport { VisionAPI } from './api/vision/visionApi';\nimport { retryValidator } from './retryValidator';\n\nexport default class CogniteClient extends BaseCogniteClient {\n  public get assets() {\n    return accessApi(this.assetsApi);\n  }\n  public get timeseries() {\n    return accessApi(this.timeSeriesApi);\n  }\n  public get datapoints() {\n    return accessApi(this.dataPointsApi);\n  }\n  public get sequences() {\n    return accessApi(this.sequencesApi);\n  }\n  public get events() {\n    return accessApi(this.eventsApi);\n  }\n  public get files() {\n    return accessApi(this.filesApi);\n  }\n  public get functions() {\n    return accessApi(this.functionsApi);\n  }\n  public get labels() {\n    return accessApi(this.labelsApi);\n  }\n  public get raw() {\n    return accessApi(this.rawApi);\n  }\n  public get projects() {\n    return accessApi(this.projectsApi);\n  }\n  public get groups() {\n    return accessApi(this.groupsApi);\n  }\n  public get securityCategories() {\n    return accessApi(this.securityCategoriesApi);\n  }\n  public get models3D() {\n    return accessApi(this.models3DApi);\n  }\n  public get revisions3D() {\n    return accessApi(this.revisions3DApi);\n  }\n  public get files3D() {\n    return accessApi(this.files3DApi);\n  }\n  public get datasets() {\n    return accessApi(this.datasetsApi);\n  }\n  public get assetMappings3D() {\n    return accessApi(this.assetMappings3DApi);\n  }\n  public get viewer3D() {\n    return accessApi(this.viewer3DApi);\n  }\n  public get relationships() {\n    return accessApi(this.relationshipsApi);\n  }\n  public get entityMatching() {\n    return accessApi(this.entityMatchingApi);\n  }\n  public get geospatial() {\n    return accessApi(this.geospatialApi);\n  }\n  public get documents() {\n    return accessApi(this.documentsApi);\n  }\n  public get annotations() {\n    return accessApi(this.annotationsApi);\n  }\n  /**\n   * @deprecated Retirement date: 2027-02-17. See https://docs.cognite.com/cdf/deprecated#deprecated-and-retired-features for more details.\n   */\n  public get vision() {\n    console.warn(\n      'The Vision API is deprecated and will be retired on 2027-02-17. See https://docs.cognite.com/cdf/deprecated#deprecated-and-retired-features for more details.'\n    );\n    return accessApi(this.visionApi);\n  }\n  public get profiles() {\n    return accessApi(this.profilesApi);\n  }\n  public get sessions() {\n    return accessApi(this.sessionsApi);\n  }\n  public get templates() {\n    return {\n      groups: accessApi(this.apiFactory(TemplateGroupsApi, 'templategroups')),\n      group: (externalId: string) => {\n        const urlsafeExternalId = CogniteClient.urlEncodeExternalId(externalId);\n        const baseVersionsUrl = `templategroups/${urlsafeExternalId}/versions`;\n        return {\n          versions: accessApi(\n            this.apiFactory(TemplateGroupVersionsApi, baseVersionsUrl)\n          ),\n          version: (version: number) => {\n            const baseGroupUrl = `${baseVersionsUrl}/${version}`;\n            const graphQlApi = this.apiFactory(\n              TemplateGraphQlApi,\n              `${baseGroupUrl}/graphql`\n            );\n            return {\n              instances: accessApi(\n                this.apiFactory(\n                  TemplateInstancesApi,\n                  `${baseGroupUrl}/instances`\n                )\n              ),\n              runQuery: async <\n                TVariables extends Record<string, unknown>,\n              >(graphQlParams: {\n                query: string;\n                variables?: TVariables;\n                operationName?: string;\n              }) => graphQlApi.runQuery(graphQlParams),\n              views: accessApi(\n                this.apiFactory(ViewsApi, `${baseGroupUrl}/views`)\n              ),\n            };\n          },\n        };\n      },\n    };\n  }\n  public get units() {\n    return accessApi(this.unitsApi);\n  }\n  public get instances() {\n    return accessApi(this.instancesApi);\n  }\n  public get containers() {\n    return accessApi(this.containersApi);\n  }\n  public get views() {\n    return accessApi(this.viewsApi);\n  }\n  public get spaces() {\n    return accessApi(this.spacesApi);\n  }\n  public get dataModels() {\n    return accessApi(this.dataModelsApi);\n  }\n  public get streams() {\n    return accessApi(this.streamsApi);\n  }\n  public get records() {\n    return accessApi(this.recordsApi);\n  }\n  private assetsApi?: AssetsAPI;\n  private timeSeriesApi?: TimeSeriesAPI;\n  protected dataPointsApi?: DataPointsAPI;\n  private sequencesApi?: SequencesAPI;\n  private eventsApi?: EventsAPI;\n  protected filesApi?: FilesAPI;\n  private functionsApi?: FunctionsAPI;\n  private labelsApi?: LabelsAPI;\n  private rawApi?: RawAPI;\n  private projectsApi?: ProjectsAPI;\n  private groupsApi?: GroupsAPI;\n  private securityCategoriesApi?: SecurityCategoriesAPI;\n  private models3DApi?: Models3DAPI;\n  private relationshipsApi?: RelationshipsApi;\n  private entityMatchingApi?: EntityMatchingApi;\n  private revisions3DApi?: Revisions3DAPI;\n  private files3DApi?: Files3DAPI;\n  private datasetsApi?: DataSetsAPI;\n  private assetMappings3DApi?: AssetMappings3DAPI;\n  private viewer3DApi?: Viewer3DAPI;\n  private geospatialApi?: GeospatialAPI;\n  private documentsApi?: DocumentsAPI;\n  private annotationsApi?: AnnotationsAPI;\n  private visionApi?: VisionAPI;\n  private profilesApi?: ProfilesAPI;\n  private unitsApi?: UnitsAPI;\n  private instancesApi?: InstancesAPI;\n  private containersApi?: ContainersAPI;\n  private viewsApi?: ViewsAPI;\n  private spacesApi?: SpacesAPI;\n  private dataModelsApi?: DataModelsAPI;\n  private sessionsApi?: SessionsApi;\n  private streamsApi?: StreamsAPI;\n  private recordsApi?: RecordsAPI;\n\n  protected get version() {\n    return version;\n  }\n\n  protected getRetryValidator(): RetryValidator {\n    return retryValidator;\n  }\n\n  protected initAPIs() {\n    const models3DPath = '3d/models';\n\n    // Lock version to the following date\n    this.httpClient.setDefaultHeader('cdf-version', 'V20210406');\n\n    this.assetsApi = this.apiFactory(AssetsAPI, 'assets');\n    this.timeSeriesApi = this.apiFactory(TimeSeriesAPI, 'timeseries');\n    this.dataPointsApi = this.apiFactory(DataPointsAPI, 'timeseries/data');\n    this.sequencesApi = this.apiFactory(SequencesAPI, 'sequences');\n    this.eventsApi = this.apiFactory(EventsAPI, 'events');\n    this.filesApi = this.apiFactory(FilesAPI, 'files');\n    this.functionsApi = this.apiFactory(FunctionsAPI, 'functions');\n    this.labelsApi = this.apiFactory(LabelsAPI, 'labels');\n    this.datasetsApi = this.apiFactory(DataSetsAPI, 'datasets');\n    this.rawApi = this.apiFactory(RawAPI, 'raw/dbs');\n    this.groupsApi = this.apiFactory(GroupsAPI, 'groups');\n    this.securityCategoriesApi = this.apiFactory(\n      SecurityCategoriesAPI,\n      'securitycategories'\n    );\n    this.models3DApi = this.apiFactory(Models3DAPI, models3DPath);\n    this.relationshipsApi = this.apiFactory(RelationshipsApi, 'relationships');\n    this.entityMatchingApi = this.apiFactory(\n      EntityMatchingApi,\n      'context/entitymatching'\n    );\n    this.revisions3DApi = this.apiFactory(Revisions3DAPI, models3DPath);\n    this.files3DApi = this.apiFactory(Files3DAPI, '3d/files');\n    this.assetMappings3DApi = this.apiFactory(AssetMappings3DAPI, models3DPath);\n    this.viewer3DApi = this.apiFactory(Viewer3DAPI, '3d');\n    this.projectsApi = new ProjectsAPI(\n      apiUrl(),\n      this.httpClient,\n      this.metadataMap\n    );\n    this.geospatialApi = this.apiFactory(GeospatialAPI, 'geospatial');\n    this.documentsApi = this.apiFactory(DocumentsAPI, 'documents');\n    this.annotationsApi = this.apiFactory(AnnotationsAPI, 'annotations');\n    this.visionApi = this.apiFactory(VisionAPI, 'context/vision');\n    this.profilesApi = this.apiFactory(ProfilesAPI, 'profiles');\n    this.unitsApi = this.apiFactory(UnitsAPI, 'units');\n    this.instancesApi = this.apiFactory(InstancesAPI, 'models/instances');\n    this.containersApi = this.apiFactory(ContainersAPI, 'models/containers');\n    this.viewsApi = this.apiFactory(ViewsAPI, 'models/views');\n    this.spacesApi = this.apiFactory(SpacesAPI, 'models/spaces');\n    this.dataModelsApi = this.apiFactory(DataModelsAPI, 'models/datamodels');\n    this.sessionsApi = this.apiFactory(SessionsApi, 'sessions');\n    this.streamsApi = this.apiFactory(StreamsAPI, 'streams');\n    this.recordsApi = this.apiFactory(RecordsAPI, 'streams');\n  }\n\n  static urlEncodeExternalId(externalId: string): string {\n    return encodeURIComponent(externalId);\n  }\n}\n"],"names":["AssetMappings3DAPI","BaseResourceAPI","modelId","revisionId","scope","path","params","query","items","ids","Files3DAPI","fileId","__async","response","HttpResponseType","Models3DAPI","models","id","changes","Nodes3DAPI","nodeId","Revisions3DAPI","resourcePath","httpClient","map","filter","RevealNodes3DAPI","RevealRevisions3DAPI","RevealSectors3DAPI","UnrealRevisions3DAPI","Viewer3DAPI","revealPath","unrealPath","AnnotationsAPI","enrichAssetsWithTheirParents","assets","externalIdMap","nodes","asset","node","externalId","parentExternalId","sortAssetCreateItems","GraphUtils","AssetsAPI","sort","unsort","RevertableArraySorter","paramsWithIgnoreUnknownIds","__spreadProps","__spreadValues","ContainersAPI","DataPointsAPI","request","DataSetsAPI","DocumentsAggregateAPI","PreviewAPI","page","uri","DocumentsAPI","args","baseUrl","EntityMatchingApi","__superGet","jobId","EventsAggregateAPI","EventsAPI","_a","sortObject","rest","__objRest","prop","order","UploadAlreadyFinishedError","FilesMultipartUploadSessionAPI","_","partNumber","fileContent","requestBody","acc","curr","index","FilesAPI","fileInfo","overwrite","waitUntilAcknowledged","file","uploadedFile","url","mimeType","headers","retryCount","sleepPromise","parts","multipartUploadSession","FunctionsAPI","ComputeAPI","CrsAPI","crs","srids","FeatureAPI","featureTypeExternalId","features","externalIds","filterParams","FeatureTypeAPI","featureTypes","GeospatialAPI","GroupsAPI","InstancesAPI","LabelsAPI","DataModelsAPI","_0","_1","options","ProjectsAPI","projectName","RawRowsAPI","databaseName","tableName","ensureParent","onlyRowKeys","columns","rowKey","RawTablesAPI","responses","RawAPI","RecordsAPI","streamExternalId","callSyncEndpoint","requestData","firstPagePromise","syncData","addSyncNextPageFunction","autoPaginationMethods","makeAutoPaginationMethods","endpoint","nextCursor","hasNext","next","data","RelationshipsApi","SecurityCategoriesAPI","SequenceRowsAPI","rows","rowNumber","values","SequencesAPI","SessionsApi","SpacesAPI","space","StreamsAPI","item","includeStatistics","TemplateGraphQlApi","variables","operationName","TemplateGroupVersionsApi","res","version","TemplateGroupsApi","fromPairs","pairs","length","result","pair","fromPairs_1","arrayMap","array","iteratee","_arrayMap","require$$0","baseToPairs","object","props","key","_baseToPairs","freeGlobal","global","_freeGlobal","freeSelf","root","_root","Symbol","_Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","value","isOwn","tag","unmasked","e","_getRawTag","objectToString","_objectToString","require$$1","require$$2","nullTag","undefinedTag","baseGetTag","_baseGetTag","isObject","type","isObject_1","asyncTag","funcTag","genTag","proxyTag","isFunction","isFunction_1","coreJsData","_coreJsData","maskSrcKey","uid","isMasked","func","_isMasked","funcProto","funcToString","toSource","_toSource","require$$3","reRegExpChar","reIsHostCtor","reIsNative","baseIsNative","pattern","_baseIsNative","getValue","_getValue","getNative","_getNative","DataView","_DataView","Map","_Map","Promise","_Promise","Set","_Set","WeakMap","_WeakMap","require$$4","require$$5","require$$6","mapTag","objectTag","promiseTag","setTag","weakMapTag","dataViewTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","Ctor","ctorString","_getTag","mapToArray","_mapToArray","setToPairs","set","_setToPairs","createToPairs","keysFunc","_createToPairs","baseTimes","n","_baseTimes","isObjectLike","isObjectLike_1","argsTag","baseIsArguments","_baseIsArguments","propertyIsEnumerable","isArguments","isArguments_1","isArray","isArray_1","stubFalse","stubFalse_1","freeExports","exports","freeModule","module","moduleExports","Buffer","nativeIsBuffer","isBuffer","MAX_SAFE_INTEGER","reIsUint","isIndex","_isIndex","isLength","isLength_1","arrayTag","boolTag","dateTag","errorTag","numberTag","regexpTag","stringTag","arrayBufferTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","baseIsTypedArray","_baseIsTypedArray","baseUnary","_baseUnary","freeProcess","nodeUtil","types","nodeIsTypedArray","isTypedArray","isTypedArray_1","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","_arrayLikeKeys","isPrototype","proto","_isPrototype","overArg","transform","arg","_overArg","nativeKeys","_nativeKeys","baseKeys","_baseKeys","isArrayLike","isArrayLike_1","keys","keys_1","toPairs","toPairs_1","SessionStatus","SessionType","isManagedInCDFGroup","group","isManagedExternallyGroup","SequenceValueType","SortOrder","ContextJobStatus","EntityMatchingFeatureType","EntityMatchingClassifier","ConflictMode","ConstantResolver","RawResolver","dbName","columnName","SyntheticTimeSeriesResolver","expression","name","metadata","description","isStep","isString","unit","ViewResolver","input","TemplateInstancesApi","TemplateInstanceCodec","templateInstances","patch","fieldResolvers","mappedResolvers","fieldResolver","ViewsApi","resolveRequest","resolveFetch","listCacheClear","_listCacheClear","eq","other","eq_1","assocIndexOf","_assocIndexOf","arrayProto","splice","listCacheDelete","lastIndex","_listCacheDelete","listCacheGet","_listCacheGet","listCacheHas","_listCacheHas","listCacheSet","_listCacheSet","ListCache","entries","entry","_ListCache","stackClear","_stackClear","stackDelete","_stackDelete","stackGet","_stackGet","stackHas","_stackHas","nativeCreate","_nativeCreate","hashClear","_hashClear","hashDelete","_hashDelete","HASH_UNDEFINED","hashGet","_hashGet","hashHas","_hashHas","hashSet","_hashSet","Hash","_Hash","mapCacheClear","_mapCacheClear","isKeyable","_isKeyable","getMapData","_getMapData","mapCacheDelete","_mapCacheDelete","mapCacheGet","_mapCacheGet","mapCacheHas","_mapCacheHas","mapCacheSet","size","_mapCacheSet","MapCache","_MapCache","LARGE_ARRAY_SIZE","stackSet","_stackSet","Stack","_Stack","arrayEach","_arrayEach","defineProperty","_defineProperty","baseAssignValue","_baseAssignValue","assignValue","objValue","_assignValue","copyObject","source","customizer","isNew","newValue","_copyObject","baseAssign","_baseAssign","nativeKeysIn","_nativeKeysIn","baseKeysIn","isProto","_baseKeysIn","keysIn","keysIn_1","baseAssignIn","_baseAssignIn","allocUnsafe","cloneBuffer","buffer","isDeep","copyArray","_copyArray","arrayFilter","predicate","resIndex","_arrayFilter","stubArray","stubArray_1","nativeGetSymbols","getSymbols","symbol","_getSymbols","copySymbols","_copySymbols","arrayPush","offset","_arrayPush","getPrototype","_getPrototype","getSymbolsIn","_getSymbolsIn","copySymbolsIn","_copySymbolsIn","baseGetAllKeys","symbolsFunc","_baseGetAllKeys","getAllKeys","_getAllKeys","getAllKeysIn","_getAllKeysIn","initCloneArray","_initCloneArray","Uint8Array","_Uint8Array","cloneArrayBuffer","arrayBuffer","_cloneArrayBuffer","cloneDataView","dataView","_cloneDataView","reFlags","cloneRegExp","regexp","_cloneRegExp","symbolProto","symbolValueOf","cloneSymbol","_cloneSymbol","cloneTypedArray","typedArray","_cloneTypedArray","symbolTag","initCloneByTag","_initCloneByTag","objectCreate","baseCreate","_baseCreate","initCloneObject","_initCloneObject","baseIsMap","_baseIsMap","nodeIsMap","isMap","isMap_1","baseIsSet","_baseIsSet","nodeIsSet","isSet","isSet_1","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","cloneableTags","baseClone","bitmask","stack","isFlat","isFull","isFunc","stacked","subValue","_baseClone","cloneDeepWith","cloneDeepWith_1","DataPointSubscriptionsAPI","ignoreUnknownIds","parsed","parseSubscriptionListDataDates","SyntheticTimeSeriesAPI","TimeSeriesAPI","UnitSystemsAPI","UnitsAPI","client","metadataMap","ProfilesAPI","userIdentifiers","ViewsAPI","JOB_COMPLETE_STATES","BETA_FEATURES","VisionAPI","parameters","betaFeatures","f","waitForCompletion","pollingTimeMs","maxRetries","getJobResult","isJobCompleted","ENDPOINTS_TO_RETRY","HttpMethod","retryValidator","createRetryValidator","CogniteClient","BaseCogniteClient","accessApi","baseVersionsUrl","baseGroupUrl","graphQlApi","graphQlParams","models3DPath","apiUrl"],"mappings":"8+BAgBO,MAAMA,WAA2BC,EAAAA,eAAgC,CAAjE,aAAA,CAAA,MAAA,GAAA,SAAA,EAQL,KAAO,KAAO,CACZC,EACAC,EACAC,IAC2C,CAC3C,MAAMC,EAAO,KAAK,UAAUH,EAASC,CAAU,EAC/C,OAAO,MAAM,aACVG,GAAW,KAAK,IAAsCD,EAAM,CAAE,OAAAC,EAAQ,EACvEF,CACF,CACF,EAaA,KAAO,OAAS,CACdF,EACAC,EACAI,IAC2C,CAC3C,MAAMF,EAAO,GAAG,KAAK,UAAUH,EAASC,CAAU,CAAC,QACnD,OAAO,MAAM,aACVG,GACC,KAAK,KAAuCD,EAAM,CAAE,KAAMC,EAAQ,EACpEC,CACF,CACF,EAuBA,KAA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,UAAU,EAC1D,KAAK,WAAa,KAAK,WAAWG,GAAY,SAAS,EACvD,KAAK,WAAa,KAAK,WAAWxB,GAAY,SAAS,CAAA,CAGzD,OAAO,oBAAoBvF,EAA4B,CACrD,OAAO,mBAAmBA,CAAU,CAAA,CAExC","x_google_ignoreList":[50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168]}