@wix/auto_sdk_consent-policy_cmp 1.0.4 → 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.
Files changed (125) hide show
  1. package/build/cjs/index.d.ts +28 -1
  2. package/build/cjs/index.js +212 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +209 -1
  5. package/build/cjs/index.typings.js +192 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +58 -1
  8. package/build/cjs/meta.js +166 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +28 -0
  11. package/build/es/index.mjs +189 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/{internal/cjs/src/bu-legal-v2-cmp-config-cmp.universal.d.ts → es/index.typings.d.mts} +30 -25
  14. package/build/es/index.typings.mjs +169 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +58 -0
  17. package/build/es/meta.mjs +141 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +28 -1
  20. package/build/internal/cjs/index.js +212 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +209 -1
  23. package/build/internal/cjs/index.typings.js +192 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +58 -1
  26. package/build/internal/cjs/meta.js +166 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +28 -0
  29. package/build/internal/es/index.mjs +189 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/bu-legal-v2-cmp-config-cmp.universal.d.ts → index.typings.d.mts} +30 -25
  32. package/build/internal/es/index.typings.mjs +169 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/es/meta.d.mts +58 -0
  35. package/build/internal/es/meta.mjs +141 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +12 -10
  38. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
  39. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.context.js +0 -10
  40. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
  41. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
  42. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.http.js +0 -105
  43. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
  44. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
  45. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -66
  46. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
  47. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
  48. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.public.js +0 -20
  49. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
  50. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -176
  51. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.types.js +0 -12
  52. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
  53. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.universal.d.ts +0 -204
  54. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -111
  55. package/build/cjs/src/bu-legal-v2-cmp-config-cmp.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
  66. package/build/es/src/bu-legal-v2-cmp-config-cmp.context.js +0 -6
  67. package/build/es/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
  68. package/build/es/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
  69. package/build/es/src/bu-legal-v2-cmp-config-cmp.http.js +0 -100
  70. package/build/es/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
  71. package/build/es/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
  72. package/build/es/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -38
  73. package/build/es/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
  74. package/build/es/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
  75. package/build/es/src/bu-legal-v2-cmp-config-cmp.public.js +0 -14
  76. package/build/es/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
  77. package/build/es/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -176
  78. package/build/es/src/bu-legal-v2-cmp-config-cmp.types.js +0 -9
  79. package/build/es/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
  80. package/build/es/src/bu-legal-v2-cmp-config-cmp.universal.d.ts +0 -204
  81. package/build/es/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -83
  82. package/build/es/src/bu-legal-v2-cmp-config-cmp.universal.js.map +0 -1
  83. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
  84. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.context.js +0 -10
  85. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
  86. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
  87. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.http.js +0 -105
  88. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
  89. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
  90. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -66
  91. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
  92. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
  93. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.public.js +0 -20
  94. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
  95. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -176
  96. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.types.js +0 -12
  97. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
  98. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -111
  99. package/build/internal/cjs/src/bu-legal-v2-cmp-config-cmp.universal.js.map +0 -1
  100. package/build/internal/es/index.d.ts +0 -1
  101. package/build/internal/es/index.js +0 -2
  102. package/build/internal/es/index.js.map +0 -1
  103. package/build/internal/es/index.typings.d.ts +0 -1
  104. package/build/internal/es/index.typings.js +0 -2
  105. package/build/internal/es/index.typings.js.map +0 -1
  106. package/build/internal/es/meta.d.ts +0 -1
  107. package/build/internal/es/meta.js +0 -2
  108. package/build/internal/es/meta.js.map +0 -1
  109. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.context.d.ts +0 -6
  110. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.context.js +0 -6
  111. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.context.js.map +0 -1
  112. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.http.d.ts +0 -5
  113. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.http.js +0 -100
  114. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.http.js.map +0 -1
  115. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.meta.d.ts +0 -14
  116. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.meta.js +0 -38
  117. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.meta.js.map +0 -1
  118. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.public.d.ts +0 -23
  119. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.public.js +0 -14
  120. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.public.js.map +0 -1
  121. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.types.d.ts +0 -176
  122. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.types.js +0 -9
  123. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.types.js.map +0 -1
  124. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.universal.js +0 -83
  125. package/build/internal/es/src/bu-legal-v2-cmp-config-cmp.universal.js.map +0 -1
