@wix/auto_sdk_consent-policy_cmp 1.0.4 → 1.0.6
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 +218 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +209 -1
- package/build/cjs/index.typings.js +198 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +58 -1
- package/build/cjs/meta.js +172 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +28 -0
- package/build/es/index.mjs +195 -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} +30 -25
- package/build/es/index.typings.mjs +175 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +58 -0
- package/build/es/meta.mjs +147 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +28 -1
- package/build/internal/cjs/index.js +218 -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 +198 -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 +172 -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 +195 -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} +30 -25
- package/build/internal/es/index.typings.mjs +175 -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 +147 -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 -176
- 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 -204
- 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 -176
- 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 -204
- 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 -176
- 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 -176
- 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
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// src/bu-legal-v2-cmp-config-cmp.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/bu-legal-v2-cmp-config-cmp.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
11
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
12
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
13
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
14
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
15
|
+
function resolveWixBuLegalV2CmpConfigServiceUrl(opts) {
|
|
16
|
+
const domainToMappings = {
|
|
17
|
+
"api._api_base_domain_": [
|
|
18
|
+
{
|
|
19
|
+
srcPath: "/cmp-config-v2",
|
|
20
|
+
destPath: ""
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"manage._base_domain_": [
|
|
24
|
+
{
|
|
25
|
+
srcPath: "/_api/cmp-config-v2",
|
|
26
|
+
destPath: "/api"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"www.wixapis.com": [
|
|
30
|
+
{
|
|
31
|
+
srcPath: "/consent/cmp",
|
|
32
|
+
destPath: ""
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
37
|
+
}
|
|
38
|
+
var PACKAGE_NAME = "@wix/auto_sdk_consent-policy_cmp";
|
|
39
|
+
function getCmpConfig(payload) {
|
|
40
|
+
function __getCmpConfig({ host }) {
|
|
41
|
+
const metadata = {
|
|
42
|
+
entityFqdn: "wix.bu.legal.v2.cmp_config",
|
|
43
|
+
method: "GET",
|
|
44
|
+
methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
|
|
45
|
+
packageName: PACKAGE_NAME,
|
|
46
|
+
migrationOptions: {
|
|
47
|
+
optInTransformResponse: true
|
|
48
|
+
},
|
|
49
|
+
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
50
|
+
protoPath: "/v2/cmp-configs",
|
|
51
|
+
data: payload,
|
|
52
|
+
host
|
|
53
|
+
}),
|
|
54
|
+
params: toURLSearchParams(payload),
|
|
55
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
56
|
+
{
|
|
57
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
58
|
+
paths: [
|
|
59
|
+
{ path: "cmpConfig.createdDate" },
|
|
60
|
+
{ path: "cmpConfig.updatedDate" }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
])
|
|
64
|
+
};
|
|
65
|
+
return metadata;
|
|
66
|
+
}
|
|
67
|
+
return __getCmpConfig;
|
|
68
|
+
}
|
|
69
|
+
function updateCmpConfig(payload) {
|
|
70
|
+
function __updateCmpConfig({ host }) {
|
|
71
|
+
const serializedData = transformPaths(payload, [
|
|
72
|
+
{
|
|
73
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
74
|
+
paths: [{ path: "fieldMask" }]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
78
|
+
paths: [
|
|
79
|
+
{ path: "cmpConfig.createdDate" },
|
|
80
|
+
{ path: "cmpConfig.updatedDate" }
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]);
|
|
84
|
+
const metadata = {
|
|
85
|
+
entityFqdn: "wix.bu.legal.v2.cmp_config",
|
|
86
|
+
method: "PATCH",
|
|
87
|
+
methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
|
|
88
|
+
packageName: PACKAGE_NAME,
|
|
89
|
+
migrationOptions: {
|
|
90
|
+
optInTransformResponse: true
|
|
91
|
+
},
|
|
92
|
+
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
93
|
+
protoPath: "/v2/cmp-configs",
|
|
94
|
+
data: serializedData,
|
|
95
|
+
host
|
|
96
|
+
}),
|
|
97
|
+
data: serializedData,
|
|
98
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
99
|
+
{
|
|
100
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
101
|
+
paths: [
|
|
102
|
+
{ path: "cmpConfig.createdDate" },
|
|
103
|
+
{ path: "cmpConfig.updatedDate" }
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
])
|
|
107
|
+
};
|
|
108
|
+
return metadata;
|
|
109
|
+
}
|
|
110
|
+
return __updateCmpConfig;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// src/bu-legal-v2-cmp-config-cmp.universal.ts
|
|
114
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
115
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
116
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
117
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
118
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
119
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
120
|
+
return WebhookIdentityType2;
|
|
121
|
+
})(WebhookIdentityType || {});
|
|
122
|
+
async function getCmpConfig2() {
|
|
123
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
124
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({});
|
|
125
|
+
const reqOpts = getCmpConfig(payload);
|
|
126
|
+
sideEffects?.onSiteCall?.();
|
|
127
|
+
try {
|
|
128
|
+
const result = await httpClient.request(reqOpts);
|
|
129
|
+
sideEffects?.onSuccess?.(result);
|
|
130
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig;
|
|
131
|
+
} catch (err) {
|
|
132
|
+
const transformedError = sdkTransformError(
|
|
133
|
+
err,
|
|
134
|
+
{
|
|
135
|
+
spreadPathsToArguments: {},
|
|
136
|
+
explicitPathsToArguments: {},
|
|
137
|
+
singleArgumentUnchanged: false
|
|
138
|
+
},
|
|
139
|
+
[]
|
|
140
|
+
);
|
|
141
|
+
sideEffects?.onError?.(err);
|
|
142
|
+
throw transformedError;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async function updateCmpConfig2(cmpConfig) {
|
|
146
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
147
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
148
|
+
cmpConfig
|
|
149
|
+
});
|
|
150
|
+
const reqOpts = updateCmpConfig(payload);
|
|
151
|
+
sideEffects?.onSiteCall?.();
|
|
152
|
+
try {
|
|
153
|
+
const result = await httpClient.request(reqOpts);
|
|
154
|
+
sideEffects?.onSuccess?.(result);
|
|
155
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig;
|
|
156
|
+
} catch (err) {
|
|
157
|
+
const transformedError = sdkTransformError(
|
|
158
|
+
err,
|
|
159
|
+
{
|
|
160
|
+
spreadPathsToArguments: {},
|
|
161
|
+
explicitPathsToArguments: { cmpConfig: "$[0]" },
|
|
162
|
+
singleArgumentUnchanged: false
|
|
163
|
+
},
|
|
164
|
+
["cmpConfig"]
|
|
165
|
+
);
|
|
166
|
+
sideEffects?.onError?.(err);
|
|
167
|
+
throw transformedError;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
WebhookIdentityType,
|
|
172
|
+
getCmpConfig2 as getCmpConfig,
|
|
173
|
+
updateCmpConfig2 as updateCmpConfig
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.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 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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;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sCAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { GetCmpConfigRequest as GetCmpConfigRequest$1, GetCmpConfigResponse as GetCmpConfigResponse$1, UpdateCmpConfigRequest as UpdateCmpConfigRequest$1, UpdateCmpConfigResponse as UpdateCmpConfigResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A CMP Config is a collection of settings and parameters defined within a consent management platform.
|
|
6
|
+
*
|
|
7
|
+
* Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.
|
|
8
|
+
*/
|
|
9
|
+
interface CmpConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Revision number, which increments by 1 each time the CMP config is updated.
|
|
12
|
+
* To prevent conflicting changes,
|
|
13
|
+
* the current revision must be passed when updating the CMP config.
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
revision?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Date and time the CMP config was created.
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
createdDate?: Date | null;
|
|
22
|
+
/**
|
|
23
|
+
* Date and time the CMP config was last updated.
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
updatedDate?: Date | null;
|
|
27
|
+
/** Whether elements are blocked until consent is given. */
|
|
28
|
+
socialElementsBlocked?: boolean | null;
|
|
29
|
+
}
|
|
30
|
+
interface GetCmpConfigRequest {
|
|
31
|
+
}
|
|
32
|
+
interface GetCmpConfigResponse {
|
|
33
|
+
/** Requested CMP config. */
|
|
34
|
+
cmpConfig?: CmpConfig;
|
|
35
|
+
}
|
|
36
|
+
interface UpdateCmpConfigRequest {
|
|
37
|
+
/** CMP config to be updated. */
|
|
38
|
+
cmpConfig: CmpConfig;
|
|
39
|
+
}
|
|
40
|
+
interface UpdateCmpConfigResponse {
|
|
41
|
+
/** Updated CMP config. */
|
|
42
|
+
cmpConfig?: CmpConfig;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
46
|
+
getUrl: (context: any) => string;
|
|
47
|
+
httpMethod: K;
|
|
48
|
+
path: string;
|
|
49
|
+
pathParams: M;
|
|
50
|
+
__requestType: T;
|
|
51
|
+
__originalRequestType: S;
|
|
52
|
+
__responseType: Q;
|
|
53
|
+
__originalResponseType: R;
|
|
54
|
+
};
|
|
55
|
+
declare function getCmpConfig(): __PublicMethodMetaInfo<'GET', {}, GetCmpConfigRequest$1, GetCmpConfigRequest, GetCmpConfigResponse$1, GetCmpConfigResponse>;
|
|
56
|
+
declare function updateCmpConfig(): __PublicMethodMetaInfo<'PATCH', {}, UpdateCmpConfigRequest$1, UpdateCmpConfigRequest, UpdateCmpConfigResponse$1, UpdateCmpConfigResponse>;
|
|
57
|
+
|
|
58
|
+
export { type __PublicMethodMetaInfo, getCmpConfig, updateCmpConfig };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// src/bu-legal-v2-cmp-config-cmp.http.ts
|
|
2
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
3
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
4
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
5
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
6
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
7
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
8
|
+
function resolveWixBuLegalV2CmpConfigServiceUrl(opts) {
|
|
9
|
+
const domainToMappings = {
|
|
10
|
+
"api._api_base_domain_": [
|
|
11
|
+
{
|
|
12
|
+
srcPath: "/cmp-config-v2",
|
|
13
|
+
destPath: ""
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"manage._base_domain_": [
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/_api/cmp-config-v2",
|
|
19
|
+
destPath: "/api"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"www.wixapis.com": [
|
|
23
|
+
{
|
|
24
|
+
srcPath: "/consent/cmp",
|
|
25
|
+
destPath: ""
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
30
|
+
}
|
|
31
|
+
var PACKAGE_NAME = "@wix/auto_sdk_consent-policy_cmp";
|
|
32
|
+
function getCmpConfig(payload) {
|
|
33
|
+
function __getCmpConfig({ host }) {
|
|
34
|
+
const metadata = {
|
|
35
|
+
entityFqdn: "wix.bu.legal.v2.cmp_config",
|
|
36
|
+
method: "GET",
|
|
37
|
+
methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
|
|
38
|
+
packageName: PACKAGE_NAME,
|
|
39
|
+
migrationOptions: {
|
|
40
|
+
optInTransformResponse: true
|
|
41
|
+
},
|
|
42
|
+
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
43
|
+
protoPath: "/v2/cmp-configs",
|
|
44
|
+
data: payload,
|
|
45
|
+
host
|
|
46
|
+
}),
|
|
47
|
+
params: toURLSearchParams(payload),
|
|
48
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
49
|
+
{
|
|
50
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
51
|
+
paths: [
|
|
52
|
+
{ path: "cmpConfig.createdDate" },
|
|
53
|
+
{ path: "cmpConfig.updatedDate" }
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
])
|
|
57
|
+
};
|
|
58
|
+
return metadata;
|
|
59
|
+
}
|
|
60
|
+
return __getCmpConfig;
|
|
61
|
+
}
|
|
62
|
+
function updateCmpConfig(payload) {
|
|
63
|
+
function __updateCmpConfig({ host }) {
|
|
64
|
+
const serializedData = transformPaths(payload, [
|
|
65
|
+
{
|
|
66
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
67
|
+
paths: [{ path: "fieldMask" }]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
71
|
+
paths: [
|
|
72
|
+
{ path: "cmpConfig.createdDate" },
|
|
73
|
+
{ path: "cmpConfig.updatedDate" }
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]);
|
|
77
|
+
const metadata = {
|
|
78
|
+
entityFqdn: "wix.bu.legal.v2.cmp_config",
|
|
79
|
+
method: "PATCH",
|
|
80
|
+
methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
|
|
81
|
+
packageName: PACKAGE_NAME,
|
|
82
|
+
migrationOptions: {
|
|
83
|
+
optInTransformResponse: true
|
|
84
|
+
},
|
|
85
|
+
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
86
|
+
protoPath: "/v2/cmp-configs",
|
|
87
|
+
data: serializedData,
|
|
88
|
+
host
|
|
89
|
+
}),
|
|
90
|
+
data: serializedData,
|
|
91
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
92
|
+
{
|
|
93
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
94
|
+
paths: [
|
|
95
|
+
{ path: "cmpConfig.createdDate" },
|
|
96
|
+
{ path: "cmpConfig.updatedDate" }
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
])
|
|
100
|
+
};
|
|
101
|
+
return metadata;
|
|
102
|
+
}
|
|
103
|
+
return __updateCmpConfig;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// src/bu-legal-v2-cmp-config-cmp.meta.ts
|
|
107
|
+
function getCmpConfig2() {
|
|
108
|
+
const payload = {};
|
|
109
|
+
const getRequestOptions = getCmpConfig(payload);
|
|
110
|
+
const getUrl = (context) => {
|
|
111
|
+
const { url } = getRequestOptions(context);
|
|
112
|
+
return url;
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
getUrl,
|
|
116
|
+
httpMethod: "GET",
|
|
117
|
+
path: "/v2/cmp-configs",
|
|
118
|
+
pathParams: {},
|
|
119
|
+
__requestType: null,
|
|
120
|
+
__originalRequestType: null,
|
|
121
|
+
__responseType: null,
|
|
122
|
+
__originalResponseType: null
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function updateCmpConfig2() {
|
|
126
|
+
const payload = {};
|
|
127
|
+
const getRequestOptions = updateCmpConfig(payload);
|
|
128
|
+
const getUrl = (context) => {
|
|
129
|
+
const { url } = getRequestOptions(context);
|
|
130
|
+
return url;
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
getUrl,
|
|
134
|
+
httpMethod: "PATCH",
|
|
135
|
+
path: "/v2/cmp-configs",
|
|
136
|
+
pathParams: {},
|
|
137
|
+
__requestType: null,
|
|
138
|
+
__originalRequestType: null,
|
|
139
|
+
__responseType: null,
|
|
140
|
+
__originalResponseType: null
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
export {
|
|
144
|
+
getCmpConfig2 as getCmpConfig,
|
|
145
|
+
updateCmpConfig2 as updateCmpConfig
|
|
146
|
+
};
|
|
147
|
+
//# sourceMappingURL=meta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B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AAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getCmpConfig","updateCmpConfig"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_consent-policy_cmp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"publishConfig": {
|
|
5
6
|
"registry": "https://registry.npmjs.org/",
|
|
6
7
|
"access": "public"
|
|
@@ -8,18 +9,18 @@
|
|
|
8
9
|
"keywords": [],
|
|
9
10
|
"sideEffects": false,
|
|
10
11
|
"main": "./build/cjs/index.js",
|
|
11
|
-
"types": "./build/
|
|
12
|
+
"types": "./build/cjs/index.d.ts",
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
|
-
"import": "./build/es/index.
|
|
15
|
+
"import": "./build/es/index.mjs",
|
|
15
16
|
"require": "./build/cjs/index.js",
|
|
16
|
-
"types": "./build/es/index.d.
|
|
17
|
+
"types": "./build/es/index.d.mts"
|
|
17
18
|
},
|
|
18
19
|
"./package.json": "./package.json",
|
|
19
20
|
"./meta": {
|
|
20
|
-
"import": "./build/es/meta.
|
|
21
|
+
"import": "./build/es/meta.mjs",
|
|
21
22
|
"require": "./build/cjs/meta.js",
|
|
22
|
-
"types": "./build/es/meta.d.
|
|
23
|
+
"types": "./build/es/meta.d.mts"
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
@@ -28,14 +29,15 @@
|
|
|
28
29
|
"service-plugins"
|
|
29
30
|
],
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@wix/sdk-runtime": "^0.3.
|
|
32
|
-
"@wix/sdk-types": "^1.13.
|
|
32
|
+
"@wix/sdk-runtime": "^0.3.55",
|
|
33
|
+
"@wix/sdk-types": "^1.13.35"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
36
|
+
"tsup": "^8.4.0",
|
|
35
37
|
"typescript": "^5.3.2"
|
|
36
38
|
},
|
|
37
39
|
"scripts": {
|
|
38
|
-
"build": "
|
|
40
|
+
"build": "tsup",
|
|
39
41
|
"test": ":"
|
|
40
42
|
},
|
|
41
43
|
"wix": {
|
|
@@ -48,5 +50,5 @@
|
|
|
48
50
|
"fqdn": "wix.bu.legal.v2.cmp_config"
|
|
49
51
|
}
|
|
50
52
|
},
|
|
51
|
-
"falconPackageHash": "
|
|
53
|
+
"falconPackageHash": "8032f34429964e3d171451c97a77cb83bb9d00b640b222d8e76958b1"
|
|
52
54
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { getCmpConfig as publicGetCmpConfig, updateCmpConfig as publicUpdateCmpConfig } from './bu-legal-v2-cmp-config-cmp.public.js';
|
|
2
|
-
import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
|
|
3
|
-
export declare const getCmpConfig: MaybeContext<BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig>;
|
|
4
|
-
export declare const updateCmpConfig: MaybeContext<BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig>;
|
|
5
|
-
export { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';
|
|
6
|
-
export { CmpConfig, GetCmpConfigRequest, GetCmpConfigResponse, UpdateCmpConfigRequest, UpdateCmpConfigResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, RestoreInfo, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, MessageEnvelope, IdentificationData, IdentificationDataIdOneOf, } from './bu-legal-v2-cmp-config-cmp.universal.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebhookIdentityType = exports.updateCmpConfig = exports.getCmpConfig = void 0;
|
|
4
|
-
const bu_legal_v2_cmp_config_cmp_public_js_1 = require("./bu-legal-v2-cmp-config-cmp.public.js");
|
|
5
|
-
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
|
|
6
|
-
exports.getCmpConfig = (0, rest_modules_1.createRESTModule)(bu_legal_v2_cmp_config_cmp_public_js_1.getCmpConfig);
|
|
7
|
-
exports.updateCmpConfig = (0, rest_modules_1.createRESTModule)(bu_legal_v2_cmp_config_cmp_public_js_1.updateCmpConfig);
|
|
8
|
-
var bu_legal_v2_cmp_config_cmp_universal_js_1 = require("./bu-legal-v2-cmp-config-cmp.universal.js");
|
|
9
|
-
Object.defineProperty(exports, "WebhookIdentityType", { enumerable: true, get: function () { return bu_legal_v2_cmp_config_cmp_universal_js_1.WebhookIdentityType; } });
|
|
10
|
-
//# sourceMappingURL=bu-legal-v2-cmp-config-cmp.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bu-legal-v2-cmp-config-cmp.context.js","sourceRoot":"","sources":["../../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"names":[],"mappings":";;;AAAA,iGAGgD;AAChD,gEAAiE;AAGpD,QAAA,YAAY,GAEP,IAAA,+BAAgB,EAAC,mDAAkB,CAAC,CAAC;AAC1C,QAAA,eAAe,GAEV,IAAA,+BAAgB,EAAC,sDAAqB,CAAC,CAAC;AAE1D,qGAAgF;AAAvE,8IAAA,mBAAmB,OAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
-
/** Retrieves a CMP config. */
|
|
3
|
-
export declare function getCmpConfig(payload: object): RequestOptionsFactory<any>;
|
|
4
|
-
/** Updates a CMP config. */
|
|
5
|
-
export declare function updateCmpConfig(payload: object): RequestOptionsFactory<any>;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCmpConfig = exports.getCmpConfig = void 0;
|
|
4
|
-
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
|
|
5
|
-
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
6
|
-
const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
7
|
-
const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
|
|
8
|
-
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
9
|
-
const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
|
|
10
|
-
function resolveWixBuLegalV2CmpConfigServiceUrl(opts) {
|
|
11
|
-
const domainToMappings = {
|
|
12
|
-
'api._api_base_domain_': [
|
|
13
|
-
{
|
|
14
|
-
srcPath: '/cmp-config-v2',
|
|
15
|
-
destPath: '',
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
'manage._base_domain_': [
|
|
19
|
-
{
|
|
20
|
-
srcPath: '/_api/cmp-config-v2',
|
|
21
|
-
destPath: '/api',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
'www.wixapis.com': [
|
|
25
|
-
{
|
|
26
|
-
srcPath: '/consent/cmp',
|
|
27
|
-
destPath: '',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
};
|
|
31
|
-
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
32
|
-
}
|
|
33
|
-
const PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';
|
|
34
|
-
/** Retrieves a CMP config. */
|
|
35
|
-
function getCmpConfig(payload) {
|
|
36
|
-
function __getCmpConfig({ host }) {
|
|
37
|
-
const metadata = {
|
|
38
|
-
entityFqdn: 'wix.bu.legal.v2.cmp_config',
|
|
39
|
-
method: 'GET',
|
|
40
|
-
methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',
|
|
41
|
-
packageName: PACKAGE_NAME,
|
|
42
|
-
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
43
|
-
protoPath: '/v2/cmp-configs',
|
|
44
|
-
data: payload,
|
|
45
|
-
host,
|
|
46
|
-
}),
|
|
47
|
-
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
48
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
49
|
-
{
|
|
50
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
51
|
-
paths: [
|
|
52
|
-
{ path: 'cmpConfig.createdDate' },
|
|
53
|
-
{ path: 'cmpConfig.updatedDate' },
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
]),
|
|
57
|
-
};
|
|
58
|
-
return metadata;
|
|
59
|
-
}
|
|
60
|
-
return __getCmpConfig;
|
|
61
|
-
}
|
|
62
|
-
exports.getCmpConfig = getCmpConfig;
|
|
63
|
-
/** Updates a CMP config. */
|
|
64
|
-
function updateCmpConfig(payload) {
|
|
65
|
-
function __updateCmpConfig({ host }) {
|
|
66
|
-
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
67
|
-
{
|
|
68
|
-
transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
|
|
69
|
-
paths: [{ path: 'fieldMask' }],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
73
|
-
paths: [
|
|
74
|
-
{ path: 'cmpConfig.createdDate' },
|
|
75
|
-
{ path: 'cmpConfig.updatedDate' },
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
]);
|
|
79
|
-
const metadata = {
|
|
80
|
-
entityFqdn: 'wix.bu.legal.v2.cmp_config',
|
|
81
|
-
method: 'PATCH',
|
|
82
|
-
methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',
|
|
83
|
-
packageName: PACKAGE_NAME,
|
|
84
|
-
url: resolveWixBuLegalV2CmpConfigServiceUrl({
|
|
85
|
-
protoPath: '/v2/cmp-configs',
|
|
86
|
-
data: serializedData,
|
|
87
|
-
host,
|
|
88
|
-
}),
|
|
89
|
-
data: serializedData,
|
|
90
|
-
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
91
|
-
{
|
|
92
|
-
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
93
|
-
paths: [
|
|
94
|
-
{ path: 'cmpConfig.createdDate' },
|
|
95
|
-
{ path: 'cmpConfig.updatedDate' },
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
]),
|
|
99
|
-
};
|
|
100
|
-
return metadata;
|
|
101
|
-
}
|
|
102
|
-
return __updateCmpConfig;
|
|
103
|
-
}
|
|
104
|
-
exports.updateCmpConfig = updateCmpConfig;
|
|
105
|
-
//# sourceMappingURL=bu-legal-v2-cmp-config-cmp.http.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bu-legal-v2-cmp-config-cmp.http.js","sourceRoot":"","sources":["../../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"names":[],"mappings":";;;AAAA,gEAAkE;AAClE,0EAAkG;AAClG,0EAAkG;AAClG,4EAAmG;AACnG,sFAAkF;AAClF,gEAA2D;AAI3D,SAAS,sCAAsC,CAC7C,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,MAAM;aACjB;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,cAAc;gBACvB,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,yBAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,YAAY,GAAG,kCAAkC,CAAC;AAExD,8BAA8B;AAC9B,SAAgB,YAAY,CAAC,OAAe;IAC1C,SAAS,cAAc,CAAC,EAAE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C5B,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,CAAC,OAAY,EAAE,EAAE,CAClC,IAAA,gCAAc,EAAC,OAAO,EAAE;gBACtB;oBACE,WAAW,EAAE,gDAAoC;oBACjD,KAAK,EAAE;wBACL,EAAE,IAAI,EAAE,uBAAuB,EAAE;wBACjC,EAAE,IAAI,EAAE,uBAAuB,EAAE;qBAClC;iBACF;aACF,CAAC;SACL,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AA1CD,0CA0CC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';
|
|
2
|
-
import * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';
|
|
3
|
-
export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
4
|
-
getUrl: (context: any) => string;
|
|
5
|
-
httpMethod: K;
|
|
6
|
-
path: string;
|
|
7
|
-
pathParams: M;
|
|
8
|
-
__requestType: T;
|
|
9
|
-
__originalRequestType: S;
|
|
10
|
-
__responseType: Q;
|
|
11
|
-
__originalResponseType: R;
|
|
12
|
-
};
|
|
13
|
-
export declare function getCmpConfig(): __PublicMethodMetaInfo<'GET', {}, ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest, ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest, ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse, ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse>;
|
|
14
|
-
export declare function updateCmpConfig(): __PublicMethodMetaInfo<'PATCH', {}, ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest, ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest, ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse, ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse>;
|