@wix/auto_sdk_groups_membership-questions 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +51 -1
- package/build/cjs/index.js +310 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +185 -1
- package/build/cjs/index.typings.js +279 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +132 -1
- package/build/cjs/meta.js +246 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +51 -0
- package/build/es/index.mjs +287 -0
- package/build/es/index.mjs.map +1 -0
- package/build/{internal/cjs/src/social-groups-v2-membership-question-membership-questions.universal.d.ts → es/index.typings.d.mts} +22 -20
- package/build/es/index.typings.mjs +256 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/{src/social-groups-v2-membership-question-membership-questions.types.d.ts → meta.d.mts} +36 -28
- package/build/es/meta.mjs +220 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +51 -1
- package/build/internal/cjs/index.js +310 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +185 -1
- package/build/internal/cjs/index.typings.js +279 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +132 -1
- package/build/internal/cjs/meta.js +246 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +51 -0
- package/build/internal/es/index.mjs +287 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/{es/src/social-groups-v2-membership-question-membership-questions.universal.d.ts → internal/es/index.typings.d.mts} +22 -20
- package/build/internal/es/index.typings.mjs +256 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/{cjs/src/social-groups-v2-membership-question-membership-questions.types.d.ts → es/meta.d.mts} +36 -28
- package/build/internal/es/meta.mjs +220 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +11 -9
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.context.d.ts +0 -6
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.context.js +0 -9
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.context.js.map +0 -1
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.http.d.ts +0 -25
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.http.js +0 -181
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.http.js.map +0 -1
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.meta.d.ts +0 -21
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.meta.js +0 -85
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.meta.js.map +0 -1
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.public.d.ts +0 -42
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.public.js +0 -24
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.public.js.map +0 -1
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.types.d.ts +0 -124
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.types.js +0 -3
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.types.js.map +0 -1
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.universal.d.ts +0 -183
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.universal.js +0 -143
- package/build/cjs/src/social-groups-v2-membership-question-membership-questions.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/social-groups-v2-membership-question-membership-questions.context.d.ts +0 -6
- package/build/es/src/social-groups-v2-membership-question-membership-questions.context.js +0 -6
- package/build/es/src/social-groups-v2-membership-question-membership-questions.context.js.map +0 -1
- package/build/es/src/social-groups-v2-membership-question-membership-questions.http.d.ts +0 -25
- package/build/es/src/social-groups-v2-membership-question-membership-questions.http.js +0 -175
- package/build/es/src/social-groups-v2-membership-question-membership-questions.http.js.map +0 -1
- package/build/es/src/social-groups-v2-membership-question-membership-questions.meta.d.ts +0 -21
- package/build/es/src/social-groups-v2-membership-question-membership-questions.meta.js +0 -56
- package/build/es/src/social-groups-v2-membership-question-membership-questions.meta.js.map +0 -1
- package/build/es/src/social-groups-v2-membership-question-membership-questions.public.d.ts +0 -42
- package/build/es/src/social-groups-v2-membership-question-membership-questions.public.js +0 -18
- package/build/es/src/social-groups-v2-membership-question-membership-questions.public.js.map +0 -1
- package/build/es/src/social-groups-v2-membership-question-membership-questions.types.js +0 -2
- package/build/es/src/social-groups-v2-membership-question-membership-questions.types.js.map +0 -1
- package/build/es/src/social-groups-v2-membership-question-membership-questions.universal.js +0 -114
- package/build/es/src/social-groups-v2-membership-question-membership-questions.universal.js.map +0 -1
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.context.d.ts +0 -6
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.context.js +0 -9
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.context.js.map +0 -1
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.http.d.ts +0 -25
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.http.js +0 -181
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.http.js.map +0 -1
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.meta.d.ts +0 -21
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.meta.js +0 -85
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.meta.js.map +0 -1
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.public.d.ts +0 -42
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.public.js +0 -24
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.public.js.map +0 -1
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.types.js +0 -3
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.types.js.map +0 -1
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.universal.js +0 -143
- package/build/internal/cjs/src/social-groups-v2-membership-question-membership-questions.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.context.d.ts +0 -6
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.context.js +0 -6
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.context.js.map +0 -1
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.http.d.ts +0 -25
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.http.js +0 -175
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.http.js.map +0 -1
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.meta.d.ts +0 -21
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.meta.js +0 -56
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.meta.js.map +0 -1
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.public.d.ts +0 -42
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.public.js +0 -18
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.public.js.map +0 -1
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.types.d.ts +0 -124
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.types.js +0 -2
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.types.js.map +0 -1
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.universal.d.ts +0 -183
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.universal.js +0 -114
- package/build/internal/es/src/social-groups-v2-membership-question-membership-questions.universal.js.map +0 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// src/social-groups-v2-membership-question-membership-questions.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/social-groups-v2-membership-question-membership-questions.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
11
|
+
function resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl(opts) {
|
|
12
|
+
const domainToMappings = {
|
|
13
|
+
"api._api_base_domain_": [
|
|
14
|
+
{
|
|
15
|
+
srcPath: "/questions-proxy",
|
|
16
|
+
destPath: ""
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
_: [
|
|
20
|
+
{
|
|
21
|
+
srcPath: "/_api/questions-proxy",
|
|
22
|
+
destPath: ""
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
26
|
+
destPath: ""
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"*.dev.wix-code.com": [
|
|
30
|
+
{
|
|
31
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
32
|
+
destPath: ""
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"editor-flow.wixapps.net": [
|
|
36
|
+
{
|
|
37
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
38
|
+
destPath: ""
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"editor._base_domain_": [
|
|
42
|
+
{
|
|
43
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
44
|
+
destPath: ""
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"blocks._base_domain_": [
|
|
48
|
+
{
|
|
49
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
50
|
+
destPath: ""
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"create.editorx": [
|
|
54
|
+
{
|
|
55
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
56
|
+
destPath: ""
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"editor.wixapps.net": [
|
|
60
|
+
{
|
|
61
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
62
|
+
destPath: ""
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"groups.wixapps.net": [
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
68
|
+
destPath: ""
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"manage._base_domain_": [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
74
|
+
destPath: ""
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/social-groups-proxy/api/questions",
|
|
78
|
+
destPath: ""
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"www._base_domain_": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
84
|
+
destPath: ""
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"www.wixapis.com": [
|
|
88
|
+
{
|
|
89
|
+
srcPath: "/social-groups-proxy/questions",
|
|
90
|
+
destPath: ""
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
95
|
+
}
|
|
96
|
+
var PACKAGE_NAME = "@wix/auto_sdk_groups_membership-questions";
|
|
97
|
+
function listMembershipQuestions(payload) {
|
|
98
|
+
function __listMembershipQuestions({ host }) {
|
|
99
|
+
const metadata = {
|
|
100
|
+
entityFqdn: "wix.social_groups.v2.membership_question",
|
|
101
|
+
method: "GET",
|
|
102
|
+
methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListMembershipQuestions",
|
|
103
|
+
packageName: PACKAGE_NAME,
|
|
104
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
105
|
+
protoPath: "/v2/membership-questions/{groupId}",
|
|
106
|
+
data: payload,
|
|
107
|
+
host
|
|
108
|
+
}),
|
|
109
|
+
params: toURLSearchParams(payload),
|
|
110
|
+
fallback: [
|
|
111
|
+
{
|
|
112
|
+
method: "GET",
|
|
113
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
114
|
+
protoPath: "/v2/membership-questions/{groupId}",
|
|
115
|
+
data: payload,
|
|
116
|
+
host
|
|
117
|
+
}),
|
|
118
|
+
params: toURLSearchParams(payload)
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
};
|
|
122
|
+
return metadata;
|
|
123
|
+
}
|
|
124
|
+
return __listMembershipQuestions;
|
|
125
|
+
}
|
|
126
|
+
function createOrReplaceAllMembershipQuestions(payload) {
|
|
127
|
+
function __createOrReplaceAllMembershipQuestions({ host }) {
|
|
128
|
+
const metadata = {
|
|
129
|
+
entityFqdn: "wix.social_groups.v2.membership_question",
|
|
130
|
+
method: "PUT",
|
|
131
|
+
methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.CreateOrReplaceAllMembershipQuestions",
|
|
132
|
+
packageName: PACKAGE_NAME,
|
|
133
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
134
|
+
protoPath: "/v2/membership-questions/{groupId}",
|
|
135
|
+
data: payload,
|
|
136
|
+
host
|
|
137
|
+
}),
|
|
138
|
+
data: payload
|
|
139
|
+
};
|
|
140
|
+
return metadata;
|
|
141
|
+
}
|
|
142
|
+
return __createOrReplaceAllMembershipQuestions;
|
|
143
|
+
}
|
|
144
|
+
function listAnswers(payload) {
|
|
145
|
+
function __listAnswers({ host }) {
|
|
146
|
+
const metadata = {
|
|
147
|
+
entityFqdn: "wix.social_groups.v2.membership_question",
|
|
148
|
+
method: "POST",
|
|
149
|
+
methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListAnswers",
|
|
150
|
+
packageName: PACKAGE_NAME,
|
|
151
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
152
|
+
protoPath: "/v2/membership-questions/{groupId}/answers",
|
|
153
|
+
data: payload,
|
|
154
|
+
host
|
|
155
|
+
}),
|
|
156
|
+
data: payload
|
|
157
|
+
};
|
|
158
|
+
return metadata;
|
|
159
|
+
}
|
|
160
|
+
return __listAnswers;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// src/social-groups-v2-membership-question-membership-questions.universal.ts
|
|
164
|
+
async function listMembershipQuestions2(groupId) {
|
|
165
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
166
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ groupId });
|
|
167
|
+
const reqOpts = listMembershipQuestions(
|
|
168
|
+
payload
|
|
169
|
+
);
|
|
170
|
+
sideEffects?.onSiteCall?.();
|
|
171
|
+
try {
|
|
172
|
+
const result = await httpClient.request(reqOpts);
|
|
173
|
+
sideEffects?.onSuccess?.(result);
|
|
174
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
175
|
+
} catch (err) {
|
|
176
|
+
const transformedError = sdkTransformError(
|
|
177
|
+
err,
|
|
178
|
+
{
|
|
179
|
+
spreadPathsToArguments: {},
|
|
180
|
+
explicitPathsToArguments: { groupId: "$[0]" },
|
|
181
|
+
singleArgumentUnchanged: false
|
|
182
|
+
},
|
|
183
|
+
["groupId"]
|
|
184
|
+
);
|
|
185
|
+
sideEffects?.onError?.(err);
|
|
186
|
+
throw transformedError;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async function createOrReplaceAllMembershipQuestions2(groupId, options) {
|
|
190
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
191
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
192
|
+
groupId,
|
|
193
|
+
questions: options?.questions
|
|
194
|
+
});
|
|
195
|
+
const reqOpts = createOrReplaceAllMembershipQuestions(
|
|
196
|
+
payload
|
|
197
|
+
);
|
|
198
|
+
sideEffects?.onSiteCall?.();
|
|
199
|
+
try {
|
|
200
|
+
const result = await httpClient.request(reqOpts);
|
|
201
|
+
sideEffects?.onSuccess?.(result);
|
|
202
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
203
|
+
} catch (err) {
|
|
204
|
+
const transformedError = sdkTransformError(
|
|
205
|
+
err,
|
|
206
|
+
{
|
|
207
|
+
spreadPathsToArguments: {},
|
|
208
|
+
explicitPathsToArguments: {
|
|
209
|
+
groupId: "$[0]",
|
|
210
|
+
questions: "$[1].questions"
|
|
211
|
+
},
|
|
212
|
+
singleArgumentUnchanged: false
|
|
213
|
+
},
|
|
214
|
+
["groupId", "options"]
|
|
215
|
+
);
|
|
216
|
+
sideEffects?.onError?.(err);
|
|
217
|
+
throw transformedError;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async function listAnswers2(groupId, options) {
|
|
221
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
222
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
223
|
+
groupId,
|
|
224
|
+
memberIds: options?.memberIds,
|
|
225
|
+
paging: options?.paging
|
|
226
|
+
});
|
|
227
|
+
const reqOpts = listAnswers(payload);
|
|
228
|
+
sideEffects?.onSiteCall?.();
|
|
229
|
+
try {
|
|
230
|
+
const result = await httpClient.request(reqOpts);
|
|
231
|
+
sideEffects?.onSuccess?.(result);
|
|
232
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
233
|
+
} catch (err) {
|
|
234
|
+
const transformedError = sdkTransformError(
|
|
235
|
+
err,
|
|
236
|
+
{
|
|
237
|
+
spreadPathsToArguments: {},
|
|
238
|
+
explicitPathsToArguments: {
|
|
239
|
+
groupId: "$[0]",
|
|
240
|
+
memberIds: "$[1].memberIds",
|
|
241
|
+
paging: "$[1].paging"
|
|
242
|
+
},
|
|
243
|
+
singleArgumentUnchanged: false
|
|
244
|
+
},
|
|
245
|
+
["groupId", "options"]
|
|
246
|
+
);
|
|
247
|
+
sideEffects?.onError?.(err);
|
|
248
|
+
throw transformedError;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
export {
|
|
252
|
+
createOrReplaceAllMembershipQuestions2 as createOrReplaceAllMembershipQuestions,
|
|
253
|
+
listAnswers2 as listAnswers,
|
|
254
|
+
listMembershipQuestions2 as listMembershipQuestions
|
|
255
|
+
};
|
|
256
|
+
//# sourceMappingURL=index.typings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/social-groups-v2-membership-question-membership-questions.universal.ts","../../../src/social-groups-v2-membership-question-membership-questions.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 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\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\ntype MembershipQuestionNonNullablePaths = `required` | `text`;\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 {\n [P in MembershipQuestionNonNullablePaths]: `questions.${number}.${P}`;\n }[MembershipQuestionNonNullablePaths]\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 {\n [P in MembershipQuestionNonNullablePaths]: `questions.${number}.${P}`;\n }[MembershipQuestionNonNullablePaths]\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 >\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 '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 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 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 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"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,yDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;A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;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,SAAS;AAAA,UACT,WAAW;AAAA,UACX,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW,SAAS;AAAA,IACvB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["listMembershipQuestions","createOrReplaceAllMembershipQuestions","listAnswers"]}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ListMembershipQuestionsRequest as ListMembershipQuestionsRequest$1, ListMembershipQuestionsResponse as ListMembershipQuestionsResponse$1, CreateOrReplaceAllMembershipQuestionsRequest as CreateOrReplaceAllMembershipQuestionsRequest$1, CreateOrReplaceAllMembershipQuestionsResponse as CreateOrReplaceAllMembershipQuestionsResponse$1, ListAnswersRequest as ListAnswersRequest$1, ListAnswersResponse as ListAnswersResponse$1 } from './index.typings.mjs';
|
|
2
|
+
import '@wix/sdk-types';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Question asked to members when joining a group.
|
|
3
6
|
* Only group admins can create or update membership questions
|
|
4
7
|
* and can set whether it is required to answer membership questions.
|
|
5
8
|
*/
|
|
6
|
-
|
|
9
|
+
interface MembershipQuestion {
|
|
7
10
|
/**
|
|
8
11
|
* Question ID.
|
|
9
12
|
* @format GUID
|
|
@@ -19,18 +22,18 @@ export interface MembershipQuestion {
|
|
|
19
22
|
*/
|
|
20
23
|
text?: string;
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
interface ListMembershipQuestionsRequest {
|
|
23
26
|
/**
|
|
24
27
|
* Group ID.
|
|
25
28
|
* @format GUID
|
|
26
29
|
*/
|
|
27
30
|
groupId: string;
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
interface ListMembershipQuestionsResponse {
|
|
30
33
|
/** Retrieved membership questions. */
|
|
31
34
|
questions?: MembershipQuestion[];
|
|
32
35
|
}
|
|
33
|
-
|
|
36
|
+
interface CreateOrReplaceAllMembershipQuestionsRequest {
|
|
34
37
|
/**
|
|
35
38
|
* Group ID.
|
|
36
39
|
* @format GUID
|
|
@@ -42,11 +45,11 @@ export interface CreateOrReplaceAllMembershipQuestionsRequest {
|
|
|
42
45
|
*/
|
|
43
46
|
questions?: MembershipQuestion[];
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
interface CreateOrReplaceAllMembershipQuestionsResponse {
|
|
46
49
|
/** Membership questions. */
|
|
47
50
|
questions?: MembershipQuestion[];
|
|
48
51
|
}
|
|
49
|
-
|
|
52
|
+
interface ListAnswersRequest {
|
|
50
53
|
/**
|
|
51
54
|
* Group ID.
|
|
52
55
|
* @format GUID
|
|
@@ -60,20 +63,20 @@ export interface ListAnswersRequest {
|
|
|
60
63
|
memberIds?: string[];
|
|
61
64
|
paging?: Paging;
|
|
62
65
|
}
|
|
63
|
-
|
|
66
|
+
interface Paging {
|
|
64
67
|
/** Number of items to load. */
|
|
65
68
|
limit?: number | null;
|
|
66
69
|
/** Number of items to skip in the current sort order. */
|
|
67
70
|
offset?: number | null;
|
|
68
71
|
}
|
|
69
|
-
|
|
72
|
+
interface ListAnswersResponse {
|
|
70
73
|
/** Answers to the membership questions, grouped by member. */
|
|
71
74
|
memberAnswers?: MemberMembershipQuestionAnswers[];
|
|
72
75
|
/** Membership questions by question ID. Includes only questions that have been answered by the specified members. */
|
|
73
76
|
questions?: Record<string, MembershipQuestion>;
|
|
74
77
|
metadata?: PagingMetadata;
|
|
75
78
|
}
|
|
76
|
-
|
|
79
|
+
interface MemberMembershipQuestionAnswers {
|
|
77
80
|
/**
|
|
78
81
|
* Member ID. See the Members API for more details.
|
|
79
82
|
* @format GUID
|
|
@@ -83,7 +86,7 @@ export interface MemberMembershipQuestionAnswers {
|
|
|
83
86
|
answers?: MembershipQuestionAnswer[];
|
|
84
87
|
}
|
|
85
88
|
/** Answer to a membership question. */
|
|
86
|
-
|
|
89
|
+
interface MembershipQuestionAnswer {
|
|
87
90
|
/**
|
|
88
91
|
* Question ID.
|
|
89
92
|
* @format GUID
|
|
@@ -95,7 +98,7 @@ export interface MembershipQuestionAnswer {
|
|
|
95
98
|
*/
|
|
96
99
|
text?: string | null;
|
|
97
100
|
}
|
|
98
|
-
|
|
101
|
+
interface PagingMetadata {
|
|
99
102
|
/** Number of items returned in the response. */
|
|
100
103
|
count?: number | null;
|
|
101
104
|
/** Offset that was requested. */
|
|
@@ -105,20 +108,25 @@ export interface PagingMetadata {
|
|
|
105
108
|
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
106
109
|
tooManyToCount?: boolean | null;
|
|
107
110
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
111
|
+
|
|
112
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
113
|
+
getUrl: (context: any) => string;
|
|
114
|
+
httpMethod: K;
|
|
115
|
+
path: string;
|
|
116
|
+
pathParams: M;
|
|
117
|
+
__requestType: T;
|
|
118
|
+
__originalRequestType: S;
|
|
119
|
+
__responseType: Q;
|
|
120
|
+
__originalResponseType: R;
|
|
121
|
+
};
|
|
122
|
+
declare function listMembershipQuestions(): __PublicMethodMetaInfo<'GET', {
|
|
123
|
+
groupId: string;
|
|
124
|
+
}, ListMembershipQuestionsRequest$1, ListMembershipQuestionsRequest, ListMembershipQuestionsResponse$1, ListMembershipQuestionsResponse>;
|
|
125
|
+
declare function createOrReplaceAllMembershipQuestions(): __PublicMethodMetaInfo<'PUT', {
|
|
126
|
+
groupId: string;
|
|
127
|
+
}, CreateOrReplaceAllMembershipQuestionsRequest$1, CreateOrReplaceAllMembershipQuestionsRequest, CreateOrReplaceAllMembershipQuestionsResponse$1, CreateOrReplaceAllMembershipQuestionsResponse>;
|
|
128
|
+
declare function listAnswers(): __PublicMethodMetaInfo<'POST', {
|
|
129
|
+
groupId: string;
|
|
130
|
+
}, ListAnswersRequest$1, ListAnswersRequest, ListAnswersResponse$1, ListAnswersResponse>;
|
|
131
|
+
|
|
132
|
+
export { type __PublicMethodMetaInfo, createOrReplaceAllMembershipQuestions, listAnswers, listMembershipQuestions };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// src/social-groups-v2-membership-question-membership-questions.http.ts
|
|
2
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
3
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
4
|
+
function resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl(opts) {
|
|
5
|
+
const domainToMappings = {
|
|
6
|
+
"api._api_base_domain_": [
|
|
7
|
+
{
|
|
8
|
+
srcPath: "/questions-proxy",
|
|
9
|
+
destPath: ""
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
_: [
|
|
13
|
+
{
|
|
14
|
+
srcPath: "/_api/questions-proxy",
|
|
15
|
+
destPath: ""
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
19
|
+
destPath: ""
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"*.dev.wix-code.com": [
|
|
23
|
+
{
|
|
24
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
25
|
+
destPath: ""
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"editor-flow.wixapps.net": [
|
|
29
|
+
{
|
|
30
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
31
|
+
destPath: ""
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"editor._base_domain_": [
|
|
35
|
+
{
|
|
36
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
37
|
+
destPath: ""
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"blocks._base_domain_": [
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
43
|
+
destPath: ""
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"create.editorx": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
49
|
+
destPath: ""
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"editor.wixapps.net": [
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
55
|
+
destPath: ""
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"groups.wixapps.net": [
|
|
59
|
+
{
|
|
60
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
61
|
+
destPath: ""
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"manage._base_domain_": [
|
|
65
|
+
{
|
|
66
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
67
|
+
destPath: ""
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
srcPath: "/social-groups-proxy/api/questions",
|
|
71
|
+
destPath: ""
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"www._base_domain_": [
|
|
75
|
+
{
|
|
76
|
+
srcPath: "/_api/social-groups-proxy/questions",
|
|
77
|
+
destPath: ""
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"www.wixapis.com": [
|
|
81
|
+
{
|
|
82
|
+
srcPath: "/social-groups-proxy/questions",
|
|
83
|
+
destPath: ""
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
88
|
+
}
|
|
89
|
+
var PACKAGE_NAME = "@wix/auto_sdk_groups_membership-questions";
|
|
90
|
+
function listMembershipQuestions(payload) {
|
|
91
|
+
function __listMembershipQuestions({ host }) {
|
|
92
|
+
const metadata = {
|
|
93
|
+
entityFqdn: "wix.social_groups.v2.membership_question",
|
|
94
|
+
method: "GET",
|
|
95
|
+
methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListMembershipQuestions",
|
|
96
|
+
packageName: PACKAGE_NAME,
|
|
97
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
98
|
+
protoPath: "/v2/membership-questions/{groupId}",
|
|
99
|
+
data: payload,
|
|
100
|
+
host
|
|
101
|
+
}),
|
|
102
|
+
params: toURLSearchParams(payload),
|
|
103
|
+
fallback: [
|
|
104
|
+
{
|
|
105
|
+
method: "GET",
|
|
106
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
107
|
+
protoPath: "/v2/membership-questions/{groupId}",
|
|
108
|
+
data: payload,
|
|
109
|
+
host
|
|
110
|
+
}),
|
|
111
|
+
params: toURLSearchParams(payload)
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
};
|
|
115
|
+
return metadata;
|
|
116
|
+
}
|
|
117
|
+
return __listMembershipQuestions;
|
|
118
|
+
}
|
|
119
|
+
function createOrReplaceAllMembershipQuestions(payload) {
|
|
120
|
+
function __createOrReplaceAllMembershipQuestions({ host }) {
|
|
121
|
+
const metadata = {
|
|
122
|
+
entityFqdn: "wix.social_groups.v2.membership_question",
|
|
123
|
+
method: "PUT",
|
|
124
|
+
methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.CreateOrReplaceAllMembershipQuestions",
|
|
125
|
+
packageName: PACKAGE_NAME,
|
|
126
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
127
|
+
protoPath: "/v2/membership-questions/{groupId}",
|
|
128
|
+
data: payload,
|
|
129
|
+
host
|
|
130
|
+
}),
|
|
131
|
+
data: payload
|
|
132
|
+
};
|
|
133
|
+
return metadata;
|
|
134
|
+
}
|
|
135
|
+
return __createOrReplaceAllMembershipQuestions;
|
|
136
|
+
}
|
|
137
|
+
function listAnswers(payload) {
|
|
138
|
+
function __listAnswers({ host }) {
|
|
139
|
+
const metadata = {
|
|
140
|
+
entityFqdn: "wix.social_groups.v2.membership_question",
|
|
141
|
+
method: "POST",
|
|
142
|
+
methodFqn: "wix.social.groups.api.v2.MembershipQuestionsService.ListAnswers",
|
|
143
|
+
packageName: PACKAGE_NAME,
|
|
144
|
+
url: resolveWixSocialGroupsApiV2MembershipQuestionsServiceUrl({
|
|
145
|
+
protoPath: "/v2/membership-questions/{groupId}/answers",
|
|
146
|
+
data: payload,
|
|
147
|
+
host
|
|
148
|
+
}),
|
|
149
|
+
data: payload
|
|
150
|
+
};
|
|
151
|
+
return metadata;
|
|
152
|
+
}
|
|
153
|
+
return __listAnswers;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// src/social-groups-v2-membership-question-membership-questions.meta.ts
|
|
157
|
+
function listMembershipQuestions2() {
|
|
158
|
+
const payload = { groupId: ":groupId" };
|
|
159
|
+
const getRequestOptions = listMembershipQuestions(
|
|
160
|
+
payload
|
|
161
|
+
);
|
|
162
|
+
const getUrl = (context) => {
|
|
163
|
+
const { url } = getRequestOptions(context);
|
|
164
|
+
return url;
|
|
165
|
+
};
|
|
166
|
+
return {
|
|
167
|
+
getUrl,
|
|
168
|
+
httpMethod: "GET",
|
|
169
|
+
path: "/v2/membership-questions/{groupId}",
|
|
170
|
+
pathParams: { groupId: "groupId" },
|
|
171
|
+
__requestType: null,
|
|
172
|
+
__originalRequestType: null,
|
|
173
|
+
__responseType: null,
|
|
174
|
+
__originalResponseType: null
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function createOrReplaceAllMembershipQuestions2() {
|
|
178
|
+
const payload = { groupId: ":groupId" };
|
|
179
|
+
const getRequestOptions = createOrReplaceAllMembershipQuestions(
|
|
180
|
+
payload
|
|
181
|
+
);
|
|
182
|
+
const getUrl = (context) => {
|
|
183
|
+
const { url } = getRequestOptions(context);
|
|
184
|
+
return url;
|
|
185
|
+
};
|
|
186
|
+
return {
|
|
187
|
+
getUrl,
|
|
188
|
+
httpMethod: "PUT",
|
|
189
|
+
path: "/v2/membership-questions/{groupId}",
|
|
190
|
+
pathParams: { groupId: "groupId" },
|
|
191
|
+
__requestType: null,
|
|
192
|
+
__originalRequestType: null,
|
|
193
|
+
__responseType: null,
|
|
194
|
+
__originalResponseType: null
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function listAnswers2() {
|
|
198
|
+
const payload = { groupId: ":groupId" };
|
|
199
|
+
const getRequestOptions = listAnswers(payload);
|
|
200
|
+
const getUrl = (context) => {
|
|
201
|
+
const { url } = getRequestOptions(context);
|
|
202
|
+
return url;
|
|
203
|
+
};
|
|
204
|
+
return {
|
|
205
|
+
getUrl,
|
|
206
|
+
httpMethod: "POST",
|
|
207
|
+
path: "/v2/membership-questions/{groupId}/answers",
|
|
208
|
+
pathParams: { groupId: "groupId" },
|
|
209
|
+
__requestType: null,
|
|
210
|
+
__originalRequestType: null,
|
|
211
|
+
__responseType: null,
|
|
212
|
+
__originalResponseType: null
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
export {
|
|
216
|
+
createOrReplaceAllMembershipQuestions2 as createOrReplaceAllMembershipQuestions,
|
|
217
|
+
listAnswers2 as listAnswers,
|
|
218
|
+
listMembershipQuestions2 as listMembershipQuestions
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=meta.mjs.map
|