@supertokens-plugins/rownd-nodejs 0.2.1 → 0.3.0-beta.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/README.md +20 -0
- package/dist/bulkMigrate.js +1096 -0
- package/dist/cli.js +54 -0
- package/dist/generateAppConfig.js +731 -0
- package/dist/index.d.mts +716 -26
- package/dist/index.d.ts +716 -26
- package/dist/index.js +1756 -113
- package/dist/index.mjs +1747 -110
- package/dist/initConfig.js +136 -0
- package/dist/setupCoreInstance.js +295 -0
- package/package.json +13 -10
- package/scripts/bulkMigrate.ts +0 -450
- package/scripts/config.yaml +0 -27
- package/src/constants.ts +0 -5
- package/src/errors.ts +0 -13
- package/src/index.ts +0 -7
- package/src/logger.ts +0 -7
- package/src/plugin.test.ts +0 -790
- package/src/plugin.ts +0 -189
- package/src/pluginImplementation.ts +0 -187
- package/src/telemetry/axiomTelemetryClient.ts +0 -34
- package/src/telemetry/createTelemetryClient.ts +0 -87
- package/src/telemetry/openTelemetryClient.ts +0 -32
- package/src/types.ts +0 -124
package/dist/cli.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// scripts/cli.ts
|
|
5
|
+
var import_node_child_process = require("child_process");
|
|
6
|
+
var import_node_path = require("path");
|
|
7
|
+
var COMMANDS = {
|
|
8
|
+
"init-config": "initConfig.js",
|
|
9
|
+
"bulk-migrate": "bulkMigrate.js",
|
|
10
|
+
"setup-core": "setupCoreInstance.js",
|
|
11
|
+
"generate-plugin-config": "generateAppConfig.js"
|
|
12
|
+
};
|
|
13
|
+
function printHelp() {
|
|
14
|
+
console.log(`Usage: rownd-nodejs <command> [options]
|
|
15
|
+
|
|
16
|
+
Commands:
|
|
17
|
+
init-config Write a bulk migration config template
|
|
18
|
+
bulk-migrate Stage Rownd users for SuperTokens bulk import
|
|
19
|
+
setup-core Provision SuperTokens infrastructure from Rownd OIDC clients
|
|
20
|
+
generate-plugin-config Generate Rownd plugin configuration from Rownd app config
|
|
21
|
+
|
|
22
|
+
Run a command with --help for command-specific options.`);
|
|
23
|
+
}
|
|
24
|
+
async function main() {
|
|
25
|
+
const [command, ...args] = process.argv.slice(2);
|
|
26
|
+
if (!command || command === "--help" || command === "-h") {
|
|
27
|
+
printHelp();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const script = COMMANDS[command];
|
|
31
|
+
if (!script) {
|
|
32
|
+
console.error(`Unknown command: ${command}`);
|
|
33
|
+
printHelp();
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const child = (0, import_node_child_process.spawn)(process.execPath, [(0, import_node_path.join)(__dirname, script), ...args], {
|
|
38
|
+
stdio: "inherit"
|
|
39
|
+
});
|
|
40
|
+
await new Promise((resolve) => {
|
|
41
|
+
child.on("exit", (code, signal) => {
|
|
42
|
+
if (signal) {
|
|
43
|
+
process.kill(process.pid, signal);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
process.exitCode = code ?? 1;
|
|
47
|
+
resolve();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
main().catch((error) => {
|
|
52
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
53
|
+
process.exitCode = 1;
|
|
54
|
+
});
|