@wix/auto_sdk_online-programs_quizzes 1.0.0
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 +63 -0
- package/build/cjs/index.js +506 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +525 -0
- package/build/cjs/index.typings.js +451 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +318 -0
- package/build/cjs/meta.js +385 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +63 -0
- package/build/es/index.mjs +475 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +525 -0
- package/build/es/index.typings.mjs +420 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +318 -0
- package/build/es/meta.mjs +353 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +63 -0
- package/build/internal/cjs/index.js +506 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +525 -0
- package/build/internal/cjs/index.typings.js +451 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +318 -0
- package/build/internal/cjs/meta.js +385 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/es/index.d.mts +63 -0
- package/build/internal/es/index.mjs +475 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +525 -0
- package/build/internal/es/index.typings.mjs +420 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +318 -0
- package/build/internal/es/meta.mjs +353 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { Quiz, CloneQuizResponse, BulkCreateQuizOptions, BulkCreateQuizResponse, BulkCloneQuizOptions, BulkCloneQuizResponse, DeleteQuizResponse } from './index.typings.js';
|
|
3
|
+
export { ActionEvent, ApplicationError, BulkActionMetadata, BulkCloneQuizRequest, BulkCreateQuizRequest, BulkQuizResult, CloneQuizRequest, CreateQuizRequest, CreateQuizResponse, DeleteQuizRequest, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, FileFormat, FileFormatWithLiterals, FileUploadField, GetQuizRequest, GetQuizResponse, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, LongTextField, MessageEnvelope, MultiChoiceField, NumericField, QuizField, QuizFieldFieldTypeOneOf, QuizSettings, RestoreInfo, ShortTextField, SingleChoiceField, UpdateQuizRequest, UpdateQuizResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function createQuiz$1(httpClient: HttpClient): CreateQuizSignature;
|
|
6
|
+
interface CreateQuizSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Creates quiz
|
|
9
|
+
* @param - Quiz to created
|
|
10
|
+
* @returns Created quiz
|
|
11
|
+
*/
|
|
12
|
+
(quiz: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 5>): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>>;
|
|
13
|
+
}
|
|
14
|
+
declare function cloneQuiz$1(httpClient: HttpClient): CloneQuizSignature;
|
|
15
|
+
interface CloneQuizSignature {
|
|
16
|
+
/**
|
|
17
|
+
* Clones quiz
|
|
18
|
+
* @param - ID of the quiz to be cloned
|
|
19
|
+
*/
|
|
20
|
+
(quizId: string): Promise<NonNullablePaths<CloneQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 5>>;
|
|
21
|
+
}
|
|
22
|
+
declare function bulkCreateQuiz$1(httpClient: HttpClient): BulkCreateQuizSignature;
|
|
23
|
+
interface BulkCreateQuizSignature {
|
|
24
|
+
/**
|
|
25
|
+
* Creates quizzes
|
|
26
|
+
* @param - Quizzes to be created
|
|
27
|
+
*/
|
|
28
|
+
(quizzes: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 5>[], options?: BulkCreateQuizOptions): Promise<NonNullablePaths<BulkCreateQuizResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description`, 6>>;
|
|
29
|
+
}
|
|
30
|
+
declare function bulkCloneQuiz$1(httpClient: HttpClient): BulkCloneQuizSignature;
|
|
31
|
+
interface BulkCloneQuizSignature {
|
|
32
|
+
/**
|
|
33
|
+
* Clones quizzes
|
|
34
|
+
* @param - IDs of the quizzes to clone.
|
|
35
|
+
*/
|
|
36
|
+
(quizIds: string[], options?: BulkCloneQuizOptions): Promise<NonNullablePaths<BulkCloneQuizResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
37
|
+
}
|
|
38
|
+
declare function getQuiz$1(httpClient: HttpClient): GetQuizSignature;
|
|
39
|
+
interface GetQuizSignature {
|
|
40
|
+
/**
|
|
41
|
+
* Reads quiz by ID
|
|
42
|
+
* @param - ID of the quiz
|
|
43
|
+
* @returns Requested quiz
|
|
44
|
+
*/
|
|
45
|
+
(quizId: string): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>>;
|
|
46
|
+
}
|
|
47
|
+
declare function deleteQuiz$1(httpClient: HttpClient): DeleteQuizSignature;
|
|
48
|
+
interface DeleteQuizSignature {
|
|
49
|
+
/**
|
|
50
|
+
* Deletes quiz
|
|
51
|
+
* @param - ID of quiz
|
|
52
|
+
*/
|
|
53
|
+
(quizId: string): Promise<NonNullablePaths<DeleteQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 5>>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare const createQuiz: MaybeContext<BuildRESTFunction<typeof createQuiz$1> & typeof createQuiz$1>;
|
|
57
|
+
declare const cloneQuiz: MaybeContext<BuildRESTFunction<typeof cloneQuiz$1> & typeof cloneQuiz$1>;
|
|
58
|
+
declare const bulkCreateQuiz: MaybeContext<BuildRESTFunction<typeof bulkCreateQuiz$1> & typeof bulkCreateQuiz$1>;
|
|
59
|
+
declare const bulkCloneQuiz: MaybeContext<BuildRESTFunction<typeof bulkCloneQuiz$1> & typeof bulkCloneQuiz$1>;
|
|
60
|
+
declare const getQuiz: MaybeContext<BuildRESTFunction<typeof getQuiz$1> & typeof getQuiz$1>;
|
|
61
|
+
declare const deleteQuiz: MaybeContext<BuildRESTFunction<typeof deleteQuiz$1> & typeof deleteQuiz$1>;
|
|
62
|
+
|
|
63
|
+
export { BulkCloneQuizOptions, BulkCloneQuizResponse, BulkCreateQuizOptions, BulkCreateQuizResponse, CloneQuizResponse, DeleteQuizResponse, Quiz, bulkCloneQuiz, bulkCreateQuiz, cloneQuiz, createQuiz, deleteQuiz, getQuiz };
|
|
@@ -0,0 +1,506 @@
|
|
|
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
|
+
FileFormat: () => FileFormat,
|
|
24
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
25
|
+
bulkCloneQuiz: () => bulkCloneQuiz4,
|
|
26
|
+
bulkCreateQuiz: () => bulkCreateQuiz4,
|
|
27
|
+
cloneQuiz: () => cloneQuiz4,
|
|
28
|
+
createQuiz: () => createQuiz4,
|
|
29
|
+
deleteQuiz: () => deleteQuiz4,
|
|
30
|
+
getQuiz: () => getQuiz4
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(index_exports);
|
|
33
|
+
|
|
34
|
+
// src/achievements-quizzes-v1-quiz-quizzes.universal.ts
|
|
35
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
36
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
37
|
+
|
|
38
|
+
// src/achievements-quizzes-v1-quiz-quizzes.http.ts
|
|
39
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
40
|
+
var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
41
|
+
var import_float2 = require("@wix/sdk-runtime/transformations/float");
|
|
42
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
43
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
44
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
45
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
46
|
+
function resolveWixAchievementsQuizzesV1QuizServiceUrl(opts) {
|
|
47
|
+
const domainToMappings = {};
|
|
48
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
49
|
+
}
|
|
50
|
+
var PACKAGE_NAME = "@wix/auto_sdk_online-programs_quizzes";
|
|
51
|
+
function createQuiz(payload) {
|
|
52
|
+
function __createQuiz({ host }) {
|
|
53
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
54
|
+
{
|
|
55
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
56
|
+
paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
60
|
+
paths: [
|
|
61
|
+
{ path: "quiz.fields.score" },
|
|
62
|
+
{ path: "quiz.fields.numeric.rightAnswer" }
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]);
|
|
66
|
+
const metadata = {
|
|
67
|
+
entityFqdn: "wix.achievements.quizzes.v1.quiz",
|
|
68
|
+
method: "POST",
|
|
69
|
+
methodFqn: "wix.achievements.quizzes.v1.QuizService.CreateQuiz",
|
|
70
|
+
packageName: PACKAGE_NAME,
|
|
71
|
+
url: resolveWixAchievementsQuizzesV1QuizServiceUrl({
|
|
72
|
+
protoPath: "/v1/quizzes",
|
|
73
|
+
data: serializedData,
|
|
74
|
+
host
|
|
75
|
+
}),
|
|
76
|
+
data: serializedData,
|
|
77
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
78
|
+
{
|
|
79
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
80
|
+
paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
84
|
+
paths: [
|
|
85
|
+
{ path: "quiz.fields.score" },
|
|
86
|
+
{ path: "quiz.fields.numeric.rightAnswer" }
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
])
|
|
90
|
+
};
|
|
91
|
+
return metadata;
|
|
92
|
+
}
|
|
93
|
+
return __createQuiz;
|
|
94
|
+
}
|
|
95
|
+
function cloneQuiz(payload) {
|
|
96
|
+
function __cloneQuiz({ host }) {
|
|
97
|
+
const metadata = {
|
|
98
|
+
entityFqdn: "wix.achievements.quizzes.v1.quiz",
|
|
99
|
+
method: "POST",
|
|
100
|
+
methodFqn: "wix.achievements.quizzes.v1.QuizService.CloneQuiz",
|
|
101
|
+
packageName: PACKAGE_NAME,
|
|
102
|
+
url: resolveWixAchievementsQuizzesV1QuizServiceUrl({
|
|
103
|
+
protoPath: "/v1/quizzes/{quizId}/clone",
|
|
104
|
+
data: payload,
|
|
105
|
+
host
|
|
106
|
+
}),
|
|
107
|
+
data: payload,
|
|
108
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
109
|
+
{
|
|
110
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
111
|
+
paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
115
|
+
paths: [
|
|
116
|
+
{ path: "quiz.fields.score" },
|
|
117
|
+
{ path: "quiz.fields.numeric.rightAnswer" }
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
])
|
|
121
|
+
};
|
|
122
|
+
return metadata;
|
|
123
|
+
}
|
|
124
|
+
return __cloneQuiz;
|
|
125
|
+
}
|
|
126
|
+
function bulkCreateQuiz(payload) {
|
|
127
|
+
function __bulkCreateQuiz({ host }) {
|
|
128
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
129
|
+
{
|
|
130
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
131
|
+
paths: [
|
|
132
|
+
{ path: "quizzes.createdDate" },
|
|
133
|
+
{ path: "quizzes.updatedDate" }
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
138
|
+
paths: [
|
|
139
|
+
{ path: "quizzes.fields.score" },
|
|
140
|
+
{ path: "quizzes.fields.numeric.rightAnswer" }
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
]);
|
|
144
|
+
const metadata = {
|
|
145
|
+
entityFqdn: "wix.achievements.quizzes.v1.quiz",
|
|
146
|
+
method: "POST",
|
|
147
|
+
methodFqn: "wix.achievements.quizzes.v1.QuizService.BulkCreateQuiz",
|
|
148
|
+
packageName: PACKAGE_NAME,
|
|
149
|
+
url: resolveWixAchievementsQuizzesV1QuizServiceUrl({
|
|
150
|
+
protoPath: "/v1/bulk/quizzes/create",
|
|
151
|
+
data: serializedData,
|
|
152
|
+
host
|
|
153
|
+
}),
|
|
154
|
+
data: serializedData,
|
|
155
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
156
|
+
{
|
|
157
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
158
|
+
paths: [
|
|
159
|
+
{ path: "results.item.createdDate" },
|
|
160
|
+
{ path: "results.item.updatedDate" }
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
165
|
+
paths: [
|
|
166
|
+
{ path: "results.item.fields.score" },
|
|
167
|
+
{ path: "results.item.fields.numeric.rightAnswer" }
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
])
|
|
171
|
+
};
|
|
172
|
+
return metadata;
|
|
173
|
+
}
|
|
174
|
+
return __bulkCreateQuiz;
|
|
175
|
+
}
|
|
176
|
+
function bulkCloneQuiz(payload) {
|
|
177
|
+
function __bulkCloneQuiz({ host }) {
|
|
178
|
+
const metadata = {
|
|
179
|
+
entityFqdn: "wix.achievements.quizzes.v1.quiz",
|
|
180
|
+
method: "POST",
|
|
181
|
+
methodFqn: "wix.achievements.quizzes.v1.QuizService.BulkCloneQuiz",
|
|
182
|
+
packageName: PACKAGE_NAME,
|
|
183
|
+
url: resolveWixAchievementsQuizzesV1QuizServiceUrl({
|
|
184
|
+
protoPath: "/v1/bulk/quizzes/clone",
|
|
185
|
+
data: payload,
|
|
186
|
+
host
|
|
187
|
+
}),
|
|
188
|
+
data: payload,
|
|
189
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
190
|
+
{
|
|
191
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
192
|
+
paths: [
|
|
193
|
+
{ path: "results.item.createdDate" },
|
|
194
|
+
{ path: "results.item.updatedDate" }
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
199
|
+
paths: [
|
|
200
|
+
{ path: "results.item.fields.score" },
|
|
201
|
+
{ path: "results.item.fields.numeric.rightAnswer" }
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
])
|
|
205
|
+
};
|
|
206
|
+
return metadata;
|
|
207
|
+
}
|
|
208
|
+
return __bulkCloneQuiz;
|
|
209
|
+
}
|
|
210
|
+
function getQuiz(payload) {
|
|
211
|
+
function __getQuiz({ host }) {
|
|
212
|
+
const metadata = {
|
|
213
|
+
entityFqdn: "wix.achievements.quizzes.v1.quiz",
|
|
214
|
+
method: "GET",
|
|
215
|
+
methodFqn: "wix.achievements.quizzes.v1.QuizService.GetQuiz",
|
|
216
|
+
packageName: PACKAGE_NAME,
|
|
217
|
+
url: resolveWixAchievementsQuizzesV1QuizServiceUrl({
|
|
218
|
+
protoPath: "/v1/quizzes/{quizId}",
|
|
219
|
+
data: payload,
|
|
220
|
+
host
|
|
221
|
+
}),
|
|
222
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
223
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
224
|
+
{
|
|
225
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
226
|
+
paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
230
|
+
paths: [
|
|
231
|
+
{ path: "quiz.fields.score" },
|
|
232
|
+
{ path: "quiz.fields.numeric.rightAnswer" }
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
])
|
|
236
|
+
};
|
|
237
|
+
return metadata;
|
|
238
|
+
}
|
|
239
|
+
return __getQuiz;
|
|
240
|
+
}
|
|
241
|
+
function deleteQuiz(payload) {
|
|
242
|
+
function __deleteQuiz({ host }) {
|
|
243
|
+
const metadata = {
|
|
244
|
+
entityFqdn: "wix.achievements.quizzes.v1.quiz",
|
|
245
|
+
method: "DELETE",
|
|
246
|
+
methodFqn: "wix.achievements.quizzes.v1.QuizService.DeleteQuiz",
|
|
247
|
+
packageName: PACKAGE_NAME,
|
|
248
|
+
url: resolveWixAchievementsQuizzesV1QuizServiceUrl({
|
|
249
|
+
protoPath: "/v1/quizzes/{quizId}",
|
|
250
|
+
data: payload,
|
|
251
|
+
host
|
|
252
|
+
}),
|
|
253
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
254
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
255
|
+
{
|
|
256
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
257
|
+
paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
261
|
+
paths: [
|
|
262
|
+
{ path: "quiz.fields.score" },
|
|
263
|
+
{ path: "quiz.fields.numeric.rightAnswer" }
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
])
|
|
267
|
+
};
|
|
268
|
+
return metadata;
|
|
269
|
+
}
|
|
270
|
+
return __deleteQuiz;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// src/achievements-quizzes-v1-quiz-quizzes.universal.ts
|
|
274
|
+
var FileFormat = /* @__PURE__ */ ((FileFormat2) => {
|
|
275
|
+
FileFormat2["IMAGE"] = "IMAGE";
|
|
276
|
+
FileFormat2["VIDEO"] = "VIDEO";
|
|
277
|
+
FileFormat2["AUDIO"] = "AUDIO";
|
|
278
|
+
FileFormat2["DOCUMENT"] = "DOCUMENT";
|
|
279
|
+
FileFormat2["ARCHIVE"] = "ARCHIVE";
|
|
280
|
+
return FileFormat2;
|
|
281
|
+
})(FileFormat || {});
|
|
282
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
283
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
284
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
285
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
286
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
287
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
288
|
+
return WebhookIdentityType2;
|
|
289
|
+
})(WebhookIdentityType || {});
|
|
290
|
+
async function createQuiz2(quiz) {
|
|
291
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
292
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ quiz });
|
|
293
|
+
const reqOpts = createQuiz(payload);
|
|
294
|
+
sideEffects?.onSiteCall?.();
|
|
295
|
+
try {
|
|
296
|
+
const result = await httpClient.request(reqOpts);
|
|
297
|
+
sideEffects?.onSuccess?.(result);
|
|
298
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.quiz;
|
|
299
|
+
} catch (err) {
|
|
300
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
301
|
+
err,
|
|
302
|
+
{
|
|
303
|
+
spreadPathsToArguments: {},
|
|
304
|
+
explicitPathsToArguments: { quiz: "$[0]" },
|
|
305
|
+
singleArgumentUnchanged: false
|
|
306
|
+
},
|
|
307
|
+
["quiz"]
|
|
308
|
+
);
|
|
309
|
+
sideEffects?.onError?.(err);
|
|
310
|
+
throw transformedError;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
async function cloneQuiz2(quizId) {
|
|
314
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
315
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ quizId });
|
|
316
|
+
const reqOpts = cloneQuiz(payload);
|
|
317
|
+
sideEffects?.onSiteCall?.();
|
|
318
|
+
try {
|
|
319
|
+
const result = await httpClient.request(reqOpts);
|
|
320
|
+
sideEffects?.onSuccess?.(result);
|
|
321
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
322
|
+
} catch (err) {
|
|
323
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
324
|
+
err,
|
|
325
|
+
{
|
|
326
|
+
spreadPathsToArguments: {},
|
|
327
|
+
explicitPathsToArguments: { quizId: "$[0]" },
|
|
328
|
+
singleArgumentUnchanged: false
|
|
329
|
+
},
|
|
330
|
+
["quizId"]
|
|
331
|
+
);
|
|
332
|
+
sideEffects?.onError?.(err);
|
|
333
|
+
throw transformedError;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
async function bulkCreateQuiz2(quizzes, options) {
|
|
337
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
338
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
339
|
+
quizzes,
|
|
340
|
+
returnEntity: options?.returnEntity
|
|
341
|
+
});
|
|
342
|
+
const reqOpts = bulkCreateQuiz(payload);
|
|
343
|
+
sideEffects?.onSiteCall?.();
|
|
344
|
+
try {
|
|
345
|
+
const result = await httpClient.request(reqOpts);
|
|
346
|
+
sideEffects?.onSuccess?.(result);
|
|
347
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
348
|
+
} catch (err) {
|
|
349
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
350
|
+
err,
|
|
351
|
+
{
|
|
352
|
+
spreadPathsToArguments: {},
|
|
353
|
+
explicitPathsToArguments: {
|
|
354
|
+
quizzes: "$[0]",
|
|
355
|
+
returnEntity: "$[1].returnEntity"
|
|
356
|
+
},
|
|
357
|
+
singleArgumentUnchanged: false
|
|
358
|
+
},
|
|
359
|
+
["quizzes", "options"]
|
|
360
|
+
);
|
|
361
|
+
sideEffects?.onError?.(err);
|
|
362
|
+
throw transformedError;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
async function bulkCloneQuiz2(quizIds, options) {
|
|
366
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
367
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
368
|
+
quizIds,
|
|
369
|
+
returnEntity: options?.returnEntity
|
|
370
|
+
});
|
|
371
|
+
const reqOpts = bulkCloneQuiz(payload);
|
|
372
|
+
sideEffects?.onSiteCall?.();
|
|
373
|
+
try {
|
|
374
|
+
const result = await httpClient.request(reqOpts);
|
|
375
|
+
sideEffects?.onSuccess?.(result);
|
|
376
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
377
|
+
} catch (err) {
|
|
378
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
379
|
+
err,
|
|
380
|
+
{
|
|
381
|
+
spreadPathsToArguments: {},
|
|
382
|
+
explicitPathsToArguments: {
|
|
383
|
+
quizIds: "$[0]",
|
|
384
|
+
returnEntity: "$[1].returnEntity"
|
|
385
|
+
},
|
|
386
|
+
singleArgumentUnchanged: false
|
|
387
|
+
},
|
|
388
|
+
["quizIds", "options"]
|
|
389
|
+
);
|
|
390
|
+
sideEffects?.onError?.(err);
|
|
391
|
+
throw transformedError;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
async function getQuiz2(quizId) {
|
|
395
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
396
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ quizId });
|
|
397
|
+
const reqOpts = getQuiz(payload);
|
|
398
|
+
sideEffects?.onSiteCall?.();
|
|
399
|
+
try {
|
|
400
|
+
const result = await httpClient.request(reqOpts);
|
|
401
|
+
sideEffects?.onSuccess?.(result);
|
|
402
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.quiz;
|
|
403
|
+
} catch (err) {
|
|
404
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
405
|
+
err,
|
|
406
|
+
{
|
|
407
|
+
spreadPathsToArguments: {},
|
|
408
|
+
explicitPathsToArguments: { quizId: "$[0]" },
|
|
409
|
+
singleArgumentUnchanged: false
|
|
410
|
+
},
|
|
411
|
+
["quizId"]
|
|
412
|
+
);
|
|
413
|
+
sideEffects?.onError?.(err);
|
|
414
|
+
throw transformedError;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
async function deleteQuiz2(quizId) {
|
|
418
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
419
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ quizId });
|
|
420
|
+
const reqOpts = deleteQuiz(payload);
|
|
421
|
+
sideEffects?.onSiteCall?.();
|
|
422
|
+
try {
|
|
423
|
+
const result = await httpClient.request(reqOpts);
|
|
424
|
+
sideEffects?.onSuccess?.(result);
|
|
425
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
426
|
+
} catch (err) {
|
|
427
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
428
|
+
err,
|
|
429
|
+
{
|
|
430
|
+
spreadPathsToArguments: {},
|
|
431
|
+
explicitPathsToArguments: { quizId: "$[0]" },
|
|
432
|
+
singleArgumentUnchanged: false
|
|
433
|
+
},
|
|
434
|
+
["quizId"]
|
|
435
|
+
);
|
|
436
|
+
sideEffects?.onError?.(err);
|
|
437
|
+
throw transformedError;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// src/achievements-quizzes-v1-quiz-quizzes.public.ts
|
|
442
|
+
function createQuiz3(httpClient) {
|
|
443
|
+
return (quiz) => createQuiz2(
|
|
444
|
+
quiz,
|
|
445
|
+
// @ts-ignore
|
|
446
|
+
{ httpClient }
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
function cloneQuiz3(httpClient) {
|
|
450
|
+
return (quizId) => cloneQuiz2(
|
|
451
|
+
quizId,
|
|
452
|
+
// @ts-ignore
|
|
453
|
+
{ httpClient }
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
function bulkCreateQuiz3(httpClient) {
|
|
457
|
+
return (quizzes, options) => bulkCreateQuiz2(
|
|
458
|
+
quizzes,
|
|
459
|
+
options,
|
|
460
|
+
// @ts-ignore
|
|
461
|
+
{ httpClient }
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
function bulkCloneQuiz3(httpClient) {
|
|
465
|
+
return (quizIds, options) => bulkCloneQuiz2(
|
|
466
|
+
quizIds,
|
|
467
|
+
options,
|
|
468
|
+
// @ts-ignore
|
|
469
|
+
{ httpClient }
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
function getQuiz3(httpClient) {
|
|
473
|
+
return (quizId) => getQuiz2(
|
|
474
|
+
quizId,
|
|
475
|
+
// @ts-ignore
|
|
476
|
+
{ httpClient }
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
function deleteQuiz3(httpClient) {
|
|
480
|
+
return (quizId) => deleteQuiz2(
|
|
481
|
+
quizId,
|
|
482
|
+
// @ts-ignore
|
|
483
|
+
{ httpClient }
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// src/achievements-quizzes-v1-quiz-quizzes.context.ts
|
|
488
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
489
|
+
var createQuiz4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createQuiz3);
|
|
490
|
+
var cloneQuiz4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(cloneQuiz3);
|
|
491
|
+
var bulkCreateQuiz4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateQuiz3);
|
|
492
|
+
var bulkCloneQuiz4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCloneQuiz3);
|
|
493
|
+
var getQuiz4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getQuiz3);
|
|
494
|
+
var deleteQuiz4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteQuiz3);
|
|
495
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
496
|
+
0 && (module.exports = {
|
|
497
|
+
FileFormat,
|
|
498
|
+
WebhookIdentityType,
|
|
499
|
+
bulkCloneQuiz,
|
|
500
|
+
bulkCreateQuiz,
|
|
501
|
+
cloneQuiz,
|
|
502
|
+
createQuiz,
|
|
503
|
+
deleteQuiz,
|
|
504
|
+
getQuiz
|
|
505
|
+
});
|
|
506
|
+
//# sourceMappingURL=index.js.map
|