@wix/auto_sdk_online-programs_quizzes 1.0.33 → 1.0.35

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 +1 @@
1
- {"version":3,"sources":["../../src/achievements-quizzes-v1-quiz-quizzes.universal.ts","../../src/achievements-quizzes-v1-quiz-quizzes.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 ambassadorWixAchievementsQuizzesV1Quiz from './achievements-quizzes-v1-quiz-quizzes.http.js';\n\n/**\n * A quiz definition used by an Online Programs quiz step.\n *\n * Create or clone a quiz, then assign the returned quiz ID to `step.quizOptions.id` when creating an Online Programs step. Quiz IDs are intentionally discovered through quiz-type steps rather than through a Quiz list or query method.\n *\n * New submissions are evaluated against the quiz definition that exists when the submission is created. Previously stored submissions retain their recorded grades and answer evaluations if the definition changes later.\n */\nexport interface Quiz {\n /**\n * Quiz ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /** Quiz title, passing grade, and attempt limit. New submissions use the current settings; stored submissions retain their recorded grade data. */\n settings?: QuizSettings;\n /**\n * Current revision of the stored quiz definition. The revision changes when the definition changes. The public Quiz API doesn't currently provide an update method.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the quiz was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the quiz was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Active questions in the quiz. Each `QuizField` defines one question and its answer input. Creating or cloning a quiz requires at least one active question. GetQuiz can return a legacy stored definition with an empty list; don't assume a retrieved definition has active questions.\n *\n * New submissions use the current questions; stored submissions retain their recorded answer evaluations.\n * @minSize 1\n * @maxSize 200\n */\n fields?: QuizField[];\n}\n\nexport interface QuizSettings {\n /**\n * Minimum unweighted integer percentage required to pass. The earned grade is calculated as `floor((correct answer count / submitted answer count) * 100)`; question `score` values don't weight it. Non-evaluable answers count as correct. If omitted, the submission has no earned or passing grade and its status is COMPLETED, even if an individual evaluated answer is incorrect.\n * @max 100\n */\n passingGrade?: number | null;\n /**\n * Quiz title.\n * @maxLength 200\n */\n title?: string | null;\n /**\n * Maximum number of submissions allowed per submitter. If omitted, no attempt-limit check is applied. Submissions grouped together share an attempt count, even across quizzes. See [Attempt limits](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/quiz-grading#attempt-limits) for how submissions are counted.\n * @min 1\n */\n attempts?: number | null;\n}\n\n/** Defines one quiz question and its answer input. */\nexport interface QuizField extends QuizFieldFieldTypeOneOf {\n /** Numeric input. */\n numeric?: NumericField;\n /** Short-text input. */\n shortText?: ShortTextField;\n /** Long-text input. Set this to an empty object (`{}`) to select it. */\n longText?: LongTextField;\n /** Input with predefined options where only one option can be selected. */\n singleChoice?: SingleChoiceField;\n /** Input with predefined options where multiple options can be selected. */\n multiChoice?: MultiChoiceField;\n /** File-upload input. */\n fileUpload?: FileUploadField;\n /**\n * Caller-generated GUID that identifies this question. Use a stable value that is unique within the quiz. Submission answer evaluations use this ID to identify the question.\n * @format GUID\n * @immutable\n */\n _id?: string;\n /**\n * Stable key used to match a submitted answer to this question. Use a value that is unique within the quiz and don't change or reuse it for another question.\n * @maxLength 200\n * @immutable\n */\n target?: string | null;\n /**\n * Question text.\n * @minLength 1\n * @maxLength 350\n */\n question?: string | null;\n /** Score returned for evaluable answers, whether correct or incorrect. Omitted from non-evaluable answer evaluations. This value doesn't weight the submission's unweighted `earnedGrade` percentage. */\n score?: number | null;\n /**\n * Feedback returned when an evaluable submitted answer is correct. Omitted for non-evaluable answers.\n * @maxLength 350\n */\n rightMessage?: string | null;\n /**\n * Feedback returned when an evaluable submitted answer is incorrect. Omitted for non-evaluable answers.\n * @maxLength 350\n */\n wrongMessage?: string | null;\n}\n\n/** @oneof */\nexport interface QuizFieldFieldTypeOneOf {\n /** Numeric input. */\n numeric?: NumericField;\n /** Short-text input. */\n shortText?: ShortTextField;\n /** Long-text input. Set this to an empty object (`{}`) to select it. */\n longText?: LongTextField;\n /** Input with predefined options where only one option can be selected. */\n singleChoice?: SingleChoiceField;\n /** Input with predefined options where multiple options can be selected. */\n multiChoice?: MultiChoiceField;\n /** File-upload input. */\n fileUpload?: FileUploadField;\n}\n\n/** File categories used by Wix Forms. Categories don't define a custom extension or MIME-type allowlist; accepted file types are controlled by Wix Forms. See [About form fields](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/about-form-fields). */\nexport enum FileUploadFormat {\n /** Image-file category. */\n IMAGE = 'IMAGE',\n /** Video-file category. */\n VIDEO = 'VIDEO',\n /** Audio-file category. */\n AUDIO = 'AUDIO',\n /** Document-file category. */\n DOCUMENT = 'DOCUMENT',\n /** Archive-file category. */\n ARCHIVE = 'ARCHIVE',\n /** 3D-model-file category. */\n MODEL_3D = 'MODEL_3D',\n}\n\n/** @enumType */\nexport type FileUploadFormatWithLiterals =\n | FileUploadFormat\n | 'IMAGE'\n | 'VIDEO'\n | 'AUDIO'\n | 'DOCUMENT'\n | 'ARCHIVE'\n | 'MODEL_3D';\n\nexport interface NumericField {\n /**\n * Correct numeric value. Matching is exact. If no correct value is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Omitted from responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct value is stored.\n */\n rightAnswer?: number | null;\n}\n\nexport interface ShortTextField {\n /**\n * Correct text. Matching trims leading and trailing whitespace and is case-insensitive. If no correct text is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Omitted from responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct text is stored.\n * @minLength 1\n * @maxLength 200\n */\n rightAnswer?: string | null;\n}\n\n/** Long-text input settings. Set `longText` to an empty object (`{}`) to select this input. Long-text answers aren't evaluated and count as correct when calculating the earned grade. */\nexport interface LongTextField {}\n\nexport interface SingleChoiceField {\n /**\n * Correct option. When supplied, it must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers is exact. If no correct option is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Omitted from responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct option is stored.\n * @minLength 1\n * @maxLength 350\n */\n rightAnswer?: string | null;\n /**\n * Options available to the participant. Labels must be unique; comparison is case-sensitive. Duplicate labels are rejected with INVALID_QUIZ before creation.\n * @minSize 1\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n options?: string[] | null;\n}\n\n/** Multiple-choice input settings. Existing Wix Forms image-choice questions are also returned in this shape, even when their original settings allow only one selection. Image-choice-specific settings aren't exposed by the Quiz API. */\nexport interface MultiChoiceField {\n /**\n * Correct options. Every supplied value must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers ignores option order but doesn't ignore duplicate values. If no correct options are stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Empty in responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove stored keys or change grading; an empty response list doesn't mean no correct options are stored.\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n rightAnswer?: string[] | null;\n /**\n * Options available to the participant.\n * @minSize 1\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n options?: string[] | null;\n}\n\nexport interface FileUploadField {\n /**\n * Text displayed on the upload button.\n *\n * Default: `Upload`.\n * @minLength 1\n * @maxLength 100\n */\n buttonText?: string | null;\n /**\n * Maximum number of files a participant can upload for this question.\n *\n * Default: `10`.\n * @min 1\n * @max 10\n */\n itemsLimit?: number | null;\n /**\n * Wix Forms file categories that participants can upload.\n *\n * Specify at least one format. `UNKNOWN_FILE_UPLOAD_FORMAT` isn't supported as a format selection. File-upload answers aren't evaluated and count as correct when calculating the earned grade.\n * @maxSize 6\n */\n fileUploadFormats?: FileUploadFormatWithLiterals[];\n}\n\nexport interface CreateQuizRequest {\n /** Quiz definition to create. Generate a stable unique GUID for every `quiz.fields.id` value. */\n quiz: Quiz;\n}\n\nexport interface CreateQuizResponse {\n /** Created quiz definition. Assign its `id` to `step.quizOptions.id` to create an Online Programs quiz step. */\n quiz?: Quiz;\n}\n\nexport interface CloneQuizRequest {\n /**\n * ID of the quiz definition to clone.\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface CloneQuizResponse {\n /** Cloned quiz definition with a new ID. Step associations and submissions aren't cloned. */\n quiz?: Quiz;\n}\n\nexport interface BulkCreateQuizzesRequest {\n /**\n * Quiz definitions to create.\n * @minSize 1\n * @maxSize 30\n */\n quizzes: Quiz[];\n /**\n * Whether to return the created quizzes in the response.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCreateQuizzesResponse {\n /**\n * Results of the bulk create operation.\n * @minSize 1\n * @maxSize 30\n */\n results?: BulkCreateQuizzesResponseBulkQuizResult[];\n /** Metadata about the bulk create operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkCreateQuizzesResponseBulkQuizResult {\n /** Metadata for the individual create operation. When the operation fails, `error` contains the original Wix Forms application error. */\n itemMetadata?: ItemMetadata;\n /** Created quiz. Empty when `return_entity` is `false`. */\n item?: Quiz;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface BulkCloneQuizzesRequest {\n /**\n * IDs of the quizzes to clone.\n * @minSize 1\n * @maxSize 30\n * @format GUID\n */\n quizIds?: string[];\n /**\n * Whether to return the cloned quizzes in the response.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCloneQuizzesResponse {\n /** Results of the bulk clone operation, including cloned quizzes and metadata. */\n results?: BulkQuizResult[];\n /** Metadata about the bulk operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkQuizResult {\n /** Metadata for the cloned quiz. */\n itemMetadata?: ItemMetadata;\n /** Cloned quiz. Empty when `return_entity` is `false`. */\n item?: Quiz;\n}\n\nexport interface GetQuizRequest {\n /**\n * Quiz ID, available from `step.quizOptions.id` on a quiz-type Online Programs step.\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface GetQuizResponse {\n /** Requested quiz definition. */\n quiz?: Quiz;\n}\n\nexport interface DeleteQuizRequest {\n /**\n * ID of the quiz definition to permanently delete.\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface DeleteQuizResponse {\n /** Permanently deleted quiz definition. */\n quiz?: Quiz;\n}\n\nexport interface BulkDeleteQuizzesRequest {\n /**\n * IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n quizIds: string[];\n}\n\nexport interface BulkDeleteQuizzesResponse {\n /**\n * Results of the bulk delete operation.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkDeleteQuizzesResponseBulkQuizResult[];\n /** Metadata about the bulk delete operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkDeleteQuizzesResponseBulkQuizResult {\n /** Metadata for the individual delete operation. When the operation fails, `error` contains the original Wix Forms application error. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateQuizApplicationErrors =\n | {\n code?: 'INVALID_QUIZ';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type CloneQuizApplicationErrors =\n | {\n code?: 'INVALID_QUIZ';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type BulkCreateQuizzesApplicationErrors = {\n code?: 'INVALID_QUIZ';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type GetQuizApplicationErrors = {\n code?: 'QUIZ_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteQuizApplicationErrors =\n | {\n code?: 'QUIZ_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a detached quiz definition with at least one question.\n *\n * To use the quiz in an Online Program, specify the returned quiz ID as `step.quizOptions.id` when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create multiple quiz definitions in a single API call, call [Bulk Create Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-create-quizzes).\n * @param quiz - Quiz definition to create. Generate a stable unique GUID for every `quiz.fields.id` value.\n * @public\n * @requiredField quiz\n * @requiredField quiz.fields\n * @requiredField quiz.fields.FieldType\n * @requiredField quiz.fields.FieldType.multiChoice.options\n * @requiredField quiz.fields.FieldType.singleChoice.options\n * @requiredField quiz.fields._id\n * @requiredField quiz.fields.question\n * @requiredField quiz.fields.target\n * @permissionId QUIZZES.CREATE_QUIZ\n * @applicableIdentity APP\n * @returns Created quiz definition. Assign its `id` to `step.quizOptions.id` to create an Online Programs quiz step.\n * @fqn wix.achievements.quizzes.v1.QuizService.CreateQuiz\n */\nexport async function createQuiz(\n quiz: NonNullablePaths<\n Quiz,\n | `fields`\n | `fields.${number}._id`\n | `fields.${number}.multiChoice.options`\n | `fields.${number}.question`\n | `fields.${number}.singleChoice.options`\n | `fields.${number}.target`,\n 3\n >\n): Promise<\n NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2> & {\n __applicationErrorsType?: CreateQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quiz: quiz });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.createQuiz(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.quiz!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { quiz: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quiz']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Clones a quiz definition and returns a new quiz ID.\n *\n * Checks the source before cloning. An existing definition found to have no active questions is rejected with INVALID_QUIZ before cloning. Source checks aren't atomic with cloning.\n *\n * This operation copies the question and settings definition only. It doesn't copy Online Programs step associations or quiz submissions. Attach the returned ID to a step separately when needed.\n * @param quizId - ID of the quiz definition to clone.\n * @public\n * @requiredField quizId\n * @permissionId QUIZZES.CREATE_QUIZ\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.CloneQuiz\n */\nexport async function cloneQuiz(quizId: string): Promise<\n NonNullablePaths<\n CloneQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 3\n > & {\n __applicationErrorsType?: CloneQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quizId: quizId });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.cloneQuiz(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: { quizId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates up to 30 detached quiz definitions in a single API call.\n *\n * Each definition must contain at least one question.\n *\n * Quiz IDs, revisions, and creation and update timestamps are assigned by the server. Client-supplied values for these read-only fields are ignored. Question IDs (`quizzes.fields.id`) must be supplied by the caller.\n *\n * Invalid quiz definitions fail the entire request before any quizzes are created.\n *\n * Individual item failures don't fail the bulk request. For each failed item, `results.itemMetadata.error` contains the original application error from the Wix Forms operation.\n *\n * To use the quizzes in an Online Program, specify the returned quiz IDs as `step.quizOptions.id` values when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create a single quiz definition, call [Create Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/create-quiz).\n * @param quizzes - Quiz definitions to create.\n * @public\n * @documentationMaturity preview\n * @requiredField quizzes\n * @requiredField quizzes.fields\n * @requiredField quizzes.fields.FieldType\n * @requiredField quizzes.fields.FieldType.multiChoice.options\n * @requiredField quizzes.fields.FieldType.singleChoice.options\n * @requiredField quizzes.fields._id\n * @requiredField quizzes.fields.question\n * @requiredField quizzes.fields.target\n * @permissionId achievements:quizzes:v1:quiz:bulk_create_quizzes\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.BulkCreateQuizzes\n */\nexport async function bulkCreateQuizzes(\n quizzes: NonNullablePaths<\n Quiz,\n | `fields`\n | `fields.${number}._id`\n | `fields.${number}.multiChoice.options`\n | `fields.${number}.question`\n | `fields.${number}.singleChoice.options`\n | `fields.${number}.target`,\n 3\n >[],\n options?: BulkCreateQuizzesOptions\n): Promise<\n NonNullablePaths<\n BulkCreateQuizzesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkCreateQuizzesApplicationErrors;\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 quizzes: quizzes,\n returnEntity: options?.returnEntity,\n });\n\n const reqOpts =\n ambassadorWixAchievementsQuizzesV1Quiz.bulkCreateQuizzes(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 quizzes: '$[0]',\n returnEntity: '$[1].returnEntity',\n },\n singleArgumentUnchanged: false,\n },\n ['quizzes', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCreateQuizzesOptions {\n /**\n * Whether to return the created quizzes in the response.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\n/**\n * Retrieves a quiz definition by ID.\n *\n * A legacy stored definition whose questions have all been deleted can be returned with an empty fields list. The minimum question requirement for creation and cloning doesn't guarantee a nonempty result from this method.\n *\n * To discover a quiz ID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.\n * @param quizId - Quiz ID, available from `step.quizOptions.id` on a quiz-type Online Programs step.\n * @public\n * @requiredField quizId\n * @permissionId achievements:quizzes:v1:quiz:get_quiz\n * @applicableIdentity APP\n * @returns Requested quiz definition.\n * @fqn wix.achievements.quizzes.v1.QuizService.GetQuiz\n */\nexport async function getQuiz(quizId: string): Promise<\n NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2> & {\n __applicationErrorsType?: GetQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quizId: quizId });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.getQuiz(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.quiz!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { quizId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Permanently deletes a quiz definition.\n *\n * This operation doesn't check whether Online Programs steps reference the quiz. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete multiple quiz definitions in a single API call, call [Bulk Delete Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes).\n * @param quizId - ID of the quiz definition to permanently delete.\n * @public\n * @requiredField quizId\n * @permissionId QUIZZES.DELETE_QUIZ\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.DeleteQuiz\n */\nexport async function deleteQuiz(quizId: string): Promise<\n NonNullablePaths<\n DeleteQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 3\n > & {\n __applicationErrorsType?: DeleteQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quizId: quizId });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.deleteQuiz(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: { quizId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Permanently deletes up to 100 quiz definitions.\n *\n * Individual item failures don't fail the bulk request. For each failed item, `results.itemMetadata.error` contains the original application error from the Wix Forms operation.\n *\n * This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete a single quiz definition, call [Delete Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/delete-quiz).\n * @param quizIds - IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first.\n * @public\n * @documentationMaturity preview\n * @requiredField quizIds\n * @permissionId achievements:quizzes:v1:quiz:bulk_delete_quizzes\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.BulkDeleteQuizzes\n */\nexport async function bulkDeleteQuizzes(\n quizIds: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteQuizzesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\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({ quizIds: quizIds });\n\n const reqOpts =\n ambassadorWixAchievementsQuizzesV1Quiz.bulkDeleteQuizzes(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: { quizIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixAchievementsQuizzesV1QuizServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/online-programs/v1/quizzes',\n destPath: '/v1/quizzes',\n },\n {\n srcPath: '/online-programs/v1/bulk/quizzes',\n destPath: '/v1/bulk/quizzes',\n },\n ],\n _: [\n {\n srcPath: '/_api/quiz-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_online-programs_quizzes';\n\n/**\n * Creates a detached quiz definition with at least one question.\n *\n * To use the quiz in an Online Program, specify the returned quiz ID as `step.quizOptions.id` when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create multiple quiz definitions in a single API call, call [Bulk Create Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-create-quizzes).\n */\nexport function createQuiz(payload: object): RequestOptionsFactory<any> {\n function __createQuiz({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'quiz.createdDate' }, { path: 'quiz.updatedDate' }],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'quiz.fields.score' },\n { path: 'quiz.fields.numeric.rightAnswer' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.CreateQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'quiz.createdDate' }, { path: 'quiz.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'quiz.fields.score' },\n { path: 'quiz.fields.numeric.rightAnswer' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createQuiz;\n}\n\n/**\n * Clones a quiz definition and returns a new quiz ID.\n *\n * Checks the source before cloning. An existing definition found to have no active questions is rejected with INVALID_QUIZ before cloning. Source checks aren't atomic with cloning.\n *\n * This operation copies the question and settings definition only. It doesn't copy Online Programs step associations or quiz submissions. Attach the returned ID to a step separately when needed.\n */\nexport function cloneQuiz(payload: object): RequestOptionsFactory<any> {\n function __cloneQuiz({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.CloneQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes/{quizId}/clone',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'quiz.createdDate' }, { path: 'quiz.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'quiz.fields.score' },\n { path: 'quiz.fields.numeric.rightAnswer' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __cloneQuiz;\n}\n\n/**\n * Creates up to 30 detached quiz definitions in a single API call.\n *\n * Each definition must contain at least one question.\n *\n * Quiz IDs, revisions, and creation and update timestamps are assigned by the server. Client-supplied values for these read-only fields are ignored. Question IDs (`quizzes.fields.id`) must be supplied by the caller.\n *\n * Invalid quiz definitions fail the entire request before any quizzes are created.\n *\n * Individual item failures don't fail the bulk request. For each failed item, `results.itemMetadata.error` contains the original application error from the Wix Forms operation.\n *\n * To use the quizzes in an Online Program, specify the returned quiz IDs as `step.quizOptions.id` values when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create a single quiz definition, call [Create Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/create-quiz).\n */\nexport function bulkCreateQuizzes(payload: object): RequestOptionsFactory<any> {\n function __bulkCreateQuizzes({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'quizzes.createdDate' },\n { path: 'quizzes.updatedDate' },\n ],\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'quizzes.fields.score' },\n { path: 'quizzes.fields.numeric.rightAnswer' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.BulkCreateQuizzes',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/bulk/quizzes/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'results.item.fields.score' },\n { path: 'results.item.fields.numeric.rightAnswer' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateQuizzes;\n}\n\n/**\n * Retrieves a quiz definition by ID.\n *\n * A legacy stored definition whose questions have all been deleted can be returned with an empty fields list. The minimum question requirement for creation and cloning doesn't guarantee a nonempty result from this method.\n *\n * To discover a quiz ID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.\n */\nexport function getQuiz(payload: object): RequestOptionsFactory<any> {\n function __getQuiz({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'GET' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.GetQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes/{quizId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'quiz.createdDate' }, { path: 'quiz.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'quiz.fields.score' },\n { path: 'quiz.fields.numeric.rightAnswer' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getQuiz;\n}\n\n/**\n * Permanently deletes a quiz definition.\n *\n * This operation doesn't check whether Online Programs steps reference the quiz. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete multiple quiz definitions in a single API call, call [Bulk Delete Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes).\n */\nexport function deleteQuiz(payload: object): RequestOptionsFactory<any> {\n function __deleteQuiz({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'DELETE' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.DeleteQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes/{quizId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'quiz.createdDate' }, { path: 'quiz.updatedDate' }],\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: [\n { path: 'quiz.fields.score' },\n { path: 'quiz.fields.numeric.rightAnswer' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __deleteQuiz;\n}\n\n/**\n * Permanently deletes up to 100 quiz definitions.\n *\n * Individual item failures don't fail the bulk request. For each failed item, `results.itemMetadata.error` contains the original application error from the Wix Forms operation.\n *\n * This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete a single quiz definition, call [Delete Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/delete-quiz).\n */\nexport function bulkDeleteQuizzes(payload: object): RequestOptionsFactory<any> {\n function __bulkDeleteQuizzes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.BulkDeleteQuizzes',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/bulk/quizzes/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteQuizzes;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,8CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;A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D,WAAW,OAAO;AAEzE,eAAa,aAAa;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,EAAE,QAAQ,OAAO;AAAA,QAC3C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAkBA,eAAsBC,mBACpB,SAcA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,EAAE,QAAiB,CAAC;AAE1E,QAAM,UACmC,kBAAkB,OAAO;AAElE,eAAa,aAAa;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,EAAE,SAAS,OAAO;AAAA,QAC5C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","FileUploadFormat","WebhookIdentityType","createQuiz","cloneQuiz","bulkCreateQuizzes","getQuiz","deleteQuiz","bulkDeleteQuizzes"]}
1
+ {"version":3,"sources":["../../src/achievements-quizzes-v1-quiz-quizzes.universal.ts","../../src/achievements-quizzes-v1-quiz-quizzes.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 ambassadorWixAchievementsQuizzesV1Quiz from './achievements-quizzes-v1-quiz-quizzes.http.js';\n\n/**\n * A quiz definition used by an Online Programs quiz step.\n *\n * Create or clone a quiz, then assign the returned quiz ID to `step.quizOptions.id` when creating an Online Programs step. Quiz IDs are intentionally discovered through quiz-type steps rather than through a Quiz list or query method.\n *\n * New submissions are evaluated against the quiz definition that exists when the submission is created. Previously stored submissions retain their recorded grades and answer evaluations if the definition changes later.\n */\nexport interface Quiz {\n /**\n * Quiz ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /** Quiz title, passing grade, and attempt limit. New submissions use the current settings; stored submissions retain their recorded grade data. */\n settings?: QuizSettings;\n /**\n * Current revision of the stored quiz definition. The revision changes when the definition changes. The public Quiz API doesn't currently provide an update method.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the quiz was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the quiz was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Active questions in the quiz. Each `QuizField` defines one question and its answer input. Creating or cloning a quiz requires at least one active question. A retrieved quiz can have an empty list after all its questions have been deleted. Check for active questions before displaying or reusing it.\n *\n * New submissions use the current questions; stored submissions retain their recorded answer evaluations.\n * @minSize 1\n * @maxSize 200\n */\n fields?: QuizField[];\n}\n\nexport interface QuizSettings {\n /**\n * Minimum unweighted integer percentage required to pass. The earned grade is calculated as `floor((correct answer count / submitted answer count) * 100)`; question `score` values don't weight it. Non-evaluable answers count as correct. If omitted, the submission has no earned or passing grade and its status is COMPLETED, even if an individual evaluated answer is incorrect.\n * @max 100\n */\n passingGrade?: number | null;\n /**\n * Quiz title.\n * @maxLength 200\n */\n title?: string | null;\n /**\n * Maximum number of submissions allowed per submitter. If omitted, no attempt-limit check is applied. Submissions grouped together share an attempt count, even across quizzes. See [Attempt limits](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/quiz-grading#attempt-limits) for how submissions are counted.\n * @min 1\n */\n attempts?: number | null;\n}\n\n/** Defines one quiz question and its answer input. */\nexport interface QuizField extends QuizFieldFieldTypeOneOf {\n /** Numeric input. */\n numeric?: NumericField;\n /** Short-text input. */\n shortText?: ShortTextField;\n /** Long-text input. Set this to an empty object (`{}`) to select it. */\n longText?: LongTextField;\n /** Input with predefined options where only one option can be selected. */\n singleChoice?: SingleChoiceField;\n /** Input with predefined options where multiple options can be selected. */\n multiChoice?: MultiChoiceField;\n /** File-upload input. */\n fileUpload?: FileUploadField;\n /**\n * Caller-generated GUID that identifies this question. Use a stable value that is unique within the quiz. Submission answer evaluations use this ID to identify the question.\n * @format GUID\n * @immutable\n */\n _id?: string;\n /**\n * Stable key used to match a submitted answer to this question. Use a value that is unique within the quiz and don't change or reuse it for another question.\n * @maxLength 200\n * @immutable\n */\n target?: string | null;\n /**\n * Question text.\n * @minLength 1\n * @maxLength 350\n */\n question?: string | null;\n /** Score returned for evaluable answers, whether correct or incorrect. Omitted from non-evaluable answer evaluations. This value doesn't weight the submission's unweighted `earnedGrade` percentage. */\n score?: number | null;\n /**\n * Feedback returned when an evaluable submitted answer is correct. Omitted for non-evaluable answers.\n * @maxLength 350\n */\n rightMessage?: string | null;\n /**\n * Feedback returned when an evaluable submitted answer is incorrect. Omitted for non-evaluable answers.\n * @maxLength 350\n */\n wrongMessage?: string | null;\n}\n\n/** @oneof */\nexport interface QuizFieldFieldTypeOneOf {\n /** Numeric input. */\n numeric?: NumericField;\n /** Short-text input. */\n shortText?: ShortTextField;\n /** Long-text input. Set this to an empty object (`{}`) to select it. */\n longText?: LongTextField;\n /** Input with predefined options where only one option can be selected. */\n singleChoice?: SingleChoiceField;\n /** Input with predefined options where multiple options can be selected. */\n multiChoice?: MultiChoiceField;\n /** File-upload input. */\n fileUpload?: FileUploadField;\n}\n\n/** File categories used by Wix Forms. Categories don't define a custom extension or MIME-type allowlist; accepted file types are controlled by Wix Forms. See [About form fields](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/about-form-fields). */\nexport enum FileUploadFormat {\n /** Image-file category. */\n IMAGE = 'IMAGE',\n /** Video-file category. */\n VIDEO = 'VIDEO',\n /** Audio-file category. */\n AUDIO = 'AUDIO',\n /** Document-file category. */\n DOCUMENT = 'DOCUMENT',\n /** Archive-file category. */\n ARCHIVE = 'ARCHIVE',\n /** 3D-model-file category. */\n MODEL_3D = 'MODEL_3D',\n}\n\n/** @enumType */\nexport type FileUploadFormatWithLiterals =\n | FileUploadFormat\n | 'IMAGE'\n | 'VIDEO'\n | 'AUDIO'\n | 'DOCUMENT'\n | 'ARCHIVE'\n | 'MODEL_3D';\n\nexport interface NumericField {\n /**\n * Correct numeric value. Matching is exact. If no correct value is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct value is stored.\n */\n rightAnswer?: number | null;\n}\n\nexport interface ShortTextField {\n /**\n * Correct text. Matching trims leading and trailing whitespace and is case-insensitive. If no correct text is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct text is stored.\n * @minLength 1\n * @maxLength 200\n */\n rightAnswer?: string | null;\n}\n\n/** Long-text input settings. Set `longText` to an empty object (`{}`) to select this input. Long-text answers aren't evaluated and count as correct when calculating the earned grade. */\nexport interface LongTextField {}\n\nexport interface SingleChoiceField {\n /**\n * Correct option. When supplied, it must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers is exact. If no correct option is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct option is stored.\n * @minLength 1\n * @maxLength 350\n */\n rightAnswer?: string | null;\n /**\n * Options available to the participant. Labels must be unique; comparison is case-sensitive. Duplicate labels are rejected with INVALID_QUIZ before creation.\n * @minSize 1\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n options?: string[] | null;\n}\n\n/** Multiple-choice input settings. Existing Wix Forms image-choice questions are also returned in this shape, even when their original settings allow only one selection. Image-choice-specific settings aren't exposed by the Quiz API. */\nexport interface MultiChoiceField {\n /**\n * Correct options. Every supplied value must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers ignores option order but doesn't ignore duplicate values. If no correct options are stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.\n *\n * Empty in responses when the caller can't access answer keys. Hidden answers still participate in grading; an empty response list doesn't mean no correct options are stored.\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n rightAnswer?: string[] | null;\n /**\n * Options available to the participant.\n * @minSize 1\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n options?: string[] | null;\n}\n\nexport interface FileUploadField {\n /**\n * Text displayed on the upload button.\n *\n * Default: `Upload`.\n * @minLength 1\n * @maxLength 100\n */\n buttonText?: string | null;\n /**\n * Maximum number of files a participant can upload for this question.\n *\n * Default: `10`.\n * @min 1\n * @max 10\n */\n itemsLimit?: number | null;\n /**\n * Wix Forms file categories that participants can upload.\n *\n * Specify at least one format. `UNKNOWN_FILE_UPLOAD_FORMAT` isn't supported as a format selection. File-upload answers aren't evaluated and count as correct when calculating the earned grade.\n * @maxSize 6\n */\n fileUploadFormats?: FileUploadFormatWithLiterals[];\n}\n\nexport interface CreateQuizRequest {\n /** Quiz definition to create. Generate a stable unique GUID for every `quiz.fields.id` value. */\n quiz: Quiz;\n}\n\nexport interface CreateQuizResponse {\n /** Created quiz definition. Assign its `id` to `step.quizOptions.id` to create an Online Programs quiz step. */\n quiz?: Quiz;\n}\n\nexport interface CloneQuizRequest {\n /**\n * ID of the quiz definition to clone.\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface CloneQuizResponse {\n /** Cloned quiz definition with a new ID. Step associations and submissions aren't cloned. */\n quiz?: Quiz;\n}\n\nexport interface BulkCreateQuizzesRequest {\n /**\n * Quiz definitions to create.\n * @minSize 1\n * @maxSize 30\n */\n quizzes: Quiz[];\n /**\n * Whether to return the created quizzes in the response.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCreateQuizzesResponse {\n /**\n * Results of the bulk create operation.\n * @minSize 1\n * @maxSize 30\n */\n results?: BulkCreateQuizzesResponseBulkQuizResult[];\n /** Metadata about the bulk create operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkCreateQuizzesResponseBulkQuizResult {\n /** Result metadata for the individual create operation. If `success` is `false`, inspect `error` for details. Individual results can contain error codes not listed for the request. */\n itemMetadata?: ItemMetadata;\n /** Created quiz. Empty when `returnEntity` is `false`. */\n item?: Quiz;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface BulkCloneQuizzesRequest {\n /**\n * IDs of the quizzes to clone.\n * @minSize 1\n * @maxSize 30\n * @format GUID\n */\n quizIds?: string[];\n /**\n * Whether to return the cloned quizzes in the response.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCloneQuizzesResponse {\n /** Results of the bulk clone operation, including cloned quizzes and metadata. */\n results?: BulkQuizResult[];\n /** Metadata about the bulk operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkQuizResult {\n /** Metadata for the cloned quiz. */\n itemMetadata?: ItemMetadata;\n /** Cloned quiz. Empty when `return_entity` is `false`. */\n item?: Quiz;\n}\n\nexport interface GetQuizRequest {\n /**\n * Quiz ID, available from `step.quizOptions.id` on a quiz-type Online Programs step.\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface GetQuizResponse {\n /** Requested quiz definition. */\n quiz?: Quiz;\n}\n\nexport interface DeleteQuizRequest {\n /**\n * ID of the quiz definition to permanently delete.\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface DeleteQuizResponse {\n /** Permanently deleted quiz definition. */\n quiz?: Quiz;\n}\n\nexport interface BulkDeleteQuizzesRequest {\n /**\n * IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n quizIds: string[];\n}\n\nexport interface BulkDeleteQuizzesResponse {\n /**\n * Results of the bulk delete operation.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkDeleteQuizzesResponseBulkQuizResult[];\n /** Metadata about the bulk delete operation. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkDeleteQuizzesResponseBulkQuizResult {\n /** Result metadata for the individual delete operation. If `success` is `false`, inspect `error` for details. Individual results can contain error codes not listed for the request. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateQuizApplicationErrors =\n | {\n code?: 'INVALID_QUIZ';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type CloneQuizApplicationErrors =\n | {\n code?: 'INVALID_QUIZ';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type BulkCreateQuizzesApplicationErrors = {\n code?: 'INVALID_QUIZ';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type GetQuizApplicationErrors = {\n code?: 'QUIZ_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteQuizApplicationErrors =\n | {\n code?: 'QUIZ_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUIZ_CONFLICT';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Creates a detached quiz definition with at least one question.\n *\n * To use the quiz in an Online Program, specify the returned quiz ID as `step.quizOptions.id` when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create multiple quiz definitions in a single API call, call [Bulk Create Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-create-quizzes).\n * @param quiz - Quiz definition to create. Generate a stable unique GUID for every `quiz.fields.id` value.\n * @public\n * @requiredField quiz\n * @requiredField quiz.fields\n * @requiredField quiz.fields.FieldType\n * @requiredField quiz.fields.FieldType.multiChoice.options\n * @requiredField quiz.fields.FieldType.singleChoice.options\n * @requiredField quiz.fields._id\n * @requiredField quiz.fields.question\n * @requiredField quiz.fields.target\n * @permissionId QUIZZES.CREATE_QUIZ\n * @applicableIdentity APP\n * @returns Created quiz definition. Assign its `id` to `step.quizOptions.id` to create an Online Programs quiz step.\n * @fqn wix.achievements.quizzes.v1.QuizService.CreateQuiz\n */\nexport async function createQuiz(\n quiz: NonNullablePaths<\n Quiz,\n | `fields`\n | `fields.${number}._id`\n | `fields.${number}.multiChoice.options`\n | `fields.${number}.question`\n | `fields.${number}.singleChoice.options`\n | `fields.${number}.target`,\n 3\n >\n): Promise<\n NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2> & {\n __applicationErrorsType?: CreateQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quiz: quiz });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.createQuiz(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.quiz!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { quiz: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quiz']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Clones a quiz definition and returns a new quiz ID.\n *\n * A quiz with no active questions can't be cloned; the request fails with INVALID_QUIZ. Avoid modifying the source quiz while cloning it.\n *\n * This operation copies the question and settings definition only. It doesn't copy Online Programs step associations or quiz submissions. Attach the returned ID to a step separately when needed.\n * @param quizId - ID of the quiz definition to clone.\n * @public\n * @requiredField quizId\n * @permissionId QUIZZES.CREATE_QUIZ\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.CloneQuiz\n */\nexport async function cloneQuiz(quizId: string): Promise<\n NonNullablePaths<\n CloneQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 3\n > & {\n __applicationErrorsType?: CloneQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quizId: quizId });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.cloneQuiz(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: { quizId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates up to 30 detached quiz definitions in a single API call.\n *\n * Each definition must contain at least one question.\n *\n * Quiz IDs, revisions, and creation and update timestamps are assigned by the server. Client-supplied values for these read-only fields are ignored. Question IDs (`quizzes.fields.id`) must be supplied by the caller.\n *\n * Invalid quiz definitions fail the entire request before any quizzes are created.\n *\n * Individual item failures don't fail the bulk request. Check `results.itemMetadata.success` for each item and inspect `results.itemMetadata.error` when it is `false`. Individual results can contain error codes not listed for the request.\n *\n * To use the quizzes in an Online Program, specify the returned quiz IDs as `step.quizOptions.id` values when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create a single quiz definition, call [Create Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/create-quiz).\n * @param quizzes - Quiz definitions to create.\n * @public\n * @documentationMaturity preview\n * @requiredField quizzes\n * @requiredField quizzes.fields\n * @requiredField quizzes.fields.FieldType\n * @requiredField quizzes.fields.FieldType.multiChoice.options\n * @requiredField quizzes.fields.FieldType.singleChoice.options\n * @requiredField quizzes.fields._id\n * @requiredField quizzes.fields.question\n * @requiredField quizzes.fields.target\n * @permissionId achievements:quizzes:v1:quiz:bulk_create_quizzes\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.BulkCreateQuizzes\n */\nexport async function bulkCreateQuizzes(\n quizzes: NonNullablePaths<\n Quiz,\n | `fields`\n | `fields.${number}._id`\n | `fields.${number}.multiChoice.options`\n | `fields.${number}.question`\n | `fields.${number}.singleChoice.options`\n | `fields.${number}.target`,\n 3\n >[],\n options?: BulkCreateQuizzesOptions\n): Promise<\n NonNullablePaths<\n BulkCreateQuizzesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 4\n > & {\n __applicationErrorsType?: BulkCreateQuizzesApplicationErrors;\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 quizzes: quizzes,\n returnEntity: options?.returnEntity,\n });\n\n const reqOpts =\n ambassadorWixAchievementsQuizzesV1Quiz.bulkCreateQuizzes(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 quizzes: '$[0]',\n returnEntity: '$[1].returnEntity',\n },\n singleArgumentUnchanged: false,\n },\n ['quizzes', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCreateQuizzesOptions {\n /**\n * Whether to return the created quizzes in the response.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\n/**\n * Retrieves a quiz definition by ID.\n *\n * A retrieved quiz can have an empty fields list after all its questions have been deleted. Check for active questions before displaying or reusing it.\n *\n * To discover a quiz ID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.\n * @param quizId - Quiz ID, available from `step.quizOptions.id` on a quiz-type Online Programs step.\n * @public\n * @requiredField quizId\n * @permissionId achievements:quizzes:v1:quiz:get_quiz\n * @applicableIdentity APP\n * @returns Requested quiz definition.\n * @fqn wix.achievements.quizzes.v1.QuizService.GetQuiz\n */\nexport async function getQuiz(quizId: string): Promise<\n NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 2> & {\n __applicationErrorsType?: GetQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quizId: quizId });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.getQuiz(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.quiz!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { quizId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Permanently deletes a quiz definition.\n *\n * This operation doesn't check whether Online Programs steps reference the quiz. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete multiple quiz definitions in a single API call, call [Bulk Delete Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes).\n * @param quizId - ID of the quiz definition to permanently delete.\n * @public\n * @requiredField quizId\n * @permissionId QUIZZES.DELETE_QUIZ\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.DeleteQuiz\n */\nexport async function deleteQuiz(quizId: string): Promise<\n NonNullablePaths<\n DeleteQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 3\n > & {\n __applicationErrorsType?: DeleteQuizApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ quizId: quizId });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.deleteQuiz(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: { quizId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Permanently deletes up to 100 quiz definitions.\n *\n * Individual item failures don't fail the bulk request. Check `results.itemMetadata.success` for each item and inspect `results.itemMetadata.error` when it is `false`. Individual results can contain error codes not listed for the request.\n *\n * This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete a single quiz definition, call [Delete Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/delete-quiz).\n * @param quizIds - IDs of the quiz definitions to permanently delete. Coordinate deletion with the Steps API and remove known step references first.\n * @public\n * @documentationMaturity preview\n * @requiredField quizIds\n * @permissionId achievements:quizzes:v1:quiz:bulk_delete_quizzes\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.BulkDeleteQuizzes\n */\nexport async function bulkDeleteQuizzes(\n quizIds: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteQuizzesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\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({ quizIds: quizIds });\n\n const reqOpts =\n ambassadorWixAchievementsQuizzesV1Quiz.bulkDeleteQuizzes(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: { quizIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['quizIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nconst TRANSFORM_PATHS_0 = [\n { path: 'quiz.createdDate' },\n { path: 'quiz.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n { path: 'quiz.fields.score' },\n { path: 'quiz.fields.numeric.rightAnswer' },\n];\nconst TRANSFORM_PATHS_2 = [\n { path: 'quizzes.createdDate' },\n { path: 'quizzes.updatedDate' },\n];\nconst TRANSFORM_PATHS_3 = [\n { path: 'quizzes.fields.score' },\n { path: 'quizzes.fields.numeric.rightAnswer' },\n];\nconst TRANSFORM_PATHS_4 = [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n];\nconst TRANSFORM_PATHS_5 = [\n { path: 'results.item.fields.score' },\n { path: 'results.item.fields.numeric.rightAnswer' },\n];\n\nfunction resolveWixAchievementsQuizzesV1QuizServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/online-programs/v1/quizzes',\n destPath: '/v1/quizzes',\n },\n {\n srcPath: '/online-programs/v1/bulk/quizzes',\n destPath: '/v1/bulk/quizzes',\n },\n ],\n _: [\n {\n srcPath: '/_api/quiz-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_online-programs_quizzes';\n\n/**\n * Creates a detached quiz definition with at least one question.\n *\n * To use the quiz in an Online Program, specify the returned quiz ID as `step.quizOptions.id` when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create multiple quiz definitions in a single API call, call [Bulk Create Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-create-quizzes).\n */\nexport function createQuiz(payload: object): RequestOptionsFactory<any> {\n function __createQuiz({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: TRANSFORM_PATHS_1,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.CreateQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createQuiz;\n}\n\n/**\n * Clones a quiz definition and returns a new quiz ID.\n *\n * A quiz with no active questions can't be cloned; the request fails with INVALID_QUIZ. Avoid modifying the source quiz while cloning it.\n *\n * This operation copies the question and settings definition only. It doesn't copy Online Programs step associations or quiz submissions. Attach the returned ID to a step separately when needed.\n */\nexport function cloneQuiz(payload: object): RequestOptionsFactory<any> {\n function __cloneQuiz({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.CloneQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes/{quizId}/clone',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __cloneQuiz;\n}\n\n/**\n * Creates up to 30 detached quiz definitions in a single API call.\n *\n * Each definition must contain at least one question.\n *\n * Quiz IDs, revisions, and creation and update timestamps are assigned by the server. Client-supplied values for these read-only fields are ignored. Question IDs (`quizzes.fields.id`) must be supplied by the caller.\n *\n * Invalid quiz definitions fail the entire request before any quizzes are created.\n *\n * Individual item failures don't fail the bulk request. Check `results.itemMetadata.success` for each item and inspect `results.itemMetadata.error` when it is `false`. Individual results can contain error codes not listed for the request.\n *\n * To use the quizzes in an Online Program, specify the returned quiz IDs as `step.quizOptions.id` values when calling the Steps API's [Create Step](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step) or [Bulk Create Steps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps) method.\n *\n * To create a single quiz definition, call [Create Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/create-quiz).\n */\nexport function bulkCreateQuizzes(payload: object): RequestOptionsFactory<any> {\n function __bulkCreateQuizzes({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: TRANSFORM_PATHS_2,\n },\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: TRANSFORM_PATHS_3,\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.BulkCreateQuizzes',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/bulk/quizzes/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_4,\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: TRANSFORM_PATHS_5,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateQuizzes;\n}\n\n/**\n * Retrieves a quiz definition by ID.\n *\n * A retrieved quiz can have an empty fields list after all its questions have been deleted. Check for active questions before displaying or reusing it.\n *\n * To discover a quiz ID, query or retrieve its quiz-type Online Programs step and read `step.quizOptions.id`.\n */\nexport function getQuiz(payload: object): RequestOptionsFactory<any> {\n function __getQuiz({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'GET' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.GetQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes/{quizId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getQuiz;\n}\n\n/**\n * Permanently deletes a quiz definition.\n *\n * This operation doesn't check whether Online Programs steps reference the quiz. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete multiple quiz definitions in a single API call, call [Bulk Delete Quizzes](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/bulk-delete-quizzes).\n */\nexport function deleteQuiz(payload: object): RequestOptionsFactory<any> {\n function __deleteQuiz({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'DELETE' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.DeleteQuiz',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/quizzes/{quizId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: TRANSFORM_PATHS_0,\n },\n {\n transformFn: transformRESTFloatToSDKFloat,\n paths: TRANSFORM_PATHS_1,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __deleteQuiz;\n}\n\n/**\n * Permanently deletes up to 100 quiz definitions.\n *\n * Individual item failures don't fail the bulk request. Check `results.itemMetadata.success` for each item and inspect `results.itemMetadata.error` when it is `false`. Individual results can contain error codes not listed for the request.\n *\n * This operation doesn't check whether Online Programs steps reference the quizzes. Coordinate deletion with the Steps API and remove known step references first. Otherwise, steps can retain dangling quiz references.\n *\n * To delete a single quiz definition, call [Delete Quiz](https://dev.wix.com/docs/api-reference/business-management/online-programs/quizzes/delete-quiz).\n */\nexport function bulkDeleteQuizzes(payload: object): RequestOptionsFactory<any> {\n function __bulkDeleteQuizzes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.BulkDeleteQuizzes',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/bulk/quizzes/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteQuizzes;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C,SAAS,oCAAoC;AAC7C,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,mBAAmB;AAAA,EAC3B,EAAE,MAAM,mBAAmB;AAC7B;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,oBAAoB;AAAA,EAC5B,EAAE,MAAM,kCAAkC;AAC5C;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,sBAAsB;AAAA,EAC9B,EAAE,MAAM,sBAAsB;AAChC;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,uBAAuB;AAAA,EAC/B,EAAE,MAAM,qCAAqC;AAC/C;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,2BAA2B;AAAA,EACnC,EAAE,MAAM,2BAA2B;AACrC;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,4BAA4B;AAAA,EACpC,EAAE,MAAM,0CAA0C;AACpD;AAEA,SAAS,8CACP,MACA;AAC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AyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","FileUploadFormat","WebhookIdentityType","createQuiz","cloneQuiz","bulkCreateQuizzes","getQuiz","deleteQuiz","bulkDeleteQuizzes"]}
@@ -33,7 +33,7 @@ interface Quiz {
33
33
  */
34
34
  updatedDate?: Date | null;
35
35
  /**
36
- * Active questions in the quiz. Each `QuizField` defines one question and its answer input. Creating or cloning a quiz requires at least one active question. GetQuiz can return a legacy stored definition with an empty list; don't assume a retrieved definition has active questions.
36
+ * Active questions in the quiz. Each `QuizField` defines one question and its answer input. Creating or cloning a quiz requires at least one active question. A retrieved quiz can have an empty list after all its questions have been deleted. Check for active questions before displaying or reusing it.
37
37
  *
38
38
  * New submissions use the current questions; stored submissions retain their recorded answer evaluations.
39
39
  * @minSize 1
@@ -139,7 +139,7 @@ interface NumericField {
139
139
  /**
140
140
  * Correct numeric value. Matching is exact. If no correct value is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
141
141
  *
142
- * Omitted from responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct value is stored.
142
+ * Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct value is stored.
143
143
  */
144
144
  rightAnswer?: number | null;
145
145
  }
