From 494d35ad311b86d620fda5f40a3624cdb7ad1598 Mon Sep 17 00:00:00 2001 From: Marco Eckstein Date: Sat, 20 Apr 2019 00:40:26 +0200 Subject: [PATCH 01/14] Add deezer-sdk (#34857) --- types/deezer-sdk/deezer-sdk-tests.ts | 45 ++ types/deezer-sdk/index.d.ts | 856 +++++++++++++++++++++++++++ types/deezer-sdk/tsconfig.json | 23 + types/deezer-sdk/tslint.json | 1 + 4 files changed, 925 insertions(+) create mode 100644 types/deezer-sdk/deezer-sdk-tests.ts create mode 100644 types/deezer-sdk/index.d.ts create mode 100644 types/deezer-sdk/tsconfig.json create mode 100644 types/deezer-sdk/tslint.json diff --git a/types/deezer-sdk/deezer-sdk-tests.ts b/types/deezer-sdk/deezer-sdk-tests.ts new file mode 100644 index 0000000000..49cd2d466a --- /dev/null +++ b/types/deezer-sdk/deezer-sdk-tests.ts @@ -0,0 +1,45 @@ +DZ.init({ + appId: "myapp", + channelUrl: "https://myapp.com/deezer-channel.html", + player: { + container: "my-widget-div", + onload: onLoad, + } +}); + +function onLoad(state: DeezerSdk.PlayerState) { + print("Player has loaded. Volume = " + state.volume); + const trackId = "12345"; + DZ.player.playTracks([trackId]); + DZ.player.playTracks([trackId], playQueue => print(playQueue.tracks)); + DZ.player.playTracks([trackId], true, playQueue => print(playQueue.tracks)); + DZ.player.playTracks([trackId], true, 1, playQueue => print(playQueue.tracks)); + DZ.player.playTracks([trackId], true, 1, 0, playQueue => print(playQueue.tracks)); + DZ.player.playTracks([trackId], undefined, undefined, undefined, undefined); +} + +dzAsyncInit = () => print("Deezer SDK has loaded."); + +DZ.Event.subscribe( + "track_end", + trackPosition => print("Track end. Position = " + trackPosition) +); +DZ.Event.subscribe( + "player_position", + ([positionSecondsFloat, _]) => print("Position = " + positionSecondsFloat) +); + +DZ.api( + "/user/123", + response => print("User name = " + response.name) + ); +DZ.api( + "user/me/playlists", + "POST", + { title : "my title" }, + response => print("My new playlist ID = " + response.id) +); + +function print(a: any) { + // ... +} diff --git a/types/deezer-sdk/index.d.ts b/types/deezer-sdk/index.d.ts new file mode 100644 index 0000000000..aa5a8a5236 --- /dev/null +++ b/types/deezer-sdk/index.d.ts @@ -0,0 +1,856 @@ +// Type definitions for non-npm package deezer-sdk 0.0 +// Project: https://developers.deezer.com/sdk/javascript +// Definitions by: Marco Eckstein +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +// = Notes = +// +// == Versioning == +// +// The Deezer JavaScript SDK is not versioned (confirmed by support). +// Definitions reflect SDK as of mid-April 2019. +// So, semantic versioning mandates version 0.0.*. +// +// == Doc == +// +// Not using @see tags because they are not supported by TSDoc (https://microsoft.github.io/tsdoc/). +// +// == Usage == +// +// There may be other ways, but this works for an Angular project: +// +// 1. Add Deezer library to a script tag, as described in https://developers.deezer.com/sdk/javascript. +// +// 2. Add +// +// "devDependencies": { +// ... +// "@types/deezer-sdk": "...", +// ... +// } +// +// to package.json. +// +// 3. Add +// +// /// +// +// to the beginning of app.module.ts. + +/** + * See: {@link https://developers.deezer.com/sdk/javascript | Introduction} + */ +declare const DZ: DeezerSdk.DZ; + +/** + * See: {@link https://developers.deezer.com/sdk/javascript/init | DZ.init} + */ +// The client may want to set this, so we have to disable a rule: +// tslint:disable-next-line:prefer-declare-function +declare let dzAsyncInit: () => void; + +/** + * See: {@link https://developers.deezer.com/sdk/javascript | Deezer Javascript SDK} + */ +declare namespace DeezerSdk { + /** + * See: {@link https://developers.deezer.com/sdk/javascript | Introduction} + */ + interface DZ { + /** + * Allows you to load and play tracks from your page. + * + * Before using the player, you must define PlayerOptions when initializing init(InitOptions). + * + * The Deezer web player requires Flash (for stream encryption purposes), the minimum required version + * is Flash Player 10.1. On mobile, the player will automatically fall back to 30-second previews. + * + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/player | Initialize a player}\ + * {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + readonly player: Player; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/events-subscribe | Subscribe to an event} + */ + readonly Event: Event; + + /** + * Initialize the JavaScript SDK in your page. + * + * See: {@link https://developers.deezer.com/sdk/javascript/init | DZ.init} + */ + init(options: InitOptions): void; + + /** + * Allows you to interact with the DZ.player object. + * + * To interact with the player, it needs to be loaded first otherwise you'll get an error message. + * Once the player is loaded, the DZ.ready method is executed and you can use it to perform your + * player actions. + * + * The DZ.ready methods accepts a function as argument that will be executed as soon as the + * DZ.player object is loaded. + * + * Another way to make sure that the player is loaded before interacting with it is to use the + * onload option when initializing the player with the DZ.init method. + * + * See: {@link https://developers.deezer.com/sdk/javascript/ready | DZ.ready} + */ + ready(callback: (sdkOptions: SdkOptions) => void): void; + + /** + * Make calls to the Deezer API. + * + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/api | DZ.api}\ + * {@link https://developers.deezer.com/api | API} + */ + api(path: string, callback: (response: any) => void): void; + api(path: string, method: HttpMethod, callback: (response: any) => void): void; + api(path: string, method: HttpMethod, data: any, callback: (response: any) => void): void; + + /** + * Prompt the user to connect on Deezer, and to authorize you application. + * + * The DZ.login method opens up a modal window. Since most browsers block pop-up windows unless they + * are initiated from a user event, we advise you to call DZ.login from a JavaScript onclick event. + * + * See: {@link https://developers.deezer.com/sdk/javascript/login | DZ.login} + */ + login(callback: (response: LoginResponse) => void): void; + + /** + * Destroy the current user session. + * + * See: {@link https://developers.deezer.com/sdk/javascript/logout | DZ.logout} + */ + logout(callback?: () => void): void; + + /** + * Determine if a user is logged in and connected to your app. + * + * See: {@link https://developers.deezer.com/sdk/javascript/getloginstatus | DZ.getLoginStatus} + */ + getLoginStatus(callback: (loginStatus: LoginStatus) => void): void; + } + + /** + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/init | DZ.init}\ + * {@link https://developers.deezer.com/sdk/javascript/player | Initialize a player} + */ + interface InitOptions { + readonly appId: string; + readonly channelUrl: string; + readonly player?: PlayerOptions; + } + + /** + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/player | Initialize a player}\ + * {@link https://developers.deezer.com/musicplugins/player | Widget player} + */ + interface PlayerOptions { + /** + * The ID of the div that will contain the widget player + * + * To implement a Deezer-like player, set this to the ID attribute of HTML div you want to load + * the widget player in. + * + * An invisible player allows you to create your own UI and JavaScript events. + * + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + readonly container?: string; + + /** + * Whether to display the playlist from the player + * + * Default: true + * + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + readonly playlist?: boolean; + + /** + * The layout format of the widget + * + * Default: classic + * + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/player#options | Player options}\ + * {@link https://developers.deezer.com/musicplugins/player | Widget player} + */ + readonly format?: WidgetFormat; + + /** + * The general layout of the widget + * + * Default: dark + * + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/player#options | Player options}\ + * {@link https://developers.deezer.com/musicplugins/player | Widget player} + */ + readonly layout?: WidgetLayout; + + /** + * The general color of the widget. Has to be a hexadecimal value without the #. + * + * Default: 1990DB + * + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/player#options | Player options}\ + * {@link https://developers.deezer.com/musicplugins/player | Widget player} + */ + readonly color?: string; + + /** + * The width of the player in pixels + * + * Default: 100% + * + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + readonly width?: number; + + /** + * The height of the player in pixels + * + * Default: 100% + * + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + readonly height?: number; + + /** + * The layout size of the widget + * + * Default: medium + * + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + readonly size?: WidgetSize; + + /** + * The callback function executed after the player has loaded. + * + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + onload?: (state: PlayerState) => void; + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + type WidgetFormat = "square" | "classic"; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + type WidgetLayout = "light" | "dark"; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + type WidgetSize = "small" | "medium" | "big"; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player#options | Player options} + */ + interface PlayerState { + readonly muted: boolean; + readonly repeat: number; + readonly shuffle: boolean; + readonly volume: number; + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/ready | DZ.ready} + */ + interface SdkOptions { + readonly token: { + readonly access_token: string; + readonly expire: string; + }; + /** + * In addition to the PlayerState properties, + * {@link https://developers.deezer.com/sdk/javascript/ready | DZ.ready} also documents the + * property current_track, but the author of this comment was not able no retrieve it. + */ + readonly player: PlayerState; + } + + /** + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/api | DZ.api}\ + * {@link https://developers.deezer.com/api | API} + */ + type HttpMethod = "GET" | "POST" | "DELETE"; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/login | DZ.login} + */ + interface LoginResponse { + authResponse: { + accessToken: string; + expire: string; + }; + status: "connected" | "not_authorized"; + userID: string; + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/getloginstatus | DZ.getLoginStatus} + */ + interface LoginStatus { + status: ConnectionStatus; + authResponse: { + accessToken: string; + expire: string; + userID: string; + }; + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/getloginstatus | DZ.getLoginStatus} + */ + type ConnectionStatus = "connected" | "notConnected" | "unknown" | "not_authorized"; + + /** + * See: + * {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + * {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + * {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + interface Player { + //#region Load tracks to a player + + // There may be more overloads possible, but the defined ones should suffice for all + // practical purposes. + + /** + * Load and play a track or list of tracks into the current player. + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param index The index of the first track to play in the list + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playTracks( + trackIds: ReadonlyArray, + autoplay?: boolean, + index?: number, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playTracks( + trackIds: ReadonlyArray, + autoplay?: boolean, + index?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playTracks( + trackIds: ReadonlyArray, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playTracks( + trackIds: ReadonlyArray, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * Load and play an album into the current player. + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param index The index of the first track to play in the list + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playAlbum( + albumId: number, + autoplay?: boolean, + index?: number, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playAlbum( + albumId: number, + autoplay?: boolean, + index?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playAlbum( + albumId: number, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playAlbum( + albumId: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * Load and play a playlist into the current player. + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param index The index of the first track to play in the list + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playPlaylist( + playlistId: number, + autoplay?: boolean, + index?: number, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playPlaylist( + playlistId: number, + autoplay?: boolean, + index?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playPlaylist( + playlistId: number, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playPlaylist( + playlistId: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * Load and play a podcast into the current player. + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param index The index of the first track to play in the list + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playPodcast( + podcastId: number, + autoplay?: boolean, + index?: number, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playPodcast( + podcastId: number, + autoplay?: boolean, + index?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playPodcast( + podcastId: number, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playPodcast( + podcastId: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * Load and play an episode or a list of episodes into the current player. + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param index The index of the first track to play in the list + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playEpisodes( + episodeIds: ReadonlyArray, + autoplay?: boolean, + index?: number, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playEpisodes( + episodeIds: ReadonlyArray, + autoplay?: boolean, + index?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playEpisodes( + episodeIds: ReadonlyArray, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playEpisodes( + episodeIds: ReadonlyArray, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * Load and play a radio into the current player. + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playRadio( + id: number, + radioType?: RadioType, + autoplay?: boolean, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playRadio( + id: number, + radioType?: RadioType, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playRadio( + id: number, + radioType?: RadioType, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * The official docs for this method are incomplete, but the existing docs and a + * {@link https://github.com/deezer/javascript-samples/blob/master/player_basic.html | usage example} + * suggest the same parameters as in {@link playRadio}, + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param index The index of the first track to play in the list + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playSmartRadio( + id: number, + radioType?: RadioType, + autoplay?: boolean, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playSmartRadio( + id: number, + radioType?: RadioType, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playSmartRadio( + id: number, + radioType?: RadioType, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * Load and play external MP3 sources into the current player. + * + * @param autoplay Whether to start playing the queue when the player has loaded. + * Default: true. Setting this to false will cancel the expected behavior of the offset parameter. + * @param index The index of the first track to play in the list + * @param offset The position in seconds where to start playing the track + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + playExternalTracks( + mp3Sources: ReadonlyArray, + autoplay?: boolean, + index?: number, + offset?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playExternalTracks( + mp3Sources: ReadonlyArray, + autoplay?: boolean, + index?: number, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playExternalTracks( + mp3Sources: ReadonlyArray, + autoplay?: boolean, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + playExternalTracks( + mp3Sources: ReadonlyArray, + onTracksLoaded?: (playQueue: PlayQueue) => void, + ): void; + + /** + * Append a track to the queue of the current player. + * + * To remove a track from the queue, you will need to reset the queue using the playTracks method. + * + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + addToQueue(trackIds: ReadonlyArray, onTracksLoaded?: (playQueue: PlayQueue) => void): void; + + //#endregion + + //#region Control a player + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + play(): void; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + pause(): void; + + /** + * Tell the player to read the next track. + * + * The behavior of this method will depend on the RepeatMode of the player. + * + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + next(): void; + + /** + * Tell the player to read the previous track. + * + * The behavior of this method will depend on the RepeatMode of the player. + * + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + prev(): void; + + /** + * Set the position of the reader head in the currently playing track. + * + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + seek(positionPercentFloat: number): void; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + setVolume(volumePercentInt: number): void; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + setMute(mute: boolean): void; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + setShuffle(shuffle: boolean): void; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + setRepeat(repeatMode: RepeatMode): void; + + /** + * Set the order of the current list of tracks. + * + * Attention, this method does not add or remove tracks from the play queue. + * Use the addToQueue method to add a track or the playTracks method to remove a track by resetting + * the play queue. + * + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + */ + changeTrackOrder(trackIds: ReadonlyArray): void; + + /** + * Hide the queue and current track information. + * + * @param trackInfo Replaces the current track information. + * + * See: {@link https://developers.deezer.com/sdk/javascript/controls | Control a player} + * + */ + setBlindTestMode( + blindTestMode: boolean, + trackInfo?: { + title: string; + artist: string; + cover: string ; + } + ): void; + + //#endregion + + //#region The player properties + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + isPlaying(): boolean; + + /** + * Get the tracks in the queue of the player. + * + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + getTrackList(): Track[]; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + getCurrentTrack(): Track; + + /** + * Get the position in the queue of the currently playing track. + * + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + getCurrentIndex(): number; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + getVolume(): number; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + getShuffle(): boolean; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + getRepeat(): RepeatMode; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + getMute(): boolean; + + //#endregion + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + type RadioType = "radio" | "artist" | "user"; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + interface PlayQueue { + readonly tracks: Track[]; + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/loadtracks | Load tracks to a player} + */ + interface Mp3Source { + readonly url: string; + readonly title: string; + readonly artist: string; + } + + /** + * 0: No repeat\ + * 1: Repeat all\ + * 2: Repeat one + * + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/controls | Control a player}\ + * {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + type RepeatMode = 0 | 1 | 2; + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + interface Track { + readonly id: string; + /** Duration in seconds (int) */ + readonly duration: number; + readonly title: string; + readonly artist: Artist; + readonly album: Album; + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + interface Artist { + readonly id: string; + readonly name: string; + } + + /** + * See: {@link https://developers.deezer.com/sdk/javascript/player_object | The player properties} + */ + interface Album { + readonly id: string; + readonly title: string; + } + + //#region Player Events + + /** + * Allows you to listen to all player-related events. + * + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/events | List of events}\ + * {@link https://developers.deezer.com/sdk/javascript/events-subscribe | Subscribe to an event} + */ + interface Event { + /** + * See: {@link https://developers.deezer.com/sdk/javascript/events | List of events} + */ + subscribe( + event: "player_loaded" | "player_play" | "player_paused"| "tracklist_changed", + callback: () => void + ): void; + subscribe( + event: "player_position", + callback: (positionSecondsFloat_durationSecondsInt: [number, number]) => void + ): void; + subscribe(event: "player_buffering", callback: (loadedPercentInt: number) => void): void; + subscribe(event: "volume_changed", callback: (volumePercentInt: number) => void): void; + subscribe(event: "shuffle_changed", callback: (shuffle: boolean) => void): void; + subscribe(event: "repeat_changed", callback: (repeatMode: RepeatMode) => void): void; + subscribe(event: "mute_changed", callback: (mute: boolean) => void): void; + subscribe(event: "track_end", callback: (trackPosition: number) => void): void; + subscribe( + event: "current_track", + callback: (currentTrackInfo: { index: number; track: Track; }) => void + ): void; + } + + /** + * See:\ + * {@link https://developers.deezer.com/sdk/javascript/events | List of events}\ + * {@link https://developers.deezer.com/sdk/javascript/events-subscribe | Subscribe to an event} + * + * @remarks + * This type is not needed to define the other types, but users may find it useful + * in some situations anyway. + */ + type PlayerEvent = + "player_loaded" + | "player_play" + | "player_paused" + | "player_position" + | "player_buffering" + | "volume_changed" + | "shuffle_changed" + | "repeat_changed" + | "mute_changed" + | "tracklist_changed" + | "track_end" + | "current_track"; + + //#endregion +} diff --git a/types/deezer-sdk/tsconfig.json b/types/deezer-sdk/tsconfig.json new file mode 100644 index 0000000000..a02fe27479 --- /dev/null +++ b/types/deezer-sdk/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "deezer-sdk-tests.ts" + ] +} diff --git a/types/deezer-sdk/tslint.json b/types/deezer-sdk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/deezer-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8ad81d7563886be7fa2d3fdb955202a0e4635844 Mon Sep 17 00:00:00 2001 From: Claas Ahlrichs Date: Sat, 20 Apr 2019 01:36:04 +0200 Subject: [PATCH 02/14] new package: getpass (#34852) * npx dts-gen -m getpass --dt * drafted types for getpass * npx prettier --write .\types\getpass\** * updated prompt --- types/getpass/getpass-tests.ts | 13 +++++++++++++ types/getpass/index.d.ts | 15 +++++++++++++++ types/getpass/tsconfig.json | 16 ++++++++++++++++ types/getpass/tslint.json | 1 + 4 files changed, 45 insertions(+) create mode 100644 types/getpass/getpass-tests.ts create mode 100644 types/getpass/index.d.ts create mode 100644 types/getpass/tsconfig.json create mode 100644 types/getpass/tslint.json diff --git a/types/getpass/getpass-tests.ts b/types/getpass/getpass-tests.ts new file mode 100644 index 0000000000..d58e9b8760 --- /dev/null +++ b/types/getpass/getpass-tests.ts @@ -0,0 +1,13 @@ +import { getPass } from "getpass"; + +getPass((_error, _password) => { + // do your thing +}); + +getPass({}, (_error, _password) => { + // do your thing +}); + +getPass({ prompt: "Pass." }, (_error, _password) => { + // do your thing +}); diff --git a/types/getpass/index.d.ts b/types/getpass/index.d.ts new file mode 100644 index 0000000000..36ae06a345 --- /dev/null +++ b/types/getpass/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for getpass 0.1 +// Project: https://github.com/arekinath/node-getpass#readme +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Options { + prompt?: string; +} + +export interface Callback { + (error: Error | null, password: string): void; +} + +export function getPass(cb: Callback): void; +export function getPass(options: Options, cb: Callback): void; diff --git a/types/getpass/tsconfig.json b/types/getpass/tsconfig.json new file mode 100644 index 0000000000..54aa83abf4 --- /dev/null +++ b/types/getpass/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "getpass-tests.ts"] +} diff --git a/types/getpass/tslint.json b/types/getpass/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/getpass/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 84196b4d06928dae32583758a304ebfa1f57eeb7 Mon Sep 17 00:00:00 2001 From: Ifiok Jr Date: Sat, 20 Apr 2019 00:37:56 +0100 Subject: [PATCH 03/14] feat: new react-github-button types (#34847) --- types/react-github-button/index.d.ts | 28 +++++++++++++++++++ .../react-github-button-tests.tsx | 10 +++++++ types/react-github-button/tsconfig.json | 17 +++++++++++ types/react-github-button/tslint.json | 1 + 4 files changed, 56 insertions(+) create mode 100644 types/react-github-button/index.d.ts create mode 100644 types/react-github-button/react-github-button-tests.tsx create mode 100644 types/react-github-button/tsconfig.json create mode 100644 types/react-github-button/tslint.json diff --git a/types/react-github-button/index.d.ts b/types/react-github-button/index.d.ts new file mode 100644 index 0000000000..87548f2d03 --- /dev/null +++ b/types/react-github-button/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for react-github-button 0.1 +// Project: https://github.com/benjycui/react-github-button#readme +// Definitions by: Ifiok Jr. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Component } from 'react'; + +export interface ReactGitHubButtonProps { + /** + * The type of information to display + */ + type: 'stargazers' | 'watchers' | 'forks'; + /** + * The size of the button. Leave undefined for default. + */ + size?: 'large'; + /** + * Your GitHub id or organization name. + */ + namespace: string; + /** + * The name of your repository. + */ + repo: string; +} + +export default class GitHubButton extends Component {} diff --git a/types/react-github-button/react-github-button-tests.tsx b/types/react-github-button/react-github-button-tests.tsx new file mode 100644 index 0000000000..39b3d4464f --- /dev/null +++ b/types/react-github-button/react-github-button-tests.tsx @@ -0,0 +1,10 @@ +import GitHubButton from 'react-github-button'; + +const MyComponent = () => ( + +); diff --git a/types/react-github-button/tsconfig.json b/types/react-github-button/tsconfig.json new file mode 100644 index 0000000000..031f784407 --- /dev/null +++ b/types/react-github-button/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "jsx": "preserve", + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "react-github-button-tests.tsx"] +} diff --git a/types/react-github-button/tslint.json b/types/react-github-button/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-github-button/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 5323fa53d4c92bacb73e8c591b7284a381f8c0e1 Mon Sep 17 00:00:00 2001 From: amchelle <25422729+amchelle@users.noreply.github.com> Date: Fri, 19 Apr 2019 18:50:42 -0500 Subject: [PATCH 04/14] Add type definitions for package ringbufferjs (#34636) --- types/ringbufferjs/index.d.ts | 26 ++++++++++++++++++++++++ types/ringbufferjs/ringbufferjs-tests.ts | 12 +++++++++++ types/ringbufferjs/tsconfig.json | 23 +++++++++++++++++++++ types/ringbufferjs/tslint.json | 1 + 4 files changed, 62 insertions(+) create mode 100644 types/ringbufferjs/index.d.ts create mode 100644 types/ringbufferjs/ringbufferjs-tests.ts create mode 100644 types/ringbufferjs/tsconfig.json create mode 100644 types/ringbufferjs/tslint.json diff --git a/types/ringbufferjs/index.d.ts b/types/ringbufferjs/index.d.ts new file mode 100644 index 0000000000..9a58da8953 --- /dev/null +++ b/types/ringbufferjs/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for ringbufferjs 1.1 +// Project: https://github.com/janogonzalez/ringbufferjs#readme +// Definitions by: Amchelle Clendenin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = RingBuffer; + +declare class RingBuffer { + _elements: T[]; + _first: number; + _last: number; + _size: number; + _evictedCb: (element: T) => any; + + constructor(capacity: number, evictedCB?: (element: T) => any); + + capacity(): number; + isEmpty(): boolean; + isFull(): boolean; + peek(): T; + peekN(count: number): T[]; + deq(): T; + deqN(count: number): T[]; + enq(element: T): number; + size(): number; +} diff --git a/types/ringbufferjs/ringbufferjs-tests.ts b/types/ringbufferjs/ringbufferjs-tests.ts new file mode 100644 index 0000000000..89bf5504ad --- /dev/null +++ b/types/ringbufferjs/ringbufferjs-tests.ts @@ -0,0 +1,12 @@ +import RingBuffer = require('ringbufferjs'); + +const buffer: RingBuffer = new RingBuffer(10); +buffer.enq(1); +const capacity: number = buffer.capacity(); +const isEmpty: boolean = buffer.isEmpty(); +const isFull: boolean = buffer.isFull(); +const peeked: number = buffer.peek(); +const peekedElements: number[] = buffer.peekN(2); +const removed: number = buffer.deq(); +const removedElements: number[] = buffer.deqN(3); +const size: number = buffer.size(); diff --git a/types/ringbufferjs/tsconfig.json b/types/ringbufferjs/tsconfig.json new file mode 100644 index 0000000000..a32dee6c34 --- /dev/null +++ b/types/ringbufferjs/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ringbufferjs-tests.ts" + ] +} diff --git a/types/ringbufferjs/tslint.json b/types/ringbufferjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ringbufferjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 4126a93ec03dea1649ed5a567e41d780bbd6abb6 Mon Sep 17 00:00:00 2001 From: Naveen Ithapu Date: Sat, 20 Apr 2019 05:34:56 +0530 Subject: [PATCH 05/14] Type definitions for react-native-zss-rich-text-editor 1.x (#34843) * Type definitions for react-native-zss-rich-text-editor 1.1.0 * Type definitions for react-native-zss-rich-text-editor 1.x * Added tests file and corrected reference type --- .../index.d.ts | 224 ++++++++++++++++++ .../package.json | 5 + ...eact-native-zss-rich-text-editor-tests.tsx | 24 ++ .../tsconfig.json | 24 ++ .../tslint.json | 3 + 5 files changed, 280 insertions(+) create mode 100644 types/react-native-zss-rich-text-editor/index.d.ts create mode 100644 types/react-native-zss-rich-text-editor/package.json create mode 100644 types/react-native-zss-rich-text-editor/react-native-zss-rich-text-editor-tests.tsx create mode 100644 types/react-native-zss-rich-text-editor/tsconfig.json create mode 100644 types/react-native-zss-rich-text-editor/tslint.json diff --git a/types/react-native-zss-rich-text-editor/index.d.ts b/types/react-native-zss-rich-text-editor/index.d.ts new file mode 100644 index 0000000000..ed3824a9a5 --- /dev/null +++ b/types/react-native-zss-rich-text-editor/index.d.ts @@ -0,0 +1,224 @@ +// Type definitions for react-native-zss-rich-text-editor 1.x +// Project: https://github.com/wix/react-native-zss-rich-text-editor +// Definitions by: Naveen Ithappu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.1 + +import { Component, ReactNode } from "react"; +import { ImageStyle, StyleProp, TextStyle, ViewStyle, ImageProps, ImageSourcePropType } from "react-native"; + +export type FunctionWithZeroArgs = () => void; + +export type LinkHandler = (url: string, title: string) => void; + +export type ImageHandler = (attributes: ImageProps) => void; + +export type ColorHandler = (color: string) => void; + +export type LinkDialogHandler = (optionalTitle: string, optionalUrl: string) => void; + +export type PlaceHolderHandler = (placeholder: string) => void; + +export type ContentStylesHandler = (styles: RichTextStyles) => void; + +export type ContentSetHandler = (html: string) => void; + +export type ContentGetHandler = () => Promise; + +export type FocusHandler = (callback: FunctionWithZeroArgs) => void; + +export type ElementStyles = StyleProp; + +export interface ContentInset { + top: number; + left: number; +} + +export interface RichTextStyles { + [key: string]: ElementStyles; +} + +export interface IconsMap { + [key: string]: ImageSourcePropType; +} + +export enum ACTIONS { + enableOnChange = 'ENABLE_ON_CHANGE', + setTitleHtml = 'SET_TITLE_HTML', + setContentHtml = 'SET_CONTENT_HTML', + getTitleHtml = 'GET_TITLE_HTML', + getTitleText = 'GET_TITLE_TEXT', + toggleTitle = 'TOGGLE_TITLE', + hideTitle = 'HIDE_TITLE', + showTitle = 'SHOW_TITLE', + getContentHtml = 'GET_CONTENT_HTML', + getSelectedText = 'GET_SELECTED_TEXT', + blurTitleEditor = 'BLUR_TITLE_EDITOR', + blurContentEditor = 'BLUR_CONTENT_EDITOR', + focusTitle = 'FOCUS_TITLE', + focusContent = 'FOCUS_CONTENT', + + setBold = 'bold', + setItalic = 'italic', + setUnderline = 'underline', + heading1 = 'h1', + heading2 = 'h2', + heading3 = 'h3', + heading4 = 'h4', + heading5 = 'h5', + heading6 = 'h6', + setParagraph = 'SET_PARAGRAPH', + removeFormat = 'REMOVE_FORMAT', + alignLeft = 'justifyLeft', + alignCenter = 'justifyCenter', + alignRight = 'justifyRight', + alignFull = 'justifyFull', + insertBulletsList = 'unorderedList', + insertOrderedList = 'orderedList', + insertLink = 'INST_LINK', + updateLink = 'UPDATE_LINK', + insertImage = 'INST_IMAGE', + setSubscript = 'subscript', + setSuperscript = 'superscript', + setStrikethrough = 'strikeThrough', + setHR = 'horizontalRule', + setIndent = 'indent', + setOutdent = 'outdent', + setTitlePlaceholder = 'SET_TITLE_PLACEHOLDER', + setContentPlaceholder = 'SET_CONTENT_PLACEHOLDER', + setTitleFocusHandler = 'SET_TITLE_FOCUS_HANDLER', + setContentFocusHandler = 'SET_CONTENT_FOCUS_HANDLER', + prepareInsert = 'PREPARE_INSERT', + restoreSelection = 'RESTORE_SELECTION', + setCustomCSS = 'SET_CUSTOM_CSS', + setTextColor = 'SET_TEXT_COLOR', + setBackgroundColor = 'SET_BACKGROUND_COLOR', + init = 'ZSSS_INIT', + setEditorHeight = 'SET_EDITOR_HEIGHT', + setFooterHeight = 'SET_FOOTER_HEIGHT', + setPlatform = 'SET_PLATFORM' +} + +// RichTextEditor takes the following optional props +export interface RichTextEditorProps { + // HTML that will be rendered in the title section as soon as the component loads. + initialTitleHTML: string; + + // HTML that will be rendered in the content section on load. + initialContentHTML: string; + + // Text that will be used as a placeholder when no text is present in the title section. + titlePlaceholder: string; + + // Text that will be used as a placeholder when no text is present in the content section. + contentPlaceholder: string; + + // Any custom CSS styles that you want to inject to the editor. + customCSS: RichTextStyles; + + // A function that will be called when the editor has been initialized. + editorInitializedCallback: FunctionWithZeroArgs; + + // Hide title + hiddenTitle: boolean; + + enableOnChange: boolean; + + footerHeight: number; + + contentInset: ContentInset; +} + +export interface RichTextToolbarOptionalProps { + // An array of actions to be provided by this toolbar. + actions: ACTIONS[]; + + // Functions called when the addLink or addImage actions are tapped. + onPressAddLink: FunctionWithZeroArgs; + onPressAddImage: FunctionWithZeroArgs; + + selectedButtonStyle: ElementStyles; + unselectedButtonStyle: ElementStyles; + iconTint: string; + selectedIconTint: string; + renderAction: () => ReactNode; + iconMap: IconsMap; +} + +export interface RichTextToolbarProps extends Partial { + // Must provide a function that returns a ref to a RichTextEditor component. + getEditor: () => RichTextEditor; +} + +/* tslint:disable:max-classes-per-file */ +export class RichTextEditor extends Component> { + // RichTextEditor also has methods that can be used on its ref to set styling at the current selection + // or cursor position: + setBold: FunctionWithZeroArgs; + setItalic: FunctionWithZeroArgs; + setUnderline: FunctionWithZeroArgs; + heading1: FunctionWithZeroArgs; + heading2: FunctionWithZeroArgs; + heading3: FunctionWithZeroArgs; + heading4: FunctionWithZeroArgs; + heading5: FunctionWithZeroArgs; + heading6: FunctionWithZeroArgs; + setParagraph: FunctionWithZeroArgs; + removeFormat: FunctionWithZeroArgs; + alignLeft: FunctionWithZeroArgs; + alignCenter: FunctionWithZeroArgs; + alignRight: FunctionWithZeroArgs; + alignFull: FunctionWithZeroArgs; + insertBulletsList: FunctionWithZeroArgs; + insertOrderedList: FunctionWithZeroArgs; + insertLink: LinkHandler; + updateLink: LinkHandler; + insertImage: ImageHandler; + setSubscript: FunctionWithZeroArgs; + setSuperscript: FunctionWithZeroArgs; + setStrikethrough: FunctionWithZeroArgs; + setHR: FunctionWithZeroArgs; + setIndent: FunctionWithZeroArgs; + setOutdent: FunctionWithZeroArgs; + setBackgroundColor: ColorHandler; + setTextColor: ColorHandler; + + // This method shows a dialog for setting a link title and url, that will be inserted at the current cursor location. + showLinkDialog: LinkDialogHandler; + + // To adjust content, placeholders or css, use these methods + setTitlePlaceholder: PlaceHolderHandler; + setContentPlaceholder: PlaceHolderHandler; + setCustomCSS: ContentStylesHandler; + setTitleHTML: ContentSetHandler; + setContentHTML: ContentSetHandler; + + // To manage selection + prepareInsert: FunctionWithZeroArgs; + restoreSelection: FunctionWithZeroArgs; + + // To get the content or title HTML, use these asynchronous methods + getTitleHtml: ContentGetHandler; + getTitleText: ContentGetHandler; + getContentHtml: ContentGetHandler; + getSelectedText: ContentGetHandler; + + // To focus or blur sections, use these methods + focusTitle: FunctionWithZeroArgs; + focusContent: FunctionWithZeroArgs; + blurTitleEditor: FunctionWithZeroArgs; + blurContentEditor: FunctionWithZeroArgs; + + // To know when the title or content are in focus, use the following methods + setTitleFocusHandler: FocusHandler; + setContentFocusHandler: FocusHandler; + + // The callback will be called with an array of actions that are active at the cusor position, + // allowing a toolbar to respond to changes. + registerToolbar: (actions: ACTIONS[]) => void; +} + +// This is a Component that provides a toolbar for easily controlling an editor. +// It is designed to be used together with a RichTextEditor component. +export class RichTextToolbar extends Component> { } +/* tslint:enable:max-classes-per-file */ diff --git a/types/react-native-zss-rich-text-editor/package.json b/types/react-native-zss-rich-text-editor/package.json new file mode 100644 index 0000000000..82d94227ac --- /dev/null +++ b/types/react-native-zss-rich-text-editor/package.json @@ -0,0 +1,5 @@ +{ + "private": true, + "dependencies": { + } +} \ No newline at end of file diff --git a/types/react-native-zss-rich-text-editor/react-native-zss-rich-text-editor-tests.tsx b/types/react-native-zss-rich-text-editor/react-native-zss-rich-text-editor-tests.tsx new file mode 100644 index 0000000000..75d5ed7294 --- /dev/null +++ b/types/react-native-zss-rich-text-editor/react-native-zss-rich-text-editor-tests.tsx @@ -0,0 +1,24 @@ +import * as React from "react"; +import { RichTextEditor } from "react-native-zss-rich-text-editor"; + +interface Props { + value: string; +} + +export class WyswygComponent extends React.Component { + props: Props; + private editorInst: RichTextEditor; + + render() { + const {value} = this.props; + return ; + } + + private readonly saveEditorReference = (ref: RichTextEditor) => { + this.editorInst = ref; + } +} diff --git a/types/react-native-zss-rich-text-editor/tsconfig.json b/types/react-native-zss-rich-text-editor/tsconfig.json new file mode 100644 index 0000000000..08a3b89180 --- /dev/null +++ b/types/react-native-zss-rich-text-editor/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-native-zss-rich-text-editor-tests.tsx" + ] +} diff --git a/types/react-native-zss-rich-text-editor/tslint.json b/types/react-native-zss-rich-text-editor/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-native-zss-rich-text-editor/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From bb68ba492cd905d4b2e54e5427cc092ae9d7d1bf Mon Sep 17 00:00:00 2001 From: rinsuki <428rinsuki+git@gmail.com> Date: Sat, 20 Apr 2019 09:11:20 +0900 Subject: [PATCH 06/14] [cookies] fix Cookies.get return type (#34860) * [cookies] fix Cookies.get return type If not exists cookie, return undefined. * fix tests --- types/cookies/cookies-tests.ts | 6 +++--- types/cookies/index.d.ts | 2 +- types/cookies/tsconfig.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/cookies/cookies-tests.ts b/types/cookies/cookies-tests.ts index cd46e0987b..094357e093 100644 --- a/types/cookies/cookies-tests.ts +++ b/types/cookies/cookies-tests.ts @@ -10,9 +10,9 @@ const server = http.createServer((req, res) => { new Cookies(req, res, {keys: new Keygrip([])}); new Cookies(req, res, {secure: true}); - let unsigned: string; - let signed: string; - let tampered: string; + let unsigned: string | undefined; + let signed: string | undefined; + let tampered: string | undefined; if (req.url === "/set") { cookies diff --git a/types/cookies/index.d.ts b/types/cookies/index.d.ts index 380ce03b7d..eef7bbdc80 100644 --- a/types/cookies/index.d.ts +++ b/types/cookies/index.d.ts @@ -22,7 +22,7 @@ interface Cookies { * Cookie header in the request. If such a cookie exists, * its value is returned. Otherwise, nothing is returned. */ - get(name: string, opts?: Cookies.GetOption): string; + get(name: string, opts?: Cookies.GetOption): string | undefined; /** * This sets the given cookie in the response and returns diff --git a/types/cookies/tsconfig.json b/types/cookies/tsconfig.json index d7a17c23bc..7e8eec6736 100644 --- a/types/cookies/tsconfig.json +++ b/types/cookies/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "cookies-tests.ts" ] -} \ No newline at end of file +} From 6fc535f32e21d8bba99bd02a01720e50946db7e9 Mon Sep 17 00:00:00 2001 From: Jonny Burger Date: Sat, 20 Apr 2019 17:28:10 +0200 Subject: [PATCH 07/14] Remove `type` from `Alert.alert` (#34881) As can be seen from the function signature, the `Alert.alert` function does not accept the `type` argument. --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 9e8e378cf3..1615d54c1b 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -7087,7 +7087,7 @@ interface AlertOptions { * ``` */ export interface AlertStatic { - alert: (title: string, message?: string, buttons?: AlertButton[], options?: AlertOptions, type?: string) => void; + alert: (title: string, message?: string, buttons?: AlertButton[], options?: AlertOptions) => void; } /** From b5846b7489c521034676cf5f25b47558c4d8209a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Sat, 20 Apr 2019 10:19:16 -0700 Subject: [PATCH 08/14] Updated missed node dependent (#34886) --- types/socketio-jwt/socketio-jwt-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/socketio-jwt/socketio-jwt-tests.ts b/types/socketio-jwt/socketio-jwt-tests.ts index 2309d2c8d6..6aa7560dea 100644 --- a/types/socketio-jwt/socketio-jwt-tests.ts +++ b/types/socketio-jwt/socketio-jwt-tests.ts @@ -5,7 +5,7 @@ import { authorize, JwtSecretFuncCallback } from 'socketio-jwt'; const app = http.createServer((req: any, rsp: any) => { fs.readFile(__dirname + '/index.html', - (err: Error, data: any) => { + (err: Error | null, data: any) => { if (err) { rsp.writeHead(500); return rsp.end('Error loading index.html'); From 85ce31ba0eb087a9686f6fdb10d9ea9384c93e01 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sun, 21 Apr 2019 08:39:19 -0700 Subject: [PATCH 09/14] Update CODEOWNERS (#34891) --- .github/CODEOWNERS | 134 +++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 83 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f7ef3b49d2..edfe53460e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -75,6 +75,8 @@ /types/alt/ @Shearerbeard /types/amap-js-api/ @breeze9527 /types/amap-js-api-autocomplete/ @breeze9527 +/types/amap-js-api-city-search/ @breeze9527 +/types/amap-js-api-district-search/ @breeze9527 /types/amap-js-api-geocoder/ @breeze9527 /types/amap-js-api-geolocation/ @breeze9527 /types/amap-js-api-indoor-map/ @breeze9527 @@ -181,7 +183,6 @@ /types/antlr4-autosuggest/ @jonfreedman /types/any-db/ @rogierschouten /types/any-db-transaction/ @rogierschouten -/types/anybar/ @khoomeister /types/anymatch/ @BendingBender /types/aos/ @shermendev /types/apex.js/ @y13i @@ -216,6 +217,7 @@ /types/argv/ @hookclaw /types/arr-diff/ @BendingBender /types/arr-union/ @mrmlnc +/types/array-binarysearch.closest/ @hvoecking /types/array-find-index/ @samverschueren /types/array-foreach/ @skysteve /types/array-sort/ @DanielMSchmidt @@ -266,7 +268,6 @@ /types/auth0-js/v7/ @advancedrei /types/auth0-lock/ @carusology @goldcaddy77 @lfaudreejr @willcaul /types/auth0.widget/ @advancedrei -/types/auto-bind/ @sseppola /types/auto-launch/ @rhysd @unindented /types/auto-sni/ @janwo /types/autobahn/ @darkl @a904guy @valepu @glenroy37 @spcfran @@ -290,6 +291,7 @@ /types/azure/ @AndrewGaspar @antiveeranna @SomaticIT /types/azure-mobile-services-client/ @dmorosinotto /types/azure-sb/ @Azure +/types/b64-lite/ @JasonHK /types/b_/ @outring /types/babel-code-frame/ @mohsen1 /types/babel-core/ @yortus @marvinhagemeister @@ -351,7 +353,6 @@ /types/bdfjs/ @jeremejevs /types/beats/ @urish /types/bech32/ @micksatana -/types/beeper/ @BendingBender /types/behavior3/ @carrrywu /types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly @@ -370,7 +371,6 @@ /types/bignum/ @Patman64 /types/bigscreen/ @dduugg /types/bin-pack/ @orentrutner -/types/bin-version/ @BendingBender /types/binary-parser/ @riggs @dolanmiu @yuhr /types/binaryextensions/ @BendingBender /types/bind-ponyfill/ @skysteve @@ -426,6 +426,7 @@ /types/bootstrap-fileinput/ @CheCoxshall /types/bootstrap-growl-ifightcrime/ @AndersonFriaca /types/bootstrap-maxlength/ @danmana +/types/bootstrap-menu/ @superheri /types/bootstrap-notify/ @niemyjski @mouse0270 @robert-voica /types/bootstrap-select/ @LKay /types/bootstrap-slider/ @dbeckwith @leonard-thieu @@ -478,7 +479,6 @@ /types/buffers/ @rhencke /types/bufferstream/ @Bartvds /types/build-output-script/ @BendingBender -/types/builtin-modules/ @ajafff /types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana @kjellmorten @pc-jedi @lenovouser /types/bull/v2/ @bgrieder @JProgrammer /types/bump-regex/ @silkentrance @@ -508,10 +508,8 @@ /types/cal-heatmap/ @RetroChrisB /types/caller/ @ignocide /types/callsite/ @newclear -/types/callsites/ @BendingBender /types/calq/ @eirikhm /types/camaro/ @tuananh -/types/camelcase-keys/ @mhegazy /types/camljs/ @andrei-markeev /types/camo/ @lucasmciruzzi /types/cancan/ @Vincent-Pang @@ -594,7 +592,7 @@ /types/chownr/ @BendingBender /types/chroma-js/ @invliD @mpacholec /types/chroma-js/v0/ @invliD -/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 @MatCarlson +/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 @MatCarlson @ekinsol /types/chrome-apps/ @niikoo @AdamLay @pine613 @mzsm @RReverser @pyle @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 /types/chromecast-caf-receiver/ @craigrbruce /types/chromecast-caf-sender/ @samuelmaddock @@ -615,17 +613,13 @@ /types/clean-css/ @tkrotoff @GolaWaya /types/clean-css/v3/ @tkrotoff /types/clean-regexp/ @BendingBender -/types/clean-stack/ @BendingBender -/types/clear-require/ @dan-j /types/clearbladejs-client/ @ClearBlade /types/clearbladejs-node/ @ClearBlade /types/clearbladejs-server/ @ClearBlade /types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun /types/cli/ @kayahr /types/cli-box/ @athasach -/types/cli-boxes/ @BendingBender /types/cli-color/ @ChaosinaCan -/types/cli-cursor/ @BendingBender /types/cli-interact/ @ffflorian /types/cli-progress/ @mhegazy /types/cli-spinner/ @janslow @@ -638,7 +632,6 @@ /types/cliff/ @brynbellomy /types/clipboard/ @impworks /types/clipboard-js/ @markwongsk -/types/clipboardy/ @BendingBender /types/clmtrackr/ @hellochar /types/clndr/ @jasperjn /types/clockpicker/ @jfcere @@ -669,6 +662,7 @@ /types/color/v2/ @Airlun /types/color/v1/ @LKay /types/color/v0/ @LKay +/types/color-check/ @ecraig12345 /types/color-convert/ @Airlun /types/color-diff/ @katsanva /types/color-name/ @Ailrun @@ -709,9 +703,9 @@ /types/compression-webpack-plugin/ @dublicator @rhys-vdw /types/compute-quantile/ @mrmlnc /types/compute-stdev/ @mrmlnc +/types/concat-map/ @claasahl /types/concat-stream/ @jmarianer /types/concaveman/ @DenisCarriere -/types/condense-whitespace/ @djcsdy /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez /types/config-yaml/ @Arylo @@ -746,13 +740,12 @@ /types/contentful-resolve-response/ @antonkarsten /types/contextjs/ @kernhanda /types/continuation-local-storage/ @rath @heycalmdown @aboveyou00 -/types/convert-hrtime/ @BendingBender /types/convert-layout/ @xeningem /types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 /types/convict/ @Nemo157 @vesse @elyscape @vanthiyathevan /types/cookie/ @pine /types/cookie-parser/ @santialbo @BendingBender -/types/cookie-session/ @borislavjivkov +/types/cookie-session/ @borislavjivkov @btomw /types/cookie-signature/ @lith-light-g /types/cookie_js/ @slawiko /types/cookiejar/ @paroxp @@ -808,7 +801,6 @@ /types/create-error/ @tkrotoff /types/create-hash/ @BendingBender /types/create-hmac/ @BendingBender -/types/create-html-element/ @BendingBender /types/create-react-class/ @jgoz /types/create-subscription/ @Asana @vsiao /types/create-xpub/ @BendingBender @@ -826,9 +818,7 @@ /types/crpc/ @0xdeafcafe /types/crumb/ @lenovouser @SimonSchick /types/cryptiles/ @awendland -/types/crypto-hash/ @BendingBender /types/crypto-js/ @misak113 -/types/crypto-random-string/ @MrManny /types/cryptojs/ @giabao /types/cryptr/ @rrogowski /types/cson/ @stpettersens @@ -863,7 +853,6 @@ /types/cwise-compiler/ @taoqf /types/cwise-parser/ @taoqf /types/cybozulabs-md5/ @pine613 -/types/cycled/ @BendingBender /types/cypress-axe/ @wKovacs64 /types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas @cerberuser /types/d/ @BendingBender @@ -920,7 +909,6 @@ /types/dagre/ @qinfchen @Frankrike @vilterp @rustedgrail /types/dagre-d3/ @markwongsk /types/dagre-layout/ @qinfchen @Frankrike @vilterp -/types/dargs/ @BendingBender /types/dashify/ @rokt33r /types/dat.gui/ @gyohk @sonic3d @rroylance @singuerinc /types/data-driven/ @mrhen @@ -953,7 +941,6 @@ /types/deasync/ @Sicilica /types/debessmann/ @vkorehov /types/debounce/ @denis-sokolov @joshuakgoldberg @wcarson -/types/debounce-fn/ @BendingBender /types/debounce-promise/ @whtsky /types/debug/ @swook @galtalmor @zamb3zi @brasten @npenin @kristianmitk /types/decay/ @enaeseth @@ -970,11 +957,11 @@ /types/deep-freeze/ @Bartvds @aluanhaddad /types/deep-freeze-es6/ @mattbishop /types/deep-freeze-strict/ @mhegazy +/types/deezer-sdk/ @marco-eckstein /types/default-gateway/ @BendingBender /types/defaults/ @IbtihelCHNAB /types/defaults-deep/ @Kocal /types/defer-promise/ @niklasf -/types/define-lazy-prop/ @BendingBender /types/defined/ @BendingBender /types/deglob/ @saadq /types/deku/ @pocka @@ -998,7 +985,6 @@ /types/detect-indent/ @Bartvds @BendingBender /types/detect-indent/v0/ @Bartvds /types/detect-it/ @thomastilkema -/types/detect-newline/ @BendingBender /types/detect-node/ @LogvinovLeon /types/detect-passive-events/ @thomastilkema /types/detect-pointer/ @thomastilkema @@ -1061,8 +1047,6 @@ /types/dookie/ @swanest /types/dot/ @ZombieHunter /types/dot-object/ @nkovacic -/types/dot-prop/ @samverschueren @BendingBender -/types/dot-prop/v2/ @samverschueren /types/dotdir-regex/ @mrmlnc /types/dotdotdot/ @milanjaros /types/dotenv/ @jussikinnula @borekb @enaeseth @maxbeatty @@ -1124,6 +1108,7 @@ /types/ecurve/ @mhegazy /types/ed25519/ @erikma /types/ed2curve/ @ffflorian +/types/edmonds-blossom/ @johnridesabike /types/ee-first/ @BendingBender /types/egg-mock/ @sheperdwind /types/egg.js/ @ToastHawaii @@ -1134,10 +1119,7 @@ /types/ejs-locals/ @jt000 /types/ejson/ @shantanubhadoria /types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan -/types/electron-config/ @mrfunkycold @unindented -/types/electron-debug/ @unindented /types/electron-devtools-installer/ @gamesmaxed @mfatihmar -/types/electron-is-dev/ @trodi /types/electron-json-storage/ @stpettersens @nrlquaker @jbw91 /types/electron-load-devtool/ @prince0203 /types/electron-notifications/ @djpereira @@ -1146,12 +1128,8 @@ /types/electron-settings/ @icopp @nrlquaker /types/electron-settings/v2/ @leonard-thieu /types/electron-spellchecker/ @unindented -/types/electron-store/ @unindented @jsynowiec -/types/electron-unhandled/ @jeremejevs -/types/electron-util/ @kputh /types/electron-window-state/ @rhysd /types/electron-winstaller/ @shiftkey @unindented -/types/elegant-spinner/ @danwbyrne /types/element-resize-detector/ @saranshkataria @franklixuefei /types/element-resize-event/ @rogierschouten @plgregoire /types/elementtree/ @dwieeb @@ -1199,7 +1177,6 @@ /types/emojione/ @dbrgn /types/empower/ @vvakame /types/empty-dir/ @BendingBender -/types/empty-trash/ @BendingBender /types/emscripten/ @zakki @periklis /types/encodeurl/ @BendingBender /types/encoding-down/ @MeirionHughes @danwbyrne @@ -1240,7 +1217,6 @@ /types/escape-html/ @elisee /types/escape-latex/ @olsio /types/escape-regexp/ @jewbre -/types/escape-string-regexp/ @kruncher @faergeek /types/escodegen/ @simondel /types/eslint/ @pmdartus @j-f1 @saadq /types/eslint-plugin-prettier/ @ikatyang @@ -1440,10 +1416,8 @@ /types/figures/ @BendingBender /types/file-exists/ @BendingBender /types/file-saver/ @cyrilschumacher @DaIgeb @chrismbarr -/types/file-url/ @coderslagoon /types/filesize/ @GiedriusGrabauskas @renchap @Ky6uk @ffxsam /types/fill-pdf/ @westy92 -/types/filter-console/ @BendingBender /types/filter-invalid-dom-props/ @icopp /types/finalhandler/ @chrootsu @hbomark /types/finch/ @DavidSichau @@ -1457,7 +1431,6 @@ /types/find-project-root/ @ikatyang /types/find-root/ @Alorel /types/find-up/ @BendingBender -/types/find-versions/ @LogvinovLeon @carnesen /types/findup-sync/ @Bartvds @ngbrown @BendingBender /types/findup-sync/v0/ @Bartvds @ngbrown /types/fined/ @BendingBender @@ -1471,7 +1444,6 @@ /types/firefox-webext-browser/ @jsmnbom /types/firmata/ @troywweber7 /types/first-mate/ @GlenCFL -/types/first-run/ @BendingBender /types/fixed-data-table/ @pepaar @stephenjelfs /types/fixed-data-table-2/ @ilivit /types/flagged-respawn/ @BendingBender @@ -1727,19 +1699,17 @@ /types/gestalt/ @serranoarevalo @joshgachnang /types/get-caller-file/ @ajafff /types/get-certain/ @BendingBender -/types/get-emails/ @BendingBender /types/get-emoji/ @BendingBender /types/get-folder-size/ @mszczepanczyk /types/get-func-name/ @BendingBender /types/get-node-dimensions/ @vincekovacs /types/get-range/ @BendingBender /types/get-res/ @satyarohith -/types/get-stdin/ @DanielRosenwasser -/types/get-urls/ @BendingBender /types/get-value/ @DanielRosenwasser @TheMallen /types/getenv/ @impankratov /types/getopts/ @azasypkin /types/getos/ @BendingBender +/types/getpass/ @claasahl /types/gettext.js/ @jucrouzet /types/gfc/ @BendingBender /types/gh-pages/ @DanielRosenwasser @@ -1753,7 +1723,6 @@ /types/git-branch/ @rynclark /types/git-config/ @stpettersens /types/git-config-path/ @BendingBender -/types/git-remote-origin-url/ @janslow /types/git-repo-name/ @BendingBender /types/git-rev-sync/ @khoi-fish /types/git-root-dir/ @ffflorian @@ -1763,7 +1732,6 @@ /types/git-username/ @BendingBender /types/gitconfiglocal/ @ffflorian /types/github-url-to-object/ @ajafff -/types/github-username/ @BendingBender /types/github-username-regex/ @BehindTheMath /types/gl/ @sjx233 /types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz @@ -1825,7 +1793,7 @@ /types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm @captain-igloo /types/googlemaps.infobubble/ @Dashue /types/googlepay/ @Fluccioni @Radu-Raicea @fstanis -/types/got/ @BendingBender @LinusU @ikokostya @stijnvn +/types/got/ @BendingBender @LinusU @ikokostya @stijnvn @wingsbob /types/got/v8/ @BendingBender @LinusU @ikokostya /types/graceful-fs/ @Bartvds @BendingBender /types/graceful-fs/v2/ @Bartvds @@ -1849,10 +1817,10 @@ /types/graphql-resolve-batch/ @nayni /types/graphql-resolvers/ @mike-engel /types/graphql-type-json/ @schfkt +/types/graphql-type-uuid/ @runk /types/graphviz/ @mhfrantz /types/grasp/ @agnoster /types/gravatar/ @denis-sokolov -/types/gravatar-url/ @ivangabriele /types/greasemonkey/ @kotas @nikolay-borzov /types/greasemonkey/v3/ @kotas /types/grecaptcha/ @DethAriel @rafaeltavares @@ -1937,6 +1905,7 @@ /types/gulp-sort/ @joeskeen /types/gulp-strip-comments/ @Aqours /types/gulp-strip-debug/ @peterjuras +/types/gulp-stylus/ @TokugawaTakesi /types/gulp-svg-sprite/ @tkqubo /types/gulp-svgmin/ @Aankhen /types/gulp-tap/ @TokugawaTakesi @@ -1951,8 +1920,6 @@ /types/gun/ @Jack-Works /types/gyronorm/ @evanshortiss /types/gzip-js/ @rhysd -/types/gzip-size/ @plantain-00 @jimivdw @andrewiggins -/types/gzip-size/v3/ @plantain-00 /types/h2o2/ @jasonswearingen @AJamesPhillips @garthk /types/halfred/ @dherges /types/halogen/ @steller @@ -1994,7 +1961,6 @@ /types/hard-source-webpack-plugin/ @woitechen /types/harmony-proxy/ @remojansen /types/has-ansi/ @BendingBender -/types/has-emoji/ @BendingBender /types/hash-file/ @HiromiShikata /types/hash-stream/ @BendingBender /types/hash-sum/ @DanielRosenwasser @@ -2018,7 +1984,6 @@ /types/heredatalens/ @denyo /types/heremaps/ @Josh-ES @denyo @fx88 /types/heroku-logger/ @kylevogt -/types/hex-rgb/ @BendingBender /types/hex-rgba/ @r3nya /types/hexo/ @kentarouTakeda /types/hexo-bunyan/ @segayuu @@ -2084,6 +2049,7 @@ /types/hubot/ @dirk @KeesCBakker @eeemil /types/hubspot-pace/ @borislavjivkov /types/humane/ @jmvrbanac +/types/humanize-duration/ @RigoTheDev /types/humanize-ms/ @adamzerella /types/humanize-plus/ @DenisCarriere /types/humanize-url/ @BendingBender @@ -2143,7 +2109,6 @@ /types/impress/ @borisyankov /types/imul/ @djcsdy /types/in-app-purchase/ @l-jonas @IchordeDionysos -/types/in-range/ @DanielRosenwasser /types/inboxsdk/ @rdoursenaud @amiram /types/incremental-dom/ @basarat @lanthaler @vvakame /types/indefinite/ @omaishr @@ -2530,7 +2495,7 @@ /types/json-socket/ @svi3c /types/json-stable-stringify/ @mhfrantz /types/json-stringify-safe/ @BendingBender -/types/json2csv/ @juanjoDiaz +/types/json2csv/ @juanjoDiaz @dangoo /types/json2md/ @MartynasZilinskas /types/json2mq/ @ZhangYiJiang /types/json3/ @NN--- @@ -2735,12 +2700,12 @@ /types/launchpad/ @rictic /types/layzr.js/ @shermendev /types/lazy-value/ @ikatyang -/types/lazy.js/ @Bartvds @miso440 +/types/lazy.js/ @Bartvds @miso440 @gablorquet /types/lazypipe/ @tomc974 /types/ldap-filters/ @pluma /types/ldapjs/ @cvillemure @peterkooijmans @pmoleri /types/leadfoot/ @theintern -/types/leaflet/ @alejo90 @atd-schubert @mcauer @ronikar +/types/leaflet/ @alejo90 @atd-schubert @mcauer @ronikar @sanfrisc /types/leaflet/v0/ @rgripper /types/leaflet-areaselect/ @awallat /types/leaflet-curve/ @onikiienko @@ -2827,7 +2792,6 @@ /types/localized-countries/ @coderslagoon /types/localizejs-library/ @salbahra /types/localtunnel/ @vladhrapov -/types/locate-path/ @me /types/lock-system/ @BendingBender /types/lockfile/ @Bartvds @BendingBender /types/lockfile/v0/ @Bartvds @@ -3328,6 +3292,7 @@ /types/minimist-options/ @ikatyang /types/minio/ @barinbritva @castorw @loremaps @OutdatedVersion /types/minipass/ @BendingBender +/types/miniprogram-wxs/ @NewFuture @wechat-miniprogram-admin /types/mirrorx/ @aaronphy /types/mithril/ @spacejack @andraaspar @isiahmeadows /types/mithril-global/ @spacejack @isiahmeadows @@ -3378,7 +3343,7 @@ /types/moment-timezone/ @michelsalib @alanblins @asermax @borys-kupar /types/money-math/ @taoqf /types/mongo-sanitize/ @CedricCazin @penumbra1 -/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi @various89 @angela-1 @lirbank @hector7 @floric @erikc5000 @Manc +/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi @various89 @angela-1 @lirbank @hector7 @floric @erikc5000 @Manc @jloveridge /types/mongodb/v2/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi /types/mongodb-memory-server/ @dmitryrogozhny /types/mongodb-uri/ @mernxl @@ -3575,6 +3540,7 @@ /types/node-jsfl-runner/ @mrand01 /types/node-json-db/ @kuzn-ilya /types/node-localstorage/ @intolerance +/types/node-mailjet/ @Nikola-Andreev /types/node-memwatch/ @Kroisse /types/node-mysql-wrapper/ @kataras /types/node-notifier/ @tkQubo @loryman @@ -3582,7 +3548,7 @@ /types/node-powershell/ @rodrigoff /types/node-pushnotifications/ @menushka /types/node-ral/ @ssddi456 -/types/node-red/ @andersea @tbowmo +/types/node-red/ @andersea @tbowmo @bernardobelchior /types/node-redis-pubsub/ @renekeijzer /types/node-resque/ @gordey4doronin /types/node-rsa/ @alitaheri @xm @ffflorian @@ -3613,7 +3579,7 @@ /types/nodemailer/ @rogierschouten @dex4er @bioball /types/nodemailer/v3/ @rogierschouten /types/nodemailer-direct-transport/ @rogierschouten -/types/nodemailer-mailgun-transport/ @otociulis +/types/nodemailer-mailgun-transport/ @otociulis @calvinmcgee /types/nodemailer-pickup-transport/ @psnider /types/nodemailer-ses-transport/ @westy92 /types/nodemailer-smtp-pool/ @rogierschouten @@ -3681,6 +3647,8 @@ /types/object-path/ @pocesar @BendingBender /types/object-refs/ @3fd /types/object.getownpropertydescriptors/ @VitorLuizC +/types/object.omit/ @ifiokjr +/types/object.pick/ @ifiokjr /types/oblo-util/ @Oblosys /types/oboe/ @optical /types/observe-js/ @herrmanno @@ -3914,7 +3882,6 @@ /types/piwik-tracker/ @lbguilherme /types/pixelmatch/ @iamolegga /types/pixi.js/ @clark-stevenson -/types/pkg-up/ @forivall /types/pkgcloud/ @dantman /types/pkijs/ @microshine /types/platform/ @JakeH @@ -3927,7 +3894,6 @@ /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann -/types/plur/ @iRoachie /types/pluralize/ @ukyo @karol-majewski /types/plurals-cldr/ @ChaosinaCan /types/png.js/ @ffflorian @@ -3935,6 +3901,7 @@ /types/pngquant-bin/ @hikoma /types/podcast/ @nikeee /types/podium/ @AJamesPhillips +/types/poi/ @bolasblack /types/point-in-polygon/ @dyst5422 @kogai /types/pollyjs__adapter/ @feinoujc /types/pollyjs__adapter-fetch/ @feinoujc @@ -3993,7 +3960,7 @@ /types/prefixfree/ @ExE-Boss /types/preloadjs/ @endel /types/prelude-ls/ @AyaMorisawa -/types/prettier/ @ikatyang +/types/prettier/ @ikatyang @ifiokjr /types/pretty/ @adamzerella /types/pretty-bytes/ @plantain-00 @danielasy /types/pretty-bytes/v4/ @plantain-00 @@ -4123,15 +4090,10 @@ /types/radius/ @codeanimal /types/radix64/ @huan086 /types/raf/ @BenLorantfy -/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm @drewwyatt @jottenlips @minitesh @krantisinh @pirix-gh +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @deftomat @deptno @blimusiek @biern @rayhaneh @rgm @drewwyatt @jottenlips @minitesh @krantisinh @pirix-gh /types/random-boolean/ @BendingBender -/types/random-float/ @BendingBender -/types/random-int/ @BendingBender -/types/random-item/ @BendingBender /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev -/types/random-obj-key/ @BendingBender -/types/random-obj-prop/ @BendingBender /types/random-seed/ @endel /types/random-string/ @stpettersens /types/randoma/ @BendingBender @@ -4190,6 +4152,7 @@ /types/react-avatar-editor/ @diogocorrea @gabsprates @lsenta @davidspiess /types/react-axe/ @akshaykarthik /types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen @enricoboccadifuoco @lonyele @lukyth +/types/react-beautiful-dnd/v10/ @varHarrie @bradleyayers @paustint @marknelissen @enricoboccadifuoco @lonyele @lukyth /types/react-better-password/ @mhuynh1 /types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly @janb87 @ldthorne @siavelis @TomasHubelbauer @lksilva /types/react-blessed/ @guoshencheng @@ -4223,7 +4186,7 @@ /types/react-copy-write/ @samhh @davej /types/react-countup/ @danielbrodin /types/react-credit-cards/ @vstrimaitis @olefrank @zzanol -/types/react-cropper/ @stepancar +/types/react-cropper/ @stepancar @bwlt /types/react-css-collapse/ @dford07 /types/react-css-modules/ @KostyaEsmukov @skirsdeda /types/react-css-transition-replace/ @LKay @@ -4277,6 +4240,7 @@ /types/react-frontload/ @rockon404 /types/react-gateway/ @jsonunger /types/react-geosuggest/ @brmenchl +/types/react-github-button/ @ifiokjr /types/react-global-configuration/ @ryokik /types/react-google-login-component/ @koss-lebedev /types/react-google-maps-loader/ @vasilysn @@ -4295,8 +4259,10 @@ /types/react-highcharts/ @j1r1k /types/react-highlight/ @joshuakgoldberg /types/react-highlight-words/ @mhegazy @diogodca @kellyrmilligan +/types/react-highlight.js/ @ChristianMurphy /types/react-highlighter/ @oizie /types/react-holder/ @isman-usoh +/types/react-hooks-helper/ @jedmundo /types/react-hot-loader/ @jacekjagiello @MartynasZilinskas @DovydasNavickas /types/react-howler/ @maksimovicdanijel /types/react-hyperscript/ @tock203 @@ -4338,6 +4304,7 @@ /types/react-leaflet/ @danzel @davschne @yuit /types/react-leaflet/v1/ @danzel @davschne @yuit /types/react-leaflet-markercluster/ @Kimahriman +/types/react-leaflet-sidebarv2/ @vikram-gsu /types/react-lifecycle-component/ @pixelshaded /types/react-lifecycles-compat/ @bySabi /types/react-linkify/ @majames @jackywang529 @@ -4360,8 +4327,9 @@ /types/react-motion-loop/ @j-em /types/react-motion-slider/ @asvetliakov /types/react-motion-ui-pack/ @jsonunger -/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel @souvik-ghosh @nossbigg @saranshkataria @franzmoro +/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel @souvik-ghosh @nossbigg @saranshkataria @franzmoro @tykus160 /types/react-native-android-taskdescription/ @christianchown +/types/react-native-app-link/ @johngeorgewright /types/react-native-auth0/ @ascariandrea @marknelissen /types/react-native-autocomplete-input/ @ifiokjr /types/react-native-background-timer/ @chillkroeteTTS @@ -4375,6 +4343,7 @@ /types/react-native-dialogflow/ @jasonmerino /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 +/types/react-native-dotenv/ @hmajid2301 /types/react-native-draggable-flatlist/ @stackbuilders @ibarrae /types/react-native-drawer/ @jnbt @suniahk /types/react-native-drawer-layout/ @jmfirth @@ -4419,7 +4388,7 @@ /types/react-native-safari-view/ @mrand01 /types/react-native-safe-area/ @pvinis /types/react-native-scaled-image/ @Jaeger25 -/types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga +/types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga @ydostyle /types/react-native-sensor-manager/ @SahinVardar /types/react-native-settings-list/ @MrLuje /types/react-native-share/ @marknelissen @@ -4445,6 +4414,7 @@ /types/react-native-video/ @huhuanming /types/react-native-view-pdf/ @thesergiomiguel /types/react-native-zeroconf/ @mattapet +/types/react-native-zss-rich-text-editor/ @naveen-ithappu /types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway @denissb @skovhus @azrosen92 @hmajid2301 /types/react-navigation/v2/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway /types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @@ -4577,6 +4547,7 @@ /types/react-treeview/ @janslow /types/react-truncate/ @mattvperry /types/react-twitter-auth/ @paulfasola @loginwashere +/types/react-typist/ @shawnkoon /types/react-ultimate-pagination/ @BenLorantfy /types/react-user-tour/ @ccancellieri /types/react-vertical-timeline-component/ @stephane-monnot @@ -4585,7 +4556,7 @@ /types/react-virtualized-auto-sizer/ @otofu-square /types/react-virtualized-select/ @seansfkelley /types/react-visibility-sensor/ @JRasmusBm @gcangussu -/types/react-webcam/ @squat +/types/react-webcam/ @squat @englund92 /types/react-weui/ @tairan /types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz @georg94 @tzarger @vegtelenseg /types/react-widgets-moment/ @dawnmist @@ -4673,6 +4644,7 @@ /types/redux-promise-middleware/ @ianks /types/redux-recycle/ @LKay /types/redux-router/ @stepancar +/types/redux-saga-routines/ @alexey-pelykh /types/redux-saga-tester/ @BenLorantfy @lawsumisu /types/redux-seamless-immutable/ @SoaresMG /types/redux-sentry-middleware/ @dolezel @@ -4695,6 +4667,7 @@ /types/ref-union-di/ @keerthi16 @KiranNiranjan /types/reflux/ @mauricedb @LiangZugeng /types/reflux/v0/ @mauricedb +/types/refractor/ @ifiokjr /types/registry-auth-token/ @mauricedb @LiangZugeng /types/regression/ @MattiasMartens /types/rehype-react/ @adriankremer @@ -4702,7 +4675,7 @@ /types/relaxed-json/ @18steps /types/relay-runtime/ @voxmatt @alloy /types/rellax/ @shermendev -/types/remarkable/ @makepost @chigix +/types/remarkable/ @makepost @chigix @bios21 /types/remote-origin-url/ @BendingBender /types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker /types/remotedev-serialize/ @jaulz @@ -4737,9 +4710,6 @@ /types/resize-observer-browser/ @chivesrs /types/resolve/ @marionebl @ajafff /types/resolve-cwd/ @BendingBender -/types/resolve-from/ @unional @BendingBender -/types/resolve-from/v2/ @unional -/types/resolve-global/ @BendingBender /types/resolve-options/ @delprzemo /types/resolve-pkg/ @mabels @BendingBender /types/resourcejs/ @shaunluttin @@ -4775,6 +4745,7 @@ /types/rickshaw/ @niemyjski /types/right-align/ @claasahl /types/rimraf/ @soywiz @e-cloud @bash +/types/ringbufferjs/ @amchelle /types/riot/ @Stubb0rn /types/riot-api-nodejs/ @zafixlrp /types/riot-games-api/ @xstoudi @@ -4799,7 +4770,6 @@ /types/rollup-plugin-json/ @asmockler @hotell /types/rollup-plugin-node-builtins/ @Kocal /types/rollup-plugin-node-globals/ @kocal -/types/rollup-plugin-node-resolve/ @eoin-obrien /types/rollup-plugin-sourcemaps/ @eoin-obrien /types/roman-numerals/ @pluma /types/ronomon__crypto-async/ @BendingBender @@ -4997,7 +4967,7 @@ /types/sheetify/ @toddself /types/shell-escape/ @nenadalm /types/shell-quote/ @jason0x43 @CameronDiver -/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu @ExE-Boss +/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu @ExE-Boss @msanguineti /types/shelljs-exec-proxy/ @qlonik /types/shimmer/ @kjin /types/shipit-cli/ @cyrilschumacher @@ -5206,7 +5176,7 @@ /types/storybook__addon-centered/ @kiyopikko /types/storybook__addon-info/ @mkornblum @fyrkant @RunningCoderLee /types/storybook__addon-jest/ @halfmatthalfcat -/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay @MLoughry @alanhchoi +/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay @MLoughry @alanhchoi @azmenak /types/storybook__addon-links/ @joscha @jessepinho /types/storybook__addon-options/ @joscha @simonhn @amacleay @gaetanmaisse @adam187 /types/storybook__addon-storyshots/ @bradleyayers @@ -5404,6 +5374,7 @@ /types/throng/ @cyrilschumacher @tatethurston /types/throttle/ @BendingBender /types/throttle-debounce/ @czbuchi @franklixuefei @oddsund +/types/throttleit/ @ifiokjr /types/through/ @AndrewGaspar /types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 @Alorel /types/through2/v0/ @Bartvds @jedmao @@ -5484,6 +5455,7 @@ /types/trusted-types/ @vrana @engelsdamien /types/tryer/ @bengry /types/ts-nameof/ @dsherret +/types/ts3-nodejs-library/ @P4sca1 @Multivit4min /types/tspromise/ @soywiz /types/ttf2woff2/ @ThomasdenH /types/tunnel/ @BendingBender @@ -5550,8 +5522,6 @@ /types/uniqid/ @idchlife /types/unique-hash-stream/ @BendingBender /types/unique-push-id/ @namick -/types/unique-random/ @Kuniwak -/types/unique-random-array/ @BendingBender /types/unique-string/ @BendingBender /types/unist/ @bizen241 @lujun2 @hrajchert @wooorm @rokt33r /types/unist-util-is/ @rokt33r @@ -5570,7 +5540,7 @@ /types/uppercamelcase/ @plantain-00 /types/urbanairship-cordova/ @Justin-Credible /types/uri-templates/ @Bartvds @barnski -/types/urijs/ @RodneyJT @xt0rted @petejohanson +/types/urijs/ @RodneyJT @xt0rted @petejohanson @ljqx /types/uritemplate/ @teyc @rubensworks /types/urix/ @BendingBender /types/url-assembler/ @wolfgang42 @@ -5824,7 +5794,6 @@ /types/wrench/ @soywiz /types/write-file-atomic/ @BendingBender /types/write-file-atomically/ @Aankhen -/types/write-json-file/ @DenisCarriere /types/write-pkg/ @azasypkin /types/ws/ @loyd @elithrar @mlamp @TitaneBoy @orblazer /types/wtfnode/ @dex4er @@ -5839,7 +5808,6 @@ /types/xml-parser/ @mhfrantz /types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath @claasahl @redlickigrzegorz /types/xml2json/ @dolanmiu -/types/xmlbuilder/ @wallymathieu @GaikwadPratik /types/xmldoc/ @Xstoudi @ajsheehan @notlaforge /types/xmldom/ @tkqubo /types/xmlpoke/ @garthk From d5e4a8e1e4513c31d3296a22ee11cc437a7eb286 Mon Sep 17 00:00:00 2001 From: Dmitri Dimitrioglo Date: Sun, 21 Apr 2019 20:39:17 +0300 Subject: [PATCH 10/14] [Square connect] Upgrade to v2.20190410 (#34893) --- types/square-connect/index.d.ts | 906 ++++++++++++++++++-------------- 1 file changed, 507 insertions(+), 399 deletions(-) diff --git a/types/square-connect/index.d.ts b/types/square-connect/index.d.ts index c017dbee94..f36d105b15 100644 --- a/types/square-connect/index.d.ts +++ b/types/square-connect/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for square-connect 2.20190313 +// Type definitions for square-connect 2.20190410 // Project: https://docs.connect.squareup.com/ // Definitions by: Dmitri Dimitrioglo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 /** - * @version Square Connect API v20190313 + * @version Square Connect API v20190410 * @note: This class is MOSTLY generated by the swagger code generator program. * @link https://github.com/swagger-api/swagger-codegen.git */ @@ -147,7 +147,7 @@ export class Address { */ postal_code?: string; /** - * The address's country, in ISO 3166-1-alpha-2 format. + * The address's country, in ISO 3166-1-alpha-2 format. See [Country](#type-country) for possible values */ country?: Address.CountryEnum; /** @@ -622,8 +622,7 @@ export class BatchRetrieveOrdersRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [BatchRetrieveOrders](#endpoint-batchretrieveorders) endpoint. + * Defines the fields that are included in the response body of a request to the BatchRetrieveOrders endpoint. */ export class BatchRetrieveOrdersResponse { /** @@ -744,7 +743,7 @@ export class Card { */ id?: string; /** - * The card's brand (such as `VISA`). See [CardBrand](#type-cardbrand) for all possible values. + * The card's brand (such as `VISA`). See [CardBrand](#type-cardbrand) for possible values. */ card_brand?: Card.CardBrandEnum; /** @@ -812,8 +811,8 @@ export class CatalogDiscount { */ name?: string; /** - * Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale. See - * [CatalogDiscountType](#type-catalogdiscounttype) for all possible values. + * Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale. + * See [CatalogDiscountType](#type-catalogdiscounttype) for possible values. */ discount_type?: CatalogDiscount.DiscountTypeEnum; /** @@ -865,6 +864,24 @@ export class CatalogIdMapping { object_id?: string; } +/** + * An image file to use in Square catalogs. Can be associated with catalog items, item variations, and categories. + */ +export class CatalogImage { + /** + * The internal name of this image. Identifies this image in calls to the Connect APIs. + */ + name?: string; + /** + * The URL of this image. Generated by Square after an image is uploaded to the CreateCatalogImage endpoint. + */ + url?: string; + /** + * A caption that describes what is shown in the image. Displayed in the Square Online Store. + */ + caption?: string; +} + export class CatalogInfoRequest {} export class CatalogInfoResponseLimits { @@ -971,12 +988,12 @@ export class CatalogItem { /** * A set of [CatalogItemModifierListInfo](#type-catalogitemmodifierlistinfo) objects representing the modifier lists * that apply to this item, along with the overrides and min and max limits that are specific to this item. - * [CatalogModifierList](#type-catalogmodifierlist)s may also be added to or deleted from an item using - * `UpdateItemModifierLists`. + * [CatalogModifierList](#type-catalogmodifierlist)s may also be added to or deleted from an item using `UpdateItemModifierLists`. */ modifier_list_info?: Array; /** * The URL of an image representing this item. + * @deprecated Deprecated in favor of `image_id` in [`CatalogObject`](#type-catalogobject). */ image_url?: string; /** @@ -987,15 +1004,15 @@ export class CatalogItem { /** * The product type of the item. May not be changed once an item has been created. * Only items of product type `REGULAR` may be created by this API; items with other product types are read-only. - * See [CatalogItemProductType](#type-catalogitemproducttype) for all possible values. + * See [CatalogItemProductType](#type-catalogitemproducttype) for possible values. */ product_type?: CatalogItem.ProductTypeEnum; /** - * If `false`, the Square Point of Sale app will present the [CatalogItem](#type-catalogitem)'s details screen - * immediately, allowing the merchant to choose [CatalogModifier](#type-catalogmodifier)s before adding the item to - * the cart. This is the default behavior. If `true`, the Square Point of Sale app will immediately add the item - * to the cart with the pre-selected modifiers, and merchants can edit modifiers by drilling down onto the item's - * details. Third-party clients are encouraged to implement similar behaviors. + * If `false`, the Square Point of Sale app will present the [CatalogItem](#type-catalogitem)'s details screen immediately, + * allowing the merchant to choose [CatalogModifier](#type-catalogmodifier)s before adding the item to the cart. + * This is the default behavior. If `true`, the Square Point of Sale app will immediately add the item to the cart + * with the pre-selected modifiers, and merchants can edit modifiers by drilling down onto the item's details. + * Third-party clients are encouraged to implement similar behaviors. */ skip_modifier_screen?: boolean; } @@ -1074,8 +1091,8 @@ export class CatalogItemVariation { */ ordinal?: number; /** - * Indicates whether the item variation's price is fixed or determined at the time of sale. See - * [CatalogPricingType](#type-catalogpricingtype) for all possible values. + * Indicates whether the item variation's price is fixed or determined at the time of sale. + * See [CatalogPricingType](#type-catalogpricingtype) for possible values. */ pricing_type?: CatalogItemVariation.PricingTypeEnum; /** @@ -1092,7 +1109,7 @@ export class CatalogItemVariation { track_inventory?: boolean; /** * Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its - * `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for all possible values. + * `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for possible values. */ inventory_alert_type?: CatalogItemVariation.InventoryAlertTypeEnum; /** @@ -1140,20 +1157,20 @@ export class CatalogModifier { /** * A modifier list in the Catalog object model. A [CatalogModifierList](#type-catalogmodifierlist) contains * [Modifier](#type-catalogmodifier)s that can be applied to a [CatalogItem](#type-catalogitem) at the time of sale. - * For example, a modifier list \"Condiments\" that would apply to a \"Hot Dog\" [CatalogItem](#type-catalogitem) might - * contain [CatalogModifier](#type-catalogmodifier)s \"Ketchup\", \"Mustard\", and \"Relish\". The `selection_type` - * field specifies whether or not multiple selections from the modifier list are allowed. + * For example, a modifier list "Condiments" that would apply to a "Hot Dog" [CatalogItem](#type-catalogitem) might + * contain [CatalogModifier](#type-catalogmodifier)s "Ketchup", "Mustard", and "Relish". + * The `selection_type` field specifies whether or not multiple selections from the modifier list are allowed. */ export class CatalogModifierList { /** - * The [CatalogModifierList](#type-catalogmodifierlist)'s name. Searchable. This field has max length of 255 Unicode - * code points. + * The [CatalogModifierList](#type-catalogmodifierlist)'s name. Searchable. + * This field has max length of 255 Unicode code points. */ name?: string; /** * Indicates whether multiple options from the [CatalogModifierList](#type-catalogmodifierlist) can be applied to a - * single [CatalogItem](#type-catalogitem). See - * [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) for all possible values. + * single [CatalogItem](#type-catalogitem). + * See [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) for possible values. */ selection_type?: CatalogModifierList.SelectionTypeEnum; /** @@ -1189,24 +1206,21 @@ export class CatalogModifierOverride { } /** - * The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined - * by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will - * be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only - * `item_variation_data` will be populated and it will contain a valid - * [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be - * populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, - * only `modifier_list_data` will be populated and it will contain a valid - * [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be - * populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only - * `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if - * type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. - * For a more detailed discussion of the Catalog data model, please see the [Catalog - * Overview](/products/catalog/overview). + * The wrapper object for object types in the Catalog data model. + * The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. + * - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. + * - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid object. + * - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid object. + * - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid object. + * - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid object. + * - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid object. + * - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. + * For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview). */ export class CatalogObject { /** * The type of this object. Each object type has expected properties expressed in a structured format within its - * corresponding `*_data` field below. See [CatalogObjectType](#type-catalogobjecttype) for all possible values. + * corresponding `*_data` field below. See [CatalogObjectType](#type-catalogobjecttype) for possible values. */ type: CatalogObject.TypeEnum; /** @@ -1251,6 +1265,10 @@ export class CatalogObject { * A list of locations where the object is not present, even if `present_at_all_locations` is `true`. */ absent_at_location_ids?: Array; + /** + * Identifies the `CatalogImage` attached to this `CatalogObject`. + */ + image_id?: string; /** * Structured data for a [CatalogItem](#type-catalogitem), set for CatalogObjects of type `ITEM`. */ @@ -1260,8 +1278,7 @@ export class CatalogObject { */ category_data?: CatalogCategory; /** - * Structured data for a [CatalogItemVariation](#type-catalogitemvariation), set for CatalogObjects of type - * `ITEM_VARIATION`. + * Structured data for a [CatalogItemVariation](#type-catalogitemvariation), set for CatalogObjects of type `ITEM_VARIATION`. */ item_variation_data?: CatalogItemVariation; /** @@ -1273,19 +1290,23 @@ export class CatalogObject { */ discount_data?: CatalogDiscount; /** - * Structured data for a [CatalogModifierList](#type-catalogmodifierlist), set for CatalogObjects of type - * `MODIFIER_LIST`. + * Structured data for a [CatalogModifierList](#type-catalogmodifierlist), set for CatalogObjects of type `MODIFIER_LIST`. */ modifier_list_data?: CatalogModifierList; /** * Structured data for a [CatalogModifier](#type-catalogmodifier), set for CatalogObjects of type `MODIFIER`. */ modifier_data?: CatalogModifier; + /** + * Structured data for a [CatalogImage](#type-catalogimage), set for CatalogObjects of type `IMAGE`. + */ + image_data?: CatalogImage; } export namespace CatalogObject { export enum TypeEnum { ITEM = 'ITEM', + IMAGE = 'IMAGE', CATEGORY = 'CATEGORY', ITEMVARIATION = 'ITEM_VARIATION', TAX = 'TAX', @@ -1423,12 +1444,13 @@ export class CatalogQuerySortedAttribute { attribute_name: string; /** * The first attribute value to be returned by the query. Ascending sorts will return only objects with this value - * or greater, while descending sorts will return only objects with this value or less. If unset, start at the - * beginning (for ascending sorts) or end (for descending sorts). + * or greater, while descending sorts will return only objects with this value or less. + * If unset, start at the beginning (for ascending sorts) or end (for descending sorts). */ initial_attribute_value?: string; /** - * The desired [SortOrder](#type-sortorder), `\"ASC\"` (ascending) or `\"DESC\"` (descending). + * The desired [SortOrder](#type-sortorder), "ASC" (ascending) or "DESC" (descending). + * See [SortOrder](#type-sortorder) for possible values. */ sort_order?: CatalogQuerySortedAttribute.SortOrderEnum; } @@ -1456,18 +1478,17 @@ export class CatalogTax { */ name?: string; /** - * Whether the tax is calculated based on a payment's subtotal or total. See - * [TaxCalculationPhase](#type-taxcalculationphase) for all possible values. + * Whether the tax is calculated based on a payment's subtotal or total. + * See [TaxCalculationPhase](#type-taxcalculationphase) for possible values. */ calculation_phase?: CatalogTax.CalculationPhaseEnum; /** - * Whether the tax is `ADDITIVE` or `INCLUSIVE`. See [TaxInclusionType](#type-taxinclusiontype) for all possible - * values. + * Whether the tax is `ADDITIVE` or `INCLUSIVE`. See [TaxInclusionType](#type-taxinclusiontype) for possible values. */ inclusion_type?: CatalogTax.InclusionTypeEnum; /** - * The percentage of the tax in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. A - * value of `7.5` corresponds to 7.5%. + * The percentage of the tax in decimal form, using a '.' as the decimal separator and without a '%' sign. + * A value of `7.5` corresponds to 7.5%. */ percentage?: string; /** @@ -1507,38 +1528,37 @@ export class CatalogV1Id { } /** - * Defines the parameters that can be included in the body of a request to the [Charge](#endpoint-charge) endpoint. + * Defines the parameters that can be included in the body of a request to the Charge endpoint. */ export class ChargeRequest { /** - * A value you specify that uniquely identifies this transaction among transactions you've created. If you're - * unsure whether a particular transaction succeeded, you can reattempt it with the same idempotency key without - * worrying about double-charging the buyer. See [Idempotency](/basics/api101/idempotency) for more information. + * A value you specify that uniquely identifies this transaction among transactions you've created. + * If you're unsure whether a particular transaction succeeded, you can reattempt it with the same idempotency key + * without worrying about double-charging the buyer. See [Idempotency](/basics/api101/idempotency) for more information. */ idempotency_key: string; /** - * The amount of money to charge. Note that you specify the amount in the __smallest denomination of the applicable - * currency__. For example, US dollar amounts are specified in cents. See [Working with monetary - * amounts](#workingwithmonetaryamounts) for details. + * The amount of money to charge. Note that you specify the amount in the __smallest denomination of the applicable + * currency__. For example, US dollar amounts are specified in cents. + * See [Working with monetary amounts] (#workingwithmonetaryamounts) for details. * The value of `currency` must match the currency associated with the business that is charging the card. */ amount_money: Money; /** - * A nonce generated from the `SqPaymentForm` that represents the card to charge. The application that provides a + * A nonce generated from the `SqPaymentForm` that represents the card to charge. The application that provides a * nonce to this endpoint must be the _same application_ that generated the nonce with the `SqPaymentForm`. - * Otherwise, the nonce is invalid. - * Do not provide a value for this field if you provide a value for `customer_card_id`. + * Otherwise, the nonce is invalid. Do not provide a value for this field if you provide a value for `customer_card_id`. */ card_nonce?: string; /** - * The ID of the customer card on file to charge. Do not provide a value for this field if you provide a value for - * `card_nonce`. If you provide this value, you _must_ also provide a value for `customer_id`. + * The ID of the customer card on file to charge. Do not provide a value for this field if you provide a value for `card_nonce`. + * If you provide this value, you _must_ also provide a value for `customer_id`. */ customer_card_id?: string; /** * If `true`, the request will only perform an Auth on the provided card. You can then later perform either a * Capture (with the [CaptureTransaction](#endpoint-capturetransaction) endpoint) or a Void (with the - * [VoidTransaction](#endpoint-voidtransaction) endpoint). Default value: `false` + * [VoidTransaction](#endpoint-voidtransaction) endpoint). Default value: `false`. */ delay_capture?: boolean; /** @@ -1603,7 +1623,7 @@ export class ChargeRequestAdditionalRecipient { } /** - * Defines the fields that are included in the response body of a request to the [Charge](#endpoint-charge) endpoint. + * Defines the fields that are included in the response body of a request to the Charge endpoint. * One of `errors` or `transaction` is present in a given response (never both). */ export class ChargeResponse { @@ -1618,8 +1638,7 @@ export class ChargeResponse { } /** - * Square Checkout lets merchants accept online payments for supported payment types using a checkout workflow hosted on - * squareup.com. + * Square Checkout lets merchants accept online payments for supported payment types using a checkout workflow hosted on squareup.com. */ export class Checkout { /** @@ -1632,23 +1651,23 @@ export class Checkout { checkout_page_url?: string; /** * If `true`, Square Checkout will collect shipping information on your behalf and store that information with the - * transaction information in your Square Dashboard. Default: `false`. + * transaction information in your Square Dashboard. Default: `false`. */ ask_for_shipping_address?: boolean; /** * The email address to display on the Square Checkout confirmation page and confirmation email that the buyer can * use to contact the merchant. If this value is not set, the confirmation page and email will display the primary - * email address associated with the merchant's Square account. Default: none; only exists if explicitly set. + * email address associated with the merchant's Square account. Default: none; only exists if explicitly set. */ merchant_support_email?: string; /** - * If provided, the buyer's email is pre-populated on the checkout page as an editable text field. Default: none; - * only exists if explicitly set. + * If provided, the buyer's email is pre-populated on the checkout page as an editable text field. + * Default: none; only exists if explicitly set. */ pre_populate_buyer_email?: string; /** - * If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. Default: - * none; only exists if explicitly set. + * If provided, the buyer's shipping info is pre-populated on the checkout page as editable text fields. + * Default: none; only exists if explicitly set. */ pre_populate_shipping_address?: Address; /** @@ -1712,15 +1731,15 @@ export class CreateBreakTypeResponse { } /** - * Defines the parameters that can be included in the body of a request to the [CreateCheckout](#endpoint-createcheckout) endpoint. + * Defines the parameters that can be included in the body of a request to the CreateCheckout endpoint. */ export class CreateCheckoutRequest { /** * A unique string that identifies this checkout among others you've created. It can be any valid string but must be - * unique for every order sent to Square Checkout for a given location ID. The idempotency key is used to avoid + * unique for every order sent to Square Checkout for a given location ID. The idempotency key is used to avoid * processing the same order more than once. If you're unsure whether a particular checkout was created * successfully, you can reattempt it with the same idempotency key and all the same other parameters without - * worrying about creating duplicates. We recommend using a random number/string generator native to the language + * worrying about creating duplicates. We recommend using a random number/string generator native to the language * you are working in to generate strings for your idempotency keys. See [Idempotency](/basics/api101/idempotency) * for more information. */ @@ -1763,9 +1782,9 @@ export class CreateCheckoutRequest { redirect_url?: string; /** * The basic primitive of multi-party transaction. The value is optional. The transaction facilitated by you can be - * split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be + * split from here. If you provide this value, the `amount_money` value in your additional_recipients must not be * more than 90% of the `total_money` calculated by Square for your order. The `location_id` must be the valid - * location of the app owner merchant. This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. + * location of the app owner merchant. This field requires `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission. * This field is currently not supported in sandbox. */ additional_recipients?: Array; @@ -1776,8 +1795,7 @@ export class CreateCheckoutRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [CreateCheckout](#endpoint-createcheckout) endpoint. + * Defines the fields that are included in the response body of a request to the CreateCheckout endpoint. */ export class CreateCheckoutResponse { /** @@ -1792,14 +1810,13 @@ export class CreateCheckoutResponse { } /** - * Defines the fields that are included in the request body of a request to the - * [CreateCustomerCard](#endpoint-createcustomercard) endpoint. + * Defines the fields that are included in the request body of a request to the CreateCustomerCard endpoint. */ export class CreateCustomerCardRequest { /** - * A card nonce representing the credit card to link to the customer. Card nonces are generated by the - * `SqPaymentForm` that buyers enter their card information into. See [Embedding the payment - * form](/payments/sqpaymentform/overview) for more information. + * A card nonce representing the credit card to link to the customer. + * Card nonces are generated by the `SqPaymentForm` that buyers enter their card information into. + * See [Embedding the payment form](/payments/sqpaymentform/overview) for more information. * @note Card nonces generated by digital wallets (e.g., Apple Pay) cannot be used to create a customer card. */ card_nonce: string; @@ -1814,9 +1831,8 @@ export class CreateCustomerCardRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [CreateCustomerCard](#endpoint-createcustomercard) endpoint. One of `errors` or `card` is present in a given - * response (never both). + * Defines the fields that are included in the response body of a request to the CreateCustomerCard endpoint. + * One of `errors` or `card` is present in a given response (never both). */ export class CreateCustomerCardResponse { /** @@ -1830,7 +1846,7 @@ export class CreateCustomerCardResponse { } /** - * Defines the body parameters that can be provided in a request to the [CreateCustomer](#endpoint-createcustomer) endpoint. + * Defines the body parameters that can be provided in a request to the CreateCustomer endpoint. */ export class CreateCustomerRequest { /** @@ -1882,9 +1898,8 @@ export class CreateCustomerRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [CreateCustomer](#endpoint-createcustomer) endpoint. One of `errors` or `customer` is present in a given response - * (never both). + * Defines the fields that are included in the response body of a request to the CreateCustomer endpoint. + * One of `errors` or `customer` is present in a given response (never both). */ export class CreateCustomerResponse { /** @@ -1898,8 +1913,7 @@ export class CreateCustomerResponse { } /** - * Defines the body parameters that can be provided in a request to the - * [CreateMobileAuthorizationCode](#endpoint-createmobileauthorizationcode) endpoint. + * Defines the body parameters that can be provided in a request to the CreateMobileAuthorizationCode endpoint. */ export class CreateMobileAuthorizationCodeRequest { /** @@ -1909,8 +1923,7 @@ export class CreateMobileAuthorizationCodeRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [CreateMobileAuthorizationCode](#endpoint-createmobileauthorizationcode) endpoint. + * Defines the fields that are included in the response body of a request to the CreateMobileAuthorizationCode endpoint. */ export class CreateMobileAuthorizationCodeResponse { /** @@ -2070,13 +2083,12 @@ export class CreateOrderRequestModifier { */ export class CreateOrderRequestTax { /** - * Only used for catalog taxes. The catalog object ID of an existing [CatalogTax](#type-catalogtax). Do not provide - * a value for this field if you provide values in other fields for an ad hoc tax. + * Only used for catalog taxes. The catalog object ID of an existing [CatalogTax](#type-catalogtax). + * Do not provide a value for this field if you provide values in other fields for an ad hoc tax. */ catalog_object_id?: string; /** - * Only used for ad hoc taxes. The tax's name. Do not provide a value for this field if you set - * `catalog_object_id`. + * Only used for ad hoc taxes. The tax's name. Do not provide a value for this field if you set `catalog_object_id`. */ name?: string; /** @@ -2100,8 +2112,8 @@ export namespace CreateOrderRequestTax { } /** - * Defines the fields that are included in the response body of a request to the [CreateOrder](#endpoint-createorder) - * endpoint. One of `errors` or `order` is present in a given response (never both). + * Defines the fields that are included in the response body of a request to the CreateOrder endpoint. + * One of `errors` or `order` is present in a given response (never both). */ export class CreateOrderResponse { /** @@ -2115,18 +2127,18 @@ export class CreateOrderResponse { } /** - * Defines the body parameters that can be included in a request to the [CreateRefund](#endpoint-createrefund) endpoint. + * Defines the body parameters that can be included in a request to the CreateRefund endpoint. */ export class CreateRefundRequest { /** - * A value you specify that uniquely identifies this refund among refunds you've created for the tender. If you're - * unsure whether a particular refund succeeded, you can reattempt it with the same idempotency key without worrying - * about duplicating the refund. See [Idempotency](/basics/api101/idempotency) for more information. + * A value you specify that uniquely identifies this refund among refunds you've created for the tender. + * If you're unsure whether a particular refund succeeded, you can reattempt it with the same idempotency key without + * worrying about duplicating the refund. See [Idempotency](/basics/api101/idempotency) for more information. */ idempotency_key: string; /** - * The ID of the tender to refund. A [`Transaction`](#type-transaction) has one or more `tenders` (i.e., methods of - * payment) associated with it, and you refund each tender separately with the Connect API. + * The ID of the tender to refund. A [`Transaction`](#type-transaction) has one or more `tenders` (i.e., methods of payment) + * associated with it, and you refund each tender separately with the Connect API. */ tender_id: string; /** @@ -2135,16 +2147,16 @@ export class CreateRefundRequest { reason?: string; /** * The amount of money to refund. Note that you specify the amount in the __smallest denomination of the applicable - * currency__. For example, US dollar amounts are specified in cents. See [Working with monetary - * amounts](#workingwithmonetaryamounts) for details. This amount cannot exceed the amount that was originally - * charged to the tender that corresponds to `tender_id`. + * currency__. For example, US dollar amounts are specified in cents. + * See [Working with monetary amounts](#workingwithmonetaryamounts) for details. + * This amount cannot exceed the amount that was originally charged to the tender that corresponds to `tender_id`. */ amount_money: Money; } /** - * Defines the fields that are included in the response body of a request to the [CreateRefund](#endpoint-createrefund) - * endpoint. One of `errors` or `refund` is present in a given response (never both). + * Defines the fields that are included in the response body of a request to the CreateRefund endpoint. + * One of `errors` or `refund` is present in a given response (never both). */ export class CreateRefundResponse { /** @@ -2264,6 +2276,7 @@ export class Customer { groups?: Array; /** * A creation source represents the method used to create the customer profile. + * See [CustomerCreationSource](#type-customercreationsource) for possible values. */ creation_source?: Customer.CreationSourceEnum; } @@ -2345,7 +2358,7 @@ export namespace CustomerCreationSourceFilter { /** * Represents a set of [`CustomerQuery`](#type-customerquery) filters used to limit the set of Customers returned by - * [`SearchCustomers`](#endpoint-seachcustomers). + * [`SearchCustomers`](#endpoint-customers-seachcustomers). */ export class CustomerFilter { /** @@ -2412,14 +2425,14 @@ export class CustomerQuery { */ export class CustomerSort { /** - * The field to sort the results on. It could be the total money spent at the merchant, the date of the first visit - * (etc). See [CustomerSortField](#type-customersortfield) for possible values. Default value: `DEFAULT`. + * The field to sort the results on. It could be the total money spent at the merchant, the date of the first visit (etc). + * See [CustomerSortField](#type-customersortfield) for possible values. */ field?: CustomerSort.FieldEnum; /** - * Indicates the order in which results should be displayed based on the value of the sort field. String comparisons - * use standard alphabetic comparison to determine order. Strings representing numbers are sorted as strings. See - * [SortOrder](#type-sortorder) for possible values. Default value: `ASC`. + * Indicates the order in which results should be displayed based on the value of the sort field. + * String comparisons use standard alphabetic comparison to determine order. + * Strings representing numbers are sorted as strings. See [SortOrder](#type-sortorder) for possible values. */ order?: CustomerSort.OrderEnum; } @@ -2441,12 +2454,12 @@ export namespace CustomerSort { export class CustomerSortField {} /** - * A range defined by two dates. Used for filtering a query for Connect v2 objects that have date properties. + * A range defined by two dates. Used for filtering a query for Connect v2 objects that have date properties. */ export class DateRange { /** * String in `YYYY-MM-DD` format, e.g. `2017-10-31` per the ISO 8601 extended format for calendar dates. - * The beginning of a date range (inclusive) + * The beginning of a date range (inclusive). */ start_date?: string; /** @@ -2491,11 +2504,13 @@ export class DeleteCatalogObjectResponse { deleted_at?: string; } +/** + * Defines the fields that are included in requests to the DeleteCustomerCard endpoint. + */ export class DeleteCustomerCardRequest {} /** - * Defines the fields that are included in the response body of a request to the - * [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint. + * Defines the fields that are included in the response body of a request to the DeleteCustomerCard endpoint. */ export class DeleteCustomerCardResponse { /** @@ -2504,11 +2519,13 @@ export class DeleteCustomerCardResponse { errors?: Array; } +/** + * Defines the fields that are included in a request to the DeleteCustomer endpoint. + */ export class DeleteCustomerRequest {} /** - * Defines the fields that are included in the response body of a request to the - * [DeleteCustomer](#endpoint-deletecustomer) endpoint. + * Defines the fields that are included in the response body of a request to the DeleteCustomer endpoint. */ export class DeleteCustomerResponse { /** @@ -2523,7 +2540,7 @@ export class DeleteCustomerResponse { export class DeleteShiftRequest {} /** - * The response to a request to delete a `Shift`. May contain a set of `Error` objects if the request resulted in errors. + * The response to a request to delete a `Shift`. May contain a set of `Error` objects if the request resulted in errors. */ export class DeleteShiftResponse { /** @@ -2564,7 +2581,7 @@ export class Employee { */ location_ids?: Array; /** - * Specifies the status of the employee being fetched. + * Specifies the status of the employee being fetched. See [EmployeeStatus](#type-employeestatus) for possible values. */ status?: Employee.StatusEnum; /** @@ -2590,8 +2607,7 @@ export namespace Employee { export class EmployeeStatus {} /** - * The hourly wage rate that an employee will earn on a `Shift` for doing the job specified by the `title` property of - * this object. + * The hourly wage rate that an employee will earn on a `Shift` for doing the job specified by the `title` property of this object. */ export class EmployeeWage { /** @@ -2698,10 +2714,12 @@ export class InventoryAdjustment { reference_id?: string; /** * The [InventoryState](#type-inventorystate) of the related quantity of items before the adjustment. + * See [InventoryState](#type-inventorystate) for possible values. */ from_state?: InventoryAdjustment.FromStateEnum; /** * The [InventoryState](#type-inventorystate) of the related quantity of items after the adjustment. + * See [InventoryState](#type-inventorystate) for possible values. */ to_state?: InventoryAdjustment.ToStateEnum; /** @@ -2722,8 +2740,8 @@ export class InventoryAdjustment { */ quantity?: string; /** - * The read-only total price paid for goods associated with the adjustment. Present if and only if `to_state` is - * `SOLD`. Always non-negative. + * The read-only total price paid for goods associated with the adjustment. + * Present if and only if `to_state` is `SOLD`. Always non-negative. */ total_price_money?: Money; /** @@ -2809,7 +2827,7 @@ export class InventoryAlertType {} export class InventoryChange { /** * Indicates how the inventory change was applied. - * See [InventoryChangeType](#type-inventorychangetype) for all possible values. + * See [InventoryChangeType](#type-inventorychangetype) for possible values. */ type?: InventoryChange.TypeEnum; /** @@ -2855,6 +2873,7 @@ export class InventoryCount { catalog_object_type?: string; /** * The current [InventoryState](#type-inventorystate) for the related quantity of items. + * See [InventoryState](#type-inventorystate) for possible values. */ state?: InventoryCount.StateEnum; /** @@ -2914,6 +2933,7 @@ export class InventoryPhysicalCount { catalog_object_type?: string; /** * The current [InventoryState](#type-inventorystate) for the related quantity of items. + * See [InventoryState](#type-inventorystate) for possible values. */ state?: InventoryPhysicalCount.StateEnum; /** @@ -2979,6 +2999,7 @@ export class InventoryTransfer { reference_id?: string; /** * The [InventoryState](#type-inventorystate) for the quantity of items being transfered. + * See [InventoryState](#type-inventorystate) for possible values. */ state?: InventoryTransfer.StateEnum; /** @@ -3054,7 +3075,7 @@ export class ItemVariationLocationOverrides { price_money?: Money; /** * The pricing type (fixed or variable) for the [CatalogItemVariation](#type-catalogitemvariation) at the given - * [location](#type-location). See [CatalogPricingType](#type-catalogpricingtype) for all possible values. + * [location](#type-location). See [CatalogPricingType](#type-catalogpricingtype) for possible values. */ pricing_type?: ItemVariationLocationOverrides.PricingTypeEnum; /** @@ -3065,12 +3086,12 @@ export class ItemVariationLocationOverrides { /** * Indicates whether the [CatalogItemVariation](#type-catalogitemvariation) displays an alert when its inventory * quantity is less than or equal to its `inventory_alert_threshold`. - * See [InventoryAlertType](#type-inventoryalerttype) for all possible values. + * See [InventoryAlertType](#type-inventoryalerttype) for possible values. */ inventory_alert_type?: ItemVariationLocationOverrides.InventoryAlertTypeEnum; /** * If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is - * `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer. + * `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer. */ inventory_alert_threshold?: number; } @@ -3087,23 +3108,22 @@ export namespace ItemVariationLocationOverrides { } /** - * Defines the query parameters that can be included in a request to the - * [ListAdditionalRecipientReceivableRefunds](#endpoint-listadditionalrecipientreceivablerefunds) endpoint. + * Defines the query parameters that can be included in a request to the ListAdditionalRecipientReceivableRefunds endpoint. */ export class ListAdditionalRecipientReceivableRefundsRequest { /** - * The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details - * on date inclusivity/exclusivity. Default value: The current time minus one year. + * The beginning of the requested reporting period, in RFC 3339 format. + * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year. */ begin_time?: string; /** - * The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on - * date inclusivity/exclusivity. Default value: The current time. + * The end of the requested reporting period, in RFC 3339 format. + * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. */ end_time?: string; /** * The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). - * Default value: `DESC` + * Default value: `DESC` See [SortOrder](#type-sortorder) for possible values. */ sort_order?: ListAdditionalRecipientReceivableRefundsRequest.SortOrderEnum; /** @@ -3121,8 +3141,7 @@ export namespace ListAdditionalRecipientReceivableRefundsRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [ListAdditionalRecipientReceivableRefunds](#endpoint-listadditionalrecipientreceivablerefunds) endpoint. + * Defines the fields that are included in the response body of a request to the ListAdditionalRecipientReceivableRefunds endpoint. * One of `errors` or `additional_recipient_receivable_refunds` is present in a given response (never both). */ export class ListAdditionalRecipientReceivableRefundsResponse { @@ -3142,8 +3161,7 @@ export class ListAdditionalRecipientReceivableRefundsResponse { } /** - * Defines the query parameters that can be included in a request to the - * [ListAdditionalRecipientReceivables](#endpoint-listadditionalrecipientreceivables) endpoint. + * Defines the query parameters that can be included in a request to the ListAdditionalRecipientReceivables endpoint. */ export class ListAdditionalRecipientReceivablesRequest { /** @@ -3152,13 +3170,13 @@ export class ListAdditionalRecipientReceivablesRequest { */ begin_time?: string; /** - * The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on - * date inclusivity/exclusivity. Default value: The current time. + * The end of the requested reporting period, in RFC 3339 format. + * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. */ end_time?: string; /** * The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). - * Default value: `DESC` + * Default value: `DESC` See [SortOrder](#type-sortorder) for possible values. */ sort_order?: ListAdditionalRecipientReceivablesRequest.SortOrderEnum; /** @@ -3176,8 +3194,7 @@ export namespace ListAdditionalRecipientReceivablesRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [ListAdditionalRecipientReceivables](#endpoint-listadditionalrecipientreceivables) endpoint. + * Defines the fields that are included in the response body of a request to the ListAdditionalRecipientReceivables endpoint. * One of `errors` or `additional_recipient_receivables` is present in a given response (never both). */ export class ListAdditionalRecipientReceivablesResponse { @@ -3265,8 +3282,7 @@ export class ListCatalogResponse { } /** - * Defines the query parameters that can be provided in a request to the [ListCustomers](#endpoint-listcustomers) - * endpoint. + * Defines the query parameters that can be provided in a request to the ListCustomers endpoint. */ export class ListCustomersRequest { /** @@ -3275,8 +3291,8 @@ export class ListCustomersRequest { */ cursor?: string; /** - * Indicates how Customers should be sorted. Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) - * for possible values. + * Indicates how Customers should be sorted. Default: `DEFAULT`. + * See [CustomerSortField](#type-customersortfield) for possible values. */ sort_field?: ListCustomersRequest.SortFieldEnum; /** @@ -3298,7 +3314,7 @@ export namespace ListCustomersRequest { } /** - * Defines the fields that are included in the response body of a request to the [ListCustomers](#endpoint-listcustomers) endpoint. + * Defines the fields that are included in the response body of a request to the ListCustomers endpoint. * One of `errors` or `customers` is present in a given response (never both). */ export class ListCustomersResponse { @@ -3364,7 +3380,7 @@ export class ListEmployeesRequest { */ location_id?: string; /** - * Specifies the EmployeeStatus to filter the employee by. + * Specifies the EmployeeStatus to filter the employee by. See [EmployeeStatus](#type-employeestatus) for possible values. */ status?: ListEmployeesRequest.StatusEnum; /** @@ -3383,8 +3399,9 @@ export namespace ListEmployeesRequest { INACTIVE = 'INACTIVE', } } + /** - * Defines the fields that are included in the response body of a request to the [ListEmployees](#endpoint-listemployees) endpoint. + * Defines the fields that are included in the response body of a request to the ListEmployees endpoint. * One of `errors` or `employees` is present in a given response (never both). */ export class ListEmployeesResponse { @@ -3402,12 +3419,14 @@ export class ListEmployeesResponse { errors?: Array; } +/** + * Defines the fields that are included in requests to the ListLocations endpoint. + */ export class ListLocationsRequest {} /** - * Defines the fields that are included in the response body of a request to the - * [ListLocations](#endpoint-listlocations) endpoint. One of `errors` or `locations` is present in a given response - * (never both). + * Defines the fields that are included in the response body of a request to the ListLocations endpoint. + * One of `errors` or `locations` is present in a given response (never both). */ export class ListLocationsResponse { /** @@ -3421,7 +3440,7 @@ export class ListLocationsResponse { } /** - * Defines the query parameters that can be included in a request to the [ListRefunds](#endpoint-listrefunds) endpoint. + * Defines the query parameters that can be included in a request to the ListRefunds endpoint. */ export class ListRefundsRequest { /** @@ -3430,13 +3449,13 @@ export class ListRefundsRequest { */ begin_time?: string; /** - * The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on - * date inclusivity/exclusivity. Default value: The current time. + * The end of the requested reporting period, in RFC 3339 format. + * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. */ end_time?: string; /** * The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). - * Default value: `DESC` + * Default value: `DESC` See [SortOrder](#type-sortorder) for possible values */ sort_order?: ListRefundsRequest.SortOrderEnum; /** @@ -3454,8 +3473,8 @@ export namespace ListRefundsRequest { } /** - * Defines the fields that are included in the response body of a request to the [ListRefunds](#endpoint-listrefunds) - * endpoint. One of `errors` or `refunds` is present in a given response (never both). + * Defines the fields that are included in the response body of a request to the ListRefunds endpoint. + * One of `errors` or `refunds` is present in a given response (never both). */ export class ListRefundsResponse { /** @@ -3467,16 +3486,15 @@ export class ListRefundsResponse { */ refunds?: Array; /** - * A pagination cursor for retrieving the next set of results, if any remain. Provide this value as the `cursor` - * parameter in a subsequent request to this endpoint. + * A pagination cursor for retrieving the next set of results, if any remain. + * Provide this value as the `cursor` parameter in a subsequent request to this endpoint. * See [Pagination](/basics/api101/pagination) for more information. */ cursor?: string; } /** - * Defines the query parameters that can be included in a request to the [ListTransactions](#endpoint-listtransactions) - * endpoint. + * Defines the query parameters that can be included in a request to the ListTransactions endpoint. */ export class ListTransactionsRequest { /** @@ -3485,13 +3503,13 @@ export class ListTransactionsRequest { */ begin_time?: string; /** - * The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on - * date inclusivity/exclusivity. Default value: The current time. + * The end of the requested reporting period, in RFC 3339 format. + * See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time. */ end_time?: string; /** * The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). - * Default value: `DESC` + * Default value: `DESC` See [SortOrder](#type-sortorder) for possible values. */ sort_order?: ListTransactionsRequest.SortOrderEnum; /** @@ -3507,10 +3525,10 @@ export namespace ListTransactionsRequest { ASC = 'ASC', } } + /** - * Defines the fields that are included in the response body of a request to the - * [ListTransactions](#endpoint-listtransactions) endpoint. One of `errors` or `transactions` is present in a given - * response (never both). + * Defines the fields that are included in the response body of a request to the ListTransactions endpoint. + * One of `errors` or `transactions` is present in a given response (never both). */ export class ListTransactionsResponse { /** @@ -3522,9 +3540,9 @@ export class ListTransactionsResponse { */ transactions?: Array; /** - * A pagination cursor for retrieving the next set of results, if any remain. Provide this value as the `cursor` - * parameter in a subsequent request to this endpoint. See [Pagination](/basics/api101/pagination) for more - * information. + * A pagination cursor for retrieving the next set of results, if any remain. + * Provide this value as the `cursor` parameter in a subsequent request to this endpoint. + * See [Pagination](/basics/api101/pagination) for more information. */ cursor?: string; } @@ -3544,8 +3562,8 @@ export class ListWorkweekConfigsRequest { } /** - * The response to a request for a set of `WorkweekConfig` objects. Contains the requested `WorkweekConfig` objects. May - * contain a set of `Error` objects if the request resulted in errors. + * The response to a request for a set of `WorkweekConfig` objects. Contains the requested `WorkweekConfig` objects. + * May contain a set of `Error` objects if the request resulted in errors. */ export class ListWorkweekConfigsResponse { /** @@ -4468,11 +4486,12 @@ export class ObtainTokenRequest { /** * The Square-issued ID of your application, available from the [application dashboard](https://connect.squareup.com/apps). */ - client_id?: string; + client_id: string; /** - * The Square-issued application secret for your application, available from the application dashboard. + * The Square-issued application secret for your application, available from the + * [application dashboard](https://connect.squareup.com/apps). */ - client_secret?: string; + client_secret: string; /** * The authorization code to exchange. This is required if `grant_type` is set to `authorization_code`, to indicate * that the application wants to exchange an authorization code for an OAuth access token. @@ -4486,17 +4505,16 @@ export class ObtainTokenRequest { * Specifies the method to request an OAuth access token. * Valid values are: `authorization_code`, `refresh_token`, and `migration_token`. */ - grant_type?: string; + grant_type: string; /** * A valid refresh token for generating a new OAuth access token. A valid refresh token is required if `grant_type` * is set to `refresh_token`, to indicate the application wants a replacement for an expired OAuth access token. */ refresh_token?: string; /** - * Legacy OAuth access token obtained using a Connect API version prior to 2019-03-13. This parameter is required - * if `grant_type` is set to `migration_token` to indicate that the application wants to get a replacement OAuth - * access token. The response also returns a refresh token. - * For more information, see [Migrate to Using Refresh Tokens](/authz/oauth/migration). + * Legacy OAuth access token obtained using a Connect API version prior to 2019-03-13. This parameter is required + * if `grant_type` is set to `migration_token` to indicate that the application wants to get a replacement OAuth access token. + * The response also returns a refresh token. For more information, see [Migrate to Using Refresh Tokens](/authz/oauth/migration). */ migration_token?: string; } @@ -4547,8 +4565,8 @@ export class ObtainTokenResponse { */ export class Order { /** - * The order's unique ID. This value is only present for Order objects created by the Orders API through the - * [CreateOrder](#endpoint-createorder) endpoint. + * The order's unique ID. This value is only present for Order objects created by the Orders API through + * the [CreateOrder](#endpoint-orders-createorder) endpoint. */ id?: string; /** @@ -4559,6 +4577,10 @@ export class Order { * A client specified identifier to associate an entity in another system with this order. */ reference_id?: string; + /** + * The origination details of the order. + */ + source?: OrderSource; /** * The line items included in the order. */ @@ -4597,11 +4619,11 @@ export class Order { */ export class OrderFulfillment { /** - * The type of the fulfillment. + * The type of the fulfillment. See [OrderFulfillmentType](#type-orderfulfillmenttype) for possible values. */ type?: OrderFulfillment.TypeEnum; /** - * The state of the fulfillment. + * The state of the fulfillment. See [OrderFulfillmentState](#type-orderfulfillmentstate) for possible values. */ state?: OrderFulfillment.StateEnum; /** @@ -4623,6 +4645,7 @@ export namespace OrderFulfillment { FAILED = 'FAILED', } } + /** * Contains details necessary to fulfill a pickup order. */ @@ -4632,10 +4655,9 @@ export class OrderFulfillmentPickupDetails { */ recipient?: OrderFulfillmentRecipient; /** - * The expiry [timestamp](#workingwithdates) in RFC 3339 format, e.g., \"2016-09-04T23:59:33.123Z\". This timestamp + * The expiry [timestamp](#workingwithdates) in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". This timestamp * indicates when the pickup fulfillment will expire if it is not accepted by the merchant. Expiration time can only - * be set up to 7 days in the future. If not set, this pickup fulfillment will be automatically accepted when - * placed. + * be set up to 7 days in the future. If not set, this pickup fulfillment will be automatically accepted when placed. */ expires_at?: string; /** @@ -4646,11 +4668,12 @@ export class OrderFulfillmentPickupDetails { auto_complete_duration?: string; /** * The schedule type of the pickup fulfillment. Defaults to `SCHEDULED`. + * See [OrderFulfillmentPickupDetailsScheduleType](#type-orderfulfillmentpickupdetailsscheduletype) for possible values. */ schedule_type?: OrderFulfillmentPickupDetails.ScheduleTypeEnum; /** - * The pickup [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". For - * fulfillments with the schedule type `ASAP`, this is automatically set to the current time plus the expected + * The pickup [timestamp](#workingwithdates) in RFC3339 timestamp format, e.g., "2016-09-04T23:59:33.123Z". + * For fulfillments with the schedule type `ASAP`, this is automatically set to the current time plus the expected * duration to prepare the fulfillment. This represents the start of the pickup window. */ pickup_at?: string; @@ -4823,9 +4846,9 @@ export class OrderLineItem { } /** - * Represents a discount that applies to one or more line items in an order. Fixed-amount, order-level discounts are - * distributed across all non-zero line item totals. The amount distributed to each line item is relative to that item’s - * contribution to the order subtotal. + * Represents a discount that applies to one or more line items in an order. + * Fixed-amount, order-level discounts are distributed across all non-zero line item totals. + * The amount distributed to each line item is relative to that item’s contribution to the order subtotal. */ export class OrderLineItemDiscount { /** @@ -4838,9 +4861,8 @@ export class OrderLineItemDiscount { name?: string; /** * The type of the discount. If it is created by API, it would be either `FIXED_PERCENTAGE` or `FIXED_AMOUNT`. - * VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or - * amount has to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible - * values. + * VARIABLE_* is not supported in API because the order is created at the time of sale and either percentage or amount has + * to be specified. See [OrderLineItemDiscountType](#type-orderlineitemdiscounttype) for possible values. */ type?: OrderLineItemDiscount.TypeEnum; /** @@ -4861,9 +4883,9 @@ export class OrderLineItemDiscount { */ applied_money?: Money; /** - * Indicates the level at which the discount applies. This field is set by the server. If set in a CreateOrder - * request, it will be ignored on write. See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for - * possible values. + * Indicates the level at which the discount applies. This field is set by the server. + * If set in a CreateOrder request, it will be ignored on write. + * See [OrderLineItemDiscountScope](#type-orderlineitemdiscountscope) for possible values. */ scope?: OrderLineItemDiscount.ScopeEnum; } @@ -4882,6 +4904,7 @@ export namespace OrderLineItemDiscount { ORDER = 'ORDER', } } + /** * Indicates whether this is a line item or order level discount. */ @@ -4911,8 +4934,8 @@ export class OrderLineItemModifier { */ base_price_money?: Money; /** - * The total price of the item modifier for its line item. This is the modifier's base_price_money multiplied by the - * line item's quantity. + * The total price of the item modifier for its line item. + * This is the modifier's base_price_money multiplied by the line item's quantity. */ total_price_money?: Money; } @@ -4930,8 +4953,8 @@ export class OrderLineItemTax { */ name?: string; /** - * Indicates the calculation method used to apply the tax. See [OrderLineItemTaxType](#type-orderlineitemtaxtype) - * for possible values. + * Indicates the calculation method used to apply the tax. + * See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. */ type?: OrderLineItemTax.TypeEnum; /** @@ -4962,6 +4985,7 @@ export namespace OrderLineItemTax { ORDER = 'ORDER', } } + /** * Indicates whether this is a line item or order level tax. */ @@ -4972,6 +4996,17 @@ export class OrderLineItemTaxScope {} */ export class OrderLineItemTaxType {} +/** + * Represents the origination details of an order. + */ +export class OrderSource { + /** + * The name used to identify the place (physical or digital) that an order originates. + * If unset, the name defaults to the name of the application that created the order. + */ + name?: string; +} + /** * Indicates the Square product used to generate an inventory change. */ @@ -5011,6 +5046,7 @@ export class Refund { amount_money: Money; /** * The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, or `FAILED`). + * See [RefundStatus](#type-refundstatus) for possible values. */ status: Refund.StatusEnum; /** @@ -5032,14 +5068,14 @@ export namespace Refund { FAILED = 'FAILED', } } + /** * Indicates a refund's current status. */ export class RefundStatus {} /** - * Defines the parameters that can be included in the body of a request to the - * [RegisterDomain](#endpoint-registerdomain) endpoint. + * Defines the parameters that can be included in the body of a request to the RegisterDomain endpoint. */ export class RegisterDomainRequest { /** @@ -5049,9 +5085,8 @@ export class RegisterDomainRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [RegisterDomain](#endpoint-registerdomain) endpoint. Either `errors` or `status` will be present in a given response - * (never both). + * Defines the fields that are included in the response body of a request to the RegisterDomain endpoint. + * Either `errors` or `status` will be present in a given response (never both). */ export class RegisterDomainResponse { /** @@ -5059,8 +5094,7 @@ export class RegisterDomainResponse { */ errors?: Array; /** - * Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for - * possible values. + * Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values. */ status?: RegisterDomainResponse.StatusEnum; } @@ -5071,6 +5105,7 @@ export namespace RegisterDomainResponse { VERIFIED = 'VERIFIED', } } + /** * The status of domain registration. */ @@ -5118,13 +5153,13 @@ export class RenewTokenResponse { export class RetrieveCatalogObjectRequest { /** - * If `true`, the response will include additional objects that are related to the requested object, as follows: If - * the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated + * If `true`, the response will include additional objects that are related to the requested object, as follows: + * If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated * [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and * [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the * response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), * its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. - * Default value: `false` + * Default value: `false`. */ include_related_objects?: boolean; } @@ -5144,12 +5179,14 @@ export class RetrieveCatalogObjectResponse { related_objects?: Array; } +/** + * Defines the fields that are included in requests to the RetrieveCustomer endpoint. + */ export class RetrieveCustomerRequest {} /** - * Defines the fields that are included in the response body of a request to the - * [RetrieveCustomer](#endpoint-retrievecustomer) endpoint. One of `errors` or `customer` is present in a given - * response (never both). + * Defines the fields that are included in the response body of a request to the RetrieveCustomer endpoint. + * One of `errors` or `customer` is present in a given response (never both). */ export class RetrieveCustomerResponse { /** @@ -5168,9 +5205,8 @@ export class RetrieveCustomerResponse { export class RetrieveEmployeeRequest {} /** - * Defines the fields that are included in the response body of a request to the - * [RetrieveEmployee](#endpoint-retrieveemployee) endpoint. One of `errors` or `employee` is present in a given - * response (never both). + * Defines the fields that are included in the response body of a request to the RetrieveEmployee endpoint. + * One of `errors` or `employee` is present in a given response (never both). */ export class RetrieveEmployeeResponse { /** @@ -5218,8 +5254,8 @@ export class RetrieveInventoryChangesResponse { */ changes?: Array; /** - * The pagination cursor to be used in a subsequent request. If unset, this is the final response. See - * [Pagination](/basics/api101/pagination) for more information. + * The pagination cursor to be used in a subsequent request. If unset, this is the final response. + * See [Pagination](/basics/api101/pagination) for more information. */ cursor?: string; } @@ -5265,12 +5301,14 @@ export class RetrieveInventoryPhysicalCountResponse { count?: InventoryPhysicalCount; } +/** + * Defines the request body fields for calls to the RetrieveTransaction endpoint. + */ export class RetrieveTransactionRequest {} /** - * Defines the fields that are included in the response body of a request to the - * [RetrieveTransaction](#endpont-retrievetransaction) endpoint. One of `errors` or `transaction` is present in a given - * response (never both). + * Defines the fields that are included in the response body of a request to the RetrieveTransaction endpoint. + * One of `errors` or `transaction` is present in a given response (never both). */ export class RetrieveTransactionResponse { /** @@ -5289,13 +5327,13 @@ export class RevokeTokenRequest { */ client_id?: string; /** - * The access token of the merchant whose token you want to revoke. Do not provide a value for merchant_id if you - * provide this parameter. + * The access token of the merchant whose token you want to revoke. + * Do not provide a value for merchant_id if you provide this parameter. */ access_token?: string; /** - * The ID of the merchant whose token you want to revoke. Do not provide a value for access_token if you provide - * this parameter. + * The ID of the merchant whose token you want to revoke. + * Do not provide a value for access_token if you provide this parameter. */ merchant_id?: string; } @@ -5315,29 +5353,27 @@ export class SearchCatalogObjectsRequest { cursor?: string; /** * The desired set of object types to appear in the search results. The legal values are taken from the - * [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, - * `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`. + * [CatalogObjectType](#type-catalogobjecttype) enumeration, namely "ITEM", "ITEM_VARIATION", "CATEGORY", "DISCOUNT", + * "TAX", "MODIFIER", or "MODIFIER_LIST". See [CatalogObjectType](#type-catalogobjecttype) for possible values. */ object_types?: Array; /** - * If `true`, deleted objects will be included in the results. Deleted objects will have their `is_deleted` field - * set to `true`. + * If `true`, deleted objects will be included in the results. + * Deleted objects will have their `is_deleted` field set to `true`. */ include_deleted_objects?: boolean; /** * If `true`, the response will include additional objects that are related to the requested object, as follows: If * a [CatalogItem](#type-catalogitem) is returned in the object field of the response, its associated * [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and - * [CatalogModifierList](#type-catalogmodifierlist)s will be included in the `related_objects` field of the - * response. If a [CatalogItemVariation](#type-catalogitemvariation) is returned in the object field of the - * response, its parent [CatalogItem](#type-catalogitem) will be included in the `related_objects` field of the - * response. + * [CatalogModifierList](#type-catalogmodifierlist)s will be included in the `related_objects` field of the response. + * If a [CatalogItemVariation](#type-catalogitemvariation) is returned in the object field of the response, + * its parent [CatalogItem](#type-catalogitem) will be included in the `related_objects` field of the response. */ include_related_objects?: boolean; /** - * Return objects modified after this [timestamp](#workingwithdates), in RFC 3339 format, e.g., - * \"2016-09-04T23:59:33.123Z\". The timestamp is exclusive - objects with a timestamp equal to `begin_time` will - * not be included in the response. + * Return objects modified after this [timestamp](#workingwithdates), in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". + * The timestamp is exclusive - objects with a timestamp equal to `begin_time` will not be included in the response. */ begin_time?: string; /** @@ -5345,9 +5381,9 @@ export class SearchCatalogObjectsRequest { */ query?: CatalogQuery; /** - * A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may - * return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of - * 1,000, it will be ignored. + * A limit on the number of results to be returned in a single page. + * The limit is advisory - the implementation may return more or fewer results. + * If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored. */ limit?: number; } @@ -5355,6 +5391,7 @@ export class SearchCatalogObjectsRequest { export namespace SearchCatalogObjectsRequest { export enum ObjectTypesEnum { ITEM = 'ITEM', + IMAGE = 'IMAGE', CATEGORY = 'CATEGORY', ITEMVARIATION = 'ITEM_VARIATION', TAX = 'TAX', @@ -5370,8 +5407,8 @@ export class SearchCatalogObjectsResponse { */ errors?: Array; /** - * The pagination cursor to be used in a subsequent request. If unset, this is the final response. See - * [Pagination](/basics/api101/pagination) for more information. + * The pagination cursor to be used in a subsequent request. If unset, this is the final response. + * See [Pagination](/basics/api101/pagination) for more information. */ cursor?: string; /** @@ -5385,7 +5422,7 @@ export class SearchCatalogObjectsResponse { } /** - * Defines the fields included in the request body for the [SearchCustomers](#endpoint-searchcustomer) endpoint. + * Defines the fields included in the request body for the SearchCustomers endpoint. */ export class SearchCustomersRequest { /** @@ -5407,9 +5444,8 @@ export class SearchCustomersRequest { } /** - * Defines the fields that are included in the response body of a request to the - * [SearchCustomers](#endpoint-searchcustomers) endpoint. One of `errors` or `customers` is present in a given response - * (never both). + * Defines the fields that are included in the response body of a request to the SearchCustomers endpoint. + * One of `errors` or `customers` is present in a given response (never both). */ export class SearchCustomersResponse { /** @@ -5506,7 +5542,7 @@ export class Shift { */ breaks?: Array; /** - * Describes working state of the current `Shift`. + * Describes working state of the current `Shift`. See [ShiftStatus](#type-shiftstatus) for possible values. */ status?: Shift.StatusEnum; /** @@ -5545,7 +5581,7 @@ export class ShiftFilter { */ employee_id?: Array; /** - * Fetch a `Shift` instance by `Shift.status`. + * Fetch a `Shift` instance by `Shift.status`. See [ShiftFilterStatus](#type-shiftfilterstatus) for possible values. */ status?: ShiftFilter.StatusEnum; /** @@ -5593,11 +5629,11 @@ export class ShiftQuery { */ export class ShiftSort { /** - * The field to sort on. + * The field to sort on. See [ShiftSortField](#type-shiftsortfield) for possible values. */ field?: ShiftSort.FieldEnum; /** - * The order in which results are returned. Defaults to DESC. + * The order in which results are returned. Defaults to DESC. See [SortOrder](#type-sortorder) for possible values. */ order?: ShiftSort.OrderEnum; } @@ -5621,7 +5657,7 @@ export namespace ShiftSort { export class ShiftSortField {} /** - * Enumerates the possible status of a `Shift` + * Enumerates the possible status of a `Shift`. */ export class ShiftStatus {} @@ -5634,8 +5670,7 @@ export class ShiftWage { */ title?: string; /** - * Can be a custom-set hourly wage or the calculated effective hourly wage based on annual wage and hours worked per - * week. + * Can be a custom-set hourly wage or the calculated effective hourly wage based on annual wage and hours worked per week. */ hourly_rate?: Money; } @@ -5650,13 +5685,13 @@ export class ShiftWorkday { */ date_range?: DateRange; /** - * The strategy on which the dates are applied. + * The strategy on which the dates are applied. See [ShiftWorkdayMatcher](#type-shiftworkdaymatcher) for possible values. */ match_shifts_by?: ShiftWorkday.MatchShiftsByEnum; /** - * Location-specific timezones convert workdays to datetime filters. Every location included in the query must have - * a timezone, or this field must be provided as a fallback. Format: the IANA timezone database identifier for the - * relevant timezone. + * Location-specific timezones convert workdays to datetime filters. + * Every location included in the query must have a timezone, or this field must be provided as a fallback. + * Format: the IANA timezone database identifier for the relevant timezone. */ default_timezone?: string; } @@ -5668,6 +5703,7 @@ export namespace ShiftWorkday { INTERSECTION = 'INTERSECTION', } } + /** * Defines the logic used to apply a workday filter. */ @@ -5683,7 +5719,7 @@ export class SortOrder {} */ export class SourceApplication { /** - * Read-only [Product](#type-product) type for the application. + * Read-only [Product](#type-product) type for the application. See [Product](#type-product) for possible values. */ product?: SourceApplication.ProductEnum; /** @@ -5710,6 +5746,7 @@ export namespace SourceApplication { OTHER = 'OTHER', } } + /** * When to calculate the taxes due on a cart. */ @@ -5753,7 +5790,7 @@ export class Tender { */ tip_money?: Money; /** - * The amount of any Square processing fees applied to the tender. This field is not immediately populated when a + * The amount of any Square processing fees applied to the tender. This field is not immediately populated when a * new transaction is created. It is usually available after about ten seconds. */ processing_fee_money?: Money; @@ -5763,20 +5800,20 @@ export class Tender { */ customer_id?: string; /** - * The type of tender, such as `CARD` or `CASH`. + * The type of tender, such as `CARD` or `CASH`. See [TenderType](#type-tendertype) for possible values. */ type: Tender.TypeEnum; /** - * The details of the card tender. This value is present only if the value of `type` is `CARD`. + * The details of the card tender. This value is present only if the value of `type` is `CARD`. */ card_details?: TenderCardDetails; /** - * The details of the cash tender. This value is present only if the value of `type` is `CASH`. + * The details of the cash tender. This value is present only if the value of `type` is `CASH`. */ cash_details?: TenderCashDetails; /** - * Additional recipients (other than the merchant) receiving a portion of this tender. For example, fees assessed on - * the purchase by a third party integration. + * Additional recipients (other than the merchant) receiving a portion of this tender. + * For example, fees assessed on the purchase by a third party integration. */ additional_recipients?: Array; } @@ -5797,8 +5834,8 @@ export namespace Tender { */ export class TenderCardDetails { /** - * The credit card payment's current state (such as `AUTHORIZED` or `CAPTURED`). See - * [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for possible values. + * The credit card payment's current state (such as `AUTHORIZED` or `CAPTURED`). + * See [TenderCardDetailsStatus](#type-tendercarddetailsstatus) for possible values. */ status?: TenderCardDetails.StatusEnum; /** @@ -5807,6 +5844,7 @@ export class TenderCardDetails { card?: Card; /** * The method used to enter the card's details for the transaction. + * See [TenderCardDetailsEntryMethod](#type-tendercarddetailsentrymethod) for possible values. */ entry_method?: TenderCardDetails.EntryMethodEnum; } @@ -5898,20 +5936,20 @@ export class Transaction { */ refunds?: Array; /** - * If the transaction was created with the [Charge](#endpoint-charge) endpoint, this value is the same as the value - * provided for the `reference_id` parameter in the request to that endpoint. Otherwise, it is not set. + * If the transaction was created with the [Charge](#endpoint-transactions-charge) endpoint, this value is the same as + * the value provided for the `reference_id` parameter in the request to that endpoint. Otherwise, it is not set. */ reference_id?: string; /** - * The Square product that processed the transaction. + * The Square product that processed the transaction. See [TransactionProduct](#type-transactionproduct) for possible values. */ product?: Transaction.ProductEnum; /** * If the transaction was created in the Square Point of Sale app, this value is the ID generated for the * transaction by Square Point of Sale. This ID has no relationship to the transaction's canonical `id`, which is * generated by Square's backend servers. This value is generated for bookkeeping purposes, in case the transaction - * cannot immediately be completed (for example, if the transaction is processed in offline mode). It is not - * currently possible with the Connect API to perform a transaction lookup by this value. + * cannot immediately be completed (for example, if the transaction is processed in offline mode). + * It is not currently possible with the Connect API to perform a transaction lookup by this value. */ client_id?: string; /** @@ -5936,6 +5974,7 @@ export namespace Transaction { OTHER = 'OTHER', } } + /** * Indicates the Square product used to process a transaction. */ @@ -5967,7 +6006,7 @@ export class UpdateBreakTypeResponse { } /** - * Defines the body parameters that can be provided in a request to the [UpdateCustomer](#endpoint-updatecustomer) endpoint. + * Defines the body parameters that can be provided in a request to the UpdateCustomer endpoint. */ export class UpdateCustomerRequest { /** @@ -6015,7 +6054,7 @@ export class UpdateCustomerRequest { } /** - * Defines the fields that are included in the response body of a request to the [UpdateCustomer](#endpoint-updatecustomer) endpoint. + * Defines the fields that are included in the response body of a request to the UpdateCustomer endpoint. * One of `errors` or `customer` is present in a given response (never both). */ export class UpdateCustomerResponse { @@ -6063,13 +6102,11 @@ export class UpdateItemTaxesRequest { */ item_ids: Array; /** - * The set of [CatalogTax](#type-catalogtax)es (referenced by ID) to enable for the - * [CatalogItem](#type-catalogitem). + * The set of [CatalogTax](#type-catalogtax)es (referenced by ID) to enable for the [CatalogItem](#type-catalogitem). */ taxes_to_enable?: Array; /** - * The set of [CatalogTax](#type-catalogtax)es (referenced by ID) to disable for the - * [CatalogItem](#type-catalogitem). + * The set of [CatalogTax](#type-catalogtax)es (referenced by ID) to disable for the [CatalogItem](#type-catalogitem). */ taxes_to_disable?: Array; } @@ -6080,8 +6117,7 @@ export class UpdateItemTaxesResponse { */ errors?: Array; /** - * The database [timestamp](#workingwithdates) of this update in RFC 3339 format, e.g., - * \"2016-09-04T23:59:33.123Z\". + * The database [timestamp](#workingwithdates) of this update in RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". */ updated_at?: string; } @@ -6122,8 +6158,8 @@ export class UpdateWorkweekConfigRequest { } /** - * The response to a request to update a `WorkweekConfig` object. Contains the updated `WorkweekConfig` object. May - * contain a set of `Error` objects if the request resulted in errors. + * The response to a request to update a `WorkweekConfig` object. Contains the updated `WorkweekConfig` object. + * May contain a set of `Error` objects if the request resulted in errors. */ export class UpdateWorkweekConfigResponse { /** @@ -6177,7 +6213,7 @@ export class V1AdjustInventoryRequest { quantity_delta?: number; /** * The reason for the inventory adjustment. - * See [V1AdjustInventoryRequestAdjustmentType](#type-v1adjustinventoryrequestadjustmenttype) for possible values + * See [V1AdjustInventoryRequestAdjustmentType](#type-v1adjustinventoryrequestadjustmenttype) for possible values. */ adjustment_type?: V1AdjustInventoryRequest.AdjustmentTypeEnum; /** @@ -6229,13 +6265,13 @@ export class V1BankAccount { */ account_number_suffix?: string; /** - * The currency code of the currency associated with the bank account, in ISO 4217 format. For example, the currency - * code for US dollars is USD. + * The currency code of the currency associated with the bank account, in ISO 4217 format. + * For example, the currency code for US dollars is USD. */ currency_code?: string; /** - * The bank account's type (for example, savings or checking). See [V1BankAccountType](#type-v1bankaccounttype) for - * possible values + * The bank account's type (for example, savings or checking). + * See [V1BankAccountType](#type-v1bankaccounttype) for possible values. */ type?: V1BankAccount.TypeEnum; } @@ -6366,8 +6402,7 @@ export class V1CashDrawerShift { */ cash_paid_out_money?: V1Money; /** - * The amount of money that should be in the cash drawer at the end of the shift, based on the shift's other money - * amounts. + * The amount of money that should be in the cash drawer at the end of the shift, based on the shift's other money amounts. */ expected_cash_money?: V1Money; /** @@ -6406,20 +6441,22 @@ export class V1Category { * The category's name. */ name?: string; + /** + * The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID. + */ + v2_id?: string; } export class V1CreateCategoryRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body?: V1Category; } export class V1CreateDiscountRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body?: V1Discount; } @@ -6433,40 +6470,35 @@ export class V1CreateEmployeeRoleRequest { export class V1CreateFeeRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body?: V1Fee; } export class V1CreateItemRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body?: V1Item; } export class V1CreateModifierListRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body?: V1ModifierList; } export class V1CreateModifierOptionRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body?: V1ModifierOption; } export class V1CreatePageRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body?: V1Page; } @@ -6481,8 +6513,8 @@ export class V1CreateRefundRequest { */ payment_id: string; /** - * TThe type of refund (FULL or PARTIAL). See [V1CreateRefundRequestType](#type-v1createrefundrequesttype) for - * possible values + * TThe type of refund (FULL or PARTIAL). + * See [V1CreateRefundRequestType](#type-v1createrefundrequesttype) for possible values. */ type: V1CreateRefundRequest.TypeEnum; /** @@ -6560,18 +6592,18 @@ export class V1Discount { */ name?: string; /** - * The rate of the discount, as a string representation of a decimal number. A value of 0.07 corresponds to a rate - * of 7%. This rate is 0 if discount_type is VARIABLE_PERCENTAGE. + * The rate of the discount, as a string representation of a decimal number. + * A value of 0.07 corresponds to a rate of 7%. This rate is 0 if discount_type is VARIABLE_PERCENTAGE. */ rate?: string; /** - * The amount of the discount. This amount is 0 if discount_type is VARIABLE_AMOUNT. This field is not included for - * rate-based discounts. + * The amount of the discount. This amount is 0 if discount_type is VARIABLE_AMOUNT. + * This field is not included for rate-based discounts. */ amount_money?: V1Money; /** - * Indicates whether the discount is a FIXED value or entered at the time of sale. See - * [V1DiscountDiscountType](#type-v1discountdiscounttype) for possible values + * Indicates whether the discount is a FIXED value or entered at the time of sale. + * See [V1DiscountDiscountType](#type-v1discountdiscounttype) for possible values. */ discount_type?: V1Discount.DiscountTypeEnum; /** @@ -6579,10 +6611,14 @@ export class V1Discount { */ pin_required?: boolean; /** - * The color of the discount's display label in Square Register, if not the default color. The default color is - * 9da2a6. See [V1DiscountColor](#type-v1discountcolor) for possible values + * The color of the discount's display label in Square Register, if not the default color. + * The default color is "9da2a6". See [V1DiscountColor](#type-v1discountcolor) for possible values. */ color?: V1Discount.ColorEnum; + /** + * The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID. + */ + v2_id?: string; } export namespace V1Discount { @@ -6638,7 +6674,7 @@ export class V1Employee { email?: string; /** * CWhether the employee is ACTIVE or INACTIVE. Inactive employees cannot sign in to Square Register.Merchants - * update this field from the Square Dashboard. See [V1EmployeeStatus](#type-v1employeestatus) for possible values + * update this field from the Square Dashboard. See [V1EmployeeStatus](#type-v1employeestatus) for possible values. */ status?: V1Employee.StatusEnum; /** @@ -6661,6 +6697,7 @@ export namespace V1Employee { INACTIVE = 'INACTIVE', } } + /** * V1EmployeeRole */ @@ -6725,17 +6762,16 @@ export class V1Fee { */ rate?: string; /** - * Forthcoming See [V1FeeCalculationPhase](#type-v1feecalculationphase) for possible values + * Forthcoming See [V1FeeCalculationPhase](#type-v1feecalculationphase) for possible values. */ calculation_phase?: V1Fee.CalculationPhaseEnum; /** - * The type of adjustment the fee applies to a payment. Currently, this value is TAX for all fees. See - * [V1FeeAdjustmentType](#type-v1feeadjustmenttype) for possible values + * The type of adjustment the fee applies to a payment. Currently, this value is TAX for all fees. + * See [V1FeeAdjustmentType](#type-v1feeadjustmenttype) for possible values. */ adjustment_type?: V1Fee.AdjustmentTypeEnum; /** - * If true, the fee applies to custom amounts entered into Square Register that are not associated with a particular - * item. + * If true, the fee applies to custom amounts entered into Square Register that are not associated with a particular item. */ applies_to_custom_amounts?: boolean; /** @@ -6743,14 +6779,18 @@ export class V1Fee { */ enabled?: boolean; /** - * Whether the fee is ADDITIVE or INCLUSIVE. See [V1FeeInclusionType](#type-v1feeinclusiontype) for possible values + * Whether the fee is ADDITIVE or INCLUSIVE. See [V1FeeInclusionType](#type-v1feeinclusiontype) for possible values. */ inclusion_type?: V1Fee.InclusionTypeEnum; /** * In countries with multiple classifications for sales taxes, indicates which classification the fee falls under. - * Currently relevant only to Canadian merchants. See [V1FeeType](#type-v1feetype) for possible values + * Currently relevant only to Canadian merchants. See [V1FeeType](#type-v1feetype) for possible values. */ type?: V1Fee.TypeEnum; + /** + * The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID. + */ + v2_id?: string; } export namespace V1Fee { @@ -6805,8 +6845,8 @@ export class V1InventoryEntry { */ export class V1Item { /** - * The item's ID. Must be unique among all entity IDs ever provided on behalf of the merchant. You can never reuse - * an ID. This value can include alphanumeric characters, dashes (-), and underscores (_). + * The item's ID. Must be unique among all entity IDs ever provided on behalf of the merchant. + * You can never reuse an ID. This value can include alphanumeric characters, dashes (-), and underscores (_). */ id?: string; /** @@ -6818,23 +6858,21 @@ export class V1Item { */ description?: string; /** - * The item's type. This value is NORMAL for almost all items. See [V1ItemType](#type-v1itemtype) for possible - * values + * The item's type. This value is NORMAL for almost all items. See [V1ItemType](#type-v1itemtype) for possible values. */ type?: V1Item.TypeEnum; /** * The color of the discount's display label in Square Register, if not the default color. The default color is - * 9da2a6. See [V1ItemColor](#type-v1itemcolor) for possible values + * 9da2a6. See [V1ItemColor](#type-v1itemcolor) for possible values. */ color?: V1Item.ColorEnum; /** - * The text of the item's display label in Square Register. Only up to the first five characters of the string are - * used. + * The text of the item's display label in Square Register. Only up to the first five characters of the string are used. */ abbreviation?: string; /** - * Indicates whether the item is viewable from the merchant's online store (PUBLIC) or PRIVATE. See - * [V1ItemVisibility](#type-v1itemvisibility) for possible values + * Indicates whether the item is viewable from the merchant's online store (PUBLIC) or PRIVATE. + * See [V1ItemVisibility](#type-v1itemvisibility) for possible values. */ visibility?: V1Item.VisibilityEnum; /** @@ -6873,6 +6911,10 @@ export class V1Item { * If true, the item can be added to pickup orders from the merchant's online store. Default value: false */ available_for_pickup?: boolean; + /** + * The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID. + */ + v2_id?: string; } export namespace V1Item { @@ -6926,13 +6968,12 @@ export class V1ListBankAccountsResponse { export class V1ListCashDrawerShiftsRequest { /** - * The order in which cash drawer shifts are listed in the response, based on their created_at field. Default value: - * ASC See [SortOrder](#type-sortorder) for possible values + * The order in which cash drawer shifts are listed in the response, based on their created_at field. + * Default value: ASC See [SortOrder](#type-sortorder) for possible values. */ order?: V1ListCashDrawerShiftsRequest.OrderEnum; /** - * The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 - * days. + * The beginning of the requested reporting period, in ISO 8601 format. Default value: The current time minus 90 days. */ begin_time?: string; /** @@ -6966,8 +7007,8 @@ export class V1ListDiscountsResponse { export class V1ListEmployeeRolesRequest { /** - * The order in which employees are listed in the response, based on their created_at field.Default value: ASC See - * [SortOrder](#type-sortorder) for possible values + * The order in which employees are listed in the response, based on their created_at field. + * Default value: ASC See [SortOrder](#type-sortorder) for possible values. */ order?: V1ListEmployeeRolesRequest.OrderEnum; /** @@ -6993,8 +7034,8 @@ export class V1ListEmployeeRolesResponse { export class V1ListEmployeesRequest { /** - * The order in which employees are listed in the response, based on their created_at field. Default value: ASC - * See [SortOrder](#type-sortorder) for possible values + * The order in which employees are listed in the response, based on their created_at field. + * Default value: ASC See [SortOrder](#type-sortorder) for possible values. */ order?: V1ListEmployeesRequest.OrderEnum; /** @@ -7007,8 +7048,7 @@ export class V1ListEmployeesRequest { */ end_updated_at?: string; /** - * If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 - * format. + * If filtering results by their created_at field, the beginning of the requested reporting period, in ISO 8601 format. */ begin_created_at?: string; /** @@ -7016,8 +7056,8 @@ export class V1ListEmployeesRequest { */ end_created_at?: string; /** - * If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE). See - * [V1ListEmployeesRequestStatus](#type-v1listemployeesrequeststatus) for possible values + * If provided, the endpoint returns only employee entities with the specified status (ACTIVE or INACTIVE). + * See [V1ListEmployeesRequestStatus](#type-v1listemployeesrequeststatus) for possible values. */ status?: V1ListEmployeesRequest.StatusEnum; /** @@ -7226,8 +7266,8 @@ export class V1ListSettlementsRequest { */ limit?: number; /** - * Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED). See - * [V1ListSettlementsRequestStatus](#type-v1listsettlementsrequeststatus) for possible values + * Provide this parameter to retrieve only settlements with a particular status (SENT or FAILED). + * See [V1ListSettlementsRequestStatus](#type-v1listsettlementsrequeststatus) for possible values */ status?: V1ListSettlementsRequest.StatusEnum; /** @@ -7461,8 +7501,8 @@ export class V1MerchantBusinessType {} */ export class V1MerchantLocationDetails { /** - * The nickname assigned to the single-location account by the parent business. This value appears in the parent - * business's multi-location dashboard. + * The nickname assigned to the single-location account by the parent business. + * This value appears in the parent business's multi-location dashboard. */ nickname?: string; } @@ -7480,14 +7520,18 @@ export class V1ModifierList { */ name?: string; /** - * Indicates whether MULTIPLE options or a SINGLE option from the modifier list can be applied to a single item. See - * [V1ModifierListSelectionType](#type-v1modifierlistselectiontype) for possible values + * Indicates whether MULTIPLE options or a SINGLE option from the modifier list can be applied to a single item. + * See [V1ModifierListSelectionType](#type-v1modifierlistselectiontype) for possible values. */ selection_type?: V1ModifierList.SelectionTypeEnum; /** * The options included in the modifier list. */ modifier_options?: Array; + /** + * The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID. + */ + v2_id?: string; } export namespace V1ModifierList { @@ -7520,8 +7564,8 @@ export class V1ModifierOption { */ on_by_default?: boolean; /** - * Indicates the modifier option's list position when displayed in Square Register and the merchant dashboard. If - * more than one modifier option in the same modifier list has the same ordinal value, those options are displayed + * Indicates the modifier option's list position when displayed in Square Register and the merchant dashboard. + * If more than one modifier option in the same modifier list has the same ordinal value, those options are displayed * in alphabetical order. */ ordinal?: number; @@ -7529,6 +7573,10 @@ export class V1ModifierOption { * The ID of the modifier list the option belongs to. */ modifier_list_id?: string; + /** + * The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID. + */ + v2_id?: string; } export class V1Money { @@ -7538,7 +7586,7 @@ export class V1Money { */ amount?: number; /** - * See [Currency](#type-currency) for possible values + * See [Currency](#type-currency) for possible values. */ currency_code?: V1Money.CurrencyCodeEnum; } @@ -7950,13 +7998,14 @@ export class V1PageCellObjectType {} export class V1PageCellPlaceholderType {} /** - * A payment represents a paid transaction between a Square merchant and a customer. Payment details are usually - * available from Connect API endpoints within a few minutes after the transaction completes. Each Payment object - * includes several fields that end in `_money`. These fields describe the various amounts of money that contribute to - * the payment total:
  • Monetary values are positive if they represent an increase in the - * amount of money the merchant receives (e.g., tax_money, tip_money).
  • Monetary - * values are negative if they represent an decrease in the amount of money the merchant receives (e.g., - * discount_money, refunded_money).
+ * A payment represents a paid transaction between a Square merchant and a customer. + * Payment details are usually available from Connect API endpoints within a few minutes after the transaction completes. + * Each Payment object includes several fields that end in `_money`. + * These fields describe the various amounts of money that contribute to the payment total: + *
  • Monetary values are positive if they represent an increase in the amount of money the merchant receives + * (e.g., tax_money, tip_money).
  • + *
  • Monetary values are negative if they represent an decrease in the amount of money the merchant receives + * (e.g., discount_money, refunded_money).
*/ export class V1Payment { /** @@ -8050,13 +8099,12 @@ export class V1Payment { */ additive_tax?: Array; /** - * All of the additive taxes associated with the payment. + * All of the tenders associated with the payment. */ tender?: Array; /** - * All of the refunds applied to the payment. Note that the value of all refunds on a payment can exceed the value - * of all tenders if a merchant chooses to refund money to a tender after previously accepting returned goods as - * part of an exchange. + * All of the refunds applied to the payment. Note that the value of all refunds on a payment can exceed the value of all + * tenders if a merchant chooses to refund money to a tender after previously accepting returned goods as part of an exchange. */ refunds?: Array; /** @@ -8091,8 +8139,7 @@ export class V1PaymentDiscount { */ applied_money?: V1Money; /** - * The ID of the applied discount, if available. Discounts applied in older versions of Square Register might not - * have an ID. + * The ID of the applied discount, if available. Discounts applied in older versions of Square Register might not have an ID. */ discount_id?: string; } @@ -8824,8 +8871,7 @@ export class V1UpdateModifierListRequestSelectionType {} export class V1UpdateModifierOptionRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body: V1ModifierOption; } @@ -8869,32 +8915,28 @@ export class V1UpdateOrderRequestAction {} export class V1UpdatePageCellRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body: V1PageCell; } export class V1UpdatePageRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body: V1Page; } export class V1UpdateTimecardRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body: V1Timecard; } export class V1UpdateVariationRequest { /** - * An object containing the fields to POST for the request. See the corresponding object definition for field - * details. + * An object containing the fields to POST for the request. See the corresponding object definition for field details. */ body: V1Variation; } @@ -8922,8 +8964,8 @@ export class V1Variation { */ ordinal?: number; /** - * Indicates whether the item variation's price is fixed or determined at the time of sale. See - * [V1VariationPricingType](#type-v1variationpricingtype) for possible values + * Indicates whether the item variation's price is fixed or determined at the time of sale. + * See [V1VariationPricingType](#type-v1variationpricingtype) for possible values. */ pricing_type?: V1Variation.PricingTypeEnum; /** @@ -8940,8 +8982,7 @@ export class V1Variation { track_inventory?: boolean; /** * Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its - * inventory_alert_threshold. See [V1VariationInventoryAlertType](#type-v1variationinventoryalerttype) for possible - * values + * inventory_alert_threshold. See [V1VariationInventoryAlertType](#type-v1variationinventoryalerttype) for possible values. */ inventory_alert_type?: V1Variation.InventoryAlertTypeEnum; /** @@ -8953,6 +8994,10 @@ export class V1Variation { * Arbitrary metadata associated with the variation. Cannot exceed 255 characters. */ user_data?: string; + /** + * The ID of the CatalogObject in the Connect v2 API. Objects that are shared across multiple locations share the same v2 ID. + */ + v2_id?: string; } export namespace V1Variation { @@ -8974,11 +9019,13 @@ export class V1VariationInventoryAlertType {} export class V1VariationPricingType {} +/** + * Defines the request body for calls to the VoidTransaction endpoint. + */ export class VoidTransactionRequest {} /** - * Defines the fields that are included in the response body of a request to the - * [VoidTransaction](#endpoint-voidtransaction) endpoint. + * Defines the fields that are included in the response body of a request to the VoidTransaction endpoint. */ export class VoidTransactionResponse { /** @@ -8993,8 +9040,7 @@ export class VoidTransactionResponse { export class Weekday {} /** - * Sets the Day of the week and hour of the day that a business starts a work week. Used for the calculation of - * overtime pay. + * Sets the Day of the week and hour of the day that a business starts a work week. Used for the calculation of overtime pay. */ export class WorkweekConfig { /** @@ -9003,6 +9049,7 @@ export class WorkweekConfig { id?: string; /** * The day of the week on which a business week cuts over for compensation purposes. + * See [Weekday](#type-weekday) for possible values. */ start_of_week: WorkweekConfig.StartOfWeekEnum; /** @@ -9016,11 +9063,11 @@ export class WorkweekConfig { */ version?: number; /** - * A read-only timestamp in RFC 3339 format; presented in UTC + * A read-only timestamp in RFC 3339 format; presented in UTC. */ created_at?: string; /** - * A read-only timestamp in RFC 3339 format; presented in UTC + * A read-only timestamp in RFC 3339 format; presented in UTC. */ updated_at?: string; } @@ -9037,6 +9084,17 @@ export namespace WorkweekConfig { } } +export class ApplePayApi { + /** + * Activates a domain for use with Web Apple Pay and Square. + * A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. + * This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using + * their platform. To learn more about Apple Pay on Web see the Apple Pay section in the + * [Embedding the Square Payment Form](/payments/sqpaymentform/overview) guide. + */ + registerDomain(params: RegisterDomainRequest): Promise; +} + export class CatalogApi { /** * Deletes a set of [CatalogItem](#type-catalogitem)s based on the provided list of target IDs and returns a set of successfully @@ -9108,6 +9166,59 @@ export class CatalogApi { upsertCatalogObject(params: UpsertCatalogObjectRequest): Promise; } +export class CheckoutApi { + /** + * Links a `checkoutId` to a `checkout_page_url` that customers will be directed to in order to provide their payment + * information using a payment processing workflow hosted on connect.squareup.com. + */ + createCheckout(params: CreateCheckoutRequest): Promise; +} + +export class CustomersApi { + /** + * Creates a new customer for a business, which can have associated cards on file. You must provide at least one of the + * following values in your request to this endpoint: `given_name`. `family_name`, `company_name`, `email_address`,`phone_number`. + */ + createCustomer(params: CreateCustomerRequest): Promise; + /** + * Adds a card on file to an existing customer. As with charges, calls to `CreateCustomerCard` are idempotent. + * Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the + * _first_ call. Cards on file are automatically updated on a monthly basis to confirm they are still valid and can be charged. + */ + createCustomerCard(params: CreateCustomerCardRequest): Promise; + /** + * Deletes a customer from a business, along with any linked cards on file. When two profiles are merged into a single profile, + * that profile is assigned a new `customer_id`. You must use the new `customer_id` to delete merged profiles. + */ + deleteCustomer(params: DeleteCustomerRequest): Promise; + /** + * Removes a card on file from a customer. + */ + deleteCustomerCard(params: DeleteCustomerCardRequest): Promise; + /** + * Lists a business's customers. + */ + listCustomers(params: ListCustomersRequest): Promise; + /** + * Returns details for a single customer. + */ + retrieveCustomer(params: RetrieveCustomerRequest): Promise; + /** + * Searches the customer profiles associated with a Square account. + * Calling SearchCustomers without an explicit query parameter returns all customer profiles ordered alphabetically based + * on `given_name` and `family_name`. + */ + searchCustomers(params: SearchCustomersRequest): Promise; + /** + * Updates the details of an existing customer. When two profiles are merged into a single profile, that profile is assigned + * a new `customer_id`. You must use the new `customer_id` to update merged profiles. + * You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the + * existing card on file with the [DeleteCustomerCard](#endpoint-customers-deletecustomercard) endpoint, then create a + * new one with the [CreateCustomerCard](#endpoint-customers-createcustomercard) endpoint. + */ + updateCustomer(params: UpdateCustomerRequest): Promise; +} + export class OrdersApi { /** * Retrieves a set of [Order](#type-order)s by their IDs. @@ -9125,9 +9236,6 @@ export class OrdersApi { } // TBU... -export class ApplePayApi {} -export class CheckoutApi {} -export class CustomersApi {} export class EmployeesApi {} export class LaborApi {} export class MobileAuthorizationApi {} From b63d70da01c08c0f5d284ba1689aa842ebb41f3e Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Sun, 21 Apr 2019 20:40:45 +0300 Subject: [PATCH 11/14] [atom] Revert getLastCursor type (#34869) Apparently, `getLastCursor` returning `undefined` was unintened and evidently was at some point silently fixed, at least in most cases. --- types/atom/atom-tests.ts | 3 +-- types/atom/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index feb6d9fe31..9a04b9c7b6 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -17,7 +17,6 @@ declare const mouseEvent: MouseEvent; declare let buffer: Atom.TextBuffer; declare const color: Atom.Color; -declare let maybeCursor: Atom.Cursor | undefined; declare let cursor: Atom.Cursor; declare let cursors: Atom.Cursor[]; declare let decoration: Atom.Decoration; @@ -2790,7 +2789,7 @@ function testTextEditor() { editor.moveToBeginningOfPreviousParagraph(); editor.selectLargerSyntaxNode(); editor.selectSmallerSyntaxNode(); - maybeCursor = editor.getLastCursor(); + cursor = editor.getLastCursor(); str = editor.getWordUnderCursor(); str = editor.getWordUnderCursor({}); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 3e2b8f33d5..fb230420c0 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1939,7 +1939,7 @@ export class TextEditor { moveToBeginningOfPreviousParagraph(): void; /** Returns the most recently added Cursor. */ - getLastCursor(): Cursor | undefined; + getLastCursor(): Cursor; /** Returns the word surrounding the most recently added cursor. */ getWordUnderCursor(options?: { From fc57ce331b2293bf9cc790a0f10a8a48b0b5c6c4 Mon Sep 17 00:00:00 2001 From: Pascal Sthamer Date: Sun, 21 Apr 2019 20:33:30 +0200 Subject: [PATCH 12/14] [ts3-nodejs-library] Add and enhance typings, remove unneeded dependency (#34873) * Add ts3-nodejs-library typings * Use files instead of include * Fix json error in tsconfig * Require at least TypeScript Version 3.0 * Fix typescript version header * Remove duplicate typings in subclasses of the abstract class * Add constructor list typings * type-safe events construct, remove unneeded steam dependency and more * Add more typings * Correctly reference node types for Buffer and Fix linting issues * Type 'close' and 'error' event * Type 'clientdisconnect', 'flooding', 'debug' and ready events --- types/ts3-nodejs-library/TeamSpeak3.d.ts | 116 +++++++++++++++++- types/ts3-nodejs-library/index.d.ts | 1 + .../ts3-nodejs-library/property/Channel.d.ts | 3 + types/ts3-nodejs-library/property/Client.d.ts | 16 +++ 4 files changed, 130 insertions(+), 6 deletions(-) diff --git a/types/ts3-nodejs-library/TeamSpeak3.d.ts b/types/ts3-nodejs-library/TeamSpeak3.d.ts index 29c45158e4..6909a31409 100644 --- a/types/ts3-nodejs-library/TeamSpeak3.d.ts +++ b/types/ts3-nodejs-library/TeamSpeak3.d.ts @@ -1,3 +1,5 @@ +/// + import { EventEmitter } from 'events'; import TeamSpeakChannel = require('./property/Channel'); import TeamSpeakClient = require('./property/Client'); @@ -5,9 +7,6 @@ import TeamSpeakServer = require('./property/Server'); import TeamSpeakServerGroup = require('./property/ServerGroup'); import TeamSpeakChannelGroup = require('./property/ChannelGroup'); -// For the buffer type. -import * as stream from 'steam'; - // We need this namespace, becaue we can't just export the interface directly, // as it would conflict with export = TeamSpeak3. declare namespace TeamSpeak3 { @@ -29,6 +28,111 @@ declare namespace TeamSpeak3 { /** Maximum wait time for the connection to get established. Defaults to 20000. */ readyTimeout?: number; } + + enum TargetMode { + CLIENT = 1, + CHANNEL = 2, + VIRTUAL_SERVER = 3 + } + + enum ClientType { + CLIENT = 0, + QUERY = 1 + } + + interface MessageData { + invoker: TeamSpeakClient; + msg: string; + targetmode: TargetMode; + } + + interface WhoAmIResponse { + virtualserver_status: string; + virtualserver_id: number; + virtualserver_unique_identifier: string; + virtualserver_port: number; + client_id: number; + client_channel_id: number; + client_nickname: string; + client_database_id: number; + cient_login_name: string; + client_unique_identifier: string; + client_origin_server_id: number; + } + + interface ClientMovedResponse { + client: TeamSpeakClient; + channel: TeamSpeakChannel; + reasonid: number; + } + + interface ServerGroupClientListResponse { + cldbid: number; + client_nickname: string; + client_unique_identifier: string; + } + + interface DisconnectedClient { + clid: number; + cid: number; + client_database_id: number; + client_nickname: string; + client_type: ClientType; + client_away: number; + client_away_message: string | undefined; + client_flag_talking: number; + client_input_muted: number; + client_output_muted: number; + client_input_hardware: number; + client_output_hardware: number; + client_talk_power: number; + client_is_talker: number; + client_is_priority_speaker: number; + client_is_recording: number; + client_is_channel_commander: number; + client_unique_identifier: string; + client_servergroups: number[]; + client_channel_group_id: number; + client_channel_group_inherited_channel_id: number; + client_version: string; + client_platform: string; + client_idle_time: number; + client_created: number; + client_lastconnected: number; + client_icon_id: number; + client_country: string | undefined; + connection_client_ip: string; + } + + interface DisconnectEvent { + cfid: number; + ctid: number; + reasonid: number; + reasonmsg: string; + clid: number; + } + + interface ClientDisconnectResponse { + client: DisconnectedClient; + event: DisconnectEvent; + } + + interface DebugInformation { + type: string; + data: string; + } +} + +interface TeamSpeak3 { + // Type-safe events. + on(event: 'textmessage', listener: (data: TeamSpeak3.MessageData) => void): this; + on(event: 'clientconnect', listener: (data: { client: TeamSpeakClient }) => void): this; + on(event: 'clientmoved', listener: (data: TeamSpeak3.ClientMovedResponse) => void): this; + on(event: 'clientdisconnect', listener: (data: TeamSpeak3.ClientDisconnectResponse) => void): this; + on(event: 'close' | 'error' | 'flooding', listener: (err: Error) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'debug', listener: (debug: TeamSpeak3.DebugInformation) => void): this; + on(event: string, listener: () => any): this; } declare class TeamSpeak3 extends EventEmitter { @@ -143,7 +247,7 @@ declare class TeamSpeak3 extends EventEmitter { /** * Displays information about your current ServerQuery connection including your loginname, etc. */ - whoami(): Promise; + whoami(): Promise; /** * Displays detailed configuration information about the selected virtual server @@ -216,7 +320,7 @@ declare class TeamSpeak3 extends EventEmitter { * Displays the IDs of all clients currently residing in the server group. * @param - the ServerGroup id */ - serverGroupClientList(sgid: number): Promise; + serverGroupClientList(sgid: number): Promise | null; /** * Adds the client to the server group specified with sgid. @@ -846,7 +950,7 @@ declare class TeamSpeak3 extends EventEmitter { * Lists all Clients with a given Filter * @param - Filter Object */ - clientList(filter: any): Promise; + clientList(filter?: any): Promise; /** * Displays a list of files and directories stored in the specified channels file repository. diff --git a/types/ts3-nodejs-library/index.d.ts b/types/ts3-nodejs-library/index.d.ts index 913b2a0899..2d2c4bfa6b 100644 --- a/types/ts3-nodejs-library/index.d.ts +++ b/types/ts3-nodejs-library/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Multivit4min/TS3-NodeJS-Library // Definitions by: Pascal Sthamer // David Kartnaller +// Mattis Krämer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 diff --git a/types/ts3-nodejs-library/property/Channel.d.ts b/types/ts3-nodejs-library/property/Channel.d.ts index a66a3762a5..4f061dce51 100644 --- a/types/ts3-nodejs-library/property/Channel.d.ts +++ b/types/ts3-nodejs-library/property/Channel.d.ts @@ -11,6 +11,9 @@ interface ChannelListResponse { declare class TeamSpeakChannel extends Abstract { constructor(parent: TeamSpeak3, list: ChannelListResponse) + /** Returns the Name of the channel */ + name: string; + /** * Returns the ID of the Channel * @returns the Channels ID diff --git a/types/ts3-nodejs-library/property/Client.d.ts b/types/ts3-nodejs-library/property/Client.d.ts index b75b9b1863..9e778331d3 100644 --- a/types/ts3-nodejs-library/property/Client.d.ts +++ b/types/ts3-nodejs-library/property/Client.d.ts @@ -11,9 +11,25 @@ interface ClientListResponse { client_unique_identifier: string; } +declare enum ClientType { + CLIENT = 0, + QUERY = 1 +} + declare class TeamSpeakClient extends Abstract { constructor(parent: TeamSpeak3, list: ClientListResponse) + /** Returns the Client Type: 0 = CLIENT, 1 = QUERY */ + type: ClientType; + /** Client Nickname */ + nickname: string; + /** Array of client Servergroups */ + servergroups: number[]; + /** The ChannelID of the client */ + cid: number; + /** The UID of the client */ + client_unique_identifier: string; + /** * Returns the Database ID of the Client * @returns the Clients Database ID From ab81d886b0a6447e9963314e8384d9438fd338f1 Mon Sep 17 00:00:00 2001 From: Brekk Date: Sun, 21 Apr 2019 20:37:00 +0200 Subject: [PATCH 13/14] fix ramda trailing commas (#34877) --- types/ramda/index.d.ts | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index eec2a628fc..17cc7ac6c2 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -27,6 +27,7 @@ // Nitesh Phadatare // Krantisinh Deshmukh // Pierre-Antoine Mills +// Brekk Bockrath // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.3 @@ -646,32 +647,32 @@ declare namespace R { } type PipeWithFns = [ - (x0: V0) => T, + (x0: V0) => T ] | [ (x0: V0) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, (x: any) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, (x: any) => any, (x: any) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, @@ -679,7 +680,7 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, @@ -688,7 +689,7 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, @@ -698,7 +699,7 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ] | [ (x0: V0) => any, (x: any) => any, @@ -709,36 +710,36 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: any) => T, + (x: any) => T ]; type ComposeWithFns = [ - (x0: V0) => T, + (x0: V0) => T ] | [ (x: any) => T, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, (x: any) => any, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, (x: any) => any, (x: any) => any, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, (x: any) => any, (x: any) => any, (x: any) => any, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, @@ -746,7 +747,7 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, @@ -755,7 +756,7 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, @@ -765,7 +766,7 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: V0) => any, + (x: V0) => any ] | [ (x: any) => T, (x: any) => any, @@ -776,7 +777,7 @@ declare namespace R { (x: any) => any, (x: any) => any, (x: any) => any, - (x: V0) => any, + (x: V0) => any ]; type Merge = { [K in keyof Primary]: Primary[K] } & { [K in Exclude>]: Secondary[K] }; From ebee278c6632a8832e7b88027f6c610d4225fc6e Mon Sep 17 00:00:00 2001 From: yinz Date: Mon, 22 Apr 2019 02:41:42 +0800 Subject: [PATCH 14/14] `multiple` type should be MultipleConfigurationMergeFunction (#34754) * fix: `multiple` type should be MultipleConfigurationMergeFunction * test: fix webpackMerge.multiple case * style: single queto --- types/webpack-merge/index.d.ts | 2 +- types/webpack-merge/webpack-merge-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/webpack-merge/index.d.ts b/types/webpack-merge/index.d.ts index 91b1dbcef0..1e2d4aa720 100644 --- a/types/webpack-merge/index.d.ts +++ b/types/webpack-merge/index.d.ts @@ -32,7 +32,7 @@ declare namespace webpackMerge { (customizeOptions: CustomizeOptions): ConfigurationMergeFunction; unique: UniqueFunction; smart: ConfigurationMergeFunction; - multiple: ConfigurationMergeFunction; + multiple: MultipleConfigurationMergeFunction; strategy(options: { [field: string]: MergeStrategy }): ConfigurationMergeFunction; smartStrategy(options: { [key: string]: MergeStrategy }): ConfigurationMergeFunction; } diff --git a/types/webpack-merge/webpack-merge-tests.ts b/types/webpack-merge/webpack-merge-tests.ts index 16d8c102c3..4a2bdc5ac1 100644 --- a/types/webpack-merge/webpack-merge-tests.ts +++ b/types/webpack-merge/webpack-merge-tests.ts @@ -10,7 +10,7 @@ const b: Configuration = { const c: Configuration = webpackMerge(a, b); const d: Configuration = webpackMerge.smart(a, b); -const e: Configuration = webpackMerge.multiple(a, b); +const e: Configuration[] = webpackMerge.multiple({a, b}); const f: Configuration = webpackMerge( { customizeArray(x: any[], y: any[], key: string): any[] | undefined {