@prezly/sdk 25.2.0 → 25.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/dist/api/ApiClient.d.ts +4 -4
- package/dist/api/DeferredJobsApiClient.d.ts +4 -4
- package/dist/api/constants.cjs +1 -1
- package/dist/api/constants.js +1 -1
- package/dist/endpoints/Accounts/Client.d.ts +1 -1
- package/dist/endpoints/Billing/types.cjs +6 -6
- package/dist/endpoints/Billing/types.js +6 -6
- package/dist/endpoints/CampaignRecipients/Client.d.ts +1 -1
- package/dist/endpoints/Campaigns/Client.cjs +14 -1
- package/dist/endpoints/Campaigns/Client.d.ts +12 -9
- package/dist/endpoints/Campaigns/Client.js +14 -1
- package/dist/endpoints/ContactTagGroups/types.cjs +3 -3
- package/dist/endpoints/ContactTagGroups/types.js +3 -3
- package/dist/endpoints/ContactTags/Client.d.ts +4 -4
- package/dist/endpoints/Contacts/Client.d.ts +6 -6
- package/dist/endpoints/ContactsExports/Client.d.ts +2 -2
- package/dist/endpoints/CoverageIntegrations/Client.d.ts +3 -3
- package/dist/endpoints/NewsroomCategories/Client.d.ts +3 -3
- package/dist/endpoints/NewsroomGalleries/Client.d.ts +1 -1
- package/dist/endpoints/NewsroomLanguages/Client.d.ts +10 -10
- package/dist/endpoints/NewsroomPrivacyRequests/Client.d.ts +2 -2
- package/dist/endpoints/NewsroomThemes/Client.d.ts +1 -1
- package/dist/endpoints/NewsroomWebhooks/Client.d.ts +3 -3
- package/dist/endpoints/PricingTables/types.cjs +12 -12
- package/dist/endpoints/PricingTables/types.js +12 -12
- package/dist/endpoints/SenderAddresses/Client.d.ts +3 -3
- package/dist/endpoints/Stories/Client.cjs +4 -2
- package/dist/endpoints/Stories/Client.d.ts +104 -104
- package/dist/endpoints/Stories/Client.js +4 -2
- package/dist/endpoints/Stories/types.d.ts +4 -2
- package/dist/endpoints/Subscriptions/Client.d.ts +2 -2
- package/dist/endpoints/Subscriptions/types.cjs +3 -3
- package/dist/endpoints/Subscriptions/types.js +3 -3
- package/dist/endpoints/Templates/Client.cjs +52 -0
- package/dist/endpoints/Templates/Client.d.ts +13 -0
- package/dist/endpoints/Templates/Client.js +46 -0
- package/dist/endpoints/Templates/index.cjs +27 -0
- package/dist/endpoints/Templates/index.d.ts +2 -0
- package/dist/endpoints/Templates/index.js +2 -0
- package/dist/endpoints/Templates/types.d.ts +8 -0
- package/dist/endpoints/index.cjs +4 -2
- package/dist/endpoints/index.d.ts +1 -0
- package/dist/endpoints/index.js +1 -0
- package/dist/http/lib.cjs +1 -1
- package/dist/http/types.cjs +6 -6
- package/dist/http/types.js +6 -6
- package/dist/routing.cjs +2 -1
- package/dist/routing.d.ts +1 -0
- package/dist/routing.js +2 -1
- package/dist/types/BillingCycle.cjs +3 -3
- package/dist/types/BillingCycle.js +3 -3
- package/dist/types/BulkDeletePayload.cjs +1 -0
- package/dist/types/BulkDeletePayload.d.ts +5 -0
- package/dist/types/BulkDeletePayload.js +1 -0
- package/dist/types/Campaign.cjs +18 -18
- package/dist/types/Campaign.js +18 -18
- package/dist/types/Category.cjs +0 -1
- package/dist/types/Category.js +0 -1
- package/dist/types/Contact.cjs +18 -18
- package/dist/types/Contact.js +18 -18
- package/dist/types/ContactDuplicateSuggestion.cjs +3 -3
- package/dist/types/ContactDuplicateSuggestion.js +3 -4
- package/dist/types/ContactTag.cjs +1 -2
- package/dist/types/ContactTag.js +1 -2
- package/dist/types/ContactsExport.cjs +3 -3
- package/dist/types/ContactsExport.js +3 -3
- package/dist/types/ContactsScope.cjs +3 -3
- package/dist/types/ContactsScope.js +3 -3
- package/dist/types/CoverageEntry.cjs +9 -9
- package/dist/types/CoverageEntry.js +9 -9
- package/dist/types/CoverageIntegration.cjs +3 -3
- package/dist/types/CoverageIntegration.js +3 -3
- package/dist/types/CoverageIntegrationRun.cjs +3 -3
- package/dist/types/CoverageIntegrationRun.js +3 -3
- package/dist/types/Culture.cjs +3 -3
- package/dist/types/Culture.js +3 -3
- package/dist/types/Currency.cjs +3 -3
- package/dist/types/Currency.js +3 -3
- package/dist/types/EmailRecipient.cjs +6 -6
- package/dist/types/EmailRecipient.js +6 -6
- package/dist/types/JobState.cjs +3 -3
- package/dist/types/JobState.js +3 -3
- package/dist/types/License.cjs +12 -12
- package/dist/types/License.js +12 -12
- package/dist/types/Newsroom.cjs +12 -12
- package/dist/types/Newsroom.js +12 -12
- package/dist/types/NewsroomDomain.cjs +6 -6
- package/dist/types/NewsroomDomain.js +6 -6
- package/dist/types/NewsroomGallery.cjs +6 -6
- package/dist/types/NewsroomGallery.js +6 -6
- package/dist/types/NewsroomTheme.cjs +7 -8
- package/dist/types/NewsroomTheme.js +7 -8
- package/dist/types/NewsroomWebhook.cjs +3 -3
- package/dist/types/NewsroomWebhook.js +3 -3
- package/dist/types/NotificationSubscription.cjs +3 -3
- package/dist/types/NotificationSubscription.js +3 -3
- package/dist/types/Permissions.cjs +3 -3
- package/dist/types/Permissions.js +3 -3
- package/dist/types/Plan.cjs +10 -10
- package/dist/types/Plan.js +11 -11
- package/dist/types/Price.cjs +6 -6
- package/dist/types/Price.js +6 -6
- package/dist/types/PrivacyRequest.cjs +6 -6
- package/dist/types/PrivacyRequest.js +6 -6
- package/dist/types/SenderAddress.cjs +3 -3
- package/dist/types/SenderAddress.js +3 -3
- package/dist/types/SenderDomain.cjs +3 -3
- package/dist/types/SenderDomain.js +3 -3
- package/dist/types/SortOrder.cjs +3 -3
- package/dist/types/SortOrder.js +3 -3
- package/dist/types/Story.cjs +12 -12
- package/dist/types/Story.js +12 -12
- package/dist/types/Template.cjs +1 -0
- package/dist/types/Template.d.ts +11 -0
- package/dist/types/Template.js +1 -0
- package/dist/types/User.cjs +6 -6
- package/dist/types/User.js +6 -6
- package/dist/types/common/Notification.cjs +3 -3
- package/dist/types/common/Notification.js +3 -3
- package/dist/types/common/OEmbedInfo.cjs +3 -3
- package/dist/types/common/OEmbedInfo.js +3 -3
- package/dist/types/common/Pagination.cjs +3 -3
- package/dist/types/common/Pagination.js +3 -3
- package/dist/types/common/Query.js +0 -1
- package/dist/types/index.cjs +15 -4
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.js +2 -1
- package/package.json +1 -1
- package/dist/types/StoriesBulkSelector.d.ts +0 -4
- /package/dist/{types/StoriesBulkSelector.cjs → endpoints/Templates/types.cjs} +0 -0
- /package/dist/{types/StoriesBulkSelector.js → endpoints/Templates/types.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProgressPromise } from '@prezly/progress-promise';
|
|
2
2
|
import type { DeferredJobsApiClient } from '../../api';
|
|
3
|
-
import type { ExtendedStory, Query, Story
|
|
3
|
+
import type { BulkDeletePayload, ExtendedStory, Query, Story } from '../../types';
|
|
4
4
|
import type { AutosaveRequest, ChangeNewsroomSuccessResponse, ChangeNewsroomUnsafeResponse, CreateRequest, IncludeOptions, ListOptions, ListResponse, MoveRequest, PreviewResponse, PreviewOptions, PublishRequest, RevertRequest, ScheduleRequest, SearchOptions, TranslateRequest, UnpublishRequest, UnscheduleRequest, UpdateRequest } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* `uuid` is the preferred way of targeting a Story. Numeric `id` is considered deprecated.
|
|
@@ -15,112 +15,112 @@ type Exactly<Concrete, Abstract> = Concrete & Record<Exclude<keyof Concrete, key
|
|
|
15
15
|
type InferExtraFields<T> = T extends Required<IncludeOptions<infer I>> ? Pick<Story.ExtraFields, I> : unknown;
|
|
16
16
|
export type Client = ReturnType<typeof createClient>;
|
|
17
17
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
18
|
-
list: <Options extends ListOptions
|
|
19
|
-
search: <
|
|
18
|
+
list: <Options extends ListOptions>(options?: Exactly<Options, ListOptions>) => Promise<ListResponse<Story & InferExtraFields<Options>>>;
|
|
19
|
+
search: <Options extends SearchOptions>(options?: Exactly<Options, SearchOptions>) => Promise<ListResponse<Story & InferExtraFields<Options>>>;
|
|
20
20
|
get: {
|
|
21
|
-
<
|
|
22
|
-
formats?: Formats
|
|
23
|
-
}>(id: Story[
|
|
24
|
-
formats?: Formats
|
|
25
|
-
}>
|
|
26
|
-
<
|
|
27
|
-
formats?: Formats
|
|
28
|
-
}>(ids: Story[
|
|
29
|
-
formats?: Formats
|
|
30
|
-
}>
|
|
31
|
-
<
|
|
32
|
-
formats?: Formats
|
|
33
|
-
}>(id: Story[
|
|
34
|
-
formats?: Formats
|
|
35
|
-
}>
|
|
36
|
-
<
|
|
37
|
-
formats?: Formats
|
|
38
|
-
}>(ids: Story[
|
|
39
|
-
formats?: Formats
|
|
40
|
-
}>
|
|
21
|
+
<Options extends IncludeOptions & {
|
|
22
|
+
formats?: Formats;
|
|
23
|
+
}>(id: Story["uuid"], options?: Exactly<Options, IncludeOptions & {
|
|
24
|
+
formats?: Formats;
|
|
25
|
+
}>): Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
26
|
+
<Options extends IncludeOptions & {
|
|
27
|
+
formats?: Formats;
|
|
28
|
+
}>(ids: Story["uuid"][], options?: Exactly<Options, IncludeOptions & {
|
|
29
|
+
formats?: Formats;
|
|
30
|
+
}>): Promise<(ExtendedStory & InferExtraFields<Options>)[]>;
|
|
31
|
+
<Options extends IncludeOptions & {
|
|
32
|
+
formats?: Formats;
|
|
33
|
+
}>(id: Story["id"] | Story["uuid"], options?: Exactly<Options, IncludeOptions & {
|
|
34
|
+
formats?: Formats;
|
|
35
|
+
}>): Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
36
|
+
<Options extends IncludeOptions & {
|
|
37
|
+
formats?: Formats;
|
|
38
|
+
}>(ids: Story["id"][], options?: Exactly<Options, IncludeOptions & {
|
|
39
|
+
formats?: Formats;
|
|
40
|
+
}>): Promise<(ExtendedStory & InferExtraFields<Options>)[]>;
|
|
41
41
|
};
|
|
42
|
-
getBySlug: <
|
|
43
|
-
formats?: Formats
|
|
44
|
-
query?: Query
|
|
45
|
-
}>(slug: Story[
|
|
46
|
-
formats?: Formats
|
|
47
|
-
query?: Query
|
|
48
|
-
}>
|
|
49
|
-
create: <
|
|
50
|
-
formats?: Formats
|
|
51
|
-
force?: boolean
|
|
52
|
-
}>(payload: CreateRequest, options?: Exactly<
|
|
53
|
-
formats?: Formats
|
|
54
|
-
force?: boolean
|
|
55
|
-
}>
|
|
56
|
-
duplicate: <
|
|
57
|
-
formats?: Formats
|
|
58
|
-
}>(id: StoryId, options?: Exactly<
|
|
59
|
-
formats?: Formats
|
|
60
|
-
}>
|
|
61
|
-
translate: <
|
|
62
|
-
formats?: Formats
|
|
63
|
-
}>(id: StoryId, payload?: TranslateRequest, options?: Exactly<
|
|
64
|
-
formats?: Formats
|
|
65
|
-
}>
|
|
66
|
-
move: <
|
|
67
|
-
formats?: Formats
|
|
68
|
-
force?: boolean
|
|
69
|
-
}>(id: StoryId, payload: MoveRequest, options?: Exactly<
|
|
70
|
-
formats?: Formats
|
|
71
|
-
force?: boolean
|
|
72
|
-
}>
|
|
73
|
-
update: <
|
|
74
|
-
formats?: Formats
|
|
75
|
-
force?: boolean
|
|
76
|
-
}>(id: StoryId, payload: UpdateRequest, options?: Exactly<
|
|
77
|
-
formats?: Formats
|
|
78
|
-
force?: boolean
|
|
79
|
-
}>
|
|
80
|
-
autosave: <
|
|
81
|
-
formats?: Formats
|
|
82
|
-
}>(id: StoryId, payload: AutosaveRequest, options?: Exactly<
|
|
83
|
-
formats?: Formats
|
|
84
|
-
}>
|
|
85
|
-
revert: <
|
|
86
|
-
formats?: Formats
|
|
87
|
-
}>(id: StoryId, payload?: RevertRequest, options?: Exactly<
|
|
88
|
-
formats?: Formats
|
|
89
|
-
}>
|
|
90
|
-
publish: <
|
|
91
|
-
formats?: Formats
|
|
92
|
-
}>(id: StoryId, payload?: PublishRequest, options?: Exactly<
|
|
93
|
-
formats?: Formats
|
|
94
|
-
}>
|
|
95
|
-
unpublish: <
|
|
96
|
-
formats?: Formats
|
|
97
|
-
}>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<
|
|
98
|
-
formats?: Formats
|
|
99
|
-
}>
|
|
100
|
-
schedule: <
|
|
101
|
-
formats?: Formats
|
|
102
|
-
}>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<
|
|
103
|
-
formats?: Formats
|
|
104
|
-
}>
|
|
105
|
-
unschedule: <
|
|
106
|
-
formats?: Formats
|
|
107
|
-
}>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<
|
|
108
|
-
formats?: Formats
|
|
109
|
-
}>
|
|
110
|
-
pin: <
|
|
111
|
-
formats?: Formats
|
|
112
|
-
force?: boolean
|
|
113
|
-
}>(id: StoryId, options?: Exactly<
|
|
114
|
-
formats?: Formats
|
|
115
|
-
force?: boolean
|
|
116
|
-
}>
|
|
117
|
-
unpin: <
|
|
118
|
-
formats?: Formats
|
|
119
|
-
}>(id: StoryId, options?: Exactly<
|
|
120
|
-
formats?: Formats
|
|
121
|
-
}>
|
|
42
|
+
getBySlug: <Options extends IncludeOptions & {
|
|
43
|
+
formats?: Formats;
|
|
44
|
+
query?: Query;
|
|
45
|
+
}>(slug: Story["slug"], options?: Exactly<Options, IncludeOptions & {
|
|
46
|
+
formats?: Formats;
|
|
47
|
+
query?: Query;
|
|
48
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
49
|
+
create: <Options extends IncludeOptions & {
|
|
50
|
+
formats?: Formats;
|
|
51
|
+
force?: boolean;
|
|
52
|
+
}>(payload: CreateRequest, options?: Exactly<Options, IncludeOptions & {
|
|
53
|
+
formats?: Formats;
|
|
54
|
+
force?: boolean;
|
|
55
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
56
|
+
duplicate: <Options extends IncludeOptions & {
|
|
57
|
+
formats?: Formats;
|
|
58
|
+
}>(id: StoryId, options?: Exactly<Options, IncludeOptions & {
|
|
59
|
+
formats?: Formats;
|
|
60
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
61
|
+
translate: <Options extends IncludeOptions & {
|
|
62
|
+
formats?: Formats;
|
|
63
|
+
}>(id: StoryId, payload?: TranslateRequest, options?: Exactly<Options, IncludeOptions & {
|
|
64
|
+
formats?: Formats;
|
|
65
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
66
|
+
move: <Options extends IncludeOptions & {
|
|
67
|
+
formats?: Formats;
|
|
68
|
+
force?: boolean;
|
|
69
|
+
}>(id: StoryId, payload: MoveRequest, options?: Exactly<Options, IncludeOptions & {
|
|
70
|
+
formats?: Formats;
|
|
71
|
+
force?: boolean;
|
|
72
|
+
}>) => Promise<ChangeNewsroomSuccessResponse<ExtendedStory & InferExtraFields<Options>> | ChangeNewsroomUnsafeResponse>;
|
|
73
|
+
update: <Options extends IncludeOptions & {
|
|
74
|
+
formats?: Formats;
|
|
75
|
+
force?: boolean;
|
|
76
|
+
}>(id: StoryId, payload: UpdateRequest, options?: Exactly<Options, IncludeOptions & {
|
|
77
|
+
formats?: Formats;
|
|
78
|
+
force?: boolean;
|
|
79
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
80
|
+
autosave: <Options extends IncludeOptions & {
|
|
81
|
+
formats?: Formats;
|
|
82
|
+
}>(id: StoryId, payload: AutosaveRequest, options?: Exactly<Options, IncludeOptions & {
|
|
83
|
+
formats?: Formats;
|
|
84
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
85
|
+
revert: <Options extends IncludeOptions & {
|
|
86
|
+
formats?: Formats;
|
|
87
|
+
}>(id: StoryId, payload?: RevertRequest, options?: Exactly<Options, IncludeOptions & {
|
|
88
|
+
formats?: Formats;
|
|
89
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
90
|
+
publish: <Options extends IncludeOptions & {
|
|
91
|
+
formats?: Formats;
|
|
92
|
+
}>(id: StoryId, payload?: PublishRequest, options?: Exactly<Options, IncludeOptions & {
|
|
93
|
+
formats?: Formats;
|
|
94
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
95
|
+
unpublish: <Options extends IncludeOptions & {
|
|
96
|
+
formats?: Formats;
|
|
97
|
+
}>(id: StoryId, payload?: UnpublishRequest, options?: Exactly<Options, IncludeOptions & {
|
|
98
|
+
formats?: Formats;
|
|
99
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
100
|
+
schedule: <Options extends IncludeOptions & {
|
|
101
|
+
formats?: Formats;
|
|
102
|
+
}>(id: StoryId, payload?: ScheduleRequest, options?: Exactly<Options, IncludeOptions & {
|
|
103
|
+
formats?: Formats;
|
|
104
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
105
|
+
unschedule: <Options extends IncludeOptions & {
|
|
106
|
+
formats?: Formats;
|
|
107
|
+
}>(id: StoryId, payload?: UnscheduleRequest, options?: Exactly<Options, IncludeOptions & {
|
|
108
|
+
formats?: Formats;
|
|
109
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
110
|
+
pin: <Options extends IncludeOptions & {
|
|
111
|
+
formats?: Formats;
|
|
112
|
+
force?: boolean;
|
|
113
|
+
}>(id: StoryId, options?: Exactly<Options, IncludeOptions & {
|
|
114
|
+
formats?: Formats;
|
|
115
|
+
force?: boolean;
|
|
116
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
117
|
+
unpin: <Options extends IncludeOptions & {
|
|
118
|
+
formats?: Formats;
|
|
119
|
+
}>(id: StoryId, options?: Exactly<Options, IncludeOptions & {
|
|
120
|
+
formats?: Formats;
|
|
121
|
+
}>) => Promise<ExtendedStory & InferExtraFields<Options>>;
|
|
122
122
|
delete: (id: StoryId) => Promise<void>;
|
|
123
|
-
bulkDelete: (
|
|
123
|
+
bulkDelete: (payload: BulkDeletePayload) => ProgressPromise<{
|
|
124
124
|
records_deleted_number: number;
|
|
125
125
|
}>;
|
|
126
126
|
preview: (id: StoryId, options?: PreviewOptions) => Promise<PreviewResponse>;
|
|
@@ -400,12 +400,14 @@ export function createClient(api) {
|
|
|
400
400
|
const url = `${routing.storiesUrl}/${id}`;
|
|
401
401
|
await api.delete(url);
|
|
402
402
|
}
|
|
403
|
-
|
|
403
|
+
function bulkDelete(payload) {
|
|
404
404
|
const {
|
|
405
|
+
search,
|
|
405
406
|
query
|
|
406
|
-
} =
|
|
407
|
+
} = payload;
|
|
407
408
|
return api.delete(routing.storiesUrl, {
|
|
408
409
|
payload: {
|
|
410
|
+
search,
|
|
409
411
|
query
|
|
410
412
|
}
|
|
411
413
|
});
|
|
@@ -254,6 +254,8 @@ export interface ChangeNewsroomUnsafeResponse {
|
|
|
254
254
|
message: string;
|
|
255
255
|
warnings: ChangeNewsroomWarning[];
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE: Record<keyof Omit<ExtendedStory, keyof Story>, boolean>;
|
|
258
|
+
declare const ALL_EXTRA_FIELDS_SHAPE: Record<keyof Story.ExtraFields, boolean>;
|
|
259
|
+
export declare const ALL_EXTRA_FIELDS: (keyof typeof ALL_EXTRA_FIELDS_SHAPE)[];
|
|
260
|
+
export declare const EXTENDED_STORY_INCLUDED_EXTRA_FIELDS: (keyof typeof EXTENDED_STORY_INCLUDED_EXTRA_FIELDS_SHAPE)[];
|
|
259
261
|
export {};
|
|
@@ -7,7 +7,7 @@ export declare function createClient(api: DeferredJobsApiClient): {
|
|
|
7
7
|
subscribeToNewsroom: <Type extends Contact.Type>(newsroomId: NewsroomId, payload: SubscribeRequest<Type>) => Promise<EmailSubscription>;
|
|
8
8
|
unsubscribeFromNewsroom: (newsroomId: NewsroomId, payload: UnsubscribeRequest) => Promise<EmailSubscription>;
|
|
9
9
|
unsubscribeFromLicense: (payload: UnsubscribeRequest) => Promise<EmailSubscription>;
|
|
10
|
-
updateNewsroomUnsubscribeDetails: (newsroomId: NewsroomId, subscriptionId: EmailSubscription[
|
|
11
|
-
updateLicenseUnsubscribeDetails: (subscriptionId: EmailSubscription[
|
|
10
|
+
updateNewsroomUnsubscribeDetails: (newsroomId: NewsroomId, subscriptionId: EmailSubscription["id"], payload: UpdateUnsubscribeDetailsRequest) => Promise<EmailSubscription>;
|
|
11
|
+
updateLicenseUnsubscribeDetails: (subscriptionId: EmailSubscription["id"], payload: UpdateUnsubscribeDetailsRequest) => Promise<EmailSubscription>;
|
|
12
12
|
};
|
|
13
13
|
export {};
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UnsubscribeReason = void 0;
|
|
7
|
-
let UnsubscribeReason = exports.UnsubscribeReason =
|
|
8
|
-
(function (UnsubscribeReason) {
|
|
7
|
+
let UnsubscribeReason = exports.UnsubscribeReason = /*#__PURE__*/function (UnsubscribeReason) {
|
|
9
8
|
UnsubscribeReason["UNKNOWN"] = "unknown";
|
|
10
9
|
UnsubscribeReason["UNWANTED"] = "unwanted";
|
|
11
10
|
UnsubscribeReason["SPAM"] = "spam";
|
|
12
11
|
UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
|
|
13
12
|
UnsubscribeReason["OTHER"] = "other";
|
|
14
|
-
|
|
13
|
+
return UnsubscribeReason;
|
|
14
|
+
}({});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export let UnsubscribeReason
|
|
2
|
-
(function (UnsubscribeReason) {
|
|
1
|
+
export let UnsubscribeReason = /*#__PURE__*/function (UnsubscribeReason) {
|
|
3
2
|
UnsubscribeReason["UNKNOWN"] = "unknown";
|
|
4
3
|
UnsubscribeReason["UNWANTED"] = "unwanted";
|
|
5
4
|
UnsubscribeReason["SPAM"] = "spam";
|
|
6
5
|
UnsubscribeReason["NEVER_SIGNED_UP"] = "never_signed_up";
|
|
7
6
|
UnsubscribeReason["OTHER"] = "other";
|
|
8
|
-
|
|
7
|
+
return UnsubscribeReason;
|
|
8
|
+
}({});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createClient = createClient;
|
|
7
|
+
var _routing = require("../../routing.cjs");
|
|
8
|
+
function createClient(api) {
|
|
9
|
+
async function list() {
|
|
10
|
+
const url = _routing.routing.templatesUrl;
|
|
11
|
+
const {
|
|
12
|
+
templates
|
|
13
|
+
} = await api.get(url);
|
|
14
|
+
return templates;
|
|
15
|
+
}
|
|
16
|
+
async function get(templateId) {
|
|
17
|
+
const url = _routing.routing.templatesUrl;
|
|
18
|
+
const {
|
|
19
|
+
template
|
|
20
|
+
} = await api.get(`${url}/${templateId}`);
|
|
21
|
+
return template;
|
|
22
|
+
}
|
|
23
|
+
async function create(payload) {
|
|
24
|
+
const url = _routing.routing.templatesUrl;
|
|
25
|
+
const {
|
|
26
|
+
template
|
|
27
|
+
} = await api.post(url, {
|
|
28
|
+
payload
|
|
29
|
+
});
|
|
30
|
+
return template;
|
|
31
|
+
}
|
|
32
|
+
async function update(templateId, payload) {
|
|
33
|
+
const url = _routing.routing.templatesUrl;
|
|
34
|
+
const {
|
|
35
|
+
template
|
|
36
|
+
} = await api.patch(`${url}/${templateId}`, {
|
|
37
|
+
payload
|
|
38
|
+
});
|
|
39
|
+
return template;
|
|
40
|
+
}
|
|
41
|
+
async function doDelete(templateId) {
|
|
42
|
+
const url = _routing.routing.templatesUrl;
|
|
43
|
+
return api.delete(`${url}/${templateId}`);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
list,
|
|
47
|
+
get,
|
|
48
|
+
create,
|
|
49
|
+
update,
|
|
50
|
+
delete: doDelete
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { Template } from '../../types';
|
|
3
|
+
import type { CreateRequest, UpdateRequest } from './types';
|
|
4
|
+
type TemplateId = Template['id'];
|
|
5
|
+
export type Client = ReturnType<typeof createClient>;
|
|
6
|
+
export declare function createClient(api: DeferredJobsApiClient): {
|
|
7
|
+
list: () => Promise<Template[]>;
|
|
8
|
+
get: (templateId: TemplateId) => Promise<Template>;
|
|
9
|
+
create: (payload: CreateRequest) => Promise<Template>;
|
|
10
|
+
update: (templateId: TemplateId, payload: UpdateRequest) => Promise<Template>;
|
|
11
|
+
delete: (templateId: TemplateId) => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { routing } from "../../routing.js";
|
|
2
|
+
export function createClient(api) {
|
|
3
|
+
async function list() {
|
|
4
|
+
const url = routing.templatesUrl;
|
|
5
|
+
const {
|
|
6
|
+
templates
|
|
7
|
+
} = await api.get(url);
|
|
8
|
+
return templates;
|
|
9
|
+
}
|
|
10
|
+
async function get(templateId) {
|
|
11
|
+
const url = routing.templatesUrl;
|
|
12
|
+
const {
|
|
13
|
+
template
|
|
14
|
+
} = await api.get(`${url}/${templateId}`);
|
|
15
|
+
return template;
|
|
16
|
+
}
|
|
17
|
+
async function create(payload) {
|
|
18
|
+
const url = routing.templatesUrl;
|
|
19
|
+
const {
|
|
20
|
+
template
|
|
21
|
+
} = await api.post(url, {
|
|
22
|
+
payload
|
|
23
|
+
});
|
|
24
|
+
return template;
|
|
25
|
+
}
|
|
26
|
+
async function update(templateId, payload) {
|
|
27
|
+
const url = routing.templatesUrl;
|
|
28
|
+
const {
|
|
29
|
+
template
|
|
30
|
+
} = await api.patch(`${url}/${templateId}`, {
|
|
31
|
+
payload
|
|
32
|
+
});
|
|
33
|
+
return template;
|
|
34
|
+
}
|
|
35
|
+
async function doDelete(templateId) {
|
|
36
|
+
const url = routing.templatesUrl;
|
|
37
|
+
return api.delete(`${url}/${templateId}`);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
list,
|
|
41
|
+
get,
|
|
42
|
+
create,
|
|
43
|
+
update,
|
|
44
|
+
delete: doDelete
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Client = require("./Client.cjs");
|
|
7
|
+
Object.keys(_Client).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Client[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Client[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _types = require("./types.cjs");
|
|
18
|
+
Object.keys(_types).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _types[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
package/dist/endpoints/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.Subscriptions = exports.Stories = exports.Snippets = exports.SenderAddresses = exports.PricingTables = exports.NotificationSubscriptions = exports.Newsrooms = exports.NewsroomWebhooks = exports.NewsroomThemes = exports.NewsroomSubscriptions = exports.NewsroomPrivacyRequests = exports.NewsroomLanguages = exports.NewsroomHub = exports.NewsroomGalleries = exports.NewsroomDomains = exports.NewsroomContacts = exports.NewsroomCategories = exports.Licenses = exports.Jobs = exports.CoverageIntegrations = exports.Coverage = exports.ContactsExports = exports.Contacts = exports.ContactTags = exports.ContactTagGroups = exports.Campaigns = exports.CampaignRecipients = exports.Billing = exports.Accounts = void 0;
|
|
6
|
+
exports.Templates = exports.Subscriptions = exports.Stories = exports.Snippets = exports.SenderAddresses = exports.PricingTables = exports.NotificationSubscriptions = exports.Newsrooms = exports.NewsroomWebhooks = exports.NewsroomThemes = exports.NewsroomSubscriptions = exports.NewsroomPrivacyRequests = exports.NewsroomLanguages = exports.NewsroomHub = exports.NewsroomGalleries = exports.NewsroomDomains = exports.NewsroomContacts = exports.NewsroomCategories = exports.Licenses = exports.Jobs = exports.CoverageIntegrations = exports.Coverage = exports.ContactsExports = exports.Contacts = exports.ContactTags = exports.ContactTagGroups = exports.Campaigns = exports.CampaignRecipients = exports.Billing = exports.Accounts = void 0;
|
|
7
7
|
var _Accounts = _interopRequireWildcard(require("./Accounts/index.cjs"));
|
|
8
8
|
exports.Accounts = _Accounts;
|
|
9
9
|
var _Billing = _interopRequireWildcard(require("./Billing/index.cjs"));
|
|
@@ -60,7 +60,9 @@ var _Stories = _interopRequireWildcard(require("./Stories/index.cjs"));
|
|
|
60
60
|
exports.Stories = _Stories;
|
|
61
61
|
var _Subscriptions = _interopRequireWildcard(require("./Subscriptions/index.cjs"));
|
|
62
62
|
exports.Subscriptions = _Subscriptions;
|
|
63
|
+
var _Templates = _interopRequireWildcard(require("./Templates/index.cjs"));
|
|
64
|
+
exports.Templates = _Templates;
|
|
63
65
|
var _NotificationSubscriptions = _interopRequireWildcard(require("./NotificationSubscriptions/index.cjs"));
|
|
64
66
|
exports.NotificationSubscriptions = _NotificationSubscriptions;
|
|
65
67
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
66
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
68
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -26,4 +26,5 @@ export * as SenderAddresses from './SenderAddresses';
|
|
|
26
26
|
export * as Snippets from './Snippets';
|
|
27
27
|
export * as Stories from './Stories';
|
|
28
28
|
export * as Subscriptions from './Subscriptions';
|
|
29
|
+
export * as Templates from './Templates';
|
|
29
30
|
export * as NotificationSubscriptions from './NotificationSubscriptions';
|
package/dist/endpoints/index.js
CHANGED
|
@@ -26,4 +26,5 @@ export * as SenderAddresses from "./SenderAddresses/index.js";
|
|
|
26
26
|
export * as Snippets from "./Snippets/index.js";
|
|
27
27
|
export * as Stories from "./Stories/index.js";
|
|
28
28
|
export * as Subscriptions from "./Subscriptions/index.js";
|
|
29
|
+
export * as Templates from "./Templates/index.js";
|
|
29
30
|
export * as NotificationSubscriptions from "./NotificationSubscriptions/index.js";
|
package/dist/http/lib.cjs
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createUrlWithQuery = createUrlWithQuery;
|
|
7
7
|
exports.isDeferredJobResponse = isDeferredJobResponse;
|
|
8
8
|
var _queryString = _interopRequireDefault(require("query-string"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function parseUrlParams(query) {
|
|
11
11
|
return _queryString.default.parse(query, {
|
|
12
12
|
arrayFormat: 'bracket'
|
package/dist/http/types.cjs
CHANGED
|
@@ -4,20 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Method = exports.HttpCodes = void 0;
|
|
7
|
-
let HttpCodes = exports.HttpCodes =
|
|
8
|
-
(function (HttpCodes) {
|
|
7
|
+
let HttpCodes = exports.HttpCodes = /*#__PURE__*/function (HttpCodes) {
|
|
9
8
|
HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
|
|
10
9
|
HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
11
10
|
HttpCodes[HttpCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
12
11
|
HttpCodes[HttpCodes["CONFLICT"] = 409] = "CONFLICT";
|
|
13
12
|
HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
|
|
14
13
|
HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
return HttpCodes;
|
|
15
|
+
}({});
|
|
16
|
+
let Method = exports.Method = /*#__PURE__*/function (Method) {
|
|
18
17
|
Method["DELETE"] = "DELETE";
|
|
19
18
|
Method["GET"] = "GET";
|
|
20
19
|
Method["PATCH"] = "PATCH";
|
|
21
20
|
Method["POST"] = "POST";
|
|
22
21
|
Method["PUT"] = "PUT";
|
|
23
|
-
|
|
22
|
+
return Method;
|
|
23
|
+
}({});
|
package/dist/http/types.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export let HttpCodes
|
|
2
|
-
(function (HttpCodes) {
|
|
1
|
+
export let HttpCodes = /*#__PURE__*/function (HttpCodes) {
|
|
3
2
|
HttpCodes[HttpCodes["ACCEPTED"] = 202] = "ACCEPTED";
|
|
4
3
|
HttpCodes[HttpCodes["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
5
4
|
HttpCodes[HttpCodes["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
6
5
|
HttpCodes[HttpCodes["CONFLICT"] = 409] = "CONFLICT";
|
|
7
6
|
HttpCodes[HttpCodes["GONE"] = 410] = "GONE";
|
|
8
7
|
HttpCodes[HttpCodes["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
return HttpCodes;
|
|
9
|
+
}({});
|
|
10
|
+
export let Method = /*#__PURE__*/function (Method) {
|
|
12
11
|
Method["DELETE"] = "DELETE";
|
|
13
12
|
Method["GET"] = "GET";
|
|
14
13
|
Method["PATCH"] = "PATCH";
|
|
15
14
|
Method["POST"] = "POST";
|
|
16
15
|
Method["PUT"] = "PUT";
|
|
17
|
-
|
|
16
|
+
return Method;
|
|
17
|
+
}({});
|
package/dist/routing.cjs
CHANGED
|
@@ -40,5 +40,6 @@ const routing = exports.routing = {
|
|
|
40
40
|
storiesUrl: '/v2/stories',
|
|
41
41
|
storiesSearchUrl: '/v2/stories/search',
|
|
42
42
|
storyCoverageUrl: '/v1/stories/:story_id/reports/coverage',
|
|
43
|
-
snippetsUrl: '/v2/snippets'
|
|
43
|
+
snippetsUrl: '/v2/snippets',
|
|
44
|
+
templatesUrl: '/v2/templates'
|
|
44
45
|
};
|
package/dist/routing.d.ts
CHANGED
package/dist/routing.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BillingCycle = void 0;
|
|
7
|
-
let BillingCycle = exports.BillingCycle =
|
|
8
|
-
(function (BillingCycle) {
|
|
7
|
+
let BillingCycle = exports.BillingCycle = /*#__PURE__*/function (BillingCycle) {
|
|
9
8
|
BillingCycle["YEAR"] = "year";
|
|
10
9
|
BillingCycle["MONTH"] = "month";
|
|
11
|
-
|
|
10
|
+
return BillingCycle;
|
|
11
|
+
}({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|