@wix/auto_sdk_online-programs_quizzes 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/build/cjs/index.d.ts +63 -0
  2. package/build/cjs/index.js +506 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +525 -0
  5. package/build/cjs/index.typings.js +451 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +318 -0
  8. package/build/cjs/meta.js +385 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/es/index.d.mts +63 -0
  11. package/build/es/index.mjs +475 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/es/index.typings.d.mts +525 -0
  14. package/build/es/index.typings.mjs +420 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +318 -0
  17. package/build/es/meta.mjs +353 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/es/package.json +3 -0
  20. package/build/internal/cjs/index.d.ts +63 -0
  21. package/build/internal/cjs/index.js +506 -0
  22. package/build/internal/cjs/index.js.map +1 -0
  23. package/build/internal/cjs/index.typings.d.ts +525 -0
  24. package/build/internal/cjs/index.typings.js +451 -0
  25. package/build/internal/cjs/index.typings.js.map +1 -0
  26. package/build/internal/cjs/meta.d.ts +318 -0
  27. package/build/internal/cjs/meta.js +385 -0
  28. package/build/internal/cjs/meta.js.map +1 -0
  29. package/build/internal/es/index.d.mts +63 -0
  30. package/build/internal/es/index.mjs +475 -0
  31. package/build/internal/es/index.mjs.map +1 -0
  32. package/build/internal/es/index.typings.d.mts +525 -0
  33. package/build/internal/es/index.typings.mjs +420 -0
  34. package/build/internal/es/index.typings.mjs.map +1 -0
  35. package/build/internal/es/meta.d.mts +318 -0
  36. package/build/internal/es/meta.mjs +353 -0
  37. package/build/internal/es/meta.mjs.map +1 -0
  38. package/meta/package.json +3 -0
  39. package/package.json +54 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts","../../src/achievements-quizzes-v1-quiz-quizzes.universal.ts","../../src/achievements-quizzes-v1-quiz-quizzes.http.ts","../../src/achievements-quizzes-v1-quiz-quizzes.public.ts","../../src/achievements-quizzes-v1-quiz-quizzes.context.ts"],"sourcesContent":["export * from './src/achievements-quizzes-v1-quiz-quizzes.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixAchievementsQuizzesV1Quiz from './achievements-quizzes-v1-quiz-quizzes.http.js';\n\nexport interface Quiz {\n /**\n * ID of the quiz\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /** Quiz settings */\n settings?: QuizSettings;\n /**\n * Represents the current state of the quiz. Each time the it is modified, its `revision` changes. For an update operation to succeed, you MUST pass the latest revision\n * @readonly\n */\n revision?: string | null;\n /**\n * The time this quiz was created\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * The time this quiz was last updated\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Quiz fields\n * @minSize 1\n * @maxSize 200\n */\n fields?: QuizField[];\n}\n\nexport interface QuizSettings {\n /**\n * Minimal grade to pass the quiz\n * @max 100\n */\n passingGrade?: number | null;\n /**\n * Quiz title\n * @maxLength 200\n */\n title?: string | null;\n /**\n * Maximal number of submission attempts\n * @min 1\n */\n attempts?: number | null;\n}\n\nexport interface QuizField extends QuizFieldFieldTypeOneOf {\n /** Type for numeric input */\n numeric?: NumericField;\n /** Type for text input */\n shortText?: ShortTextField;\n /** Type for long text input */\n longText?: LongTextField;\n /** Type for input with predefined options where only one can be selected */\n singleChoice?: SingleChoiceField;\n /** Type for input with predefined options where multiple can be selected */\n multiChoice?: MultiChoiceField;\n /** Type for file input */\n fileUpload?: FileUploadField;\n /**\n * Field ID\n * @format GUID\n * @immutable\n */\n _id?: string;\n /**\n * Key used in submission\n * @maxLength 200\n * @immutable\n */\n target?: string | null;\n /**\n * Question\n * @minLength 1\n * @maxLength 350\n */\n question?: string | null;\n /** Score of the question when answered right */\n score?: number | null;\n /**\n * Message shown for right answer\n * @maxLength 350\n */\n rightMessage?: string | null;\n /**\n * Message shown for wrong answer\n * @maxLength 350\n */\n wrongMessage?: string | null;\n}\n\n/** @oneof */\nexport interface QuizFieldFieldTypeOneOf {\n /** Type for numeric input */\n numeric?: NumericField;\n /** Type for text input */\n shortText?: ShortTextField;\n /** Type for long text input */\n longText?: LongTextField;\n /** Type for input with predefined options where only one can be selected */\n singleChoice?: SingleChoiceField;\n /** Type for input with predefined options where multiple can be selected */\n multiChoice?: MultiChoiceField;\n /** Type for file input */\n fileUpload?: FileUploadField;\n}\n\nexport enum FileFormat {\n IMAGE = 'IMAGE',\n VIDEO = 'VIDEO',\n AUDIO = 'AUDIO',\n DOCUMENT = 'DOCUMENT',\n ARCHIVE = 'ARCHIVE',\n}\n\n/** @enumType */\nexport type FileFormatWithLiterals =\n | FileFormat\n | 'IMAGE'\n | 'VIDEO'\n | 'AUDIO'\n | 'DOCUMENT'\n | 'ARCHIVE';\n\nexport interface NumericField {\n /** Right answer */\n rightAnswer?: number | null;\n}\n\nexport interface ShortTextField {\n /**\n * Right answer\n * @minLength 1\n * @maxLength 200\n */\n rightAnswer?: string | null;\n}\n\nexport interface LongTextField {}\n\nexport interface SingleChoiceField {\n /**\n * Right answer\n * @minLength 1\n * @maxLength 350\n */\n rightAnswer?: string | null;\n /**\n * Answer options\n * @minSize 1\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n options?: string[] | null;\n}\n\nexport interface MultiChoiceField {\n /**\n * Right answer\n * @maxSize 90\n * @minLength 1\n * @maxLength 350\n */\n rightAnswer?: string[] | null;\n /**\n * Answer options\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 for upload button\n * @minLength 1\n * @maxLength 100\n */\n buttonText?: string | null;\n /**\n * Limit of upload items\n * @min 1\n * @max 10\n */\n itemsLimit?: number | null;\n /**\n * Formats of files that can be uploaded\n * @minSize 1\n * @maxSize 4\n */\n fileFormats?: FileFormatWithLiterals[];\n}\n\nexport interface CreateQuizRequest {\n /** Quiz to created */\n quiz: Quiz;\n}\n\nexport interface CreateQuizResponse {\n /** Created quiz */\n quiz?: Quiz;\n}\n\nexport interface CloneQuizRequest {\n /**\n * ID of the quiz to be cloned\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface CloneQuizResponse {\n /** Cloned quiz */\n quiz?: Quiz;\n}\n\nexport interface BulkCreateQuizRequest {\n /**\n * Quizzes to be created\n * @maxSize 30\n */\n quizzes: Quiz[];\n /** When set, items will be returned on successful create */\n returnEntity?: boolean;\n}\n\nexport interface BulkCreateQuizResponse {\n /** Created quizzes with metadata */\n results?: BulkQuizResult[];\n}\n\nexport interface BulkQuizResult {\n /** Created quiz metadata */\n itemMetadata?: ItemMetadata;\n /** Created quiz */\n item?: Quiz;\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 BulkCloneQuizRequest {\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 BulkCloneQuizResponse {\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 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 GetQuizRequest {\n /**\n * ID of the quiz\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface GetQuizResponse {\n /** Requested quiz */\n quiz?: Quiz;\n}\n\nexport interface UpdateQuizRequest {\n /** Quiz to be updated. Maybe partial */\n quiz?: Quiz;\n}\n\nexport interface UpdateQuizResponse {\n /** Updated quiz */\n quiz?: Quiz;\n}\n\nexport interface DeleteQuizRequest {\n /**\n * ID of quiz\n * @format GUID\n */\n quizId: string;\n}\n\nexport interface DeleteQuizResponse {\n /** Deleted quiz */\n quiz?: Quiz;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\n/**\n * Creates quiz\n * @param quiz - Quiz to created\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\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 5\n >\n): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>> {\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 quiz\n * @param quizId - ID of the quiz to be cloned\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(\n quizId: string\n): Promise<\n NonNullablePaths<\n CloneQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 5\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 quizzes\n * @param quizzes - Quizzes to be created\n * @public\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 QUIZZES.CREATE_QUIZ\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.BulkCreateQuiz\n */\nexport async function bulkCreateQuiz(\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 5\n >[],\n options?: BulkCreateQuizOptions\n): Promise<\n NonNullablePaths<\n BulkCreateQuizResponse,\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 6\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.bulkCreateQuiz(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 BulkCreateQuizOptions {\n /** When set, items will be returned on successful create */\n returnEntity?: boolean;\n}\n\n/**\n * Clones quizzes\n * @param quizIds - IDs of the quizzes to clone.\n * @public\n * @documentationMaturity preview\n * @requiredField quizIds\n * @permissionId QUIZZES.CREATE_QUIZ\n * @applicableIdentity APP\n * @fqn wix.achievements.quizzes.v1.QuizService.BulkCloneQuiz\n */\nexport async function bulkCloneQuiz(\n quizIds: string[],\n options?: BulkCloneQuizOptions\n): Promise<\n NonNullablePaths<\n BulkCloneQuizResponse,\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 6\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 quizIds: quizIds,\n returnEntity: options?.returnEntity,\n });\n\n const reqOpts = ambassadorWixAchievementsQuizzesV1Quiz.bulkCloneQuiz(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 quizIds: '$[0]',\n returnEntity: '$[1].returnEntity',\n },\n singleArgumentUnchanged: false,\n },\n ['quizIds', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCloneQuizOptions {\n /**\n * Whether to return the cloned quizzes in the response.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\n/**\n * Reads quiz by ID\n * @param quizId - ID of the quiz\n * @public\n * @requiredField quizId\n * @permissionId QUIZZES.READ_QUIZ\n * @applicableIdentity APP\n * @returns Requested quiz\n * @fqn wix.achievements.quizzes.v1.QuizService.GetQuiz\n */\nexport async function getQuiz(\n quizId: string\n): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>> {\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 * Deletes quiz\n * @param quizId - ID of quiz\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(\n quizId: string\n): Promise<\n NonNullablePaths<\n DeleteQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 5\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","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\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_online-programs_quizzes';\n\n/** Creates quiz */\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 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/** Clones quiz */\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 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/** Creates quizzes */\nexport function bulkCreateQuiz(payload: object): RequestOptionsFactory<any> {\n function __bulkCreateQuiz({ 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.BulkCreateQuiz',\n packageName: PACKAGE_NAME,\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 __bulkCreateQuiz;\n}\n\n/** Clones quizzes */\nexport function bulkCloneQuiz(payload: object): RequestOptionsFactory<any> {\n function __bulkCloneQuiz({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.achievements.quizzes.v1.quiz',\n method: 'POST' as any,\n methodFqn: 'wix.achievements.quizzes.v1.QuizService.BulkCloneQuiz',\n packageName: PACKAGE_NAME,\n url: resolveWixAchievementsQuizzesV1QuizServiceUrl({\n protoPath: '/v1/bulk/quizzes/clone',\n data: payload,\n host,\n }),\n data: payload,\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 __bulkCloneQuiz;\n}\n\n/** Reads quiz by ID */\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 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/** Deletes quiz */\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 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","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n BulkCloneQuizOptions,\n BulkCloneQuizResponse,\n BulkCreateQuizOptions,\n BulkCreateQuizResponse,\n CloneQuizResponse,\n DeleteQuizResponse,\n Quiz,\n bulkCloneQuiz as universalBulkCloneQuiz,\n bulkCreateQuiz as universalBulkCreateQuiz,\n cloneQuiz as universalCloneQuiz,\n createQuiz as universalCreateQuiz,\n deleteQuiz as universalDeleteQuiz,\n getQuiz as universalGetQuiz,\n} from './achievements-quizzes-v1-quiz-quizzes.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/online-programs' };\n\nexport function createQuiz(httpClient: HttpClient): CreateQuizSignature {\n return (\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 5\n >\n ) =>\n universalCreateQuiz(\n quiz,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateQuizSignature {\n /**\n * Creates quiz\n * @param - Quiz to created\n * @returns Created quiz\n */\n (\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 5\n >\n ): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>>;\n}\n\nexport function cloneQuiz(httpClient: HttpClient): CloneQuizSignature {\n return (quizId: string) =>\n universalCloneQuiz(\n quizId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CloneQuizSignature {\n /**\n * Clones quiz\n * @param - ID of the quiz to be cloned\n */\n (quizId: string): Promise<\n NonNullablePaths<\n CloneQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 5\n >\n >;\n}\n\nexport function bulkCreateQuiz(\n httpClient: HttpClient\n): BulkCreateQuizSignature {\n return (\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 5\n >[],\n options?: BulkCreateQuizOptions\n ) =>\n universalBulkCreateQuiz(\n quizzes,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCreateQuizSignature {\n /**\n * Creates quizzes\n * @param - Quizzes to be created\n */\n (\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 5\n >[],\n options?: BulkCreateQuizOptions\n ): Promise<\n NonNullablePaths<\n BulkCreateQuizResponse,\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 6\n >\n >;\n}\n\nexport function bulkCloneQuiz(httpClient: HttpClient): BulkCloneQuizSignature {\n return (quizIds: string[], options?: BulkCloneQuizOptions) =>\n universalBulkCloneQuiz(\n quizIds,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCloneQuizSignature {\n /**\n * Clones quizzes\n * @param - IDs of the quizzes to clone.\n */\n (quizIds: string[], options?: BulkCloneQuizOptions): Promise<\n NonNullablePaths<\n BulkCloneQuizResponse,\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 6\n >\n >;\n}\n\nexport function getQuiz(httpClient: HttpClient): GetQuizSignature {\n return (quizId: string) =>\n universalGetQuiz(\n quizId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetQuizSignature {\n /**\n * Reads quiz by ID\n * @param - ID of the quiz\n * @returns Requested quiz\n */\n (quizId: string): Promise<\n NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>\n >;\n}\n\nexport function deleteQuiz(httpClient: HttpClient): DeleteQuizSignature {\n return (quizId: string) =>\n universalDeleteQuiz(\n quizId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteQuizSignature {\n /**\n * Deletes quiz\n * @param - ID of quiz\n */\n (quizId: string): Promise<\n NonNullablePaths<\n DeleteQuizResponse,\n `quiz.fields` | `quiz.fields.${number}._id`,\n 5\n >\n >;\n}\n\nexport {\n ActionEvent,\n ApplicationError,\n BulkActionMetadata,\n BulkCloneQuizOptions,\n BulkCloneQuizRequest,\n BulkCloneQuizResponse,\n BulkCreateQuizOptions,\n BulkCreateQuizRequest,\n BulkCreateQuizResponse,\n BulkQuizResult,\n CloneQuizRequest,\n CloneQuizResponse,\n CreateQuizRequest,\n CreateQuizResponse,\n DeleteQuizRequest,\n DeleteQuizResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n FileFormat,\n FileUploadField,\n GetQuizRequest,\n GetQuizResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n LongTextField,\n MessageEnvelope,\n MultiChoiceField,\n NumericField,\n Quiz,\n QuizField,\n QuizFieldFieldTypeOneOf,\n QuizSettings,\n RestoreInfo,\n ShortTextField,\n SingleChoiceField,\n UpdateQuizRequest,\n UpdateQuizResponse,\n WebhookIdentityType,\n} from './achievements-quizzes-v1-quiz-quizzes.universal.js';\n","import {\n createQuiz as publicCreateQuiz,\n cloneQuiz as publicCloneQuiz,\n bulkCreateQuiz as publicBulkCreateQuiz,\n bulkCloneQuiz as publicBulkCloneQuiz,\n getQuiz as publicGetQuiz,\n deleteQuiz as publicDeleteQuiz,\n} from './achievements-quizzes-v1-quiz-quizzes.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const createQuiz: MaybeContext<\n BuildRESTFunction<typeof publicCreateQuiz> & typeof publicCreateQuiz\n> = /*#__PURE__*/ createRESTModule(publicCreateQuiz);\nexport const cloneQuiz: MaybeContext<\n BuildRESTFunction<typeof publicCloneQuiz> & typeof publicCloneQuiz\n> = /*#__PURE__*/ createRESTModule(publicCloneQuiz);\nexport const bulkCreateQuiz: MaybeContext<\n BuildRESTFunction<typeof publicBulkCreateQuiz> & typeof publicBulkCreateQuiz\n> = /*#__PURE__*/ createRESTModule(publicBulkCreateQuiz);\nexport const bulkCloneQuiz: MaybeContext<\n BuildRESTFunction<typeof publicBulkCloneQuiz> & typeof publicBulkCloneQuiz\n> = /*#__PURE__*/ createRESTModule(publicBulkCloneQuiz);\nexport const getQuiz: MaybeContext<\n BuildRESTFunction<typeof publicGetQuiz> & typeof publicGetQuiz\n> = /*#__PURE__*/ createRESTModule(publicGetQuiz);\nexport const deleteQuiz: MaybeContext<\n BuildRESTFunction<typeof publicDeleteQuiz> & typeof publicDeleteQuiz\n> = /*#__PURE__*/ createRESTModule(publicDeleteQuiz);\n\nexport {\n FileFormat,\n WebhookIdentityType,\n} from './achievements-quizzes-v1-quiz-quizzes.universal.js';\nexport {\n Quiz,\n QuizSettings,\n QuizField,\n QuizFieldFieldTypeOneOf,\n NumericField,\n ShortTextField,\n LongTextField,\n SingleChoiceField,\n MultiChoiceField,\n FileUploadField,\n CreateQuizRequest,\n CreateQuizResponse,\n CloneQuizRequest,\n CloneQuizResponse,\n BulkCreateQuizRequest,\n BulkCreateQuizResponse,\n BulkQuizResult,\n ItemMetadata,\n ApplicationError,\n BulkCloneQuizRequest,\n BulkCloneQuizResponse,\n BulkActionMetadata,\n GetQuizRequest,\n GetQuizResponse,\n UpdateQuizRequest,\n UpdateQuizResponse,\n DeleteQuizRequest,\n DeleteQuizResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BulkCreateQuizOptions,\n BulkCloneQuizOptions,\n} from './achievements-quizzes-v1-quiz-quizzes.universal.js';\nexport {\n FileFormatWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './achievements-quizzes-v1-quiz-quizzes.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,sBAAAC;AAAA,EAAA,iBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,mBAA6C;AAC7C,IAAAC,gBAA6C;AAC7C,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,8CACP,MACA;AACA,QAAM,mBAAmB,CAAC;AAE1B,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,WAAW,SAA6C;AACtE,WAAS,aAAa,EAAE,KA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A;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,SAAQ,YAA0C;AAChE,SAAO,CAAC,WACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAaO,SAASC,YAAW,YAA6C;AACtE,SAAO,CAAC,WACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC1LA,IAAAC,uBAAiC;AAG1B,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,aAEK,2DAAiBA,UAAe;AAC3C,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,WAEK,2DAAiBA,QAAa;AACzC,IAAMC,cAEK,2DAAiBA,WAAgB;","names":["bulkCloneQuiz","bulkCreateQuiz","cloneQuiz","createQuiz","deleteQuiz","getQuiz","import_float","import_timestamp","import_rest_modules","payload","FileFormat","WebhookIdentityType","createQuiz","sdkTransformError","cloneQuiz","bulkCreateQuiz","bulkCloneQuiz","getQuiz","deleteQuiz","createQuiz","cloneQuiz","bulkCreateQuiz","bulkCloneQuiz","getQuiz","deleteQuiz","import_rest_modules","createQuiz","cloneQuiz","bulkCreateQuiz","bulkCloneQuiz","getQuiz","deleteQuiz"]}
@@ -0,0 +1,525 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ interface Quiz {
4
+ /**
5
+ * ID of the quiz
6
+ * @format GUID
7
+ * @readonly
8
+ */
9
+ _id?: string | null;
10
+ /** Quiz settings */
11
+ settings?: QuizSettings;
12
+ /**
13
+ * Represents the current state of the quiz. Each time the it is modified, its `revision` changes. For an update operation to succeed, you MUST pass the latest revision
14
+ * @readonly
15
+ */
16
+ revision?: string | null;
17
+ /**
18
+ * The time this quiz was created
19
+ * @readonly
20
+ */
21
+ _createdDate?: Date | null;
22
+ /**
23
+ * The time this quiz was last updated
24
+ * @readonly
25
+ */
26
+ _updatedDate?: Date | null;
27
+ /**
28
+ * Quiz fields
29
+ * @minSize 1
30
+ * @maxSize 200
31
+ */
32
+ fields?: QuizField[];
33
+ }
34
+ interface QuizSettings {
35
+ /**
36
+ * Minimal grade to pass the quiz
37
+ * @max 100
38
+ */
39
+ passingGrade?: number | null;
40
+ /**
41
+ * Quiz title
42
+ * @maxLength 200
43
+ */
44
+ title?: string | null;
45
+ /**
46
+ * Maximal number of submission attempts
47
+ * @min 1
48
+ */
49
+ attempts?: number | null;
50
+ }
51
+ interface QuizField extends QuizFieldFieldTypeOneOf {
52
+ /** Type for numeric input */
53
+ numeric?: NumericField;
54
+ /** Type for text input */
55
+ shortText?: ShortTextField;
56
+ /** Type for long text input */
57
+ longText?: LongTextField;
58
+ /** Type for input with predefined options where only one can be selected */
59
+ singleChoice?: SingleChoiceField;
60
+ /** Type for input with predefined options where multiple can be selected */
61
+ multiChoice?: MultiChoiceField;
62
+ /** Type for file input */
63
+ fileUpload?: FileUploadField;
64
+ /**
65
+ * Field ID
66
+ * @format GUID
67
+ * @immutable
68
+ */
69
+ _id?: string;
70
+ /**
71
+ * Key used in submission
72
+ * @maxLength 200
73
+ * @immutable
74
+ */
75
+ target?: string | null;
76
+ /**
77
+ * Question
78
+ * @minLength 1
79
+ * @maxLength 350
80
+ */
81
+ question?: string | null;
82
+ /** Score of the question when answered right */
83
+ score?: number | null;
84
+ /**
85
+ * Message shown for right answer
86
+ * @maxLength 350
87
+ */
88
+ rightMessage?: string | null;
89
+ /**
90
+ * Message shown for wrong answer
91
+ * @maxLength 350
92
+ */
93
+ wrongMessage?: string | null;
94
+ }
95
+ /** @oneof */
96
+ interface QuizFieldFieldTypeOneOf {
97
+ /** Type for numeric input */
98
+ numeric?: NumericField;
99
+ /** Type for text input */
100
+ shortText?: ShortTextField;
101
+ /** Type for long text input */
102
+ longText?: LongTextField;
103
+ /** Type for input with predefined options where only one can be selected */
104
+ singleChoice?: SingleChoiceField;
105
+ /** Type for input with predefined options where multiple can be selected */
106
+ multiChoice?: MultiChoiceField;
107
+ /** Type for file input */
108
+ fileUpload?: FileUploadField;
109
+ }
110
+ declare enum FileFormat {
111
+ IMAGE = "IMAGE",
112
+ VIDEO = "VIDEO",
113
+ AUDIO = "AUDIO",
114
+ DOCUMENT = "DOCUMENT",
115
+ ARCHIVE = "ARCHIVE"
116
+ }
117
+ /** @enumType */
118
+ type FileFormatWithLiterals = FileFormat | 'IMAGE' | 'VIDEO' | 'AUDIO' | 'DOCUMENT' | 'ARCHIVE';
119
+ interface NumericField {
120
+ /** Right answer */
121
+ rightAnswer?: number | null;
122
+ }
123
+ interface ShortTextField {
124
+ /**
125
+ * Right answer
126
+ * @minLength 1
127
+ * @maxLength 200
128
+ */
129
+ rightAnswer?: string | null;
130
+ }
131
+ interface LongTextField {
132
+ }
133
+ interface SingleChoiceField {
134
+ /**
135
+ * Right answer
136
+ * @minLength 1
137
+ * @maxLength 350
138
+ */
139
+ rightAnswer?: string | null;
140
+ /**
141
+ * Answer options
142
+ * @minSize 1
143
+ * @maxSize 90
144
+ * @minLength 1
145
+ * @maxLength 350
146
+ */
147
+ options?: string[] | null;
148
+ }
149
+ interface MultiChoiceField {
150
+ /**
151
+ * Right answer
152
+ * @maxSize 90
153
+ * @minLength 1
154
+ * @maxLength 350
155
+ */
156
+ rightAnswer?: string[] | null;
157
+ /**
158
+ * Answer options
159
+ * @minSize 1
160
+ * @maxSize 90
161
+ * @minLength 1
162
+ * @maxLength 350
163
+ */
164
+ options?: string[] | null;
165
+ }
166
+ interface FileUploadField {
167
+ /**
168
+ * Text for upload button
169
+ * @minLength 1
170
+ * @maxLength 100
171
+ */
172
+ buttonText?: string | null;
173
+ /**
174
+ * Limit of upload items
175
+ * @min 1
176
+ * @max 10
177
+ */
178
+ itemsLimit?: number | null;
179
+ /**
180
+ * Formats of files that can be uploaded
181
+ * @minSize 1
182
+ * @maxSize 4
183
+ */
184
+ fileFormats?: FileFormatWithLiterals[];
185
+ }
186
+ interface CreateQuizRequest {
187
+ /** Quiz to created */
188
+ quiz: Quiz;
189
+ }
190
+ interface CreateQuizResponse {
191
+ /** Created quiz */
192
+ quiz?: Quiz;
193
+ }
194
+ interface CloneQuizRequest {
195
+ /**
196
+ * ID of the quiz to be cloned
197
+ * @format GUID
198
+ */
199
+ quizId: string;
200
+ }
201
+ interface CloneQuizResponse {
202
+ /** Cloned quiz */
203
+ quiz?: Quiz;
204
+ }
205
+ interface BulkCreateQuizRequest {
206
+ /**
207
+ * Quizzes to be created
208
+ * @maxSize 30
209
+ */
210
+ quizzes: Quiz[];
211
+ /** When set, items will be returned on successful create */
212
+ returnEntity?: boolean;
213
+ }
214
+ interface BulkCreateQuizResponse {
215
+ /** Created quizzes with metadata */
216
+ results?: BulkQuizResult[];
217
+ }
218
+ interface BulkQuizResult {
219
+ /** Created quiz metadata */
220
+ itemMetadata?: ItemMetadata;
221
+ /** Created quiz */
222
+ item?: Quiz;
223
+ }
224
+ interface ItemMetadata {
225
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
226
+ _id?: string | null;
227
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
228
+ originalIndex?: number;
229
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
230
+ success?: boolean;
231
+ /** Details about the error in case of failure. */
232
+ error?: ApplicationError;
233
+ }
234
+ interface ApplicationError {
235
+ /** Error code. */
236
+ code?: string;
237
+ /** Description of the error. */
238
+ description?: string;
239
+ /** Data related to the error. */
240
+ data?: Record<string, any> | null;
241
+ }
242
+ interface BulkCloneQuizRequest {
243
+ /**
244
+ * IDs of the quizzes to clone.
245
+ * @minSize 1
246
+ * @maxSize 30
247
+ * @format GUID
248
+ */
249
+ quizIds: string[];
250
+ /**
251
+ * Whether to return the cloned quizzes in the response.
252
+ *
253
+ * Default: `false`
254
+ */
255
+ returnEntity?: boolean;
256
+ }
257
+ interface BulkCloneQuizResponse {
258
+ /** Results of the bulk clone operation, including cloned quizzes and metadata. */
259
+ results?: BulkQuizResult[];
260
+ /** Metadata about the bulk operation. */
261
+ bulkActionMetadata?: BulkActionMetadata;
262
+ }
263
+ interface BulkActionMetadata {
264
+ /** Number of items that were successfully processed. */
265
+ totalSuccesses?: number;
266
+ /** Number of items that couldn't be processed. */
267
+ totalFailures?: number;
268
+ /** Number of failures without details because detailed failure threshold was exceeded. */
269
+ undetailedFailures?: number;
270
+ }
271
+ interface GetQuizRequest {
272
+ /**
273
+ * ID of the quiz
274
+ * @format GUID
275
+ */
276
+ quizId: string;
277
+ }
278
+ interface GetQuizResponse {
279
+ /** Requested quiz */
280
+ quiz?: Quiz;
281
+ }
282
+ interface UpdateQuizRequest {
283
+ /** Quiz to be updated. Maybe partial */
284
+ quiz?: Quiz;
285
+ }
286
+ interface UpdateQuizResponse {
287
+ /** Updated quiz */
288
+ quiz?: Quiz;
289
+ }
290
+ interface DeleteQuizRequest {
291
+ /**
292
+ * ID of quiz
293
+ * @format GUID
294
+ */
295
+ quizId: string;
296
+ }
297
+ interface DeleteQuizResponse {
298
+ /** Deleted quiz */
299
+ quiz?: Quiz;
300
+ }
301
+ interface DomainEvent extends DomainEventBodyOneOf {
302
+ createdEvent?: EntityCreatedEvent;
303
+ updatedEvent?: EntityUpdatedEvent;
304
+ deletedEvent?: EntityDeletedEvent;
305
+ actionEvent?: ActionEvent;
306
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
307
+ _id?: string;
308
+ /**
309
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
310
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
311
+ */
312
+ entityFqdn?: string;
313
+ /**
314
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
315
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
316
+ */
317
+ slug?: string;
318
+ /** ID of the entity associated with the event. */
319
+ entityId?: string;
320
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
321
+ eventTime?: Date | null;
322
+ /**
323
+ * Whether the event was triggered as a result of a privacy regulation application
324
+ * (for example, GDPR).
325
+ */
326
+ triggeredByAnonymizeRequest?: boolean | null;
327
+ /** If present, indicates the action that triggered the event. */
328
+ originatedFrom?: string | null;
329
+ /**
330
+ * 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.
331
+ * 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.
332
+ */
333
+ entityEventSequence?: string | null;
334
+ }
335
+ /** @oneof */
336
+ interface DomainEventBodyOneOf {
337
+ createdEvent?: EntityCreatedEvent;
338
+ updatedEvent?: EntityUpdatedEvent;
339
+ deletedEvent?: EntityDeletedEvent;
340
+ actionEvent?: ActionEvent;
341
+ }
342
+ interface EntityCreatedEvent {
343
+ entity?: string;
344
+ }
345
+ interface RestoreInfo {
346
+ deletedDate?: Date | null;
347
+ }
348
+ interface EntityUpdatedEvent {
349
+ /**
350
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
351
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
352
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
353
+ */
354
+ currentEntity?: string;
355
+ }
356
+ interface EntityDeletedEvent {
357
+ /** Entity that was deleted. */
358
+ deletedEntity?: string | null;
359
+ }
360
+ interface ActionEvent {
361
+ body?: string;
362
+ }
363
+ interface MessageEnvelope {
364
+ /**
365
+ * App instance ID.
366
+ * @format GUID
367
+ */
368
+ instanceId?: string | null;
369
+ /**
370
+ * Event type.
371
+ * @maxLength 150
372
+ */
373
+ eventType?: string;
374
+ /** The identification type and identity data. */
375
+ identity?: IdentificationData;
376
+ /** Stringify payload. */
377
+ data?: string;
378
+ }
379
+ interface IdentificationData extends IdentificationDataIdOneOf {
380
+ /**
381
+ * ID of a site visitor that has not logged in to the site.
382
+ * @format GUID
383
+ */
384
+ anonymousVisitorId?: string;
385
+ /**
386
+ * ID of a site visitor that has logged in to the site.
387
+ * @format GUID
388
+ */
389
+ memberId?: string;
390
+ /**
391
+ * ID of a Wix user (site owner, contributor, etc.).
392
+ * @format GUID
393
+ */
394
+ wixUserId?: string;
395
+ /**
396
+ * ID of an app.
397
+ * @format GUID
398
+ */
399
+ appId?: string;
400
+ /** @readonly */
401
+ identityType?: WebhookIdentityTypeWithLiterals;
402
+ }
403
+ /** @oneof */
404
+ interface IdentificationDataIdOneOf {
405
+ /**
406
+ * ID of a site visitor that has not logged in to the site.
407
+ * @format GUID
408
+ */
409
+ anonymousVisitorId?: string;
410
+ /**
411
+ * ID of a site visitor that has logged in to the site.
412
+ * @format GUID
413
+ */
414
+ memberId?: string;
415
+ /**
416
+ * ID of a Wix user (site owner, contributor, etc.).
417
+ * @format GUID
418
+ */
419
+ wixUserId?: string;
420
+ /**
421
+ * ID of an app.
422
+ * @format GUID
423
+ */
424
+ appId?: string;
425
+ }
426
+ declare enum WebhookIdentityType {
427
+ UNKNOWN = "UNKNOWN",
428
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
429
+ MEMBER = "MEMBER",
430
+ WIX_USER = "WIX_USER",
431
+ APP = "APP"
432
+ }
433
+ /** @enumType */
434
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
435
+ /**
436
+ * Creates quiz
437
+ * @param quiz - Quiz to created
438
+ * @public
439
+ * @requiredField quiz
440
+ * @requiredField quiz.fields
441
+ * @requiredField quiz.fields.FieldType
442
+ * @requiredField quiz.fields.FieldType.multiChoice.options
443
+ * @requiredField quiz.fields.FieldType.singleChoice.options
444
+ * @requiredField quiz.fields._id
445
+ * @requiredField quiz.fields.question
446
+ * @requiredField quiz.fields.target
447
+ * @permissionId QUIZZES.CREATE_QUIZ
448
+ * @applicableIdentity APP
449
+ * @returns Created quiz
450
+ * @fqn wix.achievements.quizzes.v1.QuizService.CreateQuiz
451
+ */
452
+ declare function createQuiz(quiz: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 5>): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>>;
453
+ /**
454
+ * Clones quiz
455
+ * @param quizId - ID of the quiz to be cloned
456
+ * @public
457
+ * @requiredField quizId
458
+ * @permissionId QUIZZES.CREATE_QUIZ
459
+ * @applicableIdentity APP
460
+ * @fqn wix.achievements.quizzes.v1.QuizService.CloneQuiz
461
+ */
462
+ declare function cloneQuiz(quizId: string): Promise<NonNullablePaths<CloneQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 5>>;
463
+ /**
464
+ * Creates quizzes
465
+ * @param quizzes - Quizzes to be created
466
+ * @public
467
+ * @requiredField quizzes
468
+ * @requiredField quizzes.fields
469
+ * @requiredField quizzes.fields.FieldType
470
+ * @requiredField quizzes.fields.FieldType.multiChoice.options
471
+ * @requiredField quizzes.fields.FieldType.singleChoice.options
472
+ * @requiredField quizzes.fields._id
473
+ * @requiredField quizzes.fields.question
474
+ * @requiredField quizzes.fields.target
475
+ * @permissionId QUIZZES.CREATE_QUIZ
476
+ * @applicableIdentity APP
477
+ * @fqn wix.achievements.quizzes.v1.QuizService.BulkCreateQuiz
478
+ */
479
+ declare function bulkCreateQuiz(quizzes: NonNullablePaths<Quiz, `fields` | `fields.${number}._id` | `fields.${number}.multiChoice.options` | `fields.${number}.question` | `fields.${number}.singleChoice.options` | `fields.${number}.target`, 5>[], options?: BulkCreateQuizOptions): Promise<NonNullablePaths<BulkCreateQuizResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description`, 6>>;
480
+ interface BulkCreateQuizOptions {
481
+ /** When set, items will be returned on successful create */
482
+ returnEntity?: boolean;
483
+ }
484
+ /**
485
+ * Clones quizzes
486
+ * @param quizIds - IDs of the quizzes to clone.
487
+ * @public
488
+ * @documentationMaturity preview
489
+ * @requiredField quizIds
490
+ * @permissionId QUIZZES.CREATE_QUIZ
491
+ * @applicableIdentity APP
492
+ * @fqn wix.achievements.quizzes.v1.QuizService.BulkCloneQuiz
493
+ */
494
+ declare function bulkCloneQuiz(quizIds: string[], options?: BulkCloneQuizOptions): Promise<NonNullablePaths<BulkCloneQuizResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
495
+ interface BulkCloneQuizOptions {
496
+ /**
497
+ * Whether to return the cloned quizzes in the response.
498
+ *
499
+ * Default: `false`
500
+ */
501
+ returnEntity?: boolean;
502
+ }
503
+ /**
504
+ * Reads quiz by ID
505
+ * @param quizId - ID of the quiz
506
+ * @public
507
+ * @requiredField quizId
508
+ * @permissionId QUIZZES.READ_QUIZ
509
+ * @applicableIdentity APP
510
+ * @returns Requested quiz
511
+ * @fqn wix.achievements.quizzes.v1.QuizService.GetQuiz
512
+ */
513
+ declare function getQuiz(quizId: string): Promise<NonNullablePaths<Quiz, `fields` | `fields.${number}._id`, 4>>;
514
+ /**
515
+ * Deletes quiz
516
+ * @param quizId - ID of quiz
517
+ * @public
518
+ * @requiredField quizId
519
+ * @permissionId QUIZZES.DELETE_QUIZ
520
+ * @applicableIdentity APP
521
+ * @fqn wix.achievements.quizzes.v1.QuizService.DeleteQuiz
522
+ */
523
+ declare function deleteQuiz(quizId: string): Promise<NonNullablePaths<DeleteQuizResponse, `quiz.fields` | `quiz.fields.${number}._id`, 5>>;
524
+
525
+ export { type ActionEvent, type ApplicationError, type BulkActionMetadata, type BulkCloneQuizOptions, type BulkCloneQuizRequest, type BulkCloneQuizResponse, type BulkCreateQuizOptions, type BulkCreateQuizRequest, type BulkCreateQuizResponse, type BulkQuizResult, type CloneQuizRequest, type CloneQuizResponse, type CreateQuizRequest, type CreateQuizResponse, type DeleteQuizRequest, type DeleteQuizResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, FileFormat, type FileFormatWithLiterals, type FileUploadField, type GetQuizRequest, type GetQuizResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type LongTextField, type MessageEnvelope, type MultiChoiceField, type NumericField, type Quiz, type QuizField, type QuizFieldFieldTypeOneOf, type QuizSettings, type RestoreInfo, type ShortTextField, type SingleChoiceField, type UpdateQuizRequest, type UpdateQuizResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCloneQuiz, bulkCreateQuiz, cloneQuiz, createQuiz, deleteQuiz, getQuiz };