migma 1.11.1 → 1.13.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/README.md +7 -7
- package/dist/index.d.mts +73 -4
- package/dist/index.d.ts +73 -4
- package/dist/index.js +49 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,6 +116,7 @@ const migma = new Migma('mgma_sk_live_...', {
|
|
|
116
116
|
baseUrl: 'https://api.migma.ai/v1', // default
|
|
117
117
|
maxRetries: 2, // retries on 5xx/429
|
|
118
118
|
retryDelay: 1000, // base delay between retries
|
|
119
|
+
agentId: 'ai:claude-code', // the AI agent behind these calls (default: MIGMA_AGENT_ID, then detected)
|
|
119
120
|
});
|
|
120
121
|
```
|
|
121
122
|
|
|
@@ -228,10 +229,10 @@ const { data: deletion } = await migma.contacts.bulkDeleteByEmail({
|
|
|
228
229
|
});
|
|
229
230
|
|
|
230
231
|
// Import contacts from a CSV file (multipart upload, processed in the background).
|
|
231
|
-
// `file` accepts a
|
|
232
|
+
// `file` accepts a Buffer, Uint8Array, Blob or File. Requires 1.13.0 or later.
|
|
232
233
|
import { readFileSync } from 'node:fs';
|
|
233
234
|
|
|
234
|
-
const { data: job } = await migma.contacts.
|
|
235
|
+
const { data: job } = await migma.contacts.createImport({
|
|
235
236
|
file: readFileSync('./contacts.csv'),
|
|
236
237
|
projectId: 'proj_abc123',
|
|
237
238
|
columnMap: {
|
|
@@ -243,10 +244,10 @@ const { data: job } = await migma.contacts.imports.create({
|
|
|
243
244
|
tags: ['newsletter'],
|
|
244
245
|
});
|
|
245
246
|
|
|
246
|
-
//
|
|
247
|
-
const { data: status } = await migma.contacts.
|
|
247
|
+
// Check status and counts. Repeat until the status is completed or failed.
|
|
248
|
+
const { data: status } = await migma.contacts.getImport(job!.id);
|
|
248
249
|
// status.status → 'pending' | 'processing' | 'completed' | 'failed'
|
|
249
|
-
// status.counts → { total, created, updated, skipped, failed }
|
|
250
|
+
// status.counts → { total, created, updated, skipped, failed, non_sendable }
|
|
250
251
|
|
|
251
252
|
// Safe retries: pass an Idempotency-Key so a retried write never duplicates.
|
|
252
253
|
// Same key + same body within 24h replays the original response.
|
|
@@ -698,8 +699,7 @@ await migma.images.updateLogos('proj_abc123', {
|
|
|
698
699
|
|
|
699
700
|
| Resource | Methods | Docs |
|
|
700
701
|
|----------|---------|------|
|
|
701
|
-
| `migma.contacts` | `create` `list` `get` `update` `remove` `bulkImport` `getBulkImportStatus` `changeStatus` | [Contacts](https://docs.migma.ai/api-reference/contacts/get-contact) |
|
|
702
|
-
| `migma.contacts.imports` | `create` `get` | [Contact imports](https://docs.migma.ai/api-reference/contacts/get-contact) |
|
|
702
|
+
| `migma.contacts` | `create` `list` `get` `update` `remove` `bulkImport` `getBulkImportStatus` `createImport` `getImport` `changeStatus` | [Contacts](https://docs.migma.ai/api-reference/contacts/get-contact) |
|
|
703
703
|
| `migma.tags` | `create` `list` `get` `update` `remove` | [Tags](https://docs.migma.ai/api-reference/tags/list-tags) |
|
|
704
704
|
| `migma.segments` | `create` `list` `get` `update` `remove` | [Segments](https://docs.migma.ai/api-reference/audiences/list-audiences) |
|
|
705
705
|
| `migma.topics` | `create` `list` `get` `update` `remove` `subscribe` `unsubscribe` | [Topics](https://docs.migma.ai/api-reference/topics/list-topics) |
|
package/dist/index.d.mts
CHANGED
|
@@ -53,12 +53,13 @@ interface ClientConfig {
|
|
|
53
53
|
baseUrl: string;
|
|
54
54
|
maxRetries: number;
|
|
55
55
|
retryDelay: number;
|
|
56
|
+
agentId?: string;
|
|
56
57
|
}
|
|
57
58
|
type HttpMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
58
59
|
interface RequestOptions {
|
|
59
60
|
method: HttpMethod;
|
|
60
61
|
path: string;
|
|
61
|
-
body?: Record<string, unknown
|
|
62
|
+
body?: Record<string, unknown> | FormData;
|
|
62
63
|
query?: Record<string, string | number | boolean | undefined>;
|
|
63
64
|
headers?: Record<string, string>;
|
|
64
65
|
maxRetries?: number;
|
|
@@ -94,9 +95,12 @@ declare class MigmaClient {
|
|
|
94
95
|
count: number;
|
|
95
96
|
}>>;
|
|
96
97
|
post<T>(path: string, body?: Record<string, unknown>, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
98
|
+
postForm<T>(path: string, body: FormData, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
97
99
|
patch<T>(path: string, body?: Record<string, unknown>, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
98
100
|
put<T>(path: string, body?: Record<string, unknown>): Promise<MigmaResult<T>>;
|
|
99
101
|
delete<T>(path: string, query?: Record<string, string | number | boolean | undefined>, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
102
|
+
/** JSON by default. A form body drops the JSON header so fetch sets the multipart one with its boundary. */
|
|
103
|
+
private encode;
|
|
100
104
|
private callHeaders;
|
|
101
105
|
private buildUrl;
|
|
102
106
|
private parseRetryAfter;
|
|
@@ -296,7 +300,59 @@ interface ContactExportStatus {
|
|
|
296
300
|
downloadExpiresAt?: string;
|
|
297
301
|
error?: string;
|
|
298
302
|
}
|
|
303
|
+
/** Maps contact fields to CSV header names. Only email is required. */
|
|
304
|
+
interface ContactImportColumnMap {
|
|
305
|
+
email: string;
|
|
306
|
+
firstName?: string;
|
|
307
|
+
lastName?: string;
|
|
308
|
+
name?: string;
|
|
309
|
+
phone?: string;
|
|
310
|
+
country?: string;
|
|
311
|
+
language?: string;
|
|
312
|
+
/** Custom field key to CSV header name. */
|
|
313
|
+
customFields?: Record<string, string>;
|
|
314
|
+
}
|
|
315
|
+
interface CreateContactImportParams {
|
|
316
|
+
/** CSV contents, up to 200MB: a Buffer, Uint8Array, Blob or File. */
|
|
317
|
+
file: Blob | Uint8Array;
|
|
318
|
+
/** Name shown for the import. Defaults to the File's name, then contacts.csv. */
|
|
319
|
+
fileName?: string;
|
|
320
|
+
projectId: string;
|
|
321
|
+
columnMap: ContactImportColumnMap;
|
|
322
|
+
/** Rows whose email already exists: upsert updates them (default), skip leaves them untouched. */
|
|
323
|
+
onConflict?: 'upsert' | 'skip';
|
|
324
|
+
/** CSV field delimiter. Default comma. */
|
|
325
|
+
delimiter?: string;
|
|
326
|
+
/** Tag names or existing tag IDs for every imported contact. Unknown names create tags. */
|
|
327
|
+
tags?: string[];
|
|
328
|
+
}
|
|
329
|
+
interface ContactImportStarted {
|
|
330
|
+
object: 'contact_import';
|
|
331
|
+
id: string;
|
|
332
|
+
status: 'processing';
|
|
333
|
+
}
|
|
299
334
|
type ContactImportProvider = 'klaviyo' | 'mailchimp' | 'hubspot';
|
|
335
|
+
/** A CSV or provider import. Provider, tag and segment fields are null for CSV imports. */
|
|
336
|
+
interface ContactImportStatus {
|
|
337
|
+
object: 'contact_import';
|
|
338
|
+
id: string;
|
|
339
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
340
|
+
provider: ContactImportProvider | null;
|
|
341
|
+
tag_id: string | null;
|
|
342
|
+
segment_id: string | null;
|
|
343
|
+
counts: {
|
|
344
|
+
total: number;
|
|
345
|
+
created: number;
|
|
346
|
+
updated: number;
|
|
347
|
+
skipped: number;
|
|
348
|
+
failed: number;
|
|
349
|
+
/** Imported contacts who are not subscribed and cannot receive campaigns. */
|
|
350
|
+
non_sendable: number;
|
|
351
|
+
};
|
|
352
|
+
error: string | null;
|
|
353
|
+
created_at: string;
|
|
354
|
+
completed_at: string | null;
|
|
355
|
+
}
|
|
300
356
|
/** A list or segment in the connected provider account that can be imported. */
|
|
301
357
|
interface ProviderImportSource {
|
|
302
358
|
id: string;
|
|
@@ -319,7 +375,7 @@ interface ImportFromProviderParams {
|
|
|
319
375
|
consentMode?: 'subscribed-only' | 'include-all';
|
|
320
376
|
connectionId?: string;
|
|
321
377
|
}
|
|
322
|
-
/** Each import becomes a tag and a segment named after its sources. Poll
|
|
378
|
+
/** Each import becomes a tag and a segment named after its sources. Poll getImport with its id. */
|
|
323
379
|
interface ProviderImportStarted {
|
|
324
380
|
object: 'contact_import';
|
|
325
381
|
id: string;
|
|
@@ -349,11 +405,18 @@ declare class Contacts {
|
|
|
349
405
|
/** Queue a filtered CSV export. Poll getExport; do not list every contact to build a CSV. */
|
|
350
406
|
createExport(params: CreateContactExportParams, options?: CallOptions): Promise<MigmaResult<ContactExportStatus>>;
|
|
351
407
|
getExport(jobId: string, projectId: string): Promise<MigmaResult<ContactExportStatus>>;
|
|
408
|
+
/**
|
|
409
|
+
* Upload a CSV to import in the background. Poll getImport for status and counts.
|
|
410
|
+
* Never retried automatically: the endpoint has no idempotency key, so a repeat creates a second import.
|
|
411
|
+
*/
|
|
412
|
+
createImport(params: CreateContactImportParams): Promise<MigmaResult<ContactImportStarted>>;
|
|
413
|
+
/** Status and counts of a CSV or provider import. */
|
|
414
|
+
getImport(id: string): Promise<MigmaResult<ContactImportStatus>>;
|
|
352
415
|
/** Lists and segments in the brand's connected Klaviyo, Mailchimp or HubSpot account. A 409 error message includes the link to connect it. */
|
|
353
416
|
listProviderImportSources(params: ListProviderImportSourcesParams): Promise<MigmaResult<{
|
|
354
417
|
sources: ProviderImportSource[];
|
|
355
418
|
}>>;
|
|
356
|
-
/** Import provider sources as contacts (subscribed only by default). Poll
|
|
419
|
+
/** Import provider sources as contacts (subscribed only by default). Poll getImport for counts. */
|
|
357
420
|
importFromProvider(params: ImportFromProviderParams, options?: CallOptions): Promise<MigmaResult<ProviderImportStarted>>;
|
|
358
421
|
changeStatus(params: ChangeStatusParams, options?: CallOptions): Promise<MigmaResult<{
|
|
359
422
|
success: boolean;
|
|
@@ -1969,6 +2032,12 @@ interface MigmaConfig {
|
|
|
1969
2032
|
maxRetries?: number;
|
|
1970
2033
|
/** Base delay between retries in ms. Default: 1000 */
|
|
1971
2034
|
retryDelay?: number;
|
|
2035
|
+
/**
|
|
2036
|
+
* Names the AI agent behind these calls, sent as `X-Agent-Id`: `ai:<slug>`,
|
|
2037
|
+
* such as `ai:claude-code`. For one process serving several agents. Default:
|
|
2038
|
+
* `MIGMA_AGENT_ID`, then the detected host.
|
|
2039
|
+
*/
|
|
2040
|
+
agentId?: string;
|
|
1972
2041
|
}
|
|
1973
2042
|
declare class Migma {
|
|
1974
2043
|
private readonly client;
|
|
@@ -1994,4 +2063,4 @@ declare class Migma {
|
|
|
1994
2063
|
constructor(apiKey: string, config?: MigmaConfig);
|
|
1995
2064
|
}
|
|
1996
2065
|
|
|
1997
|
-
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 ConnectedToolSchema, type ConnectedToolScope, type ConnectedToolSummary, type Contact, type ContactExportStatus, type ContactImportProvider, type ContactStatus, type CreateCampaignParams, type CreateContactExportParams, 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 EmailEditOperation, 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 ImportFromProviderParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListConnectedToolsParams, type ListConnectedToolsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListProviderImportSourcesParams, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type ListWorkspacesResponse, type LocalTimePassed, 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 ProviderImportSource, type ProviderImportStarted, 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 };
|
|
2066
|
+
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 ConnectedToolSchema, type ConnectedToolScope, type ConnectedToolSummary, type Contact, type ContactExportStatus, type ContactImportColumnMap, type ContactImportProvider, type ContactImportStarted, type ContactImportStatus, type ContactStatus, type CreateCampaignParams, type CreateContactExportParams, type CreateContactImportParams, 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 EmailEditOperation, 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 ImportFromProviderParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListConnectedToolsParams, type ListConnectedToolsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListProviderImportSourcesParams, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type ListWorkspacesResponse, type LocalTimePassed, 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 ProviderImportSource, type ProviderImportStarted, 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
|
@@ -53,12 +53,13 @@ interface ClientConfig {
|
|
|
53
53
|
baseUrl: string;
|
|
54
54
|
maxRetries: number;
|
|
55
55
|
retryDelay: number;
|
|
56
|
+
agentId?: string;
|
|
56
57
|
}
|
|
57
58
|
type HttpMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
58
59
|
interface RequestOptions {
|
|
59
60
|
method: HttpMethod;
|
|
60
61
|
path: string;
|
|
61
|
-
body?: Record<string, unknown
|
|
62
|
+
body?: Record<string, unknown> | FormData;
|
|
62
63
|
query?: Record<string, string | number | boolean | undefined>;
|
|
63
64
|
headers?: Record<string, string>;
|
|
64
65
|
maxRetries?: number;
|
|
@@ -94,9 +95,12 @@ declare class MigmaClient {
|
|
|
94
95
|
count: number;
|
|
95
96
|
}>>;
|
|
96
97
|
post<T>(path: string, body?: Record<string, unknown>, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
98
|
+
postForm<T>(path: string, body: FormData, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
97
99
|
patch<T>(path: string, body?: Record<string, unknown>, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
98
100
|
put<T>(path: string, body?: Record<string, unknown>): Promise<MigmaResult<T>>;
|
|
99
101
|
delete<T>(path: string, query?: Record<string, string | number | boolean | undefined>, options?: CallOptions): Promise<MigmaResult<T>>;
|
|
102
|
+
/** JSON by default. A form body drops the JSON header so fetch sets the multipart one with its boundary. */
|
|
103
|
+
private encode;
|
|
100
104
|
private callHeaders;
|
|
101
105
|
private buildUrl;
|
|
102
106
|
private parseRetryAfter;
|
|
@@ -296,7 +300,59 @@ interface ContactExportStatus {
|
|
|
296
300
|
downloadExpiresAt?: string;
|
|
297
301
|
error?: string;
|
|
298
302
|
}
|
|
303
|
+
/** Maps contact fields to CSV header names. Only email is required. */
|
|
304
|
+
interface ContactImportColumnMap {
|
|
305
|
+
email: string;
|
|
306
|
+
firstName?: string;
|
|
307
|
+
lastName?: string;
|
|
308
|
+
name?: string;
|
|
309
|
+
phone?: string;
|
|
310
|
+
country?: string;
|
|
311
|
+
language?: string;
|
|
312
|
+
/** Custom field key to CSV header name. */
|
|
313
|
+
customFields?: Record<string, string>;
|
|
314
|
+
}
|
|
315
|
+
interface CreateContactImportParams {
|
|
316
|
+
/** CSV contents, up to 200MB: a Buffer, Uint8Array, Blob or File. */
|
|
317
|
+
file: Blob | Uint8Array;
|
|
318
|
+
/** Name shown for the import. Defaults to the File's name, then contacts.csv. */
|
|
319
|
+
fileName?: string;
|
|
320
|
+
projectId: string;
|
|
321
|
+
columnMap: ContactImportColumnMap;
|
|
322
|
+
/** Rows whose email already exists: upsert updates them (default), skip leaves them untouched. */
|
|
323
|
+
onConflict?: 'upsert' | 'skip';
|
|
324
|
+
/** CSV field delimiter. Default comma. */
|
|
325
|
+
delimiter?: string;
|
|
326
|
+
/** Tag names or existing tag IDs for every imported contact. Unknown names create tags. */
|
|
327
|
+
tags?: string[];
|
|
328
|
+
}
|
|
329
|
+
interface ContactImportStarted {
|
|
330
|
+
object: 'contact_import';
|
|
331
|
+
id: string;
|
|
332
|
+
status: 'processing';
|
|
333
|
+
}
|
|
299
334
|
type ContactImportProvider = 'klaviyo' | 'mailchimp' | 'hubspot';
|
|
335
|
+
/** A CSV or provider import. Provider, tag and segment fields are null for CSV imports. */
|
|
336
|
+
interface ContactImportStatus {
|
|
337
|
+
object: 'contact_import';
|
|
338
|
+
id: string;
|
|
339
|
+
status: 'pending' | 'processing' | 'completed' | 'failed';
|
|
340
|
+
provider: ContactImportProvider | null;
|
|
341
|
+
tag_id: string | null;
|
|
342
|
+
segment_id: string | null;
|
|
343
|
+
counts: {
|
|
344
|
+
total: number;
|
|
345
|
+
created: number;
|
|
346
|
+
updated: number;
|
|
347
|
+
skipped: number;
|
|
348
|
+
failed: number;
|
|
349
|
+
/** Imported contacts who are not subscribed and cannot receive campaigns. */
|
|
350
|
+
non_sendable: number;
|
|
351
|
+
};
|
|
352
|
+
error: string | null;
|
|
353
|
+
created_at: string;
|
|
354
|
+
completed_at: string | null;
|
|
355
|
+
}
|
|
300
356
|
/** A list or segment in the connected provider account that can be imported. */
|
|
301
357
|
interface ProviderImportSource {
|
|
302
358
|
id: string;
|
|
@@ -319,7 +375,7 @@ interface ImportFromProviderParams {
|
|
|
319
375
|
consentMode?: 'subscribed-only' | 'include-all';
|
|
320
376
|
connectionId?: string;
|
|
321
377
|
}
|
|
322
|
-
/** Each import becomes a tag and a segment named after its sources. Poll
|
|
378
|
+
/** Each import becomes a tag and a segment named after its sources. Poll getImport with its id. */
|
|
323
379
|
interface ProviderImportStarted {
|
|
324
380
|
object: 'contact_import';
|
|
325
381
|
id: string;
|
|
@@ -349,11 +405,18 @@ declare class Contacts {
|
|
|
349
405
|
/** Queue a filtered CSV export. Poll getExport; do not list every contact to build a CSV. */
|
|
350
406
|
createExport(params: CreateContactExportParams, options?: CallOptions): Promise<MigmaResult<ContactExportStatus>>;
|
|
351
407
|
getExport(jobId: string, projectId: string): Promise<MigmaResult<ContactExportStatus>>;
|
|
408
|
+
/**
|
|
409
|
+
* Upload a CSV to import in the background. Poll getImport for status and counts.
|
|
410
|
+
* Never retried automatically: the endpoint has no idempotency key, so a repeat creates a second import.
|
|
411
|
+
*/
|
|
412
|
+
createImport(params: CreateContactImportParams): Promise<MigmaResult<ContactImportStarted>>;
|
|
413
|
+
/** Status and counts of a CSV or provider import. */
|
|
414
|
+
getImport(id: string): Promise<MigmaResult<ContactImportStatus>>;
|
|
352
415
|
/** Lists and segments in the brand's connected Klaviyo, Mailchimp or HubSpot account. A 409 error message includes the link to connect it. */
|
|
353
416
|
listProviderImportSources(params: ListProviderImportSourcesParams): Promise<MigmaResult<{
|
|
354
417
|
sources: ProviderImportSource[];
|
|
355
418
|
}>>;
|
|
356
|
-
/** Import provider sources as contacts (subscribed only by default). Poll
|
|
419
|
+
/** Import provider sources as contacts (subscribed only by default). Poll getImport for counts. */
|
|
357
420
|
importFromProvider(params: ImportFromProviderParams, options?: CallOptions): Promise<MigmaResult<ProviderImportStarted>>;
|
|
358
421
|
changeStatus(params: ChangeStatusParams, options?: CallOptions): Promise<MigmaResult<{
|
|
359
422
|
success: boolean;
|
|
@@ -1969,6 +2032,12 @@ interface MigmaConfig {
|
|
|
1969
2032
|
maxRetries?: number;
|
|
1970
2033
|
/** Base delay between retries in ms. Default: 1000 */
|
|
1971
2034
|
retryDelay?: number;
|
|
2035
|
+
/**
|
|
2036
|
+
* Names the AI agent behind these calls, sent as `X-Agent-Id`: `ai:<slug>`,
|
|
2037
|
+
* such as `ai:claude-code`. For one process serving several agents. Default:
|
|
2038
|
+
* `MIGMA_AGENT_ID`, then the detected host.
|
|
2039
|
+
*/
|
|
2040
|
+
agentId?: string;
|
|
1972
2041
|
}
|
|
1973
2042
|
declare class Migma {
|
|
1974
2043
|
private readonly client;
|
|
@@ -1994,4 +2063,4 @@ declare class Migma {
|
|
|
1994
2063
|
constructor(apiKey: string, config?: MigmaConfig);
|
|
1995
2064
|
}
|
|
1996
2065
|
|
|
1997
|
-
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 ConnectedToolSchema, type ConnectedToolScope, type ConnectedToolSummary, type Contact, type ContactExportStatus, type ContactImportProvider, type ContactStatus, type CreateCampaignParams, type CreateContactExportParams, 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 EmailEditOperation, 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 ImportFromProviderParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListConnectedToolsParams, type ListConnectedToolsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListProviderImportSourcesParams, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type ListWorkspacesResponse, type LocalTimePassed, 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 ProviderImportSource, type ProviderImportStarted, 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 };
|
|
2066
|
+
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 ConnectedToolSchema, type ConnectedToolScope, type ConnectedToolSummary, type Contact, type ContactExportStatus, type ContactImportColumnMap, type ContactImportProvider, type ContactImportStarted, type ContactImportStatus, type ContactStatus, type CreateCampaignParams, type CreateContactExportParams, type CreateContactImportParams, 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 EmailEditOperation, 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 ImportFromProviderParams, type ImportHtmlEmailFile, type ImportHtmlEmailParams, type ImportProjectParams, type ImportProjectResponse, type ImportStatusResponse, type KnowledgeBaseEntry, type KnowledgeBaseListResponse, type LinkAnalysisResponse, type ListCampaignsParams, type ListCampaignsResponse, type ListConnectedToolsParams, type ListConnectedToolsResponse, type ListContactsParams, type ListContactsResponse, type ListEmailsEmail, type ListEmailsParams, type ListEmailsResponse, type ListProjectsParams, type ListProjectsResponse, type ListProviderImportSourcesParams, type ListSegmentsResponse, type ListTagsParams, type ListTagsResponse, type ListTopicsParams, type ListTopicsResponse, type ListWebhooksResponse, type ListWorkspacesResponse, type LocalTimePassed, 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 ProviderImportSource, type ProviderImportStarted, 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
|
@@ -9,10 +9,16 @@ var HOST_AGENT_ENV = [
|
|
|
9
9
|
{ env: "CURSOR_TRACE_ID", id: "ai:cursor" },
|
|
10
10
|
{ env: "CODEX_HOME", id: "ai:codex" }
|
|
11
11
|
];
|
|
12
|
-
function
|
|
12
|
+
function validAgentId(value) {
|
|
13
|
+
const id = (value || "").trim().toLowerCase();
|
|
14
|
+
return AGENT_ID_PATTERN.test(id) ? id : null;
|
|
15
|
+
}
|
|
16
|
+
function detectAgentId(configured) {
|
|
17
|
+
const configuredId = validAgentId(configured);
|
|
18
|
+
if (configuredId) return configuredId;
|
|
13
19
|
if (typeof process === "undefined" || !process.env) return null;
|
|
14
|
-
const explicit = (process.env.MIGMA_AGENT_ID
|
|
15
|
-
if (
|
|
20
|
+
const explicit = validAgentId(process.env.MIGMA_AGENT_ID);
|
|
21
|
+
if (explicit) return explicit;
|
|
16
22
|
for (const { env, id } of HOST_AGENT_ENV) {
|
|
17
23
|
if (process.env[env]) return id;
|
|
18
24
|
}
|
|
@@ -84,7 +90,7 @@ var MigmaClient = class {
|
|
|
84
90
|
"Content-Type": "application/json",
|
|
85
91
|
"User-Agent": "migma-node/1.0.0"
|
|
86
92
|
};
|
|
87
|
-
const agentId = detectAgentId();
|
|
93
|
+
const agentId = detectAgentId(config.agentId);
|
|
88
94
|
if (agentId) {
|
|
89
95
|
this.headers["X-Agent-Id"] = agentId;
|
|
90
96
|
}
|
|
@@ -97,8 +103,7 @@ var MigmaClient = class {
|
|
|
97
103
|
try {
|
|
98
104
|
const response = await fetch(url, {
|
|
99
105
|
method: options.method,
|
|
100
|
-
|
|
101
|
-
body: options.body ? JSON.stringify(options.body) : void 0
|
|
106
|
+
...this.encode(options)
|
|
102
107
|
});
|
|
103
108
|
const json = await readJson(response);
|
|
104
109
|
if (!response.ok || !json?.success) {
|
|
@@ -171,6 +176,9 @@ var MigmaClient = class {
|
|
|
171
176
|
async post(path, body, options) {
|
|
172
177
|
return this.request({ method: "POST", path, body, headers: this.callHeaders(options), maxRetries: options?.maxRetries });
|
|
173
178
|
}
|
|
179
|
+
async postForm(path, body, options) {
|
|
180
|
+
return this.request({ method: "POST", path, body, headers: this.callHeaders(options), maxRetries: options?.maxRetries });
|
|
181
|
+
}
|
|
174
182
|
async patch(path, body, options) {
|
|
175
183
|
return this.request({ method: "PATCH", path, body, headers: this.callHeaders(options), maxRetries: options?.maxRetries });
|
|
176
184
|
}
|
|
@@ -180,6 +188,15 @@ var MigmaClient = class {
|
|
|
180
188
|
async delete(path, query, options) {
|
|
181
189
|
return this.request({ method: "DELETE", path, query, headers: this.callHeaders(options), maxRetries: options?.maxRetries });
|
|
182
190
|
}
|
|
191
|
+
/** JSON by default. A form body drops the JSON header so fetch sets the multipart one with its boundary. */
|
|
192
|
+
encode(options) {
|
|
193
|
+
const headers = { ...this.headers, ...options.headers };
|
|
194
|
+
if (options.body instanceof FormData) {
|
|
195
|
+
delete headers["Content-Type"];
|
|
196
|
+
return { headers, body: options.body };
|
|
197
|
+
}
|
|
198
|
+
return { headers, body: options.body ? JSON.stringify(options.body) : void 0 };
|
|
199
|
+
}
|
|
183
200
|
callHeaders(options) {
|
|
184
201
|
if (options?.idempotencyKey) {
|
|
185
202
|
return { "Idempotency-Key": options.idempotencyKey };
|
|
@@ -267,12 +284,35 @@ var Contacts = class {
|
|
|
267
284
|
async getExport(jobId, projectId) {
|
|
268
285
|
return this.client.get(`/contacts/exports/${encodeURIComponent(jobId)}`, { projectId });
|
|
269
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
* Upload a CSV to import in the background. Poll getImport for status and counts.
|
|
289
|
+
* Never retried automatically: the endpoint has no idempotency key, so a repeat creates a second import.
|
|
290
|
+
*/
|
|
291
|
+
async createImport(params) {
|
|
292
|
+
const { file, fileName, projectId, columnMap, onConflict, delimiter, tags } = params;
|
|
293
|
+
const form = new FormData();
|
|
294
|
+
form.append(
|
|
295
|
+
"file",
|
|
296
|
+
file instanceof Blob ? file : new Blob([file], { type: "text/csv" }),
|
|
297
|
+
fileName ?? file.name ?? "contacts.csv"
|
|
298
|
+
);
|
|
299
|
+
form.append("projectId", projectId);
|
|
300
|
+
form.append("columnMap", JSON.stringify(columnMap));
|
|
301
|
+
if (onConflict) form.append("onConflict", onConflict);
|
|
302
|
+
if (delimiter) form.append("delimiter", delimiter);
|
|
303
|
+
if (tags?.length) form.append("tags", JSON.stringify(tags));
|
|
304
|
+
return this.client.postForm("/contacts/imports", form, { maxRetries: 0 });
|
|
305
|
+
}
|
|
306
|
+
/** Status and counts of a CSV or provider import. */
|
|
307
|
+
async getImport(id) {
|
|
308
|
+
return this.client.get(`/contacts/imports/${encodeURIComponent(id)}`);
|
|
309
|
+
}
|
|
270
310
|
/** Lists and segments in the brand's connected Klaviyo, Mailchimp or HubSpot account. A 409 error message includes the link to connect it. */
|
|
271
311
|
async listProviderImportSources(params) {
|
|
272
312
|
const { provider, projectId, connectionId } = params;
|
|
273
313
|
return this.client.get(`/contacts/imports/providers/${encodeURIComponent(provider)}/sources`, { projectId, connectionId });
|
|
274
314
|
}
|
|
275
|
-
/** Import provider sources as contacts (subscribed only by default). Poll
|
|
315
|
+
/** Import provider sources as contacts (subscribed only by default). Poll getImport for counts. */
|
|
276
316
|
async importFromProvider(params, options) {
|
|
277
317
|
return this.client.post("/contacts/imports/provider", params, { ...options, maxRetries: options?.idempotencyKey ? options.maxRetries : 0 });
|
|
278
318
|
}
|
|
@@ -1085,7 +1125,8 @@ var Migma = class {
|
|
|
1085
1125
|
this.client = new MigmaClient(apiKey, {
|
|
1086
1126
|
baseUrl: config?.baseUrl ?? "https://api.migma.ai/v1",
|
|
1087
1127
|
maxRetries: config?.maxRetries ?? 2,
|
|
1088
|
-
retryDelay: config?.retryDelay ?? 1e3
|
|
1128
|
+
retryDelay: config?.retryDelay ?? 1e3,
|
|
1129
|
+
agentId: config?.agentId
|
|
1089
1130
|
});
|
|
1090
1131
|
this.contacts = new Contacts(this.client);
|
|
1091
1132
|
this.tags = new Tags(this.client);
|