v2.302

Add isTurnAllowedBySegmentDirections method to determine if a turn can be made based on the driving directions. Helps to determine reverse connections(eg. the turn is allowed according to turn data, but not allowed by driving direction).

Added description param to Venues updateVenue method.

v2.301

This method divides a segment into two segments at the provided point

Fix the documentation for shortcutKeys as it expects a shortcut key combination and not a shortcut id.

added viewportX/viewportY properties to SdkMouseEvent (wme-map-mouse-down|wme-map-mouse-move|wme-map-mouse-up).

v2.300

The issue arose because form.handleSubmit(data) includes disabled fields as undefined. When the "end date" was not selected, recurrencePattern became disabled and its value was undefined in the submitted data. Our logic then incorrectly set repeatsYearly to true since undefined doesn't equal RECURRENCE_PATTERN.NONE. This led to a backend error, as it received repeatsYearly: true without a corresponding UNTIL (end date) value.

update migration guide to use wme-map-data-loaded event instead of change:loadingIssueTrackerMapData to determine whether the map data is loaded.

add getRedoChangesCount to Editing class.

add tracked layer events:

  • wme-layer-feature-mouse-enter when the mouse enters a tracked feature layer
  • wme-layer-feature-mouse-leave when the mouse leaves a tracked feature layer

Add an example of a layer with external graphic feature styles.

It displays the Place Update Request dialog for the specified venue, showing any pending update requests

updateStreet method updates street attributes. Currently, only supports updating the direction of a street

Added wme-street-view-button-activated | wme-street-view-button-deactivated Dispatched when WME user starts/stops dragging the street view button.

The method returns a localized formatted link for a users editor profile page.

The event is dispatched when the street view panel changes its visibility.

isChecked param gives ability to set initial checked state of the layer switcher checkbox.

v2.298

Specify units in which values are returned.

Updated editingHouseNumbers event and method documentation to prepare for upcoming deletion. The SDK HouseNumbers module is the recommended replacement.

v2.297

Add wme-update-request-panel-opened event that happens when a map update request panel opens.

add geoJSON geometry to state object.

The method take the data model name (e.g., "segments", "venues") and the object ID as input.

Added ability to update categories via SDK Venue.updateVenue.

Add following state methods:

  • getAllWithoutDefault - get all the states apart from default in the WME data model.
  • hasStates - returns true if there are any states apart from the default state in the WME data model.

Added wme-house-number-added|wme-house-number-moved|wme-house-number-updated|wme-house-number-deleted events

v2.296

Added wme-data-model-object-state-deleted | wme-data-model-object-changed-id events.

The method take the data model name (e.g., "segments", "venues") and the object ID as input

The method take the data model name (e.g., "segments", "venues") and the object ID as input

additional method to determine if a turn is allowed between segments.

additional no edits event which is dispatched after WME user performs the last undo or save indicating no edits left to be able to undo or save.

v2.294

Implement EditSuggestions.getAll and EditSuggestions.getById methods.

Add TurnClosures.addClosure method that allows adding new TurnClosure.

v2.293

Implement TurnClosures.getAll and TurnClosures.getById methods.

v2.292

Update documentation to include SDK API and remove WME internals.

For updateHouseNumber was changed signature: geometry argument renamed to point.

Added addHouseNumber method in the HouseNumbers class. This method creates a new house number and associates it with the closest road segment to the given point.

Add isMapLoading state method.

Fix userscript shortcuts persisting on reload after assigning null shortcuts and reassigning in the cheatsheet.

  • Changed cheatsheet labels for numpad keys
  • Added cheatsheet lables for the following keys: Insert, Home, Page Up, End, Page Down

v2.291

  • update Map.setLayerZIndex method to allow setting z-index for tile layers, created by SDK
  • fix Map.removeLayer method to allow removing tile layers, created by SDK

Added deleteHouseNumber method in the HouseNumbers class. This method allows you to remove an existing house number.

Added updateHouseNumber method in the HouseNumbers class. This method allows you to modify various properties of a house number, such as its geometry, fraction point, or the house number string.

change getTurnsThroughNode to return unknown turns as disallowed turns.

