@marvalt/madapter 1.0.14 → 1.1.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/index.d.ts CHANGED
@@ -22,8 +22,10 @@ interface MauticConfig {
22
22
  authMode: AuthMode;
23
23
  apiUrl?: string;
24
24
  cloudflareWorkerUrl?: string;
25
- appId?: string;
26
- workerSecret?: string;
25
+ clientId?: string;
26
+ clientSecret?: string;
27
+ cfAccessClientId?: string;
28
+ cfAccessClientSecret?: string;
27
29
  timeout?: number;
28
30
  retries?: number;
29
31
  }
@@ -31,8 +33,10 @@ interface MauticGeneratorConfig {
31
33
  authMode: AuthMode;
32
34
  apiUrl?: string;
33
35
  cloudflareWorkerUrl?: string;
34
- appId?: string;
35
- workerSecret?: string;
36
+ clientId?: string;
37
+ clientSecret?: string;
38
+ cfAccessClientId?: string;
39
+ cfAccessClientSecret?: string;
36
40
  outputPath: string;
37
41
  formIds?: number[];
38
42
  includeInactive?: boolean;
@@ -43,8 +47,6 @@ interface MauticTrackingConfig {
43
47
  enabled?: boolean;
44
48
  mauticUrl?: string;
45
49
  proxyUrl?: string;
46
- appId?: string;
47
- workerSecret?: string;
48
50
  }
49
51
 
50
52
  /**
@@ -278,7 +280,7 @@ declare class MauticService {
278
280
  removeTagFromContact(contactId: number, tags: string[]): Promise<any>;
279
281
  trackEvent(eventName: string, eventData?: Record<string, any>): Promise<any>;
280
282
  }
281
- declare const mauticService: MauticService;
283
+ declare let mauticService: MauticService | null;
282
284
 
283
285
  /**
284
286
  * @license GPL-3.0-or-later
@@ -359,7 +361,12 @@ interface MauticFormData {
359
361
  declare class MauticGenerator {
360
362
  private client;
361
363
  private config;
364
+ private cachedToken;
362
365
  constructor(config: MauticGeneratorConfig);
366
+ /**
367
+ * Get OAuth2 token for direct mode API calls
368
+ */
369
+ private getOAuth2Token;
363
370
  /**
364
371
  * Generate static data for Mautic forms
365
372
  */
@@ -705,8 +712,6 @@ declare const getMauticConfigSummary: (config: MauticConfig) => {
705
712
  authMode: AuthMode;
706
713
  hasApiUrl: boolean;
707
714
  hasCloudflareWorkerUrl: boolean;
708
- hasAppId: boolean;
709
- hasWorkerSecret: boolean;
710
715
  timeout: number | undefined;
711
716
  retries: number | undefined;
712
717
  isEnabled: boolean;