@contrail/flexplm 1.1.67-alpha.4 → 1.2.0
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/package.json
CHANGED
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { FlexPLMConnect } from '../src/util/flexplm-connect';
|
|
4
|
+
import { FCConfig } from '../src/interfaces/interfaces';
|
|
5
|
+
|
|
6
|
+
const config: FCConfig = {
|
|
7
|
+
apiHost: 'http://windchill.archergrey.com',
|
|
8
|
+
urlContext: '',
|
|
9
|
+
vibeEventEndpoint: '',
|
|
10
|
+
csrfEndpoint: '',
|
|
11
|
+
plmEnviornment: '',
|
|
12
|
+
userName: () => '', // fill in manually
|
|
13
|
+
password: () => '', // fill in manually
|
|
14
|
+
itemPreDevelopmentLifecycleStages: [],
|
|
15
|
+
payloadDefaultAsArray: true,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
async function main() {
|
|
19
|
+
const connect = new FlexPLMConnect(config);
|
|
20
|
+
const response = await connect.getRequest({
|
|
21
|
+
urlPath: '/Windchill/images/000001/000001/000001/cavkingcharlessmalldogs_medium_large-.-2965893984400.png',
|
|
22
|
+
includeUrlContext: false,
|
|
23
|
+
returnFullResponse: true,
|
|
24
|
+
}) as Response;
|
|
25
|
+
|
|
26
|
+
const buffer = Buffer.from(await response.arrayBuffer());
|
|
27
|
+
const outputPath = path.resolve(__dirname, 'output.png');
|
|
28
|
+
fs.writeFileSync(outputPath, buffer);
|
|
29
|
+
console.log(`Saved response to ${outputPath}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
main().catch((err) => {
|
|
33
|
+
console.error('Error:', err.message);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
});
|