@@ -147,7 +147,7 @@ interface ShortTextField {
147
147
  /**
148
148
  * Correct text. Matching trims leading and trailing whitespace and is case-insensitive. If no correct text is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
149
149
  *
150
- * Omitted from responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct text is stored.
150
+ * Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct text is stored.
151
151
  * @minLength 1
152
152
  * @maxLength 200
153
153
  */
@@ -160,7 +160,7 @@ interface SingleChoiceField {
160
160
  /**
161
161
  * Correct option. When supplied, it must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers is exact. If no correct option is stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
162
162
  *
163
- * Omitted from responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove the stored key or change grading; an absent response value doesn't mean no correct option is stored.
163
+ * Omitted from responses when the caller can't access answer keys. Hidden answers still participate in grading; an absent response value doesn't mean no correct option is stored.
164
164
  * @minLength 1
165
165
  * @maxLength 350
166
166
  */
@@ -179,7 +179,7 @@ interface MultiChoiceField {
179
179
  /**
180
180
  * Correct options. Every supplied value must exactly match an entry in `options`; otherwise, creation fails with INVALID_QUIZ. Matching submitted answers ignores option order but doesn't ignore duplicate values. If no correct options are stored for this question, its submitted answer is non-evaluable and counts as correct when calculating the earned grade.
181
181
  *
182
- * Empty in responses when the caller lacks `achievements:quizzes:v1:quiz:read_sensitive_fields` permission. Response filtering doesn't remove stored keys or change grading; an empty response list doesn't mean no correct options are stored.
182
+ * Empty in responses when the caller can't access answer keys. Hidden answers still participate in grading; an empty response list doesn't mean no correct options are stored.
183
183
  * @maxSize 90
184
184
  * @minLength 1
185
185
  * @maxLength 350
@@ -281,9 +281,9 @@ interface ApplicationError {
281
281
  data?: Record<string, any> | null;
282
282
  }
283
283
  interface BulkCreateQuizzesResponseBulkQuizResult {
284
- /** Metadata for the individual create operation. When the operation fails, `error` contains the original Wix Forms application error. */
284
+ /** Result metadata for the individual create operation. If `success` is `false`, inspect `error` for details. Individual results can contain error codes not listed for the request. */
285
285
  itemMetadata?: ItemMetadata;
286
- /** Created quiz. Empty when `return_entity` is `false`. */
286
+ /** Created quiz. Empty when `returnEntity` is `false`. */
287
287
  item?: Quiz;
288
288
  }
289
289
  interface BulkActionMetadata {
@@ -363,7 +363,7 @@ interface BulkDeleteQuizzesResponse {
363
363
  bulkActionMetadata?: BulkActionMetadata;
364
364
  }
365
365
  interface BulkDeleteQuizzesResponseBulkQuizResult {
366
- /** Metadata for the individual delete operation. When the operation fails, `error` contains the original Wix Forms application error. */
366
+ /** Result metadata for the individual delete operation. If `success` is `false`, inspect `error` for details. Individual results can contain error codes not listed for the request. */
367
367
  itemMetadata?: ItemMetadata;
368
368
  }
369
369
  interface DomainEvent extends DomainEventBodyOneOf {
package/build/es/meta.mjs CHANGED
@@ -6,6 +6,30 @@ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transform
6
6
  import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
7
7
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
8
8
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
9
+ var TRANSFORM_PATHS_0 = [
10
+ { path: "quiz.createdDate" },
11
+ { path: "quiz.updatedDate" }
12
+ ];
13
+ var TRANSFORM_PATHS_1 = [
14
+ { path: "quiz.fields.score" },
15
+ { path: "quiz.fields.numeric.rightAnswer" }
16
+ ];
17
+ var TRANSFORM_PATHS_2 = [
18
+ { path: "quizzes.createdDate" },
19
+ { path: "quizzes.updatedDate" }
20
+ ];
21
+ var TRANSFORM_PATHS_3 = [
22
+ { path: "quizzes.fields.score" },
23
+ { path: "quizzes.fields.numeric.rightAnswer" }
24
+ ];
25
+ var TRANSFORM_PATHS_4 = [
26
+ { path: "results.item.createdDate" },
27
+ { path: "results.item.updatedDate" }
28
+ ];
29
+ var TRANSFORM_PATHS_5 = [
30
+ { path: "results.item.fields.score" },
31
+ { path: "results.item.fields.numeric.rightAnswer" }
32
+ ];
9
33
  function resolveWixAchievementsQuizzesV1QuizServiceUrl(opts) {
10
34
  const domainToMappings = {
11
35
  "www.wixapis.com": [
@@ -33,14 +57,11 @@ function createQuiz(payload) {
33
57
  const serializedData = transformPaths(payload, [
34
58
  {
35
59
  transformFn: transformSDKTimestampToRESTTimestamp,
36
- paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
60
+ paths: TRANSFORM_PATHS_0
37
61
  },
38
62
  {
39
63
  transformFn: transformSDKFloatToRESTFloat,
40
- paths: [
41
- { path: "quiz.fields.score" },
42
- { path: "quiz.fields.numeric.rightAnswer" }
43
- ]
64
+ paths: TRANSFORM_PATHS_1
44
65
  }
45
66
  ]);
46
67
  const metadata = {
@@ -60,14 +81,11 @@ function createQuiz(payload) {
60
81
  transformResponse: (payload2) => transformPaths(payload2, [
61
82
  {
62
83
  transformFn: transformRESTTimestampToSDKTimestamp,
63
- paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
84
+ paths: TRANSFORM_PATHS_0
64
85
  },
65
86
  {
66
87
  transformFn: transformRESTFloatToSDKFloat,
67
- paths: [
68
- { path: "quiz.fields.score" },
69
- { path: "quiz.fields.numeric.rightAnswer" }
70
- ]
88
+ paths: TRANSFORM_PATHS_1
71
89
  }
72
90
  ])
73
91
  };
@@ -94,14 +112,11 @@ function cloneQuiz(payload) {
94
112
  transformResponse: (payload2) => transformPaths(payload2, [
95
113
  {
96
114
  transformFn: transformRESTTimestampToSDKTimestamp,
97
- paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
115
+ paths: TRANSFORM_PATHS_0
98
116
  },
99
117
  {
100
118
  transformFn: transformRESTFloatToSDKFloat,
101
- paths: [
102
- { path: "quiz.fields.score" },
103
- { path: "quiz.fields.numeric.rightAnswer" }
104
- ]
119
+ paths: TRANSFORM_PATHS_1
105
120
  }
106
121
  ])
107
122
  };
@@ -114,17 +129,11 @@ function bulkCreateQuizzes(payload) {
114
129
  const serializedData = transformPaths(payload, [
115
130
  {
116
131
  transformFn: transformSDKTimestampToRESTTimestamp,
117
- paths: [
118
- { path: "quizzes.createdDate" },
119
- { path: "quizzes.updatedDate" }
120
- ]
132
+ paths: TRANSFORM_PATHS_2
121
133
  },
122
134
  {
123
135
  transformFn: transformSDKFloatToRESTFloat,
124
- paths: [
125
- { path: "quizzes.fields.score" },
126
- { path: "quizzes.fields.numeric.rightAnswer" }
127
- ]
136
+ paths: TRANSFORM_PATHS_3
128
137
  }
129
138
  ]);
130
139
  const metadata = {
@@ -144,17 +153,11 @@ function bulkCreateQuizzes(payload) {
144
153
  transformResponse: (payload2) => transformPaths(payload2, [
145
154
  {
146
155
  transformFn: transformRESTTimestampToSDKTimestamp,
147
- paths: [
148
- { path: "results.item.createdDate" },
149
- { path: "results.item.updatedDate" }
150
- ]
156
+ paths: TRANSFORM_PATHS_4
151
157
  },
152
158
  {
153
159
  transformFn: transformRESTFloatToSDKFloat,
154
- paths: [
155
- { path: "results.item.fields.score" },
156
- { path: "results.item.fields.numeric.rightAnswer" }
157
- ]
160
+ paths: TRANSFORM_PATHS_5
158
161
  }
159
162
  ])
160
163
  };
@@ -181,14 +184,11 @@ function getQuiz(payload) {
181
184
  transformResponse: (payload2) => transformPaths(payload2, [
182
185
  {
183
186
  transformFn: transformRESTTimestampToSDKTimestamp,
184
- paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
187
+ paths: TRANSFORM_PATHS_0
185
188
  },
186
189
  {
187
190
  transformFn: transformRESTFloatToSDKFloat,
188
- paths: [
189
- { path: "quiz.fields.score" },
190
- { path: "quiz.fields.numeric.rightAnswer" }
191
- ]
191
+ paths: TRANSFORM_PATHS_1
192
192
  }
193
193
  ])
194
194
  };
@@ -215,14 +215,11 @@ function deleteQuiz(payload) {
215
215
  transformResponse: (payload2) => transformPaths(payload2, [
216
216
  {
217
217
  transformFn: transformRESTTimestampToSDKTimestamp,
218
- paths: [{ path: "quiz.createdDate" }, { path: "quiz.updatedDate" }]
218
+ paths: TRANSFORM_PATHS_0
219
219
  },
220
220
  {
221
221
  transformFn: transformRESTFloatToSDKFloat,
222
- paths: [
223
- { path: "quiz.fields.score" },
224
- { path: "quiz.fields.numeric.rightAnswer" }
225
- ]
222
+ paths: TRANSFORM_PATHS_1
226
223
  }
227
224
  ])
228
225
  };