@ibm-aspera/sdk 0.2.29 → 0.4.12

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.
Files changed (113) hide show
  1. package/README.md +17 -13
  2. package/dist/commonjs/app/core.d.ts +234 -0
  3. package/dist/commonjs/app/core.js +812 -0
  4. package/dist/commonjs/app/installer.d.ts +9 -0
  5. package/dist/commonjs/app/installer.js +50 -0
  6. package/dist/commonjs/connect/core.d.ts +11 -0
  7. package/dist/commonjs/connect/core.js +73 -0
  8. package/dist/commonjs/constants/constants.d.ts +8 -0
  9. package/dist/commonjs/constants/constants.js +11 -0
  10. package/dist/commonjs/constants/messages.d.ts +38 -0
  11. package/dist/commonjs/constants/messages.js +41 -0
  12. package/dist/commonjs/helpers/client/client.d.ts +5 -0
  13. package/dist/commonjs/helpers/client/client.js +7 -0
  14. package/dist/commonjs/helpers/client/http-client.d.ts +42 -0
  15. package/dist/commonjs/helpers/client/http-client.js +84 -0
  16. package/dist/commonjs/helpers/client/safari-client.d.ts +101 -0
  17. package/dist/commonjs/helpers/client/safari-client.js +264 -0
  18. package/dist/commonjs/helpers/helpers.d.ts +109 -0
  19. package/dist/commonjs/helpers/helpers.js +249 -0
  20. package/dist/commonjs/helpers/http.d.ts +16 -0
  21. package/dist/commonjs/helpers/http.js +42 -0
  22. package/dist/commonjs/helpers/ws.d.ts +62 -0
  23. package/dist/commonjs/helpers/ws.js +161 -0
  24. package/dist/commonjs/http-gateway/core.d.ts +98 -0
  25. package/dist/commonjs/http-gateway/core.js +388 -0
  26. package/dist/commonjs/http-gateway/download.d.ts +14 -0
  27. package/dist/commonjs/http-gateway/download.js +187 -0
  28. package/dist/commonjs/http-gateway/index.d.ts +11 -0
  29. package/dist/commonjs/http-gateway/index.js +11 -0
  30. package/dist/commonjs/http-gateway/models.d.ts +16 -0
  31. package/dist/commonjs/http-gateway/models.js +2 -0
  32. package/dist/commonjs/http-gateway/upload.d.ts +14 -0
  33. package/dist/commonjs/http-gateway/upload.js +124 -0
  34. package/dist/commonjs/index.d.ts +12 -0
  35. package/dist/commonjs/index.js +109 -0
  36. package/dist/commonjs/models/aspera-sdk.model.d.ts +259 -0
  37. package/dist/commonjs/models/aspera-sdk.model.js +349 -0
  38. package/dist/commonjs/models/models.d.ts +760 -0
  39. package/dist/commonjs/models/models.js +2 -0
  40. package/dist/js/aspera-sdk.js +3 -0
  41. package/dist/js/aspera-sdk.js.LICENSE.txt +15 -0
  42. package/dist/js/aspera-sdk.js.map +1 -0
  43. package/package.json +8 -5
  44. package/.editorconfig +0 -13
  45. package/.github/CODEOWNERS +0 -1
  46. package/.github/CODE_OF_CONDUCT.md +0 -128
  47. package/.github/CONTRIBUTING.md +0 -147
  48. package/.github/dependabot.yml +0 -10
  49. package/.github/workflows/ci.yml +0 -39
  50. package/.github/workflows/documentation.yml +0 -44
  51. package/.github/workflows/publish.yml +0 -23
  52. package/.github/workflows/version.yml +0 -32
  53. package/.whitesource +0 -3
  54. package/CHANGELOG.md +0 -204
  55. package/docs/DEVELOPMENT.md +0 -38
  56. package/eslint.config.js +0 -104
  57. package/example/README.md +0 -7
  58. package/example/index.html +0 -14
  59. package/example/package-lock.json +0 -2989
  60. package/example/package.json +0 -30
  61. package/example/public/404.html +0 -5
  62. package/example/public/sdk-code.js +0 -326
  63. package/example/src/App/App.scss +0 -40
  64. package/example/src/App/index.tsx +0 -196
  65. package/example/src/Views/AllTogether.tsx +0 -26
  66. package/example/src/Views/DragDrop.tsx +0 -23
  67. package/example/src/Views/Home.tsx +0 -10
  68. package/example/src/Views/Initialize.tsx +0 -31
  69. package/example/src/Views/Installer.tsx +0 -154
  70. package/example/src/Views/MonitorTransfers.tsx +0 -88
  71. package/example/src/Views/Other.tsx +0 -24
  72. package/example/src/Views/SelectItems.tsx +0 -46
  73. package/example/src/Views/StartTransfer.tsx +0 -37
  74. package/example/src/Views/Test.tsx +0 -20
  75. package/example/src/Views/Views.scss +0 -111
  76. package/example/src/helpers/index.ts +0 -19
  77. package/example/src/index.scss +0 -47
  78. package/example/src/main.tsx +0 -17
  79. package/example/src/vite-env.d.ts +0 -2
  80. package/example/tsconfig.json +0 -30
  81. package/example/vite.config.ts +0 -23
  82. package/jest.config.js +0 -19
  83. package/jest.setup.js +0 -0
  84. package/renovate.json +0 -12
  85. package/src/app/core.ts +0 -765
  86. package/src/app/installer.ts +0 -53
  87. package/src/connect/core.ts +0 -83
  88. package/src/constants/constants.ts +0 -19
  89. package/src/constants/messages.ts +0 -35
  90. package/src/helpers/client/client.ts +0 -11
  91. package/src/helpers/client/http-client.ts +0 -92
  92. package/src/helpers/client/safari-client.ts +0 -334
  93. package/src/helpers/helpers.ts +0 -253
  94. package/src/helpers/http.ts +0 -39
  95. package/src/helpers/ws.ts +0 -191
  96. package/src/http-gateway/core.ts +0 -273
  97. package/src/http-gateway/download.ts +0 -217
  98. package/src/http-gateway/index.ts +0 -19
  99. package/src/http-gateway/models.ts +0 -20
  100. package/src/http-gateway/upload.ts +0 -148
  101. package/src/index.ts +0 -72
  102. package/src/models/aspera-sdk.model.ts +0 -446
  103. package/src/models/models.ts +0 -740
  104. package/tests/client.spec.ts +0 -52
  105. package/tests/core.spec.ts +0 -13
  106. package/tests/helpers.spec.ts +0 -127
  107. package/tests/http.spec.ts +0 -14
  108. package/tests/installer.spec.ts +0 -135
  109. package/tests/mocks.ts +0 -11
  110. package/tsconfig.json +0 -14
  111. package/tsconfig.module.json +0 -16
  112. package/typedoc.js +0 -7
  113. package/webpack.config.js +0 -35