Add an event that is dispatched on save mode change.

Add a note about changing shortcuts

Allow setting Segment direction (A_TO_B/B_TO_A/TWO_WAY).

Added snapTo parameter. If the snapTo parameter is set to "segment", the point will be snapped to the nearest segment

added method updateVenueUpdateRequest into Venues class

Add guard to sdk method for updating turns that checks if the user can perform an action with the current save mode

Add Map.getMapResolution method to the SDK that returns current map resolution.

  • expose Map.MIN_ZOOM_LEVEL and Map.MAX_ZOOM_LEVEL properties
  • adjust ZoomLevel type to reflect the available zoom values

v2.290

Include x, y, lon, lat coordinates of the pointer to the mouse events.

Add possibility to redraw a map layer through SDK.

v2.289

Add the changelayer event.

Add State.getManagedCountries method, that returns the list of the countries that are managed by the current user.

Fixed getConnectedSegments methods of Segments class to return connected segments even when all turns are disabled or segment has pedestrian/walking road type

Add local and remote methods of map projection.

Added ability to update Segment flagAttributes through updateSegment of Segments class

Add the following editing methods: isEditingAllowed, isDrawingInProgress, getCurrentSaveMode

Add the following editing locking methods: lockEditing, releaseEditingLock.

Add the following edit events: wme-after-edit, wme-after-clear-redo, wme-after-undo.

Add new restrictionSubscriptions property to the SDK output for a Country object.

Added properties to Turn interface

  • hasCustomTTS
  • hasShieldsPopulated
  • hasTowardsGuidance
  • hasTurnGuidance
  • hasVisualInstruction

added the method moveNode into Nodes class

v2.288

Added Parking Lot class with methods:

  • getBrands - method to get the venue brands
  • canExitWhileClosed - method to check if the venue can be exited while closed
  • getCostType - method to get the venue cost type
  • getEstimatedNumberOfSpots - method to get the estimated number of spots for
  • isLotTypeDependentOnDayTime - method to check if the venue type vary depending on time/day
  • getParkingLotType - method to get parking type of the venue
  • getLotTypes - method to get parking lot types of the venue
  • getPaymentMethods - method to get venue payment methods
  • allow to add comments to MapUpdateRequest
  • allow to retrieve and update MapUpdateRequest resolution state (mark as open/solved/not identified)
  • allow to listen to the events on "updateRequestSessions" model

Added Charging Station class with methods:

  • getChargersAccessType - method to get the venue chargers access type
  • getCostType - method to get the venue cost type
  • getNetwork - method to get the venue network
  • getPaymentMethods - method to get venue payment methods
  • getBrands - method to get venue brands

Add method to dangerously add features to layer without validation for viewing in exceptional cases.

add Junctions object support to DataModel

  • fetchHouseNumbers - to fetch house numbers
  • clearHouseNumbers - removing house numbers from the internal store if they are not in use added ability to listen to the house numbers events

Added venueUpdateRequests property to the Venue interface

v2.287

Include user preferences into MapUpdateRequest through a separate userPreferences attribute.

Allow to get all possible turns for a BigJunction using getAllPossibleTurns method.

Add the following methods in the Map:

  • getLonLatFromMapPixel - converts pixel coordinates, relative to the top-left corner of the map component, to geographic coordinates
  • getMapPixelFromLonLat - converts geographic coordinates to pixel coordinates, relative to the top-left corner of the map component

Add new hasClosures property to the SDK output for a Segment object.

v2.285

Add new regionCode property to the SDK output for a Country object.

v2.283

Added moveHouseNumberFractionPoint method in the HouseNumbers class. This method allows you to relocate the fractional part of an existing house number to a different position.

Added HouseNumbers class. Added moveHouseNumber method in the HouseNumbers class. This method allows you to relocate an existing house number to a different position.

