@wix/auto_sdk_multilingual_translation-credits 1.0.18 → 1.0.20
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/build/index.d.mts +28 -0
- package/build/index.d.ts +28 -0
- package/build/index.js +263 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +233 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/index.d.mts +28 -0
- package/build/internal/index.d.ts +28 -0
- package/build/internal/index.js +263 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +233 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/meta.d.mts +61 -0
- package/build/internal/meta.d.ts +61 -0
- package/build/internal/meta.js +154 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +126 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/{cjs/src/multilingual-machine-v1-credit-data-translation-credits.types.d.ts → internal/multilingual-machine-v1-credit-data-translation-credits.universal-Di8nBZdQ.d.mts} +61 -49
- package/build/{cjs/src/multilingual-machine-v1-credit-data-translation-credits.universal.d.ts → internal/multilingual-machine-v1-credit-data-translation-credits.universal-Di8nBZdQ.d.ts} +61 -82
- package/build/meta.d.mts +61 -0
- package/build/meta.d.ts +61 -0
- package/build/meta.js +154 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +126 -0
- package/build/meta.mjs.map +1 -0
- package/build/{es/src/multilingual-machine-v1-credit-data-translation-credits.universal.d.ts → multilingual-machine-v1-credit-data-translation-credits.universal-Di8nBZdQ.d.mts} +61 -82
- package/build/{es/src/multilingual-machine-v1-credit-data-translation-credits.types.d.ts → multilingual-machine-v1-credit-data-translation-credits.universal-Di8nBZdQ.d.ts} +61 -49
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.context.d.ts +0 -6
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.context.js +0 -14
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.context.js.map +0 -1
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.http.d.ts +0 -11
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.http.js +0 -94
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.http.js.map +0 -1
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.meta.d.ts +0 -14
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.meta.js +0 -66
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.meta.js.map +0 -1
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.public.d.ts +0 -25
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.public.js +0 -24
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.public.js.map +0 -1
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.types.js +0 -124
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.types.js.map +0 -1
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.universal.js +0 -222
- package/build/cjs/src/multilingual-machine-v1-credit-data-translation-credits.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.context.d.ts +0 -6
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.context.js +0 -6
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.context.js.map +0 -1
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.http.d.ts +0 -11
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.http.js +0 -89
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.http.js.map +0 -1
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.meta.d.ts +0 -14
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.meta.js +0 -38
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.meta.js.map +0 -1
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.public.d.ts +0 -25
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.public.js +0 -14
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.public.js.map +0 -1
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.types.js +0 -121
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.types.js.map +0 -1
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.universal.js +0 -194
- package/build/es/src/multilingual-machine-v1-credit-data-translation-credits.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.context.d.ts +0 -6
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.context.js +0 -14
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.context.js.map +0 -1
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.http.d.ts +0 -11
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.http.js +0 -94
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.http.js.map +0 -1
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.meta.d.ts +0 -14
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.meta.js +0 -66
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.meta.js.map +0 -1
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.public.d.ts +0 -25
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.public.js +0 -24
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.public.js.map +0 -1
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.types.d.ts +0 -509
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.types.js +0 -124
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.types.js.map +0 -1
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.universal.d.ts +0 -542
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.universal.js +0 -222
- package/build/internal/cjs/src/multilingual-machine-v1-credit-data-translation-credits.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.context.d.ts +0 -6
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.context.js +0 -6
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.context.js.map +0 -1
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.http.d.ts +0 -11
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.http.js +0 -89
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.http.js.map +0 -1
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.meta.d.ts +0 -14
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.meta.js +0 -38
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.meta.js.map +0 -1
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.public.d.ts +0 -25
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.public.js +0 -14
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.public.js.map +0 -1
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.types.d.ts +0 -509
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.types.js +0 -121
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.types.js.map +0 -1
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.universal.d.ts +0 -542
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.universal.js +0 -194
- package/build/internal/es/src/multilingual-machine-v1-credit-data-translation-credits.universal.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface CreditData extends CreditDataTypeOneOf {
|
|
1
|
+
interface CreditData extends CreditDataTypeOneOf {
|
|
3
2
|
/**
|
|
4
3
|
* Limited word credit quota.
|
|
5
4
|
* @readonly
|
|
@@ -8,56 +7,58 @@ export interface CreditData extends CreditDataTypeOneOf {
|
|
|
8
7
|
/** Total number of word credits consumed by a site. For sites with an unlimited word credit quota, this property still reflects the number of credits used, even though no usage limit applies. */
|
|
9
8
|
creditsUsed?: number | null;
|
|
10
9
|
/** Quota type. */
|
|
11
|
-
quotaType?:
|
|
10
|
+
quotaType?: QuotaWithLiterals;
|
|
12
11
|
}
|
|
13
12
|
/** @oneof */
|
|
14
|
-
|
|
13
|
+
interface CreditDataTypeOneOf {
|
|
15
14
|
/**
|
|
16
15
|
* Limited word credit quota.
|
|
17
16
|
* @readonly
|
|
18
17
|
*/
|
|
19
18
|
limitedQuota?: LimitedQuota;
|
|
20
19
|
}
|
|
21
|
-
|
|
20
|
+
declare enum Quota {
|
|
22
21
|
UNKNOWN = "UNKNOWN",
|
|
23
22
|
/** Limited word credit quota. */
|
|
24
23
|
LIMITED = "LIMITED"
|
|
25
24
|
}
|
|
26
|
-
|
|
25
|
+
/** @enumType */
|
|
26
|
+
type QuotaWithLiterals = Quota | 'UNKNOWN' | 'LIMITED';
|
|
27
|
+
interface LimitedQuota {
|
|
27
28
|
/** Total word credit allocation for the site, which includes the initial quota and any additional credits purchased through the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager), regardless of usage. */
|
|
28
29
|
quota?: number | null;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
interface GetCreditDataRequest {
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
interface GetCreditDataResponse {
|
|
33
34
|
/** Credit data. */
|
|
34
35
|
creditData?: CreditData;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
interface CheckSufficientCreditsRequest {
|
|
37
38
|
/** Number of words to translate. */
|
|
38
39
|
wordCount: number;
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
interface CheckSufficientCreditsResponse {
|
|
41
42
|
/** Whether the site has enough credits to translate the specified number of words. */
|
|
42
43
|
sufficientCredits?: boolean;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
interface ReportCreditUsageRequest {
|
|
45
46
|
/** Number of credits used in the translation operation */
|
|
46
47
|
used?: number;
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
+
interface ReportCreditUsageResponse {
|
|
49
50
|
/** Updated credit status after reporting usage */
|
|
50
51
|
creditData?: CreditData;
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
interface UpdateCreditRequest {
|
|
53
54
|
/** New credit status to be set for the site */
|
|
54
55
|
creditData?: CreditData;
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
+
interface UpdateCreditResponse {
|
|
57
58
|
/** Updated credit status after the change */
|
|
58
59
|
creditData?: CreditData;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
+
interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
|
|
61
62
|
/** Emitted on a meta site creation. */
|
|
62
63
|
siteCreated?: SiteCreated;
|
|
63
64
|
/** Emitted on a meta site transfer completion. */
|
|
@@ -123,7 +124,7 @@ export interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
|
|
|
123
124
|
assets?: Asset[];
|
|
124
125
|
}
|
|
125
126
|
/** @oneof */
|
|
126
|
-
|
|
127
|
+
interface MetaSiteSpecialEventPayloadOneOf {
|
|
127
128
|
/** Emitted on a meta site creation. */
|
|
128
129
|
siteCreated?: SiteCreated;
|
|
129
130
|
/** Emitted on a meta site transfer completion. */
|
|
@@ -173,7 +174,7 @@ export interface MetaSiteSpecialEventPayloadOneOf {
|
|
|
173
174
|
/** Emitted when Picasso is detached. */
|
|
174
175
|
picassoUnassigned?: PicassoUnassigned;
|
|
175
176
|
}
|
|
176
|
-
|
|
177
|
+
interface Asset {
|
|
177
178
|
/**
|
|
178
179
|
* An application definition id (app_id in dev-center). For legacy reasons may be UUID or a string (from Java Enum).
|
|
179
180
|
* @maxLength 36
|
|
@@ -185,16 +186,18 @@ export interface Asset {
|
|
|
185
186
|
*/
|
|
186
187
|
instanceId?: string;
|
|
187
188
|
/** An application state. */
|
|
188
|
-
state?:
|
|
189
|
+
state?: StateWithLiterals;
|
|
189
190
|
}
|
|
190
|
-
|
|
191
|
+
declare enum State {
|
|
191
192
|
UNKNOWN = "UNKNOWN",
|
|
192
193
|
ENABLED = "ENABLED",
|
|
193
194
|
DISABLED = "DISABLED",
|
|
194
195
|
PENDING = "PENDING",
|
|
195
196
|
DEMO = "DEMO"
|
|
196
197
|
}
|
|
197
|
-
|
|
198
|
+
/** @enumType */
|
|
199
|
+
type StateWithLiterals = State | 'UNKNOWN' | 'ENABLED' | 'DISABLED' | 'PENDING' | 'DEMO';
|
|
200
|
+
interface SiteCreated {
|
|
198
201
|
/**
|
|
199
202
|
* A template identifier (empty if not created from a template).
|
|
200
203
|
* @maxLength 36
|
|
@@ -206,7 +209,7 @@ export interface SiteCreated {
|
|
|
206
209
|
*/
|
|
207
210
|
ownerId?: string;
|
|
208
211
|
/** A context in which meta site was created. */
|
|
209
|
-
context?:
|
|
212
|
+
context?: SiteCreatedContextWithLiterals;
|
|
210
213
|
/**
|
|
211
214
|
* A meta site id from which this site was created.
|
|
212
215
|
*
|
|
@@ -221,9 +224,9 @@ export interface SiteCreated {
|
|
|
221
224
|
*/
|
|
222
225
|
siteName?: string;
|
|
223
226
|
/** A namespace. */
|
|
224
|
-
namespace?:
|
|
227
|
+
namespace?: NamespaceWithLiterals;
|
|
225
228
|
}
|
|
226
|
-
|
|
229
|
+
declare enum SiteCreatedContext {
|
|
227
230
|
/** A valid option, we don't expose all reasons why site might be created. */
|
|
228
231
|
OTHER = "OTHER",
|
|
229
232
|
/** A meta site was created from template. */
|
|
@@ -237,7 +240,9 @@ export declare enum SiteCreatedContext {
|
|
|
237
240
|
/** deprecated A meta site was created for Flash editor. */
|
|
238
241
|
FLASH = "FLASH"
|
|
239
242
|
}
|
|
240
|
-
|
|
243
|
+
/** @enumType */
|
|
244
|
+
type SiteCreatedContextWithLiterals = SiteCreatedContext | 'OTHER' | 'FROM_TEMPLATE' | 'DUPLICATE_BY_SITE_TRANSFER' | 'DUPLICATE' | 'OLD_SITE_TRANSFER' | 'FLASH';
|
|
245
|
+
declare enum Namespace {
|
|
241
246
|
UNKNOWN_NAMESPACE = "UNKNOWN_NAMESPACE",
|
|
242
247
|
/** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
|
|
243
248
|
WIX = "WIX",
|
|
@@ -319,8 +324,10 @@ export declare enum Namespace {
|
|
|
319
324
|
/** MIMIR - Siteless account for MIMIR Ai Job runner. */
|
|
320
325
|
MIMIR = "MIMIR"
|
|
321
326
|
}
|
|
327
|
+
/** @enumType */
|
|
328
|
+
type NamespaceWithLiterals = Namespace | 'UNKNOWN_NAMESPACE' | 'WIX' | 'SHOUT_OUT' | 'ALBUMS' | 'WIX_STORES_TEST_DRIVE' | 'HOTELS' | 'CLUBS' | 'ONBOARDING_DRAFT' | 'DEV_SITE' | 'LOGOS' | 'VIDEO_MAKER' | 'PARTNER_DASHBOARD' | 'DEV_CENTER_COMPANY' | 'HTML_DRAFT' | 'SITELESS_BUSINESS' | 'CREATOR_ECONOMY' | 'DASHBOARD_FIRST' | 'ANYWHERE' | 'HEADLESS' | 'ACCOUNT_MASTER_CMS' | 'RISE' | 'BRANDED_FIRST' | 'NOWNIA' | 'UGC_TEMPLATE' | 'CODUX' | 'MEDIA_DESIGN_CREATOR' | 'SHARED_BLOG_ENTERPRISE' | 'STANDALONE_FORMS' | 'STANDALONE_EVENTS' | 'MIMIR';
|
|
322
329
|
/** Site transferred to another user. */
|
|
323
|
-
|
|
330
|
+
interface SiteTransferred {
|
|
324
331
|
/**
|
|
325
332
|
* A previous owner id (user that transfers meta site).
|
|
326
333
|
* @format GUID
|
|
@@ -333,15 +340,15 @@ export interface SiteTransferred {
|
|
|
333
340
|
newOwnerId?: string;
|
|
334
341
|
}
|
|
335
342
|
/** Soft deletion of the meta site. Could be restored. */
|
|
336
|
-
|
|
343
|
+
interface SiteDeleted {
|
|
337
344
|
/** A deletion context. */
|
|
338
345
|
deleteContext?: DeleteContext;
|
|
339
346
|
}
|
|
340
|
-
|
|
347
|
+
interface DeleteContext {
|
|
341
348
|
/** When the meta site was deleted. */
|
|
342
349
|
dateDeleted?: Date | null;
|
|
343
350
|
/** A status. */
|
|
344
|
-
deleteStatus?:
|
|
351
|
+
deleteStatus?: DeleteStatusWithLiterals;
|
|
345
352
|
/**
|
|
346
353
|
* A reason (flow).
|
|
347
354
|
* @maxLength 255
|
|
@@ -353,20 +360,22 @@ export interface DeleteContext {
|
|
|
353
360
|
*/
|
|
354
361
|
initiatorId?: string | null;
|
|
355
362
|
}
|
|
356
|
-
|
|
363
|
+
declare enum DeleteStatus {
|
|
357
364
|
UNKNOWN = "UNKNOWN",
|
|
358
365
|
TRASH = "TRASH",
|
|
359
366
|
DELETED = "DELETED",
|
|
360
367
|
PENDING_PURGE = "PENDING_PURGE",
|
|
361
368
|
PURGED_EXTERNALLY = "PURGED_EXTERNALLY"
|
|
362
369
|
}
|
|
370
|
+
/** @enumType */
|
|
371
|
+
type DeleteStatusWithLiterals = DeleteStatus | 'UNKNOWN' | 'TRASH' | 'DELETED' | 'PENDING_PURGE' | 'PURGED_EXTERNALLY';
|
|
363
372
|
/** Restoration of the meta site. */
|
|
364
|
-
|
|
373
|
+
interface SiteUndeleted {
|
|
365
374
|
}
|
|
366
375
|
/** First publish of a meta site. Or subsequent publish after unpublish. */
|
|
367
|
-
|
|
376
|
+
interface SitePublished {
|
|
368
377
|
}
|
|
369
|
-
|
|
378
|
+
interface SiteUnpublished {
|
|
370
379
|
/**
|
|
371
380
|
* A list of URLs previously associated with the meta site.
|
|
372
381
|
* @maxLength 4000
|
|
@@ -374,9 +383,9 @@ export interface SiteUnpublished {
|
|
|
374
383
|
*/
|
|
375
384
|
urls?: string[];
|
|
376
385
|
}
|
|
377
|
-
|
|
386
|
+
interface SiteMarkedAsTemplate {
|
|
378
387
|
}
|
|
379
|
-
|
|
388
|
+
interface SiteMarkedAsWixSite {
|
|
380
389
|
}
|
|
381
390
|
/**
|
|
382
391
|
* Represents a service provisioned a site.
|
|
@@ -393,7 +402,7 @@ export interface SiteMarkedAsWixSite {
|
|
|
393
402
|
* changes made to the original template afterward.
|
|
394
403
|
* To ensure this, the TPA on the template gets a new instance_id.
|
|
395
404
|
*/
|
|
396
|
-
|
|
405
|
+
interface ServiceProvisioned {
|
|
397
406
|
/**
|
|
398
407
|
* Either UUID or EmbeddedServiceType.
|
|
399
408
|
* @maxLength 36
|
|
@@ -420,7 +429,7 @@ export interface ServiceProvisioned {
|
|
|
420
429
|
*/
|
|
421
430
|
originMetaSiteId?: string | null;
|
|
422
431
|
}
|
|
423
|
-
|
|
432
|
+
interface ServiceRemoved {
|
|
424
433
|
/**
|
|
425
434
|
* Either UUID or EmbeddedServiceType.
|
|
426
435
|
* @maxLength 36
|
|
@@ -438,7 +447,7 @@ export interface ServiceRemoved {
|
|
|
438
447
|
version?: string | null;
|
|
439
448
|
}
|
|
440
449
|
/** Rename of the site. Meaning, free public url has been changed as well. */
|
|
441
|
-
|
|
450
|
+
interface SiteRenamed {
|
|
442
451
|
/**
|
|
443
452
|
* A new meta site name (URL slug).
|
|
444
453
|
* @maxLength 20
|
|
@@ -455,21 +464,21 @@ export interface SiteRenamed {
|
|
|
455
464
|
*
|
|
456
465
|
* Could not be restored. Therefore it's desirable to cleanup data.
|
|
457
466
|
*/
|
|
458
|
-
|
|
467
|
+
interface SiteHardDeleted {
|
|
459
468
|
/** A deletion context. */
|
|
460
469
|
deleteContext?: DeleteContext;
|
|
461
470
|
}
|
|
462
|
-
|
|
471
|
+
interface NamespaceChanged {
|
|
463
472
|
/** A previous namespace. */
|
|
464
|
-
oldNamespace?:
|
|
473
|
+
oldNamespace?: NamespaceWithLiterals;
|
|
465
474
|
/** A new namespace. */
|
|
466
|
-
newNamespace?:
|
|
475
|
+
newNamespace?: NamespaceWithLiterals;
|
|
467
476
|
}
|
|
468
477
|
/** Assigned Studio editor */
|
|
469
|
-
|
|
478
|
+
interface StudioAssigned {
|
|
470
479
|
}
|
|
471
480
|
/** Unassigned Studio editor */
|
|
472
|
-
|
|
481
|
+
interface StudioUnassigned {
|
|
473
482
|
}
|
|
474
483
|
/**
|
|
475
484
|
* Fired in case site URLs were changed in any way: new secondary domain, published, account slug rename, site rename etc.
|
|
@@ -479,13 +488,13 @@ export interface StudioUnassigned {
|
|
|
479
488
|
*
|
|
480
489
|
* https://bo.wix.com/wix-docs/rest/meta-site/meta-site---urls-service
|
|
481
490
|
*/
|
|
482
|
-
|
|
491
|
+
interface SiteUrlChanged {
|
|
483
492
|
}
|
|
484
493
|
/**
|
|
485
494
|
* Used at the end of the deletion flow for both draft sites and when a user deletes a site.
|
|
486
495
|
* Consumed by other teams to remove relevant data.
|
|
487
496
|
*/
|
|
488
|
-
|
|
497
|
+
interface SitePurgedExternally {
|
|
489
498
|
/**
|
|
490
499
|
* @maxLength 2048
|
|
491
500
|
* @maxSize 100
|
|
@@ -495,48 +504,18 @@ export interface SitePurgedExternally {
|
|
|
495
504
|
appDefId?: string[];
|
|
496
505
|
}
|
|
497
506
|
/** Assigned Odeditor */
|
|
498
|
-
|
|
507
|
+
interface OdeditorAssigned {
|
|
499
508
|
}
|
|
500
509
|
/** Unassigned Odeditor */
|
|
501
|
-
|
|
510
|
+
interface OdeditorUnassigned {
|
|
502
511
|
}
|
|
503
512
|
/** Assigned Picasso editor */
|
|
504
|
-
|
|
513
|
+
interface PicassoAssigned {
|
|
505
514
|
}
|
|
506
515
|
/** Unassigned Picasso */
|
|
507
|
-
|
|
516
|
+
interface PicassoUnassigned {
|
|
508
517
|
}
|
|
509
|
-
|
|
518
|
+
interface Empty {
|
|
510
519
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
* Retrieves a site's word credit data.
|
|
514
|
-
*
|
|
515
|
-
* For sites with a limited quota, you can calculate the available word credits by subtracting the credits used from the quota.
|
|
516
|
-
* For example, if a site has a quota of 100 credits and all credits have been used (`"creditsUsed": 100`), the available word credits will be 0.
|
|
517
|
-
* If a Wix user purchases an additional 50 credits, the `quota` will increase to `150`, and the site will have 50 available word credits.
|
|
518
|
-
* @public
|
|
519
|
-
* @documentationMaturity preview
|
|
520
|
-
* @permissionId WIX_MULTILINGUAL.GET_CREDITS
|
|
521
|
-
* @permissionScope Wix Multilingual - Translation API
|
|
522
|
-
* @permissionScopeId SCOPE.MULTILINGUAL.MANAGE_TRANSLATIONS
|
|
523
|
-
* @applicableIdentity APP
|
|
524
|
-
* @fqn wix.multilingual.machine.v1.TranslationCredits.GetCreditData
|
|
525
|
-
*/
|
|
526
|
-
export declare function getCreditData(): Promise<NonNullablePaths<GetCreditDataResponse, {
|
|
527
|
-
[P in CreditDataNonNullablePaths]: `creditData.${P}`;
|
|
528
|
-
}[CreditDataNonNullablePaths]>>;
|
|
529
|
-
/**
|
|
530
|
-
* Checks whether a site has enough credits to translate the specified number of words.
|
|
531
|
-
* @param wordCount - Number of words to translate.
|
|
532
|
-
* @public
|
|
533
|
-
* @documentationMaturity preview
|
|
534
|
-
* @requiredField wordCount
|
|
535
|
-
* @permissionId WIX_MULTILINGUAL.GET_IS_ELIGIBLE
|
|
536
|
-
* @permissionScope Wix Multilingual - Translation API
|
|
537
|
-
* @permissionScopeId SCOPE.MULTILINGUAL.MANAGE_TRANSLATIONS
|
|
538
|
-
* @applicableIdentity APP
|
|
539
|
-
* @fqn wix.multilingual.machine.v1.TranslationCredits.CheckSufficientCredits
|
|
540
|
-
*/
|
|
541
|
-
export declare function checkSufficientCredits(wordCount: number): Promise<NonNullablePaths<CheckSufficientCreditsResponse, `sufficientCredits`>>;
|
|
542
|
-
export {};
|
|
520
|
+
|
|
521
|
+
export { type Asset as A, type OdeditorUnassigned as B, type CheckSufficientCreditsResponse as C, DeleteStatus as D, type PicassoUnassigned as E, type Empty as F, type GetCreditDataResponse as G, type LimitedQuota as L, type MetaSiteSpecialEvent as M, Namespace as N, type OdeditorAssigned as O, type PicassoAssigned as P, Quota as Q, type ReportCreditUsageRequest as R, State as S, type UpdateCreditRequest as U, SiteCreatedContext as a, type CreditData as b, type CreditDataTypeOneOf as c, type GetCreditDataRequest as d, type CheckSufficientCreditsRequest as e, type ReportCreditUsageResponse as f, type UpdateCreditResponse as g, type MetaSiteSpecialEventPayloadOneOf as h, type SiteCreated as i, type SiteTransferred as j, type SiteDeleted as k, type DeleteContext as l, type SiteUndeleted as m, type SitePublished as n, type SiteUnpublished as o, type SiteMarkedAsTemplate as p, type SiteMarkedAsWixSite as q, type ServiceProvisioned as r, type ServiceRemoved as s, type SiteRenamed as t, type SiteHardDeleted as u, type NamespaceChanged as v, type StudioAssigned as w, type StudioUnassigned as x, type SiteUrlChanged as y, type SitePurgedExternally as z };
|
package/build/meta.d.mts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { d as GetCreditDataRequest$1, G as GetCreditDataResponse$1, e as CheckSufficientCreditsRequest$1, C as CheckSufficientCreditsResponse$1 } from './multilingual-machine-v1-credit-data-translation-credits.universal-Di8nBZdQ.mjs';
|
|
2
|
+
|
|
3
|
+
interface CreditData extends CreditDataTypeOneOf {
|
|
4
|
+
/**
|
|
5
|
+
* Limited word credit quota.
|
|
6
|
+
* @readonly
|
|
7
|
+
*/
|
|
8
|
+
limitedQuota?: LimitedQuota;
|
|
9
|
+
/** Total number of word credits consumed by a site. For sites with an unlimited word credit quota, this property still reflects the number of credits used, even though no usage limit applies. */
|
|
10
|
+
creditsUsed?: number | null;
|
|
11
|
+
/** Quota type. */
|
|
12
|
+
quotaType?: QuotaWithLiterals;
|
|
13
|
+
}
|
|
14
|
+
/** @oneof */
|
|
15
|
+
interface CreditDataTypeOneOf {
|
|
16
|
+
/**
|
|
17
|
+
* Limited word credit quota.
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
limitedQuota?: LimitedQuota;
|
|
21
|
+
}
|
|
22
|
+
declare enum Quota {
|
|
23
|
+
UNKNOWN = "UNKNOWN",
|
|
24
|
+
/** Limited word credit quota. */
|
|
25
|
+
LIMITED = "LIMITED"
|
|
26
|
+
}
|
|
27
|
+
/** @enumType */
|
|
28
|
+
type QuotaWithLiterals = Quota | 'UNKNOWN' | 'LIMITED';
|
|
29
|
+
interface LimitedQuota {
|
|
30
|
+
/** Total word credit allocation for the site, which includes the initial quota and any additional credits purchased through the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager), regardless of usage. */
|
|
31
|
+
quota?: number | null;
|
|
32
|
+
}
|
|
33
|
+
interface GetCreditDataRequest {
|
|
34
|
+
}
|
|
35
|
+
interface GetCreditDataResponse {
|
|
36
|
+
/** Credit data. */
|
|
37
|
+
creditData?: CreditData;
|
|
38
|
+
}
|
|
39
|
+
interface CheckSufficientCreditsRequest {
|
|
40
|
+
/** Number of words to translate. */
|
|
41
|
+
wordCount: number;
|
|
42
|
+
}
|
|
43
|
+
interface CheckSufficientCreditsResponse {
|
|
44
|
+
/** Whether the site has enough credits to translate the specified number of words. */
|
|
45
|
+
sufficientCredits?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
49
|
+
getUrl: (context: any) => string;
|
|
50
|
+
httpMethod: K;
|
|
51
|
+
path: string;
|
|
52
|
+
pathParams: M;
|
|
53
|
+
__requestType: T;
|
|
54
|
+
__originalRequestType: S;
|
|
55
|
+
__responseType: Q;
|
|
56
|
+
__originalResponseType: R;
|
|
57
|
+
};
|
|
58
|
+
declare function getCreditData(): __PublicMethodMetaInfo<'GET', {}, GetCreditDataRequest$1, GetCreditDataRequest, GetCreditDataResponse$1, GetCreditDataResponse>;
|
|
59
|
+
declare function checkSufficientCredits(): __PublicMethodMetaInfo<'POST', {}, CheckSufficientCreditsRequest$1, CheckSufficientCreditsRequest, CheckSufficientCreditsResponse$1, CheckSufficientCreditsResponse>;
|
|
60
|
+
|
|
61
|
+
export { type __PublicMethodMetaInfo, checkSufficientCredits, getCreditData };
|
package/build/meta.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { d as GetCreditDataRequest$1, G as GetCreditDataResponse$1, e as CheckSufficientCreditsRequest$1, C as CheckSufficientCreditsResponse$1 } from './multilingual-machine-v1-credit-data-translation-credits.universal-Di8nBZdQ.js';
|
|
2
|
+
|
|
3
|
+
interface CreditData extends CreditDataTypeOneOf {
|
|
4
|
+
/**
|
|
5
|
+
* Limited word credit quota.
|
|
6
|
+
* @readonly
|
|
7
|
+
*/
|
|
8
|
+
limitedQuota?: LimitedQuota;
|
|
9
|
+
/** Total number of word credits consumed by a site. For sites with an unlimited word credit quota, this property still reflects the number of credits used, even though no usage limit applies. */
|
|
10
|
+
creditsUsed?: number | null;
|
|
11
|
+
/** Quota type. */
|
|
12
|
+
quotaType?: QuotaWithLiterals;
|
|
13
|
+
}
|
|
14
|
+
/** @oneof */
|
|
15
|
+
interface CreditDataTypeOneOf {
|
|
16
|
+
/**
|
|
17
|
+
* Limited word credit quota.
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
limitedQuota?: LimitedQuota;
|
|
21
|
+
}
|
|
22
|
+
declare enum Quota {
|
|
23
|
+
UNKNOWN = "UNKNOWN",
|
|
24
|
+
/** Limited word credit quota. */
|
|
25
|
+
LIMITED = "LIMITED"
|
|
26
|
+
}
|
|
27
|
+
/** @enumType */
|
|
28
|
+
type QuotaWithLiterals = Quota | 'UNKNOWN' | 'LIMITED';
|
|
29
|
+
interface LimitedQuota {
|
|
30
|
+
/** Total word credit allocation for the site, which includes the initial quota and any additional credits purchased through the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager), regardless of usage. */
|
|
31
|
+
quota?: number | null;
|
|
32
|
+
}
|
|
33
|
+
interface GetCreditDataRequest {
|
|
34
|
+
}
|
|
35
|
+
interface GetCreditDataResponse {
|
|
36
|
+
/** Credit data. */
|
|
37
|
+
creditData?: CreditData;
|
|
38
|
+
}
|
|
39
|
+
interface CheckSufficientCreditsRequest {
|
|
40
|
+
/** Number of words to translate. */
|
|
41
|
+
wordCount: number;
|
|
42
|
+
}
|
|
43
|
+
interface CheckSufficientCreditsResponse {
|
|
44
|
+
/** Whether the site has enough credits to translate the specified number of words. */
|
|
45
|
+
sufficientCredits?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
49
|
+
getUrl: (context: any) => string;
|
|
50
|
+
httpMethod: K;
|
|
51
|
+
path: string;
|
|
52
|
+
pathParams: M;
|
|
53
|
+
__requestType: T;
|
|
54
|
+
__originalRequestType: S;
|
|
55
|
+
__responseType: Q;
|
|
56
|
+
__originalResponseType: R;
|
|
57
|
+
};
|
|
58
|
+
declare function getCreditData(): __PublicMethodMetaInfo<'GET', {}, GetCreditDataRequest$1, GetCreditDataRequest, GetCreditDataResponse$1, GetCreditDataResponse>;
|
|
59
|
+
declare function checkSufficientCredits(): __PublicMethodMetaInfo<'POST', {}, CheckSufficientCreditsRequest$1, CheckSufficientCreditsRequest, CheckSufficientCreditsResponse$1, CheckSufficientCreditsResponse>;
|
|
60
|
+
|
|
61
|
+
export { type __PublicMethodMetaInfo, checkSufficientCredits, getCreditData };
|
package/build/meta.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// meta.ts
|
|
21
|
+
var meta_exports = {};
|
|
22
|
+
__export(meta_exports, {
|
|
23
|
+
checkSufficientCredits: () => checkSufficientCredits2,
|
|
24
|
+
getCreditData: () => getCreditData2
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(meta_exports);
|
|
27
|
+
|
|
28
|
+
// src/multilingual-machine-v1-credit-data-translation-credits.http.ts
|
|
29
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
30
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
31
|
+
function resolveWixMultilingualMachineV1TranslationCreditsUrl(opts) {
|
|
32
|
+
const domainToMappings = {
|
|
33
|
+
"editor._base_domain_": [
|
|
34
|
+
{
|
|
35
|
+
srcPath: "/_api/translation-credits/v1",
|
|
36
|
+
destPath: "/v1"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"blocks._base_domain_": [
|
|
40
|
+
{
|
|
41
|
+
srcPath: "/_api/translation-credits/v1",
|
|
42
|
+
destPath: "/v1"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"create.editorx": [
|
|
46
|
+
{
|
|
47
|
+
srcPath: "/_api/translation-credits/v1",
|
|
48
|
+
destPath: "/v1"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"manage._base_domain_": [
|
|
52
|
+
{
|
|
53
|
+
srcPath: "/_api/translation-credits/v1",
|
|
54
|
+
destPath: "/v1"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"www.wixapis.com": [
|
|
58
|
+
{
|
|
59
|
+
srcPath: "/translation-credits/v1",
|
|
60
|
+
destPath: "/v1"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"*.dev.wix-code.com": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/_api/translation-credits/v1",
|
|
66
|
+
destPath: "/v1"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
71
|
+
}
|
|
72
|
+
var PACKAGE_NAME = "@wix/auto_sdk_multilingual_translation-credits";
|
|
73
|
+
function getCreditData(payload) {
|
|
74
|
+
function __getCreditData({ host }) {
|
|
75
|
+
const metadata = {
|
|
76
|
+
entityFqdn: "wix.multilingual.machine.v1.credit_data",
|
|
77
|
+
method: "GET",
|
|
78
|
+
methodFqn: "wix.multilingual.machine.v1.TranslationCredits.GetCreditData",
|
|
79
|
+
packageName: PACKAGE_NAME,
|
|
80
|
+
url: resolveWixMultilingualMachineV1TranslationCreditsUrl({
|
|
81
|
+
protoPath: "/v1/credit",
|
|
82
|
+
data: payload,
|
|
83
|
+
host
|
|
84
|
+
}),
|
|
85
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
86
|
+
};
|
|
87
|
+
return metadata;
|
|
88
|
+
}
|
|
89
|
+
return __getCreditData;
|
|
90
|
+
}
|
|
91
|
+
function checkSufficientCredits(payload) {
|
|
92
|
+
function __checkSufficientCredits({ host }) {
|
|
93
|
+
const metadata = {
|
|
94
|
+
entityFqdn: "wix.multilingual.machine.v1.credit_data",
|
|
95
|
+
method: "POST",
|
|
96
|
+
methodFqn: "wix.multilingual.machine.v1.TranslationCredits.CheckSufficientCredits",
|
|
97
|
+
packageName: PACKAGE_NAME,
|
|
98
|
+
url: resolveWixMultilingualMachineV1TranslationCreditsUrl({
|
|
99
|
+
protoPath: "/v1/credit/is-eligible",
|
|
100
|
+
data: payload,
|
|
101
|
+
host
|
|
102
|
+
}),
|
|
103
|
+
data: payload
|
|
104
|
+
};
|
|
105
|
+
return metadata;
|
|
106
|
+
}
|
|
107
|
+
return __checkSufficientCredits;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/multilingual-machine-v1-credit-data-translation-credits.meta.ts
|
|
111
|
+
function getCreditData2() {
|
|
112
|
+
const payload = {};
|
|
113
|
+
const getRequestOptions = getCreditData(payload);
|
|
114
|
+
const getUrl = (context) => {
|
|
115
|
+
const { url } = getRequestOptions(context);
|
|
116
|
+
return url;
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
getUrl,
|
|
120
|
+
httpMethod: "GET",
|
|
121
|
+
path: "/v1/credit",
|
|
122
|
+
pathParams: {},
|
|
123
|
+
__requestType: null,
|
|
124
|
+
__originalRequestType: null,
|
|
125
|
+
__responseType: null,
|
|
126
|
+
__originalResponseType: null
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function checkSufficientCredits2() {
|
|
130
|
+
const payload = {};
|
|
131
|
+
const getRequestOptions = checkSufficientCredits(
|
|
132
|
+
payload
|
|
133
|
+
);
|
|
134
|
+
const getUrl = (context) => {
|
|
135
|
+
const { url } = getRequestOptions(context);
|
|
136
|
+
return url;
|
|
137
|
+
};
|
|
138
|
+
return {
|
|
139
|
+
getUrl,
|
|
140
|
+
httpMethod: "POST",
|
|
141
|
+
path: "/v1/credit/is-eligible",
|
|
142
|
+
pathParams: {},
|
|
143
|
+
__requestType: null,
|
|
144
|
+
__originalRequestType: null,
|
|
145
|
+
__responseType: null,
|
|
146
|
+
__originalResponseType: null
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
150
|
+
0 && (module.exports = {
|
|
151
|
+
checkSufficientCredits,
|
|
152
|
+
getCreditData
|
|
153
|
+
});
|
|
154
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../meta.ts","../src/multilingual-machine-v1-credit-data-translation-credits.http.ts","../src/multilingual-machine-v1-credit-data-translation-credits.meta.ts"],"sourcesContent":["export * from './src/multilingual-machine-v1-credit-data-translation-credits.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixMultilingualMachineV1TranslationCreditsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'editor._base_domain_': [\n {\n srcPath: '/_api/translation-credits/v1',\n destPath: '/v1',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/translation-credits/v1',\n destPath: '/v1',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/translation-credits/v1',\n destPath: '/v1',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/translation-credits/v1',\n destPath: '/v1',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/translation-credits/v1',\n destPath: '/v1',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/translation-credits/v1',\n destPath: '/v1',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_multilingual_translation-credits';\n\n/**\n * Retrieves a site's word credit data.\n *\n * For sites with a limited quota, you can calculate the available word credits by subtracting the credits used from the quota.\n * For example, if a site has a quota of 100 credits and all credits have been used (`\"creditsUsed\": 100`), the available word credits will be 0.\n * If a Wix user purchases an additional 50 credits, the `quota` will increase to `150`, and the site will have 50 available word credits.\n */\nexport function getCreditData(payload: object): RequestOptionsFactory<any> {\n function __getCreditData({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.multilingual.machine.v1.credit_data',\n method: 'GET' as any,\n methodFqn: 'wix.multilingual.machine.v1.TranslationCredits.GetCreditData',\n packageName: PACKAGE_NAME,\n url: resolveWixMultilingualMachineV1TranslationCreditsUrl({\n protoPath: '/v1/credit',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getCreditData;\n}\n\n/** Checks whether a site has enough credits to translate the specified number of words. */\nexport function checkSufficientCredits(\n payload: object\n): RequestOptionsFactory<any> {\n function __checkSufficientCredits({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.multilingual.machine.v1.credit_data',\n method: 'POST' as any,\n methodFqn:\n 'wix.multilingual.machine.v1.TranslationCredits.CheckSufficientCredits',\n packageName: PACKAGE_NAME,\n url: resolveWixMultilingualMachineV1TranslationCreditsUrl({\n protoPath: '/v1/credit/is-eligible',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __checkSufficientCredits;\n}\n","import * as ambassadorWixMultilingualMachineV1CreditData from './multilingual-machine-v1-credit-data-translation-credits.http.js';\nimport * as ambassadorWixMultilingualMachineV1CreditDataTypes from './multilingual-machine-v1-credit-data-translation-credits.types.js';\nimport * as ambassadorWixMultilingualMachineV1CreditDataUniversalTypes from './multilingual-machine-v1-credit-data-translation-credits.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCreditData(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixMultilingualMachineV1CreditDataUniversalTypes.GetCreditDataRequest,\n ambassadorWixMultilingualMachineV1CreditDataTypes.GetCreditDataRequest,\n ambassadorWixMultilingualMachineV1CreditDataUniversalTypes.GetCreditDataResponse,\n ambassadorWixMultilingualMachineV1CreditDataTypes.GetCreditDataResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixMultilingualMachineV1CreditData.getCreditData(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/credit',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function checkSufficientCredits(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixMultilingualMachineV1CreditDataUniversalTypes.CheckSufficientCreditsRequest,\n ambassadorWixMultilingualMachineV1CreditDataTypes.CheckSufficientCreditsRequest,\n ambassadorWixMultilingualMachineV1CreditDataUniversalTypes.CheckSufficientCreditsResponse,\n ambassadorWixMultilingualMachineV1CreditDataTypes.CheckSufficientCreditsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixMultilingualMachineV1CreditData.checkSufficientCredits(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/credit/is-eligible',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gCAAAA;AAAA,EAAA,qBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,qDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,cAAc,SAA6C;AACzE,WAAS,gBAAgB,EAAE,KAAK,GAAQ;AACtC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,qDAAqD;AAAA,QACxD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,IACnC;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAGO,SAAS,uBACd,SAC4B;AAC5B,WAAS,yBAAyB,EAAE,KAAK,GAAQ;AAC/C,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,qDAAqD;AAAA,QACxD,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,IACR;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACjFO,SAASC,iBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACyC,cAAc,OAAO;AAEpE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,0BAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACyC;AAAA,IAC3C;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["checkSufficientCredits","getCreditData","import_rest_modules","getCreditData","checkSufficientCredits"]}
|