desktop-deep-link
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -5,2 +5,17 @@ # Changelog | ||
## [1.5.0](https://github.com/friedrith/desktop-deep-link/compare/v1.4.2...v1.5.0) (2022-02-03) | ||
### Features | ||
* add figma ([f03369c](https://github.com/friedrith/desktop-deep-link/commit/f03369c5aaba554df1fb8d50e66187c0ef2c0768)) | ||
* add obsidian ([f6e7853](https://github.com/friedrith/desktop-deep-link/commit/f6e7853fb29d260de343faab5ad4da0361f9d7b9)) | ||
* add trello ([0356af2](https://github.com/friedrith/desktop-deep-link/commit/0356af2ce9dca833a252e5f04d76f15e2eea29f4)) | ||
* asana ([51d1b45](https://github.com/friedrith/desktop-deep-link/commit/51d1b45cbace3191f48ece5894208e93386031b4)) | ||
### Bug Fixes | ||
* adobexd ([87406e2](https://github.com/friedrith/desktop-deep-link/commit/87406e267bcb4bde01ef6ead7105dae3bba102d4)) | ||
### [1.4.2](https://github.com/friedrith/desktop-deep-link/compare/v1.4.1...v1.4.2) (2022-01-18) | ||
@@ -7,0 +22,0 @@ |
{ | ||
"name": "desktop-deep-link", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "A library to transform urls to deep link for a lot of desktop apps.", | ||
@@ -5,0 +5,0 @@ "main": "dist/tsc/index.js", |
@@ -1,8 +0,11 @@ | ||
import { modules } from './modules' | ||
import modules from './modules' | ||
import Module from './Module' | ||
const defaultModule = { | ||
export * from './modules' | ||
export const defaultModule = { | ||
id: '', | ||
match: () => true, | ||
transform: (uri: string): string => uri, | ||
open: () => '', | ||
} | ||
@@ -9,0 +12,0 @@ |
@@ -0,1 +1,3 @@ | ||
import OpenOptions from './OpenOptions' | ||
export default interface Module { | ||
@@ -5,2 +7,3 @@ id: string | ||
transform(url: string): string | ||
open(options: OpenOptions): string | ||
} |
@@ -5,4 +5,5 @@ import adobeXd from '../adobe-xd' | ||
'https://assets.adobe.com/id/urn:aaid:sc:EU:485dd3be-1c52-4147-1111-23dae6b7fe7e?view=difile' | ||
const deepLink = | ||
'adbxd://app?action=openCloudDoc&cloudURL=https%3A%2F%2Fcc-api-storage.adobe.io%2Fid%2Furn%3Aaaid%3Asc%3AEU%%3A485dd3be-1c52-4147-1111-23dae6b7fe7e' | ||
'adbxd://app?action=openCloudDoc&cloudURL=https%3A%2F%2Fcc-api-storage.adobe.io%2Fid%2Furn%3Aaaid%3Asc%3AEU%3A485dd3be-1c52-4147-1111-23dae6b7fe7e' | ||
@@ -9,0 +10,0 @@ describe('Adobe XD', () => { |
@@ -5,2 +5,3 @@ import vscode from '../vscode' | ||
const deepLink = 'vscode://file/Users/foo/bar.code-workspace' | ||
const filename = '/Users/foo/bar.json' | ||
@@ -23,2 +24,8 @@ describe('VS Code', () => { | ||
}) | ||
it('should return deep link to open', () => { | ||
expect(vscode.open({ filename })).toEqual( | ||
'vscode://file/Users/foo/bar.json' | ||
) | ||
}) | ||
}) |
@@ -12,6 +12,12 @@ /** | ||
match: (uri: string) => Boolean(uri.match(regex)), | ||
transform: (uri: string) => | ||
`adbxd://app?action=openCloudDoc&cloudURL=https%3A%2F%2Fcc-api-storage.adobe.io%2Fid%2Furn%3Aaaid%3Asc%3AEU%%3A${ | ||
uri.match(regex)?.[1] | ||
}`, | ||
transform: (uri: string) => { | ||
const apiUrl = uri | ||
.replace('https://assets.adobe.com', 'https://cc-api-storage.adobe.io') | ||
.replace(/\?.*/, '') | ||
return `adbxd://app?action=openCloudDoc&cloudURL=${encodeURIComponent( | ||
apiUrl | ||
)}` | ||
}, | ||
open: () => '', | ||
} |
@@ -5,2 +5,3 @@ export default { | ||
transform: (uri: string) => uri.replace('https://', 'discord://'), | ||
open: () => '', | ||
} |
@@ -8,3 +8,19 @@ import adobeXd from './adobe-xd' | ||
import zoom from './zoom' | ||
import figma from './figma' | ||
import asana from './asana' | ||
import trello from './trello' | ||
import obsidian from './obsidian' | ||
export const modules = [adobeXd, msTeams, notion, slack, todoist, vscode, zoom] | ||
export default [ | ||
adobeXd, | ||
asana, | ||
figma, | ||
msTeams, | ||
notion, | ||
slack, | ||
todoist, | ||
trello, | ||
vscode, | ||
zoom, | ||
obsidian, | ||
] |
@@ -16,2 +16,3 @@ /** | ||
}, | ||
open: () => '', | ||
} |
@@ -9,2 +9,3 @@ /** | ||
transform: (uri: string) => uri.replace('https://', 'notion://'), | ||
open: () => '', | ||
} |
@@ -21,2 +21,3 @@ /** | ||
}, | ||
open: () => '', | ||
} |
@@ -11,2 +11,3 @@ /** | ||
transform: (uri: string) => `todoist://project?id=${uri.match(regex)?.[1]}`, | ||
open: () => '', | ||
} |
@@ -10,2 +10,3 @@ /** | ||
transform: (uri: string) => uri.replace('file://', 'vscode://file'), | ||
open: ({ filename }) => `vscode://file${filename}`, | ||
} |
@@ -18,2 +18,3 @@ /** | ||
}, | ||
open: () => '', | ||
} |
37466
78
689