@@ -1,31 +0,0 @@
1
- import './Views.scss';
2
- import { Button, CodeSnippet, TextInput } from '@carbon/react';
3
- import { useEffect, useState } from 'react';
4
- import hljs from 'highlight.js';
5
-
6
- export default function Initialize() {
7
- const [gatewayServer, setGatewayServer] = useState(localStorage.getItem('ASPERA-SDK-GATEWAY') || '');
8
-
9
- useEffect(() => {
10
- document.querySelector('.cds--snippet-container > pre > code')?.classList.add('language-javascript');
11
- hljs.highlightAll();
12
- }, []);
13
-
14
- const setGatewayUrl = (value: string): void => {
15
- localStorage.setItem('ASPERA-SDK-GATEWAY', value);
16
- setGatewayServer(value);
17
- }
18
-
19
- return (
20
- <div className="example-pages">
21
- <h2>Code example</h2>
22
- <CodeSnippet type="multi" feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{window.initializeAspera.toString()}</CodeSnippet>
23
- <h2>Try it out</h2>
24
- <Button onClick={() => window.initializeAspera(false, gatewayServer, false)}>Initialize SDK</Button>
25
- <Button onClick={() => window.initializeAspera(true, gatewayServer, false)}>Initialize SDK (multi user)</Button>
26
- <Button onClick={() => window.initializeAspera(true, gatewayServer, false, true)}>Initialize SDK (force Connect)</Button>
27
- <Button onClick={() => window.initializeAspera(true, gatewayServer, true)}>Initialize SDK (force gateway)</Button>
28
- <TextInput id="gateway-server-id" className="code-input" value={gatewayServer} onChange={value => setGatewayUrl(value.target.value)} labelText="HTTP Gateway URL" helperText="The HTTP Gateway Server to start up with Desktop" />
29
- </div>
30
- );
31
- };
@@ -1,154 +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 entries: {platform: string; type: string; url: string; version: string; arch: string}[] = [];
69
- public wrapperStyle = {position: 'fixed', bottom: '0px', right: '32px', height: '260px', width: '280px', 'background-color': '#444', padding: '16px 20px'};
70
- public buttonStyle = {display: 'block', width: '100%', 'margin-bottom': '16px', padding: '8px'};
71
-
72
- ngOnInit() {
73
- window.asperaSdk.getInstallerInfo().then(response => {
74
- // Installers for your platform. While normally just one. Some OS may provide multiple for user to choose.
75
- this.entries = response.entries;
76
- }).catch(error => {
77
- console.error('Installer info get failed', error);
78
- });
79
- }
80
-
81
- public launch() {
82
- window.asperaSdk.launch();
83
- }
84
-
85
- public install(url: string) {
86
- window.open(url, '_blank', 'noopener,noreferrer');
87
- }
88
- }`;
89
-
90
- const InstallerViewVue = `<script setup>
91
- import { ref } from 'vue';
92
-
93
- // Value for installer list
94
- const entries = ref([]);
95
- const wrapperStyle = {position: 'fixed', bottom: '0', right: '32px', height: '260px', width: '280px', backgroundColor: '#444', padding: '16px 20px'};
96
- const buttonStyle = {display: 'block', width: '100%', marginBottom: '16px', padding: '8px'};
97
-
98
- const launch = () => {
99
- window.asperaSdk.launch();
100
- };
101
-
102
- const install = (url) => {
103
- window.open(url, '_blank', 'noopener,noreferrer');
104
- };
105
-
106
- window.asperaSdk.getInstallerInfo().then(response => {
107
- // Installers for your platform. While normally just one. Some OS may provide multiple for user to choose.
108
- entries.value = response.entries;
109
- }).catch(error => {
110
- console.error('Installer info get failed', error);
111
- });
112
- </script>
113
-
114
- <template>
115
- <div :style="wrapperStyle">
116
- <h4 :style="{marginBottom: '20px', color: '#fff'}">IBM Aspera Installer</h4>
117
- <button :style="buttonStyle" type="button" @click="launch()">Launch</button>
118
- <button v-for="entry of entries" :style="buttonStyle" type="button" @click="install(entry.url)">Install ({{entry.platform}} - {{entry.type}})</button>
119
- </div>
120
- </template>
121
- `;
122
-
123
- export default function Installer() {
124
- const [tabIndex, setTabIndex] = useState(0);
125
-
126
- useEffect(() => {
127
- document.querySelectorAll('.cds--snippet-container > pre > code')?.forEach(item => item.classList.add('language-javascript'));
128
- hljs.highlightAll();
129
- window.installerAspera();
130
-
131
- return () => {
132
- document.querySelector('#aspera-installer-test')?.remove();
133
- }
134
- }, []);
135
-
136
- const getCodeView = (code: string, index: number): React.ReactNode => {
137
- return <CodeSnippet key={index} type="multi" className={index !== tabIndex ? 'hidden' : ''} feedback="Copied to clipboard" maxCollapsedNumberOfRows={25}>{code}</CodeSnippet>;
138
- }
139
-
140
- return (
141
- <div className="example-pages">
142
- <h2>Code example</h2>
143
- <Tabs selectedIndex={tabIndex} onChange={(data => setTabIndex(data.selectedIndex))}>
144
- <TabList>
145
- <Tab>React</Tab>
146
- <Tab>JavaScript</Tab>
147
- <Tab>Angular</Tab>
148
- <Tab>Vue</Tab>
149
- </TabList>
150
- </Tabs>
151
- {[InstallerViewReact, window.installerAspera.toString(), InstallerViewAngular, InstallerViewVue].map((item, index) => getCodeView(item, index))}
152
- </div>
153
- );
154
- };
@@ -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') && !transfer.httpGatewayTransfer;
51
- const canResume = transfer.status === 'paused' && !transfer.httpGatewayTransfer;
52
- const canOpen = transfer.status === 'completed' && transfer.transfer_spec.direction === 'receive' && !transfer.httpGatewayTransfer;
53
-
54
- return (
55
- <ListItem className="transfer-row" key={transfer.uuid} title={transfer.uuid}>
56
- {(transfer.httpDownloadExternalHandle && transfer.status === 'running') ? 'Downloaded via browser' : transfer.status} - {transfer.httpDownloadExternalHandle ? '' : `${(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,24 +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()].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
- </div>
23
- );
24
- };
@@ -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}, index: number) => <ListItem key={index}>{file.name} ({file.size} - {file.type})</ListItem>)}
39
- </UnorderedList> ) : (
40
- <h4>No files selected</h4>
41
- )
42
- }
43
- </div>
44
- </div>
45
- );
46
- };
@@ -1,37 +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(localStorage.getItem('ASPERA-SDK-TRANSFER-SPEC') || '');
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
- const setTransferSpecItem = (value: string): void => {
24
- localStorage.setItem('ASPERA-SDK-TRANSFER-SPEC', value);
25
- setTransferSpec(value);
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.startTransferAspera.toString()}</CodeSnippet>
32
- <h2>Try it out</h2>
33
- <TextArea className="code-input" value={transferSpec} onChange={value => setTransferSpecItem(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." />
34
- <Button onClick={startTransfer}>Start transfer</Button>
35
- </div>
36
- );
37
- };
@@ -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
- };
@@ -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
- }
@@ -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 basename='/aspera-sdk-js'>
15
- <App />
16
- </BrowserRouter>,
17
- );
@@ -1,2 +0,0 @@
1
- /// <reference types="vite/client" />
2
- declare module '@ibm-aspera/sdk';
@@ -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
- }
@@ -1,23 +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
- base: '/aspera-sdk-js/',
8
- resolve: {
9
- alias: {
10
- '~@ibm/plex': path.resolve(__dirname, 'node_modules/@ibm/plex'),
11
- '@ibm-aspera/sdk': path.resolve(__dirname, '../src'),
12
- },
13
- },
14
- plugins: [
15
- react(),
16
- // basicSsl()
17
- ],
18
- assetsInclude: ['**/*.md'],
19
- server: {
20
- host: 'js-sdk.aspera.us',
21
- open: true,
22
- },
23
- });
package/jest.config.js DELETED
@@ -1,19 +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
- 'node_modules/@ibm-aspera/.+\\.(j|t)sx?$': 'ts-jest',
14
- },
15
- 'testRegex': '/tests/.*\\.spec\\.ts$',
16
- 'transformIgnorePatterns': [
17
- 'node_modules/(?!@ibm-aspera/.*)'
18
- ],
19
- };