@oursprivacy/platform-sdk 1.46.0 → 1.48.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/CHANGELOG.md +14 -0
- package/client.d.mts +20 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +20 -11
- package/client.d.ts.map +1 -1
- package/client.js +11 -2
- package/client.js.map +1 -1
- package/client.mjs +11 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/attribution.d.mts +9 -1
- package/resources/attribution.d.mts.map +1 -1
- package/resources/attribution.d.ts +9 -1
- package/resources/attribution.d.ts.map +1 -1
- package/resources/consent-settings.d.mts +48 -0
- package/resources/consent-settings.d.mts.map +1 -1
- package/resources/consent-settings.d.ts +48 -0
- package/resources/consent-settings.d.ts.map +1 -1
- package/resources/conversion-journey-summaries.d.mts +38 -0
- package/resources/conversion-journey-summaries.d.mts.map +1 -1
- package/resources/conversion-journey-summaries.d.ts +38 -0
- package/resources/conversion-journey-summaries.d.ts.map +1 -1
- package/resources/conversion-journey-summaries.js +38 -0
- package/resources/conversion-journey-summaries.js.map +1 -1
- package/resources/conversion-journey-summaries.mjs +38 -0
- package/resources/conversion-journey-summaries.mjs.map +1 -1
- package/resources/data-governance.d.mts +5 -5
- package/resources/data-governance.d.mts.map +1 -1
- package/resources/data-governance.d.ts +5 -5
- package/resources/data-governance.d.ts.map +1 -1
- package/resources/destinations.d.mts +7 -27
- package/resources/destinations.d.mts.map +1 -1
- package/resources/destinations.d.ts +7 -27
- package/resources/destinations.d.ts.map +1 -1
- package/resources/experiment-variants.d.mts +4 -2
- package/resources/experiment-variants.d.mts.map +1 -1
- package/resources/experiment-variants.d.ts +4 -2
- package/resources/experiment-variants.d.ts.map +1 -1
- package/resources/experiments.d.mts +677 -102
- package/resources/experiments.d.mts.map +1 -1
- package/resources/experiments.d.ts +677 -102
- package/resources/experiments.d.ts.map +1 -1
- package/resources/experiments.js +32 -2
- package/resources/experiments.js.map +1 -1
- package/resources/experiments.mjs +32 -2
- package/resources/experiments.mjs.map +1 -1
- package/resources/funnels.d.mts +172 -22
- package/resources/funnels.d.mts.map +1 -1
- package/resources/funnels.d.ts +172 -22
- package/resources/funnels.d.ts.map +1 -1
- package/resources/funnels.js +10 -2
- package/resources/funnels.js.map +1 -1
- package/resources/funnels.mjs +10 -2
- package/resources/funnels.mjs.map +1 -1
- package/resources/heatmap-pages.d.mts +42 -14
- package/resources/heatmap-pages.d.mts.map +1 -1
- package/resources/heatmap-pages.d.ts +42 -14
- package/resources/heatmap-pages.d.ts.map +1 -1
- package/resources/heatmap-pages.js +11 -7
- package/resources/heatmap-pages.js.map +1 -1
- package/resources/heatmap-pages.mjs +11 -7
- package/resources/heatmap-pages.mjs.map +1 -1
- package/resources/index.d.mts +8 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/mappings.d.mts +2 -2
- package/resources/mappings.d.mts.map +1 -1
- package/resources/mappings.d.ts +2 -2
- package/resources/mappings.d.ts.map +1 -1
- package/resources/session-replays.d.mts +91 -0
- package/resources/session-replays.d.mts.map +1 -0
- package/resources/session-replays.d.ts +91 -0
- package/resources/session-replays.d.ts.map +1 -0
- package/resources/session-replays.js +24 -0
- package/resources/session-replays.js.map +1 -0
- package/resources/session-replays.mjs +20 -0
- package/resources/session-replays.mjs.map +1 -0
- package/resources/short-links.d.mts +138 -37
- package/resources/short-links.d.mts.map +1 -1
- package/resources/short-links.d.ts +138 -37
- package/resources/short-links.d.ts.map +1 -1
- package/resources/short-links.js +27 -12
- package/resources/short-links.js.map +1 -1
- package/resources/short-links.mjs +27 -12
- package/resources/short-links.mjs.map +1 -1
- package/resources/sources.d.mts +10 -6
- package/resources/sources.d.mts.map +1 -1
- package/resources/sources.d.ts +10 -6
- package/resources/sources.d.ts.map +1 -1
- package/resources/tag-manager-tags.d.mts +2 -2
- package/resources/tag-manager-tags.d.ts +2 -2
- package/resources/tag-manager-tags.js +2 -2
- package/resources/tag-manager-tags.mjs +2 -2
- package/resources/tag-manager-triggers.d.mts +18 -1
- package/resources/tag-manager-triggers.d.mts.map +1 -1
- package/resources/tag-manager-triggers.d.ts +18 -1
- package/resources/tag-manager-triggers.d.ts.map +1 -1
- package/resources/translation-widgets.d.mts +355 -0
- package/resources/translation-widgets.d.mts.map +1 -0
- package/resources/translation-widgets.d.ts +355 -0
- package/resources/translation-widgets.d.ts.map +1 -0
- package/resources/translation-widgets.js +72 -0
- package/resources/translation-widgets.js.map +1 -0
- package/resources/translation-widgets.mjs +68 -0
- package/resources/translation-widgets.mjs.map +1 -0
- package/resources/video-channels.d.mts +17 -17
- package/resources/video-channels.d.mts.map +1 -1
- package/resources/video-channels.d.ts +17 -17
- package/resources/video-channels.d.ts.map +1 -1
- package/resources/video-channels.js +17 -16
- package/resources/video-channels.js.map +1 -1
- package/resources/video-channels.mjs +17 -16
- package/resources/video-channels.mjs.map +1 -1
- package/resources/web-analytics.d.mts +345 -0
- package/resources/web-analytics.d.mts.map +1 -0
- package/resources/web-analytics.d.ts +345 -0
- package/resources/web-analytics.d.ts.map +1 -0
- package/resources/web-analytics.js +61 -0
- package/resources/web-analytics.js.map +1 -0
- package/resources/web-analytics.mjs +57 -0
- package/resources/web-analytics.mjs.map +1 -0
- package/resources/web-scanners.d.mts +314 -14
- package/resources/web-scanners.d.mts.map +1 -1
- package/resources/web-scanners.d.ts +314 -14
- package/resources/web-scanners.d.ts.map +1 -1
- package/resources/web-scanners.js +139 -13
- package/resources/web-scanners.js.map +1 -1
- package/resources/web-scanners.mjs +139 -13
- package/resources/web-scanners.mjs.map +1 -1
- package/src/client.ts +124 -19
- package/src/resources/attribution.ts +11 -1
- package/src/resources/consent-settings.ts +56 -0
- package/src/resources/conversion-journey-summaries.ts +38 -0
- package/src/resources/data-governance.ts +5 -5
- package/src/resources/destinations.ts +18 -115
- package/src/resources/experiment-variants.ts +4 -2
- package/src/resources/experiments.ts +812 -101
- package/src/resources/funnels.ts +276 -21
- package/src/resources/heatmap-pages.ts +49 -14
- package/src/resources/index.ts +51 -3
- package/src/resources/mappings.ts +2 -2
- package/src/resources/session-replays.ts +138 -0
- package/src/resources/short-links.ts +164 -36
- package/src/resources/sources.ts +11 -0
- package/src/resources/tag-manager-tags.ts +2 -2
- package/src/resources/tag-manager-triggers.ts +18 -1
- package/src/resources/translation-widgets.ts +528 -0
- package/src/resources/video-channels.ts +19 -18
- package/src/resources/web-analytics.ts +494 -0
- package/src/resources/web-scanners.ts +443 -13
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class TranslationWidgets extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List every translation widget configured on the account, including the domains
|
|
11
|
+
* it runs on, its appearance settings, and the languages it offers. Not paginated
|
|
12
|
+
* — widgets are capped by the account's translation widget limit. Requires scope:
|
|
13
|
+
* translationWidget:list
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const translationWidgets =
|
|
18
|
+
* await client.translationWidgets.list();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(options?: RequestOptions): APIPromise<TranslationWidgetListResponse> {
|
|
22
|
+
return this._client.get('/rest/v1/translation-widgets', options);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create a translation widget. Every field is optional — anything omitted comes
|
|
27
|
+
* back as `null` and the widget falls back to its built-in appearance, and
|
|
28
|
+
* omitting `enabledLanguages` offers every supported language. Returns the full
|
|
29
|
+
* widget, including its id, so it can be installed without a follow-up request.
|
|
30
|
+
* Requires scope: translationWidget:create
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const translationWidget =
|
|
35
|
+
* await client.translationWidgets.create();
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
create(
|
|
39
|
+
body: TranslationWidgetCreateParams,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<TranslationWidgetCreateResponse> {
|
|
42
|
+
return this._client.post('/rest/v1/translation-widgets', { body, ...options });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Fetch one translation widget by its id. Returns 404 when it does not exist.
|
|
47
|
+
* Requires scope: translationWidget:find
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const translationWidget =
|
|
52
|
+
* await client.translationWidgets.retrieve(
|
|
53
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<TranslationWidgetRetrieveResponse> {
|
|
58
|
+
return this._client.get(path`/rest/v1/translation-widgets/${id}`, options);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Return usage totals and language, host, and page breakdowns for one translation
|
|
63
|
+
* widget over the requested date range. Requires scope:
|
|
64
|
+
* report:translation-analytics
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const response = await client.translationWidgets.analytics(
|
|
69
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
70
|
+
* { from: '2019-12-27', to: '2019-12-27' },
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
analytics(
|
|
75
|
+
id: string,
|
|
76
|
+
query: TranslationWidgetAnalyticsParams,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): APIPromise<TranslationWidgetAnalyticsResponse> {
|
|
79
|
+
return this._client.get(path`/rest/v1/translation-widgets/${id}/analytics`, { query, ...options });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface TranslationWidgetListResponse {
|
|
84
|
+
/**
|
|
85
|
+
* Every translation widget on the account. Not paginated — widgets are capped by
|
|
86
|
+
* the account's translation widget limit, so the full set always fits in one
|
|
87
|
+
* response.
|
|
88
|
+
*/
|
|
89
|
+
entities: Array<TranslationWidgetListResponse.Entity>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export namespace TranslationWidgetListResponse {
|
|
93
|
+
export interface Entity {
|
|
94
|
+
/**
|
|
95
|
+
* Unique identifier for the translation widget.
|
|
96
|
+
*/
|
|
97
|
+
id: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* ISO-8601 timestamp when the widget was created.
|
|
101
|
+
*/
|
|
102
|
+
createdAt: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Accent colour for the widget button and modal, as a hex value — `#RGB`,
|
|
106
|
+
* `#RRGGBB`, or `#RRGGBBAA`.
|
|
107
|
+
*/
|
|
108
|
+
brandColor?: string | null;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Custom domain used to serve the widget script (e.g. `translate.example.com`).
|
|
112
|
+
* Leave null to use the default Ours Privacy domain. Send the bare host — no
|
|
113
|
+
* scheme, port, or path.
|
|
114
|
+
*/
|
|
115
|
+
customDomain?: string | null;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Languages offered in the widget, as ISO codes such as `en`, `es`, `fr`, `zh-TW`.
|
|
119
|
+
* Omit or send an empty array to offer every supported language. An unrecognised
|
|
120
|
+
* code is rejected with 400 rather than silently ignored.
|
|
121
|
+
*/
|
|
122
|
+
enabledLanguages?: Array<string> | null;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Layout of the language-selection modal: `standard` list, `grid` of languages, or
|
|
126
|
+
* a `dropdown`.
|
|
127
|
+
*/
|
|
128
|
+
modalVariant?: 'standard' | 'grid' | 'dropdown' | null;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Terms the widget keeps in their original form in every language — brand names,
|
|
132
|
+
* product names, and the like. Up to 500 terms of 200 characters each; duplicates
|
|
133
|
+
* and purely numeric terms are dropped.
|
|
134
|
+
*/
|
|
135
|
+
noTranslateTerms?: Array<string> | null;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Corner of the viewport the widget button is anchored to.
|
|
139
|
+
*/
|
|
140
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | null;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Colour scheme the widget renders in.
|
|
144
|
+
*/
|
|
145
|
+
theme?: 'light' | 'dark' | null;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* ISO-8601 timestamp of the most recent change. Matches `createdAt` on a widget
|
|
149
|
+
* that has never been edited.
|
|
150
|
+
*/
|
|
151
|
+
updatedAt?: string | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Domains where this widget is allowed to run. The widget refuses to load anywhere
|
|
155
|
+
* else, so a missing host means the widget never appears. Send bare hosts — no
|
|
156
|
+
* scheme, port, or path.
|
|
157
|
+
*/
|
|
158
|
+
whitelistedDomains?: Array<string> | null;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Visual style of the widget button: `compact` for an icon-sized button,
|
|
162
|
+
* `extended` for a labelled button, `minimal` for the least intrusive treatment.
|
|
163
|
+
*/
|
|
164
|
+
widgetVariant?: 'compact' | 'extended' | 'minimal' | null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface TranslationWidgetCreateResponse {
|
|
169
|
+
/**
|
|
170
|
+
* Unique identifier for the translation widget.
|
|
171
|
+
*/
|
|
172
|
+
id: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* ISO-8601 timestamp when the widget was created.
|
|
176
|
+
*/
|
|
177
|
+
createdAt: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Accent colour for the widget button and modal, as a hex value — `#RGB`,
|
|
181
|
+
* `#RRGGBB`, or `#RRGGBBAA`.
|
|
182
|
+
*/
|
|
183
|
+
brandColor?: string | null;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Custom domain used to serve the widget script (e.g. `translate.example.com`).
|
|
187
|
+
* Leave null to use the default Ours Privacy domain. Send the bare host — no
|
|
188
|
+
* scheme, port, or path.
|
|
189
|
+
*/
|
|
190
|
+
customDomain?: string | null;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Languages offered in the widget, as ISO codes such as `en`, `es`, `fr`, `zh-TW`.
|
|
194
|
+
* Omit or send an empty array to offer every supported language. An unrecognised
|
|
195
|
+
* code is rejected with 400 rather than silently ignored.
|
|
196
|
+
*/
|
|
197
|
+
enabledLanguages?: Array<string> | null;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Layout of the language-selection modal: `standard` list, `grid` of languages, or
|
|
201
|
+
* a `dropdown`.
|
|
202
|
+
*/
|
|
203
|
+
modalVariant?: 'standard' | 'grid' | 'dropdown' | null;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Terms the widget keeps in their original form in every language — brand names,
|
|
207
|
+
* product names, and the like. Up to 500 terms of 200 characters each; duplicates
|
|
208
|
+
* and purely numeric terms are dropped.
|
|
209
|
+
*/
|
|
210
|
+
noTranslateTerms?: Array<string> | null;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Corner of the viewport the widget button is anchored to.
|
|
214
|
+
*/
|
|
215
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | null;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Colour scheme the widget renders in.
|
|
219
|
+
*/
|
|
220
|
+
theme?: 'light' | 'dark' | null;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* ISO-8601 timestamp of the most recent change. Matches `createdAt` on a widget
|
|
224
|
+
* that has never been edited.
|
|
225
|
+
*/
|
|
226
|
+
updatedAt?: string | null;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Domains where this widget is allowed to run. The widget refuses to load anywhere
|
|
230
|
+
* else, so a missing host means the widget never appears. Send bare hosts — no
|
|
231
|
+
* scheme, port, or path.
|
|
232
|
+
*/
|
|
233
|
+
whitelistedDomains?: Array<string> | null;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Visual style of the widget button: `compact` for an icon-sized button,
|
|
237
|
+
* `extended` for a labelled button, `minimal` for the least intrusive treatment.
|
|
238
|
+
*/
|
|
239
|
+
widgetVariant?: 'compact' | 'extended' | 'minimal' | null;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface TranslationWidgetRetrieveResponse {
|
|
243
|
+
/**
|
|
244
|
+
* Unique identifier for the translation widget.
|
|
245
|
+
*/
|
|
246
|
+
id: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* ISO-8601 timestamp when the widget was created.
|
|
250
|
+
*/
|
|
251
|
+
createdAt: string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Accent colour for the widget button and modal, as a hex value — `#RGB`,
|
|
255
|
+
* `#RRGGBB`, or `#RRGGBBAA`.
|
|
256
|
+
*/
|
|
257
|
+
brandColor?: string | null;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Custom domain used to serve the widget script (e.g. `translate.example.com`).
|
|
261
|
+
* Leave null to use the default Ours Privacy domain. Send the bare host — no
|
|
262
|
+
* scheme, port, or path.
|
|
263
|
+
*/
|
|
264
|
+
customDomain?: string | null;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Languages offered in the widget, as ISO codes such as `en`, `es`, `fr`, `zh-TW`.
|
|
268
|
+
* Omit or send an empty array to offer every supported language. An unrecognised
|
|
269
|
+
* code is rejected with 400 rather than silently ignored.
|
|
270
|
+
*/
|
|
271
|
+
enabledLanguages?: Array<string> | null;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Layout of the language-selection modal: `standard` list, `grid` of languages, or
|
|
275
|
+
* a `dropdown`.
|
|
276
|
+
*/
|
|
277
|
+
modalVariant?: 'standard' | 'grid' | 'dropdown' | null;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Terms the widget keeps in their original form in every language — brand names,
|
|
281
|
+
* product names, and the like. Up to 500 terms of 200 characters each; duplicates
|
|
282
|
+
* and purely numeric terms are dropped.
|
|
283
|
+
*/
|
|
284
|
+
noTranslateTerms?: Array<string> | null;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Corner of the viewport the widget button is anchored to.
|
|
288
|
+
*/
|
|
289
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | null;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Colour scheme the widget renders in.
|
|
293
|
+
*/
|
|
294
|
+
theme?: 'light' | 'dark' | null;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* ISO-8601 timestamp of the most recent change. Matches `createdAt` on a widget
|
|
298
|
+
* that has never been edited.
|
|
299
|
+
*/
|
|
300
|
+
updatedAt?: string | null;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Domains where this widget is allowed to run. The widget refuses to load anywhere
|
|
304
|
+
* else, so a missing host means the widget never appears. Send bare hosts — no
|
|
305
|
+
* scheme, port, or path.
|
|
306
|
+
*/
|
|
307
|
+
whitelistedDomains?: Array<string> | null;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Visual style of the widget button: `compact` for an icon-sized button,
|
|
311
|
+
* `extended` for a labelled button, `minimal` for the least intrusive treatment.
|
|
312
|
+
*/
|
|
313
|
+
widgetVariant?: 'compact' | 'extended' | 'minimal' | null;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface TranslationWidgetAnalyticsResponse {
|
|
317
|
+
byHost: Array<TranslationWidgetAnalyticsResponse.ByHost>;
|
|
318
|
+
|
|
319
|
+
byLanguage: Array<TranslationWidgetAnalyticsResponse.ByLanguage>;
|
|
320
|
+
|
|
321
|
+
languagesUsed: number;
|
|
322
|
+
|
|
323
|
+
topPages: Array<TranslationWidgetAnalyticsResponse.TopPage>;
|
|
324
|
+
|
|
325
|
+
totalTranslations: number;
|
|
326
|
+
|
|
327
|
+
uniqueUsers: number;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export namespace TranslationWidgetAnalyticsResponse {
|
|
331
|
+
export interface ByHost {
|
|
332
|
+
host: string;
|
|
333
|
+
|
|
334
|
+
translations: number;
|
|
335
|
+
|
|
336
|
+
uniqueUsers: number;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export interface ByLanguage {
|
|
340
|
+
languageCode: string;
|
|
341
|
+
|
|
342
|
+
translations: number;
|
|
343
|
+
|
|
344
|
+
uniqueUsers: number;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export interface TopPage {
|
|
348
|
+
byLanguage: Array<TopPage.ByLanguage>;
|
|
349
|
+
|
|
350
|
+
translations: number;
|
|
351
|
+
|
|
352
|
+
uniqueUsers: number;
|
|
353
|
+
|
|
354
|
+
url: string;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export namespace TopPage {
|
|
358
|
+
export interface ByLanguage {
|
|
359
|
+
languageCode: string;
|
|
360
|
+
|
|
361
|
+
translations: number;
|
|
362
|
+
|
|
363
|
+
uniqueUsers: number;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export interface TranslationWidgetCreateParams {
|
|
369
|
+
/**
|
|
370
|
+
* Accent colour for the widget button and modal, as a hex value — `#RGB`,
|
|
371
|
+
* `#RRGGBB`, or `#RRGGBBAA`.
|
|
372
|
+
*/
|
|
373
|
+
brandColor?: string | null;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Custom domain used to serve the widget script (e.g. `translate.example.com`).
|
|
377
|
+
* Leave null to use the default Ours Privacy domain. Send the bare host — no
|
|
378
|
+
* scheme, port, or path.
|
|
379
|
+
*/
|
|
380
|
+
customDomain?: string | null;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Languages offered in the widget, as ISO codes such as `en`, `es`, `fr`, `zh-TW`.
|
|
384
|
+
* Omit or send an empty array to offer every supported language. An unrecognised
|
|
385
|
+
* code is rejected with 400 rather than silently ignored.
|
|
386
|
+
*/
|
|
387
|
+
enabledLanguages?: Array<
|
|
388
|
+
| 'af'
|
|
389
|
+
| 'sq'
|
|
390
|
+
| 'am'
|
|
391
|
+
| 'ar'
|
|
392
|
+
| 'hy'
|
|
393
|
+
| 'az'
|
|
394
|
+
| 'bn'
|
|
395
|
+
| 'bs'
|
|
396
|
+
| 'bg'
|
|
397
|
+
| 'ca'
|
|
398
|
+
| 'zh'
|
|
399
|
+
| 'zh-TW'
|
|
400
|
+
| 'hr'
|
|
401
|
+
| 'cs'
|
|
402
|
+
| 'da'
|
|
403
|
+
| 'fa-AF'
|
|
404
|
+
| 'nl'
|
|
405
|
+
| 'en'
|
|
406
|
+
| 'et'
|
|
407
|
+
| 'fa'
|
|
408
|
+
| 'tl'
|
|
409
|
+
| 'fi'
|
|
410
|
+
| 'fr'
|
|
411
|
+
| 'fr-CA'
|
|
412
|
+
| 'ka'
|
|
413
|
+
| 'de'
|
|
414
|
+
| 'el'
|
|
415
|
+
| 'gu'
|
|
416
|
+
| 'ht'
|
|
417
|
+
| 'ha'
|
|
418
|
+
| 'he'
|
|
419
|
+
| 'hi'
|
|
420
|
+
| 'hu'
|
|
421
|
+
| 'is'
|
|
422
|
+
| 'id'
|
|
423
|
+
| 'ga'
|
|
424
|
+
| 'it'
|
|
425
|
+
| 'ja'
|
|
426
|
+
| 'kn'
|
|
427
|
+
| 'kk'
|
|
428
|
+
| 'ko'
|
|
429
|
+
| 'lv'
|
|
430
|
+
| 'lt'
|
|
431
|
+
| 'mk'
|
|
432
|
+
| 'ms'
|
|
433
|
+
| 'ml'
|
|
434
|
+
| 'mt'
|
|
435
|
+
| 'mr'
|
|
436
|
+
| 'mn'
|
|
437
|
+
| 'no'
|
|
438
|
+
| 'ps'
|
|
439
|
+
| 'pl'
|
|
440
|
+
| 'pt'
|
|
441
|
+
| 'pt-PT'
|
|
442
|
+
| 'pa'
|
|
443
|
+
| 'ro'
|
|
444
|
+
| 'ru'
|
|
445
|
+
| 'sr'
|
|
446
|
+
| 'si'
|
|
447
|
+
| 'sk'
|
|
448
|
+
| 'sl'
|
|
449
|
+
| 'so'
|
|
450
|
+
| 'es'
|
|
451
|
+
| 'es-MX'
|
|
452
|
+
| 'sw'
|
|
453
|
+
| 'sv'
|
|
454
|
+
| 'ta'
|
|
455
|
+
| 'te'
|
|
456
|
+
| 'th'
|
|
457
|
+
| 'tr'
|
|
458
|
+
| 'uk'
|
|
459
|
+
| 'ur'
|
|
460
|
+
| 'uz'
|
|
461
|
+
| 'vi'
|
|
462
|
+
| 'cy'
|
|
463
|
+
> | null;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Layout of the language-selection modal: `standard` list, `grid` of languages, or
|
|
467
|
+
* a `dropdown`.
|
|
468
|
+
*/
|
|
469
|
+
modalVariant?: 'standard' | 'grid' | 'dropdown';
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Terms the widget keeps in their original form in every language — brand names,
|
|
473
|
+
* product names, and the like. Up to 500 terms of 200 characters each; duplicates
|
|
474
|
+
* and purely numeric terms are dropped.
|
|
475
|
+
*/
|
|
476
|
+
noTranslateTerms?: Array<string> | null;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Corner of the viewport the widget button is anchored to.
|
|
480
|
+
*/
|
|
481
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Colour scheme the widget renders in.
|
|
485
|
+
*/
|
|
486
|
+
theme?: 'light' | 'dark';
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Domains where this widget is allowed to run. The widget refuses to load anywhere
|
|
490
|
+
* else, so a missing host means the widget never appears. Send bare hosts — no
|
|
491
|
+
* scheme, port, or path.
|
|
492
|
+
*/
|
|
493
|
+
whitelistedDomains?: Array<string> | null;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Visual style of the widget button: `compact` for an icon-sized button,
|
|
497
|
+
* `extended` for a labelled button, `minimal` for the least intrusive treatment.
|
|
498
|
+
*/
|
|
499
|
+
widgetVariant?: 'compact' | 'extended' | 'minimal';
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export interface TranslationWidgetAnalyticsParams {
|
|
503
|
+
/**
|
|
504
|
+
* Inclusive lower bound of the analytics window as `YYYY-MM-DD`.
|
|
505
|
+
*/
|
|
506
|
+
from: string;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Inclusive upper bound of the analytics window as `YYYY-MM-DD`.
|
|
510
|
+
*/
|
|
511
|
+
to: string;
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Maximum rows to return for each breakdown. Defaults to 50.
|
|
515
|
+
*/
|
|
516
|
+
limit?: number;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export declare namespace TranslationWidgets {
|
|
520
|
+
export {
|
|
521
|
+
type TranslationWidgetListResponse as TranslationWidgetListResponse,
|
|
522
|
+
type TranslationWidgetCreateResponse as TranslationWidgetCreateResponse,
|
|
523
|
+
type TranslationWidgetRetrieveResponse as TranslationWidgetRetrieveResponse,
|
|
524
|
+
type TranslationWidgetAnalyticsResponse as TranslationWidgetAnalyticsResponse,
|
|
525
|
+
type TranslationWidgetCreateParams as TranslationWidgetCreateParams,
|
|
526
|
+
type TranslationWidgetAnalyticsParams as TranslationWidgetAnalyticsParams,
|
|
527
|
+
};
|
|
528
|
+
}
|
|
@@ -10,8 +10,8 @@ export class VideoChannels extends APIResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* List video channels for the account, sorted by name. Supports cursor pagination
|
|
12
12
|
* via `limit` and `cursor`; the limit clamp is 1000 so a single request can return
|
|
13
|
-
* the full set. Entries omit `resolvedValues` — fetch a channel by id for its
|
|
14
|
-
* count and embed output. Requires scope: videoChannel:list
|
|
13
|
+
* the full set. Entries omit `resolvedValues` — fetch a channel by id for its
|
|
14
|
+
* video count and embed output. Requires scope: videoChannel:list
|
|
15
15
|
*/
|
|
16
16
|
list(
|
|
17
17
|
query: VideoChannelListParams | null | undefined = {},
|
|
@@ -24,9 +24,9 @@ export class VideoChannels extends APIResource {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Create a video channel. Only `name` is accepted here; set branding and publish
|
|
28
|
-
* with PATCH, and add videos with `POST /rest/v1/video-channels/{id}/media`.
|
|
29
|
-
* channels start unpublished, so the page is not reachable until you send
|
|
27
|
+
* Create a video channel. Only `name` is accepted here; set branding and publish
|
|
28
|
+
* it with PATCH, and add videos with `POST /rest/v1/video-channels/{id}/media`.
|
|
29
|
+
* New channels start unpublished, so the page is not reachable until you send
|
|
30
30
|
* `isPublished: true`. Requires scope: videoChannel:create
|
|
31
31
|
*/
|
|
32
32
|
create(body: VideoChannelCreateParams, options?: RequestOptions): APIPromise<VideoChannelCreateResponse> {
|
|
@@ -91,25 +91,26 @@ export class VideoChannels extends APIResource {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* Remove one video from a channel, identified by the `mediaId` query parameter.
|
|
95
|
-
* video itself is not deleted and stays in any other channel it belongs to.
|
|
96
|
-
* Idempotent — removing a video that is not in the channel succeeds and returns
|
|
97
|
-
* channel unchanged. Requires scope: videoChannel:update
|
|
94
|
+
* Remove one video from a channel, identified by the `mediaId` query parameter.
|
|
95
|
+
* The video itself is not deleted and stays in any other channel it belongs to.
|
|
96
|
+
* Idempotent — removing a video that is not in the channel succeeds and returns
|
|
97
|
+
* the channel unchanged. Requires scope: videoChannel:update
|
|
98
98
|
*/
|
|
99
99
|
removeMedia(
|
|
100
100
|
id: string,
|
|
101
|
-
|
|
101
|
+
params: VideoChannelRemoveMediaParams,
|
|
102
102
|
options?: RequestOptions,
|
|
103
103
|
): APIPromise<VideoChannelRemoveMediaResponse> {
|
|
104
|
-
|
|
104
|
+
const { mediaId } = params;
|
|
105
|
+
return this._client.delete(path`/rest/v1/video-channels/${id}/media`, { query: { mediaId }, ...options });
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
/**
|
|
108
|
-
* Set the display order of a channel’s videos. Send every video id currently in
|
|
109
|
-
* channel in the order you want them shown — index 0 appears first. A partial
|
|
110
|
-
* or an id that is not in the channel, returns 400 so a caller working from
|
|
111
|
-
* view learns it is out of date instead of getting a partial write.
|
|
112
|
-
* videoChannel:update
|
|
109
|
+
* Set the display order of a channel’s videos. Send every video id currently in
|
|
110
|
+
* the channel in the order you want them shown — index 0 appears first. A partial
|
|
111
|
+
* list, or an id that is not in the channel, returns 400 so a caller working from
|
|
112
|
+
* a stale view learns it is out of date instead of getting a partial write.
|
|
113
|
+
* Requires scope: videoChannel:update
|
|
113
114
|
*/
|
|
114
115
|
reorder(
|
|
115
116
|
id: string,
|
|
@@ -362,8 +363,8 @@ export interface VideoChannelAssignMediaParams {
|
|
|
362
363
|
mediaId: string;
|
|
363
364
|
|
|
364
365
|
/**
|
|
365
|
-
* Zero-based slot in the channel order. Omit to append to the end; omitting it on
|
|
366
|
-
* video that is already in the channel keeps its current slot.
|
|
366
|
+
* Zero-based slot in the channel order. Omit to append to the end; omitting it on
|
|
367
|
+
* a video that is already in the channel keeps its current slot.
|
|
367
368
|
*/
|
|
368
369
|
position?: number;
|
|
369
370
|
}
|