The issue occurred because the placeholder %%WME_SDK_TYPINGS_URL%% is used within a href attribute of the README.md file. URLs have specific character restrictions, and the % character is not allowed without encoding. So %%WME_SDK_TYPINGS_URL%% was encoded to %25%25WME_SDK_TYPINGS_URL%25%25. When sed was trying to replace was %%WME_SDK_TYPINGS_URL%% with real string, there was no %%WME_SDK_TYPINGS_URL%% but %25%25WME_SDK_TYPINGS_URL%25%25. To resolve this, the placeholder was changed from %%WME_SDK_TYPINGS_URL%% to --WME_SDK_TYPINGS_URL--. The - character is allowed within URLs, so it is not encoded and could be properly replaced with the actual URL during the subsequent substitution step in the upload_sdk_docs.sh script.

v2.282

addIntersection returns ids of the four newly created segments

v2.281

Added addIntersection method in the Segments class. This method divides two intersecting segments into four new segments, with a new node created at the intersection point to connect them.

v2.280

Added images property to the Venue interface

Added openingHours property to the Venue interface. Added support of updating opening hours through updateVenue method in the Venues class.

Attributes added to Venue interface:

  • isAdLocked
  • aliases
  • brand
  • phone
  • services
  • url Added ability to update via SDK Venue.updateVenue method:
  • aliases
  • phone
  • services
  • url

Adds the ability to replace entry and exit points for venues using the replaceNavigationPoints method in the Venues class. The replaceNavigationPoints method accepts an navigationPoints argument, an array of NavigationPoints objects.

v2.279

Selection interface was replaced with Selection type: type Selection = | { ids: Array; objectType: typeof ObjectType.SEGMENT } | { ids: Array; objectType: typeof ObjectType.VENUE } ...

Added methods:

  • isLayerCheckboxChecked
  • setLayerCheckboxChecked

Added canEditTurnsThroughNode to Turns class

Previously, we had a house number mode activated by clicking a special button. This fired an event used by scripts to detect on-screen HN input. Due to the house number revamp, this event is no longer fired, and there's no special mode to edit HN. added an event wme-map-house-number-marker-added indicating when a user places a house number on the map. This event replaces the previous event wme-editing-house-numbers related to house number mode.

v2.278

Added a "Working with geometries" section with an example showing how to process complex geometries (MultiLineStrings, MultiPolygons, etc.) using turf.flatten.

Add usage examples to Map.addLayer method, covering approaches to feature styling.

Attributes added to Segment interface:

  • length
  • separator
  • level
  • allowNoDirection Added ability to update level via SDK Segment.updateSegment method

Allow to update fromLanesInfo/toLanesInfo with null, that will remove lanes info for a segment.

v2.266

Before this CL, the updateAddress method for a Venue with empty address triggered an exception. This fix allows to update Venue's streetId, even if the Venue does not have it now.

Implement Map.getPixelFromLonLat method, that returns the pixel coordinates on the screen of the given LonLat coordinates.

v2.265

Add isTwoWay method to Segment model, that allows to distinguish between two-way and undetermined segment direction. Include the corresponding attribute to SDK Segment model output.

This CL allows SDK users to create a shortcut without defining shortcut keys. This empty shortcut will be displayed in the shortcuts dialog, and users will be able to define a custom key combination.

Allow to update lockRank via SDK Segment.updateSegment method.

v2.264

Add "wme-feature-editor-opened" event that triggers when the feature editor was rendered.

Document the issues that may happen when using wrong @run-at setting [1], or @grant headers [2], [3]. [1] https://www.tampermonkey.net/documentation.php#meta:run_at [2] https://www.tampermonkey.net/documentation.php#meta:grant [3] http://shortn/_lK8EfA3KOK

Fix typo in turns filtering that prevented Turns.getTurnsThroughNode that led to getting only unknown turns instead of known ones.

v2.262

Add support for getting an update request session for the MapUpdateRequests model.

Add the following map events: mousemove, mousedown, mouseup, addlayer, removelayer.

Shortcuts.deleteShortcut method now removes the group if it is deleting the last shortcut in it.

Allow to check a specific Venue permission by using the hasPermissions method.

Allow to update fwdToll/revToll attributes via updateSegment method.

Add support for getAll, getById and getAddress methods for the RestrictedDrivingAreas model.

Shortcuts.getAllShortcuts() now returns the original shortcut string.

Allow to check a specific Segment permission by using the hasPermissions method.

