@wix/auto_sdk_consent-policy_cmp 1.0.3 → 1.0.5
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 +28 -1
- package/build/cjs/index.js +212 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +209 -1
- package/build/cjs/index.typings.js +192 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +58 -1
- package/build/cjs/meta.js +166 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +28 -0
- package/build/es/index.mjs +189 -0
- package/build/es/index.mjs.map +1 -0
- package/build/{internal/cjs/src/bu-legal-v2-cmp-config-cmp.universal.d.ts → es/index.typings.d.mts} +32 -25
- package/build/es/index.typings.mjs +169 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +58 -0
- package/build/es/meta.mjs +141 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +28 -1
- package/build/internal/cjs/index.js +212 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +209 -1
- package/build/internal/cjs/index.typings.js +192 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +58 -1
- package/build/internal/cjs/meta.js +166 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +28 -0
- package/build/internal/es/index.mjs +189 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/{src/bu-legal-v2-cmp-config-cmp.universal.d.ts → index.typings.d.mts} +32 -25
- package/build/internal/es/index.typings.mjs +169 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +58 -0
- package/build/internal/es/meta.mjs +141 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +12 -10
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.context.js +0 -10
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.http.js +0 -105
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -66
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.public.js +0 -20
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -174
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.types.js +0 -12
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.universal.d.ts +0 -202
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -111
- package/build/cjs/src/bu-legal-v2-cmp-config-cmp.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/src/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
- package/build/es/src/bu-legal-v2-cmp-config-cmp.context.js +0 -6
- package/build/es/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
- package/build/es/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
- package/build/es/src/bu-legal-v2-cmp-config-cmp.http.js +0 -100
- package/build/es/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
- package/build/es/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
- package/build/es/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -38
- package/build/es/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
- package/build/es/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
- package/build/es/src/bu-legal-v2-cmp-config-cmp.public.js +0 -14
- package/build/es/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
- package/build/es/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -174
- package/build/es/src/bu-legal-v2-cmp-config-cmp.types.js +0 -9
- package/build/es/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
- package/build/es/src/bu-legal-v2-cmp-config-cmp.universal.d.ts +0 -202
- package/build/es/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -83
- package/build/es/src/bu-legal-v2-cmp-config-cmp.universal.js.map +0 -1
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.context.js +0 -10
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.http.js +0 -105
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -66
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.public.js +0 -20
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -174
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.types.js +0 -12
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -111
- package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.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/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.context.js +0 -6
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.http.js +0 -100
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -38
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.public.js +0 -14
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -174
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.types.js +0 -9
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -83
- package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.universal.js.map +0 -1
package/build/cjs/index.d.ts
CHANGED
|
@@ -1 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { CmpConfig, UpdateCmpConfigApplicationErrors } from './index.typings.js';
|
|
3
|
+
export { ActionEvent, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetCmpConfigRequest, GetCmpConfigResponse, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, RestoreInfo, UpdateCmpConfigRequest, UpdateCmpConfigResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function getCmpConfig$1(httpClient: HttpClient): GetCmpConfigSignature;
|
|
6
|
+
interface GetCmpConfigSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves a CMP config.
|
|
9
|
+
* @returns Requested CMP config.
|
|
10
|
+
*/
|
|
11
|
+
(): Promise<CmpConfig>;
|
|
12
|
+
}
|
|
13
|
+
declare function updateCmpConfig$1(httpClient: HttpClient): UpdateCmpConfigSignature;
|
|
14
|
+
interface UpdateCmpConfigSignature {
|
|
15
|
+
/**
|
|
16
|
+
* Updates a CMP config.
|
|
17
|
+
* @param - CMP config to be updated.
|
|
18
|
+
* @returns Updated CMP config.
|
|
19
|
+
*/
|
|
20
|
+
(cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<CmpConfig & {
|
|
21
|
+
__applicationErrorsType?: UpdateCmpConfigApplicationErrors;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const getCmpConfig: MaybeContext<BuildRESTFunction<typeof getCmpConfig$1> & typeof getCmpConfig$1>;
|
|
26
|
+
declare const updateCmpConfig: MaybeContext<BuildRESTFunction<typeof updateCmpConfig$1> & typeof updateCmpConfig$1>;
|
|
27
|
+
|
|
28
|
+
export { CmpConfig, UpdateCmpConfigApplicationErrors, getCmpConfig, updateCmpConfig };
|
package/build/cjs/index.js
CHANGED
|
@@ -1,18 +1,215 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
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 });
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
24
|
+
getCmpConfig: () => getCmpConfig4,
|
|
25
|
+
updateCmpConfig: () => updateCmpConfig4
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
|
|
29
|
+
// src/bu-legal-v2-cmp-config-cmp.universal.ts
|
|
30
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
31
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
32
|
+
|
|
33
|
+
// src/bu-legal-v2-cmp-config-cmp.http.ts
|
|
34
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
35
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
36
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
37
|
+
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
|
|
38
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
39
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
40
|
+
function resolveWixBuLegalV2CmpConfigServiceUrl(opts) {
|
|
41
|
+
const domainToMappings = {
|
|
42
|
+
"api._api_base_domain_": [
|
|
43
|
+
{
|
|
44
|
+
srcPath: "/cmp-config-v2",
|
|
45
|
+
destPath: ""
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"manage._base_domain_": [
|
|
49
|
+
{
|
|
50
|
+
srcPath: "/_api/cmp-config-v2",
|
|
51
|
+
destPath: "/api"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"www.wixapis.com": [
|
|
55
|
+
{
|
|
56
|
+
srcPath: "/consent/cmp",
|
|
57
|
+
destPath: ""
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
};
|
|
61
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
62
|
+
}
|
|
63
|
+
var PACKAGE_NAME = "@wix/auto_sdk_consent-policy_cmp";
|
|
64
|
+
function getCmpConfig(payload) {
|
|
65
|
+
function __getCmpConfig({ host }) {
|
|
66
|
+
const metadata = {
|
|
67
|
+
entityFqdn: "wix.bu.legal.v2.cmp_config",
|
|
68
|
+
method: "GET",
|
|
69
|
+
methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
|
|
70
|
+
packageName: PACKAGE_NAME,
|
|
71
|
+
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
72
|
+
protoPath: "/v2/cmp-configs",
|
|
73
|
+
data: payload,
|
|
74
|
+
host
|
|
75
|
+
}),
|
|
76
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
77
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
78
|
+
{
|
|
79
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
80
|
+
paths: [
|
|
81
|
+
{ path: "cmpConfig.createdDate" },
|
|
82
|
+
{ path: "cmpConfig.updatedDate" }
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
])
|
|
86
|
+
};
|
|
87
|
+
return metadata;
|
|
88
|
+
}
|
|
89
|
+
return __getCmpConfig;
|
|
90
|
+
}
|
|
91
|
+
function updateCmpConfig(payload) {
|
|
92
|
+
function __updateCmpConfig({ host }) {
|
|
93
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
94
|
+
{
|
|
95
|
+
transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
|
|
96
|
+
paths: [{ path: "fieldMask" }]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
100
|
+
paths: [
|
|
101
|
+
{ path: "cmpConfig.createdDate" },
|
|
102
|
+
{ path: "cmpConfig.updatedDate" }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
]);
|
|
106
|
+
const metadata = {
|
|
107
|
+
entityFqdn: "wix.bu.legal.v2.cmp_config",
|
|
108
|
+
method: "PATCH",
|
|
109
|
+
methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
|
|
110
|
+
packageName: PACKAGE_NAME,
|
|
111
|
+
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
112
|
+
protoPath: "/v2/cmp-configs",
|
|
113
|
+
data: serializedData,
|
|
114
|
+
host
|
|
115
|
+
}),
|
|
116
|
+
data: serializedData,
|
|
117
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
118
|
+
{
|
|
119
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
120
|
+
paths: [
|
|
121
|
+
{ path: "cmpConfig.createdDate" },
|
|
122
|
+
{ path: "cmpConfig.updatedDate" }
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
])
|
|
126
|
+
};
|
|
127
|
+
return metadata;
|
|
128
|
+
}
|
|
129
|
+
return __updateCmpConfig;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// src/bu-legal-v2-cmp-config-cmp.universal.ts
|
|
133
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
134
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
135
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
136
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
137
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
138
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
139
|
+
return WebhookIdentityType2;
|
|
140
|
+
})(WebhookIdentityType || {});
|
|
141
|
+
async function getCmpConfig2() {
|
|
142
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
143
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
144
|
+
const reqOpts = getCmpConfig(payload);
|
|
145
|
+
sideEffects?.onSiteCall?.();
|
|
146
|
+
try {
|
|
147
|
+
const result = await httpClient.request(reqOpts);
|
|
148
|
+
sideEffects?.onSuccess?.(result);
|
|
149
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.cmpConfig;
|
|
150
|
+
} catch (err) {
|
|
151
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
152
|
+
err,
|
|
153
|
+
{
|
|
154
|
+
spreadPathsToArguments: {},
|
|
155
|
+
explicitPathsToArguments: {},
|
|
156
|
+
singleArgumentUnchanged: false
|
|
157
|
+
},
|
|
158
|
+
[]
|
|
159
|
+
);
|
|
160
|
+
sideEffects?.onError?.(err);
|
|
161
|
+
throw transformedError;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
async function updateCmpConfig2(cmpConfig) {
|
|
165
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
166
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
167
|
+
cmpConfig
|
|
168
|
+
});
|
|
169
|
+
const reqOpts = updateCmpConfig(payload);
|
|
170
|
+
sideEffects?.onSiteCall?.();
|
|
171
|
+
try {
|
|
172
|
+
const result = await httpClient.request(reqOpts);
|
|
173
|
+
sideEffects?.onSuccess?.(result);
|
|
174
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.cmpConfig;
|
|
175
|
+
} catch (err) {
|
|
176
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
177
|
+
err,
|
|
178
|
+
{
|
|
179
|
+
spreadPathsToArguments: {},
|
|
180
|
+
explicitPathsToArguments: { cmpConfig: "$[0]" },
|
|
181
|
+
singleArgumentUnchanged: false
|
|
182
|
+
},
|
|
183
|
+
["cmpConfig"]
|
|
184
|
+
);
|
|
185
|
+
sideEffects?.onError?.(err);
|
|
186
|
+
throw transformedError;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// src/bu-legal-v2-cmp-config-cmp.public.ts
|
|
191
|
+
function getCmpConfig3(httpClient) {
|
|
192
|
+
return () => getCmpConfig2(
|
|
193
|
+
// @ts-ignore
|
|
194
|
+
{ httpClient }
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
function updateCmpConfig3(httpClient) {
|
|
198
|
+
return (cmpConfig) => updateCmpConfig2(
|
|
199
|
+
cmpConfig,
|
|
200
|
+
// @ts-ignore
|
|
201
|
+
{ httpClient }
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// src/bu-legal-v2-cmp-config-cmp.context.ts
|
|
206
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
207
|
+
var getCmpConfig4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCmpConfig3);
|
|
208
|
+
var updateCmpConfig4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateCmpConfig3);
|
|
209
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
210
|
+
0 && (module.exports = {
|
|
211
|
+
WebhookIdentityType,
|
|
212
|
+
getCmpConfig,
|
|
213
|
+
updateCmpConfig
|
|
214
|
+
});
|
|
18
215
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8EAA4D"}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.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 ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\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 cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\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 resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":"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","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig","getCmpConfig","updateCmpConfig","import_rest_modules","getCmpConfig","updateCmpConfig"]}
|
|
@@ -1 +1,209 @@
|
|
|
1
|
-
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A CMP Config is a collection of settings and parameters defined within a consent management platform.
|
|
5
|
+
*
|
|
6
|
+
* Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.
|
|
7
|
+
*/
|
|
8
|
+
interface CmpConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Revision number, which increments by 1 each time the CMP config is updated.
|
|
11
|
+
* To prevent conflicting changes,
|
|
12
|
+
* the current revision must be passed when updating the CMP config.
|
|
13
|
+
* @readonly
|
|
14
|
+
*/
|
|
15
|
+
revision?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Date and time the CMP config was created.
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
_createdDate?: Date | null;
|
|
21
|
+
/**
|
|
22
|
+
* Date and time the CMP config was last updated.
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
25
|
+
_updatedDate?: Date | null;
|
|
26
|
+
/** Whether elements are blocked until consent is given. */
|
|
27
|
+
socialElementsBlocked?: boolean | null;
|
|
28
|
+
}
|
|
29
|
+
interface GetCmpConfigRequest {
|
|
30
|
+
}
|
|
31
|
+
interface GetCmpConfigResponse {
|
|
32
|
+
/** Requested CMP config. */
|
|
33
|
+
cmpConfig?: CmpConfig;
|
|
34
|
+
}
|
|
35
|
+
interface UpdateCmpConfigRequest {
|
|
36
|
+
/** CMP config to be updated. */
|
|
37
|
+
cmpConfig: CmpConfig;
|
|
38
|
+
}
|
|
39
|
+
interface UpdateCmpConfigResponse {
|
|
40
|
+
/** Updated CMP config. */
|
|
41
|
+
cmpConfig?: CmpConfig;
|
|
42
|
+
}
|
|
43
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
44
|
+
createdEvent?: EntityCreatedEvent;
|
|
45
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
46
|
+
deletedEvent?: EntityDeletedEvent;
|
|
47
|
+
actionEvent?: ActionEvent;
|
|
48
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
49
|
+
_id?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
52
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
53
|
+
*/
|
|
54
|
+
entityFqdn?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
57
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
58
|
+
*/
|
|
59
|
+
slug?: string;
|
|
60
|
+
/** ID of the entity associated with the event. */
|
|
61
|
+
entityId?: string;
|
|
62
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
63
|
+
eventTime?: Date | null;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
66
|
+
* (for example, GDPR).
|
|
67
|
+
*/
|
|
68
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
69
|
+
/** If present, indicates the action that triggered the event. */
|
|
70
|
+
originatedFrom?: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
|
|
73
|
+
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
|
|
74
|
+
*/
|
|
75
|
+
entityEventSequence?: string | null;
|
|
76
|
+
}
|
|
77
|
+
/** @oneof */
|
|
78
|
+
interface DomainEventBodyOneOf {
|
|
79
|
+
createdEvent?: EntityCreatedEvent;
|
|
80
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
81
|
+
deletedEvent?: EntityDeletedEvent;
|
|
82
|
+
actionEvent?: ActionEvent;
|
|
83
|
+
}
|
|
84
|
+
interface EntityCreatedEvent {
|
|
85
|
+
entity?: string;
|
|
86
|
+
}
|
|
87
|
+
interface RestoreInfo {
|
|
88
|
+
deletedDate?: Date | null;
|
|
89
|
+
}
|
|
90
|
+
interface EntityUpdatedEvent {
|
|
91
|
+
/**
|
|
92
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
93
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
94
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
95
|
+
*/
|
|
96
|
+
currentEntity?: string;
|
|
97
|
+
}
|
|
98
|
+
interface EntityDeletedEvent {
|
|
99
|
+
/** Entity that was deleted. */
|
|
100
|
+
deletedEntity?: string | null;
|
|
101
|
+
}
|
|
102
|
+
interface ActionEvent {
|
|
103
|
+
body?: string;
|
|
104
|
+
}
|
|
105
|
+
interface MessageEnvelope {
|
|
106
|
+
/**
|
|
107
|
+
* App instance ID.
|
|
108
|
+
* @format GUID
|
|
109
|
+
*/
|
|
110
|
+
instanceId?: string | null;
|
|
111
|
+
/**
|
|
112
|
+
* Event type.
|
|
113
|
+
* @maxLength 150
|
|
114
|
+
*/
|
|
115
|
+
eventType?: string;
|
|
116
|
+
/** The identification type and identity data. */
|
|
117
|
+
identity?: IdentificationData;
|
|
118
|
+
/** Stringify payload. */
|
|
119
|
+
data?: string;
|
|
120
|
+
}
|
|
121
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
122
|
+
/**
|
|
123
|
+
* ID of a site visitor that has not logged in to the site.
|
|
124
|
+
* @format GUID
|
|
125
|
+
*/
|
|
126
|
+
anonymousVisitorId?: string;
|
|
127
|
+
/**
|
|
128
|
+
* ID of a site visitor that has logged in to the site.
|
|
129
|
+
* @format GUID
|
|
130
|
+
*/
|
|
131
|
+
memberId?: string;
|
|
132
|
+
/**
|
|
133
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
134
|
+
* @format GUID
|
|
135
|
+
*/
|
|
136
|
+
wixUserId?: string;
|
|
137
|
+
/**
|
|
138
|
+
* ID of an app.
|
|
139
|
+
* @format GUID
|
|
140
|
+
*/
|
|
141
|
+
appId?: string;
|
|
142
|
+
/** @readonly */
|
|
143
|
+
identityType?: WebhookIdentityTypeWithLiterals;
|
|
144
|
+
}
|
|
145
|
+
/** @oneof */
|
|
146
|
+
interface IdentificationDataIdOneOf {
|
|
147
|
+
/**
|
|
148
|
+
* ID of a site visitor that has not logged in to the site.
|
|
149
|
+
* @format GUID
|
|
150
|
+
*/
|
|
151
|
+
anonymousVisitorId?: string;
|
|
152
|
+
/**
|
|
153
|
+
* ID of a site visitor that has logged in to the site.
|
|
154
|
+
* @format GUID
|
|
155
|
+
*/
|
|
156
|
+
memberId?: string;
|
|
157
|
+
/**
|
|
158
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
159
|
+
* @format GUID
|
|
160
|
+
*/
|
|
161
|
+
wixUserId?: string;
|
|
162
|
+
/**
|
|
163
|
+
* ID of an app.
|
|
164
|
+
* @format GUID
|
|
165
|
+
*/
|
|
166
|
+
appId?: string;
|
|
167
|
+
}
|
|
168
|
+
declare enum WebhookIdentityType {
|
|
169
|
+
UNKNOWN = "UNKNOWN",
|
|
170
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
171
|
+
MEMBER = "MEMBER",
|
|
172
|
+
WIX_USER = "WIX_USER",
|
|
173
|
+
APP = "APP"
|
|
174
|
+
}
|
|
175
|
+
/** @enumType */
|
|
176
|
+
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
177
|
+
/** @docsIgnore */
|
|
178
|
+
type UpdateCmpConfigApplicationErrors = {
|
|
179
|
+
code?: 'NO_HTML_WEB_APPLICATION_FOUND';
|
|
180
|
+
description?: string;
|
|
181
|
+
data?: Record<string, any>;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Retrieves a CMP config.
|
|
185
|
+
* @public
|
|
186
|
+
* @documentationMaturity preview
|
|
187
|
+
* @permissionId COOKIE_CONSENT.CMP_CONFIG_READ
|
|
188
|
+
* @applicableIdentity APP
|
|
189
|
+
* @returns Requested CMP config.
|
|
190
|
+
* @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig
|
|
191
|
+
*/
|
|
192
|
+
declare function getCmpConfig(): Promise<CmpConfig>;
|
|
193
|
+
/**
|
|
194
|
+
* Updates a CMP config.
|
|
195
|
+
* @param cmpConfig - CMP config to be updated.
|
|
196
|
+
* @public
|
|
197
|
+
* @documentationMaturity preview
|
|
198
|
+
* @requiredField cmpConfig
|
|
199
|
+
* @requiredField cmpConfig.revision
|
|
200
|
+
* @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE
|
|
201
|
+
* @applicableIdentity APP
|
|
202
|
+
* @returns Updated CMP config.
|
|
203
|
+
* @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig
|
|
204
|
+
*/
|
|
205
|
+
declare function updateCmpConfig(cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<CmpConfig & {
|
|
206
|
+
__applicationErrorsType?: UpdateCmpConfigApplicationErrors;
|
|
207
|
+
}>;
|
|
208
|
+
|
|
209
|
+
export { type ActionEvent, type CmpConfig, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetCmpConfigRequest, type GetCmpConfigResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type RestoreInfo, type UpdateCmpConfigApplicationErrors, type UpdateCmpConfigRequest, type UpdateCmpConfigResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getCmpConfig, updateCmpConfig };
|