perspectapi-ts-sdk 7.2.8 → 7.4.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 +54 -0
- package/dist/{chunk-WD62IBI5.mjs → chunk-PWZSSX4V.mjs} +170 -4
- package/dist/{index-BbTVcEl5.d.mts → index-CmcHYKO8.d.mts} +259 -7
- package/dist/{index-BbTVcEl5.d.ts → index-CmcHYKO8.d.ts} +259 -7
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +169 -4
- package/dist/index.mjs +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/index.js +171 -4
- package/dist/v2/index.mjs +3 -1
- package/package.json +1 -1
- package/src/utils/http-client.ts +17 -5
- package/src/v2/client/email-client.ts +11 -4
- package/src/v2/client/email-templates-client.ts +113 -0
- package/src/v2/client/newsletter-client.ts +156 -0
- package/src/v2/index.ts +4 -0
- package/src/v2/types.ts +233 -2
|
@@ -1636,22 +1636,71 @@ interface V2NewsletterList extends V2Object {
|
|
|
1636
1636
|
created_at: string | null;
|
|
1637
1637
|
updated_at: string | null;
|
|
1638
1638
|
}
|
|
1639
|
+
type V2NewsletterCampaignStatus = "draft" | "scheduled" | "sending" | "sent" | "cancelled";
|
|
1639
1640
|
interface V2NewsletterCampaign extends V2Object {
|
|
1640
1641
|
object: "newsletter_campaign";
|
|
1641
1642
|
name: string;
|
|
1642
1643
|
slug: string | null;
|
|
1644
|
+
slug_prefix?: string | null;
|
|
1643
1645
|
subject: string;
|
|
1644
1646
|
preview_text: string | null;
|
|
1645
|
-
|
|
1647
|
+
markdown_content?: string | null;
|
|
1648
|
+
series_id?: string | null;
|
|
1649
|
+
series_name?: string | null;
|
|
1650
|
+
template_id?: string | null;
|
|
1651
|
+
list_ids?: string[];
|
|
1652
|
+
tags?: string[] | null;
|
|
1653
|
+
notes?: string | null;
|
|
1654
|
+
from_name?: string | null;
|
|
1655
|
+
from_email?: string | null;
|
|
1656
|
+
reply_to_email?: string | null;
|
|
1657
|
+
send_to_all?: boolean;
|
|
1658
|
+
status: V2NewsletterCampaignStatus | string;
|
|
1659
|
+
scheduled_at?: string | null;
|
|
1646
1660
|
sent_at: string | null;
|
|
1647
1661
|
completed_at: string | null;
|
|
1648
1662
|
total_recipients: number;
|
|
1649
1663
|
sent_count: number;
|
|
1664
|
+
delivered_count?: number;
|
|
1650
1665
|
opened_count: number;
|
|
1651
1666
|
clicked_count: number;
|
|
1667
|
+
unsubscribed_count?: number;
|
|
1668
|
+
bounced_count?: number;
|
|
1669
|
+
complained_count?: number;
|
|
1670
|
+
created_at: string | null;
|
|
1671
|
+
updated_at: string | null;
|
|
1672
|
+
}
|
|
1673
|
+
interface V2NewsletterSeries extends V2Object {
|
|
1674
|
+
object: "newsletter_series";
|
|
1675
|
+
name: string;
|
|
1676
|
+
description: string | null;
|
|
1677
|
+
list_ids: string[];
|
|
1678
|
+
from_name: string | null;
|
|
1679
|
+
from_email: string | null;
|
|
1680
|
+
reply_to_email: string | null;
|
|
1681
|
+
subject_prefix: string | null;
|
|
1682
|
+
cadence: "manual" | "daily" | "weekly" | "monthly" | string;
|
|
1683
|
+
timezone: string | null;
|
|
1684
|
+
send_time: string | null;
|
|
1685
|
+
day_of_week: number | null;
|
|
1686
|
+
day_of_month: number | null;
|
|
1687
|
+
status: "active" | "paused" | "archived" | string;
|
|
1688
|
+
last_sent_at: string | null;
|
|
1689
|
+
next_send_at: string | null;
|
|
1690
|
+
tags: string[] | null;
|
|
1691
|
+
notes: string | null;
|
|
1652
1692
|
created_at: string | null;
|
|
1653
1693
|
updated_at: string | null;
|
|
1654
1694
|
}
|
|
1695
|
+
interface V2NewsletterStatistics {
|
|
1696
|
+
object: "newsletter_statistics";
|
|
1697
|
+
total: number;
|
|
1698
|
+
by_status: Record<string, number>;
|
|
1699
|
+
recent_activity: Array<{
|
|
1700
|
+
date: string;
|
|
1701
|
+
count: number;
|
|
1702
|
+
}>;
|
|
1703
|
+
}
|
|
1655
1704
|
interface V2NewsletterTrackingResponse {
|
|
1656
1705
|
success: boolean;
|
|
1657
1706
|
}
|
|
@@ -1724,6 +1773,84 @@ interface V2NewsletterImportResult {
|
|
|
1724
1773
|
subscription_id: string;
|
|
1725
1774
|
}>;
|
|
1726
1775
|
}
|
|
1776
|
+
interface V2NewsletterCampaignCreateParams {
|
|
1777
|
+
campaign_name: string;
|
|
1778
|
+
subject: string;
|
|
1779
|
+
/** Markdown body; rendered to HTML/text server-side. */
|
|
1780
|
+
markdown_content: string;
|
|
1781
|
+
slug?: string;
|
|
1782
|
+
slug_prefix?: string | null;
|
|
1783
|
+
/**
|
|
1784
|
+
* `scheduled` requires a `scheduled_at`, the newsletter plan entitlement, and
|
|
1785
|
+
* the `newsletters.publish` permission on the API key (creating/updating a
|
|
1786
|
+
* draft only needs `newsletters.create`/`newsletters.update`).
|
|
1787
|
+
*/
|
|
1788
|
+
status?: "draft" | "scheduled" | "cancelled";
|
|
1789
|
+
/** Local datetime (YYYY-MM-DDTHH:MM[:SS]) in the site/series timezone. */
|
|
1790
|
+
scheduled_at?: string | null;
|
|
1791
|
+
preview_text?: string;
|
|
1792
|
+
from_name?: string;
|
|
1793
|
+
from_email?: string;
|
|
1794
|
+
reply_to_email?: string;
|
|
1795
|
+
/** Newsletter template version ID (`etpl_…`). */
|
|
1796
|
+
template_id?: string | null;
|
|
1797
|
+
/** Series ID (`nsr_…`). */
|
|
1798
|
+
series_id?: string | null;
|
|
1799
|
+
/** Target list IDs (`nll_…`). */
|
|
1800
|
+
list_ids?: string[];
|
|
1801
|
+
tags?: string[];
|
|
1802
|
+
notes?: string;
|
|
1803
|
+
}
|
|
1804
|
+
type V2NewsletterCampaignUpdateParams = Partial<Omit<V2NewsletterCampaignCreateParams, "campaign_name" | "subject" | "markdown_content">> & {
|
|
1805
|
+
campaign_name?: string;
|
|
1806
|
+
subject?: string;
|
|
1807
|
+
markdown_content?: string;
|
|
1808
|
+
};
|
|
1809
|
+
interface V2NewsletterSeriesCreateParams {
|
|
1810
|
+
series_name: string;
|
|
1811
|
+
description?: string;
|
|
1812
|
+
status?: "active" | "paused" | "archived";
|
|
1813
|
+
cadence?: "manual" | "daily" | "weekly" | "monthly";
|
|
1814
|
+
timezone?: string;
|
|
1815
|
+
send_time?: string;
|
|
1816
|
+
day_of_week?: number;
|
|
1817
|
+
day_of_month?: number;
|
|
1818
|
+
next_send_at?: string | null;
|
|
1819
|
+
list_ids?: string[];
|
|
1820
|
+
from_name?: string;
|
|
1821
|
+
from_email?: string;
|
|
1822
|
+
reply_to_email?: string;
|
|
1823
|
+
subject_prefix?: string;
|
|
1824
|
+
tags?: string[];
|
|
1825
|
+
notes?: string;
|
|
1826
|
+
}
|
|
1827
|
+
type V2NewsletterSeriesUpdateParams = Partial<V2NewsletterSeriesCreateParams>;
|
|
1828
|
+
interface V2NewsletterStatisticsParams {
|
|
1829
|
+
start_date?: string;
|
|
1830
|
+
end_date?: string;
|
|
1831
|
+
list_id?: string;
|
|
1832
|
+
}
|
|
1833
|
+
interface V2NewsletterSubscriptionStatusUpdate {
|
|
1834
|
+
status: "confirmed" | "unsubscribed" | "bounced" | "complained";
|
|
1835
|
+
notes?: string;
|
|
1836
|
+
}
|
|
1837
|
+
interface V2NewsletterBulkParams {
|
|
1838
|
+
ids: string[];
|
|
1839
|
+
action: "confirm" | "unsubscribe" | "delete" | "add_to_list" | "remove_from_list";
|
|
1840
|
+
/** Required for add_to_list / remove_from_list. */
|
|
1841
|
+
list_id?: string;
|
|
1842
|
+
}
|
|
1843
|
+
interface V2NewsletterBulkResult {
|
|
1844
|
+
object: "newsletter_bulk_result";
|
|
1845
|
+
succeeded: number;
|
|
1846
|
+
failed: number;
|
|
1847
|
+
/** Per-id failures (id + reason) for the subscriptions that did not apply. */
|
|
1848
|
+
failures: Array<{
|
|
1849
|
+
id: string;
|
|
1850
|
+
error: string;
|
|
1851
|
+
}>;
|
|
1852
|
+
[key: string]: unknown;
|
|
1853
|
+
}
|
|
1727
1854
|
interface V2ContactSubmission extends V2Object {
|
|
1728
1855
|
object: "contact_submission";
|
|
1729
1856
|
name: string | null;
|
|
@@ -1875,15 +2002,87 @@ interface V2GrantCreditResult {
|
|
|
1875
2002
|
object: "grant_credit_result";
|
|
1876
2003
|
new_balance_cents: number;
|
|
1877
2004
|
}
|
|
2005
|
+
type V2EmailTemplateType = "order_customer_receipt" | "order_admin_notification" | "signup_welcome" | "order_fulfillment_notification" | "order_cancellation_notification" | "subscription_cancelled" | "subscription_cancellation_admin_notification" | "subscription_plan_changed" | "subscription_plan_changed_admin_notification" | "newsletter" | "customer_support";
|
|
2006
|
+
type V2EmailTemplateStatus = "draft" | "published" | "archived";
|
|
1878
2007
|
interface V2EmailSendParams {
|
|
1879
2008
|
to: string | string[];
|
|
1880
|
-
subject
|
|
2009
|
+
/** Required for raw sends; optional (overrides the rendered subject) for template sends. */
|
|
2010
|
+
subject?: string;
|
|
1881
2011
|
html?: string;
|
|
1882
2012
|
text?: string;
|
|
1883
2013
|
from?: string;
|
|
1884
2014
|
reply_to?: string;
|
|
1885
2015
|
cc?: string | string[];
|
|
1886
2016
|
bcc?: string | string[];
|
|
2017
|
+
/**
|
|
2018
|
+
* Template-based send. Provide exactly one of `template_id` (a published
|
|
2019
|
+
* template by ID) or `template_type` (the published template for that type);
|
|
2020
|
+
* the template is rendered server-side with `variables` substituted in.
|
|
2021
|
+
* Mutually exclusive with `html`/`text`.
|
|
2022
|
+
*/
|
|
2023
|
+
template_id?: string;
|
|
2024
|
+
template_type?: V2EmailTemplateType;
|
|
2025
|
+
variables?: Record<string, string | number | null>;
|
|
2026
|
+
/**
|
|
2027
|
+
* When true, every placeholder referenced by the template must be present in
|
|
2028
|
+
* `variables` (null counts as provided) — otherwise the API rejects the send
|
|
2029
|
+
* instead of rendering the missing placeholders as empty strings.
|
|
2030
|
+
*/
|
|
2031
|
+
strict?: boolean;
|
|
2032
|
+
}
|
|
2033
|
+
interface V2EmailTemplate extends V2Object {
|
|
2034
|
+
object: "email_template";
|
|
2035
|
+
template_type: V2EmailTemplateType;
|
|
2036
|
+
template_name: string;
|
|
2037
|
+
description: string | null;
|
|
2038
|
+
subject_template: string;
|
|
2039
|
+
html_template: string;
|
|
2040
|
+
text_template: string;
|
|
2041
|
+
status: V2EmailTemplateStatus;
|
|
2042
|
+
version: number;
|
|
2043
|
+
variables: string[];
|
|
2044
|
+
created_by: string | null;
|
|
2045
|
+
created_at: string;
|
|
2046
|
+
updated_at: string;
|
|
2047
|
+
published_at: string | null;
|
|
2048
|
+
/** Present on clone responses: the source template ID. */
|
|
2049
|
+
source_template_id?: string;
|
|
2050
|
+
}
|
|
2051
|
+
interface V2EmailTemplateType_Listing {
|
|
2052
|
+
object: "email_template_type";
|
|
2053
|
+
template_type: V2EmailTemplateType;
|
|
2054
|
+
variables: string[];
|
|
2055
|
+
}
|
|
2056
|
+
interface V2EmailTemplateListParams {
|
|
2057
|
+
template_type?: V2EmailTemplateType;
|
|
2058
|
+
status?: V2EmailTemplateStatus;
|
|
2059
|
+
}
|
|
2060
|
+
interface V2EmailTemplateCreateParams {
|
|
2061
|
+
template_type: V2EmailTemplateType;
|
|
2062
|
+
template_name: string;
|
|
2063
|
+
subject_template: string;
|
|
2064
|
+
html_template: string;
|
|
2065
|
+
text_template: string;
|
|
2066
|
+
description?: string;
|
|
2067
|
+
/**
|
|
2068
|
+
* Defaults to "draft". Creating directly into "published" additionally
|
|
2069
|
+
* requires the `templates.publish` permission (and the custom-email plan
|
|
2070
|
+
* entitlement, like all template mutations); otherwise the API returns 403.
|
|
2071
|
+
*/
|
|
2072
|
+
status?: "draft" | "published";
|
|
2073
|
+
}
|
|
2074
|
+
interface V2EmailTemplateCloneParams {
|
|
2075
|
+
template_name?: string;
|
|
2076
|
+
subject_template?: string;
|
|
2077
|
+
html_template?: string;
|
|
2078
|
+
text_template?: string;
|
|
2079
|
+
description?: string;
|
|
2080
|
+
/**
|
|
2081
|
+
* Defaults to "draft". Creating directly into "published" additionally
|
|
2082
|
+
* requires the `templates.publish` permission (and the custom-email plan
|
|
2083
|
+
* entitlement, like all template mutations); otherwise the API returns 403.
|
|
2084
|
+
*/
|
|
2085
|
+
status?: "draft" | "published";
|
|
1887
2086
|
}
|
|
1888
2087
|
interface V2EmailSendResult {
|
|
1889
2088
|
object: "email";
|
|
@@ -2188,6 +2387,22 @@ declare class NewsletterV2Client extends BaseV2Client {
|
|
|
2188
2387
|
* processed on the server.
|
|
2189
2388
|
*/
|
|
2190
2389
|
importSubscriptions(siteName: string, data: V2NewsletterImportRequest): Promise<V2NewsletterImportResult>;
|
|
2390
|
+
getListById(siteName: string, id: string, cachePolicy?: CachePolicy): Promise<V2NewsletterList>;
|
|
2391
|
+
getSubscriptionByEmail(siteName: string, email: string, cachePolicy?: CachePolicy): Promise<V2NewsletterSubscription>;
|
|
2392
|
+
updateSubscriptionStatus(siteName: string, id: string, data: V2NewsletterSubscriptionStatusUpdate): Promise<V2NewsletterSubscription>;
|
|
2393
|
+
deleteSubscription(siteName: string, id: string): Promise<V2Deleted>;
|
|
2394
|
+
bulkUpdateSubscriptions(siteName: string, data: V2NewsletterBulkParams): Promise<V2NewsletterBulkResult>;
|
|
2395
|
+
getStatistics(siteName: string, params?: V2NewsletterStatisticsParams, cachePolicy?: CachePolicy): Promise<V2NewsletterStatistics>;
|
|
2396
|
+
createCampaign(siteName: string, data: V2NewsletterCampaignCreateParams): Promise<V2NewsletterCampaign>;
|
|
2397
|
+
updateCampaign(siteName: string, id: string, data: V2NewsletterCampaignUpdateParams): Promise<V2NewsletterCampaign>;
|
|
2398
|
+
deleteCampaign(siteName: string, id: string): Promise<V2Deleted>;
|
|
2399
|
+
listSeries(siteName: string, params?: {
|
|
2400
|
+
status?: 'active' | 'paused' | 'archived';
|
|
2401
|
+
}, cachePolicy?: CachePolicy): Promise<V2List<V2NewsletterSeries>>;
|
|
2402
|
+
getSeries(siteName: string, id: string, cachePolicy?: CachePolicy): Promise<V2NewsletterSeries>;
|
|
2403
|
+
createSeries(siteName: string, data: V2NewsletterSeriesCreateParams): Promise<V2NewsletterSeries>;
|
|
2404
|
+
updateSeries(siteName: string, id: string, data: V2NewsletterSeriesUpdateParams): Promise<V2NewsletterSeries>;
|
|
2405
|
+
deleteSeries(siteName: string, id: string): Promise<V2Deleted>;
|
|
2191
2406
|
}
|
|
2192
2407
|
|
|
2193
2408
|
/**
|
|
@@ -2310,15 +2525,51 @@ declare class CreditsV2Client extends BaseV2Client {
|
|
|
2310
2525
|
|
|
2311
2526
|
declare class EmailV2Client extends BaseV2Client {
|
|
2312
2527
|
/**
|
|
2313
|
-
* Send a transactional email
|
|
2528
|
+
* Send a transactional email through the site's email provider.
|
|
2314
2529
|
*
|
|
2315
|
-
* Requires a server-side API key — never call this from a browser.
|
|
2316
|
-
*
|
|
2317
|
-
*
|
|
2530
|
+
* Requires a server-side API key — never call this from a browser. Sites
|
|
2531
|
+
* without a configured provider fall back to the platform default with
|
|
2532
|
+
* policy restrictions (owner-only recipients, daily quota).
|
|
2533
|
+
*
|
|
2534
|
+
* Provide content one of two ways (mutually exclusive):
|
|
2535
|
+
* - Raw: `subject` plus at least one of `html` / `text`.
|
|
2536
|
+
* - Template: `template_type` (published template for that type) or
|
|
2537
|
+
* `template_id` (published template by ID) plus optional `variables`; the
|
|
2538
|
+
* template is rendered server-side. `subject` is optional here and
|
|
2539
|
+
* overrides the rendered one.
|
|
2318
2540
|
*/
|
|
2319
2541
|
send(siteName: string, params: V2EmailSendParams): Promise<V2EmailSendResult>;
|
|
2320
2542
|
}
|
|
2321
2543
|
|
|
2544
|
+
/**
|
|
2545
|
+
* v2 Email Templates Client — versioned CRUD for site email templates.
|
|
2546
|
+
*
|
|
2547
|
+
* Mirrors the email_template_* MCP tools. Templates live under
|
|
2548
|
+
* /sites/:siteName/email/templates. Use `listTypes` / `getTypeVariables` to
|
|
2549
|
+
* discover the allowed substitution variables for each template type before
|
|
2550
|
+
* authoring, then create/clone/publish versions.
|
|
2551
|
+
*/
|
|
2552
|
+
|
|
2553
|
+
declare class EmailTemplatesV2Client extends BaseV2Client {
|
|
2554
|
+
private path;
|
|
2555
|
+
/** List every supported template type with its allowed variables. */
|
|
2556
|
+
listTypes(siteName: string, cachePolicy?: CachePolicy): Promise<V2List<V2EmailTemplateType_Listing>>;
|
|
2557
|
+
/** Get the allowed variables for a single template type. */
|
|
2558
|
+
getTypeVariables(siteName: string, templateType: V2EmailTemplateType, cachePolicy?: CachePolicy): Promise<V2EmailTemplateType_Listing>;
|
|
2559
|
+
/** List template versions, optionally filtered by type and/or status. */
|
|
2560
|
+
list(siteName: string, params?: V2EmailTemplateListParams, cachePolicy?: CachePolicy): Promise<V2List<V2EmailTemplate>>;
|
|
2561
|
+
/** Get a specific template version by ID (`etpl_…`). */
|
|
2562
|
+
get(siteName: string, templateId: string, cachePolicy?: CachePolicy): Promise<V2EmailTemplate>;
|
|
2563
|
+
/** Get the currently published version for a template type. */
|
|
2564
|
+
getPublished(siteName: string, templateType: V2EmailTemplateType, cachePolicy?: CachePolicy): Promise<V2EmailTemplate>;
|
|
2565
|
+
/** Create a new template version. */
|
|
2566
|
+
create(siteName: string, params: V2EmailTemplateCreateParams): Promise<V2EmailTemplate>;
|
|
2567
|
+
/** Clone a template version, optionally overriding fields. */
|
|
2568
|
+
clone(siteName: string, templateId: string, params?: V2EmailTemplateCloneParams): Promise<V2EmailTemplate>;
|
|
2569
|
+
/** Publish a template version (archives the previously published one). */
|
|
2570
|
+
publish(siteName: string, templateId: string): Promise<V2EmailTemplate>;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2322
2573
|
/**
|
|
2323
2574
|
* PerspectAPI v2 SDK Client
|
|
2324
2575
|
*
|
|
@@ -2352,6 +2603,7 @@ declare class PerspectApiV2Client {
|
|
|
2352
2603
|
readonly subscriptions: SubscriptionsV2Client;
|
|
2353
2604
|
readonly credits: CreditsV2Client;
|
|
2354
2605
|
readonly email: EmailV2Client;
|
|
2606
|
+
readonly emailTemplates: EmailTemplatesV2Client;
|
|
2355
2607
|
constructor(config: PerspectApiV2Config);
|
|
2356
2608
|
/** Update the JWT token for authenticated requests. */
|
|
2357
2609
|
setAuth(jwt: string): void;
|
|
@@ -2362,4 +2614,4 @@ declare class PerspectApiV2Client {
|
|
|
2362
2614
|
}
|
|
2363
2615
|
declare function createPerspectApiV2Client(config: PerspectApiConfig): PerspectApiV2Client;
|
|
2364
2616
|
|
|
2365
|
-
export { type NewsletterManagementList as $, type ApiResponse as A, type CreateNewsletterSubscriptionRequest as B, CacheManager as C, type NewsletterConfirmResponse as D, type NewsletterUnsubscribeRequest as E, type NewsletterUnsubscribeResponse as F, type NewsletterPreferences as G, HttpClient as H, type NewsletterList as I, type NewsletterCampaignListResponse as J, type NewsletterCampaignDetail as K, type NewsletterStatusResponse as L, type NewsletterManagementSubscriptionsListResponse as M, type NewsletterSubscribeResponse as N, type Organization as O, type PaginatedResponse as P, type NewsletterManagementSubscription as Q, type NewsletterSubscriptionSyncRequest as R, type Site as S, type NewsletterSubscriptionSyncResponse as T, type User as U, type NewsletterSubscriptionsBulkUpdateRequest as V, type Webhook as W, type NewsletterSubscriptionsBulkUpdateResponse as X, type NewsletterSubscriptionMembershipUpdateRequest as Y, type NewsletterSubscriptionsImportRequest as Z, type NewsletterSubscriptionsImportResponse as _, type CachePolicy as a, type V2ContentListParams as a$, type NewsletterManagementSeries as a0, type NewsletterManagementCampaignListResponse as a1, type NewsletterManagementCampaign as a2, type NewsletterCampaignTestSendRequest as a3, type NewsletterCampaignTestSendResponse as a4, type NewsletterManagementStatsResponse as a5, type NewsletterExportCreateRequest as a6, type NewsletterExportCreateResponse as a7, type RequestOtpRequest as a8, type VerifyOtpRequest as a9, PerspectV2Error as aA, createApiError as aB, PerspectApiError as aC, type CacheConfig as aD, type ApiError as aE, type MediaItem as aF, type CategorySummary as aG, type PaymentGateway as aH, type NewsletterSubscription as aI, type NewsletterCampaignSummary as aJ, type NewsletterManagementListMembership as aK, type NewsletterSubscriptionsBulkAction as aL, type NewsletterSubscriptionsBulkOutcome as aM, type NewsletterSubscriptionImportRowRequest as aN, type NewsletterSubscriptionsImportRowResult as aO, type NewsletterManagementPagination as aP, type SetProfileValueRequest as aQ, type V2Object as aR, type V2List as aS, type V2Deleted as aT, type V2Error as aU, type V2ErrorType as aV, type V2PaginationParams as aW, type V2Media as aX, type V2Content as aY, type V2ContentCreateParams as aZ, type V2ContentUpdateParams as a_, type VerifyOtpResponse as aa, type SiteUser as ab, type SiteUserProfile as ac, type UpdateSiteUserRequest as ad, type SiteUserOrder as ae, type SiteUserSubscription as af, type CancelSubscriptionRequest as ag, type CancelSubscriptionResponse as ah, type CreditBalance as ai, type CreditBalanceWithTransactions as aj, type GrantCreditRequest as ak, type ProductBundleGroup as al, type CreateBundleGroupRequest as am, type BundleCollection as an, type BundleCollectionItemWithProduct as ao, type CreateBundleCollectionRequest as ap, type AddCollectionItemRequest as aq, type BundleCollectionItem as ar, type PerspectApiConfig as as, type CacheAdapter as at, type BlogPost as au, type CheckoutMetadata as av, type CheckoutAddress as aw, type CheckoutTaxRequest as ax, PerspectApiV2Client as ay, createPerspectApiV2Client as az, type CacheInvalidateOptions as b, type
|
|
2617
|
+
export { type NewsletterManagementList as $, type ApiResponse as A, type CreateNewsletterSubscriptionRequest as B, CacheManager as C, type NewsletterConfirmResponse as D, type NewsletterUnsubscribeRequest as E, type NewsletterUnsubscribeResponse as F, type NewsletterPreferences as G, HttpClient as H, type NewsletterList as I, type NewsletterCampaignListResponse as J, type NewsletterCampaignDetail as K, type NewsletterStatusResponse as L, type NewsletterManagementSubscriptionsListResponse as M, type NewsletterSubscribeResponse as N, type Organization as O, type PaginatedResponse as P, type NewsletterManagementSubscription as Q, type NewsletterSubscriptionSyncRequest as R, type Site as S, type NewsletterSubscriptionSyncResponse as T, type User as U, type NewsletterSubscriptionsBulkUpdateRequest as V, type Webhook as W, type NewsletterSubscriptionsBulkUpdateResponse as X, type NewsletterSubscriptionMembershipUpdateRequest as Y, type NewsletterSubscriptionsImportRequest as Z, type NewsletterSubscriptionsImportResponse as _, type CachePolicy as a, type V2ContentListParams as a$, type NewsletterManagementSeries as a0, type NewsletterManagementCampaignListResponse as a1, type NewsletterManagementCampaign as a2, type NewsletterCampaignTestSendRequest as a3, type NewsletterCampaignTestSendResponse as a4, type NewsletterManagementStatsResponse as a5, type NewsletterExportCreateRequest as a6, type NewsletterExportCreateResponse as a7, type RequestOtpRequest as a8, type VerifyOtpRequest as a9, PerspectV2Error as aA, createApiError as aB, PerspectApiError as aC, type CacheConfig as aD, type ApiError as aE, type MediaItem as aF, type CategorySummary as aG, type PaymentGateway as aH, type NewsletterSubscription as aI, type NewsletterCampaignSummary as aJ, type NewsletterManagementListMembership as aK, type NewsletterSubscriptionsBulkAction as aL, type NewsletterSubscriptionsBulkOutcome as aM, type NewsletterSubscriptionImportRowRequest as aN, type NewsletterSubscriptionsImportRowResult as aO, type NewsletterManagementPagination as aP, type SetProfileValueRequest as aQ, type V2Object as aR, type V2List as aS, type V2Deleted as aT, type V2Error as aU, type V2ErrorType as aV, type V2PaginationParams as aW, type V2Media as aX, type V2Content as aY, type V2ContentCreateParams as aZ, type V2ContentUpdateParams as a_, type VerifyOtpResponse as aa, type SiteUser as ab, type SiteUserProfile as ac, type UpdateSiteUserRequest as ad, type SiteUserOrder as ae, type SiteUserSubscription as af, type CancelSubscriptionRequest as ag, type CancelSubscriptionResponse as ah, type CreditBalance as ai, type CreditBalanceWithTransactions as aj, type GrantCreditRequest as ak, type ProductBundleGroup as al, type CreateBundleGroupRequest as am, type BundleCollection as an, type BundleCollectionItemWithProduct as ao, type CreateBundleCollectionRequest as ap, type AddCollectionItemRequest as aq, type BundleCollectionItem as ar, type PerspectApiConfig as as, type CacheAdapter as at, type BlogPost as au, type CheckoutMetadata as av, type CheckoutAddress as aw, type CheckoutTaxRequest as ax, PerspectApiV2Client as ay, createPerspectApiV2Client as az, type CacheInvalidateOptions as b, type V2SubscriptionChargeParams as b$, type V2Product as b0, type V2ProductCreateParams as b1, type V2ProductUpdateParams as b2, type V2ProductListParams as b3, type V2Category as b4, type V2CategoryCreateParams as b5, type V2CategoryUpdateParams as b6, type V2Collection as b7, type V2CollectionItem as b8, type V2CollectionCreateParams as b9, type V2NewsletterListCreateParams as bA, type V2NewsletterListUpdateParams as bB, type V2NewsletterSyncInput as bC, type V2NewsletterSyncResult as bD, type V2NewsletterSubscriptionListMembershipUpdate as bE, type V2NewsletterImportRequest as bF, type V2NewsletterImportResult as bG, type V2NewsletterCampaignCreateParams as bH, type V2NewsletterCampaignUpdateParams as bI, type V2NewsletterSeriesCreateParams as bJ, type V2NewsletterSeriesUpdateParams as bK, type V2NewsletterStatisticsParams as bL, type V2NewsletterSubscriptionStatusUpdate as bM, type V2NewsletterBulkParams as bN, type V2NewsletterBulkResult as bO, type V2ContactSubmission as bP, type V2Organization as bQ, type V2Site as bR, type V2ApiKey as bS, type V2WebhookEventType as bT, type V2Webhook as bU, type V2WebhookCreateParams as bV, type V2WebhookUpdateParams as bW, type V2SiteUserSubscription as bX, type V2SubscriptionPauseParams as bY, type V2SubscriptionCancelParams as bZ, type V2SubscriptionChangePlanParams as b_, type V2CollectionUpdateParams as ba, type V2Order as bb, type V2OrderListParams as bc, type V2OrderLineItemPriceData as bd, type V2OrderLineItem as be, type V2OrderAddress as bf, type V2OrderTaxRequest as bg, type V2OrderCreateParams as bh, type V2OrderFulfillmentUpdate as bi, type V2OrderFulfillmentNotificationLineItem as bj, type V2OrderFulfillmentNotificationParams as bk, type V2OrderFulfillmentNotificationResult as bl, type V2OrderCreateResult as bm, type V2SiteUser as bn, type V2SiteUserUpdateParams as bo, type V2SiteUserMeUpdateParams as bp, type V2SiteUserListParams as bq, type V2SiteUserWithProfile as br, type V2SiteUserProfile as bs, type V2NewsletterSubscription as bt, type V2NewsletterList as bu, type V2NewsletterCampaignStatus as bv, type V2NewsletterCampaign as bw, type V2NewsletterSeries as bx, type V2NewsletterStatistics as by, type V2NewsletterTrackingResponse as bz, type ContentQueryParams as c, type V2SubscriptionChargeResult as c0, type V2CancelSubscriptionResult as c1, type V2CreditTransaction as c2, type V2CreditBalance as c3, type V2GrantCreditParams as c4, type V2GrantCreditResult as c5, type V2EmailTemplateType as c6, type V2EmailTemplateStatus as c7, type V2EmailSendParams as c8, type V2EmailTemplate as c9, CategoriesV2Client as cA, CollectionsV2Client as cB, OrdersV2Client as cC, SiteUsersV2Client as cD, NewsletterV2Client as cE, ContactsV2Client as cF, OrganizationsV2Client as cG, SitesV2Client as cH, ApiKeysV2Client as cI, WebhooksV2Client as cJ, SubscriptionsV2Client as cK, CreditsV2Client as cL, EmailV2Client as cM, EmailTemplatesV2Client as cN, type V2EmailTemplateType_Listing as ca, type V2EmailTemplateListParams as cb, type V2EmailTemplateCreateParams as cc, type V2EmailTemplateCloneParams as cd, type V2EmailSendResult as ce, type PaginationParams as cf, type ContentStatus as cg, type ContentType as ch, type ProductSkuMediaItem as ci, type ProductSkuOption as cj, type CreatePaymentGatewayRequest as ck, type WebhookEventType as cl, type CheckoutMetadataValue as cm, type CheckoutTaxStrategy as cn, type CheckoutTaxExemptionStatus as co, type CheckoutTaxCustomerExemptionRequest as cp, type CheckoutTaxBreakdownItem as cq, type CheckoutSessionTax as cr, type SubscriptionCancellationMode as cs, type CreditTransaction as ct, type HttpMethod as cu, type RequestOptions as cv, type PerspectApiV2Config as cw, BaseV2Client as cx, ContentV2Client as cy, ProductsV2Client as cz, type Content as d, type ContentCategoryResponse as e, type CreateContentRequest as f, type UpdateContentRequest as g, type ApiKey as h, type CreateApiKeyRequest as i, type UpdateApiKeyRequest as j, type CreateOrganizationRequest as k, type CreateSiteRequest as l, type ProductQueryParams as m, type Product as n, type CreateProductRequest as o, type ProductSku as p, type CreateProductSkuRequest as q, type Category as r, type CreateCategoryRequest as s, type CreateWebhookRequest as t, type CreateCheckoutSessionRequest as u, type CheckoutSession as v, type CreateContactRequest as w, type ContactSubmitResponse as x, type ContactStatusResponse as y, type ContactSubmission as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-
|
|
2
|
-
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary,
|
|
1
|
+
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-CmcHYKO8.mjs';
|
|
2
|
+
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary, cm as CheckoutMetadataValue, cr as CheckoutSessionTax, cq as CheckoutTaxBreakdownItem, cp as CheckoutTaxCustomerExemptionRequest, co as CheckoutTaxExemptionStatus, cn as CheckoutTaxStrategy, cg as ContentStatus, ch as ContentType, ck as CreatePaymentGatewayRequest, ct as CreditTransaction, cu as HttpMethod, aF as MediaItem, aJ as NewsletterCampaignSummary, aK as NewsletterManagementListMembership, aP as NewsletterManagementPagination, aI as NewsletterSubscription, aN as NewsletterSubscriptionImportRowRequest, aL as NewsletterSubscriptionsBulkAction, aM as NewsletterSubscriptionsBulkOutcome, aO as NewsletterSubscriptionsImportRowResult, cf as PaginationParams, aH as PaymentGateway, aC as PerspectApiError, ay as PerspectApiV2Client, aA as PerspectV2Error, ci as ProductSkuMediaItem, cj as ProductSkuOption, cv as RequestOptions, aQ as SetProfileValueRequest, cs as SubscriptionCancellationMode, bS as V2ApiKey, c1 as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bP as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, c3 as V2CreditBalance, c2 as V2CreditTransaction, aT as V2Deleted, c8 as V2EmailSendParams, ce as V2EmailSendResult, c9 as V2EmailTemplate, cd as V2EmailTemplateCloneParams, cc as V2EmailTemplateCreateParams, cb as V2EmailTemplateListParams, c7 as V2EmailTemplateStatus, c6 as V2EmailTemplateType, ca as V2EmailTemplateType_Listing, aU as V2Error, aV as V2ErrorType, c4 as V2GrantCreditParams, c5 as V2GrantCreditResult, aS as V2List, aX as V2Media, bN as V2NewsletterBulkParams, bO as V2NewsletterBulkResult, bw as V2NewsletterCampaign, bH as V2NewsletterCampaignCreateParams, bv as V2NewsletterCampaignStatus, bI as V2NewsletterCampaignUpdateParams, bF as V2NewsletterImportRequest, bG as V2NewsletterImportResult, bu as V2NewsletterList, bA as V2NewsletterListCreateParams, bB as V2NewsletterListUpdateParams, bx as V2NewsletterSeries, bJ as V2NewsletterSeriesCreateParams, bK as V2NewsletterSeriesUpdateParams, by as V2NewsletterStatistics, bL as V2NewsletterStatisticsParams, bt as V2NewsletterSubscription, bE as V2NewsletterSubscriptionListMembershipUpdate, bM as V2NewsletterSubscriptionStatusUpdate, bC as V2NewsletterSyncInput, bD as V2NewsletterSyncResult, bz as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bQ as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bR as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bX as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bZ as V2SubscriptionCancelParams, b_ as V2SubscriptionChangePlanParams, b$ as V2SubscriptionChargeParams, c0 as V2SubscriptionChargeResult, bY as V2SubscriptionPauseParams, bU as V2Webhook, bV as V2WebhookCreateParams, bT as V2WebhookEventType, bW as V2WebhookUpdateParams, cl as WebhookEventType, aB as createApiError, az as createPerspectApiV2Client } from './index-CmcHYKO8.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* v1 deprecation constants — kept in sync with the backend's
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-
|
|
2
|
-
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary,
|
|
1
|
+
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-CmcHYKO8.js';
|
|
2
|
+
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary, cm as CheckoutMetadataValue, cr as CheckoutSessionTax, cq as CheckoutTaxBreakdownItem, cp as CheckoutTaxCustomerExemptionRequest, co as CheckoutTaxExemptionStatus, cn as CheckoutTaxStrategy, cg as ContentStatus, ch as ContentType, ck as CreatePaymentGatewayRequest, ct as CreditTransaction, cu as HttpMethod, aF as MediaItem, aJ as NewsletterCampaignSummary, aK as NewsletterManagementListMembership, aP as NewsletterManagementPagination, aI as NewsletterSubscription, aN as NewsletterSubscriptionImportRowRequest, aL as NewsletterSubscriptionsBulkAction, aM as NewsletterSubscriptionsBulkOutcome, aO as NewsletterSubscriptionsImportRowResult, cf as PaginationParams, aH as PaymentGateway, aC as PerspectApiError, ay as PerspectApiV2Client, aA as PerspectV2Error, ci as ProductSkuMediaItem, cj as ProductSkuOption, cv as RequestOptions, aQ as SetProfileValueRequest, cs as SubscriptionCancellationMode, bS as V2ApiKey, c1 as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bP as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, c3 as V2CreditBalance, c2 as V2CreditTransaction, aT as V2Deleted, c8 as V2EmailSendParams, ce as V2EmailSendResult, c9 as V2EmailTemplate, cd as V2EmailTemplateCloneParams, cc as V2EmailTemplateCreateParams, cb as V2EmailTemplateListParams, c7 as V2EmailTemplateStatus, c6 as V2EmailTemplateType, ca as V2EmailTemplateType_Listing, aU as V2Error, aV as V2ErrorType, c4 as V2GrantCreditParams, c5 as V2GrantCreditResult, aS as V2List, aX as V2Media, bN as V2NewsletterBulkParams, bO as V2NewsletterBulkResult, bw as V2NewsletterCampaign, bH as V2NewsletterCampaignCreateParams, bv as V2NewsletterCampaignStatus, bI as V2NewsletterCampaignUpdateParams, bF as V2NewsletterImportRequest, bG as V2NewsletterImportResult, bu as V2NewsletterList, bA as V2NewsletterListCreateParams, bB as V2NewsletterListUpdateParams, bx as V2NewsletterSeries, bJ as V2NewsletterSeriesCreateParams, bK as V2NewsletterSeriesUpdateParams, by as V2NewsletterStatistics, bL as V2NewsletterStatisticsParams, bt as V2NewsletterSubscription, bE as V2NewsletterSubscriptionListMembershipUpdate, bM as V2NewsletterSubscriptionStatusUpdate, bC as V2NewsletterSyncInput, bD as V2NewsletterSyncResult, bz as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bQ as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bR as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bX as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bZ as V2SubscriptionCancelParams, b_ as V2SubscriptionChangePlanParams, b$ as V2SubscriptionChargeParams, c0 as V2SubscriptionChargeResult, bY as V2SubscriptionPauseParams, bU as V2Webhook, bV as V2WebhookCreateParams, bT as V2WebhookEventType, bW as V2WebhookUpdateParams, cl as WebhookEventType, aB as createApiError, az as createPerspectApiV2Client } from './index-CmcHYKO8.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* v1 deprecation constants — kept in sync with the backend's
|
package/dist/index.js
CHANGED
|
@@ -182,6 +182,8 @@ var HttpClient = class {
|
|
|
182
182
|
}
|
|
183
183
|
this.dbg(`[HTTP Client] Headers:`, JSON.stringify(safeHeaders, null, 2));
|
|
184
184
|
let lastError;
|
|
185
|
+
const method = (options.method || "GET").toUpperCase();
|
|
186
|
+
const isIdempotent = method === "GET" || method === "HEAD";
|
|
185
187
|
for (let attempt = 0; attempt <= this.retries; attempt++) {
|
|
186
188
|
try {
|
|
187
189
|
const response = await this.fetchWithTimeout(url, requestOptions);
|
|
@@ -191,6 +193,9 @@ var HttpClient = class {
|
|
|
191
193
|
if (error && typeof error === "object" && "status" in error && typeof error.status === "number" && error.status < 500) {
|
|
192
194
|
throw error;
|
|
193
195
|
}
|
|
196
|
+
if (!isIdempotent) {
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
194
199
|
if (attempt === this.retries) {
|
|
195
200
|
break;
|
|
196
201
|
}
|
|
@@ -1347,6 +1352,97 @@ var NewsletterV2Client = class extends BaseV2Client {
|
|
|
1347
1352
|
data
|
|
1348
1353
|
);
|
|
1349
1354
|
}
|
|
1355
|
+
// --- Lists (get by id) ---
|
|
1356
|
+
async getListById(siteName, id, cachePolicy) {
|
|
1357
|
+
return this.getOne(
|
|
1358
|
+
this.sitePath(siteName, "newsletter", `lists/${encodeURIComponent(id)}`),
|
|
1359
|
+
void 0,
|
|
1360
|
+
cachePolicy
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
// --- Subscriptions (admin: lookup / status / delete / bulk) ---
|
|
1364
|
+
async getSubscriptionByEmail(siteName, email, cachePolicy) {
|
|
1365
|
+
return this.getOne(
|
|
1366
|
+
this.sitePath(siteName, "newsletter", "subscriptions/by-email"),
|
|
1367
|
+
{ email },
|
|
1368
|
+
cachePolicy
|
|
1369
|
+
);
|
|
1370
|
+
}
|
|
1371
|
+
async updateSubscriptionStatus(siteName, id, data) {
|
|
1372
|
+
return this.post(
|
|
1373
|
+
this.sitePath(siteName, "newsletter", `subscriptions/${encodeURIComponent(id)}/status`),
|
|
1374
|
+
data
|
|
1375
|
+
);
|
|
1376
|
+
}
|
|
1377
|
+
async deleteSubscription(siteName, id) {
|
|
1378
|
+
return this.deleteOne(
|
|
1379
|
+
this.sitePath(siteName, "newsletter", `subscriptions/${encodeURIComponent(id)}`)
|
|
1380
|
+
);
|
|
1381
|
+
}
|
|
1382
|
+
async bulkUpdateSubscriptions(siteName, data) {
|
|
1383
|
+
return this.post(
|
|
1384
|
+
this.sitePath(siteName, "newsletter", "subscriptions/bulk"),
|
|
1385
|
+
data
|
|
1386
|
+
);
|
|
1387
|
+
}
|
|
1388
|
+
// --- Statistics ---
|
|
1389
|
+
async getStatistics(siteName, params, cachePolicy) {
|
|
1390
|
+
return this.getOne(
|
|
1391
|
+
this.sitePath(siteName, "newsletter", "statistics"),
|
|
1392
|
+
params,
|
|
1393
|
+
cachePolicy
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
// --- Campaigns (create / update / delete) ---
|
|
1397
|
+
async createCampaign(siteName, data) {
|
|
1398
|
+
return this.post(
|
|
1399
|
+
this.sitePath(siteName, "newsletter", "campaigns"),
|
|
1400
|
+
data
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
async updateCampaign(siteName, id, data) {
|
|
1404
|
+
return this.patchOne(
|
|
1405
|
+
this.sitePath(siteName, "newsletter", `campaigns/${encodeURIComponent(id)}`),
|
|
1406
|
+
data
|
|
1407
|
+
);
|
|
1408
|
+
}
|
|
1409
|
+
async deleteCampaign(siteName, id) {
|
|
1410
|
+
return this.deleteOne(
|
|
1411
|
+
this.sitePath(siteName, "newsletter", `campaigns/${encodeURIComponent(id)}`)
|
|
1412
|
+
);
|
|
1413
|
+
}
|
|
1414
|
+
// --- Series ---
|
|
1415
|
+
async listSeries(siteName, params, cachePolicy) {
|
|
1416
|
+
return this.getList(
|
|
1417
|
+
this.sitePath(siteName, "newsletter", "series"),
|
|
1418
|
+
params,
|
|
1419
|
+
cachePolicy
|
|
1420
|
+
);
|
|
1421
|
+
}
|
|
1422
|
+
async getSeries(siteName, id, cachePolicy) {
|
|
1423
|
+
return this.getOne(
|
|
1424
|
+
this.sitePath(siteName, "newsletter", `series/${encodeURIComponent(id)}`),
|
|
1425
|
+
void 0,
|
|
1426
|
+
cachePolicy
|
|
1427
|
+
);
|
|
1428
|
+
}
|
|
1429
|
+
async createSeries(siteName, data) {
|
|
1430
|
+
return this.post(
|
|
1431
|
+
this.sitePath(siteName, "newsletter", "series"),
|
|
1432
|
+
data
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1435
|
+
async updateSeries(siteName, id, data) {
|
|
1436
|
+
return this.patchOne(
|
|
1437
|
+
this.sitePath(siteName, "newsletter", `series/${encodeURIComponent(id)}`),
|
|
1438
|
+
data
|
|
1439
|
+
);
|
|
1440
|
+
}
|
|
1441
|
+
async deleteSeries(siteName, id) {
|
|
1442
|
+
return this.deleteOne(
|
|
1443
|
+
this.sitePath(siteName, "newsletter", `series/${encodeURIComponent(id)}`)
|
|
1444
|
+
);
|
|
1445
|
+
}
|
|
1350
1446
|
};
|
|
1351
1447
|
|
|
1352
1448
|
// src/v2/client/contacts-client.ts
|
|
@@ -1535,11 +1631,18 @@ var CreditsV2Client = class extends BaseV2Client {
|
|
|
1535
1631
|
// src/v2/client/email-client.ts
|
|
1536
1632
|
var EmailV2Client = class extends BaseV2Client {
|
|
1537
1633
|
/**
|
|
1538
|
-
* Send a transactional email
|
|
1634
|
+
* Send a transactional email through the site's email provider.
|
|
1635
|
+
*
|
|
1636
|
+
* Requires a server-side API key — never call this from a browser. Sites
|
|
1637
|
+
* without a configured provider fall back to the platform default with
|
|
1638
|
+
* policy restrictions (owner-only recipients, daily quota).
|
|
1539
1639
|
*
|
|
1540
|
-
*
|
|
1541
|
-
*
|
|
1542
|
-
*
|
|
1640
|
+
* Provide content one of two ways (mutually exclusive):
|
|
1641
|
+
* - Raw: `subject` plus at least one of `html` / `text`.
|
|
1642
|
+
* - Template: `template_type` (published template for that type) or
|
|
1643
|
+
* `template_id` (published template by ID) plus optional `variables`; the
|
|
1644
|
+
* template is rendered server-side. `subject` is optional here and
|
|
1645
|
+
* overrides the rendered one.
|
|
1543
1646
|
*/
|
|
1544
1647
|
async send(siteName, params) {
|
|
1545
1648
|
return this.post(
|
|
@@ -1549,6 +1652,66 @@ var EmailV2Client = class extends BaseV2Client {
|
|
|
1549
1652
|
}
|
|
1550
1653
|
};
|
|
1551
1654
|
|
|
1655
|
+
// src/v2/client/email-templates-client.ts
|
|
1656
|
+
var EmailTemplatesV2Client = class extends BaseV2Client {
|
|
1657
|
+
path(siteName, suffix = "") {
|
|
1658
|
+
return this.sitePath(siteName, "email", suffix ? `templates/${suffix}` : "templates");
|
|
1659
|
+
}
|
|
1660
|
+
/** List every supported template type with its allowed variables. */
|
|
1661
|
+
async listTypes(siteName, cachePolicy) {
|
|
1662
|
+
return this.getList(
|
|
1663
|
+
this.path(siteName, "types"),
|
|
1664
|
+
void 0,
|
|
1665
|
+
cachePolicy
|
|
1666
|
+
);
|
|
1667
|
+
}
|
|
1668
|
+
/** Get the allowed variables for a single template type. */
|
|
1669
|
+
async getTypeVariables(siteName, templateType, cachePolicy) {
|
|
1670
|
+
return this.getOne(
|
|
1671
|
+
this.path(siteName, `types/${templateType}`),
|
|
1672
|
+
void 0,
|
|
1673
|
+
cachePolicy
|
|
1674
|
+
);
|
|
1675
|
+
}
|
|
1676
|
+
/** List template versions, optionally filtered by type and/or status. */
|
|
1677
|
+
async list(siteName, params, cachePolicy) {
|
|
1678
|
+
return this.getList(this.path(siteName), params, cachePolicy);
|
|
1679
|
+
}
|
|
1680
|
+
/** Get a specific template version by ID (`etpl_…`). */
|
|
1681
|
+
async get(siteName, templateId, cachePolicy) {
|
|
1682
|
+
return this.getOne(
|
|
1683
|
+
this.path(siteName, encodeURIComponent(templateId)),
|
|
1684
|
+
void 0,
|
|
1685
|
+
cachePolicy
|
|
1686
|
+
);
|
|
1687
|
+
}
|
|
1688
|
+
/** Get the currently published version for a template type. */
|
|
1689
|
+
async getPublished(siteName, templateType, cachePolicy) {
|
|
1690
|
+
return this.getOne(
|
|
1691
|
+
this.path(siteName, `published/${templateType}`),
|
|
1692
|
+
void 0,
|
|
1693
|
+
cachePolicy
|
|
1694
|
+
);
|
|
1695
|
+
}
|
|
1696
|
+
/** Create a new template version. */
|
|
1697
|
+
async create(siteName, params) {
|
|
1698
|
+
return this.post(this.path(siteName), params);
|
|
1699
|
+
}
|
|
1700
|
+
/** Clone a template version, optionally overriding fields. */
|
|
1701
|
+
async clone(siteName, templateId, params) {
|
|
1702
|
+
return this.post(
|
|
1703
|
+
this.path(siteName, `${encodeURIComponent(templateId)}/clone`),
|
|
1704
|
+
params ?? {}
|
|
1705
|
+
);
|
|
1706
|
+
}
|
|
1707
|
+
/** Publish a template version (archives the previously published one). */
|
|
1708
|
+
async publish(siteName, templateId) {
|
|
1709
|
+
return this.post(
|
|
1710
|
+
this.path(siteName, `${encodeURIComponent(templateId)}/publish`)
|
|
1711
|
+
);
|
|
1712
|
+
}
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1552
1715
|
// src/v2/index.ts
|
|
1553
1716
|
var PerspectApiV2Client = class {
|
|
1554
1717
|
http;
|
|
@@ -1568,6 +1731,7 @@ var PerspectApiV2Client = class {
|
|
|
1568
1731
|
subscriptions;
|
|
1569
1732
|
credits;
|
|
1570
1733
|
email;
|
|
1734
|
+
emailTemplates;
|
|
1571
1735
|
constructor(config) {
|
|
1572
1736
|
const baseUrl = config.baseUrl.replace(/\/+$/, "");
|
|
1573
1737
|
const v2BaseUrl = baseUrl.endsWith("/api/v2") ? baseUrl : `${baseUrl}/api/v2`;
|
|
@@ -1590,6 +1754,7 @@ var PerspectApiV2Client = class {
|
|
|
1590
1754
|
this.subscriptions = new SubscriptionsV2Client(this.http, basePath, cache);
|
|
1591
1755
|
this.credits = new CreditsV2Client(this.http, basePath, cache);
|
|
1592
1756
|
this.email = new EmailV2Client(this.http, basePath, cache);
|
|
1757
|
+
this.emailTemplates = new EmailTemplatesV2Client(this.http, basePath, cache);
|
|
1593
1758
|
}
|
|
1594
1759
|
/** Update the JWT token for authenticated requests. */
|
|
1595
1760
|
setAuth(jwt) {
|