v2.260

Remove message noting this SDK is in early adoption mode.

v2.259

Add new stateId property to the SDK output for a City object.

v2.257

Support including dynamic feature styles when adding a layer.

Create PermanentHazards model, add support for getAllCameras and getByCameraId methods in it.

Add Segment lanes info into the SDK output and allow to update the info through the updateSegment method.

Add wme-map-move-end event which fires when map move is complete. The wme-map-move event added in http://wger/944464 is fired continuously while the map is being dragged.

v2.256

Add support for getAll and getById methods for the ManagedAreas model.

Support marker DOM element retrieval from the getFeatureDomElement method.

Support retrieval of the SVG DOM element, that is rendered for a feature in the map, by the feature id and its layer name.

v2.255

Add the daily edit counts to the UserProfile interface. Rename editCount to totalEditCount to clarify difference.

v2.254

Hash for the script: sha256-c3CetKrjl6LG3ufzMQDbBziMP7naDmn6ehtnHi/2zWo=

Trigger events on the SDK.Events module when a data model repository triggers:

  • objectschanged
  • objectssynced
  • objectsadded
  • objectsremoved To turn on tracking, first call SDK.Events.trackDataModelEvents.

Add an event triggered on the SDK.Events module when a feature is clicked on a tracked layer. To turn on tracking, first call SDK.Events.trackLayerEvents.

v2.253

Support adding a raster tile layer via the SDK.

v2.252

Convert getters in the State module into methods and add tracking of method calls BREAKING CHANGE

Migrate SDK events from the DOM CustomEvents to the SDK event bus (see the Sdk.Events module). Errors from event handlers are caught and will not break the execution. BREAKING CHANGE

Add info about subsequent getWmeSdk() calls

Add a window.SDK_INITIALIZED promise that is available for userscripts on DOMContentLoaded event before the WME is initialized. The promise gets resolved once the getWmeSdk() function is available on the window. Since the promise is available so early, userscripts can rely on it for their initialization: window.SDK_INITIALIZED.then(initScript)

  • Generate the SDK changelog from semantic commit messages that have an sdk scope
  • Update the typedoc to be able to reference external markdown documents
  • Reference the changelog from the docs generated by the typedoc

v2.251

  • generate a single tree-shaken typings file for the SDK
  • build an npm package in .tgz format
  • put the package next to the sdk docs
  • add a usage example to the README with placeholders
  • build script to replace placeholders with the public url of the typings package

v2.250

v2.249

Add save success/failure events to the SDK.

v2.248

  1. Add description of SDK modules and functionality of each one
  2. Add list of triggered events and usage example
  3. Add migration guide listing SDK methods for commonly used internal WME instances

v2.247

SDK methods can only modify layers that were created using the SDK.

  • add Map.isLayerVisible()
  • add Map.setLayerVisibility()
  • add Map.getLayerOpacity()
  • add Map.setLayerOpacity()
  • add Map.addFeaturesToLayer()
  • add Map.removeFeaturesFromLayer()
  • add Map.removeAllFeaturesFromLayer()

Add the attribute defaultLaneWidthPerRoadType to the country interface exposed in the SDK.

Use the action UpdateFeatureGeometry when updating a venue geometry. The method updateVenue was previously using the UpdateObject action which does not apply the new geometry.

Fix bugs in setSelection method:

  • setSelection with empty array clears selection
  • setSelection replaces selected objects Extract unselect logic to new method, clearSelection, instead of allowing null in setSelection

Add methods to get brands for relevant categories.

Validate the lon/lat arg is defined for:

  • Map.setMapCenter
  • Segments.createRoundabout

v2.246

v2.245

Support check if shortcut keys are in use.

Changes the region code and reloads the app.

v2.243

add a helper method to update segment address and alt addresses

add a helper method to update address of the venue

Introduce an SdkMethodTracker decorator that wraps SDK methods and reports their execution using web event. All SDK modules now need to extend an abstract SdkModule class to ensure that they have a scriptId available. For the same reason, static methods no longer allowed. Track Shortcuts module methods execution. Remaining SDK modules would be migrated in a follow-up CL.

