@wix/auto_sdk_app-management_custom-charges 1.0.11 → 1.0.13
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/cjs/index.d.ts +427 -2
- package/build/cjs/index.js +147 -16
- package/build/cjs/index.js.map +1 -1
- package/build/{cjs/src/service-plugins-types.d.ts → es/index.d.mts} +105 -21
- package/build/es/index.mjs +122 -0
- package/build/es/index.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +427 -2
- package/build/internal/cjs/index.js +147 -16
- package/build/internal/cjs/index.js.map +1 -1
- package/build/{es/src/service-plugins-types.d.ts → internal/es/index.d.mts} +105 -21
- package/build/internal/es/index.mjs +122 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/package.json +9 -8
- package/build/cjs/index.typings.d.ts +0 -59
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
- package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -9
- package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
- package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
- package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -88
- package/build/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
- package/build/cjs/src/service-plugins-types.js +0 -30
- package/build/cjs/src/service-plugins-types.js.map +0 -1
- package/build/es/index.d.ts +0 -2
- package/build/es/index.js +0 -3
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -59
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
- package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -6
- package/build/es/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
- package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
- package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -85
- package/build/es/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
- package/build/es/src/service-plugins-types.js +0 -27
- package/build/es/src/service-plugins-types.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -59
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
- package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -9
- package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
- package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
- package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -88
- package/build/internal/cjs/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
- package/build/internal/cjs/src/service-plugins-types.d.ts +0 -343
- package/build/internal/cjs/src/service-plugins-types.js +0 -30
- package/build/internal/cjs/src/service-plugins-types.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -2
- package/build/internal/es/index.js +0 -3
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -59
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.d.ts +0 -5
- package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.js +0 -6
- package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.context.js.map +0 -1
- package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.d.ts +0 -79
- package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.js +0 -85
- package/build/internal/es/src/interfaces-premium-v1-custom-charges-provider.public.js.map +0 -1
- package/build/internal/es/src/service-plugins-types.d.ts +0 -343
- package/build/internal/es/src/service-plugins-types.js +0 -27
- package/build/internal/es/src/service-plugins-types.js.map +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
|
|
3
|
-
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
|
|
4
|
-
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
|
|
5
|
-
export const provideHandlers = ServicePluginDefinition('PREMIUM_CUSTOM_CHARGES', [
|
|
6
|
-
{
|
|
7
|
-
name: 'getChargeLimit',
|
|
8
|
-
primaryHttpMappingPath: '/v1/charge-limit',
|
|
9
|
-
transformations: {
|
|
10
|
-
toREST: (payload) => {
|
|
11
|
-
const toRestResponse = payload;
|
|
12
|
-
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
13
|
-
},
|
|
14
|
-
fromREST: (payload) => {
|
|
15
|
-
const fromRestRequest = payload;
|
|
16
|
-
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'listCharges',
|
|
22
|
-
primaryHttpMappingPath: '/v1/charges',
|
|
23
|
-
transformations: {
|
|
24
|
-
toREST: (payload) => {
|
|
25
|
-
const toRestResponse = payload;
|
|
26
|
-
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
27
|
-
},
|
|
28
|
-
fromREST: (payload) => {
|
|
29
|
-
const fromRestRequest = transformPaths(payload, [
|
|
30
|
-
{
|
|
31
|
-
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
32
|
-
paths: [
|
|
33
|
-
{ path: 'request.periodStart' },
|
|
34
|
-
{ path: 'request.periodEnd' },
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
]);
|
|
38
|
-
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
name: 'chargesRejectedEvent',
|
|
44
|
-
primaryHttpMappingPath: '/v1/charges-rejected',
|
|
45
|
-
transformations: {
|
|
46
|
-
toREST: (payload) => {
|
|
47
|
-
const toRestResponse = payload;
|
|
48
|
-
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
49
|
-
},
|
|
50
|
-
fromREST: (payload) => {
|
|
51
|
-
const fromRestRequest = payload;
|
|
52
|
-
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'invoiceCreatedEvent',
|
|
58
|
-
primaryHttpMappingPath: '/v1/invoice-created',
|
|
59
|
-
transformations: {
|
|
60
|
-
toREST: (payload) => {
|
|
61
|
-
const toRestResponse = payload;
|
|
62
|
-
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
63
|
-
},
|
|
64
|
-
fromREST: (payload) => {
|
|
65
|
-
const fromRestRequest = payload;
|
|
66
|
-
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'chargeLimitUpdatedEvent',
|
|
72
|
-
primaryHttpMappingPath: '/v1/limit-updated',
|
|
73
|
-
transformations: {
|
|
74
|
-
toREST: (payload) => {
|
|
75
|
-
const toRestResponse = payload;
|
|
76
|
-
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
77
|
-
},
|
|
78
|
-
fromREST: (payload) => {
|
|
79
|
-
const fromRestRequest = payload;
|
|
80
|
-
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
]);
|
|
85
|
-
//# sourceMappingURL=interfaces-premium-v1-custom-charges-provider.public.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces-premium-v1-custom-charges-provider.public.js","sourceRoot":"","sources":["../../../../src/interfaces-premium-v1-custom-charges-provider.public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAczD,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AA2BjD,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAsEnD,wBAAwB,EAAE;IAC3B;QACE,IAAI,EAAE,gBAAgB;QACtB,sBAAsB,EAAE,kBAAkB;QAC1C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,aAAa;QACnB,sBAAsB,EAAE,aAAa;QACrC,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,EAAE;oBAC9C;wBACE,WAAW,EAAE,oCAAoC;wBACjD,KAAK,EAAE;4BACL,EAAE,IAAI,EAAE,qBAAqB,EAAE;4BAC/B,EAAE,IAAI,EAAE,mBAAmB,EAAE;yBAC9B;qBACF;iBACF,CAAC,CAAC;gBAEH,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,sBAAsB;QAC5B,sBAAsB,EAAE,sBAAsB;QAC9C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,qBAAqB;QAC3B,sBAAsB,EAAE,qBAAqB;QAC7C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;IAED;QACE,IAAI,EAAE,yBAAyB;QAC/B,sBAAsB,EAAE,mBAAmB;QAC3C,eAAe,EAAE;YACf,MAAM,EAAE,CAAC,OAAY,EAAE,EAAE;gBACvB,MAAM,cAAc,GAAG,OAAO,CAAC;gBAE/B,OAAO,qCAAqC,CAAC,cAAc,CAAC,CAAC;YAC/D,CAAC;YACD,QAAQ,EAAE,CAAC,OAAY,EAAE,EAAE;gBACzB,MAAM,eAAe,GAAG,OAAO,CAAC;gBAEhC,OAAO,uCAAuC,CAAC,eAAe,CAAC,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
export interface GetChargeLimitRequest {
|
|
2
|
-
/**
|
|
3
|
-
* ID of the subscription for which Wix retrieves the charge limit. Equals
|
|
4
|
-
* `null` in case Wix hasn't created the subscription when retrieving an
|
|
5
|
-
* initial charge limit. To track usage and billing for apps, we recommend to
|
|
6
|
-
* use `instanceId` instead of the `subscriptionId`.
|
|
7
|
-
* @format GUID
|
|
8
|
-
*/
|
|
9
|
-
subscriptionId?: string | null;
|
|
10
|
-
/**
|
|
11
|
-
* Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.
|
|
12
|
-
*
|
|
13
|
-
* 3-letter currency code in
|
|
14
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
|
|
15
|
-
* format of the charge limit. Wix may add supported currencies in the future.
|
|
16
|
-
* @format CURRENCY
|
|
17
|
-
*/
|
|
18
|
-
currency?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface GetChargeLimitResponse {
|
|
21
|
-
/**
|
|
22
|
-
* Retrieved charge limit for the app instance. You can't update the
|
|
23
|
-
* charge limit after you've set an initial value. Site owners can increase the
|
|
24
|
-
* limit in their site's dashboard, currently they aren't allowed to decrease it.
|
|
25
|
-
* @format DECIMAL_VALUE
|
|
26
|
-
* @decimalValue options { gt:0.00 }
|
|
27
|
-
*/
|
|
28
|
-
chargeLimit?: string | null;
|
|
29
|
-
}
|
|
30
|
-
export interface ListChargesRequest {
|
|
31
|
-
/**
|
|
32
|
-
* ID of the subscription for which Wix retrieves your custom charges.
|
|
33
|
-
* To track usage and billing for apps, we recommend to use `instanceId` instead
|
|
34
|
-
* of the `subscriptionId`.
|
|
35
|
-
* @format GUID
|
|
36
|
-
*/
|
|
37
|
-
subscriptionId?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.
|
|
40
|
-
*
|
|
41
|
-
* 3-letter currency code in
|
|
42
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
|
|
43
|
-
* format of your charges to return. Wix may add supported currencies in the future.
|
|
44
|
-
* @format CURRENCY
|
|
45
|
-
*/
|
|
46
|
-
currency?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Begin of the period Wix retrieves the app instance's charges for in
|
|
49
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
50
|
-
*/
|
|
51
|
-
periodStart?: Date | null;
|
|
52
|
-
/**
|
|
53
|
-
* End of the period Wix retrieves the app instance's charges for in
|
|
54
|
-
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
55
|
-
*/
|
|
56
|
-
periodEnd?: Date | null;
|
|
57
|
-
/** Information about what Wix intends to do with the retrieved charges. */
|
|
58
|
-
intent?: Intent;
|
|
59
|
-
}
|
|
60
|
-
export declare enum Intent {
|
|
61
|
-
/** Inform the customer about how much your app would charge them at the moment. Wix doesn't create an invoice. */
|
|
62
|
-
DISPLAY_ONLY = "DISPLAY_ONLY",
|
|
63
|
-
/** Create an invoice for the customer. */
|
|
64
|
-
CREATE_INVOICE = "CREATE_INVOICE"
|
|
65
|
-
}
|
|
66
|
-
export interface ListChargesResponse {
|
|
67
|
-
/**
|
|
68
|
-
* Retrieved charges.
|
|
69
|
-
*
|
|
70
|
-
* Max: 5 charges
|
|
71
|
-
* @maxSize 5
|
|
72
|
-
*/
|
|
73
|
-
charges?: ChargeLineItem[];
|
|
74
|
-
}
|
|
75
|
-
export interface ChargeLineItem {
|
|
76
|
-
/**
|
|
77
|
-
* ID of the charge. Make sure to save the charge ID on your servers for future
|
|
78
|
-
* reference. Identical to `lineItem.chargeId` in the Invoice Created Event.
|
|
79
|
-
*
|
|
80
|
-
* Max: 64 characters
|
|
81
|
-
* @maxLength 64
|
|
82
|
-
*/
|
|
83
|
-
_id?: string | null;
|
|
84
|
-
/** Charge description. */
|
|
85
|
-
description?: string;
|
|
86
|
-
/**
|
|
87
|
-
* Charge amount in the currency that's specified in the request. Use a whole number
|
|
88
|
-
* or separate major and minor units with a dot. For example, `10` or `1.99`. If
|
|
89
|
-
* you return an amount with more minor units than supported according to
|
|
90
|
-
* [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes),
|
|
91
|
-
* Wix truncates the additional minor units.
|
|
92
|
-
*
|
|
93
|
-
* Min: `0.50`
|
|
94
|
-
* @format DECIMAL_VALUE
|
|
95
|
-
*/
|
|
96
|
-
amount?: string;
|
|
97
|
-
}
|
|
98
|
-
export interface ChargesRejectedRequest {
|
|
99
|
-
/**
|
|
100
|
-
* ID of the subscription for which Wix hasn't accepted your custom charges.
|
|
101
|
-
* To track usage and billing for apps, we recommend to use `instanceId` instead
|
|
102
|
-
* of the `subscriptionId`.
|
|
103
|
-
* @format GUID
|
|
104
|
-
*/
|
|
105
|
-
subscriptionId?: string;
|
|
106
|
-
/**
|
|
107
|
-
* Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.
|
|
108
|
-
*
|
|
109
|
-
* 3-letter currency code in
|
|
110
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
|
|
111
|
-
* format of the charges. Wix may add supported currencies in the future.
|
|
112
|
-
* @format CURRENCY
|
|
113
|
-
*/
|
|
114
|
-
currency?: string;
|
|
115
|
-
/**
|
|
116
|
-
* IDs of the rejected charges.
|
|
117
|
-
*
|
|
118
|
-
* Max: 5 charges
|
|
119
|
-
* @maxSize 5
|
|
120
|
-
*/
|
|
121
|
-
chargeIds?: string[] | null;
|
|
122
|
-
/**
|
|
123
|
-
* Maximum amount that your app may charge the customer per billing cycle.
|
|
124
|
-
*
|
|
125
|
-
* Min: `0.50`
|
|
126
|
-
* @format DECIMAL_VALUE
|
|
127
|
-
* @decimalValue options { gt:0.00 }
|
|
128
|
-
*/
|
|
129
|
-
chargeLimit?: string | null;
|
|
130
|
-
/**
|
|
131
|
-
* Information about why Wix has rejected your app's charges.
|
|
132
|
-
*
|
|
133
|
-
* Max: 20 reasons
|
|
134
|
-
* @maxSize 20
|
|
135
|
-
*/
|
|
136
|
-
reasons?: ChargesRejectedReason[];
|
|
137
|
-
}
|
|
138
|
-
export declare enum ChargesRejectedReason {
|
|
139
|
-
/** There is no information about why Wix has rejected the charges. */
|
|
140
|
-
UNKNOWN = "UNKNOWN",
|
|
141
|
-
/** The sum of the charges is higher than the limit that you may charge the customer per billing cycle. */
|
|
142
|
-
CHARGE_LIMIT_EXCEEDED = "CHARGE_LIMIT_EXCEEDED",
|
|
143
|
-
/** You can't provide more than 5 charges per invoice. */
|
|
144
|
-
TOO_MANY_CHARGES = "TOO_MANY_CHARGES",
|
|
145
|
-
/** You must submit charges as whole numbers or use a dot to separate major and minor units. For example, `10` or `1.50`. Currently, Wix doesn't validate whether the submitted number of decimals for the minor unit is supported for the given currency. */
|
|
146
|
-
INVALID_FORMAT = "INVALID_FORMAT"
|
|
147
|
-
}
|
|
148
|
-
export interface ChargesRejectedResponse {
|
|
149
|
-
}
|
|
150
|
-
export interface InvoiceCreatedRequest {
|
|
151
|
-
/**
|
|
152
|
-
* ID of the subscription for which Wix has created an invoice that includes
|
|
153
|
-
* your custom charges. To track usage and billing for apps, we recommend to use
|
|
154
|
-
* `instanceId` instead of the `subscriptionId`.
|
|
155
|
-
* @format GUID
|
|
156
|
-
*/
|
|
157
|
-
subscriptionId?: string;
|
|
158
|
-
/**
|
|
159
|
-
* Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.
|
|
160
|
-
*
|
|
161
|
-
* 3-letter currency code in
|
|
162
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
|
|
163
|
-
* format of the charges. Wix may add supported currencies in the future.
|
|
164
|
-
* @format CURRENCY
|
|
165
|
-
*/
|
|
166
|
-
currency?: string;
|
|
167
|
-
/** ID of the created invoice. */
|
|
168
|
-
invoiceId?: string;
|
|
169
|
-
/**
|
|
170
|
-
* Line items included in the invoice.
|
|
171
|
-
* @maxSize 5
|
|
172
|
-
*/
|
|
173
|
-
lineItems?: InvoiceLineItem[];
|
|
174
|
-
}
|
|
175
|
-
export interface InvoiceLineItem {
|
|
176
|
-
/**
|
|
177
|
-
* ID of the charge as returned in List Charges.
|
|
178
|
-
*
|
|
179
|
-
* Max: 64 characters
|
|
180
|
-
* @maxLength 64
|
|
181
|
-
*/
|
|
182
|
-
chargeId?: string | null;
|
|
183
|
-
/**
|
|
184
|
-
* Charge amount.
|
|
185
|
-
* @format DECIMAL_VALUE
|
|
186
|
-
*/
|
|
187
|
-
amount?: string;
|
|
188
|
-
/**
|
|
189
|
-
* ID of the line item in the invoice that Wix sends to the customer.
|
|
190
|
-
* @format GUID
|
|
191
|
-
*/
|
|
192
|
-
_id?: string;
|
|
193
|
-
}
|
|
194
|
-
export interface InvoiceCreatedResponse {
|
|
195
|
-
}
|
|
196
|
-
export interface ChargeLimitUpdatedRequest {
|
|
197
|
-
/**
|
|
198
|
-
* ID of the subscription for which the charge limit has been updated.
|
|
199
|
-
* To track usage and billing for apps, we recommend to use `instanceId` instead
|
|
200
|
-
* of the `subscriptionId`.
|
|
201
|
-
* @format GUID
|
|
202
|
-
*/
|
|
203
|
-
subscriptionId?: string;
|
|
204
|
-
/**
|
|
205
|
-
* Supported values: `AUD`, `BRL`, `CAD`, `EUR`, `GBP`, `ILS`, `INR`, `JPY`, `MXN`, `PLN`, `RUB`, `TRY`, `USD`.
|
|
206
|
-
*
|
|
207
|
-
* 3-letter currency code in
|
|
208
|
-
* [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
|
|
209
|
-
* format of the charges. Wix may add supported currencies in the future.
|
|
210
|
-
* @format CURRENCY
|
|
211
|
-
*/
|
|
212
|
-
currency?: string;
|
|
213
|
-
/**
|
|
214
|
-
* Updated charge limit.
|
|
215
|
-
* @format DECIMAL_VALUE
|
|
216
|
-
*/
|
|
217
|
-
chargeLimit?: string | null;
|
|
218
|
-
}
|
|
219
|
-
export interface ChargeLimitUpdatedResponse {
|
|
220
|
-
}
|
|
221
|
-
export interface CustomChargesConfig {
|
|
222
|
-
/**
|
|
223
|
-
* Base part of your integration's deployment URI for the Custom Charges SPI.
|
|
224
|
-
* For example `"https://provider.example.com"`, if Wix should call your
|
|
225
|
-
* integration at `https://provider.example.com/v1/charge-limit` for the
|
|
226
|
-
* Get Charge Limit method.
|
|
227
|
-
*/
|
|
228
|
-
baseUri?: SpiBaseUri;
|
|
229
|
-
}
|
|
230
|
-
export interface SpiBaseUri {
|
|
231
|
-
/**
|
|
232
|
-
* Base URI where the methods are called. Wix appends the path to the `baseUri`.
|
|
233
|
-
* For example, to call the Get Shipping Rates method at `https://my-shipping-provider.com/v1/getRates`, the base URI you provide here is `https://my-shipping-provider.com/`.
|
|
234
|
-
* @minLength 6
|
|
235
|
-
* @maxLength 2048
|
|
236
|
-
*/
|
|
237
|
-
baseUri?: string;
|
|
238
|
-
/** Alternate, custom URIs to replace the default URIs for specific service plugin methods. */
|
|
239
|
-
alternativeUris?: AlternativeUri[];
|
|
240
|
-
}
|
|
241
|
-
export interface AlternativeUri {
|
|
242
|
-
/**
|
|
243
|
-
* Name of the method to create a custom URI for.
|
|
244
|
-
*
|
|
245
|
-
* For `methodName`, use the name of the method in PascalCase.
|
|
246
|
-
* For example, for Get Shipping Rates use `GetShippingRates`.
|
|
247
|
-
* @minLength 3
|
|
248
|
-
* @maxLength 128
|
|
249
|
-
*/
|
|
250
|
-
methodName?: string;
|
|
251
|
-
/**
|
|
252
|
-
* Custom URI that Wix uses to call your server for this method. The path-suffix documented in the method will not be appended to this URI.
|
|
253
|
-
* Must be a secured endpoint beginning with `https://`. For example, `https://www.my-shipping-provider.com/my-shipping-rates`.
|
|
254
|
-
* @minLength 6
|
|
255
|
-
* @maxLength 2048
|
|
256
|
-
*/
|
|
257
|
-
absoluteUri?: string;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* this message is not directly used by any service,
|
|
261
|
-
* it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
|
|
262
|
-
* e.g. SPIs, event-handlers, etc..
|
|
263
|
-
* NOTE: this context object MUST be provided as the last argument in each Velo method signature.
|
|
264
|
-
*
|
|
265
|
-
* Example:
|
|
266
|
-
* ```typescript
|
|
267
|
-
* export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
|
|
268
|
-
* ...
|
|
269
|
-
* }
|
|
270
|
-
* ```
|
|
271
|
-
*/
|
|
272
|
-
export interface Context {
|
|
273
|
-
/** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */
|
|
274
|
-
requestId?: string | null;
|
|
275
|
-
/**
|
|
276
|
-
* [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.
|
|
277
|
-
* @format CURRENCY
|
|
278
|
-
*/
|
|
279
|
-
currency?: string | null;
|
|
280
|
-
/** An object that describes the identity that triggered this request. */
|
|
281
|
-
identity?: IdentificationData;
|
|
282
|
-
/** A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. */
|
|
283
|
-
languages?: string[];
|
|
284
|
-
/**
|
|
285
|
-
* The service provider app's instance ID.
|
|
286
|
-
* @format GUID
|
|
287
|
-
*/
|
|
288
|
-
instanceId?: string | null;
|
|
289
|
-
}
|
|
290
|
-
export declare enum IdentityType {
|
|
291
|
-
UNKNOWN = "UNKNOWN",
|
|
292
|
-
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
293
|
-
MEMBER = "MEMBER",
|
|
294
|
-
WIX_USER = "WIX_USER",
|
|
295
|
-
APP = "APP"
|
|
296
|
-
}
|
|
297
|
-
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
298
|
-
/**
|
|
299
|
-
* ID of a site visitor that has not logged in to the site.
|
|
300
|
-
* @format GUID
|
|
301
|
-
*/
|
|
302
|
-
anonymousVisitorId?: string;
|
|
303
|
-
/**
|
|
304
|
-
* ID of a site visitor that has logged in to the site.
|
|
305
|
-
* @format GUID
|
|
306
|
-
*/
|
|
307
|
-
memberId?: string;
|
|
308
|
-
/**
|
|
309
|
-
* ID of a Wix user (site owner, contributor, etc.).
|
|
310
|
-
* @format GUID
|
|
311
|
-
*/
|
|
312
|
-
wixUserId?: string;
|
|
313
|
-
/**
|
|
314
|
-
* ID of an app.
|
|
315
|
-
* @format GUID
|
|
316
|
-
*/
|
|
317
|
-
appId?: string;
|
|
318
|
-
/** @readonly */
|
|
319
|
-
identityType?: IdentityType;
|
|
320
|
-
}
|
|
321
|
-
/** @oneof */
|
|
322
|
-
export interface IdentificationDataIdOneOf {
|
|
323
|
-
/**
|
|
324
|
-
* ID of a site visitor that has not logged in to the site.
|
|
325
|
-
* @format GUID
|
|
326
|
-
*/
|
|
327
|
-
anonymousVisitorId?: string;
|
|
328
|
-
/**
|
|
329
|
-
* ID of a site visitor that has logged in to the site.
|
|
330
|
-
* @format GUID
|
|
331
|
-
*/
|
|
332
|
-
memberId?: string;
|
|
333
|
-
/**
|
|
334
|
-
* ID of a Wix user (site owner, contributor, etc.).
|
|
335
|
-
* @format GUID
|
|
336
|
-
*/
|
|
337
|
-
wixUserId?: string;
|
|
338
|
-
/**
|
|
339
|
-
* ID of an app.
|
|
340
|
-
* @format GUID
|
|
341
|
-
*/
|
|
342
|
-
appId?: string;
|
|
343
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export var Intent;
|
|
2
|
-
(function (Intent) {
|
|
3
|
-
/** Inform the customer about how much your app would charge them at the moment. Wix doesn't create an invoice. */
|
|
4
|
-
Intent["DISPLAY_ONLY"] = "DISPLAY_ONLY";
|
|
5
|
-
/** Create an invoice for the customer. */
|
|
6
|
-
Intent["CREATE_INVOICE"] = "CREATE_INVOICE";
|
|
7
|
-
})(Intent || (Intent = {}));
|
|
8
|
-
export var ChargesRejectedReason;
|
|
9
|
-
(function (ChargesRejectedReason) {
|
|
10
|
-
/** There is no information about why Wix has rejected the charges. */
|
|
11
|
-
ChargesRejectedReason["UNKNOWN"] = "UNKNOWN";
|
|
12
|
-
/** The sum of the charges is higher than the limit that you may charge the customer per billing cycle. */
|
|
13
|
-
ChargesRejectedReason["CHARGE_LIMIT_EXCEEDED"] = "CHARGE_LIMIT_EXCEEDED";
|
|
14
|
-
/** You can't provide more than 5 charges per invoice. */
|
|
15
|
-
ChargesRejectedReason["TOO_MANY_CHARGES"] = "TOO_MANY_CHARGES";
|
|
16
|
-
/** You must submit charges as whole numbers or use a dot to separate major and minor units. For example, `10` or `1.50`. Currently, Wix doesn't validate whether the submitted number of decimals for the minor unit is supported for the given currency. */
|
|
17
|
-
ChargesRejectedReason["INVALID_FORMAT"] = "INVALID_FORMAT";
|
|
18
|
-
})(ChargesRejectedReason || (ChargesRejectedReason = {}));
|
|
19
|
-
export var IdentityType;
|
|
20
|
-
(function (IdentityType) {
|
|
21
|
-
IdentityType["UNKNOWN"] = "UNKNOWN";
|
|
22
|
-
IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
23
|
-
IdentityType["MEMBER"] = "MEMBER";
|
|
24
|
-
IdentityType["WIX_USER"] = "WIX_USER";
|
|
25
|
-
IdentityType["APP"] = "APP";
|
|
26
|
-
})(IdentityType || (IdentityType = {}));
|
|
27
|
-
//# sourceMappingURL=service-plugins-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-plugins-types.js","sourceRoot":"","sources":["../../../../src/service-plugins-types.ts"],"names":[],"mappings":"AA8DA,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,kHAAkH;IAClH,uCAA6B,CAAA;IAC7B,0CAA0C;IAC1C,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AA6ED,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,sEAAsE;IACtE,4CAAmB,CAAA;IACnB,0GAA0G;IAC1G,wEAA+C,CAAA;IAC/C,yDAAyD;IACzD,8DAAqC,CAAA;IACrC,6PAA6P;IAC7P,0DAAiC,CAAA;AACnC,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAuJD,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uDAAuC,CAAA;IACvC,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB"}
|