@displaydev/cli 0.15.1 → 0.16.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/dist/main.js CHANGED
@@ -36,6 +36,19 @@ function _async_to_generator(fn) {
36
36
  });
37
37
  };
38
38
  }
39
+ function _define_property(obj, key, value) {
40
+ if (key in obj) {
41
+ Object.defineProperty(obj, key, {
42
+ value: value,
43
+ enumerable: true,
44
+ configurable: true,
45
+ writable: true
46
+ });
47
+ } else {
48
+ obj[key] = value;
49
+ }
50
+ return obj;
51
+ }
39
52
  function _instanceof(left, right) {
40
53
  "@swc/helpers - instanceof";
41
54
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
@@ -50,6 +63,21 @@ function _iterable_to_array(iter) {
50
63
  function _non_iterable_spread() {
51
64
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
52
65
  }
66
+ function _object_spread(target) {
67
+ for(var i = 1; i < arguments.length; i++){
68
+ var source = arguments[i] != null ? arguments[i] : {};
69
+ var ownKeys = Object.keys(source);
70
+ if (typeof Object.getOwnPropertySymbols === "function") {
71
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
72
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
73
+ }));
74
+ }
75
+ ownKeys.forEach(function(key) {
76
+ _define_property(target, key, source[key]);
77
+ });
78
+ }
79
+ return target;
80
+ }
53
81
  function _to_consumable_array(arr) {
54
82
  return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
55
83
  }
@@ -935,7 +963,7 @@ function openBrowser(url) {
935
963
  // --- login ---
936
964
  program.command('login').description('Authenticate with display.dev').option('--email <email>', 'Email address').option('--code <code>', 'OTP code (verify step; pair with --email)').option('--api-key [key]', 'Authenticate with an API key').option('--json', 'Machine-readable output (structured status, no prose)').action(function(opts) {
937
965
  return _async_to_generator(function() {
938
- var _process_env_DISPLAYDEV_API_URL, emit, emitErr, apiUrl, client, key, unused, rl, validation, email, rl1, method, check, unused1, err, msg, code, rl2, result, unused2, deviceResult, unused3, device_code, verification_uri_complete, initialInterval, expires_in, token, err1;
966
+ var _process_env_DISPLAYDEV_API_URL, emit, emitErr, apiUrl, client, key, unused, rl, validation, email, rl1, method, check, unused1, err, msg, code, rl2, result, unused2, deviceResult, unused3, device_code, verification_uri_complete, initialInterval, expires_in, tickCapMs, sleep, token, err1;
939
967
  return _ts_generator(this, function(_state) {
940
968
  switch(_state.label){
941
969
  case 0:
@@ -1306,12 +1334,23 @@ program.command('login').description('Authenticate with display.dev').option('--
1306
1334
  ,
1307
1335
  39
1308
1336
  ]);
1337
+ // DISPLAYDEV_TEST_TICK_MS caps each polling sleep so login-sso.spec.ts
1338
+ // doesn't burn real wall-clock seconds on the slow_down branch
1339
+ // (which adds +5s to interval). Same convention as DISPLAYDEV_SKIP_BROWSER.
1340
+ tickCapMs = Number(process.env.DISPLAYDEV_TEST_TICK_MS);
1341
+ sleep = Number.isFinite(tickCapMs) && tickCapMs > 0 ? function(ms) {
1342
+ return new Promise(function(resolve) {
1343
+ return setTimeout(resolve, Math.min(ms, tickCapMs));
1344
+ });
1345
+ } : undefined;
1309
1346
  return [
1310
1347
  4,
1311
- pollDeviceToken(client, device_code, 'dsp-cli', {
1348
+ pollDeviceToken(client, device_code, 'dsp-cli', _object_spread({
1312
1349
  intervalMs: (initialInterval || 5) * 1000,
1313
1350
  expiresAt: Date.now() + (expires_in || 600) * 1000
1314
- })
1351
+ }, sleep ? {
1352
+ sleep: sleep
1353
+ } : {}))
1315
1354
  ];
1316
1355
  case 36:
1317
1356
  token = _state.sent();
@@ -1354,8 +1393,8 @@ program.command('login').description('Authenticate with display.dev').option('--
1354
1393
  });
1355
1394
  })();
1356
1395
  });
1357
- // --- branding ---
1358
- program.command('branding <shortId> <mode>').description('Override display.dev branding for an existing artifact without re-publishing (show|hide|inherit)').action(function(shortId, modeRaw) {
1396
+ // --- set-branding ---
1397
+ program.command('set-branding <shortId> <mode>').description('Override display.dev branding for an existing artifact without re-publishing (show|hide|inherit)').action(function(shortId, modeRaw) {
1359
1398
  return _async_to_generator(function() {
1360
1399
  var mode, auth, client, result, err, msg;
1361
1400
  return _ts_generator(this, function(_state) {
@@ -952,7 +952,7 @@ export function registerTools(server, api) {
952
952
  // Metadata-only: does NOT bump the artifact version. Use the `publish`
953
953
  // tool (with `show_branding`) when you're changing content at the same
954
954
  // time so both writes happen in one transaction.
955
- server.tool('branding', 'Override display.dev branding for an existing artifact without re-publishing. Paid tiers only (free-tier orgs must keep inherit).', {
955
+ server.tool('set_branding', 'Override display.dev branding for an existing artifact without re-publishing. Paid tiers only (free-tier orgs must keep inherit).', {
956
956
  short_id: z.string().describe('Artifact shortId'),
957
957
  show_branding: z.enum([
958
958
  'show',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@displaydev/cli",
3
- "version": "0.15.1",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dsp": "dist/main.js"
@@ -17,14 +17,14 @@
17
17
  "test": "vitest run"
18
18
  },
19
19
  "dependencies": {
20
- "@modelcontextprotocol/sdk": "^1.29.0",
21
- "commander": "^14.0.3",
22
- "zod": "^4.3.6"
20
+ "@modelcontextprotocol/sdk": "1.29.0",
21
+ "commander": "14.0.3",
22
+ "zod": "4.3.6"
23
23
  },
24
24
  "devDependencies": {
25
- "@swc/cli": "^0.7.10",
26
- "@swc/core": "^1.15.24",
27
- "@types/node": "^24.12.2",
28
- "vitest": "^4.1.2"
25
+ "@swc/cli": "0.7.10",
26
+ "@swc/core": "1.15.24",
27
+ "@types/node": "24.12.2",
28
+ "vitest": "4.1.2"
29
29
  }
30
30
  }