Make the ArgsValidatorDecorator to preserve the original decorated method name to improve error stacktraces.

  • allow to update fwd/rev segment speed limit
  • verify if user allowed to update each prop

make SdkArgumentValidator to allow no arg when all object fields are optional to improve userscripts SDK dev UX

add info and examples of valid shortcuts

v2.242

add a helper method to update a turn

add a helper method to find existing turn by id

  • add Turns.getTurnsFromSegment()
  • add Turns.getTurnsToSegment()

add a helper method to find all the turns that go through the node

introduce a helper method to list all the turns on the map

Add script_name param to the sdk init event.

Get livemap link via sdk. Add new sdk tracking param for the livemap link.

Allow setting user settings via SDK:

  • isCompactMode
  • isCreateRoadsAsTwoWay
  • isCreateRoadsWithAllTurnsAllowed
  • isDisplayTransparentTurnArrows
  • isImperial
  • isSelectOnlyOnEmptySelection
  • isSpreadOverlappingTurnArrows

Convert Settings to class. Will be required in next CL in order to allow arg validation.

Add a method to get the current region code of the app.

Add a method to get the current local code and name.

Initialize the sdk with a script name as well as script id. The script name will be used for display purposes such as in the shortcut modal

Expose additional user settings via the sdk:

  • isCreateRoadsAsTwoWay
  • isCreateRoadsWithAllTurnsAllowed
  • isDisplayTransparentTurnArrows
  • isSelectOnlyOnEmptySelection
  • isSpreadOverlappingTurnArrows Modify the settings documentation for clarity. Extract Settings e2e tests to a file.

Modify the web event sent when a userscript initializes the wme sdk:

  • change the event name to "WME_USERSCRIPTS_SDK_INITIALIZED" for clarity
  • send the event after the sdk is initialized
  • add param for the initialized sdk as well as the requested version See sample of event: http://gpaste/6293112051990528

v2.241

Remove the patch that makes the SDK method Map.getMapExtent() to return a wrong value. Update the e2e test.

Add a way to draw a point on the map. The point is drawn on the sketch layer and so is temporary. The method returns the Point geometry which can later be wrapped into a feature and added to the map using DataLayer methods (i.e. addNode())

v2.240

Log message to console when initializing sdk.

an error is thrown if requested versions don't match

v2.239

Add function returning the user profile link for a given username. To replace access to W.Config.user_profile.url patched in userscripts-support.js

Add function to set the map zoom level.

Support an optional zoom level to set in setMapCenter.

Add methods to get the venue main/sub categories: sdk.DataModel.Venues.getVenueMainCategories() sdk.DataModel.Venues.getVenueSubCategories() This will replace patching W.Config in userscripts-support.js

the event is dispatched only if exposed WME preferences get changed

Validate doc comments with eslint plugins

  • add Map.addLayer() that supports feature styles per geometry type
  • add Map.removeLayer()
  • add Map.addFeatureToLayer()
  • add Map.removeFeatureFromLayer()
  • cover with e2e tests

Revise the sdk README and add usage disclaimer based on pwg consultation. Also reword/restyle some text.

v2.238

Update the SDK README file.

v2.237

Report an event when a userscript requests an sdk reference.

Pass the script id which was used to initialize an sdk instance into the Sidebar module which requires it to register the sidebar tab. Previously, registering the sidebar required passing the script id again.

Remove exposure of users data model from the sdk in order to not expose user ids (PII). Instead, add modification meta data to other data models so scripts can get the relevant information from there (createdBy/On, updatedBy/On). Instead of exposing user ids, get the createdBy/updatedBy username which is publicly displayed in the UI.

Add the methods isPracticeMode & isSnapshotMode to sdk editing Module. Also move isEditingHouseNumbers getter from WmeState to Editing module.

Add username (publicly visible) to logged in user data. This was already added and removed due to privacy concerns. Since the username is publicly visible (e.g. in edit history), we can add it back.

Add an SdkArgumentValidator decorator that validates sdk method options object using yup. If there's an error, a ValidationError is thrown. The Actions object became a class with a static method because decorators in object literal aren't working [0]. [0]: https://github.com/microsoft/TypeScript/issues/5770

