@wix/auto_sdk_app-management_external-billing 1.0.9 → 1.0.10
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 +17 -0
- package/build/index.d.ts +17 -0
- package/build/index.js +188 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +163 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/index.d.mts +17 -0
- package/build/internal/index.d.ts +17 -0
- package/build/internal/index.js +188 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +163 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/{cjs/src/market-aim-v1-external-billing-event-external-billing.types.d.ts → market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.d.mts} +19 -8
- package/build/{es/src/market-aim-v1-external-billing-event-external-billing.types.d.ts → internal/market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.d.ts} +19 -8
- package/build/internal/meta.d.mts +76 -0
- package/build/internal/meta.d.ts +76 -0
- package/build/internal/meta.js +156 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +129 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/{cjs/src/market-aim-v1-external-billing-event-external-billing.types.d.ts → market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.d.mts} +19 -8
- package/build/{internal/es/src/market-aim-v1-external-billing-event-external-billing.types.d.ts → market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.d.ts} +19 -8
- package/build/meta.d.mts +76 -0
- package/build/meta.d.ts +76 -0
- package/build/meta.js +156 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +129 -0
- package/build/meta.mjs.map +1 -0
- package/package.json +12 -11
- 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/market-aim-v1-external-billing-event-external-billing.context.d.ts +0 -5
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.context.js +0 -9
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.context.js.map +0 -1
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.http.d.ts +0 -7
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.http.js +0 -112
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.http.js.map +0 -1
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.meta.d.ts +0 -13
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.meta.js +0 -47
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.meta.js.map +0 -1
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.public.d.ts +0 -15
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.public.js +0 -14
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.public.js.map +0 -1
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.types.js +0 -10
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.types.js.map +0 -1
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.universal.d.ts +0 -88
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.universal.js +0 -77
- package/build/cjs/src/market-aim-v1-external-billing-event-external-billing.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/market-aim-v1-external-billing-event-external-billing.context.d.ts +0 -5
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.context.js +0 -5
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.context.js.map +0 -1
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.http.d.ts +0 -7
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.http.js +0 -108
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.http.js.map +0 -1
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.meta.d.ts +0 -13
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.meta.js +0 -20
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.meta.js.map +0 -1
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.public.d.ts +0 -15
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.public.js +0 -9
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.public.js.map +0 -1
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.types.js +0 -7
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.types.js.map +0 -1
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.universal.d.ts +0 -88
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.universal.js +0 -50
- package/build/es/src/market-aim-v1-external-billing-event-external-billing.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/market-aim-v1-external-billing-event-external-billing.context.d.ts +0 -5
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.context.js +0 -9
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.context.js.map +0 -1
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.http.d.ts +0 -7
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.http.js +0 -112
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.http.js.map +0 -1
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.meta.d.ts +0 -13
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.meta.js +0 -47
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.meta.js.map +0 -1
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.public.d.ts +0 -15
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.public.js +0 -14
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.public.js.map +0 -1
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.types.js +0 -10
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.types.js.map +0 -1
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.universal.d.ts +0 -88
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.universal.js +0 -77
- package/build/internal/cjs/src/market-aim-v1-external-billing-event-external-billing.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/market-aim-v1-external-billing-event-external-billing.context.d.ts +0 -5
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.context.js +0 -5
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.context.js.map +0 -1
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.http.d.ts +0 -7
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.http.js +0 -108
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.http.js.map +0 -1
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.meta.d.ts +0 -13
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.meta.js +0 -20
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.meta.js.map +0 -1
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.public.d.ts +0 -15
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.public.js +0 -9
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.public.js.map +0 -1
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.types.js +0 -7
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.types.js.map +0 -1
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.universal.d.ts +0 -88
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.universal.js +0 -50
- package/build/internal/es/src/market-aim-v1-external-billing-event-external-billing.universal.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { R as ReportExternalBillingEventOptions, a as ReportExternalBillingEventResponse } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.mjs';
|
|
3
|
+
export { B as BillingType, E as ExternalBillingEvent, b as ReportExternalBillingEventRequest } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.mjs';
|
|
4
|
+
|
|
5
|
+
declare function reportExternalBillingEvent$1(httpClient: HttpClient): ReportExternalBillingEventSignature;
|
|
6
|
+
interface ReportExternalBillingEventSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Sends an external billing event to Wix.
|
|
9
|
+
* Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).
|
|
10
|
+
* The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.
|
|
11
|
+
*/
|
|
12
|
+
(options?: ReportExternalBillingEventOptions | undefined): Promise<ReportExternalBillingEventResponse>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const reportExternalBillingEvent: MaybeContext<BuildRESTFunction<typeof reportExternalBillingEvent$1> & typeof reportExternalBillingEvent$1>;
|
|
16
|
+
|
|
17
|
+
export { ReportExternalBillingEventOptions, ReportExternalBillingEventResponse, reportExternalBillingEvent };
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { R as ReportExternalBillingEventOptions, a as ReportExternalBillingEventResponse } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.js';
|
|
3
|
+
export { B as BillingType, E as ExternalBillingEvent, b as ReportExternalBillingEventRequest } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.js';
|
|
4
|
+
|
|
5
|
+
declare function reportExternalBillingEvent$1(httpClient: HttpClient): ReportExternalBillingEventSignature;
|
|
6
|
+
interface ReportExternalBillingEventSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Sends an external billing event to Wix.
|
|
9
|
+
* Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).
|
|
10
|
+
* The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.
|
|
11
|
+
*/
|
|
12
|
+
(options?: ReportExternalBillingEventOptions | undefined): Promise<ReportExternalBillingEventResponse>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const reportExternalBillingEvent: MaybeContext<BuildRESTFunction<typeof reportExternalBillingEvent$1> & typeof reportExternalBillingEvent$1>;
|
|
16
|
+
|
|
17
|
+
export { ReportExternalBillingEventOptions, ReportExternalBillingEventResponse, reportExternalBillingEvent };
|
package/build/index.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
BillingType: () => BillingType,
|
|
24
|
+
reportExternalBillingEvent: () => reportExternalBillingEvent4
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
|
|
28
|
+
// src/market-aim-v1-external-billing-event-external-billing.universal.ts
|
|
29
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
30
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
31
|
+
|
|
32
|
+
// src/market-aim-v1-external-billing-event-external-billing.http.ts
|
|
33
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
34
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
35
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
36
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
37
|
+
function resolveComWixpressMarketAimApiExternalBillingBiServiceUrl(opts) {
|
|
38
|
+
const domainToMappings = {
|
|
39
|
+
"api._api_base_domain_": [
|
|
40
|
+
{
|
|
41
|
+
srcPath: "/app-instance-manager-webapp",
|
|
42
|
+
destPath: ""
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"www.wixapis.com": [
|
|
46
|
+
{
|
|
47
|
+
srcPath: "/apps",
|
|
48
|
+
destPath: ""
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"wixapis.com": [
|
|
52
|
+
{
|
|
53
|
+
srcPath: "/apps",
|
|
54
|
+
destPath: ""
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"dev._base_domain_": [
|
|
58
|
+
{
|
|
59
|
+
srcPath: "/_api/app-instance-manager",
|
|
60
|
+
destPath: ""
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
srcPath: "/api/v1/instance",
|
|
64
|
+
destPath: "/v1/instance"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/api/v1/scripts",
|
|
68
|
+
destPath: "/v1/scripts"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"manage._base_domain_": [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/_api/app-instance-manager",
|
|
74
|
+
destPath: ""
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"www._base_domain_": [
|
|
78
|
+
{
|
|
79
|
+
srcPath: "/_api/app-instance-manager",
|
|
80
|
+
destPath: ""
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"editor._base_domain_": [
|
|
84
|
+
{
|
|
85
|
+
srcPath: "/_api/app-instance-manager",
|
|
86
|
+
destPath: ""
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"blocks._base_domain_": [
|
|
90
|
+
{
|
|
91
|
+
srcPath: "/_api/app-instance-manager",
|
|
92
|
+
destPath: ""
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"create.editorx": [
|
|
96
|
+
{
|
|
97
|
+
srcPath: "/_api/app-instance-manager",
|
|
98
|
+
destPath: ""
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
};
|
|
102
|
+
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
103
|
+
}
|
|
104
|
+
var PACKAGE_NAME = "@wix/auto_sdk_app-management_external-billing";
|
|
105
|
+
function reportExternalBillingEvent(payload) {
|
|
106
|
+
function __reportExternalBillingEvent({ host }) {
|
|
107
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
108
|
+
{
|
|
109
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
110
|
+
paths: [{ path: "event.createdDate" }]
|
|
111
|
+
}
|
|
112
|
+
]);
|
|
113
|
+
const metadata = {
|
|
114
|
+
entityFqdn: "wix.market.aim.v1.external_billing_event",
|
|
115
|
+
method: "POST",
|
|
116
|
+
methodFqn: "com.wixpress.market.aim.api.ExternalBillingBIService.ReportExternalBillingEvent",
|
|
117
|
+
packageName: PACKAGE_NAME,
|
|
118
|
+
url: resolveComWixpressMarketAimApiExternalBillingBiServiceUrl({
|
|
119
|
+
protoPath: "/v1/billing-event",
|
|
120
|
+
data: serializedData,
|
|
121
|
+
host
|
|
122
|
+
}),
|
|
123
|
+
data: serializedData,
|
|
124
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
125
|
+
{
|
|
126
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
127
|
+
paths: [{ path: "event.createdDate" }]
|
|
128
|
+
}
|
|
129
|
+
])
|
|
130
|
+
};
|
|
131
|
+
return metadata;
|
|
132
|
+
}
|
|
133
|
+
return __reportExternalBillingEvent;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/market-aim-v1-external-billing-event-external-billing.universal.ts
|
|
137
|
+
var BillingType = /* @__PURE__ */ ((BillingType2) => {
|
|
138
|
+
BillingType2["UNKNOWN"] = "UNKNOWN";
|
|
139
|
+
BillingType2["CHARGE"] = "CHARGE";
|
|
140
|
+
BillingType2["REFUND"] = "REFUND";
|
|
141
|
+
return BillingType2;
|
|
142
|
+
})(BillingType || {});
|
|
143
|
+
async function reportExternalBillingEvent2(options) {
|
|
144
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
145
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
146
|
+
event: options?.event
|
|
147
|
+
});
|
|
148
|
+
const reqOpts = reportExternalBillingEvent(
|
|
149
|
+
payload
|
|
150
|
+
);
|
|
151
|
+
sideEffects?.onSiteCall?.();
|
|
152
|
+
try {
|
|
153
|
+
const result = await httpClient.request(reqOpts);
|
|
154
|
+
sideEffects?.onSuccess?.(result);
|
|
155
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
156
|
+
} catch (err) {
|
|
157
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
158
|
+
err,
|
|
159
|
+
{
|
|
160
|
+
spreadPathsToArguments: {},
|
|
161
|
+
explicitPathsToArguments: { event: "$[0].event" },
|
|
162
|
+
singleArgumentUnchanged: false
|
|
163
|
+
},
|
|
164
|
+
["options"]
|
|
165
|
+
);
|
|
166
|
+
sideEffects?.onError?.(err);
|
|
167
|
+
throw transformedError;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// src/market-aim-v1-external-billing-event-external-billing.public.ts
|
|
172
|
+
function reportExternalBillingEvent3(httpClient) {
|
|
173
|
+
return (options) => reportExternalBillingEvent2(
|
|
174
|
+
options,
|
|
175
|
+
// @ts-ignore
|
|
176
|
+
{ httpClient }
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// src/market-aim-v1-external-billing-event-external-billing.context.ts
|
|
181
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
182
|
+
var reportExternalBillingEvent4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(reportExternalBillingEvent3);
|
|
183
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
184
|
+
0 && (module.exports = {
|
|
185
|
+
BillingType,
|
|
186
|
+
reportExternalBillingEvent
|
|
187
|
+
});
|
|
188
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../index.ts","../src/market-aim-v1-external-billing-event-external-billing.universal.ts","../src/market-aim-v1-external-billing-event-external-billing.http.ts","../src/market-aim-v1-external-billing-event-external-billing.public.ts","../src/market-aim-v1-external-billing-event-external-billing.context.ts"],"sourcesContent":["export * from './src/market-aim-v1-external-billing-event-external-billing.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixMarketAimV1ExternalBillingEvent from './market-aim-v1-external-billing-event-external-billing.http.js';\n\nexport interface ExternalBillingEvent {\n /**\n * The app ID linked to this transaction. This field is only relevant if using an API key for authorization,\n * in which case you're required to pass the app ID.\n * @format GUID\n */\n appId?: string | null;\n /**\n * The app instance ID linked to this transaction. This field is only relevant if using an API key for authorization,\n * in which case you can optionally pass the instance ID.\n *\n * This connects the transaction to a specific instance of your app installed on a Wix site.\n * Learn more [about app instances](https://dev.wix.com/docs/build-apps/develop-your-app/access/app-instances/about-app-instances).\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * The total amount of the transaction in USD, not including tax.\n * This value can be negative, such as for adjustments or refunds.\n * @format DECIMAL_VALUE\n * @decimalValue options { maxScale:10 }\n */\n grossRevenue?: string;\n /**\n * The amount charged minus agreed-upon expenses, such as shipping fees.\n * This value can be negative.\n * @format DECIMAL_VALUE\n * @decimalValue options { maxScale:10 }\n */\n netRevenue?: string | null;\n /**\n * Wix's share of the transaction in USD.\n * This value can be negative, such as for adjustments or refunds.\n * @format DECIMAL_VALUE\n * @decimalValue options { maxScale:10 }\n */\n wixShare?: string;\n /** The date and time of the transaction. */\n _createdDate?: Date | null;\n /** The type of billing event, either charge or refund. */\n billingType?: BillingTypeWithLiterals;\n}\n\nexport enum BillingType {\n UNKNOWN = 'UNKNOWN',\n CHARGE = 'CHARGE',\n REFUND = 'REFUND',\n}\n\n/** @enumType */\nexport type BillingTypeWithLiterals =\n | BillingType\n | 'UNKNOWN'\n | 'CHARGE'\n | 'REFUND';\n\nexport interface ReportExternalBillingEventRequest {\n /**\n * The billing event with details of the external transaction, including the gross revenue,\n * net revenue, and billing type (charge or refund).\n */\n event?: ExternalBillingEvent;\n}\n\nexport interface ReportExternalBillingEventResponse {\n /** The billing event that was processed. */\n event?: ExternalBillingEvent;\n}\n\ntype ExternalBillingEventNonNullablePaths =\n | `grossRevenue`\n | `wixShare`\n | `billingType`;\n\n/**\n * Sends an external billing event to Wix.\n * Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).\n * The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.\n * @public\n * @documentationMaturity preview\n * @requiredField options.event.billingType\n * @requiredField options.event.grossRevenue\n * @requiredField options.event.wixShare\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.ExternalBillingBIService.ReportExternalBillingEvent\n */\nexport async function reportExternalBillingEvent(\n options?: NonNullablePaths<\n ReportExternalBillingEventOptions,\n `event.billingType` | `event.grossRevenue` | `event.wixShare`\n >\n): Promise<\n NonNullablePaths<\n ReportExternalBillingEventResponse,\n {\n [P in ExternalBillingEventNonNullablePaths]: `event.${P}`;\n }[ExternalBillingEventNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n event: options?.event,\n });\n\n const reqOpts =\n ambassadorWixMarketAimV1ExternalBillingEvent.reportExternalBillingEvent(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { event: '$[0].event' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ReportExternalBillingEventOptions {\n /**\n * The billing event with details of the external transaction, including the gross revenue,\n * net revenue, and billing type (charge or refund).\n */\n event?: ExternalBillingEvent;\n}\n","import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressMarketAimApiExternalBillingBiServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/app-instance-manager-webapp',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n {\n srcPath: '/api/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/api/v1/scripts',\n destPath: '/v1/scripts',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_external-billing';\n\n/**\n * Sends an external billing event to Wix.\n * Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).\n * The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.\n */\nexport function reportExternalBillingEvent(\n payload: object\n): RequestOptionsFactory<any> {\n function __reportExternalBillingEvent({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'event.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.market.aim.v1.external_billing_event',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.market.aim.api.ExternalBillingBIService.ReportExternalBillingEvent',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressMarketAimApiExternalBillingBiServiceUrl({\n protoPath: '/v1/billing-event',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'event.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __reportExternalBillingEvent;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ReportExternalBillingEventOptions,\n ReportExternalBillingEventResponse,\n reportExternalBillingEvent as universalReportExternalBillingEvent,\n} from './market-aim-v1-external-billing-event-external-billing.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function reportExternalBillingEvent(\n httpClient: HttpClient\n): ReportExternalBillingEventSignature {\n return (\n options?: NonNullablePaths<\n ReportExternalBillingEventOptions,\n `event.billingType` | `event.grossRevenue` | `event.wixShare`\n >\n ) =>\n universalReportExternalBillingEvent(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ReportExternalBillingEventSignature {\n /**\n * Sends an external billing event to Wix.\n * Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).\n * The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.\n */\n (\n options?: ReportExternalBillingEventOptions | undefined\n ): Promise<ReportExternalBillingEventResponse>;\n}\n\nexport {\n BillingType,\n ExternalBillingEvent,\n ReportExternalBillingEventOptions,\n ReportExternalBillingEventRequest,\n ReportExternalBillingEventResponse,\n} from './market-aim-v1-external-billing-event-external-billing.universal.js';\n","import { reportExternalBillingEvent as publicReportExternalBillingEvent } from './market-aim-v1-external-billing-event-external-billing.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const reportExternalBillingEvent: MaybeContext<\n BuildRESTFunction<typeof publicReportExternalBillingEvent> &\n typeof publicReportExternalBillingEvent\n> = /*#__PURE__*/ createRESTModule(publicReportExternalBillingEvent);\n\nexport { BillingType } from './market-aim-v1-external-billing-event-external-billing.universal.js';\nexport {\n ExternalBillingEvent,\n ReportExternalBillingEventRequest,\n ReportExternalBillingEventResponse,\n ReportExternalBillingEventOptions,\n} from './market-aim-v1-external-billing-event-external-billing.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,oCAAAA;AAAA;AAAA;;;ACAA,6BA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SAASC,4BACd,YACqC;AACrC,SAAO,CACL,YAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACtBA,IAAAC,uBAAiC;AAG1B,IAAMC,8BAGK,2DAAiBA,2BAAgC;","names":["reportExternalBillingEvent","import_timestamp","payload","BillingType","reportExternalBillingEvent","sdkTransformError","reportExternalBillingEvent","import_rest_modules","reportExternalBillingEvent"]}
|
package/build/index.mjs
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// src/market-aim-v1-external-billing-event-external-billing.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/market-aim-v1-external-billing-event-external-billing.http.ts
|
|
9
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
10
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
11
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
12
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
13
|
+
function resolveComWixpressMarketAimApiExternalBillingBiServiceUrl(opts) {
|
|
14
|
+
const domainToMappings = {
|
|
15
|
+
"api._api_base_domain_": [
|
|
16
|
+
{
|
|
17
|
+
srcPath: "/app-instance-manager-webapp",
|
|
18
|
+
destPath: ""
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"www.wixapis.com": [
|
|
22
|
+
{
|
|
23
|
+
srcPath: "/apps",
|
|
24
|
+
destPath: ""
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"wixapis.com": [
|
|
28
|
+
{
|
|
29
|
+
srcPath: "/apps",
|
|
30
|
+
destPath: ""
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"dev._base_domain_": [
|
|
34
|
+
{
|
|
35
|
+
srcPath: "/_api/app-instance-manager",
|
|
36
|
+
destPath: ""
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
srcPath: "/api/v1/instance",
|
|
40
|
+
destPath: "/v1/instance"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
srcPath: "/api/v1/scripts",
|
|
44
|
+
destPath: "/v1/scripts"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"manage._base_domain_": [
|
|
48
|
+
{
|
|
49
|
+
srcPath: "/_api/app-instance-manager",
|
|
50
|
+
destPath: ""
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"www._base_domain_": [
|
|
54
|
+
{
|
|
55
|
+
srcPath: "/_api/app-instance-manager",
|
|
56
|
+
destPath: ""
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"editor._base_domain_": [
|
|
60
|
+
{
|
|
61
|
+
srcPath: "/_api/app-instance-manager",
|
|
62
|
+
destPath: ""
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"blocks._base_domain_": [
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/_api/app-instance-manager",
|
|
68
|
+
destPath: ""
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"create.editorx": [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/_api/app-instance-manager",
|
|
74
|
+
destPath: ""
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
};
|
|
78
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
79
|
+
}
|
|
80
|
+
var PACKAGE_NAME = "@wix/auto_sdk_app-management_external-billing";
|
|
81
|
+
function reportExternalBillingEvent(payload) {
|
|
82
|
+
function __reportExternalBillingEvent({ host }) {
|
|
83
|
+
const serializedData = transformPaths(payload, [
|
|
84
|
+
{
|
|
85
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
86
|
+
paths: [{ path: "event.createdDate" }]
|
|
87
|
+
}
|
|
88
|
+
]);
|
|
89
|
+
const metadata = {
|
|
90
|
+
entityFqdn: "wix.market.aim.v1.external_billing_event",
|
|
91
|
+
method: "POST",
|
|
92
|
+
methodFqn: "com.wixpress.market.aim.api.ExternalBillingBIService.ReportExternalBillingEvent",
|
|
93
|
+
packageName: PACKAGE_NAME,
|
|
94
|
+
url: resolveComWixpressMarketAimApiExternalBillingBiServiceUrl({
|
|
95
|
+
protoPath: "/v1/billing-event",
|
|
96
|
+
data: serializedData,
|
|
97
|
+
host
|
|
98
|
+
}),
|
|
99
|
+
data: serializedData,
|
|
100
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
101
|
+
{
|
|
102
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
103
|
+
paths: [{ path: "event.createdDate" }]
|
|
104
|
+
}
|
|
105
|
+
])
|
|
106
|
+
};
|
|
107
|
+
return metadata;
|
|
108
|
+
}
|
|
109
|
+
return __reportExternalBillingEvent;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/market-aim-v1-external-billing-event-external-billing.universal.ts
|
|
113
|
+
var BillingType = /* @__PURE__ */ ((BillingType2) => {
|
|
114
|
+
BillingType2["UNKNOWN"] = "UNKNOWN";
|
|
115
|
+
BillingType2["CHARGE"] = "CHARGE";
|
|
116
|
+
BillingType2["REFUND"] = "REFUND";
|
|
117
|
+
return BillingType2;
|
|
118
|
+
})(BillingType || {});
|
|
119
|
+
async function reportExternalBillingEvent2(options) {
|
|
120
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
121
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
122
|
+
event: options?.event
|
|
123
|
+
});
|
|
124
|
+
const reqOpts = reportExternalBillingEvent(
|
|
125
|
+
payload
|
|
126
|
+
);
|
|
127
|
+
sideEffects?.onSiteCall?.();
|
|
128
|
+
try {
|
|
129
|
+
const result = await httpClient.request(reqOpts);
|
|
130
|
+
sideEffects?.onSuccess?.(result);
|
|
131
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
132
|
+
} catch (err) {
|
|
133
|
+
const transformedError = sdkTransformError(
|
|
134
|
+
err,
|
|
135
|
+
{
|
|
136
|
+
spreadPathsToArguments: {},
|
|
137
|
+
explicitPathsToArguments: { event: "$[0].event" },
|
|
138
|
+
singleArgumentUnchanged: false
|
|
139
|
+
},
|
|
140
|
+
["options"]
|
|
141
|
+
);
|
|
142
|
+
sideEffects?.onError?.(err);
|
|
143
|
+
throw transformedError;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// src/market-aim-v1-external-billing-event-external-billing.public.ts
|
|
148
|
+
function reportExternalBillingEvent3(httpClient) {
|
|
149
|
+
return (options) => reportExternalBillingEvent2(
|
|
150
|
+
options,
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
{ httpClient }
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// src/market-aim-v1-external-billing-event-external-billing.context.ts
|
|
157
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
158
|
+
var reportExternalBillingEvent4 = /* @__PURE__ */ createRESTModule(reportExternalBillingEvent3);
|
|
159
|
+
export {
|
|
160
|
+
BillingType,
|
|
161
|
+
reportExternalBillingEvent4 as reportExternalBillingEvent
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/market-aim-v1-external-billing-event-external-billing.universal.ts","../src/market-aim-v1-external-billing-event-external-billing.http.ts","../src/market-aim-v1-external-billing-event-external-billing.public.ts","../src/market-aim-v1-external-billing-event-external-billing.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixMarketAimV1ExternalBillingEvent from './market-aim-v1-external-billing-event-external-billing.http.js';\n\nexport interface ExternalBillingEvent {\n /**\n * The app ID linked to this transaction. This field is only relevant if using an API key for authorization,\n * in which case you're required to pass the app ID.\n * @format GUID\n */\n appId?: string | null;\n /**\n * The app instance ID linked to this transaction. This field is only relevant if using an API key for authorization,\n * in which case you can optionally pass the instance ID.\n *\n * This connects the transaction to a specific instance of your app installed on a Wix site.\n * Learn more [about app instances](https://dev.wix.com/docs/build-apps/develop-your-app/access/app-instances/about-app-instances).\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * The total amount of the transaction in USD, not including tax.\n * This value can be negative, such as for adjustments or refunds.\n * @format DECIMAL_VALUE\n * @decimalValue options { maxScale:10 }\n */\n grossRevenue?: string;\n /**\n * The amount charged minus agreed-upon expenses, such as shipping fees.\n * This value can be negative.\n * @format DECIMAL_VALUE\n * @decimalValue options { maxScale:10 }\n */\n netRevenue?: string | null;\n /**\n * Wix's share of the transaction in USD.\n * This value can be negative, such as for adjustments or refunds.\n * @format DECIMAL_VALUE\n * @decimalValue options { maxScale:10 }\n */\n wixShare?: string;\n /** The date and time of the transaction. */\n _createdDate?: Date | null;\n /** The type of billing event, either charge or refund. */\n billingType?: BillingTypeWithLiterals;\n}\n\nexport enum BillingType {\n UNKNOWN = 'UNKNOWN',\n CHARGE = 'CHARGE',\n REFUND = 'REFUND',\n}\n\n/** @enumType */\nexport type BillingTypeWithLiterals =\n | BillingType\n | 'UNKNOWN'\n | 'CHARGE'\n | 'REFUND';\n\nexport interface ReportExternalBillingEventRequest {\n /**\n * The billing event with details of the external transaction, including the gross revenue,\n * net revenue, and billing type (charge or refund).\n */\n event?: ExternalBillingEvent;\n}\n\nexport interface ReportExternalBillingEventResponse {\n /** The billing event that was processed. */\n event?: ExternalBillingEvent;\n}\n\ntype ExternalBillingEventNonNullablePaths =\n | `grossRevenue`\n | `wixShare`\n | `billingType`;\n\n/**\n * Sends an external billing event to Wix.\n * Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).\n * The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.\n * @public\n * @documentationMaturity preview\n * @requiredField options.event.billingType\n * @requiredField options.event.grossRevenue\n * @requiredField options.event.wixShare\n * @permissionId WIX_DEVELOPERS.MANAGE_APP_INSTANCE\n * @permissionScope Manage Your App\n * @permissionScopeId SCOPE.DC.MANAGE-YOUR-APP\n * @permissionScope Read site, business, and email details\n * @permissionScopeId SCOPE.DEV_CENTER.APP-INSTANCE-READ-BASIC-INFO\n * @applicableIdentity APP\n * @fqn com.wixpress.market.aim.api.ExternalBillingBIService.ReportExternalBillingEvent\n */\nexport async function reportExternalBillingEvent(\n options?: NonNullablePaths<\n ReportExternalBillingEventOptions,\n `event.billingType` | `event.grossRevenue` | `event.wixShare`\n >\n): Promise<\n NonNullablePaths<\n ReportExternalBillingEventResponse,\n {\n [P in ExternalBillingEventNonNullablePaths]: `event.${P}`;\n }[ExternalBillingEventNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n event: options?.event,\n });\n\n const reqOpts =\n ambassadorWixMarketAimV1ExternalBillingEvent.reportExternalBillingEvent(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { event: '$[0].event' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ReportExternalBillingEventOptions {\n /**\n * The billing event with details of the external transaction, including the gross revenue,\n * net revenue, and billing type (charge or refund).\n */\n event?: ExternalBillingEvent;\n}\n","import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressMarketAimApiExternalBillingBiServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/app-instance-manager-webapp',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'wixapis.com': [\n {\n srcPath: '/apps',\n destPath: '',\n },\n ],\n 'dev._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n {\n srcPath: '/api/v1/instance',\n destPath: '/v1/instance',\n },\n {\n srcPath: '/api/v1/scripts',\n destPath: '/v1/scripts',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/app-instance-manager',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_external-billing';\n\n/**\n * Sends an external billing event to Wix.\n * Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).\n * The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.\n */\nexport function reportExternalBillingEvent(\n payload: object\n): RequestOptionsFactory<any> {\n function __reportExternalBillingEvent({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'event.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.market.aim.v1.external_billing_event',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.market.aim.api.ExternalBillingBIService.ReportExternalBillingEvent',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressMarketAimApiExternalBillingBiServiceUrl({\n protoPath: '/v1/billing-event',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'event.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __reportExternalBillingEvent;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ReportExternalBillingEventOptions,\n ReportExternalBillingEventResponse,\n reportExternalBillingEvent as universalReportExternalBillingEvent,\n} from './market-aim-v1-external-billing-event-external-billing.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function reportExternalBillingEvent(\n httpClient: HttpClient\n): ReportExternalBillingEventSignature {\n return (\n options?: NonNullablePaths<\n ReportExternalBillingEventOptions,\n `event.billingType` | `event.grossRevenue` | `event.wixShare`\n >\n ) =>\n universalReportExternalBillingEvent(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ReportExternalBillingEventSignature {\n /**\n * Sends an external billing event to Wix.\n * Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).\n * The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.\n */\n (\n options?: ReportExternalBillingEventOptions | undefined\n ): Promise<ReportExternalBillingEventResponse>;\n}\n\nexport {\n BillingType,\n ExternalBillingEvent,\n ReportExternalBillingEventOptions,\n ReportExternalBillingEventRequest,\n ReportExternalBillingEventResponse,\n} from './market-aim-v1-external-billing-event-external-billing.universal.js';\n","import { reportExternalBillingEvent as publicReportExternalBillingEvent } from './market-aim-v1-external-billing-event-external-billing.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const reportExternalBillingEvent: MaybeContext<\n BuildRESTFunction<typeof publicReportExternalBillingEvent> &\n typeof publicReportExternalBillingEvent\n> = /*#__PURE__*/ createRESTModule(publicReportExternalBillingEvent);\n\nexport { BillingType } from './market-aim-v1-external-billing-event-external-billing.universal.js';\nexport {\n ExternalBillingEvent,\n ReportExternalBillingEventRequest,\n ReportExternalBillingEventResponse,\n ReportExternalBillingEventOptions,\n} from './market-aim-v1-external-billing-event-external-billing.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,0DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;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,eAAe;AAAA,MACb;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,M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AL;AACL,EAAAA,aAAA,aAAU;AACV,EAAAA,aAAA,YAAS;AACT,EAAAA,aAAA,YAAS;AAHC,SAAAA;AAAA,GAAA;AAgDZ,eAAsBC,4BACpB,SAWA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,OAAO,SAAS;AAAA,EAClB,CAAC;AAED,QAAM,UACyC;AAAA,IAC3C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,aAAa;AAAA,QAChD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE1IO,SAASC,4BACd,YACqC;AACrC,SAAO,CACL,YAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACtBA,SAAS,wBAAwB;AAG1B,IAAMC,8BAGK,iCAAiBA,2BAAgC;","names":["payload","BillingType","reportExternalBillingEvent","reportExternalBillingEvent","reportExternalBillingEvent"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { R as ReportExternalBillingEventOptions, a as ReportExternalBillingEventResponse } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.mjs';
|
|
3
|
+
export { B as BillingType, E as ExternalBillingEvent, b as ReportExternalBillingEventRequest } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.mjs';
|
|
4
|
+
|
|
5
|
+
declare function reportExternalBillingEvent$1(httpClient: HttpClient): ReportExternalBillingEventSignature;
|
|
6
|
+
interface ReportExternalBillingEventSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Sends an external billing event to Wix.
|
|
9
|
+
* Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).
|
|
10
|
+
* The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.
|
|
11
|
+
*/
|
|
12
|
+
(options?: ReportExternalBillingEventOptions | undefined): Promise<ReportExternalBillingEventResponse>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const reportExternalBillingEvent: MaybeContext<BuildRESTFunction<typeof reportExternalBillingEvent$1> & typeof reportExternalBillingEvent$1>;
|
|
16
|
+
|
|
17
|
+
export { ReportExternalBillingEventOptions, ReportExternalBillingEventResponse, reportExternalBillingEvent };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { R as ReportExternalBillingEventOptions, a as ReportExternalBillingEventResponse } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.js';
|
|
3
|
+
export { B as BillingType, E as ExternalBillingEvent, b as ReportExternalBillingEventRequest } from './market-aim-v1-external-billing-event-external-billing.universal-DamAfTwv.js';
|
|
4
|
+
|
|
5
|
+
declare function reportExternalBillingEvent$1(httpClient: HttpClient): ReportExternalBillingEventSignature;
|
|
6
|
+
interface ReportExternalBillingEventSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Sends an external billing event to Wix.
|
|
9
|
+
* Use this to report charges or refunds for your [Partner Billed App](https://dev.wix.com/docs/build-apps/launch-your-app/pricing-and-billing/partner-billed-apps-reporting).
|
|
10
|
+
* The reported event enables Wix to track revenue, deductions, and shares related to third-party billing.
|
|
11
|
+
*/
|
|
12
|
+
(options?: ReportExternalBillingEventOptions | undefined): Promise<ReportExternalBillingEventResponse>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const reportExternalBillingEvent: MaybeContext<BuildRESTFunction<typeof reportExternalBillingEvent$1> & typeof reportExternalBillingEvent$1>;
|
|
16
|
+
|
|
17
|
+
export { ReportExternalBillingEventOptions, ReportExternalBillingEventResponse, reportExternalBillingEvent };
|