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.
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).
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:
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.
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.
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:
Added wme-house-number-added|wme-house-number-moved|wme-house-number-updated|wme-house-number-deleted events
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.
Implement EditSuggestions.getAll and EditSuggestions.getById methods.
Add TurnClosures.addClosure method that allows adding new TurnClosure.
Implement TurnClosures.getAll and TurnClosures.getById methods.
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.
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.
Include x, y, lon, lat coordinates of the pointer to the mouse events.
Add possibility to redraw a map layer through SDK.
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
added the method moveNode into Nodes class
Added Parking Lot class with methods:
Added Charging Station class with methods:
Add method to dangerously add features to layer without validation for viewing in exceptional cases.
add Junctions object support to DataModel
Added venueUpdateRequests property to the Venue interface
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:
Add new hasClosures property to the SDK output for a Segment object.
Add new regionCode property to the SDK output for a Country object.
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.
addIntersection returns ids of the four newly created segments
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.
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:
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.
Selection interface was replaced with Selection type:
type Selection =
| { ids: Array
Added methods:
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.
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:
Allow to update fromLanesInfo/toLanesInfo with null, that will remove lanes info for a segment.
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.
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.
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.
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.
Remove message noting this SDK is in early adoption mode.
Add new stateId property to the SDK output for a City object.
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.
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.
Add the daily edit counts to the UserProfile interface.
Rename editCount
to totalEditCount
to clarify difference.
Hash for the script: sha256-c3CetKrjl6LG3ufzMQDbBziMP7naDmn6ehtnHi/2zWo=
Trigger events on the SDK.Events module when a data model repository triggers:
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.
Support adding a raster tile layer via the SDK.
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)
Add save success/failure events to the SDK.
SDK methods can only modify layers that were created using the SDK.
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:
Add methods to get brands for relevant categories.
Validate the lon/lat arg is defined for:
Support check if shortcut keys are in use.
Changes the region code and reloads the app.
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.
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
add a helper method to update a turn
add a helper method to find existing turn by id
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:
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:
Modify the web event sent when a userscript initializes the wme sdk:
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())
Log message to console when initializing sdk.
an error is thrown if requested versions don't match
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
Revise the sdk README and add usage disclaimer based on pwg consultation. Also reword/restyle some text.
Update the SDK README file.
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.
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
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
Introduce a state property and a DOM event for tracking if house numbers editor is enabled or not
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
Add properties to the city interface returned by sdk method:
Add method to get a state by id.
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.
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.
Add:
Support SDK functions:
Add Settings.isImperial function to SDK.
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
this results into more readable type suggestions in LSP / IDEs