migma 1.6.0 → 1.8.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.mts CHANGED
@@ -492,6 +492,8 @@ interface ListProjectsParams {
492
492
  limit?: number;
493
493
  offset?: number;
494
494
  status?: string;
495
+ /** Scope the list to one workspace (see workspaces.list()). */
496
+ organizationId?: string;
495
497
  }
496
498
  interface ListProjectsResponse {
497
499
  projects: Project[];
@@ -553,6 +555,40 @@ interface FieldCatalogResponse {
553
555
  totalSubscribers: number;
554
556
  computedAt: string;
555
557
  }
558
+ interface BrandImageStyle {
559
+ styleNotes?: string;
560
+ avoid?: string;
561
+ useBrandColors?: boolean;
562
+ }
563
+ /** Body for PUT /projects/:id/brand-guidelines. At least one field is required. */
564
+ interface BrandGuidelinesParams {
565
+ /** Replaces the standing instructions every future email is written under. */
566
+ instructions?: string;
567
+ imageStyle?: BrandImageStyle;
568
+ }
569
+ interface BrandGuidelinesResponse {
570
+ instructions: string;
571
+ imageStyle: BrandImageStyle;
572
+ previous: {
573
+ instructions: string;
574
+ };
575
+ changed: boolean;
576
+ }
577
+ interface DesignReferenceItem {
578
+ id: string;
579
+ title: string;
580
+ content?: string;
581
+ date?: string;
582
+ previewHtml?: string;
583
+ thumbnailUrl?: string;
584
+ screenshotUrl?: string;
585
+ referenceOrigin?: string;
586
+ [key: string]: unknown;
587
+ }
588
+ interface ProjectReferencesResponse {
589
+ references: DesignReferenceItem[];
590
+ total: number;
591
+ }
556
592
 
557
593
  interface PollingOptions {
558
594
  /** Polling interval in ms. Default: 2000 */
@@ -578,6 +614,10 @@ declare class Projects {
578
614
  get(projectId: string): Promise<MigmaResult<Project>>;
579
615
  import(params: ImportProjectParams): Promise<MigmaResult<ImportProjectResponse>>;
580
616
  getImportStatus(projectId: string): Promise<MigmaResult<ImportStatusResponse>>;
617
+ /** Replace the brand's standing design rules and/or image style notes. */
618
+ updateBrandGuidelines(projectId: string, params: BrandGuidelinesParams): Promise<MigmaResult<BrandGuidelinesResponse>>;
619
+ /** Design references generation reads: favorites, saved designs, saved sections. */
620
+ references(projectId: string): Promise<MigmaResult<ProjectReferencesResponse>>;
581
621
  retryImport(projectId: string): Promise<MigmaResult<RetryImportResponse>>;
582
622
  fieldCatalog(projectId: string, params?: FieldCatalogParams): Promise<MigmaResult<FieldCatalogResponse>>;
583
623
  /**
@@ -815,6 +855,12 @@ interface EmailLogsResponse {
815
855
  nextCursor: string | null;
816
856
  hasMore: boolean;
817
857
  }
858
+ interface EmailFavorite {
859
+ emailId: string;
860
+ favorite: boolean;
861
+ conversationId: string;
862
+ slotUuid: string | null;
863
+ }
818
864
 
819
865
  declare class Emails {
820
866
  private readonly client;
@@ -849,6 +895,8 @@ declare class Emails {
849
895
  * series. Events arrive asynchronously; opens are directional while clicks
850
896
  * and delivery events are stronger signals.
851
897
  */
898
+ /** Star or unstar one generated email as a design reference. Idempotent. */
899
+ setFavorite(emailId: string, favorite: boolean): Promise<MigmaResult<EmailFavorite>>;
852
900
  metrics(emailId: string): Promise<MigmaResult<EmailMetrics>>;
853
901
  /** Per-recipient send log for one generated email (cursor-paginated). */
854
902
  logs(emailId: string, params?: EmailLogsParams): Promise<MigmaResult<EmailLogsResponse>>;
@@ -1159,6 +1207,10 @@ interface DomainVerificationResult {
1159
1207
  }
1160
1208
  interface DomainAvailability {
1161
1209
  available: boolean;
1210
+ prefix: string;
1211
+ fullDomain: string;
1212
+ /** Present only when unavailable: taken, reserved, or the format rule it breaks. */
1213
+ reason?: string;
1162
1214
  [key: string]: unknown;
1163
1215
  }
1164
1216
  interface CreateManagedDomainParams {
@@ -1449,11 +1501,17 @@ declare class Webhooks {
1449
1501
  getStats(): Promise<MigmaResult<Record<string, unknown>>>;
1450
1502
  }
1451
1503
 
1504
+ /** What makes a knowledge-base entry a design reference rather than a plain brand fact. */
1505
+ type ReferenceOrigin = 'favorite' | 'upload' | 'manual';
1452
1506
  interface KnowledgeBaseEntry {
1453
1507
  id: string;
1454
1508
  title: string;
1455
1509
  content: string;
1456
1510
  date: string;
1511
+ previewHtml?: string;
1512
+ thumbnailUrl?: string;
1513
+ screenshotUrl?: string;
1514
+ referenceOrigin?: ReferenceOrigin;
1457
1515
  }
1458
1516
  interface KnowledgeBaseListResponse {
1459
1517
  entries: KnowledgeBaseEntry[];
@@ -1462,6 +1520,11 @@ interface KnowledgeBaseListResponse {
1462
1520
  interface AddKnowledgeBaseParams {
1463
1521
  title: string;
1464
1522
  content: string;
1523
+ /** Set to mark the entry as a design reference generation should match. */
1524
+ referenceOrigin?: ReferenceOrigin;
1525
+ previewHtml?: string;
1526
+ thumbnailUrl?: string;
1527
+ screenshotUrl?: string;
1465
1528
  }
1466
1529
  interface UpdateKnowledgeBaseParams {
1467
1530
  title?: string;
@@ -1693,6 +1756,34 @@ declare class Metrics {
1693
1756
  sending(params?: SendingMetricsParams): Promise<MigmaResult<SendingMetrics>>;
1694
1757
  }
1695
1758
 
1759
+ interface Workspace {
1760
+ id: string;
1761
+ name: string;
1762
+ type: string;
1763
+ /** The caller's role in this workspace (owner, admin, member, …). */
1764
+ role: string;
1765
+ /** True for the caller's personal workspace. */
1766
+ personal: boolean;
1767
+ /** Brands in this workspace the caller can access — id + name only. */
1768
+ projects: Array<{
1769
+ id: string;
1770
+ name: string;
1771
+ }>;
1772
+ }
1773
+ interface ListWorkspacesResponse {
1774
+ workspaces: Workspace[];
1775
+ }
1776
+
1777
+ declare class Workspaces {
1778
+ private readonly client;
1779
+ constructor(client: MigmaClient);
1780
+ /**
1781
+ * Workspaces the API key owner belongs to. Pass a workspace id as
1782
+ * `organizationId` to projects.list() to scope brands to it.
1783
+ */
1784
+ list(): Promise<MigmaResult<ListWorkspacesResponse>>;
1785
+ }
1786
+
1696
1787
  interface MigmaConfig {
1697
1788
  /** API base URL. Default: 'https://api.migma.ai/v1' */
1698
1789
  baseUrl?: string;
@@ -1721,7 +1812,8 @@ declare class Migma {
1721
1812
  readonly images: Images;
1722
1813
  readonly campaigns: Campaigns;
1723
1814
  readonly metrics: Metrics;
1815
+ readonly workspaces: Workspaces;
1724
1816
  constructor(apiKey: string, config?: MigmaConfig);
1725
1817
  }
1726
1818
 
1727
- export { type AddCustomDnsRecordParams, type AddImageParams, type AddKnowledgeBaseParams, type AnalyzeDeliverabilityParams, type AnalyzeLinksParams, type ApiResponse, type BatchDeleteContactsParams, type BatchDeleteResponse, type BatchStatus, type BulkImportAsyncResponse, type BulkImportContactItem, type BulkImportJobStatus, type BulkImportParams, type BulkImportResponse, type BulkImportSyncResponse, type Campaign, type CampaignLog, type CampaignLogsParams, type CampaignLogsResponse, type CampaignStats, type CampaignStatus, type ChangeStatusParams, type CheckCompatibilityParams, type CheckSpellingParams, type CheckedLink, type ClientConfig, type CompatibilityResponse, type Contact, type ContactStatus, type CreateCampaignParams, type CreateContactParams, type CreateDomainParams, type CreateManagedDomainParams, type CreatePreviewParams, type CreatePreviewResponse, type CreateSegmentParams, type CreateTagParams, type CreateTopicParams, type CreateWebhookParams, type CreateWebhookResponse, type CreditStatus, type CustomDnsRecord, type CustomDnsRecordList, type CustomDnsRecordType, type DeleteResponse, type DeliverabilityResponse, type DeviceCategoriesResponse, type DnsRecord, type Domain, type DomainAvailability, type DomainDeleteResponse, type DomainPurchaseCheckout, type DomainPurchaseParams, type DomainPurchaseQuote, type DomainPurchaseSearchParams, type DomainRegistration, type DomainRegistrationStatus, type DomainStream, type DomainVerificationResult, type EditEmailParams, type Email, type EmailGenerationResult, type EmailGenerationStatus, type EmailImage, type EmailLogsParams, type EmailLogsResponse, type EmailMetrics, type EmailMetricsCountry, type EmailMetricsSummary, type EmailMetricsTimePoint, type EmailSendLog, type ExportFile, type ExportFormat, type ExportFormatsResponse, type ExportResult, type ExportStatusResponse, type FieldCatalogEntry, type FieldCatalogEntryType, type FieldCatalogParams, type FieldCatalogResponse, type GenerateEmailParams, type GenerateEmailResponse, type GeneratedEmail, type GetDevicePreviewResponse, type GetPreviewResponse, type GetPreviewStatusResponse, type GetSupportedDevicesResponse, type HubspotExportParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type LogosResponse, type MessageResponse, Migma, MigmaClient, type MigmaConfig, MigmaError, MigmaErrorCode, type MigmaResult, type PollingOptions, type PreviewDevice, type PreviewDeviceCategory, type PreviewDeviceStatus, type PreviewMetadata, type PreviewStatus, type Project, type ProjectImage, type ProviderType, type ProvisionStreamParams, type RecipientType, type RetryImportResponse, type ScheduleCampaignParams, type Segment, type SegmentActivityFilter, type SegmentFieldFilter, type SegmentFilters, type SendEmailParams, type SendEmailResponse, type SendTestEmailParams, type SendTestEmailResponse, type SendingMetrics, type SendingMetricsCounts, type SendingMetricsHistoryEntry, type SendingMetricsParams, type SendingMetricsToday, type SetupDomainParams, type SetupDomainResponse, type SpellingResponse, type SupportedDevice, type Tag, type Topic, type TopicSubscriptionParams, type TopicSubscriptionResponse, type UpdateContactParams, type UpdateDomainParams, type UpdateImageParams, type UpdateKnowledgeBaseParams, type UpdateLogosParams, type UpdateSegmentParams, type UpdateTagParams, type UpdateTopicParams, type UpdateWebhookParams, type UpgradeLink, type UpgradeLinkParams, type UpgradePlan, type ValidateAllParams, type ValidateAllResponse, type Webhook, type WebhookDeliveriesResponse, type WebhookDelivery, type WebhookDetail, type WebhookEvent, type WebhookEventType, type WebhookEventsResponse, type WebhookTestResult, poll };
1819
+ export { type AddCustomDnsRecordParams, type AddImageParams, type AddKnowledgeBaseParams, type AnalyzeDeliverabilityParams, type AnalyzeLinksParams, type ApiResponse, type BatchDeleteContactsParams, type BatchDeleteResponse, type BatchStatus, type BrandGuidelinesParams, type BrandGuidelinesResponse, type BrandImageStyle, type BulkImportAsyncResponse, type BulkImportContactItem, type BulkImportJobStatus, type BulkImportParams, type BulkImportResponse, type BulkImportSyncResponse, type Campaign, type CampaignLog, type CampaignLogsParams, type CampaignLogsResponse, type CampaignStats, type CampaignStatus, type ChangeStatusParams, type CheckCompatibilityParams, type CheckSpellingParams, type CheckedLink, type ClientConfig, type CompatibilityResponse, type Contact, type ContactStatus, type CreateCampaignParams, type CreateContactParams, type CreateDomainParams, type CreateManagedDomainParams, type CreatePreviewParams, type CreatePreviewResponse, type CreateSegmentParams, type CreateTagParams, type CreateTopicParams, type CreateWebhookParams, type CreateWebhookResponse, type CreditStatus, type CustomDnsRecord, type CustomDnsRecordList, type CustomDnsRecordType, type DeleteResponse, type DeliverabilityResponse, type DesignReferenceItem, type DeviceCategoriesResponse, type DnsRecord, type Domain, type DomainAvailability, type DomainDeleteResponse, type DomainPurchaseCheckout, type DomainPurchaseParams, type DomainPurchaseQuote, type DomainPurchaseSearchParams, type DomainRegistration, type DomainRegistrationStatus, type DomainStream, type DomainVerificationResult, type EditEmailParams, type Email, type EmailFavorite, type EmailGenerationResult, type EmailGenerationStatus, type EmailImage, type EmailLogsParams, type EmailLogsResponse, type EmailMetrics, type EmailMetricsCountry, type EmailMetricsSummary, type EmailMetricsTimePoint, type EmailSendLog, type ExportFile, type ExportFormat, type ExportFormatsResponse, type ExportResult, type ExportStatusResponse, type FieldCatalogEntry, type FieldCatalogEntryType, type FieldCatalogParams, type FieldCatalogResponse, type GenerateEmailParams, type GenerateEmailResponse, type GeneratedEmail, type GetDevicePreviewResponse, type GetPreviewResponse, type GetPreviewStatusResponse, type GetSupportedDevicesResponse, type HubspotExportParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type ListWorkspacesResponse, type LogosResponse, type MessageResponse, Migma, MigmaClient, type MigmaConfig, MigmaError, MigmaErrorCode, type MigmaResult, type PollingOptions, type PreviewDevice, type PreviewDeviceCategory, type PreviewDeviceStatus, type PreviewMetadata, type PreviewStatus, type Project, type ProjectImage, type ProjectReferencesResponse, type ProviderType, type ProvisionStreamParams, type RecipientType, type ReferenceOrigin, type RetryImportResponse, type ScheduleCampaignParams, type Segment, type SegmentActivityFilter, type SegmentFieldFilter, type SegmentFilters, type SendEmailParams, type SendEmailResponse, type SendTestEmailParams, type SendTestEmailResponse, type SendingMetrics, type SendingMetricsCounts, type SendingMetricsHistoryEntry, type SendingMetricsParams, type SendingMetricsToday, type SetupDomainParams, type SetupDomainResponse, type SpellingResponse, type SupportedDevice, type Tag, type Topic, type TopicSubscriptionParams, type TopicSubscriptionResponse, type UpdateContactParams, type UpdateDomainParams, type UpdateImageParams, type UpdateKnowledgeBaseParams, type UpdateLogosParams, type UpdateSegmentParams, type UpdateTagParams, type UpdateTopicParams, type UpdateWebhookParams, type UpgradeLink, type UpgradeLinkParams, type UpgradePlan, type ValidateAllParams, type ValidateAllResponse, type Webhook, type WebhookDeliveriesResponse, type WebhookDelivery, type WebhookDetail, type WebhookEvent, type WebhookEventType, type WebhookEventsResponse, type WebhookTestResult, type Workspace, poll };
package/dist/index.d.ts CHANGED
@@ -492,6 +492,8 @@ interface ListProjectsParams {
492
492
  limit?: number;
493
493
  offset?: number;
494
494
  status?: string;
495
+ /** Scope the list to one workspace (see workspaces.list()). */
496
+ organizationId?: string;
495
497
  }
496
498
  interface ListProjectsResponse {
497
499
  projects: Project[];
@@ -553,6 +555,40 @@ interface FieldCatalogResponse {
553
555
  totalSubscribers: number;
554
556
  computedAt: string;
555
557
  }
558
+ interface BrandImageStyle {
559
+ styleNotes?: string;
560
+ avoid?: string;
561
+ useBrandColors?: boolean;
562
+ }
563
+ /** Body for PUT /projects/:id/brand-guidelines. At least one field is required. */
564
+ interface BrandGuidelinesParams {
565
+ /** Replaces the standing instructions every future email is written under. */
566
+ instructions?: string;
567
+ imageStyle?: BrandImageStyle;
568
+ }
569
+ interface BrandGuidelinesResponse {
570
+ instructions: string;
571
+ imageStyle: BrandImageStyle;
572
+ previous: {
573
+ instructions: string;
574
+ };
575
+ changed: boolean;
576
+ }
577
+ interface DesignReferenceItem {
578
+ id: string;
579
+ title: string;
580
+ content?: string;
581
+ date?: string;
582
+ previewHtml?: string;
583
+ thumbnailUrl?: string;
584
+ screenshotUrl?: string;
585
+ referenceOrigin?: string;
586
+ [key: string]: unknown;
587
+ }
588
+ interface ProjectReferencesResponse {
589
+ references: DesignReferenceItem[];
590
+ total: number;
591
+ }
556
592
 
557
593
  interface PollingOptions {
558
594
  /** Polling interval in ms. Default: 2000 */
@@ -578,6 +614,10 @@ declare class Projects {
578
614
  get(projectId: string): Promise<MigmaResult<Project>>;
579
615
  import(params: ImportProjectParams): Promise<MigmaResult<ImportProjectResponse>>;
580
616
  getImportStatus(projectId: string): Promise<MigmaResult<ImportStatusResponse>>;
617
+ /** Replace the brand's standing design rules and/or image style notes. */
618
+ updateBrandGuidelines(projectId: string, params: BrandGuidelinesParams): Promise<MigmaResult<BrandGuidelinesResponse>>;
619
+ /** Design references generation reads: favorites, saved designs, saved sections. */
620
+ references(projectId: string): Promise<MigmaResult<ProjectReferencesResponse>>;
581
621
  retryImport(projectId: string): Promise<MigmaResult<RetryImportResponse>>;
582
622
  fieldCatalog(projectId: string, params?: FieldCatalogParams): Promise<MigmaResult<FieldCatalogResponse>>;
583
623
  /**
@@ -815,6 +855,12 @@ interface EmailLogsResponse {
815
855
  nextCursor: string | null;
816
856
  hasMore: boolean;
817
857
  }
858
+ interface EmailFavorite {
859
+ emailId: string;
860
+ favorite: boolean;
861
+ conversationId: string;
862
+ slotUuid: string | null;
863
+ }
818
864
 
819
865
  declare class Emails {
820
866
  private readonly client;
@@ -849,6 +895,8 @@ declare class Emails {
849
895
  * series. Events arrive asynchronously; opens are directional while clicks
850
896
  * and delivery events are stronger signals.
851
897
  */
898
+ /** Star or unstar one generated email as a design reference. Idempotent. */
899
+ setFavorite(emailId: string, favorite: boolean): Promise<MigmaResult<EmailFavorite>>;
852
900
  metrics(emailId: string): Promise<MigmaResult<EmailMetrics>>;
853
901
  /** Per-recipient send log for one generated email (cursor-paginated). */
854
902
  logs(emailId: string, params?: EmailLogsParams): Promise<MigmaResult<EmailLogsResponse>>;
@@ -1159,6 +1207,10 @@ interface DomainVerificationResult {
1159
1207
  }
1160
1208
  interface DomainAvailability {
1161
1209
  available: boolean;
1210
+ prefix: string;
1211
+ fullDomain: string;
1212
+ /** Present only when unavailable: taken, reserved, or the format rule it breaks. */
1213
+ reason?: string;
1162
1214
  [key: string]: unknown;
1163
1215
  }
1164
1216
  interface CreateManagedDomainParams {
@@ -1449,11 +1501,17 @@ declare class Webhooks {
1449
1501
  getStats(): Promise<MigmaResult<Record<string, unknown>>>;
1450
1502
  }
1451
1503
 
1504
+ /** What makes a knowledge-base entry a design reference rather than a plain brand fact. */
1505
+ type ReferenceOrigin = 'favorite' | 'upload' | 'manual';
1452
1506
  interface KnowledgeBaseEntry {
1453
1507
  id: string;
1454
1508
  title: string;
1455
1509
  content: string;
1456
1510
  date: string;
1511
+ previewHtml?: string;
1512
+ thumbnailUrl?: string;
1513
+ screenshotUrl?: string;
1514
+ referenceOrigin?: ReferenceOrigin;
1457
1515
  }
1458
1516
  interface KnowledgeBaseListResponse {
1459
1517
  entries: KnowledgeBaseEntry[];
@@ -1462,6 +1520,11 @@ interface KnowledgeBaseListResponse {
1462
1520
  interface AddKnowledgeBaseParams {
1463
1521
  title: string;
1464
1522
  content: string;
1523
+ /** Set to mark the entry as a design reference generation should match. */
1524
+ referenceOrigin?: ReferenceOrigin;
1525
+ previewHtml?: string;
1526
+ thumbnailUrl?: string;
1527
+ screenshotUrl?: string;
1465
1528
  }
1466
1529
  interface UpdateKnowledgeBaseParams {
1467
1530
  title?: string;
@@ -1693,6 +1756,34 @@ declare class Metrics {
1693
1756
  sending(params?: SendingMetricsParams): Promise<MigmaResult<SendingMetrics>>;
1694
1757
  }
1695
1758
 
1759
+ interface Workspace {
1760
+ id: string;
1761
+ name: string;
1762
+ type: string;
1763
+ /** The caller's role in this workspace (owner, admin, member, …). */
1764
+ role: string;
1765
+ /** True for the caller's personal workspace. */
1766
+ personal: boolean;
1767
+ /** Brands in this workspace the caller can access — id + name only. */
1768
+ projects: Array<{
1769
+ id: string;
1770
+ name: string;
1771
+ }>;
1772
+ }
1773
+ interface ListWorkspacesResponse {
1774
+ workspaces: Workspace[];
1775
+ }
1776
+
1777
+ declare class Workspaces {
1778
+ private readonly client;
1779
+ constructor(client: MigmaClient);
1780
+ /**
1781
+ * Workspaces the API key owner belongs to. Pass a workspace id as
1782
+ * `organizationId` to projects.list() to scope brands to it.
1783
+ */
1784
+ list(): Promise<MigmaResult<ListWorkspacesResponse>>;
1785
+ }
1786
+
1696
1787
  interface MigmaConfig {
1697
1788
  /** API base URL. Default: 'https://api.migma.ai/v1' */
1698
1789
  baseUrl?: string;
@@ -1721,7 +1812,8 @@ declare class Migma {
1721
1812
  readonly images: Images;
1722
1813
  readonly campaigns: Campaigns;
1723
1814
  readonly metrics: Metrics;
1815
+ readonly workspaces: Workspaces;
1724
1816
  constructor(apiKey: string, config?: MigmaConfig);
1725
1817
  }
1726
1818
 
1727
- export { type AddCustomDnsRecordParams, type AddImageParams, type AddKnowledgeBaseParams, type AnalyzeDeliverabilityParams, type AnalyzeLinksParams, type ApiResponse, type BatchDeleteContactsParams, type BatchDeleteResponse, type BatchStatus, type BulkImportAsyncResponse, type BulkImportContactItem, type BulkImportJobStatus, type BulkImportParams, type BulkImportResponse, type BulkImportSyncResponse, type Campaign, type CampaignLog, type CampaignLogsParams, type CampaignLogsResponse, type CampaignStats, type CampaignStatus, type ChangeStatusParams, type CheckCompatibilityParams, type CheckSpellingParams, type CheckedLink, type ClientConfig, type CompatibilityResponse, type Contact, type ContactStatus, type CreateCampaignParams, type CreateContactParams, type CreateDomainParams, type CreateManagedDomainParams, type CreatePreviewParams, type CreatePreviewResponse, type CreateSegmentParams, type CreateTagParams, type CreateTopicParams, type CreateWebhookParams, type CreateWebhookResponse, type CreditStatus, type CustomDnsRecord, type CustomDnsRecordList, type CustomDnsRecordType, type DeleteResponse, type DeliverabilityResponse, type DeviceCategoriesResponse, type DnsRecord, type Domain, type DomainAvailability, type DomainDeleteResponse, type DomainPurchaseCheckout, type DomainPurchaseParams, type DomainPurchaseQuote, type DomainPurchaseSearchParams, type DomainRegistration, type DomainRegistrationStatus, type DomainStream, type DomainVerificationResult, type EditEmailParams, type Email, type EmailGenerationResult, type EmailGenerationStatus, type EmailImage, type EmailLogsParams, type EmailLogsResponse, type EmailMetrics, type EmailMetricsCountry, type EmailMetricsSummary, type EmailMetricsTimePoint, type EmailSendLog, type ExportFile, type ExportFormat, type ExportFormatsResponse, type ExportResult, type ExportStatusResponse, type FieldCatalogEntry, type FieldCatalogEntryType, type FieldCatalogParams, type FieldCatalogResponse, type GenerateEmailParams, type GenerateEmailResponse, type GeneratedEmail, type GetDevicePreviewResponse, type GetPreviewResponse, type GetPreviewStatusResponse, type GetSupportedDevicesResponse, type HubspotExportParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type LogosResponse, type MessageResponse, Migma, MigmaClient, type MigmaConfig, MigmaError, MigmaErrorCode, type MigmaResult, type PollingOptions, type PreviewDevice, type PreviewDeviceCategory, type PreviewDeviceStatus, type PreviewMetadata, type PreviewStatus, type Project, type ProjectImage, type ProviderType, type ProvisionStreamParams, type RecipientType, type RetryImportResponse, type ScheduleCampaignParams, type Segment, type SegmentActivityFilter, type SegmentFieldFilter, type SegmentFilters, type SendEmailParams, type SendEmailResponse, type SendTestEmailParams, type SendTestEmailResponse, type SendingMetrics, type SendingMetricsCounts, type SendingMetricsHistoryEntry, type SendingMetricsParams, type SendingMetricsToday, type SetupDomainParams, type SetupDomainResponse, type SpellingResponse, type SupportedDevice, type Tag, type Topic, type TopicSubscriptionParams, type TopicSubscriptionResponse, type UpdateContactParams, type UpdateDomainParams, type UpdateImageParams, type UpdateKnowledgeBaseParams, type UpdateLogosParams, type UpdateSegmentParams, type UpdateTagParams, type UpdateTopicParams, type UpdateWebhookParams, type UpgradeLink, type UpgradeLinkParams, type UpgradePlan, type ValidateAllParams, type ValidateAllResponse, type Webhook, type WebhookDeliveriesResponse, type WebhookDelivery, type WebhookDetail, type WebhookEvent, type WebhookEventType, type WebhookEventsResponse, type WebhookTestResult, poll };
1819
+ export { type AddCustomDnsRecordParams, type AddImageParams, type AddKnowledgeBaseParams, type AnalyzeDeliverabilityParams, type AnalyzeLinksParams, type ApiResponse, type BatchDeleteContactsParams, type BatchDeleteResponse, type BatchStatus, type BrandGuidelinesParams, type BrandGuidelinesResponse, type BrandImageStyle, type BulkImportAsyncResponse, type BulkImportContactItem, type BulkImportJobStatus, type BulkImportParams, type BulkImportResponse, type BulkImportSyncResponse, type Campaign, type CampaignLog, type CampaignLogsParams, type CampaignLogsResponse, type CampaignStats, type CampaignStatus, type ChangeStatusParams, type CheckCompatibilityParams, type CheckSpellingParams, type CheckedLink, type ClientConfig, type CompatibilityResponse, type Contact, type ContactStatus, type CreateCampaignParams, type CreateContactParams, type CreateDomainParams, type CreateManagedDomainParams, type CreatePreviewParams, type CreatePreviewResponse, type CreateSegmentParams, type CreateTagParams, type CreateTopicParams, type CreateWebhookParams, type CreateWebhookResponse, type CreditStatus, type CustomDnsRecord, type CustomDnsRecordList, type CustomDnsRecordType, type DeleteResponse, type DeliverabilityResponse, type DesignReferenceItem, type DeviceCategoriesResponse, type DnsRecord, type Domain, type DomainAvailability, type DomainDeleteResponse, type DomainPurchaseCheckout, type DomainPurchaseParams, type DomainPurchaseQuote, type DomainPurchaseSearchParams, type DomainRegistration, type DomainRegistrationStatus, type DomainStream, type DomainVerificationResult, type EditEmailParams, type Email, type EmailFavorite, type EmailGenerationResult, type EmailGenerationStatus, type EmailImage, type EmailLogsParams, type EmailLogsResponse, type EmailMetrics, type EmailMetricsCountry, type EmailMetricsSummary, type EmailMetricsTimePoint, type EmailSendLog, type ExportFile, type ExportFormat, type ExportFormatsResponse, type ExportResult, type ExportStatusResponse, type FieldCatalogEntry, type FieldCatalogEntryType, type FieldCatalogParams, type FieldCatalogResponse, type GenerateEmailParams, type GenerateEmailResponse, type GeneratedEmail, type GetDevicePreviewResponse, type GetPreviewResponse, type GetPreviewStatusResponse, type GetSupportedDevicesResponse, type HubspotExportParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type ListWorkspacesResponse, type LogosResponse, type MessageResponse, Migma, MigmaClient, type MigmaConfig, MigmaError, MigmaErrorCode, type MigmaResult, type PollingOptions, type PreviewDevice, type PreviewDeviceCategory, type PreviewDeviceStatus, type PreviewMetadata, type PreviewStatus, type Project, type ProjectImage, type ProjectReferencesResponse, type ProviderType, type ProvisionStreamParams, type RecipientType, type ReferenceOrigin, type RetryImportResponse, type ScheduleCampaignParams, type Segment, type SegmentActivityFilter, type SegmentFieldFilter, type SegmentFilters, type SendEmailParams, type SendEmailResponse, type SendTestEmailParams, type SendTestEmailResponse, type SendingMetrics, type SendingMetricsCounts, type SendingMetricsHistoryEntry, type SendingMetricsParams, type SendingMetricsToday, type SetupDomainParams, type SetupDomainResponse, type SpellingResponse, type SupportedDevice, type Tag, type Topic, type TopicSubscriptionParams, type TopicSubscriptionResponse, type UpdateContactParams, type UpdateDomainParams, type UpdateImageParams, type UpdateKnowledgeBaseParams, type UpdateLogosParams, type UpdateSegmentParams, type UpdateTagParams, type UpdateTopicParams, type UpdateWebhookParams, type UpgradeLink, type UpgradeLinkParams, type UpgradePlan, type ValidateAllParams, type ValidateAllResponse, type Webhook, type WebhookDeliveriesResponse, type WebhookDelivery, type WebhookDetail, type WebhookEvent, type WebhookEventType, type WebhookEventsResponse, type WebhookTestResult, type Workspace, poll };
package/dist/index.js CHANGED
@@ -411,7 +411,8 @@ var Projects = class {
411
411
  return this.client.get("/projects", {
412
412
  limit: params?.limit,
413
413
  offset: params?.offset,
414
- status: params?.status
414
+ status: params?.status,
415
+ organizationId: params?.organizationId
415
416
  });
416
417
  }
417
418
  async get(projectId) {
@@ -428,6 +429,17 @@ var Projects = class {
428
429
  `/projects/import/${projectId}/status`
429
430
  );
430
431
  }
432
+ /** Replace the brand's standing design rules and/or image style notes. */
433
+ async updateBrandGuidelines(projectId, params) {
434
+ return this.client.put(
435
+ `/projects/${projectId}/brand-guidelines`,
436
+ params
437
+ );
438
+ }
439
+ /** Design references generation reads: favorites, saved designs, saved sections. */
440
+ async references(projectId) {
441
+ return this.client.get(`/projects/${projectId}/references`);
442
+ }
431
443
  async retryImport(projectId) {
432
444
  return this.client.post(
433
445
  `/projects/import/${projectId}/retry`
@@ -554,6 +566,10 @@ var Emails = class {
554
566
  * series. Events arrive asynchronously; opens are directional while clicks
555
567
  * and delivery events are stronger signals.
556
568
  */
569
+ /** Star or unstar one generated email as a design reference. Idempotent. */
570
+ async setFavorite(emailId, favorite) {
571
+ return this.client.put(`/emails/${emailId}/favorite`, { favorite });
572
+ }
557
573
  async metrics(emailId) {
558
574
  return this.client.get(`/emails/${emailId}/metrics`);
559
575
  }
@@ -975,6 +991,20 @@ var Metrics = class {
975
991
  }
976
992
  };
977
993
 
994
+ // src/resources/workspaces.ts
995
+ var Workspaces = class {
996
+ constructor(client) {
997
+ this.client = client;
998
+ }
999
+ /**
1000
+ * Workspaces the API key owner belongs to. Pass a workspace id as
1001
+ * `organizationId` to projects.list() to scope brands to it.
1002
+ */
1003
+ async list() {
1004
+ return this.client.get("/workspaces");
1005
+ }
1006
+ };
1007
+
978
1008
  // src/migma.ts
979
1009
  var Migma = class {
980
1010
  client;
@@ -996,6 +1026,7 @@ var Migma = class {
996
1026
  images;
997
1027
  campaigns;
998
1028
  metrics;
1029
+ workspaces;
999
1030
  constructor(apiKey, config) {
1000
1031
  if (!apiKey) {
1001
1032
  throw new Error(
@@ -1025,6 +1056,7 @@ var Migma = class {
1025
1056
  this.images = new Images(this.client);
1026
1057
  this.campaigns = new Campaigns(this.client);
1027
1058
  this.metrics = new Metrics(this.client);
1059
+ this.workspaces = new Workspaces(this.client);
1028
1060
  }
1029
1061
  };
1030
1062