mage-remote-run 0.26.0 → 0.26.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/lib/api/saas.js CHANGED
@@ -38,6 +38,11 @@ export class SaasClient extends ApiClient {
38
38
  }
39
39
 
40
40
  async getToken() {
41
+ // Support static token from config
42
+ if (this.config.auth.token) {
43
+ return this.config.auth.token;
44
+ }
45
+
41
46
  if (this.token && Date.now() < this.tokenExpiresAt) {
42
47
  return this.token;
43
48
  }
@@ -378,6 +378,15 @@ Examples:
378
378
  SaaS (Non-Interactive):
379
379
  $ mage-remote-run connection add --name "MySaaS" --type ac-saas --url "https://example.com" --client-id "id" --client-secret "secret" --active
380
380
 
381
+ SaaS (Pre-generated Token):
382
+ $ mage-remote-run connection add --name "MySaaS" --type ac-saas --url "https://example.com" --token "access_token_here"
383
+
384
+ PaaS (Integration Token):
385
+ $ mage-remote-run connection add --name "MyPaaS" --type ac-cloud-paas --url "https://paas.example.com" --token "integration_token"
386
+
387
+ OAuth 1.0a (Non-Interactive):
388
+ $ mage-remote-run connection add --name "MyOAuth" --type ac-on-prem --url "https://example.com" --consumer-key "ck" --consumer-secret "cs" --access-token "at" --token-secret "ts"
389
+
381
390
  Bearer Token (Non-Interactive):
382
391
  $ mage-remote-run connection add --name "MyStore" --type magento-os --url "https://magento.example.com" --token "tkn"
383
392
  `)
@@ -403,13 +412,19 @@ Examples:
403
412
  };
404
413
 
405
414
  if (options.type === 'ac-saas') {
406
- if (!options.clientId || !options.clientSecret) {
407
- throw new Error('SaaS authentication requires --client-id and --client-secret');
415
+ if (options.token) {
416
+ settings.auth = { token: options.token };
417
+ // Optional: still save client ID/secret if provided, but token takes precedence
418
+ if (options.clientId) settings.auth.clientId = options.clientId;
419
+ if (options.clientSecret) settings.auth.clientSecret = options.clientSecret;
420
+ } else if (!options.clientId || !options.clientSecret) {
421
+ throw new Error('SaaS authentication requires --client-id and --client-secret (or --token)');
422
+ } else {
423
+ settings.auth = {
424
+ clientId: options.clientId,
425
+ clientSecret: options.clientSecret
426
+ };
408
427
  }
409
- settings.auth = {
410
- clientId: options.clientId,
411
- clientSecret: options.clientSecret
412
- };
413
428
  } else {
414
429
  // Infer auth method if not provided
415
430
  let method = options.authMethod;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mage-remote-run",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "description": "The remote swiss army knife for Magento Open Source, Mage-OS, Adobe Commerce",
5
5
  "main": "index.js",
6
6
  "scripts": {