mirror of
https://github.com/openziti/zrok.git
synced 2025-08-12 17:27:29 +02:00
sdk work
This commit is contained in:
27
sdk/node/examples/pastebin/dist/index.js
vendored
Normal file
27
sdk/node/examples/pastebin/dist/index.js
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
const { Command } = require("commander"); // add this line
|
||||
const zrok = require("zrok");
|
||||
//const environ = require("zrok/environment")
|
||||
const program = new Command();
|
||||
program
|
||||
.command('copyto')
|
||||
.version("1.0.0")
|
||||
.description("command to host content to be pastedfrom'd")
|
||||
.action(() => {
|
||||
console.log('copyto command called');
|
||||
//console.log(environ)
|
||||
let root = zrok.Load();
|
||||
let shr = zrok.CreateShare(root, new zrok.ShareRequest(zrok.TCP_TUNNEL_BACKEND_MODE, zrok.PUBLIC_SHARE_MODE, "pastebin"));
|
||||
console.log(shr);
|
||||
zrok.DeleteShare(root, shr);
|
||||
});
|
||||
program
|
||||
.command('pastefrom <shrToken>')
|
||||
.version("1.0.0")
|
||||
.description("command to paste content from coptyo")
|
||||
.action((shrToken) => {
|
||||
console.log('pastefrom command called', shrToken);
|
||||
});
|
||||
program.parse(process.argv);
|
||||
const options = program.opts();
|
||||
//# sourceMappingURL=index.js.map
|
1
sdk/node/examples/pastebin/dist/index.js.map
vendored
Normal file
1
sdk/node/examples/pastebin/dist/index.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB;AAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,6CAA6C;AAE7C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,4CAA4C,CAAC;KACzD,MAAM,CAAC,GAAG,EAAE;IACX,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,sBAAsB;IACtB,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IACtB,IAAI,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC1H,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAChB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,sBAAsB,CAAC;KAC/B,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CAAC,CAAC,QAAgB,EAAE,EAAE;IAC3B,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC"}
|
1112
sdk/node/examples/pastebin/package-lock.json
generated
Normal file
1112
sdk/node/examples/pastebin/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
16
sdk/node/examples/pastebin/package.json
Normal file
16
sdk/node/examples/pastebin/package.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"commander": "^11.1.0",
|
||||
"path": "^0.12.7",
|
||||
"zrok": "../../sdk_ts/dist"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.9.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npx tsc"
|
||||
}
|
||||
}
|
29
sdk/node/examples/pastebin/src/index.ts
Normal file
29
sdk/node/examples/pastebin/src/index.ts
Normal file
@ -0,0 +1,29 @@
|
||||
const { Command } = require("commander"); // add this line
|
||||
const zrok = require("zrok")
|
||||
//const environ = require("zrok/environment")
|
||||
|
||||
const program = new Command();
|
||||
|
||||
program
|
||||
.command('copyto')
|
||||
.version("1.0.0")
|
||||
.description("command to host content to be pastedfrom'd")
|
||||
.action(() => {
|
||||
console.log('copyto command called');
|
||||
//console.log(environ)
|
||||
let root = zrok.Load()
|
||||
let shr = zrok.CreateShare(root, new zrok.ShareRequest(zrok.TCP_TUNNEL_BACKEND_MODE, zrok.PUBLIC_SHARE_MODE, "pastebin"));
|
||||
console.log(shr)
|
||||
zrok.DeleteShare(root, shr);
|
||||
});
|
||||
|
||||
program
|
||||
.command('pastefrom <shrToken>')
|
||||
.version("1.0.0")
|
||||
.description("command to paste content from coptyo")
|
||||
.action((shrToken: string) => {
|
||||
console.log('pastefrom command called', shrToken);
|
||||
});
|
||||
|
||||
program.parse(process.argv)
|
||||
const options = program.opts();
|
12
sdk/node/examples/pastebin/tsconfig.json
Normal file
12
sdk/node/examples/pastebin/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"strict": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user