repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
projectbox99/mean
dev/app/app.module.ts
<filename>dev/app/app.module.ts "use strict"; import { NgModule } from "@angular/core"; import { BrowserModule } from "@angular/platform-browser"; import { FormsModule } from "@angular/forms"; import { HttpModule } from "@angular/http"; // used to create fake backend // import { MockBackend, MockConnection } from "@...
projectbox99/mean
dev/app/home/home.component.ts
<filename>dev/app/home/home.component.ts "use strict"; import { Router } from "@angular/router"; import { Component, OnInit, Input } from "@angular/core"; import { Observable } from "rxjs/Observable"; import { Subscription } from "rxjs/Subscription"; // services import { User, UserService } from "../Services/users.s...
projectbox99/mean
dev/app/Services/ads.service.ts
<filename>dev/app/Services/ads.service.ts<gh_stars>0 "use strict"; import { Injectable } from "@angular/core"; import { Http, Headers, Response, RequestOptions } from "@angular/http"; import { Observable } from "rxjs/Observable"; export class Ad { constructor( public id: string = "", public titl...
projectbox99/mean
dev/app/Services/standing.data.service.ts
"use strict"; import { Injectable } from "@angular/core"; import { Http, Headers, Response, RequestOptions } from "@angular/http"; import { Observable } from "rxjs/Observable"; import "rxjs/add/operator/map"; import "rxjs/add/operator/catch"; // import { AuthService } from "./authentication.service"; export class ...
projectbox99/mean
dev/app/Services/search.service.ts
import { Http, Headers, Response, RequestOptions } from "@angular/http"; import { Observable } from "rxjs/Observable"; import { Subscription } from "rxjs/Subscription"; import { Injectable } from "@angular/core"; import { Ad } from "./ads.service"; import { User } from "./users.service"; import "rxjs/add/operator/map"...
logue/vuetify-swatch
vite.config.docs.ts
import { createVuePlugin as Vue } from 'vite-plugin-vue2'; import eslintPlugin from '@modyqyw/vite-plugin-eslint'; import { defineConfig, type UserConfig } from 'vite'; import path from 'path'; // https://vitejs.dev/config/ const config: UserConfig = { base: './', // Resolver resolve: { // https://vitejs.dev...
logue/vuetify-swatch
components.d.ts
// generated by unplugin-vue-components // We suggest you to commit this file into source control // Read more: https://github.com/vuejs/vue-next/pull/3399 import '@vue/runtime-core' declare module '@vue/runtime-core' { export interface GlobalComponents { VBtn: typeof import('vuetify/lib')['VBtn'] VIcon: typ...
logue/vuetify-swatch
src/index.ts
/** * Vuetify Swatches Component * * @license MIT * @author Logue {@link <EMAIL>} * @copyright 2022 <NAME> {@link https://logue.dev/} All rights reserved. * @see {@link https://github.com/logue/vuetify-swatches} */ import VSwatches from './components/VSwatches.vue'; import { install, isVue2 } from 'vue-demi'; ...
logue/vuetify-swatch
dev/serve.ts
import { createApp, isVue3, Vue2 } from 'vue-demi'; import vuetify from './plugins/vuetify'; import Dev from './DemoPage.vue'; if (isVue3) { console.info('ℹ Running as Vue3.'); createApp(Dev).mount('#app'); } else { console.info('ℹ Running as Vue2.'); // @ts-ignore new Vue2({ vuetify, render: h => h(...
logue/vuetify-swatch
dev/plugins/vuetify.ts
<filename>dev/plugins/vuetify.ts import { getCurrentInstance } from 'vue-demi'; import Vuetify from 'vuetify/lib'; import Vue from 'vue'; Vue.use(Vuetify); export default new Vuetify(); /** Get vuetify instance (For Composition api) */ export function useVuetify() { /** Get Instance */ const instance = getCurren...
logue/vuetify-swatch
src/env.d.ts
/* eslint-disable */ /// <reference types="vite/client" /> declare module '*.vue' { import Vue from 'vue'; export default Vue; } interface ImportMetaEnv { // see https://vitejs.dev/guide/env-and-mode.html#env-files // add .env variables. } interface ImportMeta { readonly env: ImportMetaEnv; }
msolefonte/kafka-restapi-client
src/lib/KafkaRestClient.ts
'use strict'; const request = require('request-promise-native'); import { ApiVersion, AuthenticationCredentials, EmbeddedFormat, ConsumerConfig, KafkaRestClientConfig, Partition, PartitionMetadata, ProduceRequest, SerializationFormat, TopicMetadata } from '../../types/' import...
msolefonte/kafka-restapi-client
src/index.ts
'use strict'; export { KafkaRestClient } from './lib/KafkaRestClient'
msolefonte/kafka-restapi-client
types/index.d.ts
<reponame>msolefonte/kafka-restapi-client export type ApiVersion = "v1" | "v2"; export interface AuthenticationCredentials { username: string; password: string; } export interface ConsumerConfig { } export type EmbeddedFormat = "avro" | "binary" | "json"; export interface KafkaRestClientConfig { apiVer...
msolefonte/kafka-restapi-client
src/lib/KafkaRestConsumer.ts
'use strict'; export class KafkaRestConsumer { private readonly url: string; constructor(url: string) { this.url = url ; } /* CONSUMER commitOffsets getOffsets subscribe getSubscriptions deleteSubscription assignPartitions getAssignedPartitions overrideOffsets ...
tony-aq/optic
workspaces/local-cli/src/commands/check.ts
<gh_stars>100-1000 import { Command } from '@oclif/command'; export default class Check extends Command { static description = 'verify that Optic can run your tasks and monitor traffic'; static hidden = true; static args = [ { name: 'taskName', }, ]; async run() { const { args } = th...
tony-aq/optic
workspaces/ui-v2/src/components/SimulatedCommandStore.tsx
import React, { useContext, useEffect, useMemo, useState } from 'react'; import { Provider } from 'react-redux'; import { v4 as uuidv4 } from 'uuid'; import { LinearProgress } from '@material-ui/core'; import { CQRSCommand } from '@useoptic/optic-domain'; import { IForkableSpectacle } from '@useoptic/spectacle'; impor...
tony-aq/optic
workspaces/shape-hash/src/protobuf-support.ts
const protobuf = require('protobufjs'); const definition = { nested: { optic_shape_hash: { nested: { FieldDescriptor: { fields: { key: { type: 'string', id: 1, }, hash: { type: 'ShapeDescriptor', i...
tony-aq/optic
workspaces/graph-lib/src/index.ts
import * as endpoints from './endpoints-graph'; import * as shapes from './shapes-graph'; export { endpoints, shapes };
tony-aq/optic
workspaces/ui-v2/src/utils/encodeQueryParams.ts
<filename>workspaces/ui-v2/src/utils/encodeQueryParams.ts export function encodeQueryParams(params: Record<string, string>): String { return Object.entries(params) .map(([k, v]) => `${k}=${encodeURIComponent(v)}`) .join('&'); }
tony-aq/optic
workspaces/ui-v2/src/errors/invariant.ts
export class InvariantViolationError extends Error {}
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/components/IDiffExampleViewer.tsx
import React, { useCallback, useReducer } from 'react'; import classNames from 'classnames'; import { makeStyles } from '@material-ui/core/styles'; import { SymbolColor, useColor, useShapeViewerStyles } from './SharedStyles'; import _isEqual from 'lodash.isequal'; import _get from 'lodash.get'; import _uniq from 'lodas...
tony-aq/optic
workspaces/ui-v2/src/lib/__tests/diff-helpers/trail-parsers.test.ts
<reponame>tony-aq/optic<gh_stars>100-1000 import { ParsedDiff } from '<src>/lib/parse-diff'; import { buildUniverse } from '<src>/lib/__tests/diff-helpers/universes/buildUniverse'; test('accurate spec trail for all diffs', async () => { const { opticContext, currentSpecContext } = await buildUniverse( require('....
tony-aq/optic
workspaces/ui-v2/src/components/loaders/index.ts
export * from './Loaders'; export * from './Errors'; export * from './SpinningOpticLogo';
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/ReviewEndpointDiffPage/DiffLinks.tsx
<reponame>tony-aq/optic import React from 'react'; import { IInterpretation } from '<src>/lib/Interfaces'; import { ICopyRender } from '../components/ICopyRender'; import { makeStyles } from '@material-ui/styles'; import { List, ListItem, ListSubheader } from '@material-ui/core'; export function DiffLinks({ allDif...
tony-aq/optic
workspaces/ui-v2/src/contexts/analytics/utils.ts
import { v4 as uuidv4 } from 'uuid'; const LOCAL_STORAGE_CLIENT_AGENT_KEY = 'USER_CLIENT_AGENT'; export const getOrSetAgentFromLocalStorage = (defaultValue: string) => { try { const clientAgent = window.localStorage.getItem( LOCAL_STORAGE_CLIENT_AGENT_KEY ); if (clientAgent) { return clientA...
tony-aq/optic
workspaces/ui-v2/src/contexts/OpticConfigContext.tsx
import React, { FC } from 'react'; import { useContext } from 'react'; import { IOpticConfigRepository } from '@useoptic/spectacle'; export function useConfigRepository(): { config: IOpticConfigRepository; } { const config = useContext(ConfigRepositoryContext)!; return { config, }; } interface ConfigServi...
tony-aq/optic
workspaces/ui-v2/src/store/selectors/__tests__/shapeSelectors.test.ts
import { RootState } from '<src>/store/root'; import { getShapeRenderer, createFlatList, convertShapeToQueryParameters, } from '../shapeSelectors'; import { getMockReduxStore } from './testHelpers'; let store: RootState; beforeEach(() => { store = getMockReduxStore(); }); describe('getShapeRenderer', () => { ...
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/AddEndpointsPage/components/index.ts
export * from './AddEndpointDiffHeader'; export * from './BulkLearnModal'; export * from './EndpointNameEditFields'; export * from './UndocumentedUrl';
tony-aq/optic
workspaces/cli-shared/test/tests/ecs.ts
<reponame>tony-aq/optic // Getting the Typescript compiler to find these in cli-shared/typings through // passing it a tsconfig has been successful :( /// <reference types="../../typings/stream-chain/index" /> /// <reference types="../../typings/stream-json/index" /> import Tap from 'tap'; import Path from 'path'; impo...
tony-aq/optic
workspaces/local-cli/src/commands/exec.ts
import { Command, flags } from '@oclif/command'; import { LocalCliTaskFlags, LocalTaskSessionWrapper, runCommandFlags, } from '../shared/local-cli-task-runner'; import { cleanupAndExit, loadPathsAndConfig } from '@useoptic/cli-shared'; import { isCommandOnlyTask } from '@useoptic/cli-config'; import { ingestOnlyT...
tony-aq/optic
workspaces/shape-hash/src/test/shape-hash.test.ts
import { toBytes, toJsonExample } from '../json-to-shape-hash'; import { decodeShapeHash } from '../protobuf-support'; const example = { glossary: { title: 'example glossary', GlossDiv: { title: 'S', GlossList: { GlossEntry: { ID: null, SortAs: 'SGML', GlossT...
tony-aq/optic
workspaces/ui-v2/src/pages/docs/DocumentationRootPage/EndpointRow.tsx
<gh_stars>100-1000 import React, { FC, useState } from 'react'; import { useHistory, useRouteMatch } from 'react-router-dom'; import { IconButton, makeStyles, ListItem, Tooltip, darken, } from '@material-ui/core'; import { Delete as DeleteIcon, Undo as UndoIcon } from '@material-ui/icons'; import { RemovedRe...
tony-aq/optic
workspaces/cli-scripts/src/notify.ts
import notifier from 'node-notifier'; function run(url: string, icon: string) { notifier.notify({ title: 'Observed Unexpected API Behavior', message: 'Click here to review the diff in Optic', icon, timeout: 7000, open: url, wait: true, }); } const [, , url, icon] = process.argv; run(url, i...
tony-aq/optic
workspaces/ui-v2/src/components/DebugOpticComponent.tsx
<reponame>tony-aq/optic import { FC, useEffect } from 'react'; import { IOpticSpecRepository } from '@useoptic/spectacle/build'; import { useSpecRepository } from '<src>/contexts/SpecRepositoryContext'; declare global { interface Window { __GLOBAL_DIFF_DEBUG_FUNCTION__?: () => any; debugOptic?: () => void; ...
tony-aq/optic
workspaces/cli-shared/src/diffs/trail-values-worker-rust.ts
import { CaptureInteractionIterator } from '../captures/avro/file-system/interaction-iterator'; import fs from 'fs-extra'; import { learnShapeDiffAffordances } from '@useoptic/optic-engine-native'; import { Streams } from '@useoptic/optic-domain'; import { ShapeDiffAffordances } from '@useoptic/optic-domain/build/strea...
tony-aq/optic
workspaces/ui-v2/src/utils/endpoint-utilities.ts
export function getEndpointId(endpoint: { pathId: string; method: string }) { const { pathId, method } = endpoint; return `${pathId}.${method.toUpperCase()}`; }
tony-aq/optic
workspaces/ui-v2/src/components/HttpBodySelector.tsx
import React, { useState } from 'react'; import { FormControl, FormControlLabel, makeStyles, Radio, RadioGroup, } from '@material-ui/core'; import { FontFamily } from '<src>/styles'; type HttpBodySelectorProps<T> = { items: T[]; children: (body: T) => React.ReactNode; getDisplayName: (item: T) => stri...
tony-aq/optic
workspaces/ui-v2/src/pages/docs/components/index.ts
export * from './Contributions'; export * from './DeleteEndpointConfirmationModal'; export * from './DocPageNavigation'; export * from './EditContributionsButton'; export * from './EndpointTOC'; export * from './MarkdownBodyContribution'; export * from './SimulatedBodyPreview'; export * from './ShapeEditor';
tony-aq/optic
workspaces/ui-v2/src/store/selectors/documentationEditSelectors.ts
<reponame>tony-aq/optic import { createSelector } from 'reselect'; import { RootState } from '../root'; import { IContribution } from '<src>/types'; import { getEndpointId } from '<src>/utils'; import { JsonType } from '@useoptic/optic-domain'; export const memoizedGetAllRemovedFields = createSelector< RootState, ...
tony-aq/optic
workspaces/api-checks/src/checks.ts
import { CheckFunction } from './types'; export const requireNotFoundWithGet: CheckFunction = async ({ endpoint }) => { if (!isMethod(endpoint, 'GET')) return; return requireStatusCode(endpoint, 404); }; export function isMethod(endpoint: any, method: string) { return endpoint.method === method; } export funct...
tony-aq/optic
workspaces/local-cli/src/commands/debug/capture.ts
import { Command } from '@oclif/command'; import { CaptureInteractionIterator } from '@useoptic/cli-shared/build/captures/avro/file-system/interaction-iterator'; import { getPathsRelativeToConfig, readApiConfig } from '@useoptic/cli-config'; import OS from 'os'; import cli from 'cli-ux'; import path from 'path'; import...
tony-aq/optic
workspaces/ui-v2/src/components/Button.tsx
<reponame>tony-aq/optic<gh_stars>100-1000 import React, { FC, ComponentProps } from 'react'; import { Button as MuiButton, CircularProgress, makeStyles, } from '@material-ui/core'; type ButtonProps = ComponentProps<typeof MuiButton> & { loading?: boolean; }; export const Button: FC<ButtonProps> = ({ children,...
tony-aq/optic
workspaces/ui-v2/src/components/Page/Page.tsx
import React, { FC, useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import classNames from 'classnames'; import { Theme, makeStyles } from '@material-ui/core/styles'; import { FullPageLoader, FullPageError } from '../loaders'; import { TopNavigation } from '../navigation/TopNavigation'; /** ...
tony-aq/optic
workspaces/ui-v2/src/components/loaders/Loaders.tsx
import React from 'react'; import { CenteredColumn } from '../layouts/CenteredColumn'; import { makeStyles } from '@material-ui/styles'; import { Box, Typography } from '@material-ui/core'; import { SpinningOpticLogo } from './SpinningOpticLogo'; interface ILoaderProps { title?: string; } export function FullPageLo...
tony-aq/optic
workspaces/ui-v2/src/pages/docs/components/EditContributionsButton.tsx
<reponame>tony-aq/optic import React from 'react'; import { useHistory } from 'react-router-dom'; import { ToggleButton } from '@material-ui/lab'; import { Typography, makeStyles } from '@material-ui/core'; import SaveAltIcon from '@material-ui/icons/SaveAlt'; import EditIcon from '@material-ui/icons/Edit'; import { C...
tony-aq/optic
workspaces/spectacle/src/utilities.ts
import { v4 as uuidv4 } from 'uuid'; export interface IdGenerator<T> { nextId(): Iterable<T> } export class UuidV4Generator implements IdGenerator<string> { * nextId() { yield uuidv4() } };
tony-aq/optic
workspaces/ui-v2/src/utils/go-to-anchor.ts
export function goToAnchor(id: string) { return () => { const anchor = document.getElementById(id); if (anchor) { const parent = document.getElementById('right-pane') || window; parent.scrollTo({ top: anchor.offsetTop - 60 }); } }; }
tony-aq/optic
workspaces/ui-v2/src/store/paths/slice.ts
<filename>workspaces/ui-v2/src/store/paths/slice.ts<gh_stars>100-1000 import { createSlice, SerializedError } from '@reduxjs/toolkit'; import { AsyncStatus, IPath } from '<src>/types'; import { fetchPaths } from './thunks'; const initialState: { results: AsyncStatus<IPath[], SerializedError>; } = { results: { ...
tony-aq/optic
workspaces/ui-v2/src/store/selectors/__tests__/testHelpers.ts
<reponame>tony-aq/optic import deepCopy from 'deepcopy'; import { RootState } from '<src>/store'; export const getMockReduxStore = (): RootState => deepCopy({ endpoints: { results: { loading: false, data: { endpoints: [ { id: 'path_UOIsxzICu5.GET', ...
tony-aq/optic
workspaces/spectacle/test/apply-commands.ts
import Tap from 'tap'; import { InMemoryOpticContextBuilder } from '../src/in-memory'; import { AddPathComponent } from '@useoptic/optic-domain'; import * as opticEngine from '@useoptic/optic-engine-wasm'; import { makeSpectacle } from '../src'; Tap.test(`wasm opticEngine can generate nanoid`, async (test) => { cons...
tony-aq/optic
workspaces/optic-domain/src/streams/index.ts
<reponame>tony-aq/optic export * as Commands from './commands'; export * as DiffResults from './diff-results'; export * as HttpInteractions from './http-interactions'; export * as LearningResults from './learning-results'; export * as SpecEvents from './spec-events'; export * as UndocumentedUrls from './undocumented-ur...
tony-aq/optic
workspaces/ui-v2/src/components/sharing/ShareModal.tsx
<reponame>tony-aq/optic import React, { useCallback, useRef, useState } from 'react'; import { Button, makeStyles, TextField, Typography, CircularProgress, IconButton, Tooltip, } from '@material-ui/core'; import CopyIcon from '@material-ui/icons/FileCopy'; import { useAuth0 } from '@auth0/auth0-react'; im...
tony-aq/optic
workspaces/ui-v2/src/components/PathParameters.tsx
<gh_stars>100-1000 import React, { FC, ReactNode } from 'react'; import { Divider, Typography, makeStyles } from '@material-ui/core'; import { JsonType } from '@useoptic/optic-domain'; import { FieldOrParameter } from './FieldOrParameter'; import { IPathParameter, IShapeRenderer } from '<src>/types'; export type Pat...
tony-aq/optic
workspaces/cli-config/tests/ignore-files/IgnoreFileInterface.test.ts
<reponame>tony-aq/optic import { IgnoreFileHelper } from '../../src/helpers/ignore-file-interface'; import * as path from 'path'; import fs from 'fs-extra'; test('can parse rules from file, with Optic yml ones included', async () => { const ignoreHelper = new IgnoreFileHelper( path.join(__dirname, 'examples', 'i...
tony-aq/optic
workspaces/ui-v2/src/components/QueryParametersPanel.tsx
import React, { FC } from 'react'; import { makeStyles } from '@material-ui/core'; import classnames from 'classnames'; import { FontFamily, FontFamilyMono, AddedGreenBackground, ChangedYellowBackground, RemovedRedBackground, } from '<src>/styles'; import { QueryParameters } from '<src>/types'; import { Shap...
tony-aq/optic
workspaces/ui-v2/src/pages/docs/components/Contributions.tsx
import React from 'react'; import { IShapeRenderer } from '<src>/types'; import Helmet from 'react-helmet'; import { EditableTextField, TextFieldVariant, FieldOrParameter, } from '<src>/components'; import { useAppConfig } from '<src>/contexts/config/AppConfiguration'; import { useAppSelector, useAppDispatch,...
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/AddEndpointsPage/index.ts
export * from './AddEndpointsPage';
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/contexts/LearnedPendingEndpointContext.tsx
import React, { FC, useContext } from 'react'; import { IPendingEndpoint } from './SharedDiffState'; import { useActor } from '@xstate/react'; import equals from 'lodash.isequal'; import { ILearnedBodies } from '@useoptic/cli-shared/build/diffs/initial-types'; import { CQRSCommand } from '@useoptic/optic-domain'; impor...
tony-aq/optic
workspaces/ui-v2/src/types/changes.ts
export type ChangeType = 'added' | 'updated' | 'removed';
tony-aq/optic
workspaces/cli-shared/src/captures/avro/saas/capture-saver.ts
<reponame>tony-aq/optic import Bottleneck from 'bottleneck'; import { developerDebugLogger, ICaptureSaver, SaasClient, } from '../../../index'; import { serdes } from '../index'; import { IHttpInteraction, IInteractionBatch } from '@useoptic/optic-domain'; export interface ISaasCaptureSaverConfig { orgId: stri...
tony-aq/optic
workspaces/ui-v2/src/lib/new-regions-interpreter.ts
<reponame>tony-aq/optic<filename>workspaces/ui-v2/src/lib/new-regions-interpreter.ts import * as Sentry from '@sentry/react'; import { CurrentSpecContext, IInterpretation, IPatchChoices, } from './Interfaces'; import { ParsedDiff, DiffLocation } from './parse-diff'; import { ILearnedBodies } from '@useoptic/cli-...
tony-aq/optic
workspaces/ui-v2/src/hooks/useBaseUrl.ts
<gh_stars>100-1000 import * as React from 'react'; import { useContext } from 'react'; const BaseUrlContext = React.createContext({ url: '' }); BaseUrlContext.displayName = 'BaseUrlContext'; // only expose the Provider component, but hide the Consumer in favour of hooks export const { Provider } = BaseUrlContext; ex...
tony-aq/optic
workspaces/ui-v2/src/pages/changelogHistory/ChangelogHistory.tsx
<gh_stars>100-1000 import React, { CSSProperties, FC, useEffect, useState } from 'react'; import { Button, makeStyles } from '@material-ui/core'; import ClassNames from 'classnames'; import Color from 'color'; import { CompareArrows as CompareArrowsIcon, Schedule as ScheduleIcon, Subject as SubjectIcon, } from '@...
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/components/DiffHeader.tsx
import React from 'react'; import { makeStyles } from '@material-ui/styles'; import { Divider, Typography } from '@material-ui/core'; import { SubtleBlueBackground } from '<src>/styles'; export type DiffHeaderProps = { name: any; children?: any; secondary?: any; }; export function DiffHeader({ name, children, se...
tony-aq/optic
workspaces/graph-lib/src/shapes-graph/index.ts
import { GraphCommandHandler, mapAppend, NodeListWrapper } from '../shared'; import { BatchCommitData } from '../endpoints-graph'; export type NodeId = string; export enum NodeType { CoreShape = 'CoreShape', Shape = 'Shape', ShapeParameter = 'ShapeParameter', Field = 'Field', BatchCommit = 'BatchCommit', } ...
tony-aq/optic
workspaces/cli-server/src/analytics.ts
import os from 'os'; import { newAnalyticsEventBus } from '@useoptic/analytics/lib/eventbus'; import Analytics from 'analytics-node'; import { CliClientContext, TrackingEventBase, } from '@useoptic/analytics/lib/interfaces/TrackingEventBase'; import { AnalyticsEventBus } from '@useoptic/analytics/lib/eventbus'; imp...
tony-aq/optic
workspaces/ui-v2/src/clients/spectacle.ts
<gh_stars>100-1000 import { CQRSCommand, JsonType } from '@useoptic/optic-domain'; import { IForkableSpectacle } from '@useoptic/spectacle'; export class SpectacleClient { constructor(private spectacle: IForkableSpectacle) {} public fetchRemoveEndpointCommands = async ( pathId: string, method: string ):...
tony-aq/optic
workspaces/ui-v2/src/pages/changelog/ChangelogListPage.tsx
import React, { FC } from 'react'; import { RouteComponentProps, useHistory, useRouteMatch, } from 'react-router-dom'; import classNames from 'classnames'; import { CenteredColumn, EndpointName, PageLayout } from '<src>/components'; import { Box, List, ListItem, LinearProgress, Typography, } from '@mat...
tony-aq/optic
workspaces/api-checks/src/index.ts
<gh_stars>100-1000 export * from './runner'; export * from './spectacle'; export * as checks from './checks'; export * as reports from './reports';
tony-aq/optic
workspaces/ui-v2/src/store/documentationEdit/slice.ts
<filename>workspaces/ui-v2/src/store/documentationEdit/slice.ts /** * There's two places to edit / modify specs - documentation and diffs page, which is * why there's two slices distinct from each other (in the future if we have a single * flow for editing, we could consolidate the two slices) */ import { createSl...
tony-aq/optic
workspaces/local-cli/src/commands/run.ts
import { Command, flags } from '@oclif/command'; import { LocalTaskSessionWrapper, runCommandFlags, } from '../shared/local-cli-task-runner'; import { cleanupAndExit, loadPathsAndConfig } from '@useoptic/cli-shared'; import { isCommandOnlyTask } from '@useoptic/cli-config'; import Exec from './exec'; import { inges...
tony-aq/optic
workspaces/local-cli/src/commands/test.ts
<reponame>tony-aq/optic import { Command, flags } from '@oclif/command'; import { LocalTaskSessionWrapper, runCommandFlags, } from '../shared/local-cli-task-runner'; export default class Test extends Command { static description = 'alias for "api run test --ci"'; static flags = runCommandFlags; async run() ...
tony-aq/optic
workspaces/ui-v2/src/components/layouts/index.ts
export * from './CenteredColumn'; export * from './FullWidth'; export * from './PageLayout'; export * from './TwoColumnFullWidth';
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/AddEndpointsPage/hooks/useCheckboxState.ts
<filename>workspaces/ui-v2/src/pages/diffs/AddEndpointsPage/hooks/useCheckboxState.ts import React from 'react'; import { IUndocumentedUrl } from '<src>/pages/diffs/contexts/SharedDiffState'; export enum CheckboxState { Checked, NotChecked, Indeterminate, } export const useCheckboxState = ( visibleUrls: IUndo...
tony-aq/optic
workspaces/ui-v2/src/styles/theme.ts
import { createMuiTheme } from '@material-ui/core'; import { JsonType } from '@useoptic/optic-domain'; export const primary = '#31366f'; export const secondary = '#ea4a61'; export const UpdatedBlue = '#2b7bd1'; export const UpdatedBlueBackground = 'rgba(43,123,209,0.11)'; export const AddedGreenBackground = 'rgba(0,19...
tony-aq/optic
workspaces/ui-v2/src/contexts/config/AppConfiguration.tsx
<reponame>tony-aq/optic import React, { ReactNode, useContext } from 'react'; import { InvariantViolationError } from '<src>/errors'; interface IAppConfigurations { allowEditing: boolean; analytics: | { enabled: false } | { enabled: true; segmentToken?: string; sentryUrl?: string; ...
tony-aq/optic
workspaces/ui-v2/src/hooks/util/useStateWithSideEffect.ts
import { useCallback, useState } from 'react'; export const useStateWithSideEffect = <T>({ initialValue, sideEffect, }: { initialValue: T; sideEffect: (newValue: T) => void; }) => { const [value, setValue] = useState<T>(initialValue); return { value, setValue: useCallback( (value: T) => { ...
tony-aq/optic
workspaces/local-cli/src/shared/verbose/verbose.ts
<filename>workspaces/local-cli/src/shared/verbose/verbose.ts import { LocalCliTaskFlags } from '../local-cli-task-runner'; import colors from 'colors'; import { IOpticTaskRunnerConfig } from '@useoptic/cli-config'; import { fromOpticVerbose } from '@useoptic/cli-shared/build/conversation'; import { IHttpInteraction } f...
tony-aq/optic
workspaces/ui-v2/src/components/FieldViewer.tsx
<gh_stars>100-1000 import React, { FC } from 'react'; import { makeStyles } from '@material-ui/core'; import * as Theme from '<src>/styles/theme'; import { IFieldDetails } from '<src>/types'; import { ShapeTypeSummary } from './ShapeTypeSummary'; type FieldViewerProps = { fields: IFieldDetails[]; }; export const F...
tony-aq/optic
workspaces/ui-v2/src/pages/docs/DocumentationRootPage/index.ts
<reponame>tony-aq/optic<gh_stars>100-1000 export * from './DocumentationRootPage';
tony-aq/optic
workspaces/ui-v2/src/components/ShapeRenderer/ShapePrimitive.tsx
import * as React from 'react'; import makeStyles from '@material-ui/styles/makeStyles'; import { JsonType } from '@useoptic/optic-domain'; import * as Theme from '<src>/styles/theme'; import { useSharedStyles } from './SharedStyles'; import { IShapeRenderer } from '<src>/types'; import classNames from 'classnames'; ...
tony-aq/optic
workspaces/ui-v2/src/types/contributions.ts
<gh_stars>100-1000 export interface IContribution { id: string; contributionKey: string; value: string; endpointId: string; }
tony-aq/optic
workspaces/ui-v2/src/store/selectors/__tests__/visibilitySelectors.test.ts
<filename>workspaces/ui-v2/src/store/selectors/__tests__/visibilitySelectors.test.ts import { ChangeType } from '<src>/types'; import { isItemVisible, isItemVisibleForChangelog, filterRemovedItems, filterRemovedItemForChangelog, filterMapOfRemovedItems, filterMapOfRemovedItemsForChangelog, } from '../visibi...
tony-aq/optic
workspaces/ui-v2/src/pages/diffs/components/SharedStyles.tsx
<gh_stars>100-1000 import { makeStyles } from '@material-ui/core/styles'; import { primary } from '<src>/styles'; export const useShapeViewerStyles = makeStyles((theme) => ({ root: { paddingTop: 10, paddingBottom: 10, backgroundColor: '#16203F', position: 'relative', }, nested: { paddingTop: ...
tony-aq/optic
workspaces/ui-v2/src/types/async.ts
<gh_stars>100-1000 export type AsyncStatus<T, E = Error> = | { loading: true; error?: undefined; data?: undefined; } | { loading: false; error: E; data?: undefined; } | { loading: false; error?: undefined; data: T };
tony-aq/optic
workspaces/ui-v2/src/lib/shape-diffs/build-inner-shape.ts
import { CurrentSpecContext, IPatchChoices } from '../Interfaces'; import { Actual } from '../shape-diff-dsl-rust'; import equals from 'lodash.isequal'; import { AddShape, AddShapeParameter, ICoreShapeInnerParameterNames, ICoreShapeKinds, ProviderInShape, SetParameterShape, ShapeProvider, } from '@useopti...
tony-aq/optic
workspaces/local-cli/src/shared/ingest-only-task-runner.ts
import { Command } from '@oclif/command'; import { LocalCliTaskFlags } from './local-cli-task-runner'; import { cleanupAndExit, developerDebugLogger, loadPathsAndConfig, } from '@useoptic/cli-shared'; import { getSpecEventsFrom } from '@useoptic/cli-config/build/helpers/read-specification-json'; import * as uuid ...
tony-aq/optic
workspaces/ui-v2/src/contexts/SpecRepositoryContext.tsx
import React, { FC } from 'react'; import { useContext } from 'react'; import { IOpticSpecRepository } from '@useoptic/spectacle'; export function useSpecRepository() { const specRepo = useContext(SpecRepositoryContext)!; if (!specRepo) { throw new Error('Could not find spectacle context'); } return specRe...
tony-aq/optic
workspaces/spectacle-shared/src/local-cli/client.ts
<gh_stars>100-1000 import { ICapture, IForkableSpectacle, IListDiffsResponse, IListUnrecognizedUrlsResponse, IOpticCapturesService, IOpticConfigRepository, IOpticDiffService, IOpticEngine, IOpticSpecRepository, SpectacleInput, StartDiffResult, } from '@useoptic/spectacle'; import { JsonHttpClient ...
tony-aq/optic
workspaces/ui-v2/src/types/shapes.ts
import { JsonType } from '@useoptic/optic-domain'; import { ChangeType } from './changes'; import { IContribution } from './contributions'; // Types for rendering shapes and fields export interface IFieldRenderer { fieldId: string; name: string; shapeId: string; shapeChoices: IShapeRenderer[]; required: bool...
tony-aq/optic
workspaces/ui-v2/src/clients/index.ts
<gh_stars>100-1000 export * from './spectacle';
tony-aq/optic
workspaces/ui-v2/src/pages/docs/index.ts
export * from './DocumentationPages';
tony-aq/optic
workspaces/ui-v2/src/contexts/MetadataLoader.tsx
import React, { FC, useEffect } from 'react'; import { FullPageLoader } from '<src>/components'; import { metadataActions, useAppDispatch, useAppSelector } from '<src>/store'; import { useSpectacleContext } from './spectacle-provider'; import { useConfigRepository } from './OpticConfigContext'; export const MetadataLo...
tony-aq/optic
workspaces/local-cli/src/commands/spectacle.ts
<filename>workspaces/local-cli/src/commands/spectacle.ts import { Command } from '@oclif/command'; import { Client } from '@useoptic/cli-client'; import { getPathsRelativeToConfig, IApiCliConfig, readApiConfig, } from '@useoptic/cli-config'; import { IPathMapping } from '@useoptic/cli-config'; import { ensureDaem...
tony-aq/optic
workspaces/ui-v2/src/hooks/useGroupedEndpoints.ts
<filename>workspaces/ui-v2/src/hooks/useGroupedEndpoints.ts import { useMemo } from 'react'; import groupBy from 'lodash.groupby'; import { IEndpoint } from '<src>/types'; import { findLongestCommonPath } from '<src>/utils'; export const useGroupedEndpoints = <T extends IEndpoint>(endpoints: T[]) => { return useMem...
tony-aq/optic
workspaces/ui-v2/src/components/layouts/PageLayout.tsx
import React, { FC } from 'react'; import { makeStyles } from '@material-ui/core/styles'; import { TopNavigation } from '<src>/components/navigation/TopNavigation'; type PageLayoutProps = { AccessoryNavigation?: FC; }; export const PageLayout: FC<PageLayoutProps> = ({ children, AccessoryNavigation, }) => { co...
tony-aq/optic
workspaces/cli-shared/src/captures/avro/file-system/capture-saver.ts
<gh_stars>100-1000 import Bottleneck from 'bottleneck'; import fs from 'fs-extra'; import path from 'path'; import avro from 'avsc'; import { developerDebugLogger, ICaptureSaver } from '../../../index'; import { captureFileSuffix } from './index'; import { schema } from '../index'; import { IInteractionBatch, IGrou...
tony-aq/optic
workspaces/ui-v2/src/pages/docs/DocumentationPages.tsx
import React from 'react'; import { Redirect, Switch, Route } from 'react-router-dom'; import { useDocumentationPageLink, useEndpointPageLink, } from '<src>/components/navigation/Routes'; import { useFetchEndpoints } from '<src>/hooks/useFetchEndpoints'; import { DocumentationRootPageWithDocsNav } from './Document...
tony-aq/optic
workspaces/ui-v2/src/store/selectors/endpointSelectors.ts
<filename>workspaces/ui-v2/src/store/selectors/endpointSelectors.ts import { IEndpoint, IResponse } from '<src>/types'; import { getEndpointId } from '<src>/utils'; import { RootState } from '../root'; export const getEndpoint = ({ pathId, method, }: { pathId: string; method: string; }) => (state: RootState) ...