Following design review and scripter feedback, reduce the data exposed when getting the logged in user state to only return: isAreaManager isCountryManager rank This can be augmented as required in the future. The user data was added in http://wger/942992.

Add method to getUserSettings which returns a subset of the preferences model. Currently returns isImperial and isCompactMode, based on the scripts usage. Return a single object instead of individual methods for simplicity.

v2.236

add a method to cover the UpdateObject & UpdateFeatureGeometry actions use case for venues for userscripts

add a method to cover the UpdateObject & UpdateFeatureGeometry actions use case for segments for userscripts

  • define a separate VenueCategory type with an id and localized name
  • use it in the Venues.addVenue()
  • add Venues.getVenueCategories() method that returns all available venue categories and their translations
  • add a snapshot test for the getVenueCategories() to ensure that we won't implicitly change the set of known venue categories

add a method to cover the AddAlternateStreet action use case for userscripts

Add two method to cover the AddOrGetStreet action use case for userscripts. Separate adding & getting the street for better dev UX.

Add two method to cover the AddOrGetCity action use case for userscripts. Separate adding & getting the city for better dev UX.

add a method to cover the CreateRoundabout action use case for userscripts

add a method to cover the AddVenue action use case for userscripts

add a method to cover the ModifyAllConnections action use case for userscripts

add a method to cover the MergeSegments action use case for userscripts

add a method to cover the DeleteObject and DeleteSegment actions

add a method to cover the AddSegment action use case for userscripts

v2.234

Introduce a state property and a DOM event for tracking if house numbers editor is enabled or not

v2.233

add a helper method to check if a shortcut (action) has already been registered

Add methods to create and remove script tabs. The registerScriptTab() waits for tab label and tab pane elements to be connected to the DOM. The waitForElementConnected() is integrated into the registerScriptTab() so there's no need to export it separately.

Add SDK methods to query and replace current selection.

trigger wme-selection-changed event when selecting or unselected data model objects

add a helper method to list all userscript shortcuts

Add a method to create and delete shortcuts. Shortcuts created with SDK have a forUserscript: true on them. Its impossible to delete a shortcut that wasn't created through the SDK. Shortcuts become visible in the shortcuts editor. Shortcut description becomes injected into I18n like WazeWrap does.

Add helper function to register a new shortcut group. The new group becomes visible in the keyboard shortcuts dialog. The group name is injected into I18n translations using technique similar to what WazeWrap does. Shortcuts e2e tests were extracted into a separate module. Introduced a generic InternalWMEError that indicates that some assumptions about how WME works were broken.

add unit test to check if all the fields are present

v2.232

Add properties to the city interface returned by sdk method:

  • countryId
  • isEmpty These properties are referenced in top scripts.

Add method to get a state by id.

  • Streets (b/340742761)
  • Segments (b/340742659)
  • Venues

Add property 'abbr' to the country interface used by the SDK. Prop is used by top downloaded script.

Instead of returning instances of data models from SDK methods, create facades over those models. Returning JSON objects instead of internal data models will decouple the WME internals from the userscripts relying on the SDK, allowing internal changes to be done freely without breaking usages. Furthermore, changes to the SDK interfaces will be recognized and announced to the community when changed.

Change method to get top city instead of city id. This is to align with the getters for top country and state.

v2.231

Add new method to SegmentsRestrictionsUseCase to detect if a segment has a toll-free restriction. Update unit tests for SegmentsRestrictionsUseCase.

add sdk helper function to undo all stacked actions

Introduce an Editing.save() method that would save changes or fail with an InvalidStateError if there's nothing to save or save is not allowed. The save also doesn't support edit suggestions yet.

v2.230

Add:

  • getSDKVersion
  • getWMEVersion
  • getWMEBackEndVersion

Support SDK functions:

  • getTopCityId
  • getTopState
  • getTopCountry

Add Settings.isImperial function to SDK.

v2.229

add sdk helper function to return a number of unsaved actions

also introduce a generic error for missing elements

the withSDK helper function simplifies writing tests for sdk functions

v2.227

this results into more readable type suggestions in LSP / IDEs

v2.224