import faker from '@faker-js/faker'; const arrayOf = (f: () => T) => { const length = 3; return Array.from({ length, }, f); }; const objectOf = (f: () => T) => { const keys = ['foo', 'bar', 'qux']; return keys.reduce>((object, key) => { object[key] = f(); return object; }, {}); }; const factories = { boolean: () => faker.datatype.boolean(), date_iso_8601: () => faker.datatype.datetime().toISOString().slice(0, 10), date_time_iso_8601: () => faker.datatype.datetime().toISOString(), decimal: () => faker.datatype.float(), double: () => faker.datatype.float(), integer: () => faker.datatype.number(), json: () => faker.datatype.json(), long: () => faker.datatype.number(), object: () => faker.datatype.json(), string: () => faker.datatype.string(), unit: () => undefined, uuid: () => faker.datatype.uuid(), 'io.flow.github.v0.enums.contents_type': (): io.flow.github.v0.enums.ContentsType => faker.helpers.arrayElement(['file', 'dir', 'symlink', 'submodule']), 'io.flow.github.v0.enums.encoding': (): io.flow.github.v0.enums.Encoding => faker.helpers.arrayElement(['base64', 'utf-8']), 'io.flow.github.v0.enums.hook_event': (): io.flow.github.v0.enums.HookEvent => faker.helpers.arrayElement(['push', 'pull_request']), 'io.flow.github.v0.enums.node_type': (): io.flow.github.v0.enums.NodeType => faker.helpers.arrayElement(['blob', 'tree', 'commit']), 'io.flow.github.v0.enums.owner_type': (): io.flow.github.v0.enums.OwnerType => faker.helpers.arrayElement(['User']), 'io.flow.github.v0.enums.visibility': (): io.flow.github.v0.enums.Visibility => faker.helpers.arrayElement(['all', 'public', 'private']), 'io.flow.github.v0.models.blob': (): io.flow.github.v0.models.Blob => ({ content: factories.string(), encoding: factories['io.flow.github.v0.enums.encoding'](), url: factories.string(), sha: factories.string(), size: factories.long(), }), 'io.flow.github.v0.models.blob_created': (): io.flow.github.v0.models.BlobCreated => ({ url: factories.string(), sha: factories.string(), }), 'io.flow.github.v0.models.blob_form': (): io.flow.github.v0.models.BlobForm => ({ content: factories.string(), encoding: factories['io.flow.github.v0.enums.encoding'](), }), 'io.flow.github.v0.models.commit': (): io.flow.github.v0.models.Commit => ({ sha: factories.string(), url: factories.string(), html_url: factories.string(), author: factories['io.flow.github.v0.models.person'](), committer: factories['io.flow.github.v0.models.person'](), tree: factories['io.flow.github.v0.models.tree_summary'](), message: factories.string(), parents: arrayOf(() => factories['io.flow.github.v0.models.commit_summary']()), }), 'io.flow.github.v0.models.commit_form': (): io.flow.github.v0.models.CommitForm => ({ message: factories.string(), tree: factories.string(), parents: arrayOf(() => factories.string()), author: factories['io.flow.github.v0.models.person'](), committer: factories['io.flow.github.v0.models.person'](), }), 'io.flow.github.v0.models.commit_response': (): io.flow.github.v0.models.CommitResponse => ({ sha: factories.string(), url: factories.string(), author: factories['io.flow.github.v0.models.person'](), committer: factories['io.flow.github.v0.models.person'](), message: factories.string(), tree: factories['io.flow.github.v0.models.tree_summary'](), parents: arrayOf(() => factories['io.flow.github.v0.models.tree_summary']()), }), 'io.flow.github.v0.models.commit_summary': (): io.flow.github.v0.models.CommitSummary => ({ sha: factories.string(), url: factories.string(), }), 'io.flow.github.v0.models.contents': (): io.flow.github.v0.models.Contents => ({ type: factories['io.flow.github.v0.enums.contents_type'](), encoding: factories['io.flow.github.v0.enums.encoding'](), size: factories.long(), name: factories.string(), path: factories.string(), content: factories.string(), sha: factories.string(), url: factories.string(), git_url: factories.string(), html_url: factories.string(), download_url: factories.string(), }), 'io.flow.github.v0.models.create_tree_form': (): io.flow.github.v0.models.CreateTreeForm => ({ base_tree: factories.string(), tree: arrayOf(() => factories['io.flow.github.v0.models.tree_form']()), }), 'io.flow.github.v0.models.create_tree_response': (): io.flow.github.v0.models.CreateTreeResponse => ({ sha: factories.string(), url: factories.string(), tree_result: factories['io.flow.github.v0.models.tree'](), }), 'io.flow.github.v0.models.error': (): io.flow.github.v0.models.Error => ({ resource: factories.string(), field: factories.string(), code: factories.string(), }), 'io.flow.github.v0.models.github_object': (): io.flow.github.v0.models.GithubObject => ({ type: factories.string(), sha: factories.string(), url: factories.string(), }), 'io.flow.github.v0.models.hook': (): io.flow.github.v0.models.Hook => ({ id: factories.long(), url: factories.string(), test_url: factories.string(), ping_url: factories.string(), name: factories.string(), events: arrayOf(() => factories['io.flow.github.v0.enums.hook_event']()), active: factories.boolean(), config: factories['io.flow.github.v0.models.hook_config'](), updated_at: factories.date_time_iso_8601(), created_at: factories.date_time_iso_8601(), }), 'io.flow.github.v0.models.hook_config': (): io.flow.github.v0.models.HookConfig => ({ url: factories.string(), content_type: factories.string(), }), 'io.flow.github.v0.models.hook_form': (): io.flow.github.v0.models.HookForm => ({ name: factories.string(), config: factories['io.flow.github.v0.models.hook_config'](), events: arrayOf(() => factories['io.flow.github.v0.enums.hook_event']()), active: factories.boolean(), }), 'io.flow.github.v0.models.node': (): io.flow.github.v0.models.Node => ({ path: factories.string(), mode: factories.string(), type: factories['io.flow.github.v0.enums.node_type'](), size: factories.long(), sha: factories.string(), url: factories.string(), }), 'io.flow.github.v0.models.node_form': (): io.flow.github.v0.models.NodeForm => ({ path: factories.string(), mode: factories.string(), type: factories['io.flow.github.v0.enums.node_type'](), sha: factories.string(), }), 'io.flow.github.v0.models.person': (): io.flow.github.v0.models.Person => ({ name: factories.string(), email: factories.string(), date: factories.date_time_iso_8601(), }), 'io.flow.github.v0.models.pull_request': (): io.flow.github.v0.models.PullRequest => ({ id: factories.long(), url: factories.string(), number: factories.long(), html_url: factories.string(), head: factories['io.flow.github.v0.models.pull_request_head'](), }), 'io.flow.github.v0.models.pull_request_form': (): io.flow.github.v0.models.PullRequestForm => ({ title: factories.string(), head: factories.string(), base: factories.string(), body: factories.string(), }), 'io.flow.github.v0.models.pull_request_head': (): io.flow.github.v0.models.PullRequestHead => ({ ref: factories.string(), }), 'io.flow.github.v0.models.ref': (): io.flow.github.v0.models.Ref => ({ ref: factories.string(), url: factories.string(), object: factories['io.flow.github.v0.models.github_object'](), }), 'io.flow.github.v0.models.ref_form': (): io.flow.github.v0.models.RefForm => ({ ref: factories.string(), sha: factories.string(), }), 'io.flow.github.v0.models.ref_update_form': (): io.flow.github.v0.models.RefUpdateForm => ({ sha: factories.string(), }), 'io.flow.github.v0.models.repository': (): io.flow.github.v0.models.Repository => ({ id: factories.long(), owner: factories['io.flow.github.v0.models.user'](), name: factories.string(), full_name: factories.string(), 'private': factories.boolean(), description: factories.string(), url: factories.string(), html_url: factories.string(), default_branch: factories.string(), }), 'io.flow.github.v0.models.tag': (): io.flow.github.v0.models.Tag => ({ tag: factories.string(), sha: factories.string(), url: factories.string(), message: factories.string(), tagger: factories['io.flow.github.v0.models.tagger'](), object: factories['io.flow.github.v0.models.github_object'](), }), 'io.flow.github.v0.models.tag_form': (): io.flow.github.v0.models.TagForm => ({ tag: factories.string(), message: factories.string(), object: factories.string(), type: factories.string(), tagger: factories['io.flow.github.v0.models.tagger'](), }), 'io.flow.github.v0.models.tag_summary': (): io.flow.github.v0.models.TagSummary => ({ name: factories.string(), commit: factories['io.flow.github.v0.models.commit_summary'](), }), 'io.flow.github.v0.models.tagger': (): io.flow.github.v0.models.Tagger => ({ name: factories.string(), email: factories.string(), date: factories.date_time_iso_8601(), }), 'io.flow.github.v0.models.tree': (): io.flow.github.v0.models.Tree => ({ sha: factories.string(), url: factories.string(), truncated: factories.boolean(), tree: arrayOf(() => factories['io.flow.github.v0.models.node']()), }), 'io.flow.github.v0.models.tree_form': (): io.flow.github.v0.models.TreeForm => ({ path: factories.string(), mode: factories.string(), type: factories['io.flow.github.v0.enums.node_type'](), sha: factories.string(), content: factories.string(), }), 'io.flow.github.v0.models.tree_result': (): io.flow.github.v0.models.TreeResult => ({ path: factories.string(), mode: factories.string(), type: factories['io.flow.github.v0.enums.node_type'](), size: factories.long(), sha: factories.string(), url: factories.string(), }), 'io.flow.github.v0.models.tree_summary': (): io.flow.github.v0.models.TreeSummary => ({ url: factories.string(), sha: factories.string(), }), 'io.flow.github.v0.models.unprocessable_entity': (): io.flow.github.v0.models.UnprocessableEntity => ({ message: factories.string(), errors: arrayOf(() => factories['io.flow.github.v0.models.error']()), }), 'io.flow.github.v0.models.user': (): io.flow.github.v0.models.User => ({ id: factories.long(), login: factories.string(), name: factories.string(), email: factories.string(), avatar_url: factories.string(), gravatar_id: factories.string(), url: factories.string(), html_url: factories.string(), type: factories['io.flow.github.v0.enums.owner_type'](), }), 'io.flow.github.v0.models.user_email': (): io.flow.github.v0.models.UserEmail => ({ email: factories.string(), verified: factories.boolean(), primary: factories.boolean(), }), 'io.flow.github.v0.models.user_org': (): io.flow.github.v0.models.UserOrg => ({ login: factories.string(), }), }; export const makeBlob = () => factories['io.flow.github.v0.models.blob'](); export const makeBlobCreated = () => factories['io.flow.github.v0.models.blob_created'](); export const makeBlobForm = () => factories['io.flow.github.v0.models.blob_form'](); export const makeCommit = () => factories['io.flow.github.v0.models.commit'](); export const makeCommitForm = () => factories['io.flow.github.v0.models.commit_form'](); export const makeCommitResponse = () => factories['io.flow.github.v0.models.commit_response'](); export const makeCommitSummary = () => factories['io.flow.github.v0.models.commit_summary'](); export const makeContents = () => factories['io.flow.github.v0.models.contents'](); export const makeContentsType = () => factories['io.flow.github.v0.enums.contents_type'](); export const makeCreateTreeForm = () => factories['io.flow.github.v0.models.create_tree_form'](); export const makeCreateTreeResponse = () => factories['io.flow.github.v0.models.create_tree_response'](); export const makeEncoding = () => factories['io.flow.github.v0.enums.encoding'](); export const makeError = () => factories['io.flow.github.v0.models.error'](); export const makeGithubObject = () => factories['io.flow.github.v0.models.github_object'](); export const makeHook = () => factories['io.flow.github.v0.models.hook'](); export const makeHookConfig = () => factories['io.flow.github.v0.models.hook_config'](); export const makeHookEvent = () => factories['io.flow.github.v0.enums.hook_event'](); export const makeHookForm = () => factories['io.flow.github.v0.models.hook_form'](); export const makeNode = () => factories['io.flow.github.v0.models.node'](); export const makeNodeForm = () => factories['io.flow.github.v0.models.node_form'](); export const makeNodeType = () => factories['io.flow.github.v0.enums.node_type'](); export const makeOwnerType = () => factories['io.flow.github.v0.enums.owner_type'](); export const makePerson = () => factories['io.flow.github.v0.models.person'](); export const makePullRequest = () => factories['io.flow.github.v0.models.pull_request'](); export const makePullRequestForm = () => factories['io.flow.github.v0.models.pull_request_form'](); export const makePullRequestHead = () => factories['io.flow.github.v0.models.pull_request_head'](); export const makeRef = () => factories['io.flow.github.v0.models.ref'](); export const makeRefForm = () => factories['io.flow.github.v0.models.ref_form'](); export const makeRefUpdateForm = () => factories['io.flow.github.v0.models.ref_update_form'](); export const makeRepository = () => factories['io.flow.github.v0.models.repository'](); export const makeTag = () => factories['io.flow.github.v0.models.tag'](); export const makeTagForm = () => factories['io.flow.github.v0.models.tag_form'](); export const makeTagSummary = () => factories['io.flow.github.v0.models.tag_summary'](); export const makeTagger = () => factories['io.flow.github.v0.models.tagger'](); export const makeTree = () => factories['io.flow.github.v0.models.tree'](); export const makeTreeForm = () => factories['io.flow.github.v0.models.tree_form'](); export const makeTreeResult = () => factories['io.flow.github.v0.models.tree_result'](); export const makeTreeSummary = () => factories['io.flow.github.v0.models.tree_summary'](); export const makeUnprocessableEntity = () => factories['io.flow.github.v0.models.unprocessable_entity'](); export const makeUser = () => factories['io.flow.github.v0.models.user'](); export const makeUserEmail = () => factories['io.flow.github.v0.models.user_email'](); export const makeUserOrg = () => factories['io.flow.github.v0.models.user_org'](); export const makeVisibility = () => factories['io.flow.github.v0.enums.visibility']();