@@ -0,0 +1,189 @@
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
+ url: resolveWixBuLegalV2CmpConfigServiceUrl({
47
+ protoPath: "/v2/cmp-configs",
48
+ data: payload,
49
+ host
50
+ }),
51
+ params: toURLSearchParams(payload),
52
+ transformResponse: (payload2) => transformPaths(payload2, [
53
+ {
54
+ transformFn: transformRESTTimestampToSDKTimestamp,
55
+ paths: [
56
+ { path: "cmpConfig.createdDate" },
57
+ { path: "cmpConfig.updatedDate" }
58
+ ]
59
+ }
60
+ ])
61
+ };
62
+ return metadata;
63
+ }
64
+ return __getCmpConfig;
65
+ }
66
+ function updateCmpConfig(payload) {
67
+ function __updateCmpConfig({ host }) {
68
+ const serializedData = transformPaths(payload, [
69
+ {
70
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
71
+ paths: [{ path: "fieldMask" }]
72
+ },
73
+ {
74
+ transformFn: transformSDKTimestampToRESTTimestamp,
75
+ paths: [
76
+ { path: "cmpConfig.createdDate" },
77
+ { path: "cmpConfig.updatedDate" }
78
+ ]
79
+ }
80
+ ]);
81
+ const metadata = {
82
+ entityFqdn: "wix.bu.legal.v2.cmp_config",
83
+ method: "PATCH",
84
+ methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
85
+ packageName: PACKAGE_NAME,
86
+ url: resolveWixBuLegalV2CmpConfigServiceUrl({
87
+ protoPath: "/v2/cmp-configs",
88
+ data: serializedData,
89
+ host
90
+ }),
91
+ data: serializedData,
92
+ transformResponse: (payload2) => transformPaths(payload2, [
93
+ {
94
+ transformFn: transformRESTTimestampToSDKTimestamp,
95
+ paths: [
96
+ { path: "cmpConfig.createdDate" },
97
+ { path: "cmpConfig.updatedDate" }
98
+ ]
99
+ }
100
+ ])
101
+ };
102
+ return metadata;
103
+ }
104
+ return __updateCmpConfig;
105
+ }
106
+
107
+ // src/bu-legal-v2-cmp-config-cmp.universal.ts
108
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
109
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
110
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
111
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
112
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
113
+ WebhookIdentityType2["APP"] = "APP";
114
+ return WebhookIdentityType2;
115
+ })(WebhookIdentityType || {});
116
+ async function getCmpConfig2() {
117
+ const { httpClient, sideEffects } = arguments[0];
118
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
119
+ const reqOpts = getCmpConfig(payload);
120
+ sideEffects?.onSiteCall?.();
121
+ try {
122
+ const result = await httpClient.request(reqOpts);
123
+ sideEffects?.onSuccess?.(result);
124
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig;
125
+ } catch (err) {
126
+ const transformedError = sdkTransformError(
127
+ err,
128
+ {
129
+ spreadPathsToArguments: {},
130
+ explicitPathsToArguments: {},
131
+ singleArgumentUnchanged: false
132
+ },
133
+ []
134
+ );
135
+ sideEffects?.onError?.(err);
136
+ throw transformedError;
137
+ }
138
+ }
139
+ async function updateCmpConfig2(cmpConfig) {
140
+ const { httpClient, sideEffects } = arguments[1];
141
+ const payload = renameKeysFromSDKRequestToRESTRequest({
142
+ cmpConfig
143
+ });
144
+ const reqOpts = updateCmpConfig(payload);
145
+ sideEffects?.onSiteCall?.();
146
+ try {
147
+ const result = await httpClient.request(reqOpts);
148
+ sideEffects?.onSuccess?.(result);
149
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig;
150
+ } catch (err) {
151
+ const transformedError = sdkTransformError(
152
+ err,
153
+ {
154
+ spreadPathsToArguments: {},
155
+ explicitPathsToArguments: { cmpConfig: "$[0]" },
156
+ singleArgumentUnchanged: false
157
+ },
158
+ ["cmpConfig"]
159
+ );
160
+ sideEffects?.onError?.(err);
161
+ throw transformedError;
162
+ }
163
+ }
164
+
165
+ // src/bu-legal-v2-cmp-config-cmp.public.ts
166
+ function getCmpConfig3(httpClient) {
167
+ return () => getCmpConfig2(
168
+ // @ts-ignore
169
+ { httpClient }
170
+ );
171
+ }
172
+ function updateCmpConfig3(httpClient) {
173
+ return (cmpConfig) => updateCmpConfig2(
174
+ cmpConfig,
175
+ // @ts-ignore
176
+ { httpClient }
177
+ );
178
+ }
179
+
180
+ // src/bu-legal-v2-cmp-config-cmp.context.ts
181
+ import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
182
+ var getCmpConfig4 = /* @__PURE__ */ createRESTModule(getCmpConfig3);
183
+ var updateCmpConfig4 = /* @__PURE__ */ createRESTModule(updateCmpConfig3);
184
+ export {
185
+ WebhookIdentityType,
186
+ getCmpConfig4 as getCmpConfig,
187
+ updateCmpConfig4 as updateCmpConfig
188
+ };
189
+ //# sourceMappingURL=index.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","../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as 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":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig"]}
@@ -1,10 +1,11 @@
1
1
  import { NonNullablePaths } from '@wix/sdk-types';
