@phystack/device-simulator 6.16.1 → 6.17.1
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/command.d.ts +0 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +0 -11
- package/dist/command.js.map +1 -1
- package/dist/commands/start.d.ts +0 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +0 -190
- package/dist/commands/start.js.map +1 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +1 -1
- package/dist/utils/config-paths.d.ts +0 -4
- package/dist/utils/config-paths.d.ts.map +1 -1
- package/dist/utils/config-paths.js +1 -18
- package/dist/utils/config-paths.js.map +1 -1
- package/dist/utils/simulator-config.d.ts +0 -16
- package/dist/utils/simulator-config.d.ts.map +1 -1
- package/dist/utils/simulator-config.js +0 -42
- package/dist/utils/simulator-config.js.map +1 -1
- package/package.json +1 -2
- package/dist/commands/list.d.ts +0 -2
- package/dist/commands/list.d.ts.map +0 -1
- package/dist/commands/list.js +0 -20
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/remove.d.ts +0 -2
- package/dist/commands/remove.d.ts.map +0 -1
- package/dist/commands/remove.js +0 -19
- package/dist/commands/remove.js.map +0 -1
- package/dist/services/dev-token.d.ts +0 -2
- package/dist/services/dev-token.d.ts.map +0 -1
- package/dist/services/dev-token.js +0 -36
- package/dist/services/dev-token.js.map +0 -1
- package/dist/services/env.d.ts +0 -2
- package/dist/services/env.d.ts.map +0 -1
- package/dist/services/env.js +0 -14
- package/dist/services/env.js.map +0 -1
- package/dist/utils/tenant-storage.d.ts +0 -14
- package/dist/utils/tenant-storage.d.ts.map +0 -1
- package/dist/utils/tenant-storage.js +0 -65
- package/dist/utils/tenant-storage.js.map +0 -1
package/dist/command.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export type { SimulatorConfig, DeviceConfig, AppConfig, TwinResponse, EventPayload, } from "./simulator/types";
|
|
2
2
|
export { AppTypeEnum, TwinTypeEnum } from "./simulator/types";
|
|
3
|
-
export type { SimulatorConnectConfig } from "./utils/simulator-config";
|
|
4
3
|
export declare function buildSimulatorCommand(): import("commander").Command;
|
|
5
4
|
export default buildSimulatorCommand;
|
|
6
5
|
//# sourceMappingURL=command.d.ts.map
|
package/dist/command.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAQA,YAAY,EACV,eAAe,EACf,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAO9D,wBAAgB,qBAAqB,gCA2BpC;AAED,eAAe,qBAAqB,CAAC"}
|
package/dist/command.js
CHANGED
|
@@ -9,8 +9,6 @@ const commander_1 = require("commander");
|
|
|
9
9
|
const utils_1 = require("./utils");
|
|
10
10
|
const start_1 = __importDefault(require("./commands/start"));
|
|
11
11
|
const run_1 = __importDefault(require("./commands/run"));
|
|
12
|
-
const list_1 = __importDefault(require("./commands/list"));
|
|
13
|
-
const remove_1 = __importDefault(require("./commands/remove"));
|
|
14
12
|
var types_1 = require("./simulator/types");
|
|
15
13
|
Object.defineProperty(exports, "AppTypeEnum", { enumerable: true, get: function () { return types_1.AppTypeEnum; } });
|
|
16
14
|
Object.defineProperty(exports, "TwinTypeEnum", { enumerable: true, get: function () { return types_1.TwinTypeEnum; } });
|
|
@@ -21,7 +19,6 @@ function buildSimulatorCommand() {
|
|
|
21
19
|
.command("start")
|
|
22
20
|
.description("Start the local simulator server")
|
|
23
21
|
.option("-p, --port <port>", "Port to listen on", "55000")
|
|
24
|
-
.option("--connect <name>", "Connect to phyhub as a provisioned device")
|
|
25
22
|
.action((0, utils_1.handleError)(start_1.default));
|
|
26
23
|
simulator
|
|
27
24
|
.command("run <path>")
|
|
@@ -30,14 +27,6 @@ function buildSimulatorCommand() {
|
|
|
30
27
|
.option("--dev-command <command>", "Override dev command (default: npm run dev)")
|
|
31
28
|
.option("--settings-dir <path>", "Settings directory path (default: src/settings)")
|
|
32
29
|
.action((0, utils_1.handleError)(run_1.default));
|
|
33
|
-
simulator
|
|
34
|
-
.command("list")
|
|
35
|
-
.description("List all provisioned simulator devices")
|
|
36
|
-
.action(list_1.default);
|
|
37
|
-
simulator
|
|
38
|
-
.command("remove <name>")
|
|
39
|
-
.description("Remove a saved simulator device")
|
|
40
|
-
.action(remove_1.default);
|
|
41
30
|
return simulator;
|
|
42
31
|
}
|
|
43
32
|
exports.default = buildSimulatorCommand;
|
package/dist/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;AAsBA,sDA2BC;AAjDD,yCAAoC;AACpC,mCAAsC;AACtC,6DAAqC;AACrC,yDAAiC;AAYjC,2CAA8D;AAArD,oGAAA,WAAW,OAAA;AAAE,qGAAA,YAAY,OAAA;AAOlC,SAAgB,qBAAqB;IACnC,MAAM,SAAS,GAAG,IAAI,mBAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,SAAS,CAAC,WAAW,CAAC,4CAA4C,CAAC,CAAC;IAEpE,SAAS;SACN,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,OAAO,CAAC;SACzD,MAAM,CAAC,IAAA,mBAAW,EAAC,eAAK,CAAC,CAAC,CAAC;IAE9B,SAAS;SACN,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CACV,4EAA4E,CAC7E;SACA,MAAM,CAAC,eAAe,EAAE,8CAA8C,CAAC;SACvE,MAAM,CACL,yBAAyB,EACzB,6CAA6C,CAC9C;SACA,MAAM,CACL,uBAAuB,EACvB,iDAAiD,CAClD;SACA,MAAM,CAAC,IAAA,mBAAW,EAAC,aAAG,CAAC,CAAC,CAAC;IAE5B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,kBAAe,qBAAqB,CAAC"}
|
package/dist/commands/start.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"yBAGsB,UAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,KAAG,OAAO,CAAC,IAAI,CAAC;AAArE,wBAoBE"}
|
package/dist/commands/start.js
CHANGED
|
@@ -1,202 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
const chalk_1 = __importDefault(require("chalk"));
|
|
40
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
41
7
|
const simulator_1 = require("../simulator");
|
|
42
|
-
const env_1 = require("../services/env");
|
|
43
|
-
const dev_token_1 = require("../services/dev-token");
|
|
44
|
-
const tenant_storage_1 = require("../utils/tenant-storage");
|
|
45
|
-
const simulator_config_1 = require("../utils/simulator-config");
|
|
46
|
-
async function resolveAuth() {
|
|
47
|
-
const headers = {
|
|
48
|
-
"Content-Type": "application/json",
|
|
49
|
-
};
|
|
50
|
-
const sessionCookie = process.env.PHYSTACK_SESSION_COOKIE;
|
|
51
|
-
const apiKey = process.env.PHYSTACK_API_KEY;
|
|
52
|
-
if (sessionCookie) {
|
|
53
|
-
headers["Cookie"] = `GRIDSESSION=${sessionCookie}`;
|
|
54
|
-
}
|
|
55
|
-
else if (apiKey) {
|
|
56
|
-
headers["Authorization"] = `ApiKey ${apiKey}`;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
try {
|
|
60
|
-
const token = (0, dev_token_1.getAccessToken)();
|
|
61
|
-
if (!token)
|
|
62
|
-
throw new Error("not logged in");
|
|
63
|
-
headers["Authorization"] = `Bearer ${token}`;
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
throw new Error('No auth available. Set PHYSTACK_SESSION_COOKIE, PHYSTACK_API_KEY, or run "phy login".');
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return headers;
|
|
70
|
-
}
|
|
71
|
-
async function provisionDevice(name, apiUrl) {
|
|
72
|
-
const serialNumber = `SIM-${crypto_1.default.randomBytes(4).toString("hex")}`;
|
|
73
|
-
const environment = (process.env.PHYSTACK_CLI_ENV || "PROD").toLowerCase();
|
|
74
|
-
const spaceId = process.env.PHYSTACK_SPACE_ID || "";
|
|
75
|
-
const envTenantId = process.env.PHYSTACK_TENANT_ID;
|
|
76
|
-
const envPhyhubUrl = process.env.PHYSTACK_SIMULATOR_PHYHUB_URL;
|
|
77
|
-
if (envTenantId && !envPhyhubUrl) {
|
|
78
|
-
throw new Error("PHYSTACK_TENANT_ID is set without PHYSTACK_SIMULATOR_PHYHUB_URL. " +
|
|
79
|
-
"These env vars are paired — supply both to override the active tenant " +
|
|
80
|
-
"(e.g. monorepo `make local` or CI flows), or unset PHYSTACK_TENANT_ID " +
|
|
81
|
-
"to use the active tenant from `phy tenant select`.");
|
|
82
|
-
}
|
|
83
|
-
const activeTenant = envTenantId ? null : await (0, tenant_storage_1.getTenant)();
|
|
84
|
-
const tenantId = envTenantId || activeTenant?.id;
|
|
85
|
-
if (!tenantId) {
|
|
86
|
-
throw new Error("No tenant available. Either run `phy tenant select` first, or set both " +
|
|
87
|
-
"PHYSTACK_TENANT_ID and PHYSTACK_SIMULATOR_PHYHUB_URL.");
|
|
88
|
-
}
|
|
89
|
-
const provisionUrl = `${apiUrl}/2026-03/devices`;
|
|
90
|
-
console.log(chalk_1.default.cyan(`Provisioning "${name}" via ${provisionUrl}...`));
|
|
91
|
-
const headers = await resolveAuth();
|
|
92
|
-
const response = await fetch(provisionUrl, {
|
|
93
|
-
method: "POST",
|
|
94
|
-
headers,
|
|
95
|
-
body: JSON.stringify({
|
|
96
|
-
tenantId,
|
|
97
|
-
displayName: name,
|
|
98
|
-
deviceSerial: serialNumber,
|
|
99
|
-
spaceId: spaceId || undefined,
|
|
100
|
-
env: environment === "local" ? "LOCAL" : undefined,
|
|
101
|
-
}),
|
|
102
|
-
});
|
|
103
|
-
if (!response.ok) {
|
|
104
|
-
const text = await response.text();
|
|
105
|
-
throw new Error(`Device provisioning failed (${response.status}): ${text}`);
|
|
106
|
-
}
|
|
107
|
-
const data = (await response.json());
|
|
108
|
-
const deviceData = data.data || data;
|
|
109
|
-
const deviceId = deviceData.deviceId || deviceData.id || deviceData.uuid;
|
|
110
|
-
const accessKey = deviceData.accessKey;
|
|
111
|
-
if (!deviceId || !accessKey) {
|
|
112
|
-
throw new Error(`Provisioning response missing required fields. Got: ${JSON.stringify(deviceData)}`);
|
|
113
|
-
}
|
|
114
|
-
const dataResidency = activeTenant?.dataResidency ||
|
|
115
|
-
(environment ? environment.toUpperCase() : undefined);
|
|
116
|
-
const config = {
|
|
117
|
-
name,
|
|
118
|
-
deviceId,
|
|
119
|
-
accessKey,
|
|
120
|
-
serialNumber,
|
|
121
|
-
phyhubUrl: envPhyhubUrl || undefined,
|
|
122
|
-
environment,
|
|
123
|
-
dataResidency,
|
|
124
|
-
provisionedAt: new Date().toISOString(),
|
|
125
|
-
tenantId: deviceData.tenantId || deviceData.organizationId || tenantId,
|
|
126
|
-
spaceId: deviceData.spaceId || spaceId,
|
|
127
|
-
};
|
|
128
|
-
(0, simulator_config_1.saveSimulator)(config);
|
|
129
|
-
console.log(chalk_1.default.green(`Device "${name}" provisioned: ${config.deviceId}`));
|
|
130
|
-
return config;
|
|
131
|
-
}
|
|
132
|
-
async function startConnected(name) {
|
|
133
|
-
let config = (0, simulator_config_1.getSimulator)(name);
|
|
134
|
-
if (!config) {
|
|
135
|
-
config = await provisionDevice(name, (0, env_1.resolveApiUrl)());
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
console.log(chalk_1.default.cyan(`Reconnecting "${name}" (${config.deviceId})...`));
|
|
139
|
-
}
|
|
140
|
-
const hubDeviceModule = (await Promise.resolve().then(() => __importStar(require("@phystack/hub-device")))).default;
|
|
141
|
-
const region = config.dataResidency ||
|
|
142
|
-
(config.environment ? config.environment.toUpperCase() : "PROD");
|
|
143
|
-
console.log(chalk_1.default.cyan(`Connecting (region=${region}${config.phyhubUrl ? `, phyhubUrl=${config.phyhubUrl}` : ", URL resolved by hub-device"})...`));
|
|
144
|
-
const connectionStatus = await hubDeviceModule.connectToPhyHub(config.environment === "local" ? "LOCAL" : "PROD", "simulator", {
|
|
145
|
-
deviceId: config.deviceId,
|
|
146
|
-
accessKey: config.accessKey,
|
|
147
|
-
deviceSerial: config.serialNumber,
|
|
148
|
-
phyhubUrl: config.phyhubUrl,
|
|
149
|
-
region,
|
|
150
|
-
}, `simulator-${name}`);
|
|
151
|
-
const phyHub = connectionStatus?.phyHub;
|
|
152
|
-
if (!phyHub) {
|
|
153
|
-
throw new Error(`connectToPhyHub() returned no HubDevice instance for "${name}"`);
|
|
154
|
-
}
|
|
155
|
-
await phyHub.connect();
|
|
156
|
-
let deviceTwinId;
|
|
157
|
-
phyHub.connectDevice((response) => {
|
|
158
|
-
if (response?.error) {
|
|
159
|
-
console.warn(chalk_1.default.yellow(`connectDevice rejected: ${response.error}`));
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const deviceTwin = response?.twins?.find((twin) => twin?.type === "Device");
|
|
163
|
-
if (deviceTwin?.id) {
|
|
164
|
-
deviceTwinId = deviceTwin.id;
|
|
165
|
-
console.log(chalk_1.default.green(`Device "${name}" connected to phyhub (twinId=${deviceTwinId})`));
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
console.warn(chalk_1.default.yellow(`connectDevice() returned no Device-type twin — heartbeat will be skipped`));
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
const heartbeat = setInterval(() => {
|
|
172
|
-
if (!deviceTwinId)
|
|
173
|
-
return;
|
|
174
|
-
phyHub.reportDeviceTwinProperties(deviceTwinId, {
|
|
175
|
-
time: {
|
|
176
|
-
current: Date.now(),
|
|
177
|
-
uptime: process.uptime(),
|
|
178
|
-
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
179
|
-
},
|
|
180
|
-
}, (response) => {
|
|
181
|
-
if (response?.error) {
|
|
182
|
-
console.warn(chalk_1.default.yellow(`reportDeviceTwinProperties rejected: ${response.error}`));
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}, 30_000);
|
|
186
|
-
const shutdown = () => {
|
|
187
|
-
clearInterval(heartbeat);
|
|
188
|
-
console.log(chalk_1.default.yellow(`\nDevice "${name}" disconnecting...`));
|
|
189
|
-
process.exit(0);
|
|
190
|
-
};
|
|
191
|
-
process.on("SIGINT", shutdown);
|
|
192
|
-
process.on("SIGTERM", shutdown);
|
|
193
|
-
await new Promise(() => { });
|
|
194
|
-
}
|
|
195
8
|
exports.default = async (options = {}) => {
|
|
196
9
|
const port = parseInt(options.port || "55000", 10);
|
|
197
|
-
if (options.connect) {
|
|
198
|
-
return startConnected(options.connect);
|
|
199
|
-
}
|
|
200
10
|
const simulator = new simulator_1.DeviceSimulator(port);
|
|
201
11
|
const shutdown = async () => {
|
|
202
12
|
await simulator.stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,4CAA+C;AAE/C,kBAAe,KAAK,EAAE,UAA6B,EAAE,EAAiB,EAAE;IACtE,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;IAEnD,MAAM,SAAS,GAAG,IAAI,2BAAe,CAAC,IAAI,CAAC,CAAC;IAE5C,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;QAC1B,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEhC,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,8BAA8B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,6 @@ const commander_1 = require("commander");
|
|
|
8
8
|
const utils_1 = require("./utils");
|
|
9
9
|
const start_1 = __importDefault(require("./commands/start"));
|
|
10
10
|
const run_1 = __importDefault(require("./commands/run"));
|
|
11
|
-
const list_1 = __importDefault(require("./commands/list"));
|
|
12
|
-
const remove_1 = __importDefault(require("./commands/remove"));
|
|
13
11
|
const program = new commander_1.Command();
|
|
14
12
|
program.version((0, utils_1.getPackageVersion)());
|
|
15
13
|
program.description("Local device simulator for app development");
|
|
@@ -17,7 +15,6 @@ program
|
|
|
17
15
|
.command("start")
|
|
18
16
|
.description("Start the local simulator server")
|
|
19
17
|
.option("-p, --port <port>", "Port to listen on", "55000")
|
|
20
|
-
.option("--connect <name>", "Connect to phyhub as a provisioned device")
|
|
21
18
|
.action((0, utils_1.handleError)(start_1.default));
|
|
22
19
|
program
|
|
23
20
|
.command("run <path>")
|
|
@@ -26,13 +23,5 @@ program
|
|
|
26
23
|
.option("--dev-command <command>", "Override dev command (default: npm run dev)")
|
|
27
24
|
.option("--settings-dir <path>", "Settings directory path (default: src/settings)")
|
|
28
25
|
.action((0, utils_1.handleError)(run_1.default));
|
|
29
|
-
program
|
|
30
|
-
.command("list")
|
|
31
|
-
.description("List all provisioned simulator devices")
|
|
32
|
-
.action(list_1.default);
|
|
33
|
-
program
|
|
34
|
-
.command("remove <name>")
|
|
35
|
-
.description("Remove a saved simulator device")
|
|
36
|
-
.action(remove_1.default);
|
|
37
26
|
program.parse(process.argv);
|
|
38
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,yCAAoC;AACpC,mCAAyD;AACzD,6DAAqC;AACrC,yDAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,yCAAoC;AACpC,mCAAyD;AACzD,6DAAqC;AACrC,yDAAiC;AAEjC,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAC9B,OAAO,CAAC,OAAO,CAAC,IAAA,yBAAiB,GAAE,CAAC,CAAC;AACrC,OAAO,CAAC,WAAW,CAAC,4CAA4C,CAAC,CAAC;AAElE,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,kCAAkC,CAAC;KAC/C,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,OAAO,CAAC;KACzD,MAAM,CAAC,IAAA,mBAAW,EAAC,eAAK,CAAC,CAAC,CAAC;AAE9B,OAAO;KACJ,OAAO,CAAC,YAAY,CAAC;KACrB,WAAW,CACV,4EAA4E,CAC7E;KACA,MAAM,CAAC,eAAe,EAAE,8CAA8C,CAAC;KACvE,MAAM,CACL,yBAAyB,EACzB,6CAA6C,CAC9C;KACA,MAAM,CACL,uBAAuB,EACvB,iDAAiD,CAClD;KACA,MAAM,CAAC,IAAA,mBAAW,EAAC,aAAG,CAAC,CAAC,CAAC;AAE5B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export declare const CONFIG_DIR: string;
|
|
2
|
-
export declare const TENANT_FILE: string;
|
|
3
2
|
export declare const CREDENTIALS_FILE: string;
|
|
4
3
|
export declare const VALIDATION_CACHE_FILE: string;
|
|
5
4
|
export declare const EMULATED_DEVICE_FILE: string;
|
|
6
|
-
export declare const DEVELOPER_TOKEN_FILE: string;
|
|
7
|
-
export declare const SIMULATORS_DIR: string;
|
|
8
5
|
export declare const SIMULATOR_DIR: string;
|
|
9
6
|
export declare const VMS_DIR: string;
|
|
10
7
|
export declare const CACHE_DIR: string;
|
|
11
|
-
export declare function getAuthFilePath(gridEnv?: string): string;
|
|
12
8
|
//# sourceMappingURL=config-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-paths.d.ts","sourceRoot":"","sources":["../../src/utils/config-paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,QAAqD,CAAC;AAE7E,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"config-paths.d.ts","sourceRoot":"","sources":["../../src/utils/config-paths.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,QAAqD,CAAC;AAE7E,eAAO,MAAM,gBAAgB,QAG5B,CAAC;AACF,eAAO,MAAM,qBAAqB,QAGjC,CAAC;AACF,eAAO,MAAM,oBAAoB,QAAuC,CAAC;AAEzE,eAAO,MAAM,aAAa,QAAqC,CAAC;AAChE,eAAO,MAAM,OAAO,QAA+B,CAAC;AACpD,eAAO,MAAM,SAAS,QAAiC,CAAC"}
|
|
@@ -3,31 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CACHE_DIR = exports.VMS_DIR = exports.SIMULATOR_DIR = exports.
|
|
7
|
-
exports.getAuthFilePath = getAuthFilePath;
|
|
6
|
+
exports.CACHE_DIR = exports.VMS_DIR = exports.SIMULATOR_DIR = exports.EMULATED_DEVICE_FILE = exports.VALIDATION_CACHE_FILE = exports.CREDENTIALS_FILE = exports.CONFIG_DIR = void 0;
|
|
8
7
|
const path_1 = __importDefault(require("path"));
|
|
9
8
|
const os_1 = __importDefault(require("os"));
|
|
10
9
|
exports.CONFIG_DIR = path_1.default.join(os_1.default.homedir(), ".config", "phystack-cli");
|
|
11
|
-
exports.TENANT_FILE = path_1.default.join(exports.CONFIG_DIR, "tenant.json");
|
|
12
10
|
exports.CREDENTIALS_FILE = path_1.default.join(exports.CONFIG_DIR, "registry-credentials.json");
|
|
13
11
|
exports.VALIDATION_CACHE_FILE = path_1.default.join(exports.CONFIG_DIR, "credential-validation-cache.json");
|
|
14
12
|
exports.EMULATED_DEVICE_FILE = path_1.default.join(exports.CONFIG_DIR, "device.json");
|
|
15
|
-
exports.DEVELOPER_TOKEN_FILE = path_1.default.join(exports.CONFIG_DIR, "developer-token.json");
|
|
16
|
-
exports.SIMULATORS_DIR = path_1.default.join(exports.CONFIG_DIR, "simulators");
|
|
17
13
|
exports.SIMULATOR_DIR = path_1.default.join(exports.CONFIG_DIR, "simulator");
|
|
18
14
|
exports.VMS_DIR = path_1.default.join(exports.CONFIG_DIR, "vms");
|
|
19
15
|
exports.CACHE_DIR = path_1.default.join(exports.CONFIG_DIR, "cache");
|
|
20
|
-
function getAuthFilePath(gridEnv = "") {
|
|
21
|
-
const formatted = gridEnv.toUpperCase();
|
|
22
|
-
switch (formatted) {
|
|
23
|
-
case "LOCAL":
|
|
24
|
-
return path_1.default.join(exports.CONFIG_DIR, "auth-local");
|
|
25
|
-
case "DEV":
|
|
26
|
-
return path_1.default.join(exports.CONFIG_DIR, "auth-dev");
|
|
27
|
-
case "QA":
|
|
28
|
-
return path_1.default.join(exports.CONFIG_DIR, "auth-qa");
|
|
29
|
-
default:
|
|
30
|
-
return path_1.default.join(exports.CONFIG_DIR, "auth");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
16
|
//# sourceMappingURL=config-paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-paths.js","sourceRoot":"","sources":["../../src/utils/config-paths.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"config-paths.js","sourceRoot":"","sources":["../../src/utils/config-paths.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,4CAAoB;AAEP,QAAA,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AAEhE,QAAA,gBAAgB,GAAG,cAAI,CAAC,IAAI,CACvC,kBAAU,EACV,2BAA2B,CAC5B,CAAC;AACW,QAAA,qBAAqB,GAAG,cAAI,CAAC,IAAI,CAC5C,kBAAU,EACV,kCAAkC,CACnC,CAAC;AACW,QAAA,oBAAoB,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,aAAa,CAAC,CAAC;AAE5D,QAAA,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,WAAW,CAAC,CAAC;AACnD,QAAA,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,KAAK,CAAC,CAAC;AACvC,QAAA,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
import { AppConfig, DeviceConfig } from "../simulator/types";
|
|
2
|
-
export interface SimulatorConnectConfig {
|
|
3
|
-
name: string;
|
|
4
|
-
deviceId: string;
|
|
5
|
-
accessKey: string;
|
|
6
|
-
serialNumber: string;
|
|
7
|
-
phyhubUrl?: string;
|
|
8
|
-
environment: string;
|
|
9
|
-
dataResidency?: string;
|
|
10
|
-
provisionedAt: string;
|
|
11
|
-
tenantId?: string;
|
|
12
|
-
spaceId?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare function listSimulators(): SimulatorConnectConfig[];
|
|
15
|
-
export declare function getSimulator(name: string): SimulatorConnectConfig | null;
|
|
16
|
-
export declare function saveSimulator(config: SimulatorConnectConfig): void;
|
|
17
|
-
export declare function removeSimulator(name: string): boolean;
|
|
18
2
|
export declare function getDeviceConfig(tenantId: string): Promise<DeviceConfig | undefined>;
|
|
19
3
|
export declare function saveDeviceConfig(tenantId: string, config: DeviceConfig): Promise<void>;
|
|
20
4
|
export declare function getAppConfig(tenantId: string, appName: string): Promise<AppConfig | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulator-config.d.ts","sourceRoot":"","sources":["../../src/utils/simulator-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"simulator-config.d.ts","sourceRoot":"","sources":["../../src/utils/simulator-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAO7D,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAYnC;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAOf;AAcD,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAchC;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAmBrE;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAGhC;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAMf"}
|
|
@@ -3,10 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.listSimulators = listSimulators;
|
|
7
|
-
exports.getSimulator = getSimulator;
|
|
8
|
-
exports.saveSimulator = saveSimulator;
|
|
9
|
-
exports.removeSimulator = removeSimulator;
|
|
10
6
|
exports.getDeviceConfig = getDeviceConfig;
|
|
11
7
|
exports.saveDeviceConfig = saveDeviceConfig;
|
|
12
8
|
exports.getAppConfig = getAppConfig;
|
|
@@ -17,44 +13,6 @@ exports.updateAppTwinId = updateAppTwinId;
|
|
|
17
13
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
18
14
|
const path_1 = __importDefault(require("path"));
|
|
19
15
|
const config_paths_1 = require("./config-paths");
|
|
20
|
-
function listSimulators() {
|
|
21
|
-
if (!fs_extra_1.default.pathExistsSync(config_paths_1.SIMULATORS_DIR))
|
|
22
|
-
return [];
|
|
23
|
-
return fs_extra_1.default
|
|
24
|
-
.readdirSync(config_paths_1.SIMULATORS_DIR)
|
|
25
|
-
.filter((f) => f.endsWith(".json"))
|
|
26
|
-
.map((f) => {
|
|
27
|
-
try {
|
|
28
|
-
return JSON.parse(fs_extra_1.default.readFileSync(path_1.default.join(config_paths_1.SIMULATORS_DIR, f), "utf8"));
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
.filter(Boolean);
|
|
35
|
-
}
|
|
36
|
-
function getSimulator(name) {
|
|
37
|
-
const filePath = path_1.default.join(config_paths_1.SIMULATORS_DIR, `${name}.json`);
|
|
38
|
-
if (!fs_extra_1.default.pathExistsSync(filePath))
|
|
39
|
-
return null;
|
|
40
|
-
try {
|
|
41
|
-
return JSON.parse(fs_extra_1.default.readFileSync(filePath, "utf8"));
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function saveSimulator(config) {
|
|
48
|
-
fs_extra_1.default.ensureDirSync(config_paths_1.SIMULATORS_DIR);
|
|
49
|
-
fs_extra_1.default.writeFileSync(path_1.default.join(config_paths_1.SIMULATORS_DIR, `${config.name}.json`), JSON.stringify(config, null, 2));
|
|
50
|
-
}
|
|
51
|
-
function removeSimulator(name) {
|
|
52
|
-
const filePath = path_1.default.join(config_paths_1.SIMULATORS_DIR, `${name}.json`);
|
|
53
|
-
if (!fs_extra_1.default.pathExistsSync(filePath))
|
|
54
|
-
return false;
|
|
55
|
-
fs_extra_1.default.removeSync(filePath);
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
16
|
function deviceConfigPath(tenantId) {
|
|
59
17
|
return path_1.default.join(tenantDir(tenantId), "device.json");
|
|
60
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulator-config.js","sourceRoot":"","sources":["../../src/utils/simulator-config.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"simulator-config.js","sourceRoot":"","sources":["../../src/utils/simulator-config.ts"],"names":[],"mappings":";;;;;AASA,0CAcC;AAED,4CAUC;AAc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AM,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phystack/device-simulator",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.17.1",
|
|
4
4
|
"description": "Standalone PhyStack device simulator for local app development.",
|
|
5
5
|
"main": "dist/command.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"test:ci": "bun test src"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@phystack/hub-device": "6.16.1",
|
|
27
26
|
"chalk": "^3.0.0",
|
|
28
27
|
"commander": "^5.0.0",
|
|
29
28
|
"fs-extra": "^8.1.0",
|
package/dist/commands/list.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,aAAa,IAAI,IAAI,CAsB5C"}
|
package/dist/commands/list.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = simulatorList;
|
|
4
|
-
const simulator_config_1 = require("../utils/simulator-config");
|
|
5
|
-
function simulatorList() {
|
|
6
|
-
const devices = (0, simulator_config_1.listSimulators)();
|
|
7
|
-
if (devices.length === 0) {
|
|
8
|
-
console.log('No provisioned simulators. Use "phy simulator start --connect <name>" to create one.');
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const header = `${"NAME".padEnd(20)} ${"ENV".padEnd(8)} ${"DEVICE ID".padEnd(38)} PROVISIONED`;
|
|
12
|
-
console.log(header);
|
|
13
|
-
console.log("-".repeat(header.length));
|
|
14
|
-
for (const d of devices) {
|
|
15
|
-
const envLabel = d.environment === "prod" || !d.environment ? "" : d.environment;
|
|
16
|
-
const date = d.provisionedAt ? d.provisionedAt.split("T")[0] : "unknown";
|
|
17
|
-
console.log(`${d.name.padEnd(20)} ${envLabel.padEnd(8)} ${d.deviceId.padEnd(38)} ${date}`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;AAEA,gCAsBC;AAxBD,gEAA2D;AAE3D,SAAwB,aAAa;IACnC,MAAM,OAAO,GAAG,IAAA,iCAAc,GAAE,CAAC;IAEjC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CACT,sFAAsF,CACvF,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC;IAC/F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,MAAM,QAAQ,GACZ,CAAC,CAAC,WAAW,KAAK,MAAM,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAClE,MAAM,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,OAAO,CAAC,GAAG,CACT,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAC9E,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/commands/remove.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAa1D"}
|
package/dist/commands/remove.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = simulatorRemove;
|
|
4
|
-
const simulator_config_1 = require("../utils/simulator-config");
|
|
5
|
-
function simulatorRemove(name) {
|
|
6
|
-
if (!name) {
|
|
7
|
-
console.error("Usage: phy simulator remove <name>");
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
const removed = (0, simulator_config_1.removeSimulator)(name);
|
|
11
|
-
if (removed) {
|
|
12
|
-
console.log(`Removed simulator "${name}".`);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
console.error(`Simulator "${name}" not found.`);
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=remove.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../src/commands/remove.ts"],"names":[],"mappings":";;AAEA,kCAaC;AAfD,gEAA4D;AAE5D,SAAwB,eAAe,CAAC,IAAY;IAClD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,kCAAe,EAAC,IAAI,CAAC,CAAC;IACtC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,IAAI,CAAC,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,cAAc,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-token.d.ts","sourceRoot":"","sources":["../../src/services/dev-token.ts"],"names":[],"mappings":"AAeA,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAoC9C"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getAccessToken = getAccessToken;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const config_paths_1 = require("../utils/config-paths");
|
|
9
|
-
function getAccessToken() {
|
|
10
|
-
const envToken = process.env.PHYSTACK_DEVELOPER_TOKEN?.trim();
|
|
11
|
-
if (envToken) {
|
|
12
|
-
return envToken;
|
|
13
|
-
}
|
|
14
|
-
if (fs_1.default.existsSync(config_paths_1.DEVELOPER_TOKEN_FILE)) {
|
|
15
|
-
try {
|
|
16
|
-
const data = JSON.parse(fs_1.default.readFileSync(config_paths_1.DEVELOPER_TOKEN_FILE, "utf8"));
|
|
17
|
-
return data.token;
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.error(`Failed to read developer token: ${error?.message ?? String(error)}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const tokensPath = process.env.PHYSTACK_CLI_AUTH_FILE_PATH ||
|
|
24
|
-
(0, config_paths_1.getAuthFilePath)(process.env.PHYSTACK_CLI_ENV);
|
|
25
|
-
try {
|
|
26
|
-
if (fs_1.default.existsSync(tokensPath)) {
|
|
27
|
-
const tokens = JSON.parse(fs_1.default.readFileSync(tokensPath, "utf8"));
|
|
28
|
-
return tokens ? tokens.access_token : null;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error(`Failed to read tokens at ${tokensPath}: ${error?.message ?? String(error)}`);
|
|
33
|
-
}
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=dev-token.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-token.js","sourceRoot":"","sources":["../../src/services/dev-token.ts"],"names":[],"mappings":";;;;;AAeA,wCAoCC;AAnDD,4CAAoB;AACpB,wDAA8E;AAc9E,SAAgB,cAAc;IAE5B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,IAAI,EAAE,CAAC;IAC9D,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IAGD,IAAI,YAAE,CAAC,UAAU,CAAC,mCAAoB,CAAC,EAAE,CAAC;QACxC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,mCAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;YACvE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CACX,mCAAmC,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CACrE,CAAC;QACJ,CAAC;IACH,CAAC;IAKD,MAAM,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,2BAA2B;QACvC,IAAA,8BAAe,EAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAChD,IAAI,CAAC;QACH,IAAI,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;YAC/D,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7C,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CACX,4BAA4B,UAAU,KAAK,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAC7E,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/services/env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/services/env.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,IAAI,MAAM,CAOtC"}
|
package/dist/services/env.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveApiUrl = resolveApiUrl;
|
|
4
|
-
const DEFAULT_API_URL = "https://api.phystack.com";
|
|
5
|
-
function resolveApiUrl() {
|
|
6
|
-
const { PHYSTACK_CLI_ENV } = process.env;
|
|
7
|
-
if (PHYSTACK_CLI_ENV) {
|
|
8
|
-
const url = process.env[`${PHYSTACK_CLI_ENV}_PHYSTACK_API`];
|
|
9
|
-
if (url)
|
|
10
|
-
return url;
|
|
11
|
-
}
|
|
12
|
-
return process.env.PHYSTACK_API || DEFAULT_API_URL;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=env.js.map
|
package/dist/services/env.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/services/env.ts"],"names":[],"mappings":";;AAEA,sCAOC;AATD,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD,SAAgB,aAAa;IAC3B,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IACzC,IAAI,gBAAgB,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,gBAAgB,eAAe,CAAC,CAAC;QAC5D,IAAI,GAAG;YAAE,OAAO,GAAG,CAAC;IACtB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,eAAe,CAAC;AACrD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface StoredTenant {
|
|
2
|
-
id: string;
|
|
3
|
-
slug: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
phyhubUrl: string;
|
|
6
|
-
dataResidency?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const saveTenant: (tenant: StoredTenant) => Promise<void>;
|
|
9
|
-
export declare const getTenant: (options?: {
|
|
10
|
-
silent?: boolean;
|
|
11
|
-
}) => Promise<StoredTenant | null>;
|
|
12
|
-
export declare const hasTenant: () => Promise<boolean>;
|
|
13
|
-
export declare const clearTenant: () => Promise<boolean>;
|
|
14
|
-
//# sourceMappingURL=tenant-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-storage.d.ts","sourceRoot":"","sources":["../../src/utils/tenant-storage.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAIlB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAQD,eAAO,MAAM,UAAU,GAAU,QAAQ,YAAY,KAAG,OAAO,CAAC,IAAI,CAcnE,CAAC;AAWF,eAAO,MAAM,SAAS,GACpB,UAAS;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,KACjC,OAAO,CAAC,YAAY,GAAG,IAAI,CAqB7B,CAAC;AAOF,eAAO,MAAM,SAAS,QAAa,OAAO,CAAC,OAAO,CASjD,CAAC;AAQF,eAAO,MAAM,WAAW,QAAa,OAAO,CAAC,OAAO,CAYnD,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.clearTenant = exports.hasTenant = exports.getTenant = exports.saveTenant = void 0;
|
|
7
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const config_paths_1 = require("./config-paths");
|
|
10
|
-
const saveTenant = async (tenant) => {
|
|
11
|
-
try {
|
|
12
|
-
await fs_extra_1.default.ensureDir(config_paths_1.CONFIG_DIR);
|
|
13
|
-
await fs_extra_1.default.writeFile(config_paths_1.TENANT_FILE, JSON.stringify(tenant, null, 2));
|
|
14
|
-
console.log(chalk_1.default.dim(`Saved tenant information to ${config_paths_1.TENANT_FILE}`));
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
console.error(chalk_1.default.red(`Failed to save tenant information: ${error.message}`));
|
|
18
|
-
throw error;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.saveTenant = saveTenant;
|
|
22
|
-
const getTenant = async (options = {}) => {
|
|
23
|
-
try {
|
|
24
|
-
if (await fs_extra_1.default.pathExists(config_paths_1.TENANT_FILE)) {
|
|
25
|
-
const data = await fs_extra_1.default.readFile(config_paths_1.TENANT_FILE, "utf8");
|
|
26
|
-
const tenant = JSON.parse(data);
|
|
27
|
-
if (!options.silent) {
|
|
28
|
-
console.log(chalk_1.default.dim(`Using tenant: ${tenant.displayName} (${tenant.slug})`));
|
|
29
|
-
}
|
|
30
|
-
return tenant;
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
console.error(chalk_1.default.red(`Failed to read tenant information: ${error.message}`));
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
exports.getTenant = getTenant;
|
|
40
|
-
const hasTenant = async () => {
|
|
41
|
-
try {
|
|
42
|
-
return await fs_extra_1.default.pathExists(config_paths_1.TENANT_FILE);
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.error(chalk_1.default.red(`Failed to check for saved tenant: ${error.message}`));
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.hasTenant = hasTenant;
|
|
50
|
-
const clearTenant = async () => {
|
|
51
|
-
try {
|
|
52
|
-
if (await fs_extra_1.default.pathExists(config_paths_1.TENANT_FILE)) {
|
|
53
|
-
await fs_extra_1.default.remove(config_paths_1.TENANT_FILE);
|
|
54
|
-
console.log(chalk_1.default.dim(`Removed tenant information`));
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
console.error(chalk_1.default.red(`Failed to clear tenant: ${error.message}`));
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
exports.clearTenant = clearTenant;
|
|
65
|
-
//# sourceMappingURL=tenant-storage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tenant-storage.js","sourceRoot":"","sources":["../../src/utils/tenant-storage.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0B;AAC1B,kDAA0B;AAC1B,iDAAyD;AAmBlD,MAAM,UAAU,GAAG,KAAK,EAAE,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