repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
superhawk610/site
src/create-pages.ts
import * as path from 'path'; import { tags } from './constants'; type GatsbyCreatePagesArgs = any; interface MarkdownNode { frontmatter: { path: string; }; } const articleTemplate = path.resolve(`${__dirname}/templates/article.tsx`); const taggedTemplate = path.resolve(`${__dirname}/templates/tagged.tsx`); ...
superhawk610/site
src/pages/portfolio.tsx
import React from 'react'; import Layout from '../components/layout'; import SEO from '../components/seo'; const PortfolioPage = () => ( <Layout> <SEO title="Portfolio" /> <h1>Portfolio</h1> <p>working on it 😉</p> </Layout> ); export default PortfolioPage;
superhawk610/site
src/templates/tagged.tsx
<filename>src/templates/tagged.tsx import React from 'react'; import { graphql, Link } from 'gatsby'; import Layout from '../components/layout'; import SEO from '../components/seo'; import ArticleList, { ArticleNode } from '../components/article-list'; interface Props { data: { allMarkdownRemark: { nodes:...
superhawk610/site
src/templates/article.tsx
import React from 'react'; import { Link, graphql } from 'gatsby'; import styled, { createGlobalStyle } from 'styled-components'; import Layout from '../components/layout'; import SEO from '../components/seo'; import ImportedNotice from '../components/imported-notice'; import Tag from '../components/tag'; import { co...
superhawk610/site
src/constants.ts
import { createGlobalStyle } from 'styled-components'; import { transparentize } from 'polished'; export const colors = { black: '#111', offBlack: '#171717', white: '#fff', offWhite: '#f7f7f7', gray: '#aaa', grayLight: '#eee', yellow: 'yellow', yellowLight: '#ffff9c', red: 'red', blue: 'blue', cy...
superhawk610/site
src/components/article-list.tsx
import React from 'react'; import { Link } from 'gatsby'; import styled from 'styled-components'; interface Props { nodes: ArticleNode[]; } export interface ArticleNode { excerpt: string; frontmatter: { path: string; title: string; peek: string; }; } const ArticleList = ({ nodes }: Props) => ( ...
superhawk610/site
src/components/imported-notice.tsx
<gh_stars>0 import React from 'react'; import styled from 'styled-components'; const ImportedNotice = () => ( <Container> This article was originally published on{' '} <a href="https://github.com/superhawk610/dev-a-day">#dev-a-day</a>. </Container> ); const Container = styled.div` padding: 1.5rem; bac...
superhawk610/site
src/context.tsx
import React, { useState, createContext, useLayoutEffect } from 'react'; import { ThemeProvider } from 'styled-components'; import { themes, defaultTheme } from './constants'; export interface Context { theme: string; toggleTheme: () => void; } export const AppContext = createContext<Context>({} as Context); exp...
superhawk610/site
src/components/spacer.tsx
<reponame>superhawk610/site<gh_stars>0 import React from 'react'; const Spacer = () => <div style={{ height: '2rem' }} />; export default Spacer;
superhawk610/site
src/utils.ts
<gh_stars>0 export const getRandomInt = (min: number, max: number) => { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; }; export const atRandom = <T>(items: T[]) => { if (items.length === 0) return null; return items[getRandomInt(0, items.length - 1)];...
superhawk610/site
src/components/divider.tsx
<filename>src/components/divider.tsx import styled from 'styled-components'; const Divider = styled.div` max-width: 400px; margin: 2rem auto; height: 2px; width: 100%; background: ${props => props.theme.divider}; `; export default Divider;
superhawk610/site
src/pages/index.tsx
import React from 'react'; import { useStaticQuery, graphql } from 'gatsby'; import Layout from '../components/layout'; import SEO from '../components/seo'; import ArticleList, { ArticleNode } from '../components/article-list'; interface ArticlesQuery { allMarkdownRemark: { nodes: ArticleNode[]; }; } // TODO...
superhawk610/site
src/components/theme-toggle.tsx
import React, { useContext } from 'react'; import { AppContext } from '../context'; import styled from 'styled-components'; import Sun from '../svgs/sun.svg'; import Moon from '../svgs/moon.svg'; const ThemeToggle = () => { const ctx = useContext(AppContext); // don't try to SSR anything, otherwise we'll get a w...
superhawk610/site
src/components/sidebar.tsx
<reponame>superhawk610/site import React from 'react'; import { Link } from 'gatsby'; import styled from 'styled-components'; import owl from '../images/owl.png'; import ThemeToggle from '../components/theme-toggle'; import Spacer from './spacer'; import { breakpoints } from '../constants'; const Sidebar = () => ( ...
superhawk610/site
src/pages/tags.tsx
<filename>src/pages/tags.tsx import React from 'react'; import Layout from '../components/layout'; import SEO from '../components/seo'; import Tag from '../components/tag'; import { tags } from '../constants'; import { Link } from 'gatsby'; const Tags = () => ( <Layout> <SEO title="Tags" /> <Link to="/">&l...
superhawk610/site
src/components/tag.tsx
<gh_stars>0 import React from 'react'; import { Link } from 'gatsby'; import styled from 'styled-components'; import { darken } from 'polished'; import { colors } from '../constants'; interface Theme { background: string; color: string; } const themes: { [name: string]: Theme } = { javascript: { background...
superhawk610/site
src/components/layout.tsx
<filename>src/components/layout.tsx import React, { useState, useEffect } from 'react'; import styled, { createGlobalStyle } from 'styled-components'; import { CSSColors } from '../constants'; import Sidebar from './sidebar'; import Footer from './footer'; import 'normalize.css'; import './layout.css'; import './pris...
superhawk610/site
src/pages/resume.tsx
import React from 'react'; import Layout from '../components/layout'; import SEO from '../components/seo'; const ResumePage = () => ( <Layout> <SEO title="Resume" /> <h1>Resume</h1> <p>working on it 😉</p> </Layout> ); export default ResumePage;
pennmeg/angular2
src/app/components/addContact.component.ts
import { Component } from '@angular/core'; @Component({ selector: 'add-contact', template: ` <button (click)="toggleContactForm()" type="button">Add New Contact</button> <div *ngIf="showForm"> <h2>New Contact</h2> <form> <label for="name" required>Name</label> <input id="name" type="text"> ...
pennmeg/angular2
src/app/app.module.ts
<filename>src/app/app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { ContactsComponent } from './components/contacts.component'; import { AddContactComponent } from './components/addContact.co...
pennmeg/angular2
src/app/service/state.service.ts
import { Injectable } from '@angular/core'; @Injectable() export class StateService { contact:any; getUserData(){ return this.list; } setUserData(data:any[]){ this.list = data; } }
pennmeg/angular2
src/app/components/contacts.component.ts
<reponame>pennmeg/angular2 import { Component } from '@angular/core'; @Component({ selector: 'contact-list', template: ` <h2>Contacts</h2> <table> <thead> <td>Name</td> <td>Email</td> <td>Phone</td> <td>Address</td> <td>Delete</td> </thead> <tbody> ...
nuanyang233/web
tests/dom/util/misc.test.ts
<filename>tests/dom/util/misc.test.ts import { off, on } from '../../../src/util/misc'; describe('misc', () => { describe('on', () => { it("should call object's `addEventListener` with passed parameters", () => { const obj = { addEventListener: jest.fn(), }; const cb = () => {}; ...
nuanyang233/web
src/useLocalStorageValue.ts
import { IHookReturn, IUseStorageValueOptions, useStorageValue } from './useStorageValue'; import { isBrowser } from './util/const'; export function useLocalStorageValue<T = unknown>( key: string, defaultValue?: null, options?: IUseStorageValueOptions ): IHookReturn<T, typeof defaultValue, IUseStorageValueOption...
nuanyang233/web
tests/ssr/useMediatedState.test.ts
<reponame>nuanyang233/web import { renderHook } from '@testing-library/react-hooks/server'; import { useMediatedState } from '../../src'; describe('useMediatedState', () => { it('should be defined', () => { expect(useMediatedState).toBeDefined(); }); it('should render', () => { const { result } = render...
nuanyang233/web
src/index.ts
<filename>src/index.ts // Callback export { useDebounceCallback } from './useDebounceCallback'; export { useRafCallback } from './useRafCallback'; // Livecycle export { useConditionalEffect, IUseConditionalEffectPredicate } from './useConditionalEffect'; export { useConditionalUpdateEffect, IUseConditionalUpdateEf...
ArtBIT/html5-mandala
src/main.ts
<reponame>ArtBIT/html5-mandala<filename>src/main.ts import Mandala from "./mandala"; import Stage from "./stage"; import Gui from "./gui"; import Config from "./config"; import { on } from "./helpers"; class MandalaApp { constructor(node) { const canvas = document.querySelector(node); this.config =...
ArtBIT/html5-mandala
src/mandala.ts
class Mandala { constructor(stage) { this.matrix = new DOMMatrix(); this.scale = 1; this.rotation = 0; } setScale(scale) { this.scale = scale; this.update(); } setRotation(angle) { this.rotation = angle; this.update(); } setPattern(patt...
ArtBIT/html5-mandala
src/gui.ts
import gui from "dat.gui"; class Gui { constructor(params) { this.listeners = {}; this.config = params; this.gui = new gui.GUI({ load: JSON }); const handle = name => value => { this.triggerChange(name, value); }; const guiCanvas = this.gui.addFolder("C...
ArtBIT/html5-mandala
src/helpers.ts
<filename>src/helpers.ts // Quick and dirty on event helper export const on = (context, eventType, eventCallback, useCapture) => { if (context && eventType && eventCallback) { var events = String(eventType).split(" "); while (events.length) { eventType = events.pop(); if (con...
ArtBIT/html5-mandala
src/config.ts
<filename>src/config.ts export default function Config(params) { params = params || {}; this.width = params.width || 2048; this.height = params.height || 2048; this.scale = params.scale || 4; this.angle = params.angle || 0; this.offset = params.offset || { h: 0, s: 0, v: 0 }; this.patternSca...
ArtBIT/html5-mandala
src/stage.ts
class Stage { constructor(canvas) { this.canvas = canvas; this.width = this.canvas.width; this.height = this.canvas.height; this.ctx = canvas.getContext("2d"); } clear(color) { if (color) { this.ctx.save(); this.ctx.fillStyle = color; ...
SsSanzo/obsidian-gantt
src/ganttDb.ts
<filename>src/ganttDb.ts export class Group{ Title: string; } export class Milestone{ StartDate: Date; Title: string; ID: string; Dependencies: Array<string>; Class: string; Progress: number; Group: Group; } export class Task extends Milestone{ EndDate: Date; } export class Render...
SsSanzo/obsidian-gantt
main.ts
<reponame>SsSanzo/obsidian-gantt import {MarkdownPostProcessor, Plugin} from 'obsidian'; import {Parser} from 'src/parser'; import {Renderer} from 'src/render'; // Remember to rename these classes and interfaces! export default class MyPlugin extends Plugin { postprocessors: Map<string, MarkdownPostProce...
SsSanzo/obsidian-gantt
src/render.ts
<reponame>SsSanzo/obsidian-gantt import {Group, GanttInfo, EventType} from "./ganttDb"; import * as Enumerable from "linq-es2015"; import * as d3 from 'd3'; import { DateTime } from "luxon"; export class Renderer{ static KEYWORD_AXISTICKS = "axisticks"; static KEYWORD_TITLE = "title"; static KEYWORD_TODAY...
SsSanzo/obsidian-gantt
src/parser.ts
<filename>src/parser.ts import * as Enumerable from "linq-es2015"; import {Task, Group, Milestone, GanttInfo, Event, EventType} from "./ganttDb"; import { Renderer } from "./render"; import { DateTime } from "luxon"; export class Parser{ ganttInfo: GanttInfo; static KEYWORD_OPTION = "option "; static KEY...
YenHub/immurl
lib/immurl.ts
<reponame>YenHub/immurl import { URL_PROPERTIES } from './constants'; /** * Identical to the native URL interface except that all mutable properties are * readonly. To change any of these properties instead you should call the * `.set()` method which will return a new ImmutableURL object. * * All propertie...
YenHub/immurl
tests/ImmutableURL.test.ts
<reponame>YenHub/immurl import { ImmutableURL, ImmutableURLSearchParams } from '../lib/immurl'; import { URL_PROPERTIES } from '../lib/constants'; import flatMap from 'lodash/flatMap'; const URLS = [ 'https://example.com', 'https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash', 'https://測試', ...
YenHub/immurl
lib/constants.ts
<filename>lib/constants.ts /** * @internal */ export const URL_PROPERTIES = [ 'hash', 'host', 'hostname', 'href', 'origin', 'password', 'pathname', 'port', 'protocol', 'search', 'searchParams', 'username', ] as const;
YenHub/immurl
tests/ImmutableURLSearchParams.test.ts
<filename>tests/ImmutableURLSearchParams.test.ts import { ImmutableURLSearchParams } from '../lib/immurl'; /** * Array of search params defined without the leading ? */ export const SEARCH_PARAMS = [ 'q=URLUtils.searchParams&topic=api', 'query', 'foo=1&bar=2&foo=4', ]; const paramNamesToTest = ['to...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/models/Lights.ts
<filename>src/app/models/Lights.ts import { sceneController } from '../app'; import { colours } from '../shared/Color'; import { SpotLight } from 'three'; export class Lights { spotLight: SpotLight; spotLightEye: SpotLight; constructor() { this.spotLight = new SpotLight(colours.burlywood); ...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/EventController.ts
<filename>src/app/controllers/EventController.ts import { renderer } from '../app'; import { fromEvent, Observable, tap } from 'rxjs'; import { delayedRedirect } from '../shared/OnClick'; import { ScrollController } from './ScrollController'; export class EventController { previosWindowInnerWidth: number; prev...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/AnimationController.ts
<filename>src/app/controllers/AnimationController.ts<gh_stars>0 import { sceneController } from '../app'; import { ScrollController } from './ScrollController'; import { Clock } from 'three'; export class AnimationController { private static _instance: AnimationController; clock = new Clock(); public stat...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/models/Crows.ts
<reponame>angelolamonaca/webpack-threeJS-rxJS-my_portfolio import { cloneModel } from '../shared/SkeletonUtils'; import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; import { getRandomArbitrary } from '../shared/Math'; import { remove } from 'lodash-es'; import { sceneController } from '../app'; import {...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/models/Camera.ts
import { PerspectiveCamera } from 'three'; export class Camera extends PerspectiveCamera { constructor() { super(45, window.innerWidth / window.innerHeight, 0.001, 20); this.position.setZ(6); } }
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/LightController.ts
<reponame>angelolamonaca/webpack-threeJS-rxJS-my_portfolio import { Lights } from '../models/Lights'; import { CameraController } from './CameraController'; import { ScrollController } from './ScrollController'; export class LightController { private static _instance: LightController; lights: Lights; cons...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/models/Octocat.ts
<gh_stars>0 import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; import { sceneController } from '../app'; import { Group } from 'three'; export class Octocat { octocatScene!: Group; constructor(gltfLoader: GLTFLoader) { gltfLoader.load('assets/asset/3dmodels/octocat.gltf', (octocat) =>...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/models/World.ts
import { Color, Fog, Group, Light, Mesh, MeshPhongMaterial, PlaneGeometry, Scene } from 'three'; export class World extends Scene { constructor() { super(); this.addBackground(); this.addFog(); this.addFloor(); } addBackground(): void { this.background = new Color(0...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/views/Renderer.ts
import * as THREE from 'three'; import { CameraController } from '../controllers/CameraController'; import { render, renderer } from '../app'; export class Renderer extends THREE.WebGLRenderer { constructor() { super({ antialias: true }); this.setPixelRatio(window.devicePixelRatio); this.se...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/HTMLElementsController.ts
import { CustomLoadingController } from './CustomLoadingController'; export class HTMLElementsController { private static _instance: HTMLElementsController; public static get Instance(): HTMLElementsController { return this._instance || (this._instance = new this()); } private static showElem...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/shared/SkeletonUtils.ts
import { Group } from 'three'; import { Object3D } from 'three/src/Three'; export function cloneModel(source: Group): Group { const sourceLookup = new Map(); const cloneLookup = new Map(); const clone = source.clone(); parallelTraverse(source, clone, function (sourceNode, clonedNode) { sourceLo...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/models/ItachiUchiha.ts
<reponame>angelolamonaca/webpack-threeJS-rxJS-my_portfolio import { AnimationAction, AnimationClip, AnimationMixer, Group, LoopOnce, Vector3 } from 'three'; import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; import { sceneController } from '../app'; export class ItachiUchiha { itachiUchihaScene!: ...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/CustomLoadingController.ts
<reponame>angelolamonaca/webpack-threeJS-rxJS-my_portfolio import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; import { animate, renderer } from '../app'; import { delay } from '../shared/Utils'; import { LoadingManager } from 'three'; import { ScrollController } from './ScrollController'; export class...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/shared/Math.ts
<gh_stars>0 /** * Returns a random number between min (inclusive) and max (exclusive) */ export function getRandomArbitrary(min: number, max: number): number { return Math.random() * (max - min) + min; }
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/shared/OnClick.ts
<filename>src/app/shared/OnClick.ts import { delay } from './Utils'; export async function delayedRedirect(destination: string, delayInMs: number) { await delay(delayInMs); const openedWindow = window.open(destination, '_blank'); if (openedWindow) openedWindow.focus(); else window.location.href = desti...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/app.ts
<reponame>angelolamonaca/webpack-threeJS-rxJS-my_portfolio<gh_stars>0 import { Renderer } from './views/Renderer'; import { SceneController } from './controllers/SceneController'; import { AnimationController } from './controllers/AnimationController'; import { CameraController } from './controllers/CameraController'; ...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/SceneController.ts
import { ItachiUchiha } from '../models/ItachiUchiha'; import { Crows } from '../models/Crows'; import { CustomLoadingController } from './CustomLoadingController'; import { World } from '../models/World'; export class SceneController { world: World; itachi: ItachiUchiha; crows: Crows; constructor() {...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/ScrollController.ts
export class ScrollController { private static _instance: ScrollController; scrollPercentage: number; static pageHeight: number; constructor() { this.scrollPercentage = 0; } public static get Instance(): ScrollController { return this._instance || (this._instance = new this());...
angelolamonaca/webpack-threeJS-rxJS-my_portfolio
src/app/controllers/CameraController.ts
import { Camera } from '../models/Camera'; import { sceneController } from '../app'; import { ScrollController } from './ScrollController'; import { Vector3 } from 'three'; export class CameraController { private static _instance: CameraController; camera: Camera; itachiEndScrollPercentage = 100; cons...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/common/connection-app.ts
<filename>src/public/common/connection-app.ts import type { App, AppDefinition, AppPOJO } from "./app"; import type { Form, FormDefinition, FormPOJO } from "./form"; import type { Connect } from "./methods"; import type { TransactionPOJO } from "./transaction"; import type { FilePath, InlineOrReference, URLString } fro...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/orders/methods.ts
import type { Transaction } from "../common"; import type { SalesOrderPOJO } from "./sales-order"; import type { SalesOrderIdentifier } from "./sales-order-identifier"; import type { SalesOrderTimeRange } from "./sales-order-time-range"; import type { SellerPOJO } from "./sellers/seller"; import type { SellerIdentifier...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/rates/rate.ts
import type { Charge, ChargePOJO, DateTimeZone, DateTimeZonePOJO, MonetaryValue, Note, NotePOJO, TimeRange, TimeRangePOJO } from "../../common"; import type { DeliveryService, DeliveryServiceIdentifierPOJO } from "../delivery-service"; import type { FulfillmentService } from "../fulfillment-service"; import type { Rate...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/orders/shipments/sales-order-shipment.ts
<filename>src/internal/orders/shipments/sales-order-shipment.ts<gh_stars>0 import { FulfillmentService, SalesOrderShipment as ISalesOrderShipment, SalesOrderShipmentPOJO } from "../../../public"; import { ShipmentIdentifier, ShipmentIdentifierBase } from "../../carriers"; import { AddressWithContactInfo, DateTimeZone, ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/pickups/pickup-cancellation.ts
import type { Address, AddressPOJO, ContactInfo, ContactInfoPOJO, Identifiers, IdentifiersPOJO, Note, NotePOJO, TimeRange, TimeRangePOJO, UUID } from "../../common"; import type { PickupCancellationReason } from "../enums"; import type { PickupService, PickupServiceIdentifierPOJO } from "./pickup-service"; import type ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/rates/rate.ts
<filename>src/internal/carriers/rates/rate.ts import { ErrorCode, FulfillmentService, Rate as IRate, RatePOJO } from "../../../public"; import { App, calculateTotalCharges, Charge, createNotes, DateTimeZone, DefinitionIdentifier, error, hideAndFreeze, Joi, MonetaryValue, Note, TimeRange, _internal } from "../../common"...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/common/measures/dimensions.ts
/** * A length measurement unit */ export enum LengthUnit { Inches = "in", Centimeters = "cm" } /** * The dimensions of a package */ export interface DimensionsPOJO { length: number; width: number; height: number; unit: LengthUnit; } /** * The dimensions of a package */ export interface Dimensions {...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/pickups/pickup-confirmation.ts
import { PickupConfirmation as IPickupConfirmation, PickupConfirmationPOJO } from "../../../public"; import { calculateTotalCharges, Charge, createNotes, hideAndFreeze, Identifiers, Joi, MonetaryValue, Note, TimeRange, _internal } from "../../common"; import { ShipmentIdentifier } from "../shipments/shipment-identifier...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/orders/sellers/warehouse.ts
<reponame>jeversmann-shipstation/shipengine-integration-platform-sdk import { Warehouse as IWarehouse, WarehousePOJO } from "../../../public"; import { Address, hideAndFreeze, Identifiers, Joi, _internal } from "../../common"; export class Warehouse implements IWarehouse { public static readonly [_internal] = { ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/orders/buyer.ts
import type { ContactInfo, ContactInfoPOJO, Identifiers, IdentifiersPOJO } from "../common"; /** * The person who bought a sales order */ export interface BuyerPOJO extends ContactInfoPOJO { /** * The marketplace's unique ID for the buyer */ id: string; /** * Your own identifiers for this buyer */...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/shipments/new-shipment.ts
import { BilledParty, Country, NewShipment as INewShipment, NewShipmentPOJO } from "../../../public"; import { AddressWithContactInfo, App, DateTimeZone, DefinitionIdentifier, hideAndFreeze, Joi, MonetaryValue, _internal } from "../../common"; import { DeliveryService } from "../delivery-service"; import { NewPackage }...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/validation/string-validation.ts
<reponame>jeversmann-shipstation/shipengine-integration-platform-sdk import * as joi from "@hapi/joi"; import * as path from "path"; import { ParsedPath } from "path"; // tslint:disable-line: no-duplicate-imports import { regex } from "../utils"; /** * Extended Joi string validation schema */ export interface String...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/orders/shipments/sales-order-package.ts
import { Customs, CustomsPOJO, PackageIdentifier, PackageIdentifierPOJO } from "../../carriers"; import { Dimensions, DimensionsPOJO, MonetaryValue, MonetaryValuePOJO, URLString, Weight, WeightPOJO } from "../../common"; import { InsuranceProvider } from "../enums"; import { SalesOrderPackageItem, SalesOrderPackageItem...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/identifiers.ts
import { Identifiers as IIdentifiers, IdentifiersPOJO } from "../../public"; import { hideAndFreeze, _internal } from "./utils"; import { Joi } from "./validation"; export class Identifiers implements IIdentifiers { public static readonly [_internal] = { label: "identifiers", schema: Joi.object().pattern( ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/pickups/pickup-cancellation-outcome.ts
import type { CancellationStatus, Note, NotePOJO, UUID } from "../../common"; /** * The outcome of a pickup cancellation */ export interface PickupCancellationOutcomePOJO { /** * Indicates which pickup cancellation this outcome is for. */ cancellationID: UUID; /** * The status of the cancellation ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/carrier-app.ts
<reponame>jeversmann-shipstation/shipengine-integration-platform-sdk import { AppType, CancellationStatus, CancelPickups, CancelShipments, CarrierApp as ICarrierApp, CarrierAppPOJO, Country, CreateManifest, CreateShipment, DocumentFormat, DocumentSize, ErrorCode, ManifestLocation, ManifestShipment, NewManifestPOJO, New...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/products/product-identifier.ts
<filename>src/public/products/product-identifier.ts<gh_stars>0 import type { Identifiers, IdentifiersPOJO } from "../common"; /** * Identifies a product */ export interface ProductIdentifierPOJO { /** * The product catalog's unique ID for the order */ id: string; /** * The Stock Keeping Unit code for...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/app.ts
import { App as IApp, AppManifest, AppPOJO, AppType, UUID } from "../../public"; import { ReferenceMap } from "./reference-map"; import { sdk } from "./sdk"; import { _internal } from "./utils"; import { Joi } from "./validation"; export abstract class App implements IApp { public static readonly [_internal] = { ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/validation/object-validation.ts
import * as joi from "@hapi/joi"; import { regex } from "../utils"; /** * Extended Joi object validation schema */ export interface ObjectValidationSchema extends joi.ObjectSchema { /** * Requires an object value to be a valid HTTP or HTTPS URL */ website(): ObjectValidationSchema; } /** * Joi object va...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/packages/new-package.ts
<filename>src/public/carriers/packages/new-package.ts import type { Dimensions, DimensionsPOJO, MonetaryValue, MonetaryValuePOJO, Weight, WeightPOJO } from "../../common"; import { Customs, CustomsPOJO } from "../customs/customs"; import type { DeliveryConfirmation, DeliveryConfirmationIdentifierPOJO } from "../deliver...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/orders/sales-order.ts
import { FulfillmentStatus, PaymentMethod, PaymentStatus, SalesOrder as ISalesOrder, SalesOrderPOJO, SalesOrderStatus } from "../../public"; import { AddressWithContactInfo, calculateTotalCharges, Charge, createNotes, DateTimeZone, hideAndFreeze, Joi, MonetaryValue, Note, _internal } from "../common"; import { Buyer } ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/note.ts
<gh_stars>0 import { Note as INote, NotePOJO, NoteType } from "../../public"; import { hideAndFreeze, _internal } from "./utils"; import { Joi } from "./validation"; /** * Normalizes any form of notes as an array of Note objects */ export function createNotes(notes?: string | ReadonlyArray<string | NotePOJO>): Note...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/documents/label.ts
import { Label as ILabel, LabelPOJO } from "../../../public"; import { hideAndFreeze, Joi, _internal } from "../../common"; import { Document, DocumentBase } from "./document"; export class Label extends DocumentBase implements ILabel { public static readonly [_internal] = { label: "label", schema: Document[...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/orders/sales-order-item.ts
import type { Charge, ChargePOJO, MonetaryValue, MonetaryValuePOJO, Note, NotePOJO, Quantity, QuantityPOJO, URLString, Weight, WeightPOJO } from "../common"; import type { ProductIdentifier, ProductIdentifierPOJO } from "../products"; import type { FulfillmentStatus } from "./enums"; import type { SalesOrderItemIdentif...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/pickups/pickup-service.ts
<gh_stars>0 import { PickupService as IPickupService, PickupServicePOJO } from "../../../public"; import { App, DefinitionIdentifier, hideAndFreeze, Joi, _internal } from "../../common"; const _private = Symbol("private fields"); export class PickupService extends DefinitionIdentifier implements IPickupService { pu...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/tracking/tracking-criteria.ts
import { TrackingCriteria as ITrackingCriteria, TrackingCriteriaPOJO } from "../../../public"; import { hideAndFreeze, Joi, _internal } from "../../common"; import { ShipmentIdentifier, ShipmentIdentifierBase } from "../shipments/shipment-identifier"; export class TrackingCriteria extends ShipmentIdentifierBase implem...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/reference-map.ts
<gh_stars>0 import { ErrorCode, UUID } from "../../public"; import { error } from "./errors"; import { ShipEngineConstructor } from "./types"; import { _internal } from "./utils"; import { Joi, validate } from "./validation"; interface ClassInstance { id: UUID; } interface Reference { type: ShipEngineConstructor; ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/pickups/pickup-confirmation.ts
<reponame>jeversmann-shipstation/shipengine-integration-platform-sdk import type { Charge, ChargePOJO, Identifiers, IdentifiersPOJO, MonetaryValue, Note, NotePOJO, TimeRange, TimeRangePOJO } from "../../common"; import type { ShipmentIdentifier, ShipmentIdentifierPOJO } from "../shipments/shipment-identifier"; /** * ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/orders/sales-order-time-range.ts
import { SalesOrderTimeRange as ISalesOrderTimeRange, SalesOrderTimeRangePOJO } from "../../public"; import { hideAndFreeze, Joi, TimeRange, TimeRangeBase, _internal } from "../common"; export class SalesOrderTimeRange extends TimeRangeBase implements ISalesOrderTimeRange { public static readonly [_internal] = { ...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/common/addresses/person-name.ts
<reponame>jeversmann-shipstation/shipengine-integration-platform-sdk<filename>src/internal/common/addresses/person-name.ts<gh_stars>0 import { PersonName as IPersonName, PersonNamePOJO } from "../../../public"; import { hideAndFreeze, _internal } from "../utils"; import { Joi } from "../validation"; export class Perso...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/rates/package-rate-criteria.ts
<filename>src/internal/carriers/rates/package-rate-criteria.ts<gh_stars>0 import { PackageRateCriteria as IPackageRateCriteria, PackageRateCriteriaPOJO } from "../../../public"; import { App, DefinitionIdentifier, Dimensions, hideAndFreeze, Joi, MonetaryValue, Weight, _internal } from "../../common"; import { DeliveryC...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/orders/shipments/sales-order-package-item.ts
import type { Quantity, QuantityPOJO } from "../../common"; import type { SalesOrderIdentifier, SalesOrderIdentifierPOJO, SalesOrderItemIdentifier, SalesOrderItemIdentifierPOJO } from "../../orders"; import type { ProductIdentifier, ProductIdentifierPOJO } from "../../products"; /** * An item inside a package */ exp...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/tracking/tracking-info.ts
import type { DateTimeZone, DateTimeZonePOJO } from "../../common"; import type { ShipmentStatus } from "../enums"; import type { ShipmentIdentifier, ShipmentIdentifierPOJO } from "../shipments/shipment-identifier"; import type { PackageTrackingInfo, PackageTrackingInfoPOJO } from "./package-tracking-info"; import type...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/common/charge.ts
import type { ChargeType } from "./enums"; import type { MonetaryValue, MonetaryValuePOJO } from "./measures/monetary-value"; import type { Note, NotePOJO } from "./note"; /** * An itemized charge or credit for a shipment or sales order */ export interface ChargePOJO { /** * The user-friendly name of the charge...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/documents/label.ts
import type { Document, DocumentPOJO } from "./document"; /** * A shipping label */ export interface LabelPOJO extends DocumentPOJO { /** * The **actual** reference fields on the label, which may not match the originally-specified * reference fields due to the carrier's restrictions on the number of fields o...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/delivery-service.ts
import type { Country, DefinitionIdentifier, DefinitionIdentifierPOJO, InlineOrReference, InlineOrReferenceArray } from "../common"; import type { DeliveryConfirmation, DeliveryConfirmationDefinition, DeliveryConfirmationPOJO } from "./delivery-confirmation"; import type { DeliveryServiceClass, DeliveryServiceGrade, Do...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/tracking/tracking-info.ts
import { ShipmentStatus, TrackingInfo as ITrackingInfo, TrackingInfoPOJO } from "../../../public"; import { App, DateTimeZone, hideAndFreeze, Joi, _internal } from "../../common"; import { ShipmentIdentifierBase } from "../shipments/shipment-identifier"; import { PackageTrackingInfo } from "./package-tracking-info"; im...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/internal/carriers/pickups/pickup-cancellation.ts
import { PickupCancellation as IPickupCancellation, PickupCancellationPOJO, PickupCancellationReason, UUID } from "../../../public"; import { Address, App, ContactInfo, createNotes, DefinitionIdentifier, hideAndFreeze, Identifiers, Joi, Note, TimeRange, _internal } from "../../common"; import { PickupService } from "./...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/carriers/manifests/non-manifested-shipment.ts
import type { Note, NotePOJO } from "../../common"; import type { ShipmentIdentifierPOJO } from "../shipments/shipment-identifier"; /** * A shipment that could not be manifested, along with details about why */ export interface NonManifestedShipmentPOJO extends ShipmentIdentifierPOJO { /** * The carrier's error...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/orders/sales-order-time-range.ts
import type { TimeRange, TimeRangePOJO } from "../common"; /** * Specifies a date/time range to retrieve sales orders for */ export interface SalesOrderTimeRangePOJO extends TimeRangePOJO { /** * Indicates whether orders that were modified during the date/time range should be returned. * If `false` (the defa...
jeversmann-shipstation/shipengine-integration-platform-sdk
src/public/common/addresses/geo-coordinate.ts
/** * The geo coordinates of a location on Earth */ export interface GeoCoordinatePOJO { /** * The latitude of the point. Represented as signed degrees between -90.0 and +90.0. * * @see http://www.geomidpoint.com/latlon.html */ latitude: number; /** * The longitude of the point. Represented as s...