Filemedium importancegenerated

auth.ts

types/generated/events_mono/common/v1/auth.ts

No strong subsystem tag
101
Lines
2822
Bytes
1
Exports
0
Imports
10
Keywords

What this is

This page documents one file from the repository and includes its full source so you can read it without leaving the docs site.

Beginner explanation

This file is one piece of the larger system. Its name, directory, imports, and exports show where it fits. Start by reading the exports and related files first.

How it is used

Start from the exports list and related files. Those are the easiest clues for where this file fits into the system.

Expert explanation

Architecturally, this file intersects with general runtime concerns. It contains 101 lines, 0 detected imports, and 1 detected exports.

Important relationships

Detected exports

  • PublicApiAuth

Keywords

objectmessagepublicapiauthextendsaccount_idorganization_uuidaccount_uuiddeeppartialexactglobalthis

Detected imports

  • No import paths detected.

Source notes

This page embeds the full file contents. Small or leaf files are still indexed honestly instead of being over-explained.

Open parent directory

Full source

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.6.1
//   protoc               unknown
// source: events_mono/common/v1/auth.proto

/* eslint-disable */

/** PublicApiAuth contains authentication context automatically injected by the API */
export interface PublicApiAuth {
  account_id?: number | undefined
  organization_uuid?: string | undefined
  account_uuid?: string | undefined
}

function createBasePublicApiAuth(): PublicApiAuth {
  return { account_id: 0, organization_uuid: '', account_uuid: '' }
}

export const PublicApiAuth: MessageFns<PublicApiAuth> = {
  fromJSON(object: any): PublicApiAuth {
    return {
      account_id: isSet(object.account_id)
        ? globalThis.Number(object.account_id)
        : 0,
      organization_uuid: isSet(object.organization_uuid)
        ? globalThis.String(object.organization_uuid)
        : '',
      account_uuid: isSet(object.account_uuid)
        ? globalThis.String(object.account_uuid)
        : '',
    }
  },

  toJSON(message: PublicApiAuth): unknown {
    const obj: any = {}
    if (message.account_id !== undefined) {
      obj.account_id = Math.round(message.account_id)
    }
    if (message.organization_uuid !== undefined) {
      obj.organization_uuid = message.organization_uuid
    }
    if (message.account_uuid !== undefined) {
      obj.account_uuid = message.account_uuid
    }
    return obj
  },

  create<I extends Exact<DeepPartial<PublicApiAuth>, I>>(
    base?: I,
  ): PublicApiAuth {
    return PublicApiAuth.fromPartial(base ?? ({} as any))
  },
  fromPartial<I extends Exact<DeepPartial<PublicApiAuth>, I>>(
    object: I,
  ): PublicApiAuth {
    const message = createBasePublicApiAuth()
    message.account_id = object.account_id ?? 0
    message.organization_uuid = object.organization_uuid ?? ''
    message.account_uuid = object.account_uuid ?? ''
    return message
  },
}

type Builtin =
  | Date
  | Function
  | Uint8Array
  | string
  | number
  | boolean
  | undefined

type DeepPartial<T> = T extends Builtin
  ? T
  : T extends globalThis.Array<infer U>
    ? globalThis.Array<DeepPartial<U>>
    : T extends ReadonlyArray<infer U>
      ? ReadonlyArray<DeepPartial<U>>
      : T extends {}
        ? { [K in keyof T]?: DeepPartial<T[K]> }
        : Partial<T>

type KeysOfUnion<T> = T extends T ? keyof T : never
type Exact<P, I extends P> = P extends Builtin
  ? P
  : P & { [K in keyof P]: Exact<P[K], I[K]> } & {
      [K in Exclude<keyof I, KeysOfUnion<P>>]: never
    }

function isSet(value: any): boolean {
  return value !== null && value !== undefined
}

interface MessageFns<T> {
  fromJSON(object: any): T
  toJSON(message: T): unknown
  create<I extends Exact<DeepPartial<T>, I>>(base?: I): T
  fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T
}