@prezly/sdk 23.7.4 → 23.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/constants.cjs +1 -1
- package/dist/api/constants.js +1 -1
- package/dist/endpoints/CoverageIntegrations/Client.cjs +15 -1
- package/dist/endpoints/CoverageIntegrations/Client.d.ts +6 -1
- package/dist/endpoints/CoverageIntegrations/Client.js +15 -1
- package/dist/endpoints/CoverageIntegrations/types.d.ts +10 -0
- package/dist/routing.cjs +1 -1
- package/dist/routing.js +1 -1
- package/package.json +1 -1
package/dist/api/constants.cjs
CHANGED
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_USER_AGENT = void 0;
|
|
7
|
-
const VERSION = "23.7.
|
|
7
|
+
const VERSION = "23.7.4";
|
|
8
8
|
const URL = 'https://github.com/prezly/javascript-sdk';
|
|
9
9
|
const DEFAULT_USER_AGENT = exports.DEFAULT_USER_AGENT = `prezly-javascript-sdk/${VERSION} (+${URL})`;
|
package/dist/api/constants.js
CHANGED
|
@@ -69,6 +69,19 @@ function createClient(api) {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
+
async function preview(provider, options) {
|
|
73
|
+
const {
|
|
74
|
+
input,
|
|
75
|
+
oldest
|
|
76
|
+
} = options;
|
|
77
|
+
return api.post(`${_routing.routing.coverageIntegrationsUrl}/preview`, {
|
|
78
|
+
payload: {
|
|
79
|
+
provider,
|
|
80
|
+
input,
|
|
81
|
+
oldest
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
72
85
|
return {
|
|
73
86
|
list,
|
|
74
87
|
get,
|
|
@@ -77,6 +90,7 @@ function createClient(api) {
|
|
|
77
90
|
activate,
|
|
78
91
|
trigger,
|
|
79
92
|
delete: doDelete,
|
|
80
|
-
listRuns
|
|
93
|
+
listRuns,
|
|
94
|
+
preview
|
|
81
95
|
};
|
|
82
96
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DeferredJobsApiClient } from '../../api';
|
|
2
|
+
import type { CoverageEntry } from '../../types';
|
|
2
3
|
import { type CoverageIntegration } from '../../types';
|
|
3
|
-
import type { CreateRequest, ListRunsOptions, ListRunsResponse, UpdateRequest } from './types';
|
|
4
|
+
import type { CreateRequest, ListRunsOptions, ListRunsResponse, PreviewResponse, UpdateRequest } from './types';
|
|
4
5
|
type IntegrationId = CoverageIntegration['id'];
|
|
5
6
|
export type Client = ReturnType<typeof createClient>;
|
|
6
7
|
export declare function createClient(api: DeferredJobsApiClient): {
|
|
@@ -12,5 +13,9 @@ export declare function createClient(api: DeferredJobsApiClient): {
|
|
|
12
13
|
trigger: (integrationId: IntegrationId) => Promise<void>;
|
|
13
14
|
delete: (integrationId: IntegrationId) => Promise<void>;
|
|
14
15
|
listRuns: (integrationId: IntegrationId, options?: ListRunsOptions) => Promise<ListRunsResponse>;
|
|
16
|
+
preview: (provider: CoverageEntry.Provider, options: {
|
|
17
|
+
input: CoverageIntegration["input"];
|
|
18
|
+
oldest?: boolean;
|
|
19
|
+
}) => Promise<PreviewResponse>;
|
|
15
20
|
};
|
|
16
21
|
export {};
|
|
@@ -63,6 +63,19 @@ export function createClient(api) {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
async function preview(provider, options) {
|
|
67
|
+
const {
|
|
68
|
+
input,
|
|
69
|
+
oldest
|
|
70
|
+
} = options;
|
|
71
|
+
return api.post(`${routing.coverageIntegrationsUrl}/preview`, {
|
|
72
|
+
payload: {
|
|
73
|
+
provider,
|
|
74
|
+
input,
|
|
75
|
+
oldest
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
66
79
|
return {
|
|
67
80
|
list,
|
|
68
81
|
get,
|
|
@@ -71,6 +84,7 @@ export function createClient(api) {
|
|
|
71
84
|
activate,
|
|
72
85
|
trigger,
|
|
73
86
|
delete: doDelete,
|
|
74
|
-
listRuns
|
|
87
|
+
listRuns,
|
|
88
|
+
preview
|
|
75
89
|
};
|
|
76
90
|
}
|
|
@@ -27,3 +27,13 @@ export interface ListRunsResponse {
|
|
|
27
27
|
pagination: Pagination;
|
|
28
28
|
sort: string;
|
|
29
29
|
}
|
|
30
|
+
export interface PreviewEntry {
|
|
31
|
+
image: string | null;
|
|
32
|
+
link: string | null;
|
|
33
|
+
title: string;
|
|
34
|
+
username: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface PreviewResponse {
|
|
37
|
+
total: number;
|
|
38
|
+
entries: PreviewEntry[];
|
|
39
|
+
}
|
package/dist/routing.cjs
CHANGED
|
@@ -14,7 +14,7 @@ const routing = exports.routing = {
|
|
|
14
14
|
contactTagGroupsUrl: '/v2/contact-tag-groups',
|
|
15
15
|
contactTagsUrl: '/v2/contact-tags',
|
|
16
16
|
coverageUrl: '/v2/coverage',
|
|
17
|
-
coverageIntegrationsUrl: '/v2/coverage
|
|
17
|
+
coverageIntegrationsUrl: '/v2/coverage/integrations',
|
|
18
18
|
jobsUrl: '/v2/jobs',
|
|
19
19
|
licenseUrl: '/v2/licenses',
|
|
20
20
|
licenseUnsubscribeUrl: '/v2/unsubscribe',
|
package/dist/routing.js
CHANGED
|
@@ -8,7 +8,7 @@ export const routing = {
|
|
|
8
8
|
contactTagGroupsUrl: '/v2/contact-tag-groups',
|
|
9
9
|
contactTagsUrl: '/v2/contact-tags',
|
|
10
10
|
coverageUrl: '/v2/coverage',
|
|
11
|
-
coverageIntegrationsUrl: '/v2/coverage
|
|
11
|
+
coverageIntegrationsUrl: '/v2/coverage/integrations',
|
|
12
12
|
jobsUrl: '/v2/jobs',
|
|
13
13
|
licenseUrl: '/v2/licenses',
|
|
14
14
|
licenseUnsubscribeUrl: '/v2/unsubscribe',
|