@wix/auto_sdk_groups_membership-questions 1.0.16 → 1.0.18

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.
@@ -1,326 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- createOrReplaceAllMembershipQuestions: () => createOrReplaceAllMembershipQuestions4,
24
- listAnswers: () => listAnswers4,
25
- listMembershipQuestions: () => listMembershipQuestions4
26
- });
27
- module.exports = __toCommonJS(index_exports);
28
-
29
- // src/social-groups-v2-membership-question-membership-questions.universal.ts
30
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
31
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
32
-
33
- // src/social-groups-v2-membership-question-membership-questions.http.ts
34
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
35
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
36
- function resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl(opts) {
37
- const domainToMappings = {
38
- "api._api_base_domain_": [
39
- {
40
- srcPath: "/questions-proxy",
41
- destPath: ""
42
- }
43
- ],
44
- _: [
45
- {
46
- srcPath: "/_api/questions-proxy",
47
- destPath: ""
48
- },
49
- {
50
- srcPath: "/_api/social-groups-proxy/questions",
51
- destPath: ""
52
- }
53
- ],
54
- "*.dev.wix-code.com": [
55
- {
56
- srcPath: "/_api/social-groups-proxy/questions",
57
- destPath: ""
58
- }
59
- ],
60
- "editor-flow.wixapps.net": [
61
- {
62
- srcPath: "/_api/social-groups-proxy/questions",
63
- destPath: ""
64
- }
65
- ],
66
- "editor._base_domain_": [
67
- {
68
- srcPath: "/_api/social-groups-proxy/questions",
69
- destPath: ""
70
- }
71
- ],
72
- "blocks._base_domain_": [
73
- {
74
- srcPath: "/_api/social-groups-proxy/questions",
75
- destPath: ""
76
- }
77
- ],
78
- "create.editorx": [
79
- {
80
- srcPath: "/_api/social-groups-proxy/questions",
81
- destPath: ""
82
- }
83
- ],
84
- "editor.wixapps.net": [
85
- {
86
- srcPath: "/_api/social-groups-proxy/questions",
87
- destPath: ""
88
- }
89
- ],
90
- "groups.wixapps.net": [
91
- {
92
- srcPath: "/_api/social-groups-proxy/questions",
93
- destPath: ""
94
- }
95
- ],
96
- "manage._base_domain_": [
97
- {
98
- srcPath: "/_api/social-groups-proxy/questions",
99
- destPath: ""
100
- },
101
- {
102
- srcPath: "/social-groups-proxy/api/questions",
103
- destPath: ""
104
- },
105
- {
106
- srcPath: "/_api/questions-proxy",
107
- destPath: ""
108
- }
109
- ],
110
- "www._base_domain_": [
111
- {
112
- srcPath: "/_api/social-groups-proxy/questions",
113
- destPath: ""
114
- }
115
- ],
116
- "www.wixapis.com": [
117
- {
118
- srcPath: "/social-groups-proxy/questions",
119
- destPath: ""
120
- }
121
- ]
122
- };
123
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
124
- }
125
- var PACKAGE_NAME = "@wix/auto_sdk_groups_membership-questions";
126
- function listMembershipQuestions(payload) {
127
- function __listMembershipQuestions({ host }) {
128
- const metadata = {
129
- entityFqdn: "wix.social_groups.v2.membership_question",
130
- method: "GET",
131
- methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListMembershipQuestions",
132
- packageName: PACKAGE_NAME,
133
- migrationOptions: {
134
- optInTransformResponse: true
135
- },
136
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
137
- protoPath: "/v2/membership-questions/{groupId}",
138
- data: payload,
139
- host
140
- }),
141
- params: (0, import_rest_modules.toURLSearchParams)(payload),
142
- fallback: [
143
- {
144
- method: "GET",
145
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
146
- protoPath: "/v2/membership-questions/{groupId}",
147
- data: payload,
148
- host
149
- }),
150
- params: (0, import_rest_modules.toURLSearchParams)(payload)
151
- }
152
- ]
153
- };
154
- return metadata;
155
- }
156
- return __listMembershipQuestions;
157
- }
158
- function createOrReplaceAllMembershipQuestions(payload) {
159
- function __createOrReplaceAllMembershipQuestions({ host }) {
160
- const metadata = {
161
- entityFqdn: "wix.social_groups.v2.membership_question",
162
- method: "PUT",
163
- methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.CreateOrReplaceAllMembershipQuestions",
164
- packageName: PACKAGE_NAME,
165
- migrationOptions: {
166
- optInTransformResponse: true
167
- },
168
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
169
- protoPath: "/v2/membership-questions/{groupId}",
170
- data: payload,
171
- host
172
- }),
173
- data: payload
174
- };
175
- return metadata;
176
- }
177
- return __createOrReplaceAllMembershipQuestions;
178
- }
179
- function listAnswers(payload) {
180
- function __listAnswers({ host }) {
181
- const metadata = {
182
- entityFqdn: "wix.social_groups.v2.membership_question",
183
- method: "POST",
184
- methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListAnswers",
185
- packageName: PACKAGE_NAME,
186
- migrationOptions: {
187
- optInTransformResponse: true
188
- },
189
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
190
- protoPath: "/v2/membership-questions/{groupId}/answers",
191
- data: payload,
192
- host
193
- }),
194
- data: payload
195
- };
196
- return metadata;
197
- }
198
- return __listAnswers;
199
- }
200
-
201
- // src/social-groups-v2-membership-question-membership-questions.universal.ts
202
- async function listMembershipQuestions2(groupId) {
203
- const { httpClient, sideEffects } = arguments[1];
204
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ groupId });
205
- const reqOpts = listMembershipQuestions(
206
- payload
207
- );
208
- sideEffects?.onSiteCall?.();
209
- try {
210
- const result = await httpClient.request(reqOpts);
211
- sideEffects?.onSuccess?.(result);
212
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
213
- } catch (err) {
214
- const transformedError = (0, import_transform_error.transformError)(
215
- err,
216
- {
217
- spreadPathsToArguments: {},
218
- explicitPathsToArguments: { groupId: "$[0]" },
219
- singleArgumentUnchanged: false
220
- },
221
- ["groupId"]
222
- );
223
- sideEffects?.onError?.(err);
224
- throw transformedError;
225
- }
226
- }
227
- async function createOrReplaceAllMembershipQuestions2(groupId, options) {
228
- const { httpClient, sideEffects } = arguments[2];
229
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
230
- groupId,
231
- questions: options?.questions
232
- });
233
- const reqOpts = createOrReplaceAllMembershipQuestions(
234
- payload
235
- );
236
- sideEffects?.onSiteCall?.();
237
- try {
238
- const result = await httpClient.request(reqOpts);
239
- sideEffects?.onSuccess?.(result);
240
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
241
- } catch (err) {
242
- const transformedError = (0, import_transform_error.transformError)(
243
- err,
244
- {
245
- spreadPathsToArguments: {},
246
- explicitPathsToArguments: {
247
- groupId: "$[0]",
248
- questions: "$[1].questions"
249
- },
250
- singleArgumentUnchanged: false
251
- },
252
- ["groupId", "options"]
253
- );
254
- sideEffects?.onError?.(err);
255
- throw transformedError;
256
- }
257
- }
258
- async function listAnswers2(groupId, options) {
259
- const { httpClient, sideEffects } = arguments[2];
260
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
261
- groupId,
262
- memberIds: options?.memberIds,
263
- paging: options?.paging
264
- });
265
- const reqOpts = listAnswers(payload);
266
- sideEffects?.onSiteCall?.();
267
- try {
268
- const result = await httpClient.request(reqOpts);
269
- sideEffects?.onSuccess?.(result);
270
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
271
- } catch (err) {
272
- const transformedError = (0, import_transform_error.transformError)(
273
- err,
274
- {
275
- spreadPathsToArguments: {},
276
- explicitPathsToArguments: {
277
- groupId: "$[0]",
278
- memberIds: "$[1].memberIds",
279
- paging: "$[1].paging"
280
- },
281
- singleArgumentUnchanged: false
282
- },
283
- ["groupId", "options"]
284
- );
285
- sideEffects?.onError?.(err);
286
- throw transformedError;
287
- }
288
- }
289
-
290
- // src/social-groups-v2-membership-question-membership-questions.public.ts
291
- function listMembershipQuestions3(httpClient) {
292
- return (groupId) => listMembershipQuestions2(
293
- groupId,
294
- // @ts-ignore
295
- { httpClient }
296
- );
297
- }
298
- function createOrReplaceAllMembershipQuestions3(httpClient) {
299
- return (groupId, options) => createOrReplaceAllMembershipQuestions2(
300
- groupId,
301
- options,
302
- // @ts-ignore
303
- { httpClient }
304
- );
305
- }
306
- function listAnswers3(httpClient) {
307
- return (groupId, options) => listAnswers2(
308
- groupId,
309
- options,
310
- // @ts-ignore
311
- { httpClient }
312
- );
313
- }
314
-
315
- // src/social-groups-v2-membership-question-membership-questions.context.ts
316
- var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
317
- var listMembershipQuestions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listMembershipQuestions3);
318
- var createOrReplaceAllMembershipQuestions4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createOrReplaceAllMembershipQuestions3);
319
- var listAnswers4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listAnswers3);
320
- // Annotate the CommonJS export names for ESM import in node:
321
- 0 && (module.exports = {
322
- createOrReplaceAllMembershipQuestions,
323
- listAnswers,
324
- listMembershipQuestions
325
- });
326
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../index.ts","../../../src/social-groups-v2-membership-question-membership-questions.universal.ts","../../../src/social-groups-v2-membership-question-membership-questions.http.ts","../../../src/social-groups-v2-membership-question-membership-questions.public.ts","../../../src/social-groups-v2-membership-question-membership-questions.context.ts"],"sourcesContent":["export * from './src/social-groups-v2-membership-question-membership-questions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixSocialGroupsV2MembershipQuestion from './social-groups-v2-membership-question-membership-questions.http.js';\n\n/**\n * Question asked to members when joining a group.\n * Only group admins can create or update membership questions\n * and can set whether it is required to answer membership questions.\n */\nexport interface MembershipQuestion {\n /**\n * Question ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /** Whether a member must answer this question when joining the group. */\n required?: boolean;\n /**\n * Question text.\n * @minLength 1\n * @maxLength 300\n */\n text?: string;\n}\n\nexport interface ListMembershipQuestionsRequest {\n /**\n * Group ID.\n * @format GUID\n */\n groupId: string;\n}\n\nexport interface ListMembershipQuestionsResponse {\n /** Retrieved membership questions. */\n questions?: MembershipQuestion[];\n}\n\nexport interface CreateOrReplaceAllMembershipQuestionsRequest {\n /**\n * Group ID.\n * @format GUID\n */\n groupId: string;\n /**\n * New membership questions.\n * @maxSize 50\n */\n questions?: MembershipQuestion[];\n}\n\nexport interface CreateOrReplaceAllMembershipQuestionsResponse {\n /** Membership questions. */\n questions?: MembershipQuestion[];\n}\n\nexport interface ListAnswersRequest {\n /**\n * Group ID.\n * @format GUID\n */\n groupId: string;\n /**\n * Member IDs. If no member ID is provided, answers for all members will be returned. See the Members API for more details.\n * @format GUID\n * @maxSize 500\n */\n memberIds?: string[];\n paging?: Paging;\n}\n\nexport interface Paging {\n /** Number of items to load. */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\nexport interface ListAnswersResponse {\n /** Answers to the membership questions, grouped by member. */\n memberAnswers?: MemberMembershipQuestionAnswers[];\n /** Membership questions by question ID. Includes only questions that have been answered by the specified members. */\n questions?: Record<string, MembershipQuestion>;\n metadata?: PagingMetadata;\n}\n\nexport interface MemberMembershipQuestionAnswers {\n /**\n * Member ID. See the Members API for more details.\n * @format GUID\n */\n memberId?: string;\n /** Answers to the membership question. */\n answers?: MembershipQuestionAnswer[];\n}\n\n/** Answer to a membership question. */\nexport interface MembershipQuestionAnswer {\n /**\n * Question ID.\n * @format GUID\n */\n _id?: string;\n /**\n * Answer text.\n * @maxLength 300\n */\n text?: string | null;\n}\n\nexport interface PagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n * @internal\n */\n hasNext?: boolean | null;\n}\n\nexport interface ListAnswerCountsRequest {\n /**\n * @format GUID\n * @maxSize 500\n */\n memberIds?: string[];\n}\n\nexport interface ListAnswerCountsResponse {\n memberAnswerCounts?: MemberAnswerCount[];\n}\n\nexport interface MemberAnswerCount {\n /** @format GUID */\n memberId?: string;\n /** @format GUID */\n groupId?: string;\n count?: number;\n}\n\n/**\n * Retrieves the membership questions for a group.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param groupId - Group ID.\n * @public\n * @requiredField groupId\n * @fqn wix.social.groups.api.v2.MembershipQuestionsService.ListMembershipQuestions\n */\nexport async function listMembershipQuestions(\n groupId: string\n): Promise<\n NonNullablePaths<\n ListMembershipQuestionsResponse,\n `questions` | `questions.${number}.required` | `questions.${number}.text`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ groupId: groupId });\n\n const reqOpts =\n ambassadorWixSocialGroupsV2MembershipQuestion.listMembershipQuestions(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { groupId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['groupId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates membership questions if none have been set up. Otherwise, replaces all existing questions.\n *\n * Providing an empty array means that members won't have to answer any question when joining the group.\n * Only admins can create or replace membership questions.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param groupId - Group ID.\n * @public\n * @requiredField groupId\n * @fqn wix.social.groups.api.v2.MembershipQuestionsService.CreateOrReplaceAllMembershipQuestions\n */\nexport async function createOrReplaceAllMembershipQuestions(\n groupId: string,\n options?: CreateOrReplaceAllMembershipQuestionsOptions\n): Promise<\n NonNullablePaths<\n CreateOrReplaceAllMembershipQuestionsResponse,\n `questions` | `questions.${number}.required` | `questions.${number}.text`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n groupId: groupId,\n questions: options?.questions,\n });\n\n const reqOpts =\n ambassadorWixSocialGroupsV2MembershipQuestion.createOrReplaceAllMembershipQuestions(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n groupId: '$[0]',\n questions: '$[1].questions',\n },\n singleArgumentUnchanged: false,\n },\n ['groupId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateOrReplaceAllMembershipQuestionsOptions {\n /**\n * New membership questions.\n * @maxSize 50\n */\n questions?: MembershipQuestion[];\n}\n\n/**\n * Retrieves the answers to the membership questions, given the provided filters.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param groupId - Group ID.\n * @public\n * @requiredField groupId\n * @fqn wix.social.groups.api.v2.MembershipQuestionsService.ListAnswers\n */\nexport async function listAnswers(\n groupId: string,\n options?: ListAnswersOptions\n): Promise<\n NonNullablePaths<\n ListAnswersResponse,\n `memberAnswers` | `memberAnswers.${number}.memberId`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n groupId: groupId,\n memberIds: options?.memberIds,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixSocialGroupsV2MembershipQuestion.listAnswers(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n groupId: '$[0]',\n memberIds: '$[1].memberIds',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['groupId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAnswersOptions {\n /**\n * Member IDs. If no member ID is provided, answers for all members will be returned. See the Members API for more details.\n * @format GUID\n * @maxSize 500\n */\n memberIds?: string[];\n paging?: Paging;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/questions-proxy',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/questions-proxy',\n destPath: '',\n },\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'editor-flow.wixapps.net': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'groups.wixapps.net': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n {\n srcPath: '/social-groups-proxy/api/questions',\n destPath: '',\n },\n {\n srcPath: '/_api/questions-proxy',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/social-groups-proxy/questions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_groups_membership-questions';\n\n/**\n * Retrieves the membership questions for a group.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n */\nexport function listMembershipQuestions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listMembershipQuestions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.social_groups.v2.membership_question',\n method: 'GET' as any,\n methodFqn:\n 'wix.social.groups.api.v2.MembershipQuestionsService.ListMembershipQuestions',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({\n protoPath: '/v2/membership-questions/{groupId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n\n fallback: [\n {\n method: 'GET' as any,\n url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({\n protoPath: '/v2/membership-questions/{groupId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __listMembershipQuestions;\n}\n\n/**\n * Creates membership questions if none have been set up. Otherwise, replaces all existing questions.\n *\n * Providing an empty array means that members won't have to answer any question when joining the group.\n * Only admins can create or replace membership questions.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n */\nexport function createOrReplaceAllMembershipQuestions(\n payload: object\n): RequestOptionsFactory<any> {\n function __createOrReplaceAllMembershipQuestions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.social_groups.v2.membership_question',\n method: 'PUT' as any,\n methodFqn:\n 'wix.social.groups.api.v2.MembershipQuestionsService.CreateOrReplaceAllMembershipQuestions',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({\n protoPath: '/v2/membership-questions/{groupId}',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createOrReplaceAllMembershipQuestions;\n}\n\n/**\n * Retrieves the answers to the membership questions, given the provided filters.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n */\nexport function listAnswers(payload: object): RequestOptionsFactory<any> {\n function __listAnswers({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.social_groups.v2.membership_question',\n method: 'POST' as any,\n methodFqn:\n 'wix.social.groups.api.v2.MembershipQuestionsService.ListAnswers',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({\n protoPath: '/v2/membership-questions/{groupId}/answers',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __listAnswers;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateOrReplaceAllMembershipQuestionsOptions,\n CreateOrReplaceAllMembershipQuestionsResponse,\n ListAnswersOptions,\n ListAnswersResponse,\n ListMembershipQuestionsResponse,\n createOrReplaceAllMembershipQuestions as universalCreateOrReplaceAllMembershipQuestions,\n listAnswers as universalListAnswers,\n listMembershipQuestions as universalListMembershipQuestions,\n} from './social-groups-v2-membership-question-membership-questions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/groups' };\n\nexport function listMembershipQuestions(\n httpClient: HttpClient\n): ListMembershipQuestionsSignature {\n return (groupId: string) =>\n universalListMembershipQuestions(\n groupId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListMembershipQuestionsSignature {\n /**\n * Retrieves the membership questions for a group.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param - Group ID.\n */\n (groupId: string): Promise<\n NonNullablePaths<\n ListMembershipQuestionsResponse,\n `questions` | `questions.${number}.required` | `questions.${number}.text`,\n 4\n >\n >;\n}\n\nexport function createOrReplaceAllMembershipQuestions(\n httpClient: HttpClient\n): CreateOrReplaceAllMembershipQuestionsSignature {\n return (\n groupId: string,\n options?: CreateOrReplaceAllMembershipQuestionsOptions\n ) =>\n universalCreateOrReplaceAllMembershipQuestions(\n groupId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateOrReplaceAllMembershipQuestionsSignature {\n /**\n * Creates membership questions if none have been set up. Otherwise, replaces all existing questions.\n *\n * Providing an empty array means that members won't have to answer any question when joining the group.\n * Only admins can create or replace membership questions.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param - Group ID.\n */\n (\n groupId: string,\n options?: CreateOrReplaceAllMembershipQuestionsOptions\n ): Promise<\n NonNullablePaths<\n CreateOrReplaceAllMembershipQuestionsResponse,\n `questions` | `questions.${number}.required` | `questions.${number}.text`,\n 4\n >\n >;\n}\n\nexport function listAnswers(httpClient: HttpClient): ListAnswersSignature {\n return (groupId: string, options?: ListAnswersOptions) =>\n universalListAnswers(\n groupId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAnswersSignature {\n /**\n * Retrieves the answers to the membership questions, given the provided filters.\n *\n * >**Note:**\n * >This endpoint requires [visitor or member authentication](https://dev.wix.com/docs/rest/articles/getting-started/access-types-and-permissions).\n * @param - Group ID.\n */\n (groupId: string, options?: ListAnswersOptions): Promise<\n NonNullablePaths<\n ListAnswersResponse,\n `memberAnswers` | `memberAnswers.${number}.memberId`,\n 4\n >\n >;\n}\n\nexport {\n CreateOrReplaceAllMembershipQuestionsOptions,\n CreateOrReplaceAllMembershipQuestionsRequest,\n CreateOrReplaceAllMembershipQuestionsResponse,\n ListAnswerCountsRequest,\n ListAnswerCountsResponse,\n ListAnswersOptions,\n ListAnswersRequest,\n ListAnswersResponse,\n ListMembershipQuestionsRequest,\n ListMembershipQuestionsResponse,\n MemberAnswerCount,\n MemberMembershipQuestionAnswers,\n MembershipQuestion,\n MembershipQuestionAnswer,\n Paging,\n PagingMetadata,\n} from './social-groups-v2-membership-question-membership-questions.universal.js';\n","import {\n listMembershipQuestions as publicListMembershipQuestions,\n createOrReplaceAllMembershipQuestions as publicCreateOrReplaceAllMembershipQuestions,\n listAnswers as publicListAnswers,\n} from './social-groups-v2-membership-question-membership-questions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listMembershipQuestions: MaybeContext<\n BuildRESTFunction<typeof publicListMembershipQuestions> &\n typeof publicListMembershipQuestions\n> = /*#__PURE__*/ createRESTModule(publicListMembershipQuestions);\nexport const createOrReplaceAllMembershipQuestions: MaybeContext<\n BuildRESTFunction<typeof publicCreateOrReplaceAllMembershipQuestions> &\n typeof publicCreateOrReplaceAllMembershipQuestions\n> = /*#__PURE__*/ createRESTModule(publicCreateOrReplaceAllMembershipQuestions);\nexport const listAnswers: MaybeContext<\n BuildRESTFunction<typeof publicListAnswers> & typeof publicListAnswers\n> = /*#__PURE__*/ createRESTModule(publicListAnswers);\n\nexport {\n MembershipQuestion,\n ListMembershipQuestionsRequest,\n ListMembershipQuestionsResponse,\n CreateOrReplaceAllMembershipQuestionsRequest,\n CreateOrReplaceAllMembershipQuestionsResponse,\n ListAnswersRequest,\n Paging,\n ListAnswersResponse,\n MemberMembershipQuestionAnswers,\n MembershipQuestionAnswer,\n PagingMetadata,\n ListAnswerCountsRequest,\n ListAnswerCountsResponse,\n MemberAnswerCount,\n CreateOrReplaceAllMembershipQuestionsOptions,\n ListAnswersOptions,\n} from './social-groups-v2-membership-question-membership-questions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+CAAAA;AAAA,EAAA,mBAAAC;AAAA,EAAA,+B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AA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnFA,IAAAC,uBAAiC;AAG1B,IAAMC,2BAGK,2DAAiBA,wBAA6B;AACzD,IAAMC,yCAGK,2DAAiBA,sCAA2C;AACvE,IAAMC,eAEK,2DAAiBA,YAAiB;","names":["createOrReplaceAllMembershipQuestions","listAnswers","listMembershipQuestions","import_rest_modules","listMembershipQuestions","sdkTransformError","createOrReplaceAllMembershipQuestions","listAnswers","listMembershipQuestions","createOrReplaceAllMembershipQuestions","listAnswers","import_rest_modules","listMembershipQuestions","createOrReplaceAllMembershipQuestions","listAnswers"]}
@@ -1,295 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.typings.ts
21
- var index_typings_exports = {};
22
- __export(index_typings_exports, {
23
- createOrReplaceAllMembershipQuestions: () => createOrReplaceAllMembershipQuestions2,
24
- listAnswers: () => listAnswers2,
25
- listMembershipQuestions: () => listMembershipQuestions2
26
- });
27
- module.exports = __toCommonJS(index_typings_exports);
28
-
29
- // src/social-groups-v2-membership-question-membership-questions.universal.ts
30
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
31
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
32
-
33
- // src/social-groups-v2-membership-question-membership-questions.http.ts
34
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
35
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
36
- function resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl(opts) {
37
- const domainToMappings = {
38
- "api._api_base_domain_": [
39
- {
40
- srcPath: "/questions-proxy",
41
- destPath: ""
42
- }
43
- ],
44
- _: [
45
- {
46
- srcPath: "/_api/questions-proxy",
47
- destPath: ""
48
- },
49
- {
50
- srcPath: "/_api/social-groups-proxy/questions",
51
- destPath: ""
52
- }
53
- ],
54
- "*.dev.wix-code.com": [
55
- {
56
- srcPath: "/_api/social-groups-proxy/questions",
57
- destPath: ""
58
- }
59
- ],
60
- "editor-flow.wixapps.net": [
61
- {
62
- srcPath: "/_api/social-groups-proxy/questions",
63
- destPath: ""
64
- }
65
- ],
66
- "editor._base_domain_": [
67
- {
68
- srcPath: "/_api/social-groups-proxy/questions",
69
- destPath: ""
70
- }
71
- ],
72
- "blocks._base_domain_": [
73
- {
74
- srcPath: "/_api/social-groups-proxy/questions",
75
- destPath: ""
76
- }
77
- ],
78
- "create.editorx": [
79
- {
80
- srcPath: "/_api/social-groups-proxy/questions",
81
- destPath: ""
82
- }
83
- ],
84
- "editor.wixapps.net": [
85
- {
86
- srcPath: "/_api/social-groups-proxy/questions",
87
- destPath: ""
88
- }
89
- ],
90
- "groups.wixapps.net": [
91
- {
92
- srcPath: "/_api/social-groups-proxy/questions",
93
- destPath: ""
94
- }
95
- ],
96
- "manage._base_domain_": [
97
- {
98
- srcPath: "/_api/social-groups-proxy/questions",
99
- destPath: ""
100
- },
101
- {
102
- srcPath: "/social-groups-proxy/api/questions",
103
- destPath: ""
104
- },
105
- {
106
- srcPath: "/_api/questions-proxy",
107
- destPath: ""
108
- }
109
- ],
110
- "www._base_domain_": [
111
- {
112
- srcPath: "/_api/social-groups-proxy/questions",
113
- destPath: ""
114
- }
115
- ],
116
- "www.wixapis.com": [
117
- {
118
- srcPath: "/social-groups-proxy/questions",
119
- destPath: ""
120
- }
121
- ]
122
- };
123
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
124
- }
125
- var PACKAGE_NAME = "@wix/auto_sdk_groups_membership-questions";
126
- function listMembershipQuestions(payload) {
127
- function __listMembershipQuestions({ host }) {
128
- const metadata = {
129
- entityFqdn: "wix.social_groups.v2.membership_question",
130
- method: "GET",
131
- methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListMembershipQuestions",
132
- packageName: PACKAGE_NAME,
133
- migrationOptions: {
134
- optInTransformResponse: true
135
- },
136
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
137
- protoPath: "/v2/membership-questions/{groupId}",
138
- data: payload,
139
- host
140
- }),
141
- params: (0, import_rest_modules.toURLSearchParams)(payload),
142
- fallback: [
143
- {
144
- method: "GET",
145
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
146
- protoPath: "/v2/membership-questions/{groupId}",
147
- data: payload,
148
- host
149
- }),
150
- params: (0, import_rest_modules.toURLSearchParams)(payload)
151
- }
152
- ]
153
- };
154
- return metadata;
155
- }
156
- return __listMembershipQuestions;
157
- }
158
- function createOrReplaceAllMembershipQuestions(payload) {
159
- function __createOrReplaceAllMembershipQuestions({ host }) {
160
- const metadata = {
161
- entityFqdn: "wix.social_groups.v2.membership_question",
162
- method: "PUT",
163
- methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.CreateOrReplaceAllMembershipQuestions",
164
- packageName: PACKAGE_NAME,
165
- migrationOptions: {
166
- optInTransformResponse: true
167
- },
168
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
169
- protoPath: "/v2/membership-questions/{groupId}",
170
- data: payload,
171
- host
172
- }),
173
- data: payload
174
- };
175
- return metadata;
176
- }
177
- return __createOrReplaceAllMembershipQuestions;
178
- }
179
- function listAnswers(payload) {
180
- function __listAnswers({ host }) {
181
- const metadata = {
182
- entityFqdn: "wix.social_groups.v2.membership_question",
183
- method: "POST",
184
- methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListAnswers",
185
- packageName: PACKAGE_NAME,
186
- migrationOptions: {
187
- optInTransformResponse: true
188
- },
189
- url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
190
- protoPath: "/v2/membership-questions/{groupId}/answers",
191
- data: payload,
192
- host
193
- }),
194
- data: payload
195
- };
196
- return metadata;
197
- }
198
- return __listAnswers;
199
- }
200
-
201
- // src/social-groups-v2-membership-question-membership-questions.universal.ts
202
- async function listMembershipQuestions2(groupId) {
203
- const { httpClient, sideEffects } = arguments[1];
204
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ groupId });
205
- const reqOpts = listMembershipQuestions(
206
- payload
207
- );
208
- sideEffects?.onSiteCall?.();
209
- try {
210
- const result = await httpClient.request(reqOpts);
211
- sideEffects?.onSuccess?.(result);
212
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
213
- } catch (err) {
214
- const transformedError = (0, import_transform_error.transformError)(
215
- err,
216
- {
217
- spreadPathsToArguments: {},
218
- explicitPathsToArguments: { groupId: "$[0]" },
219
- singleArgumentUnchanged: false
220
- },
221
- ["groupId"]
222
- );
223
- sideEffects?.onError?.(err);
224
- throw transformedError;
225
- }
226
- }
227
- async function createOrReplaceAllMembershipQuestions2(groupId, options) {
228
- const { httpClient, sideEffects } = arguments[2];
229
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
230
- groupId,
231
- questions: options?.questions
232
- });
233
- const reqOpts = createOrReplaceAllMembershipQuestions(
234
- payload
235
- );
236
- sideEffects?.onSiteCall?.();
237
- try {
238
- const result = await httpClient.request(reqOpts);
239
- sideEffects?.onSuccess?.(result);
240
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
241
- } catch (err) {
242
- const transformedError = (0, import_transform_error.transformError)(
243
- err,
244
- {
245
- spreadPathsToArguments: {},
246
- explicitPathsToArguments: {
247
- groupId: "$[0]",
248
- questions: "$[1].questions"
249
- },
250
- singleArgumentUnchanged: false
251
- },
252
- ["groupId", "options"]
253
- );
254
- sideEffects?.onError?.(err);
255
- throw transformedError;
256
- }
257
- }
258
- async function listAnswers2(groupId, options) {
259
- const { httpClient, sideEffects } = arguments[2];
260
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
261
- groupId,
262
- memberIds: options?.memberIds,
263
- paging: options?.paging
264
- });
265
- const reqOpts = listAnswers(payload);
266
- sideEffects?.onSiteCall?.();
267
- try {
268
- const result = await httpClient.request(reqOpts);
269
- sideEffects?.onSuccess?.(result);
270
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
271
- } catch (err) {
272
- const transformedError = (0, import_transform_error.transformError)(
273
- err,
274
- {
275
- spreadPathsToArguments: {},
276
- explicitPathsToArguments: {
277
- groupId: "$[0]",
278
- memberIds: "$[1].memberIds",
279
- paging: "$[1].paging"
280
- },
281
- singleArgumentUnchanged: false
282
- },
283
- ["groupId", "options"]
284
- );
285
- sideEffects?.onError?.(err);
286
- throw transformedError;
287
- }
288
- }
289
- // Annotate the CommonJS export names for ESM import in node:
290
- 0 && (module.exports = {
291
- createOrReplaceAllMembershipQuestions,
292
- listAnswers,
293
- listMembershipQuestions
294
- });
295
- //# sourceMappingURL=index.typings.js.map