2
+
2
3
  /**
3
4
  * A CMP Config is a collection of settings and parameters defined within a consent management platform.
4
5
  *
5
6
  * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.
6
7
  */
7
- export interface CmpConfig {
8
+ interface CmpConfig {
8
9
  /**
9
10
  * Revision number, which increments by 1 each time the CMP config is updated.
10
11
  * To prevent conflicting changes,
@@ -25,21 +26,21 @@ export interface CmpConfig {
25
26
  /** Whether elements are blocked until consent is given. */
26
27
  socialElementsBlocked?: boolean | null;
27
28
  }
28
- export interface GetCmpConfigRequest {
29
+ interface GetCmpConfigRequest {
29
30
  }
30
- export interface GetCmpConfigResponse {
31
+ interface GetCmpConfigResponse {
31
32
  /** Requested CMP config. */
32
33
  cmpConfig?: CmpConfig;
33
34
  }
34
- export interface UpdateCmpConfigRequest {
35
+ interface UpdateCmpConfigRequest {
35
36
  /** CMP config to be updated. */
36
37
  cmpConfig: CmpConfig;
37
38
  }
38
- export interface UpdateCmpConfigResponse {
39
+ interface UpdateCmpConfigResponse {
39
40
  /** Updated CMP config. */
40
41
  cmpConfig?: CmpConfig;
41
42
  }
42
- export interface DomainEvent extends DomainEventBodyOneOf {
43
+ interface DomainEvent extends DomainEventBodyOneOf {
43
44
  createdEvent?: EntityCreatedEvent;
44
45
  updatedEvent?: EntityUpdatedEvent;
45
46
  deletedEvent?: EntityDeletedEvent;
@@ -74,19 +75,19 @@ export interface DomainEvent extends DomainEventBodyOneOf {
74
75
  entityEventSequence?: string | null;
75
76
  }
76
77
  /** @oneof */
77
- export interface DomainEventBodyOneOf {
78
+ interface DomainEventBodyOneOf {
78
79
  createdEvent?: EntityCreatedEvent;
79
80
  updatedEvent?: EntityUpdatedEvent;
80
81
  deletedEvent?: EntityDeletedEvent;
81
82
  actionEvent?: ActionEvent;
82
83
  }
83
- export interface EntityCreatedEvent {
84
+ interface EntityCreatedEvent {
84
85
  entity?: string;
85
86
  }
86
- export interface RestoreInfo {
87
+ interface RestoreInfo {
87
88
  deletedDate?: Date | null;
88
89
  }
89
- export interface EntityUpdatedEvent {
90
+ interface EntityUpdatedEvent {
90
91
  /**
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.
92
93
  * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
@@ -94,14 +95,14 @@ export interface EntityUpdatedEvent {
94
95
  */
95
96
  currentEntity?: string;
96
97
  }
97
- export interface EntityDeletedEvent {
98
+ interface EntityDeletedEvent {
98
99
  /** Entity that was deleted. */
99
100
  deletedEntity?: string | null;
100
101
  }
101
- export interface ActionEvent {
102
+ interface ActionEvent {
102
103
  body?: string;
103
104
  }
104
- export interface MessageEnvelope {
105
+ interface MessageEnvelope {
105
106
  /**
106
107
  * App instance ID.
107
108
  * @format GUID
@@ -117,7 +118,7 @@ export interface MessageEnvelope {
117
118
  /** Stringify payload. */
118
119
  data?: string;
119
120
  }
120
- export interface IdentificationData extends IdentificationDataIdOneOf {
121
+ interface IdentificationData extends IdentificationDataIdOneOf {
121
122
  /**
122
123
  * ID of a site visitor that has not logged in to the site.
123
124
  * @format GUID
@@ -142,7 +143,7 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
142
143
  identityType?: WebhookIdentityTypeWithLiterals;
143
144
  }
144
145
  /** @oneof */
145
- export interface IdentificationDataIdOneOf {
146
+ interface IdentificationDataIdOneOf {
146
147
  /**
147
148
  * ID of a site visitor that has not logged in to the site.
148
149
  * @format GUID
@@ -164,7 +165,7 @@ export interface IdentificationDataIdOneOf {
164
165
  */
165
166
  appId?: string;
166
167
  }
167
- export declare enum WebhookIdentityType {
168
+ declare enum WebhookIdentityType {
168
169
  UNKNOWN = "UNKNOWN",
169
170
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
170
171
  MEMBER = "MEMBER",
@@ -172,21 +173,23 @@ export declare enum WebhookIdentityType {
172
173
  APP = "APP"
173
174
  }
174
175
  /** @enumType */
175
- export type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
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
+ };
176
183
  /**
177
184
  * Retrieves a CMP config.
178
185
  * @public
179
186
  * @documentationMaturity preview
180
187
  * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ
181
- * @permissionScope Manage CMP Configurations
182
- * @permissionScopeId SCOPE.CMP_CONFIG.MANAGE
183
- * @permissionScope Read CMP Configurations
184
- * @permissionScopeId SCOPE.CMP_CONFIG.READ_ONLY
185
188
  * @applicableIdentity APP
186
189
  * @returns Requested CMP config.
187
190
  * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig
188
191
  */
189
- export declare function getCmpConfig(): Promise<CmpConfig>;
192
+ declare function getCmpConfig(): Promise<CmpConfig>;
190
193
  /**
191
194
  * Updates a CMP config.
192
195
  * @param cmpConfig - CMP config to be updated.
@@ -195,10 +198,12 @@ export declare function getCmpConfig(): Promise<CmpConfig>;
195
198
  * @requiredField cmpConfig
196
199
  * @requiredField cmpConfig.revision
197
200
  * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE
198
- * @permissionScope Manage CMP Configurations
199
- * @permissionScopeId SCOPE.CMP_CONFIG.MANAGE
200
201
  * @applicableIdentity APP
201
202
  * @returns Updated CMP config.
202
203
  * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig
203
204
  */
204
- export declare function updateCmpConfig(cmpConfig: NonNullablePaths<CmpConfig, `revision`>): Promise<CmpConfig>;
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 };
@@ -0,0 +1,169 @@
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
+ url: resolveWixBuLegalV2CmpConfigServiceUrl({
47
+ protoPath: "/v2/cmp-configs",
48
+ data: payload,
49
+ host
50
+ }),
51
+ params: toURLSearchParams(payload),
52
+ transformResponse: (payload2) => transformPaths(payload2, [
53
+ {
54
+ transformFn: transformRESTTimestampToSDKTimestamp,
55
+ paths: [
56
+ { path: "cmpConfig.createdDate" },
57
+ { path: "cmpConfig.updatedDate" }
58
+ ]
59
+ }
60
+ ])
61
+ };
62
+ return metadata;
63
+ }
64
+ return __getCmpConfig;
65
+ }
66
+ function updateCmpConfig(payload) {
67
+ function __updateCmpConfig({ host }) {
68
+ const serializedData = transformPaths(payload, [
69
+ {
70
+ transformFn: transformSDKFieldMaskToRESTFieldMask,
71
+ paths: [{ path: "fieldMask" }]
72
+ },
73
+ {
74
+ transformFn: transformSDKTimestampToRESTTimestamp,
75
+ paths: [
76
+ { path: "cmpConfig.createdDate" },
77
+ { path: "cmpConfig.updatedDate" }
78
+ ]
79
+ }
80
+ ]);
81
+ const metadata = {
82
+ entityFqdn: "wix.bu.legal.v2.cmp_config",
83
+ method: "PATCH",
84
+ methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
85
+ packageName: PACKAGE_NAME,
86
+ url: resolveWixBuLegalV2CmpConfigServiceUrl({
87
+ protoPath: "/v2/cmp-configs",
88
+ data: serializedData,
89
+ host
90
+ }),
91
+ data: serializedData,
92
+ transformResponse: (payload2) => transformPaths(payload2, [
93
+ {
94
+ transformFn: transformRESTTimestampToSDKTimestamp,
95
+ paths: [
96
+ { path: "cmpConfig.createdDate" },
97
+ { path: "cmpConfig.updatedDate" }
98
+ ]
99
+ }
100
+ ])
101
+ };
102
+ return metadata;
103
+ }
104
+ return __updateCmpConfig;
105
+ }
106
+
107
+ // src/bu-legal-v2-cmp-config-cmp.universal.ts
108
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
109
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
110
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
111
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
112
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
113
+ WebhookIdentityType2["APP"] = "APP";
114
+ return WebhookIdentityType2;
115
+ })(WebhookIdentityType || {});
116
+ async function getCmpConfig2() {
117
+ const { httpClient, sideEffects } = arguments[0];
118
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
119
+ const reqOpts = getCmpConfig(payload);
120
+ sideEffects?.onSiteCall?.();
121
+ try {
122
+ const result = await httpClient.request(reqOpts);
123
+ sideEffects?.onSuccess?.(result);
124
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig;
125
+ } catch (err) {
126
+ const transformedError = sdkTransformError(
127
+ err,
128
+ {
129
+ spreadPathsToArguments: {},
130
+ explicitPathsToArguments: {},
131
+ singleArgumentUnchanged: false
132
+ },
133
+ []
134
+ );
135
+ sideEffects?.onError?.(err);
136
+ throw transformedError;
137
+ }
138
+ }
139
+ async function updateCmpConfig2(cmpConfig) {
140
+ const { httpClient, sideEffects } = arguments[1];
141
+ const payload = renameKeysFromSDKRequestToRESTRequest({
142
+ cmpConfig
143
+ });
144
+ const reqOpts = updateCmpConfig(payload);
145
+ sideEffects?.onSiteCall?.();
146
+ try {
147
+ const result = await httpClient.request(reqOpts);
148
+ sideEffects?.onSuccess?.(result);
149
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig;
150
+ } catch (err) {
151
+ const transformedError = sdkTransformError(
152
+ err,
153
+ {
154
+ spreadPathsToArguments: {},
155
+ explicitPathsToArguments: { cmpConfig: "$[0]" },
156
+ singleArgumentUnchanged: false
157
+ },
158
+ ["cmpConfig"]
159
+ );
160
+ sideEffects?.onError?.(err);
161
+ throw transformedError;
162
+ }
163
+ }
164
+ export {
165
+ WebhookIdentityType,
166
+ getCmpConfig2 as getCmpConfig,
167
+ updateCmpConfig2 as updateCmpConfig
168
+ };
169
+ //# 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 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"],"mappings":"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","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 };