@ibm-aspera/sdk 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/app/core.d.ts +2 -1
- package/dist/commonjs/app/core.js +10 -3
- package/dist/commonjs/constants/messages.d.ts +1 -0
- package/dist/commonjs/constants/messages.js +1 -0
- package/dist/js/aspera-sdk.js +1 -1
- package/dist/js/aspera-sdk.js.LICENSE.txt +1 -1
- package/dist/js/aspera-sdk.js.map +1 -1
- package/package.json +3 -3
- package/.editorconfig +0 -13
- package/.eslintrc.js +0 -131
- package/.github/CODE_OF_CONDUCT.md +0 -128
- package/.github/CONTRIBUTING.md +0 -147
- package/.github/workflows/ci.yml +0 -36
- package/.github/workflows/documentation.yml +0 -43
- package/.github/workflows/npm_upload.yml +0 -30
- package/.husky/pre-commit +0 -4
- package/CHANGELOG.md +0 -165
- package/docs/DEVELOPMENT.md +0 -38
- package/example/README.md +0 -7
- package/example/index.html +0 -14
- package/example/package-lock.json +0 -2847
- package/example/package.json +0 -29
- package/example/public/404.html +0 -5
- package/example/public/sdk-code.js +0 -334
- package/example/src/App/App.scss +0 -40
- package/example/src/App/index.tsx +0 -174
- package/example/src/Views/AllTogether.tsx +0 -26
- package/example/src/Views/DragDrop.tsx +0 -23
- package/example/src/Views/Home.tsx +0 -10
- package/example/src/Views/Initialize.tsx +0 -21
- package/example/src/Views/Installer.tsx +0 -119
- package/example/src/Views/MonitorTransfers.tsx +0 -88
- package/example/src/Views/Other.tsx +0 -25
- package/example/src/Views/SelectItems.tsx +0 -46
- package/example/src/Views/StartTransfer.tsx +0 -32
- package/example/src/Views/Test.tsx +0 -20
- package/example/src/Views/Views.scss +0 -111
- package/example/src/helpers/index.ts +0 -19
- package/example/src/index.scss +0 -47
- package/example/src/main.tsx +0 -17
- package/example/src/vite-env.d.ts +0 -2
- package/example/tsconfig.json +0 -30
- package/example/vite.config.ts +0 -22
- package/jest.config.js +0 -15
- package/jest.setup.js +0 -0
- package/src/app/core.ts +0 -611
- package/src/app/installer.ts +0 -53
- package/src/constants/constants.ts +0 -19
- package/src/constants/messages.ts +0 -29
- package/src/helpers/client/client.ts +0 -11
- package/src/helpers/client/http-client.ts +0 -92
- package/src/helpers/client/safari-client.ts +0 -334
- package/src/helpers/helpers.ts +0 -214
- package/src/helpers/http.ts +0 -39
- package/src/helpers/ws.ts +0 -215
- package/src/index.ts +0 -78
- package/src/models/aspera-sdk.model.ts +0 -399
- package/src/models/models.ts +0 -676
- package/tests/client.spec.ts +0 -52
- package/tests/core.spec.ts +0 -13
- package/tests/helpers.spec.ts +0 -124
- package/tests/http.spec.ts +0 -14
- package/tests/installer.spec.ts +0 -135
- package/tests/mocks.ts +0 -11
- package/tsconfig.json +0 -13
- package/tsconfig.module.json +0 -16
- package/typedoc.js +0 -17
- package/webpack.config.js +0 -35
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import './Views.scss';
|
|
2
|
-
import { CodeSnippet, Tab, TabList, Tabs } from '@carbon/react';
|
|
3
|
-
import React, { useEffect, useState } from 'react';
|
|
4
|
-
import hljs from 'highlight.js';
|
|
5
|
-
|
|
6
|
-
const InstallerViewReact = `const InstallerView = () => {
|
|
7
|
-
/**
|
|
8
|
-
* React function to render a basic installer window
|
|
9
|
-
* Inline styling used to make it easy to copy.
|
|
10
|
-
* After successful init you should usually remove this.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const [installers, setInstallers] = React.useState([]);
|
|
14
|
-
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
window.asperaSdk.getInstallerInfo().then(response => {
|
|
17
|
-
// Installers for your platform. While normally just one. Some OS may provide multiple for user to choose.
|
|
18
|
-
setInstallers(response.entries);
|
|
19
|
-
}).catch(error => {
|
|
20
|
-
console.error('Installer info get failed', error);
|
|
21
|
-
});
|
|
22
|
-
}, []);
|
|
23
|
-
|
|
24
|
-
const launch = () => {
|
|
25
|
-
window.asperaSdk.launch();
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const install = (url) => {
|
|
29
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div style={{position: 'fixed', bottom: 0, right: 32, height: 260, width: 280, backgroundColor: '#444', padding: '16px 20px'}}>
|
|
34
|
-
<h4 style={{marginBottom: 20, color: '#fff'}}>IBM Aspera Installer</h4>
|
|
35
|
-
<button style={{display: 'block', width: '100%', marginBottom: 16, padding: 8}} type="button" onClick={launch}>Launch</button>
|
|
36
|
-
{installers.map(installer => {
|
|
37
|
-
return (
|
|
38
|
-
<button
|
|
39
|
-
key={installer.platform + installer.type}
|
|
40
|
-
style={{display: 'block', width: '100%', marginBottom: 16, padding: 8}}
|
|
41
|
-
type="button"
|
|
42
|
-
onClick={() => install(installer.url)}
|
|
43
|
-
>
|
|
44
|
-
Install ({installer.platform} - {installer.type})
|
|
45
|
-
</button>
|
|
46
|
-
);
|
|
47
|
-
})}
|
|
48
|
-
</div>
|
|
49
|
-
);
|
|
50
|
-
};`;
|
|
51
|
-
|
|
52
|
-
const InstallerViewAngular = `import {Component, OnInit} from '@angular/core';
|
|
53
|
-
import {CommonModule} from '@angular/common';
|
|
54
|
-
|
|
55
|
-
@Component({
|
|
56
|
-
selector: 'aspera-installer',
|
|
57
|
-
imports: [CommonModule],
|
|
58
|
-
template: \`
|
|
59
|
-
<div [ngStyle]="wrapperStyle">
|
|
60
|
-
<h4 [ngStyle]="{'margin-bottom': '20px', color: '#fff'}">IBM Aspera Installer</h4>
|
|
61
|
-
<button type="button" [ngStyle]="buttonStyle" (click)="launch()">Launch</button>
|
|
62
|
-
<button type="button" *ngFor="let entry of entries" [ngStyle]="buttonStyle" (click)="install(entry.url)">Install ({{entry.platform}} - {{entry.type}})</button>
|
|
63
|
-
</div>
|
|
64
|
-
\`,
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
export class InstallerView implements OnInit {
|
|
68
|
-
public wrapperStyle = {position: 'fixed', bottom: '0px', right: '32px', height: '260px', width: '280px', 'background-color': '#444', padding: '16px 20px'};
|
|
69
|
-
public buttonStyle = {display: 'block', width: '100%', 'margin-bottom': '16px', padding: '8px'};
|
|
70
|
-
public entries: {platform: string; type: string; url: string; version: string; arch: string}[] = [];
|
|
71
|
-
|
|
72
|
-
ngOnInit() {
|
|
73
|
-
window.asperaSdk.getInstallerInfo().then(response => {
|
|
74
|
-
this.entries = response.entries;
|
|
75
|
-
}).catch(error => {
|
|
76
|
-
console.error('Installer info get failed', error);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
public launch() {
|
|
81
|
-
window.asperaSdk.launch();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
public install(url: string) {
|
|
85
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
86
|
-
}
|
|
87
|
-
}`;
|
|
88
|
-
|
|
89
|
-
export default function Installer() {
|
|
90
|
-
const [tabIndex, setTabIndex] = useState(0);
|
|
91
|
-
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
document.querySelectorAll('.cds--snippet-container > pre > code')?.forEach(item => item.classList.add('language-javascript'));
|
|
94
|
-
hljs.highlightAll();
|
|
95
|
-
window.installerAspera();
|
|
96
|
-
|
|
97
|
-
return () => {
|
|
98
|
-
document.querySelector('#aspera-installer-test')?.remove();
|
|
99
|
-
}
|
|
100
|
-
}, []);
|
|
101
|
-
|
|
102
|
-
const getCodeView = (code: string, index: number): React.ReactNode => {
|
|
103
|
-
return <CodeSnippet key={index} type="multi" className={index !== tabIndex ? 'hidden' : ''} feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{code}</CodeSnippet>;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<div className="example-pages">
|
|
108
|
-
<h2>Code example</h2>
|
|
109
|
-
<Tabs selectedIndex={tabIndex} onChange={(data => setTabIndex(data.selectedIndex))}>
|
|
110
|
-
<TabList>
|
|
111
|
-
<Tab>React</Tab>
|
|
112
|
-
<Tab>JavaScript</Tab>
|
|
113
|
-
<Tab>Angular</Tab>
|
|
114
|
-
</TabList>
|
|
115
|
-
</Tabs>
|
|
116
|
-
{[InstallerViewReact, window.installerAspera.toString(), InstallerViewAngular].map((item, index) => getCodeView(item, index))}
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import './Views.scss';
|
|
2
|
-
import { getAllTransfers } from '@ibm-aspera/sdk';
|
|
3
|
-
import { CodeSnippet, UnorderedList, ListItem, Link, Button } from '@carbon/react';
|
|
4
|
-
import { Renew } from '@carbon/icons-react';
|
|
5
|
-
import { iterableToArray } from '../helpers';
|
|
6
|
-
import { useEffect, useReducer } from 'react';
|
|
7
|
-
import hljs from 'highlight.js';
|
|
8
|
-
|
|
9
|
-
let transfers: Map<string, any> = new Map();
|
|
10
|
-
let destroyed = false;
|
|
11
|
-
|
|
12
|
-
export default function MonitorTransfers() {
|
|
13
|
-
const [_, forceUpdate] = useReducer(x => x + 1, 0);
|
|
14
|
-
|
|
15
|
-
const monitorTransfers = (): void => {
|
|
16
|
-
if (!destroyed) {
|
|
17
|
-
forceUpdate();
|
|
18
|
-
setTimeout(monitorTransfers, 1000);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
document.querySelector('.cds--snippet-container > pre > code')?.classList.add('language-javascript');
|
|
24
|
-
hljs.highlightAll();
|
|
25
|
-
transfers = window.monitorTransfersAspera();
|
|
26
|
-
monitorTransfers();
|
|
27
|
-
|
|
28
|
-
// Unmount cleanup
|
|
29
|
-
return () => {
|
|
30
|
-
destroyed = true;
|
|
31
|
-
}
|
|
32
|
-
}, []);
|
|
33
|
-
|
|
34
|
-
const reloadTransfers = (): void => {
|
|
35
|
-
getAllTransfers().then((transferUpdate: any[]) => {
|
|
36
|
-
transferUpdate.forEach(item => {
|
|
37
|
-
transfers.set(item.uuid, item);
|
|
38
|
-
});
|
|
39
|
-
}).catch((error: unknown) => {
|
|
40
|
-
console.error('Could not get all transfers on reload', error);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const removeTransfer = (transferId: string): void => {
|
|
45
|
-
transfers.delete(transferId);
|
|
46
|
-
window.removeTransferAspera(transferId);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const getTransferContent = (transfer: any): React.ReactNode => {
|
|
50
|
-
const running = transfer.status === 'running' || transfer.status === 'queued';
|
|
51
|
-
const canResume = transfer.status === 'paused';
|
|
52
|
-
const canOpen = transfer.status === 'completed' && transfer.transfer_spec.direction === 'receive';
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<ListItem className="transfer-row" key={transfer.uuid} title={transfer.uuid}>
|
|
56
|
-
{transfer.status} - {(transfer.percentage * 100).toFixed(1)}%
|
|
57
|
-
<Link onClick={() => removeTransfer(transfer.uuid)}>Remove</Link>
|
|
58
|
-
{running && <Link onClick={() => window.stopTransferAspera(transfer.uuid)}>Stop</Link>}
|
|
59
|
-
{canResume && <Link onClick={() => window.resumeTransferAspera(transfer.uuid)}>Resume</Link>}
|
|
60
|
-
{canOpen && <Link onClick={() => window.showDirectoryAspera(transfer.uuid)}>Show local</Link>}
|
|
61
|
-
<Link onClick={() => window.transferInfoAspera(transfer.uuid)}>Info</Link>
|
|
62
|
-
</ListItem>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const transferArray = iterableToArray(transfers.values());
|
|
67
|
-
const codeSnippet = [window.monitorTransfersAspera.toString(), window.removeTransferAspera.toString(), window.stopTransferAspera.toString(), window.resumeTransferAspera.toString(), window.showDirectoryAspera.toString(), window.transferInfoAspera.toString()].join('\n\n')
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<div className="example-pages">
|
|
71
|
-
<h2>Code example</h2>
|
|
72
|
-
<CodeSnippet type="multi" feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{codeSnippet}</CodeSnippet>
|
|
73
|
-
<h2>See it in action</h2>
|
|
74
|
-
<div className="ending-content">
|
|
75
|
-
{transferArray.length ? (
|
|
76
|
-
<UnorderedList>
|
|
77
|
-
{transferArray.map(transfer => getTransferContent(transfer))}
|
|
78
|
-
</UnorderedList> ) : (
|
|
79
|
-
<h4>
|
|
80
|
-
No transfers
|
|
81
|
-
<Button kind="ghost" aria-label="Reload transfers" iconDescription="Reload transfers" hasIconOnly={true} renderIcon={Renew} size="sm" style={{marginLeft: '1rem'}} onClick={reloadTransfers} />
|
|
82
|
-
</h4>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import './Views.scss';
|
|
2
|
-
import { Button, CodeSnippet } from '@carbon/react';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import hljs from 'highlight.js';
|
|
5
|
-
|
|
6
|
-
export default function Test() {
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
document.querySelector('.cds--snippet-container > pre > code')?.classList.add('language-javascript');
|
|
9
|
-
hljs.highlightAll();
|
|
10
|
-
}, []);
|
|
11
|
-
|
|
12
|
-
const codeSnippet = [window.getInfoAspera.toString(), window.showPreferencesAspera.toString(), window.registerStatusCallbackAspera.toString(), window.registerSafariExtensionStatusCallbackAspera.toString()].join('\n\n')
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<div className="example-pages">
|
|
16
|
-
<h2>Code example</h2>
|
|
17
|
-
<CodeSnippet type="multi" feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{codeSnippet}</CodeSnippet>
|
|
18
|
-
<h2>Try it out</h2>
|
|
19
|
-
<Button onClick={window.getInfoAspera}>Get info</Button>
|
|
20
|
-
<Button onClick={window.showPreferencesAspera}>Open preferences</Button>
|
|
21
|
-
<Button onClick={window.registerStatusCallbackAspera}>Status changes</Button>
|
|
22
|
-
<Button onClick={window.registerSafariExtensionStatusCallbackAspera}>Status changes (Safari)</Button>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import './Views.scss';
|
|
2
|
-
import { Button, CodeSnippet, ListItem, UnorderedList } from '@carbon/react';
|
|
3
|
-
import { useEffect, useReducer } from 'react';
|
|
4
|
-
import hljs from 'highlight.js';
|
|
5
|
-
|
|
6
|
-
let destroyed = false;
|
|
7
|
-
|
|
8
|
-
export default function SelectItems() {
|
|
9
|
-
const [_, forceUpdate] = useReducer(x => x + 1, 0);
|
|
10
|
-
|
|
11
|
-
const monitorFileChanges = (): void => {
|
|
12
|
-
if (!destroyed) {
|
|
13
|
-
forceUpdate();
|
|
14
|
-
setTimeout(monitorFileChanges, 1000);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
document.querySelector('.cds--snippet-container > pre > code')?.classList.add('language-javascript');
|
|
20
|
-
hljs.highlightAll();
|
|
21
|
-
monitorFileChanges();
|
|
22
|
-
|
|
23
|
-
return () => {
|
|
24
|
-
destroyed = true;
|
|
25
|
-
}
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div className="example-pages">
|
|
30
|
-
<h2>Code example</h2>
|
|
31
|
-
<CodeSnippet type="multi" feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{window.selectItemsAspera.toString()}</CodeSnippet>
|
|
32
|
-
<h2>Try it out</h2>
|
|
33
|
-
<Button onClick={() => window.selectItemsAspera(false)}>Select files</Button>
|
|
34
|
-
<Button onClick={() => window.selectItemsAspera(true)}>Select folders</Button>
|
|
35
|
-
<div className="ending-content">
|
|
36
|
-
{window.selectedFiles.length ? (
|
|
37
|
-
<UnorderedList>
|
|
38
|
-
{window.selectedFiles.map((file: {name: string; size: number; type: string}) => <ListItem>{file.name} ({file.size} - {file.type})</ListItem>)}
|
|
39
|
-
</UnorderedList> ) : (
|
|
40
|
-
<h4>No files selected</h4>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import './Views.scss';
|
|
2
|
-
import { Button, CodeSnippet, TextArea } from '@carbon/react';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import hljs from 'highlight.js';
|
|
5
|
-
|
|
6
|
-
export default function StartTransfer() {
|
|
7
|
-
const [transferSpec, setTransferSpec] = useState('');
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
document.querySelector('.cds--snippet-container > pre > code')?.classList.add('language-javascript');
|
|
11
|
-
hljs.highlightAll();
|
|
12
|
-
}, []);
|
|
13
|
-
|
|
14
|
-
const startTransfer = (): void => {
|
|
15
|
-
try {
|
|
16
|
-
window.startTransferAspera(JSON.parse(transferSpec));
|
|
17
|
-
} catch (error) {
|
|
18
|
-
console.error('Start transfer failed to parse transferSpec', {error, transferSpec});
|
|
19
|
-
alert('Unable to parse transfer spec for starting transfer');
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className="example-pages">
|
|
25
|
-
<h2>Code example</h2>
|
|
26
|
-
<CodeSnippet type="multi" feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{window.startTransferAspera.toString()}</CodeSnippet>
|
|
27
|
-
<h2>Try it out</h2>
|
|
28
|
-
<TextArea className="code-input" value={transferSpec} onChange={value => setTransferSpec(value.target.value)} labelText="Transfer spec" helperText="Paste a transfer spec to test a transfer. For uploads be sure to select the items first on the 'Select items' page." />
|
|
29
|
-
<Button onClick={startTransfer}>Start transfer</Button>
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import './Views.scss';
|
|
2
|
-
import { Button, CodeSnippet } from '@carbon/react';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import hljs from 'highlight.js';
|
|
5
|
-
|
|
6
|
-
export default function Test() {
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
document.querySelector('.cds--snippet-container > pre > code')?.classList.add('language-javascript');
|
|
9
|
-
hljs.highlightAll();
|
|
10
|
-
}, []);
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<div className="example-pages">
|
|
14
|
-
<h2>Code example</h2>
|
|
15
|
-
<CodeSnippet type="multi" feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{window.testAspera.toString()}</CodeSnippet>
|
|
16
|
-
<h2>Try it out</h2>
|
|
17
|
-
<Button onClick={window.testAspera}>Test SDK</Button>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.markdown-render {
|
|
3
|
-
h1 {
|
|
4
|
-
display: none;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
p {
|
|
8
|
-
margin-bottom: 1rem;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
h2, h3 {
|
|
12
|
-
margin-top: 1rem;
|
|
13
|
-
margin-bottom: 1.5rem;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
pre {
|
|
17
|
-
padding: 0.5rem;
|
|
18
|
-
background-color: var(--cds-layer-01);
|
|
19
|
-
margin-bottom: 1rem;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.example-pages {
|
|
24
|
-
h2 {
|
|
25
|
-
margin-bottom: 2rem;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.cds--snippet {
|
|
29
|
-
margin-bottom: 2rem;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.cds--btn {
|
|
33
|
-
margin-right: 1rem;
|
|
34
|
-
margin-bottom: 2rem;
|
|
35
|
-
max-width: 100%;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.cds--form-item {
|
|
39
|
-
margin-bottom: 1.5rem;
|
|
40
|
-
max-width: 48rem;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
pre, code {
|
|
44
|
-
font-family: 'IBM Plex Mono', monospace;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.code-input {
|
|
48
|
-
textarea, input {
|
|
49
|
-
font-family: 'IBM Plex Mono', monospace;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.cds--snippet--multi {
|
|
54
|
-
$max-width: 60rem;
|
|
55
|
-
max-width: $max-width;
|
|
56
|
-
max-inline-size: $max-width;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.drop-zone {
|
|
60
|
-
width: 25rem;
|
|
61
|
-
height: 5rem;
|
|
62
|
-
background-color: var(--cds-layer-02);
|
|
63
|
-
margin-bottom: 1.5rem;
|
|
64
|
-
display: flex;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
align-items: center;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.transfer-row {
|
|
70
|
-
.cds--link {
|
|
71
|
-
margin: 0 0.5rem;
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.hidden {
|
|
77
|
-
display: none;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.all-together {
|
|
82
|
-
.item-row {
|
|
83
|
-
display: flex;
|
|
84
|
-
flex-wrap: wrap;
|
|
85
|
-
|
|
86
|
-
&:not(.flat-space) {
|
|
87
|
-
gap: 1rem;
|
|
88
|
-
|
|
89
|
-
.item-area {
|
|
90
|
-
flex: 1;
|
|
91
|
-
min-width: 20rem;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&:not(:last-child) {
|
|
96
|
-
margin-bottom: 2rem;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.cds--btn--primary {
|
|
101
|
-
padding-right: 2rem;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
h2:not(.item-area--header) {
|
|
105
|
-
display: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.cds--snippet, .cds--tabs {
|
|
109
|
-
display: none;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert iterable (Map for example) to an array
|
|
3
|
-
* @param iterable - Map or iterable to convert to array
|
|
4
|
-
* @returns Array of items
|
|
5
|
-
*/
|
|
6
|
-
export const iterableToArray = (iterable: IterableIterator<unknown>): any[] => {
|
|
7
|
-
const newArray = [];
|
|
8
|
-
|
|
9
|
-
(function addItem(): void {
|
|
10
|
-
const value = iterable.next();
|
|
11
|
-
|
|
12
|
-
if (!value.done) {
|
|
13
|
-
newArray.push(value.value);
|
|
14
|
-
addItem();
|
|
15
|
-
}
|
|
16
|
-
}());
|
|
17
|
-
|
|
18
|
-
return newArray;
|
|
19
|
-
};
|
package/example/src/index.scss
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
@use '@carbon/react';
|
|
2
|
-
@import 'highlight.js/styles/tomorrow-night-bright.css';
|
|
3
|
-
|
|
4
|
-
@font-face {
|
|
5
|
-
font-family: 'IBM Plex Sans';
|
|
6
|
-
font-weight: 400;
|
|
7
|
-
src: url(~@ibm/plex/IBM-Plex-Sans/fonts/complete/woff2/IBMPlexSans-Regular.woff2) format('woff2');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@font-face {
|
|
11
|
-
font-family: 'IBM Plex Mono';
|
|
12
|
-
font-weight: 400;
|
|
13
|
-
src: url(~@ibm/plex/IBM-Plex-Mono/fonts/complete/woff2/IBMPlexMono-Regular.woff2) format('woff2');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@font-face {
|
|
17
|
-
font-family: 'IBM Plex Sans';
|
|
18
|
-
font-weight: 300;
|
|
19
|
-
src: url(~@ibm/plex/IBM-Plex-Sans/fonts/complete/woff2/IBMPlexSans-Light.woff2) format('woff2');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@font-face {
|
|
23
|
-
font-family: 'IBM Plex Sans';
|
|
24
|
-
font-weight: 600;
|
|
25
|
-
src: url(~@ibm/plex/IBM-Plex-Sans/fonts/complete/woff2/IBMPlexSans-SemiBold.woff2) format('woff2');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@font-face {
|
|
29
|
-
font-family: 'IBM Plex Sans';
|
|
30
|
-
font-weight: 700;
|
|
31
|
-
src: url(~@ibm/plex/IBM-Plex-Sans/fonts/complete/woff2/IBMPlexSans-Bold.woff2) format('woff2');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@font-face {
|
|
35
|
-
font-family: 'IBM Plex Sans';
|
|
36
|
-
font-style: italic;
|
|
37
|
-
src: url(~@ibm/plex/IBM-Plex-Sans/fonts/complete/woff2/IBMPlexSans-Italic.woff2) format('woff2');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.cds--snippet--multi .cds--snippet-container {
|
|
41
|
-
width: calc(100% - 3rem);
|
|
42
|
-
|
|
43
|
-
pre code {
|
|
44
|
-
background-color: unset;
|
|
45
|
-
overflow: auto;
|
|
46
|
-
}
|
|
47
|
-
}
|
package/example/src/main.tsx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { BrowserRouter } from "react-router";
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import './index.scss';
|
|
4
|
-
import App from './App';
|
|
5
|
-
|
|
6
|
-
// Aspera properties are put on window to avoid building and minifying and losing commments
|
|
7
|
-
declare global {
|
|
8
|
-
interface Window {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
createRoot(document.getElementById('root')!).render(
|
|
14
|
-
<BrowserRouter>
|
|
15
|
-
<App />
|
|
16
|
-
</BrowserRouter>,
|
|
17
|
-
);
|
package/example/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
-
"target": "ES2020",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
"jsx": "react-jsx",
|
|
17
|
-
|
|
18
|
-
/* Linting */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true,
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"noUncheckedSideEffectImports": true,
|
|
24
|
-
"allowJs": true,
|
|
25
|
-
"paths": {
|
|
26
|
-
"@ibm-aspera/sdk": ["./src/*"]
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"include": ["src"]
|
|
30
|
-
}
|
package/example/vite.config.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import react from '@vitejs/plugin-react';
|
|
3
|
-
import basicSsl from '@vitejs/plugin-basic-ssl';
|
|
4
|
-
import path from "path";
|
|
5
|
-
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
resolve: {
|
|
8
|
-
alias: {
|
|
9
|
-
'~@ibm/plex': path.resolve(__dirname, 'node_modules/@ibm/plex'),
|
|
10
|
-
'@ibm-aspera/sdk': path.resolve(__dirname, '../src'),
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
plugins: [
|
|
14
|
-
react(),
|
|
15
|
-
basicSsl()
|
|
16
|
-
],
|
|
17
|
-
assetsInclude: ['**/*.md'],
|
|
18
|
-
server: {
|
|
19
|
-
host: 'js-sdk.aspera.us',
|
|
20
|
-
open: true,
|
|
21
|
-
},
|
|
22
|
-
});
|
package/jest.config.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
'automock': false,
|
|
3
|
-
'setupFiles': [
|
|
4
|
-
'./jest.setup.js'
|
|
5
|
-
],
|
|
6
|
-
'moduleFileExtensions': [
|
|
7
|
-
'ts',
|
|
8
|
-
'js'
|
|
9
|
-
],
|
|
10
|
-
'testEnvironment': 'jsdom',
|
|
11
|
-
'transform': {
|
|
12
|
-
'^.+\\.tsx?$': 'ts-jest'
|
|
13
|
-
},
|
|
14
|
-
'testRegex': '/tests/.*\\.spec\\.ts$'
|
|
15
|
-
}
|
package/jest.setup.js
DELETED
|
File without changes
|