diff --git a/.codelite/.tern-project b/.codelite/.tern-project deleted file mode 100644 index 09b6465..0000000 --- a/.codelite/.tern-project +++ /dev/null @@ -1,13 +0,0 @@ -{ - "libs": ["browser", "ecma5", "ecma6"], - "plugins": { - "commonjs": { - }, - "modules": { - }, - "node_resolve": { - }, - "node": { - } - } -} \ No newline at end of file diff --git a/.codelite/Dialog-macdev.tags b/.codelite/Dialog-macdev.tags deleted file mode 100644 index 96a971f..0000000 Binary files a/.codelite/Dialog-macdev.tags and /dev/null differ diff --git a/.codelite/Dialog.session b/.codelite/Dialog.session deleted file mode 100644 index 0e31174..0000000 --- a/.codelite/Dialog.session +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/.codelite/Dialog.tags b/.codelite/Dialog.tags deleted file mode 100644 index 6f2794a..0000000 Binary files a/.codelite/Dialog.tags and /dev/null differ diff --git a/.codelite/Dialog.workspace.minh_danh b/.codelite/Dialog.workspace.minh_danh deleted file mode 100644 index 34d4191..0000000 --- a/.codelite/Dialog.workspace.minh_danh +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/.codelite/DialogSampleApp.session b/.codelite/DialogSampleApp.session deleted file mode 100644 index 14ee549..0000000 --- a/.codelite/DialogSampleApp.session +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/.codelite/DialogSampleApp.tags b/.codelite/DialogSampleApp.tags deleted file mode 100644 index e1f80cd..0000000 Binary files a/.codelite/DialogSampleApp.tags and /dev/null differ diff --git a/.codelite/HelloWorld-cameron_henlin.tags b/.codelite/HelloWorld-cameron_henlin.tags deleted file mode 100644 index 7970a43..0000000 Binary files a/.codelite/HelloWorld-cameron_henlin.tags and /dev/null differ diff --git a/.codelite/HelloWorld-macdev.tags b/.codelite/HelloWorld-macdev.tags deleted file mode 100644 index ce25e85..0000000 Binary files a/.codelite/HelloWorld-macdev.tags and /dev/null differ diff --git a/.codelite/HelloWorld-macdev.tags-shm b/.codelite/HelloWorld-macdev.tags-shm deleted file mode 100644 index dbfc882..0000000 Binary files a/.codelite/HelloWorld-macdev.tags-shm and /dev/null differ diff --git a/.codelite/HelloWorld-macdev.tags-wal b/.codelite/HelloWorld-macdev.tags-wal deleted file mode 100644 index f4e291f..0000000 Binary files a/.codelite/HelloWorld-macdev.tags-wal and /dev/null differ diff --git a/.codelite/HelloWorld.session b/.codelite/HelloWorld.session deleted file mode 100644 index 9451c88..0000000 --- a/.codelite/HelloWorld.session +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.codelite/HelloWorld.workspace.cameron_henlin b/.codelite/HelloWorld.workspace.cameron_henlin deleted file mode 100644 index e4cab5a..0000000 --- a/.codelite/HelloWorld.workspace.cameron_henlin +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/.codelite/NuklearQuickDraw-cameron_henlin.tags b/.codelite/NuklearQuickDraw-cameron_henlin.tags deleted file mode 100644 index e69de29..0000000 diff --git a/.codelite/NuklearQuickDraw-cameron_henlin.tags-shm b/.codelite/NuklearQuickDraw-cameron_henlin.tags-shm deleted file mode 100644 index 6bb49fb..0000000 Binary files a/.codelite/NuklearQuickDraw-cameron_henlin.tags-shm and /dev/null differ diff --git a/.codelite/NuklearQuickDraw.session b/.codelite/NuklearQuickDraw.session deleted file mode 100644 index 4418fb5..0000000 --- a/.codelite/NuklearQuickDraw.session +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/.codelite/QuickDrawTest-cameron_henlin.tags b/.codelite/QuickDrawTest-cameron_henlin.tags deleted file mode 100644 index 0a069e9..0000000 Binary files a/.codelite/QuickDrawTest-cameron_henlin.tags and /dev/null differ diff --git a/.codelite/QuickDrawTest.session b/.codelite/QuickDrawTest.session deleted file mode 100644 index f8ee52b..0000000 --- a/.codelite/QuickDrawTest.session +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.codelite/Sys6DialogTestApp.session b/.codelite/Sys6DialogTestApp.session deleted file mode 100644 index 1dc12b7..0000000 --- a/.codelite/Sys6DialogTestApp.session +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/.codelite/Sys6DialogTestApp.tags b/.codelite/Sys6DialogTestApp.tags deleted file mode 100644 index 6c18cba..0000000 Binary files a/.codelite/Sys6DialogTestApp.tags and /dev/null differ diff --git a/.codelite/Sys6Dialogapp.session b/.codelite/Sys6Dialogapp.session deleted file mode 100644 index cbf9aa6..0000000 --- a/.codelite/Sys6Dialogapp.session +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.codelite/Sys6Dialogapp.tags b/.codelite/Sys6Dialogapp.tags deleted file mode 100644 index d789fd9..0000000 Binary files a/.codelite/Sys6Dialogapp.tags and /dev/null differ diff --git a/.codelite/compilation.db b/.codelite/compilation.db deleted file mode 100644 index d4960d2..0000000 Binary files a/.codelite/compilation.db and /dev/null differ diff --git a/.codelite/compile_commands.json b/.codelite/compile_commands.json deleted file mode 100644 index 0637a08..0000000 --- a/.codelite/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/.codelite/cppcheck.list b/.codelite/cppcheck.list deleted file mode 100644 index abd95a6..0000000 --- a/.codelite/cppcheck.list +++ /dev/null @@ -1 +0,0 @@ -/home/minhdanh/Documents/LinuxApps/Dialog/dialog.c diff --git a/.codelite/refactoring.db b/.codelite/refactoring.db deleted file mode 100644 index 2bc195c..0000000 Binary files a/.codelite/refactoring.db and /dev/null differ diff --git a/.codelite/subversion.conf b/.codelite/subversion.conf deleted file mode 100644 index 5fdccfe..0000000 --- a/.codelite/subversion.conf +++ /dev/null @@ -1,5 +0,0 @@ -{ - "svn-settings": { - "m_repoPath": "" - } -} \ No newline at end of file diff --git a/.codelite/valgrind.memcheck.supp b/.codelite/valgrind.memcheck.supp deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0fdaf6a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +.vscode/ +output_js* \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 94df914..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "configurations": [ - { - "name": "Linux", - "includePath": [ - "${workspaceFolder}/**", - "~/Documents/Retro68/InterfacesAndLibraries/**" - ], - "defines": [], - "compilerPath": "/usr/bin/gcc", - "cStandard": "gnu17", - "cppStandard": "gnu++14", - "intelliSenseMode": "linux-gcc-x64" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 7e89774..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "C_Cpp.errorSquiggles": "Enabled", - "files.associations": { - "string.h": "c", - "stdio.h": "c", - "toolutils.h": "c", - "textedit.h": "c", - "types.h": "c", - "resources.h": "c", - "fonts.h": "c", - "devices.h": "c", - "stdlib.h": "c", - "serialhelper.h": "c", - "coprocessorjs.h": "c", - "dialogs.h": "c", - "osutils.h": "c", - "traps.h": "c", - "quickdraw.h": "c" - } -} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 977110b..866ce5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,9 +6,9 @@ cmake_minimum_required(VERSION 2.8) -add_application(NuklearQuickDraw +add_application(MessagesForMacintosh SerialHelper.c coprocessorjs.c - Sample.c - Sample.r + mac_main.c + mac_main.r ) diff --git a/JS/index.js b/JS/index.js index f484e00..9a48192 100644 --- a/JS/index.js +++ b/JS/index.js @@ -4,6 +4,9 @@ const InMemoryCache = require('apollo-cache-inmemory').InMemoryCache; const createHttpLink = require('apollo-link-http').createHttpLink; const gql = require('graphql-tag') +// TEST_MODE can be turned on or off to prevent communications with the Apollo iMessage Server running on your moder Mac +const TEST_MODE = true + const defaultOptions = { watchQuery: { fetchPolicy: 'no-cache', @@ -148,7 +151,6 @@ const widthFor12ptFont = [ 8 ] - // this is tied to Sample.c's message window max width const MAX_WIDTH = 304 const SPACE_WIDTH = widthFor12ptFont[32] @@ -169,7 +171,7 @@ const getNextWordLength = (word) => { currentWidth += currentCharWidth } -return currentWidth + return currentWidth } const shortenText = (text) => { @@ -273,12 +275,68 @@ const splitMessages = (messages) => { return messageOutput } +const parseChatsToFriendlyNameString = (chats) => { + + let friendlyNameStrings = `` + + if (!chats) { + + return `` + } + + for (let chat of chats) { + + friendlyNameStrings = `${friendlyNameStrings},${chat.friendlyName.replace(/,/g, '')}` + } + + friendlyNameStrings = friendlyNameStrings.substring(1, friendlyNameStrings.length) + + console.log(`chats`) + console.log(friendlyNameStrings) + + return friendlyNameStrings +} + let lastMessageOutput +const TEST_MESSAGES = [ + {chatter: `friend 1`, text: `my super fun text message`}, + {chatter: `me`, text: `some cool old thing I said earlier`}, + {chatter: `friend 2`, text: `this message is not relevant to the conversation! not at all :(`}, + {chatter: `friend 1`, text: `i watch star wars in reverse order`}, + {chatter: `me`, text: `https://github.com/CamHenlin/MessagesForMacintosh https://github.com/CamHenlin/MessagesForMacintosh`}, + {chatter: `friend 3`, text: `i'm just catching up`}, + {chatter: `friend 3`, text: `nobody chat for a minute`}, + {chatter: `friend 2`, text: `hang on`}, + {chatter: `friend 1`, text: `no`} +] + +const TEST_CHATS = [ + {friendlyName: `my group chat 1`, name: `my group chat 1`}, + {friendlyName: `friend 1`, name: `friend 1`}, + {friendlyName: `friend 4`, name: `friend 4`}, + {friendlyName: `boss`, name: `boss`}, + {friendlyName: `friend 3`, name: `friend 3`}, + {friendlyName: `restaurant`, name: `restaurant`} +] + +if (TEST_MODE) { + + setInterval(() => { + + TEST_MESSAGES = TEST_MESSAGES.concat({chatter: `friend 1`, text: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 64)}) + }, 10000) +} + class iMessageClient { async getMessages (chatId, page) { + if (TEST_MODE) { + + return splitMessages(TEST_MESSAGES) + } + console.log(`get messages for chat ID: ${chatId}`) let result @@ -327,6 +385,13 @@ class iMessageClient { async sendMessage (chatId, message) { + if (TEST_MODE) { + + TEST_MESSAGES = TEST_MESSAGES.concat({sender: `me`, text: message}) + + return splitMessages(TEST_MESSAGES) + } + console.log(`send message`) console.log(chatId) console.log(message) @@ -361,6 +426,11 @@ class iMessageClient { async getChats () { + if (TEST_MODE) { + + return parseChatsToFriendlyNameString(TEST_CHATS) + } + let result try { @@ -385,30 +455,19 @@ class iMessageClient { } let chats = result.data.getChats - let friendlyNameStrings = `` - if (!chats) { - - return `` - } - - for (let chat of chats) { - - friendlyNameStrings = `${friendlyNameStrings},${chat.friendlyName.replace(/,/g, '')}` - } - - friendlyNameStrings = friendlyNameStrings.substring(1, friendlyNameStrings.length) - - console.log(`chats`) - console.log(friendlyNameStrings) - - return friendlyNameStrings + return parseChatsToFriendlyNameString(chats) } setIPAddress (IPAddress) { console.log(`instantiate apolloclient with uri ${IPAddress}:4000/`) + if (TEST_MODE) { + + return + } + try { client = new ApolloClient({ diff --git a/Sample.r b/Sample.r deleted file mode 100644 index 9db4ac4..0000000 --- a/Sample.r +++ /dev/null @@ -1 +0,0 @@ -/* # # Apple Macintosh Developer Technical Support # # MultiFinder-Aware Simple Sample Application # # Sample # # Sample.r - Rez Source # # Copyright © 1989 Apple Computer, Inc. # All rights reserved. # # Versions: # 1.00 08/88 # 1.01 11/88 # 1.02 04/89 MPW 3.1 # # Components: # Sample.p April 1, 1989 # Sample.c April 1, 1989 # Sample.a April 1, 1989 # Sample.inc1.a April 1, 1989 # SampleMisc.a April 1, 1989 # Sample.r April 1, 1989 # Sample.h April 1, 1989 # [P]Sample.make April 1, 1989 # [C]Sample.make April 1, 1989 # [A]Sample.make April 1, 1989 # # Sample is an example application that demonstrates how to # initialize the commonly used toolbox managers, operate # successfully under MultiFinder, handle desk accessories, # and create, grow, and zoom windows. # # It does not by any means demonstrate all the techniques # you need for a large application. In particular, Sample # does not cover exception handling, multiple windows/documents, # sophisticated memory management, printing, or undo. All of # these are vital parts of a normal full-sized application. # # This application is an example of the form of a Macintosh # application; it is NOT a template. It is NOT intended to be # used as a foundation for the next world-class, best-selling, # 600K application. A stick figure drawing of the human body may # be a good example of the form for a painting, but that does not # mean it should be used as the basis for the next Mona Lisa. # # We recommend that you review this program or TESample before # beginning a new application. */ #include "Types.r" #include "Sample.h" /* this is a definition for a resource which contains only a rectangle */ type 'RECT' { rect; }; /* we use an MBAR resource to conveniently load all the menus */ resource 'MBAR' (rMenuBar, preload) { { mApple, mFile, mEdit, mLight, mHelp }; /* five menus */ }; resource 'MENU' (mApple, preload) { mApple, textMenuProc, AllItems & ~MenuItem2, /* Disable dashed line, enable About and DAs */ enabled, apple, { "About Messages", noicon, nokey, nomark, plain; "-", noicon, nokey, nomark, plain } }; resource 'MENU' (mFile, preload) { mFile, textMenuProc, MenuItem12, /* enable Quit only, program enables others */ enabled, "File", { "New", noicon, "N", nomark, plain; "Open", noicon, "O", nomark, plain; "-", noicon, nokey, nomark, plain; "Close", noicon, "W", nomark, plain; "Save", noicon, "S", nomark, plain; "Save As", noicon, nokey, nomark, plain; "Revert", noicon, nokey, nomark, plain; "-", noicon, nokey, nomark, plain; "Page Setup", noicon, nokey, nomark, plain; "Print", noicon, nokey, nomark, plain; "-", noicon, nokey, nomark, plain; "Quit", noicon, "Q", nomark, plain } }; resource 'MENU' (mEdit, preload) { mEdit, textMenuProc, NoItems, /* disable everything, program does the enabling */ enabled, "Edit", { "Undo", noicon, "Z", nomark, plain; "-", noicon, nokey, nomark, plain; "Cut", noicon, "X", nomark, plain; "Copy", noicon, "C", nomark, plain; "Paste", noicon, "V", nomark, plain; "Clear", noicon, nokey, nomark, plain } }; resource 'MENU' (mLight, preload) { mLight, textMenuProc, NoItems, /* disable everything, program does the enabling */ enabled, "Messages", { "New Message", noicon, nokey, nomark, plain; } }; resource 'MENU' (mHelp, preload) { mHelp, textMenuProc, AllItems, /* disable everything, program does the enabling */ enabled, "Help", { "Quick Help", noicon, nokey, nomark, plain; "User Guide", noicon, nokey, nomark, plain; "Test Entry", noicon, nokey, nomark, plain; "Test Entry 2", noicon, nokey, nomark, plain; "Test Entry 3", noicon, nokey, nomark, plain; } }; /* this ALRT and DITL are used as an About screen */ resource 'ALRT' (rAboutAlert, purgeable) { {40, 20, 160, 290}, rAboutAlert, { /* array: 4 elements */ /* [1] */ OK, visible, silent, /* [2] */ OK, visible, silent, /* [3] */ OK, visible, silent, /* [4] */ OK, visible, silent }, centerMainScreen // Where to show the alert }; resource 'DITL' (rAboutAlert, purgeable) { { /* array DITLarray: 5 elements */ /* [1] */ {88, 180, 108, 260}, Button { enabled, "OK" }, /* [2] */ {8, 8, 24, 214}, StaticText { disabled, "Messages for Macintosh" }, /* [3] */ {32, 8, 48, 237}, StaticText { disabled, "Copyright © 2021 Cameron Henlin" }, /* [4] */ {56, 8, 72, 136}, StaticText { disabled, "cam.henlin@gmail.com" }, /* [5] */ {80, 24, 112, 167}, StaticText { disabled, "https://github.com/CamHenlin/MessagesForMacintosh" } } }; /* this ALRT and DITL are used as an error screen */ resource 'ALRT' (rUserAlert, purgeable) { {40, 20, 120, 260}, rUserAlert, { /* array: 4 elements */ /* [1] */ OK, visible, silent, /* [2] */ OK, visible, silent, /* [3] */ OK, visible, silent, /* [4] */ OK, visible, silent }, centerMainScreen // Where to show the alert }; resource 'DITL' (rUserAlert, purgeable) { { /* array DITLarray: 3 elements */ /* [1] */ {50, 150, 70, 230}, Button { enabled, "OK" }, /* [2] */ {10, 60, 30, 230}, StaticText { disabled, "Sample - Error occurred!" }, /* [3] */ {8, 8, 40, 40}, Icon { disabled, 2 } } }; resource 'WIND' (rWindow, preload, purgeable) { {39, 1, 341, 511}, zoomDocProc, visible, noGoAway, 0x0, "Messages", centerMainScreen // Where to show the alert }; resource 'RECT' (rStopRect, preload, purgeable) { {69, 69, 110, 110} }; resource 'RECT' (rXRect, preload, purgeable) { {32, 32, 69, 69} }; resource 'RECT' (rGoRect, preload, purgeable) { {120, 10, 220, 110} }; /* here is the quintessential MultiFinder friendliness device, the SIZE resource */ resource 'SIZE' (-1) { dontSaveScreen, acceptSuspendResumeEvents, enableOptionSwitch, canBackground, /* we can background; we don't currently, but our sleep value */ /* guarantees we don't hog the Mac while we are in the background */ multiFinderAware, /* this says we do our own activate/deactivate; don't fake us out */ backgroundAndForeground, /* this is definitely not a background-only application! */ dontGetFrontClicks, /* change this is if you want "do first click" behavior like the Finder */ ignoreChildDiedEvents, /* essentially, I'm not a debugger (sub-launching) */ not32BitCompatible, /* this app should not be run in 32-bit address space */ reserved, reserved, reserved, reserved, reserved, reserved, reserved, kPrefSize * 1024, kMinSize * 1024 }; \ No newline at end of file diff --git a/build/%NuklearQuickDraw.ad b/build/%NuklearQuickDraw.ad deleted file mode 100644 index f1ca1b6..0000000 Binary files a/build/%NuklearQuickDraw.ad and /dev/null differ diff --git a/build/.finf/NuklearQuickDraw.APPL b/build/.finf/NuklearQuickDraw.APPL deleted file mode 100644 index 6d687eb..0000000 Binary files a/build/.finf/NuklearQuickDraw.APPL and /dev/null differ diff --git a/build/.rsrc/NuklearQuickDraw.APPL b/build/.rsrc/NuklearQuickDraw.APPL deleted file mode 100644 index a08c68d..0000000 Binary files a/build/.rsrc/NuklearQuickDraw.APPL and /dev/null differ diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt deleted file mode 100644 index 1501b82..0000000 --- a/build/CMakeCache.txt +++ /dev/null @@ -1,360 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build -# It was generated by CMake: /usr/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_ADDR2LINE:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-addr2line - -//Path to a program. -CMAKE_AR:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ar - -//Choose the type of build, options are: None Debug Release RelWithDebInfo -// MinSizeRel ... -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_AR:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ar - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ranlib - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_AR:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ar - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_C_COMPILER_RANLIB:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ranlib - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Path to a program. -CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF - -//installation prefix -CMAKE_INSTALL_PREFIX:PATH=/home/camh/Retro68-build/toolchain/m68k-apple-macos - -//Path to a program. -CMAKE_LINKER:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-objdump - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=Project - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ranlib - -//Path to a program. -CMAKE_READELF:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-readelf - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-strip - -//The CMake toolchain file -CMAKE_TOOLCHAIN_FILE:FILEPATH=/home/camh/Retro68-build/toolchain/m68k-apple-macos/cmake/retro68.toolchain.cmake - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -Project_BINARY_DIR:STATIC=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build - -//Value Computed by CMake -Project_SOURCE_DIR:STATIC=/home/camh/Documents/Retro68kApps/NuklearQuickDraw - -//path to root of Retro68 Toolchain -RETRO68_ROOT:PATH=/home/camh/Retro68-build/toolchain - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_ADDR2LINE -CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=16 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=3 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/usr/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR -CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB -CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_AR -CMAKE_C_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER_RANLIB -CMAKE_C_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_DLLTOOL -CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/camh/Documents/Retro68kApps/NuklearQuickDraw -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_READELF -CMAKE_READELF-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.16 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake b/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake deleted file mode 100644 index 70fedf4..0000000 --- a/build/CMakeFiles/3.16.3/CMakeCCompiler.cmake +++ /dev/null @@ -1,76 +0,0 @@ -set(CMAKE_C_COMPILER "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "GNU") -set(CMAKE_C_COMPILER_VERSION "9.1.0") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") - -set(CMAKE_C_PLATFORM_ID "") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_C_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ar") -set(CMAKE_C_COMPILER_AR "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ar") -set(CMAKE_RANLIB "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ranlib") -set(CMAKE_C_COMPILER_RANLIB "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ranlib") -set(CMAKE_LINKER "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ld") -set(CMAKE_MT "") -set(CMAKE_COMPILER_IS_GNUCC 1) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "") -set(CMAKE_C_COMPILER_ABI "") -set(CMAKE_C_LIBRARY_ARCHITECTURE "") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include;/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include") -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;c;retrocrt;Interface") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0;/home/camh/Retro68-build/toolchain/m68k-apple-macos/lib") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake b/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake deleted file mode 100644 index 9018db8..0000000 --- a/build/CMakeFiles/3.16.3/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,88 +0,0 @@ -set(CMAKE_CXX_COMPILER "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "GNU") -set(CMAKE_CXX_COMPILER_VERSION "9.1.0") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") - -set(CMAKE_CXX_PLATFORM_ID "") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_CXX_SIMULATE_VERSION "") - - - -set(CMAKE_AR "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ar") -set(CMAKE_CXX_COMPILER_AR "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ar") -set(CMAKE_RANLIB "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc-ranlib") -set(CMAKE_LINKER "/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-ld") -set(CMAKE_MT "") -set(CMAKE_COMPILER_IS_GNUCXX 1) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - -foreach (lang C OBJC OBJCXX) - if (CMAKE_${lang}_COMPILER_ID_RUN) - foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) - list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) - endforeach() - endif() -endforeach() - -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "") -set(CMAKE_CXX_COMPILER_ABI "") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0/m68k-apple-macos;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0/backward;/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include;/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include") -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc;c;retrocrt;Interface") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0;/home/camh/Retro68-build/toolchain/m68k-apple-macos/lib") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_C.bin deleted file mode 100644 index e69de29..0000000 diff --git a/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin b/build/CMakeFiles/3.16.3/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100644 index e69de29..0000000 diff --git a/build/CMakeFiles/3.16.3/CMakeSystem.cmake b/build/CMakeFiles/3.16.3/CMakeSystem.cmake deleted file mode 100644 index e32f5e6..0000000 --- a/build/CMakeFiles/3.16.3/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Linux-5.11.0-40-generic") -set(CMAKE_HOST_SYSTEM_NAME "Linux") -set(CMAKE_HOST_SYSTEM_VERSION "5.11.0-40-generic") -set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") - -include("/home/camh/Retro68-build/toolchain/m68k-apple-macos/cmake/retro68.toolchain.cmake") - -set(CMAKE_SYSTEM "Retro68-1") -set(CMAKE_SYSTEM_NAME "Retro68") -set(CMAKE_SYSTEM_VERSION "1") -set(CMAKE_SYSTEM_PROCESSOR "") - -set(CMAKE_CROSSCOMPILING "TRUE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/.finf/a.out b/build/CMakeFiles/3.16.3/CompilerIdC/.finf/a.out deleted file mode 100644 index 6d687eb..0000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdC/.finf/a.out and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/.rsrc/a.out b/build/CMakeFiles/3.16.3/CompilerIdC/.rsrc/a.out deleted file mode 100644 index ba2a2f3..0000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdC/.rsrc/a.out and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c b/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index d884b50..0000000 --- a/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,671 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if !defined(__STDC__) -# if (defined(_MSC_VER) && !defined(__clang__)) \ - || (defined(__ibmxl__) || defined(__IBMC__)) -# define C_DIALECT "90" -# else -# define C_DIALECT -# endif -#elif __STDC_VERSION__ >= 201000L -# define C_DIALECT "11" -#elif __STDC_VERSION__ >= 199901L -# define C_DIALECT "99" -#else -# define C_DIALECT "90" -#endif -const char* info_language_dialect_default = - "INFO" ":" "dialect_default[" C_DIALECT "]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/a.out b/build/CMakeFiles/3.16.3/CompilerIdC/a.out deleted file mode 100644 index e69de29..0000000 diff --git a/build/CMakeFiles/3.16.3/CompilerIdC/a.out.gdb b/build/CMakeFiles/3.16.3/CompilerIdC/a.out.gdb deleted file mode 100755 index 28a13e7..0000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdC/a.out.gdb and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/.finf/a.out b/build/CMakeFiles/3.16.3/CompilerIdCXX/.finf/a.out deleted file mode 100644 index 6d687eb..0000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdCXX/.finf/a.out and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/.rsrc/a.out b/build/CMakeFiles/3.16.3/CompilerIdCXX/.rsrc/a.out deleted file mode 100644 index b1abdf8..0000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdCXX/.rsrc/a.out and /dev/null differ diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp b/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index 69cfdba..0000000 --- a/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,660 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__COMO__) -# define COMPILER_ID "Comeau" - /* __COMO_VERSION__ = VRR */ -# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) -# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100) - -#elif defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXE) || defined(__CRAYXC) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - - -#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L -# if defined(__INTEL_CXX11_MODE__) -# if defined(__cpp_aggregate_nsdmi) -# define CXX_STD 201402L -# else -# define CXX_STD 201103L -# endif -# else -# define CXX_STD 199711L -# endif -#elif defined(_MSC_VER) && defined(_MSVC_LANG) -# define CXX_STD _MSVC_LANG -#else -# define CXX_STD __cplusplus -#endif - -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" -#if CXX_STD > 201703L - "20" -#elif CXX_STD >= 201703L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXE) || defined(__CRAYXC) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out b/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out deleted file mode 100644 index e69de29..0000000 diff --git a/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out.gdb b/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out.gdb deleted file mode 100755 index 4f1f132..0000000 Binary files a/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out.gdb and /dev/null differ diff --git a/build/CMakeFiles/CMakeDirectoryInformation.cmake b/build/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index cb19425..0000000 --- a/build/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/camh/Documents/Retro68kApps/NuklearQuickDraw") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/build/CMakeFiles/CMakeError.log b/build/CMakeFiles/CMakeError.log deleted file mode 100644 index 6c0b15a..0000000 --- a/build/CMakeFiles/CMakeError.log +++ /dev/null @@ -1,4 +0,0 @@ -The C compiler identification could not be found in "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/3.16.3/CompilerIdC/a.out" - -The CXX compiler identification could not be found in "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out" - diff --git a/build/CMakeFiles/CMakeOutput.log b/build/CMakeFiles/CMakeOutput.log deleted file mode 100644 index f5428af..0000000 --- a/build/CMakeFiles/CMakeOutput.log +++ /dev/null @@ -1,364 +0,0 @@ -The target system is: Retro68 - 1 - -The host system is: Linux - 5.11.0-40-generic - x86_64 -Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. -Compiler: /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -Build flags: -Id flags: - -The output was: -0 - - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" - -Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out.gdb" - -The C compiler identification is GNU, found in "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/3.16.3/CompilerIdC/a.out.gdb" - -Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. -Compiler: /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -Build flags: -Id flags: - -The output was: -0 - - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" - -Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out.gdb" - -The CXX compiler identification is GNU, found in "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/3.16.3/CompilerIdCXX/a.out.gdb" - -Determining if the C compiler works passed with the following output: -Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/make cmTC_d209b/fast && /usr/bin/make -f CMakeFiles/cmTC_d209b.dir/build.make CMakeFiles/cmTC_d209b.dir/build -make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' -Building C object CMakeFiles/cmTC_d209b.dir/testCCompiler.c.obj -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -o CMakeFiles/cmTC_d209b.dir/testCCompiler.c.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp/testCCompiler.c -Linking C executable cmTC_d209b -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d209b.dir/link.txt --verbose=1 -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc CMakeFiles/cmTC_d209b.dir/testCCompiler.c.obj -o cmTC_d209b -make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' - - - -Detecting C compiler ABI info compiled with the following output: -Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/make cmTC_f2ad3/fast && /usr/bin/make -f CMakeFiles/cmTC_f2ad3.dir/build.make CMakeFiles/cmTC_f2ad3.dir/build -make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' -Building C object CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v -o CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -Using built-in specs. -COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -Target: m68k-apple-macos -Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c,c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing -Thread model: single -gcc version 9.1.0 (GCC) -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000' - /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1 -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj -version -o /tmp/ccR5oK71.s -GNU C17 (GCC) version 9.1.0 (m68k-apple-macos) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -ignoring nonexistent directory "/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/sys-include" -#include "..." search starts here: -#include <...> search starts here: - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include -End of search list. -GNU C17 (GCC) version 9.1.0 (m68k-apple-macos) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -Compiler executable checksum: 68baab70957df643ffb4605a09112146 -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000' - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj /tmp/ccR5oK71.s -COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/ -LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/ -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000' -Linking C executable cmTC_f2ad3 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f2ad3.dir/link.txt --verbose=1 -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj -o cmTC_f2ad3 -Using built-in specs. -COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -Target: m68k-apple-macos -Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c,c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing -Thread model: single -gcc version 9.1.0 (GCC) -COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/ -LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/ -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f2ad3' '-mcpu=68000' - /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccUBj7Uv.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_f2ad3 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj --start-group -lgcc -lc -lretrocrt -lInterface --end-group -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f2ad3' '-mcpu=68000' -make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' - - - -Parsed C implicit include dir info from above output: rv=done - found start of include info - found start of implicit include info - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include] - end of search list found - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] ==> [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] ==> [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include] ==> [/home/camh/Retro68-build/toolchain/m68k-apple-macos/include] - implicit include dirs: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include;/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include] - - -Parsed C implicit link information from above output: - link line regex: [^( *|.*[/\])(m68k-apple-macos-ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp] - ignore line: [] - ignore line: [Run Build Command(s):/usr/bin/make cmTC_f2ad3/fast && /usr/bin/make -f CMakeFiles/cmTC_f2ad3.dir/build.make CMakeFiles/cmTC_f2ad3.dir/build] - ignore line: [make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'] - ignore line: [Building C object CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj] - ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v -o CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj -c /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc] - ignore line: [Target: m68k-apple-macos] - ignore line: [Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing] - ignore line: [Thread model: single] - ignore line: [gcc version 9.1.0 (GCC) ] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'] - ignore line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1 -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj -version -o /tmp/ccR5oK71.s] - ignore line: [GNU C17 (GCC) version 9.1.0 (m68k-apple-macos)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [ignoring nonexistent directory "/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/sys-include"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include] - ignore line: [End of search list.] - ignore line: [GNU C17 (GCC) version 9.1.0 (m68k-apple-macos)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [Compiler executable checksum: 68baab70957df643ffb4605a09112146] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj /tmp/ccR5oK71.s] - ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/] - ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj' '-c' '-mcpu=68000'] - ignore line: [Linking C executable cmTC_f2ad3] - ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f2ad3.dir/link.txt --verbose=1] - ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -v CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj -o cmTC_f2ad3 ] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc] - ignore line: [COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper] - ignore line: [Target: m68k-apple-macos] - ignore line: [Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing] - ignore line: [Thread model: single] - ignore line: [gcc version 9.1.0 (GCC) ] - ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/] - ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_f2ad3' '-mcpu=68000'] - link line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccUBj7Uv.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_f2ad3 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj --start-group -lgcc -lc -lretrocrt -lInterface --end-group] - arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2] ==> ignore - arg [-plugin] ==> ignore - arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so] ==> ignore - arg [-plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper] ==> ignore - arg [-plugin-opt=-fresolution=/tmp/ccUBj7Uv.res] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc] ==> ignore - arg [-plugin-opt=-pass-through=-lc] ==> ignore - arg [-plugin-opt=-pass-through=-lretrocrt] ==> ignore - arg [-plugin-opt=-pass-through=-lInterface] ==> ignore - arg [-elf2mac] ==> ignore - arg [-q] ==> ignore - arg [-undefined=_consolewrite] ==> ignore - arg [-o] ==> ignore - arg [cmTC_f2ad3] ==> ignore - arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] - arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] - arg [CMakeFiles/cmTC_f2ad3.dir/CMakeCCompilerABI.c.obj] ==> ignore - arg [--start-group] ==> ignore - arg [-lgcc] ==> lib [gcc] - arg [-lc] ==> lib [c] - arg [-lretrocrt] ==> lib [retrocrt] - arg [-lInterface] ==> lib [Interface] - arg [--end-group] ==> ignore - collapse library dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] ==> [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] - collapse library dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] ==> [/home/camh/Retro68-build/toolchain/m68k-apple-macos/lib] - implicit libs: [gcc;c;retrocrt;Interface] - implicit dirs: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0;/home/camh/Retro68-build/toolchain/m68k-apple-macos/lib] - implicit fwks: [] - - -Determining if the CXX compiler works passed with the following output: -Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/make cmTC_b0b45/fast && /usr/bin/make -f CMakeFiles/cmTC_b0b45.dir/build.make CMakeFiles/cmTC_b0b45.dir/build -make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' -Building CXX object CMakeFiles/cmTC_b0b45.dir/testCXXCompiler.cxx.obj -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -o CMakeFiles/cmTC_b0b45.dir/testCXXCompiler.cxx.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx -Linking CXX executable cmTC_b0b45 -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b0b45.dir/link.txt --verbose=1 -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ CMakeFiles/cmTC_b0b45.dir/testCXXCompiler.cxx.obj -o cmTC_b0b45 -make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' - - - -Detecting CXX compiler ABI info compiled with the following output: -Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp - -Run Build Command(s):/usr/bin/make cmTC_e45aa/fast && /usr/bin/make -f CMakeFiles/cmTC_e45aa.dir/build.make CMakeFiles/cmTC_e45aa.dir/build -make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' -Building CXX object CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v -o CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -Using built-in specs. -COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -Target: m68k-apple-macos -Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c,c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing -Thread model: single -gcc version 9.1.0 (GCC) -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000' - /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1plus -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -version -o /tmp/cc3vCbPa.s -GNU C++14 (GCC) version 9.1.0 (m68k-apple-macos) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -ignoring nonexistent directory "/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/sys-include" -#include "..." search starts here: -#include <...> search starts here: - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0 - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/m68k-apple-macos - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/backward - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include -End of search list. -GNU C++14 (GCC) version 9.1.0 (m68k-apple-macos) - compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version none -GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 -Compiler executable checksum: 5b31867a30cfa7e65d4bce12c39f8a21 -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000' - /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj /tmp/cc3vCbPa.s -COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/ -LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/ -COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000' -Linking CXX executable cmTC_e45aa -/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e45aa.dir/link.txt --verbose=1 -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -o cmTC_e45aa -Using built-in specs. -COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -Target: m68k-apple-macos -Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c,c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing -Thread model: single -gcc version 9.1.0 (GCC) -COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/ -LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/ -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e45aa' '-mcpu=68000' - /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpTTxYC.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_e45aa -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -lstdc++ -lm --start-group -lgcc -lc -lretrocrt -lInterface --end-group -COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e45aa' '-mcpu=68000' -make[1]: Leaving directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp' - - - -Parsed CXX implicit include dir info from above output: rv=done - found start of include info - found start of implicit include info - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0] - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/m68k-apple-macos] - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/backward] - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] - add: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include] - end of search list found - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0] ==> [/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0] - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/m68k-apple-macos] ==> [/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0/m68k-apple-macos] - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/backward] ==> [/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0/backward] - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] ==> [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] ==> [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] - collapse include dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include] ==> [/home/camh/Retro68-build/toolchain/m68k-apple-macos/include] - implicit include dirs: [/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0/m68k-apple-macos;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include/c++/9.1.0/backward;/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include;/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed;/home/camh/Retro68-build/toolchain/m68k-apple-macos/include] - - -Parsed CXX implicit link information from above output: - link line regex: [^( *|.*[/\])(m68k-apple-macos-ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)] - ignore line: [Change Dir: /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp] - ignore line: [] - ignore line: [Run Build Command(s):/usr/bin/make cmTC_e45aa/fast && /usr/bin/make -f CMakeFiles/cmTC_e45aa.dir/build.make CMakeFiles/cmTC_e45aa.dir/build] - ignore line: [make[1]: Entering directory '/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/CMakeTmp'] - ignore line: [Building CXX object CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj] - ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v -o CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -c /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++] - ignore line: [Target: m68k-apple-macos] - ignore line: [Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing] - ignore line: [Thread model: single] - ignore line: [gcc version 9.1.0 (GCC) ] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'] - ignore line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/cc1plus -quiet -v -Wno-trigraphs /usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mcpu=68000 -auxbase-strip CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -version -o /tmp/cc3vCbPa.s] - ignore line: [GNU C++14 (GCC) version 9.1.0 (m68k-apple-macos)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [ignoring nonexistent directory "/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/sys-include"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/m68k-apple-macos] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include/c++/9.1.0/backward] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/include-fixed] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/include] - ignore line: [End of search list.] - ignore line: [GNU C++14 (GCC) version 9.1.0 (m68k-apple-macos)] - ignore line: [ compiled by GNU C version 9.3.0 GMP version 6.2.0 MPFR version 4.0.2 MPC version 1.1.0 isl version none] - ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072] - ignore line: [Compiler executable checksum: 5b31867a30cfa7e65d4bce12c39f8a21] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'] - ignore line: [ /home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/as -mcpu=68000 -o CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj /tmp/cc3vCbPa.s] - ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/] - ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj' '-c' '-mcpu=68000'] - ignore line: [Linking CXX executable cmTC_e45aa] - ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e45aa.dir/link.txt --verbose=1] - ignore line: [/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++ -v CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -o cmTC_e45aa ] - ignore line: [Using built-in specs.] - ignore line: [COLLECT_GCC=/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-g++] - ignore line: [COLLECT_LTO_WRAPPER=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper] - ignore line: [Target: m68k-apple-macos] - ignore line: [Configured with: /home/camh/Retro68/gcc/configure --target=m68k-apple-macos --prefix=/home/camh/Retro68-build/toolchain/ --enable-languages=c c++ --with-arch=m68k --with-cpu=m68000 --disable-libssp MAKEINFO=missing] - ignore line: [Thread model: single] - ignore line: [gcc version 9.1.0 (GCC) ] - ignore line: [COMPILER_PATH=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/bin/] - ignore line: [LIBRARY_PATH=/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/:/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib/] - ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e45aa' '-mcpu=68000'] - link line: [ /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2 -plugin /home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so -plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpTTxYC.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lretrocrt -plugin-opt=-pass-through=-lInterface -elf2mac -q -undefined=_consolewrite -o cmTC_e45aa -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0 -L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj -lstdc++ -lm --start-group -lgcc -lc -lretrocrt -lInterface --end-group] - arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/collect2] ==> ignore - arg [-plugin] ==> ignore - arg [/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/liblto_plugin.so] ==> ignore - arg [-plugin-opt=/home/camh/Retro68-build/toolchain/libexec/gcc/m68k-apple-macos/9.1.0/lto-wrapper] ==> ignore - arg [-plugin-opt=-fresolution=/tmp/ccpTTxYC.res] ==> ignore - arg [-plugin-opt=-pass-through=-lgcc] ==> ignore - arg [-plugin-opt=-pass-through=-lc] ==> ignore - arg [-plugin-opt=-pass-through=-lretrocrt] ==> ignore - arg [-plugin-opt=-pass-through=-lInterface] ==> ignore - arg [-elf2mac] ==> ignore - arg [-q] ==> ignore - arg [-undefined=_consolewrite] ==> ignore - arg [-o] ==> ignore - arg [cmTC_e45aa] ==> ignore - arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] - arg [-L/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] ==> dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] - arg [CMakeFiles/cmTC_e45aa.dir/CMakeCXXCompilerABI.cpp.obj] ==> ignore - arg [-lstdc++] ==> lib [stdc++] - arg [-lm] ==> lib [m] - arg [--start-group] ==> ignore - arg [-lgcc] ==> lib [gcc] - arg [-lc] ==> lib [c] - arg [-lretrocrt] ==> lib [retrocrt] - arg [-lInterface] ==> lib [Interface] - arg [--end-group] ==> ignore - collapse library dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] ==> [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0] - collapse library dir [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0/../../../../m68k-apple-macos/lib] ==> [/home/camh/Retro68-build/toolchain/m68k-apple-macos/lib] - implicit libs: [stdc++;m;gcc;c;retrocrt;Interface] - implicit dirs: [/home/camh/Retro68-build/toolchain/lib/gcc/m68k-apple-macos/9.1.0;/home/camh/Retro68-build/toolchain/m68k-apple-macos/lib] - implicit fwks: [] - - diff --git a/build/CMakeFiles/CMakeRuleHashes.txt b/build/CMakeFiles/CMakeRuleHashes.txt deleted file mode 100644 index cdaa29a..0000000 --- a/build/CMakeFiles/CMakeRuleHashes.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Hashes of file build rules. -8ffde4ac1cdc1218469a04ac02fc18d8 CMakeFiles/NuklearQuickDraw_APPL -329185643b4f6900eadfaea9a548f63a NuklearQuickDraw.bin -91b2346eaa6612a55994cce77404dcb4 Sample.r.rsrc.bin diff --git a/build/CMakeFiles/Makefile.cmake b/build/CMakeFiles/Makefile.cmake deleted file mode 100644 index 1a7279e..0000000 --- a/build/CMakeFiles/Makefile.cmake +++ /dev/null @@ -1,119 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -# The generator used is: -set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") - -# The top level Makefile was generated from the following files: -set(CMAKE_MAKEFILE_DEPENDS - "CMakeCache.txt" - "../CMakeLists.txt" - "CMakeFiles/3.16.3/CMakeCCompiler.cmake" - "CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" - "CMakeFiles/3.16.3/CMakeSystem.cmake" - "/home/camh/Retro68-build/toolchain/m68k-apple-macos/cmake/Platform/Retro68.cmake" - "/home/camh/Retro68-build/toolchain/m68k-apple-macos/cmake/add_application.cmake" - "/home/camh/Retro68-build/toolchain/m68k-apple-macos/cmake/retro68.toolchain.cmake" - "/usr/share/cmake-3.16/Modules/CMakeCCompiler.cmake.in" - "/usr/share/cmake-3.16/Modules/CMakeCCompilerABI.c" - "/usr/share/cmake-3.16/Modules/CMakeCInformation.cmake" - "/usr/share/cmake-3.16/Modules/CMakeCXXCompiler.cmake.in" - "/usr/share/cmake-3.16/Modules/CMakeCXXCompilerABI.cpp" - "/usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake" - "/usr/share/cmake-3.16/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake" - "/usr/share/cmake-3.16/Modules/CMakeCommonLanguageInclude.cmake" - "/usr/share/cmake-3.16/Modules/CMakeCompilerIdDetection.cmake" - "/usr/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake" - "/usr/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake" - "/usr/share/cmake-3.16/Modules/CMakeDetermineCompileFeatures.cmake" - "/usr/share/cmake-3.16/Modules/CMakeDetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/CMakeDetermineCompilerABI.cmake" - "/usr/share/cmake-3.16/Modules/CMakeDetermineCompilerId.cmake" - "/usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake" - "/usr/share/cmake-3.16/Modules/CMakeFindBinUtils.cmake" - "/usr/share/cmake-3.16/Modules/CMakeGenericSystem.cmake" - "/usr/share/cmake-3.16/Modules/CMakeInitializeConfigs.cmake" - "/usr/share/cmake-3.16/Modules/CMakeLanguageInformation.cmake" - "/usr/share/cmake-3.16/Modules/CMakeParseArguments.cmake" - "/usr/share/cmake-3.16/Modules/CMakeParseImplicitIncludeInfo.cmake" - "/usr/share/cmake-3.16/Modules/CMakeParseImplicitLinkInfo.cmake" - "/usr/share/cmake-3.16/Modules/CMakeSystem.cmake.in" - "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake" - "/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInitialize.cmake" - "/usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake" - "/usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake" - "/usr/share/cmake-3.16/Modules/CMakeTestCompilerCommon.cmake" - "/usr/share/cmake-3.16/Modules/CMakeUnixFindMake.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/ADSP-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/ARMCC-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/ARMClang-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/AppleClang-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Borland-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Bruce-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/CMakeCommonCompilerMacros.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Clang-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Cray-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/GHS-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/GNU-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/GNU-C.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/GNU-CXX.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/GNU-FindBinUtils.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/GNU.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/HP-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/IAR-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Intel-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/MSVC-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/PGI-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/PathScale-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/SCO-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/TI-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/Watcom-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/XL-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/XLClang-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/zOS-C-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" - "/usr/share/cmake-3.16/Modules/Internal/CMakeCheckCompilerFlag.cmake" - "/usr/share/cmake-3.16/Modules/Internal/FeatureTesting.cmake" - ) - -# The corresponding makefile is: -set(CMAKE_MAKEFILE_OUTPUTS - "Makefile" - "CMakeFiles/cmake.check_cache" - ) - -# Byproducts of CMake generate step: -set(CMAKE_MAKEFILE_PRODUCTS - "CMakeFiles/3.16.3/CMakeSystem.cmake" - "CMakeFiles/3.16.3/CMakeCCompiler.cmake" - "CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" - "CMakeFiles/3.16.3/CMakeCCompiler.cmake" - "CMakeFiles/3.16.3/CMakeCXXCompiler.cmake" - "CMakeFiles/CMakeDirectoryInformation.cmake" - ) - -# Dependency information for all targets: -set(CMAKE_DEPEND_INFO_FILES - "CMakeFiles/NuklearQuickDraw_APPL.dir/DependInfo.cmake" - "CMakeFiles/NuklearQuickDraw.dir/DependInfo.cmake" - ) diff --git a/build/CMakeFiles/Makefile2 b/build/CMakeFiles/Makefile2 deleted file mode 100644 index 9ea45ed..0000000 --- a/build/CMakeFiles/Makefile2 +++ /dev/null @@ -1,135 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build - -#============================================================================= -# Directory level rules for the build root directory - -# The main recursive "all" target. -all: CMakeFiles/NuklearQuickDraw_APPL.dir/all -all: CMakeFiles/NuklearQuickDraw.dir/all - -.PHONY : all - -# The main recursive "preinstall" target. -preinstall: - -.PHONY : preinstall - -# The main recursive "clean" target. -clean: CMakeFiles/NuklearQuickDraw_APPL.dir/clean -clean: CMakeFiles/NuklearQuickDraw.dir/clean - -.PHONY : clean - -#============================================================================= -# Target rules for target CMakeFiles/NuklearQuickDraw_APPL.dir - -# All Build rule for target. -CMakeFiles/NuklearQuickDraw_APPL.dir/all: CMakeFiles/NuklearQuickDraw.dir/all - $(MAKE) -f CMakeFiles/NuklearQuickDraw_APPL.dir/build.make CMakeFiles/NuklearQuickDraw_APPL.dir/depend - $(MAKE) -f CMakeFiles/NuklearQuickDraw_APPL.dir/build.make CMakeFiles/NuklearQuickDraw_APPL.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=5,6 "Built target NuklearQuickDraw_APPL" -.PHONY : CMakeFiles/NuklearQuickDraw_APPL.dir/all - -# Build rule for subdir invocation for target. -CMakeFiles/NuklearQuickDraw_APPL.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles 6 - $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/NuklearQuickDraw_APPL.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles 0 -.PHONY : CMakeFiles/NuklearQuickDraw_APPL.dir/rule - -# Convenience name for target. -NuklearQuickDraw_APPL: CMakeFiles/NuklearQuickDraw_APPL.dir/rule - -.PHONY : NuklearQuickDraw_APPL - -# clean rule for target. -CMakeFiles/NuklearQuickDraw_APPL.dir/clean: - $(MAKE) -f CMakeFiles/NuklearQuickDraw_APPL.dir/build.make CMakeFiles/NuklearQuickDraw_APPL.dir/clean -.PHONY : CMakeFiles/NuklearQuickDraw_APPL.dir/clean - -#============================================================================= -# Target rules for target CMakeFiles/NuklearQuickDraw.dir - -# All Build rule for target. -CMakeFiles/NuklearQuickDraw.dir/all: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/depend - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=1,2,3,4 "Built target NuklearQuickDraw" -.PHONY : CMakeFiles/NuklearQuickDraw.dir/all - -# Build rule for subdir invocation for target. -CMakeFiles/NuklearQuickDraw.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles 4 - $(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/NuklearQuickDraw.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles 0 -.PHONY : CMakeFiles/NuklearQuickDraw.dir/rule - -# Convenience name for target. -NuklearQuickDraw: CMakeFiles/NuklearQuickDraw.dir/rule - -.PHONY : NuklearQuickDraw - -# clean rule for target. -CMakeFiles/NuklearQuickDraw.dir/clean: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/clean -.PHONY : CMakeFiles/NuklearQuickDraw.dir/clean - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/C.includecache b/build/CMakeFiles/NuklearQuickDraw.dir/C.includecache deleted file mode 100644 index 924d4c8..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/C.includecache +++ /dev/null @@ -1,148 +0,0 @@ -#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) - -#IncludeRegexScan: ^.*$ - -#IncludeRegexComplain: ^$ - -#IncludeRegexTransform: - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.c -Types.h -- -Resources.h -- -Quickdraw.h -- -Fonts.h -- -Events.h -- -Windows.h -- -Menus.h -- -TextEdit.h -- -Dialogs.h -- -ToolUtils.h -- -Memory.h -- -Sound.h -- -SegLoad.h -- -Files.h -- -OSUtils.h -- -DiskInit.h -- -Packages.h -- -Traps.h -- -Serial.h -- -Devices.h -- -stdio.h -- -string.h -- -Sample.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.h -SerialHelper.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h -Quickdraw.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/Quickdraw.h -output_js.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/output_js.h -coprocessorjs.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.h -nuklear_app.c -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear_app.c - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.h - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.c -SerialHelper.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h -stdio.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/stdio.h - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h -Serial.h -- -Devices.h -- -stdio.h -- -string.h -- - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.c -stdio.h -- -Serial.h -- -math.h -- -Devices.h -- -string.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/string.h -stdbool.h -- -time.h -- -SerialHelper.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h -coprocessorjs.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.h - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.h - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear.h -stdarg.h -- -sal.h -- -stdint.h -- -stdbool.h -- -stdlib.h -- -stdio.h -- -stdarg.h -- -assert.h -- - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear_app.c -Types.h -- -nuklear.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear.h -nuklear_quickdraw.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear_quickdraw.h - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear_quickdraw.h -MacTypes.h -- -Types.h -- -Quickdraw.h -- -Scrap.h -- -Serial.h -- -SerialHelper.h -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h - -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/output_js.h - diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/DependInfo.cmake b/build/CMakeFiles/NuklearQuickDraw.dir/DependInfo.cmake deleted file mode 100644 index d5c9ed1..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/DependInfo.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - "C" - ) -# The set of files for implicit dependencies of each language: -set(CMAKE_DEPENDS_CHECK_C - "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.c" "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj" - "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.c" "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj" - "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.c" "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj" - ) -set(CMAKE_C_COMPILER_ID "GNU") - -# The include file search paths: -set(CMAKE_C_TARGET_INCLUDE_PATH - ) - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - ) - -# Fortran module output directory. -set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj b/build/CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj deleted file mode 100644 index c049f3f..0000000 Binary files a/build/CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj and /dev/null differ diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj b/build/CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj deleted file mode 100644 index eaf9f08..0000000 Binary files a/build/CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj and /dev/null differ diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/build.make b/build/CMakeFiles/NuklearQuickDraw.dir/build.make deleted file mode 100644 index e16b342..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/build.make +++ /dev/null @@ -1,128 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -# Delete rule output on recipe failure. -.DELETE_ON_ERROR: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build - -# Include any dependencies generated for this target. -include CMakeFiles/NuklearQuickDraw.dir/depend.make - -# Include the progress variables for this target. -include CMakeFiles/NuklearQuickDraw.dir/progress.make - -# Include the compile flags for this target's objects. -include CMakeFiles/NuklearQuickDraw.dir/flags.make - -CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj: CMakeFiles/NuklearQuickDraw.dir/flags.make -CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj: ../SerialHelper.c - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.c - -CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.i" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.c > CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.i - -CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.s" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.c -o CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.s - -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj: CMakeFiles/NuklearQuickDraw.dir/flags.make -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj: ../coprocessorjs.c - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.c - -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.i" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.c > CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.i - -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.s" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.c -o CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.s - -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: CMakeFiles/NuklearQuickDraw.dir/flags.make -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../Sample.c - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj -c /home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.c - -CMakeFiles/NuklearQuickDraw.dir/Sample.c.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/NuklearQuickDraw.dir/Sample.c.i" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.c > CMakeFiles/NuklearQuickDraw.dir/Sample.c.i - -CMakeFiles/NuklearQuickDraw.dir/Sample.c.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/NuklearQuickDraw.dir/Sample.c.s" - /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.c -o CMakeFiles/NuklearQuickDraw.dir/Sample.c.s - -# Object files for target NuklearQuickDraw -NuklearQuickDraw_OBJECTS = \ -"CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj" \ -"CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj" \ -"CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj" - -# External object files for target NuklearQuickDraw -NuklearQuickDraw_EXTERNAL_OBJECTS = - -NuklearQuickDraw.code.bin: CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj -NuklearQuickDraw.code.bin: CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj -NuklearQuickDraw.code.bin: CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj -NuklearQuickDraw.code.bin: CMakeFiles/NuklearQuickDraw.dir/build.make -NuklearQuickDraw.code.bin: CMakeFiles/NuklearQuickDraw.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Linking C executable NuklearQuickDraw.code.bin" - $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/NuklearQuickDraw.dir/link.txt --verbose=$(VERBOSE) - -# Rule to build all files generated by this target. -CMakeFiles/NuklearQuickDraw.dir/build: NuklearQuickDraw.code.bin - -.PHONY : CMakeFiles/NuklearQuickDraw.dir/build - -CMakeFiles/NuklearQuickDraw.dir/clean: - $(CMAKE_COMMAND) -P CMakeFiles/NuklearQuickDraw.dir/cmake_clean.cmake -.PHONY : CMakeFiles/NuklearQuickDraw.dir/clean - -CMakeFiles/NuklearQuickDraw.dir/depend: - cd /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/camh/Documents/Retro68kApps/NuklearQuickDraw /home/camh/Documents/Retro68kApps/NuklearQuickDraw /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/NuklearQuickDraw.dir/DependInfo.cmake --color=$(COLOR) -.PHONY : CMakeFiles/NuklearQuickDraw.dir/depend - diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/cmake_clean.cmake b/build/CMakeFiles/NuklearQuickDraw.dir/cmake_clean.cmake deleted file mode 100644 index 3e269c8..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/cmake_clean.cmake +++ /dev/null @@ -1,12 +0,0 @@ -file(REMOVE_RECURSE - "CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj" - "CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj" - "CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj" - "NuklearQuickDraw.code.bin" - "NuklearQuickDraw.code.bin.pdb" -) - -# Per-language clean rules from dependency scanning. -foreach(lang C) - include(CMakeFiles/NuklearQuickDraw.dir/cmake_clean_${lang}.cmake OPTIONAL) -endforeach() diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj b/build/CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj deleted file mode 100644 index d4a8b7b..0000000 Binary files a/build/CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj and /dev/null differ diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/depend.internal b/build/CMakeFiles/NuklearQuickDraw.dir/depend.internal deleted file mode 100644 index 2eb63b7..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/depend.internal +++ /dev/null @@ -1,19 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.c - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.h - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.h - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear.h - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear_app.c - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/nuklear_quickdraw.h - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/output_js.h -CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.c - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/SerialHelper.h - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.c - /home/camh/Documents/Retro68kApps/NuklearQuickDraw/coprocessorjs.h diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/depend.make b/build/CMakeFiles/NuklearQuickDraw.dir/depend.make deleted file mode 100644 index 410f332..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/depend.make +++ /dev/null @@ -1,19 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../Sample.c -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../Sample.h -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../SerialHelper.h -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../coprocessorjs.h -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../nuklear.h -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../nuklear_app.c -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../nuklear_quickdraw.h -CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj: ../output_js.h - -CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj: ../SerialHelper.c -CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj: ../SerialHelper.h - -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj: ../SerialHelper.h -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj: ../coprocessorjs.c -CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj: ../coprocessorjs.h - diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/flags.make b/build/CMakeFiles/NuklearQuickDraw.dir/flags.make deleted file mode 100644 index cf8207c..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/flags.make +++ /dev/null @@ -1,10 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -# compile C with /home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc -C_FLAGS = - -C_DEFINES = - -C_INCLUDES = - diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/link.txt b/build/CMakeFiles/NuklearQuickDraw.dir/link.txt deleted file mode 100644 index f1afeca..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/link.txt +++ /dev/null @@ -1 +0,0 @@ -/home/camh/Retro68-build/toolchain/bin/m68k-apple-macos-gcc CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj -o NuklearQuickDraw.code.bin diff --git a/build/CMakeFiles/NuklearQuickDraw.dir/progress.make b/build/CMakeFiles/NuklearQuickDraw.dir/progress.make deleted file mode 100644 index a69a57e..0000000 --- a/build/CMakeFiles/NuklearQuickDraw.dir/progress.make +++ /dev/null @@ -1,5 +0,0 @@ -CMAKE_PROGRESS_1 = 1 -CMAKE_PROGRESS_2 = 2 -CMAKE_PROGRESS_3 = 3 -CMAKE_PROGRESS_4 = 4 - diff --git a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/DependInfo.cmake b/build/CMakeFiles/NuklearQuickDraw_APPL.dir/DependInfo.cmake deleted file mode 100644 index d413eb4..0000000 --- a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/DependInfo.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - ) -# The set of files for implicit dependencies of each language: - -# Pairs of files generated by the same build rule. -set(CMAKE_MULTIPLE_OUTPUT_PAIRS - "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/%NuklearQuickDraw.ad" "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/NuklearQuickDraw.bin" - "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/NuklearQuickDraw.APPL" "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/NuklearQuickDraw.bin" - "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/NuklearQuickDraw.ad" "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/NuklearQuickDraw.bin" - "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/NuklearQuickDraw.dsk" "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/NuklearQuickDraw.bin" - ) - - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - ) - -# Fortran module output directory. -set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/build.make b/build/CMakeFiles/NuklearQuickDraw_APPL.dir/build.make deleted file mode 100644 index d77f086..0000000 --- a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/build.make +++ /dev/null @@ -1,103 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -# Delete rule output on recipe failure. -.DELETE_ON_ERROR: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build - -# Utility rule file for NuklearQuickDraw_APPL. - -# Include the progress variables for this target. -include CMakeFiles/NuklearQuickDraw_APPL.dir/progress.make - -CMakeFiles/NuklearQuickDraw_APPL: NuklearQuickDraw.bin - - -NuklearQuickDraw.bin: NuklearQuickDraw.code.bin -NuklearQuickDraw.bin: Sample.r.rsrc.bin - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Generating NuklearQuickDraw.bin, NuklearQuickDraw.APPL, NuklearQuickDraw.dsk, NuklearQuickDraw.ad, %NuklearQuickDraw.ad" - /home/camh/Retro68-build/toolchain/bin/Rez /home/camh/Retro68-build/toolchain/m68k-apple-macos/RIncludes/Retro68APPL.r -I/home/camh/Retro68-build/toolchain/m68k-apple-macos/RIncludes --copy NuklearQuickDraw.code.bin -o NuklearQuickDraw.bin -t APPL -c ???? --cc NuklearQuickDraw.dsk --cc NuklearQuickDraw.APPL --cc %NuklearQuickDraw.ad /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/Sample.r.rsrc.bin - -NuklearQuickDraw.APPL: NuklearQuickDraw.bin - @$(CMAKE_COMMAND) -E touch_nocreate NuklearQuickDraw.APPL - -NuklearQuickDraw.dsk: NuklearQuickDraw.bin - @$(CMAKE_COMMAND) -E touch_nocreate NuklearQuickDraw.dsk - -NuklearQuickDraw.ad: NuklearQuickDraw.bin - @$(CMAKE_COMMAND) -E touch_nocreate NuklearQuickDraw.ad - -%NuklearQuickDraw.ad: NuklearQuickDraw.bin - @$(CMAKE_COMMAND) -E touch_nocreate %NuklearQuickDraw.ad - -Sample.r.rsrc.bin: ../Sample.r - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Generating Sample.r.rsrc.bin" - /home/camh/Retro68-build/toolchain/bin/Rez /home/camh/Documents/Retro68kApps/NuklearQuickDraw/Sample.r -I /home/camh/Retro68-build/toolchain/m68k-apple-macos/RIncludes -o Sample.r.rsrc.bin - -NuklearQuickDraw_APPL: CMakeFiles/NuklearQuickDraw_APPL -NuklearQuickDraw_APPL: NuklearQuickDraw.bin -NuklearQuickDraw_APPL: NuklearQuickDraw.APPL -NuklearQuickDraw_APPL: NuklearQuickDraw.dsk -NuklearQuickDraw_APPL: NuklearQuickDraw.ad -NuklearQuickDraw_APPL: %NuklearQuickDraw.ad -NuklearQuickDraw_APPL: Sample.r.rsrc.bin -NuklearQuickDraw_APPL: CMakeFiles/NuklearQuickDraw_APPL.dir/build.make - -.PHONY : NuklearQuickDraw_APPL - -# Rule to build all files generated by this target. -CMakeFiles/NuklearQuickDraw_APPL.dir/build: NuklearQuickDraw_APPL - -.PHONY : CMakeFiles/NuklearQuickDraw_APPL.dir/build - -CMakeFiles/NuklearQuickDraw_APPL.dir/clean: - $(CMAKE_COMMAND) -P CMakeFiles/NuklearQuickDraw_APPL.dir/cmake_clean.cmake -.PHONY : CMakeFiles/NuklearQuickDraw_APPL.dir/clean - -CMakeFiles/NuklearQuickDraw_APPL.dir/depend: - cd /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/camh/Documents/Retro68kApps/NuklearQuickDraw /home/camh/Documents/Retro68kApps/NuklearQuickDraw /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/NuklearQuickDraw_APPL.dir/DependInfo.cmake --color=$(COLOR) -.PHONY : CMakeFiles/NuklearQuickDraw_APPL.dir/depend - diff --git a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/cmake_clean.cmake b/build/CMakeFiles/NuklearQuickDraw_APPL.dir/cmake_clean.cmake deleted file mode 100644 index 5bd5f9d..0000000 --- a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/cmake_clean.cmake +++ /dev/null @@ -1,14 +0,0 @@ -file(REMOVE_RECURSE - "%NuklearQuickDraw.ad" - "CMakeFiles/NuklearQuickDraw_APPL" - "NuklearQuickDraw.APPL" - "NuklearQuickDraw.ad" - "NuklearQuickDraw.bin" - "NuklearQuickDraw.dsk" - "Sample.r.rsrc.bin" -) - -# Per-language clean rules from dependency scanning. -foreach(lang ) - include(CMakeFiles/NuklearQuickDraw_APPL.dir/cmake_clean_${lang}.cmake OPTIONAL) -endforeach() diff --git a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/depend.internal b/build/CMakeFiles/NuklearQuickDraw_APPL.dir/depend.internal deleted file mode 100644 index f647855..0000000 --- a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/depend.internal +++ /dev/null @@ -1,3 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - diff --git a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/depend.make b/build/CMakeFiles/NuklearQuickDraw_APPL.dir/depend.make deleted file mode 100644 index f647855..0000000 --- a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/depend.make +++ /dev/null @@ -1,3 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - diff --git a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/progress.make b/build/CMakeFiles/NuklearQuickDraw_APPL.dir/progress.make deleted file mode 100644 index 3a86673..0000000 --- a/build/CMakeFiles/NuklearQuickDraw_APPL.dir/progress.make +++ /dev/null @@ -1,3 +0,0 @@ -CMAKE_PROGRESS_1 = 5 -CMAKE_PROGRESS_2 = 6 - diff --git a/build/CMakeFiles/TargetDirectories.txt b/build/CMakeFiles/TargetDirectories.txt deleted file mode 100644 index b4bcd82..0000000 --- a/build/CMakeFiles/TargetDirectories.txt +++ /dev/null @@ -1,4 +0,0 @@ -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/rebuild_cache.dir -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/edit_cache.dir -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/NuklearQuickDraw_APPL.dir -/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/NuklearQuickDraw.dir diff --git a/build/CMakeFiles/cmake.check_cache b/build/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd73..0000000 --- a/build/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/build/CMakeFiles/progress.marks b/build/CMakeFiles/progress.marks deleted file mode 100644 index 1e8b314..0000000 --- a/build/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -6 diff --git a/build/Makefile b/build/Makefile deleted file mode 100644 index 367597f..0000000 --- a/build/Makefile +++ /dev/null @@ -1,252 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.16 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache - -.PHONY : rebuild_cache/fast - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." - /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache - -.PHONY : edit_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles/progress.marks - $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean - -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named NuklearQuickDraw_APPL - -# Build rule for target. -NuklearQuickDraw_APPL: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 NuklearQuickDraw_APPL -.PHONY : NuklearQuickDraw_APPL - -# fast build rule for target. -NuklearQuickDraw_APPL/fast: - $(MAKE) -f CMakeFiles/NuklearQuickDraw_APPL.dir/build.make CMakeFiles/NuklearQuickDraw_APPL.dir/build -.PHONY : NuklearQuickDraw_APPL/fast - -#============================================================================= -# Target rules for targets named NuklearQuickDraw - -# Build rule for target. -NuklearQuickDraw: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 NuklearQuickDraw -.PHONY : NuklearQuickDraw - -# fast build rule for target. -NuklearQuickDraw/fast: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/build -.PHONY : NuklearQuickDraw/fast - -Sample.obj: Sample.c.obj - -.PHONY : Sample.obj - -# target to build an object file -Sample.c.obj: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/Sample.c.obj -.PHONY : Sample.c.obj - -Sample.i: Sample.c.i - -.PHONY : Sample.i - -# target to preprocess a source file -Sample.c.i: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/Sample.c.i -.PHONY : Sample.c.i - -Sample.s: Sample.c.s - -.PHONY : Sample.s - -# target to generate assembly for a file -Sample.c.s: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/Sample.c.s -.PHONY : Sample.c.s - -SerialHelper.obj: SerialHelper.c.obj - -.PHONY : SerialHelper.obj - -# target to build an object file -SerialHelper.c.obj: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.obj -.PHONY : SerialHelper.c.obj - -SerialHelper.i: SerialHelper.c.i - -.PHONY : SerialHelper.i - -# target to preprocess a source file -SerialHelper.c.i: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.i -.PHONY : SerialHelper.c.i - -SerialHelper.s: SerialHelper.c.s - -.PHONY : SerialHelper.s - -# target to generate assembly for a file -SerialHelper.c.s: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/SerialHelper.c.s -.PHONY : SerialHelper.c.s - -coprocessorjs.obj: coprocessorjs.c.obj - -.PHONY : coprocessorjs.obj - -# target to build an object file -coprocessorjs.c.obj: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.obj -.PHONY : coprocessorjs.c.obj - -coprocessorjs.i: coprocessorjs.c.i - -.PHONY : coprocessorjs.i - -# target to preprocess a source file -coprocessorjs.c.i: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.i -.PHONY : coprocessorjs.c.i - -coprocessorjs.s: coprocessorjs.c.s - -.PHONY : coprocessorjs.s - -# target to generate assembly for a file -coprocessorjs.c.s: - $(MAKE) -f CMakeFiles/NuklearQuickDraw.dir/build.make CMakeFiles/NuklearQuickDraw.dir/coprocessorjs.c.s -.PHONY : coprocessorjs.c.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... rebuild_cache" - @echo "... edit_cache" - @echo "... NuklearQuickDraw_APPL" - @echo "... NuklearQuickDraw" - @echo "... Sample.obj" - @echo "... Sample.i" - @echo "... Sample.s" - @echo "... SerialHelper.obj" - @echo "... SerialHelper.i" - @echo "... SerialHelper.s" - @echo "... coprocessorjs.obj" - @echo "... coprocessorjs.i" - @echo "... coprocessorjs.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/build/NuklearQuickDraw.APPL b/build/NuklearQuickDraw.APPL deleted file mode 100644 index e69de29..0000000 diff --git a/build/NuklearQuickDraw.ad b/build/NuklearQuickDraw.ad deleted file mode 100644 index e69de29..0000000 diff --git a/build/NuklearQuickDraw.bin b/build/NuklearQuickDraw.bin deleted file mode 100644 index fd79194..0000000 Binary files a/build/NuklearQuickDraw.bin and /dev/null differ diff --git a/build/NuklearQuickDraw.code.bin b/build/NuklearQuickDraw.code.bin deleted file mode 100644 index 4cb267b..0000000 Binary files a/build/NuklearQuickDraw.code.bin and /dev/null differ diff --git a/build/NuklearQuickDraw.code.bin.gdb b/build/NuklearQuickDraw.code.bin.gdb deleted file mode 100755 index bc256dc..0000000 Binary files a/build/NuklearQuickDraw.code.bin.gdb and /dev/null differ diff --git a/build/NuklearQuickDraw.dsk b/build/NuklearQuickDraw.dsk deleted file mode 100644 index 922a2f0..0000000 Binary files a/build/NuklearQuickDraw.dsk and /dev/null differ diff --git a/build/Sample.r.rsrc.bin b/build/Sample.r.rsrc.bin deleted file mode 100644 index a8aefbf..0000000 Binary files a/build/Sample.r.rsrc.bin and /dev/null differ diff --git a/build/cmake_install.cmake b/build/cmake_install.cmake deleted file mode 100644 index 0230a18..0000000 --- a/build/cmake_install.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Install script for directory: /home/camh/Documents/Retro68kApps/NuklearQuickDraw - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/home/camh/Retro68-build/toolchain/m68k-apple-macos") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "TRUE") -endif() - -if(CMAKE_INSTALL_COMPONENT) - set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") -else() - set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") -endif() - -string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT - "${CMAKE_INSTALL_MANIFEST_FILES}") -file(WRITE "/home/camh/Documents/Retro68kApps/NuklearQuickDraw/build/${CMAKE_INSTALL_MANIFEST}" - "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/compile_commands.json b/compile_commands.json deleted file mode 100644 index 0637a08..0000000 --- a/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/Sample.c b/mac_main.c similarity index 95% rename from Sample.c rename to mac_main.c index f26296c..b25df08 100644 --- a/Sample.c +++ b/mac_main.c @@ -20,7 +20,7 @@ #include #include #include -#include "Sample.h" +#include "mac_main.h" //#define PROFILING 1 #ifdef PROFILING @@ -90,8 +90,6 @@ void PROFILE_COMPLETE() { #include "SerialHelper.h" #include "Quickdraw.h" -#include "output_js.h" -#include "coprocessorjs.h" #include "nuklear_app.c" @@ -106,6 +104,7 @@ Boolean gHasWaitNextEvent; /* set up by Initialize */ /* GInBackground is maintained by our osEvent handling routines. Any part of the program can check it to find out if it is currently in the background. */ Boolean gInBackground; /* maintained by Initialize and DoEvent */ +Boolean gotMouseEvent; // #define MAC_APP_DEBUGGING /* The following globals are the state of the window. If we supported more than @@ -154,14 +153,6 @@ void main() SysBeep(1); - setupCoprocessor("nuklear", "modem"); // could also be "printer", modem is 0 in PCE settings - printer would be 1 - // we could build a nuklear window for selection - - char programResult[MAX_RECEIVE_SIZE]; - sendProgramToCoprocessor(OUTPUT_JS, programResult); - - coprocessorLoaded = 1; - EventLoop(ctx); /* call the main event loop */ } @@ -179,6 +170,8 @@ void EventLoop(struct nk_context *ctx) int lastMouseHPos = 0; int lastMouseVPos = 0; int lastUpdatedTickCount = 0; + Boolean firstOrMouseMove = true; + gotMouseEvent = false; do { @@ -188,21 +181,6 @@ void EventLoop(struct nk_context *ctx) // PROFILE_START("eventloop"); // #endif - // check for new stuff every 10 sec? - // note! this is used by some of the functionality in our nuklear_app to trigger - // new chat lookups - if (TickCount() - lastUpdatedTickCount > 600) { - - // writeSerialPortDebug(boutRefNum, "update by tick count"); - lastUpdatedTickCount = TickCount(); - - if (strcmp(activeChat, "no active chat")) { - - // writeSerialPortDebug(boutRefNum, "check chat"); - getHasNewMessagesInChat(activeChat); - } - } - Boolean beganInput = false; GetGlobalMouse(&mouse); @@ -236,9 +214,6 @@ void EventLoop(struct nk_context *ctx) firstOrMouseMove = true; beganInput = true; - mouse_x = tempPoint.h; - mouse_y = tempPoint.v; - lastUpdatedTickCount = TickCount(); lastMouseHPos = mouse.h; lastMouseVPos = mouse.v; @@ -247,7 +222,6 @@ void EventLoop(struct nk_context *ctx) } else { gotEvent = GetNextEvent(everyEvent, &event); - gotMouseEvent = false; // drain all events before rendering -- really this only applies to keyboard events and single mouse clicks now while (gotEvent) { @@ -315,7 +289,14 @@ void EventLoop(struct nk_context *ctx) PROFILE_START("nk_quickdraw_render"); #endif - nk_quickdraw_render(FrontWindow(), ctx); + GetGlobalMouse(&mouse); + + // if the mouse is moving, don't try to render. we'll likely have more rendering to do when + // the user stops moving the mouse + if (lastMouseVPos == mouse.v || lastMouseHPos == mouse.h) { + + nk_quickdraw_render(FrontWindow(), ctx); + } #ifdef PROFILING PROFILE_END("nk_quickdraw_render"); @@ -360,8 +341,6 @@ void DoEvent(EventRecord *event, struct nk_context *ctx) { case mouseUp: - gotMouseEvent = true; - #ifdef MAC_APP_DEBUGGING writeSerialPortDebug(boutRefNum, "mouseup"); #endif @@ -642,9 +621,7 @@ void DoMenuCommand(menuResult) handledByDA = SystemEdit(menuItem-1); /* since we donÕt do any Editing */ break; case mLight: - // note this was co-opted to send new chats instead of the demo functionality. do the - // same thing for other menu items as necessary - sendNewChat = 1; + // example handling for menu item break; case mHelp: diff --git a/Sample.h b/mac_main.h similarity index 100% rename from Sample.h rename to mac_main.h diff --git a/mac_main.r b/mac_main.r new file mode 100644 index 0000000..7f1822b --- /dev/null +++ b/mac_main.r @@ -0,0 +1,298 @@ +/* +# +# Apple Macintosh Developer Technical Support +# +# MultiFinder-Aware Simple Sample Application +# +# Sample +# +# Sample.r - Rez Source +# +# Copyright © 1989 Apple Computer, Inc. +# All rights reserved. +# +# Versions: +# 1.00 08/88 +# 1.01 11/88 +# 1.02 04/89 MPW 3.1 +# +# Components: +# Sample.p April 1, 1989 +# Sample.c April 1, 1989 +# Sample.a April 1, 1989 +# Sample.inc1.a April 1, 1989 +# SampleMisc.a April 1, 1989 +# Sample.r April 1, 1989 +# Sample.h April 1, 1989 +# [P]Sample.make April 1, 1989 +# [C]Sample.make April 1, 1989 +# [A]Sample.make April 1, 1989 +# +# Sample is an example application that demonstrates how to +# initialize the commonly used toolbox managers, operate +# successfully under MultiFinder, handle desk accessories, +# and create, grow, and zoom windows. +# +# It does not by any means demonstrate all the techniques +# you need for a large application. In particular, Sample +# does not cover exception handling, multiple windows/documents, +# sophisticated memory management, printing, or undo. All of +# these are vital parts of a normal full-sized application. +# +# This application is an example of the form of a Macintosh +# application; it is NOT a template. It is NOT intended to be +# used as a foundation for the next world-class, best-selling, +# 600K application. A stick figure drawing of the human body may +# be a good example of the form for a painting, but that does not +# mean it should be used as the basis for the next Mona Lisa. +# +# We recommend that you review this program or TESample before +# beginning a new application. +*/ + +#include "Types.r" +#include "mac_main.h" + +/* this is a definition for a resource which contains only a rectangle */ +type 'RECT' { + rect; +}; + + +/* we use an MBAR resource to conveniently load all the menus */ + +resource 'MBAR' (rMenuBar, preload) { + { mApple, mFile, mEdit, mLight, mHelp }; /* five menus */ +}; + + +resource 'MENU' (mApple, preload) { + mApple, textMenuProc, + AllItems & ~MenuItem2, /* Disable dashed line, enable About and DAs */ + enabled, apple, + { + "About Messages", + noicon, nokey, nomark, plain; + "-", + noicon, nokey, nomark, plain + } +}; + +resource 'MENU' (mFile, preload) { + mFile, textMenuProc, + MenuItem12, /* enable Quit only, program enables others */ + enabled, "File", + { + "New", + noicon, "N", nomark, plain; + "Open", + noicon, "O", nomark, plain; + "-", + noicon, nokey, nomark, plain; + "Close", + noicon, "W", nomark, plain; + "Save", + noicon, "S", nomark, plain; + "Save As", + noicon, nokey, nomark, plain; + "Revert", + noicon, nokey, nomark, plain; + "-", + noicon, nokey, nomark, plain; + "Page Setup", + noicon, nokey, nomark, plain; + "Print", + noicon, nokey, nomark, plain; + "-", + noicon, nokey, nomark, plain; + "Quit", + noicon, "Q", nomark, plain + } +}; + +resource 'MENU' (mEdit, preload) { + mEdit, textMenuProc, + NoItems, /* disable everything, program does the enabling */ + enabled, "Edit", + { + "Undo", + noicon, "Z", nomark, plain; + "-", + noicon, nokey, nomark, plain; + "Cut", + noicon, "X", nomark, plain; + "Copy", + noicon, "C", nomark, plain; + "Paste", + noicon, "V", nomark, plain; + "Clear", + noicon, nokey, nomark, plain + } +}; + +resource 'MENU' (mLight, preload) { + mLight, textMenuProc, + NoItems, /* disable everything, program does the enabling */ + enabled, "Messages", + { + "New Message", + noicon, nokey, nomark, plain; + } +}; + +resource 'MENU' (mHelp, preload) { + mHelp, textMenuProc, + AllItems, /* disable everything, program does the enabling */ + enabled, "Help", + { + "Quick Help", + noicon, nokey, nomark, plain; + "User Guide", + noicon, nokey, nomark, plain; + "Test Entry", + noicon, nokey, nomark, plain; + "Test Entry 2", + noicon, nokey, nomark, plain; + "Test Entry 3", + noicon, nokey, nomark, plain; + } +}; + +/* this ALRT and DITL are used as an About screen */ +resource 'ALRT' (rAboutAlert, purgeable) { + {40, 20, 160, 290}, + rAboutAlert, + { /* array: 4 elements */ + /* [1] */ + OK, visible, silent, + /* [2] */ + OK, visible, silent, + /* [3] */ + OK, visible, silent, + /* [4] */ + OK, visible, silent + }, + centerMainScreen // Where to show the alert +}; + +resource 'DITL' (rAboutAlert, purgeable) { + { /* array DITLarray: 5 elements */ + /* [1] */ + {88, 180, 108, 260}, + Button { + enabled, + "OK" + }, + /* [2] */ + {8, 8, 24, 214}, + StaticText { + disabled, + "Messages for Macintosh" + }, + /* [3] */ + {32, 8, 48, 237}, + StaticText { + disabled, + "Copyright © 2021 Cameron Henlin" + }, + /* [4] */ + {56, 8, 72, 136}, + StaticText { + disabled, + "cam.henlin@gmail.com" + }, + /* [5] */ + {80, 24, 112, 167}, + StaticText { + disabled, + "https://github.com/CamHenlin/MessagesForMacintosh" + } + } +}; + + +/* this ALRT and DITL are used as an error screen */ + +resource 'ALRT' (rUserAlert, purgeable) { + {40, 20, 120, 260}, + rUserAlert, + { /* array: 4 elements */ + /* [1] */ + OK, visible, silent, + /* [2] */ + OK, visible, silent, + /* [3] */ + OK, visible, silent, + /* [4] */ + OK, visible, silent + }, + centerMainScreen // Where to show the alert +}; + + +resource 'DITL' (rUserAlert, purgeable) { + { /* array DITLarray: 3 elements */ + /* [1] */ + {50, 150, 70, 230}, + Button { + enabled, + "OK" + }, + /* [2] */ + {10, 60, 30, 230}, + StaticText { + disabled, + "Sample - Error occurred!" + }, + /* [3] */ + {8, 8, 40, 40}, + Icon { + disabled, + 2 + } + } +}; + + +resource 'WIND' (rWindow, preload, purgeable) { + {39, 1, 341, 511}, + zoomDocProc, visible, noGoAway, 0x0, "Messages", + centerMainScreen // Where to show the alert +}; + +resource 'RECT' (rStopRect, preload, purgeable) { + {69, 69, 110, 110} +}; + +resource 'RECT' (rXRect, preload, purgeable) { + {32, 32, 69, 69} +}; + +resource 'RECT' (rGoRect, preload, purgeable) { + {120, 10, 220, 110} +}; + + +/* here is the quintessential MultiFinder friendliness device, the SIZE resource */ + +resource 'SIZE' (-1) { + dontSaveScreen, + acceptSuspendResumeEvents, + enableOptionSwitch, + canBackground, /* we can background; we don't currently, but our sleep value */ + /* guarantees we don't hog the Mac while we are in the background */ + multiFinderAware, /* this says we do our own activate/deactivate; don't fake us out */ + backgroundAndForeground, /* this is definitely not a background-only application! */ + dontGetFrontClicks, /* change this is if you want "do first click" behavior like the Finder */ + ignoreChildDiedEvents, /* essentially, I'm not a debugger (sub-launching) */ + not32BitCompatible, /* this app should not be run in 32-bit address space */ + reserved, + reserved, + reserved, + reserved, + reserved, + reserved, + reserved, + kPrefSize * 1024, + kMinSize * 1024 +}; \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 64c316a..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "name": "NuklearQuickDraw", - "lockfileVersion": 2, - "requires": true, - "packages": { - "node_modules/@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" - }, - "node_modules/@types/zen-observable": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz", - "integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==" - }, - "node_modules/@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", - "dependencies": { - "@types/node": ">=6", - "tslib": "^1.9.3" - } - }, - "node_modules/@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-boost": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/apollo-boost/-/apollo-boost-0.4.9.tgz", - "integrity": "sha512-05y5BKcDaa8w47f8d81UVwKqrAjn8uKLv6QM9fNdldoNzQ+rnOHgFlnrySUZRz9QIT3vPftQkEz2UEASp1Mi5g==", - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "apollo-link": "^1.0.6", - "apollo-link-error": "^1.0.3", - "apollo-link-http": "^1.3.1", - "graphql-tag": "^2.4.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "dependencies": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "integrity": "sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A==", - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "integrity": "sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA==", - "dependencies": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.3.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", - "dependencies": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - }, - "peerDependencies": { - "graphql": "^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "dependencies": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "integrity": "sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig==", - "dependencies": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", - "dependencies": { - "node-fetch": "2.6.1" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/graphql": { - "version": "15.5.3", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.5.3.tgz", - "integrity": "sha512-sM+jXaO5KinTui6lbK/7b7H/Knj9BpjGxZ+Ki35v7YbUJxxdBCUqNM0h3CRVU1ZF9t5lNiBzvBCSYPvIwxPOQA==", - "peer": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/graphql-tag": { - "version": "2.12.5", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.5.tgz", - "integrity": "sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ==", - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/graphql-tag/node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "dependencies": { - "@wry/context": "^0.4.0" - } - }, - "node_modules/symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/zen-observable": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" - }, - "node_modules/zen-observable-ts": { - "version": "0.8.21", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz", - "integrity": "sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg==", - "dependencies": { - "tslib": "^1.9.3", - "zen-observable": "^0.8.0" - } - } - } -} diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE deleted file mode 100755 index 9e841e7..0000000 --- a/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md deleted file mode 100755 index 48a83fc..0000000 --- a/node_modules/@types/node/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for Node.js (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Thu, 09 Sep 2021 20:01:20 GMT - * Dependencies: none - * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require` - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13). diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts deleted file mode 100755 index 19f1e7d..0000000 --- a/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,912 +0,0 @@ -/** - * The `assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/assert.js) - */ -declare module 'assert' { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `assert` module - * will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - actual: unknown; - expected: unknown; - operator: string; - generatedMessage: boolean; - code: 'ERR_ASSERTION'; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // tslint:disable-next-line:ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is currently experimental and behavior might still change. - * @since v14.2.0, v12.19.0 - * @experimental - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * function foo() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * tracker.report(); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return of objects containing information about the wrapper functions returned by `calls`. - */ - report(): CallTrackerReportInformation[]; - /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // tslint:disable-next-line:ban-types - stackStartFn?: Function - ): never; - /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) ( `==` ). `NaN` is special handled - * and treated as being identical in case both sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison)(`!=` ). `NaN` is special handled and treated as - * being identical in case both - * sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'assert'; - * - * const obj1 = { - * a: { - * b: 1 - * } - * }; - * const obj2 = { - * a: { - * b: 2 - * } - * }; - * const obj3 = { - * a: { - * b: 1 - * } - * }; - * const obj4 = Object.create(obj1); - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text' - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text' - * } - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * } - * ); - * - * // Using regular expressions to validate error properties: - * throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text' - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i - * } - * ); - * - * // Fails due to the different `message` and `name` properties: - * throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/ - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error' - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. - * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops' - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. - * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value' - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; - function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - const strict: Omit & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module 'node:assert' { - import assert = require('assert'); - export = assert; -} diff --git a/node_modules/@types/node/assert/strict.d.ts b/node_modules/@types/node/assert/strict.d.ts deleted file mode 100755 index b4319b9..0000000 --- a/node_modules/@types/node/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module 'assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} -declare module 'node:assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts deleted file mode 100755 index 157bea9..0000000 --- a/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,497 +0,0 @@ -/** - * The `async_hooks` module provides an API to track asynchronous resources. It - * can be accessed using: - * - * ```js - * import async_hooks from 'async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/async_hooks.js) - */ -declare module 'async_hooks' { - /** - * ```js - * import { executionAsyncId } from 'async_hooks'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'fs'; - * import { executionAsyncId, executionAsyncResource } from 'async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * } - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. - * @return The ID of the resource responsible for calling the callback that is currently being executed. - */ - function triggerAsyncId(): number; - interface HookCallbacks { - /** - * Called when a class is constructed that has the possibility to emit an asynchronous event. - * @param asyncId a unique ID for the async resource - * @param type the type of the async resource - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created - * @param resource reference to the resource representing the async operation, needs to be released during destroy - */ - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; - /** - * When an asynchronous operation is initiated or completes a callback is called to notify the user. - * The before callback is called just before said callback is executed. - * @param asyncId the unique identifier assigned to the resource about to execute the callback. - */ - before?(asyncId: number): void; - /** - * Called immediately after the callback specified in before is completed. - * @param asyncId the unique identifier assigned to the resource which has executed the callback. - */ - after?(asyncId: number): void; - /** - * Called when a promise has resolve() called. This may not be in the same execution id - * as the promise itself. - * @param asyncId the unique id for the promise that was resolve()d. - */ - promiseResolve?(asyncId: number): void; - /** - * Called after the resource corresponding to asyncId is destroyed - * @param asyncId a unique ID for the async resource - */ - destroy?(asyncId: number): void; - } - interface AsyncHook { - /** - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. - */ - enable(): this; - /** - * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. - */ - disable(): this; - } - /** - * Registers functions to be called for different lifetime events of each async - * operation. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { } - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * Disables automatic `emitDestroy` when the object is garbage collected. - * This usually does not need to be set (even if `emitDestroy` is called - * manually), unless the resource's `asyncId` is retrieved and the - * sensitive API's `emitDestroy` is called with it. - * @default false - */ - requireManualDestroy?: boolean | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false } - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - class AsyncResource { - /** - * AsyncResource() is meant to be extended. Instantiating a - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * async_hook.executionAsyncId() is used. - * @param type The type of async event. - * @param triggerAsyncId The ID of the execution context that created - * this async event (default: `executionAsyncId()`), or an - * AsyncResourceOptions object (since 9.3) - */ - constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); - /** - * Binds the given function to the current execution context. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg - ): Func & { - asyncResource: AsyncResource; - }; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>( - fn: Func - ): Func & { - asyncResource: AsyncResource; - }; - /** - * Call the provided function with the provided arguments in the execution context - * of the async resource. This will establish the context, trigger the AsyncHooks - * before callbacks, call the function, trigger the AsyncHooks after callbacks, and - * then restore the original execution context. - * @since v9.6.0 - * @param fn The function to call in the execution context of this async resource. - * @param thisArg The receiver to be used for the function call. - * @param args Optional arguments to pass to the function. - */ - runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; - /** - * Call all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe - * implementation that involves significant optimizations that are non-obvious to - * implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'http'; - * import { AsyncLocalStorage } from 'async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function or - * the asynchronous operations created within the callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module 'node:async_hooks' { - export * from 'async_hooks'; -} diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts deleted file mode 100755 index 9bf8ff9..0000000 --- a/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,2142 +0,0 @@ -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/buffer.js) - */ -declare module 'buffer' { - import { BinaryLike } from 'node:crypto'; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; - export const SlowBuffer: { - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ - new (size: number): Buffer; - prototype: Buffer; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0 - * @experimental - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0 - */ - arrayBuffer(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): unknown; // pending web streams types - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - global { - // Buffer class - type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - */ - interface BufferConstructor { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. - */ - new (str: string, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). - */ - new (size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new (array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}/{SharedArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. - */ - new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. - */ - new (array: ReadonlyArray): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. - */ - new (buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | ReadonlyArray): Buffer; - from(data: WithImplicitCoercion | string>): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: 'string'): string; - }, - encoding?: BufferEncoding - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: ReadonlyArray, totalLength?: number): Buffer; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): number; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the - * deprecated`new Buffer(size)` constructor only when `size` is less than or equal - * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created - * if `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer extends Uint8Array { - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: 'Buffer'; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * This is the same behavior as `buf.subarray()`. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * ``` - * @since v0.3.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: number, end?: number): Buffer; - /** - * Returns a new `Buffer` that references the same memory as the original, but - * offset and cropped by the `start` and `end` indices. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): Buffer; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): Buffer; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): Buffer; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in`encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.slice()`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents - * of `buf`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Log the entire contents of a `Buffer`. - * - * const buf = Buffer.from('buffer'); - * - * for (const pair of buf.entries()) { - * console.log(pair); - * } - * // Prints: - * // [0, 98] - * // [1, 117] - * // [2, 102] - * // [3, 102] - * // [4, 101] - * // [5, 114] - * ``` - * @since v1.1.0 - */ - entries(): IterableIterator<[number, number]>; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const key of buf.keys()) { - * console.log(key); - * } - * // Prints: - * // 0 - * // 1 - * // 2 - * // 3 - * // 4 - * // 5 - * ``` - * @since v1.1.0 - */ - keys(): IterableIterator; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is - * called automatically when a `Buffer` is used in a `for..of` statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const value of buf.values()) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * - * for (const value of buf) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * ``` - * @since v1.1.0 - */ - values(): IterableIterator; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0 - * @deprecated Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0 - * @deprecated Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - } -} -declare module 'node:buffer' { - export * from 'buffer'; -} diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts deleted file mode 100755 index 66540c3..0000000 --- a/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,1355 +0,0 @@ -/** - * The `child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if it is in the `options` object. Otherwise, `process.env.PATH` is - * used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `child_process` module provides a handful of synchronous - * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/child_process.js) - */ -declare module 'child_process' { - import { ObjectEncodingOptions } from 'node:fs'; - import { EventEmitter, Abortable } from 'node:events'; - import * as net from 'node:net'; - import { Writable, Readable, Stream, Pipe } from 'node:stream'; - import { URL } from 'node:url'; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel currently exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * const assert = require('assert'); - * const fs = require('fs'); - * const child_process = require('child_process'); - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ] - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See[`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if[`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * const { spawn } = require('child_process'); - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'] - * } - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * const cp = require('child_process'); - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * const subprocess = require('child_process').fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = require('net').createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on - * a `'message'` event instead of `'connection'` and using `server.bind()` instead - * of `server.listen()`. This is, however, currently only supported on Unix - * platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * const { fork } = require('child_process'); - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = require('net').createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'disconnect', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: 'spawn', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; - emit(event: 'spawn', listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'disconnect', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: 'spawn', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'disconnect', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: 'spawn', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'disconnect', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: 'spawn', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'disconnect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: 'spawn', listener: () => void): this; - } - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio extends ChildProcess { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; - type StdioOptions = IOType | Array; - type SerializationType = 'json' | 'advanced'; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default true - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = 'inherit' | 'ignore' | Stream; - type StdioPipeNamed = 'pipe' | 'overlapped'; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * const { spawn } = require('child_process'); - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * const { spawn } = require('child_process'); - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent, - * retrieve it with the`process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { spawn } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on[shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * const { exec } = require('child_process'); - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * const { exec } = require('child_process'); - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const exec = util.promisify(require('child_process').exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { exec } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec( - command: string, - options: { - encoding: 'buffer' | null; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: { - encoding: 'buffer' | null; - } & ExecOptions - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - command: string, - options: { - encoding: BufferEncoding; - } & ExecOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options: ExecOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - command: string, - options?: (ObjectEncodingOptions & ExecOptions) | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: 'buffer' | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = ExecException & NodeJS.ErrnoException; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * const { execFile } = require('child_process'); - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const execFile = util.promisify(require('child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { execFile } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void - ): ChildProcess; - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithStringEncoding - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithOtherEncoding - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - options: ExecFileOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * const { fork } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: 'buffer' | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; - interface CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: 'buffer' | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - function execSync(command: string): Buffer; - function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): Buffer; - interface ExecFileSyncOptions extends CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): Buffer; -} -declare module 'node:child_process' { - export * from 'child_process'; -} diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts deleted file mode 100755 index 8c4203b..0000000 --- a/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,414 +0,0 @@ -/** - * A single instance of Node.js runs in a single thread. To take advantage of - * multi-core systems, the user will sometimes want to launch a cluster of Node.js - * processes to handle the load. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/cluster.js) - */ -declare module 'cluster' { - import * as child from 'node:child_process'; - import EventEmitter = require('node:events'); - import * as net from 'node:net'; - export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv - exec?: string | undefined; - args?: string[] | undefined; - silent?: boolean | undefined; - stdio?: any[] | undefined; - uid?: number | undefined; - gid?: number | undefined; - inspectPort?: number | (() => number) | undefined; - } - export interface Address { - address: string; - port: number; - addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the`id`. - * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. - * - * See: `Child Process module`. - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary this sends a message to a specific worker. It is identical to `ChildProcess.send()`. - * - * In a worker this sends a message to the primary. It is identical to`process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * This function will kill the worker. In the primary, it does this - * by disconnecting the `worker.process`, and once disconnected, killing - * with `signal`. In the worker, it does it by disconnecting the channel, - * and then exiting with code `0`. - * - * Because `kill()` attempts to gracefully disconnect the worker process, it is - * susceptible to waiting indefinitely for the disconnect to complete. For example, - * if the worker enters an infinite loop, a graceful disconnect will never occur. - * If the graceful disconnect behavior is not needed, use `worker.process.kill()`. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * This method is aliased as `worker.destroy()` for backward compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const net = require('net'); - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.kill()` or`.disconnect()`. If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - exitedAfterDisconnect: boolean; - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'disconnect', listener: () => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'exit', listener: (code: number, signal: string) => void): this; - addListener(event: 'listening', listener: (address: Address) => void): this; - addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: 'online', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'error', error: Error): boolean; - emit(event: 'exit', code: number, signal: string): boolean; - emit(event: 'listening', address: Address): boolean; - emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean; - emit(event: 'online'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'disconnect', listener: () => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'exit', listener: (code: number, signal: string) => void): this; - on(event: 'listening', listener: (address: Address) => void): this; - on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: 'online', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'disconnect', listener: () => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'exit', listener: (code: number, signal: string) => void): this; - once(event: 'listening', listener: (address: Address) => void): this; - once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: 'online', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'disconnect', listener: () => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'exit', listener: (code: number, signal: string) => void): this; - prependListener(event: 'listening', listener: (address: Address) => void): this; - prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: 'online', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'disconnect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this; - prependOnceListener(event: 'listening', listener: (address: Address) => void): this; - prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: 'online', listener: () => void): this; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - readonly isPrimary: boolean; - readonly isWorker: boolean; - schedulingPolicy: number; - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. - */ - setupPrimary(settings?: ClusterSettings): void; - readonly worker?: Worker | undefined; - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'disconnect', listener: (worker: Worker) => void): this; - addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: 'fork', listener: (worker: Worker) => void): this; - addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: 'online', listener: (worker: Worker) => void): this; - addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'disconnect', worker: Worker): boolean; - emit(event: 'exit', worker: Worker, code: number, signal: string): boolean; - emit(event: 'fork', worker: Worker): boolean; - emit(event: 'listening', worker: Worker, address: Address): boolean; - emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: 'online', worker: Worker): boolean; - emit(event: 'setup', settings: ClusterSettings): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'disconnect', listener: (worker: Worker) => void): this; - on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: 'fork', listener: (worker: Worker) => void): this; - on(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: 'online', listener: (worker: Worker) => void): this; - on(event: 'setup', listener: (settings: ClusterSettings) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'disconnect', listener: (worker: Worker) => void): this; - once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: 'fork', listener: (worker: Worker) => void): this; - once(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: 'online', listener: (worker: Worker) => void): this; - once(event: 'setup', listener: (settings: ClusterSettings) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'disconnect', listener: (worker: Worker) => void): this; - prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: 'fork', listener: (worker: Worker) => void): this; - prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; - prependListener(event: 'online', listener: (worker: Worker) => void): this; - prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; - prependOnceListener(event: 'online', listener: (worker: Worker) => void): this; - prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; - } - const cluster: Cluster; - export default cluster; -} -declare module 'node:cluster' { - export * from 'cluster'; - export { default as default } from 'cluster'; -} diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts deleted file mode 100755 index 60a5294..0000000 --- a/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,407 +0,0 @@ -/** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/console.js) - */ -declare module 'console' { - import console = require('node:console'); - export = console; -} -declare module 'node:console' { - import { InspectOptions } from 'node:util'; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the - * TTY. When `stdout` is not a TTY, this method does nothing. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the - * number of times `console.count()` has been called with the given `label`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See `util.format()` for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can’t be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: ReadonlyArray): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('100-elements'); - * for (let i = 0; i < 100; i++) {} - * console.timeEnd('100-elements'); - * // prints 100-elements: 225.438ms - * ``` - * @since v0.1.104 - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. - */ - timeStamp(label?: string): void; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - ignoreErrors?: boolean | undefined; - colorMode?: boolean | 'auto' | undefined; - inspectOptions?: InspectOptions | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new (options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts deleted file mode 100755 index 208020d..0000000 --- a/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module 'constants' { - import { constants as osConstants, SignalConstants } from 'node:os'; - import { constants as cryptoConstants } from 'node:crypto'; - import { constants as fsConstants } from 'node:fs'; - - const exp: typeof osConstants.errno & - typeof osConstants.priority & - SignalConstants & - typeof cryptoConstants & - typeof fsConstants; - export = exp; -} - -declare module 'node:constants' { - import constants = require('constants'); - export = constants; -} diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts deleted file mode 100755 index 8b7c1a3..0000000 --- a/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,3243 +0,0 @@ -/** - * The `crypto` module provides cryptographic functionality that includes a set of - * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. - * - * ```js - * const { createHmac } = await import('crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/crypto.js) - */ -declare module 'crypto' { - import * as stream from 'node:stream'; - import { PeerCertificate } from 'node:tls'; - interface Certificate { - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - const Certificate: Certificate & { - /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */ - new (): Certificate; - /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */ - (): Certificate; - /** - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - }; - namespace constants { - // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants - const OPENSSL_VERSION_NUMBER: number; - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ - const SSL_OP_EPHEMERAL_RSA: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; - const SSL_OP_MICROSOFT_SESS_ID_BUG: number; - /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ - const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; - const SSL_OP_NETSCAPE_CA_DN_BUG: number; - const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; - const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; - const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - const SSL_OP_NO_SSLv2: number; - const SSL_OP_NO_SSLv3: number; - const SSL_OP_NO_TICKET: number; - const SSL_OP_NO_TLSv1: number; - const SSL_OP_NO_TLSv1_1: number; - const SSL_OP_NO_TLSv1_2: number; - const SSL_OP_PKCS1_CHECK_1: number; - const SSL_OP_PKCS1_CHECK_2: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ - const SSL_OP_SINGLE_DH_USE: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ - const SSL_OP_SINGLE_ECDH_USE: number; - const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; - const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; - const SSL_OP_TLS_BLOCK_PADDING_BUG: number; - const SSL_OP_TLS_D5_BUG: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - const ALPN_ENABLED: number; - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms`(`openssl list-message-digest-algorithms` for older versions of OpenSSL) will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHash - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms`(`openssl list-message-digest-algorithms` for older versions of OpenSSL) will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = 'base64' | 'hex'; - type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; - type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { createHash } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: stream.TransformOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = 'secret' | 'public' | 'private'; - interface KeyExportOptions { - type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: 'jwk'; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - interface JwkKeyExportOptions { - format: 'jwk'; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<'pem'>): string | Buffer; - export(options?: KeyExportOptions<'der'>): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; - type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of[`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an[initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike | null, options: CipherCCMOptions): CipherCCM; - function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike | null, options?: CipherGCMOptions): CipherGCM; - function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * - * import { - * pipeline - * } from 'stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of[`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an[initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike | null, options: CipherCCMOptions): DecipherCCM; - function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike | null, options?: CipherGCMOptions): DecipherGCM; - function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; - passphrase?: string | Buffer | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'spki' | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey - * } = await import('crypto'); - * - * generateKey('hmac', { length: 64 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: 'hmac' | 'aes', - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void - ): void; - interface JsonWebKeyInput { - key: JsonWebKey; - format: 'jwk'; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = 'der' | 'ieee-p1363'; - interface SigningOptions { - /** - * @See crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1' - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createDiffieHellman - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `constants`module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in[RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`, - * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The - * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman - * } = await import('crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellman; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2 - * } = await import('crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been - * deprecated and use should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey); // '3745e48...aa39b34' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync - * } = await import('crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use - * should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); - * console.log(key); // '3745e48...aa39b34' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 248. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt - * } = await import('crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; - interface ScryptOptions { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt - * } = await import('crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; - function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync - * } = await import('crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers - * } = await import('crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves - * } = await import('crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * ```js - * const { - * getHashes - * } = await import('crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createECDH - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'`format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH - * } = await import('crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: 'latin1' | 'hex' | 'base64', - format?: 'uncompressed' | 'compressed' | 'hybrid' - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function is based on a constant-time algorithm. - * Returns true if `a` is equal to `b`, without leaking timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or[capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - /** @deprecated since v10.0.0 */ - const DEFAULT_ENCODING: BufferEncoding; - type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; - type KeyFormat = 'pem' | 'der'; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - } - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs1' | 'pkcs8'; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'sec1' | 'pkcs8'; - }; - } - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, DSA, EC, Ed25519, - * Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync - * } = await import('crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, DSA, EC, Ed25519, - * Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair - * } = await import('crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - namespace generateKeyPair { - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'rsa', - options: RSAKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'dsa', - options: DSAKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ec', - options: ECKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; - } - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - callback: (error: Error | null, data: Buffer) => void - ): void; - /** - * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the - * key type (especially Ed25519 and Ed448). - * - * If `key` is not a `KeyObject`, this function behaves as if `key` had been - * passed to {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdf - * } = await import('crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdfSync - * } = await import('crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0 - */ - function randomUUID(options?: RandomUUIDOptions): string; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject: 'always' | 'never'; - /** - * @default true - */ - wildcards: boolean; - /** - * @default true - */ - partialWildcards: boolean; - /** - * @default false - */ - multiLabelWildcards: boolean; - /** - * @default false - */ - singleLabelSubdomains: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (ca) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * @since v15.6.0 - */ - readonly subjectAltName: string; - /** - * The information access content of this certificate. - * @since v15.6.0 - */ - readonly infoAccess: string; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * @since v15.6.0 - * @return Returns `name` if the certificate matches, `undefined` if it does not. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [<bigint>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [<bigint>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most 2-64 for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - namespace webcrypto { - class CryptoKey {} // placeholder - } -} -declare module 'node:crypto' { - export * from 'crypto'; -} diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts deleted file mode 100755 index 72751d6..0000000 --- a/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,545 +0,0 @@ -/** - * The `dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/dgram.js) - */ -declare module 'dgram' { - import { AddressInfo } from 'node:net'; - import * as dns from 'node:dns'; - import { EventEmitter, Abortable } from 'node:events'; - interface RemoteInfo { - address: string; - family: 'IPv4' | 'IPv6'; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = 'udp4' | 'udp6'; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'cluster'; - * import dgram from 'dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family` and `port`properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - bind(port?: number, address?: string, callback?: () => void): void; - bind(port?: number, callback?: () => void): void; - bind(callback?: () => void): void; - bind(options: BindOptions, callback?: () => void): void; - /** - * Close the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): void; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise falsy, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to[IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): void; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): void; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): void; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no addition effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connect', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connect'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connect', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connect', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connect', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - } -} -declare module 'node:dgram' { - export * from 'dgram'; -} diff --git a/node_modules/@types/node/diagnostics_channel.d.ts b/node_modules/@types/node/diagnostics_channel.d.ts deleted file mode 100755 index c27846b..0000000 --- a/node_modules/@types/node/diagnostics_channel.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * The `diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/diagnostics_channel.js) - */ -declare module 'diagnostics_channel' { - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string): boolean; - /** - * This is the primary entry-point for anyone wanting to interact with a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @param name The channel name - * @return The named channel object - */ - function channel(name: string): Channel; - type ChannelListener = (name: string, message: unknown) => void; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is use to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - */ - class Channel { - readonly name: string; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - */ - readonly hasSubscribers: boolean; - private constructor(name: string); - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @param onMessage The previous subscribed handler to remove - */ - unsubscribe(onMessage: ChannelListener): void; - } -} -declare module 'node:diagnostics_channel' { - export * from 'diagnostics_channel'; -} diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts deleted file mode 100755 index c34f4c1..0000000 --- a/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,643 +0,0 @@ -/** - * The `dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * const dns = require('dns'); - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * const dns = require('dns'); - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/dns.js) - */ -declare module 'dns' { - import * as dnsPromises from 'node:dns/promises'; - // Supported getaddrinfo flags. - export const ADDRCONFIG: number; - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - family?: number | undefined; - hints?: number | undefined; - all?: boolean | undefined; - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - address: string; - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses, and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. - * @since v0.1.90 - */ - export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; - export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; - export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On an error, `err` is an `Error` object, where `err.code` is the error code. - * - * ```js - * const dns = require('dns'); - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: 'A'; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: 'AAAA'; - } - export interface CaaRecord { - critial: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: 'MX'; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: 'NAPTR'; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: 'SOA'; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: 'SRV'; - } - export interface AnyTxtRecord { - type: 'TXT'; - entries: string[]; - } - export interface AnyNsRecord { - type: 'NS'; - value: string; - } - export interface AnyPtrRecord { - type: 'PTR'; - value: string; - } - export interface AnyCnameRecord { - type: 'CNAME'; - value: string; - } - export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; - export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export function resolve( - hostname: string, - rrtype: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void - ): void; - export namespace resolve { - function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise; - function __promisify__(hostname: string, rrtype: 'ANY'): Promise; - function __promisify__(hostname: string, rrtype: 'MX'): Promise; - function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise; - function __promisify__(hostname: string, rrtype: 'SOA'): Promise; - function __promisify__(hostname: string, rrtype: 'SRV'): Promise; - function __promisify__(hostname: string, rrtype: 'TXT'): Promise; - function __promisify__(hostname: string, rrtype: string): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0 - */ - export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. - * @since v0.1.16 - */ - export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses - */ - export function setServers(servers: ReadonlyArray): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; - export interface ResolverOptions { - timeout?: number | undefined; - /** - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('dns'); - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default, and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module 'node:dns' { - export * from 'dns'; -} diff --git a/node_modules/@types/node/dns/promises.d.ts b/node_modules/@types/node/dns/promises.d.ts deleted file mode 100755 index 9ce3fd2..0000000 --- a/node_modules/@types/node/dns/promises.d.ts +++ /dev/null @@ -1,357 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `require('dns').promises` or `require('dns/promises')`. - * @since v10.6.0 - */ -declare module 'dns/promises' { - import { - LookupAddress, - LookupOneOptions, - LookupAllOptions, - LookupOptions, - AnyRecord, - CaaRecord, - MxRecord, - NaptrRecord, - SoaRecord, - SrvRecord, - ResolveWithTtlOptions, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - } from 'node:dns'; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses, and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * - * ```js - * const dnsPromises = require('dns').promises; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: 'A'): Promise; - function resolve(hostname: string, rrtype: 'AAAA'): Promise; - function resolve(hostname: string, rrtype: 'ANY'): Promise; - function resolve(hostname: string, rrtype: 'CAA'): Promise; - function resolve(hostname: string, rrtype: 'CNAME'): Promise; - function resolve(hostname: string, rrtype: 'MX'): Promise; - function resolve(hostname: string, rrtype: 'NAPTR'): Promise; - function resolve(hostname: string, rrtype: 'NS'): Promise; - function resolve(hostname: string, rrtype: 'PTR'): Promise; - function resolve(hostname: string, rrtype: 'SOA'): Promise; - function resolve(hostname: string, rrtype: 'SRV'): Promise; - function resolve(hostname: string, rrtype: 'TXT'): Promise; - function resolve(hostname: string, rrtype: string): Promise; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: ReadonlyArray): void; - class Resolver { - constructor(options?: ResolverOptions); - cancel(): void; - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module 'node:dns/promises' { - export * from 'dns/promises'; -} diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts deleted file mode 100755 index 7b3018e..0000000 --- a/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should**not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/domain.js) - */ -declare module 'domain' { - import EventEmitter = require('node:events'); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and lowlevel requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * const domain = require('domain'); - * const fs = require('fs'); - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module 'node:domain' { - export * from 'domain'; -} diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts deleted file mode 100755 index 97c7055..0000000 --- a/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,623 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * const EventEmitter = require('events'); - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/events.js) - */ -declare module 'events' { - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - interface NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - interface DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - } - ): any; - } - interface StaticEventEmitterOptions { - signal?: AbortSignal | undefined; - } - interface EventEmitter extends NodeJS.EventEmitter {} - /** - * The `EventEmitter` class is defined and exposed by the `events` module: - * - * ```js - * const EventEmitter = require('events'); - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter { - constructor(options?: EventEmitterOptions); - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform[EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * const { once, EventEmitter } = require('events'); - * - * async function run() { - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.log('error happened', err); - * } - * } - * - * run(); - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.log('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; - static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * const { on, EventEmitter } = require('events'); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * const { on, EventEmitter } = require('events'); - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` - */ - static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. - * - * ```js - * const { EventEmitter, listenerCount } = require('events'); - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * const { getEventListeners, EventEmitter } = require('events'); - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * getEventListeners(ee, 'foo'); // [listener] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * getEventListeners(et, 'foo'); // [listener] - * } - * ``` - * @since v15.2.0 - */ - static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` - * events. Listeners installed using this symbol are called before the regular - * `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an - * `'error'` event is emitted, therefore the process will still crash if no - * regular `'error'` listener is installed. - */ - static readonly errorMonitor: unique symbol; - static readonly captureRejectionSymbol: unique symbol; - /** - * Sets or gets the default captureRejection value for all emitters. - */ - // TODO: These should be described using static getter/setter pairs: - static captureRejections: boolean; - static defaultMaxListeners: number; - } - import internal = require('node:events'); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - } - global { - namespace NodeJS { - interface EventEmitter { - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes the specified `listener` from the listener array for the event named`eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will - * not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: - * - * ```js - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(event?: string | symbol): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: string | symbol): Function[]; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: string | symbol): Function[]; - /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * const EventEmitter = require('events'); - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: string | symbol, ...args: any[]): boolean; - /** - * Returns the number of listeners listening to the event named `eventName`. - * @since v3.2.0 - * @param eventName The name of the event being listened for - */ - listenerCount(eventName: string | symbol): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * const EventEmitter = require('events'); - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array; - } - } - } - export = EventEmitter; -} -declare module 'node:events' { - import events = require('events'); - export = events; -} diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts deleted file mode 100755 index d50eade..0000000 --- a/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,3723 +0,0 @@ -/** - * The `fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/fs.js) - */ -declare module 'fs' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import { URL } from 'node:url'; - import * as promises from 'node:fs/promises'; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | 'buffer' - | { - encoding: 'buffer'; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be resolved after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - close(): void; - /** - * events.EventEmitter - * 1. change - * 2. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'close', listener: () => void): this; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'close', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'close', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'open', listener: (fd: number) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'open', listener: (fd: number) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'open', listener: (fd: number) => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'open', listener: (fd: number) => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: TDescriptor, options?: undefined): Stats; - ( - path: TDescriptor, - options?: StatOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - } - ): Stats | undefined; - ( - path: TDescriptor, - options: StatOptions & { - bigint: true; - throwIfNoEntry: false; - } - ): BigIntStats | undefined; - ( - path: TDescriptor, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Stats; - ( - path: TDescriptor, - options: StatOptions & { - bigint: true; - } - ): BigIntStats; - ( - path: TDescriptor, - options: StatOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - } - ): Stats | BigIntStats; - (path: TDescriptor, options?: StatOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Synchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - export const fstatSync: StatSyncFn; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__( - path: PathLike, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than a - * possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If - * the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. - * - * Relative targets are relative to the link’s parent directory. - * - * ```js - * import { symlink } from 'fs'; - * - * symlink('./mew', './example/mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` in the `example` which points - * to `mew` in the same directory: - * - * ```bash - * $ tree example/ - * example/ - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - */ - export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - type Type = 'dir' | 'file' | 'junction'; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..` and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode soperations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err, [path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. - * - * ```js - * import { mkdir } from 'fs'; - * - * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. - * mkdir('/tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback - ): void; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): string | undefined; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): void; - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs'; - * - * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`require('path').sep`). - * - * ```js - * import { tmpdir } from 'os'; - * import { mkdtemp } from 'fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp( - prefix: string, - options: - | 'buffer' - | { - encoding: 'buffer'; - }, - callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void - ): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer', - callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void - ): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void - ): void; - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options: - | 'buffer' - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | BufferEncoding - | null - ): string[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer' - ): Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): string[] | Buffer[]; - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it - * must have an own `toString` function property. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void - ): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__( - fd: number, - string: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * If `buffer` is a plain object, it must have an own (not inherited) `toString`function property. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @return The number of bytes written. - */ - export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; - export type ReadPosition = number | bigint; - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param [buffer=Buffer.alloc(16384)] The buffer that the data will be written to. - * @param [offset=0] The position in `buffer` to write the data to. - * @param [length=buffer.byteLength] The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void - ): void; - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null - ): Promise<{ - bytesRead: number; - buffer: TBuffer; - }>; - } - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - callback: (err: NodeJS.ErrnoException | null, data: string) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | undefined - | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void - ): void; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | null - ): Buffer; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding - ): string; - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): string | Buffer; - export type WriteFileOptions = - | (ObjectEncodingOptions & - Abortable & { - mode?: Mode | undefined; - flag?: string | undefined; - }) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `data` is a plain object, it must have an own (not inherited) `toString`function property. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; - } - /** - * Returns `undefined`. - * - * If `data` is a plain object, it must have an own (not inherited) `toString`function property. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * ```js - * import { appendFileSync } from 'fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtime` and `prev.mtime`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | { - persistent?: boolean | undefined; - interval?: number | undefined; - } - | undefined, - listener: (curr: Stats, prev: Stats) => void - ): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | 'buffer' | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = 'rename' | 'change'; - export type WatchListener = (event: WatchEventType, filename: T) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer', - listener?: WatchListener - ): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): FSWatcher; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won’t be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export namespace constants { - // File Access Constants - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - // File Copy Constants - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - // File Open Constants - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - // File Type Constants - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - // File Mode Constants - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. Check `File access constants` for possible values - * of `mode`. It is possible to create a mask consisting of the bitwise OR of - * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`). - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file exists in the current directory, and if it is writable. - * access(file, constants.F_OK | constants.W_OK, (err) => { - * if (err) { - * console.error( - * `${file} ${err.code === 'ENOENT' ? 'does not exist' : 'is read-only'}`); - * } else { - * console.log(`${file} exists, and it is writable`); - * } - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - /** - * Synchronously tests a user's permissions for the file or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. Check `File access constants` for - * possible values of `mode`. It is possible to create a mask consisting of - * the bitwise OR of two or more values - * (e.g. `fs.constants.W_OK | fs.constants.R_OK`). - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - /** - * @default false - */ - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - } - interface ReadStreamOptions extends StreamOptions { - end?: number | undefined; - } - /** - * Unlike the 16 kb default `highWaterMark` for a readable stream, the stream - * returned by this method has a default `highWaterMark` of 64 kb. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed, like most `Readable` streams. Set the `emitClose` option to`false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * overrides for `open`, `read`, and `close` are required. - * - * ```js - * import { createReadStream } from 'fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - * @return See `Readable Stream`. - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than replacing - * it may require the `flags` option to be set to `r+` rather than the default `w`. - * The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed, like most `Writable` streams. Set the `emitClose` option to`false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for `open`,`close`, and at least one of `write` and `writev` are required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - * @return See `Writable Stream`. - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export function fdatasyncSync(fd: number): void; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. No arguments other than a possible exception are given to the - * callback function. Node.js makes no guarantees about the atomicity of the copy - * operation. If an error occurs after the destination file has been opened for - * writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. Node.js makes no guarantees about the - * atomicity of the copy operation. If an error occurs after the destination file - * has been opened for writing, Node.js will attempt to remove the destination. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - */ - export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function writev( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - */ - export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function readv( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; - export interface OpenDirOptions { - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: string, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir(path: string, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export namespace opendir { - function __promisify__(path: string, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - throwIfNoEntry?: boolean | undefined; - } - export interface CopyOptions { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp(source: string, destination: string, callback: (err: NodeJS.ErrnoException | null) => void): void; - export function cp(source: string, destination: string, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string, destination: string, opts?: CopyOptions): void; -} -declare module 'node:fs' { - export * from 'fs'; -} diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts deleted file mode 100755 index ea65b7d..0000000 --- a/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,997 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module 'fs/promises' { - import { Abortable } from 'node:events'; - import { Stream } from 'node:stream'; - import { - Stats, - BigIntStats, - StatOptions, - WriteVResult, - ReadVResult, - PathLike, - RmDirOptions, - RmOptions, - MakeDirectoryOptions, - Dirent, - OpenDirOptions, - Dir, - ObjectEncodingOptions, - BufferEncodingOption, - OpenMode, - Mode, - WatchOptions, - WatchEventType, - CopyOptions, - } from 'node:fs'; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fufills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param [offset=0] The location in the buffer at which to start filling. - * @param [length=buffer.byteLength] The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options: - | { - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile( - options?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - } - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: string | number | Date, mtime: string | number | Date): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, or an object with an own `toString` function - * property. The promise is resolved with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; - /** - * Write `buffer` to the file. - * - * If `buffer` is a plain object, it must have an own (not inherited) `toString`function property. - * - * The promise is resolved with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). For this - * scenario, use `fs.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param [offset=0] The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength] The number of bytes from `buffer` to write. - * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. - * See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [<ArrayBufferView>](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView)s to the file. - * - * The promise is resolved with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be resolved (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: ReadonlyArray, position?: number): Promise; - /** - * Read from a file and write to an array of [<ArrayBufferView>](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView)s - * @since v13.13.0, v12.17.0 - * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: ReadonlyArray, position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. Check `File access constants` for possible values - * of `mode`. It is possible to create a mask consisting of the bitwise OR of - * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`). - * - * If the accessibility check is successful, the promise is resolved with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access } from 'fs/promises'; - * import { constants } from 'fs'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { constants } from 'fs'; - * import { copyFile } from 'fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): Promise; - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | 'buffer' - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX[`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * resolved with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path - * to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. - * @since v10.0.0 - * @param [type='file'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html)documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; - /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs/promises'; - * - * try { - * await mkdtemp(path.join(os.tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing - * platform-specific path separator - * (`require('path').sep`). - * @since v10.0.0 - * @return Fulfills with a string containing the filesystem path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `Buffer`, or, an object with an own (not inherited)`toString` function property. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs/promises'; - * import { Buffer } from 'buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | null - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options: - | ({ - encoding: BufferEncoding; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - ): Promise; - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | (ObjectEncodingOptions & - Abortable & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX[`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: string, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * const { watch } = require('fs/promises'); - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer' - ): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string, destination: string, opts?: CopyOptions): Promise; -} -declare module 'node:fs/promises' { - export * from 'fs/promises'; -} diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts deleted file mode 100755 index ae974db..0000000 --- a/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,284 +0,0 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require { } -interface RequireResolve extends NodeJS.RequireResolve { } -interface NodeModule extends NodeJS.Module { } - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); - -//#region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(): void; -} - -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; -} - -declare var AbortController: { - prototype: AbortController; - new(): AbortController; -}; - -declare var AbortSignal: { - prototype: AbortSignal; - new(): AbortSignal; - // TODO: Add abort() static -}; -//#endregion borrowed - -//#region ArrayLike.at() -interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -//#endregion ArrayLike.at() end - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | null; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - } - - interface ErrnoException extends Error { - errno?: number | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined; }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): void; - end(data: string | Uint8Array, cb?: () => void): void; - end(str: string, encoding?: BufferEncoding, cb?: () => void): void; - } - - interface ReadWriteStream extends ReadableStream, WritableStream { } - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined; }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - '.js': (m: Module, filename: string) => any; - '.json': (m: Module, filename: string) => any; - '.node': (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since 11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } -} diff --git a/node_modules/@types/node/globals.global.d.ts b/node_modules/@types/node/globals.global.d.ts deleted file mode 100755 index ef1198c..0000000 --- a/node_modules/@types/node/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts deleted file mode 100755 index 4f01253..0000000 --- a/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,1358 +0,0 @@ -/** - * To use the HTTP server and client one must `require('http')`. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'mysite.com', - * 'accept': '*' } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'mysite.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/http.js) - */ -declare module 'http' { - import * as stream from 'node:stream'; - import { URL } from 'node:url'; - import { Socket, Server as NetServer } from 'node:net'; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - 'accept-language'?: string | undefined; - 'accept-patch'?: string | undefined; - 'accept-ranges'?: string | undefined; - 'access-control-allow-credentials'?: string | undefined; - 'access-control-allow-headers'?: string | undefined; - 'access-control-allow-methods'?: string | undefined; - 'access-control-allow-origin'?: string | undefined; - 'access-control-expose-headers'?: string | undefined; - 'access-control-max-age'?: string | undefined; - 'access-control-request-headers'?: string | undefined; - 'access-control-request-method'?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - 'alt-svc'?: string | undefined; - authorization?: string | undefined; - 'cache-control'?: string | undefined; - connection?: string | undefined; - 'content-disposition'?: string | undefined; - 'content-encoding'?: string | undefined; - 'content-language'?: string | undefined; - 'content-length'?: string | undefined; - 'content-location'?: string | undefined; - 'content-range'?: string | undefined; - 'content-type'?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - 'if-match'?: string | undefined; - 'if-modified-since'?: string | undefined; - 'if-none-match'?: string | undefined; - 'if-unmodified-since'?: string | undefined; - 'last-modified'?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - 'proxy-authenticate'?: string | undefined; - 'proxy-authorization'?: string | undefined; - 'public-key-pins'?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - 'retry-after'?: string | undefined; - 'sec-websocket-accept'?: string | undefined; - 'sec-websocket-extensions'?: string | undefined; - 'sec-websocket-key'?: string | undefined; - 'sec-websocket-protocol'?: string | undefined; - 'sec-websocket-version'?: string | undefined; - 'set-cookie'?: string[] | undefined; - 'strict-transport-security'?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - 'transfer-encoding'?: string | undefined; - upgrade?: string | undefined; - 'user-agent'?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - 'www-authenticate'?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict {} - interface ClientRequestArgs { - abort?: AbortSignal | undefined; - protocol?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - family?: number | undefined; - port?: number | string | null | undefined; - defaultPort?: number | string | undefined; - localAddress?: string | undefined; - socketPath?: string | undefined; - /** - * @default 8192 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - headers?: OutgoingHttpHeaders | undefined; - auth?: string | null | undefined; - agent?: Agent | boolean | undefined; - _defaultAgent?: Agent | undefined; - timeout?: number | undefined; - setHost?: boolean | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) | undefined; - } - interface ServerOptions { - IncomingMessage?: typeof IncomingMessage | undefined; - ServerResponse?: typeof ServerResponse | undefined; - /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 8192 - */ - maxHeaderSize?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when true. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - } - type RequestListener = (req: IncomingMessage, res: ServerResponse) => void; - /** - * @since v0.1.17 - */ - class Server extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * In case of inactivity, the rules defined in `server.timeout` apply. However, - * that inactivity based timeout would still allow the connection to be kept open - * if the headers are being sent very slowly (by default, up to a byte per 2 - * minutes). In order to prevent this, whenever header data arrives an additional - * check is made that more than `server.headersTimeout` milliseconds has not - * passed since the connection was established. If the check fails, a `'timeout'`event is emitted on the server object, and (by default) the socket is destroyed. - * See `server.timeout` for more information on how timeout behavior can be - * customized. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Socket) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'checkContinue', listener: RequestListener): this; - addListener(event: 'checkExpectation', listener: RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - addListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - addListener(event: 'request', listener: RequestListener): this; - addListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Socket): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'checkContinue', req: IncomingMessage, res: ServerResponse): boolean; - emit(event: 'checkExpectation', req: IncomingMessage, res: ServerResponse): boolean; - emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; - emit(event: 'connect', req: IncomingMessage, socket: stream.Duplex, head: Buffer): boolean; - emit(event: 'request', req: IncomingMessage, res: ServerResponse): boolean; - emit(event: 'upgrade', req: IncomingMessage, socket: stream.Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Socket) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'checkContinue', listener: RequestListener): this; - on(event: 'checkExpectation', listener: RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - on(event: 'request', listener: RequestListener): this; - on(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Socket) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'checkContinue', listener: RequestListener): this; - once(event: 'checkExpectation', listener: RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - once(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - once(event: 'request', listener: RequestListener): this; - once(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Socket) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'checkContinue', listener: RequestListener): this; - prependListener(event: 'checkExpectation', listener: RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - prependListener(event: 'request', listener: RequestListener): this; - prependListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'checkContinue', listener: RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - prependOnceListener(event: 'request', listener: RequestListener): this; - prependOnceListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from - * the perspective of the participants of HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: IncomingMessage; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Aliases of `outgoingMessage.socket` - * @since v0.3.0 - * @deprecated Since v15.12.0 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * occurs, Same as binding to the `timeout` event. - * - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value for the header object. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | ReadonlyArray): this; - /** - * Gets the value of HTTP header with the given name. If such a name doesn't - * exist in message, it will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript Object. This means that - * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.0.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array of names of headers of the outgoing outgoingMessage. All - * names are lowercase. - * @since v8.0.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v8.0.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers are **only** be emitted if the message is chunked encoded. If not, - * the trailer will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header fields in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Compulsorily flushes the message headers - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - constructor(req: IncomingMessage); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends a HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain' - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * does not check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.1.30 - */ - writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. - * - * Node.js does not check whether Content-Length and the length of the - * body which has been transmitted are equal or not. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0 - */ - getRawHeaderNames(): string[]; - addListener(event: 'abort', listener: () => void): this; - addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - addListener(event: 'continue', listener: () => void): this; - addListener(event: 'information', listener: (info: InformationEvent) => void): this; - addListener(event: 'response', listener: (response: IncomingMessage) => void): this; - addListener(event: 'socket', listener: (socket: Socket) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'abort', listener: () => void): this; - on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'continue', listener: () => void): this; - on(event: 'information', listener: (info: InformationEvent) => void): this; - on(event: 'response', listener: (response: IncomingMessage) => void): this; - on(event: 'socket', listener: (socket: Socket) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'abort', listener: () => void): this; - once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'continue', listener: () => void): this; - once(event: 'information', listener: (info: InformationEvent) => void): this; - once(event: 'response', listener: (response: IncomingMessage) => void): this; - once(event: 'socket', listener: (socket: Socket) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'abort', listener: () => void): this; - prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependListener(event: 'continue', listener: () => void): this; - prependListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependListener(event: 'socket', listener: (socket: Socket) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'abort', listener: () => void): this; - prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependOnceListener(event: 'continue', listener: () => void): this; - prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST' - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket`. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with '; '. - * * For all other headers, the values are joined together with ', '. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(request.url, `http://${request.headers.host}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and`request.headers.host` is `'localhost:3000'`: - * - * ```console - * $ node - * > new URL(request.url, `http://${request.headers.host}`) - * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost:3000', - * hostname: 'localhost', - * port: '3000', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - destroy(error?: Error): void; - } - interface AgentOptions { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean | undefined; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: 'fifo' | 'lifo' | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * @since v0.3.4 - */ - class Agent { - /** - * By default set to 256\. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * @since v0.1.13 - */ - function createServer(requestListener?: RequestListener): Server; - function createServer(options: ServerOptions, requestListener?: RequestListener): Server; - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs {} - /** - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const http = require('http'); - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!' - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData) - * } - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the - * request itself. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the - * response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!' - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored. - */ - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - let globalAgent: Agent; - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module 'node:http' { - export * from 'http'; -} diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts deleted file mode 100755 index bf0ae2d..0000000 --- a/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,2100 +0,0 @@ -/** - * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It - * can be accessed using: - * - * ```js - * const http2 = require('http2'); - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/http2.js) - */ -declare module 'http2' { - import EventEmitter = require('node:events'); - import * as fs from 'node:fs'; - import * as net from 'node:net'; - import * as stream from 'node:stream'; - import * as tls from 'node:tls'; - import * as url from 'node:url'; - import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; - export { OutgoingHttpHeaders } from 'node:http'; - export interface IncomingHttpStatusHeader { - ':status'?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ':path'?: string | undefined; - ':method'?: string | undefined; - ':authority'?: string | undefined; - ':scheme'?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Set the `true` if the `END_STREAM` flag was set in the request or response - * HEADERS frame received, indicating that no additional data should be received - * and the readable side of the `Http2Stream` will be closed. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session; - /** - * Provides miscellaneous information about the current state of the`Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * const http2 = require('http2'); - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - sendTrailers(headers: OutgoingHttpHeaders): void; - addListener(event: 'aborted', listener: () => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'streamClosed', listener: (code: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'wantTrailers', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'aborted'): boolean; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: Buffer | string): boolean; - emit(event: 'drain'): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'frameError', frameType: number, errorCode: number): boolean; - emit(event: 'pipe', src: stream.Readable): boolean; - emit(event: 'unpipe', src: stream.Readable): boolean; - emit(event: 'streamClosed', code: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'wantTrailers'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'aborted', listener: () => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: 'streamClosed', listener: (code: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'wantTrailers', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'aborted', listener: () => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: 'streamClosed', listener: (code: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'wantTrailers', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'aborted', listener: () => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'streamClosed', listener: (code: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'wantTrailers', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'aborted', listener: () => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'wantTrailers', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: 'continue', listener: () => {}): this; - addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'continue'): boolean; - emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'continue', listener: () => {}): this; - on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'continue', listener: () => {}): this; - once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'continue', listener: () => {}): this; - prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'continue', listener: () => {}): this; - prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - /** - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to - * collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is - * defined, then it will be called. Otherwise - * the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.log(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings(settings: Settings): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - unref(): void; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - addListener(event: 'localSettings', listener: (settings: Settings) => void): this; - addListener(event: 'ping', listener: () => void): this; - addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean; - emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; - emit(event: 'localSettings', settings: Settings): boolean; - emit(event: 'ping'): boolean; - emit(event: 'remoteSettings', settings: Settings): boolean; - emit(event: 'timeout'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - on(event: 'localSettings', listener: (settings: Settings) => void): this; - on(event: 'ping', listener: () => void): this; - on(event: 'remoteSettings', listener: (settings: Settings) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - once(event: 'localSettings', listener: (settings: Settings) => void): this; - once(event: 'ping', listener: () => void): this; - once(event: 'remoteSettings', listener: (settings: Settings) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependListener(event: 'localSettings', listener: (settings: Settings) => void): this; - prependListener(event: 'ping', listener: () => void): this; - prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this; - prependOnceListener(event: 'ping', listener: () => void): this; - prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * const http2 = require('http2'); - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: 'origin', listener: (origins: string[]) => void): this; - addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean; - emit(event: 'origin', origins: ReadonlyArray): boolean; - emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - on(event: 'origin', listener: (origins: string[]) => void): this; - on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - once(event: 'origin', listener: (origins: string[]) => void): this; - once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: 'origin', listener: (origins: string[]) => void): this; - prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this; - prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - export interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - // Http2Server - export interface SessionOptions { - maxDeflateDynamicTableSize?: number | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: 'http:' | 'https:' | undefined; - } - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage | undefined; - Http1ServerResponse?: typeof ServerResponse | undefined; - Http2ServerRequest?: typeof Http2ServerRequest | undefined; - Http2ServerResponse?: typeof Http2ServerResponse | undefined; - } - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} - export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} - export interface ServerOptions extends ServerSessionOptions {} - export interface SecureServerOptions extends SecureServerSessionOptions { - allowHTTP1?: boolean | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server extends net.Server, HTTP2ServerCommon { - addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - addListener(event: 'sessionError', listener: (err: Error) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'session', session: ServerHttp2Session): boolean; - emit(event: 'sessionError', err: Error): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'session', listener: (session: ServerHttp2Session) => void): this; - on(event: 'sessionError', listener: (err: Error) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'session', listener: (session: ServerHttp2Session) => void): this; - once(event: 'sessionError', listener: (err: Error) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependListener(event: 'sessionError', listener: (err: Error) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { - addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - addListener(event: 'sessionError', listener: (err: Error) => void): this; - addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: 'session', session: ServerHttp2Session): boolean; - emit(event: 'sessionError', err: Error): boolean; - emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: 'timeout'): boolean; - emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: 'session', listener: (session: ServerHttp2Session) => void): this; - on(event: 'sessionError', listener: (err: Error) => void): this; - on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: 'session', listener: (session: ServerHttp2Session) => void): this; - once(event: 'sessionError', listener: (err: Error) => void): this; - once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependListener(event: 'sessionError', listener: (err: Error) => void): this; - prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; - prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - readonly url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'aborted', hadError: boolean, code: number): boolean; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: Buffer | string): boolean; - emit(event: 'end'): boolean; - emit(event: 'readable'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: Buffer | string) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: Buffer | string) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 request object. - * @since v15.7.0 - */ - readonly req: Http2ServerRequest; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ''; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): void; - end(data: string | Uint8Array, callback?: () => void): void; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): void; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | ReadonlyArray): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses_must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (error: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'drain'): boolean; - emit(event: 'error', error: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'pipe', src: stream.Readable): boolean; - emit(event: 'unpipe', src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (error: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (error: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (error: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (error: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * const http2 = require('http2'); - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. - * - * Since there are no browsers known that support[unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * const http2 = require('http2'); - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem') - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * const http2 = require('http2'); - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void - ): ClientHttp2Session; -} -declare module 'node:http2' { - export * from 'http2'; -} diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts deleted file mode 100755 index 4b74017..0000000 --- a/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,391 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/https.js) - */ -declare module 'https' { - import { Duplex } from 'node:stream'; - import * as tls from 'node:tls'; - import * as http from 'node:http'; - import { URL } from 'node:url'; - type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = http.RequestOptions & - tls.SecureContextOptions & { - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor(options: ServerOptions, requestListener?: http.RequestListener); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Duplex) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'checkContinue', listener: http.RequestListener): this; - addListener(event: 'checkExpectation', listener: http.RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - addListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - addListener(event: 'request', listener: http.RequestListener): this; - addListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean; - emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean; - emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; - emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean; - emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Duplex): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'checkContinue', req: http.IncomingMessage, res: http.ServerResponse): boolean; - emit(event: 'checkExpectation', req: http.IncomingMessage, res: http.ServerResponse): boolean; - emit(event: 'clientError', err: Error, socket: Duplex): boolean; - emit(event: 'connect', req: http.IncomingMessage, socket: Duplex, head: Buffer): boolean; - emit(event: 'request', req: http.IncomingMessage, res: http.ServerResponse): boolean; - emit(event: 'upgrade', req: http.IncomingMessage, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Duplex) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'checkContinue', listener: http.RequestListener): this; - on(event: 'checkExpectation', listener: http.RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - on(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - on(event: 'request', listener: http.RequestListener): this; - on(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Duplex) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'checkContinue', listener: http.RequestListener): this; - once(event: 'checkExpectation', listener: http.RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - once(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - once(event: 'request', listener: http.RequestListener): this; - once(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'checkContinue', listener: http.RequestListener): this; - prependListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependListener(event: 'request', listener: http.RequestListener): this; - prependListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependOnceListener(event: 'request', listener: http.RequestListener): this; - prependOnceListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample' - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer(requestListener?: http.RequestListener): Server; - function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const https = require('https'); - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET' - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * const tls = require('tls'); - * const https = require('https'); - * const crypto = require('crypto'); - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha25 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * const https = require('https'); - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - let globalAgent: Agent; -} -declare module 'node:https' { - export * from 'https'; -} diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts deleted file mode 100755 index 9636fae..0000000 --- a/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -// Type definitions for non-npm package Node.js 16.9 -// Project: https://nodejs.org/ -// Definitions by: Microsoft TypeScript -// DefinitelyTyped -// Alberto Schiabel -// Alvis HT Tang -// Andrew Makarov -// Benjamin Toueg -// Chigozirim C. -// David Junger -// Deividas Bakanas -// Eugene Y. Q. Shen -// Hannes Magnusson -// Huw -// Kelvin Jin -// Klaus Meinhardt -// Lishude -// Mariusz Wiktorczyk -// Mohsen Azimi -// Nicolas Even -// Nikita Galkin -// Parambir Singh -// Sebastian Silbermann -// Simon Schick -// Thomas den Hollander -// Wilco Bakker -// wwwy3y3 -// Samuel Ainsworth -// Kyle Uehlein -// Thanik Bhongbhibhat -// Marcin Kopacz -// Trivikram Kamat -// Minh Son Nguyen -// Junxiao Shi -// Ilia Baryshnikov -// ExE Boss -// Surasak Chaisurin -// Piotr Błażejewicz -// Anna Henningsen -// Jason Kwok -// Victor Perin -// Yongsheng Zhang -// NodeJS Contributors -// Linus Unnebäck -// wafuwafu13 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -// NOTE: These definitions support NodeJS and TypeScript 3.7+. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/node_modules/@types/node/inspector.d.ts b/node_modules/@types/node/inspector.d.ts deleted file mode 100755 index 0317192..0000000 --- a/node_modules/@types/node/inspector.d.ts +++ /dev/null @@ -1,2738 +0,0 @@ -// tslint:disable-next-line:dt-header -// Type definitions for inspector - -// These definitions are auto-generated. -// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 -// for more information. - -// tslint:disable:max-line-length - -/** - * The `inspector` module provides an API for interacting with the V8 inspector. - * - * It can be accessed using: - * - * ```js - * const inspector = require('inspector'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - interface InspectorNotification { - method: string; - params: T; - } - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[] | undefined; - } - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject | undefined; - } - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {} | undefined; - } - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string | undefined; - } - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace | undefined; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - /** - * Call frame identifier. - */ - type CallFrameId = string; - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - } - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location | undefined; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject | undefined; - } - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId | undefined; - } - } - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { - /** - * Name of a type collected with type profiling. - */ - name: string; - } - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; - /** - * The types for this parameter or return value. - */ - types: TypeObject[]; - } - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Type profile entries for parameters and return values of the functions in the script. - */ - entries: TypeProfileEntry[]; - } - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string; - /** - * Included category filters. - */ - includedCategories: string[]; - } - interface StartParameterType { - traceConfig: TraceConfig; - } - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - namespace NodeWorker { - type WorkerID = string; - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - interface DetachParameterType { - sessionId: SessionID; - } - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - /** - * The `inspector.Session` is used for dispatching messages to the V8 inspector - * back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. - */ - constructor(); - /** - * Connects a session to the inspector back-end. - * @since v8.0.0 - */ - connect(): void; - /** - * Immediately close the session. All pending message callbacks will be called - * with an error. `session.connect()` will need to be called to be able to send - * messages again. Reconnected session will lose all inspector state, such as - * enabled agents or configured breakpoints. - * @since v8.0.0 - */ - disconnect(): void; - /** - * Posts a message to the inspector back-end. `callback` will be notified when - * a response is received. `callback` is a function that accepts two optional - * arguments: error and message-specific result. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the[Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8\. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - * - * ## Example usage - * - * Apart from the debugger, various V8 Profilers are available through the DevTools - * protocol. - * @since v8.0.0 - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - /** - * Evaluates expression on global object. - */ - post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - /** - * Add handler to promise with given promise object id. - */ - post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - /** - * Releases remote object with given id. - */ - post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; - /** - * Releases all remote objects that belong to a given group. - */ - post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; - /** - * Disables reporting of execution contexts creation. - */ - post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; - /** - * Discards collected exceptions and console API calls. - */ - post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; - /** - * Compiles expression. - */ - post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - /** - * Runs script with given id in a given context. - */ - post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: 'Runtime.globalLexicalScopeNames', - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - /** - * Removes JavaScript breakpoint. - */ - post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: 'Debugger.getPossibleBreakpoints', - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - /** - * Continues execution until specific location is reached. - */ - post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; - /** - * Steps into the function call. - */ - post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; - /** - * Steps out of the function call. - */ - post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - /** - * Searches for given string in script content. - */ - post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - /** - * Edits JavaScript source live. - */ - post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - /** - * Restarts particular call frame from the beginning. - */ - post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - /** - * Returns source for the script with given id. - */ - post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; - /** - * Evaluates expression on a given call frame. - */ - post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; - /** - * Enables or disables async call stacks tracking. - */ - post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: 'Console.enable', callback?: (err: Error | null) => void): void; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - /** - * Enable type profile. - * @experimental - */ - post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental - */ - post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; - /** - * Collect type profile. - * @experimental - */ - post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; - post( - method: 'HeapProfiler.getObjectByHeapObjectId', - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - /** - * Gets supported tracing categories. - */ - post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - /** - * Start trace events collection. - */ - post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; - /** - * Sends protocol message over session with given id. - */ - post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; - // Events - addListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; - emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; - emit(event: 'Runtime.executionContextsCleared'): boolean; - emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; - emit(event: 'NodeTracing.tracingComplete'): boolean; - emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; - emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - on(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - once(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - } - /** - * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically after node has - * started. - * - * If wait is `true`, will block until a client has connected to the inspect port - * and flow control has been passed to the debugger client. - * - * See the `security warning` regarding the `host`parameter usage. - * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. - * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. - * @param [wait=false] Block until a client has connected. Optional. - */ - function open(port?: number, host?: string, wait?: boolean): void; - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - /** - * Return the URL of the active inspector, or `undefined` if there is none. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help see https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help see https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; -} -declare module 'node:inspector' { - import EventEmitter = require('inspector'); - export = EventEmitter; -} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts deleted file mode 100755 index d83aec9..0000000 --- a/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @since v0.3.7 - */ -declare module 'module' { - import { URL } from 'node:url'; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * const fs = require('fs'); - * const assert = require('assert'); - * const { syncBuiltinESMExports } = require('module'); - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line number and column number in the generated source file, returns - * an object representing the position in the original file. The object returned - * consists of the following keys: - */ - findEntry(line: number, column: number): SourceMapping; - } - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static Module: typeof Module; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - url: string; - /** - * @experimental - * This feature is only available with the `--experimental-import-meta-resolve` - * command flag enabled. - * - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * @param specified The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. If none - * is specified, the value of `import.meta.url` is used as the default. - */ - resolve?(specified: string, parent?: string | URL): Promise; - } - } - export = Module; -} -declare module 'node:module' { - import module = require('module'); - export = module; -} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts deleted file mode 100755 index a704b5f..0000000 --- a/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,783 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * const net = require('net'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/net.js) - */ -declare module 'net' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import * as dns from 'node:dns'; - type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; - interface AddressInfo { - address: string; - family: string; - port: number; - } - interface SocketConstructorOpts { - fd?: number | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will_not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`,`socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort: number; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): void; - end(buffer: Uint8Array | string, callback?: () => void): void; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: (hadError: boolean) => void): this; - addListener(event: 'connect', listener: () => void): this; - addListener(event: 'data', listener: (data: Buffer) => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'timeout', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', hadError: boolean): boolean; - emit(event: 'connect'): boolean; - emit(event: 'data', data: Buffer): boolean; - emit(event: 'drain'): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean; - emit(event: 'ready'): boolean; - emit(event: 'timeout'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (hadError: boolean) => void): this; - on(event: 'connect', listener: () => void): this; - on(event: 'data', listener: (data: Buffer) => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'timeout', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (hadError: boolean) => void): this; - once(event: 'connect', listener: () => void): this; - once(event: 'data', listener: (data: Buffer) => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'timeout', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (hadError: boolean) => void): this; - prependListener(event: 'connect', listener: () => void): this; - prependListener(event: 'data', listener: (data: Buffer) => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this; - prependOnceListener(event: 'connect', listener: () => void): this; - prependOnceListener(event: 'data', listener: (data: Buffer) => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.log('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will_not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - listening: boolean; - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Socket) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Socket): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Socket) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Socket) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Socket) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - } - type IPVersion = 'ipv4' | 'ipv6'; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of an TCP echo server which listens for connections - * on port 8124: - * - * ```js - * const net = require('net'); - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```console - * $ telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```console - * $ nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Tests if input is an IP address. Returns `0` for invalid strings, - * returns `4` for IP version 4 addresses, and returns `6` for IP version 6 - * addresses. - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if input is a version 4 IP address, otherwise returns `false`. - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if input is a version 6 IP address, otherwise returns `false`. - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0 - */ - readonly port: number; - /** - * @since v15.14.0 - */ - readonly flowlabel: number; - } -} -declare module 'node:net' { - export * from 'net'; -} diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts deleted file mode 100755 index 000fa5e..0000000 --- a/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,455 +0,0 @@ -/** - * The `os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * const os = require('os'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/os.js) - */ -declare module 'os' { - interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: 'IPv4'; - } - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: 'IPv6'; - scopeid: number; - } - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T; - homedir: T; - } - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20 - * } - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. - * See[https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a `SystemError` if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: 'buffer' }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`. - * - * The return value is equivalent to `process.arch`. - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See[https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform. The value is set - * at compile time. Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): 'BE' | 'LE'; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module 'node:os' { - export * from 'os'; -} diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json deleted file mode 100755 index 9319db3..0000000 --- a/node_modules/@types/node/package.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "name": "@types/node", - "version": "16.9.1", - "description": "TypeScript definitions for Node.js", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "license": "MIT", - "contributors": [ - { - "name": "Microsoft TypeScript", - "url": "https://github.com/Microsoft", - "githubUsername": "Microsoft" - }, - { - "name": "DefinitelyTyped", - "url": "https://github.com/DefinitelyTyped", - "githubUsername": "DefinitelyTyped" - }, - { - "name": "Alberto Schiabel", - "url": "https://github.com/jkomyno", - "githubUsername": "jkomyno" - }, - { - "name": "Alvis HT Tang", - "url": "https://github.com/alvis", - "githubUsername": "alvis" - }, - { - "name": "Andrew Makarov", - "url": "https://github.com/r3nya", - "githubUsername": "r3nya" - }, - { - "name": "Benjamin Toueg", - "url": "https://github.com/btoueg", - "githubUsername": "btoueg" - }, - { - "name": "Chigozirim C.", - "url": "https://github.com/smac89", - "githubUsername": "smac89" - }, - { - "name": "David Junger", - "url": "https://github.com/touffy", - "githubUsername": "touffy" - }, - { - "name": "Deividas Bakanas", - "url": "https://github.com/DeividasBakanas", - "githubUsername": "DeividasBakanas" - }, - { - "name": "Eugene Y. Q. Shen", - "url": "https://github.com/eyqs", - "githubUsername": "eyqs" - }, - { - "name": "Hannes Magnusson", - "url": "https://github.com/Hannes-Magnusson-CK", - "githubUsername": "Hannes-Magnusson-CK" - }, - { - "name": "Huw", - "url": "https://github.com/hoo29", - "githubUsername": "hoo29" - }, - { - "name": "Kelvin Jin", - "url": "https://github.com/kjin", - "githubUsername": "kjin" - }, - { - "name": "Klaus Meinhardt", - "url": "https://github.com/ajafff", - "githubUsername": "ajafff" - }, - { - "name": "Lishude", - "url": "https://github.com/islishude", - "githubUsername": "islishude" - }, - { - "name": "Mariusz Wiktorczyk", - "url": "https://github.com/mwiktorczyk", - "githubUsername": "mwiktorczyk" - }, - { - "name": "Mohsen Azimi", - "url": "https://github.com/mohsen1", - "githubUsername": "mohsen1" - }, - { - "name": "Nicolas Even", - "url": "https://github.com/n-e", - "githubUsername": "n-e" - }, - { - "name": "Nikita Galkin", - "url": "https://github.com/galkin", - "githubUsername": "galkin" - }, - { - "name": "Parambir Singh", - "url": "https://github.com/parambirs", - "githubUsername": "parambirs" - }, - { - "name": "Sebastian Silbermann", - "url": "https://github.com/eps1lon", - "githubUsername": "eps1lon" - }, - { - "name": "Simon Schick", - "url": "https://github.com/SimonSchick", - "githubUsername": "SimonSchick" - }, - { - "name": "Thomas den Hollander", - "url": "https://github.com/ThomasdenH", - "githubUsername": "ThomasdenH" - }, - { - "name": "Wilco Bakker", - "url": "https://github.com/WilcoBakker", - "githubUsername": "WilcoBakker" - }, - { - "name": "wwwy3y3", - "url": "https://github.com/wwwy3y3", - "githubUsername": "wwwy3y3" - }, - { - "name": "Samuel Ainsworth", - "url": "https://github.com/samuela", - "githubUsername": "samuela" - }, - { - "name": "Kyle Uehlein", - "url": "https://github.com/kuehlein", - "githubUsername": "kuehlein" - }, - { - "name": "Thanik Bhongbhibhat", - "url": "https://github.com/bhongy", - "githubUsername": "bhongy" - }, - { - "name": "Marcin Kopacz", - "url": "https://github.com/chyzwar", - "githubUsername": "chyzwar" - }, - { - "name": "Trivikram Kamat", - "url": "https://github.com/trivikr", - "githubUsername": "trivikr" - }, - { - "name": "Minh Son Nguyen", - "url": "https://github.com/nguymin4", - "githubUsername": "nguymin4" - }, - { - "name": "Junxiao Shi", - "url": "https://github.com/yoursunny", - "githubUsername": "yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "url": "https://github.com/qwelias", - "githubUsername": "qwelias" - }, - { - "name": "ExE Boss", - "url": "https://github.com/ExE-Boss", - "githubUsername": "ExE-Boss" - }, - { - "name": "Surasak Chaisurin", - "url": "https://github.com/Ryan-Willpower", - "githubUsername": "Ryan-Willpower" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "url": "https://github.com/addaleax", - "githubUsername": "addaleax" - }, - { - "name": "Jason Kwok", - "url": "https://github.com/JasonHK", - "githubUsername": "JasonHK" - }, - { - "name": "Victor Perin", - "url": "https://github.com/victorperin", - "githubUsername": "victorperin" - }, - { - "name": "Yongsheng Zhang", - "url": "https://github.com/ZYSzys", - "githubUsername": "ZYSzys" - }, - { - "name": "NodeJS Contributors", - "url": "https://github.com/NodeJS", - "githubUsername": "NodeJS" - }, - { - "name": "Linus Unnebäck", - "url": "https://github.com/LinusU", - "githubUsername": "LinusU" - }, - { - "name": "wafuwafu13", - "url": "https://github.com/wafuwafu13", - "githubUsername": "wafuwafu13" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "2d4a0159d689896e5538afa996ef597df6922b3b716729c273148522b74b9f6c", - "typeScriptVersion": "3.7" -} \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts deleted file mode 100755 index 58712be..0000000 --- a/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -declare module 'path/posix' { - import path = require('path'); - export = path; -} -declare module 'path/win32' { - import path = require('path'); - export = path; -} -/** - * The `path` module provides utilities for working with file and directory paths. - * It can be accessed using: - * - * ```js - * const path = require('path'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/path.js) - */ -declare module 'path' { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param p string path to normalize. - */ - normalize(p: string): string; - /** - * Join all arguments together and normalize the resulting path. - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. - * - * @param paths paths to join. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param pathSegments string paths to join. Non-string arguments are ignored. - */ - resolve(...pathSegments: string[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * @param path path to test. - */ - isAbsolute(p: string): boolean; - /** - * Solve the relative path from {from} to {to}. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param p the path to evaluate. - */ - dirname(p: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param p the path to evaluate. - * @param ext optionally, an extension to remove from the result. - */ - basename(p: string, ext?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string - * - * @param p the path to evaluate. - */ - extname(p: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: string; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: string; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param pathString path to evaluate. - */ - parse(p: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathString path to evaluate. - */ - format(pP: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module 'node:path' { - import path = require('path'); - export = path; -} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100755 index 02f330c..0000000 --- a/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,555 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C[Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * - * ```js - * const { PerformanceObserver, performance } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/perf_hooks.js) - */ -declare module 'perf_hooks' { - import { AsyncResource } from 'node:async_hooks'; - type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly details?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()`. - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - */ - mark(name?: string, options?: MarkOptions): void; - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - */ - measure(name: string, startMark?: string, endMark?: string): void; - measure(name: string, options: MeasureOptions): void; - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T, options?: TimerifyOptions): T; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - } - interface PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0 - * * } - * * ] - * - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is - * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0 - * * } - * * ] - * - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called three times synchronously. `list` contains one item. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: ReadonlyArray; - } - | { - type: EntryType; - } - ): void; - } - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples - * @since v15.9.0 - */ - recordDelta(): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * const { monitorEventLoopDelay } = require('perf_hooks'); - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; -} -declare module 'node:perf_hooks' { - export * from 'perf_hooks'; -} diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts deleted file mode 100755 index 1f0d144..0000000 --- a/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,1477 +0,0 @@ -declare module 'process' { - import * as tty from 'node:tty'; - import { Worker } from 'node:worker_threads'; - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; - type Signals = - | 'SIGABRT' - | 'SIGALRM' - | 'SIGBUS' - | 'SIGCHLD' - | 'SIGCONT' - | 'SIGFPE' - | 'SIGHUP' - | 'SIGILL' - | 'SIGINT' - | 'SIGIO' - | 'SIGIOT' - | 'SIGKILL' - | 'SIGPIPE' - | 'SIGPOLL' - | 'SIGPROF' - | 'SIGPWR' - | 'SIGQUIT' - | 'SIGSEGV' - | 'SIGSTKFLT' - | 'SIGSTOP' - | 'SIGSYS' - | 'SIGTERM' - | 'SIGTRAP' - | 'SIGTSTP' - | 'SIGTTIN' - | 'SIGTTOU' - | 'SIGUNUSED' - | 'SIGURG' - | 'SIGUSR1' - | 'SIGUSR2' - | 'SIGVTALRM' - | 'SIGWINCH' - | 'SIGXCPU' - | 'SIGXFSZ' - | 'SIGBREAK' - | 'SIGLOST' - | 'SIGINFO'; - type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; - type MultipleResolveType = 'resolve' | 'reject'; - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; - type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - interface ProcessReport { - /** - * Directory where the report is written. - * working directory of the Node.js process. - * @default '' indicating that reports are written to the current - */ - directory: string; - /** - * Filename where the report is written. - * The default value is the empty string. - * @default '' the output filename will be comprised of a timestamp, - * PID, and sequence number. - */ - filename: string; - /** - * Returns a JSON-formatted diagnostic report for the running process. - * The report's JavaScript stack trace is taken from err, if present. - */ - getReport(err?: Error): string; - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @defaul false - */ - reportOnSignal: boolean; - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from err, if present. - * - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param error A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string): string; - writeReport(error?: Error): string; - writeReport(fileName?: string, err?: Error): string; - } - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - interface EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```console - * $ node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```console - * $ node --harmony script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ['--harmony'] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'process'; - * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information' - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information - * ``` - * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```console - * $ node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread’s `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit_before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. - */ - exit(code?: number): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @since v0.11.8 - */ - exitCode?: number | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid(): number; - /** - * The `process.setgid()` method sets the group identity of the process. (See[`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid(id: number | string): void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid(): number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See[`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid(id: number | string): void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid(): number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid(id: number | string): void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid(): number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid(id: number | string): void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups(): number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups(groups: ReadonlyArray): void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '11.13.0', - * v8: '7.0.276.38-node.18', - * uv: '1.27.0', - * zlib: '1.2.11', - * brotli: '1.0.7', - * ares: '1.15.0', - * modules: '67', - * nghttp2: '1.34.0', - * napi: '4', - * llhttp: '1.1.1', - * openssl: '1.1.1b', - * cldr: '34.0', - * icu: '63.1', - * tz: '2018e', - * unicode: '11.0' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns an `Object` containing the JavaScript - * representation of the configure options used to compile the current Node.js - * executable. This is the same as the `config.gypi` file that was produced when - * running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_dtrace: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * - * The `process.config` property is **not** read-only and there are existing - * modules in the ecosystem that are known to extend, modify, or entirely replace - * the value of `process.config`. - * - * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made - * read-only in a future release. - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`. - * - * ```js - * import { arch } from 'process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: string; - /** - * The `process.platform` property returns a string identifying the operating - * system platform on which the Node.js process is running. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js[is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Erbium', - * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be`undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - swallowErrors?: boolean | undefined; - }, - callback?: (error: Error | null) => void - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic - * reports for the current process. Additional documentation is available in the `report documentation`. - * @since v11.8.0 - */ - report?: ProcessReport | undefined; - /** - * ```js - * import { resourceUsage } from 'process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* EventEmitter */ - addListener(event: 'beforeExit', listener: BeforeExitListener): this; - addListener(event: 'disconnect', listener: DisconnectListener): this; - addListener(event: 'exit', listener: ExitListener): this; - addListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - addListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - addListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - addListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - addListener(event: 'warning', listener: WarningListener): this; - addListener(event: 'message', listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - addListener(event: 'worker', listener: WorkerListener): this; - emit(event: 'beforeExit', code: number): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'exit', code: number): boolean; - emit(event: 'rejectionHandled', promise: Promise): boolean; - emit(event: 'uncaughtException', error: Error): boolean; - emit(event: 'uncaughtExceptionMonitor', error: Error): boolean; - emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; - emit(event: 'warning', warning: Error): boolean; - emit(event: 'message', message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal: Signals): boolean; - emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; - emit(event: 'worker', listener: WorkerListener): this; - on(event: 'beforeExit', listener: BeforeExitListener): this; - on(event: 'disconnect', listener: DisconnectListener): this; - on(event: 'exit', listener: ExitListener): this; - on(event: 'rejectionHandled', listener: RejectionHandledListener): this; - on(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - on(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - on(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - on(event: 'warning', listener: WarningListener): this; - on(event: 'message', listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: 'multipleResolves', listener: MultipleResolveListener): this; - on(event: 'worker', listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'beforeExit', listener: BeforeExitListener): this; - once(event: 'disconnect', listener: DisconnectListener): this; - once(event: 'exit', listener: ExitListener): this; - once(event: 'rejectionHandled', listener: RejectionHandledListener): this; - once(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - once(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - once(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - once(event: 'warning', listener: WarningListener): this; - once(event: 'message', listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: 'multipleResolves', listener: MultipleResolveListener): this; - once(event: 'worker', listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'beforeExit', listener: BeforeExitListener): this; - prependListener(event: 'disconnect', listener: DisconnectListener): this; - prependListener(event: 'exit', listener: ExitListener): this; - prependListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - prependListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - prependListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - prependListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - prependListener(event: 'warning', listener: WarningListener): this; - prependListener(event: 'message', listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - prependListener(event: 'worker', listener: WorkerListener): this; - prependOnceListener(event: 'beforeExit', listener: BeforeExitListener): this; - prependOnceListener(event: 'disconnect', listener: DisconnectListener): this; - prependOnceListener(event: 'exit', listener: ExitListener): this; - prependOnceListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; - prependOnceListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; - prependOnceListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; - prependOnceListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; - prependOnceListener(event: 'warning', listener: WarningListener): this; - prependOnceListener(event: 'message', listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: 'multipleResolves', listener: MultipleResolveListener): this; - prependOnceListener(event: 'worker', listener: WorkerListener): this; - listeners(event: 'beforeExit'): BeforeExitListener[]; - listeners(event: 'disconnect'): DisconnectListener[]; - listeners(event: 'exit'): ExitListener[]; - listeners(event: 'rejectionHandled'): RejectionHandledListener[]; - listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; - listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; - listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; - listeners(event: 'warning'): WarningListener[]; - listeners(event: 'message'): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: 'multipleResolves'): MultipleResolveListener[]; - listeners(event: 'worker'): WorkerListener[]; - } - } - } - export = process; -} -declare module 'node:process' { - import process = require('process'); - export = process; -} diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts deleted file mode 100755 index 5854d67..0000000 --- a/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * const punycode = require('punycode'); - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/punycode.js) - */ -declare module 'punycode' { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a[Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492)encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: ReadonlyArray): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module 'node:punycode' { - export * from 'punycode'; -} diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts deleted file mode 100755 index ce6e60c..0000000 --- a/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * The `querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * const querystring = require('querystring'); - * ``` - * - * The `querystring` API is considered Legacy. While it is still maintained, - * new code should use the `URLSearchParams` API instead. - * @deprecated Legacy - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/querystring.js) - */ -declare module 'querystring' { - interface StringifyOptions { - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - maxKeys?: number | undefined; - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`:[<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [<bigint>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [<string\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [<number\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [<bigint\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [<boolean\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```js - * { - * foo: 'bar', - * abc: ['xyz', '123'] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module 'node:querystring' { - export * from 'querystring'; -} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts deleted file mode 100755 index 0f0706a..0000000 --- a/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,542 +0,0 @@ -/** - * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. It can be accessed - * using: - * - * ```js - * const readline = require('readline'); - * ``` - * - * The following simple example illustrates the basic use of the `readline` module. - * - * ```js - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * - * rl.question('What do you think of Node.js? ', (answer) => { - * // TODO: Log the answer in a database - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * }); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/readline.js) - */ -declare module 'readline' { - import { Abortable, EventEmitter } from 'node:events'; - interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' ') - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(options: ReadLineOptions); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * - * If this method is invoked as it's util.promisify()ed version, it returns a - * Promise that fulfills with the answer. If the question is canceled using - * an `AbortController` it will reject with an `AbortError`. - * - * ```js - * const util = require('util'); - * const question = util.promisify(rl.question).bind(rl); - * - * async function questionExample() { - * try { - * const answer = await question('What is you favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * } catch (err) { - * console.error('Question rejected', err); - * } - * } - * questionExample(); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `readline.Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `readline.Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'line', listener: (input: string) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: 'SIGCONT', listener: () => void): this; - addListener(event: 'SIGINT', listener: () => void): this; - addListener(event: 'SIGTSTP', listener: () => void): this; - addListener(event: 'history', listener: (history: string[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'line', input: string): boolean; - emit(event: 'pause'): boolean; - emit(event: 'resume'): boolean; - emit(event: 'SIGCONT'): boolean; - emit(event: 'SIGINT'): boolean; - emit(event: 'SIGTSTP'): boolean; - emit(event: 'history', history: string[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'line', listener: (input: string) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: 'SIGCONT', listener: () => void): this; - on(event: 'SIGINT', listener: () => void): this; - on(event: 'SIGTSTP', listener: () => void): this; - on(event: 'history', listener: (history: string[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'line', listener: (input: string) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: 'SIGCONT', listener: () => void): this; - once(event: 'SIGINT', listener: () => void): this; - once(event: 'SIGTSTP', listener: () => void): this; - once(event: 'history', listener: (history: string[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'line', listener: (input: string) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: 'SIGCONT', listener: () => void): this; - prependListener(event: 'SIGINT', listener: () => void): this; - prependListener(event: 'SIGTSTP', listener: () => void): this; - prependListener(event: 'history', listener: (history: string[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'line', listener: (input: string) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: 'SIGCONT', listener: () => void): this; - prependOnceListener(event: 'SIGINT', listener: () => void): this; - prependOnceListener(event: 'SIGTSTP', listener: () => void): this; - prependOnceListener(event: 'history', listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - type ReadLine = Interface; // type forwarded for backwards compatibility - type Completer = (line: string) => CompleterResult; - type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; - type CompleterResult = [string[], string]; - interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives `EOF` (Ctrl+D on - * Linux/macOS, Ctrl+Z followed by Return on - * Windows). - * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream: - * - * ```js - * process.stdin.unref(); - * ``` - * @since v0.1.98 - */ - function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; - function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * @since v0.7.7 - */ - function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - type Direction = -1 | 0 | 1; - interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given `TTY` stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ' - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('events'); - * const { createReadStream } = require('fs'); - * const { createInterface } = require('readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module 'node:readline' { - export * from 'readline'; -} diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts deleted file mode 100755 index 053d977..0000000 --- a/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,424 +0,0 @@ -/** - * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that - * is available both as a standalone program or includible in other applications. - * It can be accessed using: - * - * ```js - * const repl = require('repl'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/repl.js) - */ -declare module 'repl' { - import { Interface, Completer, AsyncCompleter } from 'node:readline'; - import { Context } from 'node:vm'; - import { InspectOptions } from 'node:util'; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean | undefined; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * Default: the REPL instance's `terminal` value. - */ - useColors?: boolean | undefined; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. - */ - useGlobal?: boolean | undefined; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * Default: `false`. - */ - ignoreUndefined?: boolean | undefined; - /** - * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter | undefined; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter | undefined; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. - */ - breakEvalOnSigint?: boolean | undefined; - } - type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { - options: InspectOptions; - }; - type REPLCommandAction = (this: REPLServer, text: string) => void; - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * const repl = require('repl'); - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * const repl = require('repl'); - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * } - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (*without* a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method readies the REPL instance for input - * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the - * 'prompt'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method clears any command that has been - * buffered but not yet executed. This method is primarily intended to be - * called from within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v9.0.0 - */ - clearBufferedCommand(): void; - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command-line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'line', listener: (input: string) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: 'SIGCONT', listener: () => void): this; - addListener(event: 'SIGINT', listener: () => void): this; - addListener(event: 'SIGTSTP', listener: () => void): this; - addListener(event: 'exit', listener: () => void): this; - addListener(event: 'reset', listener: (context: Context) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'line', input: string): boolean; - emit(event: 'pause'): boolean; - emit(event: 'resume'): boolean; - emit(event: 'SIGCONT'): boolean; - emit(event: 'SIGINT'): boolean; - emit(event: 'SIGTSTP'): boolean; - emit(event: 'exit'): boolean; - emit(event: 'reset', context: Context): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'line', listener: (input: string) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: 'SIGCONT', listener: () => void): this; - on(event: 'SIGINT', listener: () => void): this; - on(event: 'SIGTSTP', listener: () => void): this; - on(event: 'exit', listener: () => void): this; - on(event: 'reset', listener: (context: Context) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'line', listener: (input: string) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: 'SIGCONT', listener: () => void): this; - once(event: 'SIGINT', listener: () => void): this; - once(event: 'SIGTSTP', listener: () => void): this; - once(event: 'exit', listener: () => void): this; - once(event: 'reset', listener: (context: Context) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'line', listener: (input: string) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: 'SIGCONT', listener: () => void): this; - prependListener(event: 'SIGINT', listener: () => void): this; - prependListener(event: 'SIGTSTP', listener: () => void): this; - prependListener(event: 'exit', listener: () => void): this; - prependListener(event: 'reset', listener: (context: Context) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'line', listener: (input: string) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: 'SIGCONT', listener: () => void): this; - prependOnceListener(event: 'SIGINT', listener: () => void): this; - prependOnceListener(event: 'SIGTSTP', listener: () => void): this; - prependOnceListener(event: 'exit', listener: () => void): this; - prependOnceListener(event: 'reset', listener: (context: Context) => void): this; - } - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * const repl = require('repl'); - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - function start(options?: string | ReplOptions): REPLServer; - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - constructor(err: Error); - } -} -declare module 'node:repl' { - export * from 'repl'; -} diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts deleted file mode 100755 index 9fdf3bd..0000000 --- a/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,1218 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. - * - * To access the `stream` module: - * - * ```js - * const stream = require('stream'); - * ``` - * - * The `stream` module is useful for creating new types of stream instances. It is - * usually not necessary to use the `stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/stream.js) - */ -declare module 'stream' { - import { EventEmitter, Abortable } from 'node:events'; - import * as streamPromises from 'node:stream/promises'; - import * as streamConsumers from 'node:stream/consumers'; - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - } - ): T; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - class Readable extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call `readable.read()`, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0 - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when `'end'` event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method pulls some data out of the internal buffer and - * returns it. If no data available to be read, `null` is returned. By default, - * the data will be returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * const fs = require('fs'); - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * const { StringDecoder } = require('string_decoder'); - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.match(/\n\n/)) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * } else { - * // Still reading the header. - * header += str; - * } - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode - * streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `stream` module API - * as it is currently defined. (See `Compatibility` for more information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * const { OldReader } = require('./old-api-module.js'); - * const { Readable } = require('stream'); - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): void; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: any) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'data', chunk: any): boolean; - emit(event: 'end'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'pause'): boolean; - emit(event: 'readable'): boolean; - emit(event: 'resume'): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'data', listener: (chunk: any) => void): this; - on(event: 'end', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'data', listener: (chunk: any) => void): this; - once(event: 'end', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'data', listener: (chunk: any) => void): this; - prependListener(event: 'end', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'data', listener: (chunk: any) => void): this; - prependOnceListener(event: 'end', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: 'close', listener: () => void): this; - removeListener(event: 'data', listener: (chunk: any) => void): this; - removeListener(event: 'end', listener: () => void): this; - removeListener(event: 'error', listener: (err: Error) => void): this; - removeListener(event: 'pause', listener: () => void): this; - removeListener(event: 'readable', listener: () => void): this; - removeListener(event: 'resume', listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends Stream implements NodeJS.WritableStream { - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * It is recommended that once `write()` returns false, no more chunks be written - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * const fs = require('fs'); - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): void; - end(chunk: any, cb?: () => void): void; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): void; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, it is recommended that calls to `writable.uncork()` be - * deferred using `process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - destroy(error?: Error): void; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: Readable) => void): this; - addListener(event: 'unpipe', listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - emit(event: 'close'): boolean; - emit(event: 'drain'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'finish'): boolean; - emit(event: 'pipe', src: Readable): boolean; - emit(event: 'unpipe', src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: Readable) => void): this; - on(event: 'unpipe', listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: Readable) => void): this; - once(event: 'unpipe', listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: 'close', listener: () => void): this; - removeListener(event: 'drain', listener: () => void): this; - removeListener(event: 'error', listener: (err: Error) => void): this; - removeListener(event: 'finish', listener: () => void): this; - removeListener(event: 'pipe', listener: (src: Readable) => void): this; - removeListener(event: 'unpipe', listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends Readable implements Writable { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from(src: Stream | Blob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - _destroy(error: Error | null, callback: (error: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): void; - end(chunk: any, cb?: () => void): void; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): void; - cork(): void; - uncork(): void; - } - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream. - * - * ```js - * const fs = require('fs'); - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * const { finished } = require('stream'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - * - * The `finished` API provides promise version: - * - * ```js - * const { finished } = require('stream/promises'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * async function run() { - * await finished(rs); - * console.log('Stream is done reading.'); - * } - * - * run().catch(console.error); - * rs.resume(); // Drain the stream. - * ``` - * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. - */ - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - namespace finished { - function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends PipelineTransformSource - ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends PipelineDestinationPromiseFunction - ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal: AbortSignal; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * const { pipeline } = require('stream'); - * const fs = require('fs'); - * const zlib = require('zlib'); - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * } - * ); - * ``` - * - * The `pipeline` API provides a promise version, which can also - * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with - * an`AbortError`. - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * To use an `AbortSignal`, pass it inside an options object, - * as the last argument: - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * const ac = new AbortController(); - * const options = { - * signal: ac.signal, - * }; - * - * setTimeout(() => ac.abort(), 1); - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * options, - * ); - * } - * - * run().catch(console.error); // AbortError - * ``` - * - * The `pipeline` API also supports async generators: - * - * ```js - * const { pipeline } = require('stream/promises'); - * const fs = require('fs'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('lowercase.txt'), - * async function* (source) { - * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. - * for await (const chunk of source) { - * yield chunk.toUpperCase(); - * } - * }, - * fs.createWriteStream('uppercase.txt') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - callback?: (err: NodeJS.ErrnoException | null) => void - ): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array void)> - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module 'node:stream' { - import stream = require('stream'); - export = stream; -} diff --git a/node_modules/@types/node/stream/consumers.d.ts b/node_modules/@types/node/stream/consumers.d.ts deleted file mode 100755 index ce6c9bb..0000000 --- a/node_modules/@types/node/stream/consumers.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Duplicates of interface in lib.dom.ts. -// Duplicated here rather than referencing lib.dom.ts because doing so causes lib.dom.ts to be loaded for "test-all" -// Which in turn causes tests to pass that shouldn't pass. -// -// This interface is not, and should not be, exported. -interface Blob { - readonly size: number; - readonly type: string; - arrayBuffer(): Promise; - slice(start?: number, end?: number, contentType?: string): Blob; - stream(): NodeJS.ReadableStream; - text(): Promise; -} -declare module 'stream/consumers' { - import { Readable } from 'node:stream'; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; -} -declare module 'node:stream/consumers' { - export * from 'stream/consumers'; -} diff --git a/node_modules/@types/node/stream/promises.d.ts b/node_modules/@types/node/stream/promises.d.ts deleted file mode 100755 index b427073..0000000 --- a/node_modules/@types/node/stream/promises.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -declare module 'stream/promises' { - import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module 'node:stream/promises' { - export * from 'stream/promises'; -} diff --git a/node_modules/@types/node/stream/web.d.ts b/node_modules/@types/node/stream/web.d.ts deleted file mode 100755 index a9d75c1..0000000 --- a/node_modules/@types/node/stream/web.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module 'stream/web' { - // stub module, pending copy&paste from .d.ts or manual impl -} -declare module 'node:stream/web' { - export * from 'stream/web'; -} diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts deleted file mode 100755 index f12aa98..0000000 --- a/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `string_decoder` module provides an API for decoding `Buffer` objects into - * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/string_decoder.js) - */ -declare module 'string_decoder' { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - write(buffer: Buffer): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - end(buffer?: Buffer): string; - } -} -declare module 'node:string_decoder' { - export * from 'string_decoder'; -} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts deleted file mode 100755 index 3f3bace..0000000 --- a/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to call `require('timers')` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/timers.js) - */ -declare module 'timers' { - import { Abortable } from 'node:events'; - import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - interface Immediate extends RefCounted { - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - } - interface Timeout extends Timer { - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - } - } - function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - function clearTimeout(timeoutId: NodeJS.Timeout): void; - function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - function clearInterval(intervalId: NodeJS.Timeout): void; - function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - function clearImmediate(immediateId: NodeJS.Immediate): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module 'node:timers' { - export * from 'timers'; -} diff --git a/node_modules/@types/node/timers/promises.d.ts b/node_modules/@types/node/timers/promises.d.ts deleted file mode 100755 index fd77888..0000000 --- a/node_modules/@types/node/timers/promises.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module 'timers/promises' { - import { TimerOptions } from 'node:timers'; - /** - * ```js - * import { - * setTimeout, - * } from 'timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * - * ```js - * import { - * setInterval, - * } from 'timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; -} -declare module 'node:timers/promises' { - export * from 'timers/promises'; -} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts deleted file mode 100755 index 8d523b4..0000000 --- a/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,1019 +0,0 @@ -/** - * The `tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * const tls = require('tls'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/tls.js) - */ -declare module 'tls' { - import { X509Certificate } from 'node:crypto'; - import * as net from 'node:net'; - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - interface PeerCertificate { - subject: Certificate; - issuer: Certificate; - subjectaltname: string; - infoAccess: NodeJS.Dict; - modulus: string; - exponent: string; - valid_from: string; - valid_to: string; - fingerprint: string; - fingerprint256: string; - ext_key_usage: string[]; - serialNumber: string; - raw: Buffer; - } - interface DetailedPeerCertificate extends PeerCertificate { - issuerCertificate: DetailedPeerCertificate; - } - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket, options?: TLSSocketOptions); - /** - * Returns `true` if the peer certificate was signed by one of the CAs specified - * when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: boolean; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example: - * - * ```json - * { - * "name": "AES128-SHA256", - * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", - * "version": "TLSv1.2" - * } - * ``` - * - * See[SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html)for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the - * current connection. The value `'unknown'` will be returned for connected - * sockets that have not completed the handshaking process. The value `null` will - * be returned for server sockets or disconnected client sockets. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See[SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html)for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * fragments are buffered by the TLS layer until the entire fragment is received - * and its integrity is verified; large fragments can span multiple roundtrips - * and their processing can be delayed due to packet loss or reordering. However, - * smaller fragments add extra TLS framing bytes and CPU overhead, which may - * decrease overall server throughput. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * Note: The format of the output is identical to the output of `openssl s_client -trace` or `openssl s_server -trace`. While it is produced by OpenSSL's`SSL_trace()` function, the format is - * undocumented, can change without notice, - * and should not be relied on. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - addListener(event: 'secureConnect', listener: () => void): this; - addListener(event: 'session', listener: (session: Buffer) => void): this; - addListener(event: 'keylog', listener: (line: Buffer) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'OCSPResponse', response: Buffer): boolean; - emit(event: 'secureConnect'): boolean; - emit(event: 'session', session: Buffer): boolean; - emit(event: 'keylog', line: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - on(event: 'secureConnect', listener: () => void): this; - on(event: 'session', listener: (session: Buffer) => void): this; - on(event: 'keylog', listener: (line: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - once(event: 'secureConnect', listener: () => void): this; - once(event: 'session', listener: (session: Buffer) => void): this; - once(event: 'keylog', listener: (line: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - prependListener(event: 'secureConnect', listener: () => void): this; - prependListener(event: 'session', listener: (session: Buffer) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; - prependOnceListener(event: 'secureConnect', listener: () => void): this; - prependOnceListener(event: 'session', listener: (session: Buffer) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this; - } - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: net.Socket | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean; - emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean; - emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; - emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean; - emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; - interface SecureContextOptions { - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use - * openssl dhparam to create the parameters. The key length must be - * greater than or equal to 1024 bits or else an error will be thrown. - * Although 1024 bits is permissible, use 2048 bits or larger for - * stronger security. If omitted or invalid, the parameters are - * silently discarded and DHE ciphers will not be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion | undefined; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [<undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function can be overwritten by providing alternative function as part of - * the `options.checkServerIdentity` option passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ] - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - /** - * {@link createServer} sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods. - * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using[Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options - * are provided, the lowest minimum is used. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: ReadonlyArray; -} -declare module 'node:tls' { - export * from 'tls'; -} diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts deleted file mode 100755 index 67f3298..0000000 --- a/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -/** - * The `trace_events` module provides a mechanism to centralize tracing information - * generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.perf`: Enables capture of `Performance API` measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `trace_events` module: - * - * ```js - * const trace_events = require('trace_events'); - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in `Worker` threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/trace_events.js) - */ -declare module 'trace_events' { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - */ - readonly categories: string; - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - */ - disable(): void; - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - */ - enable(): void; - /** - * `true` only if the `Tracing` object has been enabled. - */ - readonly enabled: boolean; - } - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - /** - * Creates and returns a `Tracing` object for the given set of `categories`. - * - * ```js - * const trace_events = require('trace_events'); - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - * @return . - */ - function createTracing(options: CreateTracingOptions): Tracing; - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is determined - * by the _union_ of all currently-enabled `Tracing` objects and any categories - * enabled using the `--trace-event-categories` flag. - * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. - * - * ```js - * const trace_events = require('trace_events'); - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module 'node:trace_events' { - export * from 'trace_events'; -} diff --git a/node_modules/@types/node/tty.d.ts b/node_modules/@types/node/tty.d.ts deleted file mode 100755 index e8cb236..0000000 --- a/node_modules/@types/node/tty.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -/** - * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. - * In most cases, it will not be necessary or possible to use this module directly. - * However, it can be accessed using: - * - * ```js - * const tty = require('tty'); - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * In most cases, there should be little to no reason for an application to - * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/tty.js) - */ -declare module 'tty' { - import * as net from 'node:net'; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. Defaults to `false`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input characters.Ctrl+C will no longer cause a `SIGINT` when in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'resize', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'resize'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'resize', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'resize', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'resize', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'resize', listener: () => void): this; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 - * - * colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module 'node:tty' { - export * from 'tty'; -} diff --git a/node_modules/@types/node/url.d.ts b/node_modules/@types/node/url.d.ts deleted file mode 100755 index fe07ea4..0000000 --- a/node_modules/@types/node/url.d.ts +++ /dev/null @@ -1,798 +0,0 @@ -/** - * The `url` module provides utilities for URL resolution and parsing. It can be - * accessed using: - * - * ```js - * import url from 'url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/url.js) - */ -declare module 'url' { - import { Blob } from 'node:buffer'; - import { ClientRequestArgs } from 'node:http'; - import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring'; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * A `URIError` is thrown if the `auth` property is present but cannot be decoded. - * - * Use of the legacy `url.parse()` method is discouraged. Users should - * use the WHATWG `URL` API. Because the `url.parse()` method uses a - * lenient, non-standard algorithm for parsing URL strings, security - * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and - * incorrect handling of usernames and passwords have been identified. - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param urlString The URL string to parse. - * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property - * on the returned URL object will be an unparsed, undecoded string. - * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json' - * } - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a Web browser resolving an anchor tag HREF. - * - * ```js - * const url = require('url'); - * url.resolve('/one/two/three', 'four'); // '/one/two/four' - * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' - * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * - * You can achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param from The Base URL being resolved against. - * @param to The HREF URL being resolved. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. - * - * ```js - * import url from 'url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. - * - * ```js - * import url from 'url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToUnicode(domain: string): string; - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * - * ```js - * import { fileURLToPath } from 'url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file path. - */ - function fileURLToPath(url: string | URL): string; - /** - * This function ensures that `path` is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * - * ```js - * import { pathToFileURL } from 'url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - auth?: boolean | undefined; - fragment?: boolean | undefined; - search?: boolean | undefined; - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject` s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * const { - * Blob, - * resolveObjectURL, - * } = require('buffer'); - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - * @experimental - */ - static createObjectURL(blob: Blob): string; - /** - * Removes the stored `Blob` identified by the given ID. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(objectUrl: string): void; - constructor(input: string, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myUrl = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myUrl.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myUrl.searchParams.sort(); - * - * console.log(myUrl.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - /** - * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor(init?: URLSearchParams | string | NodeJS.Dict> | Iterable<[string, string]> | ReadonlyArray<[string, string]>); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`. - * - * Alias for `urlSearchParams[@@iterator]()`. - */ - entries(): IterableIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach(callback: (this: TThis, value: string, name: string, searchParams: this) => void, thisArg?: TThis): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; - } -} -declare module 'node:url' { - export * from 'url'; -} diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts deleted file mode 100755 index b8cb07e..0000000 --- a/node_modules/@types/node/util.d.ts +++ /dev/null @@ -1,1564 +0,0 @@ -/** - * The `util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * const util = require('util'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/util.js) - */ -declare module 'util' { - import * as types from 'node:util/types'; - export interface InspectOptions { - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default `false` - */ - getters?: 'get' | 'set' | boolean | undefined; - showHidden?: boolean | undefined; - /** - * @default 2 - */ - depth?: number | null | undefined; - colors?: boolean | undefined; - customInspect?: boolean | undefined; - showProxy?: boolean | undefined; - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - breakLength?: number | undefined; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default `true` - */ - compact?: boolean | number | undefined; - sorted?: boolean | ((a: string, b: string) => number) | undefined; - } - export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module'; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string; - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`\-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * const util = require('util'); - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * - * @since v16.8.0 - */ - export function toUSVString(string: string): string; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * const { inspect } = require('util'); - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * const util = require('util'); - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * const util = require('util'); - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]) - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same[`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * const { inspect } = require('util'); - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * const { inspect } = require('util'); - * const assert = require('assert'); - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]) - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1] - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }) - * ); - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`. - * - * ```js - * const util = require('util'); - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from`superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * const util = require('util'); - * const EventEmitter = require('events'); - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * const EventEmitter = require('events'); - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @deprecated Legacy: Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * const util = require('util'); - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * const util = require('util'); - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * const util = require('util'); - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * const util = require('util'); - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * const util = require('util'); - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value. - * - * ```js - * const util = require('util'); - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named`reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && err.hasOwnProperty('reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param original An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = CustomPromisifySymbol | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * const util = require('util'); - * const fs = require('fs'); - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * const util = require('util'); - * const fs = require('fs'); - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * const util = require('util'); - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - const custom: unique symbol; - } - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder('shift_jis'); - * let string = ''; - * let buffer; - * while (buffer = getNextChunkSomehow()) { - * string += decoder.decode(buffer, { stream: true }); - * } - * string += decoder.decode(); // end-of-stream - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - } - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - } - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): Uint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } -} -declare module 'util/types' { - export * from 'util/types'; -} -declare module 'util/types' { - import { KeyObject, webcrypto } from 'node:crypto'; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) - * or[`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)views, such as typed array - * objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent - * to[`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native = require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap(object: T | {}): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value is an instance of a built-in `Error` type. - * - * ```js - * util.types.isNativeError(new Error()); // Returns true - * util.types.isNativeError(new TypeError()); // Returns true - * util.types.isNativeError(new RangeError()); // Returns true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet(object: T | {}): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module 'node:util' { - export * from 'util'; -} -declare module 'node:util/types' { - export * from 'util/types'; -} diff --git a/node_modules/@types/node/v8.d.ts b/node_modules/@types/node/v8.d.ts deleted file mode 100755 index 35e233d..0000000 --- a/node_modules/@types/node/v8.d.ts +++ /dev/null @@ -1,378 +0,0 @@ -/** - * The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/)built into the Node.js binary. It can be accessed using: - * - * ```js - * const v8 = require('v8'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/v8.js) - */ -declare module 'v8' { - import { Readable } from 'node:stream'; - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * Returns statistics about the V8 heap spaces, i.e. the segments which make up - * the V8 heap. Neither the ordering of heap spaces, nor the availability of a - * heap space can be guaranteed as the statistics are provided via the - * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running`node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * const v8 = require('v8'); - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - function setFlagsFromString(flags: string): void; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine. Therefore, the schema may change from one version of V8 to the next. - * - * ```js - * // Print heap snapshot to the console - * const v8 = require('v8'); - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable Stream containing the V8 heap snapshot - */ - function getHeapSnapshot(): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file is intended to be used with tools such as Chrome - * DevTools. The JSON schema is undocumented and specific to the V8 - * engine, and may change from one version of V8 to the next. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * ```js - * const { writeHeapSnapshot } = require('v8'); - * const { - * Worker, - * isMainThread, - * parentPort - * } = require('worker_threads'); - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a - * worker thread. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string): string; - /** - * Returns an object with the following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794 - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): Buffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer’s internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before`.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer’s internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * @since v8.0.0 - */ - function serialize(value: any): Buffer; - /** - * Uses a `DefaultDeserializer` with default options to read a JS value - * from a buffer. - * @since v8.0.0 - * @param buffer A buffer returned by {@link serialize}. - */ - function deserialize(buffer: NodeJS.TypedArray): any; - /** - * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple - * times during the lifetime of the process. Each time the execution counter will - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v12.22.0 - */ - function stopCoverage(): void; -} -declare module 'node:v8' { - export * from 'v8'; -} diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts deleted file mode 100755 index 48d1fc8..0000000 --- a/node_modules/@types/node/vm.d.ts +++ /dev/null @@ -1,508 +0,0 @@ -/** - * The `vm` module enables compiling and running code within V8 Virtual - * Machine contexts. **The `vm` module is not a security mechanism. Do** - * **not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * const vm = require('vm'); - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/vm.js) - */ -declare module 'vm' { - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * Default: `''`. - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * Default: `0`. - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - interface ScriptOptions extends BaseOptions { - displayErrors?: boolean | undefined; - timeout?: number | undefined; - cachedData?: Buffer | undefined; - /** @deprecated in favor of `script.createCachedData()` */ - produceCachedData?: boolean | undefined; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * Default: `true`. - */ - displayErrors?: boolean | undefined; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number | undefined; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * Default: `false`. - */ - breakOnSigint?: boolean | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: 'afterEvaluate' | undefined; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer | undefined; - /** - * Specifies whether to produce new cache data. - * Default: `false`, - */ - produceCachedData?: boolean | undefined; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context | undefined; - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[] | undefined; - } - interface CreateContextOptions { - /** - * Human-readable name of the newly created context. - * @default 'VM Context i' Where i is an ascending numerical index of the created context. - */ - name?: string | undefined; - /** - * Corresponds to the newly created context for display purposes. - * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), - * like the value of the `url.origin` property of a URL object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - * @default '' - */ - origin?: string | undefined; - codeGeneration?: - | { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean | undefined; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean | undefined; - } - | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: 'afterEvaluate' | undefined; - } - type MeasureMemoryMode = 'summary' | 'detailed'; - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode | undefined; - context?: Context | undefined; - } - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - /** - * Instances of the `vm.Script` class contain precompiled scripts that can be - * executed in specific contexts. - * @since v0.3.1 - */ - class Script { - constructor(code: string, options?: ScriptOptions); - /** - * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access - * to local scope. - * - * The following example compiles code that increments a global variable, sets - * the value of another global variable, then execute the code multiple times. - * The globals are contained in the `context` object. - * - * ```js - * const vm = require('vm'); - * - * const context = { - * animal: 'cat', - * count: 2 - * }; - * - * const script = new vm.Script('count += 1; name = "kitty";'); - * - * vm.createContext(context); - * for (let i = 0; i < 10; ++i) { - * script.runInContext(context); - * } - * - * console.log(context); - * // Prints: { animal: 'cat', count: 12, name: 'kitty' } - * ``` - * - * Using the `timeout` or `breakOnSigint` options will result in new event loops - * and corresponding threads being started, which have a non-zero performance - * overhead. - * @since v0.3.1 - * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. - * @return the result of the very last statement executed in the script. - */ - runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; - /** - * First contextifies the given `contextObject`, runs the compiled code contained - * by the `vm.Script` object within the created context, and returns the result. - * Running code does not have access to local scope. - * - * The following example compiles code that sets a global variable, then executes - * the code multiple times in different contexts. The globals are set on and - * contained within each individual `context`. - * - * ```js - * const vm = require('vm'); - * - * const script = new vm.Script('globalVar = "set"'); - * - * const contexts = [{}, {}, {}]; - * contexts.forEach((context) => { - * script.runInNewContext(context); - * }); - * - * console.log(contexts); - * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] - * ``` - * @since v0.3.1 - * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. - * @return the result of the very last statement executed in the script. - */ - runInNewContext(contextObject?: Context, options?: RunningScriptOptions): any; - /** - * Runs the compiled code contained by the `vm.Script` within the context of the - * current `global` object. Running code does not have access to local scope, but_does_ have access to the current `global` object. - * - * The following example compiles code that increments a `global` variable then - * executes that code multiple times: - * - * ```js - * const vm = require('vm'); - * - * global.globalVar = 0; - * - * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - * - * for (let i = 0; i < 1000; ++i) { - * script.runInThisContext(); - * } - * - * console.log(globalVar); - * - * // 1000 - * ``` - * @since v0.3.1 - * @return the result of the very last statement executed in the script. - */ - runInThisContext(options?: RunningScriptOptions): any; - /** - * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any - * time and any number of times. - * - * ```js - * const script = new vm.Script(` - * function add(a, b) { - * return a + b; - * } - * - * const x = add(1, 2); - * `); - * - * const cacheWithoutX = script.createCachedData(); - * - * script.runInThisContext(); - * - * const cacheWithX = script.createCachedData(); - * ``` - * @since v10.6.0 - */ - createCachedData(): Buffer; - - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; - cachedDataRejected?: boolean | undefined; - cachedData?: Buffer | undefined; - } - /** - * If given a `contextObject`, the `vm.createContext()` method will `prepare - * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts, - * the `contextObject` will be the global object, retaining all of its existing - * properties but also having the built-in objects and functions any standard[global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables - * will remain unchanged. - * - * ```js - * const vm = require('vm'); - * - * global.globalVar = 3; - * - * const context = { globalVar: 1 }; - * vm.createContext(context); - * - * vm.runInContext('globalVar *= 2;', context); - * - * console.log(context); - * // Prints: { globalVar: 2 } - * - * console.log(global.globalVar); - * // Prints: 3 - * ``` - * - * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, - * empty `contextified` object will be returned. - * - * The `vm.createContext()` method is primarily useful for creating a single - * context that can be used to run multiple scripts. For instance, if emulating a - * web browser, the method can be used to create a single context representing a - * window's global object, then run all `` -``` - -On the client, you can rehydrate the cache using the initial data passed from the server: - -```js -cache: new Cache().restore(window.__APOLLO_STATE__) -``` - -If you would like to learn more about server side rendering, please check our our more in depth guide [here]. - - -

Updating the cache after a mutation

- -Being able to read and write to the Apollo cache from anywhere in your application gives you a lot of power over your data. However, there is one place where we most often want to update our cached data: after a mutation. As such, Apollo Client has optimized the experience for updating your cache with the read and write methods after a mutation with the `update` function. Let us say that we have the following GraphQL mutation: - -```graphql -mutation TodoCreateMutation($text: String!) { - createTodo(text: $text) { - id - text - completed - } -} -``` - -We may also have the following GraphQL query: - -```graphql -query TodoAppQuery { - todos { - id - text - completed - } -} -``` - -At the end of our mutation we want our query to include the new todo like we had sent our `TodoAppQuery` a second time after the mutation finished without actually sending the query. To do this we can use the `update` function provided as an option of the `client.mutate` method. To update your cache with the mutation just write code that looks like: - -```js -// We assume that the GraphQL operations `TodoCreateMutation` and -// `TodoAppQuery` have already been defined using the `gql` tag. - -const text = 'Hello, world!'; - -client.mutate({ - mutation: TodoCreateMutation, - variables: { - text, - }, - update: (proxy, { data: { createTodo } }) => { - // Read the data from our cache for this query. - const data = proxy.readQuery({ query: TodoAppQuery }); - - // Add our todo from the mutation to the end. - data.todos.push(createTodo); - - // Write our data back to the cache. - proxy.writeQuery({ query: TodoAppQuery, data }); - }, -}); -``` - -The first `proxy` argument is an instance of [`DataProxy`][] has the same four methods that we just learned exist on the Apollo Client: `readQuery`, `readFragment`, `writeQuery`, and `writeFragment`. The reason we call them on a `proxy` object here instead of on our `client` instance is that we can easily apply optimistic updates (which we will demonstrate in a bit). The `proxy` object also provides an isolated transaction which shields you from any other mutations going on at the same time, and the `proxy` object also batches writes together until the very end. - -If you provide an `optimisticResponse` option to the mutation then the `update` function will be run twice. Once immediately after you call `client.mutate` with the data from `optimisticResponse`. After the mutation successfully executes against the server the changes made in the first call to `update` will be rolled back and `update` will be called with the *actual* data returned by the mutation and not just the optimistic response. - -Putting it all together: - -```js -const text = 'Hello, world!'; - -client.mutate({ - mutation: TodoCreateMutation, - variables: { - text, - }, - optimisticResponse: { - id: -1, // -1 is a temporary id for the optimistic response. - text, - completed: false, - }, - update: (proxy, { data: { createTodo } }) => { - const data = proxy.readQuery({ query: TodoAppQuery }); - data.todos.push(createTodo); - proxy.writeQuery({ query: TodoAppQuery, data }); - }, -}); -``` - -As you can see the `update` function on `client.mutate` provides extra change management functionality specific to the use case of a mutation while still providing you the powerful data control APIs that are available on `client`. - -The `update` function is not a good place for side-effects as it may be called multiple times. Also, you may not call any of the methods on `proxy` asynchronously. - diff --git a/node_modules/apollo-cache-inmemory/jest.config.js b/node_modules/apollo-cache-inmemory/jest.config.js deleted file mode 100644 index 48f0a89..0000000 --- a/node_modules/apollo-cache-inmemory/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../config/jest.config.settings'), -}; diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts deleted file mode 100644 index a914d2b..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map deleted file mode 100644 index 5e7ef9a..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/__tests__/cache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js deleted file mode 100644 index fa91d39..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js +++ /dev/null @@ -1,627 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var graphql_tag_1 = tslib_1.__importStar(require("graphql-tag")); -var apollo_utilities_1 = require("apollo-utilities"); -var lodash_1 = require("lodash"); -var __1 = require(".."); -graphql_tag_1.disableFragmentWarnings(); -describe('Cache', function () { - function itWithInitialData(message, initialDataForCaches, callback) { - var cachesList = [ - initialDataForCaches.map(function (data) { - return new __1.InMemoryCache({ - addTypename: false, - }).restore(lodash_1.cloneDeep(data)); - }), - initialDataForCaches.map(function (data) { - return new __1.InMemoryCache({ - addTypename: false, - resultCaching: false, - }).restore(lodash_1.cloneDeep(data)); - }), - initialDataForCaches.map(function (data) { - return new __1.InMemoryCache({ - addTypename: false, - freezeResults: true, - }).restore(lodash_1.cloneDeep(data)); - }), - ]; - cachesList.forEach(function (caches, i) { - it(message + (" (" + (i + 1) + "/" + cachesList.length + ")"), function () { - return callback.apply(void 0, caches); - }); - }); - } - function itWithCacheConfig(message, config, callback) { - var caches = [ - new __1.InMemoryCache(tslib_1.__assign(tslib_1.__assign({ addTypename: false }, config), { resultCaching: true })), - new __1.InMemoryCache(tslib_1.__assign(tslib_1.__assign({ addTypename: false }, config), { resultCaching: false })), - new __1.InMemoryCache(tslib_1.__assign(tslib_1.__assign({ addTypename: false }, config), { freezeResults: true })), - ]; - caches.forEach(function (cache, i) { - it(message + (" (" + (i + 1) + "/" + caches.length + ")"), function () { return callback(cache); }); - }); - } - describe('readQuery', function () { - itWithInitialData('will read some data from the store', [ - { - ROOT_QUERY: { - a: 1, - b: 2, - c: 3, - }, - }, - ], function (proxy) { - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))), - }))).toEqual({ a: 1 }); - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n b\n c\n }\n "], ["\n {\n b\n c\n }\n "]))), - }))).toEqual({ b: 2, c: 3 }); - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), - }))).toEqual({ a: 1, b: 2, c: 3 }); - }); - itWithInitialData('will read some deeply nested data from the store', [ - { - ROOT_QUERY: { - a: 1, - b: 2, - c: 3, - d: { - type: 'id', - id: 'foo', - generated: false, - }, - }, - foo: { - e: 4, - f: 5, - g: 6, - h: { - type: 'id', - id: 'bar', - generated: false, - }, - }, - bar: { - i: 7, - j: 8, - k: 9, - }, - }, - ], function (proxy) { - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n e\n }\n }\n "], ["\n {\n a\n d {\n e\n }\n }\n "]))), - }))).toEqual({ a: 1, d: { e: 4 } }); - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n e\n h {\n i\n }\n }\n }\n "], ["\n {\n a\n d {\n e\n h {\n i\n }\n }\n }\n "]))), - }))).toEqual({ a: 1, d: { e: 4, h: { i: 7 } } }); - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "], ["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "]))), - }))).toEqual({ - a: 1, - b: 2, - c: 3, - d: { e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }, - }); - }); - itWithInitialData('will read some data from the store with variables', [ - { - ROOT_QUERY: { - 'field({"literal":true,"value":42})': 1, - 'field({"literal":false,"value":42})': 2, - }, - }, - ], function (proxy) { - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), - variables: { - literal: false, - value: 42, - }, - }))).toEqual({ a: 1, b: 2 }); - }); - itWithInitialData('will read some data from the store with null variables', [ - { - ROOT_QUERY: { - 'field({"literal":false,"value":null})': 1, - }, - }, - ], function (proxy) { - expect(apollo_utilities_1.stripSymbols(proxy.readQuery({ - query: graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: $literal, value: $value)\n }\n "]))), - variables: { - literal: false, - value: null, - }, - }))).toEqual({ a: 1 }); - }); - itWithInitialData('should not mutate arguments passed in', [ - { - ROOT_QUERY: { - 'field({"literal":true,"value":42})': 1, - 'field({"literal":false,"value":42})': 2, - }, - }, - ], function (proxy) { - var options = { - query: graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), - variables: { - literal: false, - value: 42, - }, - }; - var preQueryCopy = lodash_1.cloneDeep(options); - expect(apollo_utilities_1.stripSymbols(proxy.readQuery(options))).toEqual({ a: 1, b: 2 }); - expect(preQueryCopy).toEqual(options); - }); - }); - describe('readFragment', function () { - itWithInitialData('will throw an error when there is no fragment', [ - {}, - ], function (proxy) { - expect(function () { - proxy.readFragment({ - id: 'x', - fragment: graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n query {\n a\n b\n c\n }\n "], ["\n query {\n a\n b\n c\n }\n "]))), - }); - }).toThrowError('Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.'); - expect(function () { - proxy.readFragment({ - id: 'x', - fragment: graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n schema {\n query: Query\n }\n "], ["\n schema {\n query: Query\n }\n "]))), - }); - }).toThrowError('Found 0 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); - }); - itWithInitialData('will throw an error when there is more than one fragment but no fragment name', [{}], function (proxy) { - expect(function () { - proxy.readFragment({ - id: 'x', - fragment: graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "]))), - }); - }).toThrowError('Found 2 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); - expect(function () { - proxy.readFragment({ - id: 'x', - fragment: graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "]))), - }); - }).toThrowError('Found 3 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); - }); - itWithInitialData('will read some deeply nested data from the store at any id', [ - { - ROOT_QUERY: { - __typename: 'Type1', - a: 1, - b: 2, - c: 3, - d: { - type: 'id', - id: 'foo', - generated: false, - }, - }, - foo: { - __typename: 'Foo', - e: 4, - f: 5, - g: 6, - h: { - type: 'id', - id: 'bar', - generated: false, - }, - }, - bar: { - __typename: 'Bar', - i: 7, - j: 8, - k: 9, - }, - }, - ], function (proxy) { - expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ - id: 'foo', - fragment: graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "]))), - }))).toEqual({ e: 4, h: { i: 7 } }); - expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ - id: 'foo', - fragment: graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n "]))), - }))).toEqual({ e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }); - expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ - id: 'bar', - fragment: graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n i\n }\n "], ["\n fragment fragmentBar on Bar {\n i\n }\n "]))), - }))).toEqual({ i: 7 }); - expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ - id: 'bar', - fragment: graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "], ["\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "]))), - }))).toEqual({ i: 7, j: 8, k: 9 }); - expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ - id: 'foo', - fragment: graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "]))), - fragmentName: 'fragmentFoo', - }))).toEqual({ e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }); - expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ - id: 'bar', - fragment: graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment fragmentBar on Bar {\n i\n j\n k\n }\n "]))), - fragmentName: 'fragmentBar', - }))).toEqual({ i: 7, j: 8, k: 9 }); - }); - itWithInitialData('will read some data from the store with variables', [ - { - foo: { - __typename: 'Foo', - 'field({"literal":true,"value":42})': 1, - 'field({"literal":false,"value":42})': 2, - }, - }, - ], function (proxy) { - expect(apollo_utilities_1.stripSymbols(proxy.readFragment({ - id: 'foo', - fragment: graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), - variables: { - literal: false, - value: 42, - }, - }))).toEqual({ a: 1, b: 2 }); - }); - itWithInitialData('will return null when an id that can’t be found is provided', [ - {}, - { - bar: { __typename: 'Bar', a: 1, b: 2, c: 3 }, - }, - { - foo: { __typename: 'Foo', a: 1, b: 2, c: 3 }, - }, - ], function (client1, client2, client3) { - expect(apollo_utilities_1.stripSymbols(client1.readFragment({ - id: 'foo', - fragment: graphql_tag_1.default(templateObject_21 || (templateObject_21 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "], ["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "]))), - }))).toEqual(null); - expect(apollo_utilities_1.stripSymbols(client2.readFragment({ - id: 'foo', - fragment: graphql_tag_1.default(templateObject_22 || (templateObject_22 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "], ["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "]))), - }))).toEqual(null); - expect(apollo_utilities_1.stripSymbols(client3.readFragment({ - id: 'foo', - fragment: graphql_tag_1.default(templateObject_23 || (templateObject_23 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "], ["\n fragment fooFragment on Foo {\n a\n b\n c\n }\n "]))), - }))).toEqual({ a: 1, b: 2, c: 3 }); - }); - }); - describe('writeQuery', function () { - itWithInitialData('will write some data to the store', [{}], function (proxy) { - proxy.writeQuery({ - data: { a: 1 }, - query: graphql_tag_1.default(templateObject_24 || (templateObject_24 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))), - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - a: 1, - }, - }); - proxy.writeQuery({ - data: { b: 2, c: 3 }, - query: graphql_tag_1.default(templateObject_25 || (templateObject_25 = tslib_1.__makeTemplateObject(["\n {\n b\n c\n }\n "], ["\n {\n b\n c\n }\n "]))), - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - a: 1, - b: 2, - c: 3, - }, - }); - proxy.writeQuery({ - data: { a: 4, b: 5, c: 6 }, - query: graphql_tag_1.default(templateObject_26 || (templateObject_26 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - a: 4, - b: 5, - c: 6, - }, - }); - }); - itWithInitialData('will write some deeply nested data to the store', [{}], function (proxy) { - proxy.writeQuery({ - data: { a: 1, d: { e: 4 } }, - query: graphql_tag_1.default(templateObject_27 || (templateObject_27 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n e\n }\n }\n "], ["\n {\n a\n d {\n e\n }\n }\n "]))), - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - a: 1, - d: { - type: 'id', - id: '$ROOT_QUERY.d', - generated: true, - }, - }, - '$ROOT_QUERY.d': { - e: 4, - }, - }); - proxy.writeQuery({ - data: { a: 1, d: { h: { i: 7 } } }, - query: graphql_tag_1.default(templateObject_28 || (templateObject_28 = tslib_1.__makeTemplateObject(["\n {\n a\n d {\n h {\n i\n }\n }\n }\n "], ["\n {\n a\n d {\n h {\n i\n }\n }\n }\n "]))), - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - a: 1, - d: { - type: 'id', - id: '$ROOT_QUERY.d', - generated: true, - }, - }, - '$ROOT_QUERY.d': { - e: 4, - h: { - type: 'id', - id: '$ROOT_QUERY.d.h', - generated: true, - }, - }, - '$ROOT_QUERY.d.h': { - i: 7, - }, - }); - proxy.writeQuery({ - data: { - a: 1, - b: 2, - c: 3, - d: { e: 4, f: 5, g: 6, h: { i: 7, j: 8, k: 9 } }, - }, - query: graphql_tag_1.default(templateObject_29 || (templateObject_29 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "], ["\n {\n a\n b\n c\n d {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n }\n "]))), - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - a: 1, - b: 2, - c: 3, - d: { - type: 'id', - id: '$ROOT_QUERY.d', - generated: true, - }, - }, - '$ROOT_QUERY.d': { - e: 4, - f: 5, - g: 6, - h: { - type: 'id', - id: '$ROOT_QUERY.d.h', - generated: true, - }, - }, - '$ROOT_QUERY.d.h': { - i: 7, - j: 8, - k: 9, - }, - }); - }); - itWithInitialData('will write some data to the store with variables', [{}], function (proxy) { - proxy.writeQuery({ - data: { - a: 1, - b: 2, - }, - query: graphql_tag_1.default(templateObject_30 || (templateObject_30 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), - variables: { - literal: false, - value: 42, - }, - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - 'field({"literal":true,"value":42})': 1, - 'field({"literal":false,"value":42})': 2, - }, - }); - }); - itWithInitialData('will write some data to the store with variables where some are null', [{}], function (proxy) { - proxy.writeQuery({ - data: { - a: 1, - b: 2, - }, - query: graphql_tag_1.default(templateObject_31 || (templateObject_31 = tslib_1.__makeTemplateObject(["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n query($literal: Boolean, $value: Int) {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), - variables: { - literal: false, - value: null, - }, - }); - expect(proxy.extract()).toEqual({ - ROOT_QUERY: { - 'field({"literal":true,"value":42})': 1, - 'field({"literal":false,"value":null})': 2, - }, - }); - }); - }); - describe('writeFragment', function () { - itWithInitialData('will throw an error when there is no fragment', [{}], function (proxy) { - expect(function () { - proxy.writeFragment({ - data: {}, - id: 'x', - fragment: graphql_tag_1.default(templateObject_32 || (templateObject_32 = tslib_1.__makeTemplateObject(["\n query {\n a\n b\n c\n }\n "], ["\n query {\n a\n b\n c\n }\n "]))), - }); - }).toThrowError('Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.'); - expect(function () { - proxy.writeFragment({ - data: {}, - id: 'x', - fragment: graphql_tag_1.default(templateObject_33 || (templateObject_33 = tslib_1.__makeTemplateObject(["\n schema {\n query: Query\n }\n "], ["\n schema {\n query: Query\n }\n "]))), - }); - }).toThrowError('Found 0 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); - }); - itWithInitialData('will throw an error when there is more than one fragment but no fragment name', [{}], function (proxy) { - expect(function () { - proxy.writeFragment({ - data: {}, - id: 'x', - fragment: graphql_tag_1.default(templateObject_34 || (templateObject_34 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n "]))), - }); - }).toThrowError('Found 2 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); - expect(function () { - proxy.writeFragment({ - data: {}, - id: 'x', - fragment: graphql_tag_1.default(templateObject_35 || (templateObject_35 = tslib_1.__makeTemplateObject(["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "], ["\n fragment a on A {\n a\n }\n\n fragment b on B {\n b\n }\n\n fragment c on C {\n c\n }\n "]))), - }); - }).toThrowError('Found 3 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.'); - }); - itWithCacheConfig('will write some deeply nested data into the store at any id', { - dataIdFromObject: function (o) { return o.id; }, - addTypename: false, - }, function (proxy) { - proxy.writeFragment({ - data: { __typename: 'Foo', e: 4, h: { id: 'bar', i: 7 } }, - id: 'foo', - fragment: graphql_tag_1.default(templateObject_36 || (templateObject_36 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n e\n h {\n i\n }\n }\n "]))), - }); - expect(proxy.extract()).toMatchSnapshot(); - proxy.writeFragment({ - data: { __typename: 'Foo', f: 5, g: 6, h: { id: 'bar', j: 8, k: 9 } }, - id: 'foo', - fragment: graphql_tag_1.default(templateObject_37 || (templateObject_37 = tslib_1.__makeTemplateObject(["\n fragment fragmentFoo on Foo {\n f\n g\n h {\n j\n k\n }\n }\n "], ["\n fragment fragmentFoo on Foo {\n f\n g\n h {\n j\n k\n }\n }\n "]))), - }); - expect(proxy.extract()).toMatchSnapshot(); - proxy.writeFragment({ - data: { i: 10, __typename: 'Bar' }, - id: 'bar', - fragment: graphql_tag_1.default(templateObject_38 || (templateObject_38 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n i\n }\n "], ["\n fragment fragmentBar on Bar {\n i\n }\n "]))), - }); - expect(proxy.extract()).toMatchSnapshot(); - proxy.writeFragment({ - data: { j: 11, k: 12, __typename: 'Bar' }, - id: 'bar', - fragment: graphql_tag_1.default(templateObject_39 || (templateObject_39 = tslib_1.__makeTemplateObject(["\n fragment fragmentBar on Bar {\n j\n k\n }\n "], ["\n fragment fragmentBar on Bar {\n j\n k\n }\n "]))), - }); - expect(proxy.extract()).toMatchSnapshot(); - proxy.writeFragment({ - data: { - __typename: 'Foo', - e: 4, - f: 5, - g: 6, - h: { __typename: 'Bar', id: 'bar', i: 7, j: 8, k: 9 }, - }, - id: 'foo', - fragment: graphql_tag_1.default(templateObject_40 || (templateObject_40 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "], ["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "]))), - fragmentName: 'fooFragment', - }); - expect(proxy.extract()).toMatchSnapshot(); - proxy.writeFragment({ - data: { __typename: 'Bar', i: 10, j: 11, k: 12 }, - id: 'bar', - fragment: graphql_tag_1.default(templateObject_41 || (templateObject_41 = tslib_1.__makeTemplateObject(["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "], ["\n fragment fooFragment on Foo {\n e\n f\n g\n h {\n i\n j\n k\n }\n }\n\n fragment barFragment on Bar {\n i\n j\n k\n }\n "]))), - fragmentName: 'barFragment', - }); - expect(proxy.extract()).toMatchSnapshot(); - }); - itWithCacheConfig('writes data that can be read back', { - addTypename: true, - }, function (proxy) { - var readWriteFragment = graphql_tag_1.default(templateObject_42 || (templateObject_42 = tslib_1.__makeTemplateObject(["\n fragment aFragment on query {\n getSomething {\n id\n }\n }\n "], ["\n fragment aFragment on query {\n getSomething {\n id\n }\n }\n "]))); - var data = { - __typename: 'query', - getSomething: { id: '123', __typename: 'Something' }, - }; - proxy.writeFragment({ - data: data, - id: 'query', - fragment: readWriteFragment, - }); - var result = proxy.readFragment({ - fragment: readWriteFragment, - id: 'query', - }); - expect(apollo_utilities_1.stripSymbols(result)).toEqual(data); - }); - itWithCacheConfig('will write some data to the store with variables', { - addTypename: true, - }, function (proxy) { - proxy.writeFragment({ - data: { - a: 1, - b: 2, - __typename: 'Foo', - }, - id: 'foo', - fragment: graphql_tag_1.default(templateObject_43 || (templateObject_43 = tslib_1.__makeTemplateObject(["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "], ["\n fragment foo on Foo {\n a: field(literal: true, value: 42)\n b: field(literal: $literal, value: $value)\n }\n "]))), - variables: { - literal: false, - value: 42, - }, - }); - expect(proxy.extract()).toEqual({ - foo: { - __typename: 'Foo', - 'field({"literal":true,"value":42})': 1, - 'field({"literal":false,"value":42})': 2, - }, - }); - }); - }); - describe('performTransaction', function () { - itWithInitialData('will not broadcast mid-transaction', [{}], function (cache) { - var numBroadcasts = 0; - var query = graphql_tag_1.default(templateObject_44 || (templateObject_44 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))); - cache.watch({ - query: query, - optimistic: false, - callback: function () { - numBroadcasts++; - }, - }); - expect(numBroadcasts).toEqual(0); - cache.performTransaction(function (proxy) { - proxy.writeQuery({ - data: { a: 1 }, - query: query, - }); - expect(numBroadcasts).toEqual(0); - proxy.writeQuery({ - data: { a: 4, b: 5, c: 6 }, - query: graphql_tag_1.default(templateObject_45 || (templateObject_45 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), - }); - expect(numBroadcasts).toEqual(0); - }); - expect(numBroadcasts).toEqual(1); - }); - }); - describe('performOptimisticTransaction', function () { - itWithInitialData('will only broadcast once', [{}], function (cache) { - var numBroadcasts = 0; - var query = graphql_tag_1.default(templateObject_46 || (templateObject_46 = tslib_1.__makeTemplateObject(["\n {\n a\n }\n "], ["\n {\n a\n }\n "]))); - cache.watch({ - query: query, - optimistic: true, - callback: function () { - numBroadcasts++; - }, - }); - expect(numBroadcasts).toEqual(0); - cache.recordOptimisticTransaction(function (proxy) { - proxy.writeQuery({ - data: { a: 1 }, - query: query, - }); - expect(numBroadcasts).toEqual(0); - proxy.writeQuery({ - data: { a: 4, b: 5, c: 6 }, - query: graphql_tag_1.default(templateObject_47 || (templateObject_47 = tslib_1.__makeTemplateObject(["\n {\n a\n b\n c\n }\n "], ["\n {\n a\n b\n c\n }\n "]))), - }); - expect(numBroadcasts).toEqual(0); - }, 1); - expect(numBroadcasts).toEqual(1); - }); - }); -}); -var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47; -//# sourceMappingURL=cache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map deleted file mode 100644 index 47c72f3..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/__tests__/cache.ts"],"names":[],"mappings":";;;AAAA,iEAA2D;AAC3D,qDAAgD;AAChD,iCAAmC;AAEnC,wBAAwD;AAExD,qCAAuB,EAAE,CAAC;AAE1B,QAAQ,CAAC,OAAO,EAAE;IAChB,SAAS,iBAAiB,CACxB,OAAe,EACf,oBAAgD,EAChD,QAA6C;QAE7C,IAAM,UAAU,GAAsB;YACpC,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI;gBAC3B,OAAA,IAAI,iBAAa,CAAC;oBAChB,WAAW,EAAE,KAAK;iBACnB,CAAC,CAAC,OAAO,CAAC,kBAAS,CAAC,IAAI,CAAC,CAAC;YAF3B,CAE2B,CAC5B;YACD,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI;gBAC3B,OAAA,IAAI,iBAAa,CAAC;oBAChB,WAAW,EAAE,KAAK;oBAClB,aAAa,EAAE,KAAK;iBACrB,CAAC,CAAC,OAAO,CAAC,kBAAS,CAAC,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ts b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts deleted file mode 100644 index f81c72a..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function withError(func: Function, regex: RegExp): any; -//# sourceMappingURL=diffAgainstStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map deleted file mode 100644 index bf5c66b..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"diffAgainstStore.d.ts","sourceRoot":"","sources":["../src/__tests__/diffAgainstStore.ts"],"names":[],"mappings":"AAaA,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OActD"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js deleted file mode 100644 index 9db2e35..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js +++ /dev/null @@ -1,678 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var graphql_tag_1 = tslib_1.__importStar(require("graphql-tag")); -var apollo_utilities_1 = require("apollo-utilities"); -var objectCache_1 = require("../objectCache"); -var readFromStore_1 = require("../readFromStore"); -var writeToStore_1 = require("../writeToStore"); -var fragmentMatcher_1 = require("../fragmentMatcher"); -var inMemoryCache_1 = require("../inMemoryCache"); -var fragmentMatcherFunction = new fragmentMatcher_1.HeuristicFragmentMatcher().match; -graphql_tag_1.disableFragmentWarnings(); -function withError(func, regex) { - var message = null; - var error = console.error; - console.error = function (m) { - message = m; - }; - try { - var result = func(); - expect(message).toMatch(regex); - return result; - } - finally { - console.error = error; - } -} -exports.withError = withError; -describe('diffing queries against the store', function () { - var reader = new readFromStore_1.StoreReader(); - var writer = new writeToStore_1.StoreWriter(); - it('expects named fragments to return complete as true when diffd against ' + - 'the store', function () { - var store = objectCache_1.defaultNormalizedCacheFactory({}); - var queryResult = reader.diffQueryAgainstStore({ - store: store, - query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n query foo {\n ...root\n }\n\n fragment root on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n "], ["\n query foo {\n ...root\n }\n\n fragment root on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n "]))), - fragmentMatcherFunction: fragmentMatcherFunction, - config: { - dataIdFromObject: inMemoryCache_1.defaultDataIdFromObject, - }, - }); - expect(queryResult.complete).toEqual(false); - }); - it('expects inline fragments to return complete as true when diffd against ' + - 'the store', function () { - var store = objectCache_1.defaultNormalizedCacheFactory(); - var queryResult = reader.diffQueryAgainstStore({ - store: store, - query: graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "], ["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "]))), - fragmentMatcherFunction: fragmentMatcherFunction, - config: { - dataIdFromObject: inMemoryCache_1.defaultDataIdFromObject, - }, - }); - expect(queryResult.complete).toEqual(false); - }); - it('returns nothing when the store is enough', function () { - var query = graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "]))); - var result = { - people_one: { - name: 'Luke Skywalker', - }, - }; - var store = writer.writeQueryToStore({ - result: result, - query: query, - }); - expect(reader.diffQueryAgainstStore({ - store: store, - query: query, - }).complete).toBeTruthy(); - }); - it('caches root queries both under the ID of the node and the query name', function () { - var firstQuery = graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "]))); - var result = { - people_one: { - __typename: 'Person', - id: '1', - name: 'Luke Skywalker', - }, - }; - var getIdField = function (_a) { - var id = _a.id; - return id; - }; - var store = writer.writeQueryToStore({ - result: result, - query: firstQuery, - dataIdFromObject: getIdField, - }); - var secondQuery = graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "]))); - var complete = reader.diffQueryAgainstStore({ - store: store, - query: secondQuery, - }).complete; - expect(complete).toBeTruthy(); - expect(store.get('1')).toEqual(result.people_one); - }); - it('does not swallow errors other than field errors', function () { - var firstQuery = graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n query {\n person {\n powers\n }\n }\n "], ["\n query {\n person {\n powers\n }\n }\n "]))); - var firstResult = { - person: { - powers: 'the force', - }, - }; - var store = writer.writeQueryToStore({ - result: firstResult, - query: firstQuery, - }); - var unionQuery = graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n query {\n ...notARealFragment\n }\n "], ["\n query {\n ...notARealFragment\n }\n "]))); - return expect(function () { - reader.diffQueryAgainstStore({ - store: store, - query: unionQuery, - }); - }).toThrowError(/No fragment/); - }); - it('does not error on a correct query with union typed fragments', function () { - return withError(function () { - var firstQuery = graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "], ["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "]))); - var firstResult = { - person: { - __typename: 'Author', - firstName: 'John', - lastName: 'Smith', - }, - }; - var store = writer.writeQueryToStore({ - result: firstResult, - query: firstQuery, - }); - var unionQuery = graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n ... on Author {\n firstName\n lastName\n }\n ... on Jedi {\n powers\n }\n }\n }\n "], ["\n query {\n person {\n __typename\n ... on Author {\n firstName\n lastName\n }\n ... on Jedi {\n powers\n }\n }\n }\n "]))); - var complete = reader.diffQueryAgainstStore({ - store: store, - query: unionQuery, - returnPartialData: false, - fragmentMatcherFunction: fragmentMatcherFunction, - }).complete; - expect(complete).toBe(false); - }, /IntrospectionFragmentMatcher/); - }); - it('does not error on a query with fields missing from all but one named fragment', function () { - var firstQuery = graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "], ["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "]))); - var firstResult = { - person: { - __typename: 'Author', - firstName: 'John', - lastName: 'Smith', - }, - }; - var store = writer.writeQueryToStore({ - result: firstResult, - query: firstQuery, - }); - var unionQuery = graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n ...authorInfo\n ...jediInfo\n }\n }\n\n fragment authorInfo on Author {\n firstName\n }\n\n fragment jediInfo on Jedi {\n powers\n }\n "], ["\n query {\n person {\n __typename\n ...authorInfo\n ...jediInfo\n }\n }\n\n fragment authorInfo on Author {\n firstName\n }\n\n fragment jediInfo on Jedi {\n powers\n }\n "]))); - var complete = reader.diffQueryAgainstStore({ - store: store, - query: unionQuery, - }).complete; - expect(complete).toBe(false); - }); - it('throws an error on a query with fields missing from matching named fragments', function () { - var firstQuery = graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "], ["\n query {\n person {\n __typename\n firstName\n lastName\n }\n }\n "]))); - var firstResult = { - person: { - __typename: 'Author', - firstName: 'John', - lastName: 'Smith', - }, - }; - var store = writer.writeQueryToStore({ - result: firstResult, - query: firstQuery, - }); - var unionQuery = graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n query {\n person {\n __typename\n ...authorInfo2\n ...jediInfo2\n }\n }\n\n fragment authorInfo2 on Author {\n firstName\n address\n }\n\n fragment jediInfo2 on Jedi {\n jedi\n }\n "], ["\n query {\n person {\n __typename\n ...authorInfo2\n ...jediInfo2\n }\n }\n\n fragment authorInfo2 on Author {\n firstName\n address\n }\n\n fragment jediInfo2 on Jedi {\n jedi\n }\n "]))); - expect(function () { - reader.diffQueryAgainstStore({ - store: store, - query: unionQuery, - returnPartialData: false, - }); - }).toThrow(); - }); - it('returns available fields if returnPartialData is true', function () { - var firstQuery = graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n __typename\n id\n name\n }\n }\n "]))); - var firstResult = { - people_one: { - __typename: 'Person', - id: 'lukeId', - name: 'Luke Skywalker', - }, - }; - var store = writer.writeQueryToStore({ - result: firstResult, - query: firstQuery, - }); - var simpleQuery = graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n name\n age\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n name\n age\n }\n }\n "]))); - var inlineFragmentQuery = graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n ... on Person {\n name\n age\n }\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n ... on Person {\n name\n age\n }\n }\n }\n "]))); - var namedFragmentQuery = graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n query {\n people_one(id: \"1\") {\n ...personInfo\n }\n }\n\n fragment personInfo on Person {\n name\n age\n }\n "], ["\n query {\n people_one(id: \"1\") {\n ...personInfo\n }\n }\n\n fragment personInfo on Person {\n name\n age\n }\n "]))); - var simpleDiff = reader.diffQueryAgainstStore({ - store: store, - query: simpleQuery, - }); - expect(simpleDiff.result).toEqual({ - people_one: { - name: 'Luke Skywalker', - }, - }); - var inlineDiff = reader.diffQueryAgainstStore({ - store: store, - query: inlineFragmentQuery, - }); - expect(inlineDiff.result).toEqual({ - people_one: { - name: 'Luke Skywalker', - }, - }); - var namedDiff = reader.diffQueryAgainstStore({ - store: store, - query: namedFragmentQuery, - }); - expect(namedDiff.result).toEqual({ - people_one: { - name: 'Luke Skywalker', - }, - }); - expect(function () { - reader.diffQueryAgainstStore({ - store: store, - query: simpleQuery, - returnPartialData: false, - }); - }).toThrow(); - }); - it('will add a private id property', function () { - var query = graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "], ["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "]))); - var queryResult = { - a: [{ id: 'a:1', b: 1.1 }, { id: 'a:2', b: 1.2 }, { id: 'a:3', b: 1.3 }], - c: { - d: 2, - e: [ - { id: 'e:1', f: 3.1 }, - { id: 'e:2', f: 3.2 }, - { id: 'e:3', f: 3.3 }, - { id: 'e:4', f: 3.4 }, - { id: 'e:5', f: 3.5 }, - ], - g: { h: 4 }, - }, - }; - function dataIdFromObject(_a) { - var id = _a.id; - return id; - } - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - dataIdFromObject: dataIdFromObject, - }); - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - }).result; - expect(result).toEqual(queryResult); - expect(dataIdFromObject(result.a[0])).toBe('a:1'); - expect(dataIdFromObject(result.a[1])).toBe('a:2'); - expect(dataIdFromObject(result.a[2])).toBe('a:3'); - expect(dataIdFromObject(result.c.e[0])).toBe('e:1'); - expect(dataIdFromObject(result.c.e[1])).toBe('e:2'); - expect(dataIdFromObject(result.c.e[2])).toBe('e:3'); - expect(dataIdFromObject(result.c.e[3])).toBe('e:4'); - expect(dataIdFromObject(result.c.e[4])).toBe('e:5'); - }); - describe('referential equality preservation', function () { - it('will return the previous result if there are no changes', function () { - var query = graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); - var queryResult = { - a: { b: 1 }, - c: { d: 2, e: { f: 3 } }, - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - }); - var previousResult = { - a: { b: 1 }, - c: { d: 2, e: { f: 3 } }, - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result).toEqual(previousResult); - }); - it('will return parts of the previous result that changed', function () { - var query = graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); - var queryResult = { - a: { b: 1 }, - c: { d: 2, e: { f: 3 } }, - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - }); - var previousResult = { - a: { b: 1 }, - c: { d: 20, e: { f: 3 } }, - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result).not.toEqual(previousResult); - expect(result.a).toEqual(previousResult.a); - expect(result.c).not.toEqual(previousResult.c); - expect(result.c.e).toEqual(previousResult.c.e); - }); - it('will return the previous result if there are no changes in child arrays', function () { - var query = graphql_tag_1.default(templateObject_21 || (templateObject_21 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); - var queryResult = { - a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], - c: { - d: 2, - e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], - }, - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - }); - var previousResult = { - a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], - c: { - d: 2, - e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], - }, - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result).toEqual(previousResult); - }); - it('will not add zombie items when previousResult starts with the same items', function () { - var query = graphql_tag_1.default(templateObject_22 || (templateObject_22 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n }\n "], ["\n query {\n a {\n b\n }\n }\n "]))); - var queryResult = { - a: [{ b: 1.1 }, { b: 1.2 }], - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - }); - var previousResult = { - a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result.a[0]).toEqual(previousResult.a[0]); - expect(result.a[1]).toEqual(previousResult.a[1]); - }); - it('will return the previous result if there are no changes in nested child arrays', function () { - var query = graphql_tag_1.default(templateObject_23 || (templateObject_23 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); - var queryResult = { - a: [[[[[{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }]]]]], - c: { - d: 2, - e: [[{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }], [{ f: 3.4 }, { f: 3.5 }]], - }, - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - }); - var previousResult = { - a: [[[[[{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }]]]]], - c: { - d: 2, - e: [[{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }], [{ f: 3.4 }, { f: 3.5 }]], - }, - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result).toEqual(previousResult); - }); - it('will return parts of the previous result if there are changes in child arrays', function () { - var query = graphql_tag_1.default(templateObject_24 || (templateObject_24 = tslib_1.__makeTemplateObject(["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "], ["\n query {\n a {\n b\n }\n c {\n d\n e {\n f\n }\n }\n }\n "]))); - var queryResult = { - a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }], - c: { - d: 2, - e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], - }, - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - }); - var previousResult = { - a: [{ b: 1.1 }, { b: -1.2 }, { b: 1.3 }], - c: { - d: 20, - e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }], - }, - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result).not.toEqual(previousResult); - expect(result.a).not.toEqual(previousResult.a); - expect(result.a[0]).toEqual(previousResult.a[0]); - expect(result.a[1]).not.toEqual(previousResult.a[1]); - expect(result.a[2]).toEqual(previousResult.a[2]); - expect(result.c).not.toEqual(previousResult.c); - expect(result.c.e).toEqual(previousResult.c.e); - expect(result.c.e[0]).toEqual(previousResult.c.e[0]); - expect(result.c.e[1]).toEqual(previousResult.c.e[1]); - expect(result.c.e[2]).toEqual(previousResult.c.e[2]); - expect(result.c.e[3]).toEqual(previousResult.c.e[3]); - expect(result.c.e[4]).toEqual(previousResult.c.e[4]); - }); - it('will return the same items in a different order with `dataIdFromObject`', function () { - var query = graphql_tag_1.default(templateObject_25 || (templateObject_25 = tslib_1.__makeTemplateObject(["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "], ["\n query {\n a {\n id\n b\n }\n c {\n d\n e {\n id\n f\n }\n g {\n h\n }\n }\n }\n "]))); - var queryResult = { - a: [ - { id: 'a:1', b: 1.1 }, - { id: 'a:2', b: 1.2 }, - { id: 'a:3', b: 1.3 }, - ], - c: { - d: 2, - e: [ - { id: 'e:1', f: 3.1 }, - { id: 'e:2', f: 3.2 }, - { id: 'e:3', f: 3.3 }, - { id: 'e:4', f: 3.4 }, - { id: 'e:5', f: 3.5 }, - ], - g: { h: 4 }, - }, - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - dataIdFromObject: function (_a) { - var id = _a.id; - return id; - }, - }); - var previousResult = { - a: [ - { id: 'a:3', b: 1.3 }, - { id: 'a:2', b: 1.2 }, - { id: 'a:1', b: 1.1 }, - ], - c: { - d: 2, - e: [ - { id: 'e:4', f: 3.4 }, - { id: 'e:2', f: 3.2 }, - { id: 'e:5', f: 3.5 }, - { id: 'e:3', f: 3.3 }, - { id: 'e:1', f: 3.1 }, - ], - g: { h: 4 }, - }, - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result).not.toEqual(previousResult); - expect(result.a).not.toEqual(previousResult.a); - expect(result.a[0]).toEqual(previousResult.a[2]); - expect(result.a[1]).toEqual(previousResult.a[1]); - expect(result.a[2]).toEqual(previousResult.a[0]); - expect(result.c).not.toEqual(previousResult.c); - expect(result.c.e).not.toEqual(previousResult.c.e); - expect(result.c.e[0]).toEqual(previousResult.c.e[4]); - expect(result.c.e[1]).toEqual(previousResult.c.e[1]); - expect(result.c.e[2]).toEqual(previousResult.c.e[3]); - expect(result.c.e[3]).toEqual(previousResult.c.e[0]); - expect(result.c.e[4]).toEqual(previousResult.c.e[2]); - expect(result.c.g).toEqual(previousResult.c.g); - }); - it('will return the same JSON scalar field object', function () { - var query = graphql_tag_1.default(templateObject_26 || (templateObject_26 = tslib_1.__makeTemplateObject(["\n {\n a {\n b\n c\n }\n d {\n e\n f\n }\n }\n "], ["\n {\n a {\n b\n c\n }\n d {\n e\n f\n }\n }\n "]))); - var queryResult = { - a: { b: 1, c: { x: 2, y: 3, z: 4 } }, - d: { e: 5, f: { x: 6, y: 7, z: 8 } }, - }; - var store = writer.writeQueryToStore({ - query: query, - result: queryResult, - }); - var previousResult = { - a: { b: 1, c: { x: 2, y: 3, z: 4 } }, - d: { e: 50, f: { x: 6, y: 7, z: 8 } }, - }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: query, - previousResult: previousResult, - }).result; - expect(result).toEqual(queryResult); - expect(result).not.toEqual(previousResult); - expect(result.a).toEqual(previousResult.a); - expect(result.d).not.toEqual(previousResult.d); - expect(result.d.f).toEqual(previousResult.d.f); - }); - it('will preserve equality with custom resolvers', function () { - var listQuery = graphql_tag_1.default(templateObject_27 || (templateObject_27 = tslib_1.__makeTemplateObject(["\n {\n people {\n id\n name\n __typename\n }\n }\n "], ["\n {\n people {\n id\n name\n __typename\n }\n }\n "]))); - var listResult = { - people: [ - { - id: '4', - name: 'Luke Skywalker', - __typename: 'Person', - }, - ], - }; - var itemQuery = graphql_tag_1.default(templateObject_28 || (templateObject_28 = tslib_1.__makeTemplateObject(["\n {\n person(id: 4) {\n id\n name\n __typename\n }\n }\n "], ["\n {\n person(id: 4) {\n id\n name\n __typename\n }\n }\n "]))); - var dataIdFromObject = function (obj) { return obj.id; }; - var store = writer.writeQueryToStore({ - query: listQuery, - result: listResult, - dataIdFromObject: dataIdFromObject, - }); - var previousResult = { - person: listResult.people[0], - }; - var cacheRedirects = { - Query: { - person: function (_, args) { - return apollo_utilities_1.toIdValue({ id: args['id'], typename: 'Person' }); - }, - }, - }; - var config = { dataIdFromObject: dataIdFromObject, cacheRedirects: cacheRedirects }; - var result = reader.diffQueryAgainstStore({ - store: store, - query: itemQuery, - previousResult: previousResult, - config: config, - }).result; - expect(result).toEqual(previousResult); - }); - }); - describe('malformed queries', function () { - it('throws for non-scalar query fields without selection sets', function () { - var validQuery = graphql_tag_1.default(templateObject_29 || (templateObject_29 = tslib_1.__makeTemplateObject(["\n query getMessageList {\n messageList {\n id\n __typename\n message\n }\n }\n "], ["\n query getMessageList {\n messageList {\n id\n __typename\n message\n }\n }\n "]))); - var invalidQuery = graphql_tag_1.default(templateObject_30 || (templateObject_30 = tslib_1.__makeTemplateObject(["\n query getMessageList {\n # This field needs a selection set because its value is an array\n # of non-scalar objects.\n messageList\n }\n "], ["\n query getMessageList {\n # This field needs a selection set because its value is an array\n # of non-scalar objects.\n messageList\n }\n "]))); - var store = writer.writeQueryToStore({ - query: validQuery, - result: { - messageList: [ - { - id: 1, - __typename: 'Message', - message: 'hi', - }, - { - id: 2, - __typename: 'Message', - message: 'hello', - }, - { - id: 3, - __typename: 'Message', - message: 'hey', - }, - ], - }, - }); - try { - reader.diffQueryAgainstStore({ - store: store, - query: invalidQuery, - }); - throw new Error('should have thrown'); - } - catch (e) { - expect(e.message).toEqual('Missing selection set for object of type Message returned for query field messageList'); - } - }); - }); - describe('issue #4081', function () { - it('should not return results containing cycles', function () { - var company = { - __typename: 'Company', - id: 1, - name: 'Apollo', - users: [], - }; - company.users.push({ - __typename: 'User', - id: 1, - name: 'Ben', - company: company, - }, { - __typename: 'User', - id: 2, - name: 'James', - company: company, - }); - var query = graphql_tag_1.default(templateObject_31 || (templateObject_31 = tslib_1.__makeTemplateObject(["\n query Query {\n user {\n ...UserFragment\n company {\n users {\n ...UserFragment\n }\n }\n }\n }\n\n fragment UserFragment on User {\n id\n name\n company {\n id\n name\n }\n }\n "], ["\n query Query {\n user {\n ...UserFragment\n company {\n users {\n ...UserFragment\n }\n }\n }\n }\n\n fragment UserFragment on User {\n id\n name\n company {\n id\n name\n }\n }\n "]))); - function check(store) { - var result = reader.diffQueryAgainstStore({ store: store, query: query }).result; - var json = JSON.stringify(result); - company.users.forEach(function (user) { - expect(json).toContain(JSON.stringify(user.name)); - }); - expect(result).toEqual({ - user: { - id: 1, - name: 'Ben', - company: { - id: 1, - name: 'Apollo', - users: [ - { - id: 1, - name: 'Ben', - company: { - id: 1, - name: 'Apollo', - }, - }, - { - id: 2, - name: 'James', - company: { - id: 1, - name: 'Apollo', - }, - }, - ], - }, - }, - }); - } - check(writer.writeQueryToStore({ - query: query, - result: { - user: company.users[0], - }, - })); - check(writer.writeQueryToStore({ - dataIdFromObject: inMemoryCache_1.defaultDataIdFromObject, - query: query, - result: { - user: company.users[0], - }, - })); - }); - }); -}); -var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31; -//# sourceMappingURL=diffAgainstStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map deleted file mode 100644 index d9c1724..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"diffAgainstStore.js","sourceRoot":"","sources":["../../src/__tests__/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CACP,EAAE,EAAE,CAAC;wCACL,IAAI,EAAE,QAAQ;qCACf;iCACF;6BACF;yBACF;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;YAGD,KAAK,CACH,MAAM,CAAC,iBAAiB,CAAC;gBACvB,KAAK,OAAA;gBACL,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;iBACvB;aACF,CAAC,CACH,CAAC;YAGF,KAAK,CACH,MAAM,CAAC,iBAAiB,CAAC;gBACvB,gBAAgB,EAAE,uCAAuB;gBACzC,KAAK,OAAA;gBACL,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;iBACvB;aACF,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts deleted file mode 100644 index c07b9b3..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=fragmentMatcher.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map deleted file mode 100644 index 23193f3..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragmentMatcher.d.ts","sourceRoot":"","sources":["../src/__tests__/fragmentMatcher.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js deleted file mode 100644 index cba24f2..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var fragmentMatcher_1 = require("../fragmentMatcher"); -var objectCache_1 = require("../objectCache"); -var inMemoryCache_1 = require("../inMemoryCache"); -var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); -describe('FragmentMatcher', function () { - it('can match against the root Query', function () { - var cache = new inMemoryCache_1.InMemoryCache({ - addTypename: true, - }); - var query = graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n query AllPeople {\n people {\n id\n name\n }\n ...PeopleTypes\n }\n fragment PeopleTypes on Query {\n __type(name: \"Person\") {\n name\n kind\n }\n }\n "], ["\n query AllPeople {\n people {\n id\n name\n }\n ...PeopleTypes\n }\n fragment PeopleTypes on Query {\n __type(name: \"Person\") {\n name\n kind\n }\n }\n "]))); - var data = { - people: [ - { - __typename: 'Person', - id: 123, - name: 'Ben', - }, - ], - __type: { - __typename: '__Type', - name: 'Person', - kind: 'OBJECT', - }, - }; - cache.writeQuery({ query: query, data: data }); - expect(cache.readQuery({ query: query })).toEqual(data); - }); -}); -describe('IntrospectionFragmentMatcher', function () { - it('will throw an error if match is called if it is not ready', function () { - var ifm = new fragmentMatcher_1.IntrospectionFragmentMatcher(); - expect(function () { return ifm.match(); }).toThrowError(/called before/); - }); - it('can be seeded with an introspection query result', function () { - var ifm = new fragmentMatcher_1.IntrospectionFragmentMatcher({ - introspectionQueryResultData: { - __schema: { - types: [ - { - kind: 'UNION', - name: 'Item', - possibleTypes: [ - { - name: 'ItemA', - }, - { - name: 'ItemB', - }, - ], - }, - ], - }, - }, - }); - var store = objectCache_1.defaultNormalizedCacheFactory({ - a: { - __typename: 'ItemB', - }, - }); - var idValue = { - type: 'id', - id: 'a', - generated: false, - }; - var readStoreContext = { - store: store, - returnPartialData: false, - hasMissingField: false, - cacheRedirects: {}, - }; - expect(ifm.match(idValue, 'Item', readStoreContext)).toBe(true); - expect(ifm.match(idValue, 'NotAnItem', readStoreContext)).toBe(false); - }); -}); -var templateObject_1; -//# sourceMappingURL=fragmentMatcher.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map deleted file mode 100644 index 68d2035..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragmentMatcher.js","sourceRoot":"","sources":["../../src/__tests__/fragmentMatcher.ts"],"names":[],"mappings":";;;AAAA,sDAAkE;AAClE,8CAA+D;AAE/D,kDAAiD;AACjD,oEAA8B;AAE9B,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,kCAAkC,EAAE;QACrC,IAAM,KAAK,GAAG,IAAI,6BAAa,CAAC;YAC9B,WAAW,EAAE,IAAI;SAClB,CAAC,CAAC;QAEH,IAAM,KAAK,GAAG,qBAAG,uUAAA,4PAchB,IAAA,CAAC;QAEF,IAAM,IAAI,GAAG;YACX,MAAM,EAAE;gBACN;oBACE,UAAU,EAAE,QAAQ;oBACpB,EAAE,EAAE,GAAG;oBACP,IAAI,EAAE,KAAK;iBACZ;aACF;YACD,MAAM,EAAE;gBACN,UAAU,EAAE,QAAQ;gBACpB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;aACf;SACF,CAAC;QAEF,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,OAAA,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,8BAA8B,EAAE;IACvC,EAA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node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts deleted file mode 100644 index 7a55a8b..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=mapCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map deleted file mode 100644 index c5374f3..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapCache.d.ts","sourceRoot":"","sources":["../src/__tests__/mapCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js deleted file mode 100644 index e6fcb73..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js +++ /dev/null @@ -1,18 +0,0 @@ -jest.mock('../objectCache', function () { - var _a = require('../mapCache'), MapCache = _a.MapCache, mapNormalizedCacheFactory = _a.mapNormalizedCacheFactory; - return { - ObjectCache: MapCache, - defaultNormalizedCacheFactory: mapNormalizedCacheFactory, - }; -}); -describe('MapCache', function () { - require('./objectCache'); - require('./cache'); - require('./diffAgainstStore'); - require('./fragmentMatcher'); - require('./readFromStore'); - require('./diffAgainstStore'); - require('./roundtrip'); - require('./writeToStore'); -}); -//# sourceMappingURL=mapCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map deleted file mode 100644 index e343f39..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapCache.js","sourceRoot":"","sources":["../../src/__tests__/mapCache.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;IACpB,IAAA,2BAAgE,EAA9D,sBAAQ,EAAE,wDAAoD,CAAC;IACvE,OAAO;QACL,WAAW,EAAE,QAAQ;QACrB,6BAA6B,EAAE,yBAAyB;KACzD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,UAAU,EAAE;IAGnB,OAAO,CAAC,eAAe,CAAC,CAAC;IACzB,OAAO,CAAC,SAAS,CAAC,CAAC;IACnB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9B,OAAO,CAAC,aAAa,CAAC,CAAC;IACvB,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts deleted file mode 100644 index edef318..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=objectCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map deleted file mode 100644 index a2b4f7e..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"objectCache.d.ts","sourceRoot":"","sources":["../src/__tests__/objectCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js deleted file mode 100644 index 714519d..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var objectCache_1 = require("../objectCache"); -describe('ObjectCache', function () { - it('should create an empty cache', function () { - var cache = new objectCache_1.ObjectCache(); - expect(cache.toObject()).toEqual({}); - }); - it('should create a cache based on an Object', function () { - var contents = { a: {} }; - var cache = new objectCache_1.ObjectCache(contents); - expect(cache.toObject()).toEqual(contents); - }); - it("should .get() an object from the store by dataId", function () { - var contents = { a: {} }; - var cache = new objectCache_1.ObjectCache(contents); - expect(cache.get('a')).toBe(contents.a); - }); - it("should .set() an object from the store by dataId", function () { - var obj = {}; - var cache = new objectCache_1.ObjectCache(); - cache.set('a', obj); - expect(cache.get('a')).toBe(obj); - }); - it("should .clear() the store", function () { - var obj = {}; - var cache = new objectCache_1.ObjectCache(); - cache.set('a', obj); - cache.clear(); - expect(cache.get('a')).toBeUndefined(); - }); -}); -//# sourceMappingURL=objectCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map deleted file mode 100644 index 9d00c38..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"objectCache.js","sourceRoot":"","sources":["../../src/__tests__/objectCache.ts"],"names":[],"mappings":";;AAAA,8CAA6C;AAG7C,QAAQ,CAAC,aAAa,EAAE;IACtB,EAAE,CAAC,8BAA8B,EAAE;QACjC,IAAM,KAAK,GAAG,IAAI,yBAAW,EAAE,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,IAAM,QAAQ,GAA0B,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAClD,IAAM,KAAK,GAAG,IAAI,yBAAW,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE;QACrD,IAAM,QAAQ,GAA0B,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QAClD,IAAM,KAAK,GAAG,IAAI,yBAAW,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE;QACrD,IAAM,GAAG,GAAG,EAAE,CAAC;QACf,IAAM,KAAK,GAAG,IAAI,yBAAW,EAAE,CAAC;QAChC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE;QAC9B,IAAM,GAAG,GAAG,EAAE,CAAC;QACf,IAAM,KAAK,GAAG,IAAI,yBAAW,EAAE,CAAC;QAChC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpB,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts deleted file mode 100644 index 637affa..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=readFromStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map deleted file mode 100644 index 9a5c0b1..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readFromStore.d.ts","sourceRoot":"","sources":["../src/__tests__/readFromStore.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js deleted file mode 100644 index 49fbc3c..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js +++ /dev/null @@ -1,555 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var lodash_1 = require("lodash"); -var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); -var apollo_utilities_1 = require("apollo-utilities"); -var __1 = require("../"); -var readFromStore_1 = require("../readFromStore"); -var objectCache_1 = require("../objectCache"); -var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; -var diffAgainstStore_1 = require("./diffAgainstStore"); -describe('reading from the store', function () { - var reader = new readFromStore_1.StoreReader(); - it('runs a nested query with proper fragment fields in arrays', function () { - diffAgainstStore_1.withError(function () { - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: { - __typename: 'Query', - nestedObj: { type: 'id', id: 'abcde', generated: false }, - }, - abcde: { - id: 'abcde', - innerArray: [ - { type: 'id', generated: true, id: 'abcde.innerArray.0' }, - ], - }, - 'abcde.innerArray.0': { - id: 'abcdef', - someField: 3, - }, - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "], ["\n {\n ... on DummyQuery {\n nestedObj {\n innerArray {\n id\n otherField\n }\n }\n }\n ... on Query {\n nestedObj {\n innerArray {\n id\n someField\n }\n }\n }\n ... on DummyQuery2 {\n nestedObj {\n innerArray {\n id\n otherField2\n }\n }\n }\n }\n "]))), - fragmentMatcherFunction: fragmentMatcherFunction, - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - nestedObj: { - innerArray: [{ id: 'abcdef', someField: 3 }], - }, - }); - }, /queries contain union or interface types/); - }); - it('rejects malformed queries', function () { - expect(function () { - reader.readQueryFromStore({ - store: objectCache_1.defaultNormalizedCacheFactory(), - query: graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n query {\n name\n }\n\n query {\n address\n }\n "], ["\n query {\n name\n }\n\n query {\n address\n }\n "]))), - }); - }).toThrowError(/2 operations/); - expect(function () { - reader.readQueryFromStore({ - store: objectCache_1.defaultNormalizedCacheFactory(), - query: graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n fragment x on y {\n name\n }\n "], ["\n fragment x on y {\n name\n }\n "]))), - }); - }).toThrowError(/contain a query/); - }); - it('runs a basic query', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: result, - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n query {\n stringField\n numberField\n }\n "], ["\n query {\n stringField\n numberField\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: result['stringField'], - numberField: result['numberField'], - }); - }); - it('runs a basic query with arguments', function () { - var query = graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n query {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n query {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); - var variables = { - intArg: 5, - floatArg: 3.14, - stringArg: 'This is a string!', - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: { - id: 'abcd', - nullField: null, - 'numberField({"floatArg":3.14,"intArg":5})': 5, - 'stringField({"arg":"This is a string!"})': 'Heyo', - }, - }); - var result = reader.readQueryFromStore({ - store: store, - query: query, - variables: variables, - }); - expect(apollo_utilities_1.stripSymbols(result)).toEqual({ - id: 'abcd', - nullField: null, - numberField: 5, - stringField: 'Heyo', - }); - }); - it('runs a basic query with custom directives', function () { - var query = graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "], ["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "]))); - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: { - id: 'abcd', - firstName: 'James', - 'lastName@upperCase': 'BOND', - 'birthDate@dateFormat({"format":"DD-MM-YYYY"})': '20-05-1940', - }, - }); - var result = reader.readQueryFromStore({ - store: store, - query: query, - }); - expect(apollo_utilities_1.stripSymbols(result)).toEqual({ - id: 'abcd', - firstName: 'James', - lastName: 'BOND', - birthDate: '20-05-1940', - }); - }); - it('runs a basic query with default values for arguments', function () { - var query = graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int = 0\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int = 0\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); - var variables = { - floatArg: 3.14, - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: { - id: 'abcd', - nullField: null, - 'numberField({"floatArg":3.14,"intArg":0})': 5, - 'stringField({"arg":"This is a default string!"})': 'Heyo', - }, - }); - var result = reader.readQueryFromStore({ - store: store, - query: query, - variables: variables, - }); - expect(apollo_utilities_1.stripSymbols(result)).toEqual({ - id: 'abcd', - nullField: null, - numberField: 5, - stringField: 'Heyo', - }); - }); - it('runs a nested query', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: { - id: 'abcde', - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { - nestedObj: { - type: 'id', - id: 'abcde', - generated: false, - }, - }), - abcde: result.nestedObj, - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - nestedObj: { - stringField: 'This is a string too!', - numberField: 6, - }, - }); - }); - it('runs a nested query with multiple fragments', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: { - id: 'abcde', - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - deepNestedObj: { - stringField: 'This is a deep string', - numberField: 7, - nullField: null, - }, - nullObject: null, - __typename: 'Item', - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj', 'deepNestedObj')), { - __typename: 'Query', - nestedObj: { - type: 'id', - id: 'abcde', - generated: false, - }, - }), - abcde: lodash_1.assign({}, result.nestedObj, { - deepNestedObj: { - type: 'id', - id: 'abcdef', - generated: false, - }, - }), - abcdef: result.deepNestedObj, - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nullField\n ... on Query {\n nestedObj {\n stringField\n nullField\n deepNestedObj {\n stringField\n nullField\n }\n }\n }\n ... on Query {\n nestedObj {\n numberField\n nullField\n deepNestedObj {\n numberField\n nullField\n }\n }\n }\n ... on Query {\n nullObject\n }\n }\n "], ["\n {\n stringField\n numberField\n nullField\n ... on Query {\n nestedObj {\n stringField\n nullField\n deepNestedObj {\n stringField\n nullField\n }\n }\n }\n ... on Query {\n nestedObj {\n numberField\n nullField\n deepNestedObj {\n numberField\n nullField\n }\n }\n }\n ... on Query {\n nullObject\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: { - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - deepNestedObj: { - stringField: 'This is a deep string', - numberField: 7, - nullField: null, - }, - }, - nullObject: null, - }); - }); - it('runs a nested query with an array without IDs', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedArray: [ - { - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - { - stringField: 'This is a string also!', - numberField: 7, - nullField: null, - }, - ], - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { - nestedArray: [ - { type: 'id', generated: true, id: 'abcd.nestedArray.0' }, - { type: 'id', generated: true, id: 'abcd.nestedArray.1' }, - ], - }), - 'abcd.nestedArray.0': result.nestedArray[0], - 'abcd.nestedArray.1': result.nestedArray[1], - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - nestedArray: [ - { - stringField: 'This is a string too!', - numberField: 6, - }, - { - stringField: 'This is a string also!', - numberField: 7, - }, - ], - }); - }); - it('runs a nested query with an array without IDs and a null', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedArray: [ - null, - { - stringField: 'This is a string also!', - numberField: 7, - nullField: null, - }, - ], - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { - nestedArray: [ - null, - { type: 'id', generated: true, id: 'abcd.nestedArray.1' }, - ], - }), - 'abcd.nestedArray.1': result.nestedArray[1], - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedArray {\n stringField\n numberField\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - nestedArray: [ - null, - { - stringField: 'This is a string also!', - numberField: 7, - }, - ], - }); - }); - it('runs a nested query with an array with IDs and a null', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedArray: [ - null, - { - id: 'abcde', - stringField: 'This is a string also!', - numberField: 7, - nullField: null, - }, - ], - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { - nestedArray: [null, { type: 'id', generated: false, id: 'abcde' }], - }), - abcde: result.nestedArray[1], - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedArray {\n id\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedArray {\n id\n stringField\n numberField\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - nestedArray: [ - null, - { - id: 'abcde', - stringField: 'This is a string also!', - numberField: 7, - }, - ], - }); - }); - it('throws on a missing field', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ ROOT_QUERY: result }); - expect(function () { - reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n {\n stringField\n missingField\n }\n "], ["\n {\n stringField\n missingField\n }\n "]))), - }); - }).toThrowError(/field missingField on object/); - }); - it('runs a nested query where the reference is null', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: null, - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { - nestedObj: null, - }), - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "], ["\n {\n stringField\n numberField\n nestedObj {\n stringField\n numberField\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - nestedObj: null, - }); - }); - it('runs an array of non-objects', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - simpleArray: ['one', 'two', 'three'], - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { - simpleArray: { - type: 'json', - json: result.simpleArray, - }, - }), - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n simpleArray\n }\n "], ["\n {\n stringField\n numberField\n simpleArray\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - simpleArray: ['one', 'two', 'three'], - }); - }); - it('runs an array of non-objects with null', function () { - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - simpleArray: [null, 'two', 'three'], - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { - simpleArray: { - type: 'json', - json: result.simpleArray, - }, - }), - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n simpleArray\n }\n "], ["\n {\n stringField\n numberField\n simpleArray\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - stringField: 'This is a string!', - numberField: 5, - simpleArray: [null, 'two', 'three'], - }); - }); - it('will read from an arbitrary root id', function () { - var data = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: { - id: 'abcde', - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - deepNestedObj: { - stringField: 'This is a deep string', - numberField: 7, - nullField: null, - }, - nullObject: null, - __typename: 'Item', - }; - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(data, 'nestedObj', 'deepNestedObj')), { - __typename: 'Query', - nestedObj: { - type: 'id', - id: 'abcde', - generated: false, - }, - }), - abcde: lodash_1.assign({}, data.nestedObj, { - deepNestedObj: { - type: 'id', - id: 'abcdef', - generated: false, - }, - }), - abcdef: data.deepNestedObj, - }); - var queryResult1 = reader.readQueryFromStore({ - store: store, - rootId: 'abcde', - query: graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nullField\n deepNestedObj {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n stringField\n numberField\n nullField\n deepNestedObj {\n stringField\n numberField\n nullField\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult1)).toEqual({ - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - deepNestedObj: { - stringField: 'This is a deep string', - numberField: 7, - nullField: null, - }, - }); - var queryResult2 = reader.readQueryFromStore({ - store: store, - rootId: 'abcdef', - query: graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n {\n stringField\n numberField\n nullField\n }\n "], ["\n {\n stringField\n numberField\n nullField\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult2)).toEqual({ - stringField: 'This is a deep string', - numberField: 7, - nullField: null, - }); - }); - it('properly handles the connection directive', function () { - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: { - abc: [ - { - generated: true, - id: 'ROOT_QUERY.abc.0', - type: 'id', - }, - ], - }, - 'ROOT_QUERY.abc.0': { - name: 'efgh', - }, - }); - var queryResult = reader.readQueryFromStore({ - store: store, - query: graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "], ["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "]))), - }); - expect(apollo_utilities_1.stripSymbols(queryResult)).toEqual({ - books: [ - { - name: 'efgh', - }, - ], - }); - }); -}); -var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19; -//# sourceMappingURL=readFromStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map deleted file mode 100644 index 93ec353..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readFromStore.js","sourceRoot":"","sources":["../../src/__tests__/readFromStore.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,oEAA8B;AAC9B,qDAAgD;AAEhD,yBAA4D;AAC5D,kDAA+C;AAC/C,8CAA+D;AAE/D,IAAM,uBAAuB,GAAG,IAAI,4BAAwB,EAAE,CAAC,KAAK,CAAC;AACrE,uDAA+C;AAE/C,QAAQ,CAAC,wBAAwB,EAAE;IACjC,IAAM,MAAM,GAAG,IAAI,2BAAW,EAAE,CAAC;IAEjC,EAAE,CAAC,2DAA2D,EAAE;QAC9D,4BAAS,CAAC;YACR,IAAM,KAAK,GAAG,2CAA6B,CAAC;gBAC1C,UAAU,EAAE;oBACV,UAAU,EAAE,OAAO;oBACnB,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE;iBAC1C;gBAChB,KAAK,EAAE;oBACL,EAAE,EAAE,OAAO;oBACX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,CAAC,OAAO,CAAC;YACzC,WAAW,EAAE,uBAAuB;YACpC,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,IAAI;YACf,aAAa,EAAE;gBACb,WAAW,EAAE,uBAAuB;gBACpC,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,IAAI;aAChB;SACF,CAAC,CAAC;QAEH,IAAM,YAAY,GAAG,MAAM,CAAC,kBAAkB,CAAC;YAC7C,KAAK,OAAA;YACL,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,qBAAG,gLAAA,mGAMT,IAAA;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,+BAAY,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC;YACzC,WAAW,EAAE,uBAAuB;YACpC,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE;QAC9C,IAAM,KAAK,GAAG,2CAA6B,CAAC;YAC1C,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH;wBACE,SAAS,EAAE,IAAI;wBACf,EAAE,EAAE,kBAAkB;wBACtB,IAAI,EAAE,IAAI;qBACX;iBACF;aACF;YACD,kBAAkB,EAAE;gBAClB,IAAI,EAAE,MAAM;aACb;SACF,CAAC,CAAC;QAEH,IAAM,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;YAC5C,KAAK,OAAA;YACL,KAAK,EAAE,qBAAG,4MAAA,+HAMT,IAAA;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,+BAAY,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;YACxC,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,MAAM;iBACb;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts deleted file mode 100644 index 290798f..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=recordingCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map deleted file mode 100644 index 0029a6c..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recordingCache.d.ts","sourceRoot":"","sources":["../src/__tests__/recordingCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js deleted file mode 100644 index 29ad65f..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var inMemoryCache_1 = require("../inMemoryCache"); -var objectCache_1 = require("../objectCache"); -describe('OptimisticCacheLayer', function () { - function makeLayer(root) { - return new inMemoryCache_1.OptimisticCacheLayer('whatever', root, function () { }); - } - describe('returns correct values during recording', function () { - var data = { - Human: { __typename: 'Human', name: 'Mark' }, - Animal: { __typename: 'Mouse', name: '🐭' }, - }; - var dataToRecord = { - Human: { __typename: 'Human', name: 'John' }, - }; - var underlyingCache = new objectCache_1.ObjectCache(data); - var cache = makeLayer(underlyingCache); - beforeEach(function () { - cache = makeLayer(underlyingCache); - }); - it('should passthrough values if not defined in recording', function () { - expect(cache.get('Human')).toBe(data.Human); - expect(cache.get('Animal')).toBe(data.Animal); - }); - it('should return values defined during recording', function () { - cache.set('Human', dataToRecord.Human); - expect(cache.get('Human')).toBe(dataToRecord.Human); - expect(underlyingCache.get('Human')).toBe(data.Human); - }); - it('should return undefined for values deleted during recording', function () { - expect(cache.get('Animal')).toBe(data.Animal); - cache.delete('Animal'); - expect(cache.get('Animal')).toBeUndefined(); - expect(cache.toObject()).toHaveProperty('Animal'); - expect(underlyingCache.get('Animal')).toBe(data.Animal); - }); - }); - describe('returns correct result of a recorded transaction', function () { - var data = { - Human: { __typename: 'Human', name: 'Mark' }, - Animal: { __typename: 'Mouse', name: '🐭' }, - }; - var dataToRecord = { - Human: { __typename: 'Human', name: 'John' }, - }; - var underlyingCache = new objectCache_1.ObjectCache(data); - var cache = makeLayer(underlyingCache); - var recording; - beforeEach(function () { - cache = makeLayer(underlyingCache); - cache.set('Human', dataToRecord.Human); - cache.delete('Animal'); - recording = cache.toObject(); - }); - it('should contain the property indicating deletion', function () { - expect(recording).toHaveProperty('Animal'); - }); - it('should have recorded the changes made during recording', function () { - expect(recording).toEqual({ - Human: dataToRecord.Human, - Animal: undefined, - }); - }); - it('should keep the original data unaffected', function () { - expect(underlyingCache.toObject()).toEqual(data); - }); - }); -}); -//# sourceMappingURL=recordingCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map deleted file mode 100644 index 4c2dd1c..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recordingCache.js","sourceRoot":"","sources":["../../src/__tests__/recordingCache.ts"],"names":[],"mappings":";;AAAA,kDAAwD;AACxD,8CAA6C;AAG7C,QAAQ,CAAC,sBAAsB,EAAE;IAC/B,SAAS,SAAS,CAAC,IAAiB;QAClC,OAAO,IAAI,oCAAoB,CAAC,UAAU,EAAE,IAAI,EAAE,cAAO,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,QAAQ,CAAC,yCAAyC,EAAE;QAClD,IAAM,IAAI,GAAG;YACX,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MA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AAS,CAAC,CAAC,OAAO,CAAC;gBACxB,KAAK,EAAE,YAAY,CAAC,KAAK;gBACzB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0CAA0C,EAAE;YAC7C,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts deleted file mode 100644 index 2b083ec..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=roundtrip.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map deleted file mode 100644 index 148afc1..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"roundtrip.d.ts","sourceRoot":"","sources":["../src/__tests__/roundtrip.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js deleted file mode 100644 index bc932c5..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js +++ /dev/null @@ -1,275 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); -var diffAgainstStore_1 = require("./diffAgainstStore"); -var writeToStore_1 = require("./writeToStore"); -var depTrackingCache_1 = require("../depTrackingCache"); -var __1 = require("../"); -var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; -function assertDeeplyFrozen(value, stack) { - if (stack === void 0) { stack = []; } - if (value !== null && typeof value === 'object' && stack.indexOf(value) < 0) { - expect(Object.isExtensible(value)).toBe(false); - expect(Object.isFrozen(value)).toBe(true); - stack.push(value); - Object.keys(value).forEach(function (key) { - assertDeeplyFrozen(value[key], stack); - }); - expect(stack.pop()).toBe(value); - } -} -function storeRoundtrip(query, result, variables) { - if (variables === void 0) { variables = {}; } - var reader = new __1.StoreReader(); - var immutableReader = new __1.StoreReader({ freezeResults: true }); - var writer = new __1.StoreWriter(); - var store = writer.writeQueryToStore({ - result: result, - query: query, - variables: variables, - }); - var readOptions = { - store: store, - query: query, - variables: variables, - fragmentMatcherFunction: fragmentMatcherFunction, - }; - var reconstructedResult = reader.readQueryFromStore(readOptions); - expect(reconstructedResult).toEqual(result); - expect(store).toBeInstanceOf(depTrackingCache_1.DepTrackingCache); - expect(reader.readQueryFromStore(readOptions)).toBe(reconstructedResult); - var immutableResult = immutableReader.readQueryFromStore(readOptions); - expect(immutableResult).toEqual(reconstructedResult); - expect(immutableReader.readQueryFromStore(readOptions)).toBe(immutableResult); - if (process.env.NODE_ENV !== 'production') { - try { - immutableResult.illegal = 'this should not work'; - throw new Error('unreached'); - } - catch (e) { - expect(e.message).not.toMatch(/unreached/); - expect(e).toBeInstanceOf(TypeError); - } - assertDeeplyFrozen(immutableResult); - } - writer.writeQueryToStore({ - store: store, - result: { oyez: 1234 }, - query: graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n oyez\n }\n "], ["\n {\n oyez\n }\n "]))), - }); - var deletedRootResult = reader.readQueryFromStore(readOptions); - expect(deletedRootResult).toEqual(result); - if (deletedRootResult === reconstructedResult) { - return; - } - Object.keys(result).forEach(function (key) { - expect(deletedRootResult[key]).toBe(reconstructedResult[key]); - }); -} -describe('roundtrip', function () { - it('real graphql result', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "], ["\n {\n people_one(id: \"1\") {\n name\n }\n }\n "]))), { - people_one: { - name: 'Luke Skywalker', - }, - }); - }); - it('multidimensional array (#776)', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n rows {\n value\n }\n }\n "], ["\n {\n rows {\n value\n }\n }\n "]))), { - rows: [[{ value: 1 }, { value: 2 }], [{ value: 3 }, { value: 4 }]], - }); - }); - it('array with null values (#1551)', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n list {\n value\n }\n }\n "], ["\n {\n list {\n value\n }\n }\n "]))), { - list: [null, { value: 1 }], - }); - }); - it('enum arguments', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n {\n hero(episode: JEDI) {\n name\n }\n }\n "], ["\n {\n hero(episode: JEDI) {\n name\n }\n }\n "]))), { - hero: { - name: 'Luke Skywalker', - }, - }); - }); - it('with an alias', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n {\n luke: people_one(id: \"1\") {\n name\n }\n vader: people_one(id: \"4\") {\n name\n }\n }\n "], ["\n {\n luke: people_one(id: \"1\") {\n name\n }\n vader: people_one(id: \"4\") {\n name\n }\n }\n "]))), { - luke: { - name: 'Luke Skywalker', - }, - vader: { - name: 'Darth Vader', - }, - }); - }); - it('with variables', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n {\n luke: people_one(id: $lukeId) {\n name\n }\n vader: people_one(id: $vaderId) {\n name\n }\n }\n "], ["\n {\n luke: people_one(id: $lukeId) {\n name\n }\n vader: people_one(id: $vaderId) {\n name\n }\n }\n "]))), { - luke: { - name: 'Luke Skywalker', - }, - vader: { - name: 'Darth Vader', - }, - }, { - lukeId: '1', - vaderId: '4', - }); - }); - it('with GraphQLJSON scalar type', function () { - var updateClub = { - uid: '1d7f836018fc11e68d809dfee940f657', - name: 'Eple', - settings: { - name: 'eple', - currency: 'AFN', - calendarStretch: 2, - defaultPreAllocationPeriod: 1, - confirmationEmailCopy: null, - emailDomains: null, - }, - }; - storeRoundtrip(graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n {\n updateClub {\n uid\n name\n settings\n }\n }\n "], ["\n {\n updateClub {\n uid\n name\n settings\n }\n }\n "]))), { - updateClub: updateClub, - }); - expect(Object.isExtensible(updateClub)).toBe(true); - expect(Object.isFrozen(updateClub)).toBe(false); - }); - describe('directives', function () { - it('should be able to query with skip directive true', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n query {\n fortuneCookie @skip(if: true)\n }\n "], ["\n query {\n fortuneCookie @skip(if: true)\n }\n "]))), {}); - }); - it('should be able to query with skip directive false', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n query {\n fortuneCookie @skip(if: false)\n }\n "], ["\n query {\n fortuneCookie @skip(if: false)\n }\n "]))), { fortuneCookie: 'live long and prosper' }); - }); - }); - describe('fragments', function () { - it('should work on null fields', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n query {\n field {\n ... on Obj {\n stuff\n }\n }\n }\n "], ["\n query {\n field {\n ... on Obj {\n stuff\n }\n }\n }\n "]))), { - field: null, - }); - }); - it('should work on basic inline fragments', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n query {\n field {\n __typename\n ... on Obj {\n stuff\n }\n }\n }\n "], ["\n query {\n field {\n __typename\n ... on Obj {\n stuff\n }\n }\n }\n "]))), { - field: { - __typename: 'Obj', - stuff: 'Result', - }, - }); - }); - it('should resolve on union types with inline fragments without typenames with warning', function () { - return writeToStore_1.withWarning(function () { - storeRoundtrip(graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n query {\n all_people {\n name\n ... on Jedi {\n side\n }\n ... on Droid {\n model\n }\n }\n }\n "], ["\n query {\n all_people {\n name\n ... on Jedi {\n side\n }\n ... on Droid {\n model\n }\n }\n }\n "]))), { - all_people: [ - { - name: 'Luke Skywalker', - side: 'bright', - }, - { - name: 'R2D2', - model: 'astromech', - }, - ], - }); - }, /using fragments/); - }); - it('should throw an error on two of the same inline fragment types', function () { - return expect(function () { - storeRoundtrip(graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n query {\n all_people {\n __typename\n name\n ... on Jedi {\n side\n }\n ... on Jedi {\n rank\n }\n }\n }\n "], ["\n query {\n all_people {\n __typename\n name\n ... on Jedi {\n side\n }\n ... on Jedi {\n rank\n }\n }\n }\n "]))), { - all_people: [ - { - __typename: 'Jedi', - name: 'Luke Skywalker', - side: 'bright', - }, - ], - }); - }).toThrowError(/Can\'t find field rank on object/); - }); - it('should resolve fields it can on interface with non matching inline fragments', function () { - return diffAgainstStore_1.withError(function () { - storeRoundtrip(graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n query {\n dark_forces {\n __typename\n name\n ... on Droid {\n model\n }\n }\n }\n "], ["\n query {\n dark_forces {\n __typename\n name\n ... on Droid {\n model\n }\n }\n }\n "]))), { - dark_forces: [ - { - __typename: 'Droid', - name: '8t88', - model: '88', - }, - { - __typename: 'Darth', - name: 'Anakin Skywalker', - }, - ], - }); - }, /IntrospectionFragmentMatcher/); - }); - it('should resolve on union types with spread fragments', function () { - return diffAgainstStore_1.withError(function () { - storeRoundtrip(graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n __typename\n name\n ...jediFragment\n ...droidFragment\n }\n }\n "], ["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n __typename\n name\n ...jediFragment\n ...droidFragment\n }\n }\n "]))), { - all_people: [ - { - __typename: 'Jedi', - name: 'Luke Skywalker', - side: 'bright', - }, - { - __typename: 'Droid', - name: 'R2D2', - model: 'astromech', - }, - ], - }); - }, /IntrospectionFragmentMatcher/); - }); - it('should work with a fragment on the actual interface or union', function () { - return diffAgainstStore_1.withError(function () { - storeRoundtrip(graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n fragment jediFragment on Character {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n name\n __typename\n ...jediFragment\n ...droidFragment\n }\n }\n "], ["\n fragment jediFragment on Character {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n all_people {\n name\n __typename\n ...jediFragment\n ...droidFragment\n }\n }\n "]))), { - all_people: [ - { - __typename: 'Jedi', - name: 'Luke Skywalker', - side: 'bright', - }, - { - __typename: 'Droid', - name: 'R2D2', - model: 'astromech', - }, - ], - }); - }, /IntrospectionFragmentMatcher/); - }); - it('should throw on error on two of the same spread fragment types', function () { - expect(function () { - return storeRoundtrip(graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n fragment jediSide on Jedi {\n side\n }\n\n fragment jediRank on Jedi {\n rank\n }\n\n query {\n all_people {\n __typename\n name\n ...jediSide\n ...jediRank\n }\n }\n "], ["\n fragment jediSide on Jedi {\n side\n }\n\n fragment jediRank on Jedi {\n rank\n }\n\n query {\n all_people {\n __typename\n name\n ...jediSide\n ...jediRank\n }\n }\n "]))), { - all_people: [ - { - __typename: 'Jedi', - name: 'Luke Skywalker', - side: 'bright', - }, - ], - }); - }).toThrowError(/Can\'t find field rank on object/); - }); - it('should resolve on @include and @skip with inline fragments', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n query {\n person {\n name\n __typename\n ... on Jedi @include(if: true) {\n side\n }\n ... on Droid @skip(if: true) {\n model\n }\n }\n }\n "], ["\n query {\n person {\n name\n __typename\n ... on Jedi @include(if: true) {\n side\n }\n ... on Droid @skip(if: true) {\n model\n }\n }\n }\n "]))), { - person: { - __typename: 'Jedi', - name: 'Luke Skywalker', - side: 'bright', - }, - }); - }); - it('should resolve on @include and @skip with spread fragments', function () { - storeRoundtrip(graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n person {\n name\n __typename\n ...jediFragment @include(if: true)\n ...droidFragment @skip(if: true)\n }\n }\n "], ["\n fragment jediFragment on Jedi {\n side\n }\n\n fragment droidFragment on Droid {\n model\n }\n\n query {\n person {\n name\n __typename\n ...jediFragment @include(if: true)\n ...droidFragment @skip(if: true)\n }\n }\n "]))), { - person: { - __typename: 'Jedi', - name: 'Luke Skywalker', - side: 'bright', - }, - }); - }); - }); -}); -var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20; -//# sourceMappingURL=roundtrip.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map deleted file mode 100644 index 1b36787..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"roundtrip.js","sourceRoot":"","sources":["../../src/__tests__/roundtrip.ts"],"names":[],"mappings":";;;A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,UAAU,EAAE,MAAM;4BAClB,IAAI,EAAE,gBAAgB;4BACtB,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF,CACF;YA5BD,CA4BC,CACF,CAAC,YAAY,CAAC,kCAAkC,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE;YAC/D,cAAc,CACZ,qBAAG,yXAAA,4SAaF,MACD;gBACE,MAAM,EAAE;oBACN,UAAU,EAAE,MAAM;oBAClB,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,QAAQ;iBACf;aACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE;YAC/D,cAAc,CACZ,qBAAG,ycAAA,4XAiBF,MACD;gBACE,MAAM,EAAE;oBACN,UAAU,EAAE,MAAM;oBAClB,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,QAAQ;iBACf;aACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts deleted file mode 100644 index f110982..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function withWarning(func: Function, regex: RegExp): Promise; -//# sourceMappingURL=writeToStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map deleted file mode 100644 index b0a79c2..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"writeToStore.d.ts","sourceRoot":"","sources":["../src/__tests__/writeToStore.ts"],"names":[],"mappings":"AA2BA,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAWxD"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js deleted file mode 100644 index 2c40feb..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js +++ /dev/null @@ -1,1523 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var lodash_1 = require("lodash"); -var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); -var apollo_utilities_1 = require("apollo-utilities"); -var writeToStore_1 = require("../writeToStore"); -var objectCache_1 = require("../objectCache"); -var __1 = require("../"); -function withWarning(func, regex) { - var message = null; - var oldWarn = console.warn; - console.warn = function (m) { return (message = m); }; - return Promise.resolve(func()).then(function (val) { - expect(message).toMatch(regex); - console.warn = oldWarn; - return val; - }); -} -exports.withWarning = withWarning; -var getIdField = function (_a) { - var id = _a.id; - return id; -}; -describe('writing to the store', function () { - var writer = new writeToStore_1.StoreWriter(); - it('properly normalizes a trivial item', function () { - var query = graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }) - .toObject()).toEqual({ - ROOT_QUERY: result, - }); - }); - it('properly normalizes an aliased field', function () { - var query = graphql_tag_1.default(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n {\n id\n aliasedField: stringField\n numberField\n nullField\n }\n "], ["\n {\n id\n aliasedField: stringField\n numberField\n nullField\n }\n "]))); - var result = { - id: 'abcd', - aliasedField: 'This is a string!', - numberField: 5, - nullField: null, - }; - var normalized = writer.writeQueryToStore({ - result: result, - query: query, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - }, - }); - }); - it('properly normalizes a aliased fields with arguments', function () { - var query = graphql_tag_1.default(templateObject_3 || (templateObject_3 = tslib_1.__makeTemplateObject(["\n {\n id\n aliasedField1: stringField(arg: 1)\n aliasedField2: stringField(arg: 2)\n numberField\n nullField\n }\n "], ["\n {\n id\n aliasedField1: stringField(arg: 1)\n aliasedField2: stringField(arg: 2)\n numberField\n nullField\n }\n "]))); - var result = { - id: 'abcd', - aliasedField1: 'The arg was 1!', - aliasedField2: 'The arg was 2!', - numberField: 5, - nullField: null, - }; - var normalized = writer.writeQueryToStore({ - result: result, - query: query, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'abcd', - 'stringField({"arg":1})': 'The arg was 1!', - 'stringField({"arg":2})': 'The arg was 2!', - numberField: 5, - nullField: null, - }, - }); - }); - it('properly normalizes a query with variables', function () { - var query = graphql_tag_1.default(templateObject_4 || (templateObject_4 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); - var variables = { - intArg: 5, - floatArg: 3.14, - stringArg: 'This is a string!', - }; - var result = { - id: 'abcd', - stringField: 'Heyo', - numberField: 5, - nullField: null, - }; - var normalized = writer.writeQueryToStore({ - result: result, - query: query, - variables: variables, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'abcd', - nullField: null, - 'numberField({"floatArg":3.14,"intArg":5})': 5, - 'stringField({"arg":"This is a string!"})': 'Heyo', - }, - }); - }); - it('properly normalizes a query with default values', function () { - var query = graphql_tag_1.default(templateObject_5 || (templateObject_5 = tslib_1.__makeTemplateObject(["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "], ["\n query someBigQuery(\n $stringArg: String = \"This is a default string!\"\n $intArg: Int\n $floatArg: Float\n ) {\n id\n stringField(arg: $stringArg)\n numberField(intArg: $intArg, floatArg: $floatArg)\n nullField\n }\n "]))); - var variables = { - intArg: 5, - floatArg: 3.14, - }; - var result = { - id: 'abcd', - stringField: 'Heyo', - numberField: 5, - nullField: null, - }; - var normalized = writer.writeQueryToStore({ - result: result, - query: query, - variables: variables, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'abcd', - nullField: null, - 'numberField({"floatArg":3.14,"intArg":5})': 5, - 'stringField({"arg":"This is a default string!"})': 'Heyo', - }, - }); - }); - it('properly normalizes a query with custom directives', function () { - var query = graphql_tag_1.default(templateObject_6 || (templateObject_6 = tslib_1.__makeTemplateObject(["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "], ["\n query {\n id\n firstName @include(if: true)\n lastName @upperCase\n birthDate @dateFormat(format: \"DD-MM-YYYY\")\n }\n "]))); - var result = { - id: 'abcd', - firstName: 'James', - lastName: 'BOND', - birthDate: '20-05-1940', - }; - var normalized = writer.writeQueryToStore({ - result: result, - query: query, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'abcd', - firstName: 'James', - 'lastName@upperCase': 'BOND', - 'birthDate@dateFormat({"format":"DD-MM-YYYY"})': '20-05-1940', - }, - }); - }); - it('properly normalizes a nested object with an ID', function () { - var _a; - var query = graphql_tag_1.default(templateObject_7 || (templateObject_7 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: { - id: 'abcde', - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }) - .toObject()).toEqual((_a = { - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { - nestedObj: { - type: 'id', - id: result.nestedObj.id, - generated: false, - }, - }) - }, - _a[result.nestedObj.id] = result.nestedObj, - _a)); - }); - it('properly normalizes a nested object without an ID', function () { - var _a; - var query = graphql_tag_1.default(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: { - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }) - .toObject()).toEqual((_a = { - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { - nestedObj: { - type: 'id', - id: "$ROOT_QUERY.nestedObj", - generated: true, - }, - }) - }, - _a["$ROOT_QUERY.nestedObj"] = result.nestedObj, - _a)); - }); - it('properly normalizes a nested object with arguments but without an ID', function () { - var _a; - var query = graphql_tag_1.default(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj(arg: \"val\") {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj(arg: \"val\") {\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: { - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }) - .toObject()).toEqual((_a = { - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { - 'nestedObj({"arg":"val"})': { - type: 'id', - id: "$ROOT_QUERY.nestedObj({\"arg\":\"val\"})", - generated: true, - }, - }) - }, - _a["$ROOT_QUERY.nestedObj({\"arg\":\"val\"})"] = result.nestedObj, - _a)); - }); - it('properly normalizes a nested array with IDs', function () { - var _a; - var query = graphql_tag_1.default(templateObject_10 || (templateObject_10 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedArray: [ - { - id: 'abcde', - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - { - id: 'abcdef', - stringField: 'This is a string also!', - numberField: 7, - nullField: null, - }, - ], - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }) - .toObject()).toEqual((_a = { - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { - nestedArray: result.nestedArray.map(function (obj) { return ({ - type: 'id', - id: obj.id, - generated: false, - }); }), - }) - }, - _a[result.nestedArray[0].id] = result.nestedArray[0], - _a[result.nestedArray[1].id] = result.nestedArray[1], - _a)); - }); - it('properly normalizes a nested array with IDs and a null', function () { - var _a; - var query = graphql_tag_1.default(templateObject_11 || (templateObject_11 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedArray: [ - { - id: 'abcde', - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - null, - ], - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }) - .toObject()).toEqual((_a = { - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { - nestedArray: [ - { type: 'id', id: result.nestedArray[0].id, generated: false }, - null, - ], - }) - }, - _a[result.nestedArray[0].id] = result.nestedArray[0], - _a)); - }); - it('properly normalizes a nested array without IDs', function () { - var _a; - var query = graphql_tag_1.default(templateObject_12 || (templateObject_12 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedArray: [ - { - stringField: 'This is a string too!', - numberField: 6, - nullField: null, - }, - { - stringField: 'This is a string also!', - numberField: 7, - nullField: null, - }, - ], - }; - var normalized = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }); - expect(normalized.toObject()).toEqual((_a = { - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { - nestedArray: [ - { type: 'id', generated: true, id: "ROOT_QUERY.nestedArray.0" }, - { type: 'id', generated: true, id: "ROOT_QUERY.nestedArray.1" }, - ], - }) - }, - _a["ROOT_QUERY.nestedArray.0"] = result.nestedArray[0], - _a["ROOT_QUERY.nestedArray.1"] = result.nestedArray[1], - _a)); - }); - it('properly normalizes a nested array without IDs and a null item', function () { - var _a; - var query = graphql_tag_1.default(templateObject_13 || (templateObject_13 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedArray {\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedArray: [ - null, - { - stringField: 'This is a string also!', - numberField: 7, - nullField: null, - }, - ], - }; - var normalized = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }); - expect(normalized.toObject()).toEqual((_a = { - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedArray')), { - nestedArray: [ - null, - { type: 'id', generated: true, id: "ROOT_QUERY.nestedArray.1" }, - ], - }) - }, - _a["ROOT_QUERY.nestedArray.1"] = result.nestedArray[1], - _a)); - }); - it('properly normalizes an array of non-objects', function () { - var query = graphql_tag_1.default(templateObject_14 || (templateObject_14 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - simpleArray: ['one', 'two', 'three'], - }; - var normalized = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { - simpleArray: { - type: 'json', - json: [ - result.simpleArray[0], - result.simpleArray[1], - result.simpleArray[2], - ], - }, - }), - }); - }); - it('properly normalizes an array of non-objects with null', function () { - var query = graphql_tag_1.default(templateObject_15 || (templateObject_15 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n simpleArray\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - simpleArray: [null, 'two', 'three'], - }; - var normalized = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'simpleArray')), { - simpleArray: { - type: 'json', - json: [ - result.simpleArray[0], - result.simpleArray[1], - result.simpleArray[2], - ], - }, - }), - }); - }); - it('properly normalizes an object occurring in different graphql paths twice', function () { - var query = graphql_tag_1.default(templateObject_16 || (templateObject_16 = tslib_1.__makeTemplateObject(["\n {\n id\n object1 {\n id\n stringField\n }\n object2 {\n id\n numberField\n }\n }\n "], ["\n {\n id\n object1 {\n id\n stringField\n }\n object2 {\n id\n numberField\n }\n }\n "]))); - var result = { - id: 'a', - object1: { - id: 'aa', - stringField: 'string', - }, - object2: { - id: 'aa', - numberField: 1, - }, - }; - var normalized = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'a', - object1: { - type: 'id', - id: 'aa', - generated: false, - }, - object2: { - type: 'id', - id: 'aa', - generated: false, - }, - }, - aa: { - id: 'aa', - stringField: 'string', - numberField: 1, - }, - }); - }); - it('properly normalizes an object occurring in different graphql array paths twice', function () { - var query = graphql_tag_1.default(templateObject_17 || (templateObject_17 = tslib_1.__makeTemplateObject(["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n }\n }\n array2 {\n id\n stringField\n obj {\n id\n numberField\n }\n }\n }\n "], ["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n }\n }\n array2 {\n id\n stringField\n obj {\n id\n numberField\n }\n }\n }\n "]))); - var result = { - id: 'a', - array1: [ - { - id: 'aa', - stringField: 'string', - obj: { - id: 'aaa', - stringField: 'string', - }, - }, - ], - array2: [ - { - id: 'ab', - stringField: 'string2', - obj: { - id: 'aaa', - numberField: 1, - }, - }, - ], - }; - var normalized = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'a', - array1: [ - { - type: 'id', - id: 'aa', - generated: false, - }, - ], - array2: [ - { - type: 'id', - id: 'ab', - generated: false, - }, - ], - }, - aa: { - id: 'aa', - stringField: 'string', - obj: { - type: 'id', - id: 'aaa', - generated: false, - }, - }, - ab: { - id: 'ab', - stringField: 'string2', - obj: { - type: 'id', - id: 'aaa', - generated: false, - }, - }, - aaa: { - id: 'aaa', - stringField: 'string', - numberField: 1, - }, - }); - }); - it('properly normalizes an object occurring in the same graphql array path twice', function () { - var query = graphql_tag_1.default(templateObject_18 || (templateObject_18 = tslib_1.__makeTemplateObject(["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n numberField\n }\n }\n }\n "], ["\n {\n id\n array1 {\n id\n stringField\n obj {\n id\n stringField\n numberField\n }\n }\n }\n "]))); - var result = { - id: 'a', - array1: [ - { - id: 'aa', - stringField: 'string', - obj: { - id: 'aaa', - stringField: 'string', - numberField: 1, - }, - }, - { - id: 'ab', - stringField: 'string2', - obj: { - id: 'aaa', - stringField: 'should not be written', - numberField: 2, - }, - }, - ], - }; - var normalized = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }); - expect(normalized.toObject()).toEqual({ - ROOT_QUERY: { - id: 'a', - array1: [ - { - type: 'id', - id: 'aa', - generated: false, - }, - { - type: 'id', - id: 'ab', - generated: false, - }, - ], - }, - aa: { - id: 'aa', - stringField: 'string', - obj: { - type: 'id', - id: 'aaa', - generated: false, - }, - }, - ab: { - id: 'ab', - stringField: 'string2', - obj: { - type: 'id', - id: 'aaa', - generated: false, - }, - }, - aaa: { - id: 'aaa', - stringField: 'string', - numberField: 1, - }, - }); - }); - it('merges nodes', function () { - var query = graphql_tag_1.default(templateObject_19 || (templateObject_19 = tslib_1.__makeTemplateObject(["\n {\n id\n numberField\n nullField\n }\n "], ["\n {\n id\n numberField\n nullField\n }\n "]))); - var result = { - id: 'abcd', - numberField: 5, - nullField: null, - }; - var store = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - dataIdFromObject: getIdField, - }); - var query2 = graphql_tag_1.default(templateObject_20 || (templateObject_20 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n nullField\n }\n "], ["\n {\n id\n stringField\n nullField\n }\n "]))); - var result2 = { - id: 'abcd', - stringField: 'This is a string!', - nullField: null, - }; - var store2 = writer.writeQueryToStore({ - store: store, - query: query2, - result: result2, - dataIdFromObject: getIdField, - }); - expect(store2.toObject()).toEqual({ - ROOT_QUERY: lodash_1.assign({}, result, result2), - }); - }); - it('properly normalizes a nested object that returns null', function () { - var query = graphql_tag_1.default(templateObject_21 || (templateObject_21 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n nestedObj {\n id\n stringField\n numberField\n nullField\n }\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - nestedObj: null, - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }) - .toObject()).toEqual({ - ROOT_QUERY: lodash_1.assign({}, lodash_1.assign({}, lodash_1.omit(result, 'nestedObj')), { - nestedObj: null, - }), - }); - }); - it('properly normalizes an object with an ID when no extension is passed', function () { - var query = graphql_tag_1.default(templateObject_22 || (templateObject_22 = tslib_1.__makeTemplateObject(["\n {\n people_one(id: \"5\") {\n id\n stringField\n }\n }\n "], ["\n {\n people_one(id: \"5\") {\n id\n stringField\n }\n }\n "]))); - var result = { - people_one: { - id: 'abcd', - stringField: 'This is a string!', - }, - }; - expect(writer - .writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }) - .toObject()).toEqual({ - ROOT_QUERY: { - 'people_one({"id":"5"})': { - type: 'id', - id: '$ROOT_QUERY.people_one({"id":"5"})', - generated: true, - }, - }, - '$ROOT_QUERY.people_one({"id":"5"})': { - id: 'abcd', - stringField: 'This is a string!', - }, - }); - }); - it('consistently serialize different types of input when passed inlined or as variable', function () { - var testData = [ - { - mutation: graphql_tag_1.default(templateObject_23 || (templateObject_23 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Int!) {\n mut(inline: 5, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Int!) {\n mut(inline: 5, variable: $in) {\n id\n }\n }\n "]))), - variables: { in: 5 }, - expected: 'mut({"inline":5,"variable":5})', - }, - { - mutation: graphql_tag_1.default(templateObject_24 || (templateObject_24 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Float!) {\n mut(inline: 5.5, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Float!) {\n mut(inline: 5.5, variable: $in) {\n id\n }\n }\n "]))), - variables: { in: 5.5 }, - expected: 'mut({"inline":5.5,"variable":5.5})', - }, - { - mutation: graphql_tag_1.default(templateObject_25 || (templateObject_25 = tslib_1.__makeTemplateObject(["\n mutation mut($in: String!) {\n mut(inline: \"abc\", variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: String!) {\n mut(inline: \"abc\", variable: $in) {\n id\n }\n }\n "]))), - variables: { in: 'abc' }, - expected: 'mut({"inline":"abc","variable":"abc"})', - }, - { - mutation: graphql_tag_1.default(templateObject_26 || (templateObject_26 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Array!) {\n mut(inline: [1, 2], variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Array!) {\n mut(inline: [1, 2], variable: $in) {\n id\n }\n }\n "]))), - variables: { in: [1, 2] }, - expected: 'mut({"inline":[1,2],"variable":[1,2]})', - }, - { - mutation: graphql_tag_1.default(templateObject_27 || (templateObject_27 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Object!) {\n mut(inline: { a: 1 }, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Object!) {\n mut(inline: { a: 1 }, variable: $in) {\n id\n }\n }\n "]))), - variables: { in: { a: 1 } }, - expected: 'mut({"inline":{"a":1},"variable":{"a":1}})', - }, - { - mutation: graphql_tag_1.default(templateObject_28 || (templateObject_28 = tslib_1.__makeTemplateObject(["\n mutation mut($in: Boolean!) {\n mut(inline: true, variable: $in) {\n id\n }\n }\n "], ["\n mutation mut($in: Boolean!) {\n mut(inline: true, variable: $in) {\n id\n }\n }\n "]))), - variables: { in: true }, - expected: 'mut({"inline":true,"variable":true})', - }, - ]; - function isOperationDefinition(definition) { - return definition.kind === 'OperationDefinition'; - } - function isField(selection) { - return selection.kind === 'Field'; - } - testData.forEach(function (data) { - data.mutation.definitions.forEach(function (definition) { - if (isOperationDefinition(definition)) { - definition.selectionSet.selections.forEach(function (selection) { - if (isField(selection)) { - expect(apollo_utilities_1.storeKeyNameFromField(selection, data.variables)).toEqual(data.expected); - } - }); - } - }); - }); - }); - it('properly normalizes a mutation with object or array parameters and variables', function () { - var mutation = graphql_tag_1.default(templateObject_29 || (templateObject_29 = tslib_1.__makeTemplateObject(["\n mutation some_mutation($nil: ID, $in: Object) {\n some_mutation(\n input: {\n id: \"5\"\n arr: [1, { a: \"b\" }]\n obj: { a: \"b\" }\n num: 5.5\n nil: $nil\n bo: true\n }\n ) {\n id\n }\n some_mutation_with_variables(input: $in) {\n id\n }\n }\n "], ["\n mutation some_mutation($nil: ID, $in: Object) {\n some_mutation(\n input: {\n id: \"5\"\n arr: [1, { a: \"b\" }]\n obj: { a: \"b\" }\n num: 5.5\n nil: $nil\n bo: true\n }\n ) {\n id\n }\n some_mutation_with_variables(input: $in) {\n id\n }\n }\n "]))); - var result = { - some_mutation: { - id: 'id', - }, - some_mutation_with_variables: { - id: 'id', - }, - }; - var variables = { - nil: null, - in: { - id: '5', - arr: [1, { a: 'b' }], - obj: { a: 'b' }, - num: 5.5, - nil: null, - bo: true, - }, - }; - function isOperationDefinition(value) { - return value.kind === 'OperationDefinition'; - } - mutation.definitions.map(function (def) { - if (isOperationDefinition(def)) { - expect(writer - .writeSelectionSetToStore({ - dataId: '5', - selectionSet: def.selectionSet, - result: lodash_1.cloneDeep(result), - context: { - store: objectCache_1.defaultNormalizedCacheFactory(), - variables: variables, - dataIdFromObject: function () { return '5'; }, - }, - }) - .toObject()).toEqual({ - '5': { - id: 'id', - 'some_mutation({"input":{"arr":[1,{"a":"b"}],"bo":true,"id":"5","nil":null,"num":5.5,"obj":{"a":"b"}}})': { - generated: false, - id: '5', - type: 'id', - }, - 'some_mutation_with_variables({"input":{"arr":[1,{"a":"b"}],"bo":true,"id":"5","nil":null,"num":5.5,"obj":{"a":"b"}}})': { - generated: false, - id: '5', - type: 'id', - }, - }, - }); - } - else { - throw 'No operation definition found'; - } - }); - }); - it('should write to store if `dataIdFromObject` returns an ID of 0', function () { - var query = graphql_tag_1.default(templateObject_30 || (templateObject_30 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "]))); - var data = { - author: { - id: 0, - __typename: 'Author', - firstName: 'John', - }, - }; - var expStore = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: { - author: { - id: 0, - typename: 'Author', - type: 'id', - generated: false, - }, - }, - 0: { - id: data.author.id, - __typename: data.author.__typename, - firstName: data.author.firstName, - }, - }); - expect(writer - .writeQueryToStore({ - result: data, - query: query, - dataIdFromObject: function () { return 0; }, - }) - .toObject()).toEqual(expStore.toObject()); - }); - describe('type escaping', function () { - var dataIdFromObject = function (object) { - if (object.__typename && object.id) { - return object.__typename + '__' + object.id; - } - return undefined; - }; - it('should correctly escape generated ids', function () { - var query = graphql_tag_1.default(templateObject_31 || (templateObject_31 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n lastName\n }\n }\n "], ["\n query {\n author {\n firstName\n lastName\n }\n }\n "]))); - var data = { - author: { - firstName: 'John', - lastName: 'Smith', - }, - }; - var expStore = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: { - author: { - type: 'id', - id: '$ROOT_QUERY.author', - generated: true, - }, - }, - '$ROOT_QUERY.author': data.author, - }); - expect(writer - .writeQueryToStore({ - result: data, - query: query, - }) - .toObject()).toEqual(expStore.toObject()); - }); - it('should correctly escape real ids', function () { - var _a; - var query = graphql_tag_1.default(templateObject_32 || (templateObject_32 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "]))); - var data = { - author: { - firstName: 'John', - id: '129', - __typename: 'Author', - }, - }; - var expStore = objectCache_1.defaultNormalizedCacheFactory((_a = { - ROOT_QUERY: { - author: { - type: 'id', - id: dataIdFromObject(data.author), - generated: false, - typename: 'Author', - }, - } - }, - _a[dataIdFromObject(data.author)] = { - firstName: data.author.firstName, - id: data.author.id, - __typename: data.author.__typename, - }, - _a)); - expect(writer - .writeQueryToStore({ - result: data, - query: query, - dataIdFromObject: dataIdFromObject, - }) - .toObject()).toEqual(expStore.toObject()); - }); - it('should correctly escape json blobs', function () { - var _a; - var query = graphql_tag_1.default(templateObject_33 || (templateObject_33 = tslib_1.__makeTemplateObject(["\n query {\n author {\n info\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n info\n id\n __typename\n }\n }\n "]))); - var data = { - author: { - info: { - name: 'John', - }, - id: '129', - __typename: 'Author', - }, - }; - var expStore = objectCache_1.defaultNormalizedCacheFactory((_a = { - ROOT_QUERY: { - author: { - type: 'id', - id: dataIdFromObject(data.author), - generated: false, - typename: 'Author', - }, - } - }, - _a[dataIdFromObject(data.author)] = { - __typename: data.author.__typename, - id: data.author.id, - info: { - type: 'json', - json: data.author.info, - }, - }, - _a)); - expect(writer - .writeQueryToStore({ - result: data, - query: query, - dataIdFromObject: dataIdFromObject, - }) - .toObject()).toEqual(expStore.toObject()); - }); - }); - it('should merge objects when overwriting a generated id with a real id', function () { - var dataWithoutId = { - author: { - firstName: 'John', - lastName: 'Smith', - __typename: 'Author', - }, - }; - var dataWithId = { - author: { - firstName: 'John', - id: '129', - __typename: 'Author', - }, - }; - var dataIdFromObject = function (object) { - if (object.__typename && object.id) { - return object.__typename + '__' + object.id; - } - return undefined; - }; - var queryWithoutId = graphql_tag_1.default(templateObject_34 || (templateObject_34 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n lastName\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n lastName\n __typename\n }\n }\n "]))); - var queryWithId = graphql_tag_1.default(templateObject_35 || (templateObject_35 = tslib_1.__makeTemplateObject(["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "], ["\n query {\n author {\n firstName\n id\n __typename\n }\n }\n "]))); - var expStoreWithoutId = objectCache_1.defaultNormalizedCacheFactory({ - '$ROOT_QUERY.author': { - firstName: 'John', - lastName: 'Smith', - __typename: 'Author', - }, - ROOT_QUERY: { - author: { - type: 'id', - id: '$ROOT_QUERY.author', - generated: true, - typename: 'Author', - }, - }, - }); - var expStoreWithId = objectCache_1.defaultNormalizedCacheFactory({ - Author__129: { - firstName: 'John', - lastName: 'Smith', - id: '129', - __typename: 'Author', - }, - ROOT_QUERY: { - author: { - type: 'id', - id: 'Author__129', - generated: false, - typename: 'Author', - }, - }, - }); - var storeWithoutId = writer.writeQueryToStore({ - result: dataWithoutId, - query: queryWithoutId, - dataIdFromObject: dataIdFromObject, - }); - expect(storeWithoutId.toObject()).toEqual(expStoreWithoutId.toObject()); - var storeWithId = writer.writeQueryToStore({ - result: dataWithId, - query: queryWithId, - store: storeWithoutId, - dataIdFromObject: dataIdFromObject, - }); - expect(storeWithId.toObject()).toEqual(expStoreWithId.toObject()); - }); - it('should allow a union of objects of a different type, when overwriting a generated id with a real id', function () { - var dataWithPlaceholder = { - author: { - hello: 'Foo', - __typename: 'Placeholder', - }, - }; - var dataWithAuthor = { - author: { - firstName: 'John', - lastName: 'Smith', - id: '129', - __typename: 'Author', - }, - }; - var dataIdFromObject = function (object) { - if (object.__typename && object.id) { - return object.__typename + '__' + object.id; - } - return undefined; - }; - var query = graphql_tag_1.default(templateObject_36 || (templateObject_36 = tslib_1.__makeTemplateObject(["\n query {\n author {\n ... on Author {\n firstName\n lastName\n id\n __typename\n }\n ... on Placeholder {\n hello\n __typename\n }\n }\n }\n "], ["\n query {\n author {\n ... on Author {\n firstName\n lastName\n id\n __typename\n }\n ... on Placeholder {\n hello\n __typename\n }\n }\n }\n "]))); - var expStoreWithPlaceholder = objectCache_1.defaultNormalizedCacheFactory({ - '$ROOT_QUERY.author': { - hello: 'Foo', - __typename: 'Placeholder', - }, - ROOT_QUERY: { - author: { - type: 'id', - id: '$ROOT_QUERY.author', - generated: true, - typename: 'Placeholder', - }, - }, - }); - var expStoreWithAuthor = objectCache_1.defaultNormalizedCacheFactory({ - Author__129: { - firstName: 'John', - lastName: 'Smith', - id: '129', - __typename: 'Author', - }, - ROOT_QUERY: { - author: { - type: 'id', - id: 'Author__129', - generated: false, - typename: 'Author', - }, - }, - }); - var store = writer.writeQueryToStore({ - result: dataWithPlaceholder, - query: query, - dataIdFromObject: dataIdFromObject, - }); - expect(store.toObject()).toEqual(expStoreWithPlaceholder.toObject()); - writer.writeQueryToStore({ - result: dataWithAuthor, - query: query, - store: store, - dataIdFromObject: dataIdFromObject, - }); - expect(store.toObject()).toEqual(expStoreWithAuthor.toObject()); - writer.writeQueryToStore({ - result: dataWithPlaceholder, - query: query, - store: store, - dataIdFromObject: dataIdFromObject, - }); - expect(store.toObject()).toEqual(tslib_1.__assign(tslib_1.__assign({}, expStoreWithAuthor.toObject()), expStoreWithPlaceholder.toObject())); - }); - it('does not swallow errors other than field errors', function () { - var query = graphql_tag_1.default(templateObject_37 || (templateObject_37 = tslib_1.__makeTemplateObject(["\n query {\n ...notARealFragment\n fortuneCookie\n }\n "], ["\n query {\n ...notARealFragment\n fortuneCookie\n }\n "]))); - var result = { - fortuneCookie: 'Star Wars unit tests are boring', - }; - expect(function () { - writer.writeQueryToStore({ - result: result, - query: query, - }); - }).toThrowError(/No fragment/); - }); - it('does not change object references if the value is the same', function () { - var query = graphql_tag_1.default(templateObject_38 || (templateObject_38 = tslib_1.__makeTemplateObject(["\n {\n id\n stringField\n numberField\n nullField\n }\n "], ["\n {\n id\n stringField\n numberField\n nullField\n }\n "]))); - var result = { - id: 'abcd', - stringField: 'This is a string!', - numberField: 5, - nullField: null, - }; - var store = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - }); - var newStore = writer.writeQueryToStore({ - query: query, - result: lodash_1.cloneDeep(result), - store: objectCache_1.defaultNormalizedCacheFactory(store.toObject()), - }); - Object.keys(store.toObject()).forEach(function (field) { - expect(store.get(field)).toEqual(newStore.get(field)); - }); - }); - describe('writeResultToStore shape checking', function () { - var query = graphql_tag_1.default(templateObject_39 || (templateObject_39 = tslib_1.__makeTemplateObject(["\n query {\n todos {\n id\n name\n description\n }\n }\n "], ["\n query {\n todos {\n id\n name\n description\n }\n }\n "]))); - it('should write the result data without validating its shape when a fragment matcher is not provided', function () { - var result = { - todos: [ - { - id: '1', - name: 'Todo 1', - }, - ], - }; - var newStore = writer.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: query, - dataIdFromObject: getIdField, - }); - expect(newStore.get('1')).toEqual(result.todos[0]); - }); - it('should warn when it receives the wrong data with non-union fragments (using an heuristic matcher)', function () { - var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; - var result = { - todos: [ - { - id: '1', - name: 'Todo 1', - }, - ], - }; - return withWarning(function () { - var newStore = writer.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: query, - dataIdFromObject: getIdField, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - expect(newStore.get('1')).toEqual(result.todos[0]); - }, /Missing field description/); - }); - it('should warn when it receives the wrong data inside a fragment (using an introspection matcher)', function () { - var fragmentMatcherFunction = new __1.IntrospectionFragmentMatcher({ - introspectionQueryResultData: { - __schema: { - types: [ - { - kind: 'UNION', - name: 'Todo', - possibleTypes: [ - { name: 'ShoppingCartItem' }, - { name: 'TaskItem' }, - ], - }, - ], - }, - }, - }).match; - var queryWithInterface = graphql_tag_1.default(templateObject_40 || (templateObject_40 = tslib_1.__makeTemplateObject(["\n query {\n todos {\n id\n name\n description\n ...TodoFragment\n }\n }\n\n fragment TodoFragment on Todo {\n ... on ShoppingCartItem {\n price\n __typename\n }\n ... on TaskItem {\n date\n __typename\n }\n __typename\n }\n "], ["\n query {\n todos {\n id\n name\n description\n ...TodoFragment\n }\n }\n\n fragment TodoFragment on Todo {\n ... on ShoppingCartItem {\n price\n __typename\n }\n ... on TaskItem {\n date\n __typename\n }\n __typename\n }\n "]))); - var result = { - todos: [ - { - id: '1', - name: 'Todo 1', - description: 'Description 1', - __typename: 'ShoppingCartItem', - }, - ], - }; - return withWarning(function () { - var newStore = writer.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: queryWithInterface, - dataIdFromObject: getIdField, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - expect(newStore.get('1')).toEqual(result.todos[0]); - }, /Missing field price/); - }); - it('should warn if a result is missing __typename when required (using an heuristic matcher)', function () { - var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; - var result = { - todos: [ - { - id: '1', - name: 'Todo 1', - description: 'Description 1', - }, - ], - }; - return withWarning(function () { - var newStore = writer.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: apollo_utilities_1.addTypenameToDocument(query), - dataIdFromObject: getIdField, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - expect(newStore.get('1')).toEqual(result.todos[0]); - }, /Missing field __typename/); - }); - it('should not warn if a field is null', function () { - var result = { - todos: null, - }; - var newStore = writer.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: query, - dataIdFromObject: getIdField, - }); - expect(newStore.get('ROOT_QUERY')).toEqual({ todos: null }); - }); - it('should not warn if a field is defered', function () { - var originalWarn = console.warn; - console.warn = jest.fn(function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - }); - var defered = graphql_tag_1.default(templateObject_41 || (templateObject_41 = tslib_1.__makeTemplateObject(["\n query LazyLoad {\n id\n expensive @defer\n }\n "], ["\n query LazyLoad {\n id\n expensive @defer\n }\n "]))); - var result = { - id: 1, - }; - var fragmentMatcherFunction = new __1.HeuristicFragmentMatcher().match; - var newStore = writer.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: defered, - dataIdFromObject: getIdField, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - expect(newStore.get('ROOT_QUERY')).toEqual({ id: 1 }); - expect(console.warn).not.toBeCalled(); - console.warn = originalWarn; - }); - }); - it('throws when trying to write an object without id that was previously queried with id', function () { - var store = objectCache_1.defaultNormalizedCacheFactory({ - ROOT_QUERY: lodash_1.assign({}, { - __typename: 'Query', - item: { - type: 'id', - id: 'abcd', - generated: false, - }, - }), - abcd: lodash_1.assign({}, { - id: 'abcd', - __typename: 'Item', - stringField: 'This is a string!', - }), - }); - expect(function () { - writer.writeQueryToStore({ - store: store, - result: { - item: { - __typename: 'Item', - stringField: 'This is still a string!', - }, - }, - query: graphql_tag_1.default(templateObject_42 || (templateObject_42 = tslib_1.__makeTemplateObject(["\n query Failure {\n item {\n stringField\n }\n }\n "], ["\n query Failure {\n item {\n stringField\n }\n }\n "]))), - dataIdFromObject: getIdField, - }); - }).toThrowErrorMatchingSnapshot(); - expect(function () { - writer.writeResultToStore({ - store: store, - result: { - item: { - __typename: 'Item', - stringField: 'This is still a string!', - }, - }, - dataId: 'ROOT_QUERY', - document: graphql_tag_1.default(templateObject_43 || (templateObject_43 = tslib_1.__makeTemplateObject(["\n query {\n item {\n stringField\n }\n }\n "], ["\n query {\n item {\n stringField\n }\n }\n "]))), - dataIdFromObject: getIdField, - }); - }).toThrowError(/stringField(.|\n)*abcd/g); - }); - it('properly handles the connection directive', function () { - var store = objectCache_1.defaultNormalizedCacheFactory(); - writer.writeQueryToStore({ - query: graphql_tag_1.default(templateObject_44 || (templateObject_44 = tslib_1.__makeTemplateObject(["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "], ["\n {\n books(skip: 0, limit: 2) @connection(key: \"abc\") {\n name\n }\n }\n "]))), - result: { - books: [ - { - name: 'abcd', - }, - ], - }, - store: store, - }); - writer.writeQueryToStore({ - query: graphql_tag_1.default(templateObject_45 || (templateObject_45 = tslib_1.__makeTemplateObject(["\n {\n books(skip: 2, limit: 4) @connection(key: \"abc\") {\n name\n }\n }\n "], ["\n {\n books(skip: 2, limit: 4) @connection(key: \"abc\") {\n name\n }\n }\n "]))), - result: { - books: [ - { - name: 'efgh', - }, - ], - }, - store: store, - }); - expect(store.toObject()).toEqual({ - ROOT_QUERY: { - abc: [ - { - generated: true, - id: 'ROOT_QUERY.abc.0', - type: 'id', - }, - ], - }, - 'ROOT_QUERY.abc.0': { - name: 'efgh', - }, - }); - }); - it('should keep reference when type of mixed inlined field changes', function () { - var store = objectCache_1.defaultNormalizedCacheFactory(); - var query = graphql_tag_1.default(templateObject_46 || (templateObject_46 = tslib_1.__makeTemplateObject(["\n query {\n animals {\n species {\n name\n }\n }\n }\n "], ["\n query {\n animals {\n species {\n name\n }\n }\n }\n "]))); - writer.writeQueryToStore({ - query: query, - result: { - animals: [ - { - __typename: 'Animal', - species: { - __typename: 'Cat', - name: 'cat', - }, - }, - ], - }, - store: store, - }); - expect(store.toObject()).toEqual({ - '$ROOT_QUERY.animals.0.species': { name: 'cat' }, - ROOT_QUERY: { - animals: [ - { - generated: true, - id: 'ROOT_QUERY.animals.0', - type: 'id', - typename: 'Animal', - }, - ], - }, - 'ROOT_QUERY.animals.0': { - species: { - generated: true, - id: '$ROOT_QUERY.animals.0.species', - type: 'id', - typename: 'Cat', - }, - }, - }); - writer.writeQueryToStore({ - query: query, - result: { - animals: [ - { - __typename: 'Animal', - species: { - __typename: 'Dog', - name: 'dog', - }, - }, - ], - }, - store: store, - }); - expect(store.toObject()).toEqual({ - '$ROOT_QUERY.animals.0.species': { name: 'dog' }, - ROOT_QUERY: { - animals: [ - { - generated: true, - id: 'ROOT_QUERY.animals.0', - type: 'id', - typename: 'Animal', - }, - ], - }, - 'ROOT_QUERY.animals.0': { - species: { - generated: true, - id: '$ROOT_QUERY.animals.0.species', - type: 'id', - typename: 'Dog', - }, - }, - }); - }); - it('should not keep reference when type of mixed inlined field changes to non-inlined field', function () { - var store = objectCache_1.defaultNormalizedCacheFactory(); - var dataIdFromObject = function (object) { - if (object.__typename && object.id) { - return object.__typename + '__' + object.id; - } - return undefined; - }; - var query = graphql_tag_1.default(templateObject_47 || (templateObject_47 = tslib_1.__makeTemplateObject(["\n query {\n animals {\n species {\n id\n name\n }\n }\n }\n "], ["\n query {\n animals {\n species {\n id\n name\n }\n }\n }\n "]))); - writer.writeQueryToStore({ - query: query, - result: { - animals: [ - { - __typename: 'Animal', - species: { - __typename: 'Cat', - name: 'cat', - }, - }, - ], - }, - dataIdFromObject: dataIdFromObject, - store: store, - }); - expect(store.toObject()).toEqual({ - '$ROOT_QUERY.animals.0.species': { name: 'cat' }, - ROOT_QUERY: { - animals: [ - { - generated: true, - id: 'ROOT_QUERY.animals.0', - type: 'id', - typename: 'Animal', - }, - ], - }, - 'ROOT_QUERY.animals.0': { - species: { - generated: true, - id: '$ROOT_QUERY.animals.0.species', - type: 'id', - typename: 'Cat', - }, - }, - }); - writer.writeQueryToStore({ - query: query, - result: { - animals: [ - { - __typename: 'Animal', - species: { - id: 'dog-species', - __typename: 'Dog', - name: 'dog', - }, - }, - ], - }, - dataIdFromObject: dataIdFromObject, - store: store, - }); - expect(store.toObject()).toEqual({ - '$ROOT_QUERY.animals.0.species': undefined, - 'Dog__dog-species': { - id: 'dog-species', - name: 'dog', - }, - ROOT_QUERY: { - animals: [ - { - generated: true, - id: 'ROOT_QUERY.animals.0', - type: 'id', - typename: 'Animal', - }, - ], - }, - 'ROOT_QUERY.animals.0': { - species: { - generated: false, - id: 'Dog__dog-species', - type: 'id', - typename: 'Dog', - }, - }, - }); - }); -}); -var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47; -//# sourceMappingURL=writeToStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map b/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map deleted file mode 100644 index ceefa3d..0000000 --- a/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"writeToStore.js","sourceRoot":"","sources":["../../src/__tests__/writeToStore.ts"],"names":[],"mappings":";;;AAAA,iCAAiD;AAUjD,oEAA8B;AAC9B,qDAI0B;AAE1B,gDAA8C;AAE9C,8CAA+D;AAE/D,yBAIa;AAEb,SAAgB,WAAW,CAAC,IAAc,EAAE,KAAa;IACvD,IAAI,OAAO,GAAW,IAAa,CAAC;IACpC,IAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAE7B,OAAO,CAAC,IAAI,GAAG,UAAC,CAAS,IAAK,OAAA,CAAC,OAAO,GAAG,CAAC,CAAC,EAAb,CAAa,CAAC;IAE5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;QACrC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,CAAC,IAAI,GAAG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I;oBACV,QAAQ,EAAE,KAAK;iBAChB;aACF;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,iBAAiB,CAAC;YACvB,KAAK,OAAA;YACL,MAAM,EAAE;gBACN,OAAO,EAAE;oBACP;wBACE,UAAU,EAAE,QAAQ;wBACpB,OAAO,EAAE;4BACP,EAAE,EAAE,aAAa;4BACjB,UAAU,EAAE,KAAK;4BACjB,IAAI,EAAE,KAAK;yBACZ;qBACF;iBACF;aACF;YACD,gBAAgB,kBAAA;YAChB,KAAK,OAAA;SACN,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC;YAC/B,+BAA+B,EAAE,SAAS;YAC1C,kBAAkB,EAAE;gBAClB,EAAE,EAAE,aAAa;gBACjB,IAAI,EAAE,KAAK;aACZ;YACD,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP;wBACE,SAAS,EAAE,IAAI;wBACf,EAAE,EAAE,sBAAsB;wBAC1B,IAAI,EAAE,IAAI;wBACV,QAAQ,EAAE,QAAQ;qBACnB;iBACF;aACF;YACD,sBAAsB,EAAE;gBACtB,OAAO,EAAE;oBACP,SAAS,EAAE,KAAK;oBAChB,EAAE,EAAE,kBAAkB;oBACtB,IAAI,EAAE,IAAI;oBACV,QAAQ,EAAE,KAAK;iBAChB;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js deleted file mode 100644 index 425a221..0000000 --- a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js +++ /dev/null @@ -1,1280 +0,0 @@ -exports.__esModule = true; -exports.assertIdValue = assertIdValue; -exports.defaultDataIdFromObject = defaultDataIdFromObject; -exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory$1; -exports.enhanceErrorWithDocument = enhanceErrorWithDocument; -exports.WriteError = exports.StoreWriter = exports.StoreReader = exports.ObjectCache = exports.IntrospectionFragmentMatcher = exports.InMemoryCache = exports.HeuristicFragmentMatcher = void 0; - -var _tslib = require("tslib"); - -var _apolloCache = require("apollo-cache"); - -var _apolloUtilities = require("apollo-utilities"); - -var _optimism = require("optimism"); - -var _tsInvariant = require("ts-invariant"); - -var haveWarned = false; - -function shouldWarn() { - var answer = !haveWarned; - - if (!(0, _apolloUtilities.isTest)()) { - haveWarned = true; - } - - return answer; -} - -var HeuristicFragmentMatcher = function () { - function HeuristicFragmentMatcher() {} - - HeuristicFragmentMatcher.prototype.ensureReady = function () { - return Promise.resolve(); - }; - - HeuristicFragmentMatcher.prototype.canBypassInit = function () { - return true; - }; - - HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - - if (!obj) { - return isRootQuery; - } - - var _a = obj.__typename, - __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - - if (!__typename) { - if (shouldWarn()) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); - } - - return 'heuristic'; - } - - if (__typename === typeCondition) { - return true; - } - - if (shouldWarn()) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + 'queries contain union or interface types. Apollo Client will not be ' + 'able to accurately map fragments. To make this error go away, use ' + 'the `IntrospectionFragmentMatcher` as described in the docs: ' + 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); - } - - return 'heuristic'; - }; - - return HeuristicFragmentMatcher; -}(); - -exports.HeuristicFragmentMatcher = HeuristicFragmentMatcher; - -var IntrospectionFragmentMatcher = function () { - function IntrospectionFragmentMatcher(options) { - if (options && options.introspectionQueryResultData) { - this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); - this.isReady = true; - } else { - this.isReady = false; - } - - this.match = this.match.bind(this); - } - - IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(this.isReady, 1) : (0, _tsInvariant.invariant)(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - - if (!obj) { - return isRootQuery; - } - - var _a = obj.__typename, - __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(__typename, 2) : (0, _tsInvariant.invariant)(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); - - if (__typename === typeCondition) { - return true; - } - - var implementingTypes = this.possibleTypesMap[typeCondition]; - - if (__typename && implementingTypes && implementingTypes.indexOf(__typename) > -1) { - return true; - } - - return false; - }; - - IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { - var typeMap = {}; - - introspectionResultData.__schema.types.forEach(function (type) { - if (type.kind === 'UNION' || type.kind === 'INTERFACE') { - typeMap[type.name] = type.possibleTypes.map(function (implementingType) { - return implementingType.name; - }); - } - }); - - return typeMap; - }; - - return IntrospectionFragmentMatcher; -}(); - -exports.IntrospectionFragmentMatcher = IntrospectionFragmentMatcher; -var hasOwn = Object.prototype.hasOwnProperty; - -var DepTrackingCache = function () { - function DepTrackingCache(data) { - var _this = this; - - if (data === void 0) { - data = Object.create(null); - } - - this.data = data; - this.depend = (0, _optimism.wrap)(function (dataId) { - return _this.data[dataId]; - }, { - disposable: true, - makeCacheKey: function (dataId) { - return dataId; - } - }); - } - - DepTrackingCache.prototype.toObject = function () { - return this.data; - }; - - DepTrackingCache.prototype.get = function (dataId) { - this.depend(dataId); - return this.data[dataId]; - }; - - DepTrackingCache.prototype.set = function (dataId, value) { - var oldValue = this.data[dataId]; - - if (value !== oldValue) { - this.data[dataId] = value; - this.depend.dirty(dataId); - } - }; - - DepTrackingCache.prototype.delete = function (dataId) { - if (hasOwn.call(this.data, dataId)) { - delete this.data[dataId]; - this.depend.dirty(dataId); - } - }; - - DepTrackingCache.prototype.clear = function () { - this.replace(null); - }; - - DepTrackingCache.prototype.replace = function (newData) { - var _this = this; - - if (newData) { - Object.keys(newData).forEach(function (dataId) { - _this.set(dataId, newData[dataId]); - }); - Object.keys(this.data).forEach(function (dataId) { - if (!hasOwn.call(newData, dataId)) { - _this.delete(dataId); - } - }); - } else { - Object.keys(this.data).forEach(function (dataId) { - _this.delete(dataId); - }); - } - }; - - return DepTrackingCache; -}(); - -function defaultNormalizedCacheFactory(seed) { - return new DepTrackingCache(seed); -} - -var StoreReader = function () { - function StoreReader(_a) { - var _this = this; - - var _b = _a === void 0 ? {} : _a, - _c = _b.cacheKeyRoot, - cacheKeyRoot = _c === void 0 ? new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap) : _c, - _d = _b.freezeResults, - freezeResults = _d === void 0 ? false : _d; - - var _e = this, - executeStoreQuery = _e.executeStoreQuery, - executeSelectionSet = _e.executeSelectionSet, - executeSubSelectedArray = _e.executeSubSelectedArray; - - this.freezeResults = freezeResults; - this.executeStoreQuery = (0, _optimism.wrap)(function (options) { - return executeStoreQuery.call(_this, options); - }, { - makeCacheKey: function (_a) { - var query = _a.query, - rootValue = _a.rootValue, - contextValue = _a.contextValue, - variableValues = _a.variableValues, - fragmentMatcher = _a.fragmentMatcher; - - if (contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); - } - } - }); - this.executeSelectionSet = (0, _optimism.wrap)(function (options) { - return executeSelectionSet.call(_this, options); - }, { - makeCacheKey: function (_a) { - var selectionSet = _a.selectionSet, - rootValue = _a.rootValue, - execContext = _a.execContext; - - if (execContext.contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); - } - } - }); - this.executeSubSelectedArray = (0, _optimism.wrap)(function (options) { - return executeSubSelectedArray.call(_this, options); - }, { - makeCacheKey: function (_a) { - var field = _a.field, - array = _a.array, - execContext = _a.execContext; - - if (execContext.contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); - } - } - }); - } - - StoreReader.prototype.readQueryFromStore = function (options) { - return this.diffQueryAgainstStore((0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - returnPartialData: false - })).result; - }; - - StoreReader.prototype.diffQueryAgainstStore = function (_a) { - var store = _a.store, - query = _a.query, - variables = _a.variables, - previousResult = _a.previousResult, - _b = _a.returnPartialData, - returnPartialData = _b === void 0 ? true : _b, - _c = _a.rootId, - rootId = _c === void 0 ? 'ROOT_QUERY' : _c, - fragmentMatcherFunction = _a.fragmentMatcherFunction, - config = _a.config; - var queryDefinition = (0, _apolloUtilities.getQueryDefinition)(query); - variables = (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(queryDefinition), variables); - var context = { - store: store, - dataIdFromObject: config && config.dataIdFromObject, - cacheRedirects: config && config.cacheRedirects || {} - }; - var execResult = this.executeStoreQuery({ - query: query, - rootValue: { - type: 'id', - id: rootId, - generated: true, - typename: 'Query' - }, - contextValue: context, - variableValues: variables, - fragmentMatcher: fragmentMatcherFunction - }); - var hasMissingFields = execResult.missing && execResult.missing.length > 0; - - if (hasMissingFields && !returnPartialData) { - execResult.missing.forEach(function (info) { - if (info.tolerable) return; - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(8) : new _tsInvariant.InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); - }); - } - - if (previousResult) { - if ((0, _apolloUtilities.isEqual)(previousResult, execResult.result)) { - execResult.result = previousResult; - } - } - - return { - result: execResult.result, - complete: !hasMissingFields - }; - }; - - StoreReader.prototype.executeStoreQuery = function (_a) { - var query = _a.query, - rootValue = _a.rootValue, - contextValue = _a.contextValue, - variableValues = _a.variableValues, - _b = _a.fragmentMatcher, - fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; - var mainDefinition = (0, _apolloUtilities.getMainDefinition)(query); - var fragments = (0, _apolloUtilities.getFragmentDefinitions)(query); - var fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); - var execContext = { - query: query, - fragmentMap: fragmentMap, - contextValue: contextValue, - variableValues: variableValues, - fragmentMatcher: fragmentMatcher - }; - return this.executeSelectionSet({ - selectionSet: mainDefinition.selectionSet, - rootValue: rootValue, - execContext: execContext - }); - }; - - StoreReader.prototype.executeSelectionSet = function (_a) { - var _this = this; - - var selectionSet = _a.selectionSet, - rootValue = _a.rootValue, - execContext = _a.execContext; - var fragmentMap = execContext.fragmentMap, - contextValue = execContext.contextValue, - variables = execContext.variableValues; - var finalResult = { - result: null - }; - var objectsToMerge = []; - var object = contextValue.store.get(rootValue.id); - var typename = object && object.__typename || rootValue.id === 'ROOT_QUERY' && 'Query' || void 0; - - function handleMissing(result) { - var _a; - - if (result.missing) { - finalResult.missing = finalResult.missing || []; - - (_a = finalResult.missing).push.apply(_a, result.missing); - } - - return result.result; - } - - selectionSet.selections.forEach(function (selection) { - var _a; - - if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { - return; - } - - if ((0, _apolloUtilities.isField)(selection)) { - var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); - - if (typeof fieldResult !== 'undefined') { - objectsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); - } - } else { - var fragment = void 0; - - if ((0, _apolloUtilities.isInlineFragment)(selection)) { - fragment = selection; - } else { - fragment = fragmentMap[selection.name.value]; - - if (!fragment) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(9) : new _tsInvariant.InvariantError("No fragment named " + selection.name.value); - } - } - - var typeCondition = fragment.typeCondition && fragment.typeCondition.name.value; - var match = !typeCondition || execContext.fragmentMatcher(rootValue, typeCondition, contextValue); - - if (match) { - var fragmentExecResult = _this.executeSelectionSet({ - selectionSet: fragment.selectionSet, - rootValue: rootValue, - execContext: execContext - }); - - if (match === 'heuristic' && fragmentExecResult.missing) { - fragmentExecResult = (0, _tslib.__assign)((0, _tslib.__assign)({}, fragmentExecResult), { - missing: fragmentExecResult.missing.map(function (info) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, info), { - tolerable: true - }); - }) - }); - } - - objectsToMerge.push(handleMissing(fragmentExecResult)); - } - } - }); - finalResult.result = (0, _apolloUtilities.mergeDeepArray)(objectsToMerge); - - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(finalResult.result); - } - - return finalResult; - }; - - StoreReader.prototype.executeField = function (object, typename, field, execContext) { - var variables = execContext.variableValues, - contextValue = execContext.contextValue; - var fieldName = field.name.value; - var args = (0, _apolloUtilities.argumentsObjectFromField)(field, variables); - var info = { - resultKey: (0, _apolloUtilities.resultKeyNameFromField)(field), - directives: (0, _apolloUtilities.getDirectiveInfoFromField)(field, variables) - }; - var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); - - if (Array.isArray(readStoreResult.result)) { - return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ - field: field, - array: readStoreResult.result, - execContext: execContext - })); - } - - if (!field.selectionSet) { - assertSelectionSetForIdValue(field, readStoreResult.result); - - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - (0, _apolloUtilities.maybeDeepFreeze)(readStoreResult); - } - - return readStoreResult; - } - - if (readStoreResult.result == null) { - return readStoreResult; - } - - return this.combineExecResults(readStoreResult, this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: readStoreResult.result, - execContext: execContext - })); - }; - - StoreReader.prototype.combineExecResults = function () { - var execResults = []; - - for (var _i = 0; _i < arguments.length; _i++) { - execResults[_i] = arguments[_i]; - } - - var missing; - execResults.forEach(function (execResult) { - if (execResult.missing) { - missing = missing || []; - missing.push.apply(missing, execResult.missing); - } - }); - return { - result: execResults.pop().result, - missing: missing - }; - }; - - StoreReader.prototype.executeSubSelectedArray = function (_a) { - var _this = this; - - var field = _a.field, - array = _a.array, - execContext = _a.execContext; - var missing; - - function handleMissing(childResult) { - if (childResult.missing) { - missing = missing || []; - missing.push.apply(missing, childResult.missing); - } - - return childResult.result; - } - - array = array.map(function (item) { - if (item === null) { - return null; - } - - if (Array.isArray(item)) { - return handleMissing(_this.executeSubSelectedArray({ - field: field, - array: item, - execContext: execContext - })); - } - - if (field.selectionSet) { - return handleMissing(_this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: item, - execContext: execContext - })); - } - - assertSelectionSetForIdValue(field, item); - return item; - }); - - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(array); - } - - return { - result: array, - missing: missing - }; - }; - - return StoreReader; -}(); - -exports.StoreReader = StoreReader; - -function assertSelectionSetForIdValue(field, value) { - if (!field.selectionSet && (0, _apolloUtilities.isIdValue)(value)) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(10) : new _tsInvariant.InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); - } -} - -function defaultFragmentMatcher() { - return true; -} - -function assertIdValue(idValue) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), 11) : (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); -} - -function readStoreResolver(object, typename, fieldName, args, context, _a) { - var resultKey = _a.resultKey, - directives = _a.directives; - var storeKeyName = fieldName; - - if (args || directives) { - storeKeyName = (0, _apolloUtilities.getStoreKeyName)(storeKeyName, args, directives); - } - - var fieldValue = void 0; - - if (object) { - fieldValue = object[storeKeyName]; - - if (typeof fieldValue === 'undefined' && context.cacheRedirects && typeof typename === 'string') { - var type = context.cacheRedirects[typename]; - - if (type) { - var resolver = type[fieldName]; - - if (resolver) { - fieldValue = resolver(object, args, { - getCacheKey: function (storeObj) { - var id = context.dataIdFromObject(storeObj); - return id && (0, _apolloUtilities.toIdValue)({ - id: id, - typename: storeObj.__typename - }); - } - }); - } - } - } - } - - if (typeof fieldValue === 'undefined') { - return { - result: fieldValue, - missing: [{ - object: object, - fieldName: storeKeyName, - tolerable: false - }] - }; - } - - if ((0, _apolloUtilities.isJsonValue)(fieldValue)) { - fieldValue = fieldValue.json; - } - - return { - result: fieldValue - }; -} - -var ObjectCache = function () { - function ObjectCache(data) { - if (data === void 0) { - data = Object.create(null); - } - - this.data = data; - } - - ObjectCache.prototype.toObject = function () { - return this.data; - }; - - ObjectCache.prototype.get = function (dataId) { - return this.data[dataId]; - }; - - ObjectCache.prototype.set = function (dataId, value) { - this.data[dataId] = value; - }; - - ObjectCache.prototype.delete = function (dataId) { - this.data[dataId] = void 0; - }; - - ObjectCache.prototype.clear = function () { - this.data = Object.create(null); - }; - - ObjectCache.prototype.replace = function (newData) { - this.data = newData || Object.create(null); - }; - - return ObjectCache; -}(); - -exports.ObjectCache = ObjectCache; - -function defaultNormalizedCacheFactory$1(seed) { - return new ObjectCache(seed); -} - -var WriteError = function (_super) { - (0, _tslib.__extends)(WriteError, _super); - - function WriteError() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = 'WriteError'; - return _this; - } - - return WriteError; -}(Error); - -exports.WriteError = WriteError; - -function enhanceErrorWithDocument(error, document) { - var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); - enhancedError.message += '\n' + error.message; - enhancedError.stack = error.stack; - return enhancedError; -} - -var StoreWriter = function () { - function StoreWriter() {} - - StoreWriter.prototype.writeQueryToStore = function (_a) { - var query = _a.query, - result = _a.result, - _b = _a.store, - store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, - variables = _a.variables, - dataIdFromObject = _a.dataIdFromObject, - fragmentMatcherFunction = _a.fragmentMatcherFunction; - return this.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: query, - store: store, - variables: variables, - dataIdFromObject: dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction - }); - }; - - StoreWriter.prototype.writeResultToStore = function (_a) { - var dataId = _a.dataId, - result = _a.result, - document = _a.document, - _b = _a.store, - store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, - variables = _a.variables, - dataIdFromObject = _a.dataIdFromObject, - fragmentMatcherFunction = _a.fragmentMatcherFunction; - var operationDefinition = (0, _apolloUtilities.getOperationDefinition)(document); - - try { - return this.writeSelectionSetToStore({ - result: result, - dataId: dataId, - selectionSet: operationDefinition.selectionSet, - context: { - store: store, - processedData: {}, - variables: (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(operationDefinition), variables), - dataIdFromObject: dataIdFromObject, - fragmentMap: (0, _apolloUtilities.createFragmentMap)((0, _apolloUtilities.getFragmentDefinitions)(document)), - fragmentMatcherFunction: fragmentMatcherFunction - } - }); - } catch (e) { - throw enhanceErrorWithDocument(e, document); - } - }; - - StoreWriter.prototype.writeSelectionSetToStore = function (_a) { - var _this = this; - - var result = _a.result, - dataId = _a.dataId, - selectionSet = _a.selectionSet, - context = _a.context; - var variables = context.variables, - store = context.store, - fragmentMap = context.fragmentMap; - selectionSet.selections.forEach(function (selection) { - var _a; - - if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { - return; - } - - if ((0, _apolloUtilities.isField)(selection)) { - var resultFieldKey = (0, _apolloUtilities.resultKeyNameFromField)(selection); - var value = result[resultFieldKey]; - - if (typeof value !== 'undefined') { - _this.writeFieldToStore({ - dataId: dataId, - value: value, - field: selection, - context: context - }); - } else { - var isDefered = false; - var isClient = false; - - if (selection.directives && selection.directives.length) { - isDefered = selection.directives.some(function (directive) { - return directive.name && directive.name.value === 'defer'; - }); - isClient = selection.directives.some(function (directive) { - return directive.name && directive.name.value === 'client'; - }); - } - - if (!isDefered && !isClient && context.fragmentMatcherFunction) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); - } - } - } else { - var fragment = void 0; - - if ((0, _apolloUtilities.isInlineFragment)(selection)) { - fragment = selection; - } else { - fragment = (fragmentMap || {})[selection.name.value]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 3) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value + "."); - } - - var matches = true; - - if (context.fragmentMatcherFunction && fragment.typeCondition) { - var id = dataId || 'self'; - var idValue = (0, _apolloUtilities.toIdValue)({ - id: id, - typename: undefined - }); - var fakeContext = { - store: new ObjectCache((_a = {}, _a[id] = result, _a)), - cacheRedirects: {} - }; - var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); - - if (!(0, _apolloUtilities.isProduction)() && match === 'heuristic') { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('WARNING: heuristic fragment matching going on!'); - } - - matches = !!match; - } - - if (matches) { - _this.writeSelectionSetToStore({ - result: result, - selectionSet: fragment.selectionSet, - dataId: dataId, - context: context - }); - } - } - }); - return store; - }; - - StoreWriter.prototype.writeFieldToStore = function (_a) { - var _b; - - var field = _a.field, - value = _a.value, - dataId = _a.dataId, - context = _a.context; - var variables = context.variables, - dataIdFromObject = context.dataIdFromObject, - store = context.store; - var storeValue; - var storeObject; - var storeFieldName = (0, _apolloUtilities.storeKeyNameFromField)(field, variables); - - if (!field.selectionSet || value === null) { - storeValue = value != null && typeof value === 'object' ? { - type: 'json', - json: value - } : value; - } else if (Array.isArray(value)) { - var generatedId = dataId + "." + storeFieldName; - storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); - } else { - var valueDataId = dataId + "." + storeFieldName; - var generated = true; - - if (!isGeneratedId(valueDataId)) { - valueDataId = '$' + valueDataId; - } - - if (dataIdFromObject) { - var semanticId = dataIdFromObject(value); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 4) : (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); - - if (semanticId || typeof semanticId === 'number' && semanticId === 0) { - valueDataId = semanticId; - generated = false; - } - } - - if (!isDataProcessed(valueDataId, field, context.processedData)) { - this.writeSelectionSetToStore({ - dataId: valueDataId, - result: value, - selectionSet: field.selectionSet, - context: context - }); - } - - var typename = value.__typename; - storeValue = (0, _apolloUtilities.toIdValue)({ - id: valueDataId, - typename: typename - }, generated); - storeObject = store.get(dataId); - var escapedId = storeObject && storeObject[storeFieldName]; - - if (escapedId !== storeValue && (0, _apolloUtilities.isIdValue)(escapedId)) { - var hadTypename = escapedId.typename !== undefined; - var hasTypename = typename !== undefined; - var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, 5) : (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!hadTypename || hasTypename, 6) : (0, _tsInvariant.invariant)(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - - if (escapedId.generated) { - if (typenameChanged) { - if (!generated) { - store.delete(escapedId.id); - } - } else { - mergeWithGenerated(escapedId.id, storeValue.id, store); - } - } - } - } - - storeObject = store.get(dataId); - - if (!storeObject || !(0, _apolloUtilities.isEqual)(storeValue, storeObject[storeFieldName])) { - store.set(dataId, (0, _tslib.__assign)((0, _tslib.__assign)({}, storeObject), (_b = {}, _b[storeFieldName] = storeValue, _b))); - } - }; - - StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { - var _this = this; - - return value.map(function (item, index) { - if (item === null) { - return null; - } - - var itemDataId = generatedId + "." + index; - - if (Array.isArray(item)) { - return _this.processArrayValue(item, itemDataId, selectionSet, context); - } - - var generated = true; - - if (context.dataIdFromObject) { - var semanticId = context.dataIdFromObject(item); - - if (semanticId) { - itemDataId = semanticId; - generated = false; - } - } - - if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { - _this.writeSelectionSetToStore({ - dataId: itemDataId, - result: item, - selectionSet: selectionSet, - context: context - }); - } - - return (0, _apolloUtilities.toIdValue)({ - id: itemDataId, - typename: item.__typename - }, generated); - }); - }; - - return StoreWriter; -}(); - -exports.StoreWriter = StoreWriter; - -function isGeneratedId(id) { - return id[0] === '$'; -} - -function mergeWithGenerated(generatedKey, realKey, cache) { - if (generatedKey === realKey) { - return false; - } - - var generated = cache.get(generatedKey); - var real = cache.get(realKey); - var madeChanges = false; - Object.keys(generated).forEach(function (key) { - var value = generated[key]; - var realValue = real[key]; - - if ((0, _apolloUtilities.isIdValue)(value) && isGeneratedId(value.id) && (0, _apolloUtilities.isIdValue)(realValue) && !(0, _apolloUtilities.isEqual)(value, realValue) && mergeWithGenerated(value.id, realValue.id, cache)) { - madeChanges = true; - } - }); - cache.delete(generatedKey); - var newRealValue = (0, _tslib.__assign)((0, _tslib.__assign)({}, generated), real); - - if ((0, _apolloUtilities.isEqual)(newRealValue, real)) { - return madeChanges; - } - - cache.set(realKey, newRealValue); - return true; -} - -function isDataProcessed(dataId, field, processedData) { - if (!processedData) { - return false; - } - - if (processedData[dataId]) { - if (processedData[dataId].indexOf(field) >= 0) { - return true; - } else { - processedData[dataId].push(field); - } - } else { - processedData[dataId] = [field]; - } - - return false; -} - -var defaultConfig = { - fragmentMatcher: new HeuristicFragmentMatcher(), - dataIdFromObject: defaultDataIdFromObject, - addTypename: true, - resultCaching: true, - freezeResults: false -}; - -function defaultDataIdFromObject(result) { - if (result.__typename) { - if (result.id !== undefined) { - return result.__typename + ":" + result.id; - } - - if (result._id !== undefined) { - return result.__typename + ":" + result._id; - } - } - - return null; -} - -var hasOwn$1 = Object.prototype.hasOwnProperty; - -var OptimisticCacheLayer = function (_super) { - (0, _tslib.__extends)(OptimisticCacheLayer, _super); - - function OptimisticCacheLayer(optimisticId, parent, transaction) { - var _this = _super.call(this, Object.create(null)) || this; - - _this.optimisticId = optimisticId; - _this.parent = parent; - _this.transaction = transaction; - return _this; - } - - OptimisticCacheLayer.prototype.toObject = function () { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, this.parent.toObject()), this.data); - }; - - OptimisticCacheLayer.prototype.get = function (dataId) { - return hasOwn$1.call(this.data, dataId) ? this.data[dataId] : this.parent.get(dataId); - }; - - return OptimisticCacheLayer; -}(ObjectCache); - -var InMemoryCache = function (_super) { - (0, _tslib.__extends)(InMemoryCache, _super); - - function InMemoryCache(config) { - if (config === void 0) { - config = {}; - } - - var _this = _super.call(this) || this; - - _this.watches = new Set(); - _this.typenameDocumentCache = new Map(); - _this.cacheKeyRoot = new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap); - _this.silenceBroadcast = false; - _this.config = (0, _tslib.__assign)((0, _tslib.__assign)({}, defaultConfig), config); - - if (_this.config.customResolvers) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.customResolvers; - } - - if (_this.config.cacheResolvers) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.cacheResolvers; - } - - _this.addTypename = !!_this.config.addTypename; - _this.data = _this.config.resultCaching ? new DepTrackingCache() : new ObjectCache(); - _this.optimisticData = _this.data; - _this.storeWriter = new StoreWriter(); - _this.storeReader = new StoreReader({ - cacheKeyRoot: _this.cacheKeyRoot, - freezeResults: config.freezeResults - }); - var cache = _this; - var maybeBroadcastWatch = cache.maybeBroadcastWatch; - _this.maybeBroadcastWatch = (0, _optimism.wrap)(function (c) { - return maybeBroadcastWatch.call(_this, c); - }, { - makeCacheKey: function (c) { - if (c.optimistic) { - return; - } - - if (c.previousResult) { - return; - } - - if (cache.data instanceof DepTrackingCache) { - return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); - } - } - }); - return _this; - } - - InMemoryCache.prototype.restore = function (data) { - if (data) this.data.replace(data); - return this; - }; - - InMemoryCache.prototype.extract = function (optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return (optimistic ? this.optimisticData : this.data).toObject(); - }; - - InMemoryCache.prototype.read = function (options) { - if (typeof options.rootId === 'string' && typeof this.data.get(options.rootId) === 'undefined') { - return null; - } - - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config - }) || null; - }; - - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - this.storeWriter.writeResultToStore({ - dataId: write.dataId, - result: write.result, - variables: write.variables, - document: this.transformDocument(write.query), - store: this.data, - dataIdFromObject: this.config.dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction - }); - this.broadcastWatches(); - }; - - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.diffQueryAgainstStore({ - store: query.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(query.query), - variables: query.variables, - returnPartialData: query.returnPartialData, - previousResult: query.previousResult, - fragmentMatcherFunction: fragmentMatcherFunction, - config: this.config - }); - }; - - InMemoryCache.prototype.watch = function (watch) { - var _this = this; - - this.watches.add(watch); - return function () { - _this.watches.delete(watch); - }; - }; - - InMemoryCache.prototype.evict = function (query) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(7) : new _tsInvariant.InvariantError("eviction is not implemented on InMemory Cache"); - }; - - InMemoryCache.prototype.reset = function () { - this.data.clear(); - this.broadcastWatches(); - return Promise.resolve(); - }; - - InMemoryCache.prototype.removeOptimistic = function (idToRemove) { - var toReapply = []; - var removedCount = 0; - var layer = this.optimisticData; - - while (layer instanceof OptimisticCacheLayer) { - if (layer.optimisticId === idToRemove) { - ++removedCount; - } else { - toReapply.push(layer); - } - - layer = layer.parent; - } - - if (removedCount > 0) { - this.optimisticData = layer; - - while (toReapply.length > 0) { - var layer_1 = toReapply.pop(); - this.performTransaction(layer_1.transaction, layer_1.optimisticId); - } - - this.broadcastWatches(); - } - }; - - InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { - var _a = this, - data = _a.data, - silenceBroadcast = _a.silenceBroadcast; - - this.silenceBroadcast = true; - - if (typeof optimisticId === 'string') { - this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); - } - - try { - transaction(this); - } finally { - this.silenceBroadcast = silenceBroadcast; - this.data = data; - } - - this.broadcastWatches(); - }; - - InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { - return this.performTransaction(transaction, id); - }; - - InMemoryCache.prototype.transformDocument = function (document) { - if (this.addTypename) { - var result = this.typenameDocumentCache.get(document); - - if (!result) { - result = (0, _apolloUtilities.addTypenameToDocument)(document); - this.typenameDocumentCache.set(document, result); - this.typenameDocumentCache.set(result, result); - } - - return result; - } - - return document; - }; - - InMemoryCache.prototype.broadcastWatches = function () { - var _this = this; - - if (!this.silenceBroadcast) { - this.watches.forEach(function (c) { - return _this.maybeBroadcastWatch(c); - }); - } - }; - - InMemoryCache.prototype.maybeBroadcastWatch = function (c) { - c.callback(this.diff({ - query: c.query, - variables: c.variables, - previousResult: c.previousResult && c.previousResult(), - optimistic: c.optimistic - })); - }; - - return InMemoryCache; -}(_apolloCache.ApolloCache); - - -exports.InMemoryCache = InMemoryCache; diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map deleted file mode 100644 index 9cd94a3..0000000 --- a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"names":["defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,IAAI,UAAU,GAAG,KAAjB;;AAEA,SAAS,UAAT,GAAmB;AACjB,MAAM,MAAM,GAAG,CAAC,UAAhB;;AAEA,MAAI,CAAC,8BAAL,EAAe;AACb,IAAA,UAAU,GAAG,IAAb;AACD;;AACD,SAAO,MAAP;AACD;;AAKD,IAAA,wBAAA,GAAA,YAAA;AACE,WAAA,wBAAA,GAAA,CAEC;;AAEM,EAAA,wBAAA,CAAA,SAAA,CAAA,WAAA,GAAP,YAAA;AACE,WAAO,OAAO,CAAC,OAAR,EAAP;AACD,GAFM;;AAIA,EAAA,wBAAA,CAAA,SAAA,CAAA,aAAA,GAAP,YAAA;AACE,WAAO,IAAP;AACD,GAFM;;AAIA,EAAA,wBAAA,CAAA,SAAA,CAAA,KAAA,GAAP,UACE,OADF,EAEE,aAFF,EAGE,OAHF,EAG2B;AAEzB,QAAM,GAAG,GAAG,OAAO,CAAC,KAAR,CAA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uC,MAAvC;AACD;;AACD,aAAO,MAAP;AACD;;AACD,WAAO,QAAP;AACD,GAdM;;AAgBG,EAAA,aAAA,CAAA,SAAA,CAAA,gBAAA,GAAV,YAAA;AAAA,QAAA,KAAA,GAAA,IAAA;;AACE,QAAI,CAAC,KAAK,gBAAV,EAA4B;AAC1B,WAAK,OAAL,CAAa,OAAb,CAAqB,UAAA,CAAA,EAAC;AAAI,eAAA,KAAI,CAAC,mBAAL,CAAyB,CAAzB,CAAA;AAA2B,OAArD;AACD;AACF,GAJS;;AAQF,EAAA,aAAA,CAAA,SAAA,CAAA,mBAAA,GAAR,UAA4B,CAA5B,EAAiD;AAC/C,IAAA,CAAC,CAAC,QAAF,CACE,KAAK,IAAL,CAAU;AACR,MAAA,KAAK,EAAE,CAAC,CAAC,KADD;AAER,MAAA,SAAS,EAAE,CAAC,CAAC,SAFL;AAGR,MAAA,cAAc,EAAE,CAAC,CAAC,cAAF,IAAoB,CAAC,CAAC,cAAF,EAH5B;AAIR,MAAA,UAAU,EAAE,CAAC,CAAC;AAJN,KAAV,CADF;AAQD,GATO;;AAUV,SAAA,aAAA;AAjRA,C,CAAmC,wB","sourcesContent":["import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/3507\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n if (!__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (__typename === typeCondition) {\n return true;\n }\n\n // At this point we don't know if this fragment should match or not. It's\n // either:\n //\n // 1. (GOOD) A fragment on a matching interface or union.\n // 2. (BAD) A fragment on a non-matching concrete type or interface or union.\n //\n // If it's 2, we don't want it to match. If it's 1, we want it to match. We\n // can't tell the difference, so we warn the user, but still try to match\n // it (for backwards compatibility reasons). This unfortunately means that\n // using the `HeuristicFragmentMatcher` with unions and interfaces is\n // very unreliable. This will be addressed in a future major version of\n // Apollo Client, but for now the recommendation is to use the\n // `IntrospectionFragmentMatcher` when working with unions/interfaces.\n\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (\n __typename &&\n implementingTypes &&\n implementingTypes.indexOf(__typename) > -1\n ) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<[string], StoreObject | undefined>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((dataId: string) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n },\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId]!;\n }\n\n public set(dataId: string, value?: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject | null): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (!hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n argumentsObjectFromField,\n assign,\n canUseWeakMap,\n createFragmentMap,\n DirectiveInfo,\n FragmentMap,\n getDefaultValues,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getQueryDefinition,\n getStoreKeyName,\n IdValue,\n isEqual,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n maybeDeepFreeze,\n mergeDeepArray,\n resultKeyNameFromField,\n shouldInclude,\n StoreValue,\n toIdValue,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap, KeyTrie } from 'optimism';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher?: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\ntype ExecSubSelectedArrayOptions = {\n field: FieldNode;\n array: any[];\n execContext: ExecContext;\n};\n\nexport interface StoreReaderConfig {\n cacheKeyRoot?: KeyTrie;\n freezeResults?: boolean;\n}\n\nexport class StoreReader {\n private freezeResults: boolean;\n\n constructor({\n cacheKeyRoot = new KeyTrie(canUseWeakMap),\n freezeResults = false,\n }: StoreReaderConfig = {}) {\n const {\n executeStoreQuery,\n executeSelectionSet,\n executeSubSelectedArray,\n } = this;\n\n this.freezeResults = freezeResults;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n contextValue.store,\n query,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n selectionSet,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSubSelectedArray = wrap((options: ExecSubSelectedArrayOptions) => {\n return executeSubSelectedArray.call(this, options);\n }, {\n makeCacheKey({ field, array, execContext }) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n field,\n array,\n JSON.stringify(execContext.variableValues),\n );\n }\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType | undefined {\n return this.diffQueryAgainstStore({\n ...options,\n returnPartialData: false,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: config && config.dataIdFromObject,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing!.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition =\n fragment.typeCondition && fragment.typeCondition.name.value;\n\n const match =\n !typeCondition ||\n execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray({\n field,\n array: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n maybeDeepFreeze(readStoreResult);\n }\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] | undefined;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop()!.result,\n missing,\n };\n }\n\n private executeSubSelectedArray({\n field,\n array,\n execContext,\n }: ExecSubSelectedArrayOptions): ExecResult {\n let missing: ExecResultMissingField[] | undefined;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n array = array.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray({\n field,\n array: item,\n execContext,\n }));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n\n return { result: array, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n const id = context.dataIdFromObject!(storeObj);\n return id && toIdValue({\n id,\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n\n public get(dataId: string) {\n return this.data[dataId]!;\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document)!;\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const id = dataId || 'self';\n const idValue = toIdValue({ id, typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ [id]: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument, canUseWeakMap } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { KeyTrie } from 'optimism';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n freezeResults?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n freezeResults: false,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new KeyTrie(canUseWeakMap);\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = !!this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeWriter = new StoreWriter();\n this.storeReader = new StoreReader({\n cacheKeyRoot: this.cacheKeyRoot,\n freezeResults: config.freezeResults,\n });\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction,\n previousResult: options.previousResult,\n config: this.config,\n }) || null;\n }\n\n public write(write: Cache.WriteOptions): void {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop()!;\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js b/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js deleted file mode 100644 index cd4f04f..0000000 --- a/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -exports.__esModule=!0,exports.assertIdValue=function(e){(0,a.invariant)((0,r.isIdValue)(e),11)},exports.defaultDataIdFromObject=R,exports.defaultNormalizedCacheFactory=function(e){return new m(e)},exports.enhanceErrorWithDocument=v,exports.WriteError=exports.StoreWriter=exports.StoreReader=exports.ObjectCache=exports.IntrospectionFragmentMatcher=exports.InMemoryCache=exports.HeuristicFragmentMatcher=void 0;var e=require("tslib"),t=require("apollo-cache"),r=require("apollo-utilities"),i=require("optimism"),a=require("ts-invariant"),n=!1;function o(){var e=!n;return(0,r.isTest)()||(n=!0),e}var s=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,r){var i=r.store.get(e.id),a="ROOT_QUERY"===e.id;if(!i)return a;var n=i.__typename,s=void 0===n?a&&"Query":n;return s&&s===t||(o(),"heuristic")},e}();exports.HeuristicFragmentMatcher=s;var c=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){(0,a.invariant)(this.isReady,1);var i=r.store.get(e.id),n="ROOT_QUERY"===e.id;if(!i)return n;var o=i.__typename,s=void 0===o?n&&"Query":o;if((0,a.invariant)(s,2),s===t)return!0;var c=this.possibleTypesMap[t];return!!(s&&c&&c.indexOf(s)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach(function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map(function(e){return e.name}))}),t},e}();exports.IntrospectionFragmentMatcher=c;var u=Object.prototype.hasOwnProperty,l=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=(0,i.wrap)(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){u.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(r){t.set(r,e[r])}),Object.keys(this.data).forEach(function(r){u.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function d(e){return new l(e)}var p=function(){function t(e){var t=this,a=void 0===e?{}:e,n=a.cacheKeyRoot,o=void 0===n?new i.KeyTrie(r.canUseWeakMap):n,s=a.freezeResults,c=void 0!==s&&s,u=this.executeStoreQuery,d=this.executeSelectionSet,p=this.executeSubSelectedArray;this.freezeResults=c,this.executeStoreQuery=(0,i.wrap)(function(e){return u.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,i=e.contextValue,a=e.variableValues,n=e.fragmentMatcher;if(i.store instanceof l)return o.lookup(i.store,t,n,JSON.stringify(a),r.id)}}),this.executeSelectionSet=(0,i.wrap)(function(e){return d.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,i=e.execContext;if(i.contextValue.store instanceof l)return o.lookup(i.contextValue.store,t,i.fragmentMatcher,JSON.stringify(i.variableValues),r.id)}}),this.executeSubSelectedArray=(0,i.wrap)(function(e){return p.call(t,e)},{makeCacheKey:function(e){var t=e.field,r=e.array,i=e.execContext;if(i.contextValue.store instanceof l)return o.lookup(i.contextValue.store,t,r,JSON.stringify(i.variableValues))}})}return t.prototype.readQueryFromStore=function(t){return this.diffQueryAgainstStore((0,e.__assign)((0,e.__assign)({},t),{returnPartialData:!1})).result},t.prototype.diffQueryAgainstStore=function(e){var t=e.store,i=e.query,n=e.variables,o=e.previousResult,s=e.returnPartialData,c=void 0===s||s,u=e.rootId,l=void 0===u?"ROOT_QUERY":u,d=e.fragmentMatcherFunction,p=e.config,f=(0,r.getQueryDefinition)(i);n=(0,r.assign)({},(0,r.getDefaultValues)(f),n);var h={store:t,dataIdFromObject:p&&p.dataIdFromObject,cacheRedirects:p&&p.cacheRedirects||{}},m=this.executeStoreQuery({query:i,rootValue:{type:"id",id:l,generated:!0,typename:"Query"},contextValue:h,variableValues:n,fragmentMatcher:d}),y=m.missing&&m.missing.length>0;return y&&!c&&m.missing.forEach(function(e){if(!e.tolerable)throw new a.InvariantError(8)}),o&&(0,r.isEqual)(o,m.result)&&(m.result=o),{result:m.result,complete:!y}},t.prototype.executeStoreQuery=function(e){var t=e.query,i=e.rootValue,a=e.contextValue,n=e.variableValues,o=e.fragmentMatcher,s=void 0===o?h:o,c=(0,r.getMainDefinition)(t),u=(0,r.getFragmentDefinitions)(t),l={query:t,fragmentMap:(0,r.createFragmentMap)(u),contextValue:a,variableValues:n,fragmentMatcher:s};return this.executeSelectionSet({selectionSet:c.selectionSet,rootValue:i,execContext:l})},t.prototype.executeSelectionSet=function(t){var i=this,n=t.selectionSet,o=t.rootValue,s=t.execContext,c=s.fragmentMap,u=s.contextValue,l=s.variableValues,d={result:null},p=[],f=u.store.get(o.id),h=f&&f.__typename||"ROOT_QUERY"===o.id&&"Query"||void 0;function m(e){var t;return e.missing&&(d.missing=d.missing||[],(t=d.missing).push.apply(t,e.missing)),e.result}return n.selections.forEach(function(t){var n;if((0,r.shouldInclude)(t,l))if((0,r.isField)(t)){var d=m(i.executeField(f,h,t,s));void 0!==d&&p.push(((n={})[(0,r.resultKeyNameFromField)(t)]=d,n))}else{var y=void 0;if((0,r.isInlineFragment)(t))y=t;else if(!(y=c[t.name.value]))throw new a.InvariantError(9);var v=y.typeCondition&&y.typeCondition.name.value,g=!v||s.fragmentMatcher(o,v,u);if(g){var S=i.executeSelectionSet({selectionSet:y.selectionSet,rootValue:o,execContext:s});"heuristic"===g&&S.missing&&(S=(0,e.__assign)((0,e.__assign)({},S),{missing:S.missing.map(function(t){return(0,e.__assign)((0,e.__assign)({},t),{tolerable:!0})})})),p.push(m(S))}}}),d.result=(0,r.mergeDeepArray)(p),this.freezeResults,d},t.prototype.executeField=function(e,t,i,a){var n=a.variableValues,o=a.contextValue,s=function(e,t,i,a,n,o){o.resultKey;var s=o.directives,c=i;(a||s)&&(c=(0,r.getStoreKeyName)(c,a,s));var u=void 0;if(e&&void 0===(u=e[c])&&n.cacheRedirects&&"string"==typeof t){var l=n.cacheRedirects[t];if(l){var d=l[i];d&&(u=d(e,a,{getCacheKey:function(e){var t=n.dataIdFromObject(e);return t&&(0,r.toIdValue)({id:t,typename:e.__typename})}}))}}if(void 0===u)return{result:u,missing:[{object:e,fieldName:c,tolerable:!1}]};(0,r.isJsonValue)(u)&&(u=u.json);return{result:u}}(e,t,i.name.value,(0,r.argumentsObjectFromField)(i,n),o,{resultKey:(0,r.resultKeyNameFromField)(i),directives:(0,r.getDirectiveInfoFromField)(i,n)});return Array.isArray(s.result)?this.combineExecResults(s,this.executeSubSelectedArray({field:i,array:s.result,execContext:a})):i.selectionSet?null==s.result?s:this.combineExecResults(s,this.executeSelectionSet({selectionSet:i.selectionSet,rootValue:s.result,execContext:a})):(f(i,s.result),this.freezeResults,s)},t.prototype.combineExecResults=function(){for(var e,t=[],r=0;r=0)return!0;r[e].push(t)}else r[e]=[t];return!1}exports.StoreWriter=g;var x={fragmentMatcher:new s,dataIdFromObject:R,addTypename:!0,resultCaching:!0,freezeResults:!1};function R(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var _=Object.prototype.hasOwnProperty,I=function(t){function r(e,r,i){var a=t.call(this,Object.create(null))||this;return a.optimisticId=e,a.parent=r,a.transaction=i,a}return(0,e.__extends)(r,t),r.prototype.toObject=function(){return(0,e.__assign)((0,e.__assign)({},this.parent.toObject()),this.data)},r.prototype.get=function(e){return _.call(this.data,e)?this.data[e]:this.parent.get(e)},r}(m),F=function(t){function n(a){void 0===a&&(a={});var n=t.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new i.KeyTrie(r.canUseWeakMap),n.silenceBroadcast=!1,n.config=(0,e.__assign)((0,e.__assign)({},x),a),n.config.customResolvers&&(n.config.cacheRedirects=n.config.customResolvers),n.config.cacheResolvers&&(n.config.cacheRedirects=n.config.cacheResolvers),n.addTypename=!!n.config.addTypename,n.data=n.config.resultCaching?new l:new m,n.optimisticData=n.data,n.storeWriter=new g,n.storeReader=new p({cacheKeyRoot:n.cacheKeyRoot,freezeResults:a.freezeResults});var o=n,s=o.maybeBroadcastWatch;return n.maybeBroadcastWatch=(0,i.wrap)(function(e){return s.call(n,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return o.data instanceof l?o.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),n}return(0,e.__extends)(n,t),n.prototype.restore=function(e){return e&&this.data.replace(e),this},n.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},n.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},n.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:r}),this.broadcastWatches()},n.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:r,config:this.config})},n.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},n.prototype.evict=function(e){throw new a.InvariantError(7)},n.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},n.prototype.removeOptimistic=function(e){for(var t=[],r=0,i=this.optimisticData;i instanceof I;)i.optimisticId===e?++r:t.push(i),i=i.parent;if(r>0){for(this.optimisticData=i;t.length>0;){var a=t.pop();this.performTransaction(a.transaction,a.optimisticId)}this.broadcastWatches()}},n.prototype.performTransaction=function(e,t){var r=this.data,i=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new I(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=i,this.data=r}this.broadcastWatches()},n.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},n.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=(0,r.addTypenameToDocument)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},n.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach(function(t){return e.maybeBroadcastWatch(t)})},n.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},n}(t.ApolloCache);exports.InMemoryCache=F; diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.esm.js b/node_modules/apollo-cache-inmemory/lib/bundle.esm.js deleted file mode 100644 index 44ee01e..0000000 --- a/node_modules/apollo-cache-inmemory/lib/bundle.esm.js +++ /dev/null @@ -1,984 +0,0 @@ -import { __assign, __extends } from 'tslib'; -import { ApolloCache } from 'apollo-cache'; -import { isTest, getQueryDefinition, assign, getDefaultValues, isEqual, getMainDefinition, getFragmentDefinitions, createFragmentMap, shouldInclude, isField, resultKeyNameFromField, isInlineFragment, mergeDeepArray, argumentsObjectFromField, getDirectiveInfoFromField, maybeDeepFreeze, isIdValue, getStoreKeyName, toIdValue, isJsonValue, canUseWeakMap, getOperationDefinition, isProduction, storeKeyNameFromField, addTypenameToDocument } from 'apollo-utilities'; -import { wrap, KeyTrie } from 'optimism'; -import { invariant, InvariantError } from 'ts-invariant'; - -var haveWarned = false; -function shouldWarn() { - var answer = !haveWarned; - if (!isTest()) { - haveWarned = true; - } - return answer; -} -var HeuristicFragmentMatcher = (function () { - function HeuristicFragmentMatcher() { - } - HeuristicFragmentMatcher.prototype.ensureReady = function () { - return Promise.resolve(); - }; - HeuristicFragmentMatcher.prototype.canBypassInit = function () { - return true; - }; - HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - if (!obj) { - return isRootQuery; - } - var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - if (!__typename) { - if (shouldWarn()) { - process.env.NODE_ENV === "production" || invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); - process.env.NODE_ENV === "production" || invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); - process.env.NODE_ENV === "production" || invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + - "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); - } - return 'heuristic'; - } - if (__typename === typeCondition) { - return true; - } - if (shouldWarn()) { - process.env.NODE_ENV === "production" || invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + - 'queries contain union or interface types. Apollo Client will not be ' + - 'able to accurately map fragments. To make this error go away, use ' + - 'the `IntrospectionFragmentMatcher` as described in the docs: ' + - 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); - } - return 'heuristic'; - }; - return HeuristicFragmentMatcher; -}()); -var IntrospectionFragmentMatcher = (function () { - function IntrospectionFragmentMatcher(options) { - if (options && options.introspectionQueryResultData) { - this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); - this.isReady = true; - } - else { - this.isReady = false; - } - this.match = this.match.bind(this); - } - IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - process.env.NODE_ENV === "production" ? invariant(this.isReady, 1) : invariant(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - if (!obj) { - return isRootQuery; - } - var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - process.env.NODE_ENV === "production" ? invariant(__typename, 2) : invariant(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); - if (__typename === typeCondition) { - return true; - } - var implementingTypes = this.possibleTypesMap[typeCondition]; - if (__typename && - implementingTypes && - implementingTypes.indexOf(__typename) > -1) { - return true; - } - return false; - }; - IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { - var typeMap = {}; - introspectionResultData.__schema.types.forEach(function (type) { - if (type.kind === 'UNION' || type.kind === 'INTERFACE') { - typeMap[type.name] = type.possibleTypes.map(function (implementingType) { return implementingType.name; }); - } - }); - return typeMap; - }; - return IntrospectionFragmentMatcher; -}()); - -var hasOwn = Object.prototype.hasOwnProperty; -var DepTrackingCache = (function () { - function DepTrackingCache(data) { - var _this = this; - if (data === void 0) { data = Object.create(null); } - this.data = data; - this.depend = wrap(function (dataId) { return _this.data[dataId]; }, { - disposable: true, - makeCacheKey: function (dataId) { - return dataId; - }, - }); - } - DepTrackingCache.prototype.toObject = function () { - return this.data; - }; - DepTrackingCache.prototype.get = function (dataId) { - this.depend(dataId); - return this.data[dataId]; - }; - DepTrackingCache.prototype.set = function (dataId, value) { - var oldValue = this.data[dataId]; - if (value !== oldValue) { - this.data[dataId] = value; - this.depend.dirty(dataId); - } - }; - DepTrackingCache.prototype.delete = function (dataId) { - if (hasOwn.call(this.data, dataId)) { - delete this.data[dataId]; - this.depend.dirty(dataId); - } - }; - DepTrackingCache.prototype.clear = function () { - this.replace(null); - }; - DepTrackingCache.prototype.replace = function (newData) { - var _this = this; - if (newData) { - Object.keys(newData).forEach(function (dataId) { - _this.set(dataId, newData[dataId]); - }); - Object.keys(this.data).forEach(function (dataId) { - if (!hasOwn.call(newData, dataId)) { - _this.delete(dataId); - } - }); - } - else { - Object.keys(this.data).forEach(function (dataId) { - _this.delete(dataId); - }); - } - }; - return DepTrackingCache; -}()); -function defaultNormalizedCacheFactory(seed) { - return new DepTrackingCache(seed); -} - -var StoreReader = (function () { - function StoreReader(_a) { - var _this = this; - var _b = _a === void 0 ? {} : _a, _c = _b.cacheKeyRoot, cacheKeyRoot = _c === void 0 ? new KeyTrie(canUseWeakMap) : _c, _d = _b.freezeResults, freezeResults = _d === void 0 ? false : _d; - var _e = this, executeStoreQuery = _e.executeStoreQuery, executeSelectionSet = _e.executeSelectionSet, executeSubSelectedArray = _e.executeSubSelectedArray; - this.freezeResults = freezeResults; - this.executeStoreQuery = wrap(function (options) { - return executeStoreQuery.call(_this, options); - }, { - makeCacheKey: function (_a) { - var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, fragmentMatcher = _a.fragmentMatcher; - if (contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); - } - } - }); - this.executeSelectionSet = wrap(function (options) { - return executeSelectionSet.call(_this, options); - }, { - makeCacheKey: function (_a) { - var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; - if (execContext.contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); - } - } - }); - this.executeSubSelectedArray = wrap(function (options) { - return executeSubSelectedArray.call(_this, options); - }, { - makeCacheKey: function (_a) { - var field = _a.field, array = _a.array, execContext = _a.execContext; - if (execContext.contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); - } - } - }); - } - StoreReader.prototype.readQueryFromStore = function (options) { - return this.diffQueryAgainstStore(__assign(__assign({}, options), { returnPartialData: false })).result; - }; - StoreReader.prototype.diffQueryAgainstStore = function (_a) { - var store = _a.store, query = _a.query, variables = _a.variables, previousResult = _a.previousResult, _b = _a.returnPartialData, returnPartialData = _b === void 0 ? true : _b, _c = _a.rootId, rootId = _c === void 0 ? 'ROOT_QUERY' : _c, fragmentMatcherFunction = _a.fragmentMatcherFunction, config = _a.config; - var queryDefinition = getQueryDefinition(query); - variables = assign({}, getDefaultValues(queryDefinition), variables); - var context = { - store: store, - dataIdFromObject: config && config.dataIdFromObject, - cacheRedirects: (config && config.cacheRedirects) || {}, - }; - var execResult = this.executeStoreQuery({ - query: query, - rootValue: { - type: 'id', - id: rootId, - generated: true, - typename: 'Query', - }, - contextValue: context, - variableValues: variables, - fragmentMatcher: fragmentMatcherFunction, - }); - var hasMissingFields = execResult.missing && execResult.missing.length > 0; - if (hasMissingFields && !returnPartialData) { - execResult.missing.forEach(function (info) { - if (info.tolerable) - return; - throw process.env.NODE_ENV === "production" ? new InvariantError(8) : new InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); - }); - } - if (previousResult) { - if (isEqual(previousResult, execResult.result)) { - execResult.result = previousResult; - } - } - return { - result: execResult.result, - complete: !hasMissingFields, - }; - }; - StoreReader.prototype.executeStoreQuery = function (_a) { - var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, _b = _a.fragmentMatcher, fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; - var mainDefinition = getMainDefinition(query); - var fragments = getFragmentDefinitions(query); - var fragmentMap = createFragmentMap(fragments); - var execContext = { - query: query, - fragmentMap: fragmentMap, - contextValue: contextValue, - variableValues: variableValues, - fragmentMatcher: fragmentMatcher, - }; - return this.executeSelectionSet({ - selectionSet: mainDefinition.selectionSet, - rootValue: rootValue, - execContext: execContext, - }); - }; - StoreReader.prototype.executeSelectionSet = function (_a) { - var _this = this; - var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; - var fragmentMap = execContext.fragmentMap, contextValue = execContext.contextValue, variables = execContext.variableValues; - var finalResult = { result: null }; - var objectsToMerge = []; - var object = contextValue.store.get(rootValue.id); - var typename = (object && object.__typename) || - (rootValue.id === 'ROOT_QUERY' && 'Query') || - void 0; - function handleMissing(result) { - var _a; - if (result.missing) { - finalResult.missing = finalResult.missing || []; - (_a = finalResult.missing).push.apply(_a, result.missing); - } - return result.result; - } - selectionSet.selections.forEach(function (selection) { - var _a; - if (!shouldInclude(selection, variables)) { - return; - } - if (isField(selection)) { - var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); - if (typeof fieldResult !== 'undefined') { - objectsToMerge.push((_a = {}, - _a[resultKeyNameFromField(selection)] = fieldResult, - _a)); - } - } - else { - var fragment = void 0; - if (isInlineFragment(selection)) { - fragment = selection; - } - else { - fragment = fragmentMap[selection.name.value]; - if (!fragment) { - throw process.env.NODE_ENV === "production" ? new InvariantError(9) : new InvariantError("No fragment named " + selection.name.value); - } - } - var typeCondition = fragment.typeCondition && fragment.typeCondition.name.value; - var match = !typeCondition || - execContext.fragmentMatcher(rootValue, typeCondition, contextValue); - if (match) { - var fragmentExecResult = _this.executeSelectionSet({ - selectionSet: fragment.selectionSet, - rootValue: rootValue, - execContext: execContext, - }); - if (match === 'heuristic' && fragmentExecResult.missing) { - fragmentExecResult = __assign(__assign({}, fragmentExecResult), { missing: fragmentExecResult.missing.map(function (info) { - return __assign(__assign({}, info), { tolerable: true }); - }) }); - } - objectsToMerge.push(handleMissing(fragmentExecResult)); - } - } - }); - finalResult.result = mergeDeepArray(objectsToMerge); - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(finalResult.result); - } - return finalResult; - }; - StoreReader.prototype.executeField = function (object, typename, field, execContext) { - var variables = execContext.variableValues, contextValue = execContext.contextValue; - var fieldName = field.name.value; - var args = argumentsObjectFromField(field, variables); - var info = { - resultKey: resultKeyNameFromField(field), - directives: getDirectiveInfoFromField(field, variables), - }; - var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); - if (Array.isArray(readStoreResult.result)) { - return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ - field: field, - array: readStoreResult.result, - execContext: execContext, - })); - } - if (!field.selectionSet) { - assertSelectionSetForIdValue(field, readStoreResult.result); - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - maybeDeepFreeze(readStoreResult); - } - return readStoreResult; - } - if (readStoreResult.result == null) { - return readStoreResult; - } - return this.combineExecResults(readStoreResult, this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: readStoreResult.result, - execContext: execContext, - })); - }; - StoreReader.prototype.combineExecResults = function () { - var execResults = []; - for (var _i = 0; _i < arguments.length; _i++) { - execResults[_i] = arguments[_i]; - } - var missing; - execResults.forEach(function (execResult) { - if (execResult.missing) { - missing = missing || []; - missing.push.apply(missing, execResult.missing); - } - }); - return { - result: execResults.pop().result, - missing: missing, - }; - }; - StoreReader.prototype.executeSubSelectedArray = function (_a) { - var _this = this; - var field = _a.field, array = _a.array, execContext = _a.execContext; - var missing; - function handleMissing(childResult) { - if (childResult.missing) { - missing = missing || []; - missing.push.apply(missing, childResult.missing); - } - return childResult.result; - } - array = array.map(function (item) { - if (item === null) { - return null; - } - if (Array.isArray(item)) { - return handleMissing(_this.executeSubSelectedArray({ - field: field, - array: item, - execContext: execContext, - })); - } - if (field.selectionSet) { - return handleMissing(_this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: item, - execContext: execContext, - })); - } - assertSelectionSetForIdValue(field, item); - return item; - }); - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(array); - } - return { result: array, missing: missing }; - }; - return StoreReader; -}()); -function assertSelectionSetForIdValue(field, value) { - if (!field.selectionSet && isIdValue(value)) { - throw process.env.NODE_ENV === "production" ? new InvariantError(10) : new InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); - } -} -function defaultFragmentMatcher() { - return true; -} -function assertIdValue(idValue) { - process.env.NODE_ENV === "production" ? invariant(isIdValue(idValue), 11) : invariant(isIdValue(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); -} -function readStoreResolver(object, typename, fieldName, args, context, _a) { - var resultKey = _a.resultKey, directives = _a.directives; - var storeKeyName = fieldName; - if (args || directives) { - storeKeyName = getStoreKeyName(storeKeyName, args, directives); - } - var fieldValue = void 0; - if (object) { - fieldValue = object[storeKeyName]; - if (typeof fieldValue === 'undefined' && - context.cacheRedirects && - typeof typename === 'string') { - var type = context.cacheRedirects[typename]; - if (type) { - var resolver = type[fieldName]; - if (resolver) { - fieldValue = resolver(object, args, { - getCacheKey: function (storeObj) { - var id = context.dataIdFromObject(storeObj); - return id && toIdValue({ - id: id, - typename: storeObj.__typename, - }); - }, - }); - } - } - } - } - if (typeof fieldValue === 'undefined') { - return { - result: fieldValue, - missing: [{ - object: object, - fieldName: storeKeyName, - tolerable: false, - }], - }; - } - if (isJsonValue(fieldValue)) { - fieldValue = fieldValue.json; - } - return { - result: fieldValue, - }; -} - -var ObjectCache = (function () { - function ObjectCache(data) { - if (data === void 0) { data = Object.create(null); } - this.data = data; - } - ObjectCache.prototype.toObject = function () { - return this.data; - }; - ObjectCache.prototype.get = function (dataId) { - return this.data[dataId]; - }; - ObjectCache.prototype.set = function (dataId, value) { - this.data[dataId] = value; - }; - ObjectCache.prototype.delete = function (dataId) { - this.data[dataId] = void 0; - }; - ObjectCache.prototype.clear = function () { - this.data = Object.create(null); - }; - ObjectCache.prototype.replace = function (newData) { - this.data = newData || Object.create(null); - }; - return ObjectCache; -}()); -function defaultNormalizedCacheFactory$1(seed) { - return new ObjectCache(seed); -} - -var WriteError = (function (_super) { - __extends(WriteError, _super); - function WriteError() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'WriteError'; - return _this; - } - return WriteError; -}(Error)); -function enhanceErrorWithDocument(error, document) { - var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); - enhancedError.message += '\n' + error.message; - enhancedError.stack = error.stack; - return enhancedError; -} -var StoreWriter = (function () { - function StoreWriter() { - } - StoreWriter.prototype.writeQueryToStore = function (_a) { - var query = _a.query, result = _a.result, _b = _a.store, store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; - return this.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: query, - store: store, - variables: variables, - dataIdFromObject: dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - }; - StoreWriter.prototype.writeResultToStore = function (_a) { - var dataId = _a.dataId, result = _a.result, document = _a.document, _b = _a.store, store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; - var operationDefinition = getOperationDefinition(document); - try { - return this.writeSelectionSetToStore({ - result: result, - dataId: dataId, - selectionSet: operationDefinition.selectionSet, - context: { - store: store, - processedData: {}, - variables: assign({}, getDefaultValues(operationDefinition), variables), - dataIdFromObject: dataIdFromObject, - fragmentMap: createFragmentMap(getFragmentDefinitions(document)), - fragmentMatcherFunction: fragmentMatcherFunction, - }, - }); - } - catch (e) { - throw enhanceErrorWithDocument(e, document); - } - }; - StoreWriter.prototype.writeSelectionSetToStore = function (_a) { - var _this = this; - var result = _a.result, dataId = _a.dataId, selectionSet = _a.selectionSet, context = _a.context; - var variables = context.variables, store = context.store, fragmentMap = context.fragmentMap; - selectionSet.selections.forEach(function (selection) { - var _a; - if (!shouldInclude(selection, variables)) { - return; - } - if (isField(selection)) { - var resultFieldKey = resultKeyNameFromField(selection); - var value = result[resultFieldKey]; - if (typeof value !== 'undefined') { - _this.writeFieldToStore({ - dataId: dataId, - value: value, - field: selection, - context: context, - }); - } - else { - var isDefered = false; - var isClient = false; - if (selection.directives && selection.directives.length) { - isDefered = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'defer'; }); - isClient = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'client'; }); - } - if (!isDefered && !isClient && context.fragmentMatcherFunction) { - process.env.NODE_ENV === "production" || invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); - } - } - } - else { - var fragment = void 0; - if (isInlineFragment(selection)) { - fragment = selection; - } - else { - fragment = (fragmentMap || {})[selection.name.value]; - process.env.NODE_ENV === "production" ? invariant(fragment, 3) : invariant(fragment, "No fragment named " + selection.name.value + "."); - } - var matches = true; - if (context.fragmentMatcherFunction && fragment.typeCondition) { - var id = dataId || 'self'; - var idValue = toIdValue({ id: id, typename: undefined }); - var fakeContext = { - store: new ObjectCache((_a = {}, _a[id] = result, _a)), - cacheRedirects: {}, - }; - var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); - if (!isProduction() && match === 'heuristic') { - process.env.NODE_ENV === "production" || invariant.error('WARNING: heuristic fragment matching going on!'); - } - matches = !!match; - } - if (matches) { - _this.writeSelectionSetToStore({ - result: result, - selectionSet: fragment.selectionSet, - dataId: dataId, - context: context, - }); - } - } - }); - return store; - }; - StoreWriter.prototype.writeFieldToStore = function (_a) { - var _b; - var field = _a.field, value = _a.value, dataId = _a.dataId, context = _a.context; - var variables = context.variables, dataIdFromObject = context.dataIdFromObject, store = context.store; - var storeValue; - var storeObject; - var storeFieldName = storeKeyNameFromField(field, variables); - if (!field.selectionSet || value === null) { - storeValue = - value != null && typeof value === 'object' - ? - { type: 'json', json: value } - : - value; - } - else if (Array.isArray(value)) { - var generatedId = dataId + "." + storeFieldName; - storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); - } - else { - var valueDataId = dataId + "." + storeFieldName; - var generated = true; - if (!isGeneratedId(valueDataId)) { - valueDataId = '$' + valueDataId; - } - if (dataIdFromObject) { - var semanticId = dataIdFromObject(value); - process.env.NODE_ENV === "production" ? invariant(!semanticId || !isGeneratedId(semanticId), 4) : invariant(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); - if (semanticId || - (typeof semanticId === 'number' && semanticId === 0)) { - valueDataId = semanticId; - generated = false; - } - } - if (!isDataProcessed(valueDataId, field, context.processedData)) { - this.writeSelectionSetToStore({ - dataId: valueDataId, - result: value, - selectionSet: field.selectionSet, - context: context, - }); - } - var typename = value.__typename; - storeValue = toIdValue({ id: valueDataId, typename: typename }, generated); - storeObject = store.get(dataId); - var escapedId = storeObject && storeObject[storeFieldName]; - if (escapedId !== storeValue && isIdValue(escapedId)) { - var hadTypename = escapedId.typename !== undefined; - var hasTypename = typename !== undefined; - var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; - process.env.NODE_ENV === "production" ? invariant(!generated || escapedId.generated || typenameChanged, 5) : invariant(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - process.env.NODE_ENV === "production" ? invariant(!hadTypename || hasTypename, 6) : invariant(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - if (escapedId.generated) { - if (typenameChanged) { - if (!generated) { - store.delete(escapedId.id); - } - } - else { - mergeWithGenerated(escapedId.id, storeValue.id, store); - } - } - } - } - storeObject = store.get(dataId); - if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) { - store.set(dataId, __assign(__assign({}, storeObject), (_b = {}, _b[storeFieldName] = storeValue, _b))); - } - }; - StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { - var _this = this; - return value.map(function (item, index) { - if (item === null) { - return null; - } - var itemDataId = generatedId + "." + index; - if (Array.isArray(item)) { - return _this.processArrayValue(item, itemDataId, selectionSet, context); - } - var generated = true; - if (context.dataIdFromObject) { - var semanticId = context.dataIdFromObject(item); - if (semanticId) { - itemDataId = semanticId; - generated = false; - } - } - if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { - _this.writeSelectionSetToStore({ - dataId: itemDataId, - result: item, - selectionSet: selectionSet, - context: context, - }); - } - return toIdValue({ id: itemDataId, typename: item.__typename }, generated); - }); - }; - return StoreWriter; -}()); -function isGeneratedId(id) { - return id[0] === '$'; -} -function mergeWithGenerated(generatedKey, realKey, cache) { - if (generatedKey === realKey) { - return false; - } - var generated = cache.get(generatedKey); - var real = cache.get(realKey); - var madeChanges = false; - Object.keys(generated).forEach(function (key) { - var value = generated[key]; - var realValue = real[key]; - if (isIdValue(value) && - isGeneratedId(value.id) && - isIdValue(realValue) && - !isEqual(value, realValue) && - mergeWithGenerated(value.id, realValue.id, cache)) { - madeChanges = true; - } - }); - cache.delete(generatedKey); - var newRealValue = __assign(__assign({}, generated), real); - if (isEqual(newRealValue, real)) { - return madeChanges; - } - cache.set(realKey, newRealValue); - return true; -} -function isDataProcessed(dataId, field, processedData) { - if (!processedData) { - return false; - } - if (processedData[dataId]) { - if (processedData[dataId].indexOf(field) >= 0) { - return true; - } - else { - processedData[dataId].push(field); - } - } - else { - processedData[dataId] = [field]; - } - return false; -} - -var defaultConfig = { - fragmentMatcher: new HeuristicFragmentMatcher(), - dataIdFromObject: defaultDataIdFromObject, - addTypename: true, - resultCaching: true, - freezeResults: false, -}; -function defaultDataIdFromObject(result) { - if (result.__typename) { - if (result.id !== undefined) { - return result.__typename + ":" + result.id; - } - if (result._id !== undefined) { - return result.__typename + ":" + result._id; - } - } - return null; -} -var hasOwn$1 = Object.prototype.hasOwnProperty; -var OptimisticCacheLayer = (function (_super) { - __extends(OptimisticCacheLayer, _super); - function OptimisticCacheLayer(optimisticId, parent, transaction) { - var _this = _super.call(this, Object.create(null)) || this; - _this.optimisticId = optimisticId; - _this.parent = parent; - _this.transaction = transaction; - return _this; - } - OptimisticCacheLayer.prototype.toObject = function () { - return __assign(__assign({}, this.parent.toObject()), this.data); - }; - OptimisticCacheLayer.prototype.get = function (dataId) { - return hasOwn$1.call(this.data, dataId) - ? this.data[dataId] - : this.parent.get(dataId); - }; - return OptimisticCacheLayer; -}(ObjectCache)); -var InMemoryCache = (function (_super) { - __extends(InMemoryCache, _super); - function InMemoryCache(config) { - if (config === void 0) { config = {}; } - var _this = _super.call(this) || this; - _this.watches = new Set(); - _this.typenameDocumentCache = new Map(); - _this.cacheKeyRoot = new KeyTrie(canUseWeakMap); - _this.silenceBroadcast = false; - _this.config = __assign(__assign({}, defaultConfig), config); - if (_this.config.customResolvers) { - process.env.NODE_ENV === "production" || invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.customResolvers; - } - if (_this.config.cacheResolvers) { - process.env.NODE_ENV === "production" || invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.cacheResolvers; - } - _this.addTypename = !!_this.config.addTypename; - _this.data = _this.config.resultCaching - ? new DepTrackingCache() - : new ObjectCache(); - _this.optimisticData = _this.data; - _this.storeWriter = new StoreWriter(); - _this.storeReader = new StoreReader({ - cacheKeyRoot: _this.cacheKeyRoot, - freezeResults: config.freezeResults, - }); - var cache = _this; - var maybeBroadcastWatch = cache.maybeBroadcastWatch; - _this.maybeBroadcastWatch = wrap(function (c) { - return maybeBroadcastWatch.call(_this, c); - }, { - makeCacheKey: function (c) { - if (c.optimistic) { - return; - } - if (c.previousResult) { - return; - } - if (cache.data instanceof DepTrackingCache) { - return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); - } - } - }); - return _this; - } - InMemoryCache.prototype.restore = function (data) { - if (data) - this.data.replace(data); - return this; - }; - InMemoryCache.prototype.extract = function (optimistic) { - if (optimistic === void 0) { optimistic = false; } - return (optimistic ? this.optimisticData : this.data).toObject(); - }; - InMemoryCache.prototype.read = function (options) { - if (typeof options.rootId === 'string' && - typeof this.data.get(options.rootId) === 'undefined') { - return null; - } - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config, - }) || null; - }; - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - this.storeWriter.writeResultToStore({ - dataId: write.dataId, - result: write.result, - variables: write.variables, - document: this.transformDocument(write.query), - store: this.data, - dataIdFromObject: this.config.dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - this.broadcastWatches(); - }; - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.diffQueryAgainstStore({ - store: query.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(query.query), - variables: query.variables, - returnPartialData: query.returnPartialData, - previousResult: query.previousResult, - fragmentMatcherFunction: fragmentMatcherFunction, - config: this.config, - }); - }; - InMemoryCache.prototype.watch = function (watch) { - var _this = this; - this.watches.add(watch); - return function () { - _this.watches.delete(watch); - }; - }; - InMemoryCache.prototype.evict = function (query) { - throw process.env.NODE_ENV === "production" ? new InvariantError(7) : new InvariantError("eviction is not implemented on InMemory Cache"); - }; - InMemoryCache.prototype.reset = function () { - this.data.clear(); - this.broadcastWatches(); - return Promise.resolve(); - }; - InMemoryCache.prototype.removeOptimistic = function (idToRemove) { - var toReapply = []; - var removedCount = 0; - var layer = this.optimisticData; - while (layer instanceof OptimisticCacheLayer) { - if (layer.optimisticId === idToRemove) { - ++removedCount; - } - else { - toReapply.push(layer); - } - layer = layer.parent; - } - if (removedCount > 0) { - this.optimisticData = layer; - while (toReapply.length > 0) { - var layer_1 = toReapply.pop(); - this.performTransaction(layer_1.transaction, layer_1.optimisticId); - } - this.broadcastWatches(); - } - }; - InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { - var _a = this, data = _a.data, silenceBroadcast = _a.silenceBroadcast; - this.silenceBroadcast = true; - if (typeof optimisticId === 'string') { - this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); - } - try { - transaction(this); - } - finally { - this.silenceBroadcast = silenceBroadcast; - this.data = data; - } - this.broadcastWatches(); - }; - InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { - return this.performTransaction(transaction, id); - }; - InMemoryCache.prototype.transformDocument = function (document) { - if (this.addTypename) { - var result = this.typenameDocumentCache.get(document); - if (!result) { - result = addTypenameToDocument(document); - this.typenameDocumentCache.set(document, result); - this.typenameDocumentCache.set(result, result); - } - return result; - } - return document; - }; - InMemoryCache.prototype.broadcastWatches = function () { - var _this = this; - if (!this.silenceBroadcast) { - this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c); }); - } - }; - InMemoryCache.prototype.maybeBroadcastWatch = function (c) { - c.callback(this.diff({ - query: c.query, - variables: c.variables, - previousResult: c.previousResult && c.previousResult(), - optimistic: c.optimistic, - })); - }; - return InMemoryCache; -}(ApolloCache)); - -export { HeuristicFragmentMatcher, InMemoryCache, IntrospectionFragmentMatcher, ObjectCache, StoreReader, StoreWriter, WriteError, assertIdValue, defaultDataIdFromObject, defaultNormalizedCacheFactory$1 as defaultNormalizedCacheFactory, enhanceErrorWithDocument }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map b/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map deleted file mode 100644 index 98ebab5..0000000 --- a/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"sourcesContent":["import { isTest, IdValue } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\n\nimport {\n ReadStoreContext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/3507\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n if (!__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (__typename === typeCondition) {\n return true;\n }\n\n // At this point we don't know if this fragment should match or not. It's\n // either:\n //\n // 1. (GOOD) A fragment on a matching interface or union.\n // 2. (BAD) A fragment on a non-matching concrete type or interface or union.\n //\n // If it's 2, we don't want it to match. If it's 1, we want it to match. We\n // can't tell the difference, so we warn the user, but still try to match\n // it (for backwards compatibility reasons). This unfortunately means that\n // using the `HeuristicFragmentMatcher` with unions and interfaces is\n // very unreliable. This will be addressed in a future major version of\n // Apollo Client, but for now the recommendation is to use the\n // `IntrospectionFragmentMatcher` when working with unions/interfaces.\n\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (\n __typename &&\n implementingTypes &&\n implementingTypes.indexOf(__typename) > -1\n ) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<[string], StoreObject | undefined>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((dataId: string) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n },\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId]!;\n }\n\n public set(dataId: string, value?: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject | null): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (!hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n argumentsObjectFromField,\n assign,\n canUseWeakMap,\n createFragmentMap,\n DirectiveInfo,\n FragmentMap,\n getDefaultValues,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getQueryDefinition,\n getStoreKeyName,\n IdValue,\n isEqual,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n maybeDeepFreeze,\n mergeDeepArray,\n resultKeyNameFromField,\n shouldInclude,\n StoreValue,\n toIdValue,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap, KeyTrie } from 'optimism';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher?: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\ntype ExecSubSelectedArrayOptions = {\n field: FieldNode;\n array: any[];\n execContext: ExecContext;\n};\n\nexport interface StoreReaderConfig {\n cacheKeyRoot?: KeyTrie;\n freezeResults?: boolean;\n}\n\nexport class StoreReader {\n private freezeResults: boolean;\n\n constructor({\n cacheKeyRoot = new KeyTrie(canUseWeakMap),\n freezeResults = false,\n }: StoreReaderConfig = {}) {\n const {\n executeStoreQuery,\n executeSelectionSet,\n executeSubSelectedArray,\n } = this;\n\n this.freezeResults = freezeResults;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n contextValue.store,\n query,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n selectionSet,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSubSelectedArray = wrap((options: ExecSubSelectedArrayOptions) => {\n return executeSubSelectedArray.call(this, options);\n }, {\n makeCacheKey({ field, array, execContext }) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n field,\n array,\n JSON.stringify(execContext.variableValues),\n );\n }\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType | undefined {\n return this.diffQueryAgainstStore({\n ...options,\n returnPartialData: false,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: config && config.dataIdFromObject,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing!.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition =\n fragment.typeCondition && fragment.typeCondition.name.value;\n\n const match =\n !typeCondition ||\n execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray({\n field,\n array: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n maybeDeepFreeze(readStoreResult);\n }\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] | undefined;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop()!.result,\n missing,\n };\n }\n\n private executeSubSelectedArray({\n field,\n array,\n execContext,\n }: ExecSubSelectedArrayOptions): ExecResult {\n let missing: ExecResultMissingField[] | undefined;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n array = array.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray({\n field,\n array: item,\n execContext,\n }));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n\n return { result: array, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n const id = context.dataIdFromObject!(storeObj);\n return id && toIdValue({\n id,\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n\n public get(dataId: string) {\n return this.data[dataId]!;\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document)!;\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const id = dataId || 'self';\n const idValue = toIdValue({ id, typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ [id]: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument, canUseWeakMap } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { KeyTrie } from 'optimism';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n freezeResults?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n freezeResults: false,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new KeyTrie(canUseWeakMap);\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = !!this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeWriter = new StoreWriter();\n this.storeReader = new StoreReader({\n cacheKeyRoot: this.cacheKeyRoot,\n freezeResults: config.freezeResults,\n });\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction,\n previousResult: options.previousResult,\n config: this.config,\n }) || null;\n }\n\n public write(write: Cache.WriteOptions): void {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop()!;\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n"],"names":["defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;AAUA,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,SAAS,UAAU;IACjB,IAAM,MAAM,GAAG,CAAC,UAAU,CAAC;IAE3B,IAAI,CAAC,MAAM,EAAE,EAAE;QACb,UAAU,GAAG,IAAI,CAAC;KACnB;IACD,OAAO,MAAM,CAAC;CACf;AAKD;IACE;KAEC;IAEM,8CAAW,GAAlB;QACE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;IAEM,gDAAa,GAApB;QACE,OAAO,IAAI,CAAC;KACb;IAEM,wCAAK,GAAZ,UACE,OAAgB,EAChB,aAAqB,EACrB,OAAyB;QAEzB,IAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1C,IAAM,WAAW,GAAG,OAAO,CAAC,EAAE,KAAK,YAAY,CAAC;QAEhD,IAAI,CAAC,GAAG,EAAE;YAER,OAAO,WAAW,CAAC;SACpB;QAEO,IAAA,mBAAmC,EAAnC,wDAAmC,CAAS;QAEpD,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,UAAU,EAAE,EAAE;gBAChB;gBAIA,uDAC0C;gBA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EAAE,EAAE,CAAC,CAAC;KACjD;IAEM,yCAAiB,GAAxB,UAAyB,QAAsB;QAC7C,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAI,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;gBACzC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAIjD,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;aAChD;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,QAAQ,CAAC;KACjB;IAES,wCAAgB,GAA1B;QAAA,iBAIC;QAHC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC1B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;SACxD;KACF;IAIO,2CAAmB,GAA3B,UAA4B,CAAqB;QAC/C,CAAC,CAAC,QAAQ,CACR,IAAI,CAAC,IAAI,CAAC;YACR,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,cAAc,EAAE,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,cAAc,EAAE;YACtD,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CACH,CAAC;KACH;IACH,oBAAC;CAjRD,CAAmC,WAAW;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.umd.js b/node_modules/apollo-cache-inmemory/lib/bundle.umd.js deleted file mode 100644 index a25e9e0..0000000 --- a/node_modules/apollo-cache-inmemory/lib/bundle.umd.js +++ /dev/null @@ -1,1284 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(["exports", "tslib", "apollo-cache", "apollo-utilities", "optimism", "ts-invariant"], factory); - } else if (typeof exports !== "undefined") { - factory(exports, require("tslib"), require("apollo-cache"), require("apollo-utilities"), require("optimism"), require("ts-invariant")); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.tslib, global.apolloCache, global.apolloUtilities, global.optimism, global.tsInvariant); - global.unknown = mod.exports; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _tslib, _apolloCache, _apolloUtilities, _optimism, _tsInvariant) { - - _exports.__esModule = true; - _exports.assertIdValue = assertIdValue; - _exports.defaultDataIdFromObject = defaultDataIdFromObject; - _exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory$1; - _exports.enhanceErrorWithDocument = enhanceErrorWithDocument; - _exports.WriteError = _exports.StoreWriter = _exports.StoreReader = _exports.ObjectCache = _exports.IntrospectionFragmentMatcher = _exports.InMemoryCache = _exports.HeuristicFragmentMatcher = void 0; - var haveWarned = false; - - function shouldWarn() { - var answer = !haveWarned; - - if (!(0, _apolloUtilities.isTest)()) { - haveWarned = true; - } - - return answer; - } - - var HeuristicFragmentMatcher = function () { - function HeuristicFragmentMatcher() {} - - HeuristicFragmentMatcher.prototype.ensureReady = function () { - return Promise.resolve(); - }; - - HeuristicFragmentMatcher.prototype.canBypassInit = function () { - return true; - }; - - HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - - if (!obj) { - return isRootQuery; - } - - var _a = obj.__typename, - __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - - if (!__typename) { - if (shouldWarn()) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); - } - - return 'heuristic'; - } - - if (__typename === typeCondition) { - return true; - } - - if (shouldWarn()) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + 'queries contain union or interface types. Apollo Client will not be ' + 'able to accurately map fragments. To make this error go away, use ' + 'the `IntrospectionFragmentMatcher` as described in the docs: ' + 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); - } - - return 'heuristic'; - }; - - return HeuristicFragmentMatcher; - }(); - - _exports.HeuristicFragmentMatcher = HeuristicFragmentMatcher; - - var IntrospectionFragmentMatcher = function () { - function IntrospectionFragmentMatcher(options) { - if (options && options.introspectionQueryResultData) { - this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); - this.isReady = true; - } else { - this.isReady = false; - } - - this.match = this.match.bind(this); - } - - IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(this.isReady, 1) : (0, _tsInvariant.invariant)(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - - if (!obj) { - return isRootQuery; - } - - var _a = obj.__typename, - __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(__typename, 2) : (0, _tsInvariant.invariant)(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); - - if (__typename === typeCondition) { - return true; - } - - var implementingTypes = this.possibleTypesMap[typeCondition]; - - if (__typename && implementingTypes && implementingTypes.indexOf(__typename) > -1) { - return true; - } - - return false; - }; - - IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { - var typeMap = {}; - - introspectionResultData.__schema.types.forEach(function (type) { - if (type.kind === 'UNION' || type.kind === 'INTERFACE') { - typeMap[type.name] = type.possibleTypes.map(function (implementingType) { - return implementingType.name; - }); - } - }); - - return typeMap; - }; - - return IntrospectionFragmentMatcher; - }(); - - _exports.IntrospectionFragmentMatcher = IntrospectionFragmentMatcher; - var hasOwn = Object.prototype.hasOwnProperty; - - var DepTrackingCache = function () { - function DepTrackingCache(data) { - var _this = this; - - if (data === void 0) { - data = Object.create(null); - } - - this.data = data; - this.depend = (0, _optimism.wrap)(function (dataId) { - return _this.data[dataId]; - }, { - disposable: true, - makeCacheKey: function (dataId) { - return dataId; - } - }); - } - - DepTrackingCache.prototype.toObject = function () { - return this.data; - }; - - DepTrackingCache.prototype.get = function (dataId) { - this.depend(dataId); - return this.data[dataId]; - }; - - DepTrackingCache.prototype.set = function (dataId, value) { - var oldValue = this.data[dataId]; - - if (value !== oldValue) { - this.data[dataId] = value; - this.depend.dirty(dataId); - } - }; - - DepTrackingCache.prototype.delete = function (dataId) { - if (hasOwn.call(this.data, dataId)) { - delete this.data[dataId]; - this.depend.dirty(dataId); - } - }; - - DepTrackingCache.prototype.clear = function () { - this.replace(null); - }; - - DepTrackingCache.prototype.replace = function (newData) { - var _this = this; - - if (newData) { - Object.keys(newData).forEach(function (dataId) { - _this.set(dataId, newData[dataId]); - }); - Object.keys(this.data).forEach(function (dataId) { - if (!hasOwn.call(newData, dataId)) { - _this.delete(dataId); - } - }); - } else { - Object.keys(this.data).forEach(function (dataId) { - _this.delete(dataId); - }); - } - }; - - return DepTrackingCache; - }(); - - function defaultNormalizedCacheFactory(seed) { - return new DepTrackingCache(seed); - } - - var StoreReader = function () { - function StoreReader(_a) { - var _this = this; - - var _b = _a === void 0 ? {} : _a, - _c = _b.cacheKeyRoot, - cacheKeyRoot = _c === void 0 ? new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap) : _c, - _d = _b.freezeResults, - freezeResults = _d === void 0 ? false : _d; - - var _e = this, - executeStoreQuery = _e.executeStoreQuery, - executeSelectionSet = _e.executeSelectionSet, - executeSubSelectedArray = _e.executeSubSelectedArray; - - this.freezeResults = freezeResults; - this.executeStoreQuery = (0, _optimism.wrap)(function (options) { - return executeStoreQuery.call(_this, options); - }, { - makeCacheKey: function (_a) { - var query = _a.query, - rootValue = _a.rootValue, - contextValue = _a.contextValue, - variableValues = _a.variableValues, - fragmentMatcher = _a.fragmentMatcher; - - if (contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); - } - } - }); - this.executeSelectionSet = (0, _optimism.wrap)(function (options) { - return executeSelectionSet.call(_this, options); - }, { - makeCacheKey: function (_a) { - var selectionSet = _a.selectionSet, - rootValue = _a.rootValue, - execContext = _a.execContext; - - if (execContext.contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); - } - } - }); - this.executeSubSelectedArray = (0, _optimism.wrap)(function (options) { - return executeSubSelectedArray.call(_this, options); - }, { - makeCacheKey: function (_a) { - var field = _a.field, - array = _a.array, - execContext = _a.execContext; - - if (execContext.contextValue.store instanceof DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); - } - } - }); - } - - StoreReader.prototype.readQueryFromStore = function (options) { - return this.diffQueryAgainstStore((0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - returnPartialData: false - })).result; - }; - - StoreReader.prototype.diffQueryAgainstStore = function (_a) { - var store = _a.store, - query = _a.query, - variables = _a.variables, - previousResult = _a.previousResult, - _b = _a.returnPartialData, - returnPartialData = _b === void 0 ? true : _b, - _c = _a.rootId, - rootId = _c === void 0 ? 'ROOT_QUERY' : _c, - fragmentMatcherFunction = _a.fragmentMatcherFunction, - config = _a.config; - var queryDefinition = (0, _apolloUtilities.getQueryDefinition)(query); - variables = (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(queryDefinition), variables); - var context = { - store: store, - dataIdFromObject: config && config.dataIdFromObject, - cacheRedirects: config && config.cacheRedirects || {} - }; - var execResult = this.executeStoreQuery({ - query: query, - rootValue: { - type: 'id', - id: rootId, - generated: true, - typename: 'Query' - }, - contextValue: context, - variableValues: variables, - fragmentMatcher: fragmentMatcherFunction - }); - var hasMissingFields = execResult.missing && execResult.missing.length > 0; - - if (hasMissingFields && !returnPartialData) { - execResult.missing.forEach(function (info) { - if (info.tolerable) return; - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(8) : new _tsInvariant.InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); - }); - } - - if (previousResult) { - if ((0, _apolloUtilities.isEqual)(previousResult, execResult.result)) { - execResult.result = previousResult; - } - } - - return { - result: execResult.result, - complete: !hasMissingFields - }; - }; - - StoreReader.prototype.executeStoreQuery = function (_a) { - var query = _a.query, - rootValue = _a.rootValue, - contextValue = _a.contextValue, - variableValues = _a.variableValues, - _b = _a.fragmentMatcher, - fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; - var mainDefinition = (0, _apolloUtilities.getMainDefinition)(query); - var fragments = (0, _apolloUtilities.getFragmentDefinitions)(query); - var fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); - var execContext = { - query: query, - fragmentMap: fragmentMap, - contextValue: contextValue, - variableValues: variableValues, - fragmentMatcher: fragmentMatcher - }; - return this.executeSelectionSet({ - selectionSet: mainDefinition.selectionSet, - rootValue: rootValue, - execContext: execContext - }); - }; - - StoreReader.prototype.executeSelectionSet = function (_a) { - var _this = this; - - var selectionSet = _a.selectionSet, - rootValue = _a.rootValue, - execContext = _a.execContext; - var fragmentMap = execContext.fragmentMap, - contextValue = execContext.contextValue, - variables = execContext.variableValues; - var finalResult = { - result: null - }; - var objectsToMerge = []; - var object = contextValue.store.get(rootValue.id); - var typename = object && object.__typename || rootValue.id === 'ROOT_QUERY' && 'Query' || void 0; - - function handleMissing(result) { - var _a; - - if (result.missing) { - finalResult.missing = finalResult.missing || []; - - (_a = finalResult.missing).push.apply(_a, result.missing); - } - - return result.result; - } - - selectionSet.selections.forEach(function (selection) { - var _a; - - if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { - return; - } - - if ((0, _apolloUtilities.isField)(selection)) { - var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); - - if (typeof fieldResult !== 'undefined') { - objectsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); - } - } else { - var fragment = void 0; - - if ((0, _apolloUtilities.isInlineFragment)(selection)) { - fragment = selection; - } else { - fragment = fragmentMap[selection.name.value]; - - if (!fragment) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(9) : new _tsInvariant.InvariantError("No fragment named " + selection.name.value); - } - } - - var typeCondition = fragment.typeCondition && fragment.typeCondition.name.value; - var match = !typeCondition || execContext.fragmentMatcher(rootValue, typeCondition, contextValue); - - if (match) { - var fragmentExecResult = _this.executeSelectionSet({ - selectionSet: fragment.selectionSet, - rootValue: rootValue, - execContext: execContext - }); - - if (match === 'heuristic' && fragmentExecResult.missing) { - fragmentExecResult = (0, _tslib.__assign)((0, _tslib.__assign)({}, fragmentExecResult), { - missing: fragmentExecResult.missing.map(function (info) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, info), { - tolerable: true - }); - }) - }); - } - - objectsToMerge.push(handleMissing(fragmentExecResult)); - } - } - }); - finalResult.result = (0, _apolloUtilities.mergeDeepArray)(objectsToMerge); - - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(finalResult.result); - } - - return finalResult; - }; - - StoreReader.prototype.executeField = function (object, typename, field, execContext) { - var variables = execContext.variableValues, - contextValue = execContext.contextValue; - var fieldName = field.name.value; - var args = (0, _apolloUtilities.argumentsObjectFromField)(field, variables); - var info = { - resultKey: (0, _apolloUtilities.resultKeyNameFromField)(field), - directives: (0, _apolloUtilities.getDirectiveInfoFromField)(field, variables) - }; - var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); - - if (Array.isArray(readStoreResult.result)) { - return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ - field: field, - array: readStoreResult.result, - execContext: execContext - })); - } - - if (!field.selectionSet) { - assertSelectionSetForIdValue(field, readStoreResult.result); - - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - (0, _apolloUtilities.maybeDeepFreeze)(readStoreResult); - } - - return readStoreResult; - } - - if (readStoreResult.result == null) { - return readStoreResult; - } - - return this.combineExecResults(readStoreResult, this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: readStoreResult.result, - execContext: execContext - })); - }; - - StoreReader.prototype.combineExecResults = function () { - var execResults = []; - - for (var _i = 0; _i < arguments.length; _i++) { - execResults[_i] = arguments[_i]; - } - - var missing; - execResults.forEach(function (execResult) { - if (execResult.missing) { - missing = missing || []; - missing.push.apply(missing, execResult.missing); - } - }); - return { - result: execResults.pop().result, - missing: missing - }; - }; - - StoreReader.prototype.executeSubSelectedArray = function (_a) { - var _this = this; - - var field = _a.field, - array = _a.array, - execContext = _a.execContext; - var missing; - - function handleMissing(childResult) { - if (childResult.missing) { - missing = missing || []; - missing.push.apply(missing, childResult.missing); - } - - return childResult.result; - } - - array = array.map(function (item) { - if (item === null) { - return null; - } - - if (Array.isArray(item)) { - return handleMissing(_this.executeSubSelectedArray({ - field: field, - array: item, - execContext: execContext - })); - } - - if (field.selectionSet) { - return handleMissing(_this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: item, - execContext: execContext - })); - } - - assertSelectionSetForIdValue(field, item); - return item; - }); - - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(array); - } - - return { - result: array, - missing: missing - }; - }; - - return StoreReader; - }(); - - _exports.StoreReader = StoreReader; - - function assertSelectionSetForIdValue(field, value) { - if (!field.selectionSet && (0, _apolloUtilities.isIdValue)(value)) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(10) : new _tsInvariant.InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); - } - } - - function defaultFragmentMatcher() { - return true; - } - - function assertIdValue(idValue) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), 11) : (0, _tsInvariant.invariant)((0, _apolloUtilities.isIdValue)(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); - } - - function readStoreResolver(object, typename, fieldName, args, context, _a) { - var resultKey = _a.resultKey, - directives = _a.directives; - var storeKeyName = fieldName; - - if (args || directives) { - storeKeyName = (0, _apolloUtilities.getStoreKeyName)(storeKeyName, args, directives); - } - - var fieldValue = void 0; - - if (object) { - fieldValue = object[storeKeyName]; - - if (typeof fieldValue === 'undefined' && context.cacheRedirects && typeof typename === 'string') { - var type = context.cacheRedirects[typename]; - - if (type) { - var resolver = type[fieldName]; - - if (resolver) { - fieldValue = resolver(object, args, { - getCacheKey: function (storeObj) { - var id = context.dataIdFromObject(storeObj); - return id && (0, _apolloUtilities.toIdValue)({ - id: id, - typename: storeObj.__typename - }); - } - }); - } - } - } - } - - if (typeof fieldValue === 'undefined') { - return { - result: fieldValue, - missing: [{ - object: object, - fieldName: storeKeyName, - tolerable: false - }] - }; - } - - if ((0, _apolloUtilities.isJsonValue)(fieldValue)) { - fieldValue = fieldValue.json; - } - - return { - result: fieldValue - }; - } - - var ObjectCache = function () { - function ObjectCache(data) { - if (data === void 0) { - data = Object.create(null); - } - - this.data = data; - } - - ObjectCache.prototype.toObject = function () { - return this.data; - }; - - ObjectCache.prototype.get = function (dataId) { - return this.data[dataId]; - }; - - ObjectCache.prototype.set = function (dataId, value) { - this.data[dataId] = value; - }; - - ObjectCache.prototype.delete = function (dataId) { - this.data[dataId] = void 0; - }; - - ObjectCache.prototype.clear = function () { - this.data = Object.create(null); - }; - - ObjectCache.prototype.replace = function (newData) { - this.data = newData || Object.create(null); - }; - - return ObjectCache; - }(); - - _exports.ObjectCache = ObjectCache; - - function defaultNormalizedCacheFactory$1(seed) { - return new ObjectCache(seed); - } - - var WriteError = function (_super) { - (0, _tslib.__extends)(WriteError, _super); - - function WriteError() { - var _this = _super !== null && _super.apply(this, arguments) || this; - - _this.type = 'WriteError'; - return _this; - } - - return WriteError; - }(Error); - - _exports.WriteError = WriteError; - - function enhanceErrorWithDocument(error, document) { - var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); - enhancedError.message += '\n' + error.message; - enhancedError.stack = error.stack; - return enhancedError; - } - - var StoreWriter = function () { - function StoreWriter() {} - - StoreWriter.prototype.writeQueryToStore = function (_a) { - var query = _a.query, - result = _a.result, - _b = _a.store, - store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, - variables = _a.variables, - dataIdFromObject = _a.dataIdFromObject, - fragmentMatcherFunction = _a.fragmentMatcherFunction; - return this.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: query, - store: store, - variables: variables, - dataIdFromObject: dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction - }); - }; - - StoreWriter.prototype.writeResultToStore = function (_a) { - var dataId = _a.dataId, - result = _a.result, - document = _a.document, - _b = _a.store, - store = _b === void 0 ? defaultNormalizedCacheFactory() : _b, - variables = _a.variables, - dataIdFromObject = _a.dataIdFromObject, - fragmentMatcherFunction = _a.fragmentMatcherFunction; - var operationDefinition = (0, _apolloUtilities.getOperationDefinition)(document); - - try { - return this.writeSelectionSetToStore({ - result: result, - dataId: dataId, - selectionSet: operationDefinition.selectionSet, - context: { - store: store, - processedData: {}, - variables: (0, _apolloUtilities.assign)({}, (0, _apolloUtilities.getDefaultValues)(operationDefinition), variables), - dataIdFromObject: dataIdFromObject, - fragmentMap: (0, _apolloUtilities.createFragmentMap)((0, _apolloUtilities.getFragmentDefinitions)(document)), - fragmentMatcherFunction: fragmentMatcherFunction - } - }); - } catch (e) { - throw enhanceErrorWithDocument(e, document); - } - }; - - StoreWriter.prototype.writeSelectionSetToStore = function (_a) { - var _this = this; - - var result = _a.result, - dataId = _a.dataId, - selectionSet = _a.selectionSet, - context = _a.context; - var variables = context.variables, - store = context.store, - fragmentMap = context.fragmentMap; - selectionSet.selections.forEach(function (selection) { - var _a; - - if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { - return; - } - - if ((0, _apolloUtilities.isField)(selection)) { - var resultFieldKey = (0, _apolloUtilities.resultKeyNameFromField)(selection); - var value = result[resultFieldKey]; - - if (typeof value !== 'undefined') { - _this.writeFieldToStore({ - dataId: dataId, - value: value, - field: selection, - context: context - }); - } else { - var isDefered = false; - var isClient = false; - - if (selection.directives && selection.directives.length) { - isDefered = selection.directives.some(function (directive) { - return directive.name && directive.name.value === 'defer'; - }); - isClient = selection.directives.some(function (directive) { - return directive.name && directive.name.value === 'client'; - }); - } - - if (!isDefered && !isClient && context.fragmentMatcherFunction) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); - } - } - } else { - var fragment = void 0; - - if ((0, _apolloUtilities.isInlineFragment)(selection)) { - fragment = selection; - } else { - fragment = (fragmentMap || {})[selection.name.value]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 3) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value + "."); - } - - var matches = true; - - if (context.fragmentMatcherFunction && fragment.typeCondition) { - var id = dataId || 'self'; - var idValue = (0, _apolloUtilities.toIdValue)({ - id: id, - typename: undefined - }); - var fakeContext = { - store: new ObjectCache((_a = {}, _a[id] = result, _a)), - cacheRedirects: {} - }; - var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); - - if (!(0, _apolloUtilities.isProduction)() && match === 'heuristic') { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('WARNING: heuristic fragment matching going on!'); - } - - matches = !!match; - } - - if (matches) { - _this.writeSelectionSetToStore({ - result: result, - selectionSet: fragment.selectionSet, - dataId: dataId, - context: context - }); - } - } - }); - return store; - }; - - StoreWriter.prototype.writeFieldToStore = function (_a) { - var _b; - - var field = _a.field, - value = _a.value, - dataId = _a.dataId, - context = _a.context; - var variables = context.variables, - dataIdFromObject = context.dataIdFromObject, - store = context.store; - var storeValue; - var storeObject; - var storeFieldName = (0, _apolloUtilities.storeKeyNameFromField)(field, variables); - - if (!field.selectionSet || value === null) { - storeValue = value != null && typeof value === 'object' ? { - type: 'json', - json: value - } : value; - } else if (Array.isArray(value)) { - var generatedId = dataId + "." + storeFieldName; - storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); - } else { - var valueDataId = dataId + "." + storeFieldName; - var generated = true; - - if (!isGeneratedId(valueDataId)) { - valueDataId = '$' + valueDataId; - } - - if (dataIdFromObject) { - var semanticId = dataIdFromObject(value); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 4) : (0, _tsInvariant.invariant)(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); - - if (semanticId || typeof semanticId === 'number' && semanticId === 0) { - valueDataId = semanticId; - generated = false; - } - } - - if (!isDataProcessed(valueDataId, field, context.processedData)) { - this.writeSelectionSetToStore({ - dataId: valueDataId, - result: value, - selectionSet: field.selectionSet, - context: context - }); - } - - var typename = value.__typename; - storeValue = (0, _apolloUtilities.toIdValue)({ - id: valueDataId, - typename: typename - }, generated); - storeObject = store.get(dataId); - var escapedId = storeObject && storeObject[storeFieldName]; - - if (escapedId !== storeValue && (0, _apolloUtilities.isIdValue)(escapedId)) { - var hadTypename = escapedId.typename !== undefined; - var hasTypename = typename !== undefined; - var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, 5) : (0, _tsInvariant.invariant)(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!hadTypename || hasTypename, 6) : (0, _tsInvariant.invariant)(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - - if (escapedId.generated) { - if (typenameChanged) { - if (!generated) { - store.delete(escapedId.id); - } - } else { - mergeWithGenerated(escapedId.id, storeValue.id, store); - } - } - } - } - - storeObject = store.get(dataId); - - if (!storeObject || !(0, _apolloUtilities.isEqual)(storeValue, storeObject[storeFieldName])) { - store.set(dataId, (0, _tslib.__assign)((0, _tslib.__assign)({}, storeObject), (_b = {}, _b[storeFieldName] = storeValue, _b))); - } - }; - - StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { - var _this = this; - - return value.map(function (item, index) { - if (item === null) { - return null; - } - - var itemDataId = generatedId + "." + index; - - if (Array.isArray(item)) { - return _this.processArrayValue(item, itemDataId, selectionSet, context); - } - - var generated = true; - - if (context.dataIdFromObject) { - var semanticId = context.dataIdFromObject(item); - - if (semanticId) { - itemDataId = semanticId; - generated = false; - } - } - - if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { - _this.writeSelectionSetToStore({ - dataId: itemDataId, - result: item, - selectionSet: selectionSet, - context: context - }); - } - - return (0, _apolloUtilities.toIdValue)({ - id: itemDataId, - typename: item.__typename - }, generated); - }); - }; - - return StoreWriter; - }(); - - _exports.StoreWriter = StoreWriter; - - function isGeneratedId(id) { - return id[0] === '$'; - } - - function mergeWithGenerated(generatedKey, realKey, cache) { - if (generatedKey === realKey) { - return false; - } - - var generated = cache.get(generatedKey); - var real = cache.get(realKey); - var madeChanges = false; - Object.keys(generated).forEach(function (key) { - var value = generated[key]; - var realValue = real[key]; - - if ((0, _apolloUtilities.isIdValue)(value) && isGeneratedId(value.id) && (0, _apolloUtilities.isIdValue)(realValue) && !(0, _apolloUtilities.isEqual)(value, realValue) && mergeWithGenerated(value.id, realValue.id, cache)) { - madeChanges = true; - } - }); - cache.delete(generatedKey); - var newRealValue = (0, _tslib.__assign)((0, _tslib.__assign)({}, generated), real); - - if ((0, _apolloUtilities.isEqual)(newRealValue, real)) { - return madeChanges; - } - - cache.set(realKey, newRealValue); - return true; - } - - function isDataProcessed(dataId, field, processedData) { - if (!processedData) { - return false; - } - - if (processedData[dataId]) { - if (processedData[dataId].indexOf(field) >= 0) { - return true; - } else { - processedData[dataId].push(field); - } - } else { - processedData[dataId] = [field]; - } - - return false; - } - - var defaultConfig = { - fragmentMatcher: new HeuristicFragmentMatcher(), - dataIdFromObject: defaultDataIdFromObject, - addTypename: true, - resultCaching: true, - freezeResults: false - }; - - function defaultDataIdFromObject(result) { - if (result.__typename) { - if (result.id !== undefined) { - return result.__typename + ":" + result.id; - } - - if (result._id !== undefined) { - return result.__typename + ":" + result._id; - } - } - - return null; - } - - var hasOwn$1 = Object.prototype.hasOwnProperty; - - var OptimisticCacheLayer = function (_super) { - (0, _tslib.__extends)(OptimisticCacheLayer, _super); - - function OptimisticCacheLayer(optimisticId, parent, transaction) { - var _this = _super.call(this, Object.create(null)) || this; - - _this.optimisticId = optimisticId; - _this.parent = parent; - _this.transaction = transaction; - return _this; - } - - OptimisticCacheLayer.prototype.toObject = function () { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, this.parent.toObject()), this.data); - }; - - OptimisticCacheLayer.prototype.get = function (dataId) { - return hasOwn$1.call(this.data, dataId) ? this.data[dataId] : this.parent.get(dataId); - }; - - return OptimisticCacheLayer; - }(ObjectCache); - - var InMemoryCache = function (_super) { - (0, _tslib.__extends)(InMemoryCache, _super); - - function InMemoryCache(config) { - if (config === void 0) { - config = {}; - } - - var _this = _super.call(this) || this; - - _this.watches = new Set(); - _this.typenameDocumentCache = new Map(); - _this.cacheKeyRoot = new _optimism.KeyTrie(_apolloUtilities.canUseWeakMap); - _this.silenceBroadcast = false; - _this.config = (0, _tslib.__assign)((0, _tslib.__assign)({}, defaultConfig), config); - - if (_this.config.customResolvers) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.customResolvers; - } - - if (_this.config.cacheResolvers) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.cacheResolvers; - } - - _this.addTypename = !!_this.config.addTypename; - _this.data = _this.config.resultCaching ? new DepTrackingCache() : new ObjectCache(); - _this.optimisticData = _this.data; - _this.storeWriter = new StoreWriter(); - _this.storeReader = new StoreReader({ - cacheKeyRoot: _this.cacheKeyRoot, - freezeResults: config.freezeResults - }); - var cache = _this; - var maybeBroadcastWatch = cache.maybeBroadcastWatch; - _this.maybeBroadcastWatch = (0, _optimism.wrap)(function (c) { - return maybeBroadcastWatch.call(_this, c); - }, { - makeCacheKey: function (c) { - if (c.optimistic) { - return; - } - - if (c.previousResult) { - return; - } - - if (cache.data instanceof DepTrackingCache) { - return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); - } - } - }); - return _this; - } - - InMemoryCache.prototype.restore = function (data) { - if (data) this.data.replace(data); - return this; - }; - - InMemoryCache.prototype.extract = function (optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return (optimistic ? this.optimisticData : this.data).toObject(); - }; - - InMemoryCache.prototype.read = function (options) { - if (typeof options.rootId === 'string' && typeof this.data.get(options.rootId) === 'undefined') { - return null; - } - - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config - }) || null; - }; - - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - this.storeWriter.writeResultToStore({ - dataId: write.dataId, - result: write.result, - variables: write.variables, - document: this.transformDocument(write.query), - store: this.data, - dataIdFromObject: this.config.dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction - }); - this.broadcastWatches(); - }; - - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.diffQueryAgainstStore({ - store: query.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(query.query), - variables: query.variables, - returnPartialData: query.returnPartialData, - previousResult: query.previousResult, - fragmentMatcherFunction: fragmentMatcherFunction, - config: this.config - }); - }; - - InMemoryCache.prototype.watch = function (watch) { - var _this = this; - - this.watches.add(watch); - return function () { - _this.watches.delete(watch); - }; - }; - - InMemoryCache.prototype.evict = function (query) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(7) : new _tsInvariant.InvariantError("eviction is not implemented on InMemory Cache"); - }; - - InMemoryCache.prototype.reset = function () { - this.data.clear(); - this.broadcastWatches(); - return Promise.resolve(); - }; - - InMemoryCache.prototype.removeOptimistic = function (idToRemove) { - var toReapply = []; - var removedCount = 0; - var layer = this.optimisticData; - - while (layer instanceof OptimisticCacheLayer) { - if (layer.optimisticId === idToRemove) { - ++removedCount; - } else { - toReapply.push(layer); - } - - layer = layer.parent; - } - - if (removedCount > 0) { - this.optimisticData = layer; - - while (toReapply.length > 0) { - var layer_1 = toReapply.pop(); - this.performTransaction(layer_1.transaction, layer_1.optimisticId); - } - - this.broadcastWatches(); - } - }; - - InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { - var _a = this, - data = _a.data, - silenceBroadcast = _a.silenceBroadcast; - - this.silenceBroadcast = true; - - if (typeof optimisticId === 'string') { - this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); - } - - try { - transaction(this); - } finally { - this.silenceBroadcast = silenceBroadcast; - this.data = data; - } - - this.broadcastWatches(); - }; - - InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { - return this.performTransaction(transaction, id); - }; - - InMemoryCache.prototype.transformDocument = function (document) { - if (this.addTypename) { - var result = this.typenameDocumentCache.get(document); - - if (!result) { - result = (0, _apolloUtilities.addTypenameToDocument)(document); - this.typenameDocumentCache.set(document, result); - this.typenameDocumentCache.set(result, result); - } - - return result; - } - - return document; - }; - - InMemoryCache.prototype.broadcastWatches = function () { - var _this = this; - - if (!this.silenceBroadcast) { - this.watches.forEach(function (c) { - return _this.maybeBroadcastWatch(c); - }); - } - }; - - InMemoryCache.prototype.maybeBroadcastWatch = function (c) { - c.callback(this.diff({ - query: c.query, - variables: c.variables, - previousResult: c.previousResult && c.previousResult(), - optimistic: c.optimistic - })); - }; - - return InMemoryCache; - }(_apolloCache.ApolloCache); - - - _exports.InMemoryCache = InMemoryCache; -}); diff --git a/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map b/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map deleted file mode 100644 index 867e016..0000000 --- a/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"names":["defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,MAAI,UAAU,GAAG,KAAjB;;AAEA,WAAS,UAAT,GAAmB;AACjB,QAAM,MAAM,GAAG,CAAC,UAAhB;;AAEA,QAAI,CAAC,8BAAL,EAAe;AACb,MAAA,UAAU,GAAG,IAAb;AACD;;A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ext,\n FragmentMatcherInterface,\n PossibleTypesMap,\n IntrospectionResultData,\n} from './types';\n\nlet haveWarned = false;\n\nfunction shouldWarn() {\n const answer = !haveWarned;\n /* istanbul ignore if */\n if (!isTest()) {\n haveWarned = true;\n }\n return answer;\n}\n\n/**\n * This fragment matcher is very basic and unable to match union or interface type conditions\n */\nexport class HeuristicFragmentMatcher implements FragmentMatcherInterface {\n constructor() {\n // do nothing\n }\n\n public ensureReady() {\n return Promise.resolve();\n }\n\n public canBypassInit() {\n return true; // we don't need to initialize this fragment matcher.\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ): boolean | 'heuristic' {\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/3507\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n if (!__typename) {\n if (shouldWarn()) {\n invariant.warn(`You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments.`);\n invariant.warn(\n 'Could not find __typename on Fragment ',\n typeCondition,\n obj,\n );\n invariant.warn(\n `DEPRECATION WARNING: using fragments without __typename is unsupported behavior ` +\n `and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now.`,\n );\n }\n\n return 'heuristic';\n }\n\n if (__typename === typeCondition) {\n return true;\n }\n\n // At this point we don't know if this fragment should match or not. It's\n // either:\n //\n // 1. (GOOD) A fragment on a matching interface or union.\n // 2. (BAD) A fragment on a non-matching concrete type or interface or union.\n //\n // If it's 2, we don't want it to match. If it's 1, we want it to match. We\n // can't tell the difference, so we warn the user, but still try to match\n // it (for backwards compatibility reasons). This unfortunately means that\n // using the `HeuristicFragmentMatcher` with unions and interfaces is\n // very unreliable. This will be addressed in a future major version of\n // Apollo Client, but for now the recommendation is to use the\n // `IntrospectionFragmentMatcher` when working with unions/interfaces.\n\n if (shouldWarn()) {\n invariant.error(\n 'You are using the simple (heuristic) fragment matcher, but your ' +\n 'queries contain union or interface types. Apollo Client will not be ' +\n 'able to accurately map fragments. To make this error go away, use ' +\n 'the `IntrospectionFragmentMatcher` as described in the docs: ' +\n 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher',\n );\n }\n\n return 'heuristic';\n }\n}\n\nexport class IntrospectionFragmentMatcher implements FragmentMatcherInterface {\n private isReady: boolean;\n private possibleTypesMap: PossibleTypesMap;\n\n constructor(options?: {\n introspectionQueryResultData?: IntrospectionResultData;\n }) {\n if (options && options.introspectionQueryResultData) {\n this.possibleTypesMap = this.parseIntrospectionResult(\n options.introspectionQueryResultData,\n );\n this.isReady = true;\n } else {\n this.isReady = false;\n }\n\n this.match = this.match.bind(this);\n }\n\n public match(\n idValue: IdValue,\n typeCondition: string,\n context: ReadStoreContext,\n ) {\n invariant(\n this.isReady,\n 'FragmentMatcher.match() was called before FragmentMatcher.init()',\n );\n\n const obj = context.store.get(idValue.id);\n const isRootQuery = idValue.id === 'ROOT_QUERY';\n\n if (!obj) {\n // https://github.com/apollographql/apollo-client/pull/4620\n return isRootQuery;\n }\n\n const { __typename = isRootQuery && 'Query' } = obj;\n\n invariant(\n __typename,\n `Cannot match fragment because __typename property is missing: ${JSON.stringify(\n obj,\n )}`,\n );\n\n if (__typename === typeCondition) {\n return true;\n }\n\n const implementingTypes = this.possibleTypesMap[typeCondition];\n if (\n __typename &&\n implementingTypes &&\n implementingTypes.indexOf(__typename) > -1\n ) {\n return true;\n }\n\n return false;\n }\n\n private parseIntrospectionResult(\n introspectionResultData: IntrospectionResultData,\n ): PossibleTypesMap {\n const typeMap: PossibleTypesMap = {};\n introspectionResultData.__schema.types.forEach(type => {\n if (type.kind === 'UNION' || type.kind === 'INTERFACE') {\n typeMap[type.name] = type.possibleTypes.map(\n implementingType => implementingType.name,\n );\n }\n });\n return typeMap;\n }\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\nimport { wrap, OptimisticWrapperFunction } from 'optimism';\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class DepTrackingCache implements NormalizedCache {\n // Wrapper function produced by the optimism library, used to depend on\n // dataId strings, for easy invalidation of specific IDs.\n private depend: OptimisticWrapperFunction<[string], StoreObject | undefined>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((dataId: string) => this.data[dataId], {\n disposable: true,\n makeCacheKey(dataId: string) {\n return dataId;\n },\n });\n }\n\n public toObject(): NormalizedCacheObject {\n return this.data;\n }\n\n public get(dataId: string): StoreObject {\n this.depend(dataId);\n return this.data[dataId]!;\n }\n\n public set(dataId: string, value?: StoreObject) {\n const oldValue = this.data[dataId];\n if (value !== oldValue) {\n this.data[dataId] = value;\n this.depend.dirty(dataId);\n }\n }\n\n public delete(dataId: string): void {\n if (hasOwn.call(this.data, dataId)) {\n delete this.data[dataId];\n this.depend.dirty(dataId);\n }\n }\n\n public clear(): void {\n this.replace(null);\n }\n\n public replace(newData: NormalizedCacheObject | null): void {\n if (newData) {\n Object.keys(newData).forEach(dataId => {\n this.set(dataId, newData[dataId]);\n });\n Object.keys(this.data).forEach(dataId => {\n if (!hasOwn.call(newData, dataId)) {\n this.delete(dataId);\n }\n });\n } else {\n Object.keys(this.data).forEach(dataId => {\n this.delete(dataId);\n });\n }\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new DepTrackingCache(seed);\n}\n","import {\n argumentsObjectFromField,\n assign,\n canUseWeakMap,\n createFragmentMap,\n DirectiveInfo,\n FragmentMap,\n getDefaultValues,\n getDirectiveInfoFromField,\n getFragmentDefinitions,\n getMainDefinition,\n getQueryDefinition,\n getStoreKeyName,\n IdValue,\n isEqual,\n isField,\n isIdValue,\n isInlineFragment,\n isJsonValue,\n maybeDeepFreeze,\n mergeDeepArray,\n resultKeyNameFromField,\n shouldInclude,\n StoreValue,\n toIdValue,\n} from 'apollo-utilities';\n\nimport { Cache } from 'apollo-cache';\n\nimport {\n ReadStoreContext,\n DiffQueryAgainstStoreOptions,\n ReadQueryOptions,\n StoreObject,\n} from './types';\n\nimport {\n DocumentNode,\n FieldNode,\n FragmentDefinitionNode,\n InlineFragmentNode,\n SelectionSetNode,\n} from 'graphql';\n\nimport { wrap, KeyTrie } from 'optimism';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: ReadStoreContext,\n) => boolean | 'heuristic';\n\ntype ExecContext = {\n query: DocumentNode;\n fragmentMap: FragmentMap;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n fragmentMatcher: FragmentMatcher;\n};\n\ntype ExecInfo = {\n resultKey: string;\n directives: DirectiveInfo;\n};\n\nexport type ExecResultMissingField = {\n object: StoreObject;\n fieldName: string;\n tolerable: boolean;\n};\n\nexport type ExecResult = {\n result: R;\n // Empty array if no missing fields encountered while computing result.\n missing?: ExecResultMissingField[];\n};\n\ntype ExecStoreQueryOptions = {\n query: DocumentNode;\n rootValue: IdValue;\n contextValue: ReadStoreContext;\n variableValues: VariableMap;\n // Default matcher always matches all fragments\n fragmentMatcher?: FragmentMatcher;\n};\n\ntype ExecSelectionSetOptions = {\n selectionSet: SelectionSetNode;\n rootValue: any;\n execContext: ExecContext;\n};\n\ntype ExecSubSelectedArrayOptions = {\n field: FieldNode;\n array: any[];\n execContext: ExecContext;\n};\n\nexport interface StoreReaderConfig {\n cacheKeyRoot?: KeyTrie;\n freezeResults?: boolean;\n}\n\nexport class StoreReader {\n private freezeResults: boolean;\n\n constructor({\n cacheKeyRoot = new KeyTrie(canUseWeakMap),\n freezeResults = false,\n }: StoreReaderConfig = {}) {\n const {\n executeStoreQuery,\n executeSelectionSet,\n executeSubSelectedArray,\n } = this;\n\n this.freezeResults = freezeResults;\n\n this.executeStoreQuery = wrap((options: ExecStoreQueryOptions) => {\n return executeStoreQuery.call(this, options);\n }, {\n makeCacheKey({\n query,\n rootValue,\n contextValue,\n variableValues,\n fragmentMatcher,\n }: ExecStoreQueryOptions) {\n // The result of executeStoreQuery can be safely cached only if the\n // underlying store is capable of tracking dependencies and invalidating\n // the cache when relevant data have changed.\n if (contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n contextValue.store,\n query,\n fragmentMatcher,\n JSON.stringify(variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSelectionSet = wrap((options: ExecSelectionSetOptions) => {\n return executeSelectionSet.call(this, options);\n }, {\n makeCacheKey({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n selectionSet,\n execContext.fragmentMatcher,\n JSON.stringify(execContext.variableValues),\n rootValue.id,\n );\n }\n }\n });\n\n this.executeSubSelectedArray = wrap((options: ExecSubSelectedArrayOptions) => {\n return executeSubSelectedArray.call(this, options);\n }, {\n makeCacheKey({ field, array, execContext }) {\n if (execContext.contextValue.store instanceof DepTrackingCache) {\n return cacheKeyRoot.lookup(\n execContext.contextValue.store,\n field,\n array,\n JSON.stringify(execContext.variableValues),\n );\n }\n }\n });\n }\n\n /**\n * Resolves the result of a query solely from the store (i.e. never hits the server).\n *\n * @param {Store} store The {@link NormalizedCache} used by Apollo for the `data` portion of the\n * store.\n *\n * @param {DocumentNode} query The query document to resolve from the data available in the store.\n *\n * @param {Object} [variables] A map from the name of a variable to its value. These variables can\n * be referenced by the query document.\n *\n * @param {any} previousResult The previous result returned by this function for the same query.\n * If nothing in the store changed since that previous result then values from the previous result\n * will be returned to preserve referential equality.\n */\n public readQueryFromStore(\n options: ReadQueryOptions,\n ): QueryType | undefined {\n return this.diffQueryAgainstStore({\n ...options,\n returnPartialData: false,\n }).result;\n }\n\n /**\n * Given a store and a query, return as much of the result as possible and\n * identify if any data was missing from the store.\n * @param {DocumentNode} query A parsed GraphQL query document\n * @param {Store} store The Apollo Client store object\n * @param {any} previousResult The previous result returned by this function for the same query\n * @return {result: Object, complete: [boolean]}\n */\n public diffQueryAgainstStore({\n store,\n query,\n variables,\n previousResult,\n returnPartialData = true,\n rootId = 'ROOT_QUERY',\n fragmentMatcherFunction,\n config,\n }: DiffQueryAgainstStoreOptions): Cache.DiffResult {\n // Throw the right validation error by trying to find a query in the document\n const queryDefinition = getQueryDefinition(query);\n\n variables = assign({}, getDefaultValues(queryDefinition), variables);\n\n const context: ReadStoreContext = {\n // Global settings\n store,\n dataIdFromObject: config && config.dataIdFromObject,\n cacheRedirects: (config && config.cacheRedirects) || {},\n };\n\n const execResult = this.executeStoreQuery({\n query,\n rootValue: {\n type: 'id',\n id: rootId,\n generated: true,\n typename: 'Query',\n },\n contextValue: context,\n variableValues: variables,\n fragmentMatcher: fragmentMatcherFunction,\n });\n\n const hasMissingFields =\n execResult.missing && execResult.missing.length > 0;\n\n if (hasMissingFields && ! returnPartialData) {\n execResult.missing!.forEach(info => {\n if (info.tolerable) return;\n throw new InvariantError(\n `Can't find field ${info.fieldName} on object ${JSON.stringify(\n info.object,\n null,\n 2,\n )}.`,\n );\n });\n }\n\n if (previousResult) {\n if (isEqual(previousResult, execResult.result)) {\n execResult.result = previousResult;\n }\n }\n\n return {\n result: execResult.result,\n complete: !hasMissingFields,\n };\n }\n\n /**\n * Based on graphql function from graphql-js:\n *\n * graphql(\n * schema: GraphQLSchema,\n * requestString: string,\n * rootValue?: ?any,\n * contextValue?: ?any,\n * variableValues?: ?{[key: string]: any},\n * operationName?: ?string\n * ): Promise\n *\n * The default export as of graphql-anywhere is sync as of 4.0,\n * but below is an exported alternative that is async.\n * In the 5.0 version, this will be the only export again\n * and it will be async\n *\n */\n private executeStoreQuery({\n query,\n rootValue,\n contextValue,\n variableValues,\n // Default matcher always matches all fragments\n fragmentMatcher = defaultFragmentMatcher,\n }: ExecStoreQueryOptions): ExecResult {\n const mainDefinition = getMainDefinition(query);\n const fragments = getFragmentDefinitions(query);\n const fragmentMap = createFragmentMap(fragments);\n const execContext: ExecContext = {\n query,\n fragmentMap,\n contextValue,\n variableValues,\n fragmentMatcher,\n };\n\n return this.executeSelectionSet({\n selectionSet: mainDefinition.selectionSet,\n rootValue,\n execContext,\n });\n }\n\n private executeSelectionSet({\n selectionSet,\n rootValue,\n execContext,\n }: ExecSelectionSetOptions): ExecResult {\n const { fragmentMap, contextValue, variableValues: variables } = execContext;\n const finalResult: ExecResult = { result: null };\n\n const objectsToMerge: { [key: string]: any }[] = [];\n\n const object: StoreObject = contextValue.store.get(rootValue.id);\n\n const typename =\n (object && object.__typename) ||\n (rootValue.id === 'ROOT_QUERY' && 'Query') ||\n void 0;\n\n function handleMissing(result: ExecResult): T {\n if (result.missing) {\n finalResult.missing = finalResult.missing || [];\n finalResult.missing.push(...result.missing);\n }\n return result.result;\n }\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely\n return;\n }\n\n if (isField(selection)) {\n const fieldResult = handleMissing(\n this.executeField(object, typename, selection, execContext),\n );\n\n if (typeof fieldResult !== 'undefined') {\n objectsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n });\n }\n\n } else {\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment\n fragment = fragmentMap[selection.name.value];\n\n if (!fragment) {\n throw new InvariantError(`No fragment named ${selection.name.value}`);\n }\n }\n\n const typeCondition =\n fragment.typeCondition && fragment.typeCondition.name.value;\n\n const match =\n !typeCondition ||\n execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n\n if (match) {\n let fragmentExecResult = this.executeSelectionSet({\n selectionSet: fragment.selectionSet,\n rootValue,\n execContext,\n });\n\n if (match === 'heuristic' && fragmentExecResult.missing) {\n fragmentExecResult = {\n ...fragmentExecResult,\n missing: fragmentExecResult.missing.map(info => {\n return { ...info, tolerable: true };\n }),\n };\n }\n\n objectsToMerge.push(handleMissing(fragmentExecResult));\n }\n }\n });\n\n // Perform a single merge at the end so that we can avoid making more\n // defensive shallow copies than necessary.\n finalResult.result = mergeDeepArray(objectsToMerge);\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(finalResult.result);\n }\n\n return finalResult;\n }\n\n private executeField(\n object: StoreObject,\n typename: string | void,\n field: FieldNode,\n execContext: ExecContext,\n ): ExecResult {\n const { variableValues: variables, contextValue } = execContext;\n const fieldName = field.name.value;\n const args = argumentsObjectFromField(field, variables);\n\n const info: ExecInfo = {\n resultKey: resultKeyNameFromField(field),\n directives: getDirectiveInfoFromField(field, variables),\n };\n\n const readStoreResult = readStoreResolver(\n object,\n typename,\n fieldName,\n args,\n contextValue,\n info,\n );\n\n if (Array.isArray(readStoreResult.result)) {\n return this.combineExecResults(\n readStoreResult,\n this.executeSubSelectedArray({\n field,\n array: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n // Handle all scalar types here\n if (!field.selectionSet) {\n assertSelectionSetForIdValue(field, readStoreResult.result);\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n maybeDeepFreeze(readStoreResult);\n }\n return readStoreResult;\n }\n\n // From here down, the field has a selection set, which means it's trying to\n // query a GraphQLObjectType\n if (readStoreResult.result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return readStoreResult;\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n return this.combineExecResults(\n readStoreResult,\n this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: readStoreResult.result,\n execContext,\n }),\n );\n }\n\n private combineExecResults(\n ...execResults: ExecResult[]\n ): ExecResult {\n let missing: ExecResultMissingField[] | undefined;\n execResults.forEach(execResult => {\n if (execResult.missing) {\n missing = missing || [];\n missing.push(...execResult.missing);\n }\n });\n return {\n result: execResults.pop()!.result,\n missing,\n };\n }\n\n private executeSubSelectedArray({\n field,\n array,\n execContext,\n }: ExecSubSelectedArrayOptions): ExecResult {\n let missing: ExecResultMissingField[] | undefined;\n\n function handleMissing(childResult: ExecResult): T {\n if (childResult.missing) {\n missing = missing || [];\n missing.push(...childResult.missing);\n }\n\n return childResult.result;\n }\n\n array = array.map(item => {\n // null value in array\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse\n if (Array.isArray(item)) {\n return handleMissing(this.executeSubSelectedArray({\n field,\n array: item,\n execContext,\n }));\n }\n\n // This is an object, run the selection set on it\n if (field.selectionSet) {\n return handleMissing(this.executeSelectionSet({\n selectionSet: field.selectionSet,\n rootValue: item,\n execContext,\n }));\n }\n\n assertSelectionSetForIdValue(field, item);\n\n return item;\n });\n\n if (this.freezeResults && process.env.NODE_ENV !== 'production') {\n Object.freeze(array);\n }\n\n return { result: array, missing };\n }\n}\n\nfunction assertSelectionSetForIdValue(\n field: FieldNode,\n value: any,\n) {\n if (!field.selectionSet && isIdValue(value)) {\n throw new InvariantError(\n `Missing selection set for object of type ${\n value.typename\n } returned for query field ${field.name.value}`\n );\n }\n}\n\nfunction defaultFragmentMatcher() {\n return true;\n}\n\nexport function assertIdValue(idValue: IdValue) {\n invariant(isIdValue(idValue), `\\\nEncountered a sub-selection on the query, but the store doesn't have \\\nan object reference. This should never happen during normal use unless you have custom code \\\nthat is directly manipulating the store; please file an issue.`);\n}\n\nfunction readStoreResolver(\n object: StoreObject,\n typename: string | void,\n fieldName: string,\n args: any,\n context: ReadStoreContext,\n { resultKey, directives }: ExecInfo,\n): ExecResult {\n let storeKeyName = fieldName;\n if (args || directives) {\n // We happen to know here that getStoreKeyName returns its first\n // argument unmodified if there are no args or directives, so we can\n // avoid calling the function at all in that case, as a small but\n // important optimization to this frequently executed code.\n storeKeyName = getStoreKeyName(storeKeyName, args, directives);\n }\n\n let fieldValue: StoreValue | void = void 0;\n\n if (object) {\n fieldValue = object[storeKeyName];\n\n if (\n typeof fieldValue === 'undefined' &&\n context.cacheRedirects &&\n typeof typename === 'string'\n ) {\n // Look for the type in the custom resolver map\n const type = context.cacheRedirects[typename];\n if (type) {\n // Look for the field in the custom resolver map\n const resolver = type[fieldName];\n if (resolver) {\n fieldValue = resolver(object, args, {\n getCacheKey(storeObj: StoreObject) {\n const id = context.dataIdFromObject!(storeObj);\n return id && toIdValue({\n id,\n typename: storeObj.__typename,\n });\n },\n });\n }\n }\n }\n }\n\n if (typeof fieldValue === 'undefined') {\n return {\n result: fieldValue,\n missing: [{\n object,\n fieldName: storeKeyName,\n tolerable: false,\n }],\n };\n }\n\n if (isJsonValue(fieldValue)) {\n fieldValue = fieldValue.json;\n }\n\n return {\n result: fieldValue,\n };\n}\n","import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types';\n\nexport class ObjectCache implements NormalizedCache {\n constructor(protected data: NormalizedCacheObject = Object.create(null)) {}\n\n public toObject() {\n return this.data;\n }\n\n public get(dataId: string) {\n return this.data[dataId]!;\n }\n\n public set(dataId: string, value: StoreObject) {\n this.data[dataId] = value;\n }\n\n public delete(dataId: string) {\n this.data[dataId] = void 0;\n }\n\n public clear() {\n this.data = Object.create(null);\n }\n\n public replace(newData: NormalizedCacheObject) {\n this.data = newData || Object.create(null);\n }\n}\n\nexport function defaultNormalizedCacheFactory(\n seed?: NormalizedCacheObject,\n): NormalizedCache {\n return new ObjectCache(seed);\n}\n","import {\n SelectionSetNode,\n FieldNode,\n DocumentNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n} from 'graphql';\nimport { FragmentMatcher } from './readFromStore';\n\nimport {\n assign,\n createFragmentMap,\n FragmentMap,\n getDefaultValues,\n getFragmentDefinitions,\n getOperationDefinition,\n IdValue,\n isField,\n isIdValue,\n isInlineFragment,\n isProduction,\n resultKeyNameFromField,\n shouldInclude,\n storeKeyNameFromField,\n StoreValue,\n toIdValue,\n isEqual,\n} from 'apollo-utilities';\n\nimport { invariant } from 'ts-invariant';\n\nimport { ObjectCache } from './objectCache';\nimport { defaultNormalizedCacheFactory } from './depTrackingCache';\n\nimport {\n IdGetter,\n NormalizedCache,\n ReadStoreContext,\n StoreObject,\n} from './types';\n\nexport class WriteError extends Error {\n public type = 'WriteError';\n}\n\nexport function enhanceErrorWithDocument(error: Error, document: DocumentNode) {\n // XXX A bit hacky maybe ...\n const enhancedError = new WriteError(\n `Error writing result to store for query:\\n ${JSON.stringify(document)}`,\n );\n enhancedError.message += '\\n' + error.message;\n enhancedError.stack = error.stack;\n return enhancedError;\n}\n\nexport type WriteContext = {\n readonly store: NormalizedCache;\n readonly processedData?: { [x: string]: FieldNode[] };\n readonly variables?: any;\n readonly dataIdFromObject?: IdGetter;\n readonly fragmentMap?: FragmentMap;\n readonly fragmentMatcherFunction?: FragmentMatcher;\n};\n\nexport class StoreWriter {\n /**\n * Writes the result of a query to the store.\n *\n * @param result The result object returned for the query document.\n *\n * @param query The query document whose result we are writing to the store.\n *\n * @param store The {@link NormalizedCache} used by Apollo for the `data` portion of the store.\n *\n * @param variables A map from the name of a variable to its value. These variables can be\n * referenced by the query document.\n *\n * @param dataIdFromObject A function that returns an object identifier given a particular result\n * object. See the store documentation for details and an example of this function.\n *\n * @param fragmentMatcherFunction A function to use for matching fragment conditions in GraphQL documents\n */\n public writeQueryToStore({\n query,\n result,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n query: DocumentNode;\n result: Object;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n return this.writeResultToStore({\n dataId: 'ROOT_QUERY',\n result,\n document: query,\n store,\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n });\n }\n\n public writeResultToStore({\n dataId,\n result,\n document,\n store = defaultNormalizedCacheFactory(),\n variables,\n dataIdFromObject,\n fragmentMatcherFunction,\n }: {\n dataId: string;\n result: any;\n document: DocumentNode;\n store?: NormalizedCache;\n variables?: Object;\n dataIdFromObject?: IdGetter;\n fragmentMatcherFunction?: FragmentMatcher;\n }): NormalizedCache {\n // XXX TODO REFACTOR: this is a temporary workaround until query normalization is made to work with documents.\n const operationDefinition = getOperationDefinition(document)!;\n\n try {\n return this.writeSelectionSetToStore({\n result,\n dataId,\n selectionSet: operationDefinition.selectionSet,\n context: {\n store,\n processedData: {},\n variables: assign(\n {},\n getDefaultValues(operationDefinition),\n variables,\n ),\n dataIdFromObject,\n fragmentMap: createFragmentMap(getFragmentDefinitions(document)),\n fragmentMatcherFunction,\n },\n });\n } catch (e) {\n throw enhanceErrorWithDocument(e, document);\n }\n }\n\n public writeSelectionSetToStore({\n result,\n dataId,\n selectionSet,\n context,\n }: {\n dataId: string;\n result: any;\n selectionSet: SelectionSetNode;\n context: WriteContext;\n }): NormalizedCache {\n const { variables, store, fragmentMap } = context;\n\n selectionSet.selections.forEach(selection => {\n if (!shouldInclude(selection, variables)) {\n return;\n }\n\n if (isField(selection)) {\n const resultFieldKey: string = resultKeyNameFromField(selection);\n const value: any = result[resultFieldKey];\n\n if (typeof value !== 'undefined') {\n this.writeFieldToStore({\n dataId,\n value,\n field: selection,\n context,\n });\n } else {\n let isDefered = false;\n let isClient = false;\n if (selection.directives && selection.directives.length) {\n // If this is a defered field we don't need to throw / warn.\n isDefered = selection.directives.some(\n directive => directive.name && directive.name.value === 'defer',\n );\n\n // When using the @client directive, it might be desirable in\n // some cases to want to write a selection set to the store,\n // without having all of the selection set values available.\n // This is because the @client field values might have already\n // been written to the cache separately (e.g. via Apollo\n // Cache's `writeData` capabilities). Because of this, we'll\n // skip the missing field warning for fields with @client\n // directives.\n isClient = selection.directives.some(\n directive => directive.name && directive.name.value === 'client',\n );\n }\n\n if (!isDefered && !isClient && context.fragmentMatcherFunction) {\n // XXX We'd like to throw an error, but for backwards compatibility's sake\n // we just print a warning for the time being.\n //throw new WriteError(`Missing field ${resultFieldKey} in ${JSON.stringify(result, null, 2).substring(0, 100)}`);\n invariant.warn(\n `Missing field ${resultFieldKey} in ${JSON.stringify(\n result,\n null,\n 2,\n ).substring(0, 100)}`,\n );\n }\n }\n } else {\n // This is not a field, so it must be a fragment, either inline or named\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // Named fragment\n fragment = (fragmentMap || {})[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}.`);\n }\n\n let matches = true;\n if (context.fragmentMatcherFunction && fragment.typeCondition) {\n // TODO we need to rewrite the fragment matchers for this to work properly and efficiently\n // Right now we have to pretend that we're passing in an idValue and that there's a store\n // on the context.\n const id = dataId || 'self';\n const idValue = toIdValue({ id, typename: undefined });\n const fakeContext: ReadStoreContext = {\n // NOTE: fakeContext always uses ObjectCache\n // since this is only to ensure the return value of 'matches'\n store: new ObjectCache({ [id]: result }),\n cacheRedirects: {},\n };\n const match = context.fragmentMatcherFunction(\n idValue,\n fragment.typeCondition.name.value,\n fakeContext,\n );\n if (!isProduction() && match === 'heuristic') {\n invariant.error('WARNING: heuristic fragment matching going on!');\n }\n matches = !!match;\n }\n\n if (matches) {\n this.writeSelectionSetToStore({\n result,\n selectionSet: fragment.selectionSet,\n dataId,\n context,\n });\n }\n }\n });\n\n return store;\n }\n\n private writeFieldToStore({\n field,\n value,\n dataId,\n context,\n }: {\n field: FieldNode;\n value: any;\n dataId: string;\n context: WriteContext;\n }) {\n const { variables, dataIdFromObject, store } = context;\n\n let storeValue: StoreValue;\n let storeObject: StoreObject;\n\n const storeFieldName: string = storeKeyNameFromField(field, variables);\n\n // If this is a scalar value...\n if (!field.selectionSet || value === null) {\n storeValue =\n value != null && typeof value === 'object'\n ? // If the scalar value is a JSON blob, we have to \"escape\" it so it can’t pretend to be\n // an id.\n { type: 'json', json: value }\n : // Otherwise, just store the scalar directly in the store.\n value;\n } else if (Array.isArray(value)) {\n const generatedId = `${dataId}.${storeFieldName}`;\n\n storeValue = this.processArrayValue(\n value,\n generatedId,\n field.selectionSet,\n context,\n );\n } else {\n // It's an object\n let valueDataId = `${dataId}.${storeFieldName}`;\n let generated = true;\n\n // We only prepend the '$' if the valueDataId isn't already a generated\n // id.\n if (!isGeneratedId(valueDataId)) {\n valueDataId = '$' + valueDataId;\n }\n\n if (dataIdFromObject) {\n const semanticId = dataIdFromObject(value);\n\n // We throw an error if the first character of the id is '$. This is\n // because we use that character to designate an Apollo-generated id\n // and we use the distinction between user-desiginated and application-provided\n // ids when managing overwrites.\n invariant(\n !semanticId || !isGeneratedId(semanticId),\n 'IDs returned by dataIdFromObject cannot begin with the \"$\" character.',\n );\n\n if (\n semanticId ||\n (typeof semanticId === 'number' && semanticId === 0)\n ) {\n valueDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(valueDataId, field, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: valueDataId,\n result: value,\n selectionSet: field.selectionSet,\n context,\n });\n }\n\n // We take the id and escape it (i.e. wrap it with an enclosing object).\n // This allows us to distinguish IDs from normal scalars.\n const typename = value.__typename;\n storeValue = toIdValue({ id: valueDataId, typename }, generated);\n\n // check if there was a generated id at the location where we're\n // about to place this new id. If there was, we have to merge the\n // data from that id with the data we're about to write in the store.\n storeObject = store.get(dataId);\n const escapedId =\n storeObject && (storeObject[storeFieldName] as IdValue | undefined);\n if (escapedId !== storeValue && isIdValue(escapedId)) {\n const hadTypename = escapedId.typename !== undefined;\n const hasTypename = typename !== undefined;\n const typenameChanged =\n hadTypename && hasTypename && escapedId.typename !== typename;\n\n // If there is already a real id in the store and the current id we\n // are dealing with is generated, we throw an error.\n // One exception we allow is when the typename has changed, which occurs\n // when schema defines a union, both with and without an ID in the same place.\n // checks if we \"lost\" the read id\n invariant(\n !generated || escapedId.generated || typenameChanged,\n `Store error: the application attempted to write an object with no provided id but the store already contains an id of ${\n escapedId.id\n } for this object. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n // checks if we \"lost\" the typename\n invariant(\n !hadTypename || hasTypename,\n `Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of ${\n escapedId.typename\n } for the object of id ${escapedId.id}. The selectionSet that was trying to be written is:\\n${\n JSON.stringify(field)\n }`,\n );\n\n if (escapedId.generated) {\n // We should only merge if it's an object of the same type,\n // otherwise we should delete the generated object\n if (typenameChanged) {\n // Only delete the generated object when the old object was\n // inlined, and the new object is not. This is indicated by\n // the old id being generated, and the new id being real.\n if (!generated) {\n store.delete(escapedId.id);\n }\n } else {\n mergeWithGenerated(escapedId.id, (storeValue as IdValue).id, store);\n }\n }\n }\n }\n\n storeObject = store.get(dataId);\n if (!storeObject || !isEqual(storeValue, storeObject[storeFieldName])) {\n store.set(dataId, {\n ...storeObject,\n [storeFieldName]: storeValue,\n });\n }\n }\n\n private processArrayValue(\n value: any[],\n generatedId: string,\n selectionSet: SelectionSetNode,\n context: WriteContext,\n ): any[] {\n return value.map((item: any, index: any) => {\n if (item === null) {\n return null;\n }\n\n let itemDataId = `${generatedId}.${index}`;\n\n if (Array.isArray(item)) {\n return this.processArrayValue(item, itemDataId, selectionSet, context);\n }\n\n let generated = true;\n\n if (context.dataIdFromObject) {\n const semanticId = context.dataIdFromObject(item);\n\n if (semanticId) {\n itemDataId = semanticId;\n generated = false;\n }\n }\n\n if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) {\n this.writeSelectionSetToStore({\n dataId: itemDataId,\n result: item,\n selectionSet,\n context,\n });\n }\n\n return toIdValue(\n { id: itemDataId, typename: item.__typename },\n generated,\n );\n });\n }\n}\n\n// Checks if the id given is an id that was generated by Apollo\n// rather than by dataIdFromObject.\nfunction isGeneratedId(id: string): boolean {\n return id[0] === '$';\n}\n\nfunction mergeWithGenerated(\n generatedKey: string,\n realKey: string,\n cache: NormalizedCache,\n): boolean {\n if (generatedKey === realKey) {\n return false;\n }\n\n const generated = cache.get(generatedKey);\n const real = cache.get(realKey);\n let madeChanges = false;\n\n Object.keys(generated).forEach(key => {\n const value = generated[key];\n const realValue = real[key];\n\n if (\n isIdValue(value) &&\n isGeneratedId(value.id) &&\n isIdValue(realValue) &&\n !isEqual(value, realValue) &&\n mergeWithGenerated(value.id, realValue.id, cache)\n ) {\n madeChanges = true;\n }\n });\n\n cache.delete(generatedKey);\n const newRealValue = { ...generated, ...real };\n\n if (isEqual(newRealValue, real)) {\n return madeChanges;\n }\n\n cache.set(realKey, newRealValue);\n return true;\n}\n\nfunction isDataProcessed(\n dataId: string,\n field: FieldNode | SelectionSetNode,\n processedData?: { [x: string]: (FieldNode | SelectionSetNode)[] },\n): boolean {\n if (!processedData) {\n return false;\n }\n\n if (processedData[dataId]) {\n if (processedData[dataId].indexOf(field) >= 0) {\n return true;\n } else {\n processedData[dataId].push(field);\n }\n } else {\n processedData[dataId] = [field];\n }\n\n return false;\n}\n","// Make builtins like Map and Set safe to use with non-extensible objects.\nimport './fixPolyfills';\n\nimport { DocumentNode } from 'graphql';\n\nimport { Cache, ApolloCache, Transaction } from 'apollo-cache';\n\nimport { addTypenameToDocument, canUseWeakMap } from 'apollo-utilities';\n\nimport { wrap } from 'optimism';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { HeuristicFragmentMatcher } from './fragmentMatcher';\nimport {\n ApolloReducerConfig,\n NormalizedCache,\n NormalizedCacheObject,\n} from './types';\n\nimport { StoreReader } from './readFromStore';\nimport { StoreWriter } from './writeToStore';\nimport { DepTrackingCache } from './depTrackingCache';\nimport { KeyTrie } from 'optimism';\nimport { ObjectCache } from './objectCache';\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n freezeResults?: boolean;\n}\n\nconst defaultConfig: InMemoryCacheConfig = {\n fragmentMatcher: new HeuristicFragmentMatcher(),\n dataIdFromObject: defaultDataIdFromObject,\n addTypename: true,\n resultCaching: true,\n freezeResults: false,\n};\n\nexport function defaultDataIdFromObject(result: any): string | null {\n if (result.__typename) {\n if (result.id !== undefined) {\n return `${result.__typename}:${result.id}`;\n }\n if (result._id !== undefined) {\n return `${result.__typename}:${result._id}`;\n }\n }\n return null;\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty;\n\nexport class OptimisticCacheLayer extends ObjectCache {\n constructor(\n public readonly optimisticId: string,\n // OptimisticCacheLayer objects always wrap some other parent cache, so\n // this.parent should never be null.\n public readonly parent: NormalizedCache,\n public readonly transaction: Transaction,\n ) {\n super(Object.create(null));\n }\n\n public toObject(): NormalizedCacheObject {\n return {\n ...this.parent.toObject(),\n ...this.data,\n };\n }\n\n // All the other accessor methods of ObjectCache work without knowing about\n // this.parent, but the get method needs to be overridden to implement the\n // fallback this.parent.get(dataId) behavior.\n public get(dataId: string) {\n return hasOwn.call(this.data, dataId)\n ? this.data[dataId]\n : this.parent.get(dataId);\n }\n}\n\nexport class InMemoryCache extends ApolloCache {\n private data: NormalizedCache;\n private optimisticData: NormalizedCache;\n\n protected config: InMemoryCacheConfig;\n private watches = new Set();\n private addTypename: boolean;\n private typenameDocumentCache = new Map();\n private storeReader: StoreReader;\n private storeWriter: StoreWriter;\n private cacheKeyRoot = new KeyTrie(canUseWeakMap);\n\n // Set this while in a transaction to prevent broadcasts...\n // don't forget to turn it back on!\n private silenceBroadcast: boolean = false;\n\n constructor(config: InMemoryCacheConfig = {}) {\n super();\n this.config = { ...defaultConfig, ...config };\n\n // backwards compat\n if ((this.config as any).customResolvers) {\n invariant.warn(\n 'customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).customResolvers;\n }\n\n if ((this.config as any).cacheResolvers) {\n invariant.warn(\n 'cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.',\n );\n this.config.cacheRedirects = (this.config as any).cacheResolvers;\n }\n\n this.addTypename = !!this.config.addTypename;\n\n // Passing { resultCaching: false } in the InMemoryCache constructor options\n // will completely disable dependency tracking, which will improve memory\n // usage but worsen the performance of repeated reads.\n this.data = this.config.resultCaching\n ? new DepTrackingCache()\n : new ObjectCache();\n\n // When no optimistic writes are currently active, cache.optimisticData ===\n // cache.data, so there are no additional layers on top of the actual data.\n // When an optimistic update happens, this.optimisticData will become a\n // linked list of OptimisticCacheLayer objects that terminates with the\n // original this.data cache object.\n this.optimisticData = this.data;\n\n this.storeWriter = new StoreWriter();\n this.storeReader = new StoreReader({\n cacheKeyRoot: this.cacheKeyRoot,\n freezeResults: config.freezeResults,\n });\n\n const cache = this;\n const { maybeBroadcastWatch } = cache;\n this.maybeBroadcastWatch = wrap((c: Cache.WatchOptions) => {\n return maybeBroadcastWatch.call(this, c);\n }, {\n makeCacheKey(c: Cache.WatchOptions) {\n if (c.optimistic) {\n // If we're reading optimistic data, it doesn't matter if this.data\n // is a DepTrackingCache, since it will be ignored.\n return;\n }\n\n if (c.previousResult) {\n // If a previousResult was provided, assume the caller would prefer\n // to compare the previous data to the new data to determine whether\n // to broadcast, so we should disable caching by returning here, to\n // give maybeBroadcastWatch a chance to do that comparison.\n return;\n }\n\n if (cache.data instanceof DepTrackingCache) {\n // Return a cache key (thus enabling caching) only if we're currently\n // using a data store that can track cache dependencies.\n return cache.cacheKeyRoot.lookup(\n c.query,\n JSON.stringify(c.variables),\n );\n }\n }\n });\n }\n\n public restore(data: NormalizedCacheObject): this {\n if (data) this.data.replace(data);\n return this;\n }\n\n public extract(optimistic: boolean = false): NormalizedCacheObject {\n return (optimistic ? this.optimisticData : this.data).toObject();\n }\n\n public read(options: Cache.ReadOptions): T | null {\n if (typeof options.rootId === 'string' &&\n typeof this.data.get(options.rootId) === 'undefined') {\n return null;\n }\n\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n return this.storeReader.readQueryFromStore({\n store: options.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(options.query),\n variables: options.variables,\n rootId: options.rootId,\n fragmentMatcherFunction,\n previousResult: options.previousResult,\n config: this.config,\n }) || null;\n }\n\n public write(write: Cache.WriteOptions): void {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n this.storeWriter.writeResultToStore({\n dataId: write.dataId,\n result: write.result,\n variables: write.variables,\n document: this.transformDocument(write.query),\n store: this.data,\n dataIdFromObject: this.config.dataIdFromObject,\n fragmentMatcherFunction,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\n return this.storeReader.diffQueryAgainstStore({\n store: query.optimistic ? this.optimisticData : this.data,\n query: this.transformDocument(query.query),\n variables: query.variables,\n returnPartialData: query.returnPartialData,\n previousResult: query.previousResult,\n fragmentMatcherFunction,\n config: this.config,\n });\n }\n\n public watch(watch: Cache.WatchOptions): () => void {\n this.watches.add(watch);\n\n return () => {\n this.watches.delete(watch);\n };\n }\n\n public evict(query: Cache.EvictOptions): Cache.EvictionResult {\n throw new InvariantError(`eviction is not implemented on InMemory Cache`);\n }\n\n public reset(): Promise {\n this.data.clear();\n this.broadcastWatches();\n\n return Promise.resolve();\n }\n\n public removeOptimistic(idToRemove: string) {\n const toReapply: OptimisticCacheLayer[] = [];\n let removedCount = 0;\n let layer = this.optimisticData;\n\n while (layer instanceof OptimisticCacheLayer) {\n if (layer.optimisticId === idToRemove) {\n ++removedCount;\n } else {\n toReapply.push(layer);\n }\n layer = layer.parent;\n }\n\n if (removedCount > 0) {\n // Reset this.optimisticData to the first non-OptimisticCacheLayer object,\n // which is almost certainly this.data.\n this.optimisticData = layer;\n\n // Reapply the layers whose optimistic IDs do not match the removed ID.\n while (toReapply.length > 0) {\n const layer = toReapply.pop()!;\n this.performTransaction(layer.transaction, layer.optimisticId);\n }\n\n this.broadcastWatches();\n }\n }\n\n public performTransaction(\n transaction: Transaction,\n // This parameter is not part of the performTransaction signature inherited\n // from the ApolloCache abstract class, but it's useful because it saves us\n // from duplicating this implementation in recordOptimisticTransaction.\n optimisticId?: string,\n ) {\n const { data, silenceBroadcast } = this;\n this.silenceBroadcast = true;\n\n if (typeof optimisticId === 'string') {\n // Add a new optimistic layer and temporarily make this.data refer to\n // that layer for the duration of the transaction.\n this.data = this.optimisticData = new OptimisticCacheLayer(\n // Note that there can be multiple layers with the same optimisticId.\n // When removeOptimistic(id) is called for that id, all matching layers\n // will be removed, and the remaining layers will be reapplied.\n optimisticId,\n this.optimisticData,\n transaction,\n );\n }\n\n try {\n transaction(this);\n } finally {\n this.silenceBroadcast = silenceBroadcast;\n this.data = data;\n }\n\n // This broadcast does nothing if this.silenceBroadcast is true.\n this.broadcastWatches();\n }\n\n public recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ) {\n return this.performTransaction(transaction, id);\n }\n\n public transformDocument(document: DocumentNode): DocumentNode {\n if (this.addTypename) {\n let result = this.typenameDocumentCache.get(document);\n if (!result) {\n result = addTypenameToDocument(document);\n this.typenameDocumentCache.set(document, result);\n // If someone calls transformDocument and then mistakenly passes the\n // result back into an API that also calls transformDocument, make sure\n // we don't keep creating new query documents.\n this.typenameDocumentCache.set(result, result);\n }\n return result;\n }\n return document;\n }\n\n protected broadcastWatches() {\n if (!this.silenceBroadcast) {\n this.watches.forEach(c => this.maybeBroadcastWatch(c));\n }\n }\n\n // This method is wrapped in the constructor so that it will be called only\n // if the data that would be broadcast has changed.\n private maybeBroadcastWatch(c: Cache.WatchOptions) {\n c.callback(\n this.diff({\n query: c.query,\n variables: c.variables,\n previousResult: c.previousResult && c.previousResult(),\n optimistic: c.optimistic,\n }),\n );\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts deleted file mode 100644 index a4e74af..0000000 --- a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types'; -export declare class DepTrackingCache implements NormalizedCache { - private data; - private depend; - constructor(data?: NormalizedCacheObject); - toObject(): NormalizedCacheObject; - get(dataId: string): StoreObject; - set(dataId: string, value?: StoreObject): void; - delete(dataId: string): void; - clear(): void; - replace(newData: NormalizedCacheObject | null): void; -} -export declare function defaultNormalizedCacheFactory(seed?: NormalizedCacheObject): NormalizedCache; -//# sourceMappingURL=depTrackingCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map deleted file mode 100644 index 0a63627..0000000 --- a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"depTrackingCache.d.ts","sourceRoot":"","sources":["src/depTrackingCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAK9E,qBAAa,gBAAiB,YAAW,eAAe;IAK1C,OAAO,CAAC,IAAI;IAFxB,OAAO,CAAC,MAAM,CAA+D;gBAEzD,IAAI,GAAE,qBAA2C;IAS9D,QAAQ,IAAI,qBAAqB;IAIjC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAKhC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW;IAQvC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO5B,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI;CAgB5D;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,CAAC,EAAE,qBAAqB,GAC3B,eAAe,CAEjB"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js deleted file mode 100644 index c4441aa..0000000 --- a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var optimism_1 = require("optimism"); -var hasOwn = Object.prototype.hasOwnProperty; -var DepTrackingCache = (function () { - function DepTrackingCache(data) { - var _this = this; - if (data === void 0) { data = Object.create(null); } - this.data = data; - this.depend = optimism_1.wrap(function (dataId) { return _this.data[dataId]; }, { - disposable: true, - makeCacheKey: function (dataId) { - return dataId; - }, - }); - } - DepTrackingCache.prototype.toObject = function () { - return this.data; - }; - DepTrackingCache.prototype.get = function (dataId) { - this.depend(dataId); - return this.data[dataId]; - }; - DepTrackingCache.prototype.set = function (dataId, value) { - var oldValue = this.data[dataId]; - if (value !== oldValue) { - this.data[dataId] = value; - this.depend.dirty(dataId); - } - }; - DepTrackingCache.prototype.delete = function (dataId) { - if (hasOwn.call(this.data, dataId)) { - delete this.data[dataId]; - this.depend.dirty(dataId); - } - }; - DepTrackingCache.prototype.clear = function () { - this.replace(null); - }; - DepTrackingCache.prototype.replace = function (newData) { - var _this = this; - if (newData) { - Object.keys(newData).forEach(function (dataId) { - _this.set(dataId, newData[dataId]); - }); - Object.keys(this.data).forEach(function (dataId) { - if (!hasOwn.call(newData, dataId)) { - _this.delete(dataId); - } - }); - } - else { - Object.keys(this.data).forEach(function (dataId) { - _this.delete(dataId); - }); - } - }; - return DepTrackingCache; -}()); -exports.DepTrackingCache = DepTrackingCache; -function defaultNormalizedCacheFactory(seed) { - return new DepTrackingCache(seed); -} -exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory; -//# sourceMappingURL=depTrackingCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map b/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map deleted file mode 100644 index 032dd21..0000000 --- a/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"depTrackingCache.js","sourceRoot":"","sources":["../src/depTrackingCache.ts"],"names":[],"mappings":";;AACA,qCAA2D;AAE3D,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc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Ad,UAAe,OAAqC;QAApD,iBAeC;QAdC,IAAI,OAAO,EAAE;YACX,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAA,MAAM;gBACjC,KAAI,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAA,MAAM;gBACnC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;oBACjC,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;iBACrB;YACH,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAA,MAAM;gBACnC,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AA1DD,IA0DC;AA1DY,4CAAgB;AA4D7B,SAAgB,6BAA6B,CAC3C,IAA4B;IAE5B,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAJD,sEAIC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts deleted file mode 100644 index ae059bd..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=fixPolyfills.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map deleted file mode 100644 index 3a65eb4..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixPolyfills.d.ts","sourceRoot":"","sources":["src/fixPolyfills.ts"],"names":[],"mappings":"AAoDA,OAAO,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js deleted file mode 100644 index 4a686ea..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var testMap = new Map(); -if (testMap.set(1, 2) !== testMap) { - var set_1 = testMap.set; - Map.prototype.set = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - set_1.apply(this, args); - return this; - }; -} -var testSet = new Set(); -if (testSet.add(3) !== testSet) { - var add_1 = testSet.add; - Set.prototype.add = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - add_1.apply(this, args); - return this; - }; -} -var frozen = {}; -if (typeof Object.freeze === 'function') { - Object.freeze(frozen); -} -try { - testMap.set(frozen, frozen).delete(frozen); -} -catch (_a) { - var wrap = function (method) { - return method && (function (obj) { - try { - testMap.set(obj, obj).delete(obj); - } - finally { - return method.call(Object, obj); - } - }); - }; - Object.freeze = wrap(Object.freeze); - Object.seal = wrap(Object.seal); - Object.preventExtensions = wrap(Object.preventExtensions); -} -//# sourceMappingURL=fixPolyfills.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map b/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map deleted file mode 100644 index b5c3035..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixPolyfills.js","sourceRoot":"","sources":["../src/fixPolyfills.ts"],"names":[],"mappings":";;AAEA,IAAM,OAAO,GAAG,IAAI,GAAG,EAAE,C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,CAAC,CAAC;IACF,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;CAC3D"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts deleted file mode 100644 index acf3558..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { IdValue } from 'apollo-utilities'; -import { ReadStoreContext, FragmentMatcherInterface, IntrospectionResultData } from './types'; -export declare class HeuristicFragmentMatcher implements FragmentMatcherInterface { - constructor(); - ensureReady(): Promise; - canBypassInit(): boolean; - match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean | 'heuristic'; -} -export declare class IntrospectionFragmentMatcher implements FragmentMatcherInterface { - private isReady; - private possibleTypesMap; - constructor(options?: { - introspectionQueryResultData?: IntrospectionResultData; - }); - match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean; - private parseIntrospectionResult; -} -//# sourceMappingURL=fragmentMatcher.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map deleted file mode 100644 index 40a4f02..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragmentMatcher.d.ts","sourceRoot":"","sources":["src/fragmentMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EAExB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAgBjB,qBAAa,wBAAyB,YAAW,wBAAwB;;IAKhE,WAAW;IAIX,aAAa;IAIb,KAAK,CACV,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB,GACxB,OAAO,GAAG,WAAW;CA6DzB;AAED,qBAAa,4BAA6B,YAAW,wBAAwB;IAC3E,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,CAAC,EAAE;QACpB,4BAA4B,CAAC,EAAE,uBAAuB,CAAC;KACxD;IAaM,KAAK,CACV,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB;IAwC3B,OAAO,CAAC,wBAAwB;CAajC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js deleted file mode 100644 index e3152ca..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var apollo_utilities_1 = require("apollo-utilities"); -var ts_invariant_1 = require("ts-invariant"); -var haveWarned = false; -function shouldWarn() { - var answer = !haveWarned; - if (!apollo_utilities_1.isTest()) { - haveWarned = true; - } - return answer; -} -var HeuristicFragmentMatcher = (function () { - function HeuristicFragmentMatcher() { - } - HeuristicFragmentMatcher.prototype.ensureReady = function () { - return Promise.resolve(); - }; - HeuristicFragmentMatcher.prototype.canBypassInit = function () { - return true; - }; - HeuristicFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - if (!obj) { - return isRootQuery; - } - var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - if (!__typename) { - if (shouldWarn()) { - ts_invariant_1.invariant.warn("You're using fragments in your queries, but either don't have the addTypename:\n true option set in Apollo Client, or you are trying to write a fragment to the store without the __typename.\n Please turn on the addTypename option and include __typename when writing fragments so that Apollo Client\n can accurately match fragments."); - ts_invariant_1.invariant.warn('Could not find __typename on Fragment ', typeCondition, obj); - ts_invariant_1.invariant.warn("DEPRECATION WARNING: using fragments without __typename is unsupported behavior " + - "and will be removed in future versions of Apollo client. You should fix this and set addTypename to true now."); - } - return 'heuristic'; - } - if (__typename === typeCondition) { - return true; - } - if (shouldWarn()) { - ts_invariant_1.invariant.error('You are using the simple (heuristic) fragment matcher, but your ' + - 'queries contain union or interface types. Apollo Client will not be ' + - 'able to accurately map fragments. To make this error go away, use ' + - 'the `IntrospectionFragmentMatcher` as described in the docs: ' + - 'https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher'); - } - return 'heuristic'; - }; - return HeuristicFragmentMatcher; -}()); -exports.HeuristicFragmentMatcher = HeuristicFragmentMatcher; -var IntrospectionFragmentMatcher = (function () { - function IntrospectionFragmentMatcher(options) { - if (options && options.introspectionQueryResultData) { - this.possibleTypesMap = this.parseIntrospectionResult(options.introspectionQueryResultData); - this.isReady = true; - } - else { - this.isReady = false; - } - this.match = this.match.bind(this); - } - IntrospectionFragmentMatcher.prototype.match = function (idValue, typeCondition, context) { - ts_invariant_1.invariant(this.isReady, 'FragmentMatcher.match() was called before FragmentMatcher.init()'); - var obj = context.store.get(idValue.id); - var isRootQuery = idValue.id === 'ROOT_QUERY'; - if (!obj) { - return isRootQuery; - } - var _a = obj.__typename, __typename = _a === void 0 ? isRootQuery && 'Query' : _a; - ts_invariant_1.invariant(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); - if (__typename === typeCondition) { - return true; - } - var implementingTypes = this.possibleTypesMap[typeCondition]; - if (__typename && - implementingTypes && - implementingTypes.indexOf(__typename) > -1) { - return true; - } - return false; - }; - IntrospectionFragmentMatcher.prototype.parseIntrospectionResult = function (introspectionResultData) { - var typeMap = {}; - introspectionResultData.__schema.types.forEach(function (type) { - if (type.kind === 'UNION' || type.kind === 'INTERFACE') { - typeMap[type.name] = type.possibleTypes.map(function (implementingType) { return implementingType.name; }); - } - }); - return typeMap; - }; - return IntrospectionFragmentMatcher; -}()); -exports.IntrospectionFragmentMatcher = IntrospectionFragmentMatcher; -//# sourceMappingURL=fragmentMatcher.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map deleted file mode 100644 index f6e4c0b..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragmentMatcher.js","sourceRoot":"","sources":["../src/fragmentMatcher.ts"],"names":[],"mappings":";;AAAA,qDAAmD;AACnD,6CAAyC;AASzC,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,SAAS,UAAU;IACjB,IAAM,MAAM,GAAG,CAAC,UAAU,CAAC;IAE3B,IAAI,CAAC,yBAAM,EAAE,EAAE;QACb,UAAU,GAAG,IAAI,CAAC;KACnB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAKD;IACE;IAEA,CAAC;IAEM,8CAAW,GAAlB;QACE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEM,gDAAa,GAApB;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,wCAAK,GAAZ,UACE,OAAgB,EAChB,aAAqB,EACrB,OAAyB;QAEzB,IAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1C,IAAM,WAAW,GAAG,OAAO,CAAC,EAAE,KAAK,YAAY,CAAC;QAEhD,IAAI,CAAC,GAAG,EAAE;YAER,OAAO,WAAW,CAAC;SACpB;QAEO,IAAA,mBAAmC,EAAnC,wDAAmC,CAAS;QAEpD,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,UAAU,EAAE,EAAE;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AEO,IAAA,mBAAmC,EAAnC,wDAAmC,CAAS;QAEpD,wBAAS,CACP,UAAU,EACV,mEAAiE,IAAI,CAAC,SAAS,CAC7E,GAAG,CACF,CACJ,CAAC;QAEF,IAAI,UAAU,KAAK,aAAa,EAAE;YAChC,OAAO,IAAI,CAAC;SACb;QAED,IAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC/D,IACE,UAAU;YACV,iBAAiB;YACjB,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAC1C;YACA,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,+DAAwB,GAAhC,UACE,uBAAgD;QAEhD,IAAM,OAAO,GAAqB,EAAE,CAAC;QACrC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;YACjD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;gBACtD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CACzC,UAAA,gBAAgB,IAAI,OAAA,gBAAgB,CAAC,IAAI,EAArB,CAAqB,CAC1C,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,mCAAC;AAAD,CAAC,AA3ED,IA2EC;AA3EY,oEAA4B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts deleted file mode 100644 index 08f2dbd..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const query: any; -export default query; -//# sourceMappingURL=fragmentMatcherIntrospectionQuery.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map deleted file mode 100644 index 58ba5cd..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragmentMatcherIntrospectionQuery.d.ts","sourceRoot":"","sources":["src/fragmentMatcherIntrospectionQuery.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK,EAAE,GA8FZ,CAAC;AAEF,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js deleted file mode 100644 index c591b41..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js +++ /dev/null @@ -1,99 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var query = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: null, - variableDefinitions: null, - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: '__schema', - }, - arguments: [], - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: 'types', - }, - arguments: [], - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: 'kind', - }, - arguments: [], - directives: [], - selectionSet: null, - }, - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: 'name', - }, - arguments: [], - directives: [], - selectionSet: null, - }, - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: 'possibleTypes', - }, - arguments: [], - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: 'name', - }, - arguments: [], - directives: [], - selectionSet: null, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -}; -exports.default = query; -//# sourceMappingURL=fragmentMatcherIntrospectionQuery.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map b/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map deleted file mode 100644 index d64dd3a..0000000 --- a/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragmentMatcherIntrospectionQuery.js","sourceRoot":"","sources":["../src/fragmentMatcherIntrospectionQuery.ts"],"names":[],"mappings":";;AAAA,IAAM,KAAK,GAAQ;IACjB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE;QACX;YACE,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,OAAO;YAClB,IAAI,EAAE,IAAI;YACV,mBAAmB,EAAE,IAAI;YACzB,UAAU,EAAE,EAAE;YACd,YAAY,EAAE;gBACZ,IAAI,EAAE,cAAc;gBACpB,UAAU,EAAE;oBACV;wBACE,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,IAAI;wBACX,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,UAAU;yBAClB;wBACD,SAAS,EAAE,EAAE;wBACb,UAAU,EAAE,EAAE;wBACd,YAAY,EAAE;4BACZ,IAAI,EAAE,cAAc;4BACpB,UAAU,EAAE;gCACV;oCACE,IAAI,EAAE,OAAO;oCACb,KAAK,EAAE,IAAI;oCACX,IAAI,EAAE;wCACJ,IAAI,EAAE,MAAM;wCACZ,KAAK,EAAE,OAAO;qCACf;oCACD,SAAS,EAAE,EAAE;oCACb,UAAU,EAAE,EAAE;oCACd,YAAY,EAAE;wCACZ,IAAI,EAAE,cAAc;wCACpB,UAAU,EAAE;4CACV;gDACE,IAAI,EAAE,OAAO;gDACb,KAAK,EAAE,IAAI;gDACX,IAAI,EAAE;oDACJ,IAAI,EAAE,MAAM;oDACZ,KAAK,EAAE,MAAM;iDACd;gDACD,SAAS,EAAE,EAAE;gDACb,UAAU,EAAE,EAAE;gDACd,YAAY,EAAE,IAAI;6CACnB;4CACD;gDACE,IAAI,EAAE,OAAO;gDACb,KAAK,EAAE,IAAI;gDACX,IAAI,EAAE;oDACJ,IAAI,EAAE,MAAM;oDACZ,KAAK,EAAE,MAAM;iDACd;gDACD,SAAS,EAAE,EAAE;gDACb,UAAU,EAAE,EAAE;gDACd,YAAY,EAAE,IAAI;6CACnB;4CACD;gDACE,IAAI,EAAE,OAAO;gDACb,KAAK,EAAE,IAAI;gDACX,IAAI,EAAE;oDACJ,IAAI,EAAE,MAAM;oDACZ,KAAK,EAAE,eAAe;iDACvB;gDACD,SAAS,EAAE,EAAE;gDACb,UAAU,EAAE,EAAE;gDACd,YAAY,EAAE;oDACZ,IAAI,EAAE,cAAc;oDACpB,UAAU,EAAE;wDACV;4DACE,IAAI,EAAE,OAAO;4DACb,KAAK,EAAE,IAAI;4DACX,IAAI,EAAE;gEACJ,IAAI,EAAE,MAAM;gEACZ,KAAK,EAAE,MAAM;6DACd;4DACD,SAAS,EAAE,EAAE;4DACb,UAAU,EAAE,EAAE;4DACd,YAAY,EAAE,IAAI;yDACnB;qDACF;iDACF;6CACF;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts deleted file mode 100644 index 9702c1d..0000000 --- a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import './fixPolyfills'; -import { DocumentNode } from 'graphql'; -import { Cache, ApolloCache, Transaction } from 'apollo-cache'; -import { ApolloReducerConfig, NormalizedCache, NormalizedCacheObject } from './types'; -import { ObjectCache } from './objectCache'; -export interface InMemoryCacheConfig extends ApolloReducerConfig { - resultCaching?: boolean; - freezeResults?: boolean; -} -export declare function defaultDataIdFromObject(result: any): string | null; -export declare class OptimisticCacheLayer extends ObjectCache { - readonly optimisticId: string; - readonly parent: NormalizedCache; - readonly transaction: Transaction; - constructor(optimisticId: string, parent: NormalizedCache, transaction: Transaction); - toObject(): NormalizedCacheObject; - get(dataId: string): import("./types").StoreObject; -} -export declare class InMemoryCache extends ApolloCache { - private data; - private optimisticData; - protected config: InMemoryCacheConfig; - private watches; - private addTypename; - private typenameDocumentCache; - private storeReader; - private storeWriter; - private cacheKeyRoot; - private silenceBroadcast; - constructor(config?: InMemoryCacheConfig); - restore(data: NormalizedCacheObject): this; - extract(optimistic?: boolean): NormalizedCacheObject; - read(options: Cache.ReadOptions): T | null; - write(write: Cache.WriteOptions): void; - diff(query: Cache.DiffOptions): Cache.DiffResult; - watch(watch: Cache.WatchOptions): () => void; - evict(query: Cache.EvictOptions): Cache.EvictionResult; - reset(): Promise; - removeOptimistic(idToRemove: string): void; - performTransaction(transaction: Transaction, optimisticId?: string): void; - recordOptimisticTransaction(transaction: Transaction, id: string): void; - transformDocument(document: DocumentNode): DocumentNode; - protected broadcastWatches(): void; - private maybeBroadcastWatch; -} -//# sourceMappingURL=inMemoryCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map deleted file mode 100644 index 13bbabe..0000000 --- a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemoryCache.d.ts","sourceRoot":"","sources":["src/inMemoryCache.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA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AAC,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI;IAoB7C,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI;IAiBtC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAetD,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,IAAI;IAQ5C,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,cAAc;IAItD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtB,gBAAgB,CAAC,UAAU,EAAE,MAAM;IA6BnC,kBAAkB,CACvB,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAAC,EAI/C,YAAY,CAAC,EAAE,MAAM;IA6BhB,2BAA2B,CAChC,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAAC,EAC/C,EAAE,EAAE,MAAM;IAKL,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY;IAgB9D,SAAS,CAAC,gBAAgB;IAQ1B,OAAO,CAAC,mBAAmB;CAU5B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js deleted file mode 100644 index 06bf62d..0000000 --- a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js +++ /dev/null @@ -1,239 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -require("./fixPolyfills"); -var apollo_cache_1 = require("apollo-cache"); -var apollo_utilities_1 = require("apollo-utilities"); -var optimism_1 = require("optimism"); -var ts_invariant_1 = require("ts-invariant"); -var fragmentMatcher_1 = require("./fragmentMatcher"); -var readFromStore_1 = require("./readFromStore"); -var writeToStore_1 = require("./writeToStore"); -var depTrackingCache_1 = require("./depTrackingCache"); -var optimism_2 = require("optimism"); -var objectCache_1 = require("./objectCache"); -var defaultConfig = { - fragmentMatcher: new fragmentMatcher_1.HeuristicFragmentMatcher(), - dataIdFromObject: defaultDataIdFromObject, - addTypename: true, - resultCaching: true, - freezeResults: false, -}; -function defaultDataIdFromObject(result) { - if (result.__typename) { - if (result.id !== undefined) { - return result.__typename + ":" + result.id; - } - if (result._id !== undefined) { - return result.__typename + ":" + result._id; - } - } - return null; -} -exports.defaultDataIdFromObject = defaultDataIdFromObject; -var hasOwn = Object.prototype.hasOwnProperty; -var OptimisticCacheLayer = (function (_super) { - tslib_1.__extends(OptimisticCacheLayer, _super); - function OptimisticCacheLayer(optimisticId, parent, transaction) { - var _this = _super.call(this, Object.create(null)) || this; - _this.optimisticId = optimisticId; - _this.parent = parent; - _this.transaction = transaction; - return _this; - } - OptimisticCacheLayer.prototype.toObject = function () { - return tslib_1.__assign(tslib_1.__assign({}, this.parent.toObject()), this.data); - }; - OptimisticCacheLayer.prototype.get = function (dataId) { - return hasOwn.call(this.data, dataId) - ? this.data[dataId] - : this.parent.get(dataId); - }; - return OptimisticCacheLayer; -}(objectCache_1.ObjectCache)); -exports.OptimisticCacheLayer = OptimisticCacheLayer; -var InMemoryCache = (function (_super) { - tslib_1.__extends(InMemoryCache, _super); - function InMemoryCache(config) { - if (config === void 0) { config = {}; } - var _this = _super.call(this) || this; - _this.watches = new Set(); - _this.typenameDocumentCache = new Map(); - _this.cacheKeyRoot = new optimism_2.KeyTrie(apollo_utilities_1.canUseWeakMap); - _this.silenceBroadcast = false; - _this.config = tslib_1.__assign(tslib_1.__assign({}, defaultConfig), config); - if (_this.config.customResolvers) { - ts_invariant_1.invariant.warn('customResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating customResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.customResolvers; - } - if (_this.config.cacheResolvers) { - ts_invariant_1.invariant.warn('cacheResolvers have been renamed to cacheRedirects. Please update your config as we will be deprecating cacheResolvers in the next major version.'); - _this.config.cacheRedirects = _this.config.cacheResolvers; - } - _this.addTypename = !!_this.config.addTypename; - _this.data = _this.config.resultCaching - ? new depTrackingCache_1.DepTrackingCache() - : new objectCache_1.ObjectCache(); - _this.optimisticData = _this.data; - _this.storeWriter = new writeToStore_1.StoreWriter(); - _this.storeReader = new readFromStore_1.StoreReader({ - cacheKeyRoot: _this.cacheKeyRoot, - freezeResults: config.freezeResults, - }); - var cache = _this; - var maybeBroadcastWatch = cache.maybeBroadcastWatch; - _this.maybeBroadcastWatch = optimism_1.wrap(function (c) { - return maybeBroadcastWatch.call(_this, c); - }, { - makeCacheKey: function (c) { - if (c.optimistic) { - return; - } - if (c.previousResult) { - return; - } - if (cache.data instanceof depTrackingCache_1.DepTrackingCache) { - return cache.cacheKeyRoot.lookup(c.query, JSON.stringify(c.variables)); - } - } - }); - return _this; - } - InMemoryCache.prototype.restore = function (data) { - if (data) - this.data.replace(data); - return this; - }; - InMemoryCache.prototype.extract = function (optimistic) { - if (optimistic === void 0) { optimistic = false; } - return (optimistic ? this.optimisticData : this.data).toObject(); - }; - InMemoryCache.prototype.read = function (options) { - if (typeof options.rootId === 'string' && - typeof this.data.get(options.rootId) === 'undefined') { - return null; - } - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config, - }) || null; - }; - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - this.storeWriter.writeResultToStore({ - dataId: write.dataId, - result: write.result, - variables: write.variables, - document: this.transformDocument(write.query), - store: this.data, - dataIdFromObject: this.config.dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - this.broadcastWatches(); - }; - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.diffQueryAgainstStore({ - store: query.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(query.query), - variables: query.variables, - returnPartialData: query.returnPartialData, - previousResult: query.previousResult, - fragmentMatcherFunction: fragmentMatcherFunction, - config: this.config, - }); - }; - InMemoryCache.prototype.watch = function (watch) { - var _this = this; - this.watches.add(watch); - return function () { - _this.watches.delete(watch); - }; - }; - InMemoryCache.prototype.evict = function (query) { - throw new ts_invariant_1.InvariantError("eviction is not implemented on InMemory Cache"); - }; - InMemoryCache.prototype.reset = function () { - this.data.clear(); - this.broadcastWatches(); - return Promise.resolve(); - }; - InMemoryCache.prototype.removeOptimistic = function (idToRemove) { - var toReapply = []; - var removedCount = 0; - var layer = this.optimisticData; - while (layer instanceof OptimisticCacheLayer) { - if (layer.optimisticId === idToRemove) { - ++removedCount; - } - else { - toReapply.push(layer); - } - layer = layer.parent; - } - if (removedCount > 0) { - this.optimisticData = layer; - while (toReapply.length > 0) { - var layer_1 = toReapply.pop(); - this.performTransaction(layer_1.transaction, layer_1.optimisticId); - } - this.broadcastWatches(); - } - }; - InMemoryCache.prototype.performTransaction = function (transaction, optimisticId) { - var _a = this, data = _a.data, silenceBroadcast = _a.silenceBroadcast; - this.silenceBroadcast = true; - if (typeof optimisticId === 'string') { - this.data = this.optimisticData = new OptimisticCacheLayer(optimisticId, this.optimisticData, transaction); - } - try { - transaction(this); - } - finally { - this.silenceBroadcast = silenceBroadcast; - this.data = data; - } - this.broadcastWatches(); - }; - InMemoryCache.prototype.recordOptimisticTransaction = function (transaction, id) { - return this.performTransaction(transaction, id); - }; - InMemoryCache.prototype.transformDocument = function (document) { - if (this.addTypename) { - var result = this.typenameDocumentCache.get(document); - if (!result) { - result = apollo_utilities_1.addTypenameToDocument(document); - this.typenameDocumentCache.set(document, result); - this.typenameDocumentCache.set(result, result); - } - return result; - } - return document; - }; - InMemoryCache.prototype.broadcastWatches = function () { - var _this = this; - if (!this.silenceBroadcast) { - this.watches.forEach(function (c) { return _this.maybeBroadcastWatch(c); }); - } - }; - InMemoryCache.prototype.maybeBroadcastWatch = function (c) { - c.callback(this.diff({ - query: c.query, - variables: c.variables, - previousResult: c.previousResult && c.previousResult(), - optimistic: c.optimistic, - })); - }; - return InMemoryCache; -}(apollo_cache_1.ApolloCache)); -exports.InMemoryCache = InMemoryCache; -//# sourceMappingURL=inMemoryCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map b/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map deleted file mode 100644 index 5463f8a..0000000 --- a/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemoryCache.js","sourceRoot":"","sources":["../src/inMemoryCache.ts"],"names":[],"mappings":";;;AACA,0BAAwB;AAIxB,6CAA+D;AAE/D,qDAAwE;AAExE,qCAAgC;AAEhC,6CAAyD;AAEzD,qDAA6D;AAO7D,iDAA8C;AAC9C,+CAA6C;AAC7C,uDAAsD;AACtD,qCAAmC;AACnC,6CAA4C;AAO5C,IAAM,aAAa,GAAwB;IACzC,eAAe,EAAE,IAAI,0CAAwB,EAAE;IAC/C,gBAAgB,EAAE,uBAAuB;IACzC,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,SAAgB,uBAAuB,CAAC,MAAW;IACjD,IAAI,MAAM,CAAC,UAAU,EAAE;QACrB,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,EAAE;YAC3B,OAAU,MAAM,CAAC,UAAU,SAAI,MAAM,CAAC,EAAI,CAAC;SAC5C;QACD,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE;YAC5B,OAAU,MAAM,CAAC,UAAU,SAAI,MAAM,CAAC,GAAK,CAAC;SAC7C;KACF;IACD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AE,CAAC,CAAC,SAAS;YACtB,cAAc,EAAE,CAAC,CAAC,cAAc,IAAI,CAAC,CAAC,cAAc,EAAE;YACtD,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CACH,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAjRD,CAAmC,0BAAW,GAiR7C;AAjRY,sCAAa"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.d.ts b/node_modules/apollo-cache-inmemory/lib/index.d.ts deleted file mode 100644 index eb6e7fa..0000000 --- a/node_modules/apollo-cache-inmemory/lib/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { InMemoryCache, InMemoryCacheConfig, defaultDataIdFromObject, } from './inMemoryCache'; -export * from './readFromStore'; -export * from './writeToStore'; -export * from './fragmentMatcher'; -export * from './objectCache'; -export * from './types'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.d.ts.map b/node_modules/apollo-cache-inmemory/lib/index.d.ts.map deleted file mode 100644 index 111c29e..0000000 --- a/node_modules/apollo-cache-inmemory/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAEzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.js b/node_modules/apollo-cache-inmemory/lib/index.js deleted file mode 100644 index a434394..0000000 --- a/node_modules/apollo-cache-inmemory/lib/index.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var inMemoryCache_1 = require("./inMemoryCache"); -exports.InMemoryCache = inMemoryCache_1.InMemoryCache; -exports.defaultDataIdFromObject = inMemoryCache_1.defaultDataIdFromObject; -tslib_1.__exportStar(require("./readFromStore"), exports); -tslib_1.__exportStar(require("./writeToStore"), exports); -tslib_1.__exportStar(require("./fragmentMatcher"), exports); -tslib_1.__exportStar(require("./objectCache"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/index.js.map b/node_modules/apollo-cache-inmemory/lib/index.js.map deleted file mode 100644 index 96285b2..0000000 --- a/node_modules/apollo-cache-inmemory/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AAHvB,wCAAA,aAAa,CAAA;AAEb,kDAAA,uBAAuB,CAAA;AAGzB,0DAAgC;AAChC,yDAA+B;AAC/B,4DAAkC;AAClC,wDAA8B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts b/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts deleted file mode 100644 index 24fe078..0000000 --- a/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types'; -export declare class MapCache implements NormalizedCache { - private cache; - constructor(data?: NormalizedCacheObject); - get(dataId: string): StoreObject; - set(dataId: string, value: StoreObject): void; - delete(dataId: string): void; - clear(): void; - toObject(): NormalizedCacheObject; - replace(newData: NormalizedCacheObject): void; -} -export declare function mapNormalizedCacheFactory(seed?: NormalizedCacheObject): NormalizedCache; -//# sourceMappingURL=mapCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map deleted file mode 100644 index 26b6170..0000000 --- a/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapCache.d.ts","sourceRoot":"","sources":["src/mapCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM9E,qBAAa,QAAS,YAAW,eAAe;IAC9C,OAAO,CAAC,KAAK,CAAuC;gBAExC,IAAI,GAAE,qBAA0B;IAIrC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAIhC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI;IAI7C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI5B,KAAK,IAAI,IAAI;IAIb,QAAQ,IAAI,qBAAqB;IAQjC,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;CAMrD;AAED,wBAAgB,yBAAyB,CACvC,IAAI,CAAC,EAAE,qBAAqB,GAC3B,eAAe,CAEjB"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.js b/node_modules/apollo-cache-inmemory/lib/mapCache.js deleted file mode 100644 index f3f870e..0000000 --- a/node_modules/apollo-cache-inmemory/lib/mapCache.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var MapCache = (function () { - function MapCache(data) { - if (data === void 0) { data = {}; } - this.cache = new Map(Object.entries(data)); - } - MapCache.prototype.get = function (dataId) { - return this.cache.get("" + dataId); - }; - MapCache.prototype.set = function (dataId, value) { - this.cache.set("" + dataId, value); - }; - MapCache.prototype.delete = function (dataId) { - this.cache.delete("" + dataId); - }; - MapCache.prototype.clear = function () { - return this.cache.clear(); - }; - MapCache.prototype.toObject = function () { - var obj = {}; - this.cache.forEach(function (dataId, key) { - obj[key] = dataId; - }); - return obj; - }; - MapCache.prototype.replace = function (newData) { - var _this = this; - this.cache.clear(); - Object.entries(newData).forEach(function (_a) { - var dataId = _a[0], value = _a[1]; - return _this.cache.set(dataId, value); - }); - }; - return MapCache; -}()); -exports.MapCache = MapCache; -function mapNormalizedCacheFactory(seed) { - return new MapCache(seed); -} -exports.mapNormalizedCacheFactory = mapNormalizedCacheFactory; -//# sourceMappingURL=mapCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/mapCache.js.map b/node_modules/apollo-cache-inmemory/lib/mapCache.js.map deleted file mode 100644 index 7bc739f..0000000 --- a/node_modules/apollo-cache-inmemory/lib/mapCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapCache.js","sourceRoot":"","sources":["../src/mapCache.ts"],"names":[],"mappings":";;AAMA;IAGE,kBAAY,IAAgC;QAAhC,qBAAA,EAAA,SAAgC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;IAEM,sBAAG,GAAV,UAAW,MAAc;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAG,MAAQ,CAAE,CAAC;IACtC,CAAC;IAEM,sBAAG,GAAV,UAAW,MAAc,EAAE,KAAkB;QAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAG,MAAQ,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAEM,yBAAM,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAG,MAAQ,CAAC,CAAC;IACjC,CAAC;IAEM,wBAAK,GAAZ;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAEM,2BAAQ,GAAf;QACE,IAAM,GAAG,GAA0B,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAC,MAAM,EAAE,GAAG;YAC7B,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACb,CAAC;IAEM,0BAAO,GAAd,UAAe,OAA8B;QAA7C,iBAKC;QAJC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAC,EAAe;gBAAd,cAAM,EAAE,aAAK;YAC7C,OAAA,KAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;QAA7B,CAA6B,CAC9B,CAAC;IACJ,CAAC;IACH,eAAC;AAAD,CAAC,AArCD,IAqCC;AArCY,4BAAQ;AAuCrB,SAAgB,yBAAyB,CACvC,IAA4B;IAE5B,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAJD,8DAIC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts b/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts deleted file mode 100644 index 2d5e611..0000000 --- a/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NormalizedCache, NormalizedCacheObject, StoreObject } from './types'; -export declare class ObjectCache implements NormalizedCache { - protected data: NormalizedCacheObject; - constructor(data?: NormalizedCacheObject); - toObject(): NormalizedCacheObject; - get(dataId: string): StoreObject; - set(dataId: string, value: StoreObject): void; - delete(dataId: string): void; - clear(): void; - replace(newData: NormalizedCacheObject): void; -} -export declare function defaultNormalizedCacheFactory(seed?: NormalizedCacheObject): NormalizedCache; -//# sourceMappingURL=objectCache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map b/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map deleted file mode 100644 index 5219ce7..0000000 --- a/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"objectCache.d.ts","sourceRoot":"","sources":["src/objectCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9E,qBAAa,WAAY,YAAW,eAAe;IACrC,SAAS,CAAC,IAAI,EAAE,qBAAqB;gBAA3B,IAAI,GAAE,qBAA2C;IAEhE,QAAQ;IAIR,GAAG,CAAC,MAAM,EAAE,MAAM;IAIlB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW;IAItC,MAAM,CAAC,MAAM,EAAE,MAAM;IAIrB,KAAK;IAIL,OAAO,CAAC,OAAO,EAAE,qBAAqB;CAG9C;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,CAAC,EAAE,qBAAqB,GAC3B,eAAe,CAEjB"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.js b/node_modules/apollo-cache-inmemory/lib/objectCache.js deleted file mode 100644 index f55bac8..0000000 --- a/node_modules/apollo-cache-inmemory/lib/objectCache.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ObjectCache = (function () { - function ObjectCache(data) { - if (data === void 0) { data = Object.create(null); } - this.data = data; - } - ObjectCache.prototype.toObject = function () { - return this.data; - }; - ObjectCache.prototype.get = function (dataId) { - return this.data[dataId]; - }; - ObjectCache.prototype.set = function (dataId, value) { - this.data[dataId] = value; - }; - ObjectCache.prototype.delete = function (dataId) { - this.data[dataId] = void 0; - }; - ObjectCache.prototype.clear = function () { - this.data = Object.create(null); - }; - ObjectCache.prototype.replace = function (newData) { - this.data = newData || Object.create(null); - }; - return ObjectCache; -}()); -exports.ObjectCache = ObjectCache; -function defaultNormalizedCacheFactory(seed) { - return new ObjectCache(seed); -} -exports.defaultNormalizedCacheFactory = defaultNormalizedCacheFactory; -//# sourceMappingURL=objectCache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/objectCache.js.map b/node_modules/apollo-cache-inmemory/lib/objectCache.js.map deleted file mode 100644 index a42e368..0000000 --- a/node_modules/apollo-cache-inmemory/lib/objectCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"objectCache.js","sourceRoot":"","sources":["../src/objectCache.ts"],"names":[],"mappings":";;AAEA;IACE,qBAAsB,IAAiD;QAAjD,qBAAA,EAAA,OAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAAjD,SAAI,GAAJ,IAAI,CAA6C;IAAG,CAAC;IAEpE,8BAAQ,GAAf;QACE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,yBAAG,GAAV,UAAW,MAAc;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAE,CAAC;IAC5B,CAAC;IAEM,yBAAG,GAAV,UAAW,MAAc,EAAE,KAAkB;QAC3C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IAC5B,CAAC;IAEM,4BAAM,GAAb,UAAc,MAAc;QAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;IAC7B,CAAC;IAEM,2BAAK,GAAZ;QACE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAEM,6BAAO,GAAd,UAAe,OAA8B;QAC3C,IAAI,CAAC,IAAI,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IACH,kBAAC;AAAD,CAAC,AA1BD,IA0BC;AA1BY,kCAAW;AA4BxB,SAAgB,6BAA6B,CAC3C,IAA4B;IAE5B,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAJD,sEAIC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts b/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts deleted file mode 100644 index 896e962..0000000 --- a/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IdValue } from 'apollo-utilities'; -import { Cache } from 'apollo-cache'; -import { ReadStoreContext, DiffQueryAgainstStoreOptions, ReadQueryOptions, StoreObject } from './types'; -import { KeyTrie } from 'optimism'; -export declare type VariableMap = { - [name: string]: any; -}; -export declare type FragmentMatcher = (rootValue: any, typeCondition: string, context: ReadStoreContext) => boolean | 'heuristic'; -export declare type ExecResultMissingField = { - object: StoreObject; - fieldName: string; - tolerable: boolean; -}; -export declare type ExecResult = { - result: R; - missing?: ExecResultMissingField[]; -}; -export interface StoreReaderConfig { - cacheKeyRoot?: KeyTrie; - freezeResults?: boolean; -} -export declare class StoreReader { - private freezeResults; - constructor({ cacheKeyRoot, freezeResults, }?: StoreReaderConfig); - readQueryFromStore(options: ReadQueryOptions): QueryType | undefined; - diffQueryAgainstStore({ store, query, variables, previousResult, returnPartialData, rootId, fragmentMatcherFunction, config, }: DiffQueryAgainstStoreOptions): Cache.DiffResult; - private executeStoreQuery; - private executeSelectionSet; - private executeField; - private combineExecResults; - private executeSubSelectedArray; -} -export declare function assertIdValue(idValue: IdValue): void; -//# sourceMappingURL=readFromStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map deleted file mode 100644 index d5e7003..0000000 --- a/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readFromStore.d.ts","sourceRoot":"","sources":["src/readFromStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,OAAO,EAYR,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,gBAAgB,EAChB,WAAW,EACZ,MAAM,SAAS,CAAC;AAUjB,OAAO,EAAQ,OAAO,EAAE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o-cache-inmemory/lib/readFromStore.js b/node_modules/apollo-cache-inmemory/lib/readFromStore.js deleted file mode 100644 index da669e8..0000000 --- a/node_modules/apollo-cache-inmemory/lib/readFromStore.js +++ /dev/null @@ -1,318 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_utilities_1 = require("apollo-utilities"); -var optimism_1 = require("optimism"); -var depTrackingCache_1 = require("./depTrackingCache"); -var ts_invariant_1 = require("ts-invariant"); -var StoreReader = (function () { - function StoreReader(_a) { - var _this = this; - var _b = _a === void 0 ? {} : _a, _c = _b.cacheKeyRoot, cacheKeyRoot = _c === void 0 ? new optimism_1.KeyTrie(apollo_utilities_1.canUseWeakMap) : _c, _d = _b.freezeResults, freezeResults = _d === void 0 ? false : _d; - var _e = this, executeStoreQuery = _e.executeStoreQuery, executeSelectionSet = _e.executeSelectionSet, executeSubSelectedArray = _e.executeSubSelectedArray; - this.freezeResults = freezeResults; - this.executeStoreQuery = optimism_1.wrap(function (options) { - return executeStoreQuery.call(_this, options); - }, { - makeCacheKey: function (_a) { - var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, fragmentMatcher = _a.fragmentMatcher; - if (contextValue.store instanceof depTrackingCache_1.DepTrackingCache) { - return cacheKeyRoot.lookup(contextValue.store, query, fragmentMatcher, JSON.stringify(variableValues), rootValue.id); - } - } - }); - this.executeSelectionSet = optimism_1.wrap(function (options) { - return executeSelectionSet.call(_this, options); - }, { - makeCacheKey: function (_a) { - var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; - if (execContext.contextValue.store instanceof depTrackingCache_1.DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, selectionSet, execContext.fragmentMatcher, JSON.stringify(execContext.variableValues), rootValue.id); - } - } - }); - this.executeSubSelectedArray = optimism_1.wrap(function (options) { - return executeSubSelectedArray.call(_this, options); - }, { - makeCacheKey: function (_a) { - var field = _a.field, array = _a.array, execContext = _a.execContext; - if (execContext.contextValue.store instanceof depTrackingCache_1.DepTrackingCache) { - return cacheKeyRoot.lookup(execContext.contextValue.store, field, array, JSON.stringify(execContext.variableValues)); - } - } - }); - } - StoreReader.prototype.readQueryFromStore = function (options) { - return this.diffQueryAgainstStore(tslib_1.__assign(tslib_1.__assign({}, options), { returnPartialData: false })).result; - }; - StoreReader.prototype.diffQueryAgainstStore = function (_a) { - var store = _a.store, query = _a.query, variables = _a.variables, previousResult = _a.previousResult, _b = _a.returnPartialData, returnPartialData = _b === void 0 ? true : _b, _c = _a.rootId, rootId = _c === void 0 ? 'ROOT_QUERY' : _c, fragmentMatcherFunction = _a.fragmentMatcherFunction, config = _a.config; - var queryDefinition = apollo_utilities_1.getQueryDefinition(query); - variables = apollo_utilities_1.assign({}, apollo_utilities_1.getDefaultValues(queryDefinition), variables); - var context = { - store: store, - dataIdFromObject: config && config.dataIdFromObject, - cacheRedirects: (config && config.cacheRedirects) || {}, - }; - var execResult = this.executeStoreQuery({ - query: query, - rootValue: { - type: 'id', - id: rootId, - generated: true, - typename: 'Query', - }, - contextValue: context, - variableValues: variables, - fragmentMatcher: fragmentMatcherFunction, - }); - var hasMissingFields = execResult.missing && execResult.missing.length > 0; - if (hasMissingFields && !returnPartialData) { - execResult.missing.forEach(function (info) { - if (info.tolerable) - return; - throw new ts_invariant_1.InvariantError("Can't find field " + info.fieldName + " on object " + JSON.stringify(info.object, null, 2) + "."); - }); - } - if (previousResult) { - if (apollo_utilities_1.isEqual(previousResult, execResult.result)) { - execResult.result = previousResult; - } - } - return { - result: execResult.result, - complete: !hasMissingFields, - }; - }; - StoreReader.prototype.executeStoreQuery = function (_a) { - var query = _a.query, rootValue = _a.rootValue, contextValue = _a.contextValue, variableValues = _a.variableValues, _b = _a.fragmentMatcher, fragmentMatcher = _b === void 0 ? defaultFragmentMatcher : _b; - var mainDefinition = apollo_utilities_1.getMainDefinition(query); - var fragments = apollo_utilities_1.getFragmentDefinitions(query); - var fragmentMap = apollo_utilities_1.createFragmentMap(fragments); - var execContext = { - query: query, - fragmentMap: fragmentMap, - contextValue: contextValue, - variableValues: variableValues, - fragmentMatcher: fragmentMatcher, - }; - return this.executeSelectionSet({ - selectionSet: mainDefinition.selectionSet, - rootValue: rootValue, - execContext: execContext, - }); - }; - StoreReader.prototype.executeSelectionSet = function (_a) { - var _this = this; - var selectionSet = _a.selectionSet, rootValue = _a.rootValue, execContext = _a.execContext; - var fragmentMap = execContext.fragmentMap, contextValue = execContext.contextValue, variables = execContext.variableValues; - var finalResult = { result: null }; - var objectsToMerge = []; - var object = contextValue.store.get(rootValue.id); - var typename = (object && object.__typename) || - (rootValue.id === 'ROOT_QUERY' && 'Query') || - void 0; - function handleMissing(result) { - var _a; - if (result.missing) { - finalResult.missing = finalResult.missing || []; - (_a = finalResult.missing).push.apply(_a, result.missing); - } - return result.result; - } - selectionSet.selections.forEach(function (selection) { - var _a; - if (!apollo_utilities_1.shouldInclude(selection, variables)) { - return; - } - if (apollo_utilities_1.isField(selection)) { - var fieldResult = handleMissing(_this.executeField(object, typename, selection, execContext)); - if (typeof fieldResult !== 'undefined') { - objectsToMerge.push((_a = {}, - _a[apollo_utilities_1.resultKeyNameFromField(selection)] = fieldResult, - _a)); - } - } - else { - var fragment = void 0; - if (apollo_utilities_1.isInlineFragment(selection)) { - fragment = selection; - } - else { - fragment = fragmentMap[selection.name.value]; - if (!fragment) { - throw new ts_invariant_1.InvariantError("No fragment named " + selection.name.value); - } - } - var typeCondition = fragment.typeCondition && fragment.typeCondition.name.value; - var match = !typeCondition || - execContext.fragmentMatcher(rootValue, typeCondition, contextValue); - if (match) { - var fragmentExecResult = _this.executeSelectionSet({ - selectionSet: fragment.selectionSet, - rootValue: rootValue, - execContext: execContext, - }); - if (match === 'heuristic' && fragmentExecResult.missing) { - fragmentExecResult = tslib_1.__assign(tslib_1.__assign({}, fragmentExecResult), { missing: fragmentExecResult.missing.map(function (info) { - return tslib_1.__assign(tslib_1.__assign({}, info), { tolerable: true }); - }) }); - } - objectsToMerge.push(handleMissing(fragmentExecResult)); - } - } - }); - finalResult.result = apollo_utilities_1.mergeDeepArray(objectsToMerge); - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(finalResult.result); - } - return finalResult; - }; - StoreReader.prototype.executeField = function (object, typename, field, execContext) { - var variables = execContext.variableValues, contextValue = execContext.contextValue; - var fieldName = field.name.value; - var args = apollo_utilities_1.argumentsObjectFromField(field, variables); - var info = { - resultKey: apollo_utilities_1.resultKeyNameFromField(field), - directives: apollo_utilities_1.getDirectiveInfoFromField(field, variables), - }; - var readStoreResult = readStoreResolver(object, typename, fieldName, args, contextValue, info); - if (Array.isArray(readStoreResult.result)) { - return this.combineExecResults(readStoreResult, this.executeSubSelectedArray({ - field: field, - array: readStoreResult.result, - execContext: execContext, - })); - } - if (!field.selectionSet) { - assertSelectionSetForIdValue(field, readStoreResult.result); - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - apollo_utilities_1.maybeDeepFreeze(readStoreResult); - } - return readStoreResult; - } - if (readStoreResult.result == null) { - return readStoreResult; - } - return this.combineExecResults(readStoreResult, this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: readStoreResult.result, - execContext: execContext, - })); - }; - StoreReader.prototype.combineExecResults = function () { - var execResults = []; - for (var _i = 0; _i < arguments.length; _i++) { - execResults[_i] = arguments[_i]; - } - var missing; - execResults.forEach(function (execResult) { - if (execResult.missing) { - missing = missing || []; - missing.push.apply(missing, execResult.missing); - } - }); - return { - result: execResults.pop().result, - missing: missing, - }; - }; - StoreReader.prototype.executeSubSelectedArray = function (_a) { - var _this = this; - var field = _a.field, array = _a.array, execContext = _a.execContext; - var missing; - function handleMissing(childResult) { - if (childResult.missing) { - missing = missing || []; - missing.push.apply(missing, childResult.missing); - } - return childResult.result; - } - array = array.map(function (item) { - if (item === null) { - return null; - } - if (Array.isArray(item)) { - return handleMissing(_this.executeSubSelectedArray({ - field: field, - array: item, - execContext: execContext, - })); - } - if (field.selectionSet) { - return handleMissing(_this.executeSelectionSet({ - selectionSet: field.selectionSet, - rootValue: item, - execContext: execContext, - })); - } - assertSelectionSetForIdValue(field, item); - return item; - }); - if (this.freezeResults && process.env.NODE_ENV !== 'production') { - Object.freeze(array); - } - return { result: array, missing: missing }; - }; - return StoreReader; -}()); -exports.StoreReader = StoreReader; -function assertSelectionSetForIdValue(field, value) { - if (!field.selectionSet && apollo_utilities_1.isIdValue(value)) { - throw new ts_invariant_1.InvariantError("Missing selection set for object of type " + value.typename + " returned for query field " + field.name.value); - } -} -function defaultFragmentMatcher() { - return true; -} -function assertIdValue(idValue) { - ts_invariant_1.invariant(apollo_utilities_1.isIdValue(idValue), "Encountered a sub-selection on the query, but the store doesn't have an object reference. This should never happen during normal use unless you have custom code that is directly manipulating the store; please file an issue."); -} -exports.assertIdValue = assertIdValue; -function readStoreResolver(object, typename, fieldName, args, context, _a) { - var resultKey = _a.resultKey, directives = _a.directives; - var storeKeyName = fieldName; - if (args || directives) { - storeKeyName = apollo_utilities_1.getStoreKeyName(storeKeyName, args, directives); - } - var fieldValue = void 0; - if (object) { - fieldValue = object[storeKeyName]; - if (typeof fieldValue === 'undefined' && - context.cacheRedirects && - typeof typename === 'string') { - var type = context.cacheRedirects[typename]; - if (type) { - var resolver = type[fieldName]; - if (resolver) { - fieldValue = resolver(object, args, { - getCacheKey: function (storeObj) { - var id = context.dataIdFromObject(storeObj); - return id && apollo_utilities_1.toIdValue({ - id: id, - typename: storeObj.__typename, - }); - }, - }); - } - } - } - } - if (typeof fieldValue === 'undefined') { - return { - result: fieldValue, - missing: [{ - object: object, - fieldName: storeKeyName, - tolerable: false, - }], - }; - } - if (apollo_utilities_1.isJsonValue(fieldValue)) { - fieldValue = fieldValue.json; - } - return { - result: fieldValue, - }; -} -//# sourceMappingURL=readFromStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map b/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map deleted file mode 100644 index 6910ead..0000000 --- a/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readFromStore.js","sourceRoot":"","sources":["../src/readFromStore.ts"],"names":[],"mappings":";;;AAAA,qDAyB0B;AAmB1B,qCAAyC;AACzC,uDAAsD;AACtD,6CAAyD;AA6DzD;IAGE,qBAAY,EAGa;QAHzB,iBAuEC;YAvEW,4BAGa,EAFvB,oBAAiD,EAAjD,4FAAiD,EACjD,qBAAqB,EAArB,0CAAqB;QAEf,IAAA,SAIE,EAHN,wCAAiB,EACjB,4CAAmB,EACnB,oDACM,CAAC;QAET,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,IAAI,CAAC,iBAAiB,GAAG,eAAI,CAAC,UAAC,OAA8B;YAC3D,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAI,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC,EAAE;YACD,YAAY,EAAZ,UAAa,EAMW;oBALtB,gBAAK,EACL,wBAAS,EACT,8BAAY,EACZ,kCAAc,EACd,oCAAe;gBAKf,IAAI,YAAY,CAAC,KAAK,YAAY,mCAAgB,EAAE;oBAClD,OAAO,YAAY,CAAC,MAAM,CACxB,YAAY,CAAC,KAAK,EAClB,KAAK,EACL,eAAe,EACf,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAC9B,SAAS,CAAC,EAAE,CACb,CAAC;iBACH;YACH,CAAC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,mBAAmB,GAAG,eAAI,CAAC,UAAC,OAAgC;YAC/D,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAI,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC,EAAE;YACD,YAAY,EAAZ,UAAa,EAIa;oBAHxB,8BAAY,EACZ,wBAAS,EACT,4BAAW;gBAEX,IAAI,WAAW,CAAC,YAAY,CAAC,KAAK,YAAY,mCAAgB,EAAE;oBAC9D,OAAO,YAAY,CAAC,M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AO,EAAE,CAAC;oBACR,MAAM,QAAA;oBACN,SAAS,EAAE,YAAY;oBACvB,SAAS,EAAE,KAAK;iBACjB,CAAC;SACH,CAAC;KACH;IAED,IAAI,8BAAW,CAAC,UAAU,CAAC,EAAE;QAC3B,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC;KAC9B;IAED,OAAO;QACL,MAAM,EAAE,UAAU;KACnB,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.d.ts b/node_modules/apollo-cache-inmemory/lib/types.d.ts deleted file mode 100644 index dbef3cc..0000000 --- a/node_modules/apollo-cache-inmemory/lib/types.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { DocumentNode } from 'graphql'; -import { FragmentMatcher } from './readFromStore'; -import { Transaction } from 'apollo-cache'; -import { IdValue, StoreValue } from 'apollo-utilities'; -export interface IdGetterObj extends Object { - __typename?: string; - id?: string; -} -export declare type IdGetter = (value: IdGetterObj) => string | null | undefined; -export interface NormalizedCache { - get(dataId: string): StoreObject; - set(dataId: string, value: StoreObject): void; - delete(dataId: string): void; - clear(): void; - toObject(): NormalizedCacheObject; - replace(newData: NormalizedCacheObject): void; -} -export interface NormalizedCacheObject { - [dataId: string]: StoreObject | undefined; -} -export interface StoreObject { - __typename?: string; - [storeFieldKey: string]: StoreValue; -} -export declare type OptimisticStoreItem = { - id: string; - data: NormalizedCacheObject; - transaction: Transaction; -}; -export declare type ReadQueryOptions = { - store: NormalizedCache; - query: DocumentNode; - fragmentMatcherFunction?: FragmentMatcher; - variables?: Object; - previousResult?: any; - rootId?: string; - config?: ApolloReducerConfig; -}; -export declare type DiffQueryAgainstStoreOptions = ReadQueryOptions & { - returnPartialData?: boolean; -}; -export declare type ApolloReducerConfig = { - dataIdFromObject?: IdGetter; - fragmentMatcher?: FragmentMatcherInterface; - addTypename?: boolean; - cacheRedirects?: CacheResolverMap; -}; -export declare type ReadStoreContext = { - readonly store: NormalizedCache; - readonly cacheRedirects: CacheResolverMap; - readonly dataIdFromObject?: IdGetter; -}; -export interface FragmentMatcherInterface { - match(idValue: IdValue, typeCondition: string, context: ReadStoreContext): boolean | 'heuristic'; -} -export declare type PossibleTypesMap = { - [key: string]: string[]; -}; -export declare type IntrospectionResultData = { - __schema: { - types: { - kind: string; - name: string; - possibleTypes: { - name: string; - }[]; - }[]; - }; -}; -export declare type CacheResolver = (rootValue: any, args: { - [argName: string]: any; -}, context: any) => any; -export declare type CacheResolverMap = { - [typeName: string]: { - [fieldName: string]: CacheResolver; - }; -}; -export declare type CustomResolver = CacheResolver; -export declare type CustomResolverMap = CacheResolverMap; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.d.ts.map b/node_modules/apollo-cache-inmemory/lib/types.d.ts.map deleted file mode 100644 index 8846892..0000000 --- a/node_modules/apollo-cache-inmemory/lib/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AACD,MAAM,CAAC,OAAO,MAAM,QAAQ,GAAG,CAC7B,KAAK,EAAE,WAAW,KACf,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAM/B,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAA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AE,gBAAgB,CAAC;IAC1C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC;CACtC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,KAAK,CACH,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB,GACxB,OAAO,GAAG,WAAW,CAAC;CAC1B;AAED,oBAAY,gBAAgB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAAC;AAE3D,oBAAY,uBAAuB,GAAG;IACpC,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,aAAa,EAAE;gBACb,IAAI,EAAE,MAAM,CAAC;aACd,EAAE,CAAC;SACL,EAAE,CAAC;KACL,CAAC;CACH,CAAC;AAEF,oBAAY,aAAa,GAAG,CAC1B,SAAS,EAAE,GAAG,EACd,IAAI,EAAE;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAChC,OAAO,EAAE,GAAG,KACT,GAAG,CAAC;AAET,oBAAY,gBAAgB,GAAG;IAC7B,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC;KACpC,CAAC;CACH,CAAC;AAGF,oBAAY,cAAc,GAAG,aAAa,CAAC;AAC3C,oBAAY,iBAAiB,GAAG,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.js b/node_modules/apollo-cache-inmemory/lib/types.js deleted file mode 100644 index 11e638d..0000000 --- a/node_modules/apollo-cache-inmemory/lib/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/types.js.map b/node_modules/apollo-cache-inmemory/lib/types.js.map deleted file mode 100644 index c768b79..0000000 --- a/node_modules/apollo-cache-inmemory/lib/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts b/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts deleted file mode 100644 index a67c325..0000000 --- a/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { SelectionSetNode, FieldNode, DocumentNode } from 'graphql'; -import { FragmentMatcher } from './readFromStore'; -import { FragmentMap } from 'apollo-utilities'; -import { IdGetter, NormalizedCache } from './types'; -export declare class WriteError extends Error { - type: string; -} -export declare function enhanceErrorWithDocument(error: Error, document: DocumentNode): WriteError; -export declare type WriteContext = { - readonly store: NormalizedCache; - readonly processedData?: { - [x: string]: FieldNode[]; - }; - readonly variables?: any; - readonly dataIdFromObject?: IdGetter; - readonly fragmentMap?: FragmentMap; - readonly fragmentMatcherFunction?: FragmentMatcher; -}; -export declare class StoreWriter { - writeQueryToStore({ query, result, store, variables, dataIdFromObject, fragmentMatcherFunction, }: { - query: DocumentNode; - result: Object; - store?: NormalizedCache; - variables?: Object; - dataIdFromObject?: IdGetter; - fragmentMatcherFunction?: FragmentMatcher; - }): NormalizedCache; - writeResultToStore({ dataId, result, document, store, variables, dataIdFromObject, fragmentMatcherFunction, }: { - dataId: string; - result: any; - document: DocumentNode; - store?: NormalizedCache; - variables?: Object; - dataIdFromObject?: IdGetter; - fragmentMatcherFunction?: FragmentMatcher; - }): NormalizedCache; - writeSelectionSetToStore({ result, dataId, selectionSet, context, }: { - dataId: string; - result: any; - selectionSet: SelectionSetNode; - context: WriteContext; - }): NormalizedCache; - private writeFieldToStore; - private processArrayValue; -} -//# sourceMappingURL=writeToStore.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map b/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map deleted file mode 100644 index 6a82131..0000000 --- a/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"writeToStore.d.ts","sourceRoot":"","sources":["src/writeToStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,YAAY,EAGb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAGL,WAAW,EAeZ,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EACL,QAAQ,EACR,eAAe,EAGhB,MAAM,SAAS,CAAC;AAEjB,qBAAa,UAAW,SAAQ,KAAK;IAC5B,IAAI,SAAgB;CAC5B;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,cAQ5E;AAED,oBAAY,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAAA;KAAE,CAAC;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;IACzB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,eAAe,CAAC;CACpD,CAAC;AAEF,qBAAa,WAAW;IAkBf,iBAAiB,CAAC,EACvB,KAAK,EACL,MAAM,EACN,KAAuC,EACvC,SAAS,EACT,gBAAgB,EAChB,uBAAuB,GACxB,EAAE;QACD,KAAK,EAAE,YAAY,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,eAAe,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,QAAQ,CAAC;QAC5B,uBAAuB,CAAC,EAAE,eAAe,CAAC;KAC3C,GAAG,eAAe;IAYZ,kBAAkB,CAAC,EACxB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAuC,EACvC,SAAS,EACT,gBAAgB,EAChB,uBAAuB,GACxB,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,GAAG,CAAC;QACZ,QAAQ,EAAE,YAAY,CAAC;QACvB,KAAK,CAAC,EAAE,eAAe,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,QAAQ,CAAC;QAC5B,uBAAuB,CAAC,EAAE,eAAe,CAAC;KAC3C,GAAG,eAAe;IA2BZ,wBAAwB,CAAC,EAC9B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,OAAO,GACR,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,GAAG,CAAC;QACZ,YAAY,EAAE,gBAAgB,CAAC;QAC/B,OAAO,EAAE,YAAY,CAAC;KACvB,GAAG,eAAe;IAwGnB,OAAO,CAAC,iBAAiB;IAgJzB,OAAO,CAAC,iBAAiB;CA2C1B"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.js b/node_modules/apollo-cache-inmemory/lib/writeToStore.js deleted file mode 100644 index 5ec2a42..0000000 --- a/node_modules/apollo-cache-inmemory/lib/writeToStore.js +++ /dev/null @@ -1,276 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_utilities_1 = require("apollo-utilities"); -var ts_invariant_1 = require("ts-invariant"); -var objectCache_1 = require("./objectCache"); -var depTrackingCache_1 = require("./depTrackingCache"); -var WriteError = (function (_super) { - tslib_1.__extends(WriteError, _super); - function WriteError() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = 'WriteError'; - return _this; - } - return WriteError; -}(Error)); -exports.WriteError = WriteError; -function enhanceErrorWithDocument(error, document) { - var enhancedError = new WriteError("Error writing result to store for query:\n " + JSON.stringify(document)); - enhancedError.message += '\n' + error.message; - enhancedError.stack = error.stack; - return enhancedError; -} -exports.enhanceErrorWithDocument = enhanceErrorWithDocument; -var StoreWriter = (function () { - function StoreWriter() { - } - StoreWriter.prototype.writeQueryToStore = function (_a) { - var query = _a.query, result = _a.result, _b = _a.store, store = _b === void 0 ? depTrackingCache_1.defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; - return this.writeResultToStore({ - dataId: 'ROOT_QUERY', - result: result, - document: query, - store: store, - variables: variables, - dataIdFromObject: dataIdFromObject, - fragmentMatcherFunction: fragmentMatcherFunction, - }); - }; - StoreWriter.prototype.writeResultToStore = function (_a) { - var dataId = _a.dataId, result = _a.result, document = _a.document, _b = _a.store, store = _b === void 0 ? depTrackingCache_1.defaultNormalizedCacheFactory() : _b, variables = _a.variables, dataIdFromObject = _a.dataIdFromObject, fragmentMatcherFunction = _a.fragmentMatcherFunction; - var operationDefinition = apollo_utilities_1.getOperationDefinition(document); - try { - return this.writeSelectionSetToStore({ - result: result, - dataId: dataId, - selectionSet: operationDefinition.selectionSet, - context: { - store: store, - processedData: {}, - variables: apollo_utilities_1.assign({}, apollo_utilities_1.getDefaultValues(operationDefinition), variables), - dataIdFromObject: dataIdFromObject, - fragmentMap: apollo_utilities_1.createFragmentMap(apollo_utilities_1.getFragmentDefinitions(document)), - fragmentMatcherFunction: fragmentMatcherFunction, - }, - }); - } - catch (e) { - throw enhanceErrorWithDocument(e, document); - } - }; - StoreWriter.prototype.writeSelectionSetToStore = function (_a) { - var _this = this; - var result = _a.result, dataId = _a.dataId, selectionSet = _a.selectionSet, context = _a.context; - var variables = context.variables, store = context.store, fragmentMap = context.fragmentMap; - selectionSet.selections.forEach(function (selection) { - var _a; - if (!apollo_utilities_1.shouldInclude(selection, variables)) { - return; - } - if (apollo_utilities_1.isField(selection)) { - var resultFieldKey = apollo_utilities_1.resultKeyNameFromField(selection); - var value = result[resultFieldKey]; - if (typeof value !== 'undefined') { - _this.writeFieldToStore({ - dataId: dataId, - value: value, - field: selection, - context: context, - }); - } - else { - var isDefered = false; - var isClient = false; - if (selection.directives && selection.directives.length) { - isDefered = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'defer'; }); - isClient = selection.directives.some(function (directive) { return directive.name && directive.name.value === 'client'; }); - } - if (!isDefered && !isClient && context.fragmentMatcherFunction) { - ts_invariant_1.invariant.warn("Missing field " + resultFieldKey + " in " + JSON.stringify(result, null, 2).substring(0, 100)); - } - } - } - else { - var fragment = void 0; - if (apollo_utilities_1.isInlineFragment(selection)) { - fragment = selection; - } - else { - fragment = (fragmentMap || {})[selection.name.value]; - ts_invariant_1.invariant(fragment, "No fragment named " + selection.name.value + "."); - } - var matches = true; - if (context.fragmentMatcherFunction && fragment.typeCondition) { - var id = dataId || 'self'; - var idValue = apollo_utilities_1.toIdValue({ id: id, typename: undefined }); - var fakeContext = { - store: new objectCache_1.ObjectCache((_a = {}, _a[id] = result, _a)), - cacheRedirects: {}, - }; - var match = context.fragmentMatcherFunction(idValue, fragment.typeCondition.name.value, fakeContext); - if (!apollo_utilities_1.isProduction() && match === 'heuristic') { - ts_invariant_1.invariant.error('WARNING: heuristic fragment matching going on!'); - } - matches = !!match; - } - if (matches) { - _this.writeSelectionSetToStore({ - result: result, - selectionSet: fragment.selectionSet, - dataId: dataId, - context: context, - }); - } - } - }); - return store; - }; - StoreWriter.prototype.writeFieldToStore = function (_a) { - var _b; - var field = _a.field, value = _a.value, dataId = _a.dataId, context = _a.context; - var variables = context.variables, dataIdFromObject = context.dataIdFromObject, store = context.store; - var storeValue; - var storeObject; - var storeFieldName = apollo_utilities_1.storeKeyNameFromField(field, variables); - if (!field.selectionSet || value === null) { - storeValue = - value != null && typeof value === 'object' - ? - { type: 'json', json: value } - : - value; - } - else if (Array.isArray(value)) { - var generatedId = dataId + "." + storeFieldName; - storeValue = this.processArrayValue(value, generatedId, field.selectionSet, context); - } - else { - var valueDataId = dataId + "." + storeFieldName; - var generated = true; - if (!isGeneratedId(valueDataId)) { - valueDataId = '$' + valueDataId; - } - if (dataIdFromObject) { - var semanticId = dataIdFromObject(value); - ts_invariant_1.invariant(!semanticId || !isGeneratedId(semanticId), 'IDs returned by dataIdFromObject cannot begin with the "$" character.'); - if (semanticId || - (typeof semanticId === 'number' && semanticId === 0)) { - valueDataId = semanticId; - generated = false; - } - } - if (!isDataProcessed(valueDataId, field, context.processedData)) { - this.writeSelectionSetToStore({ - dataId: valueDataId, - result: value, - selectionSet: field.selectionSet, - context: context, - }); - } - var typename = value.__typename; - storeValue = apollo_utilities_1.toIdValue({ id: valueDataId, typename: typename }, generated); - storeObject = store.get(dataId); - var escapedId = storeObject && storeObject[storeFieldName]; - if (escapedId !== storeValue && apollo_utilities_1.isIdValue(escapedId)) { - var hadTypename = escapedId.typename !== undefined; - var hasTypename = typename !== undefined; - var typenameChanged = hadTypename && hasTypename && escapedId.typename !== typename; - ts_invariant_1.invariant(!generated || escapedId.generated || typenameChanged, "Store error: the application attempted to write an object with no provided id but the store already contains an id of " + escapedId.id + " for this object. The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - ts_invariant_1.invariant(!hadTypename || hasTypename, "Store error: the application attempted to write an object with no provided typename but the store already contains an object with typename of " + escapedId.typename + " for the object of id " + escapedId.id + ". The selectionSet that was trying to be written is:\n" + JSON.stringify(field)); - if (escapedId.generated) { - if (typenameChanged) { - if (!generated) { - store.delete(escapedId.id); - } - } - else { - mergeWithGenerated(escapedId.id, storeValue.id, store); - } - } - } - } - storeObject = store.get(dataId); - if (!storeObject || !apollo_utilities_1.isEqual(storeValue, storeObject[storeFieldName])) { - store.set(dataId, tslib_1.__assign(tslib_1.__assign({}, storeObject), (_b = {}, _b[storeFieldName] = storeValue, _b))); - } - }; - StoreWriter.prototype.processArrayValue = function (value, generatedId, selectionSet, context) { - var _this = this; - return value.map(function (item, index) { - if (item === null) { - return null; - } - var itemDataId = generatedId + "." + index; - if (Array.isArray(item)) { - return _this.processArrayValue(item, itemDataId, selectionSet, context); - } - var generated = true; - if (context.dataIdFromObject) { - var semanticId = context.dataIdFromObject(item); - if (semanticId) { - itemDataId = semanticId; - generated = false; - } - } - if (!isDataProcessed(itemDataId, selectionSet, context.processedData)) { - _this.writeSelectionSetToStore({ - dataId: itemDataId, - result: item, - selectionSet: selectionSet, - context: context, - }); - } - return apollo_utilities_1.toIdValue({ id: itemDataId, typename: item.__typename }, generated); - }); - }; - return StoreWriter; -}()); -exports.StoreWriter = StoreWriter; -function isGeneratedId(id) { - return id[0] === '$'; -} -function mergeWithGenerated(generatedKey, realKey, cache) { - if (generatedKey === realKey) { - return false; - } - var generated = cache.get(generatedKey); - var real = cache.get(realKey); - var madeChanges = false; - Object.keys(generated).forEach(function (key) { - var value = generated[key]; - var realValue = real[key]; - if (apollo_utilities_1.isIdValue(value) && - isGeneratedId(value.id) && - apollo_utilities_1.isIdValue(realValue) && - !apollo_utilities_1.isEqual(value, realValue) && - mergeWithGenerated(value.id, realValue.id, cache)) { - madeChanges = true; - } - }); - cache.delete(generatedKey); - var newRealValue = tslib_1.__assign(tslib_1.__assign({}, generated), real); - if (apollo_utilities_1.isEqual(newRealValue, real)) { - return madeChanges; - } - cache.set(realKey, newRealValue); - return true; -} -function isDataProcessed(dataId, field, processedData) { - if (!processedData) { - return false; - } - if (processedData[dataId]) { - if (processedData[dataId].indexOf(field) >= 0) { - return true; - } - else { - processedData[dataId].push(field); - } - } - else { - processedData[dataId] = [field]; - } - return false; -} -//# sourceMappingURL=writeToStore.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map b/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map deleted file mode 100644 index b592a9c..0000000 --- a/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"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AAM;QACL,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACjC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache-inmemory/package.json b/node_modules/apollo-cache-inmemory/package.json deleted file mode 100644 index 82cf0c2..0000000 --- a/node_modules/apollo-cache-inmemory/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "apollo-cache-inmemory", - "version": "1.6.6", - "description": "Core abstract of Caching layer for Apollo Client", - "author": "James Baxley ", - "contributors": [ - "James Baxley ", - "Jonas Helfer ", - "Sashko Stubailo ", - "James Burgess ", - "Bazyli Brzóska " - ], - "license": "MIT", - "main": "./lib/bundle.cjs.js", - "module": "./lib/bundle.esm.js", - "typings": "./lib/index.d.ts", - "sideEffects": [ - "./lib/fixPolyfills.js" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/apollo-client.git" - }, - "bugs": { - "url": "https://github.com/apollographql/apollo-client/issues" - }, - "homepage": "https://github.com/apollographql/apollo-client#readme", - "scripts": { - "prepare": "npm run build", - "coverage": "jest --coverage", - "test": "tsc -p tsconfig.json --noEmit && jest", - "lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts", - "prebuild": "npm run clean", - "build": "tsc -b .", - "postbuild": "npm run bundle", - "bundle": "npx rollup -c rollup.config.js", - "watch": "../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"", - "clean": "rm -rf coverage/* lib/*", - "prepublishOnly": "npm run build" - }, - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "gitHead": "d22394c419ff7d678afb5e7d4cd1df16ed803ead" -} diff --git a/node_modules/apollo-cache/CHANGELOG.md b/node_modules/apollo-cache/CHANGELOG.md deleted file mode 100644 index c9adb0e..0000000 --- a/node_modules/apollo-cache/CHANGELOG.md +++ /dev/null @@ -1,72 +0,0 @@ -# CHANGELOG - ----- - -**NOTE:** This changelog is no longer maintained. Changes are now tracked in -the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md). - ----- - -### 1.1.12 - -- No changes. - -### 1.1.11 - -- No changes. - -### 1.1.10 - -- Added optional generics to cache manipulation methods (typescript). - [PR #3541](https://github.com/apollographql/apollo-client/pull/3541) - -### 1.1.9 - -- No public facing functionality changes. -- Various internal code cleanup, tooling and dependency changes. - -### 1.1.8 - -- Not documented - -### 1.1.7 - -- Not documented - -### 1.1.6 - -- Improve code coverage -- Map coverage to original source - -### 1.1.3 - -- Dependency updates - -### 1.1.2 - -- Dependency updates - -### 1.1.1 - -- Dependency updates - -### 1.1.0 - -- Add cache.writeData to base cache type & DataProxy - [PR #2818](https://github.com/apollographql/apollo-client/pull/2818) - -### 1.0.3 - -- Dependency updates - -### 1.0.2 - -- Package dependency updates - -### 1.0.1 - -- Improved rollup builds - -### 1.0.0 - -- Initial solid cache API diff --git a/node_modules/apollo-cache/LICENSE b/node_modules/apollo-cache/LICENSE deleted file mode 100644 index 278ee9d..0000000 --- a/node_modules/apollo-cache/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Meteor Development Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/apollo-cache/jest.config.js b/node_modules/apollo-cache/jest.config.js deleted file mode 100644 index 48f0a89..0000000 --- a/node_modules/apollo-cache/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../config/jest.config.settings'), -}; diff --git a/node_modules/apollo-cache/lib/bundle.cjs.js b/node_modules/apollo-cache/lib/bundle.cjs.js deleted file mode 100644 index 25b0a4e..0000000 --- a/node_modules/apollo-cache/lib/bundle.cjs.js +++ /dev/null @@ -1,194 +0,0 @@ -exports.__esModule = true; -exports.Cache = exports.ApolloCache = void 0; - -var _apolloUtilities = require("apollo-utilities"); - -function queryFromPojo(obj) { - var op = { - kind: 'OperationDefinition', - operation: 'query', - name: { - kind: 'Name', - value: 'GeneratedClientQuery' - }, - selectionSet: selectionSetFromObj(obj) - }; - var out = { - kind: 'Document', - definitions: [op] - }; - return out; -} - -function fragmentFromPojo(obj, typename) { - var frag = { - kind: 'FragmentDefinition', - typeCondition: { - kind: 'NamedType', - name: { - kind: 'Name', - value: typename || '__FakeType' - } - }, - name: { - kind: 'Name', - value: 'GeneratedClientQuery' - }, - selectionSet: selectionSetFromObj(obj) - }; - var out = { - kind: 'Document', - definitions: [frag] - }; - return out; -} - -function selectionSetFromObj(obj) { - if (typeof obj === 'number' || typeof obj === 'boolean' || typeof obj === 'string' || typeof obj === 'undefined' || obj === null) { - return null; - } - - if (Array.isArray(obj)) { - return selectionSetFromObj(obj[0]); - } - - var selections = []; - Object.keys(obj).forEach(function (key) { - var nestedSelSet = selectionSetFromObj(obj[key]); - var field = { - kind: 'Field', - name: { - kind: 'Name', - value: key - }, - selectionSet: nestedSelSet || undefined - }; - selections.push(field); - }); - var selectionSet = { - kind: 'SelectionSet', - selections: selections - }; - return selectionSet; -} - -var justTypenameQuery = { - kind: 'Document', - definitions: [{ - kind: 'OperationDefinition', - operation: 'query', - name: null, - variableDefinitions: null, - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [{ - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: '__typename' - }, - arguments: [], - directives: [], - selectionSet: null - }] - } - }] -}; - -var ApolloCache = function () { - function ApolloCache() {} - - ApolloCache.prototype.transformDocument = function (document) { - return document; - }; - - ApolloCache.prototype.transformForLink = function (document) { - return document; - }; - - ApolloCache.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.read({ - query: options.query, - variables: options.variables, - optimistic: optimistic - }); - }; - - ApolloCache.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.read({ - query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName), - variables: options.variables, - rootId: options.id, - optimistic: optimistic - }); - }; - - ApolloCache.prototype.writeQuery = function (options) { - this.write({ - dataId: 'ROOT_QUERY', - result: options.data, - query: options.query, - variables: options.variables - }); - }; - - ApolloCache.prototype.writeFragment = function (options) { - this.write({ - dataId: options.id, - result: options.data, - variables: options.variables, - query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName) - }); - }; - - ApolloCache.prototype.writeData = function (_a) { - var id = _a.id, - data = _a.data; - - if (typeof id !== 'undefined') { - var typenameResult = null; - - try { - typenameResult = this.read({ - rootId: id, - optimistic: false, - query: justTypenameQuery - }); - } catch (e) {} - - var __typename = typenameResult && typenameResult.__typename || '__ClientData'; - - var dataToWrite = Object.assign({ - __typename: __typename - }, data); - this.writeFragment({ - id: id, - fragment: fragmentFromPojo(dataToWrite, __typename), - data: dataToWrite - }); - } else { - this.writeQuery({ - query: queryFromPojo(data), - data: data - }); - } - }; - - return ApolloCache; -}(); - -exports.ApolloCache = ApolloCache; -var Cache; -exports.Cache = Cache; - -(function (Cache) {})(Cache || (exports.Cache = Cache = {})); diff --git a/node_modules/apollo-cache/lib/bundle.cjs.js.map b/node_modules/apollo-cache/lib/bundle.cjs.js.map deleted file mode 100644 index dee6b94..0000000 --- a/node_modules/apollo-cache/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/utils.ts","../src/cache.ts","../src/types/Cache.ts"],"names":[],"mappings":";;;;;;;SAQgB,a,CAAc,G,EAAQ;AACpC,MAAM,EAAE,GAA4B;AAClC,IAAA,IAAI,EAAE,qBAD4B;AAElC,IAAA,SAAS,EAAE,OAFuB;AAGlC,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,MADF;AAEJ,MAAA,KAAK,EAAE;AAFH,KAH4B;AAOlC,IAAA,YAAY,EAAE,mBAAmB,CAAC,GAAD;AAPC,GAApC;AAUA,MAAM,GAAG,GAAiB;AACxB,IAAA,IAAI,EAAE,UADkB;AAExB,IAAA,WAAW,EAAE,CAAC,EAAD;AAFW,GAA1B;AAKA,SAAO,GAAP;AACD;;AAED,SAAgB,gBAAhB,CAAiC,GAAjC,EAA2C,QAA3C,EAA4D;AAC1D,MAAM,IAAI,GAA2B;AACnC,IAAA,IAAI,EAAE,oBAD6B;AAEnC,IAAA,aAAa,EAAE;AACb,MAAA,IAAI,EAAE,WADO;AAEb,MAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,MADF;AAEJ,QAAA,KAAK,EAAE,QAAQ,IAAI;AAFf;AAFO,KAFoB;AASnC,IAAA,IAAI,EAAE;AACJ,MAAA,IAAI,EAAE,MADF;AAEJ,MAAA,KAAK,EAAE;AAFH,KAT6B;AAanC,IAAA,YAAY,EAAE,mBAAmB,CAAC,GAAD;AAbE,GAArC;AAgBA,MAAM,GAAG,GAAiB;AACxB,IAAA,IAAI,EAAE,UADkB;AAExB,IAAA,WAAW,EAAE,CAAC,IAAD;A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B;AACjB,QAAA,EAAE,EAAA,EADe;AAEjB,QAAA,QAAQ,EAAE,gBAAgB,CAAC,WAAD,EAAc,UAAd,CAFT;AAGjB,QAAA,IAAI,EAAE;AAHW,OAAnB;AAKD,KA5BD,MA4BO;AACL,WAAK,UAAL,CAAgB;AAAE,QAAA,KAAK,EAAE,aAAa,CAAC,IAAD,CAAtB;AAA8B,QAAA,IAAI,EAAA;AAAlC,OAAhB;AACD;AACF,GAnCM;;AAoCT,SAAA,WAAA;AAAC,C;;;ICnJgB,K;;;AAAjB,CAAA,UAAiB,KAAjB,EAAsB,CAqCrB,CArCD,EAAiB,KAAK,qBAAL,KAAK,GAAA,EAAA,CAAtB,E","sourcesContent":["import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","import { DataProxy } from './DataProxy';\n\nexport namespace Cache {\n export type WatchCallback = (newData: any) => void;\n export interface EvictionResult {\n success: Boolean;\n }\n\n export interface ReadOptions\n extends DataProxy.Query {\n rootId?: string;\n previousResult?: any;\n optimistic: boolean;\n }\n\n export interface WriteOptions\n extends DataProxy.Query {\n dataId: string;\n result: TResult;\n }\n\n export interface DiffOptions extends ReadOptions {\n returnPartialData?: boolean;\n }\n\n export interface WatchOptions extends ReadOptions {\n callback: WatchCallback;\n }\n\n export interface EvictOptions\n extends DataProxy.Query {\n rootId?: string;\n }\n\n export import DiffResult = DataProxy.DiffResult;\n export import WriteQueryOptions = DataProxy.WriteQueryOptions;\n export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;\n export import WriteDataOptions = DataProxy.WriteDataOptions;\n export import Fragment = DataProxy.Fragment;\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/bundle.cjs.min.js b/node_modules/apollo-cache/lib/bundle.cjs.min.js deleted file mode 100644 index 5b9e384..0000000 --- a/node_modules/apollo-cache/lib/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -exports.__esModule=!0,exports.Cache=exports.ApolloCache=void 0;var e=require("apollo-utilities");function t(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:i(e)}]}}function i(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return i(e[0]);var t=[];return Object.keys(e).forEach(function(n){var r={kind:"Field",name:{kind:"Name",value:n},selectionSet:i(e[n])||void 0};t.push(r)}),{kind:"SelectionSet",selections:t}}var n,r={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},a=function(){function n(){}return n.prototype.transformDocument=function(e){return e},n.prototype.transformForLink=function(e){return e},n.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},n.prototype.readFragment=function(t,i){return void 0===i&&(i=!1),this.read({query:(0,e.getFragmentQueryDocument)(t.fragment,t.fragmentName),variables:t.variables,rootId:t.id,optimistic:i})},n.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},n.prototype.writeFragment=function(t){this.write({dataId:t.id,result:t.data,variables:t.variables,query:(0,e.getFragmentQueryDocument)(t.fragment,t.fragmentName)})},n.prototype.writeData=function(e){var n,a,o=e.id,u=e.data;if(void 0!==o){var l=null;try{l=this.read({rootId:o,optimistic:!1,query:r})}catch(e){}var s=l&&l.__typename||"__ClientData",d=Object.assign({__typename:s},u);this.writeFragment({id:o,fragment:(n=d,a=s,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:a||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:i(n)}]}),data:d})}else this.writeQuery({query:t(u),data:u})},n}();exports.ApolloCache=a,exports.Cache=n,n||(exports.Cache=n={}); diff --git a/node_modules/apollo-cache/lib/bundle.esm.js b/node_modules/apollo-cache/lib/bundle.esm.js deleted file mode 100644 index 7f3e30e..0000000 --- a/node_modules/apollo-cache/lib/bundle.esm.js +++ /dev/null @@ -1,175 +0,0 @@ -import { getFragmentQueryDocument } from 'apollo-utilities'; - -function queryFromPojo(obj) { - var op = { - kind: 'OperationDefinition', - operation: 'query', - name: { - kind: 'Name', - value: 'GeneratedClientQuery', - }, - selectionSet: selectionSetFromObj(obj), - }; - var out = { - kind: 'Document', - definitions: [op], - }; - return out; -} -function fragmentFromPojo(obj, typename) { - var frag = { - kind: 'FragmentDefinition', - typeCondition: { - kind: 'NamedType', - name: { - kind: 'Name', - value: typename || '__FakeType', - }, - }, - name: { - kind: 'Name', - value: 'GeneratedClientQuery', - }, - selectionSet: selectionSetFromObj(obj), - }; - var out = { - kind: 'Document', - definitions: [frag], - }; - return out; -} -function selectionSetFromObj(obj) { - if (typeof obj === 'number' || - typeof obj === 'boolean' || - typeof obj === 'string' || - typeof obj === 'undefined' || - obj === null) { - return null; - } - if (Array.isArray(obj)) { - return selectionSetFromObj(obj[0]); - } - var selections = []; - Object.keys(obj).forEach(function (key) { - var nestedSelSet = selectionSetFromObj(obj[key]); - var field = { - kind: 'Field', - name: { - kind: 'Name', - value: key, - }, - selectionSet: nestedSelSet || undefined, - }; - selections.push(field); - }); - var selectionSet = { - kind: 'SelectionSet', - selections: selections, - }; - return selectionSet; -} -var justTypenameQuery = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: null, - variableDefinitions: null, - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: '__typename', - }, - arguments: [], - directives: [], - selectionSet: null, - }, - ], - }, - }, - ], -}; - -var ApolloCache = (function () { - function ApolloCache() { - } - ApolloCache.prototype.transformDocument = function (document) { - return document; - }; - ApolloCache.prototype.transformForLink = function (document) { - return document; - }; - ApolloCache.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.read({ - query: options.query, - variables: options.variables, - optimistic: optimistic, - }); - }; - ApolloCache.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.read({ - query: getFragmentQueryDocument(options.fragment, options.fragmentName), - variables: options.variables, - rootId: options.id, - optimistic: optimistic, - }); - }; - ApolloCache.prototype.writeQuery = function (options) { - this.write({ - dataId: 'ROOT_QUERY', - result: options.data, - query: options.query, - variables: options.variables, - }); - }; - ApolloCache.prototype.writeFragment = function (options) { - this.write({ - dataId: options.id, - result: options.data, - variables: options.variables, - query: getFragmentQueryDocument(options.fragment, options.fragmentName), - }); - }; - ApolloCache.prototype.writeData = function (_a) { - var id = _a.id, data = _a.data; - if (typeof id !== 'undefined') { - var typenameResult = null; - try { - typenameResult = this.read({ - rootId: id, - optimistic: false, - query: justTypenameQuery, - }); - } - catch (e) { - } - var __typename = (typenameResult && typenameResult.__typename) || '__ClientData'; - var dataToWrite = Object.assign({ __typename: __typename }, data); - this.writeFragment({ - id: id, - fragment: fragmentFromPojo(dataToWrite, __typename), - data: dataToWrite, - }); - } - else { - this.writeQuery({ query: queryFromPojo(data), data: data }); - } - }; - return ApolloCache; -}()); - -var Cache; -(function (Cache) { -})(Cache || (Cache = {})); - -export { ApolloCache, Cache }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-cache/lib/bundle.esm.js.map b/node_modules/apollo-cache/lib/bundle.esm.js.map deleted file mode 100644 index 04ac58c..0000000 --- a/node_modules/apollo-cache/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/utils.ts","../src/cache.ts","../src/types/Cache.ts"],"sourcesContent":["import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","import { DataProxy } from './DataProxy';\n\nexport namespace Cache {\n export type WatchCallback = (newData: any) => void;\n export interface EvictionResult {\n success: Boolean;\n }\n\n export interface ReadOptions\n extends DataProxy.Query {\n rootId?: string;\n previousResult?: any;\n optimistic: boolean;\n }\n\n export interface WriteOptions\n extends DataProxy.Query {\n dataId: string;\n result: TResult;\n }\n\n export interface DiffOptions extends ReadOptions {\n returnPartialData?: boolean;\n }\n\n export interface WatchOptions extends ReadOptions {\n callback: WatchCallback;\n }\n\n export interface EvictOptions\n extends DataProxy.Query {\n rootId?: string;\n }\n\n export import DiffResult = DataProxy.DiffResult;\n export import WriteQueryOptions = DataProxy.WriteQueryOptions;\n export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;\n export import WriteDataOptions = DataProxy.WriteDataOptions;\n export import Fragment = DataProxy.Fragment;\n}\n"],"names":[],"mappings":";;SAQgB,aAAa,CAAC,GAAQ;IACpC,IAAM,EAAE,GAA4B;QAClC,IAAI,EAAE,qBAAqB;QAC3B,SAAS,EAAE,OAAO;QAClB,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,sBAAsB;SAC9B;QACD,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC;KACvC,CAAC;IAEF,IAAM,GAAG,GAAiB;QACxB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,CAAC,EAAE,CAAC;KAClB,CAAC;IAEF,OAAO,GAAG,CAAC;CACZ;AAED,SAAgB,gBAAgB,CAAC,GAAQ,EAAE,QAAiB;IAC1D,IAAM,IAAI,GAA2B;QACnC,IAAI,EAAE,oBAAoB;QAC1B,aAAa,EAAE;YACb,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,QAAQ,IAAI,YAAY;aAChC;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,sBAAsB;SAC9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o-cache/lib/bundle.umd.js deleted file mode 100644 index 0edf921..0000000 --- a/node_modules/apollo-cache/lib/bundle.umd.js +++ /dev/null @@ -1,208 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(["exports", "apollo-utilities"], factory); - } else if (typeof exports !== "undefined") { - factory(exports, require("apollo-utilities")); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.apolloUtilities); - global.unknown = mod.exports; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _apolloUtilities) { - - _exports.__esModule = true; - _exports.Cache = _exports.ApolloCache = void 0; - - function queryFromPojo(obj) { - var op = { - kind: 'OperationDefinition', - operation: 'query', - name: { - kind: 'Name', - value: 'GeneratedClientQuery' - }, - selectionSet: selectionSetFromObj(obj) - }; - var out = { - kind: 'Document', - definitions: [op] - }; - return out; - } - - function fragmentFromPojo(obj, typename) { - var frag = { - kind: 'FragmentDefinition', - typeCondition: { - kind: 'NamedType', - name: { - kind: 'Name', - value: typename || '__FakeType' - } - }, - name: { - kind: 'Name', - value: 'GeneratedClientQuery' - }, - selectionSet: selectionSetFromObj(obj) - }; - var out = { - kind: 'Document', - definitions: [frag] - }; - return out; - } - - function selectionSetFromObj(obj) { - if (typeof obj === 'number' || typeof obj === 'boolean' || typeof obj === 'string' || typeof obj === 'undefined' || obj === null) { - return null; - } - - if (Array.isArray(obj)) { - return selectionSetFromObj(obj[0]); - } - - var selections = []; - Object.keys(obj).forEach(function (key) { - var nestedSelSet = selectionSetFromObj(obj[key]); - var field = { - kind: 'Field', - name: { - kind: 'Name', - value: key - }, - selectionSet: nestedSelSet || undefined - }; - selections.push(field); - }); - var selectionSet = { - kind: 'SelectionSet', - selections: selections - }; - return selectionSet; - } - - var justTypenameQuery = { - kind: 'Document', - definitions: [{ - kind: 'OperationDefinition', - operation: 'query', - name: null, - variableDefinitions: null, - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [{ - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: '__typename' - }, - arguments: [], - directives: [], - selectionSet: null - }] - } - }] - }; - - var ApolloCache = function () { - function ApolloCache() {} - - ApolloCache.prototype.transformDocument = function (document) { - return document; - }; - - ApolloCache.prototype.transformForLink = function (document) { - return document; - }; - - ApolloCache.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.read({ - query: options.query, - variables: options.variables, - optimistic: optimistic - }); - }; - - ApolloCache.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.read({ - query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName), - variables: options.variables, - rootId: options.id, - optimistic: optimistic - }); - }; - - ApolloCache.prototype.writeQuery = function (options) { - this.write({ - dataId: 'ROOT_QUERY', - result: options.data, - query: options.query, - variables: options.variables - }); - }; - - ApolloCache.prototype.writeFragment = function (options) { - this.write({ - dataId: options.id, - result: options.data, - variables: options.variables, - query: (0, _apolloUtilities.getFragmentQueryDocument)(options.fragment, options.fragmentName) - }); - }; - - ApolloCache.prototype.writeData = function (_a) { - var id = _a.id, - data = _a.data; - - if (typeof id !== 'undefined') { - var typenameResult = null; - - try { - typenameResult = this.read({ - rootId: id, - optimistic: false, - query: justTypenameQuery - }); - } catch (e) {} - - var __typename = typenameResult && typenameResult.__typename || '__ClientData'; - - var dataToWrite = Object.assign({ - __typename: __typename - }, data); - this.writeFragment({ - id: id, - fragment: fragmentFromPojo(dataToWrite, __typename), - data: dataToWrite - }); - } else { - this.writeQuery({ - query: queryFromPojo(data), - data: data - }); - } - }; - - return ApolloCache; - }(); - - _exports.ApolloCache = ApolloCache; - var Cache; - _exports.Cache = Cache; - - (function (Cache) {})(Cache || (_exports.Cache = Cache = {})); - -}); diff --git a/node_modules/apollo-cache/lib/bundle.umd.js.map b/node_modules/apollo-cache/lib/bundle.umd.js.map deleted file mode 100644 index ce6fdb0..0000000 --- a/node_modules/apollo-cache/lib/bundle.umd.js.map +++ /dev/null @@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AD,CAAtB;AAA8B,UAAA,IAAI,EAAA;AAAlC,SAAhB;AACD;AACF,KAnCM;;AAoCT,WAAA,WAAA;AAAC,G;;;MCnJgB,K;;;AAAjB,GAAA,UAAiB,KAAjB,EAAsB,CAqCrB,CArCD,EAAiB,KAAK,sBAAL,KAAK,GAAA,EAAA,CAAtB,E","sourcesContent":["import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n FieldNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nexport function queryFromPojo(obj: any): DocumentNode {\n const op: OperationDefinitionNode = {\n kind: 'OperationDefinition',\n operation: 'query',\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [op],\n };\n\n return out;\n}\n\nexport function fragmentFromPojo(obj: any, typename?: string): DocumentNode {\n const frag: FragmentDefinitionNode = {\n kind: 'FragmentDefinition',\n typeCondition: {\n kind: 'NamedType',\n name: {\n kind: 'Name',\n value: typename || '__FakeType',\n },\n },\n name: {\n kind: 'Name',\n value: 'GeneratedClientQuery',\n },\n selectionSet: selectionSetFromObj(obj),\n };\n\n const out: DocumentNode = {\n kind: 'Document',\n definitions: [frag],\n };\n\n return out;\n}\n\nfunction selectionSetFromObj(obj: any): SelectionSetNode {\n if (\n typeof obj === 'number' ||\n typeof obj === 'boolean' ||\n typeof obj === 'string' ||\n typeof obj === 'undefined' ||\n obj === null\n ) {\n // No selection set here\n return null;\n }\n\n if (Array.isArray(obj)) {\n // GraphQL queries don't include arrays\n return selectionSetFromObj(obj[0]);\n }\n\n // Now we know it's an object\n const selections: FieldNode[] = [];\n\n Object.keys(obj).forEach(key => {\n const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]);\n\n const field: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: key,\n },\n selectionSet: nestedSelSet || undefined,\n };\n\n selections.push(field);\n });\n\n const selectionSet: SelectionSetNode = {\n kind: 'SelectionSet',\n selections,\n };\n\n return selectionSet;\n}\n\nexport const justTypenameQuery: DocumentNode = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: null,\n variableDefinitions: null,\n directives: [],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n alias: null,\n name: {\n kind: 'Name',\n value: '__typename',\n },\n arguments: [],\n directives: [],\n selectionSet: null,\n },\n ],\n },\n },\n ],\n};\n","import { DocumentNode } from 'graphql';\nimport { getFragmentQueryDocument } from 'apollo-utilities';\n\nimport { DataProxy, Cache } from './types';\nimport { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils';\n\nexport type Transaction = (c: ApolloCache) => void;\n\nexport abstract class ApolloCache implements DataProxy {\n // required to implement\n // core API\n public abstract read(\n query: Cache.ReadOptions,\n ): T | null;\n public abstract write(\n write: Cache.WriteOptions,\n ): void;\n public abstract diff(query: Cache.DiffOptions): Cache.DiffResult;\n public abstract watch(watch: Cache.WatchOptions): () => void;\n public abstract evict(\n query: Cache.EvictOptions,\n ): Cache.EvictionResult;\n public abstract reset(): Promise;\n\n // intializer / offline / ssr API\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public abstract restore(\n serializedState: TSerialized,\n ): ApolloCache;\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public abstract extract(optimistic?: boolean): TSerialized;\n\n // optimistic API\n public abstract removeOptimistic(id: string): void;\n\n // transactional API\n public abstract performTransaction(\n transaction: Transaction,\n ): void;\n public abstract recordOptimisticTransaction(\n transaction: Transaction,\n id: string,\n ): void;\n\n // optional API\n public transformDocument(document: DocumentNode): DocumentNode {\n return document;\n }\n // experimental\n public transformForLink(document: DocumentNode): DocumentNode {\n return document;\n }\n\n // DataProxy API\n /**\n *\n * @param options\n * @param optimistic\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): QueryType | null {\n return this.read({\n query: options.query,\n variables: options.variables,\n optimistic,\n });\n }\n\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): FragmentType | null {\n return this.read({\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n variables: options.variables,\n rootId: options.id,\n optimistic,\n });\n }\n\n public writeQuery(\n options: Cache.WriteQueryOptions,\n ): void {\n this.write({\n dataId: 'ROOT_QUERY',\n result: options.data,\n query: options.query,\n variables: options.variables,\n });\n }\n\n public writeFragment(\n options: Cache.WriteFragmentOptions,\n ): void {\n this.write({\n dataId: options.id,\n result: options.data,\n variables: options.variables,\n query: getFragmentQueryDocument(options.fragment, options.fragmentName),\n });\n }\n\n public writeData({\n id,\n data,\n }: Cache.WriteDataOptions): void {\n if (typeof id !== 'undefined') {\n let typenameResult = null;\n // Since we can't use fragments without having a typename in the store,\n // we need to make sure we have one.\n // To avoid overwriting an existing typename, we need to read it out first\n // and generate a fake one if none exists.\n try {\n typenameResult = this.read({\n rootId: id,\n optimistic: false,\n query: justTypenameQuery,\n });\n } catch (e) {\n // Do nothing, since an error just means no typename exists\n }\n\n // tslint:disable-next-line\n const __typename =\n (typenameResult && typenameResult.__typename) || '__ClientData';\n\n // Add a type here to satisfy the inmemory cache\n const dataToWrite = Object.assign({ __typename }, data);\n\n this.writeFragment({\n id,\n fragment: fragmentFromPojo(dataToWrite, __typename),\n data: dataToWrite,\n });\n } else {\n this.writeQuery({ query: queryFromPojo(data), data });\n }\n }\n}\n","import { DataProxy } from './DataProxy';\n\nexport namespace Cache {\n export type WatchCallback = (newData: any) => void;\n export interface EvictionResult {\n success: Boolean;\n }\n\n export interface ReadOptions\n extends DataProxy.Query {\n rootId?: string;\n previousResult?: any;\n optimistic: boolean;\n }\n\n export interface WriteOptions\n extends DataProxy.Query {\n dataId: string;\n result: TResult;\n }\n\n export interface DiffOptions extends ReadOptions {\n returnPartialData?: boolean;\n }\n\n export interface WatchOptions extends ReadOptions {\n callback: WatchCallback;\n }\n\n export interface EvictOptions\n extends DataProxy.Query {\n rootId?: string;\n }\n\n export import DiffResult = DataProxy.DiffResult;\n export import WriteQueryOptions = DataProxy.WriteQueryOptions;\n export import WriteFragmentOptions = DataProxy.WriteFragmentOptions;\n export import WriteDataOptions = DataProxy.WriteDataOptions;\n export import Fragment = DataProxy.Fragment;\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.d.ts b/node_modules/apollo-cache/lib/cache.d.ts deleted file mode 100644 index 7d2c3c3..0000000 --- a/node_modules/apollo-cache/lib/cache.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DocumentNode } from 'graphql'; -import { DataProxy, Cache } from './types'; -export declare type Transaction = (c: ApolloCache) => void; -export declare abstract class ApolloCache implements DataProxy { - abstract read(query: Cache.ReadOptions): T | null; - abstract write(write: Cache.WriteOptions): void; - abstract diff(query: Cache.DiffOptions): Cache.DiffResult; - abstract watch(watch: Cache.WatchOptions): () => void; - abstract evict(query: Cache.EvictOptions): Cache.EvictionResult; - abstract reset(): Promise; - abstract restore(serializedState: TSerialized): ApolloCache; - abstract extract(optimistic?: boolean): TSerialized; - abstract removeOptimistic(id: string): void; - abstract performTransaction(transaction: Transaction): void; - abstract recordOptimisticTransaction(transaction: Transaction, id: string): void; - transformDocument(document: DocumentNode): DocumentNode; - transformForLink(document: DocumentNode): DocumentNode; - readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; - readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; - writeQuery(options: Cache.WriteQueryOptions): void; - writeFragment(options: Cache.WriteFragmentOptions): void; - writeData({ id, data, }: Cache.WriteDataOptions): void; -} -//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.d.ts.map b/node_modules/apollo-cache/lib/cache.d.ts.map deleted file mode 100644 index 45ce125..0000000 --- a/node_modules/apollo-cache/lib/cache.d.ts.map +++ /dev/null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C,EAAE,EAAE,MAAM,GACT,IAAI;IAGA,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY;IAIvD,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY;IAUtD,SAAS,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,EAC1C,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EACpC,UAAU,GAAE,OAAe,GAC1B,SAAS,GAAG,IAAI;IAQZ,YAAY,CAAC,YAAY,EAAE,UAAU,GAAG,GAAG,EAChD,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EACvC,UAAU,GAAE,OAAe,GAC1B,YAAY,GAAG,IAAI;IASf,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EAC7C,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,GAClD,IAAI;IASA,aAAa,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EAChD,OAAO,EAAE,KAAK,CAAC,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,GACrD,IAAI;IASA,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,EAC5B,EAAE,EACF,IAAI,GACL,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAI;CAiCxC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.js b/node_modules/apollo-cache/lib/cache.js deleted file mode 100644 index aec0779..0000000 --- a/node_modules/apollo-cache/lib/cache.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var apollo_utilities_1 = require("apollo-utilities"); -var utils_1 = require("./utils"); -var ApolloCache = (function () { - function ApolloCache() { - } - ApolloCache.prototype.transformDocument = function (document) { - return document; - }; - ApolloCache.prototype.transformForLink = function (document) { - return document; - }; - ApolloCache.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.read({ - query: options.query, - variables: options.variables, - optimistic: optimistic, - }); - }; - ApolloCache.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.read({ - query: apollo_utilities_1.getFragmentQueryDocument(options.fragment, options.fragmentName), - variables: options.variables, - rootId: options.id, - optimistic: optimistic, - }); - }; - ApolloCache.prototype.writeQuery = function (options) { - this.write({ - dataId: 'ROOT_QUERY', - result: options.data, - query: options.query, - variables: options.variables, - }); - }; - ApolloCache.prototype.writeFragment = function (options) { - this.write({ - dataId: options.id, - result: options.data, - variables: options.variables, - query: apollo_utilities_1.getFragmentQueryDocument(options.fragment, options.fragmentName), - }); - }; - ApolloCache.prototype.writeData = function (_a) { - var id = _a.id, data = _a.data; - if (typeof id !== 'undefined') { - var typenameResult = null; - try { - typenameResult = this.read({ - rootId: id, - optimistic: false, - query: utils_1.justTypenameQuery, - }); - } - catch (e) { - } - var __typename = (typenameResult && typenameResult.__typename) || '__ClientData'; - var dataToWrite = Object.assign({ __typename: __typename }, data); - this.writeFragment({ - id: id, - fragment: utils_1.fragmentFromPojo(dataToWrite, __typename), - data: dataToWrite, - }); - } - else { - this.writeQuery({ query: utils_1.queryFromPojo(data), data: data }); - } - }; - return ApolloCache; -}()); -exports.ApolloCache = ApolloCache; -//# sourceMappingURL=cache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/cache.js.map b/node_modules/apollo-cache/lib/cache.js.map deleted file mode 100644 index 348c78f..0000000 --- a/node_modules/apollo-cache/lib/cache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":";;AACA,qDAA4D;AAG5D,iCAA6E;AAI7E;IAAA;IA6IA,CAAC;IA/FQ,uCAAiB,GAAxB,UAAyB,QAAsB;QAC7C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,sCAAgB,GAAvB,UAAwB,QAAsB;QAC5C,OAAO,Q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Ac,GAAG,IAAI,CAAC,IAAI,CAAM;oBAC9B,MAAM,EAAE,EAAE;oBACV,UAAU,EAAE,KAAK;oBACjB,KAAK,EAAE,yBAAiB;iBACzB,CAAC,CAAC;aACJ;YAAC,OAAO,CAAC,EAAE;aAEX;YAGD,IAAM,UAAU,GACd,CAAC,cAAc,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,cAAc,CAAC;YAGlE,IAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,YAAA,EAAE,EAAE,IAAI,CAAC,CAAC;YAExD,IAAI,CAAC,aAAa,CAAC;gBACjB,EAAE,IAAA;gBACF,QAAQ,EAAE,wBAAgB,CAAC,WAAW,EAAE,UAAU,CAAC;gBACnD,IAAI,EAAE,WAAW;aAClB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,qBAAa,CAAC,IAAI,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;SACvD;IACH,CAAC;IACH,kBAAC;AAAD,CAAC,AA7ID,IA6IC;AA7IqB,kCAAW"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.d.ts b/node_modules/apollo-cache/lib/index.d.ts deleted file mode 100644 index 492af37..0000000 --- a/node_modules/apollo-cache/lib/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './cache'; -export * from './types'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.d.ts.map b/node_modules/apollo-cache/lib/index.d.ts.map deleted file mode 100644 index bc24545..0000000 --- a/node_modules/apollo-cache/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.js b/node_modules/apollo-cache/lib/index.js deleted file mode 100644 index decd22a..0000000 --- a/node_modules/apollo-cache/lib/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./cache"), exports); -tslib_1.__exportStar(require("./types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/index.js.map b/node_modules/apollo-cache/lib/index.js.map deleted file mode 100644 index a385466..0000000 --- a/node_modules/apollo-cache/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,kDAAwB"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.d.ts b/node_modules/apollo-cache/lib/types/Cache.d.ts deleted file mode 100644 index f73aeb1..0000000 --- a/node_modules/apollo-cache/lib/types/Cache.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { DataProxy } from './DataProxy'; -export declare namespace Cache { - type WatchCallback = (newData: any) => void; - interface EvictionResult { - success: Boolean; - } - interface ReadOptions extends DataProxy.Query { - rootId?: string; - previousResult?: any; - optimistic: boolean; - } - interface WriteOptions extends DataProxy.Query { - dataId: string; - result: TResult; - } - interface DiffOptions extends ReadOptions { - returnPartialData?: boolean; - } - interface WatchOptions extends ReadOptions { - callback: WatchCallback; - } - interface EvictOptions extends DataProxy.Query { - rootId?: string; - } - export import DiffResult = DataProxy.DiffResult; - export import WriteQueryOptions = DataProxy.WriteQueryOptions; - export import WriteFragmentOptions = DataProxy.WriteFragmentOptions; - export import WriteDataOptions = DataProxy.WriteDataOptions; - export import Fragment = DataProxy.Fragment; -} -//# sourceMappingURL=Cache.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.d.ts.map b/node_modules/apollo-cache/lib/types/Cache.d.ts.map deleted file mode 100644 index aa4f617..0000000 --- a/node_modules/apollo-cache/lib/types/Cache.d.ts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AS,CAAC,QAAQ,CAAC;CAC7C"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.js b/node_modules/apollo-cache/lib/types/Cache.js deleted file mode 100644 index a2cebe5..0000000 --- a/node_modules/apollo-cache/lib/types/Cache.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var Cache; -(function (Cache) { -})(Cache = exports.Cache || (exports.Cache = {})); -//# sourceMappingURL=Cache.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/Cache.js.map b/node_modules/apollo-cache/lib/types/Cache.js.map deleted file mode 100644 index f92c62a..0000000 --- a/node_modules/apollo-cache/lib/types/Cache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Cache.js","sourceRoot":"","sources":["../../src/types/Cache.ts"],"names":[],"mappings":";;AAEA,IAAiB,KAAK,CAqCrB;AArCD,WAAiB,KAAK;AAqCtB,CAAC,EArCgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAqCrB"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.d.ts b/node_modules/apollo-cache/lib/types/DataProxy.d.ts deleted file mode 100644 index 992df92..0000000 --- a/node_modules/apollo-cache/lib/types/DataProxy.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { DocumentNode } from 'graphql'; -export declare namespace DataProxy { - interface Query { - query: DocumentNode; - variables?: TVariables; - } - interface Fragment { - id: string; - fragment: DocumentNode; - fragmentName?: string; - variables?: TVariables; - } - interface WriteQueryOptions extends Query { - data: TData; - } - interface WriteFragmentOptions extends Fragment { - data: TData; - } - interface WriteDataOptions { - data: TData; - id?: string; - } - type DiffResult = { - result?: T; - complete?: boolean; - }; -} -export interface DataProxy { - readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; - readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; - writeQuery(options: DataProxy.WriteQueryOptions): void; - writeFragment(options: DataProxy.WriteFragmentOptions): void; - writeData(options: DataProxy.WriteDataOptions): void; -} -//# sourceMappingURL=DataProxy.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map b/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map deleted file mode 100644 index 81d0ffc..0000000 --- a/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataProxy.d.ts","sourceRoot":"","sources":["../src/types/DataProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,yBAAiB,SAAS,CAAC;IACzB,UAAiB,KAAK,CAAC,UAAU;QAM/B,KAAK,EAAE,YAAY,CAAC;QAKpB,SAAS,CAAC,EAAE,UAAU,CAAC;KACxB;IAED,UAAiB,QAAQ,CAAC,UAAU;QAMlC,EAAE,EAAE,MAAM,CAAC;QAQX,QAAQ,EAAE,YAAY,CAAC;QAOvB,YAAY,CAAC,EAAE,MAAM,CAAC;QAKtB,SAAS,CAAC,EAAE,UAAU,CAAC;KACxB;IAED,UAAiB,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAClD,SAAQ,KAAK,CAAC,UAAU,CAAC;QAIzB,IAAI,EAAE,KAAK,CAAC;KACb;IAED,UAAiB,oBAAoB,CAAC,KAAK,EAAE,UAAU,CACrD,SAAQ,QAAQ,CAAC,UAAU,CAAC;QAI5B,IAAI,EAAE,KAAK,CAAC;KACb;IAED,UAAiB,gBAAgB,CAAC,KAAK;QAMrC,IAAI,EAAE,KAAK,CAAC;QACZ,EAAE,CAAC,EAAE,MAAM,CAAC;KACb;IAED,KAAY,UAAU,CAAC,CAAC,IAAI;QAC1B,MAAM,CAAC,EAAE,CAAC,CAAC;QACX,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH;AAQD,MAAM,WAAW,SAAS;IAIxB,SAAS,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,EACnC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,EACpC,UAAU,CAAC,EAAE,OAAO,GACnB,SAAS,GAAG,IAAI,CAAC;IAOpB,YAAY,CAAC,YAAY,EAAE,UAAU,GAAG,GAAG,EACzC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EACvC,UAAU,CAAC,EAAE,OAAO,GACnB,YAAY,GAAG,IAAI,CAAC;IAKvB,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EACtC,OAAO,EAAE,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,GACtD,IAAI,CAAC;IAOR,aAAa,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EACzC,OAAO,EAAE,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,GACzD,IAAI,CAAC;IAQR,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;CAC1E"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.js b/node_modules/apollo-cache/lib/types/DataProxy.js deleted file mode 100644 index e64cb3d..0000000 --- a/node_modules/apollo-cache/lib/types/DataProxy.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=DataProxy.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/DataProxy.js.map b/node_modules/apollo-cache/lib/types/DataProxy.js.map deleted file mode 100644 index 6975675..0000000 --- a/node_modules/apollo-cache/lib/types/DataProxy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataProxy.js","sourceRoot":"","sources":["../../src/types/DataProxy.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.d.ts b/node_modules/apollo-cache/lib/types/index.d.ts deleted file mode 100644 index ed0f027..0000000 --- a/node_modules/apollo-cache/lib/types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './DataProxy'; -export * from './Cache'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.d.ts.map b/node_modules/apollo-cache/lib/types/index.d.ts.map deleted file mode 100644 index 856e64b..0000000 --- a/node_modules/apollo-cache/lib/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.js b/node_modules/apollo-cache/lib/types/index.js deleted file mode 100644 index 83309fe..0000000 --- a/node_modules/apollo-cache/lib/types/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./Cache"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/types/index.js.map b/node_modules/apollo-cache/lib/types/index.js.map deleted file mode 100644 index 3b77f7b..0000000 --- a/node_modules/apollo-cache/lib/types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AACA,kDAAwB"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.d.ts b/node_modules/apollo-cache/lib/utils.d.ts deleted file mode 100644 index f107b48..0000000 --- a/node_modules/apollo-cache/lib/utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { DocumentNode } from 'graphql'; -export declare function queryFromPojo(obj: any): DocumentNode; -export declare function fragmentFromPojo(obj: any, typename?: string): DocumentNode; -export declare const justTypenameQuery: DocumentNode; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.d.ts.map b/node_modules/apollo-cache/lib/utils.d.ts.map deleted file mode 100644 index f673d7a..0000000 --- a/node_modules/apollo-cache/lib/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAKb,MAAM,SAAS,CAAC;AAEjB,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,CAiBpD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,CAuB1E;AA6CD,eAAO,MAAM,iBAAiB,EAAE,YA2B/B,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.js b/node_modules/apollo-cache/lib/utils.js deleted file mode 100644 index 289e518..0000000 --- a/node_modules/apollo-cache/lib/utils.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function queryFromPojo(obj) { - var op = { - kind: 'OperationDefinition', - operation: 'query', - name: { - kind: 'Name', - value: 'GeneratedClientQuery', - }, - selectionSet: selectionSetFromObj(obj), - }; - var out = { - kind: 'Document', - definitions: [op], - }; - return out; -} -exports.queryFromPojo = queryFromPojo; -function fragmentFromPojo(obj, typename) { - var frag = { - kind: 'FragmentDefinition', - typeCondition: { - kind: 'NamedType', - name: { - kind: 'Name', - value: typename || '__FakeType', - }, - }, - name: { - kind: 'Name', - value: 'GeneratedClientQuery', - }, - selectionSet: selectionSetFromObj(obj), - }; - var out = { - kind: 'Document', - definitions: [frag], - }; - return out; -} -exports.fragmentFromPojo = fragmentFromPojo; -function selectionSetFromObj(obj) { - if (typeof obj === 'number' || - typeof obj === 'boolean' || - typeof obj === 'string' || - typeof obj === 'undefined' || - obj === null) { - return null; - } - if (Array.isArray(obj)) { - return selectionSetFromObj(obj[0]); - } - var selections = []; - Object.keys(obj).forEach(function (key) { - var nestedSelSet = selectionSetFromObj(obj[key]); - var field = { - kind: 'Field', - name: { - kind: 'Name', - value: key, - }, - selectionSet: nestedSelSet || undefined, - }; - selections.push(field); - }); - var selectionSet = { - kind: 'SelectionSet', - selections: selections, - }; - return selectionSet; -} -exports.justTypenameQuery = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: null, - variableDefinitions: null, - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: '__typename', - }, - arguments: [], - directives: [], - selectionSet: null, - }, - ], - }, - }, - ], -}; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/apollo-cache/lib/utils.js.map b/node_modules/apollo-cache/lib/utils.js.map deleted file mode 100644 index 465f502..0000000 --- a/node_modules/apollo-cache/lib/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAQA,SAAgB,aAAa,CAAC,GAAQ;IACpC,IAAM,EAAE,GAA4B;QAClC,IAAI,EAAE,qBAAqB;QAC3B,SAAS,EAAE,OAAO;QAClB,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,sBAAsB;SAC9B;QACD,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC;KACvC,CAAC;IAEF,IAAM,GAAG,GAAiB;QACxB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,CAAC,EAAE,CAAC;KAClB,CAAC;IAEF,OAAO,GAAG,CAAC;AACb,CAAC;AAjBD,sCAiBC;AAED,SAAgB,gBAAgB,CAAC,GAAQ,EAAE,QAAiB;IAC1D,IAAM,IAAI,GAA2B;QACnC,IAAI,EAAE,oBAAoB;QAC1B,aAAa,EAAE;YACb,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,QAAQ,I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AAU;IAChB,WAAW,EAAE;QACX;YACE,IAAI,EAAE,qBAAqB;YAC3B,SAAS,EAAE,OAAO;YAClB,IAAI,EAAE,IAAI;YACV,mBAAmB,EAAE,IAAI;YACzB,UAAU,EAAE,EAAE;YACd,YAAY,EAAE;gBACZ,IAAI,EAAE,cAAc;gBACpB,UAAU,EAAE;oBACV;wBACE,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,IAAI;wBACX,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,YAAY;yBACpB;wBACD,SAAS,EAAE,EAAE;wBACb,UAAU,EAAE,EAAE;wBACd,YAAY,EAAE,IAAI;qBACnB;iBACF;aACF;SACF;KACF;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-cache/package.json b/node_modules/apollo-cache/package.json deleted file mode 100644 index 9518a0f..0000000 --- a/node_modules/apollo-cache/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "apollo-cache", - "version": "1.3.5", - "description": "Core abstract of Caching layer for Apollo Client", - "author": "James Baxley ", - "contributors": [ - "James Baxley ", - "Jonas Helfer ", - "Sashko Stubailo ", - "James Burgess " - ], - "license": "MIT", - "main": "./lib/bundle.cjs.js", - "module": "./lib/bundle.esm.js", - "typings": "./lib/index.d.ts", - "sideEffects": false, - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/apollo-client.git" - }, - "bugs": { - "url": "https://github.com/apollographql/apollo-client/issues" - }, - "homepage": "https://github.com/apollographql/apollo-client#readme", - "scripts": { - "prepare": "npm run lint && npm run build", - "coverage": "jest --coverage", - "test": "tsc -p tsconfig.json --noEmit && jest", - "lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts && tslint -c \"../../config/tslint.json\" -p tsconfig.json tests/*.ts", - "prebuild": "npm run clean", - "build": "tsc -b .", - "postbuild": "npm run bundle", - "bundle": "npx rollup -c rollup.config.js", - "watch": "../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"", - "clean": "rm -rf coverage/* lib/*", - "prepublishOnly": "npm run clean && npm run build" - }, - "dependencies": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "gitHead": "d22394c419ff7d678afb5e7d4cd1df16ed803ead" -} diff --git a/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap b/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap deleted file mode 100644 index 2a167ec..0000000 --- a/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap +++ /dev/null @@ -1,63 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[ - `writing data with no query converts a JavaScript object to a query correctly arrays 1` -] = ` -"query GeneratedClientQuery { - number - bool - nested { - bool2 - undef - nullField - str - } -} -" -`; - -exports[ - `writing data with no query converts a JavaScript object to a query correctly basic 1` -] = ` -"query GeneratedClientQuery { - number - bool - bool2 - undef - nullField - str -} -" -`; - -exports[ - `writing data with no query converts a JavaScript object to a query correctly fragments 1` -] = ` -"fragment GeneratedClientQuery on __FakeType { - number - bool - nested { - bool2 - undef - nullField - str - } -} -" -`; - -exports[ - `writing data with no query converts a JavaScript object to a query correctly nested 1` -] = ` -"query GeneratedClientQuery { - number - bool - nested { - bool2 - undef - nullField - str - } -} -" -`; diff --git a/node_modules/apollo-cache/src/__tests__/cache.ts b/node_modules/apollo-cache/src/__tests__/cache.ts deleted file mode 100644 index 6f10d7c..0000000 --- a/node_modules/apollo-cache/src/__tests__/cache.ts +++ /dev/null @@ -1,149 +0,0 @@ -import gql from 'graphql-tag'; - -import { ApolloCache as Cache } from '../cache'; - -class TestCache extends Cache {} - -describe('abstract cache', () => { - describe('transformDocument', () => { - it('returns the document', () => { - const test = new TestCache(); - expect(test.transformDocument('a')).toBe('a'); - }); - }); - - describe('transformForLink', () => { - it('returns the document', () => { - const test = new TestCache(); - expect(test.transformForLink('a')).toBe('a'); - }); - }); - - describe('readQuery', () => { - it('runs the read method', () => { - const test = new TestCache(); - test.read = jest.fn(); - - test.readQuery({}); - expect(test.read).toBeCalled(); - }); - - it('defaults optimistic to false', () => { - const test = new TestCache(); - test.read = ({ optimistic }) => optimistic; - - expect(test.readQuery({})).toBe(false); - expect(test.readQuery({}, true)).toBe(true); - }); - }); - - describe('readFragment', () => { - it('runs the read method', () => { - const test = new TestCache(); - test.read = jest.fn(); - const fragment = { - id: 'frag', - fragment: gql` - fragment a on b { - name - } - `, - }; - - test.readFragment(fragment); - expect(test.read).toBeCalled(); - }); - - it('defaults optimistic to false', () => { - const test = new TestCache(); - test.read = ({ optimistic }) => optimistic; - const fragment = { - id: 'frag', - fragment: gql` - fragment a on b { - name - } - `, - }; - - expect(test.readFragment(fragment)).toBe(false); - expect(test.readFragment(fragment, true)).toBe(true); - }); - }); - - describe('writeQuery', () => { - it('runs the write method', () => { - const test = new TestCache(); - test.write = jest.fn(); - - test.writeQuery({}); - expect(test.write).toBeCalled(); - }); - }); - - describe('writeFragment', () => { - it('runs the write method', () => { - const test = new TestCache(); - test.write = jest.fn(); - const fragment = { - id: 'frag', - fragment: gql` - fragment a on b { - name - } - `, - }; - - test.writeFragment(fragment); - expect(test.write).toBeCalled(); - }); - }); - - describe('writeData', () => { - it('either writes a fragment or a query', () => { - const test = new TestCache(); - test.read = jest.fn(); - test.writeFragment = jest.fn(); - test.writeQuery = jest.fn(); - - test.writeData({}); - expect(test.writeQuery).toBeCalled(); - - test.writeData({ id: 1 }); - expect(test.read).toBeCalled(); - expect(test.writeFragment).toBeCalled(); - - // Edge case for falsey id - test.writeData({ id: 0 }); - expect(test.read).toHaveBeenCalledTimes(2); - expect(test.writeFragment).toHaveBeenCalledTimes(2); - }); - - it('suppresses read errors', () => { - const test = new TestCache(); - test.read = () => { - throw new Error(); - }; - test.writeFragment = jest.fn(); - - expect(() => test.writeData({ id: 1 })).not.toThrow(); - expect(test.writeFragment).toBeCalled(); - }); - - it('reads __typename from typenameResult or defaults to __ClientData', () => { - const test = new TestCache(); - test.read = () => ({ __typename: 'a' }); - let res; - test.writeFragment = obj => - (res = obj.fragment.definitions[0].typeCondition.name.value); - - test.writeData({ id: 1 }); - expect(res).toBe('a'); - - test.read = () => ({}); - - test.writeData({ id: 1 }); - expect(res).toBe('__ClientData'); - }); - }); -}); diff --git a/node_modules/apollo-cache/src/__tests__/utils.ts b/node_modules/apollo-cache/src/__tests__/utils.ts deleted file mode 100644 index 953e0e1..0000000 --- a/node_modules/apollo-cache/src/__tests__/utils.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { print } from 'graphql/language/printer'; -import { queryFromPojo, fragmentFromPojo } from '../utils'; - -describe('writing data with no query', () => { - describe('converts a JavaScript object to a query correctly', () => { - it('basic', () => { - expect( - print( - queryFromPojo({ - number: 5, - bool: true, - bool2: false, - undef: undefined, - nullField: null, - str: 'string', - }), - ), - ).toMatchSnapshot(); - }); - - it('nested', () => { - expect( - print( - queryFromPojo({ - number: 5, - bool: true, - nested: { - bool2: false, - undef: undefined, - nullField: null, - str: 'string', - }, - }), - ), - ).toMatchSnapshot(); - }); - - it('arrays', () => { - expect( - print( - queryFromPojo({ - number: [5], - bool: [[true]], - nested: [ - { - bool2: false, - undef: undefined, - nullField: null, - str: 'string', - }, - ], - }), - ), - ).toMatchSnapshot(); - }); - - it('fragments', () => { - expect( - print( - fragmentFromPojo({ - number: [5], - bool: [[true]], - nested: [ - { - bool2: false, - undef: undefined, - nullField: null, - str: 'string', - }, - ], - }), - ), - ).toMatchSnapshot(); - }); - }); -}); diff --git a/node_modules/apollo-cache/src/cache.ts b/node_modules/apollo-cache/src/cache.ts deleted file mode 100644 index ab45b1a..0000000 --- a/node_modules/apollo-cache/src/cache.ts +++ /dev/null @@ -1,150 +0,0 @@ -import { DocumentNode } from 'graphql'; -import { getFragmentQueryDocument } from 'apollo-utilities'; - -import { DataProxy, Cache } from './types'; -import { justTypenameQuery, queryFromPojo, fragmentFromPojo } from './utils'; - -export type Transaction = (c: ApolloCache) => void; - -export abstract class ApolloCache implements DataProxy { - // required to implement - // core API - public abstract read( - query: Cache.ReadOptions, - ): T | null; - public abstract write( - write: Cache.WriteOptions, - ): void; - public abstract diff(query: Cache.DiffOptions): Cache.DiffResult; - public abstract watch(watch: Cache.WatchOptions): () => void; - public abstract evict( - query: Cache.EvictOptions, - ): Cache.EvictionResult; - public abstract reset(): Promise; - - // intializer / offline / ssr API - /** - * Replaces existing state in the cache (if any) with the values expressed by - * `serializedState`. - * - * Called when hydrating a cache (server side rendering, or offline storage), - * and also (potentially) during hot reloads. - */ - public abstract restore( - serializedState: TSerialized, - ): ApolloCache; - - /** - * Exposes the cache's complete state, in a serializable format for later restoration. - */ - public abstract extract(optimistic?: boolean): TSerialized; - - // optimistic API - public abstract removeOptimistic(id: string): void; - - // transactional API - public abstract performTransaction( - transaction: Transaction, - ): void; - public abstract recordOptimisticTransaction( - transaction: Transaction, - id: string, - ): void; - - // optional API - public transformDocument(document: DocumentNode): DocumentNode { - return document; - } - // experimental - public transformForLink(document: DocumentNode): DocumentNode { - return document; - } - - // DataProxy API - /** - * - * @param options - * @param optimistic - */ - public readQuery( - options: DataProxy.Query, - optimistic: boolean = false, - ): QueryType | null { - return this.read({ - query: options.query, - variables: options.variables, - optimistic, - }); - } - - public readFragment( - options: DataProxy.Fragment, - optimistic: boolean = false, - ): FragmentType | null { - return this.read({ - query: getFragmentQueryDocument(options.fragment, options.fragmentName), - variables: options.variables, - rootId: options.id, - optimistic, - }); - } - - public writeQuery( - options: Cache.WriteQueryOptions, - ): void { - this.write({ - dataId: 'ROOT_QUERY', - result: options.data, - query: options.query, - variables: options.variables, - }); - } - - public writeFragment( - options: Cache.WriteFragmentOptions, - ): void { - this.write({ - dataId: options.id, - result: options.data, - variables: options.variables, - query: getFragmentQueryDocument(options.fragment, options.fragmentName), - }); - } - - public writeData({ - id, - data, - }: Cache.WriteDataOptions): void { - if (typeof id !== 'undefined') { - let typenameResult = null; - // Since we can't use fragments without having a typename in the store, - // we need to make sure we have one. - // To avoid overwriting an existing typename, we need to read it out first - // and generate a fake one if none exists. - try { - typenameResult = this.read({ - rootId: id, - optimistic: false, - query: justTypenameQuery, - }); - } catch (e) { - // Do nothing, since an error just means no typename exists - } - - // tslint:disable-next-line - const __typename = - (typenameResult && typenameResult.__typename) || '__ClientData'; - - // Add a type here to satisfy the inmemory cache - const dataToWrite = Object.assign({ __typename }, data); - - this.writeFragment({ - id, - fragment: fragmentFromPojo(dataToWrite, __typename), - data: dataToWrite, - }); - } else { - this.writeQuery({ query: queryFromPojo(data), data }); - } - } -} diff --git a/node_modules/apollo-cache/src/index.ts b/node_modules/apollo-cache/src/index.ts deleted file mode 100644 index 18273b7..0000000 --- a/node_modules/apollo-cache/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './cache'; -export * from './types'; diff --git a/node_modules/apollo-cache/src/types/Cache.ts b/node_modules/apollo-cache/src/types/Cache.ts deleted file mode 100644 index da6ef0b..0000000 --- a/node_modules/apollo-cache/src/types/Cache.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { DataProxy } from './DataProxy'; - -export namespace Cache { - export type WatchCallback = (newData: any) => void; - export interface EvictionResult { - success: Boolean; - } - - export interface ReadOptions - extends DataProxy.Query { - rootId?: string; - previousResult?: any; - optimistic: boolean; - } - - export interface WriteOptions - extends DataProxy.Query { - dataId: string; - result: TResult; - } - - export interface DiffOptions extends ReadOptions { - returnPartialData?: boolean; - } - - export interface WatchOptions extends ReadOptions { - callback: WatchCallback; - } - - export interface EvictOptions - extends DataProxy.Query { - rootId?: string; - } - - export import DiffResult = DataProxy.DiffResult; - export import WriteQueryOptions = DataProxy.WriteQueryOptions; - export import WriteFragmentOptions = DataProxy.WriteFragmentOptions; - export import WriteDataOptions = DataProxy.WriteDataOptions; - export import Fragment = DataProxy.Fragment; -} diff --git a/node_modules/apollo-cache/src/types/DataProxy.ts b/node_modules/apollo-cache/src/types/DataProxy.ts deleted file mode 100644 index 8b85709..0000000 --- a/node_modules/apollo-cache/src/types/DataProxy.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { DocumentNode } from 'graphql'; // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved - -export namespace DataProxy { - export interface Query { - /** - * The GraphQL query shape to be used constructed using the `gql` template - * string tag from `graphql-tag`. The query will be used to determine the - * shape of the data to be read. - */ - query: DocumentNode; - - /** - * Any variables that the GraphQL query may depend on. - */ - variables?: TVariables; - } - - export interface Fragment { - /** - * The root id to be used. This id should take the same form as the - * value returned by your `dataIdFromObject` function. If a value with your - * id does not exist in the store, `null` will be returned. - */ - id: string; - - /** - * A GraphQL document created using the `gql` template string tag from - * `graphql-tag` with one or more fragments which will be used to determine - * the shape of data to read. If you provide more than one fragment in this - * document then you must also specify `fragmentName` to select a single. - */ - fragment: DocumentNode; - - /** - * The name of the fragment in your GraphQL document to be used. If you do - * not provide a `fragmentName` and there is only one fragment in your - * `fragment` document then that fragment will be used. - */ - fragmentName?: string; - - /** - * Any variables that your GraphQL fragments depend on. - */ - variables?: TVariables; - } - - export interface WriteQueryOptions - extends Query { - /** - * The data you will be writing to the store. - */ - data: TData; - } - - export interface WriteFragmentOptions - extends Fragment { - /** - * The data you will be writing to the store. - */ - data: TData; - } - - export interface WriteDataOptions { - /** - * The data you will be writing to the store. - * It also takes an optional id property. - * The id is used to write a fragment to an existing object in the store. - */ - data: TData; - id?: string; - } - - export type DiffResult = { - result?: T; - complete?: boolean; - }; -} - -/** - * A proxy to the normalized data living in our store. This interface allows a - * user to read and write denormalized data which feels natural to the user - * whilst in the background this data is being converted into the normalized - * store format. - */ -export interface DataProxy { - /** - * Reads a GraphQL query from the root query id. - */ - readQuery( - options: DataProxy.Query, - optimistic?: boolean, - ): QueryType | null; - - /** - * Reads a GraphQL fragment from any arbitrary id. If there is more than - * one fragment in the provided document then a `fragmentName` must be - * provided to select the correct fragment. - */ - readFragment( - options: DataProxy.Fragment, - optimistic?: boolean, - ): FragmentType | null; - - /** - * Writes a GraphQL query to the root query id. - */ - writeQuery( - options: DataProxy.WriteQueryOptions, - ): void; - - /** - * Writes a GraphQL fragment to any arbitrary id. If there is more than - * one fragment in the provided document then a `fragmentName` must be - * provided to select the correct fragment. - */ - writeFragment( - options: DataProxy.WriteFragmentOptions, - ): void; - - /** - * Sugar for writeQuery & writeFragment. - * Writes data to the store without passing in a query. - * If you supply an id, the data will be written as a fragment to an existing object. - * Otherwise, the data is written to the root of the store. - */ - writeData(options: DataProxy.WriteDataOptions): void; -} diff --git a/node_modules/apollo-cache/src/types/index.ts b/node_modules/apollo-cache/src/types/index.ts deleted file mode 100644 index c44054d..0000000 --- a/node_modules/apollo-cache/src/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './DataProxy'; -export * from './Cache'; diff --git a/node_modules/apollo-cache/src/utils.ts b/node_modules/apollo-cache/src/utils.ts deleted file mode 100644 index 7d88d0b..0000000 --- a/node_modules/apollo-cache/src/utils.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, - FieldNode, - FragmentDefinitionNode, -} from 'graphql'; - -export function queryFromPojo(obj: any): DocumentNode { - const op: OperationDefinitionNode = { - kind: 'OperationDefinition', - operation: 'query', - name: { - kind: 'Name', - value: 'GeneratedClientQuery', - }, - selectionSet: selectionSetFromObj(obj), - }; - - const out: DocumentNode = { - kind: 'Document', - definitions: [op], - }; - - return out; -} - -export function fragmentFromPojo(obj: any, typename?: string): DocumentNode { - const frag: FragmentDefinitionNode = { - kind: 'FragmentDefinition', - typeCondition: { - kind: 'NamedType', - name: { - kind: 'Name', - value: typename || '__FakeType', - }, - }, - name: { - kind: 'Name', - value: 'GeneratedClientQuery', - }, - selectionSet: selectionSetFromObj(obj), - }; - - const out: DocumentNode = { - kind: 'Document', - definitions: [frag], - }; - - return out; -} - -function selectionSetFromObj(obj: any): SelectionSetNode { - if ( - typeof obj === 'number' || - typeof obj === 'boolean' || - typeof obj === 'string' || - typeof obj === 'undefined' || - obj === null - ) { - // No selection set here - return null; - } - - if (Array.isArray(obj)) { - // GraphQL queries don't include arrays - return selectionSetFromObj(obj[0]); - } - - // Now we know it's an object - const selections: FieldNode[] = []; - - Object.keys(obj).forEach(key => { - const nestedSelSet: SelectionSetNode = selectionSetFromObj(obj[key]); - - const field: FieldNode = { - kind: 'Field', - name: { - kind: 'Name', - value: key, - }, - selectionSet: nestedSelSet || undefined, - }; - - selections.push(field); - }); - - const selectionSet: SelectionSetNode = { - kind: 'SelectionSet', - selections, - }; - - return selectionSet; -} - -export const justTypenameQuery: DocumentNode = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: null, - variableDefinitions: null, - directives: [], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: null, - name: { - kind: 'Name', - value: '__typename', - }, - arguments: [], - directives: [], - selectionSet: null, - }, - ], - }, - }, - ], -}; diff --git a/node_modules/apollo-client/ApolloClient.d.ts b/node_modules/apollo-client/ApolloClient.d.ts deleted file mode 100644 index 33fc2ee..0000000 --- a/node_modules/apollo-client/ApolloClient.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { ApolloLink, FetchResult, GraphQLRequest } from 'apollo-link'; -import { ExecutionResult, DocumentNode } from 'graphql'; -import { ApolloCache, DataProxy } from 'apollo-cache'; -import { QueryManager } from './core/QueryManager'; -import { ApolloQueryResult, OperationVariables, Resolvers } from './core/types'; -import { ObservableQuery } from './core/ObservableQuery'; -import { FragmentMatcher } from './core/LocalState'; -import { Observable } from './util/Observable'; -import { QueryOptions, WatchQueryOptions, SubscriptionOptions, MutationOptions } from './core/watchQueryOptions'; -import { DataStore } from './data/store'; -export interface DefaultOptions { - watchQuery?: Partial; - query?: Partial; - mutate?: Partial; -} -export declare type ApolloClientOptions = { - link?: ApolloLink; - cache: ApolloCache; - ssrForceFetchDelay?: number; - ssrMode?: boolean; - connectToDevTools?: boolean; - queryDeduplication?: boolean; - defaultOptions?: DefaultOptions; - assumeImmutableResults?: boolean; - resolvers?: Resolvers | Resolvers[]; - typeDefs?: string | string[] | DocumentNode | DocumentNode[]; - fragmentMatcher?: FragmentMatcher; - name?: string; - version?: string; -}; -export default class ApolloClient implements DataProxy { - link: ApolloLink; - store: DataStore; - cache: ApolloCache; - readonly queryManager: QueryManager; - disableNetworkFetches: boolean; - version: string; - queryDeduplication: boolean; - defaultOptions: DefaultOptions; - readonly typeDefs: ApolloClientOptions['typeDefs']; - private devToolsHookCb; - private resetStoreCallbacks; - private clearStoreCallbacks; - private localState; - constructor(options: ApolloClientOptions); - stop(): void; - watchQuery(options: WatchQueryOptions): ObservableQuery; - query(options: QueryOptions): Promise>; - mutate(options: MutationOptions): Promise>; - subscribe(options: SubscriptionOptions): Observable>; - readQuery(options: DataProxy.Query, optimistic?: boolean): T | null; - readFragment(options: DataProxy.Fragment, optimistic?: boolean): T | null; - writeQuery(options: DataProxy.WriteQueryOptions): void; - writeFragment(options: DataProxy.WriteFragmentOptions): void; - writeData(options: DataProxy.WriteDataOptions): void; - __actionHookForDevTools(cb: () => any): void; - __requestRaw(payload: GraphQLRequest): Observable; - initQueryManager(): QueryManager; - resetStore(): Promise[] | null>; - clearStore(): Promise; - onResetStore(cb: () => Promise): () => void; - onClearStore(cb: () => Promise): () => void; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; - extract(optimistic?: boolean): TCacheShape; - restore(serializedState: TCacheShape): ApolloCache; - addResolvers(resolvers: Resolvers | Resolvers[]): void; - setResolvers(resolvers: Resolvers | Resolvers[]): void; - getResolvers(): Resolvers; - setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher): void; -} -//# sourceMappingURL=ApolloClient.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/ApolloClient.d.ts.map b/node_modules/apollo-client/ApolloClient.d.ts.map deleted file mode 100644 index 37f5b9e..0000000 --- a/node_modules/apollo-client/ApolloClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3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,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;IAWtD,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAW5B,YAAY,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI;IAYhD,YAAY,CAAC,EAAE,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI;IAmBhD,wBAAwB,CAC7B,cAAc,CAAC,EAAE,OAAO,GACvB,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAO7B,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,WAAW;IAW1C,OAAO,CAAC,eAAe,EAAE,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAO/D,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE;IAO/C,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE;IAO/C,YAAY;IAOZ,4BAA4B,CAAC,eAAe,EAAE,eAAe;CAGrE"} \ No newline at end of file diff --git a/node_modules/apollo-client/ApolloClient.js b/node_modules/apollo-client/ApolloClient.js deleted file mode 100644 index eb86d49..0000000 --- a/node_modules/apollo-client/ApolloClient.js +++ /dev/null @@ -1,219 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_link_1 = require("apollo-link"); -var ts_invariant_1 = require("ts-invariant"); -var QueryManager_1 = require("./core/QueryManager"); -var LocalState_1 = require("./core/LocalState"); -var store_1 = require("./data/store"); -var version_1 = require("./version"); -var hasSuggestedDevtools = false; -var ApolloClient = (function () { - function ApolloClient(options) { - var _this = this; - this.defaultOptions = {}; - this.resetStoreCallbacks = []; - this.clearStoreCallbacks = []; - var cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, connectToDevTools = options.connectToDevTools, _c = options.queryDeduplication, queryDeduplication = _c === void 0 ? true : _c, defaultOptions = options.defaultOptions, _d = options.assumeImmutableResults, assumeImmutableResults = _d === void 0 ? false : _d, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version; - var link = options.link; - if (!link && resolvers) { - link = apollo_link_1.ApolloLink.empty(); - } - if (!link || !cache) { - throw new ts_invariant_1.InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + - "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + - "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); - } - this.link = link; - this.cache = cache; - this.store = new store_1.DataStore(cache); - this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; - this.queryDeduplication = queryDeduplication; - this.defaultOptions = defaultOptions || {}; - this.typeDefs = typeDefs; - if (ssrForceFetchDelay) { - setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay); - } - this.watchQuery = this.watchQuery.bind(this); - this.query = this.query.bind(this); - this.mutate = this.mutate.bind(this); - this.resetStore = this.resetStore.bind(this); - this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); - var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && - typeof window !== 'undefined' && - !window.__APOLLO_CLIENT__; - if (typeof connectToDevTools === 'undefined' - ? defaultConnectToDevTools - : connectToDevTools && typeof window !== 'undefined') { - window.__APOLLO_CLIENT__ = this; - } - if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { - hasSuggestedDevtools = true; - if (typeof window !== 'undefined' && - window.document && - window.top === window.self) { - if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { - if (window.navigator && - window.navigator.userAgent && - window.navigator.userAgent.indexOf('Chrome') > -1) { - console.debug('Download the Apollo DevTools ' + - 'for a better development experience: ' + - 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); - } - } - } - } - this.version = version_1.version; - this.localState = new LocalState_1.LocalState({ - cache: cache, - client: this, - resolvers: resolvers, - fragmentMatcher: fragmentMatcher, - }); - this.queryManager = new QueryManager_1.QueryManager({ - link: this.link, - store: this.store, - queryDeduplication: queryDeduplication, - ssrMode: ssrMode, - clientAwareness: { - name: clientAwarenessName, - version: clientAwarenessVersion, - }, - localState: this.localState, - assumeImmutableResults: assumeImmutableResults, - onBroadcast: function () { - if (_this.devToolsHookCb) { - _this.devToolsHookCb({ - action: {}, - state: { - queries: _this.queryManager.queryStore.getStore(), - mutations: _this.queryManager.mutationStore.getStore(), - }, - dataWithOptimisticResults: _this.cache.extract(true), - }); - } - }, - }); - } - ApolloClient.prototype.stop = function () { - this.queryManager.stop(); - }; - ApolloClient.prototype.watchQuery = function (options) { - if (this.defaultOptions.watchQuery) { - options = tslib_1.__assign(tslib_1.__assign({}, this.defaultOptions.watchQuery), options); - } - if (this.disableNetworkFetches && - (options.fetchPolicy === 'network-only' || - options.fetchPolicy === 'cache-and-network')) { - options = tslib_1.__assign(tslib_1.__assign({}, options), { fetchPolicy: 'cache-first' }); - } - return this.queryManager.watchQuery(options); - }; - ApolloClient.prototype.query = function (options) { - if (this.defaultOptions.query) { - options = tslib_1.__assign(tslib_1.__assign({}, this.defaultOptions.query), options); - } - ts_invariant_1.invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + - 'client.query can only return a single result. Please use client.watchQuery ' + - 'to receive multiple results from the cache and the network, or consider ' + - 'using a different fetchPolicy, such as cache-first or network-only.'); - if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { - options = tslib_1.__assign(tslib_1.__assign({}, options), { fetchPolicy: 'cache-first' }); - } - return this.queryManager.query(options); - }; - ApolloClient.prototype.mutate = function (options) { - if (this.defaultOptions.mutate) { - options = tslib_1.__assign(tslib_1.__assign({}, this.defaultOptions.mutate), options); - } - return this.queryManager.mutate(options); - }; - ApolloClient.prototype.subscribe = function (options) { - return this.queryManager.startGraphQLSubscription(options); - }; - ApolloClient.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.cache.readQuery(options, optimistic); - }; - ApolloClient.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.cache.readFragment(options, optimistic); - }; - ApolloClient.prototype.writeQuery = function (options) { - var result = this.cache.writeQuery(options); - this.queryManager.broadcastQueries(); - return result; - }; - ApolloClient.prototype.writeFragment = function (options) { - var result = this.cache.writeFragment(options); - this.queryManager.broadcastQueries(); - return result; - }; - ApolloClient.prototype.writeData = function (options) { - var result = this.cache.writeData(options); - this.queryManager.broadcastQueries(); - return result; - }; - ApolloClient.prototype.__actionHookForDevTools = function (cb) { - this.devToolsHookCb = cb; - }; - ApolloClient.prototype.__requestRaw = function (payload) { - return apollo_link_1.execute(this.link, payload); - }; - ApolloClient.prototype.initQueryManager = function () { - ts_invariant_1.invariant.warn('Calling the initQueryManager method is no longer necessary, ' + - 'and it will be removed from ApolloClient in version 3.0.'); - return this.queryManager; - }; - ApolloClient.prototype.resetStore = function () { - var _this = this; - return Promise.resolve() - .then(function () { return _this.queryManager.clearStore(); }) - .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); }) - .then(function () { return _this.reFetchObservableQueries(); }); - }; - ApolloClient.prototype.clearStore = function () { - var _this = this; - return Promise.resolve() - .then(function () { return _this.queryManager.clearStore(); }) - .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); }); - }; - ApolloClient.prototype.onResetStore = function (cb) { - var _this = this; - this.resetStoreCallbacks.push(cb); - return function () { - _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; }); - }; - }; - ApolloClient.prototype.onClearStore = function (cb) { - var _this = this; - this.clearStoreCallbacks.push(cb); - return function () { - _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; }); - }; - }; - ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { - return this.queryManager.reFetchObservableQueries(includeStandby); - }; - ApolloClient.prototype.extract = function (optimistic) { - return this.cache.extract(optimistic); - }; - ApolloClient.prototype.restore = function (serializedState) { - return this.cache.restore(serializedState); - }; - ApolloClient.prototype.addResolvers = function (resolvers) { - this.localState.addResolvers(resolvers); - }; - ApolloClient.prototype.setResolvers = function (resolvers) { - this.localState.setResolvers(resolvers); - }; - ApolloClient.prototype.getResolvers = function () { - return this.localState.getResolvers(); - }; - ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { - this.localState.setFragmentMatcher(fragmentMatcher); - }; - return ApolloClient; -}()); -exports.default = ApolloClient; -//# sourceMappingURL=ApolloClient.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/ApolloClient.js.map b/node_modules/apollo-client/ApolloClient.js.map deleted file mode 100644 index 1963b99..0000000 --- a/node_modules/apollo-client/ApolloClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ApolloClient.js","sourceRoot":"","sources":["../src/ApolloClient.ts"],"names":[],"mappings":";;;AAAA,2CAKqB;AAIrB,6CAAyD;AAEzD,oDAAmD;AAOnD,gDAAgE;AAWhE,sCAAyC;AAEzC,qCAAoC;AAQpC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAwBjC;IAkDE,sBAAY,OAAyC;QAArD,iBAqIC;QA/KM,mBAAc,GAAmB,EAAE,CAAC;QAInC,wBAAmB,GAA8B,EAAE,CAAC;QACpD,wBAAmB,GAA8B,EAAE,CAAC;QAuCxD,IAAA,qBAAK,EACL,oBAAe,EAAf,oCAAe,EACf,+BAAsB,EAAtB,2CAAsB,EACtB,6CAAiB,EACjB,+BAAyB,EAAzB,8CAAyB,EACzB,uCAAc,EACd,mCAA8B,EAA9B,mDAA8B,EAC9B,6BAAS,EACT,2BAAQ,EACR,yCAAe,EACf,kCAAyB,EACzB,wCAA+B,CACrB;QAEN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U,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAKM,mCAAY,GAAnB,UAAoB,SAAkC;QACpD,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAKM,mCAAY,GAAnB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IAKM,mDAA4B,GAAnC,UAAoC,eAAgC;QAClE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACtD,CAAC;IACH,mBAAC;AAAD,CAAC,AA3gBD,IA2gBC"} \ No newline at end of file diff --git a/node_modules/apollo-client/LICENSE b/node_modules/apollo-client/LICENSE deleted file mode 100644 index 278ee9d..0000000 --- a/node_modules/apollo-client/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Meteor Development Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/apollo-client/README.md b/node_modules/apollo-client/README.md deleted file mode 100644 index e41dca6..0000000 --- a/node_modules/apollo-client/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# [Apollo Client](https://www.apollographql.com/client/) [![npm version](https://badge.fury.io/js/apollo-client.svg)](https://badge.fury.io/js/apollo-client) [![Open Source Helpers](https://www.codetriage.com/apollographql/apollo-client/badges/users.svg)](https://www.codetriage.com/apollographql/apollo-client) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/apollo) - -Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL. To get the most value out of `apollo-client`, you should use it with one of its view layer integrations. - -To get started with the React integration, go to our [**React Apollo documentation website**](https://www.apollographql.com/docs/react/). - -Apollo Client also has view layer integrations for [all the popular frontend frameworks](#learn-how-to-use-apollo-client-with-your-favorite-framework). For the best experience, make sure to use the view integration layer for your frontend framework of choice. - -Apollo Client can be used in any JavaScript frontend where you want to use data from a GraphQL server. It's: - -1. **Incrementally adoptable**, so that you can drop it into an existing JavaScript app and start using GraphQL for just part of your UI. -2. **Universally compatible**, so that Apollo works with any build setup, any GraphQL server, and any GraphQL schema. -3. **Simple to get started with**, so you can start loading data right away and learn about advanced features later. -4. **Inspectable and understandable**, so that you can have great developer tools to understand exactly what is happening in your app. -5. **Built for interactive apps**, so your users can make changes and see them reflected in the UI immediately. -6. **Small and flexible**, so you don't get stuff you don't need. The core is under 25kb compressed. -7. **Community driven**, because Apollo is driven by the community and serves a variety of use cases. Everything is planned and developed in the open. - -Get started on the [home page](http://apollographql.com/client), which has great examples for a variety of frameworks. - -## Installation - -```bash -# installing the preset package -npm install apollo-boost graphql-tag graphql --save -# installing each piece independently -npm install apollo-client apollo-cache-inmemory apollo-link-http graphql-tag graphql --save -``` - -To use this client in a web browser or mobile app, you'll need a build system capable of loading NPM packages on the client. Some common choices include Browserify, Webpack, and Meteor 1.3+. - -Install the [Apollo Client Developer tools for Chrome](https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm) for a great GraphQL developer experience! - -## Usage - -You get started by constructing an instance of the core class [`ApolloClient`][]. If you load `ApolloClient` from the [`apollo-boost`][] package, it will be configured with a few reasonable defaults such as our standard in-memory cache and a link to a GraphQL API at `/graphql`. - -```js -import ApolloClient from 'apollo-boost'; - -const client = new ApolloClient(); -``` - - -To point `ApolloClient` at a different URL, add your GraphQL API's URL to the `uri` config property: - -```js -import ApolloClient from 'apollo-boost'; - -const client = new ApolloClient({ - uri: 'https://graphql.example.com' -}); -``` - -Most of the time you'll hook up your client to a frontend integration. But if you'd like to directly execute a query with your client, you may now call the `client.query` method like this: - -```js -import gql from 'graphql-tag'; - -client.query({ - query: gql` - query TodoApp { - todos { - id - text - completed - } - } - `, -}) - .then(data => console.log(data)) - .catch(error => console.error(error)); -``` - -Now your client will be primed with some data in its cache. You can continue to make queries, or you can get your `client` instance to perform all sorts of advanced tasks on your GraphQL data. Such as [reactively watching queries with `watchQuery`][], [changing data on your server with `mutate`][], or [reading a fragment from your local cache with `readFragment`][]. - -To learn more about all of the features available to you through the `apollo-client` package, be sure to read through the [**`apollo-client` API reference**](https://www.apollographql.com/docs/react/api/apollo-client.html). - -[`ApolloClient`]: https://www.apollographql.com/docs/react/api/apollo-client.html -[`apollo-boost`]: https://www.apollographql.com/docs/react/essentials/get-started.html#apollo-boost -[reactively watching queries with `watchQuery`]: https://www.apollographql.com/docs/react/api/apollo-client.html#ApolloClient.watchQuery -[changing data on your server with `mutate`]: https://www.apollographql.com/docs/react/essentials/mutations.html -[reading a fragment from your local cache with `readFragment`]: https://www.apollographql.com/docs/react/advanced/caching.html#direct - -## Learn how to use Apollo Client with your favorite framework - -- [React](http://apollographql.com/docs/react/) -- [Angular](http://apollographql.com/docs/angular/) -- [Vue](https://github.com/Akryum/vue-apollo) -- [Ember](https://github.com/bgentry/ember-apollo-client) -- [Web Components](https://github.com/apollo-elements/apollo-elements) -- [Meteor](http://apollographql.com/docs/react/recipes/meteor.html) -- [Blaze](http://github.com/Swydo/blaze-apollo) -- [Vanilla JS](https://www.apollographql.com/docs/react/api/apollo-client.html) -- [Next.js](https://github.com/zeit/next.js/tree/master/examples/with-apollo) - ---- - -## Contributing - -[![CircleCI](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client) -[![codecov](https://codecov.io/gh/apollographql/apollo-client/branch/master/graph/badge.svg)](https://codecov.io/gh/apollographql/apollo-client) - -[Read the Apollo Contributor Guidelines.](CONTRIBUTING.md) - -Running tests locally: - -``` -npm install -npm test -``` - -This project uses TypeScript for static typing and TSLint for linting. You can get both of these built into your editor with no configuration by opening this project in [Visual Studio Code](https://code.visualstudio.com/), an open source IDE which is available for free on all platforms. - -#### Important discussions - -If you're getting booted up as a contributor, here are some discussions you should take a look at: - -1. [Static typing and why we went with TypeScript](https://github.com/apollostack/apollo-client/issues/6) also covered in [the Medium post](https://medium.com/apollo-stack/javascript-code-quality-with-free-tools-9a6d80e29f2d#.k32z401au) -1. [Idea for pagination handling](https://github.com/apollostack/apollo-client/issues/26) -1. [Discussion about interaction with Redux and domain vs. client state](https://github.com/apollostack/apollo-client/issues/98) -1. [Long conversation about different client options, before this repo existed](https://github.com/apollostack/apollo/issues/1) - -## Maintainers - -- [@benjamn](https://github.com/benjamn) (Apollo) -- [@hwillson](https://github.com/hwillson) (Apollo) diff --git a/node_modules/apollo-client/bundle.cjs.js b/node_modules/apollo-client/bundle.cjs.js deleted file mode 100644 index b96ca46..0000000 --- a/node_modules/apollo-client/bundle.cjs.js +++ /dev/null @@ -1,2729 +0,0 @@ -exports.__esModule = true; -exports.isApolloError = isApolloError; -exports.ObservableQuery = exports.NetworkStatus = exports.FetchType = exports.ApolloError = exports.ApolloClient = exports.default = void 0; - -var _tslib = require("tslib"); - -var _apolloUtilities = require("apollo-utilities"); - -var _apolloLink = require("apollo-link"); - -var _symbolObservable = _interopRequireDefault(require("symbol-observable")); - -var _tsInvariant = require("ts-invariant"); - -var _visitor = require("graphql/language/visitor"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var NetworkStatus; -exports.NetworkStatus = NetworkStatus; - -(function (NetworkStatus) { - NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; - NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; - NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; - NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; - NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; - NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; - NetworkStatus[NetworkStatus["error"] = 8] = "error"; -})(NetworkStatus || (exports.NetworkStatus = NetworkStatus = {})); - -function isNetworkRequestInFlight(networkStatus) { - return networkStatus < 7; -} - -var Observable = function (_super) { - (0, _tslib.__extends)(Observable, _super); - - function Observable() { - return _super !== null && _super.apply(this, arguments) || this; - } - - Observable.prototype[_symbolObservable.default] = function () { - return this; - }; - - Observable.prototype['@@observable'] = function () { - return this; - }; - - return Observable; -}(_apolloLink.Observable); - -function isNonEmptyArray(value) { - return Array.isArray(value) && value.length > 0; -} - -function isApolloError(err) { - return err.hasOwnProperty('graphQLErrors'); -} - -var generateErrorMessage = function (err) { - var message = ''; - - if (isNonEmptyArray(err.graphQLErrors)) { - err.graphQLErrors.forEach(function (graphQLError) { - var errorMessage = graphQLError ? graphQLError.message : 'Error message not found.'; - message += "GraphQL error: " + errorMessage + "\n"; - }); - } - - if (err.networkError) { - message += 'Network error: ' + err.networkError.message + '\n'; - } - - message = message.replace(/\n$/, ''); - return message; -}; - -var ApolloError = function (_super) { - (0, _tslib.__extends)(ApolloError, _super); - - function ApolloError(_a) { - var graphQLErrors = _a.graphQLErrors, - networkError = _a.networkError, - errorMessage = _a.errorMessage, - extraInfo = _a.extraInfo; - - var _this = _super.call(this, errorMessage) || this; - - _this.graphQLErrors = graphQLErrors || []; - _this.networkError = networkError || null; - - if (!errorMessage) { - _this.message = generateErrorMessage(_this); - } else { - _this.message = errorMessage; - } - - _this.extraInfo = extraInfo; - _this.__proto__ = ApolloError.prototype; - return _this; - } - - return ApolloError; -}(Error); - -exports.ApolloError = ApolloError; -var FetchType; -exports.FetchType = FetchType; - -(function (FetchType) { - FetchType[FetchType["normal"] = 1] = "normal"; - FetchType[FetchType["refetch"] = 2] = "refetch"; - FetchType[FetchType["poll"] = 3] = "poll"; -})(FetchType || (exports.FetchType = FetchType = {})); - -var hasError = function (storeValue, policy) { - if (policy === void 0) { - policy = 'none'; - } - - return storeValue && (storeValue.networkError || policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors)); -}; - -var ObservableQuery = function (_super) { - (0, _tslib.__extends)(ObservableQuery, _super); - - function ObservableQuery(_a) { - var queryManager = _a.queryManager, - options = _a.options, - _b = _a.shouldSubscribe, - shouldSubscribe = _b === void 0 ? true : _b; - - var _this = _super.call(this, function (observer) { - return _this.onSubscribe(observer); - }) || this; - - _this.observers = new Set(); - _this.subscriptions = new Set(); - _this.isTornDown = false; - _this.options = options; - _this.variables = options.variables || {}; - _this.queryId = queryManager.generateQueryId(); - _this.shouldSubscribe = shouldSubscribe; - var opDef = (0, _apolloUtilities.getOperationDefinition)(options.query); - _this.queryName = opDef && opDef.name && opDef.name.value; - _this.queryManager = queryManager; - return _this; - } - - ObservableQuery.prototype.result = function () { - var _this = this; - - return new Promise(function (resolve, reject) { - var observer = { - next: function (result) { - resolve(result); - - _this.observers.delete(observer); - - if (!_this.observers.size) { - _this.queryManager.removeQuery(_this.queryId); - } - - setTimeout(function () { - subscription.unsubscribe(); - }, 0); - }, - error: reject - }; - - var subscription = _this.subscribe(observer); - }); - }; - - ObservableQuery.prototype.currentResult = function () { - var result = this.getCurrentResult(); - - if (result.data === undefined) { - result.data = {}; - } - - return result; - }; - - ObservableQuery.prototype.getCurrentResult = function () { - if (this.isTornDown) { - var lastResult = this.lastResult; - return { - data: !this.lastError && lastResult && lastResult.data || void 0, - error: this.lastError, - loading: false, - networkStatus: NetworkStatus.error - }; - } - - var _a = this.queryManager.getCurrentQueryResult(this), - data = _a.data, - partial = _a.partial; - - var queryStoreValue = this.queryManager.queryStore.get(this.queryId); - var result; - var fetchPolicy = this.options.fetchPolicy; - var isNetworkFetchPolicy = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; - - if (queryStoreValue) { - var networkStatus = queryStoreValue.networkStatus; - - if (hasError(queryStoreValue, this.options.errorPolicy)) { - return { - data: void 0, - loading: false, - networkStatus: networkStatus, - error: new ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError - }) - }; - } - - if (queryStoreValue.variables) { - this.options.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options.variables), queryStoreValue.variables); - this.variables = this.options.variables; - } - - result = { - data: data, - loading: isNetworkRequestInFlight(networkStatus), - networkStatus: networkStatus - }; - - if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { - result.errors = queryStoreValue.graphQLErrors; - } - } else { - var loading = isNetworkFetchPolicy || partial && fetchPolicy !== 'cache-only'; - result = { - data: data, - loading: loading, - networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready - }; - } - - if (!partial) { - this.updateLastResult((0, _tslib.__assign)((0, _tslib.__assign)({}, result), { - stale: false - })); - } - - return (0, _tslib.__assign)((0, _tslib.__assign)({}, result), { - partial: partial - }); - }; - - ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { - var snapshot = this.lastResultSnapshot; - return !(snapshot && newResult && snapshot.networkStatus === newResult.networkStatus && snapshot.stale === newResult.stale && (0, _apolloUtilities.isEqual)(snapshot.data, newResult.data)); - }; - - ObservableQuery.prototype.getLastResult = function () { - return this.lastResult; - }; - - ObservableQuery.prototype.getLastError = function () { - return this.lastError; - }; - - ObservableQuery.prototype.resetLastResults = function () { - delete this.lastResult; - delete this.lastResultSnapshot; - delete this.lastError; - this.isTornDown = false; - }; - - ObservableQuery.prototype.resetQueryStoreErrors = function () { - var queryStore = this.queryManager.queryStore.get(this.queryId); - - if (queryStore) { - queryStore.networkError = null; - queryStore.graphQLErrors = []; - } - }; - - ObservableQuery.prototype.refetch = function (variables) { - var fetchPolicy = this.options.fetchPolicy; - - if (fetchPolicy === 'cache-only') { - return Promise.reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); - } - - if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'cache-and-network') { - fetchPolicy = 'network-only'; - } - - if (!(0, _apolloUtilities.isEqual)(this.variables, variables)) { - this.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.variables), variables); - } - - if (!(0, _apolloUtilities.isEqual)(this.options.variables, this.variables)) { - this.options.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options.variables), this.variables); - } - - return this.queryManager.fetchQuery(this.queryId, (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), { - fetchPolicy: fetchPolicy - }), FetchType.refetch); - }; - - ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { - var _this = this; - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 2) : (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); - var combinedOptions = (0, _tslib.__assign)((0, _tslib.__assign)({}, fetchMoreOptions.query ? fetchMoreOptions : (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), fetchMoreOptions), { - variables: (0, _tslib.__assign)((0, _tslib.__assign)({}, this.variables), fetchMoreOptions.variables) - })), { - fetchPolicy: 'network-only' - }); - var qid = this.queryManager.generateQueryId(); - return this.queryManager.fetchQuery(qid, combinedOptions, FetchType.normal, this.queryId).then(function (fetchMoreResult) { - _this.updateQuery(function (previousResult) { - return fetchMoreOptions.updateQuery(previousResult, { - fetchMoreResult: fetchMoreResult.data, - variables: combinedOptions.variables - }); - }); - - _this.queryManager.stopQuery(qid); - - return fetchMoreResult; - }, function (error) { - _this.queryManager.stopQuery(qid); - - throw error; - }); - }; - - ObservableQuery.prototype.subscribeToMore = function (options) { - var _this = this; - - var subscription = this.queryManager.startGraphQLSubscription({ - query: options.document, - variables: options.variables - }).subscribe({ - next: function (subscriptionData) { - var updateQuery = options.updateQuery; - - if (updateQuery) { - _this.updateQuery(function (previous, _a) { - var variables = _a.variables; - return updateQuery(previous, { - subscriptionData: subscriptionData, - variables: variables - }); - }); - } - }, - error: function (err) { - if (options.onError) { - options.onError(err); - return; - } - - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled GraphQL subscription error', err); - } - }); - this.subscriptions.add(subscription); - return function () { - if (_this.subscriptions.delete(subscription)) { - subscription.unsubscribe(); - } - }; - }; - - ObservableQuery.prototype.setOptions = function (opts) { - var oldFetchPolicy = this.options.fetchPolicy; - this.options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), opts); - - if (opts.pollInterval) { - this.startPolling(opts.pollInterval); - } else if (opts.pollInterval === 0) { - this.stopPolling(); - } - - var fetchPolicy = opts.fetchPolicy; - return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || oldFetchPolicy === 'standby' || fetchPolicy === 'network-only'), opts.fetchResults); - }; - - ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { - if (tryFetch === void 0) { - tryFetch = false; - } - - if (fetchResults === void 0) { - fetchResults = true; - } - - this.isTornDown = false; - variables = variables || this.variables; - - if (!tryFetch && (0, _apolloUtilities.isEqual)(variables, this.variables)) { - return this.observers.size && fetchResults ? this.result() : Promise.resolve(); - } - - this.variables = this.options.variables = variables; - - if (!this.observers.size) { - return Promise.resolve(); - } - - return this.queryManager.fetchQuery(this.queryId, this.options); - }; - - ObservableQuery.prototype.updateQuery = function (mapFn) { - var queryManager = this.queryManager; - - var _a = queryManager.getQueryWithPreviousResult(this.queryId), - previousResult = _a.previousResult, - variables = _a.variables, - document = _a.document; - - var newResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { - return mapFn(previousResult, { - variables: variables - }); - }); - - if (newResult) { - queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); - queryManager.broadcastQueries(); - } - }; - - ObservableQuery.prototype.stopPolling = function () { - this.queryManager.stopPollingQuery(this.queryId); - this.options.pollInterval = undefined; - }; - - ObservableQuery.prototype.startPolling = function (pollInterval) { - assertNotCacheFirstOrOnly(this); - this.options.pollInterval = pollInterval; - this.queryManager.startPollingQuery(this.options, this.queryId); - }; - - ObservableQuery.prototype.updateLastResult = function (newResult) { - var previousResult = this.lastResult; - this.lastResult = newResult; - this.lastResultSnapshot = this.queryManager.assumeImmutableResults ? newResult : (0, _apolloUtilities.cloneDeep)(newResult); - return previousResult; - }; - - ObservableQuery.prototype.onSubscribe = function (observer) { - var _this = this; - - try { - var subObserver = observer._subscription._observer; - - if (subObserver && !subObserver.error) { - subObserver.error = defaultSubscriptionObserverErrorCallback; - } - } catch (_a) {} - - var first = !this.observers.size; - this.observers.add(observer); - if (observer.next && this.lastResult) observer.next(this.lastResult); - if (observer.error && this.lastError) observer.error(this.lastError); - - if (first) { - this.setUpQuery(); - } - - return function () { - if (_this.observers.delete(observer) && !_this.observers.size) { - _this.tearDownQuery(); - } - }; - }; - - ObservableQuery.prototype.setUpQuery = function () { - var _this = this; - - var _a = this, - queryManager = _a.queryManager, - queryId = _a.queryId; - - if (this.shouldSubscribe) { - queryManager.addObservableQuery(queryId, this); - } - - if (this.options.pollInterval) { - assertNotCacheFirstOrOnly(this); - queryManager.startPollingQuery(this.options, queryId); - } - - var onError = function (error) { - _this.updateLastResult((0, _tslib.__assign)((0, _tslib.__assign)({}, _this.lastResult), { - errors: error.graphQLErrors, - networkStatus: NetworkStatus.error, - loading: false - })); - - iterateObserversSafely(_this.observers, 'error', _this.lastError = error); - }; - - queryManager.observeQuery(queryId, this.options, { - next: function (result) { - if (_this.lastError || _this.isDifferentFromLastResult(result)) { - var previousResult_1 = _this.updateLastResult(result); - - var _a = _this.options, - query_1 = _a.query, - variables = _a.variables, - fetchPolicy_1 = _a.fetchPolicy; - - if (queryManager.transform(query_1).hasClientExports) { - queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { - var previousVariables = _this.variables; - _this.variables = _this.options.variables = variables; - - if (!result.loading && previousResult_1 && fetchPolicy_1 !== 'cache-only' && queryManager.transform(query_1).serverQuery && !(0, _apolloUtilities.isEqual)(previousVariables, variables)) { - _this.refetch(); - } else { - iterateObserversSafely(_this.observers, 'next', result); - } - }); - } else { - iterateObserversSafely(_this.observers, 'next', result); - } - } - }, - error: onError - }).catch(onError); - }; - - ObservableQuery.prototype.tearDownQuery = function () { - var queryManager = this.queryManager; - this.isTornDown = true; - queryManager.stopPollingQuery(this.queryId); - this.subscriptions.forEach(function (sub) { - return sub.unsubscribe(); - }); - this.subscriptions.clear(); - queryManager.removeObservableQuery(this.queryId); - queryManager.stopQuery(this.queryId); - this.observers.clear(); - }; - - return ObservableQuery; -}(Observable); - -exports.ObservableQuery = ObservableQuery; - -function defaultSubscriptionObserverErrorCallback(error) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled error', error.message, error.stack); -} - -function iterateObserversSafely(observers, method, argument) { - var observersWithMethod = []; - observers.forEach(function (obs) { - return obs[method] && observersWithMethod.push(obs); - }); - observersWithMethod.forEach(function (obs) { - return obs[method](argument); - }); -} - -function assertNotCacheFirstOrOnly(obsQuery) { - var fetchPolicy = obsQuery.options.fetchPolicy; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 3) : (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); -} - -var MutationStore = function () { - function MutationStore() { - this.store = {}; - } - - MutationStore.prototype.getStore = function () { - return this.store; - }; - - MutationStore.prototype.get = function (mutationId) { - return this.store[mutationId]; - }; - - MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { - this.store[mutationId] = { - mutation: mutation, - variables: variables || {}, - loading: true, - error: null - }; - }; - - MutationStore.prototype.markMutationError = function (mutationId, error) { - var mutation = this.store[mutationId]; - - if (mutation) { - mutation.loading = false; - mutation.error = error; - } - }; - - MutationStore.prototype.markMutationResult = function (mutationId) { - var mutation = this.store[mutationId]; - - if (mutation) { - mutation.loading = false; - mutation.error = null; - } - }; - - MutationStore.prototype.reset = function () { - this.store = {}; - }; - - return MutationStore; -}(); - -var QueryStore = function () { - function QueryStore() { - this.store = {}; - } - - QueryStore.prototype.getStore = function () { - return this.store; - }; - - QueryStore.prototype.get = function (queryId) { - return this.store[queryId]; - }; - - QueryStore.prototype.initQuery = function (query) { - var previousQuery = this.store[query.queryId]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 19) : (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); - var isSetVariables = false; - var previousVariables = null; - - if (query.storePreviousVariables && previousQuery && previousQuery.networkStatus !== NetworkStatus.loading) { - if (!(0, _apolloUtilities.isEqual)(previousQuery.variables, query.variables)) { - isSetVariables = true; - previousVariables = previousQuery.variables; - } - } - - var networkStatus; - - if (isSetVariables) { - networkStatus = NetworkStatus.setVariables; - } else if (query.isPoll) { - networkStatus = NetworkStatus.poll; - } else if (query.isRefetch) { - networkStatus = NetworkStatus.refetch; - } else { - networkStatus = NetworkStatus.loading; - } - - var graphQLErrors = []; - - if (previousQuery && previousQuery.graphQLErrors) { - graphQLErrors = previousQuery.graphQLErrors; - } - - this.store[query.queryId] = { - document: query.document, - variables: query.variables, - previousVariables: previousVariables, - networkError: null, - graphQLErrors: graphQLErrors, - networkStatus: networkStatus, - metadata: query.metadata - }; - - if (typeof query.fetchMoreForQueryId === 'string' && this.store[query.fetchMoreForQueryId]) { - this.store[query.fetchMoreForQueryId].networkStatus = NetworkStatus.fetchMore; - } - }; - - QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) return; - this.store[queryId].networkError = null; - this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : []; - this.store[queryId].previousVariables = null; - this.store[queryId].networkStatus = NetworkStatus.ready; - - if (typeof fetchMoreForQueryId === 'string' && this.store[fetchMoreForQueryId]) { - this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready; - } - }; - - QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) return; - this.store[queryId].networkError = error; - this.store[queryId].networkStatus = NetworkStatus.error; - - if (typeof fetchMoreForQueryId === 'string') { - this.markQueryResultClient(fetchMoreForQueryId, true); - } - }; - - QueryStore.prototype.markQueryResultClient = function (queryId, complete) { - var storeValue = this.store && this.store[queryId]; - - if (storeValue) { - storeValue.networkError = null; - storeValue.previousVariables = null; - - if (complete) { - storeValue.networkStatus = NetworkStatus.ready; - } - } - }; - - QueryStore.prototype.stopQuery = function (queryId) { - delete this.store[queryId]; - }; - - QueryStore.prototype.reset = function (observableQueryIds) { - var _this = this; - - Object.keys(this.store).forEach(function (queryId) { - if (observableQueryIds.indexOf(queryId) < 0) { - _this.stopQuery(queryId); - } else { - _this.store[queryId].networkStatus = NetworkStatus.loading; - } - }); - }; - - return QueryStore; -}(); - -function capitalizeFirstLetter(str) { - return str.charAt(0).toUpperCase() + str.slice(1); -} - -var LocalState = function () { - function LocalState(_a) { - var cache = _a.cache, - client = _a.client, - resolvers = _a.resolvers, - fragmentMatcher = _a.fragmentMatcher; - this.cache = cache; - - if (client) { - this.client = client; - } - - if (resolvers) { - this.addResolvers(resolvers); - } - - if (fragmentMatcher) { - this.setFragmentMatcher(fragmentMatcher); - } - } - - LocalState.prototype.addResolvers = function (resolvers) { - var _this = this; - - this.resolvers = this.resolvers || {}; - - if (Array.isArray(resolvers)) { - resolvers.forEach(function (resolverGroup) { - _this.resolvers = (0, _apolloUtilities.mergeDeep)(_this.resolvers, resolverGroup); - }); - } else { - this.resolvers = (0, _apolloUtilities.mergeDeep)(this.resolvers, resolvers); - } - }; - - LocalState.prototype.setResolvers = function (resolvers) { - this.resolvers = {}; - this.addResolvers(resolvers); - }; - - LocalState.prototype.getResolvers = function () { - return this.resolvers || {}; - }; - - LocalState.prototype.runResolvers = function (_a) { - var document = _a.document, - remoteResult = _a.remoteResult, - context = _a.context, - variables = _a.variables, - _b = _a.onlyRunForcedResolvers, - onlyRunForcedResolvers = _b === void 0 ? false : _b; - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - return (0, _tslib.__generator)(this, function (_c) { - if (document) { - return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, remoteResult), { - data: localResult.result - }); - })]; - } - - return [2, remoteResult]; - }); - }); - }; - - LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { - this.fragmentMatcher = fragmentMatcher; - }; - - LocalState.prototype.getFragmentMatcher = function () { - return this.fragmentMatcher; - }; - - LocalState.prototype.clientQuery = function (document) { - if ((0, _apolloUtilities.hasDirectives)(['client'], document)) { - if (this.resolvers) { - return document; - } - - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + 'were specified. This means ApolloClient local resolver handling ' + 'has been disabled, and @client directives will be passed through ' + 'to your link chain.'); - } - - return null; - }; - - LocalState.prototype.serverQuery = function (document) { - return this.resolvers ? (0, _apolloUtilities.removeClientSetsFromDocument)(document) : document; - }; - - LocalState.prototype.prepareContext = function (context) { - if (context === void 0) { - context = {}; - } - - var cache = this.cache; - var newContext = (0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - cache: cache, - getCacheKey: function (obj) { - if (cache.config) { - return cache.config.dataIdFromObject(obj); - } else { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(false, 6) : (0, _tsInvariant.invariant)(false, 'To use context.getCacheKey, you need to use a cache that has ' + 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); - } - } - }); - return newContext; - }; - - LocalState.prototype.addExportedVariables = function (document, variables, context) { - if (variables === void 0) { - variables = {}; - } - - if (context === void 0) { - context = {}; - } - - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - return (0, _tslib.__generator)(this, function (_a) { - if (document) { - return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, variables), data.exportedVariables); - })]; - } - - return [2, (0, _tslib.__assign)({}, variables)]; - }); - }); - }; - - LocalState.prototype.shouldForceResolvers = function (document) { - var forceResolvers = false; - (0, _visitor.visit)(document, { - Directive: { - enter: function (node) { - if (node.name.value === 'client' && node.arguments) { - forceResolvers = node.arguments.some(function (arg) { - return arg.name.value === 'always' && arg.value.kind === 'BooleanValue' && arg.value.value === true; - }); - - if (forceResolvers) { - return _visitor.BREAK; - } - } - } - } - }); - return forceResolvers; - }; - - LocalState.prototype.buildRootValueFromCache = function (document, variables) { - return this.cache.diff({ - query: (0, _apolloUtilities.buildQueryFromSelectionSet)(document), - variables: variables, - returnPartialData: true, - optimistic: false - }).result; - }; - - LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { - if (context === void 0) { - context = {}; - } - - if (variables === void 0) { - variables = {}; - } - - if (fragmentMatcher === void 0) { - fragmentMatcher = function () { - return true; - }; - } - - if (onlyRunForcedResolvers === void 0) { - onlyRunForcedResolvers = false; - } - - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; - - return (0, _tslib.__generator)(this, function (_b) { - mainDefinition = (0, _apolloUtilities.getMainDefinition)(document); - fragments = (0, _apolloUtilities.getFragmentDefinitions)(document); - fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); - definitionOperation = mainDefinition.operation; - defaultOperationType = definitionOperation ? capitalizeFirstLetter(definitionOperation) : 'Query'; - _a = this, cache = _a.cache, client = _a.client; - execContext = { - fragmentMap: fragmentMap, - context: (0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - cache: cache, - client: client - }), - variables: variables, - fragmentMatcher: fragmentMatcher, - defaultOperationType: defaultOperationType, - exportedVariables: {}, - onlyRunForcedResolvers: onlyRunForcedResolvers - }; - return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { - return { - result: result, - exportedVariables: execContext.exportedVariables - }; - })]; - }); - }); - }; - - LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var fragmentMap, context, variables, resultsToMerge, execute; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_a) { - fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; - resultsToMerge = [rootValue]; - - execute = function (selection) { - return (0, _tslib.__awaiter)(_this, void 0, void 0, function () { - var fragment, typeCondition; - return (0, _tslib.__generator)(this, function (_a) { - if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { - return [2]; - } - - if ((0, _apolloUtilities.isField)(selection)) { - return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { - var _a; - - if (typeof fieldResult !== 'undefined') { - resultsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); - } - })]; - } - - if ((0, _apolloUtilities.isInlineFragment)(selection)) { - fragment = selection; - } else { - fragment = fragmentMap[selection.name.value]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 7) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value); - } - - if (fragment && fragment.typeCondition) { - typeCondition = fragment.typeCondition.name.value; - - if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { - return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { - resultsToMerge.push(fragmentResult); - })]; - } - } - - return [2]; - }); - }); - }; - - return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { - return (0, _apolloUtilities.mergeDeepArray)(resultsToMerge); - })]; - }); - }); - }; - - LocalState.prototype.resolveField = function (field, rootValue, execContext) { - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_a) { - variables = execContext.variables; - fieldName = field.name.value; - aliasedFieldName = (0, _apolloUtilities.resultKeyNameFromField)(field); - aliasUsed = fieldName !== aliasedFieldName; - defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; - resultPromise = Promise.resolve(defaultResult); - - if (!execContext.onlyRunForcedResolvers || this.shouldForceResolvers(field)) { - resolverType = rootValue.__typename || execContext.defaultOperationType; - resolverMap = this.resolvers && this.resolvers[resolverType]; - - if (resolverMap) { - resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; - - if (resolve) { - resultPromise = Promise.resolve(resolve(rootValue, (0, _apolloUtilities.argumentsObjectFromField)(field, variables), execContext.context, { - field: field, - fragmentMap: execContext.fragmentMap - })); - } - } - } - - return [2, resultPromise.then(function (result) { - if (result === void 0) { - result = defaultResult; - } - - if (field.directives) { - field.directives.forEach(function (directive) { - if (directive.name.value === 'export' && directive.arguments) { - directive.arguments.forEach(function (arg) { - if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { - execContext.exportedVariables[arg.value.value] = result; - } - }); - } - }); - } - - if (!field.selectionSet) { - return result; - } - - if (result == null) { - return result; - } - - if (Array.isArray(result)) { - return _this.resolveSubSelectedArray(field, result, execContext); - } - - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, result, execContext); - } - })]; - }); - }); - }; - - LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { - var _this = this; - - return Promise.all(result.map(function (item) { - if (item === null) { - return null; - } - - if (Array.isArray(item)) { - return _this.resolveSubSelectedArray(field, item, execContext); - } - - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, item, execContext); - } - })); - }; - - return LocalState; -}(); - -function multiplex(inner) { - var observers = new Set(); - var sub = null; - return new Observable(function (observer) { - observers.add(observer); - sub = sub || inner.subscribe({ - next: function (value) { - observers.forEach(function (obs) { - return obs.next && obs.next(value); - }); - }, - error: function (error) { - observers.forEach(function (obs) { - return obs.error && obs.error(error); - }); - }, - complete: function () { - observers.forEach(function (obs) { - return obs.complete && obs.complete(); - }); - } - }); - return function () { - if (observers.delete(observer) && !observers.size && sub) { - sub.unsubscribe(); - sub = null; - } - }; - }); -} - -function asyncMap(observable, mapFn) { - return new Observable(function (observer) { - var next = observer.next, - error = observer.error, - complete = observer.complete; - var activeNextCount = 0; - var completed = false; - var handler = { - next: function (value) { - ++activeNextCount; - new Promise(function (resolve) { - resolve(mapFn(value)); - }).then(function (result) { - --activeNextCount; - next && next.call(observer, result); - completed && handler.complete(); - }, function (e) { - --activeNextCount; - error && error.call(observer, e); - }); - }, - error: function (e) { - error && error.call(observer, e); - }, - complete: function () { - completed = true; - - if (!activeNextCount) { - complete && complete.call(observer); - } - } - }; - var sub = observable.subscribe(handler); - return function () { - return sub.unsubscribe(); - }; - }); -} - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -var QueryManager = function () { - function QueryManager(_a) { - var link = _a.link, - _b = _a.queryDeduplication, - queryDeduplication = _b === void 0 ? false : _b, - store = _a.store, - _c = _a.onBroadcast, - onBroadcast = _c === void 0 ? function () { - return undefined; - } : _c, - _d = _a.ssrMode, - ssrMode = _d === void 0 ? false : _d, - _e = _a.clientAwareness, - clientAwareness = _e === void 0 ? {} : _e, - localState = _a.localState, - assumeImmutableResults = _a.assumeImmutableResults; - this.mutationStore = new MutationStore(); - this.queryStore = new QueryStore(); - this.clientAwareness = {}; - this.idCounter = 1; - this.queries = new Map(); - this.fetchQueryRejectFns = new Map(); - this.transformCache = new (_apolloUtilities.canUseWeakMap ? WeakMap : Map)(); - this.inFlightLinkObservables = new Map(); - this.pollingInfoByQueryId = new Map(); - this.link = link; - this.queryDeduplication = queryDeduplication; - this.dataStore = store; - this.onBroadcast = onBroadcast; - this.clientAwareness = clientAwareness; - this.localState = localState || new LocalState({ - cache: store.getCache() - }); - this.ssrMode = ssrMode; - this.assumeImmutableResults = !!assumeImmutableResults; - } - - QueryManager.prototype.stop = function () { - var _this = this; - - this.queries.forEach(function (_info, queryId) { - _this.stopQueryNoBroadcast(queryId); - }); - this.fetchQueryRejectFns.forEach(function (reject) { - reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(8) : new _tsInvariant.InvariantError('QueryManager stopped while query was in flight')); - }); - }; - - QueryManager.prototype.mutate = function (_a) { - var mutation = _a.mutation, - variables = _a.variables, - optimisticResponse = _a.optimisticResponse, - updateQueriesByName = _a.updateQueries, - _b = _a.refetchQueries, - refetchQueries = _b === void 0 ? [] : _b, - _c = _a.awaitRefetchQueries, - awaitRefetchQueries = _c === void 0 ? false : _c, - updateWithProxyFn = _a.update, - _d = _a.errorPolicy, - errorPolicy = _d === void 0 ? 'none' : _d, - fetchPolicy = _a.fetchPolicy, - _e = _a.context, - context = _e === void 0 ? {} : _e; - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var mutationId, generateUpdateQueriesInfo, self; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_f) { - switch (_f.label) { - case 0: - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutation, 9) : (0, _tsInvariant.invariant)(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', 10) : (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - mutationId = this.generateQueryId(); - mutation = this.transform(mutation).document; - this.setQuery(mutationId, function () { - return { - document: mutation - }; - }); - variables = this.getVariables(mutation, variables); - if (!this.transform(mutation).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(mutation, variables, context)]; - - case 1: - variables = _f.sent(); - _f.label = 2; - - case 2: - generateUpdateQueriesInfo = function () { - var ret = {}; - - if (updateQueriesByName) { - _this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - - if (observableQuery) { - var queryName = observableQuery.queryName; - - if (queryName && hasOwnProperty.call(updateQueriesByName, queryName)) { - ret[queryId] = { - updater: updateQueriesByName[queryName], - query: _this.queryStore.get(queryId) - }; - } - } - }); - } - - return ret; - }; - - this.mutationStore.initMutation(mutationId, mutation, variables); - this.dataStore.markMutationInit({ - mutationId: mutationId, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn, - optimisticResponse: optimisticResponse - }); - this.broadcastQueries(); - self = this; - return [2, new Promise(function (resolve, reject) { - var storeResult; - var error; - self.getObservableFromLink(mutation, (0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - optimisticResponse: optimisticResponse - }), variables, false).subscribe({ - next: function (result) { - if ((0, _apolloUtilities.graphQLResultHasError)(result) && errorPolicy === 'none') { - error = new ApolloError({ - graphQLErrors: result.errors - }); - return; - } - - self.mutationStore.markMutationResult(mutationId); - - if (fetchPolicy !== 'no-cache') { - self.dataStore.markMutationResult({ - mutationId: mutationId, - result: result, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn - }); - } - - storeResult = result; - }, - error: function (err) { - self.mutationStore.markMutationError(mutationId, err); - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse - }); - self.broadcastQueries(); - self.setQuery(mutationId, function () { - return { - document: null - }; - }); - reject(new ApolloError({ - networkError: err - })); - }, - complete: function () { - if (error) { - self.mutationStore.markMutationError(mutationId, error); - } - - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse - }); - self.broadcastQueries(); - - if (error) { - reject(error); - return; - } - - if (typeof refetchQueries === 'function') { - refetchQueries = refetchQueries(storeResult); - } - - var refetchQueryPromises = []; - - if (isNonEmptyArray(refetchQueries)) { - refetchQueries.forEach(function (refetchQuery) { - if (typeof refetchQuery === 'string') { - self.queries.forEach(function (_a) { - var observableQuery = _a.observableQuery; - - if (observableQuery && observableQuery.queryName === refetchQuery) { - refetchQueryPromises.push(observableQuery.refetch()); - } - }); - } else { - var queryOptions = { - query: refetchQuery.query, - variables: refetchQuery.variables, - fetchPolicy: 'network-only' - }; - - if (refetchQuery.context) { - queryOptions.context = refetchQuery.context; - } - - refetchQueryPromises.push(self.query(queryOptions)); - } - }); - } - - Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { - self.setQuery(mutationId, function () { - return { - document: null - }; - }); - - if (errorPolicy === 'ignore' && storeResult && (0, _apolloUtilities.graphQLResultHasError)(storeResult)) { - delete storeResult.errors; - } - - resolve(storeResult); - }); - } - }); - })]; - } - }); - }); - }; - - QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_e) { - switch (_e.label) { - case 0: - _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; - query = this.transform(options.query).document; - variables = this.getVariables(query, options.variables); - if (!this.transform(query).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(query, variables, context)]; - - case 1: - variables = _e.sent(); - _e.label = 2; - - case 2: - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - variables: variables - }); - isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; - needToFetch = isNetworkOnly; - - if (!isNetworkOnly) { - _d = this.dataStore.getCache().diff({ - query: query, - variables: variables, - returnPartialData: true, - optimistic: false - }), complete = _d.complete, result = _d.result; - needToFetch = !complete || fetchPolicy === 'cache-and-network'; - storeResult = result; - } - - shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; - if ((0, _apolloUtilities.hasDirectives)(['live'], query)) shouldFetch = true; - requestId = this.idCounter++; - cancel = fetchPolicy !== 'no-cache' ? this.updateQueryWatch(queryId, query, options) : undefined; - this.setQuery(queryId, function () { - return { - document: query, - lastRequestId: requestId, - invalidated: true, - cancel: cancel - }; - }); - this.invalidate(fetchMoreForQueryId); - this.queryStore.initQuery({ - queryId: queryId, - document: query, - storePreviousVariables: shouldFetch, - variables: variables, - isPoll: fetchType === FetchType.poll, - isRefetch: fetchType === FetchType.refetch, - metadata: metadata, - fetchMoreForQueryId: fetchMoreForQueryId - }); - this.broadcastQueries(); - - if (shouldFetch) { - networkResult = this.fetchRequest({ - requestId: requestId, - queryId: queryId, - document: query, - options: options, - fetchMoreForQueryId: fetchMoreForQueryId - }).catch(function (error) { - if (isApolloError(error)) { - throw error; - } else { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); - - _this.invalidate(queryId); - - _this.invalidate(fetchMoreForQueryId); - - _this.broadcastQueries(); - } - - throw new ApolloError({ - networkError: error - }); - } - }); - - if (fetchPolicy !== 'cache-and-network') { - return [2, networkResult]; - } - - networkResult.catch(function () {}); - } - - this.queryStore.markQueryResultClient(queryId, !shouldFetch); - this.invalidate(queryId); - this.invalidate(fetchMoreForQueryId); - - if (this.transform(query).hasForcedResolvers) { - return [2, this.localState.runResolvers({ - document: query, - remoteResult: { - data: storeResult - }, - context: context, - variables: variables, - onlyRunForcedResolvers: true - }).then(function (result) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - - _this.broadcastQueries(); - - return result; - })]; - } - - this.broadcastQueries(); - return [2, { - data: storeResult - }]; - } - }); - }); - }; - - QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { - var fetchPolicy = _a.fetchPolicy, - variables = _a.variables, - errorPolicy = _a.errorPolicy; - - if (fetchPolicy === 'no-cache') { - this.setQuery(queryId, function () { - return { - newData: { - result: result.data, - complete: true - } - }; - }); - } else { - this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); - } - }; - - QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { - var _this = this; - - function invoke(method, argument) { - if (observer[method]) { - try { - observer[method](argument); - } catch (e) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(e); - } - } else if (method === 'error') { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(argument); - } - } - - return function (queryStoreValue, newData) { - _this.invalidate(queryId, false); - - if (!queryStoreValue) return; - - var _a = _this.getQuery(queryId), - observableQuery = _a.observableQuery, - document = _a.document; - - var fetchPolicy = observableQuery ? observableQuery.options.fetchPolicy : options.fetchPolicy; - if (fetchPolicy === 'standby') return; - var loading = isNetworkRequestInFlight(queryStoreValue.networkStatus); - var lastResult = observableQuery && observableQuery.getLastResult(); - var networkStatusChanged = !!(lastResult && lastResult.networkStatus !== queryStoreValue.networkStatus); - var shouldNotifyIfLoading = options.returnPartialData || !newData && queryStoreValue.previousVariables || networkStatusChanged && options.notifyOnNetworkStatusChange || fetchPolicy === 'cache-only' || fetchPolicy === 'cache-and-network'; - - if (loading && !shouldNotifyIfLoading) { - return; - } - - var hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors); - var errorPolicy = observableQuery && observableQuery.options.errorPolicy || options.errorPolicy || 'none'; - - if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { - return invoke('error', new ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError - })); - } - - try { - var data = void 0; - var isMissing = void 0; - - if (newData) { - if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { - _this.setQuery(queryId, function () { - return { - newData: null - }; - }); - } - - data = newData.result; - isMissing = !newData.complete; - } else { - var lastError = observableQuery && observableQuery.getLastError(); - var errorStatusChanged = errorPolicy !== 'none' && (lastError && lastError.graphQLErrors) !== queryStoreValue.graphQLErrors; - - if (lastResult && lastResult.data && !errorStatusChanged) { - data = lastResult.data; - isMissing = false; - } else { - var diffResult = _this.dataStore.getCache().diff({ - query: document, - variables: queryStoreValue.previousVariables || queryStoreValue.variables, - returnPartialData: true, - optimistic: true - }); - - data = diffResult.result; - isMissing = !diffResult.complete; - } - } - - var stale = isMissing && !(options.returnPartialData || fetchPolicy === 'cache-only'); - var resultFromStore = { - data: stale ? lastResult && lastResult.data : data, - loading: loading, - networkStatus: queryStoreValue.networkStatus, - stale: stale - }; - - if (errorPolicy === 'all' && hasGraphQLErrors) { - resultFromStore.errors = queryStoreValue.graphQLErrors; - } - - invoke('next', resultFromStore); - } catch (networkError) { - invoke('error', new ApolloError({ - networkError: networkError - })); - } - }; - }; - - QueryManager.prototype.transform = function (document) { - var transformCache = this.transformCache; - - if (!transformCache.has(document)) { - var cache = this.dataStore.getCache(); - var transformed = cache.transformDocument(document); - var forLink = (0, _apolloUtilities.removeConnectionDirectiveFromDocument)(cache.transformForLink(transformed)); - var clientQuery = this.localState.clientQuery(transformed); - var serverQuery = this.localState.serverQuery(forLink); - var cacheEntry_1 = { - document: transformed, - hasClientExports: (0, _apolloUtilities.hasClientExports)(transformed), - hasForcedResolvers: this.localState.shouldForceResolvers(transformed), - clientQuery: clientQuery, - serverQuery: serverQuery, - defaultVars: (0, _apolloUtilities.getDefaultValues)((0, _apolloUtilities.getOperationDefinition)(transformed)) - }; - - var add = function (doc) { - if (doc && !transformCache.has(doc)) { - transformCache.set(doc, cacheEntry_1); - } - }; - - add(document); - add(transformed); - add(clientQuery); - add(serverQuery); - } - - return transformCache.get(document); - }; - - QueryManager.prototype.getVariables = function (document, variables) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, this.transform(document).defaultVars), variables); - }; - - QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { - if (shouldSubscribe === void 0) { - shouldSubscribe = true; - } - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 11) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); - options.variables = this.getVariables(options.query, options.variables); - - if (typeof options.notifyOnNetworkStatusChange === 'undefined') { - options.notifyOnNetworkStatusChange = false; - } - - var transformedOptions = (0, _tslib.__assign)({}, options); - return new ObservableQuery({ - queryManager: this, - options: transformedOptions, - shouldSubscribe: shouldSubscribe - }); - }; - - QueryManager.prototype.query = function (options) { - var _this = this; - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query, 12) : (0, _tsInvariant.invariant)(options.query, 'query option is required. You must specify your GraphQL document ' + 'in the query option.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query.kind === 'Document', 13) : (0, _tsInvariant.invariant)(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.returnPartialData, 14) : (0, _tsInvariant.invariant)(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.pollInterval, 15) : (0, _tsInvariant.invariant)(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); - return new Promise(function (resolve, reject) { - var watchedQuery = _this.watchQuery(options, false); - - _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); - - watchedQuery.result().then(resolve, reject).then(function () { - return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); - }); - }); - }; - - QueryManager.prototype.generateQueryId = function () { - return String(this.idCounter++); - }; - - QueryManager.prototype.stopQueryInStore = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.broadcastQueries(); - }; - - QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { - this.stopPollingQuery(queryId); - this.queryStore.stopQuery(queryId); - this.invalidate(queryId); - }; - - QueryManager.prototype.addQueryListener = function (queryId, listener) { - this.setQuery(queryId, function (_a) { - var listeners = _a.listeners; - listeners.add(listener); - return { - invalidated: false - }; - }); - }; - - QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { - var _this = this; - - var cancel = this.getQuery(queryId).cancel; - if (cancel) cancel(); - - var previousResult = function () { - var previousResult = null; - - var observableQuery = _this.getQuery(queryId).observableQuery; - - if (observableQuery) { - var lastResult = observableQuery.getLastResult(); - - if (lastResult) { - previousResult = lastResult.data; - } - } - - return previousResult; - }; - - return this.dataStore.getCache().watch({ - query: document, - variables: options.variables, - optimistic: true, - previousResult: previousResult, - callback: function (newData) { - _this.setQuery(queryId, function () { - return { - invalidated: true, - newData: newData - }; - }); - } - }); - }; - - QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { - this.setQuery(queryId, function () { - return { - observableQuery: observableQuery - }; - }); - }; - - QueryManager.prototype.removeObservableQuery = function (queryId) { - var cancel = this.getQuery(queryId).cancel; - this.setQuery(queryId, function () { - return { - observableQuery: null - }; - }); - if (cancel) cancel(); - }; - - QueryManager.prototype.clearStore = function () { - this.fetchQueryRejectFns.forEach(function (reject) { - reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(16) : new _tsInvariant.InvariantError('Store reset while query was in flight (not completed in link chain)')); - }); - var resetIds = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) resetIds.push(queryId); - }); - this.queryStore.reset(resetIds); - this.mutationStore.reset(); - return this.dataStore.reset(); - }; - - QueryManager.prototype.resetStore = function () { - var _this = this; - - return this.clearStore().then(function () { - return _this.reFetchObservableQueries(); - }); - }; - - QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { - var _this = this; - - if (includeStandby === void 0) { - includeStandby = false; - } - - var observableQueryPromises = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - - if (observableQuery) { - var fetchPolicy = observableQuery.options.fetchPolicy; - observableQuery.resetLastResults(); - - if (fetchPolicy !== 'cache-only' && (includeStandby || fetchPolicy !== 'standby')) { - observableQueryPromises.push(observableQuery.refetch()); - } - - _this.setQuery(queryId, function () { - return { - newData: null - }; - }); - - _this.invalidate(queryId); - } - }); - this.broadcastQueries(); - return Promise.all(observableQueryPromises); - }; - - QueryManager.prototype.observeQuery = function (queryId, options, observer) { - this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); - return this.fetchQuery(queryId, options); - }; - - QueryManager.prototype.startQuery = function (queryId, options, listener) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("The QueryManager.startQuery method has been deprecated"); - this.addQueryListener(queryId, listener); - this.fetchQuery(queryId, options).catch(function () { - return undefined; - }); - return queryId; - }; - - QueryManager.prototype.startGraphQLSubscription = function (_a) { - var _this = this; - - var query = _a.query, - fetchPolicy = _a.fetchPolicy, - variables = _a.variables; - query = this.transform(query).document; - variables = this.getVariables(query, variables); - - var makeObservable = function (variables) { - return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { - if (!fetchPolicy || fetchPolicy !== 'no-cache') { - _this.dataStore.markSubscriptionResult(result, query, variables); - - _this.broadcastQueries(); - } - - if ((0, _apolloUtilities.graphQLResultHasError)(result)) { - throw new ApolloError({ - graphQLErrors: result.errors - }); - } - - return result; - }); - }; - - if (this.transform(query).hasClientExports) { - var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); - return new Observable(function (observer) { - var sub = null; - observablePromise_1.then(function (observable) { - return sub = observable.subscribe(observer); - }, observer.error); - return function () { - return sub && sub.unsubscribe(); - }; - }); - } - - return makeObservable(variables); - }; - - QueryManager.prototype.stopQuery = function (queryId) { - this.stopQueryNoBroadcast(queryId); - this.broadcastQueries(); - }; - - QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.removeQuery(queryId); - }; - - QueryManager.prototype.removeQuery = function (queryId) { - this.fetchQueryRejectFns.delete("query:" + queryId); - this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); - this.getQuery(queryId).subscriptions.forEach(function (x) { - return x.unsubscribe(); - }); - this.queries.delete(queryId); - }; - - QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { - if (optimistic === void 0) { - optimistic = true; - } - - var _a = observableQuery.options, - variables = _a.variables, - query = _a.query, - fetchPolicy = _a.fetchPolicy, - returnPartialData = _a.returnPartialData; - var lastResult = observableQuery.getLastResult(); - var newData = this.getQuery(observableQuery.queryId).newData; - - if (newData && newData.complete) { - return { - data: newData.result, - partial: false - }; - } - - if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { - return { - data: undefined, - partial: false - }; - } - - var _b = this.dataStore.getCache().diff({ - query: query, - variables: variables, - previousResult: lastResult ? lastResult.data : undefined, - returnPartialData: true, - optimistic: optimistic - }), - result = _b.result, - complete = _b.complete; - - return { - data: complete || returnPartialData ? result : void 0, - partial: !complete - }; - }; - - QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { - var observableQuery; - - if (typeof queryIdOrObservable === 'string') { - var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(foundObserveableQuery, 17) : (0, _tsInvariant.invariant)(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); - observableQuery = foundObserveableQuery; - } else { - observableQuery = queryIdOrObservable; - } - - var _a = observableQuery.options, - variables = _a.variables, - query = _a.query; - return { - previousResult: this.getCurrentQueryResult(observableQuery, false).data, - variables: variables, - document: query - }; - }; - - QueryManager.prototype.broadcastQueries = function () { - var _this = this; - - this.onBroadcast(); - this.queries.forEach(function (info, id) { - if (info.invalidated) { - info.listeners.forEach(function (listener) { - if (listener) { - listener(_this.queryStore.get(id), info.newData); - } - }); - } - }); - }; - - QueryManager.prototype.getLocalState = function () { - return this.localState; - }; - - QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { - var _this = this; - - if (deduplication === void 0) { - deduplication = this.queryDeduplication; - } - - var observable; - var serverQuery = this.transform(query).serverQuery; - - if (serverQuery) { - var _a = this, - inFlightLinkObservables_1 = _a.inFlightLinkObservables, - link = _a.link; - - var operation = { - query: serverQuery, - variables: variables, - operationName: (0, _apolloUtilities.getOperationName)(serverQuery) || void 0, - context: this.prepareContext((0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - forceFetch: !deduplication - })) - }; - context = operation.context; - - if (deduplication) { - var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); - inFlightLinkObservables_1.set(serverQuery, byVariables_1); - var varJson_1 = JSON.stringify(variables); - observable = byVariables_1.get(varJson_1); - - if (!observable) { - byVariables_1.set(varJson_1, observable = multiplex((0, _apolloLink.execute)(link, operation))); - - var cleanup = function () { - byVariables_1.delete(varJson_1); - if (!byVariables_1.size) inFlightLinkObservables_1.delete(serverQuery); - cleanupSub_1.unsubscribe(); - }; - - var cleanupSub_1 = observable.subscribe({ - next: cleanup, - error: cleanup, - complete: cleanup - }); - } - } else { - observable = multiplex((0, _apolloLink.execute)(link, operation)); - } - } else { - observable = Observable.of({ - data: {} - }); - context = this.prepareContext(context); - } - - var clientQuery = this.transform(query).clientQuery; - - if (clientQuery) { - observable = asyncMap(observable, function (result) { - return _this.localState.runResolvers({ - document: clientQuery, - remoteResult: result, - context: context, - variables: variables - }); - }); - } - - return observable; - }; - - QueryManager.prototype.fetchRequest = function (_a) { - var _this = this; - - var requestId = _a.requestId, - queryId = _a.queryId, - document = _a.document, - options = _a.options, - fetchMoreForQueryId = _a.fetchMoreForQueryId; - var variables = options.variables, - _b = options.errorPolicy, - errorPolicy = _b === void 0 ? 'none' : _b, - fetchPolicy = options.fetchPolicy; - var resultFromStore; - var errorsFromStore; - return new Promise(function (resolve, reject) { - var observable = _this.getObservableFromLink(document, options.context, variables); - - var fqrfId = "fetchRequest:" + queryId; - - _this.fetchQueryRejectFns.set(fqrfId, reject); - - var cleanup = function () { - _this.fetchQueryRejectFns.delete(fqrfId); - - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.delete(subscription); - }); - }; - - var subscription = observable.map(function (result) { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - - _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); - - _this.invalidate(queryId); - - _this.invalidate(fetchMoreForQueryId); - - _this.broadcastQueries(); - } - - if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) { - return reject(new ApolloError({ - graphQLErrors: result.errors - })); - } - - if (errorPolicy === 'all') { - errorsFromStore = result.errors; - } - - if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { - resultFromStore = result.data; - } else { - var _a = _this.dataStore.getCache().diff({ - variables: variables, - query: document, - optimistic: false, - returnPartialData: true - }), - result_1 = _a.result, - complete = _a.complete; - - if (complete || options.returnPartialData) { - resultFromStore = result_1; - } - } - }).subscribe({ - error: function (error) { - cleanup(); - reject(error); - }, - complete: function () { - cleanup(); - resolve({ - data: resultFromStore, - errors: errorsFromStore, - loading: false, - networkStatus: NetworkStatus.ready, - stale: false - }); - } - }); - - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.add(subscription); - }); - }); - }; - - QueryManager.prototype.getQuery = function (queryId) { - return this.queries.get(queryId) || { - listeners: new Set(), - invalidated: false, - document: null, - newData: null, - lastRequestId: 1, - observableQuery: null, - subscriptions: new Set() - }; - }; - - QueryManager.prototype.setQuery = function (queryId, updater) { - var prev = this.getQuery(queryId); - var newInfo = (0, _tslib.__assign)((0, _tslib.__assign)({}, prev), updater(prev)); - this.queries.set(queryId, newInfo); - }; - - QueryManager.prototype.invalidate = function (queryId, invalidated) { - if (invalidated === void 0) { - invalidated = true; - } - - if (queryId) { - this.setQuery(queryId, function () { - return { - invalidated: invalidated - }; - }); - } - }; - - QueryManager.prototype.prepareContext = function (context) { - if (context === void 0) { - context = {}; - } - - var newContext = this.localState.prepareContext(context); - return (0, _tslib.__assign)((0, _tslib.__assign)({}, newContext), { - clientAwareness: this.clientAwareness - }); - }; - - QueryManager.prototype.checkInFlight = function (queryId) { - var query = this.queryStore.get(queryId); - return query && query.networkStatus !== NetworkStatus.ready && query.networkStatus !== NetworkStatus.error; - }; - - QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { - var _this = this; - - var pollInterval = options.pollInterval; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(pollInterval, 18) : (0, _tsInvariant.invariant)(pollInterval, 'Attempted to start a polling query without a polling interval.'); - - if (!this.ssrMode) { - var info = this.pollingInfoByQueryId.get(queryId); - - if (!info) { - this.pollingInfoByQueryId.set(queryId, info = {}); - } - - info.interval = pollInterval; - info.options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - fetchPolicy: 'network-only' - }); - - var maybeFetch_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - - if (info) { - if (_this.checkInFlight(queryId)) { - poll_1(); - } else { - _this.fetchQuery(queryId, info.options, FetchType.poll).then(poll_1, poll_1); - } - } - }; - - var poll_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - - if (info) { - clearTimeout(info.timeout); - info.timeout = setTimeout(maybeFetch_1, info.interval); - } - }; - - if (listener) { - this.addQueryListener(queryId, listener); - } - - poll_1(); - } - - return queryId; - }; - - QueryManager.prototype.stopPollingQuery = function (queryId) { - this.pollingInfoByQueryId.delete(queryId); - }; - - return QueryManager; -}(); - -var DataStore = function () { - function DataStore(initialCache) { - this.cache = initialCache; - } - - DataStore.prototype.getCache = function () { - return this.cache; - }; - - DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { - if (ignoreErrors === void 0) { - ignoreErrors = false; - } - - var writeWithErrors = !(0, _apolloUtilities.graphQLResultHasError)(result); - - if (ignoreErrors && (0, _apolloUtilities.graphQLResultHasError)(result) && result.data) { - writeWithErrors = true; - } - - if (!fetchMoreForQueryId && writeWithErrors) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_QUERY', - query: document, - variables: variables - }); - } - }; - - DataStore.prototype.markSubscriptionResult = function (result, document, variables) { - if (!(0, _apolloUtilities.graphQLResultHasError)(result)) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_SUBSCRIPTION', - query: document, - variables: variables - }); - } - }; - - DataStore.prototype.markMutationInit = function (mutation) { - var _this = this; - - if (mutation.optimisticResponse) { - var optimistic_1; - - if (typeof mutation.optimisticResponse === 'function') { - optimistic_1 = mutation.optimisticResponse(mutation.variables); - } else { - optimistic_1 = mutation.optimisticResponse; - } - - this.cache.recordOptimisticTransaction(function (c) { - var orig = _this.cache; - _this.cache = c; - - try { - _this.markMutationResult({ - mutationId: mutation.mutationId, - result: { - data: optimistic_1 - }, - document: mutation.document, - variables: mutation.variables, - updateQueries: mutation.updateQueries, - update: mutation.update - }); - } finally { - _this.cache = orig; - } - }, mutation.mutationId); - } - }; - - DataStore.prototype.markMutationResult = function (mutation) { - var _this = this; - - if (!(0, _apolloUtilities.graphQLResultHasError)(mutation.result)) { - var cacheWrites_1 = [{ - result: mutation.result.data, - dataId: 'ROOT_MUTATION', - query: mutation.document, - variables: mutation.variables - }]; - var updateQueries_1 = mutation.updateQueries; - - if (updateQueries_1) { - Object.keys(updateQueries_1).forEach(function (id) { - var _a = updateQueries_1[id], - query = _a.query, - updater = _a.updater; - - var _b = _this.cache.diff({ - query: query.document, - variables: query.variables, - returnPartialData: true, - optimistic: false - }), - currentQueryResult = _b.result, - complete = _b.complete; - - if (complete) { - var nextQueryResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { - return updater(currentQueryResult, { - mutationResult: mutation.result, - queryName: (0, _apolloUtilities.getOperationName)(query.document) || undefined, - queryVariables: query.variables - }); - }); - - if (nextQueryResult) { - cacheWrites_1.push({ - result: nextQueryResult, - dataId: 'ROOT_QUERY', - query: query.document, - variables: query.variables - }); - } - } - }); - } - - this.cache.performTransaction(function (c) { - cacheWrites_1.forEach(function (write) { - return c.write(write); - }); - var update = mutation.update; - - if (update) { - (0, _apolloUtilities.tryFunctionOrLogError)(function () { - return update(c, mutation.result); - }); - } - }); - } - }; - - DataStore.prototype.markMutationComplete = function (_a) { - var mutationId = _a.mutationId, - optimisticResponse = _a.optimisticResponse; - - if (optimisticResponse) { - this.cache.removeOptimistic(mutationId); - } - }; - - DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { - this.cache.write({ - result: newResult, - dataId: 'ROOT_QUERY', - variables: variables, - query: document - }); - }; - - DataStore.prototype.reset = function () { - return this.cache.reset(); - }; - - return DataStore; -}(); - -var version = "2.6.10"; -var hasSuggestedDevtools = false; - -var ApolloClient = function () { - function ApolloClient(options) { - var _this = this; - - this.defaultOptions = {}; - this.resetStoreCallbacks = []; - this.clearStoreCallbacks = []; - var cache = options.cache, - _a = options.ssrMode, - ssrMode = _a === void 0 ? false : _a, - _b = options.ssrForceFetchDelay, - ssrForceFetchDelay = _b === void 0 ? 0 : _b, - connectToDevTools = options.connectToDevTools, - _c = options.queryDeduplication, - queryDeduplication = _c === void 0 ? true : _c, - defaultOptions = options.defaultOptions, - _d = options.assumeImmutableResults, - assumeImmutableResults = _d === void 0 ? false : _d, - resolvers = options.resolvers, - typeDefs = options.typeDefs, - fragmentMatcher = options.fragmentMatcher, - clientAwarenessName = options.name, - clientAwarenessVersion = options.version; - var link = options.link; - - if (!link && resolvers) { - link = _apolloLink.ApolloLink.empty(); - } - - if (!link || !cache) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(4) : new _tsInvariant.InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); - } - - this.link = link; - this.cache = cache; - this.store = new DataStore(cache); - this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; - this.queryDeduplication = queryDeduplication; - this.defaultOptions = defaultOptions || {}; - this.typeDefs = typeDefs; - - if (ssrForceFetchDelay) { - setTimeout(function () { - return _this.disableNetworkFetches = false; - }, ssrForceFetchDelay); - } - - this.watchQuery = this.watchQuery.bind(this); - this.query = this.query.bind(this); - this.mutate = this.mutate.bind(this); - this.resetStore = this.resetStore.bind(this); - this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); - var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && !window.__APOLLO_CLIENT__; - - if (typeof connectToDevTools === 'undefined' ? defaultConnectToDevTools : connectToDevTools && typeof window !== 'undefined') { - window.__APOLLO_CLIENT__ = this; - } - - if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { - hasSuggestedDevtools = true; - - if (typeof window !== 'undefined' && window.document && window.top === window.self) { - if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { - if (window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('Chrome') > -1) { - console.debug('Download the Apollo DevTools ' + 'for a better development experience: ' + 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); - } - } - } - } - - this.version = version; - this.localState = new LocalState({ - cache: cache, - client: this, - resolvers: resolvers, - fragmentMatcher: fragmentMatcher - }); - this.queryManager = new QueryManager({ - link: this.link, - store: this.store, - queryDeduplication: queryDeduplication, - ssrMode: ssrMode, - clientAwareness: { - name: clientAwarenessName, - version: clientAwarenessVersion - }, - localState: this.localState, - assumeImmutableResults: assumeImmutableResults, - onBroadcast: function () { - if (_this.devToolsHookCb) { - _this.devToolsHookCb({ - action: {}, - state: { - queries: _this.queryManager.queryStore.getStore(), - mutations: _this.queryManager.mutationStore.getStore() - }, - dataWithOptimisticResults: _this.cache.extract(true) - }); - } - } - }); - } - - ApolloClient.prototype.stop = function () { - this.queryManager.stop(); - }; - - ApolloClient.prototype.watchQuery = function (options) { - if (this.defaultOptions.watchQuery) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.defaultOptions.watchQuery), options); - } - - if (this.disableNetworkFetches && (options.fetchPolicy === 'network-only' || options.fetchPolicy === 'cache-and-network')) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - fetchPolicy: 'cache-first' - }); - } - - return this.queryManager.watchQuery(options); - }; - - ApolloClient.prototype.query = function (options) { - if (this.defaultOptions.query) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.defaultOptions.query), options); - } - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 5) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + 'client.query can only return a single result. Please use client.watchQuery ' + 'to receive multiple results from the cache and the network, or consider ' + 'using a different fetchPolicy, such as cache-first or network-only.'); - - if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - fetchPolicy: 'cache-first' - }); - } - - return this.queryManager.query(options); - }; - - ApolloClient.prototype.mutate = function (options) { - if (this.defaultOptions.mutate) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.defaultOptions.mutate), options); - } - - return this.queryManager.mutate(options); - }; - - ApolloClient.prototype.subscribe = function (options) { - return this.queryManager.startGraphQLSubscription(options); - }; - - ApolloClient.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.cache.readQuery(options, optimistic); - }; - - ApolloClient.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.cache.readFragment(options, optimistic); - }; - - ApolloClient.prototype.writeQuery = function (options) { - var result = this.cache.writeQuery(options); - this.queryManager.broadcastQueries(); - return result; - }; - - ApolloClient.prototype.writeFragment = function (options) { - var result = this.cache.writeFragment(options); - this.queryManager.broadcastQueries(); - return result; - }; - - ApolloClient.prototype.writeData = function (options) { - var result = this.cache.writeData(options); - this.queryManager.broadcastQueries(); - return result; - }; - - ApolloClient.prototype.__actionHookForDevTools = function (cb) { - this.devToolsHookCb = cb; - }; - - ApolloClient.prototype.__requestRaw = function (payload) { - return (0, _apolloLink.execute)(this.link, payload); - }; - - ApolloClient.prototype.initQueryManager = function () { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Calling the initQueryManager method is no longer necessary, ' + 'and it will be removed from ApolloClient in version 3.0.'); - return this.queryManager; - }; - - ApolloClient.prototype.resetStore = function () { - var _this = this; - - return Promise.resolve().then(function () { - return _this.queryManager.clearStore(); - }).then(function () { - return Promise.all(_this.resetStoreCallbacks.map(function (fn) { - return fn(); - })); - }).then(function () { - return _this.reFetchObservableQueries(); - }); - }; - - ApolloClient.prototype.clearStore = function () { - var _this = this; - - return Promise.resolve().then(function () { - return _this.queryManager.clearStore(); - }).then(function () { - return Promise.all(_this.clearStoreCallbacks.map(function (fn) { - return fn(); - })); - }); - }; - - ApolloClient.prototype.onResetStore = function (cb) { - var _this = this; - - this.resetStoreCallbacks.push(cb); - return function () { - _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { - return c !== cb; - }); - }; - }; - - ApolloClient.prototype.onClearStore = function (cb) { - var _this = this; - - this.clearStoreCallbacks.push(cb); - return function () { - _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { - return c !== cb; - }); - }; - }; - - ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { - return this.queryManager.reFetchObservableQueries(includeStandby); - }; - - ApolloClient.prototype.extract = function (optimistic) { - return this.cache.extract(optimistic); - }; - - ApolloClient.prototype.restore = function (serializedState) { - return this.cache.restore(serializedState); - }; - - ApolloClient.prototype.addResolvers = function (resolvers) { - this.localState.addResolvers(resolvers); - }; - - ApolloClient.prototype.setResolvers = function (resolvers) { - this.localState.setResolvers(resolvers); - }; - - ApolloClient.prototype.getResolvers = function () { - return this.localState.getResolvers(); - }; - - ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { - this.localState.setFragmentMatcher(fragmentMatcher); - }; - - return ApolloClient; -}(); - -exports.ApolloClient = ApolloClient; -var _default = ApolloClient; - -exports.default = _default; diff --git a/node_modules/apollo-client/bundle.cjs.js.map b/node_modules/apollo-client/bundle.cjs.js.map deleted file mode 100644 index bc74e9e..0000000 --- a/node_modules/apollo-client/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/core/networkStatus.ts","../src/util/Observable.ts","../src/util/arrays.ts","../src/errors/ApolloError.ts","../src/core/types.ts","../src/core/ObservableQuery.ts","../src/data/mutations.ts","../src/data/queries.ts","../src/util/capitalizeFirstLetter.ts","../src/core/LocalState.ts","../src/util/observables.ts","../src/core/QueryManager.ts","../src/data/store.ts","../src/version.ts","../src/ApolloClient.ts"],"names":["LinkObservable"],"mappings":";;;;;;;;;;;;;;;;;;;;IAGY,a;;;AAAZ,CAAA,UAAY,aAAZ,EAAyB;AAMvB,EAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMA,EAAA,aAAA,CAAA,aAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAA;AAMA,EAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAA;AAMA,EAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAOA,EAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA;AAKA,EAAA,aAAA,CAAA,aAAA,CAAA,OAAA,CAAA,GAA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A,EAAC;AAAI,eAAA,CAAC,KAAK,EAAN;AAAQ,OAA7C,CAA3B;AACD,KAFD;AAGD,GALM;;AAmBA,EAAA,YAAA,CAAA,SAAA,CAAA,wBAAA,GAAP,UACE,cADF,EAC0B;AAExB,WAAO,KAAK,YAAL,CAAkB,wBAAlB,CAA2C,cAA3C,CAAP;AACD,GAJM;;AASA,EAAA,YAAA,CAAA,SAAA,CAAA,OAAA,GAAP,UAAe,UAAf,EAAmC;AACjC,WAAO,KAAK,KAAL,CAAW,OAAX,CAAmB,UAAnB,CAAP;AACD,GAFM;;AAWA,EAAA,YAAA,CAAA,SAAA,CAAA,OAAA,GAAP,UAAe,eAAf,EAA2C;AACzC,WAAO,KAAK,KAAL,CAAW,OAAX,CAAmB,eAAnB,CAAP;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,SAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,SAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,YAAA;AACE,WAAO,KAAK,UAAL,CAAgB,YAAhB,EAAP;AACD,GAFM;;AAOA,EAAA,YAAA,CAAA,SAAA,CAAA,4BAAA,GAAP,UAAoC,eAApC,EAAoE;AAClE,SAAK,UAAL,CAAgB,kBAAhB,CAAmC,eAAnC;AACD,GAFM;;AAGT,SAAA,YAAA;AAAC,CA3gBD,EAAA","sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus: NetworkStatus,\n): boolean {\n return networkStatus < 7;\n}\n","// This simplified polyfill attempts to follow the ECMAScript Observable proposal.\n// See https://github.com/zenparsing/es-observable\nimport { Observable as LinkObservable } from 'apollo-link';\n\nexport type Subscription = ZenObservable.Subscription;\nexport type Observer = ZenObservable.Observer;\n\nimport $$observable from 'symbol-observable';\n\n// rxjs interopt\nexport class Observable extends LinkObservable {\n public [$$observable]() {\n return this;\n }\n\n public ['@@observable' as any]() {\n return this;\n }\n}\n","export function isNonEmptyArray(value?: ArrayLike): value is Array {\n return Array.isArray(value) && value.length > 0;\n}\n","import { GraphQLError } from 'graphql';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `GraphQL error: ${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += 'Network error: ' + err.networkError.message + '\\n';\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray;\n public networkError: Error | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n\n if (!errorMessage) {\n this.message = generateErrorMessage(this);\n } else {\n this.message = errorMessage;\n }\n\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","import { FetchResult } from 'apollo-link';\nimport { DocumentNode, GraphQLError } from 'graphql';\n\nimport { QueryStoreValue } from '../data/queries';\nimport { NetworkStatus } from './networkStatus';\nimport { Resolver } from './LocalState';\n\nexport type QueryListener = (\n queryStoreValue: QueryStoreValue,\n newData?: any,\n forceResolvers?: boolean,\n) => void;\n\nexport type OperationVariables = { [key: string]: any };\n\nexport type PureQueryOptions = {\n query: DocumentNode;\n variables?: { [key: string]: any };\n context?: any;\n};\n\nexport type ApolloQueryResult = {\n data: T;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n stale: boolean;\n};\n\nexport enum FetchType {\n normal = 1,\n refetch = 2,\n poll = 3,\n}\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer = (\n previousResult: Record,\n options: {\n mutationResult: FetchResult;\n queryName: string | undefined;\n queryVariables: Record;\n },\n) => Record;\n\nexport type MutationQueryReducersMap = {\n [queryName: string]: MutationQueryReducer;\n};\n\nexport interface Resolvers {\n [key: string]: {\n [ field: string ]: Resolver;\n };\n}\n","import {\n isEqual,\n tryFunctionOrLogError,\n cloneDeep,\n getOperationDefinition,\n} from 'apollo-utilities';\nimport { GraphQLError } from 'graphql';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport { Observable, Observer, Subscription } from '../util/Observable';\nimport { ApolloError } from '../errors/ApolloError';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, FetchType, OperationVariables } from './types';\nimport {\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\n\nimport { QueryStoreValue } from '../data/queries';\n\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isNonEmptyArray } from '../util/arrays';\n\n// XXX remove in the next breaking semver change (3.0)\n// Deprecated, use ApolloCurrentQueryResult\nexport type ApolloCurrentResult = {\n data: T | {};\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n};\n\nexport type ApolloCurrentQueryResult = {\n data: T | undefined;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n stale?: boolean;\n};\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions {\n variables?: TVariables;\n}\n\nexport const hasError = (\n storeValue: QueryStoreValue,\n policy: ErrorPolicy = 'none',\n) => storeValue && (\n storeValue.networkError ||\n (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))\n);\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable> {\n public options: WatchQueryOptions;\n public readonly queryId: string;\n public readonly queryName?: string;\n /**\n *\n * The current value of the variables for this query. Can change.\n */\n public variables: TVariables;\n\n private shouldSubscribe: boolean;\n private isTornDown: boolean;\n private queryManager: QueryManager;\n private observers = new Set>>();\n private subscriptions = new Set();\n\n private lastResult: ApolloQueryResult;\n private lastResultSnapshot: ApolloQueryResult;\n private lastError: ApolloError;\n\n constructor({\n queryManager,\n options,\n shouldSubscribe = true,\n }: {\n queryManager: QueryManager;\n options: WatchQueryOptions;\n shouldSubscribe?: boolean;\n }) {\n super((observer: Observer>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.variables = options.variables || ({} as TVariables);\n this.queryId = queryManager.generateQueryId();\n this.shouldSubscribe = shouldSubscribe;\n\n const opDef = getOperationDefinition(options.query);\n this.queryName = opDef && opDef.name && opDef.name.value;\n\n // related classes\n this.queryManager = queryManager;\n }\n\n public result(): Promise> {\n return new Promise((resolve, reject) => {\n const observer: Observer> = {\n next: (result: ApolloQueryResult) => {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n this.observers.delete(observer);\n if (!this.observers.size) {\n this.queryManager.removeQuery(this.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n const subscription = this.subscribe(observer);\n });\n }\n\n // XXX remove in the next breaking semver change (3.0)\n // Deprecated, use getCurrentResult()\n public currentResult(): ApolloCurrentResult {\n const result = this.getCurrentResult() as ApolloCurrentResult;\n if (result.data === undefined) {\n result.data = {};\n }\n return result;\n }\n\n /**\n * Return the result of the query from the local cache as well as some fetching status\n * `loading` and `networkStatus` allow to know if a request is in flight\n * `partial` lets you know if the result from the local cache is complete or partial\n * @return {data: Object, error: ApolloError, loading: boolean, networkStatus: number, partial: boolean}\n */\n public getCurrentResult(): ApolloCurrentQueryResult {\n if (this.isTornDown) {\n const { lastResult } = this;\n return {\n data: !this.lastError && lastResult && lastResult.data || void 0,\n error: this.lastError,\n loading: false,\n networkStatus: NetworkStatus.error,\n };\n }\n\n const { data, partial } = this.queryManager.getCurrentQueryResult(this);\n const queryStoreValue = this.queryManager.queryStore.get(this.queryId);\n let result: ApolloQueryResult;\n\n const { fetchPolicy } = this.options;\n\n const isNetworkFetchPolicy =\n fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache';\n\n if (queryStoreValue) {\n const { networkStatus } = queryStoreValue;\n\n if (hasError(queryStoreValue, this.options.errorPolicy)) {\n return {\n data: void 0,\n loading: false,\n networkStatus,\n error: new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }),\n };\n }\n\n // Variables might have been added dynamically at query time, when\n // using `@client @export(as: \"varname\")` for example. When this happens,\n // the variables have been updated in the query store, but not updated on\n // the original `ObservableQuery`. We'll update the observable query\n // variables here to match, so retrieving from the cache doesn't fail.\n if (queryStoreValue.variables) {\n this.options.variables = {\n ...this.options.variables,\n ...(queryStoreValue.variables as TVariables),\n };\n this.variables = this.options.variables;\n }\n\n result = {\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n } as ApolloQueryResult;\n\n if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') {\n result.errors = queryStoreValue.graphQLErrors;\n }\n\n } else {\n // We need to be careful about the loading state we show to the user, to try\n // and be vaguely in line with what the user would have seen from .subscribe()\n // but to still provide useful information synchronously when the query\n // will not end up hitting the server.\n // See more: https://github.com/apollostack/apollo-client/issues/707\n // Basically: is there a query in flight right now (modolo the next tick)?\n const loading = isNetworkFetchPolicy ||\n (partial && fetchPolicy !== 'cache-only');\n\n result = {\n data,\n loading,\n networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready,\n } as ApolloQueryResult;\n }\n\n if (!partial) {\n this.updateLastResult({ ...result, stale: false });\n }\n\n return { ...result, partial };\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult) {\n const { lastResultSnapshot: snapshot } = this;\n return !(\n snapshot &&\n newResult &&\n snapshot.networkStatus === newResult.networkStatus &&\n snapshot.stale === newResult.stale &&\n isEqual(snapshot.data, newResult.data)\n );\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.\n public getLastResult(): ApolloQueryResult {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n public resetQueryStoreErrors() {\n const queryStore = this.queryManager.queryStore.get(this.queryId);\n if (queryStore) {\n queryStore.networkError = null;\n queryStore.graphQLErrors = [];\n }\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: TVariables): Promise> {\n let { fetchPolicy } = this.options;\n // early return if trying to read from cache during refetch\n if (fetchPolicy === 'cache-only') {\n return Promise.reject(new InvariantError(\n 'cache-only fetchPolicy option should not be used together with query refetch.',\n ));\n }\n\n // Unless the provided fetchPolicy always consults the network\n // (no-cache, network-only, or cache-and-network), override it with\n // network-only to force the refetch for this fetchQuery call.\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n fetchPolicy = 'network-only';\n }\n\n if (!isEqual(this.variables, variables)) {\n // update observable variables\n this.variables = {\n ...this.variables,\n ...variables,\n };\n }\n\n if (!isEqual(this.options.variables, this.variables)) {\n // Update the existing options with new variables\n this.options.variables = {\n ...this.options.variables,\n ...this.variables,\n };\n }\n\n return this.queryManager.fetchQuery(\n this.queryId,\n { ...this.options, fetchPolicy },\n FetchType.refetch,\n ) as Promise>;\n }\n\n public fetchMore(\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ): Promise> {\n // early return if no update Query\n invariant(\n fetchMoreOptions.updateQuery,\n 'updateQuery option is required. This function defines how to update the query data with the new results.',\n );\n\n const combinedOptions = {\n ...(fetchMoreOptions.query ? fetchMoreOptions : {\n ...this.options,\n ...fetchMoreOptions,\n variables: {\n ...this.variables,\n ...fetchMoreOptions.variables,\n },\n }),\n fetchPolicy: 'network-only',\n } as WatchQueryOptions;\n\n const qid = this.queryManager.generateQueryId();\n\n return this.queryManager\n .fetchQuery(\n qid,\n combinedOptions,\n FetchType.normal,\n this.queryId,\n )\n .then(\n fetchMoreResult => {\n this.updateQuery((previousResult: any) =>\n fetchMoreOptions.updateQuery(previousResult, {\n fetchMoreResult: fetchMoreResult.data as TData,\n variables: combinedOptions.variables as TVariables,\n }),\n );\n this.queryManager.stopQuery(qid);\n return fetchMoreResult as ApolloQueryResult;\n },\n error => {\n this.queryManager.stopQuery(qid);\n throw error;\n },\n );\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n const { updateQuery } = options;\n if (updateQuery) {\n this.updateQuery(\n (previous, { variables }) =>\n updateQuery(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptions.add(subscription);\n\n return () => {\n if (this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n }\n\n // Note: if the query is not active (there are no subscribers), the promise\n // will return null immediately.\n public setOptions(\n opts: WatchQueryOptions,\n ): Promise | void> {\n const { fetchPolicy: oldFetchPolicy } = this.options;\n this.options = {\n ...this.options,\n ...opts,\n } as WatchQueryOptions;\n\n if (opts.pollInterval) {\n this.startPolling(opts.pollInterval);\n } else if (opts.pollInterval === 0) {\n this.stopPolling();\n }\n\n const { fetchPolicy } = opts;\n\n return this.setVariables(\n this.options.variables as TVariables,\n // Try to fetch the query if fetchPolicy changed from either cache-only\n // or standby to something else, or changed to network-only.\n oldFetchPolicy !== fetchPolicy && (\n oldFetchPolicy === 'cache-only' ||\n oldFetchPolicy === 'standby' ||\n fetchPolicy === 'network-only'\n ),\n opts.fetchResults,\n );\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n *\n * @param fetchResults: Option to ignore fetching results when updating variables\n */\n public setVariables(\n variables: TVariables,\n tryFetch: boolean = false,\n fetchResults = true,\n ): Promise | void> {\n // since setVariables restarts the subscription, we reset the tornDown status\n this.isTornDown = false;\n\n variables = variables || this.variables;\n\n if (!tryFetch && isEqual(variables, this.variables)) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n return this.observers.size && fetchResults\n ? this.result()\n : Promise.resolve();\n }\n\n this.variables = this.options.variables = variables;\n\n // See comment above\n if (!this.observers.size) {\n return Promise.resolve();\n }\n\n // Use the same options as before, but with new variables\n return this.queryManager.fetchQuery(\n this.queryId,\n this.options,\n ) as Promise>;\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions,\n ) => TData,\n ): void {\n const { queryManager } = this;\n const {\n previousResult,\n variables,\n document,\n } = queryManager.getQueryWithPreviousResult(\n this.queryId,\n );\n\n const newResult = tryFunctionOrLogError(() =>\n mapFn(previousResult, { variables }),\n );\n\n if (newResult) {\n queryManager.dataStore.markUpdateQueryResult(\n document,\n variables,\n newResult,\n );\n queryManager.broadcastQueries();\n }\n }\n\n public stopPolling() {\n this.queryManager.stopPollingQuery(this.queryId);\n this.options.pollInterval = undefined;\n }\n\n public startPolling(pollInterval: number) {\n assertNotCacheFirstOrOnly(this);\n this.options.pollInterval = pollInterval;\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n private updateLastResult(newResult: ApolloQueryResult) {\n const previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n return previousResult;\n }\n\n private onSubscribe(observer: Observer>) {\n // Zen Observable has its own error function, so in order to log correctly\n // we need to provide a custom error callback.\n try {\n var subObserver = (observer as any)._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n } catch {}\n\n const first = !this.observers.size;\n this.observers.add(observer);\n\n // Deliver initial result\n if (observer.next && this.lastResult) observer.next(this.lastResult);\n if (observer.error && this.lastError) observer.error(this.lastError);\n\n // setup the query if it hasn't been done before\n if (first) {\n this.setUpQuery();\n }\n\n return () => {\n if (this.observers.delete(observer) && !this.observers.size) {\n this.tearDownQuery();\n }\n };\n }\n\n private setUpQuery() {\n const { queryManager, queryId } = this;\n\n if (this.shouldSubscribe) {\n queryManager.addObservableQuery(queryId, this);\n }\n\n if (this.options.pollInterval) {\n assertNotCacheFirstOrOnly(this);\n queryManager.startPollingQuery(this.options, queryId);\n }\n\n const onError = (error: ApolloError) => {\n // Since we don't get the current result on errors, only the error, we\n // must mirror the updates that occur in QueryStore.markQueryError here\n this.updateLastResult({\n ...this.lastResult,\n errors: error.graphQLErrors,\n networkStatus: NetworkStatus.error,\n loading: false,\n });\n iterateObserversSafely(this.observers, 'error', this.lastError = error);\n };\n\n queryManager.observeQuery(queryId, this.options, {\n next: (result: ApolloQueryResult) => {\n if (this.lastError || this.isDifferentFromLastResult(result)) {\n const previousResult = this.updateLastResult(result);\n const { query, variables, fetchPolicy } = this.options;\n\n // Before calling `next` on each observer, we need to first see if\n // the query is using `@client @export` directives, and update\n // any variables that might have changed. If `@export` variables have\n // changed, and the query is calling against both local and remote\n // data, a refetch is needed to pull in new data, using the\n // updated `@export` variables.\n if (queryManager.transform(query).hasClientExports) {\n queryManager.getLocalState().addExportedVariables(\n query,\n variables,\n ).then((variables: TVariables) => {\n const previousVariables = this.variables;\n this.variables = this.options.variables = variables;\n if (\n !result.loading &&\n previousResult &&\n fetchPolicy !== 'cache-only' &&\n queryManager.transform(query).serverQuery &&\n !isEqual(previousVariables, variables)\n ) {\n this.refetch();\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n });\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n }\n },\n error: onError,\n }).catch(onError);\n }\n\n private tearDownQuery() {\n const { queryManager } = this;\n\n this.isTornDown = true;\n queryManager.stopPollingQuery(this.queryId);\n\n // stop all active GraphQL subscriptions\n this.subscriptions.forEach(sub => sub.unsubscribe());\n this.subscriptions.clear();\n\n queryManager.removeObservableQuery(this.queryId);\n queryManager.stopQuery(this.queryId);\n\n this.observers.clear();\n }\n}\n\nfunction defaultSubscriptionObserverErrorCallback(error: ApolloError) {\n invariant.error('Unhandled error', error.message, error.stack);\n}\n\nfunction iterateObserversSafely(\n observers: Set>,\n method: keyof Observer,\n argument?: A,\n) {\n // In case observers is modified during iteration, we need to commit to the\n // original elements, which also provides an opportunity to filter them down\n // to just the observers with the given method.\n const observersWithMethod: Observer[] = [];\n observers.forEach(obs => obs[method] && observersWithMethod.push(obs));\n observersWithMethod.forEach(obs => (obs as any)[method](argument));\n}\n\nfunction assertNotCacheFirstOrOnly(\n obsQuery: ObservableQuery,\n) {\n const { fetchPolicy } = obsQuery.options;\n invariant(\n fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only',\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n}\n","import { DocumentNode } from 'graphql';\n\nexport class MutationStore {\n private store: { [mutationId: string]: MutationStoreValue } = {};\n\n public getStore(): { [mutationId: string]: MutationStoreValue } {\n return this.store;\n }\n\n public get(mutationId: string): MutationStoreValue {\n return this.store[mutationId];\n }\n\n public initMutation(\n mutationId: string,\n mutation: DocumentNode,\n variables: Object | undefined,\n ) {\n this.store[mutationId] = {\n mutation,\n variables: variables || {},\n loading: true,\n error: null,\n };\n }\n\n public markMutationError(mutationId: string, error: Error) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = error;\n }\n }\n\n public markMutationResult(mutationId: string) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = null;\n }\n }\n\n public reset() {\n this.store = {};\n }\n}\n\nexport interface MutationStoreValue {\n mutation: DocumentNode;\n variables: Object;\n loading: boolean;\n error: Error | null;\n}\n","import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';\nimport { isEqual } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\nimport { NetworkStatus } from '../core/networkStatus';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport type QueryStoreValue = {\n document: DocumentNode;\n variables: Object;\n previousVariables?: Object | null;\n networkStatus: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray;\n metadata: any;\n};\n\nexport class QueryStore {\n private store: { [queryId: string]: QueryStoreValue } = {};\n\n public getStore(): { [queryId: string]: QueryStoreValue } {\n return this.store;\n }\n\n public get(queryId: string): QueryStoreValue {\n return this.store[queryId];\n }\n\n public initQuery(query: {\n queryId: string;\n document: DocumentNode;\n storePreviousVariables: boolean;\n variables: Object;\n isPoll: boolean;\n isRefetch: boolean;\n metadata: any;\n fetchMoreForQueryId: string | undefined;\n }) {\n const previousQuery = this.store[query.queryId];\n\n // XXX we're throwing an error here to catch bugs where a query gets overwritten by a new one.\n // we should implement a separate action for refetching so that QUERY_INIT may never overwrite\n // an existing query (see also: https://github.com/apollostack/apollo-client/issues/732)\n invariant(\n !previousQuery ||\n previousQuery.document === query.document ||\n isEqual(previousQuery.document, query.document),\n 'Internal Error: may not update existing query string in store',\n );\n\n let isSetVariables = false;\n\n let previousVariables: Object | null = null;\n if (\n query.storePreviousVariables &&\n previousQuery &&\n previousQuery.networkStatus !== NetworkStatus.loading\n // if the previous query was still loading, we don't want to remember it at all.\n ) {\n if (!isEqual(previousQuery.variables, query.variables)) {\n isSetVariables = true;\n previousVariables = previousQuery.variables;\n }\n }\n\n // TODO break this out into a separate function\n let networkStatus;\n if (isSetVariables) {\n networkStatus = NetworkStatus.setVariables;\n } else if (query.isPoll) {\n networkStatus = NetworkStatus.poll;\n } else if (query.isRefetch) {\n networkStatus = NetworkStatus.refetch;\n // TODO: can we determine setVariables here if it's a refetch and the variables have changed?\n } else {\n networkStatus = NetworkStatus.loading;\n }\n\n let graphQLErrors: ReadonlyArray = [];\n if (previousQuery && previousQuery.graphQLErrors) {\n graphQLErrors = previousQuery.graphQLErrors;\n }\n\n // XXX right now if QUERY_INIT is fired twice, like in a refetch situation, we just overwrite\n // the store. We probably want a refetch action instead, because I suspect that if you refetch\n // before the initial fetch is done, you'll get an error.\n this.store[query.queryId] = {\n document: query.document,\n variables: query.variables,\n previousVariables,\n networkError: null,\n graphQLErrors: graphQLErrors,\n networkStatus,\n metadata: query.metadata,\n };\n\n // If the action had a `moreForQueryId` property then we need to set the\n // network status on that query as well to `fetchMore`.\n //\n // We have a complement to this if statement in the query result and query\n // error action branch, but importantly *not* in the client result branch.\n // This is because the implementation of `fetchMore` *always* sets\n // `fetchPolicy` to `network-only` so we would never have a client result.\n if (\n typeof query.fetchMoreForQueryId === 'string' &&\n this.store[query.fetchMoreForQueryId]\n ) {\n this.store[query.fetchMoreForQueryId].networkStatus =\n NetworkStatus.fetchMore;\n }\n }\n\n public markQueryResult(\n queryId: string,\n result: ExecutionResult,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = NetworkStatus.ready;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (\n typeof fetchMoreForQueryId === 'string' &&\n this.store[fetchMoreForQueryId]\n ) {\n this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready;\n }\n }\n\n public markQueryError(\n queryId: string,\n error: Error,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = error;\n this.store[queryId].networkStatus = NetworkStatus.error;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (typeof fetchMoreForQueryId === 'string') {\n this.markQueryResultClient(fetchMoreForQueryId, true);\n }\n }\n\n public markQueryResultClient(queryId: string, complete: boolean) {\n const storeValue = this.store && this.store[queryId];\n if (storeValue) {\n storeValue.networkError = null;\n storeValue.previousVariables = null;\n if (complete) {\n storeValue.networkStatus = NetworkStatus.ready;\n }\n }\n }\n\n public stopQuery(queryId: string) {\n delete this.store[queryId];\n }\n\n public reset(observableQueryIds: string[]) {\n Object.keys(this.store).forEach(queryId => {\n if (observableQueryIds.indexOf(queryId) < 0) {\n this.stopQuery(queryId);\n } else {\n // XXX set loading to true so listeners don't trigger unless they want results with partial data\n this.store[queryId].networkStatus = NetworkStatus.loading;\n }\n });\n }\n}\n","export function capitalizeFirstLetter(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n SelectionNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n FieldNode,\n ASTNode,\n} from 'graphql';\nimport { visit, BREAK } from 'graphql/language/visitor';\n\nimport { ApolloCache } from 'apollo-cache';\nimport {\n getMainDefinition,\n buildQueryFromSelectionSet,\n hasDirectives,\n removeClientSetsFromDocument,\n mergeDeep,\n mergeDeepArray,\n FragmentMap,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getFragmentDefinitions,\n createFragmentMap,\n shouldInclude,\n isField,\n isInlineFragment,\n} from 'apollo-utilities';\nimport { FetchResult } from 'apollo-link';\n\nimport { invariant } from 'ts-invariant';\n\nimport ApolloClient from '../ApolloClient';\nimport { Resolvers, OperationVariables } from './types';\nimport { capitalizeFirstLetter } from '../util/capitalizeFirstLetter';\n\nexport type Resolver = (\n rootValue?: any,\n args?: any,\n context?: any,\n info?: {\n field: FieldNode;\n fragmentMap: FragmentMap;\n },\n) => any;\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: any,\n) => boolean;\n\nexport type ExecContext = {\n fragmentMap: FragmentMap;\n context: any;\n variables: VariableMap;\n fragmentMatcher: FragmentMatcher;\n defaultOperationType: string;\n exportedVariables: Record;\n onlyRunForcedResolvers: boolean;\n};\n\nexport type LocalStateOptions = {\n cache: ApolloCache;\n client?: ApolloClient;\n resolvers?: Resolvers | Resolvers[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport class LocalState {\n private cache: ApolloCache;\n private client: ApolloClient;\n private resolvers?: Resolvers;\n private fragmentMatcher: FragmentMatcher;\n\n constructor({\n cache,\n client,\n resolvers,\n fragmentMatcher,\n }: LocalStateOptions) {\n this.cache = cache;\n\n if (client) {\n this.client = client;\n }\n\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(resolverGroup => {\n this.resolvers = mergeDeep(this.resolvers, resolverGroup);\n });\n } else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n }\n\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n }\n\n public getResolvers() {\n return this.resolvers || {};\n }\n\n // Run local client resolvers against the incoming query and remote data.\n // Locally resolved field values are merged with the incoming remote data,\n // and returned. Note that locally resolved fields will overwrite\n // remote data using the same field name.\n public async runResolvers({\n document,\n remoteResult,\n context,\n variables,\n onlyRunForcedResolvers = false,\n }: {\n document: DocumentNode | null;\n remoteResult: FetchResult;\n context?: Record;\n variables?: Record;\n onlyRunForcedResolvers?: boolean;\n }): Promise> {\n if (document) {\n return this.resolveDocument(\n document,\n remoteResult.data,\n context,\n variables,\n this.fragmentMatcher,\n onlyRunForcedResolvers,\n ).then(localResult => ({\n ...remoteResult,\n data: localResult.result,\n }));\n }\n\n return remoteResult;\n }\n\n public setFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n }\n\n public getFragmentMatcher(): FragmentMatcher {\n return this.fragmentMatcher;\n }\n\n // Client queries contain everything in the incoming document (if a @client\n // directive is found).\n public clientQuery(document: DocumentNode) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n invariant.warn(\n 'Found @client directives in a query but no ApolloClient resolvers ' +\n 'were specified. This means ApolloClient local resolver handling ' +\n 'has been disabled, and @client directives will be passed through ' +\n 'to your link chain.',\n );\n }\n return null;\n }\n\n // Server queries are stripped of all @client based selection sets.\n public serverQuery(document: DocumentNode) {\n return this.resolvers ? removeClientSetsFromDocument(document) : document;\n }\n\n public prepareContext(context = {}) {\n const { cache } = this;\n\n const newContext = {\n ...context,\n cache,\n // Getting an entry's cache key is useful for local state resolvers.\n getCacheKey: (obj: { __typename: string; id: string | number }) => {\n if ((cache as any).config) {\n return (cache as any).config.dataIdFromObject(obj);\n } else {\n invariant(false,\n 'To use context.getCacheKey, you need to use a cache that has ' +\n 'a configurable dataIdFromObject, like apollo-cache-inmemory.',\n );\n }\n },\n };\n\n return newContext;\n }\n\n // To support `@client @export(as: \"someVar\")` syntax, we'll first resolve\n // @client @export fields locally, then pass the resolved values back to be\n // used alongside the original operation variables.\n public async addExportedVariables(\n document: DocumentNode,\n variables: OperationVariables = {},\n context = {},\n ) {\n if (document) {\n return this.resolveDocument(\n document,\n this.buildRootValueFromCache(document, variables) || {},\n this.prepareContext(context),\n variables,\n ).then(data => ({\n ...variables,\n ...data.exportedVariables,\n }));\n }\n\n return {\n ...variables,\n };\n }\n\n public shouldForceResolvers(document: ASTNode) {\n let forceResolvers = false;\n visit(document, {\n Directive: {\n enter(node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(\n arg =>\n arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true,\n );\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n }\n\n // Query the cache and return matching data.\n private buildRootValueFromCache(\n document: DocumentNode,\n variables?: Record,\n ) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n }\n\n private async resolveDocument(\n document: DocumentNode,\n rootValue: TData,\n context: any = {},\n variables: VariableMap = {},\n fragmentMatcher: FragmentMatcher = () => true,\n onlyRunForcedResolvers: boolean = false,\n ) {\n const mainDefinition = getMainDefinition(document);\n const fragments = getFragmentDefinitions(document);\n const fragmentMap = createFragmentMap(fragments);\n\n const definitionOperation = (mainDefinition as OperationDefinitionNode)\n .operation;\n\n const defaultOperationType = definitionOperation\n ? capitalizeFirstLetter(definitionOperation)\n : 'Query';\n\n const { cache, client } = this;\n const execContext: ExecContext = {\n fragmentMap,\n context: {\n ...context,\n cache,\n client,\n },\n variables,\n fragmentMatcher,\n defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers,\n };\n\n return this.resolveSelectionSet(\n mainDefinition.selectionSet,\n rootValue,\n execContext,\n ).then(result => ({\n result,\n exportedVariables: execContext.exportedVariables,\n }));\n }\n\n private async resolveSelectionSet(\n selectionSet: SelectionSetNode,\n rootValue: TData,\n execContext: ExecContext,\n ) {\n const { fragmentMap, context, variables } = execContext;\n const resultsToMerge: TData[] = [rootValue];\n\n const execute = async (selection: SelectionNode): Promise => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely.\n return;\n }\n\n if (isField(selection)) {\n return this.resolveField(selection, rootValue, execContext).then(\n fieldResult => {\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n } as TData);\n }\n },\n );\n }\n\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment.\n fragment = fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}`);\n }\n\n if (fragment && fragment.typeCondition) {\n const typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return this.resolveSelectionSet(\n fragment.selectionSet,\n rootValue,\n execContext,\n ).then(fragmentResult => {\n resultsToMerge.push(fragmentResult);\n });\n }\n }\n };\n\n return Promise.all(selectionSet.selections.map(execute)).then(function() {\n return mergeDeepArray(resultsToMerge);\n });\n }\n\n private async resolveField(\n field: FieldNode,\n rootValue: any,\n execContext: ExecContext,\n ): Promise {\n const { variables } = execContext;\n const fieldName = field.name.value;\n const aliasedFieldName = resultKeyNameFromField(field);\n const aliasUsed = fieldName !== aliasedFieldName;\n const defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n let resultPromise = Promise.resolve(defaultResult);\n\n // Usually all local resolvers are run when passing through here, but\n // if we've specifically identified that we only want to run forced\n // resolvers (that is, resolvers for fields marked with\n // `@client(always: true)`), then we'll skip running non-forced resolvers.\n if (\n !execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)\n ) {\n const resolverType =\n rootValue.__typename || execContext.defaultOperationType;\n const resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n const resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(resolve(\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field, fragmentMap: execContext.fragmentMap },\n ));\n }\n }\n }\n\n return resultPromise.then((result = defaultResult) => {\n // If an @export directive is associated with the current field, store\n // the `as` export variable name and current result for later use.\n if (field.directives) {\n field.directives.forEach(directive => {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(arg => {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n\n // Handle all scalar types here.\n if (!field.selectionSet) {\n return result;\n }\n\n // From here down, the field has a selection set, which means it's trying\n // to query a GraphQLObjectType.\n if (result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return result;\n }\n\n if (Array.isArray(result)) {\n return this.resolveSubSelectedArray(field, result, execContext);\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n if (field.selectionSet) {\n return this.resolveSelectionSet(\n field.selectionSet,\n result,\n execContext,\n );\n }\n });\n }\n\n private resolveSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): any {\n return Promise.all(\n result.map(item => {\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse.\n if (Array.isArray(item)) {\n return this.resolveSubSelectedArray(field, item, execContext);\n }\n\n // This is an object, run the selection set on it.\n if (field.selectionSet) {\n return this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }),\n );\n }\n}\n","import { Observable, Observer, Subscription } from './Observable';\n\n// Returns a normal Observable that can have any number of subscribers,\n// while ensuring the original Observable gets subscribed to at most once.\nexport function multiplex(inner: Observable): Observable {\n const observers = new Set>();\n let sub: Subscription | null = null;\n return new Observable(observer => {\n observers.add(observer);\n sub = sub || inner.subscribe({\n next(value) {\n observers.forEach(obs => obs.next && obs.next(value));\n },\n error(error) {\n observers.forEach(obs => obs.error && obs.error(error));\n },\n complete() {\n observers.forEach(obs => obs.complete && obs.complete());\n },\n });\n return () => {\n if (observers.delete(observer) && !observers.size && sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n });\n}\n\n// Like Observable.prototype.map, except that the mapping function can\n// optionally return a Promise (or be async).\nexport function asyncMap(\n observable: Observable,\n mapFn: (value: V) => R | Promise,\n): Observable {\n return new Observable(observer => {\n const { next, error, complete } = observer;\n let activeNextCount = 0;\n let completed = false;\n\n const handler: Observer = {\n next(value) {\n ++activeNextCount;\n new Promise(resolve => {\n resolve(mapFn(value));\n }).then(\n result => {\n --activeNextCount;\n next && next.call(observer, result);\n completed && handler.complete!();\n },\n e => {\n --activeNextCount;\n error && error.call(observer, e);\n },\n );\n },\n error(e) {\n error && error.call(observer, e);\n },\n complete() {\n completed = true;\n if (!activeNextCount) {\n complete && complete.call(observer);\n }\n },\n };\n\n const sub = observable.subscribe(handler);\n return () => sub.unsubscribe();\n });\n}\n","import { execute, ApolloLink, FetchResult } from 'apollo-link';\nimport { DocumentNode } from 'graphql';\nimport { Cache } from 'apollo-cache';\nimport {\n getDefaultValues,\n getOperationDefinition,\n getOperationName,\n hasDirectives,\n graphQLResultHasError,\n hasClientExports,\n removeConnectionDirectiveFromDocument,\n canUseWeakMap,\n} from 'apollo-utilities';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { isApolloError, ApolloError } from '../errors/ApolloError';\nimport { Observer, Subscription, Observable } from '../util/Observable';\nimport { QueryWithUpdater, DataStore } from '../data/store';\nimport { MutationStore } from '../data/mutations';\nimport { QueryStore, QueryStoreValue } from '../data/queries';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n QueryListener,\n ApolloQueryResult,\n FetchType,\n OperationVariables,\n} from './types';\nimport { LocalState } from './LocalState';\nimport { asyncMap, multiplex } from '../util/observables';\nimport { isNonEmptyArray } from '../util/arrays';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport interface QueryInfo {\n listeners: Set;\n invalidated: boolean;\n newData: Cache.DiffResult | null;\n document: DocumentNode | null;\n lastRequestId: number;\n // A map going from queryId to an observer for a query issued by watchQuery. We use\n // these to keep track of queries that are inflight and error on the observers associated\n // with them in case of some destabalizing action (e.g. reset of the Apollo store).\n observableQuery: ObservableQuery | null;\n subscriptions: Set;\n cancel?: () => void;\n}\n\nexport class QueryManager {\n public link: ApolloLink;\n public mutationStore: MutationStore = new MutationStore();\n public queryStore: QueryStore = new QueryStore();\n public dataStore: DataStore;\n public readonly assumeImmutableResults: boolean;\n\n private queryDeduplication: boolean;\n private clientAwareness: Record = {};\n private localState: LocalState;\n\n private onBroadcast: () => void;\n\n private ssrMode: boolean;\n\n // let's not start at zero to avoid pain with bad checks\n private idCounter = 1;\n\n // XXX merge with ObservableQuery but that needs to be expanded to support mutations and\n // subscriptions as well\n private queries: Map = new Map();\n\n // A map of Promise reject functions for fetchQuery promises that have not\n // yet been resolved, used to keep track of in-flight queries so that we can\n // reject them in case a destabilizing event occurs (e.g. Apollo store reset).\n // The key is in the format of `query:${queryId}` or `fetchRequest:${queryId}`,\n // depending on where the promise's rejection function was created from.\n private fetchQueryRejectFns = new Map();\n\n constructor({\n link,\n queryDeduplication = false,\n store,\n onBroadcast = () => undefined,\n ssrMode = false,\n clientAwareness = {},\n localState,\n assumeImmutableResults,\n }: {\n link: ApolloLink;\n queryDeduplication?: boolean;\n store: DataStore;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record;\n localState?: LocalState;\n assumeImmutableResults?: boolean;\n }) {\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.dataStore = store;\n this.onBroadcast = onBroadcast;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: store.getCache() });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n }\n\n /**\n * Call this method to terminate any active query processes, making it safe\n * to dispose of this QueryManager instance.\n */\n public stop() {\n this.queries.forEach((_info, queryId) => {\n this.stopQueryNoBroadcast(queryId);\n });\n\n this.fetchQueryRejectFns.forEach(reject => {\n reject(\n new InvariantError('QueryManager stopped while query was in flight'),\n );\n });\n }\n\n public async mutate({\n mutation,\n variables,\n optimisticResponse,\n updateQueries: updateQueriesByName,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise> {\n invariant(\n mutation,\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n\n invariant(\n !fetchPolicy || fetchPolicy === 'no-cache',\n \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\"\n );\n\n const mutationId = this.generateQueryId();\n mutation = this.transform(mutation).document;\n\n this.setQuery(mutationId, () => ({ document: mutation }));\n\n variables = this.getVariables(mutation, variables);\n\n if (this.transform(mutation).hasClientExports) {\n variables = await this.localState.addExportedVariables(mutation, variables, context);\n }\n\n // Create a map of update queries by id to the query instead of by name.\n const generateUpdateQueriesInfo: () => {\n [queryId: string]: QueryWithUpdater;\n } = () => {\n const ret: { [queryId: string]: QueryWithUpdater } = {};\n\n if (updateQueriesByName) {\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const { queryName } = observableQuery;\n if (\n queryName &&\n hasOwnProperty.call(updateQueriesByName, queryName)\n ) {\n ret[queryId] = {\n updater: updateQueriesByName[queryName],\n query: this.queryStore.get(queryId),\n };\n }\n }\n });\n }\n\n return ret;\n };\n\n this.mutationStore.initMutation(\n mutationId,\n mutation,\n variables,\n );\n\n this.dataStore.markMutationInit({\n mutationId,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n const self = this;\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult | null;\n let error: ApolloError;\n\n self.getObservableFromLink(\n mutation,\n {\n ...context,\n optimisticResponse,\n },\n variables,\n false,\n ).subscribe({\n next(result: FetchResult) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n self.mutationStore.markMutationResult(mutationId);\n\n if (fetchPolicy !== 'no-cache') {\n self.dataStore.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n });\n }\n\n storeResult = result;\n },\n\n error(err: Error) {\n self.mutationStore.markMutationError(mutationId, err);\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n self.broadcastQueries();\n self.setQuery(mutationId, () => ({ document: null }));\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete() {\n if (error) {\n self.mutationStore.markMutationError(mutationId, error);\n }\n\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n\n self.broadcastQueries();\n\n if (error) {\n reject(error);\n return;\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult!);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult[] | ApolloQueryResult<{}>\n >[] = [];\n\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(refetchQuery => {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(({ observableQuery }) => {\n if (\n observableQuery &&\n observableQuery.queryName === refetchQuery\n ) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n } else {\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n\n Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n self.setQuery(mutationId, () => ({ document: null }));\n\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n resolve(storeResult!);\n });\n },\n });\n });\n }\n\n public async fetchQuery(\n queryId: string,\n options: WatchQueryOptions,\n fetchType?: FetchType,\n // This allows us to track if this is a query spawned by a `fetchMore`\n // call for another query. We need this data to compute the `fetchMore`\n // network status for the query this is fetching for.\n fetchMoreForQueryId?: string,\n ): Promise> {\n const {\n metadata = null,\n fetchPolicy = 'cache-first', // cache-first is the default fetch policy.\n context = {},\n } = options;\n\n const query = this.transform(options.query).document;\n\n let variables = this.getVariables(query, options.variables);\n\n if (this.transform(query).hasClientExports) {\n variables = await this.localState.addExportedVariables(query, variables, context);\n }\n\n options = { ...options, variables };\n\n let storeResult: any;\n const isNetworkOnly =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n let needToFetch = isNetworkOnly;\n\n // Unless we are completely skipping the cache, we want to diff the query\n // against the cache before we fetch it from the network interface.\n if (!isNetworkOnly) {\n const { complete, result } = this.dataStore.getCache().diff({\n query,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n // If we're in here, only fetch if we have missing fields\n needToFetch = !complete || fetchPolicy === 'cache-and-network';\n storeResult = result;\n }\n\n let shouldFetch =\n needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby';\n\n // we need to check to see if this is an operation that uses the @live directive\n if (hasDirectives(['live'], query)) shouldFetch = true;\n\n const requestId = this.idCounter++;\n\n // set up a watcher to listen to cache updates\n const cancel = fetchPolicy !== 'no-cache'\n ? this.updateQueryWatch(queryId, query, options)\n : undefined;\n\n // Initialize query in store with unique requestId\n this.setQuery(queryId, () => ({\n document: query,\n lastRequestId: requestId,\n invalidated: true,\n cancel,\n }));\n\n this.invalidate(fetchMoreForQueryId);\n\n this.queryStore.initQuery({\n queryId,\n document: query,\n storePreviousVariables: shouldFetch,\n variables,\n isPoll: fetchType === FetchType.poll,\n isRefetch: fetchType === FetchType.refetch,\n metadata,\n fetchMoreForQueryId,\n });\n\n this.broadcastQueries();\n\n if (shouldFetch) {\n const networkResult = this.fetchRequest({\n requestId,\n queryId,\n document: query,\n options,\n fetchMoreForQueryId,\n }).catch(error => {\n // This is for the benefit of `refetch` promises, which currently don't get their errors\n // through the store like watchQuery observers do\n if (isApolloError(error)) {\n throw error;\n } else {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n this.broadcastQueries();\n }\n throw new ApolloError({ networkError: error });\n }\n });\n\n // we don't return the promise for cache-and-network since it is already\n // returned below from the cache\n if (fetchPolicy !== 'cache-and-network') {\n return networkResult;\n }\n\n // however we need to catch the error so it isn't unhandled in case of\n // network error\n networkResult.catch(() => {});\n }\n\n // If there is no part of the query we need to fetch from the server (or,\n // fetchPolicy is cache-only), we just write the store result as the final result.\n this.queryStore.markQueryResultClient(queryId, !shouldFetch);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n if (this.transform(query).hasForcedResolvers) {\n return this.localState.runResolvers({\n document: query,\n remoteResult: { data: storeResult },\n context,\n variables,\n onlyRunForcedResolvers: true,\n }).then((result: FetchResult) => {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n this.broadcastQueries();\n return result;\n });\n }\n\n this.broadcastQueries();\n\n // If we have no query to send to the server, we should return the result\n // found within the store.\n return { data: storeResult };\n }\n\n private markQueryResult(\n queryId: string,\n result: FetchResult,\n {\n fetchPolicy,\n variables,\n errorPolicy,\n }: WatchQueryOptions,\n fetchMoreForQueryId?: string,\n ) {\n if (fetchPolicy === 'no-cache') {\n this.setQuery(queryId, () => ({\n newData: { result: result.data, complete: true },\n }));\n } else {\n this.dataStore.markQueryResult(\n result,\n this.getQuery(queryId).document!,\n variables,\n fetchMoreForQueryId,\n errorPolicy === 'ignore' || errorPolicy === 'all',\n );\n }\n }\n\n // Returns a query listener that will update the given observer based on the\n // results (or lack thereof) for a particular query.\n public queryListenerForObserver(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ): QueryListener {\n function invoke(method: 'next' | 'error', argument: any) {\n if (observer[method]) {\n try {\n observer[method]!(argument);\n } catch (e) {\n invariant.error(e);\n }\n } else if (method === 'error') {\n invariant.error(argument);\n }\n }\n\n return (\n queryStoreValue: QueryStoreValue,\n newData?: Cache.DiffResult,\n ) => {\n // we're going to take a look at the data, so the query is no longer invalidated\n this.invalidate(queryId, false);\n\n // The query store value can be undefined in the event of a store\n // reset.\n if (!queryStoreValue) return;\n\n const { observableQuery, document } = this.getQuery(queryId);\n\n const fetchPolicy = observableQuery\n ? observableQuery.options.fetchPolicy\n : options.fetchPolicy;\n\n // don't watch the store for queries on standby\n if (fetchPolicy === 'standby') return;\n\n const loading = isNetworkRequestInFlight(queryStoreValue.networkStatus);\n const lastResult = observableQuery && observableQuery.getLastResult();\n\n const networkStatusChanged = !!(\n lastResult &&\n lastResult.networkStatus !== queryStoreValue.networkStatus\n );\n\n const shouldNotifyIfLoading =\n options.returnPartialData ||\n (!newData && queryStoreValue.previousVariables) ||\n (networkStatusChanged && options.notifyOnNetworkStatusChange) ||\n fetchPolicy === 'cache-only' ||\n fetchPolicy === 'cache-and-network';\n\n if (loading && !shouldNotifyIfLoading) {\n return;\n }\n\n const hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors);\n\n const errorPolicy: ErrorPolicy = observableQuery\n && observableQuery.options.errorPolicy\n || options.errorPolicy\n || 'none';\n\n // If we have either a GraphQL error or a network error, we create\n // an error and tell the observer about it.\n if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) {\n return invoke('error', new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }));\n }\n\n try {\n let data: any;\n let isMissing: boolean;\n\n if (newData) {\n // As long as we're using the cache, clear out the latest\n // `newData`, since it will now become the current data. We need\n // to keep the `newData` stored with the query when using\n // `no-cache` since `getCurrentQueryResult` attemps to pull from\n // `newData` first, following by trying the cache (which won't\n // find a hit for `no-cache`).\n if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') {\n this.setQuery(queryId, () => ({ newData: null }));\n }\n\n data = newData.result;\n isMissing = !newData.complete;\n } else {\n const lastError = observableQuery && observableQuery.getLastError();\n const errorStatusChanged =\n errorPolicy !== 'none' &&\n (lastError && lastError.graphQLErrors) !==\n queryStoreValue.graphQLErrors;\n\n if (lastResult && lastResult.data && !errorStatusChanged) {\n data = lastResult.data;\n isMissing = false;\n } else {\n const diffResult = this.dataStore.getCache().diff({\n query: document as DocumentNode,\n variables:\n queryStoreValue.previousVariables ||\n queryStoreValue.variables,\n returnPartialData: true,\n optimistic: true,\n });\n\n data = diffResult.result;\n isMissing = !diffResult.complete;\n }\n }\n\n // If there is some data missing and the user has told us that they\n // do not tolerate partial data then we want to return the previous\n // result and mark it as stale.\n const stale = isMissing && !(\n options.returnPartialData ||\n fetchPolicy === 'cache-only'\n );\n\n const resultFromStore: ApolloQueryResult = {\n data: stale ? lastResult && lastResult.data : data,\n loading,\n networkStatus: queryStoreValue.networkStatus,\n stale,\n };\n\n // if the query wants updates on errors we need to add it to the result\n if (errorPolicy === 'all' && hasGraphQLErrors) {\n resultFromStore.errors = queryStoreValue.graphQLErrors;\n }\n\n invoke('next', resultFromStore);\n\n } catch (networkError) {\n invoke('error', new ApolloError({ networkError }));\n }\n };\n }\n\n private transformCache = new (canUseWeakMap ? WeakMap : Map)<\n DocumentNode,\n Readonly<{\n document: Readonly;\n hasClientExports: boolean;\n hasForcedResolvers: boolean;\n clientQuery: Readonly | null;\n serverQuery: Readonly | null;\n defaultVars: Readonly;\n }>\n >();\n\n public transform(document: DocumentNode) {\n const { transformCache } = this;\n\n if (!transformCache.has(document)) {\n const cache = this.dataStore.getCache();\n const transformed = cache.transformDocument(document);\n const forLink = removeConnectionDirectiveFromDocument(\n cache.transformForLink(transformed));\n\n const clientQuery = this.localState.clientQuery(transformed);\n const serverQuery = this.localState.serverQuery(forLink);\n\n const cacheEntry = {\n document: transformed,\n // TODO These two calls (hasClientExports and shouldForceResolvers)\n // could probably be merged into a single traversal.\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery,\n serverQuery,\n defaultVars: getDefaultValues(\n getOperationDefinition(transformed)\n ) as OperationVariables,\n };\n\n const add = (doc: DocumentNode | null) => {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry);\n }\n }\n // Add cacheEntry to the transformCache using several different keys,\n // since any one of these documents could end up getting passed to the\n // transform method again in the future.\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n\n return transformCache.get(document)!;\n }\n\n private getVariables(\n document: DocumentNode,\n variables?: OperationVariables,\n ): OperationVariables {\n return {\n ...this.transform(document).defaultVars,\n ...variables,\n };\n }\n\n // The shouldSubscribe option is a temporary fix that tells us whether watchQuery was called\n // directly (i.e. through ApolloClient) or through the query method within QueryManager.\n // Currently, the query method uses watchQuery in order to handle non-network errors correctly\n // but we don't want to keep track observables issued for the query method since those aren't\n // supposed to be refetched in the event of a store reset. Once we unify error handling for\n // network errors and non-network errors, the shouldSubscribe option will go away.\n\n public watchQuery(\n options: WatchQueryOptions,\n shouldSubscribe = true,\n ): ObservableQuery {\n invariant(\n options.fetchPolicy !== 'standby',\n 'client.watchQuery cannot be called with fetchPolicy set to \"standby\"',\n );\n\n // assign variable default values if supplied\n options.variables = this.getVariables(options.query, options.variables);\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n let transformedOptions = { ...options } as WatchQueryOptions;\n\n return new ObservableQuery({\n queryManager: this,\n options: transformedOptions,\n shouldSubscribe: shouldSubscribe,\n });\n }\n\n public query(options: QueryOptions): Promise> {\n invariant(\n options.query,\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n\n invariant(\n options.query.kind === 'Document',\n 'You must wrap the query string in a \"gql\" tag.',\n );\n\n invariant(\n !(options as any).returnPartialData,\n 'returnPartialData option only supported on watchQuery.',\n );\n\n invariant(\n !(options as any).pollInterval,\n 'pollInterval option only supported on watchQuery.',\n );\n\n return new Promise>((resolve, reject) => {\n const watchedQuery = this.watchQuery(options, false);\n this.fetchQueryRejectFns.set(`query:${watchedQuery.queryId}`, reject);\n watchedQuery\n .result()\n .then(resolve, reject)\n // Since neither resolve nor reject throw or return a value, this .then\n // handler is guaranteed to execute. Note that it doesn't really matter\n // when we remove the reject function from this.fetchQueryRejectFns,\n // since resolve and reject are mutually idempotent. In fact, it would\n // not be incorrect to let reject functions accumulate over time; it's\n // just a waste of memory.\n .then(() =>\n this.fetchQueryRejectFns.delete(`query:${watchedQuery.queryId}`),\n );\n });\n }\n\n public generateQueryId() {\n return String(this.idCounter++);\n }\n\n public stopQueryInStore(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryInStoreNoBroadcast(queryId: string) {\n this.stopPollingQuery(queryId);\n this.queryStore.stopQuery(queryId);\n this.invalidate(queryId);\n }\n\n public addQueryListener(queryId: string, listener: QueryListener) {\n this.setQuery(queryId, ({ listeners }) => {\n listeners.add(listener);\n return { invalidated: false };\n });\n }\n\n public updateQueryWatch(\n queryId: string,\n document: DocumentNode,\n options: WatchQueryOptions,\n ) {\n const { cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n const previousResult = () => {\n let previousResult = null;\n const { observableQuery } = this.getQuery(queryId);\n if (observableQuery) {\n const lastResult = observableQuery.getLastResult();\n if (lastResult) {\n previousResult = lastResult.data;\n }\n }\n\n return previousResult;\n };\n return this.dataStore.getCache().watch({\n query: document as DocumentNode,\n variables: options.variables,\n optimistic: true,\n previousResult,\n callback: newData => {\n this.setQuery(queryId, () => ({ invalidated: true, newData }));\n },\n });\n }\n\n // Adds an ObservableQuery to this.observableQueries and to this.observableQueriesByName.\n public addObservableQuery(\n queryId: string,\n observableQuery: ObservableQuery,\n ) {\n this.setQuery(queryId, () => ({ observableQuery }));\n }\n\n public removeObservableQuery(queryId: string) {\n const { cancel } = this.getQuery(queryId);\n this.setQuery(queryId, () => ({ observableQuery: null }));\n if (cancel) cancel();\n }\n\n public clearStore(): Promise {\n // Before we have sent the reset action to the store,\n // we can no longer rely on the results returned by in-flight\n // requests since these may depend on values that previously existed\n // in the data portion of the store. So, we cancel the promises and observers\n // that we have issued so far and not yet resolved (in the case of\n // queries).\n this.fetchQueryRejectFns.forEach(reject => {\n reject(new InvariantError(\n 'Store reset while query was in flight (not completed in link chain)',\n ));\n });\n\n const resetIds: string[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) resetIds.push(queryId);\n });\n\n this.queryStore.reset(resetIds);\n this.mutationStore.reset();\n\n // begin removing data from the store\n return this.dataStore.reset();\n }\n\n public resetStore(): Promise[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby: boolean = false,\n ): Promise[]> {\n const observableQueryPromises: Promise>[] = [];\n\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.setQuery(queryId, () => ({ newData: null }));\n this.invalidate(queryId);\n }\n });\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public observeQuery(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ) {\n this.addQueryListener(\n queryId,\n this.queryListenerForObserver(queryId, options, observer),\n );\n return this.fetchQuery(queryId, options);\n }\n\n public startQuery(\n queryId: string,\n options: WatchQueryOptions,\n listener: QueryListener,\n ) {\n invariant.warn(\"The QueryManager.startQuery method has been deprecated\");\n\n this.addQueryListener(queryId, listener);\n\n this.fetchQuery(queryId, options)\n // `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the\n // console will show an `Uncaught (in promise)` message. Ignore the error for now.\n .catch(() => undefined);\n\n return queryId;\n }\n\n public startGraphQLSubscription({\n query,\n fetchPolicy,\n variables,\n }: SubscriptionOptions): Observable> {\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n\n const makeObservable = (variables: OperationVariables) =>\n this.getObservableFromLink(\n query,\n {},\n variables,\n false,\n ).map(result => {\n if (!fetchPolicy || fetchPolicy !== 'no-cache') {\n this.dataStore.markSubscriptionResult(\n result,\n query,\n variables,\n );\n this.broadcastQueries();\n }\n\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n\n return result;\n });\n\n if (this.transform(query).hasClientExports) {\n const observablePromise = this.localState.addExportedVariables(\n query,\n variables,\n ).then(makeObservable);\n\n return new Observable>(observer => {\n let sub: Subscription | null = null;\n observablePromise.then(\n observable => sub = observable.subscribe(observer),\n observer.error,\n );\n return () => sub && sub.unsubscribe();\n });\n }\n\n return makeObservable(variables);\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryNoBroadcast(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n // teardown all links\n // Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises\n // that each add their reject functions to fetchQueryRejectFns.\n // A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.\n // The same queryId could have two rejection fns for two promises\n this.fetchQueryRejectFns.delete(`query:${queryId}`);\n this.fetchQueryRejectFns.delete(`fetchRequest:${queryId}`);\n this.getQuery(queryId).subscriptions.forEach(x => x.unsubscribe());\n this.queries.delete(queryId);\n }\n\n public getCurrentQueryResult(\n observableQuery: ObservableQuery,\n optimistic: boolean = true,\n ): {\n data: T | undefined;\n partial: boolean;\n } {\n const { variables, query, fetchPolicy, returnPartialData } = observableQuery.options;\n const lastResult = observableQuery.getLastResult();\n const { newData } = this.getQuery(observableQuery.queryId);\n\n if (newData && newData.complete) {\n return { data: newData.result, partial: false };\n }\n\n if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') {\n return { data: undefined, partial: false };\n }\n\n const { result, complete } = this.dataStore.getCache().diff({\n query,\n variables,\n previousResult: lastResult ? lastResult.data : undefined,\n returnPartialData: true,\n optimistic,\n });\n\n return {\n data: (complete || returnPartialData) ? result : void 0,\n partial: !complete,\n };\n }\n\n public getQueryWithPreviousResult(\n queryIdOrObservable: string | ObservableQuery,\n ): {\n previousResult: any;\n variables: TVariables | undefined;\n document: DocumentNode;\n } {\n let observableQuery: ObservableQuery;\n if (typeof queryIdOrObservable === 'string') {\n const { observableQuery: foundObserveableQuery } = this.getQuery(\n queryIdOrObservable,\n );\n invariant(\n foundObserveableQuery,\n `ObservableQuery with this id doesn't exist: ${queryIdOrObservable}`\n );\n observableQuery = foundObserveableQuery!;\n } else {\n observableQuery = queryIdOrObservable;\n }\n\n const { variables, query } = observableQuery.options;\n return {\n previousResult: this.getCurrentQueryResult(observableQuery, false).data,\n variables,\n document: query,\n };\n }\n\n public broadcastQueries() {\n this.onBroadcast();\n this.queries.forEach((info, id) => {\n if (info.invalidated) {\n info.listeners.forEach(listener => {\n // it's possible for the listener to be undefined if the query is being stopped\n // See here for more detail: https://github.com/apollostack/apollo-client/issues/231\n if (listener) {\n listener(this.queryStore.get(id), info.newData);\n }\n });\n }\n });\n }\n\n public getLocalState(): LocalState {\n return this.localState;\n }\n\n private inFlightLinkObservables = new Map<\n DocumentNode,\n Map>\n >();\n\n private getObservableFromLink(\n query: DocumentNode,\n context: any,\n variables?: OperationVariables,\n deduplication: boolean = this.queryDeduplication,\n ): Observable> {\n let observable: Observable>;\n\n const { serverQuery } = this.transform(query);\n if (serverQuery) {\n const { inFlightLinkObservables, link } = this;\n\n const operation = {\n query: serverQuery,\n variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext({\n ...context,\n forceFetch: !deduplication\n }),\n };\n\n context = operation.context;\n\n if (deduplication) {\n const byVariables = inFlightLinkObservables.get(serverQuery) || new Map();\n inFlightLinkObservables.set(serverQuery, byVariables);\n\n const varJson = JSON.stringify(variables);\n observable = byVariables.get(varJson);\n\n if (!observable) {\n byVariables.set(\n varJson,\n observable = multiplex(\n execute(link, operation) as Observable>\n )\n );\n\n const cleanup = () => {\n byVariables.delete(varJson);\n if (!byVariables.size) inFlightLinkObservables.delete(serverQuery);\n cleanupSub.unsubscribe();\n };\n\n const cleanupSub = observable.subscribe({\n next: cleanup,\n error: cleanup,\n complete: cleanup,\n });\n }\n\n } else {\n observable = multiplex(execute(link, operation) as Observable>);\n }\n } else {\n observable = Observable.of({ data: {} } as FetchResult);\n context = this.prepareContext(context);\n }\n\n const { clientQuery } = this.transform(query);\n if (clientQuery) {\n observable = asyncMap(observable, result => {\n return this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context,\n variables,\n });\n });\n }\n\n return observable;\n }\n\n // Takes a request id, query id, a query document and information associated with the query\n // and send it to the network interface. Returns\n // a promise for the result associated with that request.\n private fetchRequest({\n requestId,\n queryId,\n document,\n options,\n fetchMoreForQueryId,\n }: {\n requestId: number;\n queryId: string;\n document: DocumentNode;\n options: WatchQueryOptions;\n fetchMoreForQueryId?: string;\n }): Promise> {\n const { variables, errorPolicy = 'none', fetchPolicy } = options;\n let resultFromStore: any;\n let errorsFromStore: any;\n\n return new Promise>((resolve, reject) => {\n const observable = this.getObservableFromLink(\n document,\n options.context,\n variables,\n );\n\n const fqrfId = `fetchRequest:${queryId}`;\n this.fetchQueryRejectFns.set(fqrfId, reject);\n\n const cleanup = () => {\n this.fetchQueryRejectFns.delete(fqrfId);\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.delete(subscription);\n });\n };\n\n const subscription = observable.map((result: FetchResult) => {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n\n this.queryStore.markQueryResult(\n queryId,\n result,\n fetchMoreForQueryId,\n );\n\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) {\n return reject(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n\n if (errorPolicy === 'all') {\n errorsFromStore = result.errors;\n }\n\n if (fetchMoreForQueryId || fetchPolicy === 'no-cache') {\n // We don't write fetchMore results to the store because this would overwrite\n // the original result in case an @connection directive is used.\n resultFromStore = result.data;\n } else {\n // ensure result is combined with data already in store\n const { result, complete } = this.dataStore.getCache().diff({\n variables,\n query: document,\n optimistic: false,\n returnPartialData: true,\n });\n\n if (complete || options.returnPartialData) {\n resultFromStore = result;\n }\n }\n }).subscribe({\n error(error: ApolloError) {\n cleanup();\n reject(error);\n },\n\n complete() {\n cleanup();\n resolve({\n data: resultFromStore,\n errors: errorsFromStore,\n loading: false,\n networkStatus: NetworkStatus.ready,\n stale: false,\n });\n },\n });\n\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.add(subscription);\n });\n });\n }\n\n private getQuery(queryId: string) {\n return (\n this.queries.get(queryId) || {\n listeners: new Set(),\n invalidated: false,\n document: null,\n newData: null,\n lastRequestId: 1,\n observableQuery: null,\n subscriptions: new Set(),\n }\n );\n }\n\n private setQuery(\n queryId: string,\n updater: (prev: QueryInfo) => Pick | void,\n ) {\n const prev = this.getQuery(queryId);\n const newInfo = { ...prev, ...updater(prev) };\n this.queries.set(queryId, newInfo);\n }\n\n private invalidate(\n queryId: string | undefined,\n invalidated = true,\n ) {\n if (queryId) {\n this.setQuery(queryId, () => ({ invalidated }));\n }\n }\n\n private prepareContext(context = {}) {\n const newContext = this.localState.prepareContext(context);\n return {\n ...newContext,\n clientAwareness: this.clientAwareness,\n };\n }\n\n public checkInFlight(queryId: string) {\n const query = this.queryStore.get(queryId);\n\n return (\n query &&\n query.networkStatus !== NetworkStatus.ready &&\n query.networkStatus !== NetworkStatus.error\n );\n }\n\n // Map from client ID to { interval, options }.\n private pollingInfoByQueryId = new Map();\n\n public startPollingQuery(\n options: WatchQueryOptions,\n queryId: string,\n listener?: QueryListener,\n ): string {\n const { pollInterval } = options;\n\n invariant(\n pollInterval,\n 'Attempted to start a polling query without a polling interval.',\n );\n\n // Do not poll in SSR mode\n if (!this.ssrMode) {\n let info = this.pollingInfoByQueryId.get(queryId)!;\n if (!info) {\n this.pollingInfoByQueryId.set(queryId, (info = {} as any));\n }\n\n info.interval = pollInterval!;\n info.options = {\n ...options,\n fetchPolicy: 'network-only',\n };\n\n const maybeFetch = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n if (this.checkInFlight(queryId)) {\n poll();\n } else {\n this.fetchQuery(queryId, info.options, FetchType.poll).then(\n poll,\n poll,\n );\n }\n }\n };\n\n const poll = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n\n if (listener) {\n this.addQueryListener(queryId, listener);\n }\n\n poll();\n }\n\n return queryId;\n }\n\n public stopPollingQuery(queryId: string) {\n this.pollingInfoByQueryId.delete(queryId);\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, Cache, DataProxy } from 'apollo-cache';\n\nimport { QueryStoreValue } from '../data/queries';\nimport {\n getOperationName,\n tryFunctionOrLogError,\n graphQLResultHasError,\n} from 'apollo-utilities';\nimport { MutationQueryReducer } from '../core/types';\n\nexport type QueryWithUpdater = {\n updater: MutationQueryReducer;\n query: QueryStoreValue;\n};\n\nexport interface DataWrite {\n rootId: string;\n result: any;\n document: DocumentNode;\n operationName: string | null;\n variables: Object;\n}\n\nexport class DataStore {\n private cache: ApolloCache;\n\n constructor(initialCache: ApolloCache) {\n this.cache = initialCache;\n }\n\n public getCache(): ApolloCache {\n return this.cache;\n }\n\n public markQueryResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n fetchMoreForQueryId: string | undefined,\n ignoreErrors: boolean = false,\n ) {\n let writeWithErrors = !graphQLResultHasError(result);\n if (ignoreErrors && graphQLResultHasError(result) && result.data) {\n writeWithErrors = true;\n }\n if (!fetchMoreForQueryId && writeWithErrors) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markSubscriptionResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n ) {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (!graphQLResultHasError(result)) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markMutationInit(mutation: {\n mutationId: string;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n optimisticResponse: Object | Function | undefined;\n }) {\n if (mutation.optimisticResponse) {\n let optimistic: Object;\n if (typeof mutation.optimisticResponse === 'function') {\n optimistic = mutation.optimisticResponse(mutation.variables);\n } else {\n optimistic = mutation.optimisticResponse;\n }\n\n this.cache.recordOptimisticTransaction(c => {\n const orig = this.cache;\n this.cache = c;\n\n try {\n this.markMutationResult({\n mutationId: mutation.mutationId,\n result: { data: optimistic },\n document: mutation.document,\n variables: mutation.variables,\n updateQueries: mutation.updateQueries,\n update: mutation.update,\n });\n } finally {\n this.cache = orig;\n }\n }, mutation.mutationId);\n }\n }\n\n public markMutationResult(mutation: {\n mutationId: string;\n result: ExecutionResult;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n }) {\n // Incorporate the result from this mutation into the store\n if (!graphQLResultHasError(mutation.result)) {\n const cacheWrites: Cache.WriteOptions[] = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n\n const { updateQueries } = mutation;\n if (updateQueries) {\n Object.keys(updateQueries).forEach(id => {\n const { query, updater } = updateQueries[id];\n\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = this.cache.diff({\n query: query.document,\n variables: query.variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (complete) {\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = tryFunctionOrLogError(() =>\n updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: getOperationName(query.document) || undefined,\n queryVariables: query.variables,\n }),\n );\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: query.document,\n variables: query.variables,\n });\n }\n }\n });\n }\n\n this.cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const { update } = mutation;\n if (update) {\n tryFunctionOrLogError(() => update(c, mutation.result));\n }\n });\n }\n }\n\n public markMutationComplete({\n mutationId,\n optimisticResponse,\n }: {\n mutationId: string;\n optimisticResponse?: any;\n }) {\n if (optimisticResponse) {\n this.cache.removeOptimistic(mutationId);\n }\n }\n\n public markUpdateQueryResult(\n document: DocumentNode,\n variables: any,\n newResult: any,\n ) {\n this.cache.write({\n result: newResult,\n dataId: 'ROOT_QUERY',\n variables,\n query: document,\n });\n }\n\n public reset(): Promise {\n return this.cache.reset();\n }\n}\n","export const version = \"2.6.10\"","import {\n ApolloLink,\n FetchResult,\n GraphQLRequest,\n execute,\n} from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, DataProxy } from 'apollo-cache';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { QueryManager } from './core/QueryManager';\nimport {\n ApolloQueryResult,\n OperationVariables,\n Resolvers,\n} from './core/types';\nimport { ObservableQuery } from './core/ObservableQuery';\nimport { LocalState, FragmentMatcher } from './core/LocalState';\nimport { Observable } from './util/Observable';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n WatchQueryFetchPolicy,\n} from './core/watchQueryOptions';\n\nimport { DataStore } from './data/store';\n\nimport { version } from './version';\n\nexport interface DefaultOptions {\n watchQuery?: Partial;\n query?: Partial;\n mutate?: Partial;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions = {\n link?: ApolloLink;\n cache: ApolloCache;\n ssrForceFetchDelay?: number;\n ssrMode?: boolean;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n assumeImmutableResults?: boolean;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n name?: string;\n version?: string;\n};\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport default class ApolloClient implements DataProxy {\n public link: ApolloLink;\n public store: DataStore;\n public cache: ApolloCache;\n public readonly queryManager: QueryManager;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n public readonly typeDefs: ApolloClientOptions['typeDefs'];\n\n private devToolsHookCb: Function;\n private resetStoreCallbacks: Array<() => Promise> = [];\n private clearStoreCallbacks: Array<() => Promise> = [];\n private localState: LocalState;\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param assumeImmutableResults When this option is true, the client will assume results\n * read from the cache are never mutated by application code,\n * which enables substantial performance optimizations. Passing\n * `{ freezeResults: true }` to the `InMemoryCache` constructor\n * can help enforce this immutability.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions) {\n const {\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools,\n queryDeduplication = true,\n defaultOptions,\n assumeImmutableResults = false,\n resolvers,\n typeDefs,\n fragmentMatcher,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n let { link } = options;\n\n // If a link hasn't been defined, but local state resolvers have been set,\n // setup a default empty link.\n if (!link && resolvers) {\n link = ApolloLink.empty();\n }\n\n if (!link || !cache) {\n throw new InvariantError(\n \"In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\\n\" +\n \"These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\\n\" +\n \"For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup\"\n );\n }\n\n // remove apollo-client supported directives\n this.link = link;\n this.cache = cache;\n this.store = new DataStore(cache);\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n // Attach the client instance to window to let us be found by chrome devtools, but only in\n // development mode\n const defaultConnectToDevTools =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n !(window as any).__APOLLO_CLIENT__;\n\n if (\n typeof connectToDevTools === 'undefined'\n ? defaultConnectToDevTools\n : connectToDevTools && typeof window !== 'undefined'\n ) {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self\n ) {\n // First check if devtools is not installed\n if (\n typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined'\n ) {\n // Only for Chrome\n if (\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.indexOf('Chrome') > -1\n ) {\n // tslint:disable-next-line\n console.debug(\n 'Download the Apollo DevTools ' +\n 'for a better development experience: ' +\n 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm',\n );\n }\n }\n }\n }\n\n this.version = version;\n\n this.localState = new LocalState({\n cache,\n client: this,\n resolvers,\n fragmentMatcher,\n });\n\n this.queryManager = new QueryManager({\n link: this.link,\n store: this.store,\n queryDeduplication,\n ssrMode,\n clientAwareness: {\n name: clientAwarenessName!,\n version: clientAwarenessVersion!,\n },\n localState: this.localState,\n assumeImmutableResults,\n onBroadcast: () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager.queryStore.getStore(),\n mutations: this.queryManager.mutationStore.getStore(),\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n },\n });\n }\n\n /**\n * Call this method to terminate any active client processes, making it safe\n * to dispose of this `ApolloClient` instance.\n */\n public stop() {\n this.queryManager.stop();\n }\n\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n *

\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n *

\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n *

\n * Note that if the cache does not change, the subscriber will *not* be notified.\n *

\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n if (this.defaultOptions.watchQuery) {\n options = {\n ...this.defaultOptions.watchQuery,\n ...options,\n } as WatchQueryOptions;\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.watchQuery(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query(\n options: QueryOptions,\n ): Promise> {\n if (this.defaultOptions.query) {\n options = { ...this.defaultOptions.query, ...options } as QueryOptions<\n TVariables\n >;\n }\n\n invariant(\n (options.fetchPolicy as WatchQueryFetchPolicy) !== 'cache-and-network',\n 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.'\n );\n\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.query(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate(\n options: MutationOptions,\n ): Promise> {\n if (this.defaultOptions.mutate) {\n options = {\n ...this.defaultOptions.mutate,\n ...options,\n } as MutationOptions;\n }\n\n return this.queryManager.mutate(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe(\n options: SubscriptionOptions,\n ): Observable> {\n return this.queryManager.startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readQuery(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readFragment(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery(\n options: DataProxy.WriteQueryOptions,\n ): void {\n const result = this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment(\n options: DataProxy.WriteFragmentOptions,\n ): void {\n const result = this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Sugar for writeQuery & writeFragment\n * This method will construct a query from the data object passed in.\n * If no id is supplied, writeData will write the data to the root.\n * If an id is supplied, writeData will write a fragment to the object\n * specified by the id in the store.\n *\n * Since you aren't passing in a query to check the shape of the data,\n * you must pass in an object that conforms to the shape of valid GraphQL data.\n */\n public writeData(\n options: DataProxy.WriteDataOptions,\n ): void {\n const result = this.cache.writeData(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable {\n return execute(this.link, payload);\n }\n\n /**\n * This initializes the query manager that tracks queries and the cache\n */\n public initQueryManager(): QueryManager {\n invariant.warn(\n 'Calling the initQueryManager method is no longer necessary, ' +\n 'and it will be removed from ApolloClient in version 3.0.',\n );\n return this.queryManager;\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise[] | null> {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => this.reFetchObservableQueries());\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())));\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise[]> {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.cache.extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache {\n return this.cache.restore(serializedState);\n }\n\n /**\n * Add additional local resolvers.\n */\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.addResolvers(resolvers);\n }\n\n /**\n * Set (override existing) local resolvers.\n */\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.setResolvers(resolvers);\n }\n\n /**\n * Get all registered local resolvers.\n */\n public getResolvers() {\n return this.localState.getResolvers();\n }\n\n /**\n * Set a custom local state fragment matcher.\n */\n public setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-client/bundle.cjs.min.js b/node_modules/apollo-client/bundle.cjs.min.js deleted file mode 100644 index 0448cd8..0000000 --- a/node_modules/apollo-client/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -exports.__esModule=!0,exports.isApolloError=h,exports.ObservableQuery=exports.NetworkStatus=exports.FetchType=exports.ApolloError=exports.ApolloClient=exports.default=void 0;var e,t,r=require("tslib"),o=require("apollo-utilities"),n=require("apollo-link"),s=(e=require("symbol-observable"))&&e.__esModule?e:{default:e},i=require("ts-invariant"),a=require("graphql/language/visitor");function u(e){return e<7}exports.NetworkStatus=t,function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(t||(exports.NetworkStatus=t={}));var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.__extends)(t,e),t.prototype[s.default]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(n.Observable);function l(e){return Array.isArray(e)&&e.length>0}function h(e){return e.hasOwnProperty("graphQLErrors")}var p,y=function(e){var t="";return l(e.graphQLErrors)&&e.graphQLErrors.forEach(function(e){var r=e?e.message:"Error message not found.";t+="GraphQL error: "+r+"\n"}),e.networkError&&(t+="Network error: "+e.networkError.message+"\n"),t=t.replace(/\n$/,"")},f=function(e){function t(r){var o=r.graphQLErrors,n=r.networkError,s=r.errorMessage,i=r.extraInfo,a=e.call(this,s)||this;return a.graphQLErrors=o||[],a.networkError=n||null,a.message=s||y(a),a.extraInfo=i,a.__proto__=t.prototype,a}return(0,r.__extends)(t,e),t}(Error);exports.ApolloError=f,exports.FetchType=p,function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(p||(exports.FetchType=p={}));var v=function(e){function n(t){var r=t.queryManager,n=t.options,s=t.shouldSubscribe,i=void 0===s||s,a=e.call(this,function(e){return a.onSubscribe(e)})||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=i;var u=(0,o.getOperationDefinition)(n.query);return a.queryName=u&&u.name&&u.name.value,a.queryManager=r,a}return(0,r.__extends)(n,e),n.prototype.result=function(){var e=this;return new Promise(function(t,r){var o={next:function(r){t(r),e.observers.delete(o),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout(function(){n.unsubscribe()},0)},error:r},n=e.subscribe(o)})},n.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},n.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:t.error}}var o,n,s,i=this.queryManager.getCurrentQueryResult(this),a=i.data,c=i.partial,h=this.queryManager.queryStore.get(this.queryId),p=this.options.fetchPolicy,y="network-only"===p||"no-cache"===p;if(h){var v=h.networkStatus;if(n=h,void 0===(s=this.options.errorPolicy)&&(s="none"),n&&(n.networkError||"none"===s&&l(n.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:v,error:new f({graphQLErrors:h.graphQLErrors,networkError:h.networkError})};h.variables&&(this.options.variables=(0,r.__assign)((0,r.__assign)({},this.options.variables),h.variables),this.variables=this.options.variables),o={data:a,loading:u(v),networkStatus:v},h.graphQLErrors&&"all"===this.options.errorPolicy&&(o.errors=h.graphQLErrors)}else{var d=y||c&&"cache-only"!==p;o={data:a,loading:d,networkStatus:d?t.loading:t.ready}}return c||this.updateLastResult((0,r.__assign)((0,r.__assign)({},o),{stale:!1})),(0,r.__assign)((0,r.__assign)({},o),{partial:c})},n.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&(0,o.isEqual)(t.data,e.data))},n.prototype.getLastResult=function(){return this.lastResult},n.prototype.getLastError=function(){return this.lastError},n.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},n.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},n.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new i.InvariantError(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),(0,o.isEqual)(this.variables,e)||(this.variables=(0,r.__assign)((0,r.__assign)({},this.variables),e)),(0,o.isEqual)(this.options.variables,this.variables)||(this.options.variables=(0,r.__assign)((0,r.__assign)({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,(0,r.__assign)((0,r.__assign)({},this.options),{fetchPolicy:t}),p.refetch))},n.prototype.fetchMore=function(e){var t=this;(0,i.invariant)(e.updateQuery,2);var o=(0,r.__assign)((0,r.__assign)({},e.query?e:(0,r.__assign)((0,r.__assign)((0,r.__assign)({},this.options),e),{variables:(0,r.__assign)((0,r.__assign)({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,o,p.normal,this.queryId).then(function(r){return t.updateQuery(function(t){return e.updateQuery(t,{fetchMoreResult:r.data,variables:o.variables})}),t.queryManager.stopQuery(n),r},function(e){throw t.queryManager.stopQuery(n),e})},n.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(r){var o=e.updateQuery;o&&t.updateQuery(function(e,t){var n=t.variables;return o(e,{subscriptionData:r,variables:n})})},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},n.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=(0,r.__assign)((0,r.__assign)({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var o=e.fetchPolicy;return this.setVariables(this.options.variables,t!==o&&("cache-only"===t||"standby"===t||"network-only"===o),e.fetchResults)},n.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&(0,o.isEqual)(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},n.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,s=r.variables,i=r.document,a=(0,o.tryFunctionOrLogError)(function(){return e(n,{variables:s})});a&&(t.dataStore.markUpdateQueryResult(i,s,a),t.broadcastQueries())},n.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},n.prototype.startPolling=function(e){g(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},n.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,o.cloneDeep)(e),t},n.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=d)}catch(e){}var o=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),o&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},n.prototype.setUpQuery=function(){var e=this,n=this.queryManager,s=this.queryId;this.shouldSubscribe&&n.addObservableQuery(s,this),this.options.pollInterval&&(g(this),n.startPollingQuery(this.options,s));var i=function(o){e.updateLastResult((0,r.__assign)((0,r.__assign)({},e.lastResult),{errors:o.graphQLErrors,networkStatus:t.error,loading:!1})),b(e.observers,"error",e.lastError=o)};n.observeQuery(s,this.options,{next:function(t){if(e.lastError||e.isDifferentFromLastResult(t)){var r=e.updateLastResult(t),s=e.options,i=s.query,a=s.variables,u=s.fetchPolicy;n.transform(i).hasClientExports?n.getLocalState().addExportedVariables(i,a).then(function(s){var a=e.variables;e.variables=e.options.variables=s,!t.loading&&r&&"cache-only"!==u&&n.transform(i).serverQuery&&!(0,o.isEqual)(a,s)?e.refetch():b(e.observers,"next",t)}):b(e.observers,"next",t)}},error:i}).catch(i)},n.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},n}(c);function d(e){}function b(e,t,r){var o=[];e.forEach(function(e){return e[t]&&o.push(e)}),o.forEach(function(e){return e[t](r)})}function g(e){var t=e.options.fetchPolicy;(0,i.invariant)("cache-first"!==t&&"cache-only"!==t,3)}exports.ObservableQuery=v;var m=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Q=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var r=this.store[e.queryId];(0,i.invariant)(!r||r.document===e.document||(0,o.isEqual)(r.document,e.document),19);var n,s=!1,a=null;e.storePreviousVariables&&r&&r.networkStatus!==t.loading&&((0,o.isEqual)(r.variables,e.variables)||(s=!0,a=r.variables)),n=s?t.setVariables:e.isPoll?t.poll:e.isRefetch?t.refetch:t.loading;var u=[];r&&r.graphQLErrors&&(u=r.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:a,networkError:null,graphQLErrors:u,networkStatus:n,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=t.fetchMore)},e.prototype.markQueryResult=function(e,r,o){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=l(r.errors)?r.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=t.ready,"string"==typeof o&&this.store[o]&&(this.store[o].networkStatus=t.ready))},e.prototype.markQueryError=function(e,r,o){this.store&&this.store[e]&&(this.store[e].networkError=r,this.store[e].networkStatus=t.error,"string"==typeof o&&this.markQueryResultClient(o,!0))},e.prototype.markQueryResultClient=function(e,r){var o=this.store&&this.store[e];o&&(o.networkError=null,o.previousVariables=null,r&&(o.networkStatus=t.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var r=this;Object.keys(this.store).forEach(function(o){e.indexOf(o)<0?r.stopQuery(o):r.store[o].networkStatus=t.loading})},e}();var _=function(){function e(e){var t=e.cache,r=e.client,o=e.resolvers,n=e.fragmentMatcher;this.cache=t,r&&(this.client=r),o&&this.addResolvers(o),n&&this.setFragmentMatcher(n)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=(0,o.mergeDeep)(t.resolvers,e)}):this.resolvers=(0,o.mergeDeep)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,o=e.remoteResult,n=e.context,s=e.variables,i=e.onlyRunForcedResolvers,a=void 0!==i&&i;return(0,r.__awaiter)(this,void 0,void 0,function(){return(0,r.__generator)(this,function(e){return t?[2,this.resolveDocument(t,o.data,n,s,this.fragmentMatcher,a).then(function(e){return(0,r.__assign)((0,r.__assign)({},o),{data:e.result})})]:[2,o]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,o.hasDirectives)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?(0,o.removeClientSetsFromDocument)(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return(0,r.__assign)((0,r.__assign)({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);(0,i.invariant)(!1,6)}})},e.prototype.addExportedVariables=function(e,t,o){return void 0===t&&(t={}),void 0===o&&(o={}),(0,r.__awaiter)(this,void 0,void 0,function(){return(0,r.__generator)(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(o),t).then(function(e){return(0,r.__assign)((0,r.__assign)({},t),e.exportedVariables)})]:[2,(0,r.__assign)({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,a.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return a.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,o.buildQueryFromSelectionSet)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,s,i,a){return void 0===n&&(n={}),void 0===s&&(s={}),void 0===i&&(i=function(){return!0}),void 0===a&&(a=!1),(0,r.__awaiter)(this,void 0,void 0,function(){var u,c,l,h,p,y,f,v,d;return(0,r.__generator)(this,function(b){var g;return u=(0,o.getMainDefinition)(e),c=(0,o.getFragmentDefinitions)(e),l=(0,o.createFragmentMap)(c),h=u.operation,p=h?(g=h).charAt(0).toUpperCase()+g.slice(1):"Query",f=(y=this).cache,v=y.client,d={fragmentMap:l,context:(0,r.__assign)((0,r.__assign)({},n),{cache:f,client:v}),variables:s,fragmentMatcher:i,defaultOperationType:p,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(u.selectionSet,t,d).then(function(e){return{result:e,exportedVariables:d.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,n){return(0,r.__awaiter)(this,void 0,void 0,function(){var s,a,u,c,l,h=this;return(0,r.__generator)(this,function(p){return s=n.fragmentMap,a=n.context,u=n.variables,c=[t],l=function(e){return(0,r.__awaiter)(h,void 0,void 0,function(){var l,h;return(0,r.__generator)(this,function(r){return(0,o.shouldInclude)(e,u)?(0,o.isField)(e)?[2,this.resolveField(e,t,n).then(function(t){var r;void 0!==t&&c.push(((r={})[(0,o.resultKeyNameFromField)(e)]=t,r))})]:((0,o.isInlineFragment)(e)?l=e:(l=s[e.name.value],(0,i.invariant)(l,7)),l&&l.typeCondition&&(h=l.typeCondition.name.value,n.fragmentMatcher(t,h,a))?[2,this.resolveSelectionSet(l.selectionSet,t,n).then(function(e){c.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return(0,o.mergeDeepArray)(c)})]})})},e.prototype.resolveField=function(e,t,n){return(0,r.__awaiter)(this,void 0,void 0,function(){var s,i,a,u,c,l,h,p,y,f=this;return(0,r.__generator)(this,function(r){return s=n.variables,i=e.name.value,a=(0,o.resultKeyNameFromField)(e),u=i!==a,c=t[a]||t[i],l=Promise.resolve(c),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(h=t.__typename||n.defaultOperationType,(p=this.resolvers&&this.resolvers[h])&&(y=p[u?i:a])&&(l=Promise.resolve(y(t,(0,o.argumentsObjectFromField)(e,s),n.context,{field:e,fragmentMap:n.fragmentMap})))),[2,l.then(function(t){return void 0===t&&(t=c),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)})}),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,n):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,n):void 0:t})]})})},e.prototype.resolveSubSelectedArray=function(e,t,r){var o=this;return Promise.all(t.map(function(t){return null===t?null:Array.isArray(t)?o.resolveSubSelectedArray(e,t,r):e.selectionSet?o.resolveSelectionSet(e.selectionSet,t,r):void 0}))},e}();function w(e){var t=new Set,r=null;return new c(function(o){return t.add(o),r=r||e.subscribe({next:function(e){t.forEach(function(t){return t.next&&t.next(e)})},error:function(e){t.forEach(function(t){return t.error&&t.error(e)})},complete:function(){t.forEach(function(e){return e.complete&&e.complete()})}}),function(){t.delete(o)&&!t.size&&r&&(r.unsubscribe(),r=null)}})}var S=Object.prototype.hasOwnProperty,q=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,s=e.store,i=e.onBroadcast,a=void 0===i?function(){}:i,u=e.ssrMode,c=void 0!==u&&u,l=e.clientAwareness,h=void 0===l?{}:l,p=e.localState,y=e.assumeImmutableResults;this.mutationStore=new m,this.queryStore=new Q,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(o.canUseWeakMap?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=s,this.onBroadcast=a,this.clientAwareness=h,this.localState=p||new _({cache:s.getCache()}),this.ssrMode=c,this.assumeImmutableResults=!!y}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,r){e.stopQueryNoBroadcast(r)}),this.fetchQueryRejectFns.forEach(function(e){e(new i.InvariantError(8))})},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,s=e.optimisticResponse,a=e.updateQueries,u=e.refetchQueries,c=void 0===u?[]:u,h=e.awaitRefetchQueries,p=void 0!==h&&h,y=e.update,v=e.errorPolicy,d=void 0===v?"none":v,b=e.fetchPolicy,g=e.context,m=void 0===g?{}:g;return(0,r.__awaiter)(this,void 0,void 0,function(){var e,u,h,v=this;return(0,r.__generator)(this,function(g){switch(g.label){case 0:return(0,i.invariant)(t,9),(0,i.invariant)(!b||"no-cache"===b,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,function(){return{document:t}}),n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,m)]:[3,2];case 1:n=g.sent(),g.label=2;case 2:return u=function(){var e={};return a&&v.queries.forEach(function(t,r){var o=t.observableQuery;if(o){var n=o.queryName;n&&S.call(a,n)&&(e[r]={updater:a[n],query:v.queryStore.get(r)})}}),e},this.mutationStore.initMutation(e,t,n),this.dataStore.markMutationInit({mutationId:e,document:t,variables:n,updateQueries:u(),update:y,optimisticResponse:s}),this.broadcastQueries(),h=this,[2,new Promise(function(i,a){var v,g;h.getObservableFromLink(t,(0,r.__assign)((0,r.__assign)({},m),{optimisticResponse:s}),n,!1).subscribe({next:function(r){(0,o.graphQLResultHasError)(r)&&"none"===d?g=new f({graphQLErrors:r.errors}):(h.mutationStore.markMutationResult(e),"no-cache"!==b&&h.dataStore.markMutationResult({mutationId:e,result:r,document:t,variables:n,updateQueries:u(),update:y}),v=r)},error:function(t){h.mutationStore.markMutationError(e,t),h.dataStore.markMutationComplete({mutationId:e,optimisticResponse:s}),h.broadcastQueries(),h.setQuery(e,function(){return{document:null}}),a(new f({networkError:t}))},complete:function(){if(g&&h.mutationStore.markMutationError(e,g),h.dataStore.markMutationComplete({mutationId:e,optimisticResponse:s}),h.broadcastQueries(),g)a(g);else{"function"==typeof c&&(c=c(v));var t=[];l(c)&&c.forEach(function(e){if("string"==typeof e)h.queries.forEach(function(r){var o=r.observableQuery;o&&o.queryName===e&&t.push(o.refetch())});else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(h.query(r))}}),Promise.all(p?t:[]).then(function(){h.setQuery(e,function(){return{document:null}}),"ignore"===d&&v&&(0,o.graphQLResultHasError)(v)&&delete v.errors,i(v)})}}})})]}})})},e.prototype.fetchQuery=function(e,t,n,s){return(0,r.__awaiter)(this,void 0,void 0,function(){var i,a,u,c,l,y,v,d,b,g,m,Q,_,w,S,q,R,k,E=this;return(0,r.__generator)(this,function(M){switch(M.label){case 0:return i=t.metadata,a=void 0===i?null:i,u=t.fetchPolicy,c=void 0===u?"cache-first":u,l=t.context,y=void 0===l?{}:l,v=this.transform(t.query).document,d=this.getVariables(v,t.variables),this.transform(v).hasClientExports?[4,this.localState.addExportedVariables(v,d,y)]:[3,2];case 1:d=M.sent(),M.label=2;case 2:if(t=(0,r.__assign)((0,r.__assign)({},t),{variables:d}),m=g="network-only"===c||"no-cache"===c,g||(Q=this.dataStore.getCache().diff({query:v,variables:d,returnPartialData:!0,optimistic:!1}),_=Q.complete,w=Q.result,m=!_||"cache-and-network"===c,b=w),S=m&&"cache-only"!==c&&"standby"!==c,(0,o.hasDirectives)(["live"],v)&&(S=!0),q=this.idCounter++,R="no-cache"!==c?this.updateQueryWatch(e,v,t):void 0,this.setQuery(e,function(){return{document:v,lastRequestId:q,invalidated:!0,cancel:R}}),this.invalidate(s),this.queryStore.initQuery({queryId:e,document:v,storePreviousVariables:S,variables:d,isPoll:n===p.poll,isRefetch:n===p.refetch,metadata:a,fetchMoreForQueryId:s}),this.broadcastQueries(),S){if(k=this.fetchRequest({requestId:q,queryId:e,document:v,options:t,fetchMoreForQueryId:s}).catch(function(t){throw h(t)?t:(q>=E.getQuery(e).lastRequestId&&(E.queryStore.markQueryError(e,t,s),E.invalidate(e),E.invalidate(s),E.broadcastQueries()),new f({networkError:t}))}),"cache-and-network"!==c)return[2,k];k.catch(function(){})}return this.queryStore.markQueryResultClient(e,!S),this.invalidate(e),this.invalidate(s),this.transform(v).hasForcedResolvers?[2,this.localState.runResolvers({document:v,remoteResult:{data:b},context:y,variables:d,onlyRunForcedResolvers:!0}).then(function(r){return E.markQueryResult(e,r,t,s),E.broadcastQueries(),r})]:(this.broadcastQueries(),[2,{data:b}])}})})},e.prototype.markQueryResult=function(e,t,r,o){var n=r.fetchPolicy,s=r.variables,i=r.errorPolicy;"no-cache"===n?this.setQuery(e,function(){return{newData:{result:t.data,complete:!0}}}):this.dataStore.markQueryResult(t,this.getQuery(e).document,s,o,"ignore"===i||"all"===i)},e.prototype.queryListenerForObserver=function(e,t,r){var o=this;function n(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,s){if(o.invalidate(e,!1),r){var i=o.getQuery(e),a=i.observableQuery,c=i.document,h=a?a.options.fetchPolicy:t.fetchPolicy;if("standby"!==h){var p=u(r.networkStatus),y=a&&a.getLastResult(),v=!(!y||y.networkStatus===r.networkStatus),d=t.returnPartialData||!s&&r.previousVariables||v&&t.notifyOnNetworkStatusChange||"cache-only"===h||"cache-and-network"===h;if(!p||d){var b=l(r.graphQLErrors),g=a&&a.options.errorPolicy||t.errorPolicy||"none";if("none"===g&&b||r.networkError)return n("error",new f({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var m=void 0,Q=void 0;if(s)"no-cache"!==h&&"network-only"!==h&&o.setQuery(e,function(){return{newData:null}}),m=s.result,Q=!s.complete;else{var _=a&&a.getLastError(),w="none"!==g&&(_&&_.graphQLErrors)!==r.graphQLErrors;if(y&&y.data&&!w)m=y.data,Q=!1;else{var S=o.dataStore.getCache().diff({query:c,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});m=S.result,Q=!S.complete}}var q=Q&&!(t.returnPartialData||"cache-only"===h),R={data:q?y&&y.data:m,loading:p,networkStatus:r.networkStatus,stale:q};"all"===g&&b&&(R.errors=r.graphQLErrors),n("next",R)}catch(e){n("error",new f({networkError:e}))}}}}}},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.dataStore.getCache(),n=r.transformDocument(e),s=(0,o.removeConnectionDirectiveFromDocument)(r.transformForLink(n)),i=this.localState.clientQuery(n),a=this.localState.serverQuery(s),u={document:n,hasClientExports:(0,o.hasClientExports)(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,serverQuery:a,defaultVars:(0,o.getDefaultValues)((0,o.getOperationDefinition)(n))},c=function(e){e&&!t.has(e)&&t.set(e,u)};c(e),c(n),c(i),c(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,r.__assign)((0,r.__assign)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),(0,i.invariant)("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var o=(0,r.__assign)({},e);return new v({queryManager:this,options:o,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return(0,i.invariant)(e.query,12),(0,i.invariant)("Document"===e.query.kind,13),(0,i.invariant)(!e.returnPartialData,14),(0,i.invariant)(!e.pollInterval,15),new Promise(function(r,o){var n=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+n.queryId,o),n.result().then(r,o).then(function(){return t.fetchQueryRejectFns.delete("query:"+n.queryId)})})},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){return e.listeners.add(t),{invalidated:!1}})},e.prototype.updateQueryWatch=function(e,t,r){var o=this,n=this.getQuery(e).cancel;n&&n();return this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=o.getQuery(e).observableQuery;if(r){var n=r.getLastResult();n&&(t=n.data)}return t},callback:function(t){o.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}})},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,function(){return{observableQuery:null}}),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach(function(e){e(new i.InvariantError(16))});var e=[];return this.queries.forEach(function(t,r){t.observableQuery&&e.push(r)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach(function(o,n){var s=o.observableQuery;if(s){var i=s.options.fetchPolicy;s.resetLastResults(),"cache-only"===i||!e&&"standby"===i||r.push(s.refetch()),t.setQuery(n,function(){return{newData:null}}),t.invalidate(n)}}),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch(function(){}),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,s=e.variables;r=this.transform(r).document,s=this.getVariables(r,s);var i=function(e){return t.getObservableFromLink(r,{},e,!1).map(function(s){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(s,r,e),t.broadcastQueries()),(0,o.graphQLResultHasError)(s))throw new f({graphQLErrors:s.errors});return s})};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,s).then(i);return new c(function(e){var t=null;return a.then(function(r){return t=r.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return i(s)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,o=r.variables,n=r.query,s=r.fetchPolicy,i=r.returnPartialData,a=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===s||"network-only"===s)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:n,variables:o,previousResult:a?a.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||i?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;(0,i.invariant)(r,17),t=r}else t=e;var o=t.options,n=o.variables,s=o.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:n,document:s}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,r){t.invalidated&&t.listeners.forEach(function(o){o&&o(e.queryStore.get(r),t.newData)})})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,s,i){var a,u=this;void 0===i&&(i=this.queryDeduplication);var l=this.transform(e).serverQuery;if(l){var h=this.inFlightLinkObservables,p=this.link,y={query:l,variables:s,operationName:(0,o.getOperationName)(l)||void 0,context:this.prepareContext((0,r.__assign)((0,r.__assign)({},t),{forceFetch:!i}))};if(t=y.context,i){var f=h.get(l)||new Map;h.set(l,f);var v=JSON.stringify(s);if(!(a=f.get(v))){f.set(v,a=w((0,n.execute)(p,y)));var d=function(){f.delete(v),f.size||h.delete(l),b.unsubscribe()},b=a.subscribe({next:d,error:d,complete:d})}}else a=w((0,n.execute)(p,y))}else a=c.of({data:{}}),t=this.prepareContext(t);var g=this.transform(e).clientQuery;return g&&(a=function(e,t){return new c(function(r){var o=r.next,n=r.error,s=r.complete,i=0,a=!1,u={next:function(e){++i,new Promise(function(r){r(t(e))}).then(function(e){--i,o&&o.call(r,e),a&&u.complete()},function(e){--i,n&&n.call(r,e)})},error:function(e){n&&n.call(r,e)},complete:function(){a=!0,i||s&&s.call(r)}},c=e.subscribe(u);return function(){return c.unsubscribe()}})}(a,function(e){return u.localState.runResolvers({document:g,remoteResult:e,context:t,variables:s})})),a},e.prototype.fetchRequest=function(e){var r,o,n=this,s=e.requestId,i=e.queryId,a=e.document,u=e.options,c=e.fetchMoreForQueryId,h=u.variables,p=u.errorPolicy,y=void 0===p?"none":p,v=u.fetchPolicy;return new Promise(function(e,p){var d=n.getObservableFromLink(a,u.context,h),b="fetchRequest:"+i;n.fetchQueryRejectFns.set(b,p);var g=function(){n.fetchQueryRejectFns.delete(b),n.setQuery(i,function(e){e.subscriptions.delete(m)})},m=d.map(function(e){if(s>=n.getQuery(i).lastRequestId&&(n.markQueryResult(i,e,u,c),n.queryStore.markQueryResult(i,e,c),n.invalidate(i),n.invalidate(c),n.broadcastQueries()),"none"===y&&l(e.errors))return p(new f({graphQLErrors:e.errors}));if("all"===y&&(o=e.errors),c||"no-cache"===v)r=e.data;else{var t=n.dataStore.getCache().diff({variables:h,query:a,optimistic:!1,returnPartialData:!0}),d=t.result;(t.complete||u.returnPartialData)&&(r=d)}}).subscribe({error:function(e){g(),p(e)},complete:function(){g(),e({data:r,errors:o,loading:!1,networkStatus:t.ready,stale:!1})}});n.setQuery(i,function(e){e.subscriptions.add(m)})})},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var o=this.getQuery(e),n=(0,r.__assign)((0,r.__assign)({},o),t(o));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,function(){return{invalidated:t}})},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,r.__assign)((0,r.__assign)({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var r=this.queryStore.get(e);return r&&r.networkStatus!==t.ready&&r.networkStatus!==t.error},e.prototype.startPollingQuery=function(e,t,o){var n=this,s=e.pollInterval;if((0,i.invariant)(s,18),!this.ssrMode){var a=this.pollingInfoByQueryId.get(t);a||this.pollingInfoByQueryId.set(t,a={}),a.interval=s,a.options=(0,r.__assign)((0,r.__assign)({},e),{fetchPolicy:"network-only"});var u=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?c():n.fetchQuery(t,e.options,p.poll).then(c,c))},c=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(u,e.interval))};o&&this.addQueryListener(t,o),c()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),R=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,s){void 0===s&&(s=!1);var i=!(0,o.graphQLResultHasError)(e);s&&(0,o.graphQLResultHasError)(e)&&e.data&&(i=!0),!n&&i&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){(0,o.graphQLResultHasError)(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction(function(o){var n=r.cache;r.cache=o;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=n}},e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!(0,o.graphQLResultHasError)(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach(function(s){var i=n[s],a=i.query,u=i.updater,c=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),l=c.result;if(c.complete){var h=(0,o.tryFunctionOrLogError)(function(){return u(l,{mutationResult:e.result,queryName:(0,o.getOperationName)(a.document)||void 0,queryVariables:a.variables})});h&&r.push({result:h,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}}),this.cache.performTransaction(function(t){r.forEach(function(e){return t.write(e)});var n=e.update;n&&(0,o.tryFunctionOrLogError)(function(){return n(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),k="2.6.10",E=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,o=e.ssrMode,s=void 0!==o&&o,a=e.ssrForceFetchDelay,u=void 0===a?0:a,c=e.connectToDevTools,l=e.queryDeduplication,h=void 0===l||l,p=e.defaultOptions,y=e.assumeImmutableResults,f=void 0!==y&&y,v=e.resolvers,d=e.typeDefs,b=e.fragmentMatcher,g=e.name,m=e.version,Q=e.link;if(!Q&&v&&(Q=n.ApolloLink.empty()),!Q||!r)throw new i.InvariantError(4);this.link=Q,this.cache=r,this.store=new R(r),this.disableNetworkFetches=s||u>0,this.queryDeduplication=h,this.defaultOptions=p||{},this.typeDefs=d,u&&setTimeout(function(){return t.disableNetworkFetches=!1},u),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);void 0!==c&&(c&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),this.version=k,this.localState=new _({cache:r,client:this,resolvers:v,fragmentMatcher:b}),this.queryManager=new q({link:this.link,store:this.store,queryDeduplication:h,ssrMode:s,clientAwareness:{name:g,version:m},localState:this.localState,assumeImmutableResults:f,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=(0,r.__assign)((0,r.__assign)({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,r.__assign)((0,r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,r.__assign)((0,r.__assign)({},this.defaultOptions.query),e)),(0,i.invariant)("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,r.__assign)((0,r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,r.__assign)((0,r.__assign)({},this.defaultOptions.mutate),e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,n.execute)(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(e){return e()}))}).then(function(){return e.reFetchObservableQueries()})},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(e){return e()}))})},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(t){return t!==e})}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}();exports.ApolloClient=E;var M=E;exports.default=M; diff --git a/node_modules/apollo-client/bundle.esm.js b/node_modules/apollo-client/bundle.esm.js deleted file mode 100644 index 450ae21..0000000 --- a/node_modules/apollo-client/bundle.esm.js +++ /dev/null @@ -1,2108 +0,0 @@ -import { __extends, __assign, __awaiter, __generator } from 'tslib'; -import { getOperationDefinition, isEqual, tryFunctionOrLogError, cloneDeep, mergeDeep, hasDirectives, removeClientSetsFromDocument, buildQueryFromSelectionSet, getMainDefinition, getFragmentDefinitions, createFragmentMap, mergeDeepArray, resultKeyNameFromField, argumentsObjectFromField, shouldInclude, isField, isInlineFragment, canUseWeakMap, graphQLResultHasError, removeConnectionDirectiveFromDocument, hasClientExports, getDefaultValues, getOperationName } from 'apollo-utilities'; -import { Observable as Observable$1, execute, ApolloLink } from 'apollo-link'; -import $$observable from 'symbol-observable'; -import { InvariantError, invariant } from 'ts-invariant'; -import { visit, BREAK } from 'graphql/language/visitor'; - -var NetworkStatus; -(function (NetworkStatus) { - NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; - NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; - NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; - NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; - NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; - NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; - NetworkStatus[NetworkStatus["error"] = 8] = "error"; -})(NetworkStatus || (NetworkStatus = {})); -function isNetworkRequestInFlight(networkStatus) { - return networkStatus < 7; -} - -var Observable = (function (_super) { - __extends(Observable, _super); - function Observable() { - return _super !== null && _super.apply(this, arguments) || this; - } - Observable.prototype[$$observable] = function () { - return this; - }; - Observable.prototype['@@observable'] = function () { - return this; - }; - return Observable; -}(Observable$1)); - -function isNonEmptyArray(value) { - return Array.isArray(value) && value.length > 0; -} - -function isApolloError(err) { - return err.hasOwnProperty('graphQLErrors'); -} -var generateErrorMessage = function (err) { - var message = ''; - if (isNonEmptyArray(err.graphQLErrors)) { - err.graphQLErrors.forEach(function (graphQLError) { - var errorMessage = graphQLError - ? graphQLError.message - : 'Error message not found.'; - message += "GraphQL error: " + errorMessage + "\n"; - }); - } - if (err.networkError) { - message += 'Network error: ' + err.networkError.message + '\n'; - } - message = message.replace(/\n$/, ''); - return message; -}; -var ApolloError = (function (_super) { - __extends(ApolloError, _super); - function ApolloError(_a) { - var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo; - var _this = _super.call(this, errorMessage) || this; - _this.graphQLErrors = graphQLErrors || []; - _this.networkError = networkError || null; - if (!errorMessage) { - _this.message = generateErrorMessage(_this); - } - else { - _this.message = errorMessage; - } - _this.extraInfo = extraInfo; - _this.__proto__ = ApolloError.prototype; - return _this; - } - return ApolloError; -}(Error)); - -var FetchType; -(function (FetchType) { - FetchType[FetchType["normal"] = 1] = "normal"; - FetchType[FetchType["refetch"] = 2] = "refetch"; - FetchType[FetchType["poll"] = 3] = "poll"; -})(FetchType || (FetchType = {})); - -var hasError = function (storeValue, policy) { - if (policy === void 0) { policy = 'none'; } - return storeValue && (storeValue.networkError || - (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))); -}; -var ObservableQuery = (function (_super) { - __extends(ObservableQuery, _super); - function ObservableQuery(_a) { - var queryManager = _a.queryManager, options = _a.options, _b = _a.shouldSubscribe, shouldSubscribe = _b === void 0 ? true : _b; - var _this = _super.call(this, function (observer) { - return _this.onSubscribe(observer); - }) || this; - _this.observers = new Set(); - _this.subscriptions = new Set(); - _this.isTornDown = false; - _this.options = options; - _this.variables = options.variables || {}; - _this.queryId = queryManager.generateQueryId(); - _this.shouldSubscribe = shouldSubscribe; - var opDef = getOperationDefinition(options.query); - _this.queryName = opDef && opDef.name && opDef.name.value; - _this.queryManager = queryManager; - return _this; - } - ObservableQuery.prototype.result = function () { - var _this = this; - return new Promise(function (resolve, reject) { - var observer = { - next: function (result) { - resolve(result); - _this.observers.delete(observer); - if (!_this.observers.size) { - _this.queryManager.removeQuery(_this.queryId); - } - setTimeout(function () { - subscription.unsubscribe(); - }, 0); - }, - error: reject, - }; - var subscription = _this.subscribe(observer); - }); - }; - ObservableQuery.prototype.currentResult = function () { - var result = this.getCurrentResult(); - if (result.data === undefined) { - result.data = {}; - } - return result; - }; - ObservableQuery.prototype.getCurrentResult = function () { - if (this.isTornDown) { - var lastResult = this.lastResult; - return { - data: !this.lastError && lastResult && lastResult.data || void 0, - error: this.lastError, - loading: false, - networkStatus: NetworkStatus.error, - }; - } - var _a = this.queryManager.getCurrentQueryResult(this), data = _a.data, partial = _a.partial; - var queryStoreValue = this.queryManager.queryStore.get(this.queryId); - var result; - var fetchPolicy = this.options.fetchPolicy; - var isNetworkFetchPolicy = fetchPolicy === 'network-only' || - fetchPolicy === 'no-cache'; - if (queryStoreValue) { - var networkStatus = queryStoreValue.networkStatus; - if (hasError(queryStoreValue, this.options.errorPolicy)) { - return { - data: void 0, - loading: false, - networkStatus: networkStatus, - error: new ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError, - }), - }; - } - if (queryStoreValue.variables) { - this.options.variables = __assign(__assign({}, this.options.variables), queryStoreValue.variables); - this.variables = this.options.variables; - } - result = { - data: data, - loading: isNetworkRequestInFlight(networkStatus), - networkStatus: networkStatus, - }; - if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { - result.errors = queryStoreValue.graphQLErrors; - } - } - else { - var loading = isNetworkFetchPolicy || - (partial && fetchPolicy !== 'cache-only'); - result = { - data: data, - loading: loading, - networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready, - }; - } - if (!partial) { - this.updateLastResult(__assign(__assign({}, result), { stale: false })); - } - return __assign(__assign({}, result), { partial: partial }); - }; - ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { - var snapshot = this.lastResultSnapshot; - return !(snapshot && - newResult && - snapshot.networkStatus === newResult.networkStatus && - snapshot.stale === newResult.stale && - isEqual(snapshot.data, newResult.data)); - }; - ObservableQuery.prototype.getLastResult = function () { - return this.lastResult; - }; - ObservableQuery.prototype.getLastError = function () { - return this.lastError; - }; - ObservableQuery.prototype.resetLastResults = function () { - delete this.lastResult; - delete this.lastResultSnapshot; - delete this.lastError; - this.isTornDown = false; - }; - ObservableQuery.prototype.resetQueryStoreErrors = function () { - var queryStore = this.queryManager.queryStore.get(this.queryId); - if (queryStore) { - queryStore.networkError = null; - queryStore.graphQLErrors = []; - } - }; - ObservableQuery.prototype.refetch = function (variables) { - var fetchPolicy = this.options.fetchPolicy; - if (fetchPolicy === 'cache-only') { - return Promise.reject(process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); - } - if (fetchPolicy !== 'no-cache' && - fetchPolicy !== 'cache-and-network') { - fetchPolicy = 'network-only'; - } - if (!isEqual(this.variables, variables)) { - this.variables = __assign(__assign({}, this.variables), variables); - } - if (!isEqual(this.options.variables, this.variables)) { - this.options.variables = __assign(__assign({}, this.options.variables), this.variables); - } - return this.queryManager.fetchQuery(this.queryId, __assign(__assign({}, this.options), { fetchPolicy: fetchPolicy }), FetchType.refetch); - }; - ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { - var _this = this; - process.env.NODE_ENV === "production" ? invariant(fetchMoreOptions.updateQuery, 2) : invariant(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); - var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign(__assign(__assign({}, this.options), fetchMoreOptions), { variables: __assign(__assign({}, this.variables), fetchMoreOptions.variables) }))), { fetchPolicy: 'network-only' }); - var qid = this.queryManager.generateQueryId(); - return this.queryManager - .fetchQuery(qid, combinedOptions, FetchType.normal, this.queryId) - .then(function (fetchMoreResult) { - _this.updateQuery(function (previousResult) { - return fetchMoreOptions.updateQuery(previousResult, { - fetchMoreResult: fetchMoreResult.data, - variables: combinedOptions.variables, - }); - }); - _this.queryManager.stopQuery(qid); - return fetchMoreResult; - }, function (error) { - _this.queryManager.stopQuery(qid); - throw error; - }); - }; - ObservableQuery.prototype.subscribeToMore = function (options) { - var _this = this; - var subscription = this.queryManager - .startGraphQLSubscription({ - query: options.document, - variables: options.variables, - }) - .subscribe({ - next: function (subscriptionData) { - var updateQuery = options.updateQuery; - if (updateQuery) { - _this.updateQuery(function (previous, _a) { - var variables = _a.variables; - return updateQuery(previous, { - subscriptionData: subscriptionData, - variables: variables, - }); - }); - } - }, - error: function (err) { - if (options.onError) { - options.onError(err); - return; - } - process.env.NODE_ENV === "production" || invariant.error('Unhandled GraphQL subscription error', err); - }, - }); - this.subscriptions.add(subscription); - return function () { - if (_this.subscriptions.delete(subscription)) { - subscription.unsubscribe(); - } - }; - }; - ObservableQuery.prototype.setOptions = function (opts) { - var oldFetchPolicy = this.options.fetchPolicy; - this.options = __assign(__assign({}, this.options), opts); - if (opts.pollInterval) { - this.startPolling(opts.pollInterval); - } - else if (opts.pollInterval === 0) { - this.stopPolling(); - } - var fetchPolicy = opts.fetchPolicy; - return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || - oldFetchPolicy === 'standby' || - fetchPolicy === 'network-only'), opts.fetchResults); - }; - ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { - if (tryFetch === void 0) { tryFetch = false; } - if (fetchResults === void 0) { fetchResults = true; } - this.isTornDown = false; - variables = variables || this.variables; - if (!tryFetch && isEqual(variables, this.variables)) { - return this.observers.size && fetchResults - ? this.result() - : Promise.resolve(); - } - this.variables = this.options.variables = variables; - if (!this.observers.size) { - return Promise.resolve(); - } - return this.queryManager.fetchQuery(this.queryId, this.options); - }; - ObservableQuery.prototype.updateQuery = function (mapFn) { - var queryManager = this.queryManager; - var _a = queryManager.getQueryWithPreviousResult(this.queryId), previousResult = _a.previousResult, variables = _a.variables, document = _a.document; - var newResult = tryFunctionOrLogError(function () { - return mapFn(previousResult, { variables: variables }); - }); - if (newResult) { - queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); - queryManager.broadcastQueries(); - } - }; - ObservableQuery.prototype.stopPolling = function () { - this.queryManager.stopPollingQuery(this.queryId); - this.options.pollInterval = undefined; - }; - ObservableQuery.prototype.startPolling = function (pollInterval) { - assertNotCacheFirstOrOnly(this); - this.options.pollInterval = pollInterval; - this.queryManager.startPollingQuery(this.options, this.queryId); - }; - ObservableQuery.prototype.updateLastResult = function (newResult) { - var previousResult = this.lastResult; - this.lastResult = newResult; - this.lastResultSnapshot = this.queryManager.assumeImmutableResults - ? newResult - : cloneDeep(newResult); - return previousResult; - }; - ObservableQuery.prototype.onSubscribe = function (observer) { - var _this = this; - try { - var subObserver = observer._subscription._observer; - if (subObserver && !subObserver.error) { - subObserver.error = defaultSubscriptionObserverErrorCallback; - } - } - catch (_a) { } - var first = !this.observers.size; - this.observers.add(observer); - if (observer.next && this.lastResult) - observer.next(this.lastResult); - if (observer.error && this.lastError) - observer.error(this.lastError); - if (first) { - this.setUpQuery(); - } - return function () { - if (_this.observers.delete(observer) && !_this.observers.size) { - _this.tearDownQuery(); - } - }; - }; - ObservableQuery.prototype.setUpQuery = function () { - var _this = this; - var _a = this, queryManager = _a.queryManager, queryId = _a.queryId; - if (this.shouldSubscribe) { - queryManager.addObservableQuery(queryId, this); - } - if (this.options.pollInterval) { - assertNotCacheFirstOrOnly(this); - queryManager.startPollingQuery(this.options, queryId); - } - var onError = function (error) { - _this.updateLastResult(__assign(__assign({}, _this.lastResult), { errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false })); - iterateObserversSafely(_this.observers, 'error', _this.lastError = error); - }; - queryManager.observeQuery(queryId, this.options, { - next: function (result) { - if (_this.lastError || _this.isDifferentFromLastResult(result)) { - var previousResult_1 = _this.updateLastResult(result); - var _a = _this.options, query_1 = _a.query, variables = _a.variables, fetchPolicy_1 = _a.fetchPolicy; - if (queryManager.transform(query_1).hasClientExports) { - queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { - var previousVariables = _this.variables; - _this.variables = _this.options.variables = variables; - if (!result.loading && - previousResult_1 && - fetchPolicy_1 !== 'cache-only' && - queryManager.transform(query_1).serverQuery && - !isEqual(previousVariables, variables)) { - _this.refetch(); - } - else { - iterateObserversSafely(_this.observers, 'next', result); - } - }); - } - else { - iterateObserversSafely(_this.observers, 'next', result); - } - } - }, - error: onError, - }).catch(onError); - }; - ObservableQuery.prototype.tearDownQuery = function () { - var queryManager = this.queryManager; - this.isTornDown = true; - queryManager.stopPollingQuery(this.queryId); - this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); }); - this.subscriptions.clear(); - queryManager.removeObservableQuery(this.queryId); - queryManager.stopQuery(this.queryId); - this.observers.clear(); - }; - return ObservableQuery; -}(Observable)); -function defaultSubscriptionObserverErrorCallback(error) { - process.env.NODE_ENV === "production" || invariant.error('Unhandled error', error.message, error.stack); -} -function iterateObserversSafely(observers, method, argument) { - var observersWithMethod = []; - observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); }); - observersWithMethod.forEach(function (obs) { return obs[method](argument); }); -} -function assertNotCacheFirstOrOnly(obsQuery) { - var fetchPolicy = obsQuery.options.fetchPolicy; - process.env.NODE_ENV === "production" ? invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 3) : invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); -} - -var MutationStore = (function () { - function MutationStore() { - this.store = {}; - } - MutationStore.prototype.getStore = function () { - return this.store; - }; - MutationStore.prototype.get = function (mutationId) { - return this.store[mutationId]; - }; - MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { - this.store[mutationId] = { - mutation: mutation, - variables: variables || {}, - loading: true, - error: null, - }; - }; - MutationStore.prototype.markMutationError = function (mutationId, error) { - var mutation = this.store[mutationId]; - if (mutation) { - mutation.loading = false; - mutation.error = error; - } - }; - MutationStore.prototype.markMutationResult = function (mutationId) { - var mutation = this.store[mutationId]; - if (mutation) { - mutation.loading = false; - mutation.error = null; - } - }; - MutationStore.prototype.reset = function () { - this.store = {}; - }; - return MutationStore; -}()); - -var QueryStore = (function () { - function QueryStore() { - this.store = {}; - } - QueryStore.prototype.getStore = function () { - return this.store; - }; - QueryStore.prototype.get = function (queryId) { - return this.store[queryId]; - }; - QueryStore.prototype.initQuery = function (query) { - var previousQuery = this.store[query.queryId]; - process.env.NODE_ENV === "production" ? invariant(!previousQuery || - previousQuery.document === query.document || - isEqual(previousQuery.document, query.document), 19) : invariant(!previousQuery || - previousQuery.document === query.document || - isEqual(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); - var isSetVariables = false; - var previousVariables = null; - if (query.storePreviousVariables && - previousQuery && - previousQuery.networkStatus !== NetworkStatus.loading) { - if (!isEqual(previousQuery.variables, query.variables)) { - isSetVariables = true; - previousVariables = previousQuery.variables; - } - } - var networkStatus; - if (isSetVariables) { - networkStatus = NetworkStatus.setVariables; - } - else if (query.isPoll) { - networkStatus = NetworkStatus.poll; - } - else if (query.isRefetch) { - networkStatus = NetworkStatus.refetch; - } - else { - networkStatus = NetworkStatus.loading; - } - var graphQLErrors = []; - if (previousQuery && previousQuery.graphQLErrors) { - graphQLErrors = previousQuery.graphQLErrors; - } - this.store[query.queryId] = { - document: query.document, - variables: query.variables, - previousVariables: previousVariables, - networkError: null, - graphQLErrors: graphQLErrors, - networkStatus: networkStatus, - metadata: query.metadata, - }; - if (typeof query.fetchMoreForQueryId === 'string' && - this.store[query.fetchMoreForQueryId]) { - this.store[query.fetchMoreForQueryId].networkStatus = - NetworkStatus.fetchMore; - } - }; - QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) - return; - this.store[queryId].networkError = null; - this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : []; - this.store[queryId].previousVariables = null; - this.store[queryId].networkStatus = NetworkStatus.ready; - if (typeof fetchMoreForQueryId === 'string' && - this.store[fetchMoreForQueryId]) { - this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready; - } - }; - QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) - return; - this.store[queryId].networkError = error; - this.store[queryId].networkStatus = NetworkStatus.error; - if (typeof fetchMoreForQueryId === 'string') { - this.markQueryResultClient(fetchMoreForQueryId, true); - } - }; - QueryStore.prototype.markQueryResultClient = function (queryId, complete) { - var storeValue = this.store && this.store[queryId]; - if (storeValue) { - storeValue.networkError = null; - storeValue.previousVariables = null; - if (complete) { - storeValue.networkStatus = NetworkStatus.ready; - } - } - }; - QueryStore.prototype.stopQuery = function (queryId) { - delete this.store[queryId]; - }; - QueryStore.prototype.reset = function (observableQueryIds) { - var _this = this; - Object.keys(this.store).forEach(function (queryId) { - if (observableQueryIds.indexOf(queryId) < 0) { - _this.stopQuery(queryId); - } - else { - _this.store[queryId].networkStatus = NetworkStatus.loading; - } - }); - }; - return QueryStore; -}()); - -function capitalizeFirstLetter(str) { - return str.charAt(0).toUpperCase() + str.slice(1); -} - -var LocalState = (function () { - function LocalState(_a) { - var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher; - this.cache = cache; - if (client) { - this.client = client; - } - if (resolvers) { - this.addResolvers(resolvers); - } - if (fragmentMatcher) { - this.setFragmentMatcher(fragmentMatcher); - } - } - LocalState.prototype.addResolvers = function (resolvers) { - var _this = this; - this.resolvers = this.resolvers || {}; - if (Array.isArray(resolvers)) { - resolvers.forEach(function (resolverGroup) { - _this.resolvers = mergeDeep(_this.resolvers, resolverGroup); - }); - } - else { - this.resolvers = mergeDeep(this.resolvers, resolvers); - } - }; - LocalState.prototype.setResolvers = function (resolvers) { - this.resolvers = {}; - this.addResolvers(resolvers); - }; - LocalState.prototype.getResolvers = function () { - return this.resolvers || {}; - }; - LocalState.prototype.runResolvers = function (_a) { - var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b; - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_c) { - if (document) { - return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (__assign(__assign({}, remoteResult), { data: localResult.result })); })]; - } - return [2, remoteResult]; - }); - }); - }; - LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { - this.fragmentMatcher = fragmentMatcher; - }; - LocalState.prototype.getFragmentMatcher = function () { - return this.fragmentMatcher; - }; - LocalState.prototype.clientQuery = function (document) { - if (hasDirectives(['client'], document)) { - if (this.resolvers) { - return document; - } - process.env.NODE_ENV === "production" || invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + - 'were specified. This means ApolloClient local resolver handling ' + - 'has been disabled, and @client directives will be passed through ' + - 'to your link chain.'); - } - return null; - }; - LocalState.prototype.serverQuery = function (document) { - return this.resolvers ? removeClientSetsFromDocument(document) : document; - }; - LocalState.prototype.prepareContext = function (context) { - if (context === void 0) { context = {}; } - var cache = this.cache; - var newContext = __assign(__assign({}, context), { cache: cache, getCacheKey: function (obj) { - if (cache.config) { - return cache.config.dataIdFromObject(obj); - } - else { - process.env.NODE_ENV === "production" ? invariant(false, 6) : invariant(false, 'To use context.getCacheKey, you need to use a cache that has ' + - 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); - } - } }); - return newContext; - }; - LocalState.prototype.addExportedVariables = function (document, variables, context) { - if (variables === void 0) { variables = {}; } - if (context === void 0) { context = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (document) { - return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (__assign(__assign({}, variables), data.exportedVariables)); })]; - } - return [2, __assign({}, variables)]; - }); - }); - }; - LocalState.prototype.shouldForceResolvers = function (document) { - var forceResolvers = false; - visit(document, { - Directive: { - enter: function (node) { - if (node.name.value === 'client' && node.arguments) { - forceResolvers = node.arguments.some(function (arg) { - return arg.name.value === 'always' && - arg.value.kind === 'BooleanValue' && - arg.value.value === true; - }); - if (forceResolvers) { - return BREAK; - } - } - }, - }, - }); - return forceResolvers; - }; - LocalState.prototype.buildRootValueFromCache = function (document, variables) { - return this.cache.diff({ - query: buildQueryFromSelectionSet(document), - variables: variables, - returnPartialData: true, - optimistic: false, - }).result; - }; - LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { - if (context === void 0) { context = {}; } - if (variables === void 0) { variables = {}; } - if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; } - if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; } - return __awaiter(this, void 0, void 0, function () { - var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; - return __generator(this, function (_b) { - mainDefinition = getMainDefinition(document); - fragments = getFragmentDefinitions(document); - fragmentMap = createFragmentMap(fragments); - definitionOperation = mainDefinition - .operation; - defaultOperationType = definitionOperation - ? capitalizeFirstLetter(definitionOperation) - : 'Query'; - _a = this, cache = _a.cache, client = _a.client; - execContext = { - fragmentMap: fragmentMap, - context: __assign(__assign({}, context), { cache: cache, - client: client }), - variables: variables, - fragmentMatcher: fragmentMatcher, - defaultOperationType: defaultOperationType, - exportedVariables: {}, - onlyRunForcedResolvers: onlyRunForcedResolvers, - }; - return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { return ({ - result: result, - exportedVariables: execContext.exportedVariables, - }); })]; - }); - }); - }; - LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { - return __awaiter(this, void 0, void 0, function () { - var fragmentMap, context, variables, resultsToMerge, execute; - var _this = this; - return __generator(this, function (_a) { - fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; - resultsToMerge = [rootValue]; - execute = function (selection) { return __awaiter(_this, void 0, void 0, function () { - var fragment, typeCondition; - return __generator(this, function (_a) { - if (!shouldInclude(selection, variables)) { - return [2]; - } - if (isField(selection)) { - return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { - var _a; - if (typeof fieldResult !== 'undefined') { - resultsToMerge.push((_a = {}, - _a[resultKeyNameFromField(selection)] = fieldResult, - _a)); - } - })]; - } - if (isInlineFragment(selection)) { - fragment = selection; - } - else { - fragment = fragmentMap[selection.name.value]; - process.env.NODE_ENV === "production" ? invariant(fragment, 7) : invariant(fragment, "No fragment named " + selection.name.value); - } - if (fragment && fragment.typeCondition) { - typeCondition = fragment.typeCondition.name.value; - if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { - return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { - resultsToMerge.push(fragmentResult); - })]; - } - } - return [2]; - }); - }); }; - return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { - return mergeDeepArray(resultsToMerge); - })]; - }); - }); - }; - LocalState.prototype.resolveField = function (field, rootValue, execContext) { - return __awaiter(this, void 0, void 0, function () { - var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; - var _this = this; - return __generator(this, function (_a) { - variables = execContext.variables; - fieldName = field.name.value; - aliasedFieldName = resultKeyNameFromField(field); - aliasUsed = fieldName !== aliasedFieldName; - defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; - resultPromise = Promise.resolve(defaultResult); - if (!execContext.onlyRunForcedResolvers || - this.shouldForceResolvers(field)) { - resolverType = rootValue.__typename || execContext.defaultOperationType; - resolverMap = this.resolvers && this.resolvers[resolverType]; - if (resolverMap) { - resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; - if (resolve) { - resultPromise = Promise.resolve(resolve(rootValue, argumentsObjectFromField(field, variables), execContext.context, { field: field, fragmentMap: execContext.fragmentMap })); - } - } - } - return [2, resultPromise.then(function (result) { - if (result === void 0) { result = defaultResult; } - if (field.directives) { - field.directives.forEach(function (directive) { - if (directive.name.value === 'export' && directive.arguments) { - directive.arguments.forEach(function (arg) { - if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { - execContext.exportedVariables[arg.value.value] = result; - } - }); - } - }); - } - if (!field.selectionSet) { - return result; - } - if (result == null) { - return result; - } - if (Array.isArray(result)) { - return _this.resolveSubSelectedArray(field, result, execContext); - } - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, result, execContext); - } - })]; - }); - }); - }; - LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { - var _this = this; - return Promise.all(result.map(function (item) { - if (item === null) { - return null; - } - if (Array.isArray(item)) { - return _this.resolveSubSelectedArray(field, item, execContext); - } - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, item, execContext); - } - })); - }; - return LocalState; -}()); - -function multiplex(inner) { - var observers = new Set(); - var sub = null; - return new Observable(function (observer) { - observers.add(observer); - sub = sub || inner.subscribe({ - next: function (value) { - observers.forEach(function (obs) { return obs.next && obs.next(value); }); - }, - error: function (error) { - observers.forEach(function (obs) { return obs.error && obs.error(error); }); - }, - complete: function () { - observers.forEach(function (obs) { return obs.complete && obs.complete(); }); - }, - }); - return function () { - if (observers.delete(observer) && !observers.size && sub) { - sub.unsubscribe(); - sub = null; - } - }; - }); -} -function asyncMap(observable, mapFn) { - return new Observable(function (observer) { - var next = observer.next, error = observer.error, complete = observer.complete; - var activeNextCount = 0; - var completed = false; - var handler = { - next: function (value) { - ++activeNextCount; - new Promise(function (resolve) { - resolve(mapFn(value)); - }).then(function (result) { - --activeNextCount; - next && next.call(observer, result); - completed && handler.complete(); - }, function (e) { - --activeNextCount; - error && error.call(observer, e); - }); - }, - error: function (e) { - error && error.call(observer, e); - }, - complete: function () { - completed = true; - if (!activeNextCount) { - complete && complete.call(observer); - } - }, - }; - var sub = observable.subscribe(handler); - return function () { return sub.unsubscribe(); }; - }); -} - -var hasOwnProperty = Object.prototype.hasOwnProperty; -var QueryManager = (function () { - function QueryManager(_a) { - var link = _a.link, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, store = _a.store, _c = _a.onBroadcast, onBroadcast = _c === void 0 ? function () { return undefined; } : _c, _d = _a.ssrMode, ssrMode = _d === void 0 ? false : _d, _e = _a.clientAwareness, clientAwareness = _e === void 0 ? {} : _e, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults; - this.mutationStore = new MutationStore(); - this.queryStore = new QueryStore(); - this.clientAwareness = {}; - this.idCounter = 1; - this.queries = new Map(); - this.fetchQueryRejectFns = new Map(); - this.transformCache = new (canUseWeakMap ? WeakMap : Map)(); - this.inFlightLinkObservables = new Map(); - this.pollingInfoByQueryId = new Map(); - this.link = link; - this.queryDeduplication = queryDeduplication; - this.dataStore = store; - this.onBroadcast = onBroadcast; - this.clientAwareness = clientAwareness; - this.localState = localState || new LocalState({ cache: store.getCache() }); - this.ssrMode = ssrMode; - this.assumeImmutableResults = !!assumeImmutableResults; - } - QueryManager.prototype.stop = function () { - var _this = this; - this.queries.forEach(function (_info, queryId) { - _this.stopQueryNoBroadcast(queryId); - }); - this.fetchQueryRejectFns.forEach(function (reject) { - reject(process.env.NODE_ENV === "production" ? new InvariantError(8) : new InvariantError('QueryManager stopped while query was in flight')); - }); - }; - QueryManager.prototype.mutate = function (_a) { - var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueriesByName = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e; - return __awaiter(this, void 0, void 0, function () { - var mutationId, generateUpdateQueriesInfo, self; - var _this = this; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - process.env.NODE_ENV === "production" ? invariant(mutation, 9) : invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); - process.env.NODE_ENV === "production" ? invariant(!fetchPolicy || fetchPolicy === 'no-cache', 10) : invariant(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - mutationId = this.generateQueryId(); - mutation = this.transform(mutation).document; - this.setQuery(mutationId, function () { return ({ document: mutation }); }); - variables = this.getVariables(mutation, variables); - if (!this.transform(mutation).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(mutation, variables, context)]; - case 1: - variables = _f.sent(); - _f.label = 2; - case 2: - generateUpdateQueriesInfo = function () { - var ret = {}; - if (updateQueriesByName) { - _this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) { - var queryName = observableQuery.queryName; - if (queryName && - hasOwnProperty.call(updateQueriesByName, queryName)) { - ret[queryId] = { - updater: updateQueriesByName[queryName], - query: _this.queryStore.get(queryId), - }; - } - } - }); - } - return ret; - }; - this.mutationStore.initMutation(mutationId, mutation, variables); - this.dataStore.markMutationInit({ - mutationId: mutationId, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn, - optimisticResponse: optimisticResponse, - }); - this.broadcastQueries(); - self = this; - return [2, new Promise(function (resolve, reject) { - var storeResult; - var error; - self.getObservableFromLink(mutation, __assign(__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false).subscribe({ - next: function (result) { - if (graphQLResultHasError(result) && errorPolicy === 'none') { - error = new ApolloError({ - graphQLErrors: result.errors, - }); - return; - } - self.mutationStore.markMutationResult(mutationId); - if (fetchPolicy !== 'no-cache') { - self.dataStore.markMutationResult({ - mutationId: mutationId, - result: result, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn, - }); - } - storeResult = result; - }, - error: function (err) { - self.mutationStore.markMutationError(mutationId, err); - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse, - }); - self.broadcastQueries(); - self.setQuery(mutationId, function () { return ({ document: null }); }); - reject(new ApolloError({ - networkError: err, - })); - }, - complete: function () { - if (error) { - self.mutationStore.markMutationError(mutationId, error); - } - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse, - }); - self.broadcastQueries(); - if (error) { - reject(error); - return; - } - if (typeof refetchQueries === 'function') { - refetchQueries = refetchQueries(storeResult); - } - var refetchQueryPromises = []; - if (isNonEmptyArray(refetchQueries)) { - refetchQueries.forEach(function (refetchQuery) { - if (typeof refetchQuery === 'string') { - self.queries.forEach(function (_a) { - var observableQuery = _a.observableQuery; - if (observableQuery && - observableQuery.queryName === refetchQuery) { - refetchQueryPromises.push(observableQuery.refetch()); - } - }); - } - else { - var queryOptions = { - query: refetchQuery.query, - variables: refetchQuery.variables, - fetchPolicy: 'network-only', - }; - if (refetchQuery.context) { - queryOptions.context = refetchQuery.context; - } - refetchQueryPromises.push(self.query(queryOptions)); - } - }); - } - Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { - self.setQuery(mutationId, function () { return ({ document: null }); }); - if (errorPolicy === 'ignore' && - storeResult && - graphQLResultHasError(storeResult)) { - delete storeResult.errors; - } - resolve(storeResult); - }); - }, - }); - })]; - } - }); - }); - }; - QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { - return __awaiter(this, void 0, void 0, function () { - var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; - var _this = this; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; - query = this.transform(options.query).document; - variables = this.getVariables(query, options.variables); - if (!this.transform(query).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(query, variables, context)]; - case 1: - variables = _e.sent(); - _e.label = 2; - case 2: - options = __assign(__assign({}, options), { variables: variables }); - isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; - needToFetch = isNetworkOnly; - if (!isNetworkOnly) { - _d = this.dataStore.getCache().diff({ - query: query, - variables: variables, - returnPartialData: true, - optimistic: false, - }), complete = _d.complete, result = _d.result; - needToFetch = !complete || fetchPolicy === 'cache-and-network'; - storeResult = result; - } - shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; - if (hasDirectives(['live'], query)) - shouldFetch = true; - requestId = this.idCounter++; - cancel = fetchPolicy !== 'no-cache' - ? this.updateQueryWatch(queryId, query, options) - : undefined; - this.setQuery(queryId, function () { return ({ - document: query, - lastRequestId: requestId, - invalidated: true, - cancel: cancel, - }); }); - this.invalidate(fetchMoreForQueryId); - this.queryStore.initQuery({ - queryId: queryId, - document: query, - storePreviousVariables: shouldFetch, - variables: variables, - isPoll: fetchType === FetchType.poll, - isRefetch: fetchType === FetchType.refetch, - metadata: metadata, - fetchMoreForQueryId: fetchMoreForQueryId, - }); - this.broadcastQueries(); - if (shouldFetch) { - networkResult = this.fetchRequest({ - requestId: requestId, - queryId: queryId, - document: query, - options: options, - fetchMoreForQueryId: fetchMoreForQueryId, - }).catch(function (error) { - if (isApolloError(error)) { - throw error; - } - else { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); - _this.invalidate(queryId); - _this.invalidate(fetchMoreForQueryId); - _this.broadcastQueries(); - } - throw new ApolloError({ networkError: error }); - } - }); - if (fetchPolicy !== 'cache-and-network') { - return [2, networkResult]; - } - networkResult.catch(function () { }); - } - this.queryStore.markQueryResultClient(queryId, !shouldFetch); - this.invalidate(queryId); - this.invalidate(fetchMoreForQueryId); - if (this.transform(query).hasForcedResolvers) { - return [2, this.localState.runResolvers({ - document: query, - remoteResult: { data: storeResult }, - context: context, - variables: variables, - onlyRunForcedResolvers: true, - }).then(function (result) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - _this.broadcastQueries(); - return result; - })]; - } - this.broadcastQueries(); - return [2, { data: storeResult }]; - } - }); - }); - }; - QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { - var fetchPolicy = _a.fetchPolicy, variables = _a.variables, errorPolicy = _a.errorPolicy; - if (fetchPolicy === 'no-cache') { - this.setQuery(queryId, function () { return ({ - newData: { result: result.data, complete: true }, - }); }); - } - else { - this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); - } - }; - QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { - var _this = this; - function invoke(method, argument) { - if (observer[method]) { - try { - observer[method](argument); - } - catch (e) { - process.env.NODE_ENV === "production" || invariant.error(e); - } - } - else if (method === 'error') { - process.env.NODE_ENV === "production" || invariant.error(argument); - } - } - return function (queryStoreValue, newData) { - _this.invalidate(queryId, false); - if (!queryStoreValue) - return; - var _a = _this.getQuery(queryId), observableQuery = _a.observableQuery, document = _a.document; - var fetchPolicy = observableQuery - ? observableQuery.options.fetchPolicy - : options.fetchPolicy; - if (fetchPolicy === 'standby') - return; - var loading = isNetworkRequestInFlight(queryStoreValue.networkStatus); - var lastResult = observableQuery && observableQuery.getLastResult(); - var networkStatusChanged = !!(lastResult && - lastResult.networkStatus !== queryStoreValue.networkStatus); - var shouldNotifyIfLoading = options.returnPartialData || - (!newData && queryStoreValue.previousVariables) || - (networkStatusChanged && options.notifyOnNetworkStatusChange) || - fetchPolicy === 'cache-only' || - fetchPolicy === 'cache-and-network'; - if (loading && !shouldNotifyIfLoading) { - return; - } - var hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors); - var errorPolicy = observableQuery - && observableQuery.options.errorPolicy - || options.errorPolicy - || 'none'; - if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { - return invoke('error', new ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError, - })); - } - try { - var data = void 0; - var isMissing = void 0; - if (newData) { - if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { - _this.setQuery(queryId, function () { return ({ newData: null }); }); - } - data = newData.result; - isMissing = !newData.complete; - } - else { - var lastError = observableQuery && observableQuery.getLastError(); - var errorStatusChanged = errorPolicy !== 'none' && - (lastError && lastError.graphQLErrors) !== - queryStoreValue.graphQLErrors; - if (lastResult && lastResult.data && !errorStatusChanged) { - data = lastResult.data; - isMissing = false; - } - else { - var diffResult = _this.dataStore.getCache().diff({ - query: document, - variables: queryStoreValue.previousVariables || - queryStoreValue.variables, - returnPartialData: true, - optimistic: true, - }); - data = diffResult.result; - isMissing = !diffResult.complete; - } - } - var stale = isMissing && !(options.returnPartialData || - fetchPolicy === 'cache-only'); - var resultFromStore = { - data: stale ? lastResult && lastResult.data : data, - loading: loading, - networkStatus: queryStoreValue.networkStatus, - stale: stale, - }; - if (errorPolicy === 'all' && hasGraphQLErrors) { - resultFromStore.errors = queryStoreValue.graphQLErrors; - } - invoke('next', resultFromStore); - } - catch (networkError) { - invoke('error', new ApolloError({ networkError: networkError })); - } - }; - }; - QueryManager.prototype.transform = function (document) { - var transformCache = this.transformCache; - if (!transformCache.has(document)) { - var cache = this.dataStore.getCache(); - var transformed = cache.transformDocument(document); - var forLink = removeConnectionDirectiveFromDocument(cache.transformForLink(transformed)); - var clientQuery = this.localState.clientQuery(transformed); - var serverQuery = this.localState.serverQuery(forLink); - var cacheEntry_1 = { - document: transformed, - hasClientExports: hasClientExports(transformed), - hasForcedResolvers: this.localState.shouldForceResolvers(transformed), - clientQuery: clientQuery, - serverQuery: serverQuery, - defaultVars: getDefaultValues(getOperationDefinition(transformed)), - }; - var add = function (doc) { - if (doc && !transformCache.has(doc)) { - transformCache.set(doc, cacheEntry_1); - } - }; - add(document); - add(transformed); - add(clientQuery); - add(serverQuery); - } - return transformCache.get(document); - }; - QueryManager.prototype.getVariables = function (document, variables) { - return __assign(__assign({}, this.transform(document).defaultVars), variables); - }; - QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { - if (shouldSubscribe === void 0) { shouldSubscribe = true; } - process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'standby', 11) : invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); - options.variables = this.getVariables(options.query, options.variables); - if (typeof options.notifyOnNetworkStatusChange === 'undefined') { - options.notifyOnNetworkStatusChange = false; - } - var transformedOptions = __assign({}, options); - return new ObservableQuery({ - queryManager: this, - options: transformedOptions, - shouldSubscribe: shouldSubscribe, - }); - }; - QueryManager.prototype.query = function (options) { - var _this = this; - process.env.NODE_ENV === "production" ? invariant(options.query, 12) : invariant(options.query, 'query option is required. You must specify your GraphQL document ' + - 'in the query option.'); - process.env.NODE_ENV === "production" ? invariant(options.query.kind === 'Document', 13) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); - process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 14) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); - process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 15) : invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); - return new Promise(function (resolve, reject) { - var watchedQuery = _this.watchQuery(options, false); - _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); - watchedQuery - .result() - .then(resolve, reject) - .then(function () { - return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); - }); - }); - }; - QueryManager.prototype.generateQueryId = function () { - return String(this.idCounter++); - }; - QueryManager.prototype.stopQueryInStore = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.broadcastQueries(); - }; - QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { - this.stopPollingQuery(queryId); - this.queryStore.stopQuery(queryId); - this.invalidate(queryId); - }; - QueryManager.prototype.addQueryListener = function (queryId, listener) { - this.setQuery(queryId, function (_a) { - var listeners = _a.listeners; - listeners.add(listener); - return { invalidated: false }; - }); - }; - QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { - var _this = this; - var cancel = this.getQuery(queryId).cancel; - if (cancel) - cancel(); - var previousResult = function () { - var previousResult = null; - var observableQuery = _this.getQuery(queryId).observableQuery; - if (observableQuery) { - var lastResult = observableQuery.getLastResult(); - if (lastResult) { - previousResult = lastResult.data; - } - } - return previousResult; - }; - return this.dataStore.getCache().watch({ - query: document, - variables: options.variables, - optimistic: true, - previousResult: previousResult, - callback: function (newData) { - _this.setQuery(queryId, function () { return ({ invalidated: true, newData: newData }); }); - }, - }); - }; - QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { - this.setQuery(queryId, function () { return ({ observableQuery: observableQuery }); }); - }; - QueryManager.prototype.removeObservableQuery = function (queryId) { - var cancel = this.getQuery(queryId).cancel; - this.setQuery(queryId, function () { return ({ observableQuery: null }); }); - if (cancel) - cancel(); - }; - QueryManager.prototype.clearStore = function () { - this.fetchQueryRejectFns.forEach(function (reject) { - reject(process.env.NODE_ENV === "production" ? new InvariantError(16) : new InvariantError('Store reset while query was in flight (not completed in link chain)')); - }); - var resetIds = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) - resetIds.push(queryId); - }); - this.queryStore.reset(resetIds); - this.mutationStore.reset(); - return this.dataStore.reset(); - }; - QueryManager.prototype.resetStore = function () { - var _this = this; - return this.clearStore().then(function () { - return _this.reFetchObservableQueries(); - }); - }; - QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { - var _this = this; - if (includeStandby === void 0) { includeStandby = false; } - var observableQueryPromises = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) { - var fetchPolicy = observableQuery.options.fetchPolicy; - observableQuery.resetLastResults(); - if (fetchPolicy !== 'cache-only' && - (includeStandby || fetchPolicy !== 'standby')) { - observableQueryPromises.push(observableQuery.refetch()); - } - _this.setQuery(queryId, function () { return ({ newData: null }); }); - _this.invalidate(queryId); - } - }); - this.broadcastQueries(); - return Promise.all(observableQueryPromises); - }; - QueryManager.prototype.observeQuery = function (queryId, options, observer) { - this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); - return this.fetchQuery(queryId, options); - }; - QueryManager.prototype.startQuery = function (queryId, options, listener) { - process.env.NODE_ENV === "production" || invariant.warn("The QueryManager.startQuery method has been deprecated"); - this.addQueryListener(queryId, listener); - this.fetchQuery(queryId, options) - .catch(function () { return undefined; }); - return queryId; - }; - QueryManager.prototype.startGraphQLSubscription = function (_a) { - var _this = this; - var query = _a.query, fetchPolicy = _a.fetchPolicy, variables = _a.variables; - query = this.transform(query).document; - variables = this.getVariables(query, variables); - var makeObservable = function (variables) { - return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { - if (!fetchPolicy || fetchPolicy !== 'no-cache') { - _this.dataStore.markSubscriptionResult(result, query, variables); - _this.broadcastQueries(); - } - if (graphQLResultHasError(result)) { - throw new ApolloError({ - graphQLErrors: result.errors, - }); - } - return result; - }); - }; - if (this.transform(query).hasClientExports) { - var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); - return new Observable(function (observer) { - var sub = null; - observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error); - return function () { return sub && sub.unsubscribe(); }; - }); - } - return makeObservable(variables); - }; - QueryManager.prototype.stopQuery = function (queryId) { - this.stopQueryNoBroadcast(queryId); - this.broadcastQueries(); - }; - QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.removeQuery(queryId); - }; - QueryManager.prototype.removeQuery = function (queryId) { - this.fetchQueryRejectFns.delete("query:" + queryId); - this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); - this.getQuery(queryId).subscriptions.forEach(function (x) { return x.unsubscribe(); }); - this.queries.delete(queryId); - }; - QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { - if (optimistic === void 0) { optimistic = true; } - var _a = observableQuery.options, variables = _a.variables, query = _a.query, fetchPolicy = _a.fetchPolicy, returnPartialData = _a.returnPartialData; - var lastResult = observableQuery.getLastResult(); - var newData = this.getQuery(observableQuery.queryId).newData; - if (newData && newData.complete) { - return { data: newData.result, partial: false }; - } - if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { - return { data: undefined, partial: false }; - } - var _b = this.dataStore.getCache().diff({ - query: query, - variables: variables, - previousResult: lastResult ? lastResult.data : undefined, - returnPartialData: true, - optimistic: optimistic, - }), result = _b.result, complete = _b.complete; - return { - data: (complete || returnPartialData) ? result : void 0, - partial: !complete, - }; - }; - QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { - var observableQuery; - if (typeof queryIdOrObservable === 'string') { - var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; - process.env.NODE_ENV === "production" ? invariant(foundObserveableQuery, 17) : invariant(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); - observableQuery = foundObserveableQuery; - } - else { - observableQuery = queryIdOrObservable; - } - var _a = observableQuery.options, variables = _a.variables, query = _a.query; - return { - previousResult: this.getCurrentQueryResult(observableQuery, false).data, - variables: variables, - document: query, - }; - }; - QueryManager.prototype.broadcastQueries = function () { - var _this = this; - this.onBroadcast(); - this.queries.forEach(function (info, id) { - if (info.invalidated) { - info.listeners.forEach(function (listener) { - if (listener) { - listener(_this.queryStore.get(id), info.newData); - } - }); - } - }); - }; - QueryManager.prototype.getLocalState = function () { - return this.localState; - }; - QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { - var _this = this; - if (deduplication === void 0) { deduplication = this.queryDeduplication; } - var observable; - var serverQuery = this.transform(query).serverQuery; - if (serverQuery) { - var _a = this, inFlightLinkObservables_1 = _a.inFlightLinkObservables, link = _a.link; - var operation = { - query: serverQuery, - variables: variables, - operationName: getOperationName(serverQuery) || void 0, - context: this.prepareContext(__assign(__assign({}, context), { forceFetch: !deduplication })), - }; - context = operation.context; - if (deduplication) { - var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); - inFlightLinkObservables_1.set(serverQuery, byVariables_1); - var varJson_1 = JSON.stringify(variables); - observable = byVariables_1.get(varJson_1); - if (!observable) { - byVariables_1.set(varJson_1, observable = multiplex(execute(link, operation))); - var cleanup = function () { - byVariables_1.delete(varJson_1); - if (!byVariables_1.size) - inFlightLinkObservables_1.delete(serverQuery); - cleanupSub_1.unsubscribe(); - }; - var cleanupSub_1 = observable.subscribe({ - next: cleanup, - error: cleanup, - complete: cleanup, - }); - } - } - else { - observable = multiplex(execute(link, operation)); - } - } - else { - observable = Observable.of({ data: {} }); - context = this.prepareContext(context); - } - var clientQuery = this.transform(query).clientQuery; - if (clientQuery) { - observable = asyncMap(observable, function (result) { - return _this.localState.runResolvers({ - document: clientQuery, - remoteResult: result, - context: context, - variables: variables, - }); - }); - } - return observable; - }; - QueryManager.prototype.fetchRequest = function (_a) { - var _this = this; - var requestId = _a.requestId, queryId = _a.queryId, document = _a.document, options = _a.options, fetchMoreForQueryId = _a.fetchMoreForQueryId; - var variables = options.variables, _b = options.errorPolicy, errorPolicy = _b === void 0 ? 'none' : _b, fetchPolicy = options.fetchPolicy; - var resultFromStore; - var errorsFromStore; - return new Promise(function (resolve, reject) { - var observable = _this.getObservableFromLink(document, options.context, variables); - var fqrfId = "fetchRequest:" + queryId; - _this.fetchQueryRejectFns.set(fqrfId, reject); - var cleanup = function () { - _this.fetchQueryRejectFns.delete(fqrfId); - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.delete(subscription); - }); - }; - var subscription = observable.map(function (result) { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); - _this.invalidate(queryId); - _this.invalidate(fetchMoreForQueryId); - _this.broadcastQueries(); - } - if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) { - return reject(new ApolloError({ - graphQLErrors: result.errors, - })); - } - if (errorPolicy === 'all') { - errorsFromStore = result.errors; - } - if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { - resultFromStore = result.data; - } - else { - var _a = _this.dataStore.getCache().diff({ - variables: variables, - query: document, - optimistic: false, - returnPartialData: true, - }), result_1 = _a.result, complete = _a.complete; - if (complete || options.returnPartialData) { - resultFromStore = result_1; - } - } - }).subscribe({ - error: function (error) { - cleanup(); - reject(error); - }, - complete: function () { - cleanup(); - resolve({ - data: resultFromStore, - errors: errorsFromStore, - loading: false, - networkStatus: NetworkStatus.ready, - stale: false, - }); - }, - }); - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.add(subscription); - }); - }); - }; - QueryManager.prototype.getQuery = function (queryId) { - return (this.queries.get(queryId) || { - listeners: new Set(), - invalidated: false, - document: null, - newData: null, - lastRequestId: 1, - observableQuery: null, - subscriptions: new Set(), - }); - }; - QueryManager.prototype.setQuery = function (queryId, updater) { - var prev = this.getQuery(queryId); - var newInfo = __assign(__assign({}, prev), updater(prev)); - this.queries.set(queryId, newInfo); - }; - QueryManager.prototype.invalidate = function (queryId, invalidated) { - if (invalidated === void 0) { invalidated = true; } - if (queryId) { - this.setQuery(queryId, function () { return ({ invalidated: invalidated }); }); - } - }; - QueryManager.prototype.prepareContext = function (context) { - if (context === void 0) { context = {}; } - var newContext = this.localState.prepareContext(context); - return __assign(__assign({}, newContext), { clientAwareness: this.clientAwareness }); - }; - QueryManager.prototype.checkInFlight = function (queryId) { - var query = this.queryStore.get(queryId); - return (query && - query.networkStatus !== NetworkStatus.ready && - query.networkStatus !== NetworkStatus.error); - }; - QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { - var _this = this; - var pollInterval = options.pollInterval; - process.env.NODE_ENV === "production" ? invariant(pollInterval, 18) : invariant(pollInterval, 'Attempted to start a polling query without a polling interval.'); - if (!this.ssrMode) { - var info = this.pollingInfoByQueryId.get(queryId); - if (!info) { - this.pollingInfoByQueryId.set(queryId, (info = {})); - } - info.interval = pollInterval; - info.options = __assign(__assign({}, options), { fetchPolicy: 'network-only' }); - var maybeFetch_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - if (info) { - if (_this.checkInFlight(queryId)) { - poll_1(); - } - else { - _this.fetchQuery(queryId, info.options, FetchType.poll).then(poll_1, poll_1); - } - } - }; - var poll_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - if (info) { - clearTimeout(info.timeout); - info.timeout = setTimeout(maybeFetch_1, info.interval); - } - }; - if (listener) { - this.addQueryListener(queryId, listener); - } - poll_1(); - } - return queryId; - }; - QueryManager.prototype.stopPollingQuery = function (queryId) { - this.pollingInfoByQueryId.delete(queryId); - }; - return QueryManager; -}()); - -var DataStore = (function () { - function DataStore(initialCache) { - this.cache = initialCache; - } - DataStore.prototype.getCache = function () { - return this.cache; - }; - DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { - if (ignoreErrors === void 0) { ignoreErrors = false; } - var writeWithErrors = !graphQLResultHasError(result); - if (ignoreErrors && graphQLResultHasError(result) && result.data) { - writeWithErrors = true; - } - if (!fetchMoreForQueryId && writeWithErrors) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_QUERY', - query: document, - variables: variables, - }); - } - }; - DataStore.prototype.markSubscriptionResult = function (result, document, variables) { - if (!graphQLResultHasError(result)) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_SUBSCRIPTION', - query: document, - variables: variables, - }); - } - }; - DataStore.prototype.markMutationInit = function (mutation) { - var _this = this; - if (mutation.optimisticResponse) { - var optimistic_1; - if (typeof mutation.optimisticResponse === 'function') { - optimistic_1 = mutation.optimisticResponse(mutation.variables); - } - else { - optimistic_1 = mutation.optimisticResponse; - } - this.cache.recordOptimisticTransaction(function (c) { - var orig = _this.cache; - _this.cache = c; - try { - _this.markMutationResult({ - mutationId: mutation.mutationId, - result: { data: optimistic_1 }, - document: mutation.document, - variables: mutation.variables, - updateQueries: mutation.updateQueries, - update: mutation.update, - }); - } - finally { - _this.cache = orig; - } - }, mutation.mutationId); - } - }; - DataStore.prototype.markMutationResult = function (mutation) { - var _this = this; - if (!graphQLResultHasError(mutation.result)) { - var cacheWrites_1 = [{ - result: mutation.result.data, - dataId: 'ROOT_MUTATION', - query: mutation.document, - variables: mutation.variables, - }]; - var updateQueries_1 = mutation.updateQueries; - if (updateQueries_1) { - Object.keys(updateQueries_1).forEach(function (id) { - var _a = updateQueries_1[id], query = _a.query, updater = _a.updater; - var _b = _this.cache.diff({ - query: query.document, - variables: query.variables, - returnPartialData: true, - optimistic: false, - }), currentQueryResult = _b.result, complete = _b.complete; - if (complete) { - var nextQueryResult = tryFunctionOrLogError(function () { - return updater(currentQueryResult, { - mutationResult: mutation.result, - queryName: getOperationName(query.document) || undefined, - queryVariables: query.variables, - }); - }); - if (nextQueryResult) { - cacheWrites_1.push({ - result: nextQueryResult, - dataId: 'ROOT_QUERY', - query: query.document, - variables: query.variables, - }); - } - } - }); - } - this.cache.performTransaction(function (c) { - cacheWrites_1.forEach(function (write) { return c.write(write); }); - var update = mutation.update; - if (update) { - tryFunctionOrLogError(function () { return update(c, mutation.result); }); - } - }); - } - }; - DataStore.prototype.markMutationComplete = function (_a) { - var mutationId = _a.mutationId, optimisticResponse = _a.optimisticResponse; - if (optimisticResponse) { - this.cache.removeOptimistic(mutationId); - } - }; - DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { - this.cache.write({ - result: newResult, - dataId: 'ROOT_QUERY', - variables: variables, - query: document, - }); - }; - DataStore.prototype.reset = function () { - return this.cache.reset(); - }; - return DataStore; -}()); - -var version = "2.6.10"; - -var hasSuggestedDevtools = false; -var ApolloClient = (function () { - function ApolloClient(options) { - var _this = this; - this.defaultOptions = {}; - this.resetStoreCallbacks = []; - this.clearStoreCallbacks = []; - var cache = options.cache, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, connectToDevTools = options.connectToDevTools, _c = options.queryDeduplication, queryDeduplication = _c === void 0 ? true : _c, defaultOptions = options.defaultOptions, _d = options.assumeImmutableResults, assumeImmutableResults = _d === void 0 ? false : _d, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version; - var link = options.link; - if (!link && resolvers) { - link = ApolloLink.empty(); - } - if (!link || !cache) { - throw process.env.NODE_ENV === "production" ? new InvariantError(4) : new InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + - "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + - "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); - } - this.link = link; - this.cache = cache; - this.store = new DataStore(cache); - this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; - this.queryDeduplication = queryDeduplication; - this.defaultOptions = defaultOptions || {}; - this.typeDefs = typeDefs; - if (ssrForceFetchDelay) { - setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay); - } - this.watchQuery = this.watchQuery.bind(this); - this.query = this.query.bind(this); - this.mutate = this.mutate.bind(this); - this.resetStore = this.resetStore.bind(this); - this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); - var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && - typeof window !== 'undefined' && - !window.__APOLLO_CLIENT__; - if (typeof connectToDevTools === 'undefined' - ? defaultConnectToDevTools - : connectToDevTools && typeof window !== 'undefined') { - window.__APOLLO_CLIENT__ = this; - } - if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { - hasSuggestedDevtools = true; - if (typeof window !== 'undefined' && - window.document && - window.top === window.self) { - if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { - if (window.navigator && - window.navigator.userAgent && - window.navigator.userAgent.indexOf('Chrome') > -1) { - console.debug('Download the Apollo DevTools ' + - 'for a better development experience: ' + - 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); - } - } - } - } - this.version = version; - this.localState = new LocalState({ - cache: cache, - client: this, - resolvers: resolvers, - fragmentMatcher: fragmentMatcher, - }); - this.queryManager = new QueryManager({ - link: this.link, - store: this.store, - queryDeduplication: queryDeduplication, - ssrMode: ssrMode, - clientAwareness: { - name: clientAwarenessName, - version: clientAwarenessVersion, - }, - localState: this.localState, - assumeImmutableResults: assumeImmutableResults, - onBroadcast: function () { - if (_this.devToolsHookCb) { - _this.devToolsHookCb({ - action: {}, - state: { - queries: _this.queryManager.queryStore.getStore(), - mutations: _this.queryManager.mutationStore.getStore(), - }, - dataWithOptimisticResults: _this.cache.extract(true), - }); - } - }, - }); - } - ApolloClient.prototype.stop = function () { - this.queryManager.stop(); - }; - ApolloClient.prototype.watchQuery = function (options) { - if (this.defaultOptions.watchQuery) { - options = __assign(__assign({}, this.defaultOptions.watchQuery), options); - } - if (this.disableNetworkFetches && - (options.fetchPolicy === 'network-only' || - options.fetchPolicy === 'cache-and-network')) { - options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' }); - } - return this.queryManager.watchQuery(options); - }; - ApolloClient.prototype.query = function (options) { - if (this.defaultOptions.query) { - options = __assign(__assign({}, this.defaultOptions.query), options); - } - process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'cache-and-network', 5) : invariant(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + - 'client.query can only return a single result. Please use client.watchQuery ' + - 'to receive multiple results from the cache and the network, or consider ' + - 'using a different fetchPolicy, such as cache-first or network-only.'); - if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { - options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' }); - } - return this.queryManager.query(options); - }; - ApolloClient.prototype.mutate = function (options) { - if (this.defaultOptions.mutate) { - options = __assign(__assign({}, this.defaultOptions.mutate), options); - } - return this.queryManager.mutate(options); - }; - ApolloClient.prototype.subscribe = function (options) { - return this.queryManager.startGraphQLSubscription(options); - }; - ApolloClient.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.cache.readQuery(options, optimistic); - }; - ApolloClient.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { optimistic = false; } - return this.cache.readFragment(options, optimistic); - }; - ApolloClient.prototype.writeQuery = function (options) { - var result = this.cache.writeQuery(options); - this.queryManager.broadcastQueries(); - return result; - }; - ApolloClient.prototype.writeFragment = function (options) { - var result = this.cache.writeFragment(options); - this.queryManager.broadcastQueries(); - return result; - }; - ApolloClient.prototype.writeData = function (options) { - var result = this.cache.writeData(options); - this.queryManager.broadcastQueries(); - return result; - }; - ApolloClient.prototype.__actionHookForDevTools = function (cb) { - this.devToolsHookCb = cb; - }; - ApolloClient.prototype.__requestRaw = function (payload) { - return execute(this.link, payload); - }; - ApolloClient.prototype.initQueryManager = function () { - process.env.NODE_ENV === "production" || invariant.warn('Calling the initQueryManager method is no longer necessary, ' + - 'and it will be removed from ApolloClient in version 3.0.'); - return this.queryManager; - }; - ApolloClient.prototype.resetStore = function () { - var _this = this; - return Promise.resolve() - .then(function () { return _this.queryManager.clearStore(); }) - .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); }) - .then(function () { return _this.reFetchObservableQueries(); }); - }; - ApolloClient.prototype.clearStore = function () { - var _this = this; - return Promise.resolve() - .then(function () { return _this.queryManager.clearStore(); }) - .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); }); - }; - ApolloClient.prototype.onResetStore = function (cb) { - var _this = this; - this.resetStoreCallbacks.push(cb); - return function () { - _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { return c !== cb; }); - }; - }; - ApolloClient.prototype.onClearStore = function (cb) { - var _this = this; - this.clearStoreCallbacks.push(cb); - return function () { - _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { return c !== cb; }); - }; - }; - ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { - return this.queryManager.reFetchObservableQueries(includeStandby); - }; - ApolloClient.prototype.extract = function (optimistic) { - return this.cache.extract(optimistic); - }; - ApolloClient.prototype.restore = function (serializedState) { - return this.cache.restore(serializedState); - }; - ApolloClient.prototype.addResolvers = function (resolvers) { - this.localState.addResolvers(resolvers); - }; - ApolloClient.prototype.setResolvers = function (resolvers) { - this.localState.setResolvers(resolvers); - }; - ApolloClient.prototype.getResolvers = function () { - return this.localState.getResolvers(); - }; - ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { - this.localState.setFragmentMatcher(fragmentMatcher); - }; - return ApolloClient; -}()); - -export default ApolloClient; -export { ApolloClient, ApolloError, FetchType, NetworkStatus, ObservableQuery, isApolloError }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-client/bundle.esm.js.map b/node_modules/apollo-client/bundle.esm.js.map deleted file mode 100644 index e1b9a1f..0000000 --- a/node_modules/apollo-client/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/core/networkStatus.ts","../src/util/Observable.ts","../src/util/arrays.ts","../src/errors/ApolloError.ts","../src/core/types.ts","../src/core/ObservableQuery.ts","../src/data/mutations.ts","../src/data/queries.ts","../src/util/capitalizeFirstLetter.ts","../src/core/LocalState.ts","../src/util/observables.ts","../src/core/QueryManager.ts","../src/data/store.ts","../src/version.ts","../src/ApolloClient.ts"],"sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus: NetworkStatus,\n): boolean {\n return networkStatus < 7;\n}\n","// This simplified polyfill attempts to follow the ECMAScript Observable proposal.\n// See https://github.com/zenparsing/es-observable\nimport { Observable as LinkObservable } from 'apollo-link';\n\nexport type Subscription = ZenObservable.Subscription;\nexport type Observer = ZenObservable.Observer;\n\nimport $$observable from 'symbol-observable';\n\n// rxjs interopt\nexport class Observable extends LinkObservable {\n public [$$observable]() {\n return this;\n }\n\n public ['@@observable' as any]() {\n return this;\n }\n}\n","export function isNonEmptyArray(value?: ArrayLike): value is Array {\n return Array.isArray(value) && value.length > 0;\n}\n","import { GraphQLError } from 'graphql';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `GraphQL error: ${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += 'Network error: ' + err.networkError.message + '\\n';\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray;\n public networkError: Error | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n\n if (!errorMessage) {\n this.message = generateErrorMessage(this);\n } else {\n this.message = errorMessage;\n }\n\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","import { FetchResult } from 'apollo-link';\nimport { DocumentNode, GraphQLError } from 'graphql';\n\nimport { QueryStoreValue } from '../data/queries';\nimport { NetworkStatus } from './networkStatus';\nimport { Resolver } from './LocalState';\n\nexport type QueryListener = (\n queryStoreValue: QueryStoreValue,\n newData?: any,\n forceResolvers?: boolean,\n) => void;\n\nexport type OperationVariables = { [key: string]: any };\n\nexport type PureQueryOptions = {\n query: DocumentNode;\n variables?: { [key: string]: any };\n context?: any;\n};\n\nexport type ApolloQueryResult = {\n data: T;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n stale: boolean;\n};\n\nexport enum FetchType {\n normal = 1,\n refetch = 2,\n poll = 3,\n}\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer = (\n previousResult: Record,\n options: {\n mutationResult: FetchResult;\n queryName: string | undefined;\n queryVariables: Record;\n },\n) => Record;\n\nexport type MutationQueryReducersMap = {\n [queryName: string]: MutationQueryReducer;\n};\n\nexport interface Resolvers {\n [key: string]: {\n [ field: string ]: Resolver;\n };\n}\n","import {\n isEqual,\n tryFunctionOrLogError,\n cloneDeep,\n getOperationDefinition,\n} from 'apollo-utilities';\nimport { GraphQLError } from 'graphql';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport { Observable, Observer, Subscription } from '../util/Observable';\nimport { ApolloError } from '../errors/ApolloError';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, FetchType, OperationVariables } from './types';\nimport {\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\n\nimport { QueryStoreValue } from '../data/queries';\n\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isNonEmptyArray } from '../util/arrays';\n\n// XXX remove in the next breaking semver change (3.0)\n// Deprecated, use ApolloCurrentQueryResult\nexport type ApolloCurrentResult = {\n data: T | {};\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n};\n\nexport type ApolloCurrentQueryResult = {\n data: T | undefined;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n stale?: boolean;\n};\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions {\n variables?: TVariables;\n}\n\nexport const hasError = (\n storeValue: QueryStoreValue,\n policy: ErrorPolicy = 'none',\n) => storeValue && (\n storeValue.networkError ||\n (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))\n);\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable> {\n public options: WatchQueryOptions;\n public readonly queryId: string;\n public readonly queryName?: string;\n /**\n *\n * The current value of the variables for this query. Can change.\n */\n public variables: TVariables;\n\n private shouldSubscribe: boolean;\n private isTornDown: boolean;\n private queryManager: QueryManager;\n private observers = new Set>>();\n private subscriptions = new Set();\n\n private lastResult: ApolloQueryResult;\n private lastResultSnapshot: ApolloQueryResult;\n private lastError: ApolloError;\n\n constructor({\n queryManager,\n options,\n shouldSubscribe = true,\n }: {\n queryManager: QueryManager;\n options: WatchQueryOptions;\n shouldSubscribe?: boolean;\n }) {\n super((observer: Observer>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.variables = options.variables || ({} as TVariables);\n this.queryId = queryManager.generateQueryId();\n this.shouldSubscribe = shouldSubscribe;\n\n const opDef = getOperationDefinition(options.query);\n this.queryName = opDef && opDef.name && opDef.name.value;\n\n // related classes\n this.queryManager = queryManager;\n }\n\n public result(): Promise> {\n return new Promise((resolve, reject) => {\n const observer: Observer> = {\n next: (result: ApolloQueryResult) => {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n this.observers.delete(observer);\n if (!this.observers.size) {\n this.queryManager.removeQuery(this.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n const subscription = this.subscribe(observer);\n });\n }\n\n // XXX remove in the next breaking semver change (3.0)\n // Deprecated, use getCurrentResult()\n public currentResult(): ApolloCurrentResult {\n const result = this.getCurrentResult() as ApolloCurrentResult;\n if (result.data === undefined) {\n result.data = {};\n }\n return result;\n }\n\n /**\n * Return the result of the query from the local cache as well as some fetching status\n * `loading` and `networkStatus` allow to know if a request is in flight\n * `partial` lets you know if the result from the local cache is complete or partial\n * @return {data: Object, error: ApolloError, loading: boolean, networkStatus: number, partial: boolean}\n */\n public getCurrentResult(): ApolloCurrentQueryResult {\n if (this.isTornDown) {\n const { lastResult } = this;\n return {\n data: !this.lastError && lastResult && lastResult.data || void 0,\n error: this.lastError,\n loading: false,\n networkStatus: NetworkStatus.error,\n };\n }\n\n const { data, partial } = this.queryManager.getCurrentQueryResult(this);\n const queryStoreValue = this.queryManager.queryStore.get(this.queryId);\n let result: ApolloQueryResult;\n\n const { fetchPolicy } = this.options;\n\n const isNetworkFetchPolicy =\n fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache';\n\n if (queryStoreValue) {\n const { networkStatus } = queryStoreValue;\n\n if (hasError(queryStoreValue, this.options.errorPolicy)) {\n return {\n data: void 0,\n loading: false,\n networkStatus,\n error: new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }),\n };\n }\n\n // Variables might have been added dynamically at query time, when\n // using `@client @export(as: \"varname\")` for example. When this happens,\n // the variables have been updated in the query store, but not updated on\n // the original `ObservableQuery`. We'll update the observable query\n // variables here to match, so retrieving from the cache doesn't fail.\n if (queryStoreValue.variables) {\n this.options.variables = {\n ...this.options.variables,\n ...(queryStoreValue.variables as TVariables),\n };\n this.variables = this.options.variables;\n }\n\n result = {\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n } as ApolloQueryResult;\n\n if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') {\n result.errors = queryStoreValue.graphQLErrors;\n }\n\n } else {\n // We need to be careful about the loading state we show to the user, to try\n // and be vaguely in line with what the user would have seen from .subscribe()\n // but to still provide useful information synchronously when the query\n // will not end up hitting the server.\n // See more: https://github.com/apollostack/apollo-client/issues/707\n // Basically: is there a query in flight right now (modolo the next tick)?\n const loading = isNetworkFetchPolicy ||\n (partial && fetchPolicy !== 'cache-only');\n\n result = {\n data,\n loading,\n networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready,\n } as ApolloQueryResult;\n }\n\n if (!partial) {\n this.updateLastResult({ ...result, stale: false });\n }\n\n return { ...result, partial };\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult) {\n const { lastResultSnapshot: snapshot } = this;\n return !(\n snapshot &&\n newResult &&\n snapshot.networkStatus === newResult.networkStatus &&\n snapshot.stale === newResult.stale &&\n isEqual(snapshot.data, newResult.data)\n );\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.\n public getLastResult(): ApolloQueryResult {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n public resetQueryStoreErrors() {\n const queryStore = this.queryManager.queryStore.get(this.queryId);\n if (queryStore) {\n queryStore.networkError = null;\n queryStore.graphQLErrors = [];\n }\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: TVariables): Promise> {\n let { fetchPolicy } = this.options;\n // early return if trying to read from cache during refetch\n if (fetchPolicy === 'cache-only') {\n return Promise.reject(new InvariantError(\n 'cache-only fetchPolicy option should not be used together with query refetch.',\n ));\n }\n\n // Unless the provided fetchPolicy always consults the network\n // (no-cache, network-only, or cache-and-network), override it with\n // network-only to force the refetch for this fetchQuery call.\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n fetchPolicy = 'network-only';\n }\n\n if (!isEqual(this.variables, variables)) {\n // update observable variables\n this.variables = {\n ...this.variables,\n ...variables,\n };\n }\n\n if (!isEqual(this.options.variables, this.variables)) {\n // Update the existing options with new variables\n this.options.variables = {\n ...this.options.variables,\n ...this.variables,\n };\n }\n\n return this.queryManager.fetchQuery(\n this.queryId,\n { ...this.options, fetchPolicy },\n FetchType.refetch,\n ) as Promise>;\n }\n\n public fetchMore(\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ): Promise> {\n // early return if no update Query\n invariant(\n fetchMoreOptions.updateQuery,\n 'updateQuery option is required. This function defines how to update the query data with the new results.',\n );\n\n const combinedOptions = {\n ...(fetchMoreOptions.query ? fetchMoreOptions : {\n ...this.options,\n ...fetchMoreOptions,\n variables: {\n ...this.variables,\n ...fetchMoreOptions.variables,\n },\n }),\n fetchPolicy: 'network-only',\n } as WatchQueryOptions;\n\n const qid = this.queryManager.generateQueryId();\n\n return this.queryManager\n .fetchQuery(\n qid,\n combinedOptions,\n FetchType.normal,\n this.queryId,\n )\n .then(\n fetchMoreResult => {\n this.updateQuery((previousResult: any) =>\n fetchMoreOptions.updateQuery(previousResult, {\n fetchMoreResult: fetchMoreResult.data as TData,\n variables: combinedOptions.variables as TVariables,\n }),\n );\n this.queryManager.stopQuery(qid);\n return fetchMoreResult as ApolloQueryResult;\n },\n error => {\n this.queryManager.stopQuery(qid);\n throw error;\n },\n );\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n const { updateQuery } = options;\n if (updateQuery) {\n this.updateQuery(\n (previous, { variables }) =>\n updateQuery(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptions.add(subscription);\n\n return () => {\n if (this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n }\n\n // Note: if the query is not active (there are no subscribers), the promise\n // will return null immediately.\n public setOptions(\n opts: WatchQueryOptions,\n ): Promise | void> {\n const { fetchPolicy: oldFetchPolicy } = this.options;\n this.options = {\n ...this.options,\n ...opts,\n } as WatchQueryOptions;\n\n if (opts.pollInterval) {\n this.startPolling(opts.pollInterval);\n } else if (opts.pollInterval === 0) {\n this.stopPolling();\n }\n\n const { fetchPolicy } = opts;\n\n return this.setVariables(\n this.options.variables as TVariables,\n // Try to fetch the query if fetchPolicy changed from either cache-only\n // or standby to something else, or changed to network-only.\n oldFetchPolicy !== fetchPolicy && (\n oldFetchPolicy === 'cache-only' ||\n oldFetchPolicy === 'standby' ||\n fetchPolicy === 'network-only'\n ),\n opts.fetchResults,\n );\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n *\n * @param fetchResults: Option to ignore fetching results when updating variables\n */\n public setVariables(\n variables: TVariables,\n tryFetch: boolean = false,\n fetchResults = true,\n ): Promise | void> {\n // since setVariables restarts the subscription, we reset the tornDown status\n this.isTornDown = false;\n\n variables = variables || this.variables;\n\n if (!tryFetch && isEqual(variables, this.variables)) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n return this.observers.size && fetchResults\n ? this.result()\n : Promise.resolve();\n }\n\n this.variables = this.options.variables = variables;\n\n // See comment above\n if (!this.observers.size) {\n return Promise.resolve();\n }\n\n // Use the same options as before, but with new variables\n return this.queryManager.fetchQuery(\n this.queryId,\n this.options,\n ) as Promise>;\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions,\n ) => TData,\n ): void {\n const { queryManager } = this;\n const {\n previousResult,\n variables,\n document,\n } = queryManager.getQueryWithPreviousResult(\n this.queryId,\n );\n\n const newResult = tryFunctionOrLogError(() =>\n mapFn(previousResult, { variables }),\n );\n\n if (newResult) {\n queryManager.dataStore.markUpdateQueryResult(\n document,\n variables,\n newResult,\n );\n queryManager.broadcastQueries();\n }\n }\n\n public stopPolling() {\n this.queryManager.stopPollingQuery(this.queryId);\n this.options.pollInterval = undefined;\n }\n\n public startPolling(pollInterval: number) {\n assertNotCacheFirstOrOnly(this);\n this.options.pollInterval = pollInterval;\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n private updateLastResult(newResult: ApolloQueryResult) {\n const previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n return previousResult;\n }\n\n private onSubscribe(observer: Observer>) {\n // Zen Observable has its own error function, so in order to log correctly\n // we need to provide a custom error callback.\n try {\n var subObserver = (observer as any)._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n } catch {}\n\n const first = !this.observers.size;\n this.observers.add(observer);\n\n // Deliver initial result\n if (observer.next && this.lastResult) observer.next(this.lastResult);\n if (observer.error && this.lastError) observer.error(this.lastError);\n\n // setup the query if it hasn't been done before\n if (first) {\n this.setUpQuery();\n }\n\n return () => {\n if (this.observers.delete(observer) && !this.observers.size) {\n this.tearDownQuery();\n }\n };\n }\n\n private setUpQuery() {\n const { queryManager, queryId } = this;\n\n if (this.shouldSubscribe) {\n queryManager.addObservableQuery(queryId, this);\n }\n\n if (this.options.pollInterval) {\n assertNotCacheFirstOrOnly(this);\n queryManager.startPollingQuery(this.options, queryId);\n }\n\n const onError = (error: ApolloError) => {\n // Since we don't get the current result on errors, only the error, we\n // must mirror the updates that occur in QueryStore.markQueryError here\n this.updateLastResult({\n ...this.lastResult,\n errors: error.graphQLErrors,\n networkStatus: NetworkStatus.error,\n loading: false,\n });\n iterateObserversSafely(this.observers, 'error', this.lastError = error);\n };\n\n queryManager.observeQuery(queryId, this.options, {\n next: (result: ApolloQueryResult) => {\n if (this.lastError || this.isDifferentFromLastResult(result)) {\n const previousResult = this.updateLastResult(result);\n const { query, variables, fetchPolicy } = this.options;\n\n // Before calling `next` on each observer, we need to first see if\n // the query is using `@client @export` directives, and update\n // any variables that might have changed. If `@export` variables have\n // changed, and the query is calling against both local and remote\n // data, a refetch is needed to pull in new data, using the\n // updated `@export` variables.\n if (queryManager.transform(query).hasClientExports) {\n queryManager.getLocalState().addExportedVariables(\n query,\n variables,\n ).then((variables: TVariables) => {\n const previousVariables = this.variables;\n this.variables = this.options.variables = variables;\n if (\n !result.loading &&\n previousResult &&\n fetchPolicy !== 'cache-only' &&\n queryManager.transform(query).serverQuery &&\n !isEqual(previousVariables, variables)\n ) {\n this.refetch();\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n });\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n }\n },\n error: onError,\n }).catch(onError);\n }\n\n private tearDownQuery() {\n const { queryManager } = this;\n\n this.isTornDown = true;\n queryManager.stopPollingQuery(this.queryId);\n\n // stop all active GraphQL subscriptions\n this.subscriptions.forEach(sub => sub.unsubscribe());\n this.subscriptions.clear();\n\n queryManager.removeObservableQuery(this.queryId);\n queryManager.stopQuery(this.queryId);\n\n this.observers.clear();\n }\n}\n\nfunction defaultSubscriptionObserverErrorCallback(error: ApolloError) {\n invariant.error('Unhandled error', error.message, error.stack);\n}\n\nfunction iterateObserversSafely(\n observers: Set>,\n method: keyof Observer,\n argument?: A,\n) {\n // In case observers is modified during iteration, we need to commit to the\n // original elements, which also provides an opportunity to filter them down\n // to just the observers with the given method.\n const observersWithMethod: Observer[] = [];\n observers.forEach(obs => obs[method] && observersWithMethod.push(obs));\n observersWithMethod.forEach(obs => (obs as any)[method](argument));\n}\n\nfunction assertNotCacheFirstOrOnly(\n obsQuery: ObservableQuery,\n) {\n const { fetchPolicy } = obsQuery.options;\n invariant(\n fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only',\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n}\n","import { DocumentNode } from 'graphql';\n\nexport class MutationStore {\n private store: { [mutationId: string]: MutationStoreValue } = {};\n\n public getStore(): { [mutationId: string]: MutationStoreValue } {\n return this.store;\n }\n\n public get(mutationId: string): MutationStoreValue {\n return this.store[mutationId];\n }\n\n public initMutation(\n mutationId: string,\n mutation: DocumentNode,\n variables: Object | undefined,\n ) {\n this.store[mutationId] = {\n mutation,\n variables: variables || {},\n loading: true,\n error: null,\n };\n }\n\n public markMutationError(mutationId: string, error: Error) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = error;\n }\n }\n\n public markMutationResult(mutationId: string) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = null;\n }\n }\n\n public reset() {\n this.store = {};\n }\n}\n\nexport interface MutationStoreValue {\n mutation: DocumentNode;\n variables: Object;\n loading: boolean;\n error: Error | null;\n}\n","import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';\nimport { isEqual } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\nimport { NetworkStatus } from '../core/networkStatus';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport type QueryStoreValue = {\n document: DocumentNode;\n variables: Object;\n previousVariables?: Object | null;\n networkStatus: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray;\n metadata: any;\n};\n\nexport class QueryStore {\n private store: { [queryId: string]: QueryStoreValue } = {};\n\n public getStore(): { [queryId: string]: QueryStoreValue } {\n return this.store;\n }\n\n public get(queryId: string): QueryStoreValue {\n return this.store[queryId];\n }\n\n public initQuery(query: {\n queryId: string;\n document: DocumentNode;\n storePreviousVariables: boolean;\n variables: Object;\n isPoll: boolean;\n isRefetch: boolean;\n metadata: any;\n fetchMoreForQueryId: string | undefined;\n }) {\n const previousQuery = this.store[query.queryId];\n\n // XXX we're throwing an error here to catch bugs where a query gets overwritten by a new one.\n // we should implement a separate action for refetching so that QUERY_INIT may never overwrite\n // an existing query (see also: https://github.com/apollostack/apollo-client/issues/732)\n invariant(\n !previousQuery ||\n previousQuery.document === query.document ||\n isEqual(previousQuery.document, query.document),\n 'Internal Error: may not update existing query string in store',\n );\n\n let isSetVariables = false;\n\n let previousVariables: Object | null = null;\n if (\n query.storePreviousVariables &&\n previousQuery &&\n previousQuery.networkStatus !== NetworkStatus.loading\n // if the previous query was still loading, we don't want to remember it at all.\n ) {\n if (!isEqual(previousQuery.variables, query.variables)) {\n isSetVariables = true;\n previousVariables = previousQuery.variables;\n }\n }\n\n // TODO break this out into a separate function\n let networkStatus;\n if (isSetVariables) {\n networkStatus = NetworkStatus.setVariables;\n } else if (query.isPoll) {\n networkStatus = NetworkStatus.poll;\n } else if (query.isRefetch) {\n networkStatus = NetworkStatus.refetch;\n // TODO: can we determine setVariables here if it's a refetch and the variables have changed?\n } else {\n networkStatus = NetworkStatus.loading;\n }\n\n let graphQLErrors: ReadonlyArray = [];\n if (previousQuery && previousQuery.graphQLErrors) {\n graphQLErrors = previousQuery.graphQLErrors;\n }\n\n // XXX right now if QUERY_INIT is fired twice, like in a refetch situation, we just overwrite\n // the store. We probably want a refetch action instead, because I suspect that if you refetch\n // before the initial fetch is done, you'll get an error.\n this.store[query.queryId] = {\n document: query.document,\n variables: query.variables,\n previousVariables,\n networkError: null,\n graphQLErrors: graphQLErrors,\n networkStatus,\n metadata: query.metadata,\n };\n\n // If the action had a `moreForQueryId` property then we need to set the\n // network status on that query as well to `fetchMore`.\n //\n // We have a complement to this if statement in the query result and query\n // error action branch, but importantly *not* in the client result branch.\n // This is because the implementation of `fetchMore` *always* sets\n // `fetchPolicy` to `network-only` so we would never have a client result.\n if (\n typeof query.fetchMoreForQueryId === 'string' &&\n this.store[query.fetchMoreForQueryId]\n ) {\n this.store[query.fetchMoreForQueryId].networkStatus =\n NetworkStatus.fetchMore;\n }\n }\n\n public markQueryResult(\n queryId: string,\n result: ExecutionResult,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = NetworkStatus.ready;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (\n typeof fetchMoreForQueryId === 'string' &&\n this.store[fetchMoreForQueryId]\n ) {\n this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready;\n }\n }\n\n public markQueryError(\n queryId: string,\n error: Error,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = error;\n this.store[queryId].networkStatus = NetworkStatus.error;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (typeof fetchMoreForQueryId === 'string') {\n this.markQueryResultClient(fetchMoreForQueryId, true);\n }\n }\n\n public markQueryResultClient(queryId: string, complete: boolean) {\n const storeValue = this.store && this.store[queryId];\n if (storeValue) {\n storeValue.networkError = null;\n storeValue.previousVariables = null;\n if (complete) {\n storeValue.networkStatus = NetworkStatus.ready;\n }\n }\n }\n\n public stopQuery(queryId: string) {\n delete this.store[queryId];\n }\n\n public reset(observableQueryIds: string[]) {\n Object.keys(this.store).forEach(queryId => {\n if (observableQueryIds.indexOf(queryId) < 0) {\n this.stopQuery(queryId);\n } else {\n // XXX set loading to true so listeners don't trigger unless they want results with partial data\n this.store[queryId].networkStatus = NetworkStatus.loading;\n }\n });\n }\n}\n","export function capitalizeFirstLetter(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n SelectionNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n FieldNode,\n ASTNode,\n} from 'graphql';\nimport { visit, BREAK } from 'graphql/language/visitor';\n\nimport { ApolloCache } from 'apollo-cache';\nimport {\n getMainDefinition,\n buildQueryFromSelectionSet,\n hasDirectives,\n removeClientSetsFromDocument,\n mergeDeep,\n mergeDeepArray,\n FragmentMap,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getFragmentDefinitions,\n createFragmentMap,\n shouldInclude,\n isField,\n isInlineFragment,\n} from 'apollo-utilities';\nimport { FetchResult } from 'apollo-link';\n\nimport { invariant } from 'ts-invariant';\n\nimport ApolloClient from '../ApolloClient';\nimport { Resolvers, OperationVariables } from './types';\nimport { capitalizeFirstLetter } from '../util/capitalizeFirstLetter';\n\nexport type Resolver = (\n rootValue?: any,\n args?: any,\n context?: any,\n info?: {\n field: FieldNode;\n fragmentMap: FragmentMap;\n },\n) => any;\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: any,\n) => boolean;\n\nexport type ExecContext = {\n fragmentMap: FragmentMap;\n context: any;\n variables: VariableMap;\n fragmentMatcher: FragmentMatcher;\n defaultOperationType: string;\n exportedVariables: Record;\n onlyRunForcedResolvers: boolean;\n};\n\nexport type LocalStateOptions = {\n cache: ApolloCache;\n client?: ApolloClient;\n resolvers?: Resolvers | Resolvers[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport class LocalState {\n private cache: ApolloCache;\n private client: ApolloClient;\n private resolvers?: Resolvers;\n private fragmentMatcher: FragmentMatcher;\n\n constructor({\n cache,\n client,\n resolvers,\n fragmentMatcher,\n }: LocalStateOptions) {\n this.cache = cache;\n\n if (client) {\n this.client = client;\n }\n\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(resolverGroup => {\n this.resolvers = mergeDeep(this.resolvers, resolverGroup);\n });\n } else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n }\n\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n }\n\n public getResolvers() {\n return this.resolvers || {};\n }\n\n // Run local client resolvers against the incoming query and remote data.\n // Locally resolved field values are merged with the incoming remote data,\n // and returned. Note that locally resolved fields will overwrite\n // remote data using the same field name.\n public async runResolvers({\n document,\n remoteResult,\n context,\n variables,\n onlyRunForcedResolvers = false,\n }: {\n document: DocumentNode | null;\n remoteResult: FetchResult;\n context?: Record;\n variables?: Record;\n onlyRunForcedResolvers?: boolean;\n }): Promise> {\n if (document) {\n return this.resolveDocument(\n document,\n remoteResult.data,\n context,\n variables,\n this.fragmentMatcher,\n onlyRunForcedResolvers,\n ).then(localResult => ({\n ...remoteResult,\n data: localResult.result,\n }));\n }\n\n return remoteResult;\n }\n\n public setFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n }\n\n public getFragmentMatcher(): FragmentMatcher {\n return this.fragmentMatcher;\n }\n\n // Client queries contain everything in the incoming document (if a @client\n // directive is found).\n public clientQuery(document: DocumentNode) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n invariant.warn(\n 'Found @client directives in a query but no ApolloClient resolvers ' +\n 'were specified. This means ApolloClient local resolver handling ' +\n 'has been disabled, and @client directives will be passed through ' +\n 'to your link chain.',\n );\n }\n return null;\n }\n\n // Server queries are stripped of all @client based selection sets.\n public serverQuery(document: DocumentNode) {\n return this.resolvers ? removeClientSetsFromDocument(document) : document;\n }\n\n public prepareContext(context = {}) {\n const { cache } = this;\n\n const newContext = {\n ...context,\n cache,\n // Getting an entry's cache key is useful for local state resolvers.\n getCacheKey: (obj: { __typename: string; id: string | number }) => {\n if ((cache as any).config) {\n return (cache as any).config.dataIdFromObject(obj);\n } else {\n invariant(false,\n 'To use context.getCacheKey, you need to use a cache that has ' +\n 'a configurable dataIdFromObject, like apollo-cache-inmemory.',\n );\n }\n },\n };\n\n return newContext;\n }\n\n // To support `@client @export(as: \"someVar\")` syntax, we'll first resolve\n // @client @export fields locally, then pass the resolved values back to be\n // used alongside the original operation variables.\n public async addExportedVariables(\n document: DocumentNode,\n variables: OperationVariables = {},\n context = {},\n ) {\n if (document) {\n return this.resolveDocument(\n document,\n this.buildRootValueFromCache(document, variables) || {},\n this.prepareContext(context),\n variables,\n ).then(data => ({\n ...variables,\n ...data.exportedVariables,\n }));\n }\n\n return {\n ...variables,\n };\n }\n\n public shouldForceResolvers(document: ASTNode) {\n let forceResolvers = false;\n visit(document, {\n Directive: {\n enter(node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(\n arg =>\n arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true,\n );\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n }\n\n // Query the cache and return matching data.\n private buildRootValueFromCache(\n document: DocumentNode,\n variables?: Record,\n ) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n }\n\n private async resolveDocument(\n document: DocumentNode,\n rootValue: TData,\n context: any = {},\n variables: VariableMap = {},\n fragmentMatcher: FragmentMatcher = () => true,\n onlyRunForcedResolvers: boolean = false,\n ) {\n const mainDefinition = getMainDefinition(document);\n const fragments = getFragmentDefinitions(document);\n const fragmentMap = createFragmentMap(fragments);\n\n const definitionOperation = (mainDefinition as OperationDefinitionNode)\n .operation;\n\n const defaultOperationType = definitionOperation\n ? capitalizeFirstLetter(definitionOperation)\n : 'Query';\n\n const { cache, client } = this;\n const execContext: ExecContext = {\n fragmentMap,\n context: {\n ...context,\n cache,\n client,\n },\n variables,\n fragmentMatcher,\n defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers,\n };\n\n return this.resolveSelectionSet(\n mainDefinition.selectionSet,\n rootValue,\n execContext,\n ).then(result => ({\n result,\n exportedVariables: execContext.exportedVariables,\n }));\n }\n\n private async resolveSelectionSet(\n selectionSet: SelectionSetNode,\n rootValue: TData,\n execContext: ExecContext,\n ) {\n const { fragmentMap, context, variables } = execContext;\n const resultsToMerge: TData[] = [rootValue];\n\n const execute = async (selection: SelectionNode): Promise => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely.\n return;\n }\n\n if (isField(selection)) {\n return this.resolveField(selection, rootValue, execContext).then(\n fieldResult => {\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n } as TData);\n }\n },\n );\n }\n\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment.\n fragment = fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}`);\n }\n\n if (fragment && fragment.typeCondition) {\n const typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return this.resolveSelectionSet(\n fragment.selectionSet,\n rootValue,\n execContext,\n ).then(fragmentResult => {\n resultsToMerge.push(fragmentResult);\n });\n }\n }\n };\n\n return Promise.all(selectionSet.selections.map(execute)).then(function() {\n return mergeDeepArray(resultsToMerge);\n });\n }\n\n private async resolveField(\n field: FieldNode,\n rootValue: any,\n execContext: ExecContext,\n ): Promise {\n const { variables } = execContext;\n const fieldName = field.name.value;\n const aliasedFieldName = resultKeyNameFromField(field);\n const aliasUsed = fieldName !== aliasedFieldName;\n const defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n let resultPromise = Promise.resolve(defaultResult);\n\n // Usually all local resolvers are run when passing through here, but\n // if we've specifically identified that we only want to run forced\n // resolvers (that is, resolvers for fields marked with\n // `@client(always: true)`), then we'll skip running non-forced resolvers.\n if (\n !execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)\n ) {\n const resolverType =\n rootValue.__typename || execContext.defaultOperationType;\n const resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n const resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(resolve(\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field, fragmentMap: execContext.fragmentMap },\n ));\n }\n }\n }\n\n return resultPromise.then((result = defaultResult) => {\n // If an @export directive is associated with the current field, store\n // the `as` export variable name and current result for later use.\n if (field.directives) {\n field.directives.forEach(directive => {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(arg => {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n\n // Handle all scalar types here.\n if (!field.selectionSet) {\n return result;\n }\n\n // From here down, the field has a selection set, which means it's trying\n // to query a GraphQLObjectType.\n if (result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return result;\n }\n\n if (Array.isArray(result)) {\n return this.resolveSubSelectedArray(field, result, execContext);\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n if (field.selectionSet) {\n return this.resolveSelectionSet(\n field.selectionSet,\n result,\n execContext,\n );\n }\n });\n }\n\n private resolveSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): any {\n return Promise.all(\n result.map(item => {\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse.\n if (Array.isArray(item)) {\n return this.resolveSubSelectedArray(field, item, execContext);\n }\n\n // This is an object, run the selection set on it.\n if (field.selectionSet) {\n return this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }),\n );\n }\n}\n","import { Observable, Observer, Subscription } from './Observable';\n\n// Returns a normal Observable that can have any number of subscribers,\n// while ensuring the original Observable gets subscribed to at most once.\nexport function multiplex(inner: Observable): Observable {\n const observers = new Set>();\n let sub: Subscription | null = null;\n return new Observable(observer => {\n observers.add(observer);\n sub = sub || inner.subscribe({\n next(value) {\n observers.forEach(obs => obs.next && obs.next(value));\n },\n error(error) {\n observers.forEach(obs => obs.error && obs.error(error));\n },\n complete() {\n observers.forEach(obs => obs.complete && obs.complete());\n },\n });\n return () => {\n if (observers.delete(observer) && !observers.size && sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n });\n}\n\n// Like Observable.prototype.map, except that the mapping function can\n// optionally return a Promise (or be async).\nexport function asyncMap(\n observable: Observable,\n mapFn: (value: V) => R | Promise,\n): Observable {\n return new Observable(observer => {\n const { next, error, complete } = observer;\n let activeNextCount = 0;\n let completed = false;\n\n const handler: Observer = {\n next(value) {\n ++activeNextCount;\n new Promise(resolve => {\n resolve(mapFn(value));\n }).then(\n result => {\n --activeNextCount;\n next && next.call(observer, result);\n completed && handler.complete!();\n },\n e => {\n --activeNextCount;\n error && error.call(observer, e);\n },\n );\n },\n error(e) {\n error && error.call(observer, e);\n },\n complete() {\n completed = true;\n if (!activeNextCount) {\n complete && complete.call(observer);\n }\n },\n };\n\n const sub = observable.subscribe(handler);\n return () => sub.unsubscribe();\n });\n}\n","import { execute, ApolloLink, FetchResult } from 'apollo-link';\nimport { DocumentNode } from 'graphql';\nimport { Cache } from 'apollo-cache';\nimport {\n getDefaultValues,\n getOperationDefinition,\n getOperationName,\n hasDirectives,\n graphQLResultHasError,\n hasClientExports,\n removeConnectionDirectiveFromDocument,\n canUseWeakMap,\n} from 'apollo-utilities';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { isApolloError, ApolloError } from '../errors/ApolloError';\nimport { Observer, Subscription, Observable } from '../util/Observable';\nimport { QueryWithUpdater, DataStore } from '../data/store';\nimport { MutationStore } from '../data/mutations';\nimport { QueryStore, QueryStoreValue } from '../data/queries';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n QueryListener,\n ApolloQueryResult,\n FetchType,\n OperationVariables,\n} from './types';\nimport { LocalState } from './LocalState';\nimport { asyncMap, multiplex } from '../util/observables';\nimport { isNonEmptyArray } from '../util/arrays';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport interface QueryInfo {\n listeners: Set;\n invalidated: boolean;\n newData: Cache.DiffResult | null;\n document: DocumentNode | null;\n lastRequestId: number;\n // A map going from queryId to an observer for a query issued by watchQuery. We use\n // these to keep track of queries that are inflight and error on the observers associated\n // with them in case of some destabalizing action (e.g. reset of the Apollo store).\n observableQuery: ObservableQuery | null;\n subscriptions: Set;\n cancel?: () => void;\n}\n\nexport class QueryManager {\n public link: ApolloLink;\n public mutationStore: MutationStore = new MutationStore();\n public queryStore: QueryStore = new QueryStore();\n public dataStore: DataStore;\n public readonly assumeImmutableResults: boolean;\n\n private queryDeduplication: boolean;\n private clientAwareness: Record = {};\n private localState: LocalState;\n\n private onBroadcast: () => void;\n\n private ssrMode: boolean;\n\n // let's not start at zero to avoid pain with bad checks\n private idCounter = 1;\n\n // XXX merge with ObservableQuery but that needs to be expanded to support mutations and\n // subscriptions as well\n private queries: Map = new Map();\n\n // A map of Promise reject functions for fetchQuery promises that have not\n // yet been resolved, used to keep track of in-flight queries so that we can\n // reject them in case a destabilizing event occurs (e.g. Apollo store reset).\n // The key is in the format of `query:${queryId}` or `fetchRequest:${queryId}`,\n // depending on where the promise's rejection function was created from.\n private fetchQueryRejectFns = new Map();\n\n constructor({\n link,\n queryDeduplication = false,\n store,\n onBroadcast = () => undefined,\n ssrMode = false,\n clientAwareness = {},\n localState,\n assumeImmutableResults,\n }: {\n link: ApolloLink;\n queryDeduplication?: boolean;\n store: DataStore;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record;\n localState?: LocalState;\n assumeImmutableResults?: boolean;\n }) {\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.dataStore = store;\n this.onBroadcast = onBroadcast;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: store.getCache() });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n }\n\n /**\n * Call this method to terminate any active query processes, making it safe\n * to dispose of this QueryManager instance.\n */\n public stop() {\n this.queries.forEach((_info, queryId) => {\n this.stopQueryNoBroadcast(queryId);\n });\n\n this.fetchQueryRejectFns.forEach(reject => {\n reject(\n new InvariantError('QueryManager stopped while query was in flight'),\n );\n });\n }\n\n public async mutate({\n mutation,\n variables,\n optimisticResponse,\n updateQueries: updateQueriesByName,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise> {\n invariant(\n mutation,\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n\n invariant(\n !fetchPolicy || fetchPolicy === 'no-cache',\n \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\"\n );\n\n const mutationId = this.generateQueryId();\n mutation = this.transform(mutation).document;\n\n this.setQuery(mutationId, () => ({ document: mutation }));\n\n variables = this.getVariables(mutation, variables);\n\n if (this.transform(mutation).hasClientExports) {\n variables = await this.localState.addExportedVariables(mutation, variables, context);\n }\n\n // Create a map of update queries by id to the query instead of by name.\n const generateUpdateQueriesInfo: () => {\n [queryId: string]: QueryWithUpdater;\n } = () => {\n const ret: { [queryId: string]: QueryWithUpdater } = {};\n\n if (updateQueriesByName) {\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const { queryName } = observableQuery;\n if (\n queryName &&\n hasOwnProperty.call(updateQueriesByName, queryName)\n ) {\n ret[queryId] = {\n updater: updateQueriesByName[queryName],\n query: this.queryStore.get(queryId),\n };\n }\n }\n });\n }\n\n return ret;\n };\n\n this.mutationStore.initMutation(\n mutationId,\n mutation,\n variables,\n );\n\n this.dataStore.markMutationInit({\n mutationId,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n const self = this;\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult | null;\n let error: ApolloError;\n\n self.getObservableFromLink(\n mutation,\n {\n ...context,\n optimisticResponse,\n },\n variables,\n false,\n ).subscribe({\n next(result: FetchResult) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n self.mutationStore.markMutationResult(mutationId);\n\n if (fetchPolicy !== 'no-cache') {\n self.dataStore.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n });\n }\n\n storeResult = result;\n },\n\n error(err: Error) {\n self.mutationStore.markMutationError(mutationId, err);\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n self.broadcastQueries();\n self.setQuery(mutationId, () => ({ document: null }));\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete() {\n if (error) {\n self.mutationStore.markMutationError(mutationId, error);\n }\n\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n\n self.broadcastQueries();\n\n if (error) {\n reject(error);\n return;\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult!);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult[] | ApolloQueryResult<{}>\n >[] = [];\n\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(refetchQuery => {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(({ observableQuery }) => {\n if (\n observableQuery &&\n observableQuery.queryName === refetchQuery\n ) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n } else {\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n\n Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n self.setQuery(mutationId, () => ({ document: null }));\n\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n resolve(storeResult!);\n });\n },\n });\n });\n }\n\n public async fetchQuery(\n queryId: string,\n options: WatchQueryOptions,\n fetchType?: FetchType,\n // This allows us to track if this is a query spawned by a `fetchMore`\n // call for another query. We need this data to compute the `fetchMore`\n // network status for the query this is fetching for.\n fetchMoreForQueryId?: string,\n ): Promise> {\n const {\n metadata = null,\n fetchPolicy = 'cache-first', // cache-first is the default fetch policy.\n context = {},\n } = options;\n\n const query = this.transform(options.query).document;\n\n let variables = this.getVariables(query, options.variables);\n\n if (this.transform(query).hasClientExports) {\n variables = await this.localState.addExportedVariables(query, variables, context);\n }\n\n options = { ...options, variables };\n\n let storeResult: any;\n const isNetworkOnly =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n let needToFetch = isNetworkOnly;\n\n // Unless we are completely skipping the cache, we want to diff the query\n // against the cache before we fetch it from the network interface.\n if (!isNetworkOnly) {\n const { complete, result } = this.dataStore.getCache().diff({\n query,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n // If we're in here, only fetch if we have missing fields\n needToFetch = !complete || fetchPolicy === 'cache-and-network';\n storeResult = result;\n }\n\n let shouldFetch =\n needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby';\n\n // we need to check to see if this is an operation that uses the @live directive\n if (hasDirectives(['live'], query)) shouldFetch = true;\n\n const requestId = this.idCounter++;\n\n // set up a watcher to listen to cache updates\n const cancel = fetchPolicy !== 'no-cache'\n ? this.updateQueryWatch(queryId, query, options)\n : undefined;\n\n // Initialize query in store with unique requestId\n this.setQuery(queryId, () => ({\n document: query,\n lastRequestId: requestId,\n invalidated: true,\n cancel,\n }));\n\n this.invalidate(fetchMoreForQueryId);\n\n this.queryStore.initQuery({\n queryId,\n document: query,\n storePreviousVariables: shouldFetch,\n variables,\n isPoll: fetchType === FetchType.poll,\n isRefetch: fetchType === FetchType.refetch,\n metadata,\n fetchMoreForQueryId,\n });\n\n this.broadcastQueries();\n\n if (shouldFetch) {\n const networkResult = this.fetchRequest({\n requestId,\n queryId,\n document: query,\n options,\n fetchMoreForQueryId,\n }).catch(error => {\n // This is for the benefit of `refetch` promises, which currently don't get their errors\n // through the store like watchQuery observers do\n if (isApolloError(error)) {\n throw error;\n } else {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n this.broadcastQueries();\n }\n throw new ApolloError({ networkError: error });\n }\n });\n\n // we don't return the promise for cache-and-network since it is already\n // returned below from the cache\n if (fetchPolicy !== 'cache-and-network') {\n return networkResult;\n }\n\n // however we need to catch the error so it isn't unhandled in case of\n // network error\n networkResult.catch(() => {});\n }\n\n // If there is no part of the query we need to fetch from the server (or,\n // fetchPolicy is cache-only), we just write the store result as the final result.\n this.queryStore.markQueryResultClient(queryId, !shouldFetch);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n if (this.transform(query).hasForcedResolvers) {\n return this.localState.runResolvers({\n document: query,\n remoteResult: { data: storeResult },\n context,\n variables,\n onlyRunForcedResolvers: true,\n }).then((result: FetchResult) => {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n this.broadcastQueries();\n return result;\n });\n }\n\n this.broadcastQueries();\n\n // If we have no query to send to the server, we should return the result\n // found within the store.\n return { data: storeResult };\n }\n\n private markQueryResult(\n queryId: string,\n result: FetchResult,\n {\n fetchPolicy,\n variables,\n errorPolicy,\n }: WatchQueryOptions,\n fetchMoreForQueryId?: string,\n ) {\n if (fetchPolicy === 'no-cache') {\n this.setQuery(queryId, () => ({\n newData: { result: result.data, complete: true },\n }));\n } else {\n this.dataStore.markQueryResult(\n result,\n this.getQuery(queryId).document!,\n variables,\n fetchMoreForQueryId,\n errorPolicy === 'ignore' || errorPolicy === 'all',\n );\n }\n }\n\n // Returns a query listener that will update the given observer based on the\n // results (or lack thereof) for a particular query.\n public queryListenerForObserver(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ): QueryListener {\n function invoke(method: 'next' | 'error', argument: any) {\n if (observer[method]) {\n try {\n observer[method]!(argument);\n } catch (e) {\n invariant.error(e);\n }\n } else if (method === 'error') {\n invariant.error(argument);\n }\n }\n\n return (\n queryStoreValue: QueryStoreValue,\n newData?: Cache.DiffResult,\n ) => {\n // we're going to take a look at the data, so the query is no longer invalidated\n this.invalidate(queryId, false);\n\n // The query store value can be undefined in the event of a store\n // reset.\n if (!queryStoreValue) return;\n\n const { observableQuery, document } = this.getQuery(queryId);\n\n const fetchPolicy = observableQuery\n ? observableQuery.options.fetchPolicy\n : options.fetchPolicy;\n\n // don't watch the store for queries on standby\n if (fetchPolicy === 'standby') return;\n\n const loading = isNetworkRequestInFlight(queryStoreValue.networkStatus);\n const lastResult = observableQuery && observableQuery.getLastResult();\n\n const networkStatusChanged = !!(\n lastResult &&\n lastResult.networkStatus !== queryStoreValue.networkStatus\n );\n\n const shouldNotifyIfLoading =\n options.returnPartialData ||\n (!newData && queryStoreValue.previousVariables) ||\n (networkStatusChanged && options.notifyOnNetworkStatusChange) ||\n fetchPolicy === 'cache-only' ||\n fetchPolicy === 'cache-and-network';\n\n if (loading && !shouldNotifyIfLoading) {\n return;\n }\n\n const hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors);\n\n const errorPolicy: ErrorPolicy = observableQuery\n && observableQuery.options.errorPolicy\n || options.errorPolicy\n || 'none';\n\n // If we have either a GraphQL error or a network error, we create\n // an error and tell the observer about it.\n if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) {\n return invoke('error', new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }));\n }\n\n try {\n let data: any;\n let isMissing: boolean;\n\n if (newData) {\n // As long as we're using the cache, clear out the latest\n // `newData`, since it will now become the current data. We need\n // to keep the `newData` stored with the query when using\n // `no-cache` since `getCurrentQueryResult` attemps to pull from\n // `newData` first, following by trying the cache (which won't\n // find a hit for `no-cache`).\n if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') {\n this.setQuery(queryId, () => ({ newData: null }));\n }\n\n data = newData.result;\n isMissing = !newData.complete;\n } else {\n const lastError = observableQuery && observableQuery.getLastError();\n const errorStatusChanged =\n errorPolicy !== 'none' &&\n (lastError && lastError.graphQLErrors) !==\n queryStoreValue.graphQLErrors;\n\n if (lastResult && lastResult.data && !errorStatusChanged) {\n data = lastResult.data;\n isMissing = false;\n } else {\n const diffResult = this.dataStore.getCache().diff({\n query: document as DocumentNode,\n variables:\n queryStoreValue.previousVariables ||\n queryStoreValue.variables,\n returnPartialData: true,\n optimistic: true,\n });\n\n data = diffResult.result;\n isMissing = !diffResult.complete;\n }\n }\n\n // If there is some data missing and the user has told us that they\n // do not tolerate partial data then we want to return the previous\n // result and mark it as stale.\n const stale = isMissing && !(\n options.returnPartialData ||\n fetchPolicy === 'cache-only'\n );\n\n const resultFromStore: ApolloQueryResult = {\n data: stale ? lastResult && lastResult.data : data,\n loading,\n networkStatus: queryStoreValue.networkStatus,\n stale,\n };\n\n // if the query wants updates on errors we need to add it to the result\n if (errorPolicy === 'all' && hasGraphQLErrors) {\n resultFromStore.errors = queryStoreValue.graphQLErrors;\n }\n\n invoke('next', resultFromStore);\n\n } catch (networkError) {\n invoke('error', new ApolloError({ networkError }));\n }\n };\n }\n\n private transformCache = new (canUseWeakMap ? WeakMap : Map)<\n DocumentNode,\n Readonly<{\n document: Readonly;\n hasClientExports: boolean;\n hasForcedResolvers: boolean;\n clientQuery: Readonly | null;\n serverQuery: Readonly | null;\n defaultVars: Readonly;\n }>\n >();\n\n public transform(document: DocumentNode) {\n const { transformCache } = this;\n\n if (!transformCache.has(document)) {\n const cache = this.dataStore.getCache();\n const transformed = cache.transformDocument(document);\n const forLink = removeConnectionDirectiveFromDocument(\n cache.transformForLink(transformed));\n\n const clientQuery = this.localState.clientQuery(transformed);\n const serverQuery = this.localState.serverQuery(forLink);\n\n const cacheEntry = {\n document: transformed,\n // TODO These two calls (hasClientExports and shouldForceResolvers)\n // could probably be merged into a single traversal.\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery,\n serverQuery,\n defaultVars: getDefaultValues(\n getOperationDefinition(transformed)\n ) as OperationVariables,\n };\n\n const add = (doc: DocumentNode | null) => {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry);\n }\n }\n // Add cacheEntry to the transformCache using several different keys,\n // since any one of these documents could end up getting passed to the\n // transform method again in the future.\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n\n return transformCache.get(document)!;\n }\n\n private getVariables(\n document: DocumentNode,\n variables?: OperationVariables,\n ): OperationVariables {\n return {\n ...this.transform(document).defaultVars,\n ...variables,\n };\n }\n\n // The shouldSubscribe option is a temporary fix that tells us whether watchQuery was called\n // directly (i.e. through ApolloClient) or through the query method within QueryManager.\n // Currently, the query method uses watchQuery in order to handle non-network errors correctly\n // but we don't want to keep track observables issued for the query method since those aren't\n // supposed to be refetched in the event of a store reset. Once we unify error handling for\n // network errors and non-network errors, the shouldSubscribe option will go away.\n\n public watchQuery(\n options: WatchQueryOptions,\n shouldSubscribe = true,\n ): ObservableQuery {\n invariant(\n options.fetchPolicy !== 'standby',\n 'client.watchQuery cannot be called with fetchPolicy set to \"standby\"',\n );\n\n // assign variable default values if supplied\n options.variables = this.getVariables(options.query, options.variables);\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n let transformedOptions = { ...options } as WatchQueryOptions;\n\n return new ObservableQuery({\n queryManager: this,\n options: transformedOptions,\n shouldSubscribe: shouldSubscribe,\n });\n }\n\n public query(options: QueryOptions): Promise> {\n invariant(\n options.query,\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n\n invariant(\n options.query.kind === 'Document',\n 'You must wrap the query string in a \"gql\" tag.',\n );\n\n invariant(\n !(options as any).returnPartialData,\n 'returnPartialData option only supported on watchQuery.',\n );\n\n invariant(\n !(options as any).pollInterval,\n 'pollInterval option only supported on watchQuery.',\n );\n\n return new Promise>((resolve, reject) => {\n const watchedQuery = this.watchQuery(options, false);\n this.fetchQueryRejectFns.set(`query:${watchedQuery.queryId}`, reject);\n watchedQuery\n .result()\n .then(resolve, reject)\n // Since neither resolve nor reject throw or return a value, this .then\n // handler is guaranteed to execute. Note that it doesn't really matter\n // when we remove the reject function from this.fetchQueryRejectFns,\n // since resolve and reject are mutually idempotent. In fact, it would\n // not be incorrect to let reject functions accumulate over time; it's\n // just a waste of memory.\n .then(() =>\n this.fetchQueryRejectFns.delete(`query:${watchedQuery.queryId}`),\n );\n });\n }\n\n public generateQueryId() {\n return String(this.idCounter++);\n }\n\n public stopQueryInStore(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryInStoreNoBroadcast(queryId: string) {\n this.stopPollingQuery(queryId);\n this.queryStore.stopQuery(queryId);\n this.invalidate(queryId);\n }\n\n public addQueryListener(queryId: string, listener: QueryListener) {\n this.setQuery(queryId, ({ listeners }) => {\n listeners.add(listener);\n return { invalidated: false };\n });\n }\n\n public updateQueryWatch(\n queryId: string,\n document: DocumentNode,\n options: WatchQueryOptions,\n ) {\n const { cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n const previousResult = () => {\n let previousResult = null;\n const { observableQuery } = this.getQuery(queryId);\n if (observableQuery) {\n const lastResult = observableQuery.getLastResult();\n if (lastResult) {\n previousResult = lastResult.data;\n }\n }\n\n return previousResult;\n };\n return this.dataStore.getCache().watch({\n query: document as DocumentNode,\n variables: options.variables,\n optimistic: true,\n previousResult,\n callback: newData => {\n this.setQuery(queryId, () => ({ invalidated: true, newData }));\n },\n });\n }\n\n // Adds an ObservableQuery to this.observableQueries and to this.observableQueriesByName.\n public addObservableQuery(\n queryId: string,\n observableQuery: ObservableQuery,\n ) {\n this.setQuery(queryId, () => ({ observableQuery }));\n }\n\n public removeObservableQuery(queryId: string) {\n const { cancel } = this.getQuery(queryId);\n this.setQuery(queryId, () => ({ observableQuery: null }));\n if (cancel) cancel();\n }\n\n public clearStore(): Promise {\n // Before we have sent the reset action to the store,\n // we can no longer rely on the results returned by in-flight\n // requests since these may depend on values that previously existed\n // in the data portion of the store. So, we cancel the promises and observers\n // that we have issued so far and not yet resolved (in the case of\n // queries).\n this.fetchQueryRejectFns.forEach(reject => {\n reject(new InvariantError(\n 'Store reset while query was in flight (not completed in link chain)',\n ));\n });\n\n const resetIds: string[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) resetIds.push(queryId);\n });\n\n this.queryStore.reset(resetIds);\n this.mutationStore.reset();\n\n // begin removing data from the store\n return this.dataStore.reset();\n }\n\n public resetStore(): Promise[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby: boolean = false,\n ): Promise[]> {\n const observableQueryPromises: Promise>[] = [];\n\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.setQuery(queryId, () => ({ newData: null }));\n this.invalidate(queryId);\n }\n });\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public observeQuery(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ) {\n this.addQueryListener(\n queryId,\n this.queryListenerForObserver(queryId, options, observer),\n );\n return this.fetchQuery(queryId, options);\n }\n\n public startQuery(\n queryId: string,\n options: WatchQueryOptions,\n listener: QueryListener,\n ) {\n invariant.warn(\"The QueryManager.startQuery method has been deprecated\");\n\n this.addQueryListener(queryId, listener);\n\n this.fetchQuery(queryId, options)\n // `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the\n // console will show an `Uncaught (in promise)` message. Ignore the error for now.\n .catch(() => undefined);\n\n return queryId;\n }\n\n public startGraphQLSubscription({\n query,\n fetchPolicy,\n variables,\n }: SubscriptionOptions): Observable> {\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n\n const makeObservable = (variables: OperationVariables) =>\n this.getObservableFromLink(\n query,\n {},\n variables,\n false,\n ).map(result => {\n if (!fetchPolicy || fetchPolicy !== 'no-cache') {\n this.dataStore.markSubscriptionResult(\n result,\n query,\n variables,\n );\n this.broadcastQueries();\n }\n\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n\n return result;\n });\n\n if (this.transform(query).hasClientExports) {\n const observablePromise = this.localState.addExportedVariables(\n query,\n variables,\n ).then(makeObservable);\n\n return new Observable>(observer => {\n let sub: Subscription | null = null;\n observablePromise.then(\n observable => sub = observable.subscribe(observer),\n observer.error,\n );\n return () => sub && sub.unsubscribe();\n });\n }\n\n return makeObservable(variables);\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryNoBroadcast(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n // teardown all links\n // Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises\n // that each add their reject functions to fetchQueryRejectFns.\n // A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.\n // The same queryId could have two rejection fns for two promises\n this.fetchQueryRejectFns.delete(`query:${queryId}`);\n this.fetchQueryRejectFns.delete(`fetchRequest:${queryId}`);\n this.getQuery(queryId).subscriptions.forEach(x => x.unsubscribe());\n this.queries.delete(queryId);\n }\n\n public getCurrentQueryResult(\n observableQuery: ObservableQuery,\n optimistic: boolean = true,\n ): {\n data: T | undefined;\n partial: boolean;\n } {\n const { variables, query, fetchPolicy, returnPartialData } = observableQuery.options;\n const lastResult = observableQuery.getLastResult();\n const { newData } = this.getQuery(observableQuery.queryId);\n\n if (newData && newData.complete) {\n return { data: newData.result, partial: false };\n }\n\n if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') {\n return { data: undefined, partial: false };\n }\n\n const { result, complete } = this.dataStore.getCache().diff({\n query,\n variables,\n previousResult: lastResult ? lastResult.data : undefined,\n returnPartialData: true,\n optimistic,\n });\n\n return {\n data: (complete || returnPartialData) ? result : void 0,\n partial: !complete,\n };\n }\n\n public getQueryWithPreviousResult(\n queryIdOrObservable: string | ObservableQuery,\n ): {\n previousResult: any;\n variables: TVariables | undefined;\n document: DocumentNode;\n } {\n let observableQuery: ObservableQuery;\n if (typeof queryIdOrObservable === 'string') {\n const { observableQuery: foundObserveableQuery } = this.getQuery(\n queryIdOrObservable,\n );\n invariant(\n foundObserveableQuery,\n `ObservableQuery with this id doesn't exist: ${queryIdOrObservable}`\n );\n observableQuery = foundObserveableQuery!;\n } else {\n observableQuery = queryIdOrObservable;\n }\n\n const { variables, query } = observableQuery.options;\n return {\n previousResult: this.getCurrentQueryResult(observableQuery, false).data,\n variables,\n document: query,\n };\n }\n\n public broadcastQueries() {\n this.onBroadcast();\n this.queries.forEach((info, id) => {\n if (info.invalidated) {\n info.listeners.forEach(listener => {\n // it's possible for the listener to be undefined if the query is being stopped\n // See here for more detail: https://github.com/apollostack/apollo-client/issues/231\n if (listener) {\n listener(this.queryStore.get(id), info.newData);\n }\n });\n }\n });\n }\n\n public getLocalState(): LocalState {\n return this.localState;\n }\n\n private inFlightLinkObservables = new Map<\n DocumentNode,\n Map>\n >();\n\n private getObservableFromLink(\n query: DocumentNode,\n context: any,\n variables?: OperationVariables,\n deduplication: boolean = this.queryDeduplication,\n ): Observable> {\n let observable: Observable>;\n\n const { serverQuery } = this.transform(query);\n if (serverQuery) {\n const { inFlightLinkObservables, link } = this;\n\n const operation = {\n query: serverQuery,\n variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext({\n ...context,\n forceFetch: !deduplication\n }),\n };\n\n context = operation.context;\n\n if (deduplication) {\n const byVariables = inFlightLinkObservables.get(serverQuery) || new Map();\n inFlightLinkObservables.set(serverQuery, byVariables);\n\n const varJson = JSON.stringify(variables);\n observable = byVariables.get(varJson);\n\n if (!observable) {\n byVariables.set(\n varJson,\n observable = multiplex(\n execute(link, operation) as Observable>\n )\n );\n\n const cleanup = () => {\n byVariables.delete(varJson);\n if (!byVariables.size) inFlightLinkObservables.delete(serverQuery);\n cleanupSub.unsubscribe();\n };\n\n const cleanupSub = observable.subscribe({\n next: cleanup,\n error: cleanup,\n complete: cleanup,\n });\n }\n\n } else {\n observable = multiplex(execute(link, operation) as Observable>);\n }\n } else {\n observable = Observable.of({ data: {} } as FetchResult);\n context = this.prepareContext(context);\n }\n\n const { clientQuery } = this.transform(query);\n if (clientQuery) {\n observable = asyncMap(observable, result => {\n return this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context,\n variables,\n });\n });\n }\n\n return observable;\n }\n\n // Takes a request id, query id, a query document and information associated with the query\n // and send it to the network interface. Returns\n // a promise for the result associated with that request.\n private fetchRequest({\n requestId,\n queryId,\n document,\n options,\n fetchMoreForQueryId,\n }: {\n requestId: number;\n queryId: string;\n document: DocumentNode;\n options: WatchQueryOptions;\n fetchMoreForQueryId?: string;\n }): Promise> {\n const { variables, errorPolicy = 'none', fetchPolicy } = options;\n let resultFromStore: any;\n let errorsFromStore: any;\n\n return new Promise>((resolve, reject) => {\n const observable = this.getObservableFromLink(\n document,\n options.context,\n variables,\n );\n\n const fqrfId = `fetchRequest:${queryId}`;\n this.fetchQueryRejectFns.set(fqrfId, reject);\n\n const cleanup = () => {\n this.fetchQueryRejectFns.delete(fqrfId);\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.delete(subscription);\n });\n };\n\n const subscription = observable.map((result: FetchResult) => {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n\n this.queryStore.markQueryResult(\n queryId,\n result,\n fetchMoreForQueryId,\n );\n\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) {\n return reject(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n\n if (errorPolicy === 'all') {\n errorsFromStore = result.errors;\n }\n\n if (fetchMoreForQueryId || fetchPolicy === 'no-cache') {\n // We don't write fetchMore results to the store because this would overwrite\n // the original result in case an @connection directive is used.\n resultFromStore = result.data;\n } else {\n // ensure result is combined with data already in store\n const { result, complete } = this.dataStore.getCache().diff({\n variables,\n query: document,\n optimistic: false,\n returnPartialData: true,\n });\n\n if (complete || options.returnPartialData) {\n resultFromStore = result;\n }\n }\n }).subscribe({\n error(error: ApolloError) {\n cleanup();\n reject(error);\n },\n\n complete() {\n cleanup();\n resolve({\n data: resultFromStore,\n errors: errorsFromStore,\n loading: false,\n networkStatus: NetworkStatus.ready,\n stale: false,\n });\n },\n });\n\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.add(subscription);\n });\n });\n }\n\n private getQuery(queryId: string) {\n return (\n this.queries.get(queryId) || {\n listeners: new Set(),\n invalidated: false,\n document: null,\n newData: null,\n lastRequestId: 1,\n observableQuery: null,\n subscriptions: new Set(),\n }\n );\n }\n\n private setQuery(\n queryId: string,\n updater: (prev: QueryInfo) => Pick | void,\n ) {\n const prev = this.getQuery(queryId);\n const newInfo = { ...prev, ...updater(prev) };\n this.queries.set(queryId, newInfo);\n }\n\n private invalidate(\n queryId: string | undefined,\n invalidated = true,\n ) {\n if (queryId) {\n this.setQuery(queryId, () => ({ invalidated }));\n }\n }\n\n private prepareContext(context = {}) {\n const newContext = this.localState.prepareContext(context);\n return {\n ...newContext,\n clientAwareness: this.clientAwareness,\n };\n }\n\n public checkInFlight(queryId: string) {\n const query = this.queryStore.get(queryId);\n\n return (\n query &&\n query.networkStatus !== NetworkStatus.ready &&\n query.networkStatus !== NetworkStatus.error\n );\n }\n\n // Map from client ID to { interval, options }.\n private pollingInfoByQueryId = new Map();\n\n public startPollingQuery(\n options: WatchQueryOptions,\n queryId: string,\n listener?: QueryListener,\n ): string {\n const { pollInterval } = options;\n\n invariant(\n pollInterval,\n 'Attempted to start a polling query without a polling interval.',\n );\n\n // Do not poll in SSR mode\n if (!this.ssrMode) {\n let info = this.pollingInfoByQueryId.get(queryId)!;\n if (!info) {\n this.pollingInfoByQueryId.set(queryId, (info = {} as any));\n }\n\n info.interval = pollInterval!;\n info.options = {\n ...options,\n fetchPolicy: 'network-only',\n };\n\n const maybeFetch = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n if (this.checkInFlight(queryId)) {\n poll();\n } else {\n this.fetchQuery(queryId, info.options, FetchType.poll).then(\n poll,\n poll,\n );\n }\n }\n };\n\n const poll = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n\n if (listener) {\n this.addQueryListener(queryId, listener);\n }\n\n poll();\n }\n\n return queryId;\n }\n\n public stopPollingQuery(queryId: string) {\n this.pollingInfoByQueryId.delete(queryId);\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, Cache, DataProxy } from 'apollo-cache';\n\nimport { QueryStoreValue } from '../data/queries';\nimport {\n getOperationName,\n tryFunctionOrLogError,\n graphQLResultHasError,\n} from 'apollo-utilities';\nimport { MutationQueryReducer } from '../core/types';\n\nexport type QueryWithUpdater = {\n updater: MutationQueryReducer;\n query: QueryStoreValue;\n};\n\nexport interface DataWrite {\n rootId: string;\n result: any;\n document: DocumentNode;\n operationName: string | null;\n variables: Object;\n}\n\nexport class DataStore {\n private cache: ApolloCache;\n\n constructor(initialCache: ApolloCache) {\n this.cache = initialCache;\n }\n\n public getCache(): ApolloCache {\n return this.cache;\n }\n\n public markQueryResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n fetchMoreForQueryId: string | undefined,\n ignoreErrors: boolean = false,\n ) {\n let writeWithErrors = !graphQLResultHasError(result);\n if (ignoreErrors && graphQLResultHasError(result) && result.data) {\n writeWithErrors = true;\n }\n if (!fetchMoreForQueryId && writeWithErrors) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markSubscriptionResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n ) {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (!graphQLResultHasError(result)) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markMutationInit(mutation: {\n mutationId: string;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n optimisticResponse: Object | Function | undefined;\n }) {\n if (mutation.optimisticResponse) {\n let optimistic: Object;\n if (typeof mutation.optimisticResponse === 'function') {\n optimistic = mutation.optimisticResponse(mutation.variables);\n } else {\n optimistic = mutation.optimisticResponse;\n }\n\n this.cache.recordOptimisticTransaction(c => {\n const orig = this.cache;\n this.cache = c;\n\n try {\n this.markMutationResult({\n mutationId: mutation.mutationId,\n result: { data: optimistic },\n document: mutation.document,\n variables: mutation.variables,\n updateQueries: mutation.updateQueries,\n update: mutation.update,\n });\n } finally {\n this.cache = orig;\n }\n }, mutation.mutationId);\n }\n }\n\n public markMutationResult(mutation: {\n mutationId: string;\n result: ExecutionResult;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n }) {\n // Incorporate the result from this mutation into the store\n if (!graphQLResultHasError(mutation.result)) {\n const cacheWrites: Cache.WriteOptions[] = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n\n const { updateQueries } = mutation;\n if (updateQueries) {\n Object.keys(updateQueries).forEach(id => {\n const { query, updater } = updateQueries[id];\n\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = this.cache.diff({\n query: query.document,\n variables: query.variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (complete) {\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = tryFunctionOrLogError(() =>\n updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: getOperationName(query.document) || undefined,\n queryVariables: query.variables,\n }),\n );\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: query.document,\n variables: query.variables,\n });\n }\n }\n });\n }\n\n this.cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const { update } = mutation;\n if (update) {\n tryFunctionOrLogError(() => update(c, mutation.result));\n }\n });\n }\n }\n\n public markMutationComplete({\n mutationId,\n optimisticResponse,\n }: {\n mutationId: string;\n optimisticResponse?: any;\n }) {\n if (optimisticResponse) {\n this.cache.removeOptimistic(mutationId);\n }\n }\n\n public markUpdateQueryResult(\n document: DocumentNode,\n variables: any,\n newResult: any,\n ) {\n this.cache.write({\n result: newResult,\n dataId: 'ROOT_QUERY',\n variables,\n query: document,\n });\n }\n\n public reset(): Promise {\n return this.cache.reset();\n }\n}\n","export const version = \"2.6.10\"","import {\n ApolloLink,\n FetchResult,\n GraphQLRequest,\n execute,\n} from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, DataProxy } from 'apollo-cache';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { QueryManager } from './core/QueryManager';\nimport {\n ApolloQueryResult,\n OperationVariables,\n Resolvers,\n} from './core/types';\nimport { ObservableQuery } from './core/ObservableQuery';\nimport { LocalState, FragmentMatcher } from './core/LocalState';\nimport { Observable } from './util/Observable';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n WatchQueryFetchPolicy,\n} from './core/watchQueryOptions';\n\nimport { DataStore } from './data/store';\n\nimport { version } from './version';\n\nexport interface DefaultOptions {\n watchQuery?: Partial;\n query?: Partial;\n mutate?: Partial;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions = {\n link?: ApolloLink;\n cache: ApolloCache;\n ssrForceFetchDelay?: number;\n ssrMode?: boolean;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n assumeImmutableResults?: boolean;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n name?: string;\n version?: string;\n};\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport default class ApolloClient implements DataProxy {\n public link: ApolloLink;\n public store: DataStore;\n public cache: ApolloCache;\n public readonly queryManager: QueryManager;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n public readonly typeDefs: ApolloClientOptions['typeDefs'];\n\n private devToolsHookCb: Function;\n private resetStoreCallbacks: Array<() => Promise> = [];\n private clearStoreCallbacks: Array<() => Promise> = [];\n private localState: LocalState;\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param assumeImmutableResults When this option is true, the client will assume results\n * read from the cache are never mutated by application code,\n * which enables substantial performance optimizations. Passing\n * `{ freezeResults: true }` to the `InMemoryCache` constructor\n * can help enforce this immutability.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions) {\n const {\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools,\n queryDeduplication = true,\n defaultOptions,\n assumeImmutableResults = false,\n resolvers,\n typeDefs,\n fragmentMatcher,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n let { link } = options;\n\n // If a link hasn't been defined, but local state resolvers have been set,\n // setup a default empty link.\n if (!link && resolvers) {\n link = ApolloLink.empty();\n }\n\n if (!link || !cache) {\n throw new InvariantError(\n \"In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\\n\" +\n \"These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\\n\" +\n \"For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup\"\n );\n }\n\n // remove apollo-client supported directives\n this.link = link;\n this.cache = cache;\n this.store = new DataStore(cache);\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n // Attach the client instance to window to let us be found by chrome devtools, but only in\n // development mode\n const defaultConnectToDevTools =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n !(window as any).__APOLLO_CLIENT__;\n\n if (\n typeof connectToDevTools === 'undefined'\n ? defaultConnectToDevTools\n : connectToDevTools && typeof window !== 'undefined'\n ) {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self\n ) {\n // First check if devtools is not installed\n if (\n typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined'\n ) {\n // Only for Chrome\n if (\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.indexOf('Chrome') > -1\n ) {\n // tslint:disable-next-line\n console.debug(\n 'Download the Apollo DevTools ' +\n 'for a better development experience: ' +\n 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm',\n );\n }\n }\n }\n }\n\n this.version = version;\n\n this.localState = new LocalState({\n cache,\n client: this,\n resolvers,\n fragmentMatcher,\n });\n\n this.queryManager = new QueryManager({\n link: this.link,\n store: this.store,\n queryDeduplication,\n ssrMode,\n clientAwareness: {\n name: clientAwarenessName!,\n version: clientAwarenessVersion!,\n },\n localState: this.localState,\n assumeImmutableResults,\n onBroadcast: () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager.queryStore.getStore(),\n mutations: this.queryManager.mutationStore.getStore(),\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n },\n });\n }\n\n /**\n * Call this method to terminate any active client processes, making it safe\n * to dispose of this `ApolloClient` instance.\n */\n public stop() {\n this.queryManager.stop();\n }\n\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n *

\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n *

\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n *

\n * Note that if the cache does not change, the subscriber will *not* be notified.\n *

\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n if (this.defaultOptions.watchQuery) {\n options = {\n ...this.defaultOptions.watchQuery,\n ...options,\n } as WatchQueryOptions;\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.watchQuery(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query(\n options: QueryOptions,\n ): Promise> {\n if (this.defaultOptions.query) {\n options = { ...this.defaultOptions.query, ...options } as QueryOptions<\n TVariables\n >;\n }\n\n invariant(\n (options.fetchPolicy as WatchQueryFetchPolicy) !== 'cache-and-network',\n 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.'\n );\n\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.query(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate(\n options: MutationOptions,\n ): Promise> {\n if (this.defaultOptions.mutate) {\n options = {\n ...this.defaultOptions.mutate,\n ...options,\n } as MutationOptions;\n }\n\n return this.queryManager.mutate(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe(\n options: SubscriptionOptions,\n ): Observable> {\n return this.queryManager.startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readQuery(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readFragment(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery(\n options: DataProxy.WriteQueryOptions,\n ): void {\n const result = this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment(\n options: DataProxy.WriteFragmentOptions,\n ): void {\n const result = this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Sugar for writeQuery & writeFragment\n * This method will construct a query from the data object passed in.\n * If no id is supplied, writeData will write the data to the root.\n * If an id is supplied, writeData will write a fragment to the object\n * specified by the id in the store.\n *\n * Since you aren't passing in a query to check the shape of the data,\n * you must pass in an object that conforms to the shape of valid GraphQL data.\n */\n public writeData(\n options: DataProxy.WriteDataOptions,\n ): void {\n const result = this.cache.writeData(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable {\n return execute(this.link, payload);\n }\n\n /**\n * This initializes the query manager that tracks queries and the cache\n */\n public initQueryManager(): QueryManager {\n invariant.warn(\n 'Calling the initQueryManager method is no longer necessary, ' +\n 'and it will be removed from ApolloClient in version 3.0.',\n );\n return this.queryManager;\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise[] | null> {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => this.reFetchObservableQueries());\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())));\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise[]> {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.cache.extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache {\n return this.cache.restore(serializedState);\n }\n\n /**\n * Add additional local resolvers.\n */\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.addResolvers(resolvers);\n }\n\n /**\n * Set (override existing) local resolvers.\n */\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.setResolvers(resolvers);\n }\n\n /**\n * Get all registered local resolvers.\n */\n public getResolvers() {\n return this.localState.getResolvers();\n }\n\n /**\n * Set a custom local state fragment matcher.\n */\n public setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n }\n}\n"],"names":["LinkObservable"],"mappings":";;;;;;;IAGY,aA0CX;AA1CD,WAAY,aAAa;IAMvB,uDAAW,CAAA;IAMX,iEAAgB,CAAA;IAMhB,2DAAa,CAAA;IAMb,uDAAW,CAAA;IAOX,iDAAQ,CAAA;IAKR,mDAAS,CAAA;IAKT,mDAAS,CAAA;CACV,EA1CW,aAAa,KAAb,aAAa,QA0CxB;AAMD,SAAgB,wBAAwB,CACtC,aAA4B;IAE5B,OAAO,aAAa,GAAG,CAAC,CAAC;CAC1B;;AC7CD;IAAmC,8BAAiB;IAApD;;KAQC;IAPQ,qBAAC,YAAY,CAAC,GAArB;QACE,OAAO,IAAI,CAAC;KACb;IAEM,qBAAC,cAAqB,CAAC,GAA9B;QACE,OAAO,IAAI,CAAC;KACb;IACH,iBAAC;CARD,CAAmCA,YAAc,GAQhD;;SClBe,eAAe,CAAI,KAAoB;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;CACjD;;SCCe,aAAa,CAAC,GAAU;IACtC,OAAO,GAAG,CAAC,cA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,CAAC,CAAC;KACrD;IACH,mBAAC;CAAA,IAAA;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-client/bundle.umd.js b/node_modules/apollo-client/bundle.umd.js deleted file mode 100644 index f3c5420..0000000 --- a/node_modules/apollo-client/bundle.umd.js +++ /dev/null @@ -1,2733 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(["exports", "tslib", "apollo-utilities", "apollo-link", "symbol-observable", "ts-invariant", "graphql/language/visitor"], factory); - } else if (typeof exports !== "undefined") { - factory(exports, require("tslib"), require("apollo-utilities"), require("apollo-link"), require("symbol-observable"), require("ts-invariant"), require("graphql/language/visitor")); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.tslib, global.apolloUtilities, global.apolloLink, global.symbolObservable, global.tsInvariant, global.visitor); - global.unknown = mod.exports; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _tslib, _apolloUtilities, _apolloLink, _symbolObservable, _tsInvariant, _visitor) { - - _exports.__esModule = true; - _exports.isApolloError = isApolloError; - _exports.ObservableQuery = _exports.NetworkStatus = _exports.FetchType = _exports.ApolloError = _exports.ApolloClient = _exports.default = void 0; - _symbolObservable = _interopRequireDefault(_symbolObservable); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var NetworkStatus; - _exports.NetworkStatus = NetworkStatus; - - (function (NetworkStatus) { - NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; - NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; - NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; - NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; - NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; - NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; - NetworkStatus[NetworkStatus["error"] = 8] = "error"; - })(NetworkStatus || (_exports.NetworkStatus = NetworkStatus = {})); - - function isNetworkRequestInFlight(networkStatus) { - return networkStatus < 7; - } - - var Observable = function (_super) { - (0, _tslib.__extends)(Observable, _super); - - function Observable() { - return _super !== null && _super.apply(this, arguments) || this; - } - - Observable.prototype[_symbolObservable.default] = function () { - return this; - }; - - Observable.prototype['@@observable'] = function () { - return this; - }; - - return Observable; - }(_apolloLink.Observable); - - function isNonEmptyArray(value) { - return Array.isArray(value) && value.length > 0; - } - - function isApolloError(err) { - return err.hasOwnProperty('graphQLErrors'); - } - - var generateErrorMessage = function (err) { - var message = ''; - - if (isNonEmptyArray(err.graphQLErrors)) { - err.graphQLErrors.forEach(function (graphQLError) { - var errorMessage = graphQLError ? graphQLError.message : 'Error message not found.'; - message += "GraphQL error: " + errorMessage + "\n"; - }); - } - - if (err.networkError) { - message += 'Network error: ' + err.networkError.message + '\n'; - } - - message = message.replace(/\n$/, ''); - return message; - }; - - var ApolloError = function (_super) { - (0, _tslib.__extends)(ApolloError, _super); - - function ApolloError(_a) { - var graphQLErrors = _a.graphQLErrors, - networkError = _a.networkError, - errorMessage = _a.errorMessage, - extraInfo = _a.extraInfo; - - var _this = _super.call(this, errorMessage) || this; - - _this.graphQLErrors = graphQLErrors || []; - _this.networkError = networkError || null; - - if (!errorMessage) { - _this.message = generateErrorMessage(_this); - } else { - _this.message = errorMessage; - } - - _this.extraInfo = extraInfo; - _this.__proto__ = ApolloError.prototype; - return _this; - } - - return ApolloError; - }(Error); - - _exports.ApolloError = ApolloError; - var FetchType; - _exports.FetchType = FetchType; - - (function (FetchType) { - FetchType[FetchType["normal"] = 1] = "normal"; - FetchType[FetchType["refetch"] = 2] = "refetch"; - FetchType[FetchType["poll"] = 3] = "poll"; - })(FetchType || (_exports.FetchType = FetchType = {})); - - var hasError = function (storeValue, policy) { - if (policy === void 0) { - policy = 'none'; - } - - return storeValue && (storeValue.networkError || policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors)); - }; - - var ObservableQuery = function (_super) { - (0, _tslib.__extends)(ObservableQuery, _super); - - function ObservableQuery(_a) { - var queryManager = _a.queryManager, - options = _a.options, - _b = _a.shouldSubscribe, - shouldSubscribe = _b === void 0 ? true : _b; - - var _this = _super.call(this, function (observer) { - return _this.onSubscribe(observer); - }) || this; - - _this.observers = new Set(); - _this.subscriptions = new Set(); - _this.isTornDown = false; - _this.options = options; - _this.variables = options.variables || {}; - _this.queryId = queryManager.generateQueryId(); - _this.shouldSubscribe = shouldSubscribe; - var opDef = (0, _apolloUtilities.getOperationDefinition)(options.query); - _this.queryName = opDef && opDef.name && opDef.name.value; - _this.queryManager = queryManager; - return _this; - } - - ObservableQuery.prototype.result = function () { - var _this = this; - - return new Promise(function (resolve, reject) { - var observer = { - next: function (result) { - resolve(result); - - _this.observers.delete(observer); - - if (!_this.observers.size) { - _this.queryManager.removeQuery(_this.queryId); - } - - setTimeout(function () { - subscription.unsubscribe(); - }, 0); - }, - error: reject - }; - - var subscription = _this.subscribe(observer); - }); - }; - - ObservableQuery.prototype.currentResult = function () { - var result = this.getCurrentResult(); - - if (result.data === undefined) { - result.data = {}; - } - - return result; - }; - - ObservableQuery.prototype.getCurrentResult = function () { - if (this.isTornDown) { - var lastResult = this.lastResult; - return { - data: !this.lastError && lastResult && lastResult.data || void 0, - error: this.lastError, - loading: false, - networkStatus: NetworkStatus.error - }; - } - - var _a = this.queryManager.getCurrentQueryResult(this), - data = _a.data, - partial = _a.partial; - - var queryStoreValue = this.queryManager.queryStore.get(this.queryId); - var result; - var fetchPolicy = this.options.fetchPolicy; - var isNetworkFetchPolicy = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; - - if (queryStoreValue) { - var networkStatus = queryStoreValue.networkStatus; - - if (hasError(queryStoreValue, this.options.errorPolicy)) { - return { - data: void 0, - loading: false, - networkStatus: networkStatus, - error: new ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError - }) - }; - } - - if (queryStoreValue.variables) { - this.options.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options.variables), queryStoreValue.variables); - this.variables = this.options.variables; - } - - result = { - data: data, - loading: isNetworkRequestInFlight(networkStatus), - networkStatus: networkStatus - }; - - if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { - result.errors = queryStoreValue.graphQLErrors; - } - } else { - var loading = isNetworkFetchPolicy || partial && fetchPolicy !== 'cache-only'; - result = { - data: data, - loading: loading, - networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready - }; - } - - if (!partial) { - this.updateLastResult((0, _tslib.__assign)((0, _tslib.__assign)({}, result), { - stale: false - })); - } - - return (0, _tslib.__assign)((0, _tslib.__assign)({}, result), { - partial: partial - }); - }; - - ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { - var snapshot = this.lastResultSnapshot; - return !(snapshot && newResult && snapshot.networkStatus === newResult.networkStatus && snapshot.stale === newResult.stale && (0, _apolloUtilities.isEqual)(snapshot.data, newResult.data)); - }; - - ObservableQuery.prototype.getLastResult = function () { - return this.lastResult; - }; - - ObservableQuery.prototype.getLastError = function () { - return this.lastError; - }; - - ObservableQuery.prototype.resetLastResults = function () { - delete this.lastResult; - delete this.lastResultSnapshot; - delete this.lastError; - this.isTornDown = false; - }; - - ObservableQuery.prototype.resetQueryStoreErrors = function () { - var queryStore = this.queryManager.queryStore.get(this.queryId); - - if (queryStore) { - queryStore.networkError = null; - queryStore.graphQLErrors = []; - } - }; - - ObservableQuery.prototype.refetch = function (variables) { - var fetchPolicy = this.options.fetchPolicy; - - if (fetchPolicy === 'cache-only') { - return Promise.reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(1) : new _tsInvariant.InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); - } - - if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'cache-and-network') { - fetchPolicy = 'network-only'; - } - - if (!(0, _apolloUtilities.isEqual)(this.variables, variables)) { - this.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.variables), variables); - } - - if (!(0, _apolloUtilities.isEqual)(this.options.variables, this.variables)) { - this.options.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options.variables), this.variables); - } - - return this.queryManager.fetchQuery(this.queryId, (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), { - fetchPolicy: fetchPolicy - }), FetchType.refetch); - }; - - ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { - var _this = this; - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 2) : (0, _tsInvariant.invariant)(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); - var combinedOptions = (0, _tslib.__assign)((0, _tslib.__assign)({}, fetchMoreOptions.query ? fetchMoreOptions : (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), fetchMoreOptions), { - variables: (0, _tslib.__assign)((0, _tslib.__assign)({}, this.variables), fetchMoreOptions.variables) - })), { - fetchPolicy: 'network-only' - }); - var qid = this.queryManager.generateQueryId(); - return this.queryManager.fetchQuery(qid, combinedOptions, FetchType.normal, this.queryId).then(function (fetchMoreResult) { - _this.updateQuery(function (previousResult) { - return fetchMoreOptions.updateQuery(previousResult, { - fetchMoreResult: fetchMoreResult.data, - variables: combinedOptions.variables - }); - }); - - _this.queryManager.stopQuery(qid); - - return fetchMoreResult; - }, function (error) { - _this.queryManager.stopQuery(qid); - - throw error; - }); - }; - - ObservableQuery.prototype.subscribeToMore = function (options) { - var _this = this; - - var subscription = this.queryManager.startGraphQLSubscription({ - query: options.document, - variables: options.variables - }).subscribe({ - next: function (subscriptionData) { - var updateQuery = options.updateQuery; - - if (updateQuery) { - _this.updateQuery(function (previous, _a) { - var variables = _a.variables; - return updateQuery(previous, { - subscriptionData: subscriptionData, - variables: variables - }); - }); - } - }, - error: function (err) { - if (options.onError) { - options.onError(err); - return; - } - - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled GraphQL subscription error', err); - } - }); - this.subscriptions.add(subscription); - return function () { - if (_this.subscriptions.delete(subscription)) { - subscription.unsubscribe(); - } - }; - }; - - ObservableQuery.prototype.setOptions = function (opts) { - var oldFetchPolicy = this.options.fetchPolicy; - this.options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), opts); - - if (opts.pollInterval) { - this.startPolling(opts.pollInterval); - } else if (opts.pollInterval === 0) { - this.stopPolling(); - } - - var fetchPolicy = opts.fetchPolicy; - return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || oldFetchPolicy === 'standby' || fetchPolicy === 'network-only'), opts.fetchResults); - }; - - ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { - if (tryFetch === void 0) { - tryFetch = false; - } - - if (fetchResults === void 0) { - fetchResults = true; - } - - this.isTornDown = false; - variables = variables || this.variables; - - if (!tryFetch && (0, _apolloUtilities.isEqual)(variables, this.variables)) { - return this.observers.size && fetchResults ? this.result() : Promise.resolve(); - } - - this.variables = this.options.variables = variables; - - if (!this.observers.size) { - return Promise.resolve(); - } - - return this.queryManager.fetchQuery(this.queryId, this.options); - }; - - ObservableQuery.prototype.updateQuery = function (mapFn) { - var queryManager = this.queryManager; - - var _a = queryManager.getQueryWithPreviousResult(this.queryId), - previousResult = _a.previousResult, - variables = _a.variables, - document = _a.document; - - var newResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { - return mapFn(previousResult, { - variables: variables - }); - }); - - if (newResult) { - queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); - queryManager.broadcastQueries(); - } - }; - - ObservableQuery.prototype.stopPolling = function () { - this.queryManager.stopPollingQuery(this.queryId); - this.options.pollInterval = undefined; - }; - - ObservableQuery.prototype.startPolling = function (pollInterval) { - assertNotCacheFirstOrOnly(this); - this.options.pollInterval = pollInterval; - this.queryManager.startPollingQuery(this.options, this.queryId); - }; - - ObservableQuery.prototype.updateLastResult = function (newResult) { - var previousResult = this.lastResult; - this.lastResult = newResult; - this.lastResultSnapshot = this.queryManager.assumeImmutableResults ? newResult : (0, _apolloUtilities.cloneDeep)(newResult); - return previousResult; - }; - - ObservableQuery.prototype.onSubscribe = function (observer) { - var _this = this; - - try { - var subObserver = observer._subscription._observer; - - if (subObserver && !subObserver.error) { - subObserver.error = defaultSubscriptionObserverErrorCallback; - } - } catch (_a) {} - - var first = !this.observers.size; - this.observers.add(observer); - if (observer.next && this.lastResult) observer.next(this.lastResult); - if (observer.error && this.lastError) observer.error(this.lastError); - - if (first) { - this.setUpQuery(); - } - - return function () { - if (_this.observers.delete(observer) && !_this.observers.size) { - _this.tearDownQuery(); - } - }; - }; - - ObservableQuery.prototype.setUpQuery = function () { - var _this = this; - - var _a = this, - queryManager = _a.queryManager, - queryId = _a.queryId; - - if (this.shouldSubscribe) { - queryManager.addObservableQuery(queryId, this); - } - - if (this.options.pollInterval) { - assertNotCacheFirstOrOnly(this); - queryManager.startPollingQuery(this.options, queryId); - } - - var onError = function (error) { - _this.updateLastResult((0, _tslib.__assign)((0, _tslib.__assign)({}, _this.lastResult), { - errors: error.graphQLErrors, - networkStatus: NetworkStatus.error, - loading: false - })); - - iterateObserversSafely(_this.observers, 'error', _this.lastError = error); - }; - - queryManager.observeQuery(queryId, this.options, { - next: function (result) { - if (_this.lastError || _this.isDifferentFromLastResult(result)) { - var previousResult_1 = _this.updateLastResult(result); - - var _a = _this.options, - query_1 = _a.query, - variables = _a.variables, - fetchPolicy_1 = _a.fetchPolicy; - - if (queryManager.transform(query_1).hasClientExports) { - queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { - var previousVariables = _this.variables; - _this.variables = _this.options.variables = variables; - - if (!result.loading && previousResult_1 && fetchPolicy_1 !== 'cache-only' && queryManager.transform(query_1).serverQuery && !(0, _apolloUtilities.isEqual)(previousVariables, variables)) { - _this.refetch(); - } else { - iterateObserversSafely(_this.observers, 'next', result); - } - }); - } else { - iterateObserversSafely(_this.observers, 'next', result); - } - } - }, - error: onError - }).catch(onError); - }; - - ObservableQuery.prototype.tearDownQuery = function () { - var queryManager = this.queryManager; - this.isTornDown = true; - queryManager.stopPollingQuery(this.queryId); - this.subscriptions.forEach(function (sub) { - return sub.unsubscribe(); - }); - this.subscriptions.clear(); - queryManager.removeObservableQuery(this.queryId); - queryManager.stopQuery(this.queryId); - this.observers.clear(); - }; - - return ObservableQuery; - }(Observable); - - _exports.ObservableQuery = ObservableQuery; - - function defaultSubscriptionObserverErrorCallback(error) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error('Unhandled error', error.message, error.stack); - } - - function iterateObserversSafely(observers, method, argument) { - var observersWithMethod = []; - observers.forEach(function (obs) { - return obs[method] && observersWithMethod.push(obs); - }); - observersWithMethod.forEach(function (obs) { - return obs[method](argument); - }); - } - - function assertNotCacheFirstOrOnly(obsQuery) { - var fetchPolicy = obsQuery.options.fetchPolicy; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 3) : (0, _tsInvariant.invariant)(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); - } - - var MutationStore = function () { - function MutationStore() { - this.store = {}; - } - - MutationStore.prototype.getStore = function () { - return this.store; - }; - - MutationStore.prototype.get = function (mutationId) { - return this.store[mutationId]; - }; - - MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { - this.store[mutationId] = { - mutation: mutation, - variables: variables || {}, - loading: true, - error: null - }; - }; - - MutationStore.prototype.markMutationError = function (mutationId, error) { - var mutation = this.store[mutationId]; - - if (mutation) { - mutation.loading = false; - mutation.error = error; - } - }; - - MutationStore.prototype.markMutationResult = function (mutationId) { - var mutation = this.store[mutationId]; - - if (mutation) { - mutation.loading = false; - mutation.error = null; - } - }; - - MutationStore.prototype.reset = function () { - this.store = {}; - }; - - return MutationStore; - }(); - - var QueryStore = function () { - function QueryStore() { - this.store = {}; - } - - QueryStore.prototype.getStore = function () { - return this.store; - }; - - QueryStore.prototype.get = function (queryId) { - return this.store[queryId]; - }; - - QueryStore.prototype.initQuery = function (query) { - var previousQuery = this.store[query.queryId]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 19) : (0, _tsInvariant.invariant)(!previousQuery || previousQuery.document === query.document || (0, _apolloUtilities.isEqual)(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); - var isSetVariables = false; - var previousVariables = null; - - if (query.storePreviousVariables && previousQuery && previousQuery.networkStatus !== NetworkStatus.loading) { - if (!(0, _apolloUtilities.isEqual)(previousQuery.variables, query.variables)) { - isSetVariables = true; - previousVariables = previousQuery.variables; - } - } - - var networkStatus; - - if (isSetVariables) { - networkStatus = NetworkStatus.setVariables; - } else if (query.isPoll) { - networkStatus = NetworkStatus.poll; - } else if (query.isRefetch) { - networkStatus = NetworkStatus.refetch; - } else { - networkStatus = NetworkStatus.loading; - } - - var graphQLErrors = []; - - if (previousQuery && previousQuery.graphQLErrors) { - graphQLErrors = previousQuery.graphQLErrors; - } - - this.store[query.queryId] = { - document: query.document, - variables: query.variables, - previousVariables: previousVariables, - networkError: null, - graphQLErrors: graphQLErrors, - networkStatus: networkStatus, - metadata: query.metadata - }; - - if (typeof query.fetchMoreForQueryId === 'string' && this.store[query.fetchMoreForQueryId]) { - this.store[query.fetchMoreForQueryId].networkStatus = NetworkStatus.fetchMore; - } - }; - - QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) return; - this.store[queryId].networkError = null; - this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : []; - this.store[queryId].previousVariables = null; - this.store[queryId].networkStatus = NetworkStatus.ready; - - if (typeof fetchMoreForQueryId === 'string' && this.store[fetchMoreForQueryId]) { - this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready; - } - }; - - QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) return; - this.store[queryId].networkError = error; - this.store[queryId].networkStatus = NetworkStatus.error; - - if (typeof fetchMoreForQueryId === 'string') { - this.markQueryResultClient(fetchMoreForQueryId, true); - } - }; - - QueryStore.prototype.markQueryResultClient = function (queryId, complete) { - var storeValue = this.store && this.store[queryId]; - - if (storeValue) { - storeValue.networkError = null; - storeValue.previousVariables = null; - - if (complete) { - storeValue.networkStatus = NetworkStatus.ready; - } - } - }; - - QueryStore.prototype.stopQuery = function (queryId) { - delete this.store[queryId]; - }; - - QueryStore.prototype.reset = function (observableQueryIds) { - var _this = this; - - Object.keys(this.store).forEach(function (queryId) { - if (observableQueryIds.indexOf(queryId) < 0) { - _this.stopQuery(queryId); - } else { - _this.store[queryId].networkStatus = NetworkStatus.loading; - } - }); - }; - - return QueryStore; - }(); - - function capitalizeFirstLetter(str) { - return str.charAt(0).toUpperCase() + str.slice(1); - } - - var LocalState = function () { - function LocalState(_a) { - var cache = _a.cache, - client = _a.client, - resolvers = _a.resolvers, - fragmentMatcher = _a.fragmentMatcher; - this.cache = cache; - - if (client) { - this.client = client; - } - - if (resolvers) { - this.addResolvers(resolvers); - } - - if (fragmentMatcher) { - this.setFragmentMatcher(fragmentMatcher); - } - } - - LocalState.prototype.addResolvers = function (resolvers) { - var _this = this; - - this.resolvers = this.resolvers || {}; - - if (Array.isArray(resolvers)) { - resolvers.forEach(function (resolverGroup) { - _this.resolvers = (0, _apolloUtilities.mergeDeep)(_this.resolvers, resolverGroup); - }); - } else { - this.resolvers = (0, _apolloUtilities.mergeDeep)(this.resolvers, resolvers); - } - }; - - LocalState.prototype.setResolvers = function (resolvers) { - this.resolvers = {}; - this.addResolvers(resolvers); - }; - - LocalState.prototype.getResolvers = function () { - return this.resolvers || {}; - }; - - LocalState.prototype.runResolvers = function (_a) { - var document = _a.document, - remoteResult = _a.remoteResult, - context = _a.context, - variables = _a.variables, - _b = _a.onlyRunForcedResolvers, - onlyRunForcedResolvers = _b === void 0 ? false : _b; - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - return (0, _tslib.__generator)(this, function (_c) { - if (document) { - return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, remoteResult), { - data: localResult.result - }); - })]; - } - - return [2, remoteResult]; - }); - }); - }; - - LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { - this.fragmentMatcher = fragmentMatcher; - }; - - LocalState.prototype.getFragmentMatcher = function () { - return this.fragmentMatcher; - }; - - LocalState.prototype.clientQuery = function (document) { - if ((0, _apolloUtilities.hasDirectives)(['client'], document)) { - if (this.resolvers) { - return document; - } - - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + 'were specified. This means ApolloClient local resolver handling ' + 'has been disabled, and @client directives will be passed through ' + 'to your link chain.'); - } - - return null; - }; - - LocalState.prototype.serverQuery = function (document) { - return this.resolvers ? (0, _apolloUtilities.removeClientSetsFromDocument)(document) : document; - }; - - LocalState.prototype.prepareContext = function (context) { - if (context === void 0) { - context = {}; - } - - var cache = this.cache; - var newContext = (0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - cache: cache, - getCacheKey: function (obj) { - if (cache.config) { - return cache.config.dataIdFromObject(obj); - } else { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(false, 6) : (0, _tsInvariant.invariant)(false, 'To use context.getCacheKey, you need to use a cache that has ' + 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); - } - } - }); - return newContext; - }; - - LocalState.prototype.addExportedVariables = function (document, variables, context) { - if (variables === void 0) { - variables = {}; - } - - if (context === void 0) { - context = {}; - } - - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - return (0, _tslib.__generator)(this, function (_a) { - if (document) { - return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, variables), data.exportedVariables); - })]; - } - - return [2, (0, _tslib.__assign)({}, variables)]; - }); - }); - }; - - LocalState.prototype.shouldForceResolvers = function (document) { - var forceResolvers = false; - (0, _visitor.visit)(document, { - Directive: { - enter: function (node) { - if (node.name.value === 'client' && node.arguments) { - forceResolvers = node.arguments.some(function (arg) { - return arg.name.value === 'always' && arg.value.kind === 'BooleanValue' && arg.value.value === true; - }); - - if (forceResolvers) { - return _visitor.BREAK; - } - } - } - } - }); - return forceResolvers; - }; - - LocalState.prototype.buildRootValueFromCache = function (document, variables) { - return this.cache.diff({ - query: (0, _apolloUtilities.buildQueryFromSelectionSet)(document), - variables: variables, - returnPartialData: true, - optimistic: false - }).result; - }; - - LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { - if (context === void 0) { - context = {}; - } - - if (variables === void 0) { - variables = {}; - } - - if (fragmentMatcher === void 0) { - fragmentMatcher = function () { - return true; - }; - } - - if (onlyRunForcedResolvers === void 0) { - onlyRunForcedResolvers = false; - } - - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; - - return (0, _tslib.__generator)(this, function (_b) { - mainDefinition = (0, _apolloUtilities.getMainDefinition)(document); - fragments = (0, _apolloUtilities.getFragmentDefinitions)(document); - fragmentMap = (0, _apolloUtilities.createFragmentMap)(fragments); - definitionOperation = mainDefinition.operation; - defaultOperationType = definitionOperation ? capitalizeFirstLetter(definitionOperation) : 'Query'; - _a = this, cache = _a.cache, client = _a.client; - execContext = { - fragmentMap: fragmentMap, - context: (0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - cache: cache, - client: client - }), - variables: variables, - fragmentMatcher: fragmentMatcher, - defaultOperationType: defaultOperationType, - exportedVariables: {}, - onlyRunForcedResolvers: onlyRunForcedResolvers - }; - return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { - return { - result: result, - exportedVariables: execContext.exportedVariables - }; - })]; - }); - }); - }; - - LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var fragmentMap, context, variables, resultsToMerge, execute; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_a) { - fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; - resultsToMerge = [rootValue]; - - execute = function (selection) { - return (0, _tslib.__awaiter)(_this, void 0, void 0, function () { - var fragment, typeCondition; - return (0, _tslib.__generator)(this, function (_a) { - if (!(0, _apolloUtilities.shouldInclude)(selection, variables)) { - return [2]; - } - - if ((0, _apolloUtilities.isField)(selection)) { - return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { - var _a; - - if (typeof fieldResult !== 'undefined') { - resultsToMerge.push((_a = {}, _a[(0, _apolloUtilities.resultKeyNameFromField)(selection)] = fieldResult, _a)); - } - })]; - } - - if ((0, _apolloUtilities.isInlineFragment)(selection)) { - fragment = selection; - } else { - fragment = fragmentMap[selection.name.value]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragment, 7) : (0, _tsInvariant.invariant)(fragment, "No fragment named " + selection.name.value); - } - - if (fragment && fragment.typeCondition) { - typeCondition = fragment.typeCondition.name.value; - - if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { - return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { - resultsToMerge.push(fragmentResult); - })]; - } - } - - return [2]; - }); - }); - }; - - return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { - return (0, _apolloUtilities.mergeDeepArray)(resultsToMerge); - })]; - }); - }); - }; - - LocalState.prototype.resolveField = function (field, rootValue, execContext) { - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_a) { - variables = execContext.variables; - fieldName = field.name.value; - aliasedFieldName = (0, _apolloUtilities.resultKeyNameFromField)(field); - aliasUsed = fieldName !== aliasedFieldName; - defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; - resultPromise = Promise.resolve(defaultResult); - - if (!execContext.onlyRunForcedResolvers || this.shouldForceResolvers(field)) { - resolverType = rootValue.__typename || execContext.defaultOperationType; - resolverMap = this.resolvers && this.resolvers[resolverType]; - - if (resolverMap) { - resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; - - if (resolve) { - resultPromise = Promise.resolve(resolve(rootValue, (0, _apolloUtilities.argumentsObjectFromField)(field, variables), execContext.context, { - field: field, - fragmentMap: execContext.fragmentMap - })); - } - } - } - - return [2, resultPromise.then(function (result) { - if (result === void 0) { - result = defaultResult; - } - - if (field.directives) { - field.directives.forEach(function (directive) { - if (directive.name.value === 'export' && directive.arguments) { - directive.arguments.forEach(function (arg) { - if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { - execContext.exportedVariables[arg.value.value] = result; - } - }); - } - }); - } - - if (!field.selectionSet) { - return result; - } - - if (result == null) { - return result; - } - - if (Array.isArray(result)) { - return _this.resolveSubSelectedArray(field, result, execContext); - } - - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, result, execContext); - } - })]; - }); - }); - }; - - LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { - var _this = this; - - return Promise.all(result.map(function (item) { - if (item === null) { - return null; - } - - if (Array.isArray(item)) { - return _this.resolveSubSelectedArray(field, item, execContext); - } - - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, item, execContext); - } - })); - }; - - return LocalState; - }(); - - function multiplex(inner) { - var observers = new Set(); - var sub = null; - return new Observable(function (observer) { - observers.add(observer); - sub = sub || inner.subscribe({ - next: function (value) { - observers.forEach(function (obs) { - return obs.next && obs.next(value); - }); - }, - error: function (error) { - observers.forEach(function (obs) { - return obs.error && obs.error(error); - }); - }, - complete: function () { - observers.forEach(function (obs) { - return obs.complete && obs.complete(); - }); - } - }); - return function () { - if (observers.delete(observer) && !observers.size && sub) { - sub.unsubscribe(); - sub = null; - } - }; - }); - } - - function asyncMap(observable, mapFn) { - return new Observable(function (observer) { - var next = observer.next, - error = observer.error, - complete = observer.complete; - var activeNextCount = 0; - var completed = false; - var handler = { - next: function (value) { - ++activeNextCount; - new Promise(function (resolve) { - resolve(mapFn(value)); - }).then(function (result) { - --activeNextCount; - next && next.call(observer, result); - completed && handler.complete(); - }, function (e) { - --activeNextCount; - error && error.call(observer, e); - }); - }, - error: function (e) { - error && error.call(observer, e); - }, - complete: function () { - completed = true; - - if (!activeNextCount) { - complete && complete.call(observer); - } - } - }; - var sub = observable.subscribe(handler); - return function () { - return sub.unsubscribe(); - }; - }); - } - - var hasOwnProperty = Object.prototype.hasOwnProperty; - - var QueryManager = function () { - function QueryManager(_a) { - var link = _a.link, - _b = _a.queryDeduplication, - queryDeduplication = _b === void 0 ? false : _b, - store = _a.store, - _c = _a.onBroadcast, - onBroadcast = _c === void 0 ? function () { - return undefined; - } : _c, - _d = _a.ssrMode, - ssrMode = _d === void 0 ? false : _d, - _e = _a.clientAwareness, - clientAwareness = _e === void 0 ? {} : _e, - localState = _a.localState, - assumeImmutableResults = _a.assumeImmutableResults; - this.mutationStore = new MutationStore(); - this.queryStore = new QueryStore(); - this.clientAwareness = {}; - this.idCounter = 1; - this.queries = new Map(); - this.fetchQueryRejectFns = new Map(); - this.transformCache = new (_apolloUtilities.canUseWeakMap ? WeakMap : Map)(); - this.inFlightLinkObservables = new Map(); - this.pollingInfoByQueryId = new Map(); - this.link = link; - this.queryDeduplication = queryDeduplication; - this.dataStore = store; - this.onBroadcast = onBroadcast; - this.clientAwareness = clientAwareness; - this.localState = localState || new LocalState({ - cache: store.getCache() - }); - this.ssrMode = ssrMode; - this.assumeImmutableResults = !!assumeImmutableResults; - } - - QueryManager.prototype.stop = function () { - var _this = this; - - this.queries.forEach(function (_info, queryId) { - _this.stopQueryNoBroadcast(queryId); - }); - this.fetchQueryRejectFns.forEach(function (reject) { - reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(8) : new _tsInvariant.InvariantError('QueryManager stopped while query was in flight')); - }); - }; - - QueryManager.prototype.mutate = function (_a) { - var mutation = _a.mutation, - variables = _a.variables, - optimisticResponse = _a.optimisticResponse, - updateQueriesByName = _a.updateQueries, - _b = _a.refetchQueries, - refetchQueries = _b === void 0 ? [] : _b, - _c = _a.awaitRefetchQueries, - awaitRefetchQueries = _c === void 0 ? false : _c, - updateWithProxyFn = _a.update, - _d = _a.errorPolicy, - errorPolicy = _d === void 0 ? 'none' : _d, - fetchPolicy = _a.fetchPolicy, - _e = _a.context, - context = _e === void 0 ? {} : _e; - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var mutationId, generateUpdateQueriesInfo, self; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_f) { - switch (_f.label) { - case 0: - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutation, 9) : (0, _tsInvariant.invariant)(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', 10) : (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - mutationId = this.generateQueryId(); - mutation = this.transform(mutation).document; - this.setQuery(mutationId, function () { - return { - document: mutation - }; - }); - variables = this.getVariables(mutation, variables); - if (!this.transform(mutation).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(mutation, variables, context)]; - - case 1: - variables = _f.sent(); - _f.label = 2; - - case 2: - generateUpdateQueriesInfo = function () { - var ret = {}; - - if (updateQueriesByName) { - _this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - - if (observableQuery) { - var queryName = observableQuery.queryName; - - if (queryName && hasOwnProperty.call(updateQueriesByName, queryName)) { - ret[queryId] = { - updater: updateQueriesByName[queryName], - query: _this.queryStore.get(queryId) - }; - } - } - }); - } - - return ret; - }; - - this.mutationStore.initMutation(mutationId, mutation, variables); - this.dataStore.markMutationInit({ - mutationId: mutationId, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn, - optimisticResponse: optimisticResponse - }); - this.broadcastQueries(); - self = this; - return [2, new Promise(function (resolve, reject) { - var storeResult; - var error; - self.getObservableFromLink(mutation, (0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - optimisticResponse: optimisticResponse - }), variables, false).subscribe({ - next: function (result) { - if ((0, _apolloUtilities.graphQLResultHasError)(result) && errorPolicy === 'none') { - error = new ApolloError({ - graphQLErrors: result.errors - }); - return; - } - - self.mutationStore.markMutationResult(mutationId); - - if (fetchPolicy !== 'no-cache') { - self.dataStore.markMutationResult({ - mutationId: mutationId, - result: result, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn - }); - } - - storeResult = result; - }, - error: function (err) { - self.mutationStore.markMutationError(mutationId, err); - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse - }); - self.broadcastQueries(); - self.setQuery(mutationId, function () { - return { - document: null - }; - }); - reject(new ApolloError({ - networkError: err - })); - }, - complete: function () { - if (error) { - self.mutationStore.markMutationError(mutationId, error); - } - - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse - }); - self.broadcastQueries(); - - if (error) { - reject(error); - return; - } - - if (typeof refetchQueries === 'function') { - refetchQueries = refetchQueries(storeResult); - } - - var refetchQueryPromises = []; - - if (isNonEmptyArray(refetchQueries)) { - refetchQueries.forEach(function (refetchQuery) { - if (typeof refetchQuery === 'string') { - self.queries.forEach(function (_a) { - var observableQuery = _a.observableQuery; - - if (observableQuery && observableQuery.queryName === refetchQuery) { - refetchQueryPromises.push(observableQuery.refetch()); - } - }); - } else { - var queryOptions = { - query: refetchQuery.query, - variables: refetchQuery.variables, - fetchPolicy: 'network-only' - }; - - if (refetchQuery.context) { - queryOptions.context = refetchQuery.context; - } - - refetchQueryPromises.push(self.query(queryOptions)); - } - }); - } - - Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { - self.setQuery(mutationId, function () { - return { - document: null - }; - }); - - if (errorPolicy === 'ignore' && storeResult && (0, _apolloUtilities.graphQLResultHasError)(storeResult)) { - delete storeResult.errors; - } - - resolve(storeResult); - }); - } - }); - })]; - } - }); - }); - }; - - QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { - return (0, _tslib.__awaiter)(this, void 0, void 0, function () { - var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; - - var _this = this; - - return (0, _tslib.__generator)(this, function (_e) { - switch (_e.label) { - case 0: - _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; - query = this.transform(options.query).document; - variables = this.getVariables(query, options.variables); - if (!this.transform(query).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(query, variables, context)]; - - case 1: - variables = _e.sent(); - _e.label = 2; - - case 2: - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - variables: variables - }); - isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; - needToFetch = isNetworkOnly; - - if (!isNetworkOnly) { - _d = this.dataStore.getCache().diff({ - query: query, - variables: variables, - returnPartialData: true, - optimistic: false - }), complete = _d.complete, result = _d.result; - needToFetch = !complete || fetchPolicy === 'cache-and-network'; - storeResult = result; - } - - shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; - if ((0, _apolloUtilities.hasDirectives)(['live'], query)) shouldFetch = true; - requestId = this.idCounter++; - cancel = fetchPolicy !== 'no-cache' ? this.updateQueryWatch(queryId, query, options) : undefined; - this.setQuery(queryId, function () { - return { - document: query, - lastRequestId: requestId, - invalidated: true, - cancel: cancel - }; - }); - this.invalidate(fetchMoreForQueryId); - this.queryStore.initQuery({ - queryId: queryId, - document: query, - storePreviousVariables: shouldFetch, - variables: variables, - isPoll: fetchType === FetchType.poll, - isRefetch: fetchType === FetchType.refetch, - metadata: metadata, - fetchMoreForQueryId: fetchMoreForQueryId - }); - this.broadcastQueries(); - - if (shouldFetch) { - networkResult = this.fetchRequest({ - requestId: requestId, - queryId: queryId, - document: query, - options: options, - fetchMoreForQueryId: fetchMoreForQueryId - }).catch(function (error) { - if (isApolloError(error)) { - throw error; - } else { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); - - _this.invalidate(queryId); - - _this.invalidate(fetchMoreForQueryId); - - _this.broadcastQueries(); - } - - throw new ApolloError({ - networkError: error - }); - } - }); - - if (fetchPolicy !== 'cache-and-network') { - return [2, networkResult]; - } - - networkResult.catch(function () {}); - } - - this.queryStore.markQueryResultClient(queryId, !shouldFetch); - this.invalidate(queryId); - this.invalidate(fetchMoreForQueryId); - - if (this.transform(query).hasForcedResolvers) { - return [2, this.localState.runResolvers({ - document: query, - remoteResult: { - data: storeResult - }, - context: context, - variables: variables, - onlyRunForcedResolvers: true - }).then(function (result) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - - _this.broadcastQueries(); - - return result; - })]; - } - - this.broadcastQueries(); - return [2, { - data: storeResult - }]; - } - }); - }); - }; - - QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { - var fetchPolicy = _a.fetchPolicy, - variables = _a.variables, - errorPolicy = _a.errorPolicy; - - if (fetchPolicy === 'no-cache') { - this.setQuery(queryId, function () { - return { - newData: { - result: result.data, - complete: true - } - }; - }); - } else { - this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); - } - }; - - QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { - var _this = this; - - function invoke(method, argument) { - if (observer[method]) { - try { - observer[method](argument); - } catch (e) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(e); - } - } else if (method === 'error') { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.error(argument); - } - } - - return function (queryStoreValue, newData) { - _this.invalidate(queryId, false); - - if (!queryStoreValue) return; - - var _a = _this.getQuery(queryId), - observableQuery = _a.observableQuery, - document = _a.document; - - var fetchPolicy = observableQuery ? observableQuery.options.fetchPolicy : options.fetchPolicy; - if (fetchPolicy === 'standby') return; - var loading = isNetworkRequestInFlight(queryStoreValue.networkStatus); - var lastResult = observableQuery && observableQuery.getLastResult(); - var networkStatusChanged = !!(lastResult && lastResult.networkStatus !== queryStoreValue.networkStatus); - var shouldNotifyIfLoading = options.returnPartialData || !newData && queryStoreValue.previousVariables || networkStatusChanged && options.notifyOnNetworkStatusChange || fetchPolicy === 'cache-only' || fetchPolicy === 'cache-and-network'; - - if (loading && !shouldNotifyIfLoading) { - return; - } - - var hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors); - var errorPolicy = observableQuery && observableQuery.options.errorPolicy || options.errorPolicy || 'none'; - - if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { - return invoke('error', new ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError - })); - } - - try { - var data = void 0; - var isMissing = void 0; - - if (newData) { - if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { - _this.setQuery(queryId, function () { - return { - newData: null - }; - }); - } - - data = newData.result; - isMissing = !newData.complete; - } else { - var lastError = observableQuery && observableQuery.getLastError(); - var errorStatusChanged = errorPolicy !== 'none' && (lastError && lastError.graphQLErrors) !== queryStoreValue.graphQLErrors; - - if (lastResult && lastResult.data && !errorStatusChanged) { - data = lastResult.data; - isMissing = false; - } else { - var diffResult = _this.dataStore.getCache().diff({ - query: document, - variables: queryStoreValue.previousVariables || queryStoreValue.variables, - returnPartialData: true, - optimistic: true - }); - - data = diffResult.result; - isMissing = !diffResult.complete; - } - } - - var stale = isMissing && !(options.returnPartialData || fetchPolicy === 'cache-only'); - var resultFromStore = { - data: stale ? lastResult && lastResult.data : data, - loading: loading, - networkStatus: queryStoreValue.networkStatus, - stale: stale - }; - - if (errorPolicy === 'all' && hasGraphQLErrors) { - resultFromStore.errors = queryStoreValue.graphQLErrors; - } - - invoke('next', resultFromStore); - } catch (networkError) { - invoke('error', new ApolloError({ - networkError: networkError - })); - } - }; - }; - - QueryManager.prototype.transform = function (document) { - var transformCache = this.transformCache; - - if (!transformCache.has(document)) { - var cache = this.dataStore.getCache(); - var transformed = cache.transformDocument(document); - var forLink = (0, _apolloUtilities.removeConnectionDirectiveFromDocument)(cache.transformForLink(transformed)); - var clientQuery = this.localState.clientQuery(transformed); - var serverQuery = this.localState.serverQuery(forLink); - var cacheEntry_1 = { - document: transformed, - hasClientExports: (0, _apolloUtilities.hasClientExports)(transformed), - hasForcedResolvers: this.localState.shouldForceResolvers(transformed), - clientQuery: clientQuery, - serverQuery: serverQuery, - defaultVars: (0, _apolloUtilities.getDefaultValues)((0, _apolloUtilities.getOperationDefinition)(transformed)) - }; - - var add = function (doc) { - if (doc && !transformCache.has(doc)) { - transformCache.set(doc, cacheEntry_1); - } - }; - - add(document); - add(transformed); - add(clientQuery); - add(serverQuery); - } - - return transformCache.get(document); - }; - - QueryManager.prototype.getVariables = function (document, variables) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, this.transform(document).defaultVars), variables); - }; - - QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { - if (shouldSubscribe === void 0) { - shouldSubscribe = true; - } - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 11) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); - options.variables = this.getVariables(options.query, options.variables); - - if (typeof options.notifyOnNetworkStatusChange === 'undefined') { - options.notifyOnNetworkStatusChange = false; - } - - var transformedOptions = (0, _tslib.__assign)({}, options); - return new ObservableQuery({ - queryManager: this, - options: transformedOptions, - shouldSubscribe: shouldSubscribe - }); - }; - - QueryManager.prototype.query = function (options) { - var _this = this; - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query, 12) : (0, _tsInvariant.invariant)(options.query, 'query option is required. You must specify your GraphQL document ' + 'in the query option.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.query.kind === 'Document', 13) : (0, _tsInvariant.invariant)(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.returnPartialData, 14) : (0, _tsInvariant.invariant)(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.pollInterval, 15) : (0, _tsInvariant.invariant)(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); - return new Promise(function (resolve, reject) { - var watchedQuery = _this.watchQuery(options, false); - - _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); - - watchedQuery.result().then(resolve, reject).then(function () { - return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); - }); - }); - }; - - QueryManager.prototype.generateQueryId = function () { - return String(this.idCounter++); - }; - - QueryManager.prototype.stopQueryInStore = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.broadcastQueries(); - }; - - QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { - this.stopPollingQuery(queryId); - this.queryStore.stopQuery(queryId); - this.invalidate(queryId); - }; - - QueryManager.prototype.addQueryListener = function (queryId, listener) { - this.setQuery(queryId, function (_a) { - var listeners = _a.listeners; - listeners.add(listener); - return { - invalidated: false - }; - }); - }; - - QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { - var _this = this; - - var cancel = this.getQuery(queryId).cancel; - if (cancel) cancel(); - - var previousResult = function () { - var previousResult = null; - - var observableQuery = _this.getQuery(queryId).observableQuery; - - if (observableQuery) { - var lastResult = observableQuery.getLastResult(); - - if (lastResult) { - previousResult = lastResult.data; - } - } - - return previousResult; - }; - - return this.dataStore.getCache().watch({ - query: document, - variables: options.variables, - optimistic: true, - previousResult: previousResult, - callback: function (newData) { - _this.setQuery(queryId, function () { - return { - invalidated: true, - newData: newData - }; - }); - } - }); - }; - - QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { - this.setQuery(queryId, function () { - return { - observableQuery: observableQuery - }; - }); - }; - - QueryManager.prototype.removeObservableQuery = function (queryId) { - var cancel = this.getQuery(queryId).cancel; - this.setQuery(queryId, function () { - return { - observableQuery: null - }; - }); - if (cancel) cancel(); - }; - - QueryManager.prototype.clearStore = function () { - this.fetchQueryRejectFns.forEach(function (reject) { - reject(process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(16) : new _tsInvariant.InvariantError('Store reset while query was in flight (not completed in link chain)')); - }); - var resetIds = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) resetIds.push(queryId); - }); - this.queryStore.reset(resetIds); - this.mutationStore.reset(); - return this.dataStore.reset(); - }; - - QueryManager.prototype.resetStore = function () { - var _this = this; - - return this.clearStore().then(function () { - return _this.reFetchObservableQueries(); - }); - }; - - QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { - var _this = this; - - if (includeStandby === void 0) { - includeStandby = false; - } - - var observableQueryPromises = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - - if (observableQuery) { - var fetchPolicy = observableQuery.options.fetchPolicy; - observableQuery.resetLastResults(); - - if (fetchPolicy !== 'cache-only' && (includeStandby || fetchPolicy !== 'standby')) { - observableQueryPromises.push(observableQuery.refetch()); - } - - _this.setQuery(queryId, function () { - return { - newData: null - }; - }); - - _this.invalidate(queryId); - } - }); - this.broadcastQueries(); - return Promise.all(observableQueryPromises); - }; - - QueryManager.prototype.observeQuery = function (queryId, options, observer) { - this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); - return this.fetchQuery(queryId, options); - }; - - QueryManager.prototype.startQuery = function (queryId, options, listener) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn("The QueryManager.startQuery method has been deprecated"); - this.addQueryListener(queryId, listener); - this.fetchQuery(queryId, options).catch(function () { - return undefined; - }); - return queryId; - }; - - QueryManager.prototype.startGraphQLSubscription = function (_a) { - var _this = this; - - var query = _a.query, - fetchPolicy = _a.fetchPolicy, - variables = _a.variables; - query = this.transform(query).document; - variables = this.getVariables(query, variables); - - var makeObservable = function (variables) { - return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { - if (!fetchPolicy || fetchPolicy !== 'no-cache') { - _this.dataStore.markSubscriptionResult(result, query, variables); - - _this.broadcastQueries(); - } - - if ((0, _apolloUtilities.graphQLResultHasError)(result)) { - throw new ApolloError({ - graphQLErrors: result.errors - }); - } - - return result; - }); - }; - - if (this.transform(query).hasClientExports) { - var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); - return new Observable(function (observer) { - var sub = null; - observablePromise_1.then(function (observable) { - return sub = observable.subscribe(observer); - }, observer.error); - return function () { - return sub && sub.unsubscribe(); - }; - }); - } - - return makeObservable(variables); - }; - - QueryManager.prototype.stopQuery = function (queryId) { - this.stopQueryNoBroadcast(queryId); - this.broadcastQueries(); - }; - - QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.removeQuery(queryId); - }; - - QueryManager.prototype.removeQuery = function (queryId) { - this.fetchQueryRejectFns.delete("query:" + queryId); - this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); - this.getQuery(queryId).subscriptions.forEach(function (x) { - return x.unsubscribe(); - }); - this.queries.delete(queryId); - }; - - QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { - if (optimistic === void 0) { - optimistic = true; - } - - var _a = observableQuery.options, - variables = _a.variables, - query = _a.query, - fetchPolicy = _a.fetchPolicy, - returnPartialData = _a.returnPartialData; - var lastResult = observableQuery.getLastResult(); - var newData = this.getQuery(observableQuery.queryId).newData; - - if (newData && newData.complete) { - return { - data: newData.result, - partial: false - }; - } - - if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { - return { - data: undefined, - partial: false - }; - } - - var _b = this.dataStore.getCache().diff({ - query: query, - variables: variables, - previousResult: lastResult ? lastResult.data : undefined, - returnPartialData: true, - optimistic: optimistic - }), - result = _b.result, - complete = _b.complete; - - return { - data: complete || returnPartialData ? result : void 0, - partial: !complete - }; - }; - - QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { - var observableQuery; - - if (typeof queryIdOrObservable === 'string') { - var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(foundObserveableQuery, 17) : (0, _tsInvariant.invariant)(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); - observableQuery = foundObserveableQuery; - } else { - observableQuery = queryIdOrObservable; - } - - var _a = observableQuery.options, - variables = _a.variables, - query = _a.query; - return { - previousResult: this.getCurrentQueryResult(observableQuery, false).data, - variables: variables, - document: query - }; - }; - - QueryManager.prototype.broadcastQueries = function () { - var _this = this; - - this.onBroadcast(); - this.queries.forEach(function (info, id) { - if (info.invalidated) { - info.listeners.forEach(function (listener) { - if (listener) { - listener(_this.queryStore.get(id), info.newData); - } - }); - } - }); - }; - - QueryManager.prototype.getLocalState = function () { - return this.localState; - }; - - QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { - var _this = this; - - if (deduplication === void 0) { - deduplication = this.queryDeduplication; - } - - var observable; - var serverQuery = this.transform(query).serverQuery; - - if (serverQuery) { - var _a = this, - inFlightLinkObservables_1 = _a.inFlightLinkObservables, - link = _a.link; - - var operation = { - query: serverQuery, - variables: variables, - operationName: (0, _apolloUtilities.getOperationName)(serverQuery) || void 0, - context: this.prepareContext((0, _tslib.__assign)((0, _tslib.__assign)({}, context), { - forceFetch: !deduplication - })) - }; - context = operation.context; - - if (deduplication) { - var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); - inFlightLinkObservables_1.set(serverQuery, byVariables_1); - var varJson_1 = JSON.stringify(variables); - observable = byVariables_1.get(varJson_1); - - if (!observable) { - byVariables_1.set(varJson_1, observable = multiplex((0, _apolloLink.execute)(link, operation))); - - var cleanup = function () { - byVariables_1.delete(varJson_1); - if (!byVariables_1.size) inFlightLinkObservables_1.delete(serverQuery); - cleanupSub_1.unsubscribe(); - }; - - var cleanupSub_1 = observable.subscribe({ - next: cleanup, - error: cleanup, - complete: cleanup - }); - } - } else { - observable = multiplex((0, _apolloLink.execute)(link, operation)); - } - } else { - observable = Observable.of({ - data: {} - }); - context = this.prepareContext(context); - } - - var clientQuery = this.transform(query).clientQuery; - - if (clientQuery) { - observable = asyncMap(observable, function (result) { - return _this.localState.runResolvers({ - document: clientQuery, - remoteResult: result, - context: context, - variables: variables - }); - }); - } - - return observable; - }; - - QueryManager.prototype.fetchRequest = function (_a) { - var _this = this; - - var requestId = _a.requestId, - queryId = _a.queryId, - document = _a.document, - options = _a.options, - fetchMoreForQueryId = _a.fetchMoreForQueryId; - var variables = options.variables, - _b = options.errorPolicy, - errorPolicy = _b === void 0 ? 'none' : _b, - fetchPolicy = options.fetchPolicy; - var resultFromStore; - var errorsFromStore; - return new Promise(function (resolve, reject) { - var observable = _this.getObservableFromLink(document, options.context, variables); - - var fqrfId = "fetchRequest:" + queryId; - - _this.fetchQueryRejectFns.set(fqrfId, reject); - - var cleanup = function () { - _this.fetchQueryRejectFns.delete(fqrfId); - - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.delete(subscription); - }); - }; - - var subscription = observable.map(function (result) { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - - _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); - - _this.invalidate(queryId); - - _this.invalidate(fetchMoreForQueryId); - - _this.broadcastQueries(); - } - - if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) { - return reject(new ApolloError({ - graphQLErrors: result.errors - })); - } - - if (errorPolicy === 'all') { - errorsFromStore = result.errors; - } - - if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { - resultFromStore = result.data; - } else { - var _a = _this.dataStore.getCache().diff({ - variables: variables, - query: document, - optimistic: false, - returnPartialData: true - }), - result_1 = _a.result, - complete = _a.complete; - - if (complete || options.returnPartialData) { - resultFromStore = result_1; - } - } - }).subscribe({ - error: function (error) { - cleanup(); - reject(error); - }, - complete: function () { - cleanup(); - resolve({ - data: resultFromStore, - errors: errorsFromStore, - loading: false, - networkStatus: NetworkStatus.ready, - stale: false - }); - } - }); - - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.add(subscription); - }); - }); - }; - - QueryManager.prototype.getQuery = function (queryId) { - return this.queries.get(queryId) || { - listeners: new Set(), - invalidated: false, - document: null, - newData: null, - lastRequestId: 1, - observableQuery: null, - subscriptions: new Set() - }; - }; - - QueryManager.prototype.setQuery = function (queryId, updater) { - var prev = this.getQuery(queryId); - var newInfo = (0, _tslib.__assign)((0, _tslib.__assign)({}, prev), updater(prev)); - this.queries.set(queryId, newInfo); - }; - - QueryManager.prototype.invalidate = function (queryId, invalidated) { - if (invalidated === void 0) { - invalidated = true; - } - - if (queryId) { - this.setQuery(queryId, function () { - return { - invalidated: invalidated - }; - }); - } - }; - - QueryManager.prototype.prepareContext = function (context) { - if (context === void 0) { - context = {}; - } - - var newContext = this.localState.prepareContext(context); - return (0, _tslib.__assign)((0, _tslib.__assign)({}, newContext), { - clientAwareness: this.clientAwareness - }); - }; - - QueryManager.prototype.checkInFlight = function (queryId) { - var query = this.queryStore.get(queryId); - return query && query.networkStatus !== NetworkStatus.ready && query.networkStatus !== NetworkStatus.error; - }; - - QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { - var _this = this; - - var pollInterval = options.pollInterval; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(pollInterval, 18) : (0, _tsInvariant.invariant)(pollInterval, 'Attempted to start a polling query without a polling interval.'); - - if (!this.ssrMode) { - var info = this.pollingInfoByQueryId.get(queryId); - - if (!info) { - this.pollingInfoByQueryId.set(queryId, info = {}); - } - - info.interval = pollInterval; - info.options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - fetchPolicy: 'network-only' - }); - - var maybeFetch_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - - if (info) { - if (_this.checkInFlight(queryId)) { - poll_1(); - } else { - _this.fetchQuery(queryId, info.options, FetchType.poll).then(poll_1, poll_1); - } - } - }; - - var poll_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - - if (info) { - clearTimeout(info.timeout); - info.timeout = setTimeout(maybeFetch_1, info.interval); - } - }; - - if (listener) { - this.addQueryListener(queryId, listener); - } - - poll_1(); - } - - return queryId; - }; - - QueryManager.prototype.stopPollingQuery = function (queryId) { - this.pollingInfoByQueryId.delete(queryId); - }; - - return QueryManager; - }(); - - var DataStore = function () { - function DataStore(initialCache) { - this.cache = initialCache; - } - - DataStore.prototype.getCache = function () { - return this.cache; - }; - - DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { - if (ignoreErrors === void 0) { - ignoreErrors = false; - } - - var writeWithErrors = !(0, _apolloUtilities.graphQLResultHasError)(result); - - if (ignoreErrors && (0, _apolloUtilities.graphQLResultHasError)(result) && result.data) { - writeWithErrors = true; - } - - if (!fetchMoreForQueryId && writeWithErrors) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_QUERY', - query: document, - variables: variables - }); - } - }; - - DataStore.prototype.markSubscriptionResult = function (result, document, variables) { - if (!(0, _apolloUtilities.graphQLResultHasError)(result)) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_SUBSCRIPTION', - query: document, - variables: variables - }); - } - }; - - DataStore.prototype.markMutationInit = function (mutation) { - var _this = this; - - if (mutation.optimisticResponse) { - var optimistic_1; - - if (typeof mutation.optimisticResponse === 'function') { - optimistic_1 = mutation.optimisticResponse(mutation.variables); - } else { - optimistic_1 = mutation.optimisticResponse; - } - - this.cache.recordOptimisticTransaction(function (c) { - var orig = _this.cache; - _this.cache = c; - - try { - _this.markMutationResult({ - mutationId: mutation.mutationId, - result: { - data: optimistic_1 - }, - document: mutation.document, - variables: mutation.variables, - updateQueries: mutation.updateQueries, - update: mutation.update - }); - } finally { - _this.cache = orig; - } - }, mutation.mutationId); - } - }; - - DataStore.prototype.markMutationResult = function (mutation) { - var _this = this; - - if (!(0, _apolloUtilities.graphQLResultHasError)(mutation.result)) { - var cacheWrites_1 = [{ - result: mutation.result.data, - dataId: 'ROOT_MUTATION', - query: mutation.document, - variables: mutation.variables - }]; - var updateQueries_1 = mutation.updateQueries; - - if (updateQueries_1) { - Object.keys(updateQueries_1).forEach(function (id) { - var _a = updateQueries_1[id], - query = _a.query, - updater = _a.updater; - - var _b = _this.cache.diff({ - query: query.document, - variables: query.variables, - returnPartialData: true, - optimistic: false - }), - currentQueryResult = _b.result, - complete = _b.complete; - - if (complete) { - var nextQueryResult = (0, _apolloUtilities.tryFunctionOrLogError)(function () { - return updater(currentQueryResult, { - mutationResult: mutation.result, - queryName: (0, _apolloUtilities.getOperationName)(query.document) || undefined, - queryVariables: query.variables - }); - }); - - if (nextQueryResult) { - cacheWrites_1.push({ - result: nextQueryResult, - dataId: 'ROOT_QUERY', - query: query.document, - variables: query.variables - }); - } - } - }); - } - - this.cache.performTransaction(function (c) { - cacheWrites_1.forEach(function (write) { - return c.write(write); - }); - var update = mutation.update; - - if (update) { - (0, _apolloUtilities.tryFunctionOrLogError)(function () { - return update(c, mutation.result); - }); - } - }); - } - }; - - DataStore.prototype.markMutationComplete = function (_a) { - var mutationId = _a.mutationId, - optimisticResponse = _a.optimisticResponse; - - if (optimisticResponse) { - this.cache.removeOptimistic(mutationId); - } - }; - - DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { - this.cache.write({ - result: newResult, - dataId: 'ROOT_QUERY', - variables: variables, - query: document - }); - }; - - DataStore.prototype.reset = function () { - return this.cache.reset(); - }; - - return DataStore; - }(); - - var version = "2.6.10"; - var hasSuggestedDevtools = false; - - var ApolloClient = function () { - function ApolloClient(options) { - var _this = this; - - this.defaultOptions = {}; - this.resetStoreCallbacks = []; - this.clearStoreCallbacks = []; - var cache = options.cache, - _a = options.ssrMode, - ssrMode = _a === void 0 ? false : _a, - _b = options.ssrForceFetchDelay, - ssrForceFetchDelay = _b === void 0 ? 0 : _b, - connectToDevTools = options.connectToDevTools, - _c = options.queryDeduplication, - queryDeduplication = _c === void 0 ? true : _c, - defaultOptions = options.defaultOptions, - _d = options.assumeImmutableResults, - assumeImmutableResults = _d === void 0 ? false : _d, - resolvers = options.resolvers, - typeDefs = options.typeDefs, - fragmentMatcher = options.fragmentMatcher, - clientAwarenessName = options.name, - clientAwarenessVersion = options.version; - var link = options.link; - - if (!link && resolvers) { - link = _apolloLink.ApolloLink.empty(); - } - - if (!link || !cache) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(4) : new _tsInvariant.InvariantError("In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\n" + "These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\n" + "For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup"); - } - - this.link = link; - this.cache = cache; - this.store = new DataStore(cache); - this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0; - this.queryDeduplication = queryDeduplication; - this.defaultOptions = defaultOptions || {}; - this.typeDefs = typeDefs; - - if (ssrForceFetchDelay) { - setTimeout(function () { - return _this.disableNetworkFetches = false; - }, ssrForceFetchDelay); - } - - this.watchQuery = this.watchQuery.bind(this); - this.query = this.query.bind(this); - this.mutate = this.mutate.bind(this); - this.resetStore = this.resetStore.bind(this); - this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this); - var defaultConnectToDevTools = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && !window.__APOLLO_CLIENT__; - - if (typeof connectToDevTools === 'undefined' ? defaultConnectToDevTools : connectToDevTools && typeof window !== 'undefined') { - window.__APOLLO_CLIENT__ = this; - } - - if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') { - hasSuggestedDevtools = true; - - if (typeof window !== 'undefined' && window.document && window.top === window.self) { - if (typeof window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { - if (window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('Chrome') > -1) { - console.debug('Download the Apollo DevTools ' + 'for a better development experience: ' + 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm'); - } - } - } - } - - this.version = version; - this.localState = new LocalState({ - cache: cache, - client: this, - resolvers: resolvers, - fragmentMatcher: fragmentMatcher - }); - this.queryManager = new QueryManager({ - link: this.link, - store: this.store, - queryDeduplication: queryDeduplication, - ssrMode: ssrMode, - clientAwareness: { - name: clientAwarenessName, - version: clientAwarenessVersion - }, - localState: this.localState, - assumeImmutableResults: assumeImmutableResults, - onBroadcast: function () { - if (_this.devToolsHookCb) { - _this.devToolsHookCb({ - action: {}, - state: { - queries: _this.queryManager.queryStore.getStore(), - mutations: _this.queryManager.mutationStore.getStore() - }, - dataWithOptimisticResults: _this.cache.extract(true) - }); - } - } - }); - } - - ApolloClient.prototype.stop = function () { - this.queryManager.stop(); - }; - - ApolloClient.prototype.watchQuery = function (options) { - if (this.defaultOptions.watchQuery) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.defaultOptions.watchQuery), options); - } - - if (this.disableNetworkFetches && (options.fetchPolicy === 'network-only' || options.fetchPolicy === 'cache-and-network')) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - fetchPolicy: 'cache-first' - }); - } - - return this.queryManager.watchQuery(options); - }; - - ApolloClient.prototype.query = function (options) { - if (this.defaultOptions.query) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.defaultOptions.query), options); - } - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 5) : (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 'The cache-and-network fetchPolicy does not work with client.query, because ' + 'client.query can only return a single result. Please use client.watchQuery ' + 'to receive multiple results from the cache and the network, or consider ' + 'using a different fetchPolicy, such as cache-first or network-only.'); - - if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - fetchPolicy: 'cache-first' - }); - } - - return this.queryManager.query(options); - }; - - ApolloClient.prototype.mutate = function (options) { - if (this.defaultOptions.mutate) { - options = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.defaultOptions.mutate), options); - } - - return this.queryManager.mutate(options); - }; - - ApolloClient.prototype.subscribe = function (options) { - return this.queryManager.startGraphQLSubscription(options); - }; - - ApolloClient.prototype.readQuery = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.cache.readQuery(options, optimistic); - }; - - ApolloClient.prototype.readFragment = function (options, optimistic) { - if (optimistic === void 0) { - optimistic = false; - } - - return this.cache.readFragment(options, optimistic); - }; - - ApolloClient.prototype.writeQuery = function (options) { - var result = this.cache.writeQuery(options); - this.queryManager.broadcastQueries(); - return result; - }; - - ApolloClient.prototype.writeFragment = function (options) { - var result = this.cache.writeFragment(options); - this.queryManager.broadcastQueries(); - return result; - }; - - ApolloClient.prototype.writeData = function (options) { - var result = this.cache.writeData(options); - this.queryManager.broadcastQueries(); - return result; - }; - - ApolloClient.prototype.__actionHookForDevTools = function (cb) { - this.devToolsHookCb = cb; - }; - - ApolloClient.prototype.__requestRaw = function (payload) { - return (0, _apolloLink.execute)(this.link, payload); - }; - - ApolloClient.prototype.initQueryManager = function () { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Calling the initQueryManager method is no longer necessary, ' + 'and it will be removed from ApolloClient in version 3.0.'); - return this.queryManager; - }; - - ApolloClient.prototype.resetStore = function () { - var _this = this; - - return Promise.resolve().then(function () { - return _this.queryManager.clearStore(); - }).then(function () { - return Promise.all(_this.resetStoreCallbacks.map(function (fn) { - return fn(); - })); - }).then(function () { - return _this.reFetchObservableQueries(); - }); - }; - - ApolloClient.prototype.clearStore = function () { - var _this = this; - - return Promise.resolve().then(function () { - return _this.queryManager.clearStore(); - }).then(function () { - return Promise.all(_this.clearStoreCallbacks.map(function (fn) { - return fn(); - })); - }); - }; - - ApolloClient.prototype.onResetStore = function (cb) { - var _this = this; - - this.resetStoreCallbacks.push(cb); - return function () { - _this.resetStoreCallbacks = _this.resetStoreCallbacks.filter(function (c) { - return c !== cb; - }); - }; - }; - - ApolloClient.prototype.onClearStore = function (cb) { - var _this = this; - - this.clearStoreCallbacks.push(cb); - return function () { - _this.clearStoreCallbacks = _this.clearStoreCallbacks.filter(function (c) { - return c !== cb; - }); - }; - }; - - ApolloClient.prototype.reFetchObservableQueries = function (includeStandby) { - return this.queryManager.reFetchObservableQueries(includeStandby); - }; - - ApolloClient.prototype.extract = function (optimistic) { - return this.cache.extract(optimistic); - }; - - ApolloClient.prototype.restore = function (serializedState) { - return this.cache.restore(serializedState); - }; - - ApolloClient.prototype.addResolvers = function (resolvers) { - this.localState.addResolvers(resolvers); - }; - - ApolloClient.prototype.setResolvers = function (resolvers) { - this.localState.setResolvers(resolvers); - }; - - ApolloClient.prototype.getResolvers = function () { - return this.localState.getResolvers(); - }; - - ApolloClient.prototype.setLocalStateFragmentMatcher = function (fragmentMatcher) { - this.localState.setFragmentMatcher(fragmentMatcher); - }; - - return ApolloClient; - }(); - - _exports.ApolloClient = ApolloClient; - var _default = ApolloClient; - - _exports.default = _default; -}); diff --git a/node_modules/apollo-client/bundle.umd.js.map b/node_modules/apollo-client/bundle.umd.js.map deleted file mode 100644 index f4c2971..0000000 --- a/node_modules/apollo-client/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/core/networkStatus.ts","../src/util/Observable.ts","../src/util/arrays.ts","../src/errors/ApolloError.ts","../src/core/types.ts","../src/core/ObservableQuery.ts","../src/data/mutations.ts","../src/data/queries.ts","../src/util/capitalizeFirstLetter.ts","../src/core/LocalState.ts","../src/util/observables.ts","../src/core/QueryManager.ts","../src/data/store.ts","../src/version.ts","../src/ApolloClient.ts"],"names":["LinkObservable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAGY,a;;;AAAZ,GAAA,UAAY,aAAZ,EAAyB;AAMvB,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMA,IAAA,aAAA,CAAA,aAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAA;AAMA,IAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAA;AAMA,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAOA,IAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA;AAKA,IAAA,aAAA,CAAA,aAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AAKA,IAAA,aAAA,CAAA,aAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AACD,GA1CD,EAAY,aAAa,8BAAb,aAAa,GAAA,EAAA,CAAzB;;AAgDA,WAAgB,wBAAhB,CACE,aADF,EAC8B;AAE5B,WAAO,aAAa,GAAG,CAAvB;AACD;;AC7CD,MAAA,UAAA,GAAA,UAAA,MAAA,EAAA;AAAmCA,0BAAAA,UAAAA,EAAAA,MAAAA;;AAAnC,aAAA,UAAA,GAAA;;AAQC;;AAPQ,IAAA,UAAA,CAAA,SAAA,CAAC,yBAAD,IAAP,YAAA;AACE,aAAO,IAAP;AACD,KAFM;;AAIA,IAAA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AX,CAAmB,UAAnB,CAAP;AACD,KAFM;;AAWA,IAAA,YAAA,CAAA,SAAA,CAAA,OAAA,GAAP,UAAe,eAAf,EAA2C;AACzC,aAAO,KAAK,KAAL,CAAW,OAAX,CAAmB,eAAnB,CAAP;AACD,KAFM;;AAOA,IAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,WAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,KAFM;;AAOA,IAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,UAAoB,SAApB,EAAsD;AACpD,WAAK,UAAL,CAAgB,YAAhB,CAA6B,SAA7B;AACD,KAFM;;AAOA,IAAA,YAAA,CAAA,SAAA,CAAA,YAAA,GAAP,YAAA;AACE,aAAO,KAAK,UAAL,CAAgB,YAAhB,EAAP;AACD,KAFM;;AAOA,IAAA,YAAA,CAAA,SAAA,CAAA,4BAAA,GAAP,UAAoC,eAApC,EAAoE;AAClE,WAAK,UAAL,CAAgB,kBAAhB,CAAmC,eAAnC;AACD,KAFM;;AAGT,WAAA,YAAA;AAAC,GA3gBD,EAAA","sourcesContent":["/**\n * The current status of a query’s execution in our system.\n */\nexport enum NetworkStatus {\n /**\n * The query has never been run before and the query is now currently running. A query will still\n * have this network status even if a partial data result was returned from the cache, but a\n * query was dispatched anyway.\n */\n loading = 1,\n\n /**\n * If `setVariables` was called and a query was fired because of that then the network status\n * will be `setVariables` until the result of that query comes back.\n */\n setVariables = 2,\n\n /**\n * Indicates that `fetchMore` was called on this query and that the query created is currently in\n * flight.\n */\n fetchMore = 3,\n\n /**\n * Similar to the `setVariables` network status. It means that `refetch` was called on a query\n * and the refetch request is currently in flight.\n */\n refetch = 4,\n\n /**\n * Indicates that a polling query is currently in flight. So for example if you are polling a\n * query every 10 seconds then the network status will switch to `poll` every 10 seconds whenever\n * a poll request has been sent but not resolved.\n */\n poll = 6,\n\n /**\n * No request is in flight for this query, and no errors happened. Everything is OK.\n */\n ready = 7,\n\n /**\n * No request is in flight for this query, but one or more errors were detected.\n */\n error = 8,\n}\n\n/**\n * Returns true if there is currently a network request in flight according to a given network\n * status.\n */\nexport function isNetworkRequestInFlight(\n networkStatus: NetworkStatus,\n): boolean {\n return networkStatus < 7;\n}\n","// This simplified polyfill attempts to follow the ECMAScript Observable proposal.\n// See https://github.com/zenparsing/es-observable\nimport { Observable as LinkObservable } from 'apollo-link';\n\nexport type Subscription = ZenObservable.Subscription;\nexport type Observer = ZenObservable.Observer;\n\nimport $$observable from 'symbol-observable';\n\n// rxjs interopt\nexport class Observable extends LinkObservable {\n public [$$observable]() {\n return this;\n }\n\n public ['@@observable' as any]() {\n return this;\n }\n}\n","export function isNonEmptyArray(value?: ArrayLike): value is Array {\n return Array.isArray(value) && value.length > 0;\n}\n","import { GraphQLError } from 'graphql';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport function isApolloError(err: Error): err is ApolloError {\n return err.hasOwnProperty('graphQLErrors');\n}\n\n// Sets the error message on this error according to the\n// the GraphQL and network errors that are present.\n// If the error message has already been set through the\n// constructor or otherwise, this function is a nop.\nconst generateErrorMessage = (err: ApolloError) => {\n let message = '';\n // If we have GraphQL errors present, add that to the error message.\n if (isNonEmptyArray(err.graphQLErrors)) {\n err.graphQLErrors.forEach((graphQLError: GraphQLError) => {\n const errorMessage = graphQLError\n ? graphQLError.message\n : 'Error message not found.';\n message += `GraphQL error: ${errorMessage}\\n`;\n });\n }\n\n if (err.networkError) {\n message += 'Network error: ' + err.networkError.message + '\\n';\n }\n\n // strip newline from the end of the message\n message = message.replace(/\\n$/, '');\n return message;\n};\n\nexport class ApolloError extends Error {\n public message: string;\n public graphQLErrors: ReadonlyArray;\n public networkError: Error | null;\n\n // An object that can be used to provide some additional information\n // about an error, e.g. specifying the type of error this is. Used\n // internally within Apollo Client.\n public extraInfo: any;\n\n // Constructs an instance of ApolloError given a GraphQLError\n // or a network error. Note that one of these has to be a valid\n // value or the constructed error will be meaningless.\n constructor({\n graphQLErrors,\n networkError,\n errorMessage,\n extraInfo,\n }: {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | null;\n errorMessage?: string;\n extraInfo?: any;\n }) {\n super(errorMessage);\n this.graphQLErrors = graphQLErrors || [];\n this.networkError = networkError || null;\n\n if (!errorMessage) {\n this.message = generateErrorMessage(this);\n } else {\n this.message = errorMessage;\n }\n\n this.extraInfo = extraInfo;\n\n // We're not using `Object.setPrototypeOf` here as it isn't fully\n // supported on Android (see issue #3236).\n (this as any).__proto__ = ApolloError.prototype;\n }\n}\n","import { FetchResult } from 'apollo-link';\nimport { DocumentNode, GraphQLError } from 'graphql';\n\nimport { QueryStoreValue } from '../data/queries';\nimport { NetworkStatus } from './networkStatus';\nimport { Resolver } from './LocalState';\n\nexport type QueryListener = (\n queryStoreValue: QueryStoreValue,\n newData?: any,\n forceResolvers?: boolean,\n) => void;\n\nexport type OperationVariables = { [key: string]: any };\n\nexport type PureQueryOptions = {\n query: DocumentNode;\n variables?: { [key: string]: any };\n context?: any;\n};\n\nexport type ApolloQueryResult = {\n data: T;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n stale: boolean;\n};\n\nexport enum FetchType {\n normal = 1,\n refetch = 2,\n poll = 3,\n}\n\n// This is part of the public API, people write these functions in `updateQueries`.\nexport type MutationQueryReducer = (\n previousResult: Record,\n options: {\n mutationResult: FetchResult;\n queryName: string | undefined;\n queryVariables: Record;\n },\n) => Record;\n\nexport type MutationQueryReducersMap = {\n [queryName: string]: MutationQueryReducer;\n};\n\nexport interface Resolvers {\n [key: string]: {\n [ field: string ]: Resolver;\n };\n}\n","import {\n isEqual,\n tryFunctionOrLogError,\n cloneDeep,\n getOperationDefinition,\n} from 'apollo-utilities';\nimport { GraphQLError } from 'graphql';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport { Observable, Observer, Subscription } from '../util/Observable';\nimport { ApolloError } from '../errors/ApolloError';\nimport { QueryManager } from './QueryManager';\nimport { ApolloQueryResult, FetchType, OperationVariables } from './types';\nimport {\n WatchQueryOptions,\n FetchMoreQueryOptions,\n SubscribeToMoreOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\n\nimport { QueryStoreValue } from '../data/queries';\n\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { isNonEmptyArray } from '../util/arrays';\n\n// XXX remove in the next breaking semver change (3.0)\n// Deprecated, use ApolloCurrentQueryResult\nexport type ApolloCurrentResult = {\n data: T | {};\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n};\n\nexport type ApolloCurrentQueryResult = {\n data: T | undefined;\n errors?: ReadonlyArray;\n loading: boolean;\n networkStatus: NetworkStatus;\n error?: ApolloError;\n partial?: boolean;\n stale?: boolean;\n};\n\nexport interface FetchMoreOptions<\n TData = any,\n TVariables = OperationVariables\n> {\n updateQuery: (\n previousQueryResult: TData,\n options: {\n fetchMoreResult?: TData;\n variables?: TVariables;\n },\n ) => TData;\n}\n\nexport interface UpdateQueryOptions {\n variables?: TVariables;\n}\n\nexport const hasError = (\n storeValue: QueryStoreValue,\n policy: ErrorPolicy = 'none',\n) => storeValue && (\n storeValue.networkError ||\n (policy === 'none' && isNonEmptyArray(storeValue.graphQLErrors))\n);\n\nexport class ObservableQuery<\n TData = any,\n TVariables = OperationVariables\n> extends Observable> {\n public options: WatchQueryOptions;\n public readonly queryId: string;\n public readonly queryName?: string;\n /**\n *\n * The current value of the variables for this query. Can change.\n */\n public variables: TVariables;\n\n private shouldSubscribe: boolean;\n private isTornDown: boolean;\n private queryManager: QueryManager;\n private observers = new Set>>();\n private subscriptions = new Set();\n\n private lastResult: ApolloQueryResult;\n private lastResultSnapshot: ApolloQueryResult;\n private lastError: ApolloError;\n\n constructor({\n queryManager,\n options,\n shouldSubscribe = true,\n }: {\n queryManager: QueryManager;\n options: WatchQueryOptions;\n shouldSubscribe?: boolean;\n }) {\n super((observer: Observer>) =>\n this.onSubscribe(observer),\n );\n\n // active state\n this.isTornDown = false;\n\n // query information\n this.options = options;\n this.variables = options.variables || ({} as TVariables);\n this.queryId = queryManager.generateQueryId();\n this.shouldSubscribe = shouldSubscribe;\n\n const opDef = getOperationDefinition(options.query);\n this.queryName = opDef && opDef.name && opDef.name.value;\n\n // related classes\n this.queryManager = queryManager;\n }\n\n public result(): Promise> {\n return new Promise((resolve, reject) => {\n const observer: Observer> = {\n next: (result: ApolloQueryResult) => {\n resolve(result);\n\n // Stop the query within the QueryManager if we can before\n // this function returns.\n //\n // We do this in order to prevent observers piling up within\n // the QueryManager. Notice that we only fully unsubscribe\n // from the subscription in a setTimeout(..., 0) call. This call can\n // actually be handled by the browser at a much later time. If queries\n // are fired in the meantime, observers that should have been removed\n // from the QueryManager will continue to fire, causing an unnecessary\n // performance hit.\n this.observers.delete(observer);\n if (!this.observers.size) {\n this.queryManager.removeQuery(this.queryId);\n }\n\n setTimeout(() => {\n subscription.unsubscribe();\n }, 0);\n },\n error: reject,\n };\n const subscription = this.subscribe(observer);\n });\n }\n\n // XXX remove in the next breaking semver change (3.0)\n // Deprecated, use getCurrentResult()\n public currentResult(): ApolloCurrentResult {\n const result = this.getCurrentResult() as ApolloCurrentResult;\n if (result.data === undefined) {\n result.data = {};\n }\n return result;\n }\n\n /**\n * Return the result of the query from the local cache as well as some fetching status\n * `loading` and `networkStatus` allow to know if a request is in flight\n * `partial` lets you know if the result from the local cache is complete or partial\n * @return {data: Object, error: ApolloError, loading: boolean, networkStatus: number, partial: boolean}\n */\n public getCurrentResult(): ApolloCurrentQueryResult {\n if (this.isTornDown) {\n const { lastResult } = this;\n return {\n data: !this.lastError && lastResult && lastResult.data || void 0,\n error: this.lastError,\n loading: false,\n networkStatus: NetworkStatus.error,\n };\n }\n\n const { data, partial } = this.queryManager.getCurrentQueryResult(this);\n const queryStoreValue = this.queryManager.queryStore.get(this.queryId);\n let result: ApolloQueryResult;\n\n const { fetchPolicy } = this.options;\n\n const isNetworkFetchPolicy =\n fetchPolicy === 'network-only' ||\n fetchPolicy === 'no-cache';\n\n if (queryStoreValue) {\n const { networkStatus } = queryStoreValue;\n\n if (hasError(queryStoreValue, this.options.errorPolicy)) {\n return {\n data: void 0,\n loading: false,\n networkStatus,\n error: new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }),\n };\n }\n\n // Variables might have been added dynamically at query time, when\n // using `@client @export(as: \"varname\")` for example. When this happens,\n // the variables have been updated in the query store, but not updated on\n // the original `ObservableQuery`. We'll update the observable query\n // variables here to match, so retrieving from the cache doesn't fail.\n if (queryStoreValue.variables) {\n this.options.variables = {\n ...this.options.variables,\n ...(queryStoreValue.variables as TVariables),\n };\n this.variables = this.options.variables;\n }\n\n result = {\n data,\n loading: isNetworkRequestInFlight(networkStatus),\n networkStatus,\n } as ApolloQueryResult;\n\n if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') {\n result.errors = queryStoreValue.graphQLErrors;\n }\n\n } else {\n // We need to be careful about the loading state we show to the user, to try\n // and be vaguely in line with what the user would have seen from .subscribe()\n // but to still provide useful information synchronously when the query\n // will not end up hitting the server.\n // See more: https://github.com/apollostack/apollo-client/issues/707\n // Basically: is there a query in flight right now (modolo the next tick)?\n const loading = isNetworkFetchPolicy ||\n (partial && fetchPolicy !== 'cache-only');\n\n result = {\n data,\n loading,\n networkStatus: loading ? NetworkStatus.loading : NetworkStatus.ready,\n } as ApolloQueryResult;\n }\n\n if (!partial) {\n this.updateLastResult({ ...result, stale: false });\n }\n\n return { ...result, partial };\n }\n\n // Compares newResult to the snapshot we took of this.lastResult when it was\n // first received.\n public isDifferentFromLastResult(newResult: ApolloQueryResult) {\n const { lastResultSnapshot: snapshot } = this;\n return !(\n snapshot &&\n newResult &&\n snapshot.networkStatus === newResult.networkStatus &&\n snapshot.stale === newResult.stale &&\n isEqual(snapshot.data, newResult.data)\n );\n }\n\n // Returns the last result that observer.next was called with. This is not the same as\n // getCurrentResult! If you're not sure which you need, then you probably need getCurrentResult.\n public getLastResult(): ApolloQueryResult {\n return this.lastResult;\n }\n\n public getLastError(): ApolloError {\n return this.lastError;\n }\n\n public resetLastResults(): void {\n delete this.lastResult;\n delete this.lastResultSnapshot;\n delete this.lastError;\n this.isTornDown = false;\n }\n\n public resetQueryStoreErrors() {\n const queryStore = this.queryManager.queryStore.get(this.queryId);\n if (queryStore) {\n queryStore.networkError = null;\n queryStore.graphQLErrors = [];\n }\n }\n\n /**\n * Update the variables of this observable query, and fetch the new results.\n * This method should be preferred over `setVariables` in most use cases.\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n */\n public refetch(variables?: TVariables): Promise> {\n let { fetchPolicy } = this.options;\n // early return if trying to read from cache during refetch\n if (fetchPolicy === 'cache-only') {\n return Promise.reject(new InvariantError(\n 'cache-only fetchPolicy option should not be used together with query refetch.',\n ));\n }\n\n // Unless the provided fetchPolicy always consults the network\n // (no-cache, network-only, or cache-and-network), override it with\n // network-only to force the refetch for this fetchQuery call.\n if (fetchPolicy !== 'no-cache' &&\n fetchPolicy !== 'cache-and-network') {\n fetchPolicy = 'network-only';\n }\n\n if (!isEqual(this.variables, variables)) {\n // update observable variables\n this.variables = {\n ...this.variables,\n ...variables,\n };\n }\n\n if (!isEqual(this.options.variables, this.variables)) {\n // Update the existing options with new variables\n this.options.variables = {\n ...this.options.variables,\n ...this.variables,\n };\n }\n\n return this.queryManager.fetchQuery(\n this.queryId,\n { ...this.options, fetchPolicy },\n FetchType.refetch,\n ) as Promise>;\n }\n\n public fetchMore(\n fetchMoreOptions: FetchMoreQueryOptions &\n FetchMoreOptions,\n ): Promise> {\n // early return if no update Query\n invariant(\n fetchMoreOptions.updateQuery,\n 'updateQuery option is required. This function defines how to update the query data with the new results.',\n );\n\n const combinedOptions = {\n ...(fetchMoreOptions.query ? fetchMoreOptions : {\n ...this.options,\n ...fetchMoreOptions,\n variables: {\n ...this.variables,\n ...fetchMoreOptions.variables,\n },\n }),\n fetchPolicy: 'network-only',\n } as WatchQueryOptions;\n\n const qid = this.queryManager.generateQueryId();\n\n return this.queryManager\n .fetchQuery(\n qid,\n combinedOptions,\n FetchType.normal,\n this.queryId,\n )\n .then(\n fetchMoreResult => {\n this.updateQuery((previousResult: any) =>\n fetchMoreOptions.updateQuery(previousResult, {\n fetchMoreResult: fetchMoreResult.data as TData,\n variables: combinedOptions.variables as TVariables,\n }),\n );\n this.queryManager.stopQuery(qid);\n return fetchMoreResult as ApolloQueryResult;\n },\n error => {\n this.queryManager.stopQuery(qid);\n throw error;\n },\n );\n }\n\n // XXX the subscription variables are separate from the query variables.\n // if you want to update subscription variables, right now you have to do that separately,\n // and you can only do it by stopping the subscription and then subscribing again with new variables.\n public subscribeToMore<\n TSubscriptionData = TData,\n TSubscriptionVariables = TVariables\n >(\n options: SubscribeToMoreOptions<\n TData,\n TSubscriptionVariables,\n TSubscriptionData\n >,\n ) {\n const subscription = this.queryManager\n .startGraphQLSubscription({\n query: options.document,\n variables: options.variables,\n })\n .subscribe({\n next: (subscriptionData: { data: TSubscriptionData }) => {\n const { updateQuery } = options;\n if (updateQuery) {\n this.updateQuery(\n (previous, { variables }) =>\n updateQuery(previous, {\n subscriptionData,\n variables,\n }),\n );\n }\n },\n error: (err: any) => {\n if (options.onError) {\n options.onError(err);\n return;\n }\n invariant.error('Unhandled GraphQL subscription error', err);\n },\n });\n\n this.subscriptions.add(subscription);\n\n return () => {\n if (this.subscriptions.delete(subscription)) {\n subscription.unsubscribe();\n }\n };\n }\n\n // Note: if the query is not active (there are no subscribers), the promise\n // will return null immediately.\n public setOptions(\n opts: WatchQueryOptions,\n ): Promise | void> {\n const { fetchPolicy: oldFetchPolicy } = this.options;\n this.options = {\n ...this.options,\n ...opts,\n } as WatchQueryOptions;\n\n if (opts.pollInterval) {\n this.startPolling(opts.pollInterval);\n } else if (opts.pollInterval === 0) {\n this.stopPolling();\n }\n\n const { fetchPolicy } = opts;\n\n return this.setVariables(\n this.options.variables as TVariables,\n // Try to fetch the query if fetchPolicy changed from either cache-only\n // or standby to something else, or changed to network-only.\n oldFetchPolicy !== fetchPolicy && (\n oldFetchPolicy === 'cache-only' ||\n oldFetchPolicy === 'standby' ||\n fetchPolicy === 'network-only'\n ),\n opts.fetchResults,\n );\n }\n\n /**\n * This is for *internal* use only. Most users should instead use `refetch`\n * in order to be properly notified of results even when they come from cache.\n *\n * Update the variables of this observable query, and fetch the new results\n * if they've changed. If you want to force new results, use `refetch`.\n *\n * Note: the `next` callback will *not* fire if the variables have not changed\n * or if the result is coming from cache.\n *\n * Note: the promise will return the old results immediately if the variables\n * have not changed.\n *\n * Note: the promise will return null immediately if the query is not active\n * (there are no subscribers).\n *\n * @private\n *\n * @param variables: The new set of variables. If there are missing variables,\n * the previous values of those variables will be used.\n *\n * @param tryFetch: Try and fetch new results even if the variables haven't\n * changed (we may still just hit the store, but if there's nothing in there\n * this will refetch)\n *\n * @param fetchResults: Option to ignore fetching results when updating variables\n */\n public setVariables(\n variables: TVariables,\n tryFetch: boolean = false,\n fetchResults = true,\n ): Promise | void> {\n // since setVariables restarts the subscription, we reset the tornDown status\n this.isTornDown = false;\n\n variables = variables || this.variables;\n\n if (!tryFetch && isEqual(variables, this.variables)) {\n // If we have no observers, then we don't actually want to make a network\n // request. As soon as someone observes the query, the request will kick\n // off. For now, we just store any changes. (See #1077)\n return this.observers.size && fetchResults\n ? this.result()\n : Promise.resolve();\n }\n\n this.variables = this.options.variables = variables;\n\n // See comment above\n if (!this.observers.size) {\n return Promise.resolve();\n }\n\n // Use the same options as before, but with new variables\n return this.queryManager.fetchQuery(\n this.queryId,\n this.options,\n ) as Promise>;\n }\n\n public updateQuery(\n mapFn: (\n previousQueryResult: TData,\n options: UpdateQueryOptions,\n ) => TData,\n ): void {\n const { queryManager } = this;\n const {\n previousResult,\n variables,\n document,\n } = queryManager.getQueryWithPreviousResult(\n this.queryId,\n );\n\n const newResult = tryFunctionOrLogError(() =>\n mapFn(previousResult, { variables }),\n );\n\n if (newResult) {\n queryManager.dataStore.markUpdateQueryResult(\n document,\n variables,\n newResult,\n );\n queryManager.broadcastQueries();\n }\n }\n\n public stopPolling() {\n this.queryManager.stopPollingQuery(this.queryId);\n this.options.pollInterval = undefined;\n }\n\n public startPolling(pollInterval: number) {\n assertNotCacheFirstOrOnly(this);\n this.options.pollInterval = pollInterval;\n this.queryManager.startPollingQuery(this.options, this.queryId);\n }\n\n private updateLastResult(newResult: ApolloQueryResult) {\n const previousResult = this.lastResult;\n this.lastResult = newResult;\n this.lastResultSnapshot = this.queryManager.assumeImmutableResults\n ? newResult\n : cloneDeep(newResult);\n return previousResult;\n }\n\n private onSubscribe(observer: Observer>) {\n // Zen Observable has its own error function, so in order to log correctly\n // we need to provide a custom error callback.\n try {\n var subObserver = (observer as any)._subscription._observer;\n if (subObserver && !subObserver.error) {\n subObserver.error = defaultSubscriptionObserverErrorCallback;\n }\n } catch {}\n\n const first = !this.observers.size;\n this.observers.add(observer);\n\n // Deliver initial result\n if (observer.next && this.lastResult) observer.next(this.lastResult);\n if (observer.error && this.lastError) observer.error(this.lastError);\n\n // setup the query if it hasn't been done before\n if (first) {\n this.setUpQuery();\n }\n\n return () => {\n if (this.observers.delete(observer) && !this.observers.size) {\n this.tearDownQuery();\n }\n };\n }\n\n private setUpQuery() {\n const { queryManager, queryId } = this;\n\n if (this.shouldSubscribe) {\n queryManager.addObservableQuery(queryId, this);\n }\n\n if (this.options.pollInterval) {\n assertNotCacheFirstOrOnly(this);\n queryManager.startPollingQuery(this.options, queryId);\n }\n\n const onError = (error: ApolloError) => {\n // Since we don't get the current result on errors, only the error, we\n // must mirror the updates that occur in QueryStore.markQueryError here\n this.updateLastResult({\n ...this.lastResult,\n errors: error.graphQLErrors,\n networkStatus: NetworkStatus.error,\n loading: false,\n });\n iterateObserversSafely(this.observers, 'error', this.lastError = error);\n };\n\n queryManager.observeQuery(queryId, this.options, {\n next: (result: ApolloQueryResult) => {\n if (this.lastError || this.isDifferentFromLastResult(result)) {\n const previousResult = this.updateLastResult(result);\n const { query, variables, fetchPolicy } = this.options;\n\n // Before calling `next` on each observer, we need to first see if\n // the query is using `@client @export` directives, and update\n // any variables that might have changed. If `@export` variables have\n // changed, and the query is calling against both local and remote\n // data, a refetch is needed to pull in new data, using the\n // updated `@export` variables.\n if (queryManager.transform(query).hasClientExports) {\n queryManager.getLocalState().addExportedVariables(\n query,\n variables,\n ).then((variables: TVariables) => {\n const previousVariables = this.variables;\n this.variables = this.options.variables = variables;\n if (\n !result.loading &&\n previousResult &&\n fetchPolicy !== 'cache-only' &&\n queryManager.transform(query).serverQuery &&\n !isEqual(previousVariables, variables)\n ) {\n this.refetch();\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n });\n } else {\n iterateObserversSafely(this.observers, 'next', result);\n }\n }\n },\n error: onError,\n }).catch(onError);\n }\n\n private tearDownQuery() {\n const { queryManager } = this;\n\n this.isTornDown = true;\n queryManager.stopPollingQuery(this.queryId);\n\n // stop all active GraphQL subscriptions\n this.subscriptions.forEach(sub => sub.unsubscribe());\n this.subscriptions.clear();\n\n queryManager.removeObservableQuery(this.queryId);\n queryManager.stopQuery(this.queryId);\n\n this.observers.clear();\n }\n}\n\nfunction defaultSubscriptionObserverErrorCallback(error: ApolloError) {\n invariant.error('Unhandled error', error.message, error.stack);\n}\n\nfunction iterateObserversSafely(\n observers: Set>,\n method: keyof Observer,\n argument?: A,\n) {\n // In case observers is modified during iteration, we need to commit to the\n // original elements, which also provides an opportunity to filter them down\n // to just the observers with the given method.\n const observersWithMethod: Observer[] = [];\n observers.forEach(obs => obs[method] && observersWithMethod.push(obs));\n observersWithMethod.forEach(obs => (obs as any)[method](argument));\n}\n\nfunction assertNotCacheFirstOrOnly(\n obsQuery: ObservableQuery,\n) {\n const { fetchPolicy } = obsQuery.options;\n invariant(\n fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only',\n 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.',\n );\n}\n","import { DocumentNode } from 'graphql';\n\nexport class MutationStore {\n private store: { [mutationId: string]: MutationStoreValue } = {};\n\n public getStore(): { [mutationId: string]: MutationStoreValue } {\n return this.store;\n }\n\n public get(mutationId: string): MutationStoreValue {\n return this.store[mutationId];\n }\n\n public initMutation(\n mutationId: string,\n mutation: DocumentNode,\n variables: Object | undefined,\n ) {\n this.store[mutationId] = {\n mutation,\n variables: variables || {},\n loading: true,\n error: null,\n };\n }\n\n public markMutationError(mutationId: string, error: Error) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = error;\n }\n }\n\n public markMutationResult(mutationId: string) {\n const mutation = this.store[mutationId];\n if (mutation) {\n mutation.loading = false;\n mutation.error = null;\n }\n }\n\n public reset() {\n this.store = {};\n }\n}\n\nexport interface MutationStoreValue {\n mutation: DocumentNode;\n variables: Object;\n loading: boolean;\n error: Error | null;\n}\n","import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql';\nimport { isEqual } from 'apollo-utilities';\nimport { invariant } from 'ts-invariant';\nimport { NetworkStatus } from '../core/networkStatus';\nimport { isNonEmptyArray } from '../util/arrays';\n\nexport type QueryStoreValue = {\n document: DocumentNode;\n variables: Object;\n previousVariables?: Object | null;\n networkStatus: NetworkStatus;\n networkError?: Error | null;\n graphQLErrors?: ReadonlyArray;\n metadata: any;\n};\n\nexport class QueryStore {\n private store: { [queryId: string]: QueryStoreValue } = {};\n\n public getStore(): { [queryId: string]: QueryStoreValue } {\n return this.store;\n }\n\n public get(queryId: string): QueryStoreValue {\n return this.store[queryId];\n }\n\n public initQuery(query: {\n queryId: string;\n document: DocumentNode;\n storePreviousVariables: boolean;\n variables: Object;\n isPoll: boolean;\n isRefetch: boolean;\n metadata: any;\n fetchMoreForQueryId: string | undefined;\n }) {\n const previousQuery = this.store[query.queryId];\n\n // XXX we're throwing an error here to catch bugs where a query gets overwritten by a new one.\n // we should implement a separate action for refetching so that QUERY_INIT may never overwrite\n // an existing query (see also: https://github.com/apollostack/apollo-client/issues/732)\n invariant(\n !previousQuery ||\n previousQuery.document === query.document ||\n isEqual(previousQuery.document, query.document),\n 'Internal Error: may not update existing query string in store',\n );\n\n let isSetVariables = false;\n\n let previousVariables: Object | null = null;\n if (\n query.storePreviousVariables &&\n previousQuery &&\n previousQuery.networkStatus !== NetworkStatus.loading\n // if the previous query was still loading, we don't want to remember it at all.\n ) {\n if (!isEqual(previousQuery.variables, query.variables)) {\n isSetVariables = true;\n previousVariables = previousQuery.variables;\n }\n }\n\n // TODO break this out into a separate function\n let networkStatus;\n if (isSetVariables) {\n networkStatus = NetworkStatus.setVariables;\n } else if (query.isPoll) {\n networkStatus = NetworkStatus.poll;\n } else if (query.isRefetch) {\n networkStatus = NetworkStatus.refetch;\n // TODO: can we determine setVariables here if it's a refetch and the variables have changed?\n } else {\n networkStatus = NetworkStatus.loading;\n }\n\n let graphQLErrors: ReadonlyArray = [];\n if (previousQuery && previousQuery.graphQLErrors) {\n graphQLErrors = previousQuery.graphQLErrors;\n }\n\n // XXX right now if QUERY_INIT is fired twice, like in a refetch situation, we just overwrite\n // the store. We probably want a refetch action instead, because I suspect that if you refetch\n // before the initial fetch is done, you'll get an error.\n this.store[query.queryId] = {\n document: query.document,\n variables: query.variables,\n previousVariables,\n networkError: null,\n graphQLErrors: graphQLErrors,\n networkStatus,\n metadata: query.metadata,\n };\n\n // If the action had a `moreForQueryId` property then we need to set the\n // network status on that query as well to `fetchMore`.\n //\n // We have a complement to this if statement in the query result and query\n // error action branch, but importantly *not* in the client result branch.\n // This is because the implementation of `fetchMore` *always* sets\n // `fetchPolicy` to `network-only` so we would never have a client result.\n if (\n typeof query.fetchMoreForQueryId === 'string' &&\n this.store[query.fetchMoreForQueryId]\n ) {\n this.store[query.fetchMoreForQueryId].networkStatus =\n NetworkStatus.fetchMore;\n }\n }\n\n public markQueryResult(\n queryId: string,\n result: ExecutionResult,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = null;\n this.store[queryId].graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];\n this.store[queryId].previousVariables = null;\n this.store[queryId].networkStatus = NetworkStatus.ready;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (\n typeof fetchMoreForQueryId === 'string' &&\n this.store[fetchMoreForQueryId]\n ) {\n this.store[fetchMoreForQueryId].networkStatus = NetworkStatus.ready;\n }\n }\n\n public markQueryError(\n queryId: string,\n error: Error,\n fetchMoreForQueryId: string | undefined,\n ) {\n if (!this.store || !this.store[queryId]) return;\n\n this.store[queryId].networkError = error;\n this.store[queryId].networkStatus = NetworkStatus.error;\n\n // If we have a `fetchMoreForQueryId` then we need to update the network\n // status for that query. See the branch for query initialization for more\n // explanation about this process.\n if (typeof fetchMoreForQueryId === 'string') {\n this.markQueryResultClient(fetchMoreForQueryId, true);\n }\n }\n\n public markQueryResultClient(queryId: string, complete: boolean) {\n const storeValue = this.store && this.store[queryId];\n if (storeValue) {\n storeValue.networkError = null;\n storeValue.previousVariables = null;\n if (complete) {\n storeValue.networkStatus = NetworkStatus.ready;\n }\n }\n }\n\n public stopQuery(queryId: string) {\n delete this.store[queryId];\n }\n\n public reset(observableQueryIds: string[]) {\n Object.keys(this.store).forEach(queryId => {\n if (observableQueryIds.indexOf(queryId) < 0) {\n this.stopQuery(queryId);\n } else {\n // XXX set loading to true so listeners don't trigger unless they want results with partial data\n this.store[queryId].networkStatus = NetworkStatus.loading;\n }\n });\n }\n}\n","export function capitalizeFirstLetter(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n SelectionSetNode,\n SelectionNode,\n InlineFragmentNode,\n FragmentDefinitionNode,\n FieldNode,\n ASTNode,\n} from 'graphql';\nimport { visit, BREAK } from 'graphql/language/visitor';\n\nimport { ApolloCache } from 'apollo-cache';\nimport {\n getMainDefinition,\n buildQueryFromSelectionSet,\n hasDirectives,\n removeClientSetsFromDocument,\n mergeDeep,\n mergeDeepArray,\n FragmentMap,\n argumentsObjectFromField,\n resultKeyNameFromField,\n getFragmentDefinitions,\n createFragmentMap,\n shouldInclude,\n isField,\n isInlineFragment,\n} from 'apollo-utilities';\nimport { FetchResult } from 'apollo-link';\n\nimport { invariant } from 'ts-invariant';\n\nimport ApolloClient from '../ApolloClient';\nimport { Resolvers, OperationVariables } from './types';\nimport { capitalizeFirstLetter } from '../util/capitalizeFirstLetter';\n\nexport type Resolver = (\n rootValue?: any,\n args?: any,\n context?: any,\n info?: {\n field: FieldNode;\n fragmentMap: FragmentMap;\n },\n) => any;\n\nexport type VariableMap = { [name: string]: any };\n\nexport type FragmentMatcher = (\n rootValue: any,\n typeCondition: string,\n context: any,\n) => boolean;\n\nexport type ExecContext = {\n fragmentMap: FragmentMap;\n context: any;\n variables: VariableMap;\n fragmentMatcher: FragmentMatcher;\n defaultOperationType: string;\n exportedVariables: Record;\n onlyRunForcedResolvers: boolean;\n};\n\nexport type LocalStateOptions = {\n cache: ApolloCache;\n client?: ApolloClient;\n resolvers?: Resolvers | Resolvers[];\n fragmentMatcher?: FragmentMatcher;\n};\n\nexport class LocalState {\n private cache: ApolloCache;\n private client: ApolloClient;\n private resolvers?: Resolvers;\n private fragmentMatcher: FragmentMatcher;\n\n constructor({\n cache,\n client,\n resolvers,\n fragmentMatcher,\n }: LocalStateOptions) {\n this.cache = cache;\n\n if (client) {\n this.client = client;\n }\n\n if (resolvers) {\n this.addResolvers(resolvers);\n }\n\n if (fragmentMatcher) {\n this.setFragmentMatcher(fragmentMatcher);\n }\n }\n\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = this.resolvers || {};\n if (Array.isArray(resolvers)) {\n resolvers.forEach(resolverGroup => {\n this.resolvers = mergeDeep(this.resolvers, resolverGroup);\n });\n } else {\n this.resolvers = mergeDeep(this.resolvers, resolvers);\n }\n }\n\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.resolvers = {};\n this.addResolvers(resolvers);\n }\n\n public getResolvers() {\n return this.resolvers || {};\n }\n\n // Run local client resolvers against the incoming query and remote data.\n // Locally resolved field values are merged with the incoming remote data,\n // and returned. Note that locally resolved fields will overwrite\n // remote data using the same field name.\n public async runResolvers({\n document,\n remoteResult,\n context,\n variables,\n onlyRunForcedResolvers = false,\n }: {\n document: DocumentNode | null;\n remoteResult: FetchResult;\n context?: Record;\n variables?: Record;\n onlyRunForcedResolvers?: boolean;\n }): Promise> {\n if (document) {\n return this.resolveDocument(\n document,\n remoteResult.data,\n context,\n variables,\n this.fragmentMatcher,\n onlyRunForcedResolvers,\n ).then(localResult => ({\n ...remoteResult,\n data: localResult.result,\n }));\n }\n\n return remoteResult;\n }\n\n public setFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.fragmentMatcher = fragmentMatcher;\n }\n\n public getFragmentMatcher(): FragmentMatcher {\n return this.fragmentMatcher;\n }\n\n // Client queries contain everything in the incoming document (if a @client\n // directive is found).\n public clientQuery(document: DocumentNode) {\n if (hasDirectives(['client'], document)) {\n if (this.resolvers) {\n return document;\n }\n invariant.warn(\n 'Found @client directives in a query but no ApolloClient resolvers ' +\n 'were specified. This means ApolloClient local resolver handling ' +\n 'has been disabled, and @client directives will be passed through ' +\n 'to your link chain.',\n );\n }\n return null;\n }\n\n // Server queries are stripped of all @client based selection sets.\n public serverQuery(document: DocumentNode) {\n return this.resolvers ? removeClientSetsFromDocument(document) : document;\n }\n\n public prepareContext(context = {}) {\n const { cache } = this;\n\n const newContext = {\n ...context,\n cache,\n // Getting an entry's cache key is useful for local state resolvers.\n getCacheKey: (obj: { __typename: string; id: string | number }) => {\n if ((cache as any).config) {\n return (cache as any).config.dataIdFromObject(obj);\n } else {\n invariant(false,\n 'To use context.getCacheKey, you need to use a cache that has ' +\n 'a configurable dataIdFromObject, like apollo-cache-inmemory.',\n );\n }\n },\n };\n\n return newContext;\n }\n\n // To support `@client @export(as: \"someVar\")` syntax, we'll first resolve\n // @client @export fields locally, then pass the resolved values back to be\n // used alongside the original operation variables.\n public async addExportedVariables(\n document: DocumentNode,\n variables: OperationVariables = {},\n context = {},\n ) {\n if (document) {\n return this.resolveDocument(\n document,\n this.buildRootValueFromCache(document, variables) || {},\n this.prepareContext(context),\n variables,\n ).then(data => ({\n ...variables,\n ...data.exportedVariables,\n }));\n }\n\n return {\n ...variables,\n };\n }\n\n public shouldForceResolvers(document: ASTNode) {\n let forceResolvers = false;\n visit(document, {\n Directive: {\n enter(node) {\n if (node.name.value === 'client' && node.arguments) {\n forceResolvers = node.arguments.some(\n arg =>\n arg.name.value === 'always' &&\n arg.value.kind === 'BooleanValue' &&\n arg.value.value === true,\n );\n if (forceResolvers) {\n return BREAK;\n }\n }\n },\n },\n });\n return forceResolvers;\n }\n\n // Query the cache and return matching data.\n private buildRootValueFromCache(\n document: DocumentNode,\n variables?: Record,\n ) {\n return this.cache.diff({\n query: buildQueryFromSelectionSet(document),\n variables,\n returnPartialData: true,\n optimistic: false,\n }).result;\n }\n\n private async resolveDocument(\n document: DocumentNode,\n rootValue: TData,\n context: any = {},\n variables: VariableMap = {},\n fragmentMatcher: FragmentMatcher = () => true,\n onlyRunForcedResolvers: boolean = false,\n ) {\n const mainDefinition = getMainDefinition(document);\n const fragments = getFragmentDefinitions(document);\n const fragmentMap = createFragmentMap(fragments);\n\n const definitionOperation = (mainDefinition as OperationDefinitionNode)\n .operation;\n\n const defaultOperationType = definitionOperation\n ? capitalizeFirstLetter(definitionOperation)\n : 'Query';\n\n const { cache, client } = this;\n const execContext: ExecContext = {\n fragmentMap,\n context: {\n ...context,\n cache,\n client,\n },\n variables,\n fragmentMatcher,\n defaultOperationType,\n exportedVariables: {},\n onlyRunForcedResolvers,\n };\n\n return this.resolveSelectionSet(\n mainDefinition.selectionSet,\n rootValue,\n execContext,\n ).then(result => ({\n result,\n exportedVariables: execContext.exportedVariables,\n }));\n }\n\n private async resolveSelectionSet(\n selectionSet: SelectionSetNode,\n rootValue: TData,\n execContext: ExecContext,\n ) {\n const { fragmentMap, context, variables } = execContext;\n const resultsToMerge: TData[] = [rootValue];\n\n const execute = async (selection: SelectionNode): Promise => {\n if (!shouldInclude(selection, variables)) {\n // Skip this entirely.\n return;\n }\n\n if (isField(selection)) {\n return this.resolveField(selection, rootValue, execContext).then(\n fieldResult => {\n if (typeof fieldResult !== 'undefined') {\n resultsToMerge.push({\n [resultKeyNameFromField(selection)]: fieldResult,\n } as TData);\n }\n },\n );\n }\n\n let fragment: InlineFragmentNode | FragmentDefinitionNode;\n\n if (isInlineFragment(selection)) {\n fragment = selection;\n } else {\n // This is a named fragment.\n fragment = fragmentMap[selection.name.value];\n invariant(fragment, `No fragment named ${selection.name.value}`);\n }\n\n if (fragment && fragment.typeCondition) {\n const typeCondition = fragment.typeCondition.name.value;\n if (execContext.fragmentMatcher(rootValue, typeCondition, context)) {\n return this.resolveSelectionSet(\n fragment.selectionSet,\n rootValue,\n execContext,\n ).then(fragmentResult => {\n resultsToMerge.push(fragmentResult);\n });\n }\n }\n };\n\n return Promise.all(selectionSet.selections.map(execute)).then(function() {\n return mergeDeepArray(resultsToMerge);\n });\n }\n\n private async resolveField(\n field: FieldNode,\n rootValue: any,\n execContext: ExecContext,\n ): Promise {\n const { variables } = execContext;\n const fieldName = field.name.value;\n const aliasedFieldName = resultKeyNameFromField(field);\n const aliasUsed = fieldName !== aliasedFieldName;\n const defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName];\n let resultPromise = Promise.resolve(defaultResult);\n\n // Usually all local resolvers are run when passing through here, but\n // if we've specifically identified that we only want to run forced\n // resolvers (that is, resolvers for fields marked with\n // `@client(always: true)`), then we'll skip running non-forced resolvers.\n if (\n !execContext.onlyRunForcedResolvers ||\n this.shouldForceResolvers(field)\n ) {\n const resolverType =\n rootValue.__typename || execContext.defaultOperationType;\n const resolverMap = this.resolvers && this.resolvers[resolverType];\n if (resolverMap) {\n const resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName];\n if (resolve) {\n resultPromise = Promise.resolve(resolve(\n rootValue,\n argumentsObjectFromField(field, variables),\n execContext.context,\n { field, fragmentMap: execContext.fragmentMap },\n ));\n }\n }\n }\n\n return resultPromise.then((result = defaultResult) => {\n // If an @export directive is associated with the current field, store\n // the `as` export variable name and current result for later use.\n if (field.directives) {\n field.directives.forEach(directive => {\n if (directive.name.value === 'export' && directive.arguments) {\n directive.arguments.forEach(arg => {\n if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {\n execContext.exportedVariables[arg.value.value] = result;\n }\n });\n }\n });\n }\n\n // Handle all scalar types here.\n if (!field.selectionSet) {\n return result;\n }\n\n // From here down, the field has a selection set, which means it's trying\n // to query a GraphQLObjectType.\n if (result == null) {\n // Basically any field in a GraphQL response can be null, or missing\n return result;\n }\n\n if (Array.isArray(result)) {\n return this.resolveSubSelectedArray(field, result, execContext);\n }\n\n // Returned value is an object, and the query has a sub-selection. Recurse.\n if (field.selectionSet) {\n return this.resolveSelectionSet(\n field.selectionSet,\n result,\n execContext,\n );\n }\n });\n }\n\n private resolveSubSelectedArray(\n field: FieldNode,\n result: any[],\n execContext: ExecContext,\n ): any {\n return Promise.all(\n result.map(item => {\n if (item === null) {\n return null;\n }\n\n // This is a nested array, recurse.\n if (Array.isArray(item)) {\n return this.resolveSubSelectedArray(field, item, execContext);\n }\n\n // This is an object, run the selection set on it.\n if (field.selectionSet) {\n return this.resolveSelectionSet(field.selectionSet, item, execContext);\n }\n }),\n );\n }\n}\n","import { Observable, Observer, Subscription } from './Observable';\n\n// Returns a normal Observable that can have any number of subscribers,\n// while ensuring the original Observable gets subscribed to at most once.\nexport function multiplex(inner: Observable): Observable {\n const observers = new Set>();\n let sub: Subscription | null = null;\n return new Observable(observer => {\n observers.add(observer);\n sub = sub || inner.subscribe({\n next(value) {\n observers.forEach(obs => obs.next && obs.next(value));\n },\n error(error) {\n observers.forEach(obs => obs.error && obs.error(error));\n },\n complete() {\n observers.forEach(obs => obs.complete && obs.complete());\n },\n });\n return () => {\n if (observers.delete(observer) && !observers.size && sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n });\n}\n\n// Like Observable.prototype.map, except that the mapping function can\n// optionally return a Promise (or be async).\nexport function asyncMap(\n observable: Observable,\n mapFn: (value: V) => R | Promise,\n): Observable {\n return new Observable(observer => {\n const { next, error, complete } = observer;\n let activeNextCount = 0;\n let completed = false;\n\n const handler: Observer = {\n next(value) {\n ++activeNextCount;\n new Promise(resolve => {\n resolve(mapFn(value));\n }).then(\n result => {\n --activeNextCount;\n next && next.call(observer, result);\n completed && handler.complete!();\n },\n e => {\n --activeNextCount;\n error && error.call(observer, e);\n },\n );\n },\n error(e) {\n error && error.call(observer, e);\n },\n complete() {\n completed = true;\n if (!activeNextCount) {\n complete && complete.call(observer);\n }\n },\n };\n\n const sub = observable.subscribe(handler);\n return () => sub.unsubscribe();\n });\n}\n","import { execute, ApolloLink, FetchResult } from 'apollo-link';\nimport { DocumentNode } from 'graphql';\nimport { Cache } from 'apollo-cache';\nimport {\n getDefaultValues,\n getOperationDefinition,\n getOperationName,\n hasDirectives,\n graphQLResultHasError,\n hasClientExports,\n removeConnectionDirectiveFromDocument,\n canUseWeakMap,\n} from 'apollo-utilities';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { isApolloError, ApolloError } from '../errors/ApolloError';\nimport { Observer, Subscription, Observable } from '../util/Observable';\nimport { QueryWithUpdater, DataStore } from '../data/store';\nimport { MutationStore } from '../data/mutations';\nimport { QueryStore, QueryStoreValue } from '../data/queries';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n ErrorPolicy,\n} from './watchQueryOptions';\nimport { ObservableQuery } from './ObservableQuery';\nimport { NetworkStatus, isNetworkRequestInFlight } from './networkStatus';\nimport {\n QueryListener,\n ApolloQueryResult,\n FetchType,\n OperationVariables,\n} from './types';\nimport { LocalState } from './LocalState';\nimport { asyncMap, multiplex } from '../util/observables';\nimport { isNonEmptyArray } from '../util/arrays';\n\nconst { hasOwnProperty } = Object.prototype;\n\nexport interface QueryInfo {\n listeners: Set;\n invalidated: boolean;\n newData: Cache.DiffResult | null;\n document: DocumentNode | null;\n lastRequestId: number;\n // A map going from queryId to an observer for a query issued by watchQuery. We use\n // these to keep track of queries that are inflight and error on the observers associated\n // with them in case of some destabalizing action (e.g. reset of the Apollo store).\n observableQuery: ObservableQuery | null;\n subscriptions: Set;\n cancel?: () => void;\n}\n\nexport class QueryManager {\n public link: ApolloLink;\n public mutationStore: MutationStore = new MutationStore();\n public queryStore: QueryStore = new QueryStore();\n public dataStore: DataStore;\n public readonly assumeImmutableResults: boolean;\n\n private queryDeduplication: boolean;\n private clientAwareness: Record = {};\n private localState: LocalState;\n\n private onBroadcast: () => void;\n\n private ssrMode: boolean;\n\n // let's not start at zero to avoid pain with bad checks\n private idCounter = 1;\n\n // XXX merge with ObservableQuery but that needs to be expanded to support mutations and\n // subscriptions as well\n private queries: Map = new Map();\n\n // A map of Promise reject functions for fetchQuery promises that have not\n // yet been resolved, used to keep track of in-flight queries so that we can\n // reject them in case a destabilizing event occurs (e.g. Apollo store reset).\n // The key is in the format of `query:${queryId}` or `fetchRequest:${queryId}`,\n // depending on where the promise's rejection function was created from.\n private fetchQueryRejectFns = new Map();\n\n constructor({\n link,\n queryDeduplication = false,\n store,\n onBroadcast = () => undefined,\n ssrMode = false,\n clientAwareness = {},\n localState,\n assumeImmutableResults,\n }: {\n link: ApolloLink;\n queryDeduplication?: boolean;\n store: DataStore;\n onBroadcast?: () => void;\n ssrMode?: boolean;\n clientAwareness?: Record;\n localState?: LocalState;\n assumeImmutableResults?: boolean;\n }) {\n this.link = link;\n this.queryDeduplication = queryDeduplication;\n this.dataStore = store;\n this.onBroadcast = onBroadcast;\n this.clientAwareness = clientAwareness;\n this.localState = localState || new LocalState({ cache: store.getCache() });\n this.ssrMode = ssrMode;\n this.assumeImmutableResults = !!assumeImmutableResults;\n }\n\n /**\n * Call this method to terminate any active query processes, making it safe\n * to dispose of this QueryManager instance.\n */\n public stop() {\n this.queries.forEach((_info, queryId) => {\n this.stopQueryNoBroadcast(queryId);\n });\n\n this.fetchQueryRejectFns.forEach(reject => {\n reject(\n new InvariantError('QueryManager stopped while query was in flight'),\n );\n });\n }\n\n public async mutate({\n mutation,\n variables,\n optimisticResponse,\n updateQueries: updateQueriesByName,\n refetchQueries = [],\n awaitRefetchQueries = false,\n update: updateWithProxyFn,\n errorPolicy = 'none',\n fetchPolicy,\n context = {},\n }: MutationOptions): Promise> {\n invariant(\n mutation,\n 'mutation option is required. You must specify your GraphQL document in the mutation option.',\n );\n\n invariant(\n !fetchPolicy || fetchPolicy === 'no-cache',\n \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\"\n );\n\n const mutationId = this.generateQueryId();\n mutation = this.transform(mutation).document;\n\n this.setQuery(mutationId, () => ({ document: mutation }));\n\n variables = this.getVariables(mutation, variables);\n\n if (this.transform(mutation).hasClientExports) {\n variables = await this.localState.addExportedVariables(mutation, variables, context);\n }\n\n // Create a map of update queries by id to the query instead of by name.\n const generateUpdateQueriesInfo: () => {\n [queryId: string]: QueryWithUpdater;\n } = () => {\n const ret: { [queryId: string]: QueryWithUpdater } = {};\n\n if (updateQueriesByName) {\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const { queryName } = observableQuery;\n if (\n queryName &&\n hasOwnProperty.call(updateQueriesByName, queryName)\n ) {\n ret[queryId] = {\n updater: updateQueriesByName[queryName],\n query: this.queryStore.get(queryId),\n };\n }\n }\n });\n }\n\n return ret;\n };\n\n this.mutationStore.initMutation(\n mutationId,\n mutation,\n variables,\n );\n\n this.dataStore.markMutationInit({\n mutationId,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n optimisticResponse,\n });\n\n this.broadcastQueries();\n\n const self = this;\n\n return new Promise((resolve, reject) => {\n let storeResult: FetchResult | null;\n let error: ApolloError;\n\n self.getObservableFromLink(\n mutation,\n {\n ...context,\n optimisticResponse,\n },\n variables,\n false,\n ).subscribe({\n next(result: FetchResult) {\n if (graphQLResultHasError(result) && errorPolicy === 'none') {\n error = new ApolloError({\n graphQLErrors: result.errors,\n });\n return;\n }\n\n self.mutationStore.markMutationResult(mutationId);\n\n if (fetchPolicy !== 'no-cache') {\n self.dataStore.markMutationResult({\n mutationId,\n result,\n document: mutation,\n variables,\n updateQueries: generateUpdateQueriesInfo(),\n update: updateWithProxyFn,\n });\n }\n\n storeResult = result;\n },\n\n error(err: Error) {\n self.mutationStore.markMutationError(mutationId, err);\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n self.broadcastQueries();\n self.setQuery(mutationId, () => ({ document: null }));\n reject(\n new ApolloError({\n networkError: err,\n }),\n );\n },\n\n complete() {\n if (error) {\n self.mutationStore.markMutationError(mutationId, error);\n }\n\n self.dataStore.markMutationComplete({\n mutationId,\n optimisticResponse,\n });\n\n self.broadcastQueries();\n\n if (error) {\n reject(error);\n return;\n }\n\n // allow for conditional refetches\n // XXX do we want to make this the only API one day?\n if (typeof refetchQueries === 'function') {\n refetchQueries = refetchQueries(storeResult!);\n }\n\n const refetchQueryPromises: Promise<\n ApolloQueryResult[] | ApolloQueryResult<{}>\n >[] = [];\n\n if (isNonEmptyArray(refetchQueries)) {\n refetchQueries.forEach(refetchQuery => {\n if (typeof refetchQuery === 'string') {\n self.queries.forEach(({ observableQuery }) => {\n if (\n observableQuery &&\n observableQuery.queryName === refetchQuery\n ) {\n refetchQueryPromises.push(observableQuery.refetch());\n }\n });\n } else {\n const queryOptions: QueryOptions = {\n query: refetchQuery.query,\n variables: refetchQuery.variables,\n fetchPolicy: 'network-only',\n };\n\n if (refetchQuery.context) {\n queryOptions.context = refetchQuery.context;\n }\n\n refetchQueryPromises.push(self.query(queryOptions));\n }\n });\n }\n\n Promise.all(\n awaitRefetchQueries ? refetchQueryPromises : [],\n ).then(() => {\n self.setQuery(mutationId, () => ({ document: null }));\n\n if (\n errorPolicy === 'ignore' &&\n storeResult &&\n graphQLResultHasError(storeResult)\n ) {\n delete storeResult.errors;\n }\n\n resolve(storeResult!);\n });\n },\n });\n });\n }\n\n public async fetchQuery(\n queryId: string,\n options: WatchQueryOptions,\n fetchType?: FetchType,\n // This allows us to track if this is a query spawned by a `fetchMore`\n // call for another query. We need this data to compute the `fetchMore`\n // network status for the query this is fetching for.\n fetchMoreForQueryId?: string,\n ): Promise> {\n const {\n metadata = null,\n fetchPolicy = 'cache-first', // cache-first is the default fetch policy.\n context = {},\n } = options;\n\n const query = this.transform(options.query).document;\n\n let variables = this.getVariables(query, options.variables);\n\n if (this.transform(query).hasClientExports) {\n variables = await this.localState.addExportedVariables(query, variables, context);\n }\n\n options = { ...options, variables };\n\n let storeResult: any;\n const isNetworkOnly =\n fetchPolicy === 'network-only' || fetchPolicy === 'no-cache';\n let needToFetch = isNetworkOnly;\n\n // Unless we are completely skipping the cache, we want to diff the query\n // against the cache before we fetch it from the network interface.\n if (!isNetworkOnly) {\n const { complete, result } = this.dataStore.getCache().diff({\n query,\n variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n // If we're in here, only fetch if we have missing fields\n needToFetch = !complete || fetchPolicy === 'cache-and-network';\n storeResult = result;\n }\n\n let shouldFetch =\n needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby';\n\n // we need to check to see if this is an operation that uses the @live directive\n if (hasDirectives(['live'], query)) shouldFetch = true;\n\n const requestId = this.idCounter++;\n\n // set up a watcher to listen to cache updates\n const cancel = fetchPolicy !== 'no-cache'\n ? this.updateQueryWatch(queryId, query, options)\n : undefined;\n\n // Initialize query in store with unique requestId\n this.setQuery(queryId, () => ({\n document: query,\n lastRequestId: requestId,\n invalidated: true,\n cancel,\n }));\n\n this.invalidate(fetchMoreForQueryId);\n\n this.queryStore.initQuery({\n queryId,\n document: query,\n storePreviousVariables: shouldFetch,\n variables,\n isPoll: fetchType === FetchType.poll,\n isRefetch: fetchType === FetchType.refetch,\n metadata,\n fetchMoreForQueryId,\n });\n\n this.broadcastQueries();\n\n if (shouldFetch) {\n const networkResult = this.fetchRequest({\n requestId,\n queryId,\n document: query,\n options,\n fetchMoreForQueryId,\n }).catch(error => {\n // This is for the benefit of `refetch` promises, which currently don't get their errors\n // through the store like watchQuery observers do\n if (isApolloError(error)) {\n throw error;\n } else {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n this.broadcastQueries();\n }\n throw new ApolloError({ networkError: error });\n }\n });\n\n // we don't return the promise for cache-and-network since it is already\n // returned below from the cache\n if (fetchPolicy !== 'cache-and-network') {\n return networkResult;\n }\n\n // however we need to catch the error so it isn't unhandled in case of\n // network error\n networkResult.catch(() => {});\n }\n\n // If there is no part of the query we need to fetch from the server (or,\n // fetchPolicy is cache-only), we just write the store result as the final result.\n this.queryStore.markQueryResultClient(queryId, !shouldFetch);\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n if (this.transform(query).hasForcedResolvers) {\n return this.localState.runResolvers({\n document: query,\n remoteResult: { data: storeResult },\n context,\n variables,\n onlyRunForcedResolvers: true,\n }).then((result: FetchResult) => {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n this.broadcastQueries();\n return result;\n });\n }\n\n this.broadcastQueries();\n\n // If we have no query to send to the server, we should return the result\n // found within the store.\n return { data: storeResult };\n }\n\n private markQueryResult(\n queryId: string,\n result: FetchResult,\n {\n fetchPolicy,\n variables,\n errorPolicy,\n }: WatchQueryOptions,\n fetchMoreForQueryId?: string,\n ) {\n if (fetchPolicy === 'no-cache') {\n this.setQuery(queryId, () => ({\n newData: { result: result.data, complete: true },\n }));\n } else {\n this.dataStore.markQueryResult(\n result,\n this.getQuery(queryId).document!,\n variables,\n fetchMoreForQueryId,\n errorPolicy === 'ignore' || errorPolicy === 'all',\n );\n }\n }\n\n // Returns a query listener that will update the given observer based on the\n // results (or lack thereof) for a particular query.\n public queryListenerForObserver(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ): QueryListener {\n function invoke(method: 'next' | 'error', argument: any) {\n if (observer[method]) {\n try {\n observer[method]!(argument);\n } catch (e) {\n invariant.error(e);\n }\n } else if (method === 'error') {\n invariant.error(argument);\n }\n }\n\n return (\n queryStoreValue: QueryStoreValue,\n newData?: Cache.DiffResult,\n ) => {\n // we're going to take a look at the data, so the query is no longer invalidated\n this.invalidate(queryId, false);\n\n // The query store value can be undefined in the event of a store\n // reset.\n if (!queryStoreValue) return;\n\n const { observableQuery, document } = this.getQuery(queryId);\n\n const fetchPolicy = observableQuery\n ? observableQuery.options.fetchPolicy\n : options.fetchPolicy;\n\n // don't watch the store for queries on standby\n if (fetchPolicy === 'standby') return;\n\n const loading = isNetworkRequestInFlight(queryStoreValue.networkStatus);\n const lastResult = observableQuery && observableQuery.getLastResult();\n\n const networkStatusChanged = !!(\n lastResult &&\n lastResult.networkStatus !== queryStoreValue.networkStatus\n );\n\n const shouldNotifyIfLoading =\n options.returnPartialData ||\n (!newData && queryStoreValue.previousVariables) ||\n (networkStatusChanged && options.notifyOnNetworkStatusChange) ||\n fetchPolicy === 'cache-only' ||\n fetchPolicy === 'cache-and-network';\n\n if (loading && !shouldNotifyIfLoading) {\n return;\n }\n\n const hasGraphQLErrors = isNonEmptyArray(queryStoreValue.graphQLErrors);\n\n const errorPolicy: ErrorPolicy = observableQuery\n && observableQuery.options.errorPolicy\n || options.errorPolicy\n || 'none';\n\n // If we have either a GraphQL error or a network error, we create\n // an error and tell the observer about it.\n if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) {\n return invoke('error', new ApolloError({\n graphQLErrors: queryStoreValue.graphQLErrors,\n networkError: queryStoreValue.networkError,\n }));\n }\n\n try {\n let data: any;\n let isMissing: boolean;\n\n if (newData) {\n // As long as we're using the cache, clear out the latest\n // `newData`, since it will now become the current data. We need\n // to keep the `newData` stored with the query when using\n // `no-cache` since `getCurrentQueryResult` attemps to pull from\n // `newData` first, following by trying the cache (which won't\n // find a hit for `no-cache`).\n if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') {\n this.setQuery(queryId, () => ({ newData: null }));\n }\n\n data = newData.result;\n isMissing = !newData.complete;\n } else {\n const lastError = observableQuery && observableQuery.getLastError();\n const errorStatusChanged =\n errorPolicy !== 'none' &&\n (lastError && lastError.graphQLErrors) !==\n queryStoreValue.graphQLErrors;\n\n if (lastResult && lastResult.data && !errorStatusChanged) {\n data = lastResult.data;\n isMissing = false;\n } else {\n const diffResult = this.dataStore.getCache().diff({\n query: document as DocumentNode,\n variables:\n queryStoreValue.previousVariables ||\n queryStoreValue.variables,\n returnPartialData: true,\n optimistic: true,\n });\n\n data = diffResult.result;\n isMissing = !diffResult.complete;\n }\n }\n\n // If there is some data missing and the user has told us that they\n // do not tolerate partial data then we want to return the previous\n // result and mark it as stale.\n const stale = isMissing && !(\n options.returnPartialData ||\n fetchPolicy === 'cache-only'\n );\n\n const resultFromStore: ApolloQueryResult = {\n data: stale ? lastResult && lastResult.data : data,\n loading,\n networkStatus: queryStoreValue.networkStatus,\n stale,\n };\n\n // if the query wants updates on errors we need to add it to the result\n if (errorPolicy === 'all' && hasGraphQLErrors) {\n resultFromStore.errors = queryStoreValue.graphQLErrors;\n }\n\n invoke('next', resultFromStore);\n\n } catch (networkError) {\n invoke('error', new ApolloError({ networkError }));\n }\n };\n }\n\n private transformCache = new (canUseWeakMap ? WeakMap : Map)<\n DocumentNode,\n Readonly<{\n document: Readonly;\n hasClientExports: boolean;\n hasForcedResolvers: boolean;\n clientQuery: Readonly | null;\n serverQuery: Readonly | null;\n defaultVars: Readonly;\n }>\n >();\n\n public transform(document: DocumentNode) {\n const { transformCache } = this;\n\n if (!transformCache.has(document)) {\n const cache = this.dataStore.getCache();\n const transformed = cache.transformDocument(document);\n const forLink = removeConnectionDirectiveFromDocument(\n cache.transformForLink(transformed));\n\n const clientQuery = this.localState.clientQuery(transformed);\n const serverQuery = this.localState.serverQuery(forLink);\n\n const cacheEntry = {\n document: transformed,\n // TODO These two calls (hasClientExports and shouldForceResolvers)\n // could probably be merged into a single traversal.\n hasClientExports: hasClientExports(transformed),\n hasForcedResolvers: this.localState.shouldForceResolvers(transformed),\n clientQuery,\n serverQuery,\n defaultVars: getDefaultValues(\n getOperationDefinition(transformed)\n ) as OperationVariables,\n };\n\n const add = (doc: DocumentNode | null) => {\n if (doc && !transformCache.has(doc)) {\n transformCache.set(doc, cacheEntry);\n }\n }\n // Add cacheEntry to the transformCache using several different keys,\n // since any one of these documents could end up getting passed to the\n // transform method again in the future.\n add(document);\n add(transformed);\n add(clientQuery);\n add(serverQuery);\n }\n\n return transformCache.get(document)!;\n }\n\n private getVariables(\n document: DocumentNode,\n variables?: OperationVariables,\n ): OperationVariables {\n return {\n ...this.transform(document).defaultVars,\n ...variables,\n };\n }\n\n // The shouldSubscribe option is a temporary fix that tells us whether watchQuery was called\n // directly (i.e. through ApolloClient) or through the query method within QueryManager.\n // Currently, the query method uses watchQuery in order to handle non-network errors correctly\n // but we don't want to keep track observables issued for the query method since those aren't\n // supposed to be refetched in the event of a store reset. Once we unify error handling for\n // network errors and non-network errors, the shouldSubscribe option will go away.\n\n public watchQuery(\n options: WatchQueryOptions,\n shouldSubscribe = true,\n ): ObservableQuery {\n invariant(\n options.fetchPolicy !== 'standby',\n 'client.watchQuery cannot be called with fetchPolicy set to \"standby\"',\n );\n\n // assign variable default values if supplied\n options.variables = this.getVariables(options.query, options.variables);\n\n if (typeof options.notifyOnNetworkStatusChange === 'undefined') {\n options.notifyOnNetworkStatusChange = false;\n }\n\n let transformedOptions = { ...options } as WatchQueryOptions;\n\n return new ObservableQuery({\n queryManager: this,\n options: transformedOptions,\n shouldSubscribe: shouldSubscribe,\n });\n }\n\n public query(options: QueryOptions): Promise> {\n invariant(\n options.query,\n 'query option is required. You must specify your GraphQL document ' +\n 'in the query option.',\n );\n\n invariant(\n options.query.kind === 'Document',\n 'You must wrap the query string in a \"gql\" tag.',\n );\n\n invariant(\n !(options as any).returnPartialData,\n 'returnPartialData option only supported on watchQuery.',\n );\n\n invariant(\n !(options as any).pollInterval,\n 'pollInterval option only supported on watchQuery.',\n );\n\n return new Promise>((resolve, reject) => {\n const watchedQuery = this.watchQuery(options, false);\n this.fetchQueryRejectFns.set(`query:${watchedQuery.queryId}`, reject);\n watchedQuery\n .result()\n .then(resolve, reject)\n // Since neither resolve nor reject throw or return a value, this .then\n // handler is guaranteed to execute. Note that it doesn't really matter\n // when we remove the reject function from this.fetchQueryRejectFns,\n // since resolve and reject are mutually idempotent. In fact, it would\n // not be incorrect to let reject functions accumulate over time; it's\n // just a waste of memory.\n .then(() =>\n this.fetchQueryRejectFns.delete(`query:${watchedQuery.queryId}`),\n );\n });\n }\n\n public generateQueryId() {\n return String(this.idCounter++);\n }\n\n public stopQueryInStore(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryInStoreNoBroadcast(queryId: string) {\n this.stopPollingQuery(queryId);\n this.queryStore.stopQuery(queryId);\n this.invalidate(queryId);\n }\n\n public addQueryListener(queryId: string, listener: QueryListener) {\n this.setQuery(queryId, ({ listeners }) => {\n listeners.add(listener);\n return { invalidated: false };\n });\n }\n\n public updateQueryWatch(\n queryId: string,\n document: DocumentNode,\n options: WatchQueryOptions,\n ) {\n const { cancel } = this.getQuery(queryId);\n if (cancel) cancel();\n const previousResult = () => {\n let previousResult = null;\n const { observableQuery } = this.getQuery(queryId);\n if (observableQuery) {\n const lastResult = observableQuery.getLastResult();\n if (lastResult) {\n previousResult = lastResult.data;\n }\n }\n\n return previousResult;\n };\n return this.dataStore.getCache().watch({\n query: document as DocumentNode,\n variables: options.variables,\n optimistic: true,\n previousResult,\n callback: newData => {\n this.setQuery(queryId, () => ({ invalidated: true, newData }));\n },\n });\n }\n\n // Adds an ObservableQuery to this.observableQueries and to this.observableQueriesByName.\n public addObservableQuery(\n queryId: string,\n observableQuery: ObservableQuery,\n ) {\n this.setQuery(queryId, () => ({ observableQuery }));\n }\n\n public removeObservableQuery(queryId: string) {\n const { cancel } = this.getQuery(queryId);\n this.setQuery(queryId, () => ({ observableQuery: null }));\n if (cancel) cancel();\n }\n\n public clearStore(): Promise {\n // Before we have sent the reset action to the store,\n // we can no longer rely on the results returned by in-flight\n // requests since these may depend on values that previously existed\n // in the data portion of the store. So, we cancel the promises and observers\n // that we have issued so far and not yet resolved (in the case of\n // queries).\n this.fetchQueryRejectFns.forEach(reject => {\n reject(new InvariantError(\n 'Store reset while query was in flight (not completed in link chain)',\n ));\n });\n\n const resetIds: string[] = [];\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) resetIds.push(queryId);\n });\n\n this.queryStore.reset(resetIds);\n this.mutationStore.reset();\n\n // begin removing data from the store\n return this.dataStore.reset();\n }\n\n public resetStore(): Promise[]> {\n // Similarly, we have to have to refetch each of the queries currently being\n // observed. We refetch instead of error'ing on these since the assumption is that\n // resetting the store doesn't eliminate the need for the queries currently being\n // watched. If there is an existing query in flight when the store is reset,\n // the promise for it will be rejected and its results will not be written to the\n // store.\n return this.clearStore().then(() => {\n return this.reFetchObservableQueries();\n });\n }\n\n public reFetchObservableQueries(\n includeStandby: boolean = false,\n ): Promise[]> {\n const observableQueryPromises: Promise>[] = [];\n\n this.queries.forEach(({ observableQuery }, queryId) => {\n if (observableQuery) {\n const fetchPolicy = observableQuery.options.fetchPolicy;\n\n observableQuery.resetLastResults();\n if (\n fetchPolicy !== 'cache-only' &&\n (includeStandby || fetchPolicy !== 'standby')\n ) {\n observableQueryPromises.push(observableQuery.refetch());\n }\n\n this.setQuery(queryId, () => ({ newData: null }));\n this.invalidate(queryId);\n }\n });\n\n this.broadcastQueries();\n\n return Promise.all(observableQueryPromises);\n }\n\n public observeQuery(\n queryId: string,\n options: WatchQueryOptions,\n observer: Observer>,\n ) {\n this.addQueryListener(\n queryId,\n this.queryListenerForObserver(queryId, options, observer),\n );\n return this.fetchQuery(queryId, options);\n }\n\n public startQuery(\n queryId: string,\n options: WatchQueryOptions,\n listener: QueryListener,\n ) {\n invariant.warn(\"The QueryManager.startQuery method has been deprecated\");\n\n this.addQueryListener(queryId, listener);\n\n this.fetchQuery(queryId, options)\n // `fetchQuery` returns a Promise. In case of a failure it should be caucht or else the\n // console will show an `Uncaught (in promise)` message. Ignore the error for now.\n .catch(() => undefined);\n\n return queryId;\n }\n\n public startGraphQLSubscription({\n query,\n fetchPolicy,\n variables,\n }: SubscriptionOptions): Observable> {\n query = this.transform(query).document;\n variables = this.getVariables(query, variables);\n\n const makeObservable = (variables: OperationVariables) =>\n this.getObservableFromLink(\n query,\n {},\n variables,\n false,\n ).map(result => {\n if (!fetchPolicy || fetchPolicy !== 'no-cache') {\n this.dataStore.markSubscriptionResult(\n result,\n query,\n variables,\n );\n this.broadcastQueries();\n }\n\n if (graphQLResultHasError(result)) {\n throw new ApolloError({\n graphQLErrors: result.errors,\n });\n }\n\n return result;\n });\n\n if (this.transform(query).hasClientExports) {\n const observablePromise = this.localState.addExportedVariables(\n query,\n variables,\n ).then(makeObservable);\n\n return new Observable>(observer => {\n let sub: Subscription | null = null;\n observablePromise.then(\n observable => sub = observable.subscribe(observer),\n observer.error,\n );\n return () => sub && sub.unsubscribe();\n });\n }\n\n return makeObservable(variables);\n }\n\n public stopQuery(queryId: string) {\n this.stopQueryNoBroadcast(queryId);\n this.broadcastQueries();\n }\n\n private stopQueryNoBroadcast(queryId: string) {\n this.stopQueryInStoreNoBroadcast(queryId);\n this.removeQuery(queryId);\n }\n\n public removeQuery(queryId: string) {\n // teardown all links\n // Both `QueryManager.fetchRequest` and `QueryManager.query` create separate promises\n // that each add their reject functions to fetchQueryRejectFns.\n // A query created with `QueryManager.query()` could trigger a `QueryManager.fetchRequest`.\n // The same queryId could have two rejection fns for two promises\n this.fetchQueryRejectFns.delete(`query:${queryId}`);\n this.fetchQueryRejectFns.delete(`fetchRequest:${queryId}`);\n this.getQuery(queryId).subscriptions.forEach(x => x.unsubscribe());\n this.queries.delete(queryId);\n }\n\n public getCurrentQueryResult(\n observableQuery: ObservableQuery,\n optimistic: boolean = true,\n ): {\n data: T | undefined;\n partial: boolean;\n } {\n const { variables, query, fetchPolicy, returnPartialData } = observableQuery.options;\n const lastResult = observableQuery.getLastResult();\n const { newData } = this.getQuery(observableQuery.queryId);\n\n if (newData && newData.complete) {\n return { data: newData.result, partial: false };\n }\n\n if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') {\n return { data: undefined, partial: false };\n }\n\n const { result, complete } = this.dataStore.getCache().diff({\n query,\n variables,\n previousResult: lastResult ? lastResult.data : undefined,\n returnPartialData: true,\n optimistic,\n });\n\n return {\n data: (complete || returnPartialData) ? result : void 0,\n partial: !complete,\n };\n }\n\n public getQueryWithPreviousResult(\n queryIdOrObservable: string | ObservableQuery,\n ): {\n previousResult: any;\n variables: TVariables | undefined;\n document: DocumentNode;\n } {\n let observableQuery: ObservableQuery;\n if (typeof queryIdOrObservable === 'string') {\n const { observableQuery: foundObserveableQuery } = this.getQuery(\n queryIdOrObservable,\n );\n invariant(\n foundObserveableQuery,\n `ObservableQuery with this id doesn't exist: ${queryIdOrObservable}`\n );\n observableQuery = foundObserveableQuery!;\n } else {\n observableQuery = queryIdOrObservable;\n }\n\n const { variables, query } = observableQuery.options;\n return {\n previousResult: this.getCurrentQueryResult(observableQuery, false).data,\n variables,\n document: query,\n };\n }\n\n public broadcastQueries() {\n this.onBroadcast();\n this.queries.forEach((info, id) => {\n if (info.invalidated) {\n info.listeners.forEach(listener => {\n // it's possible for the listener to be undefined if the query is being stopped\n // See here for more detail: https://github.com/apollostack/apollo-client/issues/231\n if (listener) {\n listener(this.queryStore.get(id), info.newData);\n }\n });\n }\n });\n }\n\n public getLocalState(): LocalState {\n return this.localState;\n }\n\n private inFlightLinkObservables = new Map<\n DocumentNode,\n Map>\n >();\n\n private getObservableFromLink(\n query: DocumentNode,\n context: any,\n variables?: OperationVariables,\n deduplication: boolean = this.queryDeduplication,\n ): Observable> {\n let observable: Observable>;\n\n const { serverQuery } = this.transform(query);\n if (serverQuery) {\n const { inFlightLinkObservables, link } = this;\n\n const operation = {\n query: serverQuery,\n variables,\n operationName: getOperationName(serverQuery) || void 0,\n context: this.prepareContext({\n ...context,\n forceFetch: !deduplication\n }),\n };\n\n context = operation.context;\n\n if (deduplication) {\n const byVariables = inFlightLinkObservables.get(serverQuery) || new Map();\n inFlightLinkObservables.set(serverQuery, byVariables);\n\n const varJson = JSON.stringify(variables);\n observable = byVariables.get(varJson);\n\n if (!observable) {\n byVariables.set(\n varJson,\n observable = multiplex(\n execute(link, operation) as Observable>\n )\n );\n\n const cleanup = () => {\n byVariables.delete(varJson);\n if (!byVariables.size) inFlightLinkObservables.delete(serverQuery);\n cleanupSub.unsubscribe();\n };\n\n const cleanupSub = observable.subscribe({\n next: cleanup,\n error: cleanup,\n complete: cleanup,\n });\n }\n\n } else {\n observable = multiplex(execute(link, operation) as Observable>);\n }\n } else {\n observable = Observable.of({ data: {} } as FetchResult);\n context = this.prepareContext(context);\n }\n\n const { clientQuery } = this.transform(query);\n if (clientQuery) {\n observable = asyncMap(observable, result => {\n return this.localState.runResolvers({\n document: clientQuery,\n remoteResult: result,\n context,\n variables,\n });\n });\n }\n\n return observable;\n }\n\n // Takes a request id, query id, a query document and information associated with the query\n // and send it to the network interface. Returns\n // a promise for the result associated with that request.\n private fetchRequest({\n requestId,\n queryId,\n document,\n options,\n fetchMoreForQueryId,\n }: {\n requestId: number;\n queryId: string;\n document: DocumentNode;\n options: WatchQueryOptions;\n fetchMoreForQueryId?: string;\n }): Promise> {\n const { variables, errorPolicy = 'none', fetchPolicy } = options;\n let resultFromStore: any;\n let errorsFromStore: any;\n\n return new Promise>((resolve, reject) => {\n const observable = this.getObservableFromLink(\n document,\n options.context,\n variables,\n );\n\n const fqrfId = `fetchRequest:${queryId}`;\n this.fetchQueryRejectFns.set(fqrfId, reject);\n\n const cleanup = () => {\n this.fetchQueryRejectFns.delete(fqrfId);\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.delete(subscription);\n });\n };\n\n const subscription = observable.map((result: FetchResult) => {\n if (requestId >= this.getQuery(queryId).lastRequestId) {\n this.markQueryResult(\n queryId,\n result,\n options,\n fetchMoreForQueryId,\n );\n\n this.queryStore.markQueryResult(\n queryId,\n result,\n fetchMoreForQueryId,\n );\n\n this.invalidate(queryId);\n this.invalidate(fetchMoreForQueryId);\n\n this.broadcastQueries();\n }\n\n if (errorPolicy === 'none' && isNonEmptyArray(result.errors)) {\n return reject(new ApolloError({\n graphQLErrors: result.errors,\n }));\n }\n\n if (errorPolicy === 'all') {\n errorsFromStore = result.errors;\n }\n\n if (fetchMoreForQueryId || fetchPolicy === 'no-cache') {\n // We don't write fetchMore results to the store because this would overwrite\n // the original result in case an @connection directive is used.\n resultFromStore = result.data;\n } else {\n // ensure result is combined with data already in store\n const { result, complete } = this.dataStore.getCache().diff({\n variables,\n query: document,\n optimistic: false,\n returnPartialData: true,\n });\n\n if (complete || options.returnPartialData) {\n resultFromStore = result;\n }\n }\n }).subscribe({\n error(error: ApolloError) {\n cleanup();\n reject(error);\n },\n\n complete() {\n cleanup();\n resolve({\n data: resultFromStore,\n errors: errorsFromStore,\n loading: false,\n networkStatus: NetworkStatus.ready,\n stale: false,\n });\n },\n });\n\n this.setQuery(queryId, ({ subscriptions }) => {\n subscriptions.add(subscription);\n });\n });\n }\n\n private getQuery(queryId: string) {\n return (\n this.queries.get(queryId) || {\n listeners: new Set(),\n invalidated: false,\n document: null,\n newData: null,\n lastRequestId: 1,\n observableQuery: null,\n subscriptions: new Set(),\n }\n );\n }\n\n private setQuery(\n queryId: string,\n updater: (prev: QueryInfo) => Pick | void,\n ) {\n const prev = this.getQuery(queryId);\n const newInfo = { ...prev, ...updater(prev) };\n this.queries.set(queryId, newInfo);\n }\n\n private invalidate(\n queryId: string | undefined,\n invalidated = true,\n ) {\n if (queryId) {\n this.setQuery(queryId, () => ({ invalidated }));\n }\n }\n\n private prepareContext(context = {}) {\n const newContext = this.localState.prepareContext(context);\n return {\n ...newContext,\n clientAwareness: this.clientAwareness,\n };\n }\n\n public checkInFlight(queryId: string) {\n const query = this.queryStore.get(queryId);\n\n return (\n query &&\n query.networkStatus !== NetworkStatus.ready &&\n query.networkStatus !== NetworkStatus.error\n );\n }\n\n // Map from client ID to { interval, options }.\n private pollingInfoByQueryId = new Map();\n\n public startPollingQuery(\n options: WatchQueryOptions,\n queryId: string,\n listener?: QueryListener,\n ): string {\n const { pollInterval } = options;\n\n invariant(\n pollInterval,\n 'Attempted to start a polling query without a polling interval.',\n );\n\n // Do not poll in SSR mode\n if (!this.ssrMode) {\n let info = this.pollingInfoByQueryId.get(queryId)!;\n if (!info) {\n this.pollingInfoByQueryId.set(queryId, (info = {} as any));\n }\n\n info.interval = pollInterval!;\n info.options = {\n ...options,\n fetchPolicy: 'network-only',\n };\n\n const maybeFetch = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n if (this.checkInFlight(queryId)) {\n poll();\n } else {\n this.fetchQuery(queryId, info.options, FetchType.poll).then(\n poll,\n poll,\n );\n }\n }\n };\n\n const poll = () => {\n const info = this.pollingInfoByQueryId.get(queryId);\n if (info) {\n clearTimeout(info.timeout);\n info.timeout = setTimeout(maybeFetch, info.interval);\n }\n };\n\n if (listener) {\n this.addQueryListener(queryId, listener);\n }\n\n poll();\n }\n\n return queryId;\n }\n\n public stopPollingQuery(queryId: string) {\n this.pollingInfoByQueryId.delete(queryId);\n }\n}\n","import { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, Cache, DataProxy } from 'apollo-cache';\n\nimport { QueryStoreValue } from '../data/queries';\nimport {\n getOperationName,\n tryFunctionOrLogError,\n graphQLResultHasError,\n} from 'apollo-utilities';\nimport { MutationQueryReducer } from '../core/types';\n\nexport type QueryWithUpdater = {\n updater: MutationQueryReducer;\n query: QueryStoreValue;\n};\n\nexport interface DataWrite {\n rootId: string;\n result: any;\n document: DocumentNode;\n operationName: string | null;\n variables: Object;\n}\n\nexport class DataStore {\n private cache: ApolloCache;\n\n constructor(initialCache: ApolloCache) {\n this.cache = initialCache;\n }\n\n public getCache(): ApolloCache {\n return this.cache;\n }\n\n public markQueryResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n fetchMoreForQueryId: string | undefined,\n ignoreErrors: boolean = false,\n ) {\n let writeWithErrors = !graphQLResultHasError(result);\n if (ignoreErrors && graphQLResultHasError(result) && result.data) {\n writeWithErrors = true;\n }\n if (!fetchMoreForQueryId && writeWithErrors) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_QUERY',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markSubscriptionResult(\n result: ExecutionResult,\n document: DocumentNode,\n variables: any,\n ) {\n // the subscription interface should handle not sending us results we no longer subscribe to.\n // XXX I don't think we ever send in an object with errors, but we might in the future...\n if (!graphQLResultHasError(result)) {\n this.cache.write({\n result: result.data,\n dataId: 'ROOT_SUBSCRIPTION',\n query: document,\n variables: variables,\n });\n }\n }\n\n public markMutationInit(mutation: {\n mutationId: string;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n optimisticResponse: Object | Function | undefined;\n }) {\n if (mutation.optimisticResponse) {\n let optimistic: Object;\n if (typeof mutation.optimisticResponse === 'function') {\n optimistic = mutation.optimisticResponse(mutation.variables);\n } else {\n optimistic = mutation.optimisticResponse;\n }\n\n this.cache.recordOptimisticTransaction(c => {\n const orig = this.cache;\n this.cache = c;\n\n try {\n this.markMutationResult({\n mutationId: mutation.mutationId,\n result: { data: optimistic },\n document: mutation.document,\n variables: mutation.variables,\n updateQueries: mutation.updateQueries,\n update: mutation.update,\n });\n } finally {\n this.cache = orig;\n }\n }, mutation.mutationId);\n }\n }\n\n public markMutationResult(mutation: {\n mutationId: string;\n result: ExecutionResult;\n document: DocumentNode;\n variables: any;\n updateQueries: { [queryId: string]: QueryWithUpdater };\n update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined;\n }) {\n // Incorporate the result from this mutation into the store\n if (!graphQLResultHasError(mutation.result)) {\n const cacheWrites: Cache.WriteOptions[] = [{\n result: mutation.result.data,\n dataId: 'ROOT_MUTATION',\n query: mutation.document,\n variables: mutation.variables,\n }];\n\n const { updateQueries } = mutation;\n if (updateQueries) {\n Object.keys(updateQueries).forEach(id => {\n const { query, updater } = updateQueries[id];\n\n // Read the current query result from the store.\n const { result: currentQueryResult, complete } = this.cache.diff({\n query: query.document,\n variables: query.variables,\n returnPartialData: true,\n optimistic: false,\n });\n\n if (complete) {\n // Run our reducer using the current query result and the mutation result.\n const nextQueryResult = tryFunctionOrLogError(() =>\n updater(currentQueryResult, {\n mutationResult: mutation.result,\n queryName: getOperationName(query.document) || undefined,\n queryVariables: query.variables,\n }),\n );\n\n // Write the modified result back into the store if we got a new result.\n if (nextQueryResult) {\n cacheWrites.push({\n result: nextQueryResult,\n dataId: 'ROOT_QUERY',\n query: query.document,\n variables: query.variables,\n });\n }\n }\n });\n }\n\n this.cache.performTransaction(c => {\n cacheWrites.forEach(write => c.write(write));\n\n // If the mutation has some writes associated with it then we need to\n // apply those writes to the store by running this reducer again with a\n // write action.\n const { update } = mutation;\n if (update) {\n tryFunctionOrLogError(() => update(c, mutation.result));\n }\n });\n }\n }\n\n public markMutationComplete({\n mutationId,\n optimisticResponse,\n }: {\n mutationId: string;\n optimisticResponse?: any;\n }) {\n if (optimisticResponse) {\n this.cache.removeOptimistic(mutationId);\n }\n }\n\n public markUpdateQueryResult(\n document: DocumentNode,\n variables: any,\n newResult: any,\n ) {\n this.cache.write({\n result: newResult,\n dataId: 'ROOT_QUERY',\n variables,\n query: document,\n });\n }\n\n public reset(): Promise {\n return this.cache.reset();\n }\n}\n","export const version = \"2.6.10\"","import {\n ApolloLink,\n FetchResult,\n GraphQLRequest,\n execute,\n} from 'apollo-link';\nimport { ExecutionResult, DocumentNode } from 'graphql';\nimport { ApolloCache, DataProxy } from 'apollo-cache';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { QueryManager } from './core/QueryManager';\nimport {\n ApolloQueryResult,\n OperationVariables,\n Resolvers,\n} from './core/types';\nimport { ObservableQuery } from './core/ObservableQuery';\nimport { LocalState, FragmentMatcher } from './core/LocalState';\nimport { Observable } from './util/Observable';\n\nimport {\n QueryOptions,\n WatchQueryOptions,\n SubscriptionOptions,\n MutationOptions,\n WatchQueryFetchPolicy,\n} from './core/watchQueryOptions';\n\nimport { DataStore } from './data/store';\n\nimport { version } from './version';\n\nexport interface DefaultOptions {\n watchQuery?: Partial;\n query?: Partial;\n mutate?: Partial;\n}\n\nlet hasSuggestedDevtools = false;\n\nexport type ApolloClientOptions = {\n link?: ApolloLink;\n cache: ApolloCache;\n ssrForceFetchDelay?: number;\n ssrMode?: boolean;\n connectToDevTools?: boolean;\n queryDeduplication?: boolean;\n defaultOptions?: DefaultOptions;\n assumeImmutableResults?: boolean;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: FragmentMatcher;\n name?: string;\n version?: string;\n};\n\n/**\n * This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries\n * and mutations) to a GraphQL spec-compliant server over a {@link NetworkInterface} instance,\n * receive results from the server and cache the results in a store. It also delivers updates\n * to GraphQL queries through {@link Observable} instances.\n */\nexport default class ApolloClient implements DataProxy {\n public link: ApolloLink;\n public store: DataStore;\n public cache: ApolloCache;\n public readonly queryManager: QueryManager;\n public disableNetworkFetches: boolean;\n public version: string;\n public queryDeduplication: boolean;\n public defaultOptions: DefaultOptions = {};\n public readonly typeDefs: ApolloClientOptions['typeDefs'];\n\n private devToolsHookCb: Function;\n private resetStoreCallbacks: Array<() => Promise> = [];\n private clearStoreCallbacks: Array<() => Promise> = [];\n private localState: LocalState;\n\n /**\n * Constructs an instance of {@link ApolloClient}.\n *\n * @param link The {@link ApolloLink} over which GraphQL documents will be resolved into a response.\n *\n * @param cache The initial cache to use in the data store.\n *\n * @param ssrMode Determines whether this is being run in Server Side Rendering (SSR) mode.\n *\n * @param ssrForceFetchDelay Determines the time interval before we force fetch queries for a\n * server side render.\n *\n * @param queryDeduplication If set to false, a query will still be sent to the server even if a query\n * with identical parameters (query, variables, operationName) is already in flight.\n *\n * @param defaultOptions Used to set application wide defaults for the\n * options supplied to `watchQuery`, `query`, or\n * `mutate`.\n *\n * @param assumeImmutableResults When this option is true, the client will assume results\n * read from the cache are never mutated by application code,\n * which enables substantial performance optimizations. Passing\n * `{ freezeResults: true }` to the `InMemoryCache` constructor\n * can help enforce this immutability.\n *\n * @param name A custom name that can be used to identify this client, when\n * using Apollo client awareness features. E.g. \"iOS\".\n *\n * @param version A custom version that can be used to identify this client,\n * when using Apollo client awareness features. This is the\n * version of your client, which you may want to increment on\n * new builds. This is NOT the version of Apollo Client that\n * you are using.\n */\n constructor(options: ApolloClientOptions) {\n const {\n cache,\n ssrMode = false,\n ssrForceFetchDelay = 0,\n connectToDevTools,\n queryDeduplication = true,\n defaultOptions,\n assumeImmutableResults = false,\n resolvers,\n typeDefs,\n fragmentMatcher,\n name: clientAwarenessName,\n version: clientAwarenessVersion,\n } = options;\n\n let { link } = options;\n\n // If a link hasn't been defined, but local state resolvers have been set,\n // setup a default empty link.\n if (!link && resolvers) {\n link = ApolloLink.empty();\n }\n\n if (!link || !cache) {\n throw new InvariantError(\n \"In order to initialize Apollo Client, you must specify 'link' and 'cache' properties in the options object.\\n\" +\n \"These options are part of the upgrade requirements when migrating from Apollo Client 1.x to Apollo Client 2.x.\\n\" +\n \"For more information, please visit: https://www.apollographql.com/docs/tutorial/client.html#apollo-client-setup\"\n );\n }\n\n // remove apollo-client supported directives\n this.link = link;\n this.cache = cache;\n this.store = new DataStore(cache);\n this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;\n this.queryDeduplication = queryDeduplication;\n this.defaultOptions = defaultOptions || {};\n this.typeDefs = typeDefs;\n\n if (ssrForceFetchDelay) {\n setTimeout(\n () => (this.disableNetworkFetches = false),\n ssrForceFetchDelay,\n );\n }\n\n this.watchQuery = this.watchQuery.bind(this);\n this.query = this.query.bind(this);\n this.mutate = this.mutate.bind(this);\n this.resetStore = this.resetStore.bind(this);\n this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);\n\n // Attach the client instance to window to let us be found by chrome devtools, but only in\n // development mode\n const defaultConnectToDevTools =\n process.env.NODE_ENV !== 'production' &&\n typeof window !== 'undefined' &&\n !(window as any).__APOLLO_CLIENT__;\n\n if (\n typeof connectToDevTools === 'undefined'\n ? defaultConnectToDevTools\n : connectToDevTools && typeof window !== 'undefined'\n ) {\n (window as any).__APOLLO_CLIENT__ = this;\n }\n\n /**\n * Suggest installing the devtools for developers who don't have them\n */\n if (!hasSuggestedDevtools && process.env.NODE_ENV !== 'production') {\n hasSuggestedDevtools = true;\n if (\n typeof window !== 'undefined' &&\n window.document &&\n window.top === window.self\n ) {\n // First check if devtools is not installed\n if (\n typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined'\n ) {\n // Only for Chrome\n if (\n window.navigator &&\n window.navigator.userAgent &&\n window.navigator.userAgent.indexOf('Chrome') > -1\n ) {\n // tslint:disable-next-line\n console.debug(\n 'Download the Apollo DevTools ' +\n 'for a better development experience: ' +\n 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm',\n );\n }\n }\n }\n }\n\n this.version = version;\n\n this.localState = new LocalState({\n cache,\n client: this,\n resolvers,\n fragmentMatcher,\n });\n\n this.queryManager = new QueryManager({\n link: this.link,\n store: this.store,\n queryDeduplication,\n ssrMode,\n clientAwareness: {\n name: clientAwarenessName!,\n version: clientAwarenessVersion!,\n },\n localState: this.localState,\n assumeImmutableResults,\n onBroadcast: () => {\n if (this.devToolsHookCb) {\n this.devToolsHookCb({\n action: {},\n state: {\n queries: this.queryManager.queryStore.getStore(),\n mutations: this.queryManager.mutationStore.getStore(),\n },\n dataWithOptimisticResults: this.cache.extract(true),\n });\n }\n },\n });\n }\n\n /**\n * Call this method to terminate any active client processes, making it safe\n * to dispose of this `ApolloClient` instance.\n */\n public stop() {\n this.queryManager.stop();\n }\n\n /**\n * This watches the cache store of the query according to the options specified and\n * returns an {@link ObservableQuery}. We can subscribe to this {@link ObservableQuery} and\n * receive updated results through a GraphQL observer when the cache store changes.\n *

\n * Note that this method is not an implementation of GraphQL subscriptions. Rather,\n * it uses Apollo's store in order to reactively deliver updates to your query results.\n *

\n * For example, suppose you call watchQuery on a GraphQL query that fetches a person's\n * first and last name and this person has a particular object identifer, provided by\n * dataIdFromObject. Later, a different query fetches that same person's\n * first and last name and the first name has now changed. Then, any observers associated\n * with the results of the first query will be updated with a new result object.\n *

\n * Note that if the cache does not change, the subscriber will *not* be notified.\n *

\n * See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for\n * a description of store reactivity.\n */\n public watchQuery(\n options: WatchQueryOptions,\n ): ObservableQuery {\n if (this.defaultOptions.watchQuery) {\n options = {\n ...this.defaultOptions.watchQuery,\n ...options,\n } as WatchQueryOptions;\n }\n\n // XXX Overwriting options is probably not the best way to do this long term...\n if (\n this.disableNetworkFetches &&\n (options.fetchPolicy === 'network-only' ||\n options.fetchPolicy === 'cache-and-network')\n ) {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.watchQuery(options);\n }\n\n /**\n * This resolves a single query according to the options specified and\n * returns a {@link Promise} which is either resolved with the resulting data\n * or rejected with an error.\n *\n * @param options An object of type {@link QueryOptions} that allows us to\n * describe how this query should be treated e.g. whether it should hit the\n * server at all or just resolve from the cache, etc.\n */\n public query(\n options: QueryOptions,\n ): Promise> {\n if (this.defaultOptions.query) {\n options = { ...this.defaultOptions.query, ...options } as QueryOptions<\n TVariables\n >;\n }\n\n invariant(\n (options.fetchPolicy as WatchQueryFetchPolicy) !== 'cache-and-network',\n 'The cache-and-network fetchPolicy does not work with client.query, because ' +\n 'client.query can only return a single result. Please use client.watchQuery ' +\n 'to receive multiple results from the cache and the network, or consider ' +\n 'using a different fetchPolicy, such as cache-first or network-only.'\n );\n\n if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {\n options = { ...options, fetchPolicy: 'cache-first' };\n }\n\n return this.queryManager.query(options);\n }\n\n /**\n * This resolves a single mutation according to the options specified and returns a\n * {@link Promise} which is either resolved with the resulting data or rejected with an\n * error.\n *\n * It takes options as an object with the following keys and values:\n */\n public mutate(\n options: MutationOptions,\n ): Promise> {\n if (this.defaultOptions.mutate) {\n options = {\n ...this.defaultOptions.mutate,\n ...options,\n } as MutationOptions;\n }\n\n return this.queryManager.mutate(options);\n }\n\n /**\n * This subscribes to a graphql subscription according to the options specified and returns an\n * {@link Observable} which either emits received data or an error.\n */\n public subscribe(\n options: SubscriptionOptions,\n ): Observable> {\n return this.queryManager.startGraphQLSubscription(options);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL query without making a network request. This method will start at\n * the root query. To start at a specific id returned by `dataIdFromObject`\n * use `readFragment`.\n *\n * @param optimistic Set to `true` to allow `readQuery` to return\n * optimistic results. Is `false` by default.\n */\n public readQuery(\n options: DataProxy.Query,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readQuery(options, optimistic);\n }\n\n /**\n * Tries to read some data from the store in the shape of the provided\n * GraphQL fragment without making a network request. This method will read a\n * GraphQL fragment from any arbitrary id that is currently cached, unlike\n * `readQuery` which will only read from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are reading. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n *\n * @param optimistic Set to `true` to allow `readFragment` to return\n * optimistic results. Is `false` by default.\n */\n public readFragment(\n options: DataProxy.Fragment,\n optimistic: boolean = false,\n ): T | null {\n return this.cache.readFragment(options, optimistic);\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL query directly to\n * the store. This method will start at the root query. To start at a\n * specific id returned by `dataIdFromObject` then use `writeFragment`.\n */\n public writeQuery(\n options: DataProxy.WriteQueryOptions,\n ): void {\n const result = this.cache.writeQuery(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Writes some data in the shape of the provided GraphQL fragment directly to\n * the store. This method will write to a GraphQL fragment from any arbitrary\n * id that is currently cached, unlike `writeQuery` which will only write\n * from the root query.\n *\n * You must pass in a GraphQL document with a single fragment or a document\n * with multiple fragments that represent what you are writing. If you pass\n * in a document with multiple fragments then you must also specify a\n * `fragmentName`.\n */\n public writeFragment(\n options: DataProxy.WriteFragmentOptions,\n ): void {\n const result = this.cache.writeFragment(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n /**\n * Sugar for writeQuery & writeFragment\n * This method will construct a query from the data object passed in.\n * If no id is supplied, writeData will write the data to the root.\n * If an id is supplied, writeData will write a fragment to the object\n * specified by the id in the store.\n *\n * Since you aren't passing in a query to check the shape of the data,\n * you must pass in an object that conforms to the shape of valid GraphQL data.\n */\n public writeData(\n options: DataProxy.WriteDataOptions,\n ): void {\n const result = this.cache.writeData(options);\n this.queryManager.broadcastQueries();\n return result;\n }\n\n public __actionHookForDevTools(cb: () => any) {\n this.devToolsHookCb = cb;\n }\n\n public __requestRaw(payload: GraphQLRequest): Observable {\n return execute(this.link, payload);\n }\n\n /**\n * This initializes the query manager that tracks queries and the cache\n */\n public initQueryManager(): QueryManager {\n invariant.warn(\n 'Calling the initQueryManager method is no longer necessary, ' +\n 'and it will be removed from ApolloClient in version 3.0.',\n );\n return this.queryManager;\n }\n\n /**\n * Resets your entire store by clearing out your cache and then re-executing\n * all of your active queries. This makes it so that you may guarantee that\n * there is no data left in your store from a time before you called this\n * method.\n *\n * `resetStore()` is useful when your user just logged out. You’ve removed the\n * user session, and you now want to make sure that any references to data you\n * might have fetched while the user session was active is gone.\n *\n * It is important to remember that `resetStore()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n */\n public resetStore(): Promise[] | null> {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.resetStoreCallbacks.map(fn => fn())))\n .then(() => this.reFetchObservableQueries());\n }\n\n /**\n * Remove all data from the store. Unlike `resetStore`, `clearStore` will\n * not refetch any active queries.\n */\n public clearStore(): Promise {\n return Promise.resolve()\n .then(() => this.queryManager.clearStore())\n .then(() => Promise.all(this.clearStoreCallbacks.map(fn => fn())));\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * reset. `onResetStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onResetStore(cb: () => Promise): () => void {\n this.resetStoreCallbacks.push(cb);\n return () => {\n this.resetStoreCallbacks = this.resetStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Allows callbacks to be registered that are executed when the store is\n * cleared. `onClearStore` returns an unsubscribe function that can be used\n * to remove registered callbacks.\n */\n public onClearStore(cb: () => Promise): () => void {\n this.clearStoreCallbacks.push(cb);\n return () => {\n this.clearStoreCallbacks = this.clearStoreCallbacks.filter(c => c !== cb);\n };\n }\n\n /**\n * Refetches all of your active queries.\n *\n * `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage\n *\n * It is important to remember that `reFetchObservableQueries()` *will* refetch any active\n * queries. This means that any components that might be mounted will execute\n * their queries again using your network interface. If you do not want to\n * re-execute any queries then you should make sure to stop watching any\n * active queries.\n * Takes optional parameter `includeStandby` which will include queries in standby-mode when refetching.\n */\n public reFetchObservableQueries(\n includeStandby?: boolean,\n ): Promise[]> {\n return this.queryManager.reFetchObservableQueries(includeStandby);\n }\n\n /**\n * Exposes the cache's complete state, in a serializable format for later restoration.\n */\n public extract(optimistic?: boolean): TCacheShape {\n return this.cache.extract(optimistic);\n }\n\n /**\n * Replaces existing state in the cache (if any) with the values expressed by\n * `serializedState`.\n *\n * Called when hydrating a cache (server side rendering, or offline storage),\n * and also (potentially) during hot reloads.\n */\n public restore(serializedState: TCacheShape): ApolloCache {\n return this.cache.restore(serializedState);\n }\n\n /**\n * Add additional local resolvers.\n */\n public addResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.addResolvers(resolvers);\n }\n\n /**\n * Set (override existing) local resolvers.\n */\n public setResolvers(resolvers: Resolvers | Resolvers[]) {\n this.localState.setResolvers(resolvers);\n }\n\n /**\n * Get all registered local resolvers.\n */\n public getResolvers() {\n return this.localState.getResolvers();\n }\n\n /**\n * Set a custom local state fragment matcher.\n */\n public setLocalStateFragmentMatcher(fragmentMatcher: FragmentMatcher) {\n this.localState.setFragmentMatcher(fragmentMatcher);\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.d.ts b/node_modules/apollo-client/config/jest/setup.d.ts deleted file mode 100644 index 1cbe8c4..0000000 --- a/node_modules/apollo-client/config/jest/setup.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=setup.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.d.ts.map b/node_modules/apollo-client/config/jest/setup.d.ts.map deleted file mode 100644 index 62b670a..0000000 --- a/node_modules/apollo-client/config/jest/setup.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/config/jest/setup.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.js b/node_modules/apollo-client/config/jest/setup.js deleted file mode 100644 index e45f1b0..0000000 --- a/node_modules/apollo-client/config/jest/setup.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var graphql_tag_1 = require("graphql-tag"); -graphql_tag_1.disableFragmentWarnings(); -process.on('unhandledRejection', function () { }); -//# sourceMappingURL=setup.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/config/jest/setup.js.map b/node_modules/apollo-client/config/jest/setup.js.map deleted file mode 100644 index 56b7a5d..0000000 --- a/node_modules/apollo-client/config/jest/setup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/config/jest/setup.ts"],"names":[],"mappings":";;AAAA,2CAAsD;AAGtD,qCAAuB,EAAE,CAAC;AAE1B,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,cAAO,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.d.ts b/node_modules/apollo-client/core/LocalState.d.ts deleted file mode 100644 index 040127f..0000000 --- a/node_modules/apollo-client/core/LocalState.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { DocumentNode, FieldNode, ASTNode } from 'graphql'; -import { ApolloCache } from 'apollo-cache'; -import { FragmentMap } from 'apollo-utilities'; -import { FetchResult } from 'apollo-link'; -import ApolloClient from '../ApolloClient'; -import { Resolvers, OperationVariables } from './types'; -export declare type Resolver = (rootValue?: any, args?: any, context?: any, info?: { - field: FieldNode; - fragmentMap: FragmentMap; -}) => any; -export declare type VariableMap = { - [name: string]: any; -}; -export declare type FragmentMatcher = (rootValue: any, typeCondition: string, context: any) => boolean; -export declare type ExecContext = { - fragmentMap: FragmentMap; - context: any; - variables: VariableMap; - fragmentMatcher: FragmentMatcher; - defaultOperationType: string; - exportedVariables: Record; - onlyRunForcedResolvers: boolean; -}; -export declare type LocalStateOptions = { - cache: ApolloCache; - client?: ApolloClient; - resolvers?: Resolvers | Resolvers[]; - fragmentMatcher?: FragmentMatcher; -}; -export declare class LocalState { - private cache; - private client; - private resolvers?; - private fragmentMatcher; - constructor({ cache, client, resolvers, fragmentMatcher, }: LocalStateOptions); - addResolvers(resolvers: Resolvers | Resolvers[]): void; - setResolvers(resolvers: Resolvers | Resolvers[]): void; - getResolvers(): Resolvers; - runResolvers({ document, remoteResult, context, variables, onlyRunForcedResolvers, }: { - document: DocumentNode | null; - remoteResult: FetchResult; - context?: Record; - variables?: Record; - onlyRunForcedResolvers?: boolean; - }): Promise>; - setFragmentMatcher(fragmentMatcher: FragmentMatcher): void; - getFragmentMatcher(): FragmentMatcher; - clientQuery(document: DocumentNode): DocumentNode | null; - serverQuery(document: DocumentNode): DocumentNode | null; - prepareContext(context?: {}): { - cache: ApolloCache; - getCacheKey: (obj: { - __typename: string; - id: string | number; - }) => any; - }; - addExportedVariables(document: DocumentNode, variables?: OperationVariables, context?: {}): Promise<{ - [x: string]: any; - }>; - shouldForceResolvers(document: ASTNode): boolean; - private buildRootValueFromCache; - private resolveDocument; - private resolveSelectionSet; - private resolveField; - private resolveSubSelectedArray; -} -//# sourceMappingURL=LocalState.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.d.ts.map b/node_modules/apollo-client/core/LocalState.d.ts.map deleted file mode 100644 index 30d146f..0000000 --- a/node_modules/apollo-client/core/LocalState.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LocalState.d.ts","sourceRoot":"","sources":["../src/core/LocalState.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAMZ,SAAS,EACT,OAAO,EACR,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAOL,WAAW,EAQZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGxD,oBAAY,QAAQ,GAAG,CACrB,SAAS,CAAC,EAAE,GAAG,EACf,IAAI,CAAC,EAAE,GAAG,EACV,OAAO,CAAC,EAAE,GAAG,EACb,IAAI,CAAC,EAAE;IACL,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;CAC1B,KACE,GAAG,CAAC;AAET,oBAAY,WAAW,GA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C;QAC9B,YAAY,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAkBxB,kBAAkB,CAAC,eAAe,EAAE,eAAe;IAInD,kBAAkB,IAAI,eAAe;IAMrC,WAAW,CAAC,QAAQ,EAAE,YAAY;IAgBlC,WAAW,CAAC,QAAQ,EAAE,YAAY;IAIlC,cAAc,CAAC,OAAO,KAAK;;;;;;;IAyBrB,oBAAoB,CAC/B,QAAQ,EAAE,YAAY,EACtB,SAAS,GAAE,kBAAuB,EAClC,OAAO,KAAK;;;IAmBP,oBAAoB,CAAC,QAAQ,EAAE,OAAO;IAuB7C,OAAO,CAAC,uBAAuB;YAYjB,eAAe;YA4Cf,mBAAmB;YAuDnB,YAAY;IA8E1B,OAAO,CAAC,uBAAuB;CAuBhC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.js b/node_modules/apollo-client/core/LocalState.js deleted file mode 100644 index 934f3e2..0000000 --- a/node_modules/apollo-client/core/LocalState.js +++ /dev/null @@ -1,276 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var visitor_1 = require("graphql/language/visitor"); -var apollo_utilities_1 = require("apollo-utilities"); -var ts_invariant_1 = require("ts-invariant"); -var capitalizeFirstLetter_1 = require("../util/capitalizeFirstLetter"); -var LocalState = (function () { - function LocalState(_a) { - var cache = _a.cache, client = _a.client, resolvers = _a.resolvers, fragmentMatcher = _a.fragmentMatcher; - this.cache = cache; - if (client) { - this.client = client; - } - if (resolvers) { - this.addResolvers(resolvers); - } - if (fragmentMatcher) { - this.setFragmentMatcher(fragmentMatcher); - } - } - LocalState.prototype.addResolvers = function (resolvers) { - var _this = this; - this.resolvers = this.resolvers || {}; - if (Array.isArray(resolvers)) { - resolvers.forEach(function (resolverGroup) { - _this.resolvers = apollo_utilities_1.mergeDeep(_this.resolvers, resolverGroup); - }); - } - else { - this.resolvers = apollo_utilities_1.mergeDeep(this.resolvers, resolvers); - } - }; - LocalState.prototype.setResolvers = function (resolvers) { - this.resolvers = {}; - this.addResolvers(resolvers); - }; - LocalState.prototype.getResolvers = function () { - return this.resolvers || {}; - }; - LocalState.prototype.runResolvers = function (_a) { - var document = _a.document, remoteResult = _a.remoteResult, context = _a.context, variables = _a.variables, _b = _a.onlyRunForcedResolvers, onlyRunForcedResolvers = _b === void 0 ? false : _b; - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_c) { - if (document) { - return [2, this.resolveDocument(document, remoteResult.data, context, variables, this.fragmentMatcher, onlyRunForcedResolvers).then(function (localResult) { return (tslib_1.__assign(tslib_1.__assign({}, remoteResult), { data: localResult.result })); })]; - } - return [2, remoteResult]; - }); - }); - }; - LocalState.prototype.setFragmentMatcher = function (fragmentMatcher) { - this.fragmentMatcher = fragmentMatcher; - }; - LocalState.prototype.getFragmentMatcher = function () { - return this.fragmentMatcher; - }; - LocalState.prototype.clientQuery = function (document) { - if (apollo_utilities_1.hasDirectives(['client'], document)) { - if (this.resolvers) { - return document; - } - ts_invariant_1.invariant.warn('Found @client directives in a query but no ApolloClient resolvers ' + - 'were specified. This means ApolloClient local resolver handling ' + - 'has been disabled, and @client directives will be passed through ' + - 'to your link chain.'); - } - return null; - }; - LocalState.prototype.serverQuery = function (document) { - return this.resolvers ? apollo_utilities_1.removeClientSetsFromDocument(document) : document; - }; - LocalState.prototype.prepareContext = function (context) { - if (context === void 0) { context = {}; } - var cache = this.cache; - var newContext = tslib_1.__assign(tslib_1.__assign({}, context), { cache: cache, getCacheKey: function (obj) { - if (cache.config) { - return cache.config.dataIdFromObject(obj); - } - else { - ts_invariant_1.invariant(false, 'To use context.getCacheKey, you need to use a cache that has ' + - 'a configurable dataIdFromObject, like apollo-cache-inmemory.'); - } - } }); - return newContext; - }; - LocalState.prototype.addExportedVariables = function (document, variables, context) { - if (variables === void 0) { variables = {}; } - if (context === void 0) { context = {}; } - return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - if (document) { - return [2, this.resolveDocument(document, this.buildRootValueFromCache(document, variables) || {}, this.prepareContext(context), variables).then(function (data) { return (tslib_1.__assign(tslib_1.__assign({}, variables), data.exportedVariables)); })]; - } - return [2, tslib_1.__assign({}, variables)]; - }); - }); - }; - LocalState.prototype.shouldForceResolvers = function (document) { - var forceResolvers = false; - visitor_1.visit(document, { - Directive: { - enter: function (node) { - if (node.name.value === 'client' && node.arguments) { - forceResolvers = node.arguments.some(function (arg) { - return arg.name.value === 'always' && - arg.value.kind === 'BooleanValue' && - arg.value.value === true; - }); - if (forceResolvers) { - return visitor_1.BREAK; - } - } - }, - }, - }); - return forceResolvers; - }; - LocalState.prototype.buildRootValueFromCache = function (document, variables) { - return this.cache.diff({ - query: apollo_utilities_1.buildQueryFromSelectionSet(document), - variables: variables, - returnPartialData: true, - optimistic: false, - }).result; - }; - LocalState.prototype.resolveDocument = function (document, rootValue, context, variables, fragmentMatcher, onlyRunForcedResolvers) { - if (context === void 0) { context = {}; } - if (variables === void 0) { variables = {}; } - if (fragmentMatcher === void 0) { fragmentMatcher = function () { return true; }; } - if (onlyRunForcedResolvers === void 0) { onlyRunForcedResolvers = false; } - return tslib_1.__awaiter(this, void 0, void 0, function () { - var mainDefinition, fragments, fragmentMap, definitionOperation, defaultOperationType, _a, cache, client, execContext; - return tslib_1.__generator(this, function (_b) { - mainDefinition = apollo_utilities_1.getMainDefinition(document); - fragments = apollo_utilities_1.getFragmentDefinitions(document); - fragmentMap = apollo_utilities_1.createFragmentMap(fragments); - definitionOperation = mainDefinition - .operation; - defaultOperationType = definitionOperation - ? capitalizeFirstLetter_1.capitalizeFirstLetter(definitionOperation) - : 'Query'; - _a = this, cache = _a.cache, client = _a.client; - execContext = { - fragmentMap: fragmentMap, - context: tslib_1.__assign(tslib_1.__assign({}, context), { cache: cache, - client: client }), - variables: variables, - fragmentMatcher: fragmentMatcher, - defaultOperationType: defaultOperationType, - exportedVariables: {}, - onlyRunForcedResolvers: onlyRunForcedResolvers, - }; - return [2, this.resolveSelectionSet(mainDefinition.selectionSet, rootValue, execContext).then(function (result) { return ({ - result: result, - exportedVariables: execContext.exportedVariables, - }); })]; - }); - }); - }; - LocalState.prototype.resolveSelectionSet = function (selectionSet, rootValue, execContext) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var fragmentMap, context, variables, resultsToMerge, execute; - var _this = this; - return tslib_1.__generator(this, function (_a) { - fragmentMap = execContext.fragmentMap, context = execContext.context, variables = execContext.variables; - resultsToMerge = [rootValue]; - execute = function (selection) { return tslib_1.__awaiter(_this, void 0, void 0, function () { - var fragment, typeCondition; - return tslib_1.__generator(this, function (_a) { - if (!apollo_utilities_1.shouldInclude(selection, variables)) { - return [2]; - } - if (apollo_utilities_1.isField(selection)) { - return [2, this.resolveField(selection, rootValue, execContext).then(function (fieldResult) { - var _a; - if (typeof fieldResult !== 'undefined') { - resultsToMerge.push((_a = {}, - _a[apollo_utilities_1.resultKeyNameFromField(selection)] = fieldResult, - _a)); - } - })]; - } - if (apollo_utilities_1.isInlineFragment(selection)) { - fragment = selection; - } - else { - fragment = fragmentMap[selection.name.value]; - ts_invariant_1.invariant(fragment, "No fragment named " + selection.name.value); - } - if (fragment && fragment.typeCondition) { - typeCondition = fragment.typeCondition.name.value; - if (execContext.fragmentMatcher(rootValue, typeCondition, context)) { - return [2, this.resolveSelectionSet(fragment.selectionSet, rootValue, execContext).then(function (fragmentResult) { - resultsToMerge.push(fragmentResult); - })]; - } - } - return [2]; - }); - }); }; - return [2, Promise.all(selectionSet.selections.map(execute)).then(function () { - return apollo_utilities_1.mergeDeepArray(resultsToMerge); - })]; - }); - }); - }; - LocalState.prototype.resolveField = function (field, rootValue, execContext) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var variables, fieldName, aliasedFieldName, aliasUsed, defaultResult, resultPromise, resolverType, resolverMap, resolve; - var _this = this; - return tslib_1.__generator(this, function (_a) { - variables = execContext.variables; - fieldName = field.name.value; - aliasedFieldName = apollo_utilities_1.resultKeyNameFromField(field); - aliasUsed = fieldName !== aliasedFieldName; - defaultResult = rootValue[aliasedFieldName] || rootValue[fieldName]; - resultPromise = Promise.resolve(defaultResult); - if (!execContext.onlyRunForcedResolvers || - this.shouldForceResolvers(field)) { - resolverType = rootValue.__typename || execContext.defaultOperationType; - resolverMap = this.resolvers && this.resolvers[resolverType]; - if (resolverMap) { - resolve = resolverMap[aliasUsed ? fieldName : aliasedFieldName]; - if (resolve) { - resultPromise = Promise.resolve(resolve(rootValue, apollo_utilities_1.argumentsObjectFromField(field, variables), execContext.context, { field: field, fragmentMap: execContext.fragmentMap })); - } - } - } - return [2, resultPromise.then(function (result) { - if (result === void 0) { result = defaultResult; } - if (field.directives) { - field.directives.forEach(function (directive) { - if (directive.name.value === 'export' && directive.arguments) { - directive.arguments.forEach(function (arg) { - if (arg.name.value === 'as' && arg.value.kind === 'StringValue') { - execContext.exportedVariables[arg.value.value] = result; - } - }); - } - }); - } - if (!field.selectionSet) { - return result; - } - if (result == null) { - return result; - } - if (Array.isArray(result)) { - return _this.resolveSubSelectedArray(field, result, execContext); - } - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, result, execContext); - } - })]; - }); - }); - }; - LocalState.prototype.resolveSubSelectedArray = function (field, result, execContext) { - var _this = this; - return Promise.all(result.map(function (item) { - if (item === null) { - return null; - } - if (Array.isArray(item)) { - return _this.resolveSubSelectedArray(field, item, execContext); - } - if (field.selectionSet) { - return _this.resolveSelectionSet(field.selectionSet, item, execContext); - } - })); - }; - return LocalState; -}()); -exports.LocalState = LocalState; -//# sourceMappingURL=LocalState.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/LocalState.js.map b/node_modules/apollo-client/core/LocalState.js.map deleted file mode 100644 index c2282fe..0000000 --- a/node_modules/apollo-client/core/LocalState.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LocalState.js","sourceRoot":"","sources":["../../src/core/LocalState.ts"],"names":[],"mappings":";;;AAUA,oDAAwD;AAGxD,qDAe0B;AAG1B,6CAAyC;AAIzC,uEAAsE;AAqCtE;IAME,oBAAY,EAKqB;YAJ/B,gBAAK,EACL,kBAAM,EACN,wBAAS,EACT,oCAAe;QAEf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;SACtB;QAED,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;SAC9B;QAED,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;SAC1C;IACH,CAAC;IAEM,iCAAY,GAAnB,UAAoB,SAAkC;QAAtD,iBASC;QARC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC;QACtC,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YAC5B,SAAS,CAAC,OAAO,CAAC,UAAA,aAAa;gBAC7B,KAAI,CAAC,SAAS,GAAG,4BAAS,CAAC,KAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,SAAS,GAAG,4BAAS,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;SACvD;IACH,CAAC;IAEM,iCAAY,GAAnB,UAAoB,SAAkC;QACpD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAEM,iCAAY,GAAnB;QACE,OAAO,IAAI,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BACjE;wBAGD,IAAI,KAAK,CAAC,YAAY,EAAE;4BACtB,OAAO,KAAI,CAAC,mBAAmB,CAC7B,KAAK,CAAC,YAAY,EAClB,MAAM,EACN,WAAW,CACZ,CAAC;yBACH;oBACH,CAAC,CAAC,EAAC;;;KACJ;IAEO,4CAAuB,GAA/B,UACE,KAAgB,EAChB,MAAa,EACb,WAAwB;QAH1B,iBAsBC;QAjBC,OAAO,OAAO,CAAC,GAAG,CAChB,MAAM,CAAC,GAAG,CAAC,UAAA,IAAI;YACb,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjB,OAAO,IAAI,CAAC;aACb;YAGD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACvB,OAAO,KAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;aAC/D;YAGD,IAAI,KAAK,CAAC,YAAY,EAAE;gBACtB,OAAO,KAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;aACxE;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AAzYD,IAyYC;AAzYY,gCAAU"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.d.ts b/node_modules/apollo-client/core/ObservableQuery.d.ts deleted file mode 100644 index c2e01f4..0000000 --- a/node_modules/apollo-client/core/ObservableQuery.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { GraphQLError } from 'graphql'; -import { NetworkStatus } from './networkStatus'; -import { Observable } from '../util/Observable'; -import { ApolloError } from '../errors/ApolloError'; -import { QueryManager } from './QueryManager'; -import { ApolloQueryResult, OperationVariables } from './types'; -import { WatchQueryOptions, FetchMoreQueryOptions, SubscribeToMoreOptions, ErrorPolicy } from './watchQueryOptions'; -import { QueryStoreValue } from '../data/queries'; -export declare type ApolloCurrentResult = { - data: T | {}; - errors?: ReadonlyArray; - loading: boolean; - networkStatus: NetworkStatus; - error?: ApolloError; - partial?: boolean; -}; -export declare type ApolloCurrentQueryResult = { - data: T | undefined; - errors?: ReadonlyArray; - loading: boolean; - networkStatus: NetworkStatus; - error?: ApolloError; - partial?: boolean; - stale?: boolean; -}; -export interface FetchMoreOptions { - updateQuery: (previousQueryResult: TData, options: { - fetchMoreResult?: TData; - variables?: TVariables; - }) => TData; -} -export interface UpdateQueryOptions { - variables?: TVariables; -} -export declare const hasError: (storeValue: QueryStoreValue, policy?: ErrorPolicy) => boolean | Error; -export declare class ObservableQuery extends Observable> { - options: WatchQueryOptions; - readonly queryId: string; - readonly queryName?: string; - variables: TVariables; - private shouldSubscribe; - private isTornDown; - private queryManager; - private observers; - private subscriptions; - private lastResult; - private lastResultSnapshot; - private lastError; - constructor({ queryManager, options, shouldSubscribe, }: { - queryManager: QueryManager; - options: WatchQueryOptions; - shouldSubscribe?: boolean; - }); - result(): Promise>; - currentResult(): ApolloCurrentResult; - getCurrentResult(): ApolloCurrentQueryResult; - isDifferentFromLastResult(newResult: ApolloQueryResult): boolean; - getLastResult(): ApolloQueryResult; - getLastError(): ApolloError; - resetLastResults(): void; - resetQueryStoreErrors(): void; - refetch(variables?: TVariables): Promise>; - fetchMore(fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions): Promise>; - subscribeToMore(options: SubscribeToMoreOptions): () => void; - setOptions(opts: WatchQueryOptions): Promise | void>; - setVariables(variables: TVariables, tryFetch?: boolean, fetchResults?: boolean): Promise | void>; - updateQuery(mapFn: (previousQueryResult: TData, options: UpdateQueryOptions) => TData): void; - stopPolling(): void; - startPolling(pollInterval: number): void; - private updateLastResult; - private onSubscribe; - private setUpQuery; - private tearDownQuery; -} -//# sourceMappingURL=ObservableQuery.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.d.ts.map b/node_modules/apollo-client/core/ObservableQuery.d.ts.map deleted file mode 100644 index 88e8458..0000000 --- a/node_modules/apollo-client/core/ObservableQuery.d.ts.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E,iBAAiB,CAAC,KAAK,CAAC;IAa7D,aAAa,IAAI,iBAAiB,CAAC,KAAK,CAAC;IAIzC,YAAY,IAAI,WAAW;IAI3B,gBAAgB,IAAI,IAAI;IAOxB,qBAAqB;IAerB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAwClE,SAAS,CAAC,CAAC,SAAS,MAAM,UAAU,EACzC,gBAAgB,EAAE,qBAAqB,CAAC,UAAU,EAAE,CAAC,CAAC,GACpD,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,GACpC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAiD7B,eAAe,CACpB,iBAAiB,GAAG,KAAK,EACzB,sBAAsB,GAAG,UAAU,EAEnC,OAAO,EAAE,sBAAsB,CAC7B,KAAK,EACL,sBAAsB,EACtB,iBAAiB,CAClB;IAwCI,UAAU,CACf,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAuDpC,YAAY,CACjB,SAAS,EAAE,UAAU,EACrB,QAAQ,GAAE,OAAe,EACzB,YAAY,UAAO,GAClB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IA6BpC,WAAW,CAAC,KAAK,GAAG,UAAU,EACnC,KAAK,EAAE,CACL,mBAAmB,EAAE,KAAK,EAC1B,OAAO,EAAE,kBAAkB,CAAC,KAAK,CAAC,KAC/B,KAAK,GACT,IAAI;IAwBA,WAAW;IAKX,YAAY,CAAC,YAAY,EAAE,MAAM;IAMxC,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,UAAU;IAgElB,OAAO,CAAC,aAAa;CAetB"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.js b/node_modules/apollo-client/core/ObservableQuery.js deleted file mode 100644 index cf6160a..0000000 --- a/node_modules/apollo-client/core/ObservableQuery.js +++ /dev/null @@ -1,367 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_utilities_1 = require("apollo-utilities"); -var networkStatus_1 = require("./networkStatus"); -var Observable_1 = require("../util/Observable"); -var ApolloError_1 = require("../errors/ApolloError"); -var types_1 = require("./types"); -var ts_invariant_1 = require("ts-invariant"); -var arrays_1 = require("../util/arrays"); -exports.hasError = function (storeValue, policy) { - if (policy === void 0) { policy = 'none'; } - return storeValue && (storeValue.networkError || - (policy === 'none' && arrays_1.isNonEmptyArray(storeValue.graphQLErrors))); -}; -var ObservableQuery = (function (_super) { - tslib_1.__extends(ObservableQuery, _super); - function ObservableQuery(_a) { - var queryManager = _a.queryManager, options = _a.options, _b = _a.shouldSubscribe, shouldSubscribe = _b === void 0 ? true : _b; - var _this = _super.call(this, function (observer) { - return _this.onSubscribe(observer); - }) || this; - _this.observers = new Set(); - _this.subscriptions = new Set(); - _this.isTornDown = false; - _this.options = options; - _this.variables = options.variables || {}; - _this.queryId = queryManager.generateQueryId(); - _this.shouldSubscribe = shouldSubscribe; - var opDef = apollo_utilities_1.getOperationDefinition(options.query); - _this.queryName = opDef && opDef.name && opDef.name.value; - _this.queryManager = queryManager; - return _this; - } - ObservableQuery.prototype.result = function () { - var _this = this; - return new Promise(function (resolve, reject) { - var observer = { - next: function (result) { - resolve(result); - _this.observers.delete(observer); - if (!_this.observers.size) { - _this.queryManager.removeQuery(_this.queryId); - } - setTimeout(function () { - subscription.unsubscribe(); - }, 0); - }, - error: reject, - }; - var subscription = _this.subscribe(observer); - }); - }; - ObservableQuery.prototype.currentResult = function () { - var result = this.getCurrentResult(); - if (result.data === undefined) { - result.data = {}; - } - return result; - }; - ObservableQuery.prototype.getCurrentResult = function () { - if (this.isTornDown) { - var lastResult = this.lastResult; - return { - data: !this.lastError && lastResult && lastResult.data || void 0, - error: this.lastError, - loading: false, - networkStatus: networkStatus_1.NetworkStatus.error, - }; - } - var _a = this.queryManager.getCurrentQueryResult(this), data = _a.data, partial = _a.partial; - var queryStoreValue = this.queryManager.queryStore.get(this.queryId); - var result; - var fetchPolicy = this.options.fetchPolicy; - var isNetworkFetchPolicy = fetchPolicy === 'network-only' || - fetchPolicy === 'no-cache'; - if (queryStoreValue) { - var networkStatus = queryStoreValue.networkStatus; - if (exports.hasError(queryStoreValue, this.options.errorPolicy)) { - return { - data: void 0, - loading: false, - networkStatus: networkStatus, - error: new ApolloError_1.ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError, - }), - }; - } - if (queryStoreValue.variables) { - this.options.variables = tslib_1.__assign(tslib_1.__assign({}, this.options.variables), queryStoreValue.variables); - this.variables = this.options.variables; - } - result = { - data: data, - loading: networkStatus_1.isNetworkRequestInFlight(networkStatus), - networkStatus: networkStatus, - }; - if (queryStoreValue.graphQLErrors && this.options.errorPolicy === 'all') { - result.errors = queryStoreValue.graphQLErrors; - } - } - else { - var loading = isNetworkFetchPolicy || - (partial && fetchPolicy !== 'cache-only'); - result = { - data: data, - loading: loading, - networkStatus: loading ? networkStatus_1.NetworkStatus.loading : networkStatus_1.NetworkStatus.ready, - }; - } - if (!partial) { - this.updateLastResult(tslib_1.__assign(tslib_1.__assign({}, result), { stale: false })); - } - return tslib_1.__assign(tslib_1.__assign({}, result), { partial: partial }); - }; - ObservableQuery.prototype.isDifferentFromLastResult = function (newResult) { - var snapshot = this.lastResultSnapshot; - return !(snapshot && - newResult && - snapshot.networkStatus === newResult.networkStatus && - snapshot.stale === newResult.stale && - apollo_utilities_1.isEqual(snapshot.data, newResult.data)); - }; - ObservableQuery.prototype.getLastResult = function () { - return this.lastResult; - }; - ObservableQuery.prototype.getLastError = function () { - return this.lastError; - }; - ObservableQuery.prototype.resetLastResults = function () { - delete this.lastResult; - delete this.lastResultSnapshot; - delete this.lastError; - this.isTornDown = false; - }; - ObservableQuery.prototype.resetQueryStoreErrors = function () { - var queryStore = this.queryManager.queryStore.get(this.queryId); - if (queryStore) { - queryStore.networkError = null; - queryStore.graphQLErrors = []; - } - }; - ObservableQuery.prototype.refetch = function (variables) { - var fetchPolicy = this.options.fetchPolicy; - if (fetchPolicy === 'cache-only') { - return Promise.reject(new ts_invariant_1.InvariantError('cache-only fetchPolicy option should not be used together with query refetch.')); - } - if (fetchPolicy !== 'no-cache' && - fetchPolicy !== 'cache-and-network') { - fetchPolicy = 'network-only'; - } - if (!apollo_utilities_1.isEqual(this.variables, variables)) { - this.variables = tslib_1.__assign(tslib_1.__assign({}, this.variables), variables); - } - if (!apollo_utilities_1.isEqual(this.options.variables, this.variables)) { - this.options.variables = tslib_1.__assign(tslib_1.__assign({}, this.options.variables), this.variables); - } - return this.queryManager.fetchQuery(this.queryId, tslib_1.__assign(tslib_1.__assign({}, this.options), { fetchPolicy: fetchPolicy }), types_1.FetchType.refetch); - }; - ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { - var _this = this; - ts_invariant_1.invariant(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); - var combinedOptions = tslib_1.__assign(tslib_1.__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, this.options), fetchMoreOptions), { variables: tslib_1.__assign(tslib_1.__assign({}, this.variables), fetchMoreOptions.variables) }))), { fetchPolicy: 'network-only' }); - var qid = this.queryManager.generateQueryId(); - return this.queryManager - .fetchQuery(qid, combinedOptions, types_1.FetchType.normal, this.queryId) - .then(function (fetchMoreResult) { - _this.updateQuery(function (previousResult) { - return fetchMoreOptions.updateQuery(previousResult, { - fetchMoreResult: fetchMoreResult.data, - variables: combinedOptions.variables, - }); - }); - _this.queryManager.stopQuery(qid); - return fetchMoreResult; - }, function (error) { - _this.queryManager.stopQuery(qid); - throw error; - }); - }; - ObservableQuery.prototype.subscribeToMore = function (options) { - var _this = this; - var subscription = this.queryManager - .startGraphQLSubscription({ - query: options.document, - variables: options.variables, - }) - .subscribe({ - next: function (subscriptionData) { - var updateQuery = options.updateQuery; - if (updateQuery) { - _this.updateQuery(function (previous, _a) { - var variables = _a.variables; - return updateQuery(previous, { - subscriptionData: subscriptionData, - variables: variables, - }); - }); - } - }, - error: function (err) { - if (options.onError) { - options.onError(err); - return; - } - ts_invariant_1.invariant.error('Unhandled GraphQL subscription error', err); - }, - }); - this.subscriptions.add(subscription); - return function () { - if (_this.subscriptions.delete(subscription)) { - subscription.unsubscribe(); - } - }; - }; - ObservableQuery.prototype.setOptions = function (opts) { - var oldFetchPolicy = this.options.fetchPolicy; - this.options = tslib_1.__assign(tslib_1.__assign({}, this.options), opts); - if (opts.pollInterval) { - this.startPolling(opts.pollInterval); - } - else if (opts.pollInterval === 0) { - this.stopPolling(); - } - var fetchPolicy = opts.fetchPolicy; - return this.setVariables(this.options.variables, oldFetchPolicy !== fetchPolicy && (oldFetchPolicy === 'cache-only' || - oldFetchPolicy === 'standby' || - fetchPolicy === 'network-only'), opts.fetchResults); - }; - ObservableQuery.prototype.setVariables = function (variables, tryFetch, fetchResults) { - if (tryFetch === void 0) { tryFetch = false; } - if (fetchResults === void 0) { fetchResults = true; } - this.isTornDown = false; - variables = variables || this.variables; - if (!tryFetch && apollo_utilities_1.isEqual(variables, this.variables)) { - return this.observers.size && fetchResults - ? this.result() - : Promise.resolve(); - } - this.variables = this.options.variables = variables; - if (!this.observers.size) { - return Promise.resolve(); - } - return this.queryManager.fetchQuery(this.queryId, this.options); - }; - ObservableQuery.prototype.updateQuery = function (mapFn) { - var queryManager = this.queryManager; - var _a = queryManager.getQueryWithPreviousResult(this.queryId), previousResult = _a.previousResult, variables = _a.variables, document = _a.document; - var newResult = apollo_utilities_1.tryFunctionOrLogError(function () { - return mapFn(previousResult, { variables: variables }); - }); - if (newResult) { - queryManager.dataStore.markUpdateQueryResult(document, variables, newResult); - queryManager.broadcastQueries(); - } - }; - ObservableQuery.prototype.stopPolling = function () { - this.queryManager.stopPollingQuery(this.queryId); - this.options.pollInterval = undefined; - }; - ObservableQuery.prototype.startPolling = function (pollInterval) { - assertNotCacheFirstOrOnly(this); - this.options.pollInterval = pollInterval; - this.queryManager.startPollingQuery(this.options, this.queryId); - }; - ObservableQuery.prototype.updateLastResult = function (newResult) { - var previousResult = this.lastResult; - this.lastResult = newResult; - this.lastResultSnapshot = this.queryManager.assumeImmutableResults - ? newResult - : apollo_utilities_1.cloneDeep(newResult); - return previousResult; - }; - ObservableQuery.prototype.onSubscribe = function (observer) { - var _this = this; - try { - var subObserver = observer._subscription._observer; - if (subObserver && !subObserver.error) { - subObserver.error = defaultSubscriptionObserverErrorCallback; - } - } - catch (_a) { } - var first = !this.observers.size; - this.observers.add(observer); - if (observer.next && this.lastResult) - observer.next(this.lastResult); - if (observer.error && this.lastError) - observer.error(this.lastError); - if (first) { - this.setUpQuery(); - } - return function () { - if (_this.observers.delete(observer) && !_this.observers.size) { - _this.tearDownQuery(); - } - }; - }; - ObservableQuery.prototype.setUpQuery = function () { - var _this = this; - var _a = this, queryManager = _a.queryManager, queryId = _a.queryId; - if (this.shouldSubscribe) { - queryManager.addObservableQuery(queryId, this); - } - if (this.options.pollInterval) { - assertNotCacheFirstOrOnly(this); - queryManager.startPollingQuery(this.options, queryId); - } - var onError = function (error) { - _this.updateLastResult(tslib_1.__assign(tslib_1.__assign({}, _this.lastResult), { errors: error.graphQLErrors, networkStatus: networkStatus_1.NetworkStatus.error, loading: false })); - iterateObserversSafely(_this.observers, 'error', _this.lastError = error); - }; - queryManager.observeQuery(queryId, this.options, { - next: function (result) { - if (_this.lastError || _this.isDifferentFromLastResult(result)) { - var previousResult_1 = _this.updateLastResult(result); - var _a = _this.options, query_1 = _a.query, variables = _a.variables, fetchPolicy_1 = _a.fetchPolicy; - if (queryManager.transform(query_1).hasClientExports) { - queryManager.getLocalState().addExportedVariables(query_1, variables).then(function (variables) { - var previousVariables = _this.variables; - _this.variables = _this.options.variables = variables; - if (!result.loading && - previousResult_1 && - fetchPolicy_1 !== 'cache-only' && - queryManager.transform(query_1).serverQuery && - !apollo_utilities_1.isEqual(previousVariables, variables)) { - _this.refetch(); - } - else { - iterateObserversSafely(_this.observers, 'next', result); - } - }); - } - else { - iterateObserversSafely(_this.observers, 'next', result); - } - } - }, - error: onError, - }).catch(onError); - }; - ObservableQuery.prototype.tearDownQuery = function () { - var queryManager = this.queryManager; - this.isTornDown = true; - queryManager.stopPollingQuery(this.queryId); - this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); }); - this.subscriptions.clear(); - queryManager.removeObservableQuery(this.queryId); - queryManager.stopQuery(this.queryId); - this.observers.clear(); - }; - return ObservableQuery; -}(Observable_1.Observable)); -exports.ObservableQuery = ObservableQuery; -function defaultSubscriptionObserverErrorCallback(error) { - ts_invariant_1.invariant.error('Unhandled error', error.message, error.stack); -} -function iterateObserversSafely(observers, method, argument) { - var observersWithMethod = []; - observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); }); - observersWithMethod.forEach(function (obs) { return obs[method](argument); }); -} -function assertNotCacheFirstOrOnly(obsQuery) { - var fetchPolicy = obsQuery.options.fetchPolicy; - ts_invariant_1.invariant(fetchPolicy !== 'cache-first' && fetchPolicy !== 'cache-only', 'Queries that specify the cache-first and cache-only fetchPolicies cannot also be polling queries.'); -} -//# sourceMappingURL=ObservableQuery.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/ObservableQuery.js.map b/node_modules/apollo-client/core/ObservableQuery.js.map deleted file mode 100644 index 2983a91..0000000 --- a/node_modules/apollo-client/core/ObservableQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ObservableQuery.js","sourceRoot":"","sources":["../../src/core/ObservableQuery.ts"],"names":[],"mappings":";;;AAAA,qDAK0B;AAE1B,iDAA0E;AAC1E,iDAAwE;AACxE,qDAAoD;AAEpD,iCAA2E;AAU3E,6CAAyD;AACzD,yCAAiD;AAwCpC,QAAA,QAAQ,GAAG,UACtB,UAA2B,EAC3B,MAA4B;IAA5B,u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CAAC;AACrE,CAAC;AAED,SAAS,yBAAyB,CAChC,QAA4C;IAEpC,IAAA,0CAAW,CAAsB;IACzC,wBAAS,CACP,WAAW,KAAK,aAAa,IAAI,WAAW,KAAK,YAAY,EAC7D,mGAAmG,CACpG,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.d.ts b/node_modules/apollo-client/core/QueryManager.d.ts deleted file mode 100644 index ca23f6a..0000000 --- a/node_modules/apollo-client/core/QueryManager.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { ApolloLink, FetchResult } from 'apollo-link'; -import { DocumentNode } from 'graphql'; -import { Cache } from 'apollo-cache'; -import { Observer, Subscription, Observable } from '../util/Observable'; -import { DataStore } from '../data/store'; -import { MutationStore } from '../data/mutations'; -import { QueryStore } from '../data/queries'; -import { QueryOptions, WatchQueryOptions, SubscriptionOptions, MutationOptions } from './watchQueryOptions'; -import { ObservableQuery } from './ObservableQuery'; -import { QueryListener, ApolloQueryResult, FetchType, OperationVariables } from './types'; -import { LocalState } from './LocalState'; -export interface QueryInfo { - listeners: Set; - invalidated: boolean; - newData: Cache.DiffResult | null; - document: DocumentNode | null; - lastRequestId: number; - observableQuery: ObservableQuery | null; - subscriptions: Set; - cancel?: () => void; -} -export declare class QueryManager { - link: ApolloLink; - mutationStore: MutationStore; - queryStore: QueryStore; - dataStore: DataStore; - readonly assumeImmutableResults: boolean; - private queryDeduplication; - private clientAwareness; - private localState; - private onBroadcast; - private ssrMode; - private idCounter; - private queries; - private fetchQueryRejectFns; - constructor({ link, queryDeduplication, store, onBroadcast, ssrMode, clientAwareness, localState, assumeImmutableResults, }: { - link: ApolloLink; - queryDeduplication?: boolean; - store: DataStore; - onBroadcast?: () => void; - ssrMode?: boolean; - clientAwareness?: Record; - localState?: LocalState; - assumeImmutableResults?: boolean; - }); - stop(): void; - mutate({ mutation, variables, optimisticResponse, updateQueries: updateQueriesByName, refetchQueries, awaitRefetchQueries, update: updateWithProxyFn, errorPolicy, fetchPolicy, context, }: MutationOptions): Promise>; - fetchQuery(queryId: string, options: WatchQueryOptions, fetchType?: FetchType, fetchMoreForQueryId?: string): Promise>; - private markQueryResult; - queryListenerForObserver(queryId: string, options: WatchQueryOptions, observer: Observer>): QueryListener; - private transformCache; - transform(document: DocumentNode): Readonly<{ - document: Readonly; - hasClientExports: boolean; - hasForcedResolvers: boolean; - clientQuery: Readonly | null; - serverQuery: Readonly | null; - defaultVars: Readonly; - }>; - private getVariables; - watchQuery(options: WatchQueryOptions, shouldSubscribe?: boolean): ObservableQuery; - query(options: QueryOptions): Promise>; - generateQueryId(): string; - stopQueryInStore(queryId: string): void; - private stopQueryInStoreNoBroadcast; - addQueryListener(queryId: string, listener: QueryListener): void; - updateQueryWatch(queryId: string, document: DocumentNode, options: WatchQueryOptions): () => void; - addObservableQuery(queryId: string, observableQuery: ObservableQuery): void; - removeObservableQuery(queryId: string): void; - clearStore(): Promise; - resetStore(): Promise[]>; - reFetchObservableQueries(includeStandby?: boolean): Promise[]>; - observeQuery(queryId: string, options: WatchQueryOptions, observer: Observer>): Promise, Record>>; - startQuery(queryId: string, options: WatchQueryOptions, listener: QueryListener): string; - startGraphQLSubscription({ query, fetchPolicy, variables, }: SubscriptionOptions): Observable>; - stopQuery(queryId: string): void; - private stopQueryNoBroadcast; - removeQuery(queryId: string): void; - getCurrentQueryResult(observableQuery: ObservableQuery, optimistic?: boolean): { - data: T | undefined; - partial: boolean; - }; - getQueryWithPreviousResult(queryIdOrObservable: string | ObservableQuery): { - previousResult: any; - variables: TVariables | undefined; - document: DocumentNode; - }; - broadcastQueries(): void; - getLocalState(): LocalState; - private inFlightLinkObservables; - private getObservableFromLink; - private fetchRequest; - private getQuery; - private setQuery; - private invalidate; - private prepareContext; - checkInFlight(queryId: string): boolean; - private pollingInfoByQueryId; - startPollingQuery(options: WatchQueryOptions, queryId: string, listener?: QueryListener): string; - stopPollingQuery(queryId: string): void; -} -//# sourceMappingURL=QueryManager.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.d.ts.map b/node_modules/apollo-client/core/QueryManager.d.ts.map deleted file mode 100644 index c31bab2..0000000 --- a/node_modules/apollo-client/core/QueryManager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"QueryManager.d.ts","sourceRoot":"","sources":["../src/core/QueryManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAerC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAoB,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IAItB,eAAe,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC7C,aAAa,EAAE,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Q;IAShB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,cAAc;IAQf,aAAa,CAAC,OAAO,EAAE,MAAM;IAWpC,OAAO,CAAC,oBAAoB,CAIvB;IAEE,iBAAiB,CACtB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,aAAa,GACvB,MAAM;IAqDF,gBAAgB,CAAC,OAAO,EAAE,MAAM;CAGxC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.js b/node_modules/apollo-client/core/QueryManager.js deleted file mode 100644 index ad59088..0000000 --- a/node_modules/apollo-client/core/QueryManager.js +++ /dev/null @@ -1,867 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_link_1 = require("apollo-link"); -var apollo_utilities_1 = require("apollo-utilities"); -var ts_invariant_1 = require("ts-invariant"); -var ApolloError_1 = require("../errors/ApolloError"); -var Observable_1 = require("../util/Observable"); -var mutations_1 = require("../data/mutations"); -var queries_1 = require("../data/queries"); -var ObservableQuery_1 = require("./ObservableQuery"); -var networkStatus_1 = require("./networkStatus"); -var types_1 = require("./types"); -var LocalState_1 = require("./LocalState"); -var observables_1 = require("../util/observables"); -var arrays_1 = require("../util/arrays"); -var hasOwnProperty = Object.prototype.hasOwnProperty; -var QueryManager = (function () { - function QueryManager(_a) { - var link = _a.link, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, store = _a.store, _c = _a.onBroadcast, onBroadcast = _c === void 0 ? function () { return undefined; } : _c, _d = _a.ssrMode, ssrMode = _d === void 0 ? false : _d, _e = _a.clientAwareness, clientAwareness = _e === void 0 ? {} : _e, localState = _a.localState, assumeImmutableResults = _a.assumeImmutableResults; - this.mutationStore = new mutations_1.MutationStore(); - this.queryStore = new queries_1.QueryStore(); - this.clientAwareness = {}; - this.idCounter = 1; - this.queries = new Map(); - this.fetchQueryRejectFns = new Map(); - this.transformCache = new (apollo_utilities_1.canUseWeakMap ? WeakMap : Map)(); - this.inFlightLinkObservables = new Map(); - this.pollingInfoByQueryId = new Map(); - this.link = link; - this.queryDeduplication = queryDeduplication; - this.dataStore = store; - this.onBroadcast = onBroadcast; - this.clientAwareness = clientAwareness; - this.localState = localState || new LocalState_1.LocalState({ cache: store.getCache() }); - this.ssrMode = ssrMode; - this.assumeImmutableResults = !!assumeImmutableResults; - } - QueryManager.prototype.stop = function () { - var _this = this; - this.queries.forEach(function (_info, queryId) { - _this.stopQueryNoBroadcast(queryId); - }); - this.fetchQueryRejectFns.forEach(function (reject) { - reject(new ts_invariant_1.InvariantError('QueryManager stopped while query was in flight')); - }); - }; - QueryManager.prototype.mutate = function (_a) { - var mutation = _a.mutation, variables = _a.variables, optimisticResponse = _a.optimisticResponse, updateQueriesByName = _a.updateQueries, _b = _a.refetchQueries, refetchQueries = _b === void 0 ? [] : _b, _c = _a.awaitRefetchQueries, awaitRefetchQueries = _c === void 0 ? false : _c, updateWithProxyFn = _a.update, _d = _a.errorPolicy, errorPolicy = _d === void 0 ? 'none' : _d, fetchPolicy = _a.fetchPolicy, _e = _a.context, context = _e === void 0 ? {} : _e; - return tslib_1.__awaiter(this, void 0, void 0, function () { - var mutationId, generateUpdateQueriesInfo, self; - var _this = this; - return tslib_1.__generator(this, function (_f) { - switch (_f.label) { - case 0: - ts_invariant_1.invariant(mutation, 'mutation option is required. You must specify your GraphQL document in the mutation option.'); - ts_invariant_1.invariant(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - mutationId = this.generateQueryId(); - mutation = this.transform(mutation).document; - this.setQuery(mutationId, function () { return ({ document: mutation }); }); - variables = this.getVariables(mutation, variables); - if (!this.transform(mutation).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(mutation, variables, context)]; - case 1: - variables = _f.sent(); - _f.label = 2; - case 2: - generateUpdateQueriesInfo = function () { - var ret = {}; - if (updateQueriesByName) { - _this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) { - var queryName = observableQuery.queryName; - if (queryName && - hasOwnProperty.call(updateQueriesByName, queryName)) { - ret[queryId] = { - updater: updateQueriesByName[queryName], - query: _this.queryStore.get(queryId), - }; - } - } - }); - } - return ret; - }; - this.mutationStore.initMutation(mutationId, mutation, variables); - this.dataStore.markMutationInit({ - mutationId: mutationId, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn, - optimisticResponse: optimisticResponse, - }); - this.broadcastQueries(); - self = this; - return [2, new Promise(function (resolve, reject) { - var storeResult; - var error; - self.getObservableFromLink(mutation, tslib_1.__assign(tslib_1.__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false).subscribe({ - next: function (result) { - if (apollo_utilities_1.graphQLResultHasError(result) && errorPolicy === 'none') { - error = new ApolloError_1.ApolloError({ - graphQLErrors: result.errors, - }); - return; - } - self.mutationStore.markMutationResult(mutationId); - if (fetchPolicy !== 'no-cache') { - self.dataStore.markMutationResult({ - mutationId: mutationId, - result: result, - document: mutation, - variables: variables, - updateQueries: generateUpdateQueriesInfo(), - update: updateWithProxyFn, - }); - } - storeResult = result; - }, - error: function (err) { - self.mutationStore.markMutationError(mutationId, err); - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse, - }); - self.broadcastQueries(); - self.setQuery(mutationId, function () { return ({ document: null }); }); - reject(new ApolloError_1.ApolloError({ - networkError: err, - })); - }, - complete: function () { - if (error) { - self.mutationStore.markMutationError(mutationId, error); - } - self.dataStore.markMutationComplete({ - mutationId: mutationId, - optimisticResponse: optimisticResponse, - }); - self.broadcastQueries(); - if (error) { - reject(error); - return; - } - if (typeof refetchQueries === 'function') { - refetchQueries = refetchQueries(storeResult); - } - var refetchQueryPromises = []; - if (arrays_1.isNonEmptyArray(refetchQueries)) { - refetchQueries.forEach(function (refetchQuery) { - if (typeof refetchQuery === 'string') { - self.queries.forEach(function (_a) { - var observableQuery = _a.observableQuery; - if (observableQuery && - observableQuery.queryName === refetchQuery) { - refetchQueryPromises.push(observableQuery.refetch()); - } - }); - } - else { - var queryOptions = { - query: refetchQuery.query, - variables: refetchQuery.variables, - fetchPolicy: 'network-only', - }; - if (refetchQuery.context) { - queryOptions.context = refetchQuery.context; - } - refetchQueryPromises.push(self.query(queryOptions)); - } - }); - } - Promise.all(awaitRefetchQueries ? refetchQueryPromises : []).then(function () { - self.setQuery(mutationId, function () { return ({ document: null }); }); - if (errorPolicy === 'ignore' && - storeResult && - apollo_utilities_1.graphQLResultHasError(storeResult)) { - delete storeResult.errors; - } - resolve(storeResult); - }); - }, - }); - })]; - } - }); - }); - }; - QueryManager.prototype.fetchQuery = function (queryId, options, fetchType, fetchMoreForQueryId) { - return tslib_1.__awaiter(this, void 0, void 0, function () { - var _a, metadata, _b, fetchPolicy, _c, context, query, variables, storeResult, isNetworkOnly, needToFetch, _d, complete, result, shouldFetch, requestId, cancel, networkResult; - var _this = this; - return tslib_1.__generator(this, function (_e) { - switch (_e.label) { - case 0: - _a = options.metadata, metadata = _a === void 0 ? null : _a, _b = options.fetchPolicy, fetchPolicy = _b === void 0 ? 'cache-first' : _b, _c = options.context, context = _c === void 0 ? {} : _c; - query = this.transform(options.query).document; - variables = this.getVariables(query, options.variables); - if (!this.transform(query).hasClientExports) return [3, 2]; - return [4, this.localState.addExportedVariables(query, variables, context)]; - case 1: - variables = _e.sent(); - _e.label = 2; - case 2: - options = tslib_1.__assign(tslib_1.__assign({}, options), { variables: variables }); - isNetworkOnly = fetchPolicy === 'network-only' || fetchPolicy === 'no-cache'; - needToFetch = isNetworkOnly; - if (!isNetworkOnly) { - _d = this.dataStore.getCache().diff({ - query: query, - variables: variables, - returnPartialData: true, - optimistic: false, - }), complete = _d.complete, result = _d.result; - needToFetch = !complete || fetchPolicy === 'cache-and-network'; - storeResult = result; - } - shouldFetch = needToFetch && fetchPolicy !== 'cache-only' && fetchPolicy !== 'standby'; - if (apollo_utilities_1.hasDirectives(['live'], query)) - shouldFetch = true; - requestId = this.idCounter++; - cancel = fetchPolicy !== 'no-cache' - ? this.updateQueryWatch(queryId, query, options) - : undefined; - this.setQuery(queryId, function () { return ({ - document: query, - lastRequestId: requestId, - invalidated: true, - cancel: cancel, - }); }); - this.invalidate(fetchMoreForQueryId); - this.queryStore.initQuery({ - queryId: queryId, - document: query, - storePreviousVariables: shouldFetch, - variables: variables, - isPoll: fetchType === types_1.FetchType.poll, - isRefetch: fetchType === types_1.FetchType.refetch, - metadata: metadata, - fetchMoreForQueryId: fetchMoreForQueryId, - }); - this.broadcastQueries(); - if (shouldFetch) { - networkResult = this.fetchRequest({ - requestId: requestId, - queryId: queryId, - document: query, - options: options, - fetchMoreForQueryId: fetchMoreForQueryId, - }).catch(function (error) { - if (ApolloError_1.isApolloError(error)) { - throw error; - } - else { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.queryStore.markQueryError(queryId, error, fetchMoreForQueryId); - _this.invalidate(queryId); - _this.invalidate(fetchMoreForQueryId); - _this.broadcastQueries(); - } - throw new ApolloError_1.ApolloError({ networkError: error }); - } - }); - if (fetchPolicy !== 'cache-and-network') { - return [2, networkResult]; - } - networkResult.catch(function () { }); - } - this.queryStore.markQueryResultClient(queryId, !shouldFetch); - this.invalidate(queryId); - this.invalidate(fetchMoreForQueryId); - if (this.transform(query).hasForcedResolvers) { - return [2, this.localState.runResolvers({ - document: query, - remoteResult: { data: storeResult }, - context: context, - variables: variables, - onlyRunForcedResolvers: true, - }).then(function (result) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - _this.broadcastQueries(); - return result; - })]; - } - this.broadcastQueries(); - return [2, { data: storeResult }]; - } - }); - }); - }; - QueryManager.prototype.markQueryResult = function (queryId, result, _a, fetchMoreForQueryId) { - var fetchPolicy = _a.fetchPolicy, variables = _a.variables, errorPolicy = _a.errorPolicy; - if (fetchPolicy === 'no-cache') { - this.setQuery(queryId, function () { return ({ - newData: { result: result.data, complete: true }, - }); }); - } - else { - this.dataStore.markQueryResult(result, this.getQuery(queryId).document, variables, fetchMoreForQueryId, errorPolicy === 'ignore' || errorPolicy === 'all'); - } - }; - QueryManager.prototype.queryListenerForObserver = function (queryId, options, observer) { - var _this = this; - function invoke(method, argument) { - if (observer[method]) { - try { - observer[method](argument); - } - catch (e) { - ts_invariant_1.invariant.error(e); - } - } - else if (method === 'error') { - ts_invariant_1.invariant.error(argument); - } - } - return function (queryStoreValue, newData) { - _this.invalidate(queryId, false); - if (!queryStoreValue) - return; - var _a = _this.getQuery(queryId), observableQuery = _a.observableQuery, document = _a.document; - var fetchPolicy = observableQuery - ? observableQuery.options.fetchPolicy - : options.fetchPolicy; - if (fetchPolicy === 'standby') - return; - var loading = networkStatus_1.isNetworkRequestInFlight(queryStoreValue.networkStatus); - var lastResult = observableQuery && observableQuery.getLastResult(); - var networkStatusChanged = !!(lastResult && - lastResult.networkStatus !== queryStoreValue.networkStatus); - var shouldNotifyIfLoading = options.returnPartialData || - (!newData && queryStoreValue.previousVariables) || - (networkStatusChanged && options.notifyOnNetworkStatusChange) || - fetchPolicy === 'cache-only' || - fetchPolicy === 'cache-and-network'; - if (loading && !shouldNotifyIfLoading) { - return; - } - var hasGraphQLErrors = arrays_1.isNonEmptyArray(queryStoreValue.graphQLErrors); - var errorPolicy = observableQuery - && observableQuery.options.errorPolicy - || options.errorPolicy - || 'none'; - if (errorPolicy === 'none' && hasGraphQLErrors || queryStoreValue.networkError) { - return invoke('error', new ApolloError_1.ApolloError({ - graphQLErrors: queryStoreValue.graphQLErrors, - networkError: queryStoreValue.networkError, - })); - } - try { - var data = void 0; - var isMissing = void 0; - if (newData) { - if (fetchPolicy !== 'no-cache' && fetchPolicy !== 'network-only') { - _this.setQuery(queryId, function () { return ({ newData: null }); }); - } - data = newData.result; - isMissing = !newData.complete; - } - else { - var lastError = observableQuery && observableQuery.getLastError(); - var errorStatusChanged = errorPolicy !== 'none' && - (lastError && lastError.graphQLErrors) !== - queryStoreValue.graphQLErrors; - if (lastResult && lastResult.data && !errorStatusChanged) { - data = lastResult.data; - isMissing = false; - } - else { - var diffResult = _this.dataStore.getCache().diff({ - query: document, - variables: queryStoreValue.previousVariables || - queryStoreValue.variables, - returnPartialData: true, - optimistic: true, - }); - data = diffResult.result; - isMissing = !diffResult.complete; - } - } - var stale = isMissing && !(options.returnPartialData || - fetchPolicy === 'cache-only'); - var resultFromStore = { - data: stale ? lastResult && lastResult.data : data, - loading: loading, - networkStatus: queryStoreValue.networkStatus, - stale: stale, - }; - if (errorPolicy === 'all' && hasGraphQLErrors) { - resultFromStore.errors = queryStoreValue.graphQLErrors; - } - invoke('next', resultFromStore); - } - catch (networkError) { - invoke('error', new ApolloError_1.ApolloError({ networkError: networkError })); - } - }; - }; - QueryManager.prototype.transform = function (document) { - var transformCache = this.transformCache; - if (!transformCache.has(document)) { - var cache = this.dataStore.getCache(); - var transformed = cache.transformDocument(document); - var forLink = apollo_utilities_1.removeConnectionDirectiveFromDocument(cache.transformForLink(transformed)); - var clientQuery = this.localState.clientQuery(transformed); - var serverQuery = this.localState.serverQuery(forLink); - var cacheEntry_1 = { - document: transformed, - hasClientExports: apollo_utilities_1.hasClientExports(transformed), - hasForcedResolvers: this.localState.shouldForceResolvers(transformed), - clientQuery: clientQuery, - serverQuery: serverQuery, - defaultVars: apollo_utilities_1.getDefaultValues(apollo_utilities_1.getOperationDefinition(transformed)), - }; - var add = function (doc) { - if (doc && !transformCache.has(doc)) { - transformCache.set(doc, cacheEntry_1); - } - }; - add(document); - add(transformed); - add(clientQuery); - add(serverQuery); - } - return transformCache.get(document); - }; - QueryManager.prototype.getVariables = function (document, variables) { - return tslib_1.__assign(tslib_1.__assign({}, this.transform(document).defaultVars), variables); - }; - QueryManager.prototype.watchQuery = function (options, shouldSubscribe) { - if (shouldSubscribe === void 0) { shouldSubscribe = true; } - ts_invariant_1.invariant(options.fetchPolicy !== 'standby', 'client.watchQuery cannot be called with fetchPolicy set to "standby"'); - options.variables = this.getVariables(options.query, options.variables); - if (typeof options.notifyOnNetworkStatusChange === 'undefined') { - options.notifyOnNetworkStatusChange = false; - } - var transformedOptions = tslib_1.__assign({}, options); - return new ObservableQuery_1.ObservableQuery({ - queryManager: this, - options: transformedOptions, - shouldSubscribe: shouldSubscribe, - }); - }; - QueryManager.prototype.query = function (options) { - var _this = this; - ts_invariant_1.invariant(options.query, 'query option is required. You must specify your GraphQL document ' + - 'in the query option.'); - ts_invariant_1.invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); - ts_invariant_1.invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); - ts_invariant_1.invariant(!options.pollInterval, 'pollInterval option only supported on watchQuery.'); - return new Promise(function (resolve, reject) { - var watchedQuery = _this.watchQuery(options, false); - _this.fetchQueryRejectFns.set("query:" + watchedQuery.queryId, reject); - watchedQuery - .result() - .then(resolve, reject) - .then(function () { - return _this.fetchQueryRejectFns.delete("query:" + watchedQuery.queryId); - }); - }); - }; - QueryManager.prototype.generateQueryId = function () { - return String(this.idCounter++); - }; - QueryManager.prototype.stopQueryInStore = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.broadcastQueries(); - }; - QueryManager.prototype.stopQueryInStoreNoBroadcast = function (queryId) { - this.stopPollingQuery(queryId); - this.queryStore.stopQuery(queryId); - this.invalidate(queryId); - }; - QueryManager.prototype.addQueryListener = function (queryId, listener) { - this.setQuery(queryId, function (_a) { - var listeners = _a.listeners; - listeners.add(listener); - return { invalidated: false }; - }); - }; - QueryManager.prototype.updateQueryWatch = function (queryId, document, options) { - var _this = this; - var cancel = this.getQuery(queryId).cancel; - if (cancel) - cancel(); - var previousResult = function () { - var previousResult = null; - var observableQuery = _this.getQuery(queryId).observableQuery; - if (observableQuery) { - var lastResult = observableQuery.getLastResult(); - if (lastResult) { - previousResult = lastResult.data; - } - } - return previousResult; - }; - return this.dataStore.getCache().watch({ - query: document, - variables: options.variables, - optimistic: true, - previousResult: previousResult, - callback: function (newData) { - _this.setQuery(queryId, function () { return ({ invalidated: true, newData: newData }); }); - }, - }); - }; - QueryManager.prototype.addObservableQuery = function (queryId, observableQuery) { - this.setQuery(queryId, function () { return ({ observableQuery: observableQuery }); }); - }; - QueryManager.prototype.removeObservableQuery = function (queryId) { - var cancel = this.getQuery(queryId).cancel; - this.setQuery(queryId, function () { return ({ observableQuery: null }); }); - if (cancel) - cancel(); - }; - QueryManager.prototype.clearStore = function () { - this.fetchQueryRejectFns.forEach(function (reject) { - reject(new ts_invariant_1.InvariantError('Store reset while query was in flight (not completed in link chain)')); - }); - var resetIds = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) - resetIds.push(queryId); - }); - this.queryStore.reset(resetIds); - this.mutationStore.reset(); - return this.dataStore.reset(); - }; - QueryManager.prototype.resetStore = function () { - var _this = this; - return this.clearStore().then(function () { - return _this.reFetchObservableQueries(); - }); - }; - QueryManager.prototype.reFetchObservableQueries = function (includeStandby) { - var _this = this; - if (includeStandby === void 0) { includeStandby = false; } - var observableQueryPromises = []; - this.queries.forEach(function (_a, queryId) { - var observableQuery = _a.observableQuery; - if (observableQuery) { - var fetchPolicy = observableQuery.options.fetchPolicy; - observableQuery.resetLastResults(); - if (fetchPolicy !== 'cache-only' && - (includeStandby || fetchPolicy !== 'standby')) { - observableQueryPromises.push(observableQuery.refetch()); - } - _this.setQuery(queryId, function () { return ({ newData: null }); }); - _this.invalidate(queryId); - } - }); - this.broadcastQueries(); - return Promise.all(observableQueryPromises); - }; - QueryManager.prototype.observeQuery = function (queryId, options, observer) { - this.addQueryListener(queryId, this.queryListenerForObserver(queryId, options, observer)); - return this.fetchQuery(queryId, options); - }; - QueryManager.prototype.startQuery = function (queryId, options, listener) { - ts_invariant_1.invariant.warn("The QueryManager.startQuery method has been deprecated"); - this.addQueryListener(queryId, listener); - this.fetchQuery(queryId, options) - .catch(function () { return undefined; }); - return queryId; - }; - QueryManager.prototype.startGraphQLSubscription = function (_a) { - var _this = this; - var query = _a.query, fetchPolicy = _a.fetchPolicy, variables = _a.variables; - query = this.transform(query).document; - variables = this.getVariables(query, variables); - var makeObservable = function (variables) { - return _this.getObservableFromLink(query, {}, variables, false).map(function (result) { - if (!fetchPolicy || fetchPolicy !== 'no-cache') { - _this.dataStore.markSubscriptionResult(result, query, variables); - _this.broadcastQueries(); - } - if (apollo_utilities_1.graphQLResultHasError(result)) { - throw new ApolloError_1.ApolloError({ - graphQLErrors: result.errors, - }); - } - return result; - }); - }; - if (this.transform(query).hasClientExports) { - var observablePromise_1 = this.localState.addExportedVariables(query, variables).then(makeObservable); - return new Observable_1.Observable(function (observer) { - var sub = null; - observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error); - return function () { return sub && sub.unsubscribe(); }; - }); - } - return makeObservable(variables); - }; - QueryManager.prototype.stopQuery = function (queryId) { - this.stopQueryNoBroadcast(queryId); - this.broadcastQueries(); - }; - QueryManager.prototype.stopQueryNoBroadcast = function (queryId) { - this.stopQueryInStoreNoBroadcast(queryId); - this.removeQuery(queryId); - }; - QueryManager.prototype.removeQuery = function (queryId) { - this.fetchQueryRejectFns.delete("query:" + queryId); - this.fetchQueryRejectFns.delete("fetchRequest:" + queryId); - this.getQuery(queryId).subscriptions.forEach(function (x) { return x.unsubscribe(); }); - this.queries.delete(queryId); - }; - QueryManager.prototype.getCurrentQueryResult = function (observableQuery, optimistic) { - if (optimistic === void 0) { optimistic = true; } - var _a = observableQuery.options, variables = _a.variables, query = _a.query, fetchPolicy = _a.fetchPolicy, returnPartialData = _a.returnPartialData; - var lastResult = observableQuery.getLastResult(); - var newData = this.getQuery(observableQuery.queryId).newData; - if (newData && newData.complete) { - return { data: newData.result, partial: false }; - } - if (fetchPolicy === 'no-cache' || fetchPolicy === 'network-only') { - return { data: undefined, partial: false }; - } - var _b = this.dataStore.getCache().diff({ - query: query, - variables: variables, - previousResult: lastResult ? lastResult.data : undefined, - returnPartialData: true, - optimistic: optimistic, - }), result = _b.result, complete = _b.complete; - return { - data: (complete || returnPartialData) ? result : void 0, - partial: !complete, - }; - }; - QueryManager.prototype.getQueryWithPreviousResult = function (queryIdOrObservable) { - var observableQuery; - if (typeof queryIdOrObservable === 'string') { - var foundObserveableQuery = this.getQuery(queryIdOrObservable).observableQuery; - ts_invariant_1.invariant(foundObserveableQuery, "ObservableQuery with this id doesn't exist: " + queryIdOrObservable); - observableQuery = foundObserveableQuery; - } - else { - observableQuery = queryIdOrObservable; - } - var _a = observableQuery.options, variables = _a.variables, query = _a.query; - return { - previousResult: this.getCurrentQueryResult(observableQuery, false).data, - variables: variables, - document: query, - }; - }; - QueryManager.prototype.broadcastQueries = function () { - var _this = this; - this.onBroadcast(); - this.queries.forEach(function (info, id) { - if (info.invalidated) { - info.listeners.forEach(function (listener) { - if (listener) { - listener(_this.queryStore.get(id), info.newData); - } - }); - } - }); - }; - QueryManager.prototype.getLocalState = function () { - return this.localState; - }; - QueryManager.prototype.getObservableFromLink = function (query, context, variables, deduplication) { - var _this = this; - if (deduplication === void 0) { deduplication = this.queryDeduplication; } - var observable; - var serverQuery = this.transform(query).serverQuery; - if (serverQuery) { - var _a = this, inFlightLinkObservables_1 = _a.inFlightLinkObservables, link = _a.link; - var operation = { - query: serverQuery, - variables: variables, - operationName: apollo_utilities_1.getOperationName(serverQuery) || void 0, - context: this.prepareContext(tslib_1.__assign(tslib_1.__assign({}, context), { forceFetch: !deduplication })), - }; - context = operation.context; - if (deduplication) { - var byVariables_1 = inFlightLinkObservables_1.get(serverQuery) || new Map(); - inFlightLinkObservables_1.set(serverQuery, byVariables_1); - var varJson_1 = JSON.stringify(variables); - observable = byVariables_1.get(varJson_1); - if (!observable) { - byVariables_1.set(varJson_1, observable = observables_1.multiplex(apollo_link_1.execute(link, operation))); - var cleanup = function () { - byVariables_1.delete(varJson_1); - if (!byVariables_1.size) - inFlightLinkObservables_1.delete(serverQuery); - cleanupSub_1.unsubscribe(); - }; - var cleanupSub_1 = observable.subscribe({ - next: cleanup, - error: cleanup, - complete: cleanup, - }); - } - } - else { - observable = observables_1.multiplex(apollo_link_1.execute(link, operation)); - } - } - else { - observable = Observable_1.Observable.of({ data: {} }); - context = this.prepareContext(context); - } - var clientQuery = this.transform(query).clientQuery; - if (clientQuery) { - observable = observables_1.asyncMap(observable, function (result) { - return _this.localState.runResolvers({ - document: clientQuery, - remoteResult: result, - context: context, - variables: variables, - }); - }); - } - return observable; - }; - QueryManager.prototype.fetchRequest = function (_a) { - var _this = this; - var requestId = _a.requestId, queryId = _a.queryId, document = _a.document, options = _a.options, fetchMoreForQueryId = _a.fetchMoreForQueryId; - var variables = options.variables, _b = options.errorPolicy, errorPolicy = _b === void 0 ? 'none' : _b, fetchPolicy = options.fetchPolicy; - var resultFromStore; - var errorsFromStore; - return new Promise(function (resolve, reject) { - var observable = _this.getObservableFromLink(document, options.context, variables); - var fqrfId = "fetchRequest:" + queryId; - _this.fetchQueryRejectFns.set(fqrfId, reject); - var cleanup = function () { - _this.fetchQueryRejectFns.delete(fqrfId); - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.delete(subscription); - }); - }; - var subscription = observable.map(function (result) { - if (requestId >= _this.getQuery(queryId).lastRequestId) { - _this.markQueryResult(queryId, result, options, fetchMoreForQueryId); - _this.queryStore.markQueryResult(queryId, result, fetchMoreForQueryId); - _this.invalidate(queryId); - _this.invalidate(fetchMoreForQueryId); - _this.broadcastQueries(); - } - if (errorPolicy === 'none' && arrays_1.isNonEmptyArray(result.errors)) { - return reject(new ApolloError_1.ApolloError({ - graphQLErrors: result.errors, - })); - } - if (errorPolicy === 'all') { - errorsFromStore = result.errors; - } - if (fetchMoreForQueryId || fetchPolicy === 'no-cache') { - resultFromStore = result.data; - } - else { - var _a = _this.dataStore.getCache().diff({ - variables: variables, - query: document, - optimistic: false, - returnPartialData: true, - }), result_1 = _a.result, complete = _a.complete; - if (complete || options.returnPartialData) { - resultFromStore = result_1; - } - } - }).subscribe({ - error: function (error) { - cleanup(); - reject(error); - }, - complete: function () { - cleanup(); - resolve({ - data: resultFromStore, - errors: errorsFromStore, - loading: false, - networkStatus: networkStatus_1.NetworkStatus.ready, - stale: false, - }); - }, - }); - _this.setQuery(queryId, function (_a) { - var subscriptions = _a.subscriptions; - subscriptions.add(subscription); - }); - }); - }; - QueryManager.prototype.getQuery = function (queryId) { - return (this.queries.get(queryId) || { - listeners: new Set(), - invalidated: false, - document: null, - newData: null, - lastRequestId: 1, - observableQuery: null, - subscriptions: new Set(), - }); - }; - QueryManager.prototype.setQuery = function (queryId, updater) { - var prev = this.getQuery(queryId); - var newInfo = tslib_1.__assign(tslib_1.__assign({}, prev), updater(prev)); - this.queries.set(queryId, newInfo); - }; - QueryManager.prototype.invalidate = function (queryId, invalidated) { - if (invalidated === void 0) { invalidated = true; } - if (queryId) { - this.setQuery(queryId, function () { return ({ invalidated: invalidated }); }); - } - }; - QueryManager.prototype.prepareContext = function (context) { - if (context === void 0) { context = {}; } - var newContext = this.localState.prepareContext(context); - return tslib_1.__assign(tslib_1.__assign({}, newContext), { clientAwareness: this.clientAwareness }); - }; - QueryManager.prototype.checkInFlight = function (queryId) { - var query = this.queryStore.get(queryId); - return (query && - query.networkStatus !== networkStatus_1.NetworkStatus.ready && - query.networkStatus !== networkStatus_1.NetworkStatus.error); - }; - QueryManager.prototype.startPollingQuery = function (options, queryId, listener) { - var _this = this; - var pollInterval = options.pollInterval; - ts_invariant_1.invariant(pollInterval, 'Attempted to start a polling query without a polling interval.'); - if (!this.ssrMode) { - var info = this.pollingInfoByQueryId.get(queryId); - if (!info) { - this.pollingInfoByQueryId.set(queryId, (info = {})); - } - info.interval = pollInterval; - info.options = tslib_1.__assign(tslib_1.__assign({}, options), { fetchPolicy: 'network-only' }); - var maybeFetch_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - if (info) { - if (_this.checkInFlight(queryId)) { - poll_1(); - } - else { - _this.fetchQuery(queryId, info.options, types_1.FetchType.poll).then(poll_1, poll_1); - } - } - }; - var poll_1 = function () { - var info = _this.pollingInfoByQueryId.get(queryId); - if (info) { - clearTimeout(info.timeout); - info.timeout = setTimeout(maybeFetch_1, info.interval); - } - }; - if (listener) { - this.addQueryListener(queryId, listener); - } - poll_1(); - } - return queryId; - }; - QueryManager.prototype.stopPollingQuery = function (queryId) { - this.pollingInfoByQueryId.delete(queryId); - }; - return QueryManager; -}()); -exports.QueryManager = QueryManager; -//# sourceMappingURL=QueryManager.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/QueryManager.js.map b/node_modules/apollo-client/core/QueryManager.js.map deleted file mode 100644 index c85ceb3..0000000 --- a/node_modules/apollo-client/core/QueryManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"QueryManager.js","sourceRoot":"","sources":["../../src/core/QueryManager.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAG/D,qDAS0B;AAE1B,6CAAyD;AAEzD,qDAAmE;AACnE,iDAAwE;AAExE,+CAAkD;AAClD,2CAA8D;AAS9D,qDAAoD;AACpD,iDAA0E;AAC1E,iCAKiB;AACjB,2CAA0C;AAC1C,mDAA0D;AAC1D,yCAAiD;AAEzC,IAAA,gDAAc,CAAsB;AAgB5C;IA6BE,sBAAY,EAkBX;YAjBC,cAAI,EACJ,0BAA0B,EAA1B,+CAA0B,EAC1B,gBAAK,EACL,mBAA6B,EAA7B,oEAA6B,EAC7B,eAAe,EAAf,oCAAe,EACf,uBAAoB,EAApB,yCAAoB,EACpB,0BAAU,EACV,kDAAsB;QAnCjB,kBAAa,GAAkB,IAAI,yBAAa,EAAE,CAAC;QACnD,eAAU,GAAe,IAAI,oBAAU,EAAE,CAAC;QAKzC,oBAAe,GAA2B,EAAE,CAAC;QAQ7C,cAAS,GAAG,CAAC,CAAC;QAId,YAAO,GAA2B,IAAI,GAAG,EAAE,CAAC;QAO5C,wBAAmB,GAAG,IAAI,GAAG,EAAoB,CAAC;QAujBlD,mBAAc,GAAG,IAAI,CAAC,gCAAa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CAAC,OAAO,CAAC,CAAC;oBAC3B,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,YAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACtD;YACH,CAAC,CAAC;YAEF,IAAI,QAAQ,EAAE;gBACZ,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;aAC1C;YAED,MAAI,EAAE,CAAC;SACR;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,uCAAgB,GAAvB,UAAwB,OAAe;QACrC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IACH,mBAAC;AAAD,CAAC,AAt0CD,IAs0CC;AAt0CY,oCAAY"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.d.ts b/node_modules/apollo-client/core/networkStatus.d.ts deleted file mode 100644 index 4112caf..0000000 --- a/node_modules/apollo-client/core/networkStatus.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare enum NetworkStatus { - loading = 1, - setVariables = 2, - fetchMore = 3, - refetch = 4, - poll = 6, - ready = 7, - error = 8 -} -export declare function isNetworkRequestInFlight(networkStatus: NetworkStatus): boolean; -//# sourceMappingURL=networkStatus.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.d.ts.map b/node_modules/apollo-client/core/networkStatus.d.ts.map deleted file mode 100644 index 9623964..0000000 --- a/node_modules/apollo-client/core/networkStatus.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"networkStatus.d.ts","sourceRoot":"","sources":["../src/core/networkStatus.ts"],"names":[],"mappings":"AAGA,oBAAY,aAAa;IAMvB,OAAO,IAAI;IAMX,YAAY,IAAI;IAMhB,SAAS,IAAI;IAMb,OAAO,IAAI;IAOX,IAAI,IAAI;IAKR,KAAK,IAAI;IAKT,KAAK,IAAI;CACV;AAMD,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAET"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.js b/node_modules/apollo-client/core/networkStatus.js deleted file mode 100644 index 262f964..0000000 --- a/node_modules/apollo-client/core/networkStatus.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var NetworkStatus; -(function (NetworkStatus) { - NetworkStatus[NetworkStatus["loading"] = 1] = "loading"; - NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables"; - NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore"; - NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch"; - NetworkStatus[NetworkStatus["poll"] = 6] = "poll"; - NetworkStatus[NetworkStatus["ready"] = 7] = "ready"; - NetworkStatus[NetworkStatus["error"] = 8] = "error"; -})(NetworkStatus = exports.NetworkStatus || (exports.NetworkStatus = {})); -function isNetworkRequestInFlight(networkStatus) { - return networkStatus < 7; -} -exports.isNetworkRequestInFlight = isNetworkRequestInFlight; -//# sourceMappingURL=networkStatus.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/networkStatus.js.map b/node_modules/apollo-client/core/networkStatus.js.map deleted file mode 100644 index ebe2eff..0000000 --- a/node_modules/apollo-client/core/networkStatus.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"networkStatus.js","sourceRoot":"","sources":["../../src/core/networkStatus.ts"],"names":[],"mappings":";;AAGA,IAAY,aA0CX;AA1CD,WAAY,aAAa;IAMvB,uDAAW,CAAA;IAMX,iEAAgB,CAAA;IAMhB,2DAAa,CAAA;IAMb,uDAAW,CAAA;IAOX,iDAAQ,CAAA;IAKR,mDAAS,CAAA;IAKT,mDAAS,CAAA;AACX,CAAC,EA1CW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA0CxB;AAMD,SAAgB,wBAAwB,CACtC,aAA4B;IAE5B,OAAO,aAAa,GAAG,CAAC,CAAC;AAC3B,CAAC;AAJD,4DAIC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.d.ts b/node_modules/apollo-client/core/types.d.ts deleted file mode 100644 index 2816c32..0000000 --- a/node_modules/apollo-client/core/types.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { FetchResult } from 'apollo-link'; -import { DocumentNode, GraphQLError } from 'graphql'; -import { QueryStoreValue } from '../data/queries'; -import { NetworkStatus } from './networkStatus'; -import { Resolver } from './LocalState'; -export declare type QueryListener = (queryStoreValue: QueryStoreValue, newData?: any, forceResolvers?: boolean) => void; -export declare type OperationVariables = { - [key: string]: any; -}; -export declare type PureQueryOptions = { - query: DocumentNode; - variables?: { - [key: string]: any; - }; - context?: any; -}; -export declare type ApolloQueryResult = { - data: T; - errors?: ReadonlyArray; - loading: boolean; - networkStatus: NetworkStatus; - stale: boolean; -}; -export declare enum FetchType { - normal = 1, - refetch = 2, - poll = 3 -} -export declare type MutationQueryReducer = (previousResult: Record, options: { - mutationResult: FetchResult; - queryName: string | undefined; - queryVariables: Record; -}) => Record; -export declare type MutationQueryReducersMap = { - [queryName: string]: MutationQueryReducer; -}; -export interface Resolvers { - [key: string]: { - [field: string]: Resolver; - }; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.d.ts.map b/node_modules/apollo-client/core/types.d.ts.map deleted file mode 100644 index 04c69fb..0000000 --- a/node_modules/apollo-client/core/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,oBAAY,aAAa,GAAG,CAC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GAAG;QACb,CAAE,KAAK,EAAE,MAAM,GAAI,QAAQ,CAAC;KAC7B,CAAC;CACH"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.js b/node_modules/apollo-client/core/types.js deleted file mode 100644 index a0437d7..0000000 --- a/node_modules/apollo-client/core/types.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var FetchType; -(function (FetchType) { - FetchType[FetchType["normal"] = 1] = "normal"; - FetchType[FetchType["refetch"] = 2] = "refetch"; - FetchType[FetchType["poll"] = 3] = "poll"; -})(FetchType = exports.FetchType || (exports.FetchType = {})); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/types.js.map b/node_modules/apollo-client/core/types.js.map deleted file mode 100644 index 1877806..0000000 --- a/node_modules/apollo-client/core/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":";;AA6BA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,6CAAU,CAAA;IACV,+CAAW,CAAA;IACX,yCAAQ,CAAA;AACV,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.d.ts b/node_modules/apollo-client/core/watchQueryOptions.d.ts deleted file mode 100644 index 2e702c6..0000000 --- a/node_modules/apollo-client/core/watchQueryOptions.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { DocumentNode } from 'graphql'; -import { FetchResult } from 'apollo-link'; -import { DataProxy } from 'apollo-cache'; -import { MutationQueryReducersMap } from './types'; -import { PureQueryOptions, OperationVariables } from './types'; -export declare type FetchPolicy = 'cache-first' | 'network-only' | 'cache-only' | 'no-cache' | 'standby'; -export declare type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network'; -export declare type ErrorPolicy = 'none' | 'ignore' | 'all'; -export interface QueryBaseOptions { - query: DocumentNode; - variables?: TVariables; - errorPolicy?: ErrorPolicy; - fetchResults?: boolean; - metadata?: any; - context?: any; -} -export interface QueryOptions extends QueryBaseOptions { - fetchPolicy?: FetchPolicy; -} -export interface ModifiableWatchQueryOptions extends QueryBaseOptions { - pollInterval?: number; - notifyOnNetworkStatusChange?: boolean; - returnPartialData?: boolean; -} -export interface WatchQueryOptions extends QueryBaseOptions, ModifiableWatchQueryOptions { - fetchPolicy?: WatchQueryFetchPolicy; -} -export interface FetchMoreQueryOptions { - query?: DocumentNode; - variables?: Pick; - context?: any; -} -export declare type UpdateQueryFn = (previousQueryResult: TData, options: { - subscriptionData: { - data: TSubscriptionData; - }; - variables?: TSubscriptionVariables; -}) => TData; -export declare type SubscribeToMoreOptions = { - document: DocumentNode; - variables?: TSubscriptionVariables; - updateQuery?: UpdateQueryFn; - onError?: (error: Error) => void; -}; -export interface SubscriptionOptions { - query: DocumentNode; - variables?: TVariables; - fetchPolicy?: FetchPolicy; -} -export declare type RefetchQueryDescription = Array; -export interface MutationBaseOptions { - optimisticResponse?: T | ((vars: TVariables) => T); - updateQueries?: MutationQueryReducersMap; - refetchQueries?: ((result: FetchResult) => RefetchQueryDescription) | RefetchQueryDescription; - awaitRefetchQueries?: boolean; - update?: MutationUpdaterFn; - errorPolicy?: ErrorPolicy; - variables?: TVariables; -} -export interface MutationOptions extends MutationBaseOptions { - mutation: DocumentNode; - context?: any; - fetchPolicy?: FetchPolicy; -} -export declare type MutationUpdaterFn = (proxy: DataProxy, mutationResult: FetchResult) => void; -//# sourceMappingURL=watchQueryOptions.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.d.ts.map b/node_modules/apollo-client/core/watchQueryOptions.d.ts.map deleted file mode 100644 index afbd092..0000000 --- a/node_modules/apollo-client/core/watchQueryOptions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"watchQueryOptions.d.ts","sourceRoot":"","sources":["../src/core/watchQueryOptions.ts"],"names":[],"mapp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,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,UAAU,KAAK,CAAC,CAAC,CAAC;IAQnD,aAAa,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAU5C,cAAc,CAAC,EACX,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,uBAAuB,CAAC,GACrD,uBAAuB,CAAC;IAU5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAyB9B,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAK9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAM1B,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,eAAe,CAC9B,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC1B,UAAU,GAAG,kBAAkB,CAC/B,SAAQ,mBAAmB,CAAC,CAAC,EAAE,UAAU,CAAC;IAK1C,QAAQ,EAAE,YAAY,CAAC;IAYvB,OAAO,CAAC,EAAE,GAAG,CAAC;IAKd,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAGD,oBAAY,iBAAiB,CAAC,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI,CAC1D,KAAK,EAAE,SAAS,EAChB,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,KAC3B,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.js b/node_modules/apollo-client/core/watchQueryOptions.js deleted file mode 100644 index 7a61e2e..0000000 --- a/node_modules/apollo-client/core/watchQueryOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=watchQueryOptions.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/core/watchQueryOptions.js.map b/node_modules/apollo-client/core/watchQueryOptions.js.map deleted file mode 100644 index 9ad66e3..0000000 --- a/node_modules/apollo-client/core/watchQueryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"watchQueryOptions.js","sourceRoot":"","sources":["../../src/core/watchQueryOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.d.ts b/node_modules/apollo-client/data/mutations.d.ts deleted file mode 100644 index c7cbafa..0000000 --- a/node_modules/apollo-client/data/mutations.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { DocumentNode } from 'graphql'; -export declare class MutationStore { - private store; - getStore(): { - [mutationId: string]: MutationStoreValue; - }; - get(mutationId: string): MutationStoreValue; - initMutation(mutationId: string, mutation: DocumentNode, variables: Object | undefined): void; - markMutationError(mutationId: string, error: Error): void; - markMutationResult(mutationId: string): void; - reset(): void; -} -export interface MutationStoreValue { - mutation: DocumentNode; - variables: Object; - loading: boolean; - error: Error | null; -} -//# sourceMappingURL=mutations.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.d.ts.map b/node_modules/apollo-client/data/mutations.d.ts.map deleted file mode 100644 index cd6b572..0000000 --- a/node_modules/apollo-client/data/mutations.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../src/data/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAoD;IAE1D,QAAQ,IAAI;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAAA;KAAE;IAIxD,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB;IAI3C,YAAY,CACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,MAAM,GAAG,SAAS;IAUxB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;IAQlD,kBAAkB,CAAC,UAAU,EAAE,MAAM;IAQrC,KAAK;CAGb;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.js b/node_modules/apollo-client/data/mutations.js deleted file mode 100644 index 8779300..0000000 --- a/node_modules/apollo-client/data/mutations.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var MutationStore = (function () { - function MutationStore() { - this.store = {}; - } - MutationStore.prototype.getStore = function () { - return this.store; - }; - MutationStore.prototype.get = function (mutationId) { - return this.store[mutationId]; - }; - MutationStore.prototype.initMutation = function (mutationId, mutation, variables) { - this.store[mutationId] = { - mutation: mutation, - variables: variables || {}, - loading: true, - error: null, - }; - }; - MutationStore.prototype.markMutationError = function (mutationId, error) { - var mutation = this.store[mutationId]; - if (mutation) { - mutation.loading = false; - mutation.error = error; - } - }; - MutationStore.prototype.markMutationResult = function (mutationId) { - var mutation = this.store[mutationId]; - if (mutation) { - mutation.loading = false; - mutation.error = null; - } - }; - MutationStore.prototype.reset = function () { - this.store = {}; - }; - return MutationStore; -}()); -exports.MutationStore = MutationStore; -//# sourceMappingURL=mutations.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/mutations.js.map b/node_modules/apollo-client/data/mutations.js.map deleted file mode 100644 index 1f5364f..0000000 --- a/node_modules/apollo-client/data/mutations.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/data/mutations.ts"],"names":[],"mappings":";;AAEA;IAAA;QACU,UAAK,GAAiD,EAAE,CAAC;IA0CnE,CAAC;IAxCQ,gCAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,2BAAG,GAAV,UAAW,UAAkB;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;IAEM,oCAAY,GAAnB,UACE,UAAkB,EAClB,QAAsB,EACtB,SAA6B;QAE7B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG;YACvB,QAAQ,UAAA;YACR,SAAS,EAAE,SAAS,IAAI,EAAE;YAC1B,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;IAEM,yCAAiB,GAAxB,UAAyB,UAAkB,EAAE,KAAY;QACvD,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;SACxB;IACH,CAAC;IAEM,0CAAkB,GAAzB,UAA0B,UAAkB;QAC1C,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;SACvB;IACH,CAAC;IAEM,6BAAK,GAAZ;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IACH,oBAAC;AAAD,CAAC,AA3CD,IA2CC;AA3CY,sCAAa"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.d.ts b/node_modules/apollo-client/data/queries.d.ts deleted file mode 100644 index 685ea34..0000000 --- a/node_modules/apollo-client/data/queries.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { DocumentNode, GraphQLError, ExecutionResult } from 'graphql'; -import { NetworkStatus } from '../core/networkStatus'; -export declare type QueryStoreValue = { - document: DocumentNode; - variables: Object; - previousVariables?: Object | null; - networkStatus: NetworkStatus; - networkError?: Error | null; - graphQLErrors?: ReadonlyArray; - metadata: any; -}; -export declare class QueryStore { - private store; - getStore(): { - [queryId: string]: QueryStoreValue; - }; - get(queryId: string): QueryStoreValue; - initQuery(query: { - queryId: string; - document: DocumentNode; - storePreviousVariables: boolean; - variables: Object; - isPoll: boolean; - isRefetch: boolean; - metadata: any; - fetchMoreForQueryId: string | undefined; - }): void; - markQueryResult(queryId: string, result: ExecutionResult, fetchMoreForQueryId: string | undefined): void; - markQueryError(queryId: string, error: Error, fetchMoreForQueryId: string | undefined): void; - markQueryResultClient(queryId: string, complete: boolean): void; - stopQuery(queryId: string): void; - reset(observableQueryIds: string[]): void; -} -//# sourceMappingURL=queries.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.d.ts.map b/node_modules/apollo-client/data/queries.d.ts.map deleted file mode 100644 index 70c3b71..0000000 --- a/node_modules/apollo-client/data/queries.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/data/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,oBAAY,eAAe,GAAG;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5C,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,qBAAa,UAAU;IACrB,OAAO,CAAC,KAAK,CAA8C;IAEpD,QAAQ,IAAI;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE;IAIlD,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe;IAIrC,SAAS,CAAC,KAAK,EAAE;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,YAAY,CAAC;QACvB,sBAAsB,EAAE,OAAO,CAAC;QAChC,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,GAAG,CAAC;QACd,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;KACzC;IA2EM,eAAe,CACpB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,eAAe,EACvB,mBAAmB,EAAE,MAAM,GAAG,SAAS;IAoBlC,cAAc,CACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,KAAK,EACZ,mBAAmB,EAAE,MAAM,GAAG,SAAS;IAelC,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;IAWxD,SAAS,CAAC,OAAO,EAAE,MAAM;IAIzB,KAAK,CAAC,kBAAkB,EAAE,MAAM,EAAE;CAU1C"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.js b/node_modules/apollo-client/data/queries.js deleted file mode 100644 index 22eadff..0000000 --- a/node_modules/apollo-client/data/queries.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var apollo_utilities_1 = require("apollo-utilities"); -var ts_invariant_1 = require("ts-invariant"); -var networkStatus_1 = require("../core/networkStatus"); -var arrays_1 = require("../util/arrays"); -var QueryStore = (function () { - function QueryStore() { - this.store = {}; - } - QueryStore.prototype.getStore = function () { - return this.store; - }; - QueryStore.prototype.get = function (queryId) { - return this.store[queryId]; - }; - QueryStore.prototype.initQuery = function (query) { - var previousQuery = this.store[query.queryId]; - ts_invariant_1.invariant(!previousQuery || - previousQuery.document === query.document || - apollo_utilities_1.isEqual(previousQuery.document, query.document), 'Internal Error: may not update existing query string in store'); - var isSetVariables = false; - var previousVariables = null; - if (query.storePreviousVariables && - previousQuery && - previousQuery.networkStatus !== networkStatus_1.NetworkStatus.loading) { - if (!apollo_utilities_1.isEqual(previousQuery.variables, query.variables)) { - isSetVariables = true; - previousVariables = previousQuery.variables; - } - } - var networkStatus; - if (isSetVariables) { - networkStatus = networkStatus_1.NetworkStatus.setVariables; - } - else if (query.isPoll) { - networkStatus = networkStatus_1.NetworkStatus.poll; - } - else if (query.isRefetch) { - networkStatus = networkStatus_1.NetworkStatus.refetch; - } - else { - networkStatus = networkStatus_1.NetworkStatus.loading; - } - var graphQLErrors = []; - if (previousQuery && previousQuery.graphQLErrors) { - graphQLErrors = previousQuery.graphQLErrors; - } - this.store[query.queryId] = { - document: query.document, - variables: query.variables, - previousVariables: previousVariables, - networkError: null, - graphQLErrors: graphQLErrors, - networkStatus: networkStatus, - metadata: query.metadata, - }; - if (typeof query.fetchMoreForQueryId === 'string' && - this.store[query.fetchMoreForQueryId]) { - this.store[query.fetchMoreForQueryId].networkStatus = - networkStatus_1.NetworkStatus.fetchMore; - } - }; - QueryStore.prototype.markQueryResult = function (queryId, result, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) - return; - this.store[queryId].networkError = null; - this.store[queryId].graphQLErrors = arrays_1.isNonEmptyArray(result.errors) ? result.errors : []; - this.store[queryId].previousVariables = null; - this.store[queryId].networkStatus = networkStatus_1.NetworkStatus.ready; - if (typeof fetchMoreForQueryId === 'string' && - this.store[fetchMoreForQueryId]) { - this.store[fetchMoreForQueryId].networkStatus = networkStatus_1.NetworkStatus.ready; - } - }; - QueryStore.prototype.markQueryError = function (queryId, error, fetchMoreForQueryId) { - if (!this.store || !this.store[queryId]) - return; - this.store[queryId].networkError = error; - this.store[queryId].networkStatus = networkStatus_1.NetworkStatus.error; - if (typeof fetchMoreForQueryId === 'string') { - this.markQueryResultClient(fetchMoreForQueryId, true); - } - }; - QueryStore.prototype.markQueryResultClient = function (queryId, complete) { - var storeValue = this.store && this.store[queryId]; - if (storeValue) { - storeValue.networkError = null; - storeValue.previousVariables = null; - if (complete) { - storeValue.networkStatus = networkStatus_1.NetworkStatus.ready; - } - } - }; - QueryStore.prototype.stopQuery = function (queryId) { - delete this.store[queryId]; - }; - QueryStore.prototype.reset = function (observableQueryIds) { - var _this = this; - Object.keys(this.store).forEach(function (queryId) { - if (observableQueryIds.indexOf(queryId) < 0) { - _this.stopQuery(queryId); - } - else { - _this.store[queryId].networkStatus = networkStatus_1.NetworkStatus.loading; - } - }); - }; - return QueryStore; -}()); -exports.QueryStore = QueryStore; -//# sourceMappingURL=queries.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/queries.js.map b/node_modules/apollo-client/data/queries.js.map deleted file mode 100644 index 8e0c751..0000000 --- a/node_modules/apollo-client/data/queries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/data/queries.ts"],"names":[],"mappings":";;AACA,qDAA2C;AAC3C,6CAAyC;AACzC,uDAAsD;AACtD,yCAAiD;AAYjD;IAAA;QACU,UAAK,GAA2C,EAAE,CAAC;IAgK7D,CAAC;IA9JQ,6BAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,wBAAG,GAAV,UAAW,OAAe;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAEM,8BAAS,GAAhB,UAAiB,KAShB;QACC,IAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAKhD,wBAAS,CACP,CAAC,aAAa;YACd,aAAa,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;YACzC,0BAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAC/C,+DAA+D,CAChE,CAAC;QAEF,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,IAAI,iBAAiB,GAAkB,IAAI,CAAC;QAC5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,QAAiB;QAC7D,IAAM,UAAU,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrD,IAAI,UAAU,EAAE;YACd,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC;YAC/B,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC;YACpC,IAAI,QAAQ,EAAE;gBACZ,UAAU,CAAC,aAAa,GAAG,6BAAa,CAAC,KAAK,CAAC;aAChD;SACF;IACH,CAAC;IAEM,8BAAS,GAAhB,UAAiB,OAAe;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAEM,0BAAK,GAAZ,UAAa,kBAA4B;QAAzC,iBASC;QARC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAA,OAAO;YACrC,IAAI,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBAC3C,KAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;aACzB;iBAAM;gBAEL,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,aAAa,GAAG,6BAAa,CAAC,OAAO,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AAjKD,IAiKC;AAjKY,gCAAU"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.d.ts b/node_modules/apollo-client/data/store.d.ts deleted file mode 100644 index 3363df4..0000000 --- a/node_modules/apollo-client/data/store.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { ExecutionResult, DocumentNode } from 'graphql'; -import { ApolloCache, DataProxy } from 'apollo-cache'; -import { QueryStoreValue } from '../data/queries'; -import { MutationQueryReducer } from '../core/types'; -export declare type QueryWithUpdater = { - updater: MutationQueryReducer; - query: QueryStoreValue; -}; -export interface DataWrite { - rootId: string; - result: any; - document: DocumentNode; - operationName: string | null; - variables: Object; -} -export declare class DataStore { - private cache; - constructor(initialCache: ApolloCache); - getCache(): ApolloCache; - markQueryResult(result: ExecutionResult, document: DocumentNode, variables: any, fetchMoreForQueryId: string | undefined, ignoreErrors?: boolean): void; - markSubscriptionResult(result: ExecutionResult, document: DocumentNode, variables: any): void; - markMutationInit(mutation: { - mutationId: string; - document: DocumentNode; - variables: any; - updateQueries: { - [queryId: string]: QueryWithUpdater; - }; - update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined; - optimisticResponse: Object | Function | undefined; - }): void; - markMutationResult(mutation: { - mutationId: string; - result: ExecutionResult; - document: DocumentNode; - variables: any; - updateQueries: { - [queryId: string]: QueryWithUpdater; - }; - update: ((proxy: DataProxy, mutationResult: Object) => void) | undefined; - }): void; - markMutationComplete({ mutationId, optimisticResponse, }: { - mutationId: string; - optimisticResponse?: any; - }): void; - markUpdateQueryResult(document: DocumentNode, variables: any, newResult: any): void; - reset(): Promise; -} -//# sourceMappingURL=store.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.d.ts.map b/node_modules/apollo-client/data/store.d.ts.map deleted file mode 100644 index 7f0e559..0000000 --- a/node_modules/apollo-client/data/store.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/data/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,WAAW,EAAS,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,oBAAY,gBAAgB,GAAG;IAC7B,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACtC,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,M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SAAS,CAAC;KAC1E;IA4DM,oBAAoB,CAAC,EAC1B,UAAU,EACV,kBAAkB,GACnB,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,CAAC,EAAE,GAAG,CAAC;KAC1B;IAMM,qBAAqB,CAC1B,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,GAAG;IAUT,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG9B"} \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.js b/node_modules/apollo-client/data/store.js deleted file mode 100644 index aecfa79..0000000 --- a/node_modules/apollo-client/data/store.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var apollo_utilities_1 = require("apollo-utilities"); -var DataStore = (function () { - function DataStore(initialCache) { - this.cache = initialCache; - } - DataStore.prototype.getCache = function () { - return this.cache; - }; - DataStore.prototype.markQueryResult = function (result, document, variables, fetchMoreForQueryId, ignoreErrors) { - if (ignoreErrors === void 0) { ignoreErrors = false; } - var writeWithErrors = !apollo_utilities_1.graphQLResultHasError(result); - if (ignoreErrors && apollo_utilities_1.graphQLResultHasError(result) && result.data) { - writeWithErrors = true; - } - if (!fetchMoreForQueryId && writeWithErrors) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_QUERY', - query: document, - variables: variables, - }); - } - }; - DataStore.prototype.markSubscriptionResult = function (result, document, variables) { - if (!apollo_utilities_1.graphQLResultHasError(result)) { - this.cache.write({ - result: result.data, - dataId: 'ROOT_SUBSCRIPTION', - query: document, - variables: variables, - }); - } - }; - DataStore.prototype.markMutationInit = function (mutation) { - var _this = this; - if (mutation.optimisticResponse) { - var optimistic_1; - if (typeof mutation.optimisticResponse === 'function') { - optimistic_1 = mutation.optimisticResponse(mutation.variables); - } - else { - optimistic_1 = mutation.optimisticResponse; - } - this.cache.recordOptimisticTransaction(function (c) { - var orig = _this.cache; - _this.cache = c; - try { - _this.markMutationResult({ - mutationId: mutation.mutationId, - result: { data: optimistic_1 }, - document: mutation.document, - variables: mutation.variables, - updateQueries: mutation.updateQueries, - update: mutation.update, - }); - } - finally { - _this.cache = orig; - } - }, mutation.mutationId); - } - }; - DataStore.prototype.markMutationResult = function (mutation) { - var _this = this; - if (!apollo_utilities_1.graphQLResultHasError(mutation.result)) { - var cacheWrites_1 = [{ - result: mutation.result.data, - dataId: 'ROOT_MUTATION', - query: mutation.document, - variables: mutation.variables, - }]; - var updateQueries_1 = mutation.updateQueries; - if (updateQueries_1) { - Object.keys(updateQueries_1).forEach(function (id) { - var _a = updateQueries_1[id], query = _a.query, updater = _a.updater; - var _b = _this.cache.diff({ - query: query.document, - variables: query.variables, - returnPartialData: true, - optimistic: false, - }), currentQueryResult = _b.result, complete = _b.complete; - if (complete) { - var nextQueryResult = apollo_utilities_1.tryFunctionOrLogError(function () { - return updater(currentQueryResult, { - mutationResult: mutation.result, - queryName: apollo_utilities_1.getOperationName(query.document) || undefined, - queryVariables: query.variables, - }); - }); - if (nextQueryResult) { - cacheWrites_1.push({ - result: nextQueryResult, - dataId: 'ROOT_QUERY', - query: query.document, - variables: query.variables, - }); - } - } - }); - } - this.cache.performTransaction(function (c) { - cacheWrites_1.forEach(function (write) { return c.write(write); }); - var update = mutation.update; - if (update) { - apollo_utilities_1.tryFunctionOrLogError(function () { return update(c, mutation.result); }); - } - }); - } - }; - DataStore.prototype.markMutationComplete = function (_a) { - var mutationId = _a.mutationId, optimisticResponse = _a.optimisticResponse; - if (optimisticResponse) { - this.cache.removeOptimistic(mutationId); - } - }; - DataStore.prototype.markUpdateQueryResult = function (document, variables, newResult) { - this.cache.write({ - result: newResult, - dataId: 'ROOT_QUERY', - variables: variables, - query: document, - }); - }; - DataStore.prototype.reset = function () { - return this.cache.reset(); - }; - return DataStore; -}()); -exports.DataStore = DataStore; -//# sourceMappingURL=store.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/data/store.js.map b/node_modules/apollo-client/data/store.js.map deleted file mode 100644 index 66905e9..0000000 --- a/node_modules/apollo-client/data/store.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/data/store.ts"],"names":[],"mappings":";;AAIA,qDAI0B;AAgB1B;IAGE,mBAAY,YAAsC;QAChD,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC;IAC5B,CAAC;IAEM,4BAAQ,GAAf;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEM,mCAAe,GAAtB,UACE,MAAuB,EACvB,QAAsB,EACtB,SAAc,EACd,mBAAuC,EACvC,YAA6B;QAA7B,6BAAA,EAAA,oBAA6B;QAE7B,IAAI,eAAe,GAAG,CAAC,wCAAqB,CAAC,MAAM,CAAC,CAAC;QACrD,IAAI,YAAY,IAAI,wCAAqB,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE;YAChE,eAAe,GAAG,IAAI,CAAC;SACxB;QACD,IAAI,CAAC,mBAAmB,IAAI,eAAe,EAAE;YAC3C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBACf,MAAM,EAAE,MAAM,CAAC,IAAI;gBACnB,MAAM,EAAE,YAAY;gBACpB,KAAK,EAAE,QAAQ;gBACf,SAAS,EAAE,SAAS;aACrB,CAAC,CAAC;SACJ;IACH,CAAC;IAEM,0CAAsB,GAA7B,UACE,MAAuB,EACvB,QAAsB,EACtB,SAAc;QAId,IAAI,CAAC,wCAAqB,CAAC,MAAM,CAAC,EAAE;YAClC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;gBACf,MAAM,EAAE,MAAM,CAAC,IAAI;gBACnB,MAAM,EAAE,mBAAmB;gBAC3B,KAAK,EAAE,QAAQ;gBACf,SAAS,EAAE,SAAS;aACrB,CAAC,CAAC;SACJ;IACH,CAAC;IAEM,oCAAgB,GAAvB,UAAwB,QAOvB;QAPD,iBAkCC;QA1BC,IAAI,QAAQ,CAAC,kBAAkB,EAAE;YAC/B,IAAI,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EM,yCAAqB,GAA5B,UACE,QAAsB,EACtB,SAAc,EACd,SAAc;QAEd,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YACf,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,YAAY;YACpB,SAAS,WAAA;YACT,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;IACL,CAAC;IAEM,yBAAK,GAAZ;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IACH,gBAAC;AAAD,CAAC,AApLD,IAoLC;AApLY,8BAAS"} \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.d.ts b/node_modules/apollo-client/errors/ApolloError.d.ts deleted file mode 100644 index 4cf37ab..0000000 --- a/node_modules/apollo-client/errors/ApolloError.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { GraphQLError } from 'graphql'; -export declare function isApolloError(err: Error): err is ApolloError; -export declare class ApolloError extends Error { - message: string; - graphQLErrors: ReadonlyArray; - networkError: Error | null; - extraInfo: any; - constructor({ graphQLErrors, networkError, errorMessage, extraInfo, }: { - graphQLErrors?: ReadonlyArray; - networkError?: Error | null; - errorMessage?: string; - extraInfo?: any; - }); -} -//# sourceMappingURL=ApolloError.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.d.ts.map b/node_modules/apollo-client/errors/ApolloError.d.ts.map deleted file mode 100644 index 7881e67..0000000 --- a/node_modules/apollo-client/errors/ApolloError.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ApolloError.d.ts","sourceRoot":"","sources":["../src/errors/ApolloError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,wBAAgB,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,WAAW,CAE5D;AA2BD,qBAAa,WAAY,SAAQ,KAAK;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,YAAY,EAAE,KAAK,GAAG,IAAI,CAAC;IAK3B,SAAS,EAAE,GAAG,CAAC;gBAKV,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,EAAE;QACD,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;QAC5C,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;QAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,GAAG,CAAC;KACjB;CAiBF"} \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.js b/node_modules/apollo-client/errors/ApolloError.js deleted file mode 100644 index e0eda4a..0000000 --- a/node_modules/apollo-client/errors/ApolloError.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var arrays_1 = require("../util/arrays"); -function isApolloError(err) { - return err.hasOwnProperty('graphQLErrors'); -} -exports.isApolloError = isApolloError; -var generateErrorMessage = function (err) { - var message = ''; - if (arrays_1.isNonEmptyArray(err.graphQLErrors)) { - err.graphQLErrors.forEach(function (graphQLError) { - var errorMessage = graphQLError - ? graphQLError.message - : 'Error message not found.'; - message += "GraphQL error: " + errorMessage + "\n"; - }); - } - if (err.networkError) { - message += 'Network error: ' + err.networkError.message + '\n'; - } - message = message.replace(/\n$/, ''); - return message; -}; -var ApolloError = (function (_super) { - tslib_1.__extends(ApolloError, _super); - function ApolloError(_a) { - var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo; - var _this = _super.call(this, errorMessage) || this; - _this.graphQLErrors = graphQLErrors || []; - _this.networkError = networkError || null; - if (!errorMessage) { - _this.message = generateErrorMessage(_this); - } - else { - _this.message = errorMessage; - } - _this.extraInfo = extraInfo; - _this.__proto__ = ApolloError.prototype; - return _this; - } - return ApolloError; -}(Error)); -exports.ApolloError = ApolloError; -//# sourceMappingURL=ApolloError.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/errors/ApolloError.js.map b/node_modules/apollo-client/errors/ApolloError.js.map deleted file mode 100644 index e10bf82..0000000 --- a/node_modules/apollo-client/errors/ApolloError.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ApolloError.js","sourceRoot":"","sources":["../../src/errors/ApolloError.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AAEjD,SAAgB,aAAa,CAAC,GAAU;IACtC,OAAO,GAAG,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAC7C,CAAC;AAFD,sCAEC;AAMD,IAAM,oBAAoB,GAAG,UAAC,GAAgB;IAC5C,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,wBAAe,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;QACtC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,UAAC,YAA0B;YACnD,IAAM,YAAY,GAAG,YAAY;gBAC/B,CAAC,CAAC,YAAY,CAAC,OAAO;gBACtB,CAAC,CAAC,0BAA0B,CAAC;YAC/B,OAAO,IAAI,oBAAkB,YAAY,OAAI,CAAC;QAChD,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,GAAG,CAAC,YAAY,EAAE;QACpB,OAAO,IAAI,iBAAiB,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;KAChE;IAGD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;IAAiC,uCAAK;IAapC,qBAAY,EAUX;YATC,gCAAa,EACb,8BAAY,EACZ,8BAAY,EACZ,wBAAS;QAJX,YAWE,kBAAM,YAAY,CAAC,SAepB;QAdC,KAAI,CAAC,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;QACzC,KAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;QAEzC,IAAI,CAAC,YAAY,EAAE;YACjB,KAAI,CAAC,OAAO,GAAG,oBAAoB,CAAC,KAAI,CAAC,CAAC;SAC3C;aAAM;YACL,KAAI,CAAC,OAAO,GAAG,YAAY,CAAC;SAC7B;QAED,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAI1B,KAAY,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;;IAClD,CAAC;IACH,kBAAC;AAAD,CAAC,AAxCD,CAAiC,KAAK,GAwCrC;AAxCY,kCAAW"} \ No newline at end of file diff --git a/node_modules/apollo-client/index.d.ts b/node_modules/apollo-client/index.d.ts deleted file mode 100644 index 7c26dd5..0000000 --- a/node_modules/apollo-client/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export { ObservableQuery, FetchMoreOptions, UpdateQueryOptions, ApolloCurrentResult, ApolloCurrentQueryResult, } from './core/ObservableQuery'; -export { QueryBaseOptions, QueryOptions, WatchQueryOptions, MutationOptions, SubscriptionOptions, FetchPolicy, WatchQueryFetchPolicy, ErrorPolicy, FetchMoreQueryOptions, SubscribeToMoreOptions, MutationUpdaterFn, } from './core/watchQueryOptions'; -export { NetworkStatus } from './core/networkStatus'; -export * from './core/types'; -export { Resolver, FragmentMatcher as LocalStateFragmentMatcher, } from './core/LocalState'; -export { isApolloError, ApolloError } from './errors/ApolloError'; -import ApolloClient, { ApolloClientOptions, DefaultOptions } from './ApolloClient'; -export { ApolloClientOptions, DefaultOptions }; -export { ApolloClient }; -export default ApolloClient; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/index.d.ts.map b/node_modules/apollo-client/index.d.ts.map deleted file mode 100644 index 6ca55e7..0000000 --- a/node_modules/apollo-client/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,eAAe,IAAI,yBAAyB,GAC7C,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,YAAY,EAAE,EACnB,mBAAmB,EACnB,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/index.js b/node_modules/apollo-client/index.js deleted file mode 100644 index a259ed1..0000000 --- a/node_modules/apollo-client/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var ObservableQuery_1 = require("./core/ObservableQuery"); -exports.ObservableQuery = ObservableQuery_1.ObservableQuery; -var networkStatus_1 = require("./core/networkStatus"); -exports.NetworkStatus = networkStatus_1.NetworkStatus; -tslib_1.__exportStar(require("./core/types"), exports); -var ApolloError_1 = require("./errors/ApolloError"); -exports.isApolloError = ApolloError_1.isApolloError; -exports.ApolloError = ApolloError_1.ApolloError; -var ApolloClient_1 = tslib_1.__importDefault(require("./ApolloClient")); -exports.ApolloClient = ApolloClient_1.default; -exports.default = ApolloClient_1.default; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/index.js.map b/node_modules/apollo-client/index.js.map deleted file mode 100644 index 68b6728..0000000 --- a/node_modules/apollo-client/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,0DAMgC;AAL9B,4CAAA,eAAe,CAAA;AAmBjB,sDAAqD;AAA5C,wCAAA,aAAa,CAAA;AACtB,uDAA6B;AAM7B,oDAAkE;AAAzD,sCAAA,aAAa,CAAA;AAAE,oCAAA,WAAW,CAAA;AAEnC,wEAGwB;AAIf,uBAPF,sBAAY,CAOE;AACrB,kBAAe,sBAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-client/package.json b/node_modules/apollo-client/package.json deleted file mode 100644 index c0e6661..0000000 --- a/node_modules/apollo-client/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "apollo-client", - "version": "2.6.10", - "description": "A simple yet functional GraphQL client.", - "main": "bundle.umd.js", - "module": "bundle.esm.js", - "typings": "index.d.ts", - "sideEffects": false, - "repository": { - "type": "git", - "url": "apollographql/apollo-client" - }, - "pre-commit": "lint-staged", - "keywords": [ - "ecmascript", - "es2015", - "jsnext", - "javascript", - "relay", - "npm", - "react" - ], - "author": "Sashko Stubailo ", - "license": "MIT", - "dependencies": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.3.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } -} \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.d.ts b/node_modules/apollo-client/util/Observable.d.ts deleted file mode 100644 index b4cc631..0000000 --- a/node_modules/apollo-client/util/Observable.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { Observable as LinkObservable } from 'apollo-link'; -export declare type Subscription = ZenObservable.Subscription; -export declare type Observer = ZenObservable.Observer; -export declare class Observable extends LinkObservable { -} -//# sourceMappingURL=Observable.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.d.ts.map b/node_modules/apollo-client/util/Observable.d.ts.map deleted file mode 100644 index 2f8454b..0000000 --- a/node_modules/apollo-client/util/Observable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Observable.d.ts","sourceRoot":"","sources":["../src/util/Observable.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,oBAAY,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC;AACtD,oBAAY,QAAQ,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAKpD,qBAAa,UAAU,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;CAQnD"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.js b/node_modules/apollo-client/util/Observable.js deleted file mode 100644 index 59ead53..0000000 --- a/node_modules/apollo-client/util/Observable.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_link_1 = require("apollo-link"); -var symbol_observable_1 = tslib_1.__importDefault(require("symbol-observable")); -var Observable = (function (_super) { - tslib_1.__extends(Observable, _super); - function Observable() { - return _super !== null && _super.apply(this, arguments) || this; - } - Observable.prototype[symbol_observable_1.default] = function () { - return this; - }; - Observable.prototype['@@observable'] = function () { - return this; - }; - return Observable; -}(apollo_link_1.Observable)); -exports.Observable = Observable; -//# sourceMappingURL=Observable.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/Observable.js.map b/node_modules/apollo-client/util/Observable.js.map deleted file mode 100644 index 1222b5f..0000000 --- a/node_modules/apollo-client/util/Observable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Observable.js","sourceRoot":"","sources":["../../src/util/Observable.ts"],"names":[],"mappings":";;;AAEA,2CAA2D;AAK3D,gFAA6C;AAG7C;IAAmC,sCAAiB;IAApD;;IAQA,CAAC;IAPQ,qBAAC,2BAAY,CAAC,GAArB;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,qBAAC,cAAqB,CAAC,GAA9B;QACE,OAAO,IAAI,CAAC;IACd,CAAC;IACH,iBAAC;AAAD,CAAC,AARD,CAAmC,wBAAc,GAQhD;AARY,gCAAU"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.d.ts b/node_modules/apollo-client/util/arrays.d.ts deleted file mode 100644 index 17d9b15..0000000 --- a/node_modules/apollo-client/util/arrays.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function isNonEmptyArray(value?: ArrayLike): value is Array; -//# sourceMappingURL=arrays.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.d.ts.map b/node_modules/apollo-client/util/arrays.d.ts.map deleted file mode 100644 index 2db55b3..0000000 --- a/node_modules/apollo-client/util/arrays.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../src/util/arrays.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAE1E"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.js b/node_modules/apollo-client/util/arrays.js deleted file mode 100644 index e388142..0000000 --- a/node_modules/apollo-client/util/arrays.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function isNonEmptyArray(value) { - return Array.isArray(value) && value.length > 0; -} -exports.isNonEmptyArray = isNonEmptyArray; -//# sourceMappingURL=arrays.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/arrays.js.map b/node_modules/apollo-client/util/arrays.js.map deleted file mode 100644 index 9302fd1..0000000 --- a/node_modules/apollo-client/util/arrays.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../src/util/arrays.ts"],"names":[],"mappings":";;AAAA,SAAgB,eAAe,CAAI,KAAoB;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAClD,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts b/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts deleted file mode 100644 index dacd211..0000000 --- a/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function capitalizeFirstLetter(str: string): string; -//# sourceMappingURL=capitalizeFirstLetter.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map b/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map deleted file mode 100644 index ceb2059..0000000 --- a/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"capitalizeFirstLetter.d.ts","sourceRoot":"","sources":["../src/util/capitalizeFirstLetter.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,UAEhD"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.js b/node_modules/apollo-client/util/capitalizeFirstLetter.js deleted file mode 100644 index 1ee854f..0000000 --- a/node_modules/apollo-client/util/capitalizeFirstLetter.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function capitalizeFirstLetter(str) { - return str.charAt(0).toUpperCase() + str.slice(1); -} -exports.capitalizeFirstLetter = capitalizeFirstLetter; -//# sourceMappingURL=capitalizeFirstLetter.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/capitalizeFirstLetter.js.map b/node_modules/apollo-client/util/capitalizeFirstLetter.js.map deleted file mode 100644 index 639769e..0000000 --- a/node_modules/apollo-client/util/capitalizeFirstLetter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"capitalizeFirstLetter.js","sourceRoot":"","sources":["../../src/util/capitalizeFirstLetter.ts"],"names":[],"mappings":";;AAAA,SAAgB,qBAAqB,CAAC,GAAW;IAC/C,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAFD,sDAEC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.d.ts b/node_modules/apollo-client/util/observableToPromise.d.ts deleted file mode 100644 index dd54089..0000000 --- a/node_modules/apollo-client/util/observableToPromise.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ObservableQuery } from '../core/ObservableQuery'; -import { ApolloQueryResult } from '../core/types'; -import { Subscription } from '../util/Observable'; -export declare type Options = { - observable: ObservableQuery; - shouldResolve?: boolean; - wait?: number; - errorCallbacks?: ((error: Error) => any)[]; -}; -export declare type ResultCallback = ((result: ApolloQueryResult) => any); -export declare function observableToPromiseAndSubscription({ observable, shouldResolve, wait, errorCallbacks }: Options, ...cbs: ResultCallback[]): { - promise: Promise; - subscription: Subscription; -}; -export default function (options: Options, ...cbs: ResultCallback[]): Promise; -//# sourceMappingURL=observableToPromise.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.d.ts.map b/node_modules/apollo-client/util/observableToPromise.d.ts.map deleted file mode 100644 index 7935d2b..0000000 --- a/node_modules/apollo-client/util/observableToPromise.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"observableToPromise.d.ts","sourceRoot":"","sources":["../src/util/observableToPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD,oBAAY,OAAO,GAAG;IACpB,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,EAAE,CAAC;CAC5C,CAAC;AAEF,oBAAY,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;AAMvE,wBAAgB,kCAAkC,CAChD,EAAE,UAAU,EAAE,aAAoB,EAAE,IAAS,EAAE,cAAmB,EAAE,EAAE,OAAO,EAC7E,GAAG,GAAG,EAAE,cAAc,EAAE,GACvB;IAAE,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,YAAY,CAAA;CAAE,CA8DzD;AAED,MAAM,CAAC,OAAO,WACZ,OAAO,EAAE,OAAO,EAChB,GAAG,GAAG,EAAE,cAAc,EAAE,GACvB,OAAO,CAAC,GAAG,EAAE,CAAC,CAEhB"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.js b/node_modules/apollo-client/util/observableToPromise.js deleted file mode 100644 index 395647d..0000000 --- a/node_modules/apollo-client/util/observableToPromise.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -function observableToPromiseAndSubscription(_a) { - var observable = _a.observable, _b = _a.shouldResolve, shouldResolve = _b === void 0 ? true : _b, _c = _a.wait, wait = _c === void 0 ? -1 : _c, _d = _a.errorCallbacks, errorCallbacks = _d === void 0 ? [] : _d; - var cbs = []; - for (var _i = 1; _i < arguments.length; _i++) { - cbs[_i - 1] = arguments[_i]; - } - var subscription = null; - var promise = new Promise(function (resolve, reject) { - var errorIndex = 0; - var cbIndex = 0; - var results = []; - var tryToResolve = function () { - if (!shouldResolve) { - return; - } - var done = function () { - subscription.unsubscribe(); - resolve(results); - }; - if (cbIndex === cbs.length && errorIndex === errorCallbacks.length) { - if (wait === -1) { - done(); - } - else { - setTimeout(done, wait); - } - } - }; - subscription = observable.subscribe({ - next: function (result) { - var cb = cbs[cbIndex++]; - if (cb) { - try { - results.push(cb(result)); - } - catch (e) { - return reject(e); - } - tryToResolve(); - } - else { - reject(new Error("Observable called more than " + cbs.length + " times")); - } - }, - error: function (error) { - var errorCb = errorCallbacks[errorIndex++]; - if (errorCb) { - try { - errorCb(error); - } - catch (e) { - return reject(e); - } - tryToResolve(); - } - else { - reject(error); - } - }, - }); - }); - return { - promise: promise, - subscription: subscription, - }; -} -exports.observableToPromiseAndSubscription = observableToPromiseAndSubscription; -function default_1(options) { - var cbs = []; - for (var _i = 1; _i < arguments.length; _i++) { - cbs[_i - 1] = arguments[_i]; - } - return observableToPromiseAndSubscription.apply(void 0, tslib_1.__spreadArrays([options], cbs)).promise; -} -exports.default = default_1; -//# sourceMappingURL=observableToPromise.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observableToPromise.js.map b/node_modules/apollo-client/util/observableToPromise.js.map deleted file mode 100644 index 5bcb3df..0000000 --- a/node_modules/apollo-client/util/observableToPromise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"observableToPromise.js","sourceRoot":"","sources":["../../src/util/observableToPromise.ts"],"names":[],"mappings":";;;AA0BA,SAAgB,kCAAkC,CAChD,EAA6E;QAA3E,0BAAU,EAAE,qBAAoB,EAApB,yCAAoB,EAAE,YAAS,EAAT,8BAAS,EAAE,sBAAmB,EAAnB,wCAAmB;IAClE,aAAwB;SAAxB,UAAwB,EAAxB,qBAAwB,EAAxB,IAAwB;QAAxB,4BAAwB;;IAExB,IAAI,YAAY,GAAiB,IAAa,C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K,CAAC,CAAC;qBAChB;oBAAC,OAAO,CAAC,EAAE;wBACV,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;qBAClB;oBACD,YAAY,EAAE,CAAC;iBAChB;qBAAM;oBACL,MAAM,CAAC,KAAK,CAAC,CAAC;iBACf;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,SAAA;QACP,YAAY,cAAA;KACb,CAAC;AACJ,CAAC;AAjED,gFAiEC;AAED,mBACE,OAAgB;IAChB,aAAwB;SAAxB,UAAwB,EAAxB,qBAAwB,EAAxB,IAAwB;QAAxB,4BAAwB;;IAExB,OAAO,kCAAkC,uCAAC,OAAO,GAAK,GAAG,GAAE,OAAO,CAAC;AACrE,CAAC;AALD,4BAKC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.d.ts b/node_modules/apollo-client/util/observables.d.ts deleted file mode 100644 index f366bba..0000000 --- a/node_modules/apollo-client/util/observables.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Observable } from './Observable'; -export declare function multiplex(inner: Observable): Observable; -export declare function asyncMap(observable: Observable, mapFn: (value: V) => R | Promise): Observable; -//# sourceMappingURL=observables.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.d.ts.map b/node_modules/apollo-client/util/observables.d.ts.map deleted file mode 100644 index 01993d3..0000000 --- a/node_modules/apollo-client/util/observables.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"observables.d.ts","sourceRoot":"","sources":["../src/util/observables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AAIlE,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAuBhE;AAID,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAC3B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAClC,UAAU,CAAC,CAAC,CAAC,CAqCf"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.js b/node_modules/apollo-client/util/observables.js deleted file mode 100644 index 3384708..0000000 --- a/node_modules/apollo-client/util/observables.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var Observable_1 = require("./Observable"); -function multiplex(inner) { - var observers = new Set(); - var sub = null; - return new Observable_1.Observable(function (observer) { - observers.add(observer); - sub = sub || inner.subscribe({ - next: function (value) { - observers.forEach(function (obs) { return obs.next && obs.next(value); }); - }, - error: function (error) { - observers.forEach(function (obs) { return obs.error && obs.error(error); }); - }, - complete: function () { - observers.forEach(function (obs) { return obs.complete && obs.complete(); }); - }, - }); - return function () { - if (observers.delete(observer) && !observers.size && sub) { - sub.unsubscribe(); - sub = null; - } - }; - }); -} -exports.multiplex = multiplex; -function asyncMap(observable, mapFn) { - return new Observable_1.Observable(function (observer) { - var next = observer.next, error = observer.error, complete = observer.complete; - var activeNextCount = 0; - var completed = false; - var handler = { - next: function (value) { - ++activeNextCount; - new Promise(function (resolve) { - resolve(mapFn(value)); - }).then(function (result) { - --activeNextCount; - next && next.call(observer, result); - completed && handler.complete(); - }, function (e) { - --activeNextCount; - error && error.call(observer, e); - }); - }, - error: function (e) { - error && error.call(observer, e); - }, - complete: function () { - completed = true; - if (!activeNextCount) { - complete && complete.call(observer); - } - }, - }; - var sub = observable.subscribe(handler); - return function () { return sub.unsubscribe(); }; - }); -} -exports.asyncMap = asyncMap; -//# sourceMappingURL=observables.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/observables.js.map b/node_modules/apollo-client/util/observables.js.map deleted file mode 100644 index e75fe71..0000000 --- a/node_modules/apollo-client/util/observables.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"observables.js","sourceRoot":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AQ,CAAc;QAC3C,IAAI,eAAe,GAAG,CAAC,CAAC;QACxB,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,IAAM,OAAO,GAAgB;YAC3B,IAAI,EAAJ,UAAK,KAAK;gBACR,EAAE,eAAe,CAAC;gBAClB,IAAI,OAAO,CAAC,UAAA,OAAO;oBACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBACxB,CAAC,CAAC,CAAC,IAAI,CACL,UAAA,MAAM;oBACJ,EAAE,eAAe,CAAC;oBAClB,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;oBACpC,SAAS,IAAI,OAAO,CAAC,QAAS,EAAE,CAAC;gBACnC,CAAC,EACD,UAAA,CAAC;oBACC,EAAE,eAAe,CAAC;oBAClB,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACnC,CAAC,CACF,CAAC;YACJ,CAAC;YACD,KAAK,YAAC,CAAC;gBACL,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YACnC,CAAC;YACD,QAAQ;gBACN,SAAS,GAAG,IAAI,CAAC;gBACjB,IAAI,CAAC,eAAe,EAAE;oBACpB,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACrC;YACH,CAAC;SACF,CAAC;QAEF,IAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,cAAM,OAAA,GAAG,CAAC,WAAW,EAAE,EAAjB,CAAiB,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC;AAxCD,4BAwCC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/subscribeAndCount.d.ts b/node_modules/apollo-client/util/subscribeAndCount.d.ts deleted file mode 100644 index fdcb0a9..0000000 --- a/node_modules/apollo-client/util/subscribeAndCount.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -import { ObservableQuery } from '../core/ObservableQuery'; -import { ApolloQueryResult } from '../core/types'; -import { Subscription } from '../util/Observable'; -export default function subscribeAndCount(done: jest.DoneCallback, observable: ObservableQuery, cb: (handleCount: number, result: ApolloQueryResult) => any): Subscription; -//# sourceMappingURL=subscribeAndCount.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/subscribeAndCount.d.ts.map b/node_modules/apollo-client/util/subscribeAndCount.d.ts.map deleted file mode 100644 index 6d367b1..0000000 --- a/node_modules/apollo-client/util/subscribeAndCount.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscribeAndCount.d.ts","sourceRoot":"","sources":["../src/util/subscribeAndCount.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,IAAI,EAAE,IAAI,CAAC,YAAY,EACvB,UAAU,EAAE,eAAe,CAAC,GAAG,CAAC,EAChC,EAAE,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,KAAK,GAAG,GAC/D,YAAY,CAqBd"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/subscribeAndCount.js b/node_modules/apollo-client/util/subscribeAndCount.js deleted file mode 100644 index e809971..0000000 --- a/node_modules/apollo-client/util/subscribeAndCount.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var observables_1 = require("./observables"); -function subscribeAndCount(done, observable, cb) { - var handleCount = 0; - var subscription = observables_1.asyncMap(observable, function (result) { - try { - return cb(++handleCount, result); - } - catch (e) { - setImmediate(function () { - subscription.unsubscribe(); - done.fail(e); - }); - } - }).subscribe({ - error: done.fail, - }); - return subscription; -} -exports.default = subscribeAndCount; -//# sourceMappingURL=subscribeAndCount.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/subscribeAndCount.js.map b/node_modules/apollo-client/util/subscribeAndCount.js.map deleted file mode 100644 index 8d939c4..0000000 --- a/node_modules/apollo-client/util/subscribeAndCount.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscribeAndCount.js","sourceRoot":"","sources":["../../src/util/subscribeAndCount.ts"],"names":[],"mappings":";;AAGA,6CAAyC;AAEzC,SAAwB,iBAAiB,CACvC,IAAuB,EACvB,UAAgC,EAChC,EAAgE;IAEhE,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAM,YAAY,GAAG,sBAAQ,CAC3B,UAAU,EACV,UAAC,MAA8B;QAC7B,IAAI;YACF,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;SAClC;QAAC,OAAO,CAAC,EAAE;YAIV,YAAY,CAAC;gBACX,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC3B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACf,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CACF,CAAC,SAAS,CAAC;QACV,KAAK,EAAE,IAAI,CAAC,IAAI;KACjB,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACtB,CAAC;AAzBD,oCAyBC"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.d.ts b/node_modules/apollo-client/util/wrap.d.ts deleted file mode 100644 index 1b8c7d4..0000000 --- a/node_modules/apollo-client/util/wrap.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -declare const _default: (done: jest.DoneCallback, cb: (...args: any[]) => any) => (...args: any[]) => any; -export default _default; -export declare function withWarning(func: Function, regex: RegExp): Promise; -export declare function withError(func: Function, regex: RegExp): any; -//# sourceMappingURL=wrap.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.d.ts.map b/node_modules/apollo-client/util/wrap.d.ts.map deleted file mode 100644 index ba22fd9..0000000 --- a/node_modules/apollo-client/util/wrap.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../src/util/wrap.ts"],"names":[],"mappings":";;AAEA,wBAQE;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAWxD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,OAatD"} \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.js b/node_modules/apollo-client/util/wrap.js deleted file mode 100644 index 9447e55..0000000 --- a/node_modules/apollo-client/util/wrap.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = (function (done, cb) { return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - try { - return cb.apply(void 0, args); - } - catch (e) { - done.fail(e); - } -}; }); -function withWarning(func, regex) { - var message = null; - var oldWarn = console.warn; - console.warn = function (m) { return (message = m); }; - return Promise.resolve(func()).then(function (val) { - expect(message).toMatch(regex); - console.warn = oldWarn; - return val; - }); -} -exports.withWarning = withWarning; -function withError(func, regex) { - var message = null; - var oldError = console.error; - console.error = function (m) { return (message = m); }; - try { - var result = func(); - expect(message).toMatch(regex); - return result; - } - finally { - console.error = oldError; - } -} -exports.withError = withError; -//# sourceMappingURL=wrap.js.map \ No newline at end of file diff --git a/node_modules/apollo-client/util/wrap.js.map b/node_modules/apollo-client/util/wrap.js.map deleted file mode 100644 index becadbf..0000000 --- a/node_modules/apollo-client/util/wrap.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrap.js","sourceRoot":"","sources":["../../src/util/wrap.ts"],"names":[],"mappings":";;AAEA,mBAAe,UAAC,IAAuB,EAAE,EAA2B,IAAK,OAAA;IACvE,c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.ts deleted file mode 100644 index e5bc4f9..0000000 --- a/node_modules/apollo-client/version.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const version = "2.6.10"; -//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-client/version.d.ts.map b/node_modules/apollo-client/version.d.ts.map deleted file mode 100644 index 674cd41..0000000 --- a/node_modules/apollo-client/version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/apollo-client/version.js b/node_modules/apollo-client/version.js deleted file mode 100644 index c40c18b..0000000 --- a/node_modules/apollo-client/version.js +++ /dev/null @@ -1 +0,0 @@ -exports.version = "2.6.10" \ No newline at end of file diff --git a/node_modules/apollo-client/version.js.map b/node_modules/apollo-client/version.js.map deleted file mode 100644 index 4e080c9..0000000 --- a/node_modules/apollo-client/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/CHANGELOG.md b/node_modules/apollo-link-error/CHANGELOG.md deleted file mode 100644 index aef8995..0000000 --- a/node_modules/apollo-link-error/CHANGELOG.md +++ /dev/null @@ -1,52 +0,0 @@ -# Change log - ----- - -**NOTE:** This changelog is no longer maintained. Changes are now tracked in -the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). - ----- - -### 1.1.2 - -- No changes - -### 1.1.1 -- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
- [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) -- Update types to be compatible with `@types/graphql@0.13.3` - -### 1.1.0 -- Pass `forward` into error handler for ErrorLink to support retrying a failed request - -### 1.0.9 -- Correct return type to FetchResult [#600](https://github.com/apollographql/apollo-link/pull/600) - -### 1.0.8 -- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) - -### 1.0.7 -- update apollo link with zen-observable-ts [PR#515](https://github.com/apollographql/apollo-link/pull/515) - -### 1.0.6 -- ApolloLink upgrade - -### 1.0.5 -- ApolloLink upgrade - -### 1.0.4 -- ApolloLink upgrade - -### 1.0.3 -- export options as named interface [TypeScript] - -### 1.0.2 -- changed peer-dependency of apollo-link to actual dependency -- graphQLErrors alias networkError.result.errors on a networkError - -### 1.0.1 -- moved to better rollup build - -### 1.0.0 -- Added the operation and any data to the error handler callback -- changed graphqlErrors to be graphQLErrors to be consistent with Apollo Client diff --git a/node_modules/apollo-link-error/LICENSE b/node_modules/apollo-link-error/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/node_modules/apollo-link-error/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 - 2017 Meteor Development Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/apollo-link-error/README.md b/node_modules/apollo-link-error/README.md deleted file mode 100644 index 43f757c..0000000 --- a/node_modules/apollo-link-error/README.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: apollo-link-error -description: Handle and inspect errors in your GraphQL network stack. ---- - -Use this link to do some custom logic when a GraphQL or network error happens: - -```js -import { onError } from "apollo-link-error"; - -const link = onError(({ graphQLErrors, networkError }) => { - if (graphQLErrors) - graphQLErrors.forEach(({ message, locations, path }) => - console.log( - `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}` - ) - ); - if (networkError) console.log(`[Network error]: ${networkError}`); -}); -``` - -Apollo Link is a system of modular components for GraphQL networking. [Read the docs](https://www.apollographql.com/docs/link/#usage) to learn how to use this link with libraries like Apollo Client and graphql-tools, or as a standalone client. - -## Callback - -Error Link takes a function that is called in the event of an error. This function is called with an object containing the following keys: - -* `operation`: The Operation that errored -* `response`: The result returned from lower down in the link chain -* `graphQLErrors`: An array of errors from the GraphQL endpoint -* `networkError`: Any error during the link execution or server response, that wasn't delivered as part of the `errors` field in the GraphQL result -* `forward`: A reference to the next link in the chain. Calling `return forward(operation)` in the callback will retry the request, returning a new observable for the upstream link to subscribe to. - -Returns: `Observable | void` The error callback can optionally return an observable from calling `forward(operation)` if it wants to retry the request. It should not return anything else. - -## Error categorization - -An error is passed as a `networkError` if a link further down the chain called the `error` callback on the observable. In most cases, `graphQLErrors` is the `errors` field of the result from the last `next` call. - -A `networkError` can contain additional fields, such as a GraphQL object in the case of a [failing HTTP status code](http#errors) from [`apollo-link-http`](http). In this situation, `graphQLErrors` is an alias for `networkError.result.errors` if the property exists. - -## Retrying failed requests - -An error handler might want to do more than just logging errors. You can check for a certain failure condition or error code, and retry the request if rectifying the error is possible. For example, when using some form of token based authentication, there is a need to handle re-authentication when the token expires. Here is an example of how to do this using `forward()`. -```js -onError(({ graphQLErrors, networkError, operation, forward }) => { - if (graphQLErrors) { - for (let err of graphQLErrors) { - switch (err.extensions.code) { - case 'UNAUTHENTICATED': - // error code is set to UNAUTHENTICATED - // when AuthenticationError thrown in resolver - - // modify the operation context with a new token - const oldHeaders = operation.getContext().headers; - operation.setContext({ - headers: { - ...oldHeaders, - authorization: getNewToken(), - }, - }); - // retry the request, returning the new observable - return forward(operation); - } - } - } - if (networkError) { - console.log(`[Network error]: ${networkError}`); - // if you would also like to retry automatically on - // network errors, we recommend that you use - // apollo-link-retry - } - } -); -``` - -Here is a diagram of how the request flow looks like now: -![Diagram of request flow after retrying in error links](https://i.imgur.com/ncVAdz4.png) - -One caveat is that the errors from the new response from retrying the request does not get passed into the error handler again. This helps to avoid being trapped in an endless request loop when you call forward() in your error handler. - -## Ignoring errors - -If you want to conditionally ignore errors, you can set `response.errors = undefined;` within the error handler: - -```js -onError(({ response, operation }) => { - if (operation.operationName === "IgnoreErrorsQuery") { - response.errors = undefined; - } -}); -``` diff --git a/node_modules/apollo-link-error/lib/bundle.cjs.js b/node_modules/apollo-link-error/lib/bundle.cjs.js deleted file mode 100644 index b5afd68..0000000 --- a/node_modules/apollo-link-error/lib/bundle.cjs.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tslib = require('tslib'); -var apolloLink = require('apollo-link'); - -function onError(errorHandler) { - return new apolloLink.ApolloLink(function (operation, forward) { - return new apolloLink.Observable(function (observer) { - var sub; - var retriedSub; - var retriedResult; - try { - sub = forward(operation).subscribe({ - next: function (result) { - if (result.errors) { - retriedResult = errorHandler({ - graphQLErrors: result.errors, - response: result, - operation: operation, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - } - observer.next(result); - }, - error: function (networkError) { - retriedResult = errorHandler({ - operation: operation, - networkError: networkError, - graphQLErrors: networkError && - networkError.result && - networkError.result.errors, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - observer.error(networkError); - }, - complete: function () { - if (!retriedResult) { - observer.complete.bind(observer)(); - } - }, - }); - } - catch (e) { - errorHandler({ networkError: e, operation: operation, forward: forward }); - observer.error(e); - } - return function () { - if (sub) - sub.unsubscribe(); - if (retriedSub) - sub.unsubscribe(); - }; - }); - }); -} -var ErrorLink = (function (_super) { - tslib.__extends(ErrorLink, _super); - function ErrorLink(errorHandler) { - var _this = _super.call(this) || this; - _this.link = onError(errorHandler); - return _this; - } - ErrorLink.prototype.request = function (operation, forward) { - return this.link.request(operation, forward); - }; - return ErrorLink; -}(apolloLink.ApolloLink)); - -exports.ErrorLink = ErrorLink; -exports.onError = onError; -//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link-error/lib/bundle.cjs.js.map b/node_modules/apollo-link-error/lib/bundle.cjs.js.map deleted file mode 100644 index 9541978..0000000 --- a/node_modules/apollo-link-error/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __extends } from 'tslib';\nimport { ApolloLink, Observable } from 'apollo-link';\n\nfunction onError(errorHandler) {\n return new ApolloLink(function (operation, forward) {\n return new Observable(function (observer) {\n var sub;\n var retriedSub;\n var retriedResult;\n try {\n sub = forward(operation).subscribe({\n next: function (result) {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation: operation,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: function (networkError) {\n retriedResult = errorHandler({\n operation: operation,\n networkError: networkError,\n graphQLErrors: networkError &&\n networkError.result &&\n networkError.result.errors,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: function () {\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n }\n catch (e) {\n errorHandler({ networkError: e, operation: operation, forward: forward });\n observer.error(e);\n }\n return function () {\n if (sub)\n sub.unsubscribe();\n if (retriedSub)\n sub.unsubscribe();\n };\n });\n });\n}\nvar ErrorLink = (function (_super) {\n __extends(ErrorLink, _super);\n function ErrorLink(errorHandler) {\n var _this = _super.call(this) || this;\n _this.link = onError(errorHandler);\n return _this;\n }\n ErrorLink.prototype.request = function (operation, forward) {\n return this.link.request(operation, forward);\n };\n return ErrorLink;\n}(ApolloLink));\n\nexport { ErrorLink, onError };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["ApolloLink","Observable","__extends"],"mappings":";;;;;;;AAGA,SAAS,OAAO,CAAC,YAAY,EAAE;AAC/B,IAAI,OAAO,IAAIA,qBAAU,CAAC,UAAU,SAAS,EAAE,OAAO,EAAE;AACxD,QAAQ,OAAO,IAAIC,qBAAU,CAAC,UAAU,QAAQ,EAAE;AAClD,YAAY,IAAI,GAAG,CAAC;AACpB,YAAY,IAAI,UAAU,CAAC;AAC3B,YAAY,IAAI,aAAa,CAAC;AAC9B,YAAY,IAAI;AAChB,gBAAgB,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;AACnD,oBAAoB,IAAI,EAAE,UAAU,MAAM,EAAE;AAC5C,wBAAwB,IAAI,MAAM,CAAC,MAAM,EAAE;AAC3C,4BAA4B,aAAa,GAAG,YAAY,CAAC;AACzD,gCAAgC,aAAa,EAAE,MAAM,CAAC,MAAM;AAC5D,gCAAgC,QAAQ,EAAE,MAAM;AAChD,gCAAgC,SAAS,EAAE,SAAS;AACpD,gCAAgC,OAAO,EAAE,OAAO;AAChD,6BAA6B,CAAC,CAAC;AAC/B,4BAA4B,IAAI,aAAa,EAAE;AAC/C,gCAAgC,UAAU,GAAG,aAAa,CAAC,SA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error/lib/bundle.esm.js b/node_modules/apollo-link-error/lib/bundle.esm.js deleted file mode 100644 index a7eb503..0000000 --- a/node_modules/apollo-link-error/lib/bundle.esm.js +++ /dev/null @@ -1,84 +0,0 @@ -import { __extends } from 'tslib'; -import { ApolloLink, Observable } from 'apollo-link'; - -function onError(errorHandler) { - return new ApolloLink(function (operation, forward) { - return new Observable(function (observer) { - var sub; - var retriedSub; - var retriedResult; - try { - sub = forward(operation).subscribe({ - next: function (result) { - if (result.errors) { - retriedResult = errorHandler({ - graphQLErrors: result.errors, - response: result, - operation: operation, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - } - observer.next(result); - }, - error: function (networkError) { - retriedResult = errorHandler({ - operation: operation, - networkError: networkError, - graphQLErrors: networkError && - networkError.result && - networkError.result.errors, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - observer.error(networkError); - }, - complete: function () { - if (!retriedResult) { - observer.complete.bind(observer)(); - } - }, - }); - } - catch (e) { - errorHandler({ networkError: e, operation: operation, forward: forward }); - observer.error(e); - } - return function () { - if (sub) - sub.unsubscribe(); - if (retriedSub) - sub.unsubscribe(); - }; - }); - }); -} -var ErrorLink = (function (_super) { - __extends(ErrorLink, _super); - function ErrorLink(errorHandler) { - var _this = _super.call(this) || this; - _this.link = onError(errorHandler); - return _this; - } - ErrorLink.prototype.request = function (operation, forward) { - return this.link.request(operation, forward); - }; - return ErrorLink; -}(ApolloLink)); - -export { ErrorLink, onError }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link-error/lib/bundle.esm.js.map b/node_modules/apollo-link-error/lib/bundle.esm.js.map deleted file mode 100644 index dd978bc..0000000 --- a/node_modules/apollo-link-error/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["/* tslint:disable */\n\nimport {\n ApolloLink,\n Observable,\n Operation,\n NextLink,\n FetchResult,\n ExecutionResult,\n} from 'apollo-link';\nimport { GraphQLError } from 'graphql';\nimport { ServerError, ServerParseError } from 'apollo-link-http-common';\n\nexport interface ErrorResponse {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | ServerError | ServerParseError;\n response?: ExecutionResult;\n operation: Operation;\n forward: NextLink;\n}\n\nexport namespace ErrorLink {\n /**\n * Callback to be triggered when an error occurs within the link stack.\n */\n export interface ErrorHandler {\n (error: ErrorResponse): Observable | void;\n }\n}\n\n// For backwards compatibility.\nexport import ErrorHandler = ErrorLink.ErrorHandler;\n\nexport function onError(errorHandler: ErrorHandler): ApolloLink {\n return new ApolloLink((operation, forward) => {\n return new Observable(observer => {\n let sub;\n let retriedSub;\n let retriedResult;\n\n try {\n sub = forward(operation).subscribe({\n next: result => {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation,\n forward,\n });\n\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: networkError => {\n retriedResult = errorHandler({\n operation,\n networkError,\n //Network errors can return GraphQL errors on for example a 403\n graphQLErrors:\n networkError &&\n networkError.result &&\n networkError.result.errors,\n forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n } catch (e) {\n errorHandler({ networkError: e, operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) sub.unsubscribe();\n };\n });\n });\n}\n\nexport class ErrorLink extends ApolloLink {\n private link: ApolloLink;\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super();\n this.link = onError(errorHandler);\n }\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable | null {\n return this.link.request(operation, forward);\n }\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;SAiCgB,OAAO,CAAC,YAA0B;IAChD,OAAO,IAAI,UAAU,CAAC,UAAC,SAAS,EAAE,OAAO;QACvC,OAAO,IAAI,UAAU,CAAC,UAAA,QAAQ;YAC5B,IAAI,GAAG,CAAC;YACR,IAAI,UAAU,CAAC;YACf,IAAI,aAAa,CAAC;YAElB,IAAI;gBACF,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;oBACjC,IAAI,EAAE,UAAA,MAAM;wBACV,IAAI,MAAM,CAAC,MAAM,EAAE;4BACjB,aAAa,GAAG,YAAY,CAAC;gCAC3B,aAAa,EAAE,MAAM,CAAC,MAAM;gCAC5B,QAAQ,EAAE,MAAM;gCAChB,SAAS,WAAA;gCACT,OAAO,SAAA;6BACR,CAAC,CAAC;4BAEH,IAAI,aAAa,EAAE;gCACjB,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;oCACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;oCAClC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;oCACpC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;iCAC3C,CAAC,CAAC;gCACH,OAAO;6BACR;yBACF;wBACD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;qBACvB;oBACD,KAAK,EAAE,UAAA,YAAY;wBACjB,aAAa,GAAG,YAAY,CAAC;4BAC3B,SAAS,WAAA;4BACT,YAAY,cAAA;4BAEZ,aAAa,EACX,YAAY;gCACZ,YAAY,CAAC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9C;IACH,gBAAC;AAAD,CAbA,CAA+B,UAAU;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/bundle.umd.js b/node_modules/apollo-link-error/lib/bundle.umd.js deleted file mode 100644 index df8bbfa..0000000 --- a/node_modules/apollo-link-error/lib/bundle.umd.js +++ /dev/null @@ -1,92 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('apollo-link')) : - typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'apollo-link'], factory) : - (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.error = {}), global.tslib, global.apolloLink.core)); -}(this, (function (exports, tslib_1, apolloLink) { 'use strict'; - - function onError(errorHandler) { - return new apolloLink.ApolloLink(function (operation, forward) { - return new apolloLink.Observable(function (observer) { - var sub; - var retriedSub; - var retriedResult; - try { - sub = forward(operation).subscribe({ - next: function (result) { - if (result.errors) { - retriedResult = errorHandler({ - graphQLErrors: result.errors, - response: result, - operation: operation, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - } - observer.next(result); - }, - error: function (networkError) { - retriedResult = errorHandler({ - operation: operation, - networkError: networkError, - graphQLErrors: networkError && - networkError.result && - networkError.result.errors, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - observer.error(networkError); - }, - complete: function () { - if (!retriedResult) { - observer.complete.bind(observer)(); - } - }, - }); - } - catch (e) { - errorHandler({ networkError: e, operation: operation, forward: forward }); - observer.error(e); - } - return function () { - if (sub) - sub.unsubscribe(); - if (retriedSub) - sub.unsubscribe(); - }; - }); - }); - } - var ErrorLink = (function (_super) { - tslib_1.__extends(ErrorLink, _super); - function ErrorLink(errorHandler) { - var _this = _super.call(this) || this; - _this.link = onError(errorHandler); - return _this; - } - ErrorLink.prototype.request = function (operation, forward) { - return this.link.request(operation, forward); - }; - return ErrorLink; - }(apolloLink.ApolloLink)); - - exports.ErrorLink = ErrorLink; - exports.onError = onError; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link-error/lib/bundle.umd.js.map b/node_modules/apollo-link-error/lib/bundle.umd.js.map deleted file mode 100644 index f51c1d2..0000000 --- a/node_modules/apollo-link-error/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.umd.js","sources":["../src/index.ts"],"sourcesContent":["/* tslint:disable */\n\nimport {\n ApolloLink,\n Observable,\n Operation,\n NextLink,\n FetchResult,\n ExecutionResult,\n} from 'apollo-link';\nimport { GraphQLError } from 'graphql';\nimport { ServerError, ServerParseError } from 'apollo-link-http-common';\n\nexport interface ErrorResponse {\n graphQLErrors?: ReadonlyArray;\n networkError?: Error | ServerError | ServerParseError;\n response?: ExecutionResult;\n operation: Operation;\n forward: NextLink;\n}\n\nexport namespace ErrorLink {\n /**\n * Callback to be triggered when an error occurs within the link stack.\n */\n export interface ErrorHandler {\n (error: ErrorResponse): Observable | void;\n }\n}\n\n// For backwards compatibility.\nexport import ErrorHandler = ErrorLink.ErrorHandler;\n\nexport function onError(errorHandler: ErrorHandler): ApolloLink {\n return new ApolloLink((operation, forward) => {\n return new Observable(observer => {\n let sub;\n let retriedSub;\n let retriedResult;\n\n try {\n sub = forward(operation).subscribe({\n next: result => {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation,\n forward,\n });\n\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: networkError => {\n retriedResult = errorHandler({\n operation,\n networkError,\n //Network errors can return GraphQL errors on for example a 403\n graphQLErrors:\n networkError &&\n networkError.result &&\n networkError.result.errors,\n forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n } catch (e) {\n errorHandler({ networkError: e, operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) sub.unsubscribe();\n };\n });\n });\n}\n\nexport class ErrorLink extends ApolloLink {\n private link: ApolloLink;\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super();\n this.link = onError(errorHandler);\n }\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable | null {\n return this.link.request(operation, forward);\n }\n}\n"],"names":["ApolloLink","Observable","tslib_1.__extends"],"mappings":";;;;;;WAiCgB,OAAO,CAAC,YAA0B;MAChD,OAAO,IAAIA,qBAAU,CAAC,UAAC,SAAS,EAAE,OAAO;UACvC,OAAO,IAAIC,qBAAU,CAAC,UAAA,QAAQ;cAC5B,IAAI,GAAG,CAAC;cACR,IAAI,UAAU,CAAC;cACf,IAAI,aAAa,CAAC;cAElB,IAAI;kBACF,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;sBACjC,IAAI,EAAE,UAAA,MAAM;0BACV,IAAI,MAAM,CAAC,MAAM,EAAE;8BACjB,aAAa,GAAG,YAAY,CAAC;kCAC3B,aAAa,EAAE,MAAM,CAAC,MAAM;kCAC5B,QAAQ,EAAE,MAAM;kCAChB,SAAS,WAAA;kCACT,OAAO,SAAA;+BACR,CAAC,CAAC;8BAEH,IAAI,aAAa,EAAE;kCACjB,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;sCACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;sCAClC,KAAK,EAA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AC3B,IAAI,UAAU;sBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;eACnC,CAAC;WACH,CAAC,CAAC;OACJ,CAAC,CAAC;EACL,CAAC;;MAE8BC,qCAAU;MAEvC,mBAAY,YAAoC;UAAhD,YACE,iBAAO,SAER;UADC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;;OACnC;MAEM,2BAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;UAEjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;OAC9C;MACH,gBAAC;EAAD,CAbA,CAA+BF,qBAAU;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/index.d.ts b/node_modules/apollo-link-error/lib/index.d.ts deleted file mode 100644 index fdea55c..0000000 --- a/node_modules/apollo-link-error/lib/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ApolloLink, Observable, Operation, NextLink, FetchResult, ExecutionResult } from 'apollo-link'; -import { GraphQLError } from 'graphql'; -import { ServerError, ServerParseError } from 'apollo-link-http-common'; -export interface ErrorResponse { - graphQLErrors?: ReadonlyArray; - networkError?: Error | ServerError | ServerParseError; - response?: ExecutionResult; - operation: Operation; - forward: NextLink; -} -export declare namespace ErrorLink { - interface ErrorHandler { - (error: ErrorResponse): Observable | void; - } -} -export import ErrorHandler = ErrorLink.ErrorHandler; -export declare function onError(errorHandler: ErrorHandler): ApolloLink; -export declare class ErrorLink extends ApolloLink { - private link; - constructor(errorHandler: ErrorLink.ErrorHandler); - request(operation: Operation, forward: NextLink): Observable | null; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/index.d.ts.map b/node_modules/apollo-link-error/lib/index.d.ts.map deleted file mode 100644 index ac5780a..0000000 --- a/node_modules/apollo-link-error/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,KAAK,GAAG,WAAW,GAAG,gBAAgB,CAAC;IACtD,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED,yBAAiB,SAAS,CAAC;IAIzB,UAAiB,YAAY;QAC3B,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;KACxD;CACF;AAGD,MAAM,QAAQ,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;AAEpD,wBAAgB,OAAO,CAAC,YAAY,EAAE,YAAY,GAAG,UAAU,CAqE9D;AAED,qBAAa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,IAAI,CAAa;gBACb,YAAY,EAAE,SAAS,CAAC,YAAY;IAKzC,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,QAAQ,GAChB,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAGlC"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/index.js b/node_modules/apollo-link-error/lib/index.js deleted file mode 100644 index 5d44190..0000000 --- a/node_modules/apollo-link-error/lib/index.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_link_1 = require("apollo-link"); -function onError(errorHandler) { - return new apollo_link_1.ApolloLink(function (operation, forward) { - return new apollo_link_1.Observable(function (observer) { - var sub; - var retriedSub; - var retriedResult; - try { - sub = forward(operation).subscribe({ - next: function (result) { - if (result.errors) { - retriedResult = errorHandler({ - graphQLErrors: result.errors, - response: result, - operation: operation, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - } - observer.next(result); - }, - error: function (networkError) { - retriedResult = errorHandler({ - operation: operation, - networkError: networkError, - graphQLErrors: networkError && - networkError.result && - networkError.result.errors, - forward: forward, - }); - if (retriedResult) { - retriedSub = retriedResult.subscribe({ - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer), - }); - return; - } - observer.error(networkError); - }, - complete: function () { - if (!retriedResult) { - observer.complete.bind(observer)(); - } - }, - }); - } - catch (e) { - errorHandler({ networkError: e, operation: operation, forward: forward }); - observer.error(e); - } - return function () { - if (sub) - sub.unsubscribe(); - if (retriedSub) - sub.unsubscribe(); - }; - }); - }); -} -exports.onError = onError; -var ErrorLink = (function (_super) { - tslib_1.__extends(ErrorLink, _super); - function ErrorLink(errorHandler) { - var _this = _super.call(this) || this; - _this.link = onError(errorHandler); - return _this; - } - ErrorLink.prototype.request = function (operation, forward) { - return this.link.request(operation, forward); - }; - return ErrorLink; -}(apollo_link_1.ApolloLink)); -exports.ErrorLink = ErrorLink; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-error/lib/index.js.map b/node_modules/apollo-link-error/lib/index.js.map deleted file mode 100644 index 4a94840..0000000 --- a/node_modules/apollo-link-error/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,2CAOqB;AAwBrB,SAAgB,OAAO,CAAC,YAA0B;IAChD,OAAO,IAAI,wBAAU,CAAC,UAAC,SAAS,EAAE,OAAO;QACvC,OAAO,IA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E,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;6BAC3C,CAAC,CAAC;4BACH,OAAO;yBACR;wBACD,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;oBAC/B,CAAC;oBACD,QAAQ,EAAE;wBAGR,IAAI,CAAC,aAAa,EAAE;4BAClB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;yBACpC;oBACH,CAAC;iBACF,CAAC,CAAC;aACJ;YAAC,OAAO,CAAC,EAAE;gBACV,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;gBACtD,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACnB;YAED,OAAO;gBACL,IAAI,GAAG;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;gBAC3B,IAAI,UAAU;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AArED,0BAqEC;AAED;IAA+B,qCAAU;IAEvC,mBAAY,YAAoC;QAAhD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;;IACpC,CAAC;IAEM,2BAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;QAEjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IACH,gBAAC;AAAD,CAAC,AAbD,CAA+B,wBAAU,GAaxC;AAbY,8BAAS"} \ No newline at end of file diff --git a/node_modules/apollo-link-error/package.json b/node_modules/apollo-link-error/package.json deleted file mode 100644 index e78a4a0..0000000 --- a/node_modules/apollo-link-error/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "apollo-link-error", - "version": "1.1.13", - "description": "Error Apollo Link for GraphQL Network Stack", - "author": "James Baxley ", - "license": "MIT", - "main": "./lib/index.js", - "module": "./lib/bundle.esm.js", - "typings": "./lib/index.d.ts", - "sideEffects": false, - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/apollo-link.git" - }, - "bugs": { - "url": "https://github.com/apollographql/apollo-link/issues" - }, - "homepage": "https://github.com/apollographql/apollo-link#readme", - "scripts": { - "build": "tsc && rollup -c", - "clean": "rimraf lib/* && rimraf coverage/*", - "coverage": "jest --coverage", - "filesize": "../../scripts/minify", - "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", - "prebuild": "npm run clean", - "prepare": "npm run build", - "test": "npm run lint && jest", - "watch": "tsc -w -p . & rollup -c -w" - }, - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "typescript": "3.0.3" - }, - "jest": { - "transform": { - ".(ts|tsx)": "ts-jest" - }, - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ], - "testURL": "http://localhost" - }, - "gitHead": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/node_modules/apollo-link-http-common/CHANGELOG.md b/node_modules/apollo-link-http-common/CHANGELOG.md deleted file mode 100644 index 227e016..0000000 --- a/node_modules/apollo-link-http-common/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# Change log - ----- - -**NOTE:** This changelog is no longer maintained. Changes are now tracked in -the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). - ----- - -### 0.2.6 - -- No changes - -### 0.2.5 -- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
- [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) - -### 0.2.4 -- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) - -### v0.2.3 -- correct the warning message on no fetch found to node-fetch[PR#526](https://github.com/apollographql/apollo-link/pull/526) - -### v0.2.2 -- update apollo link with zen-observable-ts [PR#515](https://github.com/apollographql/apollo-link/pull/515) - -### v0.2.1 -- Apollo link upgrade - -### v0.2.0 -- rename serializeFetchBody to serializeFetchParameter and take a label argument diff --git a/node_modules/apollo-link-http-common/LICENSE b/node_modules/apollo-link-http-common/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/node_modules/apollo-link-http-common/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 - 2017 Meteor Development Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/apollo-link-http-common/README.md b/node_modules/apollo-link-http-common/README.md deleted file mode 100644 index 9dd9a16..0000000 --- a/node_modules/apollo-link-http-common/README.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: apollo-link-http-common -description: Http utilities shared across Apollo Links ---- - -This repository is used in apollo-link-http and apollo-link-http-batch. The -package is public to allow easier development of links that will be a part of -the main repository. Developers using this package should know that the api -will change and versions may not follow SemVer. diff --git a/node_modules/apollo-link-http-common/lib/bundle.cjs.js b/node_modules/apollo-link-http-common/lib/bundle.cjs.js deleted file mode 100644 index 60b8d29..0000000 --- a/node_modules/apollo-link-http-common/lib/bundle.cjs.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tslib = require('tslib'); -var printer = require('graphql/language/printer'); -var tsInvariant = require('ts-invariant'); - -var defaultHttpOptions = { - includeQuery: true, - includeExtensions: false, -}; -var defaultHeaders = { - accept: '*/*', - 'content-type': 'application/json', -}; -var defaultOptions = { - method: 'POST', -}; -var fallbackHttpConfig = { - http: defaultHttpOptions, - headers: defaultHeaders, - options: defaultOptions, -}; -var throwServerError = function (response, result, message) { - var error = new Error(message); - error.name = 'ServerError'; - error.response = response; - error.statusCode = response.status; - error.result = result; - throw error; -}; -var parseAndCheckHttpResponse = function (operations) { return function (response) { - return (response - .text() - .then(function (bodyText) { - try { - return JSON.parse(bodyText); - } - catch (err) { - var parseError = err; - parseError.name = 'ServerParseError'; - parseError.response = response; - parseError.statusCode = response.status; - parseError.bodyText = bodyText; - return Promise.reject(parseError); - } - }) - .then(function (result) { - if (response.status >= 300) { - throwServerError(response, result, "Response not successful: Received status code " + response.status); - } - if (!Array.isArray(result) && - !result.hasOwnProperty('data') && - !result.hasOwnProperty('errors')) { - throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) - ? operations.map(function (op) { return op.operationName; }) - : operations.operationName) + "'."); - } - return result; - })); -}; }; -var checkFetcher = function (fetcher) { - if (!fetcher && typeof fetch === 'undefined') { - var library = 'unfetch'; - if (typeof window === 'undefined') - library = 'node-fetch'; - throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); - } -}; -var createSignalIfSupported = function () { - if (typeof AbortController === 'undefined') - return { controller: false, signal: false }; - var controller = new AbortController(); - var signal = controller.signal; - return { controller: controller, signal: signal }; -}; -var selectHttpOptionsAndBody = function (operation, fallbackConfig) { - var configs = []; - for (var _i = 2; _i < arguments.length; _i++) { - configs[_i - 2] = arguments[_i]; - } - var options = tslib.__assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); - var http = fallbackConfig.http; - configs.forEach(function (config) { - options = tslib.__assign({}, options, config.options, { headers: tslib.__assign({}, options.headers, config.headers) }); - if (config.credentials) - options.credentials = config.credentials; - http = tslib.__assign({}, http, config.http); - }); - var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; - var body = { operationName: operationName, variables: variables }; - if (http.includeExtensions) - body.extensions = extensions; - if (http.includeQuery) - body.query = printer.print(query); - return { - options: options, - body: body, - }; -}; -var serializeFetchParameter = function (p, label) { - var serialized; - try { - serialized = JSON.stringify(p); - } - catch (e) { - var parseError = process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("Network request failed. " + label + " is not serializable: " + e.message); - parseError.parseError = e; - throw parseError; - } - return serialized; -}; -var selectURI = function (operation, fallbackURI) { - var context = operation.getContext(); - var contextURI = context.uri; - if (contextURI) { - return contextURI; - } - else if (typeof fallbackURI === 'function') { - return fallbackURI(operation); - } - else { - return fallbackURI || '/graphql'; - } -}; - -exports.checkFetcher = checkFetcher; -exports.createSignalIfSupported = createSignalIfSupported; -exports.fallbackHttpConfig = fallbackHttpConfig; -exports.parseAndCheckHttpResponse = parseAndCheckHttpResponse; -exports.selectHttpOptionsAndBody = selectHttpOptionsAndBody; -exports.selectURI = selectURI; -exports.serializeFetchParameter = serializeFetchParameter; -exports.throwServerError = throwServerError; -//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map b/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map deleted file mode 100644 index 3da1d63..0000000 --- a/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __assign } from 'tslib';\nimport { print } from 'graphql/language/printer';\nimport { InvariantError } from 'ts-invariant';\n\nvar defaultHttpOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\nvar defaultHeaders = {\n accept: '*/*',\n 'content-type': 'application/json',\n};\nvar defaultOptions = {\n method: 'POST',\n};\nvar fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\nvar throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\nvar parseAndCheckHttpResponse = function (operations) { return function (response) {\n return (response\n .text()\n .then(function (bodyText) {\n try {\n return JSON.parse(bodyText);\n }\n catch (err) {\n var parseError = err;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n .then(function (result) {\n if (response.status >= 300) {\n throwServerError(response, result, \"Response not successful: Received status code \" + response.status);\n }\n if (!Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')) {\n throwServerError(response, result, \"Server response was missing for query '\" + (Array.isArray(operations)\n ? operations.map(function (op) { return op.operationName; })\n : operations.operationName) + \"'.\");\n }\n return result;\n }));\n}; };\nvar checkFetcher = function (fetcher) {\n if (!fetcher && typeof fetch === 'undefined') {\n var library = 'unfetch';\n if (typeof window === 'undefined')\n library = 'node-fetch';\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(1) : new InvariantError(\"\\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\\nyour environment like https://www.npmjs.com/package/\" + library + \".\\n\\nFor example:\\nimport fetch from '\" + library + \"';\\nimport { createHttpLink } from 'apollo-link-http';\\n\\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });\");\n }\n};\nvar createSignalIfSupported = function () {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n var controller = new AbortController();\n var signal = controller.signal;\n return { controller: controller, signal: signal };\n};\nvar selectHttpOptionsAndBody = function (operation, fallbackConfig) {\n var configs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n configs[_i - 2] = arguments[_i];\n }\n var options = __assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });\n var http = fallbackConfig.http;\n configs.forEach(function (config) {\n options = __assign({}, options, config.options, { headers: __assign({}, options.headers, config.headers) });\n if (config.credentials)\n options.credentials = config.credentials;\n http = __assign({}, http, config.http);\n });\n var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;\n var body = { operationName: operationName, variables: variables };\n if (http.includeExtensions)\n body.extensions = extensions;\n if (http.includeQuery)\n body.query = print(query);\n return {\n options: options,\n body: body,\n };\n};\nvar serializeFetchParameter = function (p, label) {\n var serialized;\n try {\n serialized = JSON.stringify(p);\n }\n catch (e) {\n var parseError = process.env.NODE_ENV === \"production\" ? new InvariantError(2) : new InvariantError(\"Network request failed. \" + label + \" is not serializable: \" + e.message);\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\nvar selectURI = function (operation, fallbackURI) {\n var context = operation.getContext();\n var contextURI = context.uri;\n if (contextURI) {\n return contextURI;\n }\n else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n }\n else {\n return fallbackURI || '/graphql';\n }\n};\n\nexport { checkFetcher, createSignalIfSupported, fallbackHttpConfig, parseAndCheckHttpResponse, selectHttpOptionsAndBody, selectURI, serializeFetchParameter, throwServerError };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["InvariantError","__assign","print"],"mappings":";;;;;;;;AAIA,IAAI,kBAAkB,GAAG;AACzB,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,iBAAiB,EAAE,KAAK;AAC5B,CAAC,CAAC;AACF,IAAI,cAAc,GAAG;AACrB,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,cAAc,EAAE,kBAAkB;AACtC,CAAC,CAAC;AACF,IAAI,cAAc,GAAG;AACrB,IAAI,MAAM,EAAE,MAAM;AAClB,CAAC,CAAC;AACC,IAAC,kBAAkB,GAAG;AACzB,IAAI,IAAI,EAAE,kBAAkB;AAC5B,IAAI,OAAO,EAAE,cAAc;AAC3B,IAAI,OAAO,EAAE,cAAc;AAC3B,EAAE;AACC,IAAC,gBAAgB,GAAG,UAAU,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;AAC5D,IAAI,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AACnC,IAAI,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;AAC/B,IAAI,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,IAAI,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;AACvC,IAAI,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AAC1B,IAAI,MAAM,KAAK,CAAC;AAChB,EAAE;AACC,IAAC,yBAAyB,GAAG,UAAU,UAAU,EAAE,EAAE,OAAO,UAAU,QAAQ,EAAE;AACnF,IAAI,QAAQ,QAAQ;AACpB,SAAS,IAAI,EAAE;AACf,SAAS,IAAI,CAAC,UAAU,QAAQ,EAAE;AAClC,QAAQ,IAAI;AACZ,YAAY,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACxC,SAAS;AACT,QAAQ,OAAO,GAAG,EAAE;AACpB,YAAY,IAAI,UAAU,GAAG,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AAY,GAAG,IAAIF,0BAAc,CAAC,CAAC,CAAC,GAAG,IAAIA,0BAAc,CAAC,0BAA0B,GAAG,KAAK,GAAG,wBAAwB,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;AACvL,QAAQ,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;AAClC,QAAQ,MAAM,UAAU,CAAC;AACzB,KAAK;AACL,IAAI,OAAO,UAAU,CAAC;AACtB,EAAE;AACC,IAAC,SAAS,GAAG,UAAU,SAAS,EAAE,WAAW,EAAE;AAClD,IAAI,IAAI,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;AACzC,IAAI,IAAI,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;AACjC,IAAI,IAAI,UAAU,EAAE;AACpB,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,SAAS,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;AAChD,QAAQ,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;AACtC,KAAK;AACL,SAAS;AACT,QAAQ,OAAO,WAAW,IAAI,UAAU,CAAC;AACzC,KAAK;AACL;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/bundle.esm.js b/node_modules/apollo-link-http-common/lib/bundle.esm.js deleted file mode 100644 index d84067e..0000000 --- a/node_modules/apollo-link-http-common/lib/bundle.esm.js +++ /dev/null @@ -1,125 +0,0 @@ -import { __assign } from 'tslib'; -import { print } from 'graphql/language/printer'; -import { InvariantError } from 'ts-invariant'; - -var defaultHttpOptions = { - includeQuery: true, - includeExtensions: false, -}; -var defaultHeaders = { - accept: '*/*', - 'content-type': 'application/json', -}; -var defaultOptions = { - method: 'POST', -}; -var fallbackHttpConfig = { - http: defaultHttpOptions, - headers: defaultHeaders, - options: defaultOptions, -}; -var throwServerError = function (response, result, message) { - var error = new Error(message); - error.name = 'ServerError'; - error.response = response; - error.statusCode = response.status; - error.result = result; - throw error; -}; -var parseAndCheckHttpResponse = function (operations) { return function (response) { - return (response - .text() - .then(function (bodyText) { - try { - return JSON.parse(bodyText); - } - catch (err) { - var parseError = err; - parseError.name = 'ServerParseError'; - parseError.response = response; - parseError.statusCode = response.status; - parseError.bodyText = bodyText; - return Promise.reject(parseError); - } - }) - .then(function (result) { - if (response.status >= 300) { - throwServerError(response, result, "Response not successful: Received status code " + response.status); - } - if (!Array.isArray(result) && - !result.hasOwnProperty('data') && - !result.hasOwnProperty('errors')) { - throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) - ? operations.map(function (op) { return op.operationName; }) - : operations.operationName) + "'."); - } - return result; - })); -}; }; -var checkFetcher = function (fetcher) { - if (!fetcher && typeof fetch === 'undefined') { - var library = 'unfetch'; - if (typeof window === 'undefined') - library = 'node-fetch'; - throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); - } -}; -var createSignalIfSupported = function () { - if (typeof AbortController === 'undefined') - return { controller: false, signal: false }; - var controller = new AbortController(); - var signal = controller.signal; - return { controller: controller, signal: signal }; -}; -var selectHttpOptionsAndBody = function (operation, fallbackConfig) { - var configs = []; - for (var _i = 2; _i < arguments.length; _i++) { - configs[_i - 2] = arguments[_i]; - } - var options = __assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); - var http = fallbackConfig.http; - configs.forEach(function (config) { - options = __assign({}, options, config.options, { headers: __assign({}, options.headers, config.headers) }); - if (config.credentials) - options.credentials = config.credentials; - http = __assign({}, http, config.http); - }); - var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; - var body = { operationName: operationName, variables: variables }; - if (http.includeExtensions) - body.extensions = extensions; - if (http.includeQuery) - body.query = print(query); - return { - options: options, - body: body, - }; -}; -var serializeFetchParameter = function (p, label) { - var serialized; - try { - serialized = JSON.stringify(p); - } - catch (e) { - var parseError = process.env.NODE_ENV === "production" ? new InvariantError(2) : new InvariantError("Network request failed. " + label + " is not serializable: " + e.message); - parseError.parseError = e; - throw parseError; - } - return serialized; -}; -var selectURI = function (operation, fallbackURI) { - var context = operation.getContext(); - var contextURI = context.uri; - if (contextURI) { - return contextURI; - } - else if (typeof fallbackURI === 'function') { - return fallbackURI(operation); - } - else { - return fallbackURI || '/graphql'; - } -}; - -export { checkFetcher, createSignalIfSupported, fallbackHttpConfig, parseAndCheckHttpResponse, selectHttpOptionsAndBody, selectURI, serializeFetchParameter, throwServerError }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link-http-common/lib/bundle.esm.js.map b/node_modules/apollo-link-http-common/lib/bundle.esm.js.map deleted file mode 100644 index b893800..0000000 --- a/node_modules/apollo-link-http-common/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/index.ts"],"sourcesContent":["import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\nimport { InvariantError } from 'ts-invariant';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: WindowOrWorkerGlobalScope['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: WindowOrWorkerGlobalScope['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new InvariantError(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new InvariantError(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n"],"names":[],"mappings":";;;;AA2FA,IAAM,kBAAkB,GAAqB;IAC3C,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,IAAM,cAAc,GAAG;IAErB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAEF,IAAM,cAAc,GAAG;IACrB,MAAM,EAAE,MAAM;CACf,CAAC;IAEW,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;EACvB;IAEW,gBAAgB,GAAG,UAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IACxD,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAgB,CAAC;IAEhD,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;IAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;IACnC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAEtB,MAAM,KAAK,CAAC;AACd,EAAE;IAGW,yBAAyB,GAAG,UAAA,UAAU,IAAI,OAAA,UAAC,QAAkB;IACxE,QACE,QAAQ;SACL,IAAI,EAAE;SACN,IAAI,CAAC,UAAA,QAAQ;QACZ,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,IAAM,UAAU,GAAG,GAAuB,CAAC;YAC3C,UAAU,C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,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,IAAM,UAAU,GAAG,mFACwC;QAE3D,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,MAAM,UAAU,CAAC;KAClB;IACD,OAAO,UAAU,CAAC;AACpB,EAAE;IAGW,SAAS,GAAG,UACvB,SAAS,EACT,WAAyD;IAEzD,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;IACvC,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAE/B,IAAI,UAAU,EAAE;QACd,OAAO,UAAU,CAAC;KACnB;SAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/B;SAAM;QACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;KAC9C;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/bundle.umd.js b/node_modules/apollo-link-http-common/lib/bundle.umd.js deleted file mode 100644 index 0d234d1..0000000 --- a/node_modules/apollo-link-http-common/lib/bundle.umd.js +++ /dev/null @@ -1,138 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('graphql/language/printer'), require('ts-invariant')) : - typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'graphql/language/printer', 'ts-invariant'], factory) : - (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.httpCommon = {}), global.tslib, global.graphql.printer, global.invariant)); -}(this, (function (exports, tslib_1, printer, tsInvariant) { 'use strict'; - - var defaultHttpOptions = { - includeQuery: true, - includeExtensions: false, - }; - var defaultHeaders = { - accept: '*/*', - 'content-type': 'application/json', - }; - var defaultOptions = { - method: 'POST', - }; - var fallbackHttpConfig = { - http: defaultHttpOptions, - headers: defaultHeaders, - options: defaultOptions, - }; - var throwServerError = function (response, result, message) { - var error = new Error(message); - error.name = 'ServerError'; - error.response = response; - error.statusCode = response.status; - error.result = result; - throw error; - }; - var parseAndCheckHttpResponse = function (operations) { return function (response) { - return (response - .text() - .then(function (bodyText) { - try { - return JSON.parse(bodyText); - } - catch (err) { - var parseError = err; - parseError.name = 'ServerParseError'; - parseError.response = response; - parseError.statusCode = response.status; - parseError.bodyText = bodyText; - return Promise.reject(parseError); - } - }) - .then(function (result) { - if (response.status >= 300) { - throwServerError(response, result, "Response not successful: Received status code " + response.status); - } - if (!Array.isArray(result) && - !result.hasOwnProperty('data') && - !result.hasOwnProperty('errors')) { - throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) - ? operations.map(function (op) { return op.operationName; }) - : operations.operationName) + "'."); - } - return result; - })); - }; }; - var checkFetcher = function (fetcher) { - if (!fetcher && typeof fetch === 'undefined') { - var library = 'unfetch'; - if (typeof window === 'undefined') - library = 'node-fetch'; - throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); - } - }; - var createSignalIfSupported = function () { - if (typeof AbortController === 'undefined') - return { controller: false, signal: false }; - var controller = new AbortController(); - var signal = controller.signal; - return { controller: controller, signal: signal }; - }; - var selectHttpOptionsAndBody = function (operation, fallbackConfig) { - var configs = []; - for (var _i = 2; _i < arguments.length; _i++) { - configs[_i - 2] = arguments[_i]; - } - var options = tslib_1.__assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); - var http = fallbackConfig.http; - configs.forEach(function (config) { - options = tslib_1.__assign({}, options, config.options, { headers: tslib_1.__assign({}, options.headers, config.headers) }); - if (config.credentials) - options.credentials = config.credentials; - http = tslib_1.__assign({}, http, config.http); - }); - var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; - var body = { operationName: operationName, variables: variables }; - if (http.includeExtensions) - body.extensions = extensions; - if (http.includeQuery) - body.query = printer.print(query); - return { - options: options, - body: body, - }; - }; - var serializeFetchParameter = function (p, label) { - var serialized; - try { - serialized = JSON.stringify(p); - } - catch (e) { - var parseError = process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("Network request failed. " + label + " is not serializable: " + e.message); - parseError.parseError = e; - throw parseError; - } - return serialized; - }; - var selectURI = function (operation, fallbackURI) { - var context = operation.getContext(); - var contextURI = context.uri; - if (contextURI) { - return contextURI; - } - else if (typeof fallbackURI === 'function') { - return fallbackURI(operation); - } - else { - return fallbackURI || '/graphql'; - } - }; - - exports.checkFetcher = checkFetcher; - exports.createSignalIfSupported = createSignalIfSupported; - exports.fallbackHttpConfig = fallbackHttpConfig; - exports.parseAndCheckHttpResponse = parseAndCheckHttpResponse; - exports.selectHttpOptionsAndBody = selectHttpOptionsAndBody; - exports.selectURI = selectURI; - exports.serializeFetchParameter = serializeFetchParameter; - exports.throwServerError = throwServerError; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link-http-common/lib/bundle.umd.js.map b/node_modules/apollo-link-http-common/lib/bundle.umd.js.map deleted file mode 100644 index 2ad167e..0000000 --- a/node_modules/apollo-link-http-common/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { Operation } from 'apollo-link';\nimport { print } from 'graphql/language/printer';\nimport { InvariantError } from 'ts-invariant';\n\n/*\n * Http Utilities: shared across links that make http requests\n */\n\n// XXX replace with actual typings when available\ndeclare var AbortController: any;\n\n//Used for any Error for data from the server\n//on a request with a Status >= 300\n//response contains no data or errors\nexport type ServerError = Error & {\n response: Response;\n result: Record;\n statusCode: number;\n};\n\n//Thrown when server's resonse is cannot be parsed\nexport type ServerParseError = Error & {\n response: Response;\n statusCode: number;\n bodyText: string;\n};\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any; //overrides headers in options\n credentials?: any;\n}\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\n// The body of a GraphQL-over-HTTP-POST request.\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record;\n extensions?: Record;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: WindowOrWorkerGlobalScope['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const throwServerError = (response, result, message) => {\n const error = new Error(message) as ServerError;\n\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n\n throw error;\n};\n\n//TODO: when conditional types come in ts 2.8, operations should be a generic type that extends Operation | Array\nexport const parseAndCheckHttpResponse = operations => (response: Response) => {\n return (\n response\n .text()\n .then(bodyText => {\n try {\n return JSON.parse(bodyText);\n } catch (err) {\n const parseError = err as ServerParseError;\n parseError.name = 'ServerParseError';\n parseError.response = response;\n parseError.statusCode = response.status;\n parseError.bodyText = bodyText;\n return Promise.reject(parseError);\n }\n })\n //TODO: when conditional types come out then result should be T extends Array ? Array : FetchResult\n .then((result: any) => {\n if (response.status >= 300) {\n //Network error\n throwServerError(\n response,\n result,\n `Response not successful: Received status code ${response.status}`,\n );\n }\n //TODO should really error per response in a Batch based on properties\n // - could be done in a validation link\n if (\n !Array.isArray(result) &&\n !result.hasOwnProperty('data') &&\n !result.hasOwnProperty('errors')\n ) {\n //Data error\n throwServerError(\n response,\n result,\n `Server response was missing for query '${\n Array.isArray(operations)\n ? operations.map(op => op.operationName)\n : operations.operationName\n }'.`,\n );\n }\n return result;\n })\n );\n};\n\nexport const checkFetcher = (fetcher: WindowOrWorkerGlobalScope['fetch']) => {\n if (!fetcher && typeof fetch === 'undefined') {\n let library: string = 'unfetch';\n if (typeof window === 'undefined') library = 'node-fetch';\n throw new InvariantError(`\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/${library}.\n\nFor example:\nimport fetch from '${library}';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });`);\n }\n};\n\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array\n) => {\n let options: HttpConfig & Record = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http;\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...config.headers,\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = print(query);\n\n return {\n options,\n body,\n };\n};\n\nexport const serializeFetchParameter = (p, label) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new InvariantError(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n\n//selects \"/graphql\" by default\nexport const selectURI = (\n operation,\n fallbackURI?: string | ((operation: Operation) => string),\n) => {\n const context = operation.getContext();\n const contextURI = context.uri;\n\n if (contextURI) {\n return contextURI;\n } else if (typeof fallbackURI === 'function') {\n return fallbackURI(operation);\n } else {\n return (fallbackURI as string) || '/graphql';\n }\n};\n"],"names":["print"],"mappings":";;;;;;EA2FA,IAAM,kBAAkB,GAAqB;MAC3C,YAAY,EAAE,IAAI;MAClB,iBAAiB,EAAE,KAAK;GACzB,CAAC;EAEF,IAAM,cAAc,GAAG;MAErB,MAAM,EAAE,KAAK;MACb,cAAc,EAAE,kBAAkB;GACnC,CAAC;EAEF,IAAM,cAAc,GAAG;MACrB,MAAM,EAAE,MAAM;GACf,CAAC;MAEW,kBAAkB,GAAG;MAChC,IAAI,EAAE,kBAAkB;MACxB,OAAO,EAAE,cAAc;MACvB,OAAO,EAAE,cAAc;IACvB;MAEW,gBAAgB,GAAG,UAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;MACxD,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAgB,CAAC;MAEhD,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;MAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;MAC1B,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;MACnC,KAAK,CAAC,MAAM,GAAG,MAAM,CA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AAC,iBAAiB;UAAG,IAAY,CAAC,UAAU,GAAG,UAAU,CAAC;MAGlE,IAAI,IAAI,CAAC,YAAY;UAAG,IAAY,CAAC,KAAK,GAAGA,aAAK,CAAC,KAAK,CAAC,CAAC;MAE1D,OAAO;UACL,OAAO,SAAA;UACP,IAAI,MAAA;OACL,CAAC;EACJ,EAAE;MAEW,uBAAuB,GAAG,UAAC,CAAC,EAAE,KAAK;MAC9C,IAAI,UAAU,CAAC;MACf,IAAI;UACF,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;OAChC;MAAC,OAAO,CAAC,EAAE;UACV,IAAM,UAAU,GAAG,2GACwC;UAE3D,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;UAC1B,MAAM,UAAU,CAAC;OAClB;MACD,OAAO,UAAU,CAAC;EACpB,EAAE;MAGW,SAAS,GAAG,UACvB,SAAS,EACT,WAAyD;MAEzD,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;MACvC,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;MAE/B,IAAI,UAAU,EAAE;UACd,OAAO,UAAU,CAAC;OACnB;WAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;UAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;OAC/B;WAAM;UACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;OAC9C;EACH;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/index.d.ts b/node_modules/apollo-link-http-common/lib/index.d.ts deleted file mode 100644 index dbbe809..0000000 --- a/node_modules/apollo-link-http-common/lib/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Operation } from 'apollo-link'; -import { InvariantError } from 'ts-invariant'; -export declare type ServerError = Error & { - response: Response; - result: Record; - statusCode: number; -}; -export declare type ServerParseError = Error & { - response: Response; - statusCode: number; - bodyText: string; -}; -export declare type ClientParseError = InvariantError & { - parseError: Error; -}; -export interface HttpQueryOptions { - includeQuery?: boolean; - includeExtensions?: boolean; -} -export interface HttpConfig { - http?: HttpQueryOptions; - options?: any; - headers?: any; - credentials?: any; -} -export interface UriFunction { - (operation: Operation): string; -} -export interface Body { - query?: string; - operationName?: string; - variables?: Record; - extensions?: Record; -} -export interface HttpOptions { - uri?: string | UriFunction; - includeExtensions?: boolean; - fetch?: WindowOrWorkerGlobalScope['fetch']; - headers?: any; - credentials?: string; - fetchOptions?: any; -} -export declare const fallbackHttpConfig: { - http: HttpQueryOptions; - headers: { - accept: string; - 'content-type': string; - }; - options: { - method: string; - }; -}; -export declare const throwServerError: (response: any, result: any, message: any) => never; -export declare const parseAndCheckHttpResponse: (operations: any) => (response: Response) => Promise; -export declare const checkFetcher: (fetcher: (input: RequestInfo, init?: RequestInit) => Promise) => void; -export declare const createSignalIfSupported: () => { - controller: any; - signal: any; -}; -export declare const selectHttpOptionsAndBody: (operation: Operation, fallbackConfig: HttpConfig, ...configs: HttpConfig[]) => { - options: HttpConfig & Record; - body: Body; -}; -export declare const serializeFetchParameter: (p: any, label: any) => any; -export declare const selectURI: (operation: any, fallbackURI?: string | ((operation: Operation) => string)) => any; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/index.d.ts.map b/node_modules/apollo-link-http-common/lib/index.d.ts.map deleted file mode 100644 index 262422a..0000000 --- a/node_modules/apollo-link-http-common/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAY9C,oBAAY,WAAW,GAAG,KAAK,GAAG;IAChC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,UAAU,EAAE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eAAO,MAAM,yBAAyB,2DA+CrC,CAAC;AAEF,eAAO,MAAM,YAAY,kFAcxB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;CAOnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CA8CpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,6BAYnC,CAAC;AAGF,eAAO,MAAM,SAAS,oFAcrB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/index.js b/node_modules/apollo-link-http-common/lib/index.js deleted file mode 100644 index 05cd095..0000000 --- a/node_modules/apollo-link-http-common/lib/index.js +++ /dev/null @@ -1,124 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var printer_1 = require("graphql/language/printer"); -var ts_invariant_1 = require("ts-invariant"); -var defaultHttpOptions = { - includeQuery: true, - includeExtensions: false, -}; -var defaultHeaders = { - accept: '*/*', - 'content-type': 'application/json', -}; -var defaultOptions = { - method: 'POST', -}; -exports.fallbackHttpConfig = { - http: defaultHttpOptions, - headers: defaultHeaders, - options: defaultOptions, -}; -exports.throwServerError = function (response, result, message) { - var error = new Error(message); - error.name = 'ServerError'; - error.response = response; - error.statusCode = response.status; - error.result = result; - throw error; -}; -exports.parseAndCheckHttpResponse = function (operations) { return function (response) { - return (response - .text() - .then(function (bodyText) { - try { - return JSON.parse(bodyText); - } - catch (err) { - var parseError = err; - parseError.name = 'ServerParseError'; - parseError.response = response; - parseError.statusCode = response.status; - parseError.bodyText = bodyText; - return Promise.reject(parseError); - } - }) - .then(function (result) { - if (response.status >= 300) { - exports.throwServerError(response, result, "Response not successful: Received status code " + response.status); - } - if (!Array.isArray(result) && - !result.hasOwnProperty('data') && - !result.hasOwnProperty('errors')) { - exports.throwServerError(response, result, "Server response was missing for query '" + (Array.isArray(operations) - ? operations.map(function (op) { return op.operationName; }) - : operations.operationName) + "'."); - } - return result; - })); -}; }; -exports.checkFetcher = function (fetcher) { - if (!fetcher && typeof fetch === 'undefined') { - var library = 'unfetch'; - if (typeof window === 'undefined') - library = 'node-fetch'; - throw new ts_invariant_1.InvariantError("\nfetch is not found globally and no fetcher passed, to fix pass a fetch for\nyour environment like https://www.npmjs.com/package/" + library + ".\n\nFor example:\nimport fetch from '" + library + "';\nimport { createHttpLink } from 'apollo-link-http';\n\nconst link = createHttpLink({ uri: '/graphql', fetch: fetch });"); - } -}; -exports.createSignalIfSupported = function () { - if (typeof AbortController === 'undefined') - return { controller: false, signal: false }; - var controller = new AbortController(); - var signal = controller.signal; - return { controller: controller, signal: signal }; -}; -exports.selectHttpOptionsAndBody = function (operation, fallbackConfig) { - var configs = []; - for (var _i = 2; _i < arguments.length; _i++) { - configs[_i - 2] = arguments[_i]; - } - var options = tslib_1.__assign({}, fallbackConfig.options, { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials }); - var http = fallbackConfig.http; - configs.forEach(function (config) { - options = tslib_1.__assign({}, options, config.options, { headers: tslib_1.__assign({}, options.headers, config.headers) }); - if (config.credentials) - options.credentials = config.credentials; - http = tslib_1.__assign({}, http, config.http); - }); - var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query; - var body = { operationName: operationName, variables: variables }; - if (http.includeExtensions) - body.extensions = extensions; - if (http.includeQuery) - body.query = printer_1.print(query); - return { - options: options, - body: body, - }; -}; -exports.serializeFetchParameter = function (p, label) { - var serialized; - try { - serialized = JSON.stringify(p); - } - catch (e) { - var parseError = new ts_invariant_1.InvariantError("Network request failed. " + label + " is not serializable: " + e.message); - parseError.parseError = e; - throw parseError; - } - return serialized; -}; -exports.selectURI = function (operation, fallbackURI) { - var context = operation.getContext(); - var contextURI = context.uri; - if (contextURI) { - return contextURI; - } - else if (typeof fallbackURI === 'function') { - return fallbackURI(operation); - } - else { - return fallbackURI || '/graphql'; - } -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/lib/index.js.map b/node_modules/apollo-link-http-common/lib/index.js.map deleted file mode 100644 index ca963ac..0000000 --- a/node_modules/apollo-link-http-common/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,oDAAiD;AACjD,6CAA8C;AAyF9C,IAAM,kBAAkB,GAAqB;IAC3C,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,IAAM,cAAc,GAAG;IAErB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAEF,IAAM,cAAc,GAAG;IACrB,MAAM,EAAE,MAAM;CACf,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;CACxB,CAAC;AAEW,QAAA,gBAAgB,GAAG,UAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IACxD,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAgB,CAAC;IAEhD,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;IAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;IACnC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAEtB,MAAM,KAAK,CAAC;AACd,CAAC,CAAC;AAGW,QAAA,yBAAyB,GAAG,UAAA,UAAU,IAAI,OAAA,UAAC,QAAkB;IACxE,OAAO,CACL,QAAQ;SACL,IAAI,EAAE;SACN,IAAI,CAAC,UAAA,QAAQ;QACZ,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SAC7B;QAAC,OAAO,GAAG,EAAE;YACZ,IAAM,UAAU,GAAG,GAAuB,CAAC;YAC3C,UAAU,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrC,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC/B,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AC;AAEW,QAAA,uBAAuB,GAAG,UAAC,CAAC,EAAE,KAAK;IAC9C,IAAI,UAAU,CAAC;IACf,IAAI;QACF,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,IAAM,UAAU,GAAG,IAAI,6BAAc,CACnC,6BAA2B,KAAK,8BAAyB,CAAC,CAAC,OAAS,CACjD,CAAC;QACtB,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,MAAM,UAAU,CAAC;KAClB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAGW,QAAA,SAAS,GAAG,UACvB,SAAS,EACT,WAAyD;IAEzD,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;IACvC,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAE/B,IAAI,UAAU,EAAE;QACd,OAAO,UAAU,CAAC;KACnB;SAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;QAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/B;SAAM;QACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;KAC9C;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http-common/package.json b/node_modules/apollo-link-http-common/package.json deleted file mode 100644 index 90d1acd..0000000 --- a/node_modules/apollo-link-http-common/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "apollo-link-http-common", - "version": "0.2.16", - "description": "Http utilities for Apollo Link shared across all links using http", - "main": "./lib/index.js", - "module": "./lib/bundle.esm.js", - "typings": "./lib/index.d.ts", - "sideEffects": false, - "scripts": { - "build": "tsc && rollup -c", - "clean": "rimraf lib/* && rimraf coverage/*", - "coverage": "jest --coverage", - "filesize": "../../scripts/minify", - "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", - "prebuild": "npm run clean", - "prepare": "npm run build", - "test": "npm run lint && jest", - "watch": "tsc -w -p . & rollup -c -w" - }, - "keywords": [ - "apollo", - "http", - "network" - ], - "author": "Evans Hauser", - "license": "MIT", - "dependencies": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "fetch-mock": "6.5.2", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "object-to-querystring": "1.0.8", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "typescript": "3.0.3" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/apollo-link.git" - }, - "bugs": { - "url": "https://github.com/apollographql/apollo-link/issues" - }, - "homepage": "https://github.com/apollographql/apollo-link#readme", - "jest": { - "transform": { - ".(ts|tsx)": "ts-jest" - }, - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ], - "testURL": "http://localhost" - }, - "gitHead": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/node_modules/apollo-link-http/CHANGELOG.md b/node_modules/apollo-link-http/CHANGELOG.md deleted file mode 100644 index 33b0a2e..0000000 --- a/node_modules/apollo-link-http/CHANGELOG.md +++ /dev/null @@ -1,85 +0,0 @@ -# Change log - ----- - -**NOTE:** This changelog is no longer maintained. Changes are now tracked in -the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). - ----- - -### 1.5.7 - -- Fix a bug where empty `apollographql-client-name` and - `apollographql-client-version` headers were being included with requests - when they weren't set in the `context` based `clientAwareness` object.
- [@hwillson](http://github.com/hwillson) in [#872](https://github.com/apollographql/apollo-link/pull/872) - -### 1.5.6 - -- If `name` or `version` client awareness settings are found in the - incoming `operation` `context`, they'll be extracted and added as headers - to all outgoing requests. The header names used (`apollographql-client-name` - and `apollographql-client-version`) line up with the associated Apollo Server - changes made in https://github.com/apollographql/apollo-server/pull/1960.
- [@hwillson](http://github.com/hwillson) in [#872](https://github.com/apollographql/apollo-link/pull/872) - -### 1.5.5 -- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
- [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) - -### 1.5.4 -- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) -- Check for signal already present on `fetchOptions` [#584](https://github.com/apollographql/apollo-link/pull/584) - -### 1.5.3 -- updated dependency on `apolloLink.httpCommon` [#522](https://github.com/apollographql/apollo-link/pull/522) - -### 1.5.2 -- fix issue where execution result with only `errors` key fired the `next` event -- Add missing rollup alias and make http-common exported as `apolloLink.httpCommon` [#522](https://github.com/apollographql/apollo-link/pull/522) - -### 1.5.1 -- update apollo link with zen-observable-ts [PR#515](https://github.com/apollographql/apollo-link/pull/515) - -### 1.5.0 -- New useGETForQueries option: if set, uses GET for queries (but not mutations) - -### 1.4.0 -- move logic to apollo-link-http-core [PR#364](https://github.com/apollographql/apollo-link/pull/364) -- follow the spec properly for GET requests [PR#490](https://github.com/apollographql/apollo-link/pull/490) -- ApolloLink upgrade - -### 1.3.3 -- ApolloLink upgrade -- Allow graphql results to fire even if there is a network error - -### 1.3.2 -- Update to graphql@0.12 - -### 1.3.1 -- export options as named interface [TypeScript] -- Fix typescript bug with destructuring of parameter in createHttpLink ([#189](https://github.com/apollographql/apollo-link/issues/189)) - -### 1.3.0 -- changed to initially parsing response as text to improve error handling -- cleaned up error handling types and added docs -- changed peer-dependency of apollo-link to actual dependency - -### 1.2.0 -- moved to better rollup build -- support for persisted queries by opting out of sending the query - -### v1.1.0 -- support dynamic endpoints using `uri` on the context -- the request not attaches the raw response as `response` on the context. This can be used to access response headers or more - -### v1.0.0 -- official release, not changes - -### v0.9.0 -- changed `fetcherOptions` to be `fetchOptions` and added a test for using 'GET' requests - -### v0.8.0 -- throw error on empty ExectionResult (missing) -- support setting credentials, headers, and fetcherOptions in the setup of the link -- removed sending of context to the server and allowed opt-in of sending extensions diff --git a/node_modules/apollo-link-http/LICENSE b/node_modules/apollo-link-http/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/node_modules/apollo-link-http/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 - 2017 Meteor Development Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/apollo-link-http/README.md b/node_modules/apollo-link-http/README.md deleted file mode 100644 index 1547f27..0000000 --- a/node_modules/apollo-link-http/README.md +++ /dev/null @@ -1,315 +0,0 @@ ---- -title: apollo-link-http -description: Get GraphQL results over a network using HTTP fetch. ---- - -The http link is the most common Apollo Link, a system of modular components -for GraphQL networking. If you haven't done so already, [read the Apollo Link -docs](https://www.apollographql.com/docs/link/#usage) to learn about the Apollo -Link ecosystem and how to use this link with libraries like Apollo Client and -graphql-tools, or as a standalone client. - -The http link is a terminating link that fetches GraphQL results from a GraphQL -endpoint over an http connection. The http link supports both POST and GET -requests with the ability to change the http options on a per query basis. This -can be used for authentication, persisted queries, dynamic uris, and other -granular updates. - -## Usage - -Import and initialize this link in just two lines: - -```js -import { createHttpLink } from "apollo-link-http"; - -const link = createHttpLink({ uri: "/graphql" }); -``` - -## Options - -HTTP Link takes an object with some options on it to customize the behavior of the link. If your server supports it, the HTTP link can also send over metadata about the request in the extensions field. To enable this, pass `includeExtensions` as true. The options you can pass are outlined below: - -* `uri`: the URI key is a string endpoint or function resolving to an endpoint -- will default to "/graphql" if not specified -* `includeExtensions`: allow passing the extensions field to your graphql server, defaults to false -* `fetch`: a `fetch` compatible API for making a request -* `headers`: an object representing values to be sent as headers on the request -* `credentials`: a string representing the credentials policy you want for the fetch call. Possible values are: `omit`, `include` and `same-origin` -* `fetchOptions`: any overrides of the fetch options argument to pass to the fetch call -* `useGETForQueries`: set to `true` to use the HTTP `GET` method for queries (but not for mutations) - -## Fetch polyfill - -The HTTP Link relies on having `fetch` present in your runtime environment. If you are running on react-native, or modern browsers, this should be no problem. If you are targeting an environment without `fetch` such as older browsers or the server, you will need to pass your own `fetch` to the link through the options. We recommend [`unfetch`](https://github.com/developit/unfetch) for older browsers and [`node-fetch`](https://github.com/bitinn/node-fetch) for running in Node. - -## Context - -The Http Link uses the `headers` field on the context to allow passing headers to the HTTP request. It also supports the `credentials` field for defining credentials policy, `uri` for changing the endpoint dynamically, and `fetchOptions` to allow generic fetch overrides (i.e. `method: "GET"`). These options will override the same key if passed when creating the the link. - -Note that if you set `fetchOptions.method` to `GET`, the http link will follow the [standard GraphQL HTTP GET encoding](http://graphql.org/learn/serving-over-http/#get-request): the query, variables, operation name, and extensions will be passed as query parameters rather than in the HTTP request body. If you want mutations to continue to be sent as non-idempotent `POST` requests, set the top-level `useGETForQueries` option to `true` instead of setting `fetchOptions.method` to `GET`. - -This link also attaches the response from the `fetch` operation on the context as `response` so you can access it from within another link. - -* `headers`: an object representing values to be sent as headers on the request -* `credentials`: a string representing the credentials policy you want for the fetch call. Possible values are: `omit`, `include` and `same-origin` -* `uri`: a string of the endpoint you want to fetch from -* `fetchOptions`: any overrides of the fetch options argument to pass to the fetch call -* `response`: this is the raw response from the fetch request after it is made. -* `http`: this is an object to control fine grained aspects of the http link itself, such as persisted queries (see below) - -### Persisted queries - -The http link supports an advanced GraphQL feature called persisted queries. This allows you to not send the stringified query over the wire, but instead send some kind of identifier of the query. To support this you need to attach the id somewhere to the extensions field and pass the following options to the context: - -```js -operation.setContext({ - http: { - includeExtensions: true, - includeQuery: false, - } -}) -``` - -The `http` object on context currently supports two keys: - -* `includeExtensions`: Send the extensions object for this request. -* `includeQuery`: Don't send the `query` field for this request. - -One way to use persisted queries is with [apollo-link-persisted-queries](https://github.com/apollographql/apollo-link-persisted-queries) and [Apollo Engine](https://www.apollographql.com/docs/engine/auto-persisted-queries.html). - -### Passing context per query - -Apollo Client supports passing context separately for every query, so you can do things like pass a special header for a single query invocation if you need to. - -```js -import { createHttpLink } from "apollo-link-http"; -import ApolloClient from "apollo-client"; -import { InMemoryCache } from "apollo-cache-inmemory"; - -const client = new ApolloClient({ - link: createHttpLink({ uri: "/graphql" }), - cache: new InMemoryCache() -}); - -// a query with apollo-client -client.query({ - query: MY_QUERY, - context: { - // example of setting the headers with context per operation - headers: { - special: "Special header value" - } - } -}); -``` - -## Errors - -The Http Link draws a distinction between client, server and GraphQL errors. Server errors can occur in three different scenarios: parse, network and data errors. [`apollo-link-error`](error) provides an [interface](error#callback) for handling these errors. This list describes the scenarios that cause different errors: - -* _Client parse error_: the request body is not-serializable due to circular references for example -* _Server parse error_: the response from the server cannot be parsed ([response.json()](https://developer.mozilla.org/en-US/docs/Web/API/Body/json)) -* _Server network error_: the response has a status of >= 300 -* _Server data error_: the parse request does not contain `data` or `errors` -* _GraphQL error_: an objects in the `errors` array for a 200 level status - -Since many server implementations can return a valid GraphQL result on a server network error, the thrown `Error` object contains the parsed server result. A server data error also receives the parsed result. - -The table below provides a summary of error, `Observable` method called by the HTTP link, and type of error thrown for each failure: - -| Error | Callback | Error Type | -| -------------- | :------: | ------------------ | -| Client Parse | `error` | `ClientParseError` | -| Server Parse | `error` | `ServerParseError` | -| Server Network | `error` | `ServerError` | -| Server Data | `error` | `ServerError` | -| GraphQL Error | `next` | `Object` | - -All error types inherit the `name`, `message`, and nullable `stack` properties from the generic javascript [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error). - -```js -//type ClientParseError -{ - parseError: Error; // Error returned from response.json() -}; - -//type ServerParseError -{ - response: Response; // Object returned from fetch() - statusCode: number; // HTTP status code - bodyText: string // text that was returned from server -}; - -//type ServerError -{ - result: Record; // Parsed object from server response - response: Response; // Object returned from fetch() - statusCode: number; // HTTP status code -}; -``` - -## Custom fetching - -You can use the `fetch` option when creating an http-link to do a lot of custom networking. This is useful if you want to modify the request based on the calculated headers or calculate the uri based on the operation: - -### Custom auth - -```js -const customFetch = (uri, options) => { - const { header } = Hawk.client.header( - "http://example.com:8000/resource/1?b=1&a=2", - "POST", - { credentials: credentials, ext: "some-app-data" } - ); - options.headers.Authorization = header; - return fetch(uri, options); -}; - -const link = createHttpLink({ fetch: customFetch }); -``` - -### Dynamic URI - -```js -const customFetch = (uri, options) => { - const { operationName } = JSON.parse(options.body); - return fetch(`${uri}/graph/graphql?opname=${operationName}`, options); -}; - -const link = createHttpLink({ fetch: customFetch }); -``` - -## Upgrade: Apollo Client 1.0 - -If you previously used either `apollo-fetch` or `apollo-client`'s `createNetworkInterface`, you will need to change the way `use` and `useAfter` are implemented in your app. Both can be implemented by writing a custom link. It's important to note that regardless of whether you're adding middleware or afterware, your Http link will always be last in the chain since it's a terminating link. - -#### Middleware - -_Before_ - -```js -// before -import ApolloClient, { createNetworkInterface } from "apollo-client"; - -const networkInterface = createNetworkInterface({ uri: "/graphql" }); - -networkInterface.use([ - { - applyMiddleware(req, next) { - if (!req.options.headers) { - req.options.headers = {}; // Create the header object if needed. - } - req.options.headers["authorization"] = localStorage.getItem("token") - ? localStorage.getItem("token") - : null; - next(); - } - } -]); -``` - -_After_ - -```js -import { ApolloLink } from "apollo-link"; -import { createHttpLink } from "apollo-link-http"; - -const httpLink = createHttpLink({ uri: "/graphql" }); -const middlewareLink = new ApolloLink((operation, forward) => { - operation.setContext({ - headers: { - authorization: localStorage.getItem("token") || null - } - }); - return forward(operation); -}); - -// use with apollo-client -const link = middlewareLink.concat(httpLink); -``` - -#### Afterware (error) - -_Before_ - -```js -import ApolloClient, { createNetworkInterface } from "apollo-client"; -import { logout } from "./logout"; - -const networkInterface = createNetworkInterface({ uri: "/graphql" }); - -networkInterface.useAfter([ - { - applyAfterware({ response }, next) { - if (response.statusCode === 401) { - logout(); - } - next(); - } - } -]); -``` - -_After_ - -```js -import { ApolloLink } from "apollo-link"; -import { createHttpLink } from "apollo-link-http"; -import { onError } from "apollo-link-error"; - -import { logout } from "./logout"; - -const httpLink = createHttpLink({ uri: "/graphql" }); -const errorLink = onError(({ networkError }) => { - if (networkError.statusCode === 401) { - logout(); - } -}); - -// use with apollo-client -const link = errorLink.concat(httpLink); -``` - -#### Afterware (data manipulation) - -_Before_ - -```js -import ApolloClient, { createNetworkInterface } from "apollo-client"; - -const networkInterface = createNetworkInterface({ uri: "/graphql" }); - -networkInterface.useAfter([ - { - applyAfterware({ response }, next) { - if (response.data.user.lastLoginDate) { - response.data.user.lastLoginDate = new Date( - response.data.user.lastLoginDate - ); - } - next(); - } - } -]); -``` - -_After_ - -```js -import { ApolloLink } from "apollo-link"; -import { createHttpLink } from "apollo-link-http"; - -const httpLink = createHttpLink({ uri: "/graphql" }); -const addDatesLink = new ApolloLink((operation, forward) => { - return forward(operation).map(response => { - if (response.data.user.lastLoginDate) { - response.data.user.lastLoginDate = new Date( - response.data.user.lastLoginDate - ); - } - return response; - }); -}); - -// use with apollo-client -const link = addDatesLink.concat(httpLink); -``` diff --git a/node_modules/apollo-link-http/lib/bundle.cjs.js b/node_modules/apollo-link-http/lib/bundle.cjs.js deleted file mode 100644 index 8199fb7..0000000 --- a/node_modules/apollo-link-http/lib/bundle.cjs.js +++ /dev/null @@ -1,150 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tslib = require('tslib'); -var apolloLink = require('apollo-link'); -var apolloLinkHttpCommon = require('apollo-link-http-common'); - -var createHttpLink = function (linkOptions) { - if (linkOptions === void 0) { linkOptions = {}; } - var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = tslib.__rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); - apolloLinkHttpCommon.checkFetcher(fetcher); - if (!fetcher) { - fetcher = fetch; - } - var linkConfig = { - http: { includeExtensions: includeExtensions }, - options: requestOptions.fetchOptions, - credentials: requestOptions.credentials, - headers: requestOptions.headers, - }; - return new apolloLink.ApolloLink(function (operation) { - var chosenURI = apolloLinkHttpCommon.selectURI(operation, uri); - var context = operation.getContext(); - var clientAwarenessHeaders = {}; - if (context.clientAwareness) { - var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; - if (name_1) { - clientAwarenessHeaders['apollographql-client-name'] = name_1; - } - if (version) { - clientAwarenessHeaders['apollographql-client-version'] = version; - } - } - var contextHeaders = tslib.__assign({}, clientAwarenessHeaders, context.headers); - var contextConfig = { - http: context.http, - options: context.fetchOptions, - credentials: context.credentials, - headers: contextHeaders, - }; - var _b = apolloLinkHttpCommon.selectHttpOptionsAndBody(operation, apolloLinkHttpCommon.fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; - var controller; - if (!options.signal) { - var _c = apolloLinkHttpCommon.createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; - controller = _controller; - if (controller) - options.signal = signal; - } - var definitionIsMutation = function (d) { - return d.kind === 'OperationDefinition' && d.operation === 'mutation'; - }; - if (useGETForQueries && - !operation.query.definitions.some(definitionIsMutation)) { - options.method = 'GET'; - } - if (options.method === 'GET') { - var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; - if (parseError) { - return apolloLink.fromError(parseError); - } - chosenURI = newURI; - } - else { - try { - options.body = apolloLinkHttpCommon.serializeFetchParameter(body, 'Payload'); - } - catch (parseError) { - return apolloLink.fromError(parseError); - } - } - return new apolloLink.Observable(function (observer) { - fetcher(chosenURI, options) - .then(function (response) { - operation.setContext({ response: response }); - return response; - }) - .then(apolloLinkHttpCommon.parseAndCheckHttpResponse(operation)) - .then(function (result) { - observer.next(result); - observer.complete(); - return result; - }) - .catch(function (err) { - if (err.name === 'AbortError') - return; - if (err.result && err.result.errors && err.result.data) { - observer.next(err.result); - } - observer.error(err); - }); - return function () { - if (controller) - controller.abort(); - }; - }); - }); -}; -function rewriteURIForGET(chosenURI, body) { - var queryParams = []; - var addQueryParam = function (key, value) { - queryParams.push(key + "=" + encodeURIComponent(value)); - }; - if ('query' in body) { - addQueryParam('query', body.query); - } - if (body.operationName) { - addQueryParam('operationName', body.operationName); - } - if (body.variables) { - var serializedVariables = void 0; - try { - serializedVariables = apolloLinkHttpCommon.serializeFetchParameter(body.variables, 'Variables map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('variables', serializedVariables); - } - if (body.extensions) { - var serializedExtensions = void 0; - try { - serializedExtensions = apolloLinkHttpCommon.serializeFetchParameter(body.extensions, 'Extensions map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('extensions', serializedExtensions); - } - var fragment = '', preFragment = chosenURI; - var fragmentStart = chosenURI.indexOf('#'); - if (fragmentStart !== -1) { - fragment = chosenURI.substr(fragmentStart); - preFragment = chosenURI.substr(0, fragmentStart); - } - var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; - var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; - return { newURI: newURI }; -} -var HttpLink = (function (_super) { - tslib.__extends(HttpLink, _super); - function HttpLink(opts) { - return _super.call(this, createHttpLink(opts).request) || this; - } - return HttpLink; -}(apolloLink.ApolloLink)); - -exports.HttpLink = HttpLink; -exports.createHttpLink = createHttpLink; -//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link-http/lib/bundle.cjs.js.map b/node_modules/apollo-link-http/lib/bundle.cjs.js.map deleted file mode 100644 index 0a2c8fd..0000000 --- a/node_modules/apollo-link-http/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __rest, __assign, __extends } from 'tslib';\nimport { ApolloLink, fromError, Observable } from 'apollo-link';\nimport { checkFetcher, selectURI, selectHttpOptionsAndBody, fallbackHttpConfig, createSignalIfSupported, serializeFetchParameter, parseAndCheckHttpResponse } from 'apollo-link-http-common';\n\nvar createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"includeExtensions\", \"useGETForQueries\"]);\n checkFetcher(fetcher);\n if (!fetcher) {\n fetcher = fetch;\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign({}, clientAwarenessHeaders, context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n fetcher(chosenURI, options)\n .then(function (response) {\n operation.setContext({ response: response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\nfunction rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(opts) {\n return _super.call(this, createHttpLink(opts).request) || this;\n }\n return HttpLink;\n}(ApolloLink));\n\nexport { HttpLink, createHttpLink };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["__rest","checkFetcher","ApolloLink","selectURI","__assign","selectHttpOptionsAndBody","fallbackHttpConfig","createSignalIfSupported","fromError","serializeFetchParameter","Observable","parseAndCheckHttpResponse","__extends"],"mappings":";;;;;;;;AAIG,IAAC,cAAc,GAAG,UAAU,WAAW,EAAE;AAC5C,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;AACrD,IAAI,IAAI,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAAC,iBAAiB,EAAE,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,EAAE,cAAc,GAAGA,YAAM,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAC,CAAC;AACtS,IAAIC,iCAAY,CAAC,OAAO,CAAC,CAAC;AAC1B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,GAAG,KAAK,CAAC;AACxB,KAAK;AACL,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,IAAI,EAAE,EAAE,iBAAiB,EAAE,iBAAiB,EAAE;AACtD,QAA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,EAAE,WAAW,GAAG,SAAS,CAAC;AAC/C,IAAI,IAAI,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;AAC9B,QAAQ,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AACnD,QAAQ,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AACzD,KAAK;AACL,IAAI,IAAI,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AACxE,IAAI,IAAI,MAAM,GAAG,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;AACpF,IAAI,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC;AACE,IAAC,QAAQ,IAAI,UAAU,MAAM,EAAE;AAClC,IAAIG,eAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChC,IAAI,SAAS,QAAQ,CAAC,IAAI,EAAE;AAC5B,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;AACvE,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC;AACpB,CAAC,CAACV,qBAAU,CAAC;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/bundle.esm.js b/node_modules/apollo-link-http/lib/bundle.esm.js deleted file mode 100644 index 88fe95d..0000000 --- a/node_modules/apollo-link-http/lib/bundle.esm.js +++ /dev/null @@ -1,145 +0,0 @@ -import { __rest, __assign, __extends } from 'tslib'; -import { ApolloLink, fromError, Observable } from 'apollo-link'; -import { checkFetcher, selectURI, selectHttpOptionsAndBody, fallbackHttpConfig, createSignalIfSupported, serializeFetchParameter, parseAndCheckHttpResponse } from 'apollo-link-http-common'; - -var createHttpLink = function (linkOptions) { - if (linkOptions === void 0) { linkOptions = {}; } - var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = __rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); - checkFetcher(fetcher); - if (!fetcher) { - fetcher = fetch; - } - var linkConfig = { - http: { includeExtensions: includeExtensions }, - options: requestOptions.fetchOptions, - credentials: requestOptions.credentials, - headers: requestOptions.headers, - }; - return new ApolloLink(function (operation) { - var chosenURI = selectURI(operation, uri); - var context = operation.getContext(); - var clientAwarenessHeaders = {}; - if (context.clientAwareness) { - var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; - if (name_1) { - clientAwarenessHeaders['apollographql-client-name'] = name_1; - } - if (version) { - clientAwarenessHeaders['apollographql-client-version'] = version; - } - } - var contextHeaders = __assign({}, clientAwarenessHeaders, context.headers); - var contextConfig = { - http: context.http, - options: context.fetchOptions, - credentials: context.credentials, - headers: contextHeaders, - }; - var _b = selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; - var controller; - if (!options.signal) { - var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; - controller = _controller; - if (controller) - options.signal = signal; - } - var definitionIsMutation = function (d) { - return d.kind === 'OperationDefinition' && d.operation === 'mutation'; - }; - if (useGETForQueries && - !operation.query.definitions.some(definitionIsMutation)) { - options.method = 'GET'; - } - if (options.method === 'GET') { - var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; - if (parseError) { - return fromError(parseError); - } - chosenURI = newURI; - } - else { - try { - options.body = serializeFetchParameter(body, 'Payload'); - } - catch (parseError) { - return fromError(parseError); - } - } - return new Observable(function (observer) { - fetcher(chosenURI, options) - .then(function (response) { - operation.setContext({ response: response }); - return response; - }) - .then(parseAndCheckHttpResponse(operation)) - .then(function (result) { - observer.next(result); - observer.complete(); - return result; - }) - .catch(function (err) { - if (err.name === 'AbortError') - return; - if (err.result && err.result.errors && err.result.data) { - observer.next(err.result); - } - observer.error(err); - }); - return function () { - if (controller) - controller.abort(); - }; - }); - }); -}; -function rewriteURIForGET(chosenURI, body) { - var queryParams = []; - var addQueryParam = function (key, value) { - queryParams.push(key + "=" + encodeURIComponent(value)); - }; - if ('query' in body) { - addQueryParam('query', body.query); - } - if (body.operationName) { - addQueryParam('operationName', body.operationName); - } - if (body.variables) { - var serializedVariables = void 0; - try { - serializedVariables = serializeFetchParameter(body.variables, 'Variables map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('variables', serializedVariables); - } - if (body.extensions) { - var serializedExtensions = void 0; - try { - serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('extensions', serializedExtensions); - } - var fragment = '', preFragment = chosenURI; - var fragmentStart = chosenURI.indexOf('#'); - if (fragmentStart !== -1) { - fragment = chosenURI.substr(fragmentStart); - preFragment = chosenURI.substr(0, fragmentStart); - } - var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; - var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; - return { newURI: newURI }; -} -var HttpLink = (function (_super) { - __extends(HttpLink, _super); - function HttpLink(opts) { - return _super.call(this, createHttpLink(opts).request) || this; - } - return HttpLink; -}(ApolloLink)); - -export { HttpLink, createHttpLink }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link-http/lib/bundle.esm.js.map b/node_modules/apollo-link-http/lib/bundle.esm.js.map deleted file mode 100644 index 1141d32..0000000 --- a/node_modules/apollo-link-http/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/httpLink.ts"],"sourcesContent":["/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch if nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n // `apollographql-client-*` headers are automatically set if a\n // `clientAwareness` object is found in the context. These headers are\n // set first, followed by the rest of the headers pulled from\n // `context.headers`. If desired, `apollographql-client-*` headers set by\n // the `clientAwareness` object can be overridden by\n // `apollographql-client-*` headers set in `context.headers`.\n const clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n const { name, version } = context.clientAwareness;\n if (name) {\n clientAwarenessHeaders['apollographql-client-name'] = name;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n\n const contextHeaders = { ...clientAwarenessHeaders, ...context.headers };\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so it's already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we don't call next, the UI can only show networkError because AC didn't\n // get any graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;IAkCa,cAAc,GAAG,UAAC,WAAkC;IAAlC,4BAAA,EAAA,gBAAkC;IAE7D,IAAA,oBAAgB,EAAhB,qCAAgB,EAEhB,2BAAc,EACd,iDAAiB,EACjB,+CAAgB,EAChB,+FAAiB,CACH;IAGhB,YAAY,CAAC,OAAO,CAAC,CAAC;IAKtB,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,GAAG,KAAK,CAAC;KACjB;IAED,IAAM,UAAU,GAAG;QACjB,IAAI,EAAE,EAAE,iBAAiB,mBAAA,EAAE;QAC3B,OAAO,EAAE,cAAc,CAAC,YAAY;QACpC,WAAW,EAAE,cAAc,CAAC,WAAW;QACvC,OAAO,EAAE,cAAc,CAAC,OAAO;KAChC,CAAC;IAEF,OAAO,IAAI,UAAU,CAAC,UAAA,SAAS;QAC7B,IAAI,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAE1C,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;QAQvC,IAAM,sBAAsB,GAAG,EAAE,CAAC;QAClC,IAAI,OAAO,CAAC,eAAe,EAAE;YACrB,IAAA,4BAA2C,EAAzC,gBAAI,EAAE,oBAAO,CAA6B;YAClD,IAAI,MAAI,EAAE;gBACR,sBAAsB,CAAC,2BAA2B,CAAC,GAAG,MAAI,CAAC;aAC5D;YACD,IAAI,OAAO,EAAE;gBACX,sBAAsB,CAAC,8BAA8B,CAAC,GAAG,OAAO,CAAC;aAClE;SACF;QAED,IAAM,cAAc,gBAAQ,sBAAsB,EAAK,OAAO,CAAC,OAAO,CAAE,CAAC;QAEzE,IAAM,aAAa,GAAG;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,OAAO,CAAC,YAAY;YAC7B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC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,OAAO,UAAU,EAAE;YACnB,OAAO,EAAE,UAAU,YAAA,EAAE,CAAC;SACvB;QACD,aAAa,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;KACjD;IACD,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,IAAI,oBAAoB,SAAA,CAAC;QACzB,IAAI;YACF,oBAAoB,GAAG,uBAAuB,CAC5C,IAAI,CAAC,UAAU,EACf,gBAAgB,CACjB,CAAC;SACH;QAAC,OAAO,UAAU,EAAE;YACnB,OAAO,EAAE,UAAU,YAAA,EAAE,CAAC;SACvB;QACD,aAAa,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;KACnD;IAQD,IAAI,QAAQ,GAAG,EAAE,EACf,WAAW,GAAG,SAAS,CAAC;IAC1B,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;QACxB,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC3C,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;KAClD;IACD,IAAM,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;IACtE,IAAM,MAAM,GACV,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IACrE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;AACpB,CAAC;;IAE6BA,4BAAU;IAEtC,kBAAY,IAAuB;eACjC,kBAAM,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;KACpC;IACH,eAAC;AAAD,CALA,CAA8B,UAAU;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/bundle.umd.js b/node_modules/apollo-link-http/lib/bundle.umd.js deleted file mode 100644 index 5e03c5c..0000000 --- a/node_modules/apollo-link-http/lib/bundle.umd.js +++ /dev/null @@ -1,152 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('apollo-link'), require('apollo-link-http-common')) : - typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'apollo-link', 'apollo-link-http-common'], factory) : - (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.http = {}), global.tslib, global.apolloLink.core, global.apolloLink.httpCommon)); -}(this, (function (exports, tslib_1, apolloLink, apolloLinkHttpCommon) { 'use strict'; - - var createHttpLink = function (linkOptions) { - if (linkOptions === void 0) { linkOptions = {}; } - var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = tslib_1.__rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); - apolloLinkHttpCommon.checkFetcher(fetcher); - if (!fetcher) { - fetcher = fetch; - } - var linkConfig = { - http: { includeExtensions: includeExtensions }, - options: requestOptions.fetchOptions, - credentials: requestOptions.credentials, - headers: requestOptions.headers, - }; - return new apolloLink.ApolloLink(function (operation) { - var chosenURI = apolloLinkHttpCommon.selectURI(operation, uri); - var context = operation.getContext(); - var clientAwarenessHeaders = {}; - if (context.clientAwareness) { - var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; - if (name_1) { - clientAwarenessHeaders['apollographql-client-name'] = name_1; - } - if (version) { - clientAwarenessHeaders['apollographql-client-version'] = version; - } - } - var contextHeaders = tslib_1.__assign({}, clientAwarenessHeaders, context.headers); - var contextConfig = { - http: context.http, - options: context.fetchOptions, - credentials: context.credentials, - headers: contextHeaders, - }; - var _b = apolloLinkHttpCommon.selectHttpOptionsAndBody(operation, apolloLinkHttpCommon.fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; - var controller; - if (!options.signal) { - var _c = apolloLinkHttpCommon.createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; - controller = _controller; - if (controller) - options.signal = signal; - } - var definitionIsMutation = function (d) { - return d.kind === 'OperationDefinition' && d.operation === 'mutation'; - }; - if (useGETForQueries && - !operation.query.definitions.some(definitionIsMutation)) { - options.method = 'GET'; - } - if (options.method === 'GET') { - var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; - if (parseError) { - return apolloLink.fromError(parseError); - } - chosenURI = newURI; - } - else { - try { - options.body = apolloLinkHttpCommon.serializeFetchParameter(body, 'Payload'); - } - catch (parseError) { - return apolloLink.fromError(parseError); - } - } - return new apolloLink.Observable(function (observer) { - fetcher(chosenURI, options) - .then(function (response) { - operation.setContext({ response: response }); - return response; - }) - .then(apolloLinkHttpCommon.parseAndCheckHttpResponse(operation)) - .then(function (result) { - observer.next(result); - observer.complete(); - return result; - }) - .catch(function (err) { - if (err.name === 'AbortError') - return; - if (err.result && err.result.errors && err.result.data) { - observer.next(err.result); - } - observer.error(err); - }); - return function () { - if (controller) - controller.abort(); - }; - }); - }); - }; - function rewriteURIForGET(chosenURI, body) { - var queryParams = []; - var addQueryParam = function (key, value) { - queryParams.push(key + "=" + encodeURIComponent(value)); - }; - if ('query' in body) { - addQueryParam('query', body.query); - } - if (body.operationName) { - addQueryParam('operationName', body.operationName); - } - if (body.variables) { - var serializedVariables = void 0; - try { - serializedVariables = apolloLinkHttpCommon.serializeFetchParameter(body.variables, 'Variables map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('variables', serializedVariables); - } - if (body.extensions) { - var serializedExtensions = void 0; - try { - serializedExtensions = apolloLinkHttpCommon.serializeFetchParameter(body.extensions, 'Extensions map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('extensions', serializedExtensions); - } - var fragment = '', preFragment = chosenURI; - var fragmentStart = chosenURI.indexOf('#'); - if (fragmentStart !== -1) { - fragment = chosenURI.substr(fragmentStart); - preFragment = chosenURI.substr(0, fragmentStart); - } - var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; - var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; - return { newURI: newURI }; - } - var HttpLink = (function (_super) { - tslib_1.__extends(HttpLink, _super); - function HttpLink(opts) { - return _super.call(this, createHttpLink(opts).request) || this; - } - return HttpLink; - }(apolloLink.ApolloLink)); - - exports.HttpLink = HttpLink; - exports.createHttpLink = createHttpLink; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link-http/lib/bundle.umd.js.map b/node_modules/apollo-link-http/lib/bundle.umd.js.map deleted file mode 100644 index 3414fad..0000000 --- a/node_modules/apollo-link-http/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.umd.js","sources":["../src/httpLink.ts"],"sourcesContent":["/* tslint:disable */\n\nimport { ApolloLink, Observable, RequestHandler, fromError } from 'apollo-link';\nimport {\n serializeFetchParameter,\n selectURI,\n parseAndCheckHttpResponse,\n checkFetcher,\n selectHttpOptionsAndBody,\n createSignalIfSupported,\n fallbackHttpConfig,\n Body,\n HttpOptions,\n UriFunction as _UriFunction,\n} from 'apollo-link-http-common';\nimport { DefinitionNode } from 'graphql';\n\nexport namespace HttpLink {\n //TODO Would much rather be able to export directly\n export interface UriFunction extends _UriFunction {}\n export interface Options extends HttpOptions {\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n }\n}\n\n// For backwards compatibility.\nexport import FetchOptions = HttpLink.Options;\nexport import UriFunction = HttpLink.UriFunction;\n\nexport const createHttpLink = (linkOptions: HttpLink.Options = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch if nothing passed in\n fetch: fetcher,\n includeExtensions,\n useGETForQueries,\n ...requestOptions\n } = linkOptions;\n\n // dev warnings to ensure fetch is present\n checkFetcher(fetcher);\n\n //fetcher is set here rather than the destructuring to ensure fetch is\n //declared before referencing it. Reference in the destructuring would cause\n //a ReferenceError\n if (!fetcher) {\n fetcher = fetch;\n }\n\n const linkConfig = {\n http: { includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n // `apollographql-client-*` headers are automatically set if a\n // `clientAwareness` object is found in the context. These headers are\n // set first, followed by the rest of the headers pulled from\n // `context.headers`. If desired, `apollographql-client-*` headers set by\n // the `clientAwareness` object can be overridden by\n // `apollographql-client-*` headers set in `context.headers`.\n const clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n const { name, version } = context.clientAwareness;\n if (name) {\n clientAwarenessHeaders['apollographql-client-name'] = name;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n\n const contextHeaders = { ...clientAwarenessHeaders, ...context.headers };\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBody(\n operation,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n let controller;\n if (!(options as any).signal) {\n const { controller: _controller, signal } = createSignalIfSupported();\n controller = _controller;\n if (controller) (options as any).signal = signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n fetcher(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(result => {\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(err => {\n // fetch was cancelled so it's already been cleaned up in the unsubscribe\n if (err.name === 'AbortError') return;\n // if it is a network error, BUT there is graphql result info\n // fire the next observer before calling error\n // this gives apollo-client (and react-apollo) the `graphqlErrors` and `networErrors`\n // to pass to UI\n // this should only happen if we *also* have data as part of the response key per\n // the spec\n if (err.result && err.result.errors && err.result.data) {\n // if we don't call next, the UI can only show networkError because AC didn't\n // get any graphqlErrors\n // this is graphql execution result info (i.e errors and possibly data)\n // this is because there is no formal spec how errors should translate to\n // http status codes. So an auth error (401) could have both data\n // from a public field, errors from a private field, and a status of 401\n // {\n // user { // this will have errors\n // firstName\n // }\n // products { // this is public so will have data\n // cost\n // }\n // }\n //\n // the result of above *could* look like this:\n // {\n // data: { products: [{ cost: \"$10\" }] },\n // errors: [{\n // message: 'your session has timed out',\n // path: []\n // }]\n // }\n // status code of above would be a 401\n // in the UI you want to show data where you can, errors as data where you can\n // and use correct http status codes\n observer.next(err.result);\n }\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n\n// For GET operations, returns the given URI rewritten with parameters, or a\n// parse error.\nfunction rewriteURIForGET(chosenURI: string, body: Body) {\n // Implement the standard HTTP GET serialization, plus 'extensions'. Note\n // the extra level of JSON serialization!\n const queryParams = [];\n const addQueryParam = (key: string, value: string) => {\n queryParams.push(`${key}=${encodeURIComponent(value)}`);\n };\n\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n let serializedVariables;\n try {\n serializedVariables = serializeFetchParameter(\n body.variables,\n 'Variables map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n let serializedExtensions;\n try {\n serializedExtensions = serializeFetchParameter(\n body.extensions,\n 'Extensions map',\n );\n } catch (parseError) {\n return { parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n\n // Reconstruct the URI with added query params.\n // XXX This assumes that the URI is well-formed and that it doesn't\n // already contain any of these query params. We could instead use the\n // URL API and take a polyfill (whatwg-url@6) for older browsers that\n // don't support URLSearchParams. Note that some browsers (and\n // versions of whatwg-url) support URL but not URLSearchParams!\n let fragment = '',\n preFragment = chosenURI;\n const fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n const queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n const newURI =\n preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI };\n}\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(opts?: HttpLink.Options) {\n super(createHttpLink(opts).request);\n }\n}\n"],"names":["checkFetcher","ApolloLink","selectURI","fromError","serializeFetchParameter","Observable","parseAndCheckHttpResponse","tslib_1.__extends"],"mappings":";;;;;;MAkCa,cAAc,GAAG,UAAC,WAAkC;MAAlC,4BAAA,EAAA,gBAAkC;MAE7D,IAAA,oBAAgB,EAAhB,qCAAgB,EAEhB,2BAAc,EACd,iDAAiB,EACjB,+CAAgB,EAChB,uGAAiB,CACH;MAGhBA,iCAAY,CAAC,OAAO,CAAC,CAAC;MAKtB,IAAI,CAAC,OAAO,EAAE;UACZ,OAAO,GAAG,KAAK,CAAC;OACjB;MAED,IAAM,UAAU,GAAG;UACjB,IAAI,EAAE,EAAE,iBAAiB,mBAAA,EAAE;UAC3B,OAAO,EAAE,cAAc,CAAC,YAAY;UACpC,WAAW,EAAE,cAAc,CAAC,WAAW;UACvC,OAAO,EAAE,cAAc,CAAC,OAAO;OAChC,CAAC;MAEF,OAAO,IAAIC,qBAAU,CAAC,UAAA,SAA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;UACxB,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;UAC3C,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;OAClD;MACD,IAAM,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;MACtE,IAAM,MAAM,GACV,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;MACrE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;EACpB,CAAC;;MAE6BG,oCAAU;MAEtC,kBAAY,IAAuB;iBACjC,kBAAM,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;OACpC;MACH,eAAC;EAAD,CALA,CAA8BN,qBAAU;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/httpLink.d.ts b/node_modules/apollo-link-http/lib/httpLink.d.ts deleted file mode 100644 index 042ab64..0000000 --- a/node_modules/apollo-link-http/lib/httpLink.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ApolloLink, RequestHandler } from 'apollo-link'; -import { HttpOptions, UriFunction as _UriFunction } from 'apollo-link-http-common'; -export declare namespace HttpLink { - interface UriFunction extends _UriFunction { - } - interface Options extends HttpOptions { - useGETForQueries?: boolean; - } -} -export import FetchOptions = HttpLink.Options; -export import UriFunction = HttpLink.UriFunction; -export declare const createHttpLink: (linkOptions?: FetchOptions) => ApolloLink; -export declare class HttpLink extends ApolloLink { - requester: RequestHandler; - constructor(opts?: HttpLink.Options); -} -//# sourceMappingURL=httpLink.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/httpLink.d.ts.map b/node_modules/apollo-link-http/lib/httpLink.d.ts.map deleted file mode 100644 index dd44773..0000000 --- a/node_modules/apollo-link-http/lib/httpLink.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"httpLink.d.ts","sourceRoot":"","sources":["src/httpLink.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAc,cAAc,EAAa,MAAM,aAAa,CAAC;AAChF,OAAO,EASL,WAAW,EACX,WAAW,IAAI,YAAY,EAC5B,MAAM,yBAAyB,CAAC;AAGjC,yBAAiB,QAAQ,CAAC;IAExB,UAAiB,WAAY,SAAQ,YAAY;KAAG;IACpD,UAAiB,OAAQ,SAAQ,WAAW;QAM1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B;CACF;AAGD,MAAM,QAAQ,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC;AAC9C,MAAM,QAAQ,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;AAEjD,eAAO,MAAM,cAAc,4CA+J1B,CAAC;AA8DF,qBAAa,QAAS,SAAQ,UAAU;IAC/B,SAAS,EAAE,cAAc,CAAC;gBACrB,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO;CAGpC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/httpLink.js b/node_modules/apollo-link-http/lib/httpLink.js deleted file mode 100644 index af0708b..0000000 --- a/node_modules/apollo-link-http/lib/httpLink.js +++ /dev/null @@ -1,145 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var apollo_link_1 = require("apollo-link"); -var apollo_link_http_common_1 = require("apollo-link-http-common"); -exports.createHttpLink = function (linkOptions) { - if (linkOptions === void 0) { linkOptions = {}; } - var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = tslib_1.__rest(linkOptions, ["uri", "fetch", "includeExtensions", "useGETForQueries"]); - apollo_link_http_common_1.checkFetcher(fetcher); - if (!fetcher) { - fetcher = fetch; - } - var linkConfig = { - http: { includeExtensions: includeExtensions }, - options: requestOptions.fetchOptions, - credentials: requestOptions.credentials, - headers: requestOptions.headers, - }; - return new apollo_link_1.ApolloLink(function (operation) { - var chosenURI = apollo_link_http_common_1.selectURI(operation, uri); - var context = operation.getContext(); - var clientAwarenessHeaders = {}; - if (context.clientAwareness) { - var _a = context.clientAwareness, name_1 = _a.name, version = _a.version; - if (name_1) { - clientAwarenessHeaders['apollographql-client-name'] = name_1; - } - if (version) { - clientAwarenessHeaders['apollographql-client-version'] = version; - } - } - var contextHeaders = tslib_1.__assign({}, clientAwarenessHeaders, context.headers); - var contextConfig = { - http: context.http, - options: context.fetchOptions, - credentials: context.credentials, - headers: contextHeaders, - }; - var _b = apollo_link_http_common_1.selectHttpOptionsAndBody(operation, apollo_link_http_common_1.fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body; - var controller; - if (!options.signal) { - var _c = apollo_link_http_common_1.createSignalIfSupported(), _controller = _c.controller, signal = _c.signal; - controller = _controller; - if (controller) - options.signal = signal; - } - var definitionIsMutation = function (d) { - return d.kind === 'OperationDefinition' && d.operation === 'mutation'; - }; - if (useGETForQueries && - !operation.query.definitions.some(definitionIsMutation)) { - options.method = 'GET'; - } - if (options.method === 'GET') { - var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError; - if (parseError) { - return apollo_link_1.fromError(parseError); - } - chosenURI = newURI; - } - else { - try { - options.body = apollo_link_http_common_1.serializeFetchParameter(body, 'Payload'); - } - catch (parseError) { - return apollo_link_1.fromError(parseError); - } - } - return new apollo_link_1.Observable(function (observer) { - fetcher(chosenURI, options) - .then(function (response) { - operation.setContext({ response: response }); - return response; - }) - .then(apollo_link_http_common_1.parseAndCheckHttpResponse(operation)) - .then(function (result) { - observer.next(result); - observer.complete(); - return result; - }) - .catch(function (err) { - if (err.name === 'AbortError') - return; - if (err.result && err.result.errors && err.result.data) { - observer.next(err.result); - } - observer.error(err); - }); - return function () { - if (controller) - controller.abort(); - }; - }); - }); -}; -function rewriteURIForGET(chosenURI, body) { - var queryParams = []; - var addQueryParam = function (key, value) { - queryParams.push(key + "=" + encodeURIComponent(value)); - }; - if ('query' in body) { - addQueryParam('query', body.query); - } - if (body.operationName) { - addQueryParam('operationName', body.operationName); - } - if (body.variables) { - var serializedVariables = void 0; - try { - serializedVariables = apollo_link_http_common_1.serializeFetchParameter(body.variables, 'Variables map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('variables', serializedVariables); - } - if (body.extensions) { - var serializedExtensions = void 0; - try { - serializedExtensions = apollo_link_http_common_1.serializeFetchParameter(body.extensions, 'Extensions map'); - } - catch (parseError) { - return { parseError: parseError }; - } - addQueryParam('extensions', serializedExtensions); - } - var fragment = '', preFragment = chosenURI; - var fragmentStart = chosenURI.indexOf('#'); - if (fragmentStart !== -1) { - fragment = chosenURI.substr(fragmentStart); - preFragment = chosenURI.substr(0, fragmentStart); - } - var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&'; - var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment; - return { newURI: newURI }; -} -var HttpLink = (function (_super) { - tslib_1.__extends(HttpLink, _super); - function HttpLink(opts) { - return _super.call(this, exports.createHttpLink(opts).request) || this; - } - return HttpLink; -}(apollo_link_1.ApolloLink)); -exports.HttpLink = HttpLink; -//# sourceMappingURL=httpLink.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/httpLink.js.map b/node_modules/apollo-link-http/lib/httpLink.js.map deleted file mode 100644 index c598864..0000000 --- a/node_modules/apollo-link-http/lib/httpLink.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"httpLink.js","sourceRoot":"","sources":["../src/httpLink.ts"],"names":[],"mappings":";;;AAEA,2CAAgF;AAChF,mEAWiC;AAoBpB,QAAA,cAAc,GAAG,UAAC,WAAkC;IAAlC,4BAAA,EAAA,gBAAkC;IAE7D,IAAA,oBAAgB,EAAhB,qCAAgB,EAEhB,2BAAc,EACd,iDAAiB,EACjB,+CAAgB,EAChB,uGAA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;QACzB,IAAI;YACF,oBAAoB,GAAG,iDAAuB,CAC5C,IAAI,CAAC,UAAU,EACf,gBAAgB,CACjB,CAAC;SACH;QAAC,OAAO,UAAU,EAAE;YACnB,OAAO,EAAE,UAAU,YAAA,EAAE,CAAC;SACvB;QACD,aAAa,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;KACnD;IAQD,IAAI,QAAQ,GAAG,EAAE,EACf,WAAW,GAAG,SAAS,CAAC;IAC1B,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;QACxB,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC3C,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;KAClD;IACD,IAAM,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACtE,IAAM,MAAM,GACV,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IACrE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;AACpB,CAAC;AAED;IAA8B,oCAAU;IAEtC,kBAAY,IAAuB;eACjC,kBAAM,sBAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IACrC,CAAC;IACH,eAAC;AAAD,CAAC,AALD,CAA8B,wBAAU,GAKvC;AALY,4BAAQ"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.d.ts b/node_modules/apollo-link-http/lib/index.d.ts deleted file mode 100644 index a59e5e7..0000000 --- a/node_modules/apollo-link-http/lib/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './httpLink'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.d.ts.map b/node_modules/apollo-link-http/lib/index.d.ts.map deleted file mode 100644 index 99cf802..0000000 --- a/node_modules/apollo-link-http/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.js b/node_modules/apollo-link-http/lib/index.js deleted file mode 100644 index 9aab4cf..0000000 --- a/node_modules/apollo-link-http/lib/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./httpLink"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link-http/lib/index.js.map b/node_modules/apollo-link-http/lib/index.js.map deleted file mode 100644 index 518010f..0000000 --- a/node_modules/apollo-link-http/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"} \ No newline at end of file diff --git a/node_modules/apollo-link-http/package.json b/node_modules/apollo-link-http/package.json deleted file mode 100644 index 578d133..0000000 --- a/node_modules/apollo-link-http/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "apollo-link-http", - "version": "1.5.17", - "description": "HTTP transport layer for GraphQL", - "author": "Evans Hauser ", - "contributors": [ - "James Baxley ", - "Jonas Helfer ", - "jon wong ", - "Sashko Stubailo ", - "Stephen Kao " - ], - "license": "MIT", - "main": "./lib/index.js", - "module": "./lib/bundle.esm.js", - "typings": "./lib/index.d.ts", - "sideEffects": false, - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/apollo-link.git" - }, - "bugs": { - "url": "https://github.com/apollographql/apollo-link/issues" - }, - "homepage": "https://github.com/apollographql/apollo-link#readme", - "scripts": { - "build": "tsc && rollup -c", - "clean": "rimraf lib/* && rimraf coverage/*", - "coverage": "jest --coverage", - "filesize": "../../scripts/minify", - "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", - "prebuild": "npm run clean", - "prepare": "npm run build", - "test": "npm run lint && jest", - "watch": "tsc -w -p . & rollup -c -w" - }, - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "apollo-fetch": "0.7.0", - "fetch-mock": "6.5.2", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "object-to-querystring": "1.0.8", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "typescript": "3.0.3" - }, - "jest": { - "transform": { - ".(ts|tsx)": "ts-jest" - }, - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ], - "testPathIgnorePatterns": [ - "/node_modules/", - "sharedHttpTests.ts" - ], - "testURL": "http://localhost" - }, - "gitHead": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/node_modules/apollo-link/CHANGELOG.md b/node_modules/apollo-link/CHANGELOG.md deleted file mode 100644 index a97f058..0000000 --- a/node_modules/apollo-link/CHANGELOG.md +++ /dev/null @@ -1,57 +0,0 @@ -# Change log - ----- - -**NOTE:** This changelog is no longer maintained. Changes are now tracked in -the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-link/blob/master/CHANGELOG.md). - ----- - -### 1.2.4 - -- No changes - -### 1.2.3 -- Added `graphql` 14 to peer and dev deps; Updated `@types/graphql` to 14
- [@hwillson](http://github.com/hwillson) in [#789](https://github.com/apollographql/apollo-link/pull/789) - -### 1.2.2 -- Update apollo-link [#559](https://github.com/apollographql/apollo-link/pull/559) -- export graphql types and add @types/graphql as a regular dependency [PR#576](https://github.com/apollographql/apollo-link/pull/576) -- moved @types/node to dev dependencies in package.josn to avoid collisions with other projects. [PR#540](https://github.com/apollographql/apollo-link/pull/540) - -### 1.2.1 -- update apollo link with zen-observable-ts to remove import issues [PR#515](https://github.com/apollographql/apollo-link/pull/515) - -### 1.2.0 -- Add `fromError` Observable helper -- change import method of zen-observable for rollup compat - -### 1.1.0 -- Expose `#execute` on ApolloLink as static - -### 1.0.7 -- Update to graphql@0.12 - -### 1.0.6 -- update rollup - -### 1.0.5 -- fix bug where context wasn't merged when setting it - -### 1.0.4 -- export link util helpers - -### 1.0.3 -- removed requiring query on initial execution check -- moved to move efficent rollup build - -### 1.0.1, 1.0.2 - -- preleases for dev tool integation - -### 0.8.0 -- added support for `extensions` on an operation - -### 0.7.0 -- new operation API and start of changelog diff --git a/node_modules/apollo-link/LICENSE b/node_modules/apollo-link/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/node_modules/apollo-link/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 - 2017 Meteor Development Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/apollo-link/README.md b/node_modules/apollo-link/README.md deleted file mode 100644 index 8180388..0000000 --- a/node_modules/apollo-link/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# apollo-link - -## Purpose - -`apollo-link` is a standard interface for modifying control flow of GraphQL requests and fetching GraphQL results, designed to provide a simple GraphQL client that is capable of extensions. -The targeted use cases of `apollo-link` are highlighted below: - -* fetch queries directly without normalized cache -* network interface for Apollo Client -* network interface for Relay Modern -* fetcher for - -Apollo Link is the interface for creating new links in your application. - -The client sends a request as a method call to a link and can recieve one or more (in the case of subscriptions) responses from the server. The responses are returned using the Observer pattern. - -![Apollo Link Chain](https://cdn-images-1.medium.com/max/1600/1*62VLGUaU-9ULCoBCGvgdkQ.png) - -Results from the server can be provided by calling `next(result)` on the observer. In the case of a network/transport error (not a GraphQL Error) the `error(err)` method can be used to indicate a response will not be recieved. If multiple responses are not supported by the link, `complete()` should be called to inform the client no further data will be provided. - -In the case of an intermediate link, a second argument to `request(operation, forward)` is the link to `forward(operation)` to. `forward` returns an observable and it can be returned directly or subscribed to. - -```js -forward(operation).subscribe({ - next: result => { - handleTheResult(result) - }, - error: error => { - handleTheNetworkError(error) - }, -}); -``` - -## Implementing a basic custom transport - -```js -import { ApolloLink, Observable } from 'apollo-link'; - -export class CustomApolloLink extends ApolloLink { - request(operation /*, forward*/) { - //Whether no one is listening anymore - let unsubscribed = false; - - return new Observable(observer => { - somehowGetOperationToServer(operation, (error, result) => { - if (unsubscribed) return; - if (error) { - //Network error - observer.error(error); - } else { - observer.next(result); - observer.complete(); //If subscriptions not supported - } - }); - - function unsubscribe() { - unsubscribed = true; - } - - return unsubscribe; - }); - } -} -``` - -## Installation - -`npm install apollo-link --save` - diff --git a/node_modules/apollo-link/lib/bundle.cjs.js b/node_modules/apollo-link/lib/bundle.cjs.js deleted file mode 100644 index 67ed928..0000000 --- a/node_modules/apollo-link/lib/bundle.cjs.js +++ /dev/null @@ -1,212 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Observable = _interopDefault(require('zen-observable-ts')); -var tsInvariant = require('ts-invariant'); -var tslib = require('tslib'); -var apolloUtilities = require('apollo-utilities'); - -function validateOperation(operation) { - var OPERATION_FIELDS = [ - 'query', - 'operationName', - 'variables', - 'extensions', - 'context', - ]; - for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { - var key = _a[_i]; - if (OPERATION_FIELDS.indexOf(key) < 0) { - throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("illegal argument: " + key); - } - } - return operation; -} -var LinkError = (function (_super) { - tslib.__extends(LinkError, _super); - function LinkError(message, link) { - var _this = _super.call(this, message) || this; - _this.link = link; - return _this; - } - return LinkError; -}(Error)); -function isTerminating(link) { - return link.request.length <= 1; -} -function toPromise(observable) { - var completed = false; - return new Promise(function (resolve, reject) { - observable.subscribe({ - next: function (data) { - if (completed) { - process.env.NODE_ENV === "production" || tsInvariant.invariant.warn("Promise Wrapper does not support multiple results from Observable"); - } - else { - completed = true; - resolve(data); - } - }, - error: reject, - }); - }); -} -var makePromise = toPromise; -function fromPromise(promise) { - return new Observable(function (observer) { - promise - .then(function (value) { - observer.next(value); - observer.complete(); - }) - .catch(observer.error.bind(observer)); - }); -} -function fromError(errorValue) { - return new Observable(function (observer) { - observer.error(errorValue); - }); -} -function transformOperation(operation) { - var transformedOperation = { - variables: operation.variables || {}, - extensions: operation.extensions || {}, - operationName: operation.operationName, - query: operation.query, - }; - if (!transformedOperation.operationName) { - transformedOperation.operationName = - typeof transformedOperation.query !== 'string' - ? apolloUtilities.getOperationName(transformedOperation.query) - : ''; - } - return transformedOperation; -} -function createOperation(starting, operation) { - var context = tslib.__assign({}, starting); - var setContext = function (next) { - if (typeof next === 'function') { - context = tslib.__assign({}, context, next(context)); - } - else { - context = tslib.__assign({}, context, next); - } - }; - var getContext = function () { return (tslib.__assign({}, context)); }; - Object.defineProperty(operation, 'setContext', { - enumerable: false, - value: setContext, - }); - Object.defineProperty(operation, 'getContext', { - enumerable: false, - value: getContext, - }); - Object.defineProperty(operation, 'toKey', { - enumerable: false, - value: function () { return getKey(operation); }, - }); - return operation; -} -function getKey(operation) { - var query = operation.query, variables = operation.variables, operationName = operation.operationName; - return JSON.stringify([operationName, query, variables]); -} - -function passthrough(op, forward) { - return forward ? forward(op) : Observable.of(); -} -function toLink(handler) { - return typeof handler === 'function' ? new ApolloLink(handler) : handler; -} -function empty() { - return new ApolloLink(function () { return Observable.of(); }); -} -function from(links) { - if (links.length === 0) - return empty(); - return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); -} -function split(test, left, right) { - var leftLink = toLink(left); - var rightLink = toLink(right || new ApolloLink(passthrough)); - if (isTerminating(leftLink) && isTerminating(rightLink)) { - return new ApolloLink(function (operation) { - return test(operation) - ? leftLink.request(operation) || Observable.of() - : rightLink.request(operation) || Observable.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return test(operation) - ? leftLink.request(operation, forward) || Observable.of() - : rightLink.request(operation, forward) || Observable.of(); - }); - } -} -var concat = function (first, second) { - var firstLink = toLink(first); - if (isTerminating(firstLink)) { - process.env.NODE_ENV === "production" || tsInvariant.invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); - return firstLink; - } - var nextLink = toLink(second); - if (isTerminating(nextLink)) { - return new ApolloLink(function (operation) { - return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return (firstLink.request(operation, function (op) { - return nextLink.request(op, forward) || Observable.of(); - }) || Observable.of()); - }); - } -}; -var ApolloLink = (function () { - function ApolloLink(request) { - if (request) - this.request = request; - } - ApolloLink.prototype.split = function (test, left, right) { - return this.concat(split(test, left, right || new ApolloLink(passthrough))); - }; - ApolloLink.prototype.concat = function (next) { - return concat(this, next); - }; - ApolloLink.prototype.request = function (operation, forward) { - throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError('request is not implemented'); - }; - ApolloLink.empty = empty; - ApolloLink.from = from; - ApolloLink.split = split; - ApolloLink.execute = execute; - return ApolloLink; -}()); -function execute(link, operation) { - return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of()); -} - -exports.Observable = Observable; -Object.defineProperty(exports, 'getOperationName', { - enumerable: true, - get: function () { - return apolloUtilities.getOperationName; - } -}); -exports.ApolloLink = ApolloLink; -exports.concat = concat; -exports.createOperation = createOperation; -exports.empty = empty; -exports.execute = execute; -exports.from = from; -exports.fromError = fromError; -exports.fromPromise = fromPromise; -exports.makePromise = makePromise; -exports.split = split; -exports.toPromise = toPromise; -//# sourceMappingURL=bundle.cjs.js.map diff --git a/node_modules/apollo-link/lib/bundle.cjs.js.map b/node_modules/apollo-link/lib/bundle.cjs.js.map deleted file mode 100644 index 45e1e8e..0000000 --- a/node_modules/apollo-link/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import Observable from 'zen-observable-ts';\nexport { default as Observable } from 'zen-observable-ts';\nimport { invariant, InvariantError } from 'ts-invariant';\nimport { __extends, __assign } from 'tslib';\nimport { getOperationName } from 'apollo-utilities';\nexport { getOperationName } from 'apollo-utilities';\n\nfunction validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(2) : new InvariantError(\"illegal argument: \" + key);\n }\n }\n return operation;\n}\nvar LinkError = (function (_super) {\n __extends(LinkError, _super);\n function LinkError(message, link) {\n var _this = _super.call(this, message) || this;\n _this.link = link;\n return _this;\n }\n return LinkError;\n}(Error));\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nfunction toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n process.env.NODE_ENV === \"production\" || invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\nvar makePromise = toPromise;\nfunction fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\nfunction fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\nfunction transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n return transformedOperation;\n}\nfunction createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign({}, context, next(context));\n }\n else {\n context = __assign({}, context, next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: function () { return getKey(operation); },\n });\n return operation;\n}\nfunction getKey(operation) {\n var query = operation.query, variables = operation.variables, operationName = operation.operationName;\n return JSON.stringify([operationName, query, variables]);\n}\n\nfunction passthrough(op, forward) {\n return forward ? forward(op) : Observable.of();\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction empty() {\n return new ApolloLink(function () { return Observable.of(); });\n}\nfunction from(links) {\n if (links.length === 0)\n return empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n}\nfunction split(test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}\nvar concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n process.env.NODE_ENV === \"production\" || invariant.warn(new LinkError(\"You are calling concat on a terminating link, which will have no effect\", firstLink));\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n};\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw process.env.NODE_ENV === \"production\" ? new InvariantError(1) : new InvariantError('request is not implemented');\n };\n ApolloLink.empty = empty;\n ApolloLink.from = from;\n ApolloLink.split = split;\n ApolloLink.execute = execute;\n return ApolloLink;\n}());\nfunction execute(link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n}\n\nexport { ApolloLink, concat, createOperation, empty, execute, from, fromError, fromPromise, makePromise, split, toPromise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bundle.esm.js deleted file mode 100644 index c73d770..0000000 --- a/node_modules/apollo-link/lib/bundle.esm.js +++ /dev/null @@ -1,191 +0,0 @@ -import Observable from 'zen-observable-ts'; -export { default as Observable } from 'zen-observable-ts'; -import { invariant, InvariantError } from 'ts-invariant'; -import { __extends, __assign } from 'tslib'; -import { getOperationName } from 'apollo-utilities'; -export { getOperationName } from 'apollo-utilities'; - -function validateOperation(operation) { - var OPERATION_FIELDS = [ - 'query', - 'operationName', - 'variables', - 'extensions', - 'context', - ]; - for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { - var key = _a[_i]; - if (OPERATION_FIELDS.indexOf(key) < 0) { - throw process.env.NODE_ENV === "production" ? new InvariantError(2) : new InvariantError("illegal argument: " + key); - } - } - return operation; -} -var LinkError = (function (_super) { - __extends(LinkError, _super); - function LinkError(message, link) { - var _this = _super.call(this, message) || this; - _this.link = link; - return _this; - } - return LinkError; -}(Error)); -function isTerminating(link) { - return link.request.length <= 1; -} -function toPromise(observable) { - var completed = false; - return new Promise(function (resolve, reject) { - observable.subscribe({ - next: function (data) { - if (completed) { - process.env.NODE_ENV === "production" || invariant.warn("Promise Wrapper does not support multiple results from Observable"); - } - else { - completed = true; - resolve(data); - } - }, - error: reject, - }); - }); -} -var makePromise = toPromise; -function fromPromise(promise) { - return new Observable(function (observer) { - promise - .then(function (value) { - observer.next(value); - observer.complete(); - }) - .catch(observer.error.bind(observer)); - }); -} -function fromError(errorValue) { - return new Observable(function (observer) { - observer.error(errorValue); - }); -} -function transformOperation(operation) { - var transformedOperation = { - variables: operation.variables || {}, - extensions: operation.extensions || {}, - operationName: operation.operationName, - query: operation.query, - }; - if (!transformedOperation.operationName) { - transformedOperation.operationName = - typeof transformedOperation.query !== 'string' - ? getOperationName(transformedOperation.query) - : ''; - } - return transformedOperation; -} -function createOperation(starting, operation) { - var context = __assign({}, starting); - var setContext = function (next) { - if (typeof next === 'function') { - context = __assign({}, context, next(context)); - } - else { - context = __assign({}, context, next); - } - }; - var getContext = function () { return (__assign({}, context)); }; - Object.defineProperty(operation, 'setContext', { - enumerable: false, - value: setContext, - }); - Object.defineProperty(operation, 'getContext', { - enumerable: false, - value: getContext, - }); - Object.defineProperty(operation, 'toKey', { - enumerable: false, - value: function () { return getKey(operation); }, - }); - return operation; -} -function getKey(operation) { - var query = operation.query, variables = operation.variables, operationName = operation.operationName; - return JSON.stringify([operationName, query, variables]); -} - -function passthrough(op, forward) { - return forward ? forward(op) : Observable.of(); -} -function toLink(handler) { - return typeof handler === 'function' ? new ApolloLink(handler) : handler; -} -function empty() { - return new ApolloLink(function () { return Observable.of(); }); -} -function from(links) { - if (links.length === 0) - return empty(); - return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); -} -function split(test, left, right) { - var leftLink = toLink(left); - var rightLink = toLink(right || new ApolloLink(passthrough)); - if (isTerminating(leftLink) && isTerminating(rightLink)) { - return new ApolloLink(function (operation) { - return test(operation) - ? leftLink.request(operation) || Observable.of() - : rightLink.request(operation) || Observable.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return test(operation) - ? leftLink.request(operation, forward) || Observable.of() - : rightLink.request(operation, forward) || Observable.of(); - }); - } -} -var concat = function (first, second) { - var firstLink = toLink(first); - if (isTerminating(firstLink)) { - process.env.NODE_ENV === "production" || invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); - return firstLink; - } - var nextLink = toLink(second); - if (isTerminating(nextLink)) { - return new ApolloLink(function (operation) { - return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return (firstLink.request(operation, function (op) { - return nextLink.request(op, forward) || Observable.of(); - }) || Observable.of()); - }); - } -}; -var ApolloLink = (function () { - function ApolloLink(request) { - if (request) - this.request = request; - } - ApolloLink.prototype.split = function (test, left, right) { - return this.concat(split(test, left, right || new ApolloLink(passthrough))); - }; - ApolloLink.prototype.concat = function (next) { - return concat(this, next); - }; - ApolloLink.prototype.request = function (operation, forward) { - throw process.env.NODE_ENV === "production" ? new InvariantError(1) : new InvariantError('request is not implemented'); - }; - ApolloLink.empty = empty; - ApolloLink.from = from; - ApolloLink.split = split; - ApolloLink.execute = execute; - return ApolloLink; -}()); -function execute(link, operation) { - return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of()); -} - -export { ApolloLink, concat, createOperation, empty, execute, from, fromError, fromPromise, makePromise, split, toPromise }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-link/lib/bundle.esm.js.map b/node_modules/apollo-link/lib/bundle.esm.js.map deleted file mode 100644 index 6612c81..0000000 --- a/node_modules/apollo-link/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/linkUtils.ts","../src/link.ts"],"sourcesContent":["import Observable from 'zen-observable-ts';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nimport { getOperationName } from 'apollo-utilities';\nimport { invariant, InvariantError } from 'ts-invariant';\nexport { getOperationName };\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n invariant.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX We're assuming here that query and variables will be serialized in\n // the same order, which might not always be true.\n const { query, variables, operationName } = operation;\n return JSON.stringify([operationName, query, variables]);\n}\n","import Observable from 'zen-observable-ts';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nfunction passthrough(op, forward) {\n return forward ? forward(op) : Observable.of();\n}\n\nfunction toLink(handler: RequestHandler | ApolloLink) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\n\nexport function empty(): ApolloLink {\n return new ApolloLink(() => Observable.of());\n}\n\nexport function from(links: ApolloLink[]): ApolloLink {\n if (links.length === 0) return empty();\n return links.map(toLink).reduce((x, y) => x.concat(y));\n}\n\nexport function split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n): ApolloLink {\n const leftLink = toLink(left);\n const rightLink = toLink(right || new ApolloLink(passthrough));\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n invariant.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n ): ApolloLink {\n return this.concat(split(test, left, right || new ApolloLink(passthrough)));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new InvariantError('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;SASgB,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM;SACP;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;IAA+BA,6BAAK;IAElC,mBAAY,OAAgB,EAAE,IAAiB;QAA/C,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;KAClB;IACH,gBAAC;AAAD,CANA,CAA+B,KAAK,GAMnC;SAEe,aAAa,CAAC,IAAgB;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;AAClC,CAAC;SAEe,SAAS,CAAI,UAAyB;IACpD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,OAAO,IAAI,OAAO,CAAI,UAAC,OAAO,EAAE,MAAM;QACpC,UAAU,CAAC,SAAS,CAAC;YACnB,IAAI,EAAE,UAAA,IAAI;gBACR,IAAI,SAAS,EAAE;oBACb;iBAGD;qBAAM;oBACL,SAAS,GAAG,IAAI,CAAC;oBACjB,OAAO,CAAC,IAAI,CAAC,CAAC;iBACf;aACF;YACD,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;KACJ,CAAC,CAAC;AACL,CAAC;IAGY,WAAW,GAAG,UAAU;SAErB,WAAW,CAAI,OAAmB;IAChD,O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,OAAO,EACjB,kBAAkB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CACjD,CACF,IAAI,UAAU,CAAC,EAAE,EAAE,EACpB;AACJ,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/bundle.umd.js b/node_modules/apollo-link/lib/bundle.umd.js deleted file mode 100644 index 5e978ca..0000000 --- a/node_modules/apollo-link/lib/bundle.umd.js +++ /dev/null @@ -1,213 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('zen-observable-ts'), require('ts-invariant'), require('tslib'), require('apollo-utilities')) : - typeof define === 'function' && define.amd ? define(['exports', 'zen-observable-ts', 'ts-invariant', 'tslib', 'apollo-utilities'], factory) : - (global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.core = {}), global.apolloLink.zenObservable, global.invariant, global.tslib, global.apolloUtilities)); -}(this, (function (exports, Observable, tsInvariant, tslib_1, apolloUtilities) { 'use strict'; - - Observable = Observable && Observable.hasOwnProperty('default') ? Observable['default'] : Observable; - - function validateOperation(operation) { - var OPERATION_FIELDS = [ - 'query', - 'operationName', - 'variables', - 'extensions', - 'context', - ]; - for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { - var key = _a[_i]; - if (OPERATION_FIELDS.indexOf(key) < 0) { - throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(2) : new tsInvariant.InvariantError("illegal argument: " + key); - } - } - return operation; - } - var LinkError = (function (_super) { - tslib_1.__extends(LinkError, _super); - function LinkError(message, link) { - var _this = _super.call(this, message) || this; - _this.link = link; - return _this; - } - return LinkError; - }(Error)); - function isTerminating(link) { - return link.request.length <= 1; - } - function toPromise(observable) { - var completed = false; - return new Promise(function (resolve, reject) { - observable.subscribe({ - next: function (data) { - if (completed) { - process.env.NODE_ENV === "production" || tsInvariant.invariant.warn("Promise Wrapper does not support multiple results from Observable"); - } - else { - completed = true; - resolve(data); - } - }, - error: reject, - }); - }); - } - var makePromise = toPromise; - function fromPromise(promise) { - return new Observable(function (observer) { - promise - .then(function (value) { - observer.next(value); - observer.complete(); - }) - .catch(observer.error.bind(observer)); - }); - } - function fromError(errorValue) { - return new Observable(function (observer) { - observer.error(errorValue); - }); - } - function transformOperation(operation) { - var transformedOperation = { - variables: operation.variables || {}, - extensions: operation.extensions || {}, - operationName: operation.operationName, - query: operation.query, - }; - if (!transformedOperation.operationName) { - transformedOperation.operationName = - typeof transformedOperation.query !== 'string' - ? apolloUtilities.getOperationName(transformedOperation.query) - : ''; - } - return transformedOperation; - } - function createOperation(starting, operation) { - var context = tslib_1.__assign({}, starting); - var setContext = function (next) { - if (typeof next === 'function') { - context = tslib_1.__assign({}, context, next(context)); - } - else { - context = tslib_1.__assign({}, context, next); - } - }; - var getContext = function () { return (tslib_1.__assign({}, context)); }; - Object.defineProperty(operation, 'setContext', { - enumerable: false, - value: setContext, - }); - Object.defineProperty(operation, 'getContext', { - enumerable: false, - value: getContext, - }); - Object.defineProperty(operation, 'toKey', { - enumerable: false, - value: function () { return getKey(operation); }, - }); - return operation; - } - function getKey(operation) { - var query = operation.query, variables = operation.variables, operationName = operation.operationName; - return JSON.stringify([operationName, query, variables]); - } - - function passthrough(op, forward) { - return forward ? forward(op) : Observable.of(); - } - function toLink(handler) { - return typeof handler === 'function' ? new ApolloLink(handler) : handler; - } - function empty() { - return new ApolloLink(function () { return Observable.of(); }); - } - function from(links) { - if (links.length === 0) - return empty(); - return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); - } - function split(test, left, right) { - var leftLink = toLink(left); - var rightLink = toLink(right || new ApolloLink(passthrough)); - if (isTerminating(leftLink) && isTerminating(rightLink)) { - return new ApolloLink(function (operation) { - return test(operation) - ? leftLink.request(operation) || Observable.of() - : rightLink.request(operation) || Observable.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return test(operation) - ? leftLink.request(operation, forward) || Observable.of() - : rightLink.request(operation, forward) || Observable.of(); - }); - } - } - var concat = function (first, second) { - var firstLink = toLink(first); - if (isTerminating(firstLink)) { - process.env.NODE_ENV === "production" || tsInvariant.invariant.warn(new LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); - return firstLink; - } - var nextLink = toLink(second); - if (isTerminating(nextLink)) { - return new ApolloLink(function (operation) { - return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return (firstLink.request(operation, function (op) { - return nextLink.request(op, forward) || Observable.of(); - }) || Observable.of()); - }); - } - }; - var ApolloLink = (function () { - function ApolloLink(request) { - if (request) - this.request = request; - } - ApolloLink.prototype.split = function (test, left, right) { - return this.concat(split(test, left, right || new ApolloLink(passthrough))); - }; - ApolloLink.prototype.concat = function (next) { - return concat(this, next); - }; - ApolloLink.prototype.request = function (operation, forward) { - throw process.env.NODE_ENV === "production" ? new tsInvariant.InvariantError(1) : new tsInvariant.InvariantError('request is not implemented'); - }; - ApolloLink.empty = empty; - ApolloLink.from = from; - ApolloLink.split = split; - ApolloLink.execute = execute; - return ApolloLink; - }()); - function execute(link, operation) { - return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of()); - } - - exports.Observable = Observable; - Object.defineProperty(exports, 'getOperationName', { - enumerable: true, - get: function () { - return apolloUtilities.getOperationName; - } - }); - exports.ApolloLink = ApolloLink; - exports.concat = concat; - exports.createOperation = createOperation; - exports.empty = empty; - exports.execute = execute; - exports.from = from; - exports.fromError = fromError; - exports.fromPromise = fromPromise; - exports.makePromise = makePromise; - exports.split = split; - exports.toPromise = toPromise; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=bundle.umd.js.map diff --git a/node_modules/apollo-link/lib/bundle.umd.js.map b/node_modules/apollo-link/lib/bundle.umd.js.map deleted file mode 100644 index ca934c4..0000000 --- a/node_modules/apollo-link/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.umd.js","sources":["../src/linkUtils.ts","../src/link.ts"],"sourcesContent":["import Observable from 'zen-observable-ts';\n\nimport { GraphQLRequest, Operation } from './types';\nimport { ApolloLink } from './link';\n\nimport { getOperationName } from 'apollo-utilities';\nimport { invariant, InvariantError } from 'ts-invariant';\nexport { getOperationName };\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n\nexport class LinkError extends Error {\n public link: ApolloLink;\n constructor(message?: string, link?: ApolloLink) {\n super(message);\n this.link = link;\n }\n}\n\nexport function isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport function toPromise(observable: Observable): Promise {\n let completed = false;\n return new Promise((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n invariant.warn(\n `Promise Wrapper does not support multiple results from Observable`,\n );\n } else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n\n// backwards compat\nexport const makePromise = toPromise;\n\nexport function fromPromise(promise: Promise): Observable {\n return new Observable(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n\nexport function fromError(errorValue: any): Observable {\n return new Observable(observer => {\n observer.error(errorValue);\n });\n}\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query)\n : '';\n }\n\n return transformedOperation as Operation;\n}\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = next => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n Object.defineProperty(operation, 'toKey', {\n enumerable: false,\n value: () => getKey(operation),\n });\n\n return operation as Operation;\n}\n\nexport function getKey(operation: GraphQLRequest) {\n // XXX We're assuming here that query and variables will be serialized in\n // the same order, which might not always be true.\n const { query, variables, operationName } = operation;\n return JSON.stringify([operationName, query, variables]);\n}\n","import Observable from 'zen-observable-ts';\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport {\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n FetchResult,\n} from './types';\n\nimport {\n validateOperation,\n isTerminating,\n LinkError,\n transformOperation,\n createOperation,\n} from './linkUtils';\n\nfunction passthrough(op, forward) {\n return forward ? forward(op) : Observable.of();\n}\n\nfunction toLink(handler: RequestHandler | ApolloLink) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\n\nexport function empty(): ApolloLink {\n return new ApolloLink(() => Observable.of());\n}\n\nexport function from(links: ApolloLink[]): ApolloLink {\n if (links.length === 0) return empty();\n return links.map(toLink).reduce((x, y) => x.concat(y));\n}\n\nexport function split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n): ApolloLink {\n const leftLink = toLink(left);\n const rightLink = toLink(right || new ApolloLink(passthrough));\n\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(operation => {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n } else {\n return new ApolloLink((operation, forward) => {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n}\n\n// join two Links together\nexport const concat = (\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler,\n) => {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n invariant.warn(\n new LinkError(\n `You are calling concat on a terminating link, which will have no effect`,\n firstLink,\n ),\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n if (isTerminating(nextLink)) {\n return new ApolloLink(\n operation =>\n firstLink.request(\n operation,\n op => nextLink.request(op) || Observable.of(),\n ) || Observable.of(),\n );\n } else {\n return new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, op => {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of()\n );\n });\n }\n};\n\nexport class ApolloLink {\n public static empty = empty;\n public static from = from;\n public static split = split;\n public static execute = execute;\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler,\n ): ApolloLink {\n return this.concat(split(test, left, right || new ApolloLink(passthrough)));\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink,\n ): Observable | null {\n throw new InvariantError('request is not implemented');\n }\n}\n\nexport function execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n): Observable {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n ),\n ) || Observable.of()\n );\n}\n"],"names":["tslib_1.__extends","getOperationName"],"mappings":";;;;;;;;WASgB,iBAAiB,CAAC,SAAyB;MACzD,IAAM,gBAAgB,GAAG;UACvB,OAAO;UACP,eAAe;UACf,WAAW;UACX,YAAY;UACZ,SAAS;OACV,CAAC;MACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;UAAnC,IAAI,GAAG,SAAA;UACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;cACrC,MAAM;WACP;OACF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EACrB;WACH,CAAC,CAAC;OACJ;EACH,CAAC,CAAC;AAEF;MAME,oBAAY,OAAwB;UAClC,IAAI,OAAO;cAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;OACrC;MAEM,0BAAK,GAAZ,UACE,IAAgC,EAChC,IAAiC,EACjC,KAAmC;UAEnC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;OAC7E;MAEM,2BAAM,GAAb,UAAc,IAAiC;UAC7C,OAAO,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;OAC3B;MAEM,4BAAO,GAAd,UACE,SAAoB,EACpB,OAAkB;UAElB,MAAM;OACP;MA1Ba,gBAAK,GAAG,KAAK,CAAC;MACd,eAAI,GAAG,IAAI,CAAC;MACZ,gBAAK,GAAG,KAAK,CAAC;MACd,kBAAO,GAAG,OAAO,CAAC;MAwBlC,iBAAC;GA5BD,IA4BC;WAEe,OAAO,CACrB,IAAgB,EAChB,SAAyB;MAEzB,QACE,IAAI,CAAC,OAAO,CACV,eAAe,CACb,SAAS,CAAC,OAAO,EACjB,kBAAkB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CACjD,CACF,IAAI,UAAU,CAAC,EAAE,EAAE,EACpB;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.d.ts b/node_modules/apollo-link/lib/index.d.ts deleted file mode 100644 index 94b9f78..0000000 --- a/node_modules/apollo-link/lib/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './link'; -export { createOperation, makePromise, toPromise, fromPromise, fromError, getOperationName, } from './linkUtils'; -export * from './types'; -import Observable from 'zen-observable-ts'; -export { Observable }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.d.ts.map b/node_modules/apollo-link/lib/index.d.ts.map deleted file mode 100644 index ae8e854..0000000 --- a/node_modules/apollo-link/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EACL,eAAe,EACf,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,SAAS,CAAC;AAExB,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.js b/node_modules/apollo-link/lib/index.js deleted file mode 100644 index 7a4f2ae..0000000 --- a/node_modules/apollo-link/lib/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./link"), exports); -var linkUtils_1 = require("./linkUtils"); -exports.createOperation = linkUtils_1.createOperation; -exports.makePromise = linkUtils_1.makePromise; -exports.toPromise = linkUtils_1.toPromise; -exports.fromPromise = linkUtils_1.fromPromise; -exports.fromError = linkUtils_1.fromError; -exports.getOperationName = linkUtils_1.getOperationName; -var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts")); -exports.Observable = zen_observable_ts_1.default; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/index.js.map b/node_modules/apollo-link/lib/index.js.map deleted file mode 100644 index 2a40f7d..0000000 --- a/node_modules/apollo-link/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,yCAOqB;AANnB,sCAAA,eAAe,CAAA;AACf,kCAAA,WAAW,CAAA;AACX,gCAAA,SAAS,CAAA;AACT,kCAAA,WAAW,CAAA;AACX,gCAAA,SAAS,CAAA;AACT,uCAAA,gBAAgB,CAAA;AAIlB,gFAA2C;AAClC,qBADF,2BAAU,CACE"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.d.ts b/node_modules/apollo-link/lib/link.d.ts deleted file mode 100644 index 9b83c28..0000000 --- a/node_modules/apollo-link/lib/link.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import Observable from 'zen-observable-ts'; -import { GraphQLRequest, NextLink, Operation, RequestHandler, FetchResult } from './types'; -export declare function empty(): ApolloLink; -export declare function from(links: ApolloLink[]): ApolloLink; -export declare function split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink; -export declare const concat: (first: RequestHandler | ApolloLink, second: RequestHandler | ApolloLink) => ApolloLink; -export declare class ApolloLink { - static empty: typeof empty; - static from: typeof from; - static split: typeof split; - static execute: typeof execute; - constructor(request?: RequestHandler); - split(test: (op: Operation) => boolean, left: ApolloLink | RequestHandler, right?: ApolloLink | RequestHandler): ApolloLink; - concat(next: ApolloLink | RequestHandler): ApolloLink; - request(operation: Operation, forward?: NextLink): Observable | null; -} -export declare function execute(link: ApolloLink, operation: GraphQLRequest): Observable; -//# sourceMappingURL=link.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.d.ts.map b/node_modules/apollo-link/lib/link.d.ts.map deleted file mode 100644 index 47cf776..0000000 --- a/node_modules/apollo-link/lib/link.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["src/link.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EACL,cAAc,EACd,QAAQ,EACR,SAAS,EACT,cAAc,EACd,WAAW,EACZ,MAAM,SAAS,CAAC;AAkBjB,wBAAgB,KAAK,IAAI,UAAU,CAElC;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CAGpD;AAED,wBAAgB,KAAK,CACnB,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,OAAO,EAChC,IAAI,EAAE,UAAU,GAAG,cAAc,EACjC,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAClC,UAAU,CAiBZ;AAGD,eAAO,MAAM,MAAM,yFAiClB,CAAC;AAEF,qBAAa,UAAU;IACrB,OAAc,KAAK,eAAS;IAC5B,OAAc,IAAI,cAAQ;IAC1B,OAAc,KAAK,eAAS;IAC5B,OAAc,OAAO,iBAAW;gBAEpB,OAAO,CAAC,EAAE,cAAc;IAI7B,KAAK,CACV,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,OAAO,EAChC,IAAI,EAAE,UAAU,GAAG,cAAc,EACjC,KAAK,CAAC,EAAE,UAAU,GAAG,cAAc,GAClC,UAAU;IAIN,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,GAAG,UAAU;IAIrD,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAGlC;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,cAAc,GACxB,UAAU,CAAC,WAAW,CAAC,CASzB"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.js b/node_modules/apollo-link/lib/link.js deleted file mode 100644 index 561886f..0000000 --- a/node_modules/apollo-link/lib/link.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts")); -var ts_invariant_1 = require("ts-invariant"); -var linkUtils_1 = require("./linkUtils"); -function passthrough(op, forward) { - return forward ? forward(op) : zen_observable_ts_1.default.of(); -} -function toLink(handler) { - return typeof handler === 'function' ? new ApolloLink(handler) : handler; -} -function empty() { - return new ApolloLink(function () { return zen_observable_ts_1.default.of(); }); -} -exports.empty = empty; -function from(links) { - if (links.length === 0) - return empty(); - return links.map(toLink).reduce(function (x, y) { return x.concat(y); }); -} -exports.from = from; -function split(test, left, right) { - var leftLink = toLink(left); - var rightLink = toLink(right || new ApolloLink(passthrough)); - if (linkUtils_1.isTerminating(leftLink) && linkUtils_1.isTerminating(rightLink)) { - return new ApolloLink(function (operation) { - return test(operation) - ? leftLink.request(operation) || zen_observable_ts_1.default.of() - : rightLink.request(operation) || zen_observable_ts_1.default.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return test(operation) - ? leftLink.request(operation, forward) || zen_observable_ts_1.default.of() - : rightLink.request(operation, forward) || zen_observable_ts_1.default.of(); - }); - } -} -exports.split = split; -exports.concat = function (first, second) { - var firstLink = toLink(first); - if (linkUtils_1.isTerminating(firstLink)) { - ts_invariant_1.invariant.warn(new linkUtils_1.LinkError("You are calling concat on a terminating link, which will have no effect", firstLink)); - return firstLink; - } - var nextLink = toLink(second); - if (linkUtils_1.isTerminating(nextLink)) { - return new ApolloLink(function (operation) { - return firstLink.request(operation, function (op) { return nextLink.request(op) || zen_observable_ts_1.default.of(); }) || zen_observable_ts_1.default.of(); - }); - } - else { - return new ApolloLink(function (operation, forward) { - return (firstLink.request(operation, function (op) { - return nextLink.request(op, forward) || zen_observable_ts_1.default.of(); - }) || zen_observable_ts_1.default.of()); - }); - } -}; -var ApolloLink = (function () { - function ApolloLink(request) { - if (request) - this.request = request; - } - ApolloLink.prototype.split = function (test, left, right) { - return this.concat(split(test, left, right || new ApolloLink(passthrough))); - }; - ApolloLink.prototype.concat = function (next) { - return exports.concat(this, next); - }; - ApolloLink.prototype.request = function (operation, forward) { - throw new ts_invariant_1.InvariantError('request is not implemented'); - }; - ApolloLink.empty = empty; - ApolloLink.from = from; - ApolloLink.split = split; - ApolloLink.execute = execute; - return ApolloLink; -}()); -exports.ApolloLink = ApolloLink; -function execute(link, operation) { - return (link.request(linkUtils_1.createOperation(operation.context, linkUtils_1.transformOperation(linkUtils_1.validateOperation(operation)))) || zen_observable_ts_1.default.of()); -} -exports.execute = execute; -//# sourceMappingURL=link.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/link.js.map b/node_modules/apollo-link/lib/link.js.map deleted file mode 100644 index 7e94f97..0000000 --- a/node_modules/apollo-link/lib/link.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"link.js","sourceRoot":"","sources":["../src/link.ts"],"names":[],"mappings":";;;AAAA,gFAA2C;AAC3C,6CAAyD;AAUzD,yCAMqB;AAErB,SAAS,WAAW,CAAC,EAAE,EAAE,OAAO;IAC9B,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,2BAAU,CAAC,EAAE,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,MAAM,CAAC,OAAoC;IAClD,OAAO,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC3E,CAAC;AAED,SAAgB,KAAK;IACnB,OAAO,IAAI,UAAU,CAAC,cAAM,OAAA,2BAAU,CAAC,EAAE,EAAE,EAAf,CAAe,CAAC,CAAC;AAC/C,CAAC;AAFD,sBAEC;AAED,SAAgB,IAAI,CAAC,KAAmB;IACtC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,EAAE,CAAC;IACvC,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAX,CAAW,CAAC,CAAC;AACzD,CAAC;AAHD,oBAGC;AAED,SAAgB,KAAK,CACnB,IAAgC,EAChC,IAAiC,EACjC,KAAmC;IAEnC,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAM,SAAS,GAAG,MAAM,CA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B,EAChB,SAAyB;IAEzB,OAAO,CACL,IAAI,CAAC,OAAO,CACV,2BAAe,CACb,SAAS,CAAC,OAAO,EACjB,8BAAkB,CAAC,6BAAiB,CAAC,SAAS,CAAC,CAAC,CACjD,CACF,IAAI,2BAAU,CAAC,EAAE,EAAE,CACrB,CAAC;AACJ,CAAC;AAZD,0BAYC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.d.ts b/node_modules/apollo-link/lib/linkUtils.d.ts deleted file mode 100644 index 058ccfe..0000000 --- a/node_modules/apollo-link/lib/linkUtils.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import Observable from 'zen-observable-ts'; -import { GraphQLRequest, Operation } from './types'; -import { ApolloLink } from './link'; -import { getOperationName } from 'apollo-utilities'; -export { getOperationName }; -export declare function validateOperation(operation: GraphQLRequest): GraphQLRequest; -export declare class LinkError extends Error { - link: ApolloLink; - constructor(message?: string, link?: ApolloLink); -} -export declare function isTerminating(link: ApolloLink): boolean; -export declare function toPromise(observable: Observable): Promise; -export declare const makePromise: typeof toPromise; -export declare function fromPromise(promise: Promise): Observable; -export declare function fromError(errorValue: any): Observable; -export declare function transformOperation(operation: GraphQLRequest): GraphQLRequest; -export declare function createOperation(starting: any, operation: GraphQLRequest): Operation; -export declare function getKey(operation: GraphQLRequest): string; -//# sourceMappingURL=linkUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.d.ts.map b/node_modules/apollo-link/lib/linkUtils.d.ts.map deleted file mode 100644 index 39109a3..0000000 --- a/node_modules/apollo-link/lib/linkUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"linkUtils.d.ts","sourceRoot":"","sources":["src/linkUtils.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAe3E;AAED,qBAAa,SAAU,SAAQ,KAAK;IAC3B,IAAI,EAAE,UAAU,CAAC;gBACZ,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU;CAIhD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEvD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBlE;AAGD,eAAO,MAAM,WAAW,kBAAY,CAAC;AAErC,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CASjE;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAI3D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAiB5E;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,cAAc,GACxB,SAAS,CA2BX;AAED,wBAAgB,MAAM,CAAC,SAAS,EAAE,cAAc,UAK/C"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.js b/node_modules/apollo-link/lib/linkUtils.js deleted file mode 100644 index be68bd3..0000000 --- a/node_modules/apollo-link/lib/linkUtils.js +++ /dev/null @@ -1,122 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts")); -var apollo_utilities_1 = require("apollo-utilities"); -exports.getOperationName = apollo_utilities_1.getOperationName; -var ts_invariant_1 = require("ts-invariant"); -function validateOperation(operation) { - var OPERATION_FIELDS = [ - 'query', - 'operationName', - 'variables', - 'extensions', - 'context', - ]; - for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) { - var key = _a[_i]; - if (OPERATION_FIELDS.indexOf(key) < 0) { - throw new ts_invariant_1.InvariantError("illegal argument: " + key); - } - } - return operation; -} -exports.validateOperation = validateOperation; -var LinkError = (function (_super) { - tslib_1.__extends(LinkError, _super); - function LinkError(message, link) { - var _this = _super.call(this, message) || this; - _this.link = link; - return _this; - } - return LinkError; -}(Error)); -exports.LinkError = LinkError; -function isTerminating(link) { - return link.request.length <= 1; -} -exports.isTerminating = isTerminating; -function toPromise(observable) { - var completed = false; - return new Promise(function (resolve, reject) { - observable.subscribe({ - next: function (data) { - if (completed) { - ts_invariant_1.invariant.warn("Promise Wrapper does not support multiple results from Observable"); - } - else { - completed = true; - resolve(data); - } - }, - error: reject, - }); - }); -} -exports.toPromise = toPromise; -exports.makePromise = toPromise; -function fromPromise(promise) { - return new zen_observable_ts_1.default(function (observer) { - promise - .then(function (value) { - observer.next(value); - observer.complete(); - }) - .catch(observer.error.bind(observer)); - }); -} -exports.fromPromise = fromPromise; -function fromError(errorValue) { - return new zen_observable_ts_1.default(function (observer) { - observer.error(errorValue); - }); -} -exports.fromError = fromError; -function transformOperation(operation) { - var transformedOperation = { - variables: operation.variables || {}, - extensions: operation.extensions || {}, - operationName: operation.operationName, - query: operation.query, - }; - if (!transformedOperation.operationName) { - transformedOperation.operationName = - typeof transformedOperation.query !== 'string' - ? apollo_utilities_1.getOperationName(transformedOperation.query) - : ''; - } - return transformedOperation; -} -exports.transformOperation = transformOperation; -function createOperation(starting, operation) { - var context = tslib_1.__assign({}, starting); - var setContext = function (next) { - if (typeof next === 'function') { - context = tslib_1.__assign({}, context, next(context)); - } - else { - context = tslib_1.__assign({}, context, next); - } - }; - var getContext = function () { return (tslib_1.__assign({}, context)); }; - Object.defineProperty(operation, 'setContext', { - enumerable: false, - value: setContext, - }); - Object.defineProperty(operation, 'getContext', { - enumerable: false, - value: getContext, - }); - Object.defineProperty(operation, 'toKey', { - enumerable: false, - value: function () { return getKey(operation); }, - }); - return operation; -} -exports.createOperation = createOperation; -function getKey(operation) { - var query = operation.query, variables = operation.variables, operationName = operation.operationName; - return JSON.stringify([operationName, query, variables]); -} -exports.getKey = getKey; -//# sourceMappingURL=linkUtils.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/linkUtils.js.map b/node_modules/apollo-link/lib/linkUtils.js.map deleted file mode 100644 index aabc150..0000000 --- a/node_modules/apollo-link/lib/linkUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"linkUtils.js","sourceRoot":"","sources":["../src/linkUtils.ts"],"names":[],"mappings":";;;AAAA,gFAA2C;AAK3C,qDAAoD;AAE3C,2BAFA,mCAAgB,CAEA;AADzB,6CAAyD;AAGzD,SAAgB,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM,IAAI,6BAAc,CAAC,uBAAqB,GAAK,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAfD,8CAeC;AAED;IAA+B,qCAAK;IAElC,mBAAY,OAAgB,EAAE,IAAiB;QAA/C,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;;IACnB,CAAC;IACH,gBAAC;AAAD,CAAC,AAND,CAA+B,KAAK,GAMnC;AANY,8BAAS;AAQtB,SAAgB,aAAa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CAAC;AA9BD,0CA8BC;AAED,SAAgB,MAAM,CAAC,SAAyB;IAGtC,IAAA,uBAAK,EAAE,+BAAS,EAAE,uCAAa,CAAe;IACtD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3D,CAAC;AALD,wBAKC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.d.ts b/node_modules/apollo-link/lib/test-utils.d.ts deleted file mode 100644 index 1a2cbdb..0000000 --- a/node_modules/apollo-link/lib/test-utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import MockLink from './test-utils/mockLink'; -import SetContextLink from './test-utils/setContext'; -export * from './test-utils/testingUtils'; -export { MockLink, SetContextLink }; -//# sourceMappingURL=test-utils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.d.ts.map b/node_modules/apollo-link/lib/test-utils.d.ts.map deleted file mode 100644 index f337f9d..0000000 --- a/node_modules/apollo-link/lib/test-utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["src/test-utils.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,cAAc,MAAM,yBAAyB,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.js b/node_modules/apollo-link/lib/test-utils.js deleted file mode 100644 index feecc92..0000000 --- a/node_modules/apollo-link/lib/test-utils.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var mockLink_1 = tslib_1.__importDefault(require("./test-utils/mockLink")); -exports.MockLink = mockLink_1.default; -var setContext_1 = tslib_1.__importDefault(require("./test-utils/setContext")); -exports.SetContextLink = setContext_1.default; -tslib_1.__exportStar(require("./test-utils/testingUtils"), exports); -//# sourceMappingURL=test-utils.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils.js.map b/node_modules/apollo-link/lib/test-utils.js.map deleted file mode 100644 index ea03f9f..0000000 --- a/node_modules/apollo-link/lib/test-utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../src/test-utils.ts"],"names":[],"mappings":";;;AAAA,2EAA6C;AAIpC,mBAJF,kBAAQ,CAIE;AAHjB,+EAAqD;AAGlC,yBAHZ,oBAAc,CAGY;AAFjC,oEAA0C"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.d.ts b/node_modules/apollo-link/lib/test-utils/mockLink.d.ts deleted file mode 100644 index e61009f..0000000 --- a/node_modules/apollo-link/lib/test-utils/mockLink.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Operation, RequestHandler, NextLink, FetchResult } from '../types'; -import Observable from 'zen-observable-ts'; -import { ApolloLink } from '../link'; -export default class MockLink extends ApolloLink { - constructor(handleRequest?: RequestHandler); - request(operation: Operation, forward?: NextLink): Observable | null; -} -//# sourceMappingURL=mockLink.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map b/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map deleted file mode 100644 index 91d303f..0000000 --- a/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mockLink.d.ts","sourceRoot":"","sources":["../src/test-utils/mockLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;gBAClC,aAAa,GAAE,cAA2B;IAK/C,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAGlC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.js b/node_modules/apollo-link/lib/test-utils/mockLink.js deleted file mode 100644 index 166c100..0000000 --- a/node_modules/apollo-link/lib/test-utils/mockLink.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var link_1 = require("../link"); -var MockLink = (function (_super) { - tslib_1.__extends(MockLink, _super); - function MockLink(handleRequest) { - if (handleRequest === void 0) { handleRequest = function () { return null; }; } - var _this = _super.call(this) || this; - _this.request = handleRequest; - return _this; - } - MockLink.prototype.request = function (operation, forward) { - throw Error('should be overridden'); - }; - return MockLink; -}(link_1.ApolloLink)); -exports.default = MockLink; -//# sourceMappingURL=mockLink.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/mockLink.js.map b/node_modules/apollo-link/lib/test-utils/mockLink.js.map deleted file mode 100644 index 24bed60..0000000 --- a/node_modules/apollo-link/lib/test-utils/mockLink.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mockLink.js","sourceRoot":"","sources":["../../src/test-utils/mockLink.ts"],"names":[],"mappings":";;;AAIA,gCAAqC;AAErC;IAAsC,oCAAU;IAC9C,kBAAY,aAA0C;QAA1C,8BAAA,EAAA,8BAAsC,OAAA,IAAI,EAAJ,CAAI;QAAtD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,OAAO,GAAG,aAAa,CAAC;;IAC/B,CAAC;IAEM,0BAAO,GAAd,UACE,SAAoB,EACpB,OAAkB;QAElB,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACtC,CAAC;IACH,eAAC;AAAD,CAAC,AAZD,CAAsC,iBAAU,GAY/C"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.d.ts b/node_modules/apollo-link/lib/test-utils/setContext.d.ts deleted file mode 100644 index 41259d8..0000000 --- a/node_modules/apollo-link/lib/test-utils/setContext.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Operation, NextLink, FetchResult } from '../types'; -import Observable from 'zen-observable-ts'; -import { ApolloLink } from '../link'; -export default class SetContextLink extends ApolloLink { - private setContext; - constructor(setContext?: (context: Record) => Record); - request(operation: Operation, forward: NextLink): Observable; -} -//# sourceMappingURL=setContext.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map b/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map deleted file mode 100644 index 5ead879..0000000 --- a/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setContext.d.ts","sourceRoot":"","sources":["../src/test-utils/setContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IAElD,OAAO,CAAC,UAAU;gBAAV,UAAU,GAAE,CAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACzB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAU;IAK5B,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,QAAQ,GAChB,UAAU,CAAC,WAAW,CAAC;CAI3B"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.js b/node_modules/apollo-link/lib/test-utils/setContext.js deleted file mode 100644 index 0f382ec..0000000 --- a/node_modules/apollo-link/lib/test-utils/setContext.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var link_1 = require("../link"); -var SetContextLink = (function (_super) { - tslib_1.__extends(SetContextLink, _super); - function SetContextLink(setContext) { - if (setContext === void 0) { setContext = function (c) { return c; }; } - var _this = _super.call(this) || this; - _this.setContext = setContext; - return _this; - } - SetContextLink.prototype.request = function (operation, forward) { - operation.setContext(this.setContext(operation.getContext())); - return forward(operation); - }; - return SetContextLink; -}(link_1.ApolloLink)); -exports.default = SetContextLink; -//# sourceMappingURL=setContext.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/setContext.js.map b/node_modules/apollo-link/lib/test-utils/setContext.js.map deleted file mode 100644 index 29d313a..0000000 --- a/node_modules/apollo-link/lib/test-utils/setContext.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setContext.js","sourceRoot":"","sources":["../../src/test-utils/setContext.ts"],"names":[],"mappings":";;;AAIA,gCAAqC;AAErC;IAA4C,0CAAU;IACpD,wBACU,UAEyB;QAFzB,2BAAA,EAAA,uBAEmB,CAAC,IAAI,OAAA,CAAC,EAAD,CAAC;QAHnC,YAKE,iBAAO,SACR;QALS,gBAAU,GAAV,UAAU,CAEe;;IAGnC,CAAC;IAEM,gCAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;QAEjB,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QAC9D,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IACH,qBAAC;AAAD,CAAC,AAhBD,CAA4C,iBAAU,GAgBrD"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts b/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts deleted file mode 100644 index e79b7f6..0000000 --- a/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ApolloLink } from '../link'; -export declare function checkCalls(calls: any[], results: Array): void; -export interface TestResultType { - link: ApolloLink; - results?: any[]; - query?: string; - done?: () => void; - context?: any; - variables?: any; -} -export declare function testLinkResults(params: TestResultType): void; -//# sourceMappingURL=testingUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map b/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map deleted file mode 100644 index 0e0cfa6..0000000 --- a/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"testingUtils.d.ts","sourceRoot":"","sources":["../src/test-utils/testingUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,UAAU,EAAE,MAAM,SAAS,CAAC;AAU9C,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,QAGjE;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,QAuBrD"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.js b/node_modules/apollo-link/lib/test-utils/testingUtils.js deleted file mode 100644 index 694489b..0000000 --- a/node_modules/apollo-link/lib/test-utils/testingUtils.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag")); -var link_1 = require("../link"); -var sampleQuery = graphql_tag_1.default(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n query SampleQuery {\n stub {\n id\n }\n }\n"], ["\n query SampleQuery {\n stub {\n id\n }\n }\n"]))); -function checkCalls(calls, results) { - if (calls === void 0) { calls = []; } - expect(calls.length).toBe(results.length); - calls.map(function (call, i) { return expect(call.data).toEqual(results[i]); }); -} -exports.checkCalls = checkCalls; -function testLinkResults(params) { - var link = params.link, context = params.context, variables = params.variables; - var results = params.results || []; - var query = params.query || sampleQuery; - var done = params.done || (function () { return void 0; }); - var spy = jest.fn(); - link_1.execute(link, { query: query, context: context, variables: variables }).subscribe({ - next: spy, - error: function (error) { - expect(error).toEqual(results.pop()); - checkCalls(spy.mock.calls[0], results); - if (done) { - done(); - } - }, - complete: function () { - checkCalls(spy.mock.calls[0], results); - if (done) { - done(); - } - }, - }); -} -exports.testLinkResults = testLinkResults; -var templateObject_1; -//# sourceMappingURL=testingUtils.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/test-utils/testingUtils.js.map b/node_modules/apollo-link/lib/test-utils/testingUtils.js.map deleted file mode 100644 index 94130d9..0000000 --- a/node_modules/apollo-link/lib/test-utils/testingUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"testingUtils.js","sourceRoot":"","sources":["../../src/test-utils/testingUtils.ts"],"names":[],"mappings":";;;AAAA,oEAA8B;AAC9B,gCAA8C;AAE9C,IAAM,WAAW,GAAG,qBAAG,wIAAA,6DAMtB,IAAA,CAAC;AAEF,SAAgB,UAAU,CAAI,KAAiB,EAAE,OAAiB;IAApC,sBAAA,EAAA,UAAiB;IAC7C,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,CAAC,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAArC,CAAqC,CAAC,CAAC;AAChE,CAAC;AAHD,gCAGC;AAWD,SAAgB,eAAe,CAAC,MAAsB;IAC5C,IAAA,kBAAI,EAAE,wBAAO,EAAE,4BAAS,CAAY;IAC5C,IAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACrC,IAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,WAAW,CAAC;IAC1C,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,cAAM,OAAA,KAAK,CAAC,EAAN,CAAM,CAAC,CAAC;IAE3C,IAAM,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACtB,cAAO,CAAC,IAAI,EAAE,EAAE,KAAK,OAAA,EAAE,OAAO,SAAA,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC,SAAS,CAAC;QACrD,IAAI,EAAE,GAAG;QACT,KAAK,EAAE,UAAA,KAAK;YACV,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YACrC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,EAAE;gBACR,IAAI,EAAE,CAAC;aACR;QACH,CAAC;QACD,QAAQ,EAAE;YACR,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACvC,IAAI,IAAI,EAAE;gBACR,IAAI,EAAE,CAAC;aACR;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAvBD,0CAuBC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.d.ts b/node_modules/apollo-link/lib/types.d.ts deleted file mode 100644 index ba9a75c..0000000 --- a/node_modules/apollo-link/lib/types.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import Observable from 'zen-observable-ts'; -import { DocumentNode } from 'graphql/language/ast'; -import { ExecutionResult as GraphQLExecutionResult } from 'graphql'; -export { DocumentNode }; -export interface ExecutionResult extends GraphQLExecutionResult { - data?: TData | null; -} -export interface GraphQLRequest { - query: DocumentNode; - variables?: Record; - operationName?: string; - context?: Record; - extensions?: Record; -} -export interface Operation { - query: DocumentNode; - variables: Record; - operationName: string; - extensions: Record; - setContext: (context: Record) => Record; - getContext: () => Record; - toKey: () => string; -} -export declare type FetchResult, E = Record> = ExecutionResult & { - extensions?: E; - context?: C; -}; -export declare type NextLink = (operation: Operation) => Observable; -export declare type RequestHandler = (operation: Operation, forward: NextLink) => Observable | null; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.d.ts.map b/node_modules/apollo-link/lib/types.d.ts.map deleted file mode 100644 index 64b6a64..0000000 --- a/node_modules/apollo-link/lib/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,MAAM,WAAW,eAAe,CAC9B,KAAK,GAAG;IACN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CACD,SAAQ,sBAAsB;IAC9B,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClE,UAAU,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,KAAK,EAAE,MAAM,MAAM,CAAC;CACrB;AAED,oBAAY,WAAW,CACrB,KAAK,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC9B,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACrB,eAAe,CAAC,KAAK,CAAC,GAAG;IAC3B,UAAU,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,CAAC;CACb,CAAC;AAEF,oBAAY,QAAQ,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,UAAU,CAAC,WAAW,CAAC,CAAC;AACzE,oBAAY,cAAc,GAAG,CAC3B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,QAAQ,KACd,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.js b/node_modules/apollo-link/lib/types.js deleted file mode 100644 index 11e638d..0000000 --- a/node_modules/apollo-link/lib/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/apollo-link/lib/types.js.map b/node_modules/apollo-link/lib/types.js.map deleted file mode 100644 index c768b79..0000000 --- a/node_modules/apollo-link/lib/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/apollo-link/package.json b/node_modules/apollo-link/package.json deleted file mode 100644 index 9be5fd7..0000000 --- a/node_modules/apollo-link/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "apollo-link", - "version": "1.2.14", - "description": "Flexible, lightweight transport layer for GraphQL", - "author": "Evans Hauser ", - "contributors": [ - "James Baxley ", - "Jonas Helfer ", - "jon wong ", - "Sashko Stubailo " - ], - "license": "MIT", - "main": "./lib/index.js", - "module": "./lib/bundle.esm.js", - "typings": "./lib/index.d.ts", - "sideEffects": false, - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/apollo-link.git" - }, - "bugs": { - "url": "https://github.com/apollographql/apollo-link/issues" - }, - "homepage": "https://github.com/apollographql/apollo-link#readme", - "scripts": { - "build": "tsc && rollup -c", - "clean": "rimraf lib/* && rimraf coverage/*", - "coverage": "jest --coverage", - "filesize": "../../scripts/minify", - "lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", - "prebuild": "npm run clean", - "prepare": "npm run build", - "test": "npm run lint && jest", - "watch": "tsc -w -p . & rollup -c -w" - }, - "dependencies": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - }, - "peerDependencies": { - "graphql": "^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "@types/node": "9.6.55", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "typescript": "3.0.3" - }, - "jest": { - "transform": { - ".(ts|tsx)": "ts-jest" - }, - "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ], - "testURL": "http://localhost" - }, - "gitHead": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/node_modules/apollo-utilities/.flowconfig b/node_modules/apollo-utilities/.flowconfig deleted file mode 100644 index ffa2101..0000000 --- a/node_modules/apollo-utilities/.flowconfig +++ /dev/null @@ -1,8 +0,0 @@ -[ignore] - -[include] - -[libs] - -[options] -suppress_comment= \\(.\\|\n\\)*\\$ExpectError diff --git a/node_modules/apollo-utilities/CHANGELOG.md b/node_modules/apollo-utilities/CHANGELOG.md deleted file mode 100644 index 2cabb60..0000000 --- a/node_modules/apollo-utilities/CHANGELOG.md +++ /dev/null @@ -1,106 +0,0 @@ -# CHANGELOG - ----- - -**NOTE:** This changelog is no longer maintained. Changes are now tracked in -the top level [`CHANGELOG.md`](https://github.com/apollographql/apollo-client/blob/master/CHANGELOG.md). - ----- - -### 1.0.16 - -- Removed unnecessary whitespace from error message - [Issue #3398](https://github.com/apollographql/apollo-client/issues/3398) - [PR #3593](https://github.com/apollographql/apollo-client/pull/3593) - -### 1.0.15 - -- No changes - -### 1.0.14 - -- Store key names generated by `getStoreKeyName` now leverage a more - deterministic approach to handling JSON based strings. This prevents store - key names from differing when using `args` like - `{ prop1: 'value1', prop2: 'value2' }` and - `{ prop2: 'value2', prop1: 'value1' }`. - [PR #2869](https://github.com/apollographql/apollo-client/pull/2869) -- Avoid needless `hasOwnProperty` check in `deepFreeze`. - [PR #3545](https://github.com/apollographql/apollo-client/pull/3545) - -### 1.0.13 - -- Make `maybeDeepFreeze` a little more defensive, by always using - `Object.prototype.hasOwnProperty` (to avoid cases where the object being - frozen doesn't have its own `hasOwnProperty`). - [Issue #3426](https://github.com/apollographql/apollo-client/issues/3426) - [PR #3418](https://github.com/apollographql/apollo-client/pull/3418) -- Remove certain small internal caches to prevent memory leaks when using SSR. - [PR #3444](https://github.com/apollographql/apollo-client/pull/3444) - -### 1.0.12 - -- Not documented - -### 1.0.11 - -- `toIdValue` helper now takes an object with `id` and `typename` properties - as the preferred interface - [PR #3159](https://github.com/apollographql/apollo-client/pull/3159) -- Map coverage to original source -- Don't `deepFreeze` in development/test environments if ES6 symbols are - polyfilled - [PR #3082](https://github.com/apollographql/apollo-client/pull/3082) -- Added ability to include or ignore fragments in `getDirectivesFromDocument` - [PR #3010](https://github.com/apollographql/apollo-client/pull/3010) - -### 1.0.9 - -- Dependency updates -- Added getDirectivesFromDocument utility function - [PR #2974](https://github.com/apollographql/apollo-client/pull/2974) - -### 1.0.8 - -- Add client, rest, and export directives to list of known directives - [PR #2949](https://github.com/apollographql/apollo-client/pull/2949) - -### 1.0.7 - -- Fix typo in error message for invalid argument being passed to @skip or - @include directives - [PR #2867](https://github.com/apollographql/apollo-client/pull/2867) - -### 1.0.6 - -- Update `getStoreKeyName` to support custom directives - -### 1.0.5 - -- Package dependency updates - -### 1.0.4 - -- Package dependency updates - -### 1.0.3 - -- Package dependency updates - -### 1.0.2 - -- Improved rollup builds - -### 1.0.1 - -- Added config to remove selection set of directive matches test - -### 1.0.0 - -- Added utilities from hermes cache -- Added removeDirectivesFromDocument to allow cleaning of client only - directives -- Added hasDirectives to recurse the AST and return a boolean for an array of - directive names -- Improved performance of common store actions by memoizing addTypename and - removeConnectionDirective diff --git a/node_modules/apollo-utilities/LICENSE b/node_modules/apollo-utilities/LICENSE deleted file mode 100644 index 278ee9d..0000000 --- a/node_modules/apollo-utilities/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Meteor Development Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/apollo-utilities/jest.config.js b/node_modules/apollo-utilities/jest.config.js deleted file mode 100644 index 48f0a89..0000000 --- a/node_modules/apollo-utilities/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../config/jest.config.settings'), -}; diff --git a/node_modules/apollo-utilities/lib/bundle.cjs.js b/node_modules/apollo-utilities/lib/bundle.cjs.js deleted file mode 100644 index 49d9f00..0000000 --- a/node_modules/apollo-utilities/lib/bundle.cjs.js +++ /dev/null @@ -1,1125 +0,0 @@ -exports.__esModule = true; -exports.addTypenameToDocument = addTypenameToDocument; -exports.argumentsObjectFromField = argumentsObjectFromField; -exports.assign = assign; -exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet; -exports.checkDocument = checkDocument; -exports.cloneDeep = cloneDeep; -exports.createFragmentMap = createFragmentMap; -exports.getDefaultValues = getDefaultValues; -exports.getDirectiveInfoFromField = getDirectiveInfoFromField; -exports.getDirectiveNames = getDirectiveNames; -exports.getDirectivesFromDocument = getDirectivesFromDocument; -exports.getEnv = getEnv; -exports.getFragmentDefinition = getFragmentDefinition; -exports.getFragmentDefinitions = getFragmentDefinitions; -exports.getFragmentQueryDocument = getFragmentQueryDocument; -exports.getInclusionDirectives = getInclusionDirectives; -exports.getMainDefinition = getMainDefinition; -exports.getMutationDefinition = getMutationDefinition; -exports.getOperationDefinition = getOperationDefinition; -exports.getOperationDefinitionOrDie = getOperationDefinitionOrDie; -exports.getOperationName = getOperationName; -exports.getQueryDefinition = getQueryDefinition; -exports.getStoreKeyName = getStoreKeyName; -exports.graphQLResultHasError = graphQLResultHasError; -exports.hasClientExports = hasClientExports; -exports.hasDirectives = hasDirectives; -exports.isDevelopment = isDevelopment; -exports.isEnv = isEnv; -exports.isField = isField; -exports.isIdValue = isIdValue; -exports.isInlineFragment = isInlineFragment; -exports.isJsonValue = isJsonValue; -exports.isNumberValue = isNumberValue; -exports.isProduction = isProduction; -exports.isScalarValue = isScalarValue; -exports.isTest = isTest; -exports.maybeDeepFreeze = maybeDeepFreeze; -exports.mergeDeep = mergeDeep; -exports.mergeDeepArray = mergeDeepArray; -exports.removeArgumentsFromDocument = removeArgumentsFromDocument; -exports.removeClientSetsFromDocument = removeClientSetsFromDocument; -exports.removeConnectionDirectiveFromDocument = removeConnectionDirectiveFromDocument; -exports.removeDirectivesFromDocument = removeDirectivesFromDocument; -exports.removeFragmentSpreadFromDocument = removeFragmentSpreadFromDocument; -exports.resultKeyNameFromField = resultKeyNameFromField; -exports.shouldInclude = shouldInclude; -exports.storeKeyNameFromField = storeKeyNameFromField; -exports.stripSymbols = stripSymbols; -exports.toIdValue = toIdValue; -exports.tryFunctionOrLogError = tryFunctionOrLogError; -exports.valueFromNode = valueFromNode; -exports.valueToObjectRepresentation = valueToObjectRepresentation; -exports.variablesInOperation = variablesInOperation; -exports.warnOnceInDevelopment = warnOnceInDevelopment; -exports.canUseWeakMap = exports.isEqual = void 0; - -var _visitor = require("graphql/language/visitor"); - -var _tsInvariant = require("ts-invariant"); - -var _tslib = require("tslib"); - -var _fastJsonStableStringify = _interopRequireDefault(require("fast-json-stable-stringify")); - -var _equality = require("@wry/equality"); - -exports.isEqual = _equality.equal; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isScalarValue(value) { - return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; -} - -function isNumberValue(value) { - return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; -} - -function isStringValue(value) { - return value.kind === 'StringValue'; -} - -function isBooleanValue(value) { - return value.kind === 'BooleanValue'; -} - -function isIntValue(value) { - return value.kind === 'IntValue'; -} - -function isFloatValue(value) { - return value.kind === 'FloatValue'; -} - -function isVariable(value) { - return value.kind === 'Variable'; -} - -function isObjectValue(value) { - return value.kind === 'ObjectValue'; -} - -function isListValue(value) { - return value.kind === 'ListValue'; -} - -function isEnumValue(value) { - return value.kind === 'EnumValue'; -} - -function isNullValue(value) { - return value.kind === 'NullValue'; -} - -function valueToObjectRepresentation(argObj, name, value, variables) { - if (isIntValue(value) || isFloatValue(value)) { - argObj[name.value] = Number(value.value); - } else if (isBooleanValue(value) || isStringValue(value)) { - argObj[name.value] = value.value; - } else if (isObjectValue(value)) { - var nestedArgObj_1 = {}; - value.fields.map(function (obj) { - return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); - }); - argObj[name.value] = nestedArgObj_1; - } else if (isVariable(value)) { - var variableValue = (variables || {})[value.name.value]; - argObj[name.value] = variableValue; - } else if (isListValue(value)) { - argObj[name.value] = value.values.map(function (listValue) { - var nestedArgArrayObj = {}; - valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); - return nestedArgArrayObj[name.value]; - }); - } else if (isEnumValue(value)) { - argObj[name.value] = value.value; - } else if (isNullValue(value)) { - argObj[name.value] = null; - } else { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(17) : new _tsInvariant.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + 'is not supported. Use variables instead of inline arguments to ' + 'overcome this limitation.'); - } -} - -function storeKeyNameFromField(field, variables) { - var directivesObj = null; - - if (field.directives) { - directivesObj = {}; - field.directives.forEach(function (directive) { - directivesObj[directive.name.value] = {}; - - if (directive.arguments) { - directive.arguments.forEach(function (_a) { - var name = _a.name, - value = _a.value; - return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); - }); - } - }); - } - - var argObj = null; - - if (field.arguments && field.arguments.length) { - argObj = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, - value = _a.value; - return valueToObjectRepresentation(argObj, name, value, variables); - }); - } - - return getStoreKeyName(field.name.value, argObj, directivesObj); -} - -var KNOWN_DIRECTIVES = ['connection', 'include', 'skip', 'client', 'rest', 'export']; - -function getStoreKeyName(fieldName, args, directives) { - if (directives && directives['connection'] && directives['connection']['key']) { - if (directives['connection']['filter'] && directives['connection']['filter'].length > 0) { - var filterKeys = directives['connection']['filter'] ? directives['connection']['filter'] : []; - filterKeys.sort(); - var queryArgs_1 = args; - var filteredArgs_1 = {}; - filterKeys.forEach(function (key) { - filteredArgs_1[key] = queryArgs_1[key]; - }); - return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; - } else { - return directives['connection']['key']; - } - } - - var completeFieldName = fieldName; - - if (args) { - var stringifiedArgs = (0, _fastJsonStableStringify.default)(args); - completeFieldName += "(" + stringifiedArgs + ")"; - } - - if (directives) { - Object.keys(directives).forEach(function (key) { - if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; - - if (directives[key] && Object.keys(directives[key]).length) { - completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; - } else { - completeFieldName += "@" + key; - } - }); - } - - return completeFieldName; -} - -function argumentsObjectFromField(field, variables) { - if (field.arguments && field.arguments.length) { - var argObj_1 = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, - value = _a.value; - return valueToObjectRepresentation(argObj_1, name, value, variables); - }); - return argObj_1; - } - - return null; -} - -function resultKeyNameFromField(field) { - return field.alias ? field.alias.value : field.name.value; -} - -function isField(selection) { - return selection.kind === 'Field'; -} - -function isInlineFragment(selection) { - return selection.kind === 'InlineFragment'; -} - -function isIdValue(idObject) { - return idObject && idObject.type === 'id' && typeof idObject.generated === 'boolean'; -} - -function toIdValue(idConfig, generated) { - if (generated === void 0) { - generated = false; - } - - return (0, _tslib.__assign)({ - type: 'id', - generated: generated - }, typeof idConfig === 'string' ? { - id: idConfig, - typename: undefined - } : idConfig); -} - -function isJsonValue(jsonObject) { - return jsonObject != null && typeof jsonObject === 'object' && jsonObject.type === 'json'; -} - -function defaultValueFromVariable(node) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(18) : new _tsInvariant.InvariantError("Variable nodes are not supported by valueFromNode"); -} - -function valueFromNode(node, onVariable) { - if (onVariable === void 0) { - onVariable = defaultValueFromVariable; - } - - switch (node.kind) { - case 'Variable': - return onVariable(node); - - case 'NullValue': - return null; - - case 'IntValue': - return parseInt(node.value, 10); - - case 'FloatValue': - return parseFloat(node.value); - - case 'ListValue': - return node.values.map(function (v) { - return valueFromNode(v, onVariable); - }); - - case 'ObjectValue': - { - var value = {}; - - for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { - var field = _a[_i]; - value[field.name.value] = valueFromNode(field.value, onVariable); - } - - return value; - } - - default: - return node.value; - } -} - -function getDirectiveInfoFromField(field, variables) { - if (field.directives && field.directives.length) { - var directiveObj_1 = {}; - field.directives.forEach(function (directive) { - directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables); - }); - return directiveObj_1; - } - - return null; -} - -function shouldInclude(selection, variables) { - if (variables === void 0) { - variables = {}; - } - - return getInclusionDirectives(selection.directives).every(function (_a) { - var directive = _a.directive, - ifArgument = _a.ifArgument; - var evaledValue = false; - - if (ifArgument.value.kind === 'Variable') { - evaledValue = variables[ifArgument.value.name.value]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(evaledValue !== void 0, 13) : (0, _tsInvariant.invariant)(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); - } else { - evaledValue = ifArgument.value.value; - } - - return directive.name.value === 'skip' ? !evaledValue : evaledValue; - }); -} - -function getDirectiveNames(doc) { - var names = []; - (0, _visitor.visit)(doc, { - Directive: function (node) { - names.push(node.name.value); - } - }); - return names; -} - -function hasDirectives(names, doc) { - return getDirectiveNames(doc).some(function (name) { - return names.indexOf(name) > -1; - }); -} - -function hasClientExports(document) { - return document && hasDirectives(['client'], document) && hasDirectives(['export'], document); -} - -function isInclusionDirective(_a) { - var value = _a.name.value; - return value === 'skip' || value === 'include'; -} - -function getInclusionDirectives(directives) { - return directives ? directives.filter(isInclusionDirective).map(function (directive) { - var directiveArguments = directive.arguments; - var directiveName = directive.name.value; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, 14) : (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); - var ifArgument = directiveArguments[0]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', 15) : (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); - var ifValue = ifArgument.value; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 16) : (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); - return { - directive: directive, - ifArgument: ifArgument - }; - }) : []; -} - -function getFragmentQueryDocument(document, fragmentName) { - var actualFragmentName = fragmentName; - var fragments = []; - document.definitions.forEach(function (definition) { - if (definition.kind === 'OperationDefinition') { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(11) : new _tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); - } - - if (definition.kind === 'FragmentDefinition') { - fragments.push(definition); - } - }); - - if (typeof actualFragmentName === 'undefined') { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragments.length === 1, 12) : (0, _tsInvariant.invariant)(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); - actualFragmentName = fragments[0].name.value; - } - - var query = (0, _tslib.__assign)((0, _tslib.__assign)({}, document), { - definitions: (0, _tslib.__spreadArrays)([{ - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [{ - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName - } - }] - } - }], document.definitions) - }); - return query; -} - -function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - if (typeof source === 'undefined' || source === null) { - return; - } - - Object.keys(source).forEach(function (key) { - target[key] = source[key]; - }); - }); - return target; -} - -function getMutationDefinition(doc) { - checkDocument(doc); - var mutationDef = doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition' && definition.operation === 'mutation'; - })[0]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutationDef, 1) : (0, _tsInvariant.invariant)(mutationDef, 'Must contain a mutation definition.'); - return mutationDef; -} - -function checkDocument(doc) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', 2) : (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - var operations = doc.definitions.filter(function (d) { - return d.kind !== 'FragmentDefinition'; - }).map(function (definition) { - if (definition.kind !== 'OperationDefinition') { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(3) : new _tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); - } - - return definition; - }); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(operations.length <= 1, 4) : (0, _tsInvariant.invariant)(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); - return doc; -} - -function getOperationDefinition(doc) { - checkDocument(doc); - return doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition'; - })[0]; -} - -function getOperationDefinitionOrDie(document) { - var def = getOperationDefinition(document); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(def, 5) : (0, _tsInvariant.invariant)(def, "GraphQL document is missing an operation"); - return def; -} - -function getOperationName(doc) { - return doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition' && definition.name; - }).map(function (x) { - return x.name.value; - })[0] || null; -} - -function getFragmentDefinitions(doc) { - return doc.definitions.filter(function (definition) { - return definition.kind === 'FragmentDefinition'; - }); -} - -function getQueryDefinition(doc) { - var queryDef = getOperationDefinition(doc); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 6) : (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); - return queryDef; -} - -function getFragmentDefinition(doc) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.kind === 'Document', 7) : (0, _tsInvariant.invariant)(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 8) : (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); - var fragmentDef = doc.definitions[0]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 9) : (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); - return fragmentDef; -} - -function getMainDefinition(queryDoc) { - checkDocument(queryDoc); - var fragmentDefinition; - - for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { - var definition = _a[_i]; - - if (definition.kind === 'OperationDefinition') { - var operation = definition.operation; - - if (operation === 'query' || operation === 'mutation' || operation === 'subscription') { - return definition; - } - } - - if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { - fragmentDefinition = definition; - } - } - - if (fragmentDefinition) { - return fragmentDefinition; - } - - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(10) : new _tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); -} - -function createFragmentMap(fragments) { - if (fragments === void 0) { - fragments = []; - } - - var symTable = {}; - fragments.forEach(function (fragment) { - symTable[fragment.name.value] = fragment; - }); - return symTable; -} - -function getDefaultValues(definition) { - if (definition && definition.variableDefinitions && definition.variableDefinitions.length) { - var defaultValues = definition.variableDefinitions.filter(function (_a) { - var defaultValue = _a.defaultValue; - return defaultValue; - }).map(function (_a) { - var variable = _a.variable, - defaultValue = _a.defaultValue; - var defaultValueObj = {}; - valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); - return defaultValueObj; - }); - return assign.apply(void 0, (0, _tslib.__spreadArrays)([{}], defaultValues)); - } - - return {}; -} - -function variablesInOperation(operation) { - var names = new Set(); - - if (operation.variableDefinitions) { - for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { - var definition = _a[_i]; - names.add(definition.variable.name.value); - } - } - - return names; -} - -function filterInPlace(array, test, context) { - var target = 0; - array.forEach(function (elem, i) { - if (test.call(this, elem, i, array)) { - array[target++] = elem; - } - }, context); - array.length = target; - return array; -} - -var TYPENAME_FIELD = { - kind: 'Field', - name: { - kind: 'Name', - value: '__typename' - } -}; - -function isEmpty(op, fragments) { - return op.selectionSet.selections.every(function (selection) { - return selection.kind === 'FragmentSpread' && isEmpty(fragments[selection.name.value], fragments); - }); -} - -function nullIfDocIsEmpty(doc) { - return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc))) ? null : doc; -} - -function getDirectiveMatcher(directives) { - return function directiveMatcher(directive) { - return directives.some(function (dir) { - return dir.name && dir.name === directive.name.value || dir.test && dir.test(directive); - }); - }; -} - -function removeDirectivesFromDocument(directives, doc) { - var variablesInUse = Object.create(null); - var variablesToRemove = []; - var fragmentSpreadsInUse = Object.create(null); - var fragmentSpreadsToRemove = []; - var modifiedDoc = nullIfDocIsEmpty((0, _visitor.visit)(doc, { - Variable: { - enter: function (node, _key, parent) { - if (parent.kind !== 'VariableDefinition') { - variablesInUse[node.name.value] = true; - } - } - }, - Field: { - enter: function (node) { - if (directives && node.directives) { - var shouldRemoveField = directives.some(function (directive) { - return directive.remove; - }); - - if (shouldRemoveField && node.directives && node.directives.some(getDirectiveMatcher(directives))) { - if (node.arguments) { - node.arguments.forEach(function (arg) { - if (arg.value.kind === 'Variable') { - variablesToRemove.push({ - name: arg.value.name.value - }); - } - }); - } - - if (node.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { - fragmentSpreadsToRemove.push({ - name: frag.name.value - }); - }); - } - - return null; - } - } - } - }, - FragmentSpread: { - enter: function (node) { - fragmentSpreadsInUse[node.name.value] = true; - } - }, - Directive: { - enter: function (node) { - if (getDirectiveMatcher(directives)(node)) { - return null; - } - } - } - })); - - if (modifiedDoc && filterInPlace(variablesToRemove, function (v) { - return !variablesInUse[v.name]; - }).length) { - modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); - } - - if (modifiedDoc && filterInPlace(fragmentSpreadsToRemove, function (fs) { - return !fragmentSpreadsInUse[fs.name]; - }).length) { - modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); - } - - return modifiedDoc; -} - -function addTypenameToDocument(doc) { - return (0, _visitor.visit)(checkDocument(doc), { - SelectionSet: { - enter: function (node, _key, parent) { - if (parent && parent.kind === 'OperationDefinition') { - return; - } - - var selections = node.selections; - - if (!selections) { - return; - } - - var skip = selections.some(function (selection) { - return isField(selection) && (selection.name.value === '__typename' || selection.name.value.lastIndexOf('__', 0) === 0); - }); - - if (skip) { - return; - } - - var field = parent; - - if (isField(field) && field.directives && field.directives.some(function (d) { - return d.name.value === 'export'; - })) { - return; - } - - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - selections: (0, _tslib.__spreadArrays)(selections, [TYPENAME_FIELD]) - }); - } - } - }); -} - -var connectionRemoveConfig = { - test: function (directive) { - var willRemove = directive.name.value === 'connection'; - - if (willRemove) { - if (!directive.arguments || !directive.arguments.some(function (arg) { - return arg.name.value === 'key'; - })) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Removing an @connection directive even though it does not have a key. ' + 'You may want to use the key parameter to specify a store key.'); - } - } - - return willRemove; - } -}; - -function removeConnectionDirectiveFromDocument(doc) { - return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc)); -} - -function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { - if (nestedCheck === void 0) { - nestedCheck = true; - } - - return selectionSet && selectionSet.selections && selectionSet.selections.some(function (selection) { - return hasDirectivesInSelection(directives, selection, nestedCheck); - }); -} - -function hasDirectivesInSelection(directives, selection, nestedCheck) { - if (nestedCheck === void 0) { - nestedCheck = true; - } - - if (!isField(selection)) { - return true; - } - - if (!selection.directives) { - return false; - } - - return selection.directives.some(getDirectiveMatcher(directives)) || nestedCheck && hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck); -} - -function getDirectivesFromDocument(directives, doc) { - checkDocument(doc); - var parentPath; - return nullIfDocIsEmpty((0, _visitor.visit)(doc, { - SelectionSet: { - enter: function (node, _key, _parent, path) { - var currentPath = path.join('-'); - - if (!parentPath || currentPath === parentPath || !currentPath.startsWith(parentPath)) { - if (node.selections) { - var selectionsWithDirectives = node.selections.filter(function (selection) { - return hasDirectivesInSelection(directives, selection); - }); - - if (hasDirectivesInSelectionSet(directives, node, false)) { - parentPath = currentPath; - } - - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - selections: selectionsWithDirectives - }); - } else { - return null; - } - } - } - } - })); -} - -function getArgumentMatcher(config) { - return function argumentMatcher(argument) { - return config.some(function (aConfig) { - return argument.value && argument.value.kind === 'Variable' && argument.value.name && (aConfig.name === argument.value.name.value || aConfig.test && aConfig.test(argument)); - }); - }; -} - -function removeArgumentsFromDocument(config, doc) { - var argMatcher = getArgumentMatcher(config); - return nullIfDocIsEmpty((0, _visitor.visit)(doc, { - OperationDefinition: { - enter: function (node) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - variableDefinitions: node.variableDefinitions.filter(function (varDef) { - return !config.some(function (arg) { - return arg.name === varDef.variable.name.value; - }); - }) - }); - } - }, - Field: { - enter: function (node) { - var shouldRemoveField = config.some(function (argConfig) { - return argConfig.remove; - }); - - if (shouldRemoveField) { - var argMatchCount_1 = 0; - node.arguments.forEach(function (arg) { - if (argMatcher(arg)) { - argMatchCount_1 += 1; - } - }); - - if (argMatchCount_1 === 1) { - return null; - } - } - } - }, - Argument: { - enter: function (node) { - if (argMatcher(node)) { - return null; - } - } - } - })); -} - -function removeFragmentSpreadFromDocument(config, doc) { - function enter(node) { - if (config.some(function (def) { - return def.name === node.name.value; - })) { - return null; - } - } - - return nullIfDocIsEmpty((0, _visitor.visit)(doc, { - FragmentSpread: { - enter: enter - }, - FragmentDefinition: { - enter: enter - } - })); -} - -function getAllFragmentSpreadsFromSelectionSet(selectionSet) { - var allFragments = []; - selectionSet.selections.forEach(function (selection) { - if ((isField(selection) || isInlineFragment(selection)) && selection.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { - return allFragments.push(frag); - }); - } else if (selection.kind === 'FragmentSpread') { - allFragments.push(selection); - } - }); - return allFragments; -} - -function buildQueryFromSelectionSet(document) { - var definition = getMainDefinition(document); - var definitionOperation = definition.operation; - - if (definitionOperation === 'query') { - return document; - } - - var modifiedDoc = (0, _visitor.visit)(document, { - OperationDefinition: { - enter: function (node) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - operation: 'query' - }); - } - } - }); - return modifiedDoc; -} - -function removeClientSetsFromDocument(document) { - checkDocument(document); - var modifiedDoc = removeDirectivesFromDocument([{ - test: function (directive) { - return directive.name.value === 'client'; - }, - remove: true - }], document); - - if (modifiedDoc) { - modifiedDoc = (0, _visitor.visit)(modifiedDoc, { - FragmentDefinition: { - enter: function (node) { - if (node.selectionSet) { - var isTypenameOnly = node.selectionSet.selections.every(function (selection) { - return isField(selection) && selection.name.value === '__typename'; - }); - - if (isTypenameOnly) { - return null; - } - } - } - } - }); - } - - return modifiedDoc; -} - -var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && navigator.product === 'ReactNative'); -exports.canUseWeakMap = canUseWeakMap; -var toString = Object.prototype.toString; - -function cloneDeep(value) { - return cloneDeepHelper(value, new Map()); -} - -function cloneDeepHelper(val, seen) { - switch (toString.call(val)) { - case "[object Array]": - { - if (seen.has(val)) return seen.get(val); - var copy_1 = val.slice(0); - seen.set(val, copy_1); - copy_1.forEach(function (child, i) { - copy_1[i] = cloneDeepHelper(child, seen); - }); - return copy_1; - } - - case "[object Object]": - { - if (seen.has(val)) return seen.get(val); - var copy_2 = Object.create(Object.getPrototypeOf(val)); - seen.set(val, copy_2); - Object.keys(val).forEach(function (key) { - copy_2[key] = cloneDeepHelper(val[key], seen); - }); - return copy_2; - } - - default: - return val; - } -} - -function getEnv() { - if (typeof process !== 'undefined' && process.env.NODE_ENV) { - return process.env.NODE_ENV; - } - - return 'development'; -} - -function isEnv(env) { - return getEnv() === env; -} - -function isProduction() { - return isEnv('production') === true; -} - -function isDevelopment() { - return isEnv('development') === true; -} - -function isTest() { - return isEnv('test') === true; -} - -function tryFunctionOrLogError(f) { - try { - return f(); - } catch (e) { - if (console.error) { - console.error(e); - } - } -} - -function graphQLResultHasError(result) { - return result.errors && result.errors.length; -} - -function deepFreeze(o) { - Object.freeze(o); - Object.getOwnPropertyNames(o).forEach(function (prop) { - if (o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop])) { - deepFreeze(o[prop]); - } - }); - return o; -} - -function maybeDeepFreeze(obj) { - if (isDevelopment() || isTest()) { - var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; - - if (!symbolIsPolyfilled) { - return deepFreeze(obj); - } - } - - return obj; -} - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function mergeDeep() { - var sources = []; - - for (var _i = 0; _i < arguments.length; _i++) { - sources[_i] = arguments[_i]; - } - - return mergeDeepArray(sources); -} - -function mergeDeepArray(sources) { - var target = sources[0] || {}; - var count = sources.length; - - if (count > 1) { - var pastCopies = []; - target = shallowCopyForMerge(target, pastCopies); - - for (var i = 1; i < count; ++i) { - target = mergeHelper(target, sources[i], pastCopies); - } - } - - return target; -} - -function isObject(obj) { - return obj !== null && typeof obj === 'object'; -} - -function mergeHelper(target, source, pastCopies) { - if (isObject(source) && isObject(target)) { - if (Object.isExtensible && !Object.isExtensible(target)) { - target = shallowCopyForMerge(target, pastCopies); - } - - Object.keys(source).forEach(function (sourceKey) { - var sourceValue = source[sourceKey]; - - if (hasOwnProperty.call(target, sourceKey)) { - var targetValue = target[sourceKey]; - - if (sourceValue !== targetValue) { - target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); - } - } else { - target[sourceKey] = sourceValue; - } - }); - return target; - } - - return source; -} - -function shallowCopyForMerge(value, pastCopies) { - if (value !== null && typeof value === 'object' && pastCopies.indexOf(value) < 0) { - if (Array.isArray(value)) { - value = value.slice(0); - } else { - value = (0, _tslib.__assign)({ - __proto__: Object.getPrototypeOf(value) - }, value); - } - - pastCopies.push(value); - } - - return value; -} - -var haveWarned = Object.create({}); - -function warnOnceInDevelopment(msg, type) { - if (type === void 0) { - type = 'warn'; - } - - if (!isProduction() && !haveWarned[msg]) { - if (!isTest()) { - haveWarned[msg] = true; - } - - if (type === 'error') { - console.error(msg); - } else { - console.warn(msg); - } - } -} - -function stripSymbols(data) { - return JSON.parse(JSON.stringify(data)); -} diff --git a/node_modules/apollo-utilities/lib/bundle.cjs.js.map b/node_modules/apollo-utilities/lib/bundle.cjs.js.map deleted file mode 100644 index a445ea6..0000000 --- a/node_modules/apollo-utilities/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/storeUtils.ts","../src/directives.ts","../src/fragments.ts","../src/util/assign.ts","../src/getFromAST.ts","../src/util/filterInPlace.ts","../src/transform.ts","../src/util/canUse.ts","../src/util/cloneDeep.ts","../src/util/environment.ts","../src/util/errorHandling.ts","../src/util/maybeDeepFreeze.ts","../src/util/mergeDeep.ts","../src/util/warnOnce.ts","../src/util/stripSymbols.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAiDgB,a,CAAc,K,EAAgB;AAC5C,SAAO,CAAC,aAAD,EAAgB,cAAhB,EAAgC,WAAhC,EAA6C,OAA7C,CAAqD,KAAK,CAAC,IAA3D,IAAmE,CAAC,CAA3E;AACD;;AAID,SAAgB,aAAhB,CAA8B,KAA9B,EAA8C;AAC5C,SAAO,CAAC,UAAD,EAAa,YAAb,EAA2B,OAA3B,CAAmC,KAAK,CAAC,IAAzC,IAAiD,CAAC,CAAzD;AACD;;AAED,SAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,SAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;AACD;;AAED,SAAS,cAAT,CAAwB,KAAxB,EAAwC;AACtC,SAAO,KAAK,CAAC,IAAN,KAAe,cAAtB;AACD;;AAED,SAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,SAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,SAAS,YAAT,CAAsB,KAAtB,EAAsC;AACpC,SAAO,KAAK,CAAC,IAAN,KAAe,YAAtB;AACD;;AAED,SAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,SAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,SAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,SAAO,KAA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,MAAP,CAAc,EAAd,CAAnB;;AAUA,SAAgB,qBAAhB,CAAsC,GAAtC,EAAmD,IAAnD,EAAgE;AAAb,MAAA,IAAA,KAAA,KAAA,CAAA,EAAA;AAAA,IAAA,IAAA,GAAA,MAAA;AAAa;;AAC9D,MAAI,CAAC,YAAY,EAAb,IAAmB,CAAC,UAAU,CAAC,GAAD,CAAlC,EAAyC;AACvC,QAAI,CAAC,MAAM,EAAX,EAAe;AACb,MAAA,UAAU,CAAC,GAAD,CAAV,GAAkB,IAAlB;AACD;;AACD,QAAI,IAAI,KAAK,OAAb,EAAsB;AACpB,MAAA,OAAO,CAAC,KAAR,CAAc,GAAd;AACD,KAFD,MAEO;AACL,MAAA,OAAO,CAAC,IAAR,CAAa,GAAb;AACD;AACF;AACF;;SCZe,Y,CAAgB,I,EAAO;AACrC,SAAO,IAAI,CAAC,KAAL,CAAW,IAAI,CAAC,SAAL,CAAe,IAAf,CAAX,CAAP;AACD,C","sourcesContent":["import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n return getInclusionDirectives(\n selection.directives,\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray,\n): InclusionDirectives {\n return directives ? directives.filter(isInclusionDirective).map(directive => {\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n return { directive, ifArgument };\n }) : [];\n}\n\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","export function filterInPlace(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\nimport { invariant } from 'ts-invariant';\nimport { isField, isInlineFragment } from './storeUtils';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","import { isDevelopment, isTest } from './environment';\n\n// Taken (mostly) from https://github.com/substack/deep-freeze to avoid\n// import hassles with rollup.\nfunction deepFreeze(o: any) {\n Object.freeze(o);\n\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])\n ) {\n deepFreeze(o[prop]);\n }\n });\n\n return o;\n}\n\nexport function maybeDeepFreeze(obj: any) {\n if (isDevelopment() || isTest()) {\n // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing\n // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043).\n const symbolIsPolyfilled =\n typeof Symbol === 'function' && typeof Symbol('') === 'string';\n\n if (!symbolIsPolyfilled) {\n return deepFreeze(obj);\n }\n }\n return obj;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { isProduction, isTest } from './environment';\n\nconst haveWarned = Object.create({});\n\n/**\n * Print a warning only once in development.\n * In production no warnings are printed.\n * In test all warnings are printed.\n *\n * @param msg The warning message\n * @param type warn or error (will call console.warn or console.error)\n */\nexport function warnOnceInDevelopment(msg: string, type = 'warn') {\n if (!isProduction() && !haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n if (type === 'error') {\n console.error(msg);\n } else {\n console.warn(msg);\n }\n }\n}\n","/**\n * In order to make assertions easier, this function strips `symbol`'s from\n * the incoming data.\n *\n * This can be handy when running tests against `apollo-client` for example,\n * since it adds `symbol`'s to the data in the store. Jest's `toEqual`\n * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),\n * which means all test data used in a `toEqual` comparison would also have to\n * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data\n * we can compare against more simplified test data.\n */\nexport function stripSymbols(data: T): T {\n return JSON.parse(JSON.stringify(data));\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/bundle.cjs.min.js b/node_modules/apollo-utilities/lib/bundle.cjs.min.js deleted file mode 100644 index a7ed4e2..0000000 --- a/node_modules/apollo-utilities/lib/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -exports.__esModule=!0,exports.addTypenameToDocument=function(e){return(0,n.visit)(y(e),{SelectionSet:{enter:function(e,n,t){if(!t||"OperationDefinition"!==t.kind){var i=e.selections;if(i){var o=i.some(function(e){return f(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))});if(!o){var a=t;if(!(f(a)&&a.directives&&a.directives.some(function(e){return"export"===e.name.value})))return(0,r.__assign)((0,r.__assign)({},e),{selections:(0,r.__spreadArrays)(i,[_])})}}}}}})},exports.argumentsObjectFromField=s,exports.assign=x,exports.buildQueryFromSelectionSet=function(e){if("query"===k(e).operation)return e;return(0,n.visit)(e,{OperationDefinition:{enter:function(e){return(0,r.__assign)((0,r.__assign)({},e),{operation:"query"})}}})},exports.checkDocument=y,exports.cloneDeep=function(e){return function e(n,t){switch(M.call(n)){case"[object Array]":if(t.has(n))return t.get(n);var r=n.slice(0);return t.set(n,r),r.forEach(function(n,i){r[i]=e(n,t)}),r;case"[object Object]":if(t.has(n))return t.get(n);var i=Object.create(Object.getPrototypeOf(n));return t.set(n,i),Object.keys(n).forEach(function(r){i[r]=e(n[r],t)}),i;default:return n}}(e,new Map)},exports.createFragmentMap=O,exports.getDefaultValues=function(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var n=e.variableDefinitions.filter(function(e){var n=e.defaultValue;return n}).map(function(e){var n=e.variable,t=e.defaultValue,r={};return a(r,n.name,t),r});return x.apply(void 0,(0,r.__spreadArrays)([{}],n))}return{}},exports.getDirectiveInfoFromField=function(e,n){if(e.directives&&e.directives.length){var t={};return e.directives.forEach(function(e){t[e.name.value]=s(e,n)}),t}return null},exports.getDirectiveNames=m,exports.getDirectivesFromDocument=function(e,t){var i;return y(t),E((0,n.visit)(t,{SelectionSet:{enter:function(n,t,o,a){var u=a.join("-");if(!i||u===i||!u.startsWith(i)){if(n.selections){var c=n.selections.filter(function(n){return I(e,n)});return w(e,n,!1)&&(i=u),(0,r.__assign)((0,r.__assign)({},n),{selections:c})}return null}}}}))},exports.getEnv=J,exports.getFragmentDefinition=D,exports.getFragmentDefinitions=b,exports.getFragmentQueryDocument=function(e,n){var i=n,o=[];e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new t.InvariantError(11);"FragmentDefinition"===e.kind&&o.push(e)}),void 0===i&&((0,t.invariant)(1===o.length,12),i=o[0].name.value);return(0,r.__assign)((0,r.__assign)({},e),{definitions:(0,r.__spreadArrays)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:i}}]}}],e.definitions)})},exports.getInclusionDirectives=g,exports.getMainDefinition=k,exports.getMutationDefinition=function(e){y(e);var n=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})[0];return(0,t.invariant)(n,1),n},exports.getOperationDefinition=h,exports.getOperationDefinitionOrDie=function(e){var n=h(e);return(0,t.invariant)(n,5),n},exports.getOperationName=function(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null},exports.getQueryDefinition=function(e){var n=h(e);return(0,t.invariant)(n&&"query"===n.operation,6),n},exports.getStoreKeyName=c,exports.graphQLResultHasError=function(e){return e.errors&&e.errors.length},exports.hasClientExports=function(e){return e&&p(["client"],e)&&p(["export"],e)},exports.hasDirectives=p,exports.isDevelopment=Q,exports.isEnv=P,exports.isField=f,exports.isIdValue=function(e){return e&&"id"===e.type&&"boolean"==typeof e.generated},exports.isInlineFragment=l,exports.isJsonValue=function(e){return null!=e&&"object"==typeof e&&"json"===e.type},exports.isNumberValue=function(e){return["IntValue","FloatValue"].indexOf(e.kind)>-1},exports.isProduction=L,exports.isScalarValue=function(e){return["StringValue","BooleanValue","EnumValue"].indexOf(e.kind)>-1},exports.isTest=T,exports.maybeDeepFreeze=function(e){if(Q()||T()){var n="function"==typeof Symbol&&"string"==typeof Symbol("");if(!n)return function e(n){Object.freeze(n);Object.getOwnPropertyNames(n).forEach(function(t){null===n[t]||"object"!=typeof n[t]&&"function"!=typeof n[t]||Object.isFrozen(n[t])||e(n[t])});return n}(e)}return e},exports.mergeDeep=function(){for(var e=[],n=0;n0){var r=t.connection.filter?t.connection.filter:[];r.sort();var o=n,a={};return r.forEach(function(e){a[e]=o[e]}),t.connection.key+"("+JSON.stringify(a)+")"}return t.connection.key}var c=e;if(n){var s=(0,i.default)(n);c+="("+s+")"}return t&&Object.keys(t).forEach(function(e){-1===u.indexOf(e)&&(t[e]&&Object.keys(t[e]).length?c+="@"+e+"("+JSON.stringify(t[e])+")":c+="@"+e)}),c}function s(e,n){if(e.arguments&&e.arguments.length){var t={};return e.arguments.forEach(function(e){var r=e.name,i=e.value;return a(t,r,i,n)}),t}return null}function f(e){return"Field"===e.kind}function l(e){return"InlineFragment"===e.kind}function v(e){throw new t.InvariantError(18)}function m(e){var t=[];return(0,n.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}function p(e,n){return m(n).some(function(n){return e.indexOf(n)>-1})}function d(e){var n=e.name.value;return"skip"===n||"include"===n}function g(e){return e?e.filter(d).map(function(e){var n=e.arguments;e.name.value;(0,t.invariant)(n&&1===n.length,14);var r=n[0];(0,t.invariant)(r.name&&"if"===r.name.value,15);var i=r.value;return(0,t.invariant)(i&&("Variable"===i.kind||"BooleanValue"===i.kind),16),{directive:e,ifArgument:r}}):[]}function x(e){for(var n=[],t=1;t1){var r=[];n=K(n,r);for(var i=1;i -1; -} -function isNumberValue(value) { - return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; -} -function isStringValue(value) { - return value.kind === 'StringValue'; -} -function isBooleanValue(value) { - return value.kind === 'BooleanValue'; -} -function isIntValue(value) { - return value.kind === 'IntValue'; -} -function isFloatValue(value) { - return value.kind === 'FloatValue'; -} -function isVariable(value) { - return value.kind === 'Variable'; -} -function isObjectValue(value) { - return value.kind === 'ObjectValue'; -} -function isListValue(value) { - return value.kind === 'ListValue'; -} -function isEnumValue(value) { - return value.kind === 'EnumValue'; -} -function isNullValue(value) { - return value.kind === 'NullValue'; -} -function valueToObjectRepresentation(argObj, name, value, variables) { - if (isIntValue(value) || isFloatValue(value)) { - argObj[name.value] = Number(value.value); - } - else if (isBooleanValue(value) || isStringValue(value)) { - argObj[name.value] = value.value; - } - else if (isObjectValue(value)) { - var nestedArgObj_1 = {}; - value.fields.map(function (obj) { - return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); - }); - argObj[name.value] = nestedArgObj_1; - } - else if (isVariable(value)) { - var variableValue = (variables || {})[value.name.value]; - argObj[name.value] = variableValue; - } - else if (isListValue(value)) { - argObj[name.value] = value.values.map(function (listValue) { - var nestedArgArrayObj = {}; - valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); - return nestedArgArrayObj[name.value]; - }); - } - else if (isEnumValue(value)) { - argObj[name.value] = value.value; - } - else if (isNullValue(value)) { - argObj[name.value] = null; - } - else { - throw process.env.NODE_ENV === "production" ? new InvariantError(17) : new InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + - 'is not supported. Use variables instead of inline arguments to ' + - 'overcome this limitation.'); - } -} -function storeKeyNameFromField(field, variables) { - var directivesObj = null; - if (field.directives) { - directivesObj = {}; - field.directives.forEach(function (directive) { - directivesObj[directive.name.value] = {}; - if (directive.arguments) { - directive.arguments.forEach(function (_a) { - var name = _a.name, value = _a.value; - return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); - }); - } - }); - } - var argObj = null; - if (field.arguments && field.arguments.length) { - argObj = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, value = _a.value; - return valueToObjectRepresentation(argObj, name, value, variables); - }); - } - return getStoreKeyName(field.name.value, argObj, directivesObj); -} -var KNOWN_DIRECTIVES = [ - 'connection', - 'include', - 'skip', - 'client', - 'rest', - 'export', -]; -function getStoreKeyName(fieldName, args, directives) { - if (directives && - directives['connection'] && - directives['connection']['key']) { - if (directives['connection']['filter'] && - directives['connection']['filter'].length > 0) { - var filterKeys = directives['connection']['filter'] - ? directives['connection']['filter'] - : []; - filterKeys.sort(); - var queryArgs_1 = args; - var filteredArgs_1 = {}; - filterKeys.forEach(function (key) { - filteredArgs_1[key] = queryArgs_1[key]; - }); - return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; - } - else { - return directives['connection']['key']; - } - } - var completeFieldName = fieldName; - if (args) { - var stringifiedArgs = stringify(args); - completeFieldName += "(" + stringifiedArgs + ")"; - } - if (directives) { - Object.keys(directives).forEach(function (key) { - if (KNOWN_DIRECTIVES.indexOf(key) !== -1) - return; - if (directives[key] && Object.keys(directives[key]).length) { - completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; - } - else { - completeFieldName += "@" + key; - } - }); - } - return completeFieldName; -} -function argumentsObjectFromField(field, variables) { - if (field.arguments && field.arguments.length) { - var argObj_1 = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, value = _a.value; - return valueToObjectRepresentation(argObj_1, name, value, variables); - }); - return argObj_1; - } - return null; -} -function resultKeyNameFromField(field) { - return field.alias ? field.alias.value : field.name.value; -} -function isField(selection) { - return selection.kind === 'Field'; -} -function isInlineFragment(selection) { - return selection.kind === 'InlineFragment'; -} -function isIdValue(idObject) { - return idObject && - idObject.type === 'id' && - typeof idObject.generated === 'boolean'; -} -function toIdValue(idConfig, generated) { - if (generated === void 0) { generated = false; } - return __assign({ type: 'id', generated: generated }, (typeof idConfig === 'string' - ? { id: idConfig, typename: undefined } - : idConfig)); -} -function isJsonValue(jsonObject) { - return (jsonObject != null && - typeof jsonObject === 'object' && - jsonObject.type === 'json'); -} -function defaultValueFromVariable(node) { - throw process.env.NODE_ENV === "production" ? new InvariantError(18) : new InvariantError("Variable nodes are not supported by valueFromNode"); -} -function valueFromNode(node, onVariable) { - if (onVariable === void 0) { onVariable = defaultValueFromVariable; } - switch (node.kind) { - case 'Variable': - return onVariable(node); - case 'NullValue': - return null; - case 'IntValue': - return parseInt(node.value, 10); - case 'FloatValue': - return parseFloat(node.value); - case 'ListValue': - return node.values.map(function (v) { return valueFromNode(v, onVariable); }); - case 'ObjectValue': { - var value = {}; - for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { - var field = _a[_i]; - value[field.name.value] = valueFromNode(field.value, onVariable); - } - return value; - } - default: - return node.value; - } -} - -function getDirectiveInfoFromField(field, variables) { - if (field.directives && field.directives.length) { - var directiveObj_1 = {}; - field.directives.forEach(function (directive) { - directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables); - }); - return directiveObj_1; - } - return null; -} -function shouldInclude(selection, variables) { - if (variables === void 0) { variables = {}; } - return getInclusionDirectives(selection.directives).every(function (_a) { - var directive = _a.directive, ifArgument = _a.ifArgument; - var evaledValue = false; - if (ifArgument.value.kind === 'Variable') { - evaledValue = variables[ifArgument.value.name.value]; - process.env.NODE_ENV === "production" ? invariant(evaledValue !== void 0, 13) : invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); - } - else { - evaledValue = ifArgument.value.value; - } - return directive.name.value === 'skip' ? !evaledValue : evaledValue; - }); -} -function getDirectiveNames(doc) { - var names = []; - visit(doc, { - Directive: function (node) { - names.push(node.name.value); - }, - }); - return names; -} -function hasDirectives(names, doc) { - return getDirectiveNames(doc).some(function (name) { return names.indexOf(name) > -1; }); -} -function hasClientExports(document) { - return (document && - hasDirectives(['client'], document) && - hasDirectives(['export'], document)); -} -function isInclusionDirective(_a) { - var value = _a.name.value; - return value === 'skip' || value === 'include'; -} -function getInclusionDirectives(directives) { - return directives ? directives.filter(isInclusionDirective).map(function (directive) { - var directiveArguments = directive.arguments; - var directiveName = directive.name.value; - process.env.NODE_ENV === "production" ? invariant(directiveArguments && directiveArguments.length === 1, 14) : invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); - var ifArgument = directiveArguments[0]; - process.env.NODE_ENV === "production" ? invariant(ifArgument.name && ifArgument.name.value === 'if', 15) : invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); - var ifValue = ifArgument.value; - process.env.NODE_ENV === "production" ? invariant(ifValue && - (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 16) : invariant(ifValue && - (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); - return { directive: directive, ifArgument: ifArgument }; - }) : []; -} - -function getFragmentQueryDocument(document, fragmentName) { - var actualFragmentName = fragmentName; - var fragments = []; - document.definitions.forEach(function (definition) { - if (definition.kind === 'OperationDefinition') { - throw process.env.NODE_ENV === "production" ? new InvariantError(11) : new InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + - 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); - } - if (definition.kind === 'FragmentDefinition') { - fragments.push(definition); - } - }); - if (typeof actualFragmentName === 'undefined') { - process.env.NODE_ENV === "production" ? invariant(fragments.length === 1, 12) : invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); - actualFragmentName = fragments[0].name.value; - } - var query = __assign(__assign({}, document), { definitions: __spreadArrays([ - { - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName, - }, - }, - ], - }, - } - ], document.definitions) }); - return query; -} - -function assign(target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - sources.forEach(function (source) { - if (typeof source === 'undefined' || source === null) { - return; - } - Object.keys(source).forEach(function (key) { - target[key] = source[key]; - }); - }); - return target; -} - -function getMutationDefinition(doc) { - checkDocument(doc); - var mutationDef = doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition' && - definition.operation === 'mutation'; - })[0]; - process.env.NODE_ENV === "production" ? invariant(mutationDef, 1) : invariant(mutationDef, 'Must contain a mutation definition.'); - return mutationDef; -} -function checkDocument(doc) { - process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 2) : invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - var operations = doc.definitions - .filter(function (d) { return d.kind !== 'FragmentDefinition'; }) - .map(function (definition) { - if (definition.kind !== 'OperationDefinition') { - throw process.env.NODE_ENV === "production" ? new InvariantError(3) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); - } - return definition; - }); - process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 4) : invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); - return doc; -} -function getOperationDefinition(doc) { - checkDocument(doc); - return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0]; -} -function getOperationDefinitionOrDie(document) { - var def = getOperationDefinition(document); - process.env.NODE_ENV === "production" ? invariant(def, 5) : invariant(def, "GraphQL document is missing an operation"); - return def; -} -function getOperationName(doc) { - return (doc.definitions - .filter(function (definition) { - return definition.kind === 'OperationDefinition' && definition.name; - }) - .map(function (x) { return x.name.value; })[0] || null); -} -function getFragmentDefinitions(doc) { - return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; }); -} -function getQueryDefinition(doc) { - var queryDef = getOperationDefinition(doc); - process.env.NODE_ENV === "production" ? invariant(queryDef && queryDef.operation === 'query', 6) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); - return queryDef; -} -function getFragmentDefinition(doc) { - process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 7) : invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - process.env.NODE_ENV === "production" ? invariant(doc.definitions.length <= 1, 8) : invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); - var fragmentDef = doc.definitions[0]; - process.env.NODE_ENV === "production" ? invariant(fragmentDef.kind === 'FragmentDefinition', 9) : invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); - return fragmentDef; -} -function getMainDefinition(queryDoc) { - checkDocument(queryDoc); - var fragmentDefinition; - for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { - var definition = _a[_i]; - if (definition.kind === 'OperationDefinition') { - var operation = definition.operation; - if (operation === 'query' || - operation === 'mutation' || - operation === 'subscription') { - return definition; - } - } - if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { - fragmentDefinition = definition; - } - } - if (fragmentDefinition) { - return fragmentDefinition; - } - throw process.env.NODE_ENV === "production" ? new InvariantError(10) : new InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); -} -function createFragmentMap(fragments) { - if (fragments === void 0) { fragments = []; } - var symTable = {}; - fragments.forEach(function (fragment) { - symTable[fragment.name.value] = fragment; - }); - return symTable; -} -function getDefaultValues(definition) { - if (definition && - definition.variableDefinitions && - definition.variableDefinitions.length) { - var defaultValues = definition.variableDefinitions - .filter(function (_a) { - var defaultValue = _a.defaultValue; - return defaultValue; - }) - .map(function (_a) { - var variable = _a.variable, defaultValue = _a.defaultValue; - var defaultValueObj = {}; - valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); - return defaultValueObj; - }); - return assign.apply(void 0, __spreadArrays([{}], defaultValues)); - } - return {}; -} -function variablesInOperation(operation) { - var names = new Set(); - if (operation.variableDefinitions) { - for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { - var definition = _a[_i]; - names.add(definition.variable.name.value); - } - } - return names; -} - -function filterInPlace(array, test, context) { - var target = 0; - array.forEach(function (elem, i) { - if (test.call(this, elem, i, array)) { - array[target++] = elem; - } - }, context); - array.length = target; - return array; -} - -var TYPENAME_FIELD = { - kind: 'Field', - name: { - kind: 'Name', - value: '__typename', - }, -}; -function isEmpty(op, fragments) { - return op.selectionSet.selections.every(function (selection) { - return selection.kind === 'FragmentSpread' && - isEmpty(fragments[selection.name.value], fragments); - }); -} -function nullIfDocIsEmpty(doc) { - return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc))) - ? null - : doc; -} -function getDirectiveMatcher(directives) { - return function directiveMatcher(directive) { - return directives.some(function (dir) { - return (dir.name && dir.name === directive.name.value) || - (dir.test && dir.test(directive)); - }); - }; -} -function removeDirectivesFromDocument(directives, doc) { - var variablesInUse = Object.create(null); - var variablesToRemove = []; - var fragmentSpreadsInUse = Object.create(null); - var fragmentSpreadsToRemove = []; - var modifiedDoc = nullIfDocIsEmpty(visit(doc, { - Variable: { - enter: function (node, _key, parent) { - if (parent.kind !== 'VariableDefinition') { - variablesInUse[node.name.value] = true; - } - }, - }, - Field: { - enter: function (node) { - if (directives && node.directives) { - var shouldRemoveField = directives.some(function (directive) { return directive.remove; }); - if (shouldRemoveField && - node.directives && - node.directives.some(getDirectiveMatcher(directives))) { - if (node.arguments) { - node.arguments.forEach(function (arg) { - if (arg.value.kind === 'Variable') { - variablesToRemove.push({ - name: arg.value.name.value, - }); - } - }); - } - if (node.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { - fragmentSpreadsToRemove.push({ - name: frag.name.value, - }); - }); - } - return null; - } - } - }, - }, - FragmentSpread: { - enter: function (node) { - fragmentSpreadsInUse[node.name.value] = true; - }, - }, - Directive: { - enter: function (node) { - if (getDirectiveMatcher(directives)(node)) { - return null; - } - }, - }, - })); - if (modifiedDoc && - filterInPlace(variablesToRemove, function (v) { return !variablesInUse[v.name]; }).length) { - modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); - } - if (modifiedDoc && - filterInPlace(fragmentSpreadsToRemove, function (fs) { return !fragmentSpreadsInUse[fs.name]; }) - .length) { - modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); - } - return modifiedDoc; -} -function addTypenameToDocument(doc) { - return visit(checkDocument(doc), { - SelectionSet: { - enter: function (node, _key, parent) { - if (parent && - parent.kind === 'OperationDefinition') { - return; - } - var selections = node.selections; - if (!selections) { - return; - } - var skip = selections.some(function (selection) { - return (isField(selection) && - (selection.name.value === '__typename' || - selection.name.value.lastIndexOf('__', 0) === 0)); - }); - if (skip) { - return; - } - var field = parent; - if (isField(field) && - field.directives && - field.directives.some(function (d) { return d.name.value === 'export'; })) { - return; - } - return __assign(__assign({}, node), { selections: __spreadArrays(selections, [TYPENAME_FIELD]) }); - }, - }, - }); -} -var connectionRemoveConfig = { - test: function (directive) { - var willRemove = directive.name.value === 'connection'; - if (willRemove) { - if (!directive.arguments || - !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) { - process.env.NODE_ENV === "production" || invariant.warn('Removing an @connection directive even though it does not have a key. ' + - 'You may want to use the key parameter to specify a store key.'); - } - } - return willRemove; - }, -}; -function removeConnectionDirectiveFromDocument(doc) { - return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc)); -} -function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { - if (nestedCheck === void 0) { nestedCheck = true; } - return (selectionSet && - selectionSet.selections && - selectionSet.selections.some(function (selection) { - return hasDirectivesInSelection(directives, selection, nestedCheck); - })); -} -function hasDirectivesInSelection(directives, selection, nestedCheck) { - if (nestedCheck === void 0) { nestedCheck = true; } - if (!isField(selection)) { - return true; - } - if (!selection.directives) { - return false; - } - return (selection.directives.some(getDirectiveMatcher(directives)) || - (nestedCheck && - hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck))); -} -function getDirectivesFromDocument(directives, doc) { - checkDocument(doc); - var parentPath; - return nullIfDocIsEmpty(visit(doc, { - SelectionSet: { - enter: function (node, _key, _parent, path) { - var currentPath = path.join('-'); - if (!parentPath || - currentPath === parentPath || - !currentPath.startsWith(parentPath)) { - if (node.selections) { - var selectionsWithDirectives = node.selections.filter(function (selection) { return hasDirectivesInSelection(directives, selection); }); - if (hasDirectivesInSelectionSet(directives, node, false)) { - parentPath = currentPath; - } - return __assign(__assign({}, node), { selections: selectionsWithDirectives }); - } - else { - return null; - } - } - }, - }, - })); -} -function getArgumentMatcher(config) { - return function argumentMatcher(argument) { - return config.some(function (aConfig) { - return argument.value && - argument.value.kind === 'Variable' && - argument.value.name && - (aConfig.name === argument.value.name.value || - (aConfig.test && aConfig.test(argument))); - }); - }; -} -function removeArgumentsFromDocument(config, doc) { - var argMatcher = getArgumentMatcher(config); - return nullIfDocIsEmpty(visit(doc, { - OperationDefinition: { - enter: function (node) { - return __assign(__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) { - return !config.some(function (arg) { return arg.name === varDef.variable.name.value; }); - }) }); - }, - }, - Field: { - enter: function (node) { - var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; }); - if (shouldRemoveField) { - var argMatchCount_1 = 0; - node.arguments.forEach(function (arg) { - if (argMatcher(arg)) { - argMatchCount_1 += 1; - } - }); - if (argMatchCount_1 === 1) { - return null; - } - } - }, - }, - Argument: { - enter: function (node) { - if (argMatcher(node)) { - return null; - } - }, - }, - })); -} -function removeFragmentSpreadFromDocument(config, doc) { - function enter(node) { - if (config.some(function (def) { return def.name === node.name.value; })) { - return null; - } - } - return nullIfDocIsEmpty(visit(doc, { - FragmentSpread: { enter: enter }, - FragmentDefinition: { enter: enter }, - })); -} -function getAllFragmentSpreadsFromSelectionSet(selectionSet) { - var allFragments = []; - selectionSet.selections.forEach(function (selection) { - if ((isField(selection) || isInlineFragment(selection)) && - selection.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); }); - } - else if (selection.kind === 'FragmentSpread') { - allFragments.push(selection); - } - }); - return allFragments; -} -function buildQueryFromSelectionSet(document) { - var definition = getMainDefinition(document); - var definitionOperation = definition.operation; - if (definitionOperation === 'query') { - return document; - } - var modifiedDoc = visit(document, { - OperationDefinition: { - enter: function (node) { - return __assign(__assign({}, node), { operation: 'query' }); - }, - }, - }); - return modifiedDoc; -} -function removeClientSetsFromDocument(document) { - checkDocument(document); - var modifiedDoc = removeDirectivesFromDocument([ - { - test: function (directive) { return directive.name.value === 'client'; }, - remove: true, - }, - ], document); - if (modifiedDoc) { - modifiedDoc = visit(modifiedDoc, { - FragmentDefinition: { - enter: function (node) { - if (node.selectionSet) { - var isTypenameOnly = node.selectionSet.selections.every(function (selection) { - return isField(selection) && selection.name.value === '__typename'; - }); - if (isTypenameOnly) { - return null; - } - } - }, - }, - }); - } - return modifiedDoc; -} - -var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && - navigator.product === 'ReactNative'); - -var toString = Object.prototype.toString; -function cloneDeep(value) { - return cloneDeepHelper(value, new Map()); -} -function cloneDeepHelper(val, seen) { - switch (toString.call(val)) { - case "[object Array]": { - if (seen.has(val)) - return seen.get(val); - var copy_1 = val.slice(0); - seen.set(val, copy_1); - copy_1.forEach(function (child, i) { - copy_1[i] = cloneDeepHelper(child, seen); - }); - return copy_1; - } - case "[object Object]": { - if (seen.has(val)) - return seen.get(val); - var copy_2 = Object.create(Object.getPrototypeOf(val)); - seen.set(val, copy_2); - Object.keys(val).forEach(function (key) { - copy_2[key] = cloneDeepHelper(val[key], seen); - }); - return copy_2; - } - default: - return val; - } -} - -function getEnv() { - if (typeof process !== 'undefined' && process.env.NODE_ENV) { - return process.env.NODE_ENV; - } - return 'development'; -} -function isEnv(env) { - return getEnv() === env; -} -function isProduction() { - return isEnv('production') === true; -} -function isDevelopment() { - return isEnv('development') === true; -} -function isTest() { - return isEnv('test') === true; -} - -function tryFunctionOrLogError(f) { - try { - return f(); - } - catch (e) { - if (console.error) { - console.error(e); - } - } -} -function graphQLResultHasError(result) { - return result.errors && result.errors.length; -} - -function deepFreeze(o) { - Object.freeze(o); - Object.getOwnPropertyNames(o).forEach(function (prop) { - if (o[prop] !== null && - (typeof o[prop] === 'object' || typeof o[prop] === 'function') && - !Object.isFrozen(o[prop])) { - deepFreeze(o[prop]); - } - }); - return o; -} -function maybeDeepFreeze(obj) { - if (isDevelopment() || isTest()) { - var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; - if (!symbolIsPolyfilled) { - return deepFreeze(obj); - } - } - return obj; -} - -var hasOwnProperty = Object.prototype.hasOwnProperty; -function mergeDeep() { - var sources = []; - for (var _i = 0; _i < arguments.length; _i++) { - sources[_i] = arguments[_i]; - } - return mergeDeepArray(sources); -} -function mergeDeepArray(sources) { - var target = sources[0] || {}; - var count = sources.length; - if (count > 1) { - var pastCopies = []; - target = shallowCopyForMerge(target, pastCopies); - for (var i = 1; i < count; ++i) { - target = mergeHelper(target, sources[i], pastCopies); - } - } - return target; -} -function isObject(obj) { - return obj !== null && typeof obj === 'object'; -} -function mergeHelper(target, source, pastCopies) { - if (isObject(source) && isObject(target)) { - if (Object.isExtensible && !Object.isExtensible(target)) { - target = shallowCopyForMerge(target, pastCopies); - } - Object.keys(source).forEach(function (sourceKey) { - var sourceValue = source[sourceKey]; - if (hasOwnProperty.call(target, sourceKey)) { - var targetValue = target[sourceKey]; - if (sourceValue !== targetValue) { - target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); - } - } - else { - target[sourceKey] = sourceValue; - } - }); - return target; - } - return source; -} -function shallowCopyForMerge(value, pastCopies) { - if (value !== null && - typeof value === 'object' && - pastCopies.indexOf(value) < 0) { - if (Array.isArray(value)) { - value = value.slice(0); - } - else { - value = __assign({ __proto__: Object.getPrototypeOf(value) }, value); - } - pastCopies.push(value); - } - return value; -} - -var haveWarned = Object.create({}); -function warnOnceInDevelopment(msg, type) { - if (type === void 0) { type = 'warn'; } - if (!isProduction() && !haveWarned[msg]) { - if (!isTest()) { - haveWarned[msg] = true; - } - if (type === 'error') { - console.error(msg); - } - else { - console.warn(msg); - } - } -} - -function stripSymbols(data) { - return JSON.parse(JSON.stringify(data)); -} - -export { addTypenameToDocument, argumentsObjectFromField, assign, buildQueryFromSelectionSet, canUseWeakMap, checkDocument, cloneDeep, createFragmentMap, getDefaultValues, getDirectiveInfoFromField, getDirectiveNames, getDirectivesFromDocument, getEnv, getFragmentDefinition, getFragmentDefinitions, getFragmentQueryDocument, getInclusionDirectives, getMainDefinition, getMutationDefinition, getOperationDefinition, getOperationDefinitionOrDie, getOperationName, getQueryDefinition, getStoreKeyName, graphQLResultHasError, hasClientExports, hasDirectives, isDevelopment, isEnv, isField, isIdValue, isInlineFragment, isJsonValue, isNumberValue, isProduction, isScalarValue, isTest, maybeDeepFreeze, mergeDeep, mergeDeepArray, removeArgumentsFromDocument, removeClientSetsFromDocument, removeConnectionDirectiveFromDocument, removeDirectivesFromDocument, removeFragmentSpreadFromDocument, resultKeyNameFromField, shouldInclude, storeKeyNameFromField, stripSymbols, toIdValue, tryFunctionOrLogError, valueFromNode, valueToObjectRepresentation, variablesInOperation, warnOnceInDevelopment }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/node_modules/apollo-utilities/lib/bundle.esm.js.map b/node_modules/apollo-utilities/lib/bundle.esm.js.map deleted file mode 100644 index 2057809..0000000 --- a/node_modules/apollo-utilities/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/storeUtils.ts","../src/directives.ts","../src/fragments.ts","../src/util/assign.ts","../src/getFromAST.ts","../src/util/filterInPlace.ts","../src/transform.ts","../src/util/canUse.ts","../src/util/cloneDeep.ts","../src/util/environment.ts","../src/util/errorHandling.ts","../src/util/maybeDeepFreeze.ts","../src/util/mergeDeep.ts","../src/util/warnOnce.ts","../src/util/stripSymbols.ts"],"sourcesContent":["import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n return getInclusionDirectives(\n selection.directives,\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray,\n): InclusionDirectives {\n return directives ? directives.filter(isInclusionDirective).map(directive => {\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n return { directive, ifArgument };\n }) : [];\n}\n\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","export function filterInPlace(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\nimport { invariant } from 'ts-invariant';\nimport { isField, isInlineFragment } from './storeUtils';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","import { isDevelopment, isTest } from './environment';\n\n// Taken (mostly) from https://github.com/substack/deep-freeze to avoid\n// import hassles with rollup.\nfunction deepFreeze(o: any) {\n Object.freeze(o);\n\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])\n ) {\n deepFreeze(o[prop]);\n }\n });\n\n return o;\n}\n\nexport function maybeDeepFreeze(obj: any) {\n if (isDevelopment() || isTest()) {\n // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing\n // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043).\n const symbolIsPolyfilled =\n typeof Symbol === 'function' && typeof Symbol('') === 'string';\n\n if (!symbolIsPolyfilled) {\n return deepFreeze(obj);\n }\n }\n return obj;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { isProduction, isTest } from './environment';\n\nconst haveWarned = Object.create({});\n\n/**\n * Print a warning only once in development.\n * In production no warnings are printed.\n * In test all warnings are printed.\n *\n * @param msg The warning message\n * @param type warn or error (will call console.warn or console.error)\n */\nexport function warnOnceInDevelopment(msg: string, type = 'warn') {\n if (!isProduction() && !haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n if (type === 'error') {\n console.error(msg);\n } else {\n console.warn(msg);\n }\n }\n}\n","/**\n * In order to make assertions easier, this function strips `symbol`'s from\n * the incoming data.\n *\n * This can be handy when running tests against `apollo-client` for example,\n * since it adds `symbol`'s to the data in the store. Jest's `toEqual`\n * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),\n * which means all test data used in a `toEqual` comparison would also have to\n * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data\n * we can compare against more simplified test data.\n */\nexport function stripSymbols(data: T): T {\n return JSON.parse(JSON.stringify(data));\n}\n"],"names":[],"mappings":";;;;;;SAiDgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9E;AAID,SAAgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;CAC5D;AAED,SAAS,aAAa,CAAC,KAAgB;IACrC,OAAO,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC;CACrC;AAED,SAAS,cAAc,CAAC,KAAgB;IACtC,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC;CACtC;AAED,SAAS,UAAU,CAAC,KAAgB;IAClC,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;CAClC;AAED,SAAS,YAAY,CAAC,KAAgB;IACpC,OAAO,KAAK,CAAC,IAAI,KAAK,YAA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C,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;CACF;;SCZe,YAAY,CAAI,IAAO;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;CACzC;;;;"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/bundle.umd.js b/node_modules/apollo-utilities/lib/bundle.umd.js deleted file mode 100644 index 4c8a17b..0000000 --- a/node_modules/apollo-utilities/lib/bundle.umd.js +++ /dev/null @@ -1,1131 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(["exports", "graphql/language/visitor", "ts-invariant", "tslib", "fast-json-stable-stringify", "@wry/equality"], factory); - } else if (typeof exports !== "undefined") { - factory(exports, require("graphql/language/visitor"), require("ts-invariant"), require("tslib"), require("fast-json-stable-stringify"), require("@wry/equality")); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.visitor, global.tsInvariant, global.tslib, global.fastJsonStableStringify, global.equality); - global.unknown = mod.exports; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _visitor, _tsInvariant, _tslib, _fastJsonStableStringify, _equality) { - - _exports.__esModule = true; - _exports.addTypenameToDocument = addTypenameToDocument; - _exports.argumentsObjectFromField = argumentsObjectFromField; - _exports.assign = assign; - _exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet; - _exports.checkDocument = checkDocument; - _exports.cloneDeep = cloneDeep; - _exports.createFragmentMap = createFragmentMap; - _exports.getDefaultValues = getDefaultValues; - _exports.getDirectiveInfoFromField = getDirectiveInfoFromField; - _exports.getDirectiveNames = getDirectiveNames; - _exports.getDirectivesFromDocument = getDirectivesFromDocument; - _exports.getEnv = getEnv; - _exports.getFragmentDefinition = getFragmentDefinition; - _exports.getFragmentDefinitions = getFragmentDefinitions; - _exports.getFragmentQueryDocument = getFragmentQueryDocument; - _exports.getInclusionDirectives = getInclusionDirectives; - _exports.getMainDefinition = getMainDefinition; - _exports.getMutationDefinition = getMutationDefinition; - _exports.getOperationDefinition = getOperationDefinition; - _exports.getOperationDefinitionOrDie = getOperationDefinitionOrDie; - _exports.getOperationName = getOperationName; - _exports.getQueryDefinition = getQueryDefinition; - _exports.getStoreKeyName = getStoreKeyName; - _exports.graphQLResultHasError = graphQLResultHasError; - _exports.hasClientExports = hasClientExports; - _exports.hasDirectives = hasDirectives; - _exports.isDevelopment = isDevelopment; - _exports.isEnv = isEnv; - _exports.isField = isField; - _exports.isIdValue = isIdValue; - _exports.isInlineFragment = isInlineFragment; - _exports.isJsonValue = isJsonValue; - _exports.isNumberValue = isNumberValue; - _exports.isProduction = isProduction; - _exports.isScalarValue = isScalarValue; - _exports.isTest = isTest; - _exports.maybeDeepFreeze = maybeDeepFreeze; - _exports.mergeDeep = mergeDeep; - _exports.mergeDeepArray = mergeDeepArray; - _exports.removeArgumentsFromDocument = removeArgumentsFromDocument; - _exports.removeClientSetsFromDocument = removeClientSetsFromDocument; - _exports.removeConnectionDirectiveFromDocument = removeConnectionDirectiveFromDocument; - _exports.removeDirectivesFromDocument = removeDirectivesFromDocument; - _exports.removeFragmentSpreadFromDocument = removeFragmentSpreadFromDocument; - _exports.resultKeyNameFromField = resultKeyNameFromField; - _exports.shouldInclude = shouldInclude; - _exports.storeKeyNameFromField = storeKeyNameFromField; - _exports.stripSymbols = stripSymbols; - _exports.toIdValue = toIdValue; - _exports.tryFunctionOrLogError = tryFunctionOrLogError; - _exports.valueFromNode = valueFromNode; - _exports.valueToObjectRepresentation = valueToObjectRepresentation; - _exports.variablesInOperation = variablesInOperation; - _exports.warnOnceInDevelopment = warnOnceInDevelopment; - _exports.canUseWeakMap = _exports.isEqual = void 0; - _fastJsonStableStringify = _interopRequireDefault(_fastJsonStableStringify); - _exports.isEqual = _equality.equal; - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function isScalarValue(value) { - return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; - } - - function isNumberValue(value) { - return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; - } - - function isStringValue(value) { - return value.kind === 'StringValue'; - } - - function isBooleanValue(value) { - return value.kind === 'BooleanValue'; - } - - function isIntValue(value) { - return value.kind === 'IntValue'; - } - - function isFloatValue(value) { - return value.kind === 'FloatValue'; - } - - function isVariable(value) { - return value.kind === 'Variable'; - } - - function isObjectValue(value) { - return value.kind === 'ObjectValue'; - } - - function isListValue(value) { - return value.kind === 'ListValue'; - } - - function isEnumValue(value) { - return value.kind === 'EnumValue'; - } - - function isNullValue(value) { - return value.kind === 'NullValue'; - } - - function valueToObjectRepresentation(argObj, name, value, variables) { - if (isIntValue(value) || isFloatValue(value)) { - argObj[name.value] = Number(value.value); - } else if (isBooleanValue(value) || isStringValue(value)) { - argObj[name.value] = value.value; - } else if (isObjectValue(value)) { - var nestedArgObj_1 = {}; - value.fields.map(function (obj) { - return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); - }); - argObj[name.value] = nestedArgObj_1; - } else if (isVariable(value)) { - var variableValue = (variables || {})[value.name.value]; - argObj[name.value] = variableValue; - } else if (isListValue(value)) { - argObj[name.value] = value.values.map(function (listValue) { - var nestedArgArrayObj = {}; - valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); - return nestedArgArrayObj[name.value]; - }); - } else if (isEnumValue(value)) { - argObj[name.value] = value.value; - } else if (isNullValue(value)) { - argObj[name.value] = null; - } else { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(17) : new _tsInvariant.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + 'is not supported. Use variables instead of inline arguments to ' + 'overcome this limitation.'); - } - } - - function storeKeyNameFromField(field, variables) { - var directivesObj = null; - - if (field.directives) { - directivesObj = {}; - field.directives.forEach(function (directive) { - directivesObj[directive.name.value] = {}; - - if (directive.arguments) { - directive.arguments.forEach(function (_a) { - var name = _a.name, - value = _a.value; - return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); - }); - } - }); - } - - var argObj = null; - - if (field.arguments && field.arguments.length) { - argObj = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, - value = _a.value; - return valueToObjectRepresentation(argObj, name, value, variables); - }); - } - - return getStoreKeyName(field.name.value, argObj, directivesObj); - } - - var KNOWN_DIRECTIVES = ['connection', 'include', 'skip', 'client', 'rest', 'export']; - - function getStoreKeyName(fieldName, args, directives) { - if (directives && directives['connection'] && directives['connection']['key']) { - if (directives['connection']['filter'] && directives['connection']['filter'].length > 0) { - var filterKeys = directives['connection']['filter'] ? directives['connection']['filter'] : []; - filterKeys.sort(); - var queryArgs_1 = args; - var filteredArgs_1 = {}; - filterKeys.forEach(function (key) { - filteredArgs_1[key] = queryArgs_1[key]; - }); - return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; - } else { - return directives['connection']['key']; - } - } - - var completeFieldName = fieldName; - - if (args) { - var stringifiedArgs = (0, _fastJsonStableStringify.default)(args); - completeFieldName += "(" + stringifiedArgs + ")"; - } - - if (directives) { - Object.keys(directives).forEach(function (key) { - if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; - - if (directives[key] && Object.keys(directives[key]).length) { - completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; - } else { - completeFieldName += "@" + key; - } - }); - } - - return completeFieldName; - } - - function argumentsObjectFromField(field, variables) { - if (field.arguments && field.arguments.length) { - var argObj_1 = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, - value = _a.value; - return valueToObjectRepresentation(argObj_1, name, value, variables); - }); - return argObj_1; - } - - return null; - } - - function resultKeyNameFromField(field) { - return field.alias ? field.alias.value : field.name.value; - } - - function isField(selection) { - return selection.kind === 'Field'; - } - - function isInlineFragment(selection) { - return selection.kind === 'InlineFragment'; - } - - function isIdValue(idObject) { - return idObject && idObject.type === 'id' && typeof idObject.generated === 'boolean'; - } - - function toIdValue(idConfig, generated) { - if (generated === void 0) { - generated = false; - } - - return (0, _tslib.__assign)({ - type: 'id', - generated: generated - }, typeof idConfig === 'string' ? { - id: idConfig, - typename: undefined - } : idConfig); - } - - function isJsonValue(jsonObject) { - return jsonObject != null && typeof jsonObject === 'object' && jsonObject.type === 'json'; - } - - function defaultValueFromVariable(node) { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(18) : new _tsInvariant.InvariantError("Variable nodes are not supported by valueFromNode"); - } - - function valueFromNode(node, onVariable) { - if (onVariable === void 0) { - onVariable = defaultValueFromVariable; - } - - switch (node.kind) { - case 'Variable': - return onVariable(node); - - case 'NullValue': - return null; - - case 'IntValue': - return parseInt(node.value, 10); - - case 'FloatValue': - return parseFloat(node.value); - - case 'ListValue': - return node.values.map(function (v) { - return valueFromNode(v, onVariable); - }); - - case 'ObjectValue': - { - var value = {}; - - for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { - var field = _a[_i]; - value[field.name.value] = valueFromNode(field.value, onVariable); - } - - return value; - } - - default: - return node.value; - } - } - - function getDirectiveInfoFromField(field, variables) { - if (field.directives && field.directives.length) { - var directiveObj_1 = {}; - field.directives.forEach(function (directive) { - directiveObj_1[directive.name.value] = argumentsObjectFromField(directive, variables); - }); - return directiveObj_1; - } - - return null; - } - - function shouldInclude(selection, variables) { - if (variables === void 0) { - variables = {}; - } - - return getInclusionDirectives(selection.directives).every(function (_a) { - var directive = _a.directive, - ifArgument = _a.ifArgument; - var evaledValue = false; - - if (ifArgument.value.kind === 'Variable') { - evaledValue = variables[ifArgument.value.name.value]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(evaledValue !== void 0, 13) : (0, _tsInvariant.invariant)(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); - } else { - evaledValue = ifArgument.value.value; - } - - return directive.name.value === 'skip' ? !evaledValue : evaledValue; - }); - } - - function getDirectiveNames(doc) { - var names = []; - (0, _visitor.visit)(doc, { - Directive: function (node) { - names.push(node.name.value); - } - }); - return names; - } - - function hasDirectives(names, doc) { - return getDirectiveNames(doc).some(function (name) { - return names.indexOf(name) > -1; - }); - } - - function hasClientExports(document) { - return document && hasDirectives(['client'], document) && hasDirectives(['export'], document); - } - - function isInclusionDirective(_a) { - var value = _a.name.value; - return value === 'skip' || value === 'include'; - } - - function getInclusionDirectives(directives) { - return directives ? directives.filter(isInclusionDirective).map(function (directive) { - var directiveArguments = directive.arguments; - var directiveName = directive.name.value; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, 14) : (0, _tsInvariant.invariant)(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); - var ifArgument = directiveArguments[0]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', 15) : (0, _tsInvariant.invariant)(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); - var ifValue = ifArgument.value; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 16) : (0, _tsInvariant.invariant)(ifValue && (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); - return { - directive: directive, - ifArgument: ifArgument - }; - }) : []; - } - - function getFragmentQueryDocument(document, fragmentName) { - var actualFragmentName = fragmentName; - var fragments = []; - document.definitions.forEach(function (definition) { - if (definition.kind === 'OperationDefinition') { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(11) : new _tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); - } - - if (definition.kind === 'FragmentDefinition') { - fragments.push(definition); - } - }); - - if (typeof actualFragmentName === 'undefined') { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragments.length === 1, 12) : (0, _tsInvariant.invariant)(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); - actualFragmentName = fragments[0].name.value; - } - - var query = (0, _tslib.__assign)((0, _tslib.__assign)({}, document), { - definitions: (0, _tslib.__spreadArrays)([{ - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [{ - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName - } - }] - } - }], document.definitions) - }); - return query; - } - - function assign(target) { - var sources = []; - - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - - sources.forEach(function (source) { - if (typeof source === 'undefined' || source === null) { - return; - } - - Object.keys(source).forEach(function (key) { - target[key] = source[key]; - }); - }); - return target; - } - - function getMutationDefinition(doc) { - checkDocument(doc); - var mutationDef = doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition' && definition.operation === 'mutation'; - })[0]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(mutationDef, 1) : (0, _tsInvariant.invariant)(mutationDef, 'Must contain a mutation definition.'); - return mutationDef; - } - - function checkDocument(doc) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', 2) : (0, _tsInvariant.invariant)(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - var operations = doc.definitions.filter(function (d) { - return d.kind !== 'FragmentDefinition'; - }).map(function (definition) { - if (definition.kind !== 'OperationDefinition') { - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(3) : new _tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); - } - - return definition; - }); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(operations.length <= 1, 4) : (0, _tsInvariant.invariant)(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); - return doc; - } - - function getOperationDefinition(doc) { - checkDocument(doc); - return doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition'; - })[0]; - } - - function getOperationDefinitionOrDie(document) { - var def = getOperationDefinition(document); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(def, 5) : (0, _tsInvariant.invariant)(def, "GraphQL document is missing an operation"); - return def; - } - - function getOperationName(doc) { - return doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition' && definition.name; - }).map(function (x) { - return x.name.value; - })[0] || null; - } - - function getFragmentDefinitions(doc) { - return doc.definitions.filter(function (definition) { - return definition.kind === 'FragmentDefinition'; - }); - } - - function getQueryDefinition(doc) { - var queryDef = getOperationDefinition(doc); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 6) : (0, _tsInvariant.invariant)(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); - return queryDef; - } - - function getFragmentDefinition(doc) { - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.kind === 'Document', 7) : (0, _tsInvariant.invariant)(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 8) : (0, _tsInvariant.invariant)(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); - var fragmentDef = doc.definitions[0]; - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 9) : (0, _tsInvariant.invariant)(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); - return fragmentDef; - } - - function getMainDefinition(queryDoc) { - checkDocument(queryDoc); - var fragmentDefinition; - - for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { - var definition = _a[_i]; - - if (definition.kind === 'OperationDefinition') { - var operation = definition.operation; - - if (operation === 'query' || operation === 'mutation' || operation === 'subscription') { - return definition; - } - } - - if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { - fragmentDefinition = definition; - } - } - - if (fragmentDefinition) { - return fragmentDefinition; - } - - throw process.env.NODE_ENV === "production" ? new _tsInvariant.InvariantError(10) : new _tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); - } - - function createFragmentMap(fragments) { - if (fragments === void 0) { - fragments = []; - } - - var symTable = {}; - fragments.forEach(function (fragment) { - symTable[fragment.name.value] = fragment; - }); - return symTable; - } - - function getDefaultValues(definition) { - if (definition && definition.variableDefinitions && definition.variableDefinitions.length) { - var defaultValues = definition.variableDefinitions.filter(function (_a) { - var defaultValue = _a.defaultValue; - return defaultValue; - }).map(function (_a) { - var variable = _a.variable, - defaultValue = _a.defaultValue; - var defaultValueObj = {}; - valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); - return defaultValueObj; - }); - return assign.apply(void 0, (0, _tslib.__spreadArrays)([{}], defaultValues)); - } - - return {}; - } - - function variablesInOperation(operation) { - var names = new Set(); - - if (operation.variableDefinitions) { - for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { - var definition = _a[_i]; - names.add(definition.variable.name.value); - } - } - - return names; - } - - function filterInPlace(array, test, context) { - var target = 0; - array.forEach(function (elem, i) { - if (test.call(this, elem, i, array)) { - array[target++] = elem; - } - }, context); - array.length = target; - return array; - } - - var TYPENAME_FIELD = { - kind: 'Field', - name: { - kind: 'Name', - value: '__typename' - } - }; - - function isEmpty(op, fragments) { - return op.selectionSet.selections.every(function (selection) { - return selection.kind === 'FragmentSpread' && isEmpty(fragments[selection.name.value], fragments); - }); - } - - function nullIfDocIsEmpty(doc) { - return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc))) ? null : doc; - } - - function getDirectiveMatcher(directives) { - return function directiveMatcher(directive) { - return directives.some(function (dir) { - return dir.name && dir.name === directive.name.value || dir.test && dir.test(directive); - }); - }; - } - - function removeDirectivesFromDocument(directives, doc) { - var variablesInUse = Object.create(null); - var variablesToRemove = []; - var fragmentSpreadsInUse = Object.create(null); - var fragmentSpreadsToRemove = []; - var modifiedDoc = nullIfDocIsEmpty((0, _visitor.visit)(doc, { - Variable: { - enter: function (node, _key, parent) { - if (parent.kind !== 'VariableDefinition') { - variablesInUse[node.name.value] = true; - } - } - }, - Field: { - enter: function (node) { - if (directives && node.directives) { - var shouldRemoveField = directives.some(function (directive) { - return directive.remove; - }); - - if (shouldRemoveField && node.directives && node.directives.some(getDirectiveMatcher(directives))) { - if (node.arguments) { - node.arguments.forEach(function (arg) { - if (arg.value.kind === 'Variable') { - variablesToRemove.push({ - name: arg.value.name.value - }); - } - }); - } - - if (node.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { - fragmentSpreadsToRemove.push({ - name: frag.name.value - }); - }); - } - - return null; - } - } - } - }, - FragmentSpread: { - enter: function (node) { - fragmentSpreadsInUse[node.name.value] = true; - } - }, - Directive: { - enter: function (node) { - if (getDirectiveMatcher(directives)(node)) { - return null; - } - } - } - })); - - if (modifiedDoc && filterInPlace(variablesToRemove, function (v) { - return !variablesInUse[v.name]; - }).length) { - modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); - } - - if (modifiedDoc && filterInPlace(fragmentSpreadsToRemove, function (fs) { - return !fragmentSpreadsInUse[fs.name]; - }).length) { - modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); - } - - return modifiedDoc; - } - - function addTypenameToDocument(doc) { - return (0, _visitor.visit)(checkDocument(doc), { - SelectionSet: { - enter: function (node, _key, parent) { - if (parent && parent.kind === 'OperationDefinition') { - return; - } - - var selections = node.selections; - - if (!selections) { - return; - } - - var skip = selections.some(function (selection) { - return isField(selection) && (selection.name.value === '__typename' || selection.name.value.lastIndexOf('__', 0) === 0); - }); - - if (skip) { - return; - } - - var field = parent; - - if (isField(field) && field.directives && field.directives.some(function (d) { - return d.name.value === 'export'; - })) { - return; - } - - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - selections: (0, _tslib.__spreadArrays)(selections, [TYPENAME_FIELD]) - }); - } - } - }); - } - - var connectionRemoveConfig = { - test: function (directive) { - var willRemove = directive.name.value === 'connection'; - - if (willRemove) { - if (!directive.arguments || !directive.arguments.some(function (arg) { - return arg.name.value === 'key'; - })) { - process.env.NODE_ENV === "production" || _tsInvariant.invariant.warn('Removing an @connection directive even though it does not have a key. ' + 'You may want to use the key parameter to specify a store key.'); - } - } - - return willRemove; - } - }; - - function removeConnectionDirectiveFromDocument(doc) { - return removeDirectivesFromDocument([connectionRemoveConfig], checkDocument(doc)); - } - - function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { - if (nestedCheck === void 0) { - nestedCheck = true; - } - - return selectionSet && selectionSet.selections && selectionSet.selections.some(function (selection) { - return hasDirectivesInSelection(directives, selection, nestedCheck); - }); - } - - function hasDirectivesInSelection(directives, selection, nestedCheck) { - if (nestedCheck === void 0) { - nestedCheck = true; - } - - if (!isField(selection)) { - return true; - } - - if (!selection.directives) { - return false; - } - - return selection.directives.some(getDirectiveMatcher(directives)) || nestedCheck && hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck); - } - - function getDirectivesFromDocument(directives, doc) { - checkDocument(doc); - var parentPath; - return nullIfDocIsEmpty((0, _visitor.visit)(doc, { - SelectionSet: { - enter: function (node, _key, _parent, path) { - var currentPath = path.join('-'); - - if (!parentPath || currentPath === parentPath || !currentPath.startsWith(parentPath)) { - if (node.selections) { - var selectionsWithDirectives = node.selections.filter(function (selection) { - return hasDirectivesInSelection(directives, selection); - }); - - if (hasDirectivesInSelectionSet(directives, node, false)) { - parentPath = currentPath; - } - - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - selections: selectionsWithDirectives - }); - } else { - return null; - } - } - } - } - })); - } - - function getArgumentMatcher(config) { - return function argumentMatcher(argument) { - return config.some(function (aConfig) { - return argument.value && argument.value.kind === 'Variable' && argument.value.name && (aConfig.name === argument.value.name.value || aConfig.test && aConfig.test(argument)); - }); - }; - } - - function removeArgumentsFromDocument(config, doc) { - var argMatcher = getArgumentMatcher(config); - return nullIfDocIsEmpty((0, _visitor.visit)(doc, { - OperationDefinition: { - enter: function (node) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - variableDefinitions: node.variableDefinitions.filter(function (varDef) { - return !config.some(function (arg) { - return arg.name === varDef.variable.name.value; - }); - }) - }); - } - }, - Field: { - enter: function (node) { - var shouldRemoveField = config.some(function (argConfig) { - return argConfig.remove; - }); - - if (shouldRemoveField) { - var argMatchCount_1 = 0; - node.arguments.forEach(function (arg) { - if (argMatcher(arg)) { - argMatchCount_1 += 1; - } - }); - - if (argMatchCount_1 === 1) { - return null; - } - } - } - }, - Argument: { - enter: function (node) { - if (argMatcher(node)) { - return null; - } - } - } - })); - } - - function removeFragmentSpreadFromDocument(config, doc) { - function enter(node) { - if (config.some(function (def) { - return def.name === node.name.value; - })) { - return null; - } - } - - return nullIfDocIsEmpty((0, _visitor.visit)(doc, { - FragmentSpread: { - enter: enter - }, - FragmentDefinition: { - enter: enter - } - })); - } - - function getAllFragmentSpreadsFromSelectionSet(selectionSet) { - var allFragments = []; - selectionSet.selections.forEach(function (selection) { - if ((isField(selection) || isInlineFragment(selection)) && selection.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { - return allFragments.push(frag); - }); - } else if (selection.kind === 'FragmentSpread') { - allFragments.push(selection); - } - }); - return allFragments; - } - - function buildQueryFromSelectionSet(document) { - var definition = getMainDefinition(document); - var definitionOperation = definition.operation; - - if (definitionOperation === 'query') { - return document; - } - - var modifiedDoc = (0, _visitor.visit)(document, { - OperationDefinition: { - enter: function (node) { - return (0, _tslib.__assign)((0, _tslib.__assign)({}, node), { - operation: 'query' - }); - } - } - }); - return modifiedDoc; - } - - function removeClientSetsFromDocument(document) { - checkDocument(document); - var modifiedDoc = removeDirectivesFromDocument([{ - test: function (directive) { - return directive.name.value === 'client'; - }, - remove: true - }], document); - - if (modifiedDoc) { - modifiedDoc = (0, _visitor.visit)(modifiedDoc, { - FragmentDefinition: { - enter: function (node) { - if (node.selectionSet) { - var isTypenameOnly = node.selectionSet.selections.every(function (selection) { - return isField(selection) && selection.name.value === '__typename'; - }); - - if (isTypenameOnly) { - return null; - } - } - } - } - }); - } - - return modifiedDoc; - } - - var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && navigator.product === 'ReactNative'); - _exports.canUseWeakMap = canUseWeakMap; - var toString = Object.prototype.toString; - - function cloneDeep(value) { - return cloneDeepHelper(value, new Map()); - } - - function cloneDeepHelper(val, seen) { - switch (toString.call(val)) { - case "[object Array]": - { - if (seen.has(val)) return seen.get(val); - var copy_1 = val.slice(0); - seen.set(val, copy_1); - copy_1.forEach(function (child, i) { - copy_1[i] = cloneDeepHelper(child, seen); - }); - return copy_1; - } - - case "[object Object]": - { - if (seen.has(val)) return seen.get(val); - var copy_2 = Object.create(Object.getPrototypeOf(val)); - seen.set(val, copy_2); - Object.keys(val).forEach(function (key) { - copy_2[key] = cloneDeepHelper(val[key], seen); - }); - return copy_2; - } - - default: - return val; - } - } - - function getEnv() { - if (typeof process !== 'undefined' && process.env.NODE_ENV) { - return process.env.NODE_ENV; - } - - return 'development'; - } - - function isEnv(env) { - return getEnv() === env; - } - - function isProduction() { - return isEnv('production') === true; - } - - function isDevelopment() { - return isEnv('development') === true; - } - - function isTest() { - return isEnv('test') === true; - } - - function tryFunctionOrLogError(f) { - try { - return f(); - } catch (e) { - if (console.error) { - console.error(e); - } - } - } - - function graphQLResultHasError(result) { - return result.errors && result.errors.length; - } - - function deepFreeze(o) { - Object.freeze(o); - Object.getOwnPropertyNames(o).forEach(function (prop) { - if (o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop])) { - deepFreeze(o[prop]); - } - }); - return o; - } - - function maybeDeepFreeze(obj) { - if (isDevelopment() || isTest()) { - var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; - - if (!symbolIsPolyfilled) { - return deepFreeze(obj); - } - } - - return obj; - } - - var hasOwnProperty = Object.prototype.hasOwnProperty; - - function mergeDeep() { - var sources = []; - - for (var _i = 0; _i < arguments.length; _i++) { - sources[_i] = arguments[_i]; - } - - return mergeDeepArray(sources); - } - - function mergeDeepArray(sources) { - var target = sources[0] || {}; - var count = sources.length; - - if (count > 1) { - var pastCopies = []; - target = shallowCopyForMerge(target, pastCopies); - - for (var i = 1; i < count; ++i) { - target = mergeHelper(target, sources[i], pastCopies); - } - } - - return target; - } - - function isObject(obj) { - return obj !== null && typeof obj === 'object'; - } - - function mergeHelper(target, source, pastCopies) { - if (isObject(source) && isObject(target)) { - if (Object.isExtensible && !Object.isExtensible(target)) { - target = shallowCopyForMerge(target, pastCopies); - } - - Object.keys(source).forEach(function (sourceKey) { - var sourceValue = source[sourceKey]; - - if (hasOwnProperty.call(target, sourceKey)) { - var targetValue = target[sourceKey]; - - if (sourceValue !== targetValue) { - target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); - } - } else { - target[sourceKey] = sourceValue; - } - }); - return target; - } - - return source; - } - - function shallowCopyForMerge(value, pastCopies) { - if (value !== null && typeof value === 'object' && pastCopies.indexOf(value) < 0) { - if (Array.isArray(value)) { - value = value.slice(0); - } else { - value = (0, _tslib.__assign)({ - __proto__: Object.getPrototypeOf(value) - }, value); - } - - pastCopies.push(value); - } - - return value; - } - - var haveWarned = Object.create({}); - - function warnOnceInDevelopment(msg, type) { - if (type === void 0) { - type = 'warn'; - } - - if (!isProduction() && !haveWarned[msg]) { - if (!isTest()) { - haveWarned[msg] = true; - } - - if (type === 'error') { - console.error(msg); - } else { - console.warn(msg); - } - } - } - - function stripSymbols(data) { - return JSON.parse(JSON.stringify(data)); - } - -}); diff --git a/node_modules/apollo-utilities/lib/bundle.umd.js.map b/node_modules/apollo-utilities/lib/bundle.umd.js.map deleted file mode 100644 index e69270f..0000000 --- a/node_modules/apollo-utilities/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/storeUtils.ts","../src/directives.ts","../src/fragments.ts","../src/util/assign.ts","../src/getFromAST.ts","../src/util/filterInPlace.ts","../src/transform.ts","../src/util/canUse.ts","../src/util/cloneDeep.ts","../src/util/environment.ts","../src/util/errorHandling.ts","../src/util/maybeDeepFreeze.ts","../src/util/mergeDeep.ts","../src/util/warnOnce.ts","../src/util/stripSymbols.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAiDgB,a,CAAc,K,EAAgB;AAC5C,WAAO,CAAC,aAAD,EAAgB,cAAhB,EAAgC,WAAhC,EAA6C,OAA7C,CAAqD,KAAK,CAAC,IAA3D,IAAmE,CAAC,CAA3E;AACD;;AAID,WAAgB,aAAhB,CAA8B,KAA9B,EAA8C;AAC5C,WAAO,CAAC,UAAD,EAAa,YAAb,EAA2B,OAA3B,CAAmC,KAAK,CAAC,IAAzC,IAAiD,CAAC,CAAzD;AACD;;AAED,WAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,WAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;AACD;;AAED,WAAS,cAAT,CAAwB,KAAxB,EAAwC;AACtC,WAAO,KAAK,CAAC,IAAN,KAAe,cAAtB;AACD;;AAED,WAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,WAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,WAAS,YAAT,CAAsB,KAAtB,EAAsC;AACpC,WAAO,KAAK,CAAC,IAAN,KAAe,YAAtB;AACD;;AAED,WAAS,UAAT,CAAoB,KAApB,EAAoC;AAClC,WAAO,KAAK,CAAC,IAAN,KAAe,UAAtB;AACD;;AAED,WAAS,aAAT,CAAuB,KAAvB,EAAuC;AACrC,WAAO,KAAK,CAAC,IAAN,KAAe,aAAtB;AACD;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MAAP,CAAc,EAAd,CAAnB;;AAUA,WAAgB,qBAAhB,CAAsC,GAAtC,EAAmD,IAAnD,EAAgE;AAAb,QAAA,IAAA,KAAA,KAAA,CAAA,EAAA;AAAA,MAAA,IAAA,GAAA,MAAA;AAAa;;AAC9D,QAAI,CAAC,YAAY,EAAb,IAAmB,CAAC,UAAU,CAAC,GAAD,CAAlC,EAAyC;AACvC,UAAI,CAAC,MAAM,EAAX,EAAe;AACb,QAAA,UAAU,CAAC,GAAD,CAAV,GAAkB,IAAlB;AACD;;AACD,UAAI,IAAI,KAAK,OAAb,EAAsB;AACpB,QAAA,OAAO,CAAC,KAAR,CAAc,GAAd;AACD,OAFD,MAEO;AACL,QAAA,OAAO,CAAC,IAAR,CAAa,GAAb;AACD;AACF;AACF;;WCZe,Y,CAAgB,I,EAAO;AACrC,WAAO,IAAI,CAAC,KAAL,CAAW,IAAI,CAAC,SAAL,CAAe,IAAf,CAAX,CAAP;AACD,G","sourcesContent":["import {\n DirectiveNode,\n FieldNode,\n IntValueNode,\n FloatValueNode,\n StringValueNode,\n BooleanValueNode,\n ObjectValueNode,\n ListValueNode,\n EnumValueNode,\n NullValueNode,\n VariableNode,\n InlineFragmentNode,\n ValueNode,\n SelectionNode,\n NameNode,\n} from 'graphql';\n\nimport stringify from 'fast-json-stable-stringify';\nimport { InvariantError } from 'ts-invariant';\n\nexport interface IdValue {\n type: 'id';\n id: string;\n generated: boolean;\n typename: string | undefined;\n}\n\nexport interface JsonValue {\n type: 'json';\n json: any;\n}\n\nexport type ListValue = Array;\n\nexport type StoreValue =\n | number\n | string\n | string[]\n | IdValue\n | ListValue\n | JsonValue\n | null\n | undefined\n | void\n | Object;\n\nexport type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode;\n\nexport function isScalarValue(value: ValueNode): value is ScalarValue {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}\n\nexport type NumberValue = IntValueNode | FloatValueNode;\n\nexport function isNumberValue(value: ValueNode): value is NumberValue {\n return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1;\n}\n\nfunction isStringValue(value: ValueNode): value is StringValueNode {\n return value.kind === 'StringValue';\n}\n\nfunction isBooleanValue(value: ValueNode): value is BooleanValueNode {\n return value.kind === 'BooleanValue';\n}\n\nfunction isIntValue(value: ValueNode): value is IntValueNode {\n return value.kind === 'IntValue';\n}\n\nfunction isFloatValue(value: ValueNode): value is FloatValueNode {\n return value.kind === 'FloatValue';\n}\n\nfunction isVariable(value: ValueNode): value is VariableNode {\n return value.kind === 'Variable';\n}\n\nfunction isObjectValue(value: ValueNode): value is ObjectValueNode {\n return value.kind === 'ObjectValue';\n}\n\nfunction isListValue(value: ValueNode): value is ListValueNode {\n return value.kind === 'ListValue';\n}\n\nfunction isEnumValue(value: ValueNode): value is EnumValueNode {\n return value.kind === 'EnumValue';\n}\n\nfunction isNullValue(value: ValueNode): value is NullValueNode {\n return value.kind === 'NullValue';\n}\n\nexport function valueToObjectRepresentation(\n argObj: any,\n name: NameNode,\n value: ValueNode,\n variables?: Object,\n) {\n if (isIntValue(value) || isFloatValue(value)) {\n argObj[name.value] = Number(value.value);\n } else if (isBooleanValue(value) || isStringValue(value)) {\n argObj[name.value] = value.value;\n } else if (isObjectValue(value)) {\n const nestedArgObj = {};\n value.fields.map(obj =>\n valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables),\n );\n argObj[name.value] = nestedArgObj;\n } else if (isVariable(value)) {\n const variableValue = (variables || ({} as any))[value.name.value];\n argObj[name.value] = variableValue;\n } else if (isListValue(value)) {\n argObj[name.value] = value.values.map(listValue => {\n const nestedArgArrayObj = {};\n valueToObjectRepresentation(\n nestedArgArrayObj,\n name,\n listValue,\n variables,\n );\n return (nestedArgArrayObj as any)[name.value];\n });\n } else if (isEnumValue(value)) {\n argObj[name.value] = (value as EnumValueNode).value;\n } else if (isNullValue(value)) {\n argObj[name.value] = null;\n } else {\n throw new InvariantError(\n `The inline argument \"${name.value}\" of kind \"${(value as any).kind}\"` +\n 'is not supported. Use variables instead of inline arguments to ' +\n 'overcome this limitation.',\n );\n }\n}\n\nexport function storeKeyNameFromField(\n field: FieldNode,\n variables?: Object,\n): string {\n let directivesObj: any = null;\n if (field.directives) {\n directivesObj = {};\n field.directives.forEach(directive => {\n directivesObj[directive.name.value] = {};\n\n if (directive.arguments) {\n directive.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(\n directivesObj[directive.name.value],\n name,\n value,\n variables,\n ),\n );\n }\n });\n }\n\n let argObj: any = null;\n if (field.arguments && field.arguments.length) {\n argObj = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n }\n\n return getStoreKeyName(field.name.value, argObj, directivesObj);\n}\n\nexport type Directives = {\n [directiveName: string]: {\n [argName: string]: any;\n };\n};\n\nconst KNOWN_DIRECTIVES: string[] = [\n 'connection',\n 'include',\n 'skip',\n 'client',\n 'rest',\n 'export',\n];\n\nexport function getStoreKeyName(\n fieldName: string,\n args?: Object,\n directives?: Directives,\n): string {\n if (\n directives &&\n directives['connection'] &&\n directives['connection']['key']\n ) {\n if (\n directives['connection']['filter'] &&\n (directives['connection']['filter'] as string[]).length > 0\n ) {\n const filterKeys = directives['connection']['filter']\n ? (directives['connection']['filter'] as string[])\n : [];\n filterKeys.sort();\n\n const queryArgs = args as { [key: string]: any };\n const filteredArgs = {} as { [key: string]: any };\n filterKeys.forEach(key => {\n filteredArgs[key] = queryArgs[key];\n });\n\n return `${directives['connection']['key']}(${JSON.stringify(\n filteredArgs,\n )})`;\n } else {\n return directives['connection']['key'];\n }\n }\n\n let completeFieldName: string = fieldName;\n\n if (args) {\n // We can't use `JSON.stringify` here since it's non-deterministic,\n // and can lead to different store key names being created even though\n // the `args` object used during creation has the same properties/values.\n const stringifiedArgs: string = stringify(args);\n completeFieldName += `(${stringifiedArgs})`;\n }\n\n if (directives) {\n Object.keys(directives).forEach(key => {\n if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return;\n if (directives[key] && Object.keys(directives[key]).length) {\n completeFieldName += `@${key}(${JSON.stringify(directives[key])})`;\n } else {\n completeFieldName += `@${key}`;\n }\n });\n }\n\n return completeFieldName;\n}\n\nexport function argumentsObjectFromField(\n field: FieldNode | DirectiveNode,\n variables: Object,\n): Object {\n if (field.arguments && field.arguments.length) {\n const argObj: Object = {};\n field.arguments.forEach(({ name, value }) =>\n valueToObjectRepresentation(argObj, name, value, variables),\n );\n return argObj;\n }\n\n return null;\n}\n\nexport function resultKeyNameFromField(field: FieldNode): string {\n return field.alias ? field.alias.value : field.name.value;\n}\n\nexport function isField(selection: SelectionNode): selection is FieldNode {\n return selection.kind === 'Field';\n}\n\nexport function isInlineFragment(\n selection: SelectionNode,\n): selection is InlineFragmentNode {\n return selection.kind === 'InlineFragment';\n}\n\nexport function isIdValue(idObject: StoreValue): idObject is IdValue {\n return idObject &&\n (idObject as IdValue | JsonValue).type === 'id' &&\n typeof (idObject as IdValue).generated === 'boolean';\n}\n\nexport type IdConfig = {\n id: string;\n typename: string | undefined;\n};\n\nexport function toIdValue(\n idConfig: string | IdConfig,\n generated = false,\n): IdValue {\n return {\n type: 'id',\n generated,\n ...(typeof idConfig === 'string'\n ? { id: idConfig, typename: undefined }\n : idConfig),\n };\n}\n\nexport function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue {\n return (\n jsonObject != null &&\n typeof jsonObject === 'object' &&\n (jsonObject as IdValue | JsonValue).type === 'json'\n );\n}\n\nfunction defaultValueFromVariable(node: VariableNode) {\n throw new InvariantError(`Variable nodes are not supported by valueFromNode`);\n}\n\nexport type VariableValue = (node: VariableNode) => any;\n\n/**\n * Evaluate a ValueNode and yield its value in its natural JS form.\n */\nexport function valueFromNode(\n node: ValueNode,\n onVariable: VariableValue = defaultValueFromVariable,\n): any {\n switch (node.kind) {\n case 'Variable':\n return onVariable(node);\n case 'NullValue':\n return null;\n case 'IntValue':\n return parseInt(node.value, 10);\n case 'FloatValue':\n return parseFloat(node.value);\n case 'ListValue':\n return node.values.map(v => valueFromNode(v, onVariable));\n case 'ObjectValue': {\n const value: { [key: string]: any } = {};\n for (const field of node.fields) {\n value[field.name.value] = valueFromNode(field.value, onVariable);\n }\n return value;\n }\n default:\n return node.value;\n }\n}\n","// Provides the methods that allow QueryManager to handle the `skip` and\n// `include` directives within GraphQL.\nimport {\n FieldNode,\n SelectionNode,\n VariableNode,\n BooleanValueNode,\n DirectiveNode,\n DocumentNode,\n ArgumentNode,\n ValueNode,\n} from 'graphql';\n\nimport { visit } from 'graphql/language/visitor';\n\nimport { invariant } from 'ts-invariant';\n\nimport { argumentsObjectFromField } from './storeUtils';\n\nexport type DirectiveInfo = {\n [fieldName: string]: { [argName: string]: any };\n};\n\nexport function getDirectiveInfoFromField(\n field: FieldNode,\n variables: Object,\n): DirectiveInfo {\n if (field.directives && field.directives.length) {\n const directiveObj: DirectiveInfo = {};\n field.directives.forEach((directive: DirectiveNode) => {\n directiveObj[directive.name.value] = argumentsObjectFromField(\n directive,\n variables,\n );\n });\n return directiveObj;\n }\n return null;\n}\n\nexport function shouldInclude(\n selection: SelectionNode,\n variables: { [name: string]: any } = {},\n): boolean {\n return getInclusionDirectives(\n selection.directives,\n ).every(({ directive, ifArgument }) => {\n let evaledValue: boolean = false;\n if (ifArgument.value.kind === 'Variable') {\n evaledValue = variables[(ifArgument.value as VariableNode).name.value];\n invariant(\n evaledValue !== void 0,\n `Invalid variable referenced in @${directive.name.value} directive.`,\n );\n } else {\n evaledValue = (ifArgument.value as BooleanValueNode).value;\n }\n return directive.name.value === 'skip' ? !evaledValue : evaledValue;\n });\n}\n\nexport function getDirectiveNames(doc: DocumentNode) {\n const names: string[] = [];\n\n visit(doc, {\n Directive(node) {\n names.push(node.name.value);\n },\n });\n\n return names;\n}\n\nexport function hasDirectives(names: string[], doc: DocumentNode) {\n return getDirectiveNames(doc).some(\n (name: string) => names.indexOf(name) > -1,\n );\n}\n\nexport function hasClientExports(document: DocumentNode) {\n return (\n document &&\n hasDirectives(['client'], document) &&\n hasDirectives(['export'], document)\n );\n}\n\nexport type InclusionDirectives = Array<{\n directive: DirectiveNode;\n ifArgument: ArgumentNode;\n}>;\n\nfunction isInclusionDirective({ name: { value } }: DirectiveNode): boolean {\n return value === 'skip' || value === 'include';\n}\n\nexport function getInclusionDirectives(\n directives: ReadonlyArray,\n): InclusionDirectives {\n return directives ? directives.filter(isInclusionDirective).map(directive => {\n const directiveArguments = directive.arguments;\n const directiveName = directive.name.value;\n\n invariant(\n directiveArguments && directiveArguments.length === 1,\n `Incorrect number of arguments for the @${directiveName} directive.`,\n );\n\n const ifArgument = directiveArguments[0];\n invariant(\n ifArgument.name && ifArgument.name.value === 'if',\n `Invalid argument for the @${directiveName} directive.`,\n );\n\n const ifValue: ValueNode = ifArgument.value;\n\n // means it has to be a variable value if this is a valid @skip or @include directive\n invariant(\n ifValue &&\n (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'),\n `Argument for the @${directiveName} directive must be a variable or a boolean value.`,\n );\n\n return { directive, ifArgument };\n }) : [];\n}\n\n","import { DocumentNode, FragmentDefinitionNode } from 'graphql';\nimport { invariant, InvariantError } from 'ts-invariant';\n\n/**\n * Returns a query document which adds a single query operation that only\n * spreads the target fragment inside of it.\n *\n * So for example a document of:\n *\n * ```graphql\n * fragment foo on Foo { a b c }\n * ```\n *\n * Turns into:\n *\n * ```graphql\n * { ...foo }\n *\n * fragment foo on Foo { a b c }\n * ```\n *\n * The target fragment will either be the only fragment in the document, or a\n * fragment specified by the provided `fragmentName`. If there is more than one\n * fragment, but a `fragmentName` was not defined then an error will be thrown.\n */\nexport function getFragmentQueryDocument(\n document: DocumentNode,\n fragmentName?: string,\n): DocumentNode {\n let actualFragmentName = fragmentName;\n\n // Build an array of all our fragment definitions that will be used for\n // validations. We also do some validations on the other definitions in the\n // document while building this list.\n const fragments: Array = [];\n document.definitions.forEach(definition => {\n // Throw an error if we encounter an operation definition because we will\n // define our own operation definition later on.\n if (definition.kind === 'OperationDefinition') {\n throw new InvariantError(\n `Found a ${definition.operation} operation${\n definition.name ? ` named '${definition.name.value}'` : ''\n }. ` +\n 'No operations are allowed when using a fragment as a query. Only fragments are allowed.',\n );\n }\n // Add our definition to the fragments array if it is a fragment\n // definition.\n if (definition.kind === 'FragmentDefinition') {\n fragments.push(definition);\n }\n });\n\n // If the user did not give us a fragment name then let us try to get a\n // name from a single fragment in the definition.\n if (typeof actualFragmentName === 'undefined') {\n invariant(\n fragments.length === 1,\n `Found ${\n fragments.length\n } fragments. \\`fragmentName\\` must be provided when there is not exactly 1 fragment.`,\n );\n actualFragmentName = fragments[0].name.value;\n }\n\n // Generate a query document with an operation that simply spreads the\n // fragment inside of it.\n const query: DocumentNode = {\n ...document,\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'FragmentSpread',\n name: {\n kind: 'Name',\n value: actualFragmentName,\n },\n },\n ],\n },\n },\n ...document.definitions,\n ],\n };\n\n return query;\n}\n","/**\n * Adds the properties of one or more source objects to a target object. Works exactly like\n * `Object.assign`, but as a utility to maintain support for IE 11.\n *\n * @see https://github.com/apollostack/apollo-client/pull/1009\n */\nexport function assign(a: A, b: B): A & B;\nexport function assign(a: A, b: B, c: C): A & B & C;\nexport function assign(a: A, b: B, c: C, d: D): A & B & C & D;\nexport function assign(\n a: A,\n b: B,\n c: C,\n d: D,\n e: E,\n): A & B & C & D & E;\nexport function assign(target: any, ...sources: Array): any;\nexport function assign(\n target: { [key: string]: any },\n ...sources: Array<{ [key: string]: any }>\n): { [key: string]: any } {\n sources.forEach(source => {\n if (typeof source === 'undefined' || source === null) {\n return;\n }\n Object.keys(source).forEach(key => {\n target[key] = source[key];\n });\n });\n return target;\n}\n","import {\n DocumentNode,\n OperationDefinitionNode,\n FragmentDefinitionNode,\n ValueNode,\n} from 'graphql';\n\nimport { invariant, InvariantError } from 'ts-invariant';\n\nimport { assign } from './util/assign';\n\nimport { valueToObjectRepresentation, JsonValue } from './storeUtils';\n\nexport function getMutationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode {\n checkDocument(doc);\n\n let mutationDef: OperationDefinitionNode | null = doc.definitions.filter(\n definition =>\n definition.kind === 'OperationDefinition' &&\n definition.operation === 'mutation',\n )[0] as OperationDefinitionNode;\n\n invariant(mutationDef, 'Must contain a mutation definition.');\n\n return mutationDef;\n}\n\n// Checks the document for errors and throws an exception if there is an error.\nexport function checkDocument(doc: DocumentNode) {\n invariant(\n doc && doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n const operations = doc.definitions\n .filter(d => d.kind !== 'FragmentDefinition')\n .map(definition => {\n if (definition.kind !== 'OperationDefinition') {\n throw new InvariantError(\n `Schema type definitions not allowed in queries. Found: \"${\n definition.kind\n }\"`,\n );\n }\n return definition;\n });\n\n invariant(\n operations.length <= 1,\n `Ambiguous GraphQL document: contains ${operations.length} operations`,\n );\n\n return doc;\n}\n\nexport function getOperationDefinition(\n doc: DocumentNode,\n): OperationDefinitionNode | undefined {\n checkDocument(doc);\n return doc.definitions.filter(\n definition => definition.kind === 'OperationDefinition',\n )[0] as OperationDefinitionNode;\n}\n\nexport function getOperationDefinitionOrDie(\n document: DocumentNode,\n): OperationDefinitionNode {\n const def = getOperationDefinition(document);\n invariant(def, `GraphQL document is missing an operation`);\n return def;\n}\n\nexport function getOperationName(doc: DocumentNode): string | null {\n return (\n doc.definitions\n .filter(\n definition =>\n definition.kind === 'OperationDefinition' && definition.name,\n )\n .map((x: OperationDefinitionNode) => x.name.value)[0] || null\n );\n}\n\n// Returns the FragmentDefinitions from a particular document as an array\nexport function getFragmentDefinitions(\n doc: DocumentNode,\n): FragmentDefinitionNode[] {\n return doc.definitions.filter(\n definition => definition.kind === 'FragmentDefinition',\n ) as FragmentDefinitionNode[];\n}\n\nexport function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode {\n const queryDef = getOperationDefinition(doc) as OperationDefinitionNode;\n\n invariant(\n queryDef && queryDef.operation === 'query',\n 'Must contain a query definition.',\n );\n\n return queryDef;\n}\n\nexport function getFragmentDefinition(\n doc: DocumentNode,\n): FragmentDefinitionNode {\n invariant(\n doc.kind === 'Document',\n `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \\\nstring in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql`,\n );\n\n invariant(\n doc.definitions.length <= 1,\n 'Fragment must have exactly one definition.',\n );\n\n const fragmentDef = doc.definitions[0] as FragmentDefinitionNode;\n\n invariant(\n fragmentDef.kind === 'FragmentDefinition',\n 'Must be a fragment definition.',\n );\n\n return fragmentDef as FragmentDefinitionNode;\n}\n\n/**\n * Returns the first operation definition found in this document.\n * If no operation definition is found, the first fragment definition will be returned.\n * If no definitions are found, an error will be thrown.\n */\nexport function getMainDefinition(\n queryDoc: DocumentNode,\n): OperationDefinitionNode | FragmentDefinitionNode {\n checkDocument(queryDoc);\n\n let fragmentDefinition;\n\n for (let definition of queryDoc.definitions) {\n if (definition.kind === 'OperationDefinition') {\n const operation = (definition as OperationDefinitionNode).operation;\n if (\n operation === 'query' ||\n operation === 'mutation' ||\n operation === 'subscription'\n ) {\n return definition as OperationDefinitionNode;\n }\n }\n if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {\n // we do this because we want to allow multiple fragment definitions\n // to precede an operation definition.\n fragmentDefinition = definition as FragmentDefinitionNode;\n }\n }\n\n if (fragmentDefinition) {\n return fragmentDefinition;\n }\n\n throw new InvariantError(\n 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.',\n );\n}\n\n/**\n * This is an interface that describes a map from fragment names to fragment definitions.\n */\nexport interface FragmentMap {\n [fragmentName: string]: FragmentDefinitionNode;\n}\n\n// Utility function that takes a list of fragment definitions and makes a hash out of them\n// that maps the name of the fragment to the fragment definition.\nexport function createFragmentMap(\n fragments: FragmentDefinitionNode[] = [],\n): FragmentMap {\n const symTable: FragmentMap = {};\n fragments.forEach(fragment => {\n symTable[fragment.name.value] = fragment;\n });\n\n return symTable;\n}\n\nexport function getDefaultValues(\n definition: OperationDefinitionNode | undefined,\n): { [key: string]: JsonValue } {\n if (\n definition &&\n definition.variableDefinitions &&\n definition.variableDefinitions.length\n ) {\n const defaultValues = definition.variableDefinitions\n .filter(({ defaultValue }) => defaultValue)\n .map(\n ({ variable, defaultValue }): { [key: string]: JsonValue } => {\n const defaultValueObj: { [key: string]: JsonValue } = {};\n valueToObjectRepresentation(\n defaultValueObj,\n variable.name,\n defaultValue as ValueNode,\n );\n\n return defaultValueObj;\n },\n );\n\n return assign({}, ...defaultValues);\n }\n\n return {};\n}\n\n/**\n * Returns the names of all variables declared by the operation.\n */\nexport function variablesInOperation(\n operation: OperationDefinitionNode,\n): Set {\n const names = new Set();\n if (operation.variableDefinitions) {\n for (const definition of operation.variableDefinitions) {\n names.add(definition.variable.name.value);\n }\n }\n\n return names;\n}\n","export function filterInPlace(\n array: T[],\n test: (elem: T) => boolean,\n context?: any,\n): T[] {\n let target = 0;\n array.forEach(function (elem, i) {\n if (test.call(this, elem, i, array)) {\n array[target++] = elem;\n }\n }, context);\n array.length = target;\n return array;\n}\n","import {\n DocumentNode,\n SelectionNode,\n SelectionSetNode,\n OperationDefinitionNode,\n FieldNode,\n DirectiveNode,\n FragmentDefinitionNode,\n ArgumentNode,\n FragmentSpreadNode,\n VariableDefinitionNode,\n VariableNode,\n} from 'graphql';\nimport { visit } from 'graphql/language/visitor';\n\nimport {\n checkDocument,\n getOperationDefinition,\n getFragmentDefinition,\n getFragmentDefinitions,\n createFragmentMap,\n FragmentMap,\n getMainDefinition,\n} from './getFromAST';\nimport { filterInPlace } from './util/filterInPlace';\nimport { invariant } from 'ts-invariant';\nimport { isField, isInlineFragment } from './storeUtils';\n\nexport type RemoveNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n remove?: boolean;\n};\n\nexport type GetNodeConfig = {\n name?: string;\n test?: (node: N) => boolean;\n};\n\nexport type RemoveDirectiveConfig = RemoveNodeConfig;\nexport type GetDirectiveConfig = GetNodeConfig;\nexport type RemoveArgumentsConfig = RemoveNodeConfig;\nexport type GetFragmentSpreadConfig = GetNodeConfig;\nexport type RemoveFragmentSpreadConfig = RemoveNodeConfig;\nexport type RemoveFragmentDefinitionConfig = RemoveNodeConfig<\n FragmentDefinitionNode\n>;\nexport type RemoveVariableDefinitionConfig = RemoveNodeConfig<\n VariableDefinitionNode\n>;\n\nconst TYPENAME_FIELD: FieldNode = {\n kind: 'Field',\n name: {\n kind: 'Name',\n value: '__typename',\n },\n};\n\nfunction isEmpty(\n op: OperationDefinitionNode | FragmentDefinitionNode,\n fragments: FragmentMap,\n): boolean {\n return op.selectionSet.selections.every(\n selection =>\n selection.kind === 'FragmentSpread' &&\n isEmpty(fragments[selection.name.value], fragments),\n );\n}\n\nfunction nullIfDocIsEmpty(doc: DocumentNode) {\n return isEmpty(\n getOperationDefinition(doc) || getFragmentDefinition(doc),\n createFragmentMap(getFragmentDefinitions(doc)),\n )\n ? null\n : doc;\n}\n\nfunction getDirectiveMatcher(\n directives: (RemoveDirectiveConfig | GetDirectiveConfig)[],\n) {\n return function directiveMatcher(directive: DirectiveNode) {\n return directives.some(\n dir =>\n (dir.name && dir.name === directive.name.value) ||\n (dir.test && dir.test(directive)),\n );\n };\n}\n\nexport function removeDirectivesFromDocument(\n directives: RemoveDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode | null {\n const variablesInUse: Record = Object.create(null);\n let variablesToRemove: RemoveArgumentsConfig[] = [];\n\n const fragmentSpreadsInUse: Record = Object.create(null);\n let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = [];\n\n let modifiedDoc = nullIfDocIsEmpty(\n visit(doc, {\n Variable: {\n enter(node, _key, parent) {\n // Store each variable that's referenced as part of an argument\n // (excluding operation definition variables), so we know which\n // variables are being used. If we later want to remove a variable\n // we'll fist check to see if it's being used, before continuing with\n // the removal.\n if (\n (parent as VariableDefinitionNode).kind !== 'VariableDefinition'\n ) {\n variablesInUse[node.name.value] = true;\n }\n },\n },\n\n Field: {\n enter(node) {\n if (directives && node.directives) {\n // If `remove` is set to true for a directive, and a directive match\n // is found for a field, remove the field as well.\n const shouldRemoveField = directives.some(\n directive => directive.remove,\n );\n\n if (\n shouldRemoveField &&\n node.directives &&\n node.directives.some(getDirectiveMatcher(directives))\n ) {\n if (node.arguments) {\n // Store field argument variables so they can be removed\n // from the operation definition.\n node.arguments.forEach(arg => {\n if (arg.value.kind === 'Variable') {\n variablesToRemove.push({\n name: (arg.value as VariableNode).name.value,\n });\n }\n });\n }\n\n if (node.selectionSet) {\n // Store fragment spread names so they can be removed from the\n // docuemnt.\n getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(\n frag => {\n fragmentSpreadsToRemove.push({\n name: frag.name.value,\n });\n },\n );\n }\n\n // Remove the field.\n return null;\n }\n }\n },\n },\n\n FragmentSpread: {\n enter(node) {\n // Keep track of referenced fragment spreads. This is used to\n // determine if top level fragment definitions should be removed.\n fragmentSpreadsInUse[node.name.value] = true;\n },\n },\n\n Directive: {\n enter(node) {\n // If a matching directive is found, remove it.\n if (getDirectiveMatcher(directives)(node)) {\n return null;\n }\n },\n },\n }),\n );\n\n // If we've removed fields with arguments, make sure the associated\n // variables are also removed from the rest of the document, as long as they\n // aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length\n ) {\n modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc);\n }\n\n // If we've removed selection sets with fragment spreads, make sure the\n // associated fragment definitions are also removed from the rest of the\n // document, as long as they aren't being used elsewhere.\n if (\n modifiedDoc &&\n filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name])\n .length\n ) {\n modifiedDoc = removeFragmentSpreadFromDocument(\n fragmentSpreadsToRemove,\n modifiedDoc,\n );\n }\n\n return modifiedDoc;\n}\n\nexport function addTypenameToDocument(doc: DocumentNode): DocumentNode {\n return visit(checkDocument(doc), {\n SelectionSet: {\n enter(node, _key, parent) {\n // Don't add __typename to OperationDefinitions.\n if (\n parent &&\n (parent as OperationDefinitionNode).kind === 'OperationDefinition'\n ) {\n return;\n }\n\n // No changes if no selections.\n const { selections } = node;\n if (!selections) {\n return;\n }\n\n // If selections already have a __typename, or are part of an\n // introspection query, do nothing.\n const skip = selections.some(selection => {\n return (\n isField(selection) &&\n (selection.name.value === '__typename' ||\n selection.name.value.lastIndexOf('__', 0) === 0)\n );\n });\n if (skip) {\n return;\n }\n\n // If this SelectionSet is @export-ed as an input variable, it should\n // not have a __typename field (see issue #4691).\n const field = parent as FieldNode;\n if (\n isField(field) &&\n field.directives &&\n field.directives.some(d => d.name.value === 'export')\n ) {\n return;\n }\n\n // Create and return a new SelectionSet with a __typename Field.\n return {\n ...node,\n selections: [...selections, TYPENAME_FIELD],\n };\n },\n },\n });\n}\n\nconst connectionRemoveConfig = {\n test: (directive: DirectiveNode) => {\n const willRemove = directive.name.value === 'connection';\n if (willRemove) {\n if (\n !directive.arguments ||\n !directive.arguments.some(arg => arg.name.value === 'key')\n ) {\n invariant.warn(\n 'Removing an @connection directive even though it does not have a key. ' +\n 'You may want to use the key parameter to specify a store key.',\n );\n }\n }\n\n return willRemove;\n },\n};\n\nexport function removeConnectionDirectiveFromDocument(doc: DocumentNode) {\n return removeDirectivesFromDocument(\n [connectionRemoveConfig],\n checkDocument(doc),\n );\n}\n\nfunction hasDirectivesInSelectionSet(\n directives: GetDirectiveConfig[],\n selectionSet: SelectionSetNode,\n nestedCheck = true,\n): boolean {\n return (\n selectionSet &&\n selectionSet.selections &&\n selectionSet.selections.some(selection =>\n hasDirectivesInSelection(directives, selection, nestedCheck),\n )\n );\n}\n\nfunction hasDirectivesInSelection(\n directives: GetDirectiveConfig[],\n selection: SelectionNode,\n nestedCheck = true,\n): boolean {\n if (!isField(selection)) {\n return true;\n }\n\n if (!selection.directives) {\n return false;\n }\n\n return (\n selection.directives.some(getDirectiveMatcher(directives)) ||\n (nestedCheck &&\n hasDirectivesInSelectionSet(\n directives,\n selection.selectionSet,\n nestedCheck,\n ))\n );\n}\n\nexport function getDirectivesFromDocument(\n directives: GetDirectiveConfig[],\n doc: DocumentNode,\n): DocumentNode {\n checkDocument(doc);\n\n let parentPath: string;\n\n return nullIfDocIsEmpty(\n visit(doc, {\n SelectionSet: {\n enter(node, _key, _parent, path) {\n const currentPath = path.join('-');\n\n if (\n !parentPath ||\n currentPath === parentPath ||\n !currentPath.startsWith(parentPath)\n ) {\n if (node.selections) {\n const selectionsWithDirectives = node.selections.filter(\n selection => hasDirectivesInSelection(directives, selection),\n );\n\n if (hasDirectivesInSelectionSet(directives, node, false)) {\n parentPath = currentPath;\n }\n\n return {\n ...node,\n selections: selectionsWithDirectives,\n };\n } else {\n return null;\n }\n }\n },\n },\n }),\n );\n}\n\nfunction getArgumentMatcher(config: RemoveArgumentsConfig[]) {\n return function argumentMatcher(argument: ArgumentNode) {\n return config.some(\n (aConfig: RemoveArgumentsConfig) =>\n argument.value &&\n argument.value.kind === 'Variable' &&\n argument.value.name &&\n (aConfig.name === argument.value.name.value ||\n (aConfig.test && aConfig.test(argument))),\n );\n };\n}\n\nexport function removeArgumentsFromDocument(\n config: RemoveArgumentsConfig[],\n doc: DocumentNode,\n): DocumentNode {\n const argMatcher = getArgumentMatcher(config);\n\n return nullIfDocIsEmpty(\n visit(doc, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n // Remove matching top level variables definitions.\n variableDefinitions: node.variableDefinitions.filter(\n varDef =>\n !config.some(arg => arg.name === varDef.variable.name.value),\n ),\n };\n },\n },\n\n Field: {\n enter(node) {\n // If `remove` is set to true for an argument, and an argument match\n // is found for a field, remove the field as well.\n const shouldRemoveField = config.some(argConfig => argConfig.remove);\n\n if (shouldRemoveField) {\n let argMatchCount = 0;\n node.arguments.forEach(arg => {\n if (argMatcher(arg)) {\n argMatchCount += 1;\n }\n });\n if (argMatchCount === 1) {\n return null;\n }\n }\n },\n },\n\n Argument: {\n enter(node) {\n // Remove all matching arguments.\n if (argMatcher(node)) {\n return null;\n }\n },\n },\n }),\n );\n}\n\nexport function removeFragmentSpreadFromDocument(\n config: RemoveFragmentSpreadConfig[],\n doc: DocumentNode,\n): DocumentNode {\n function enter(\n node: FragmentSpreadNode | FragmentDefinitionNode,\n ): null | void {\n if (config.some(def => def.name === node.name.value)) {\n return null;\n }\n }\n\n return nullIfDocIsEmpty(\n visit(doc, {\n FragmentSpread: { enter },\n FragmentDefinition: { enter },\n }),\n );\n}\n\nfunction getAllFragmentSpreadsFromSelectionSet(\n selectionSet: SelectionSetNode,\n): FragmentSpreadNode[] {\n const allFragments: FragmentSpreadNode[] = [];\n\n selectionSet.selections.forEach(selection => {\n if (\n (isField(selection) || isInlineFragment(selection)) &&\n selection.selectionSet\n ) {\n getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(\n frag => allFragments.push(frag),\n );\n } else if (selection.kind === 'FragmentSpread') {\n allFragments.push(selection);\n }\n });\n\n return allFragments;\n}\n\n// If the incoming document is a query, return it as is. Otherwise, build a\n// new document containing a query operation based on the selection set\n// of the previous main operation.\nexport function buildQueryFromSelectionSet(\n document: DocumentNode,\n): DocumentNode {\n const definition = getMainDefinition(document);\n const definitionOperation = (definition).operation;\n\n if (definitionOperation === 'query') {\n // Already a query, so return the existing document.\n return document;\n }\n\n // Build a new query using the selection set of the main operation.\n const modifiedDoc = visit(document, {\n OperationDefinition: {\n enter(node) {\n return {\n ...node,\n operation: 'query',\n };\n },\n },\n });\n return modifiedDoc;\n}\n\n// Remove fields / selection sets that include an @client directive.\nexport function removeClientSetsFromDocument(\n document: DocumentNode,\n): DocumentNode | null {\n checkDocument(document);\n\n let modifiedDoc = removeDirectivesFromDocument(\n [\n {\n test: (directive: DirectiveNode) => directive.name.value === 'client',\n remove: true,\n },\n ],\n document,\n );\n\n // After a fragment definition has had its @client related document\n // sets removed, if the only field it has left is a __typename field,\n // remove the entire fragment operation to prevent it from being fired\n // on the server.\n if (modifiedDoc) {\n modifiedDoc = visit(modifiedDoc, {\n FragmentDefinition: {\n enter(node) {\n if (node.selectionSet) {\n const isTypenameOnly = node.selectionSet.selections.every(\n selection =>\n isField(selection) && selection.name.value === '__typename',\n );\n if (isTypenameOnly) {\n return null;\n }\n }\n },\n },\n });\n }\n\n return modifiedDoc;\n}\n","export const canUseWeakMap = typeof WeakMap === 'function' && !(\n typeof navigator === 'object' &&\n navigator.product === 'ReactNative'\n);\n","const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep(value: T): T {\n return cloneDeepHelper(value, new Map());\n}\n\nfunction cloneDeepHelper(val: T, seen: Map): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n","export function getEnv(): string | undefined {\n if (typeof process !== 'undefined' && process.env.NODE_ENV) {\n return process.env.NODE_ENV;\n }\n\n // default environment\n return 'development';\n}\n\nexport function isEnv(env: string): boolean {\n return getEnv() === env;\n}\n\nexport function isProduction(): boolean {\n return isEnv('production') === true;\n}\n\nexport function isDevelopment(): boolean {\n return isEnv('development') === true;\n}\n\nexport function isTest(): boolean {\n return isEnv('test') === true;\n}\n","import { ExecutionResult } from 'graphql';\n\nexport function tryFunctionOrLogError(f: Function) {\n try {\n return f();\n } catch (e) {\n if (console.error) {\n console.error(e);\n }\n }\n}\n\nexport function graphQLResultHasError(result: ExecutionResult) {\n return result.errors && result.errors.length;\n}\n","import { isDevelopment, isTest } from './environment';\n\n// Taken (mostly) from https://github.com/substack/deep-freeze to avoid\n// import hassles with rollup.\nfunction deepFreeze(o: any) {\n Object.freeze(o);\n\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])\n ) {\n deepFreeze(o[prop]);\n }\n });\n\n return o;\n}\n\nexport function maybeDeepFreeze(obj: any) {\n if (isDevelopment() || isTest()) {\n // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing\n // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043).\n const symbolIsPolyfilled =\n typeof Symbol === 'function' && typeof Symbol('') === 'string';\n\n if (!symbolIsPolyfilled) {\n return deepFreeze(obj);\n }\n }\n return obj;\n}\n","const { hasOwnProperty } = Object.prototype;\n\n// These mergeDeep and mergeDeepArray utilities merge any number of objects\n// together, sharing as much memory as possible with the source objects, while\n// remaining careful to avoid modifying any source objects.\n\n// Logically, the return type of mergeDeep should be the intersection of\n// all the argument types. The binary call signature is by far the most\n// common, but we support 0- through 5-ary as well. After that, the\n// resulting type is just the inferred array element type. Note to nerds:\n// there is a more clever way of doing this that converts the tuple type\n// first to a union type (easy enough: T[number]) and then converts the\n// union to an intersection type using distributive conditional type\n// inference, but that approach has several fatal flaws (boolean becomes\n// true & false, and the inferred type ends up as unknown in many cases),\n// in addition to being nearly impossible to explain/understand.\nexport type TupleToIntersection =\n T extends [infer A] ? A :\n T extends [infer A, infer B] ? A & B :\n T extends [infer A, infer B, infer C] ? A & B & C :\n T extends [infer A, infer B, infer C, infer D] ? A & B & C & D :\n T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E :\n T extends (infer U)[] ? U : any;\n\nexport function mergeDeep(\n ...sources: T\n): TupleToIntersection {\n return mergeDeepArray(sources);\n}\n\n// In almost any situation where you could succeed in getting the\n// TypeScript compiler to infer a tuple type for the sources array, you\n// could just use mergeDeep instead of mergeDeepArray, so instead of\n// trying to convert T[] to an intersection type we just infer the array\n// element type, which works perfectly when the sources array has a\n// consistent element type.\nexport function mergeDeepArray(sources: T[]): T {\n let target = sources[0] || {} as T;\n const count = sources.length;\n if (count > 1) {\n const pastCopies: any[] = [];\n target = shallowCopyForMerge(target, pastCopies);\n for (let i = 1; i < count; ++i) {\n target = mergeHelper(target, sources[i], pastCopies);\n }\n }\n return target;\n}\n\nfunction isObject(obj: any): obj is Record {\n return obj !== null && typeof obj === 'object';\n}\n\nfunction mergeHelper(\n target: any,\n source: any,\n pastCopies: any[],\n) {\n if (isObject(source) && isObject(target)) {\n // In case the target has been frozen, make an extensible copy so that\n // we can merge properties into the copy.\n if (Object.isExtensible && !Object.isExtensible(target)) {\n target = shallowCopyForMerge(target, pastCopies);\n }\n\n Object.keys(source).forEach(sourceKey => {\n const sourceValue = source[sourceKey];\n if (hasOwnProperty.call(target, sourceKey)) {\n const targetValue = target[sourceKey];\n if (sourceValue !== targetValue) {\n // When there is a key collision, we need to make a shallow copy of\n // target[sourceKey] so the merge does not modify any source objects.\n // To avoid making unnecessary copies, we use a simple array to track\n // past copies, since it's safe to modify copies created earlier in\n // the merge. We use an array for pastCopies instead of a Map or Set,\n // since the number of copies should be relatively small, and some\n // Map/Set polyfills modify their keys.\n target[sourceKey] = mergeHelper(\n shallowCopyForMerge(targetValue, pastCopies),\n sourceValue,\n pastCopies,\n );\n }\n } else {\n // If there is no collision, the target can safely share memory with\n // the source, and the recursion can terminate here.\n target[sourceKey] = sourceValue;\n }\n });\n\n return target;\n }\n\n // If source (or target) is not an object, let source replace target.\n return source;\n}\n\nfunction shallowCopyForMerge(value: T, pastCopies: any[]): T {\n if (\n value !== null &&\n typeof value === 'object' &&\n pastCopies.indexOf(value) < 0\n ) {\n if (Array.isArray(value)) {\n value = (value as any).slice(0);\n } else {\n value = {\n __proto__: Object.getPrototypeOf(value),\n ...value,\n };\n }\n pastCopies.push(value);\n }\n return value;\n}\n","import { isProduction, isTest } from './environment';\n\nconst haveWarned = Object.create({});\n\n/**\n * Print a warning only once in development.\n * In production no warnings are printed.\n * In test all warnings are printed.\n *\n * @param msg The warning message\n * @param type warn or error (will call console.warn or console.error)\n */\nexport function warnOnceInDevelopment(msg: string, type = 'warn') {\n if (!isProduction() && !haveWarned[msg]) {\n if (!isTest()) {\n haveWarned[msg] = true;\n }\n if (type === 'error') {\n console.error(msg);\n } else {\n console.warn(msg);\n }\n }\n}\n","/**\n * In order to make assertions easier, this function strips `symbol`'s from\n * the incoming data.\n *\n * This can be handy when running tests against `apollo-client` for example,\n * since it adds `symbol`'s to the data in the store. Jest's `toEqual`\n * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437),\n * which means all test data used in a `toEqual` comparison would also have to\n * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data\n * we can compare against more simplified test data.\n */\nexport function stripSymbols(data: T): T {\n return JSON.parse(JSON.stringify(data));\n}\n"]} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.d.ts b/node_modules/apollo-utilities/lib/directives.d.ts deleted file mode 100644 index 5389a83..0000000 --- a/node_modules/apollo-utilities/lib/directives.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldNode, SelectionNode, DirectiveNode, DocumentNode, ArgumentNode } from 'graphql'; -export declare type DirectiveInfo = { - [fieldName: string]: { - [argName: string]: any; - }; -}; -export declare function getDirectiveInfoFromField(field: FieldNode, variables: Object): DirectiveInfo; -export declare function shouldInclude(selection: SelectionNode, variables?: { - [name: string]: any; -}): boolean; -export declare function getDirectiveNames(doc: DocumentNode): string[]; -export declare function hasDirectives(names: string[], doc: DocumentNode): boolean; -export declare function hasClientExports(document: DocumentNode): boolean; -export declare type InclusionDirectives = Array<{ - directive: DirectiveNode; - ifArgument: ArgumentNode; -}>; -export declare function getInclusionDirectives(directives: ReadonlyArray): InclusionDirectives; -//# sourceMappingURL=directives.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.d.ts.map b/node_modules/apollo-utilities/lib/directives.d.ts.map deleted file mode 100644 index 4da04b6..0000000 --- a/node_modules/apollo-utilities/lib/directives.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["src/directives.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,aAAa,EAGb,aAAa,EACb,YAAY,EACZ,YAAY,EAEb,MAAM,SAAS,CAAC;AAQjB,oBAAY,aAAa,GAAG;IAC1B,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACjD,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,GAChB,aAAa,CAYf;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,aAAa,EACxB,SAAS,GAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAO,GACtC,OAAO,CAgBT;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,YAUlD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,YAAY,WAI/D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,WAMtD;AAED,oBAAY,mBAAmB,GAAG,KAAK,CAAC;IACtC,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,YAAY,CAAC;CAC1B,CAAC,CAAC;AAMH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,aAAa,CAAC,aAAa,CAAC,GACvC,mBAAmB,CA2BrB"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.js b/node_modules/apollo-utilities/lib/directives.js deleted file mode 100644 index 41a8a9d..0000000 --- a/node_modules/apollo-utilities/lib/directives.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var visitor_1 = require("graphql/language/visitor"); -var ts_invariant_1 = require("ts-invariant"); -var storeUtils_1 = require("./storeUtils"); -function getDirectiveInfoFromField(field, variables) { - if (field.directives && field.directives.length) { - var directiveObj_1 = {}; - field.directives.forEach(function (directive) { - directiveObj_1[directive.name.value] = storeUtils_1.argumentsObjectFromField(directive, variables); - }); - return directiveObj_1; - } - return null; -} -exports.getDirectiveInfoFromField = getDirectiveInfoFromField; -function shouldInclude(selection, variables) { - if (variables === void 0) { variables = {}; } - return getInclusionDirectives(selection.directives).every(function (_a) { - var directive = _a.directive, ifArgument = _a.ifArgument; - var evaledValue = false; - if (ifArgument.value.kind === 'Variable') { - evaledValue = variables[ifArgument.value.name.value]; - ts_invariant_1.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive."); - } - else { - evaledValue = ifArgument.value.value; - } - return directive.name.value === 'skip' ? !evaledValue : evaledValue; - }); -} -exports.shouldInclude = shouldInclude; -function getDirectiveNames(doc) { - var names = []; - visitor_1.visit(doc, { - Directive: function (node) { - names.push(node.name.value); - }, - }); - return names; -} -exports.getDirectiveNames = getDirectiveNames; -function hasDirectives(names, doc) { - return getDirectiveNames(doc).some(function (name) { return names.indexOf(name) > -1; }); -} -exports.hasDirectives = hasDirectives; -function hasClientExports(document) { - return (document && - hasDirectives(['client'], document) && - hasDirectives(['export'], document)); -} -exports.hasClientExports = hasClientExports; -function isInclusionDirective(_a) { - var value = _a.name.value; - return value === 'skip' || value === 'include'; -} -function getInclusionDirectives(directives) { - return directives ? directives.filter(isInclusionDirective).map(function (directive) { - var directiveArguments = directive.arguments; - var directiveName = directive.name.value; - ts_invariant_1.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive."); - var ifArgument = directiveArguments[0]; - ts_invariant_1.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive."); - var ifValue = ifArgument.value; - ts_invariant_1.invariant(ifValue && - (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value."); - return { directive: directive, ifArgument: ifArgument }; - }) : []; -} -exports.getInclusionDirectives = getInclusionDirectives; -//# sourceMappingURL=directives.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/directives.js.map b/node_modules/apollo-utilities/lib/directives.js.map deleted file mode 100644 index 915e07f..0000000 --- a/node_modules/apollo-utilities/lib/directives.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"directives.js","sourceRoot":"","sources":["../src/directives.ts"],"names":[],"mappings":";;AAaA,oDAAiD;AAEjD,6CAAyC;AAEzC,2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AI,EACjD,+BAA6B,aAAa,gBAAa,CACxD,CAAC;QAEF,IAAM,OAAO,GAAc,UAAU,CAAC,KAAK,CAAC;QAG5C,wBAAS,CACP,OAAO;YACL,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,EAClE,uBAAqB,aAAa,sDAAmD,CACtF,CAAC;QAEF,OAAO,EAAE,SAAS,WAAA,EAAE,UAAU,YAAA,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACV,CAAC;AA7BD,wDA6BC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.d.ts b/node_modules/apollo-utilities/lib/fragments.d.ts deleted file mode 100644 index 8141196..0000000 --- a/node_modules/apollo-utilities/lib/fragments.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { DocumentNode } from 'graphql'; -export declare function getFragmentQueryDocument(document: DocumentNode, fragmentName?: string): DocumentNode; -//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.d.ts.map b/node_modules/apollo-utilities/lib/fragments.d.ts.map deleted file mode 100644 index cbff38a..0000000 --- a/node_modules/apollo-utilities/lib/fragments.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["src/fragments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,SAAS,CAAC;AAyB/D,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,YAAY,EACtB,YAAY,CAAC,EAAE,MAAM,GACpB,YAAY,CA+Dd"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.js b/node_modules/apollo-utilities/lib/fragments.js deleted file mode 100644 index 5b6e8f8..0000000 --- a/node_modules/apollo-utilities/lib/fragments.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var ts_invariant_1 = require("ts-invariant"); -function getFragmentQueryDocument(document, fragmentName) { - var actualFragmentName = fragmentName; - var fragments = []; - document.definitions.forEach(function (definition) { - if (definition.kind === 'OperationDefinition') { - throw new ts_invariant_1.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " + - 'No operations are allowed when using a fragment as a query. Only fragments are allowed.'); - } - if (definition.kind === 'FragmentDefinition') { - fragments.push(definition); - } - }); - if (typeof actualFragmentName === 'undefined') { - ts_invariant_1.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment."); - actualFragmentName = fragments[0].name.value; - } - var query = tslib_1.__assign(tslib_1.__assign({}, document), { definitions: tslib_1.__spreadArrays([ - { - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName, - }, - }, - ], - }, - } - ], document.definitions) }); - return query; -} -exports.getFragmentQueryDocument = getFragmentQueryDocument; -//# sourceMappingURL=fragments.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/fragments.js.map b/node_modules/apollo-utilities/lib/fragments.js.map deleted file mode 100644 index ece1e37..0000000 --- a/node_modules/apollo-utilities/lib/fragments.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../src/fragments.ts"],"names":[],"mappings":";;;AACA,6CAAyD;AAwBzD,SAAgB,wBAAwB,CACtC,QAAsB,EACtB,YAAqB;IAErB,IAAI,kBAAkB,GAAG,YAAY,CAAC;IAKtC,IAAM,SAAS,GAAkC,EAAE,CAAC;IACpD,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,UAAA,UAAU;QAGrC,IAAI,UAAU,CAAC,IAAI,KAAK,qBAAqB,EAAE;YAC7C,MAAM,IAAI,6BAAc,CACtB,aAAW,UAAU,CAAC,SAAS,mBAC7B,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,aAAW,UAAU,CAAC,IAAI,CAAC,KAAK,MAAG,CAAC,CAAC,CAAC,EAAE,QACxD;gBACF,yFAAyF,CAC5F,CAAC;SACH;QAGD,IAAI,UAAU,CAAC,IAAI,KAAK,oBAAoB,EAAE;YAC5C,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC5B;IACH,CAAC,CAAC,CAAC;IAIH,IAAI,OAAO,kBAAkB,KAAK,WAAW,EAAE;QAC7C,wBAAS,CACP,SAAS,CAAC,MAAM,KAAK,CAAC,EACtB,WACE,SAAS,CAAC,MAAM,sFACmE,CACtF,CAAC;QACF,kBAAkB,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;KAC9C;IAID,IAAM,KAAK,yCACN,QAAQ,KACX,WAAW;YACT;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,SAAS,EAAE,OAAO;gBAClB,YAAY,EAAE;oBACZ,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACV;4BACE,IAAI,EAAE,gBAAgB;4BACtB,IAAI,EAAE;gCACJ,IAAI,EAAE,MAAM;gCACZ,KAAK,EAAE,kBAAkB;6BAC1B;yBACF;qBACF;iBACF;aACF;WACE,QAAQ,CAAC,WAAW,IAE1B,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAlED,4DAkEC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/getFromAST.d.ts b/node_modules/apollo-utilities/lib/getFromAST.d.ts deleted file mode 100644 index d002918..0000000 --- a/node_modules/apollo-utilities/lib/getFromAST.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { DocumentNode, OperationDefinitionNode, FragmentDefinitionNode } from 'graphql'; -import { JsonValue } from './storeUtils'; -export declare function getMutationDefinition(doc: DocumentNode): OperationDefinitionNode; -export declare function checkDocument(doc: DocumentNode): DocumentNode; -export declare function getOperationDefinition(doc: DocumentNode): OperationDefinitionNode | undefined; -export declare function getOperationDefinitionOrDie(document: DocumentNode): OperationDefinitionNode; -export declare function getOperationName(doc: DocumentNode): string | null; -export declare function getFragmentDefinitions(doc: DocumentNode): FragmentDefinitionNode[]; -export declare function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode; -export declare function getFragmentDefinition(doc: DocumentNode): FragmentDefinitionNode; -export declare function getMainDefinition(queryDoc: DocumentNode): OperationDefinitionNode | FragmentDefinitionNode; -export interface FragmentMap { - [fragmentName: string]: FragmentDefinitionNode; -} -export declare function createFragmentMap(fragments?: FragmentDefinitionNode[]): FragmentMap; -export declare function getDefaultValues(definition: OperationDefinitionNode | undefined): { - [key: string]: JsonValue; -}; -export declare function variablesInOperation(operation: OperationDefinitionNode): Set; -//# sourceMappingURL=getFromAST.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/getFromAST.d.ts.map b/node_modules/apollo-utilities/lib/getFromAST.d.ts.map deleted file mode 100644 index ef2f994..0000000 --- a/node_modules/apollo-utilities/lib/getFromAST.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"getFromAST.d.ts","sourceRoot":"","sources":["src/getFromAST.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAMjB,OAAO,EAA+B,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtE,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,GAChB,uBAAuB,CAYzB;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,gBA0B9C;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,YAAY,GAChB,uBAAuB,GAAG,SAAS,CAKrC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,YAAY,GACrB,uBAAuB,CAIzB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CASjE;AAGD,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,YAAY,GAChB,sBAAsB,EAAE,CAI1B;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,uBAAuB,CAS7E;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,GAChB,sBAAsB,CAoBxB;AAOD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,YAAY,GACrB,uBAAuB,GAAG,sBAAsB,CA8BlD;AAKD,MAAM,WAAW,WAAW;IAC1B,CAAC,YAAY,EAAE,MAAM,GAAG,sBAAsB,CAAC;CAChD;AAID,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,sBAAsB,EAAO,GACvC,WAAW,CAOb;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,uBAAuB,GAAG,SAAS,GAC9C;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAyB9B;AAKD,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,uBAAuB,GACjC,GAAG,CAAC,MAAM,CAAC,CASb"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/getFromAST.js b/node_modules/apollo-utilities/lib/getFromAST.js deleted file mode 100644 index 39f4e5a..0000000 --- a/node_modules/apollo-utilities/lib/getFromAST.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var ts_invariant_1 = require("ts-invariant"); -var assign_1 = require("./util/assign"); -var storeUtils_1 = require("./storeUtils"); -function getMutationDefinition(doc) { - checkDocument(doc); - var mutationDef = doc.definitions.filter(function (definition) { - return definition.kind === 'OperationDefinition' && - definition.operation === 'mutation'; - })[0]; - ts_invariant_1.invariant(mutationDef, 'Must contain a mutation definition.'); - return mutationDef; -} -exports.getMutationDefinition = getMutationDefinition; -function checkDocument(doc) { - ts_invariant_1.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - var operations = doc.definitions - .filter(function (d) { return d.kind !== 'FragmentDefinition'; }) - .map(function (definition) { - if (definition.kind !== 'OperationDefinition') { - throw new ts_invariant_1.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); - } - return definition; - }); - ts_invariant_1.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations"); - return doc; -} -exports.checkDocument = checkDocument; -function getOperationDefinition(doc) { - checkDocument(doc); - return doc.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; })[0]; -} -exports.getOperationDefinition = getOperationDefinition; -function getOperationDefinitionOrDie(document) { - var def = getOperationDefinition(document); - ts_invariant_1.invariant(def, "GraphQL document is missing an operation"); - return def; -} -exports.getOperationDefinitionOrDie = getOperationDefinitionOrDie; -function getOperationName(doc) { - return (doc.definitions - .filter(function (definition) { - return definition.kind === 'OperationDefinition' && definition.name; - }) - .map(function (x) { return x.name.value; })[0] || null); -} -exports.getOperationName = getOperationName; -function getFragmentDefinitions(doc) { - return doc.definitions.filter(function (definition) { return definition.kind === 'FragmentDefinition'; }); -} -exports.getFragmentDefinitions = getFragmentDefinitions; -function getQueryDefinition(doc) { - var queryDef = getOperationDefinition(doc); - ts_invariant_1.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); - return queryDef; -} -exports.getQueryDefinition = getQueryDefinition; -function getFragmentDefinition(doc) { - ts_invariant_1.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"); - ts_invariant_1.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.'); - var fragmentDef = doc.definitions[0]; - ts_invariant_1.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.'); - return fragmentDef; -} -exports.getFragmentDefinition = getFragmentDefinition; -function getMainDefinition(queryDoc) { - checkDocument(queryDoc); - var fragmentDefinition; - for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) { - var definition = _a[_i]; - if (definition.kind === 'OperationDefinition') { - var operation = definition.operation; - if (operation === 'query' || - operation === 'mutation' || - operation === 'subscription') { - return definition; - } - } - if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { - fragmentDefinition = definition; - } - } - if (fragmentDefinition) { - return fragmentDefinition; - } - throw new ts_invariant_1.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.'); -} -exports.getMainDefinition = getMainDefinition; -function createFragmentMap(fragments) { - if (fragments === void 0) { fragments = []; } - var symTable = {}; - fragments.forEach(function (fragment) { - symTable[fragment.name.value] = fragment; - }); - return symTable; -} -exports.createFragmentMap = createFragmentMap; -function getDefaultValues(definition) { - if (definition && - definition.variableDefinitions && - definition.variableDefinitions.length) { - var defaultValues = definition.variableDefinitions - .filter(function (_a) { - var defaultValue = _a.defaultValue; - return defaultValue; - }) - .map(function (_a) { - var variable = _a.variable, defaultValue = _a.defaultValue; - var defaultValueObj = {}; - storeUtils_1.valueToObjectRepresentation(defaultValueObj, variable.name, defaultValue); - return defaultValueObj; - }); - return assign_1.assign.apply(void 0, tslib_1.__spreadArrays([{}], defaultValues)); - } - return {}; -} -exports.getDefaultValues = getDefaultValues; -function variablesInOperation(operation) { - var names = new Set(); - if (operation.variableDefinitions) { - for (var _i = 0, _a = operation.variableDefinitions; _i < _a.length; _i++) { - var definition = _a[_i]; - names.add(definition.variable.name.value); - } - } - return names; -} -exports.variablesInOperation = variablesInOperation; -//# sourceMappingURL=getFromAST.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/getFromAST.js.map b/node_modules/apollo-utilities/lib/getFromAST.js.map deleted file mode 100644 index 88d74a5..0000000 --- a/node_modules/apollo-utilities/lib/getFromAST.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"getFromAST.js","sourceRoot":"","sources":["../src/getFromAST.ts"],"names":[],"mappings":";;;AAOA,6CAAyD;AAEzD,wCAAuC;AA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mBAAmB,CAAC,MAAM,EACrC;QACA,IAAM,aAAa,GAAG,UAAU,CAAC,mBAAmB;aACjD,MAAM,CAAC,UAAC,EAAgB;gBAAd,8BAAY;YAAO,OAAA,YAAY;QAAZ,CAAY,CAAC;aAC1C,GAAG,CACF,UAAC,EAA0B;gBAAxB,sBAAQ,EAAE,8BAAY;YACvB,IAAM,eAAe,GAAiC,EAAE,CAAC;YACzD,wCAA2B,CACzB,eAAe,EACf,QAAQ,CAAC,IAAI,EACb,YAAyB,CAC1B,CAAC;YAEF,OAAO,eAAe,CAAC;QACzB,CAAC,CACF,CAAC;QAEJ,OAAO,eAAM,uCAAC,EAAE,GAAK,aAAa,GAAE;KACrC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AA3BD,4CA2BC;AAKD,SAAgB,oBAAoB,CAClC,SAAkC;IAElC,IAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,IAAI,SAAS,CAAC,mBAAmB,EAAE;QACjC,KAAyB,UAA6B,EAA7B,KAAA,SAAS,CAAC,mBAAmB,EAA7B,cAA6B,EAA7B,IAA6B,EAAE;YAAnD,IAAM,UAAU,SAAA;YACnB,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC3C;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAXD,oDAWC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.d.ts b/node_modules/apollo-utilities/lib/index.d.ts deleted file mode 100644 index 4aef870..0000000 --- a/node_modules/apollo-utilities/lib/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export * from './directives'; -export * from './fragments'; -export * from './getFromAST'; -export * from './transform'; -export * from './storeUtils'; -export * from './util/assign'; -export * from './util/canUse'; -export * from './util/cloneDeep'; -export * from './util/environment'; -export * from './util/errorHandling'; -export * from './util/isEqual'; -export * from './util/maybeDeepFreeze'; -export * from './util/mergeDeep'; -export * from './util/warnOnce'; -export * from './util/stripSymbols'; -export * from './util/mergeDeep'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.d.ts.map b/node_modules/apollo-utilities/lib/index.d.ts.map deleted file mode 100644 index 65614a6..0000000 --- a/node_modules/apollo-utilities/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.js b/node_modules/apollo-utilities/lib/index.js deleted file mode 100644 index 0693303..0000000 --- a/node_modules/apollo-utilities/lib/index.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./directives"), exports); -tslib_1.__exportStar(require("./fragments"), exports); -tslib_1.__exportStar(require("./getFromAST"), exports); -tslib_1.__exportStar(require("./transform"), exports); -tslib_1.__exportStar(require("./storeUtils"), exports); -tslib_1.__exportStar(require("./util/assign"), exports); -tslib_1.__exportStar(require("./util/canUse"), exports); -tslib_1.__exportStar(require("./util/cloneDeep"), exports); -tslib_1.__exportStar(require("./util/environment"), exports); -tslib_1.__exportStar(require("./util/errorHandling"), exports); -tslib_1.__exportStar(require("./util/isEqual"), exports); -tslib_1.__exportStar(require("./util/maybeDeepFreeze"), exports); -tslib_1.__exportStar(require("./util/mergeDeep"), exports); -tslib_1.__exportStar(require("./util/warnOnce"), exports); -tslib_1.__exportStar(require("./util/stripSymbols"), exports); -tslib_1.__exportStar(require("./util/mergeDeep"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/index.js.map b/node_modules/apollo-utilities/lib/index.js.map deleted file mode 100644 index 3c41b70..0000000 --- a/node_modules/apollo-utilities/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B;AAC5B,uDAA6B;AAC7B,wDAA8B;AAC9B,wDAA8B;AAC9B,2DAAiC;AACjC,6DAAmC;AACnC,+DAAqC;AACrC,yDAA+B;AAC/B,iEAAuC;AACvC,2DAAiC;AACjC,0DAAgC;AAChC,8DAAoC;AACpC,2DAAiC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.d.ts b/node_modules/apollo-utilities/lib/storeUtils.d.ts deleted file mode 100644 index 57ec870..0000000 --- a/node_modules/apollo-utilities/lib/storeUtils.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { DirectiveNode, FieldNode, IntValueNode, FloatValueNode, StringValueNode, BooleanValueNode, EnumValueNode, VariableNode, InlineFragmentNode, ValueNode, SelectionNode, NameNode } from 'graphql'; -export interface IdValue { - type: 'id'; - id: string; - generated: boolean; - typename: string | undefined; -} -export interface JsonValue { - type: 'json'; - json: any; -} -export declare type ListValue = Array; -export declare type StoreValue = number | string | string[] | IdValue | ListValue | JsonValue | null | undefined | void | Object; -export declare type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode; -export declare function isScalarValue(value: ValueNode): value is ScalarValue; -export declare type NumberValue = IntValueNode | FloatValueNode; -export declare function isNumberValue(value: ValueNode): value is NumberValue; -export declare function valueToObjectRepresentation(argObj: any, name: NameNode, value: ValueNode, variables?: Object): void; -export declare function storeKeyNameFromField(field: FieldNode, variables?: Object): string; -export declare type Directives = { - [directiveName: string]: { - [argName: string]: any; - }; -}; -export declare function getStoreKeyName(fieldName: string, args?: Object, directives?: Directives): string; -export declare function argumentsObjectFromField(field: FieldNode | DirectiveNode, variables: Object): Object; -export declare function resultKeyNameFromField(field: FieldNode): string; -export declare function isField(selection: SelectionNode): selection is FieldNode; -export declare function isInlineFragment(selection: SelectionNode): selection is InlineFragmentNode; -export declare function isIdValue(idObject: StoreValue): idObject is IdValue; -export declare type IdConfig = { - id: string; - typename: string | undefined; -}; -export declare function toIdValue(idConfig: string | IdConfig, generated?: boolean): IdValue; -export declare function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue; -export declare type VariableValue = (node: VariableNode) => any; -export declare function valueFromNode(node: ValueNode, onVariable?: VariableValue): any; -//# sourceMappingURL=storeUtils.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.d.ts.map b/node_modules/apollo-utilities/lib/storeUtils.d.ts.map deleted file mode 100644 index 531a964..0000000 --- a/node_modules/apollo-utilities/lib/storeUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"storeUtils.d.ts","sourceRoot":"","sources":["src/storeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAGhB,aAAa,EAEb,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,SAAS,CAAC;AAKjB,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS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GAAG,SAAS,IAAI,SAAS,CAExE;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,aAAa,GACvB,SAAS,IAAI,kBAAkB,CAEjC;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,IAAI,OAAO,CAInE;AAED,oBAAY,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAC3B,SAAS,UAAQ,GAChB,OAAO,CAQT;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,IAAI,SAAS,CAM3E;AAMD,oBAAY,aAAa,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,GAAG,CAAC;AAKxD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,UAAU,GAAE,aAAwC,GACnD,GAAG,CAsBL"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.js b/node_modules/apollo-utilities/lib/storeUtils.js deleted file mode 100644 index bf04bfb..0000000 --- a/node_modules/apollo-utilities/lib/storeUtils.js +++ /dev/null @@ -1,225 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var fast_json_stable_stringify_1 = tslib_1.__importDefault(require("fast-json-stable-stringify")); -var ts_invariant_1 = require("ts-invariant"); -function isScalarValue(value) { - return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; -} -exports.isScalarValue = isScalarValue; -function isNumberValue(value) { - return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; -} -exports.isNumberValue = isNumberValue; -function isStringValue(value) { - return value.kind === 'StringValue'; -} -function isBooleanValue(value) { - return value.kind === 'BooleanValue'; -} -function isIntValue(value) { - return value.kind === 'IntValue'; -} -function isFloatValue(value) { - return value.kind === 'FloatValue'; -} -function isVariable(value) { - return value.kind === 'Variable'; -} -function isObjectValue(value) { - return value.kind === 'ObjectValue'; -} -function isListValue(value) { - return value.kind === 'ListValue'; -} -function isEnumValue(value) { - return value.kind === 'EnumValue'; -} -function isNullValue(value) { - return value.kind === 'NullValue'; -} -function valueToObjectRepresentation(argObj, name, value, variables) { - if (isIntValue(value) || isFloatValue(value)) { - argObj[name.value] = Number(value.value); - } - else if (isBooleanValue(value) || isStringValue(value)) { - argObj[name.value] = value.value; - } - else if (isObjectValue(value)) { - var nestedArgObj_1 = {}; - value.fields.map(function (obj) { - return valueToObjectRepresentation(nestedArgObj_1, obj.name, obj.value, variables); - }); - argObj[name.value] = nestedArgObj_1; - } - else if (isVariable(value)) { - var variableValue = (variables || {})[value.name.value]; - argObj[name.value] = variableValue; - } - else if (isListValue(value)) { - argObj[name.value] = value.values.map(function (listValue) { - var nestedArgArrayObj = {}; - valueToObjectRepresentation(nestedArgArrayObj, name, listValue, variables); - return nestedArgArrayObj[name.value]; - }); - } - else if (isEnumValue(value)) { - argObj[name.value] = value.value; - } - else if (isNullValue(value)) { - argObj[name.value] = null; - } - else { - throw new ts_invariant_1.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" + - 'is not supported. Use variables instead of inline arguments to ' + - 'overcome this limitation.'); - } -} -exports.valueToObjectRepresentation = valueToObjectRepresentation; -function storeKeyNameFromField(field, variables) { - var directivesObj = null; - if (field.directives) { - directivesObj = {}; - field.directives.forEach(function (directive) { - directivesObj[directive.name.value] = {}; - if (directive.arguments) { - directive.arguments.forEach(function (_a) { - var name = _a.name, value = _a.value; - return valueToObjectRepresentation(directivesObj[directive.name.value], name, value, variables); - }); - } - }); - } - var argObj = null; - if (field.arguments && field.arguments.length) { - argObj = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, value = _a.value; - return valueToObjectRepresentation(argObj, name, value, variables); - }); - } - return getStoreKeyName(field.name.value, argObj, directivesObj); -} -exports.storeKeyNameFromField = storeKeyNameFromField; -var KNOWN_DIRECTIVES = [ - 'connection', - 'include', - 'skip', - 'client', - 'rest', - 'export', -]; -function getStoreKeyName(fieldName, args, directives) { - if (directives && - directives['connection'] && - directives['connection']['key']) { - if (directives['connection']['filter'] && - directives['connection']['filter'].length > 0) { - var filterKeys = directives['connection']['filter'] - ? directives['connection']['filter'] - : []; - filterKeys.sort(); - var queryArgs_1 = args; - var filteredArgs_1 = {}; - filterKeys.forEach(function (key) { - filteredArgs_1[key] = queryArgs_1[key]; - }); - return directives['connection']['key'] + "(" + JSON.stringify(filteredArgs_1) + ")"; - } - else { - return directives['connection']['key']; - } - } - var completeFieldName = fieldName; - if (args) { - var stringifiedArgs = fast_json_stable_stringify_1.default(args); - completeFieldName += "(" + stringifiedArgs + ")"; - } - if (directives) { - Object.keys(directives).forEach(function (key) { - if (KNOWN_DIRECTIVES.indexOf(key) !== -1) - return; - if (directives[key] && Object.keys(directives[key]).length) { - completeFieldName += "@" + key + "(" + JSON.stringify(directives[key]) + ")"; - } - else { - completeFieldName += "@" + key; - } - }); - } - return completeFieldName; -} -exports.getStoreKeyName = getStoreKeyName; -function argumentsObjectFromField(field, variables) { - if (field.arguments && field.arguments.length) { - var argObj_1 = {}; - field.arguments.forEach(function (_a) { - var name = _a.name, value = _a.value; - return valueToObjectRepresentation(argObj_1, name, value, variables); - }); - return argObj_1; - } - return null; -} -exports.argumentsObjectFromField = argumentsObjectFromField; -function resultKeyNameFromField(field) { - return field.alias ? field.alias.value : field.name.value; -} -exports.resultKeyNameFromField = resultKeyNameFromField; -function isField(selection) { - return selection.kind === 'Field'; -} -exports.isField = isField; -function isInlineFragment(selection) { - return selection.kind === 'InlineFragment'; -} -exports.isInlineFragment = isInlineFragment; -function isIdValue(idObject) { - return idObject && - idObject.type === 'id' && - typeof idObject.generated === 'boolean'; -} -exports.isIdValue = isIdValue; -function toIdValue(idConfig, generated) { - if (generated === void 0) { generated = false; } - return tslib_1.__assign({ type: 'id', generated: generated }, (typeof idConfig === 'string' - ? { id: idConfig, typename: undefined } - : idConfig)); -} -exports.toIdValue = toIdValue; -function isJsonValue(jsonObject) { - return (jsonObject != null && - typeof jsonObject === 'object' && - jsonObject.type === 'json'); -} -exports.isJsonValue = isJsonValue; -function defaultValueFromVariable(node) { - throw new ts_invariant_1.InvariantError("Variable nodes are not supported by valueFromNode"); -} -function valueFromNode(node, onVariable) { - if (onVariable === void 0) { onVariable = defaultValueFromVariable; } - switch (node.kind) { - case 'Variable': - return onVariable(node); - case 'NullValue': - return null; - case 'IntValue': - return parseInt(node.value, 10); - case 'FloatValue': - return parseFloat(node.value); - case 'ListValue': - return node.values.map(function (v) { return valueFromNode(v, onVariable); }); - case 'ObjectValue': { - var value = {}; - for (var _i = 0, _a = node.fields; _i < _a.length; _i++) { - var field = _a[_i]; - value[field.name.value] = valueFromNode(field.value, onVariable); - } - return value; - } - default: - return node.value; - } -} -exports.valueFromNode = valueFromNode; -//# sourceMappingURL=storeUtils.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/storeUtils.js.map b/node_modules/apollo-utilities/lib/storeUtils.js.map deleted file mode 100644 index bb07be7..0000000 --- a/node_modules/apollo-utilities/lib/storeUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"storeUtils.js","sourceRoot":"","sources":["../src/storeUtils.ts"],"names":[],"mappings":";;;AAkBA,kGAAmD;AACnD,6CAA8C;AA8B9C,SAAgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/E,CAAC;AAFD,sCAEC;AAID,SAAgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAFD,sCAEC;AAED,SAAS,aAAa,CAAC,K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;gBAA5B,IAAM,KAAK,SAAA;gBACd,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;aAClE;YACD,OAAO,KAAK,CAAC;SACd;QACD;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;AACH,CAAC;AAzBD,sCAyBC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.d.ts b/node_modules/apollo-utilities/lib/transform.d.ts deleted file mode 100644 index 377bb5a..0000000 --- a/node_modules/apollo-utilities/lib/transform.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { DocumentNode, DirectiveNode, FragmentDefinitionNode, ArgumentNode, FragmentSpreadNode, VariableDefinitionNode } from 'graphql'; -export declare type RemoveNodeConfig = { - name?: string; - test?: (node: N) => boolean; - remove?: boolean; -}; -export declare type GetNodeConfig = { - name?: string; - test?: (node: N) => boolean; -}; -export declare type RemoveDirectiveConfig = RemoveNodeConfig; -export declare type GetDirectiveConfig = GetNodeConfig; -export declare type RemoveArgumentsConfig = RemoveNodeConfig; -export declare type GetFragmentSpreadConfig = GetNodeConfig; -export declare type RemoveFragmentSpreadConfig = RemoveNodeConfig; -export declare type RemoveFragmentDefinitionConfig = RemoveNodeConfig; -export declare type RemoveVariableDefinitionConfig = RemoveNodeConfig; -export declare function removeDirectivesFromDocument(directives: RemoveDirectiveConfig[], doc: DocumentNode): DocumentNode | null; -export declare function addTypenameToDocument(doc: DocumentNode): DocumentNode; -export declare function removeConnectionDirectiveFromDocument(doc: DocumentNode): DocumentNode; -export declare function getDirectivesFromDocument(directives: GetDirectiveConfig[], doc: DocumentNode): DocumentNode; -export declare function removeArgumentsFromDocument(config: RemoveArgumentsConfig[], doc: DocumentNode): DocumentNode; -export declare function removeFragmentSpreadFromDocument(config: RemoveFragmentSpreadConfig[], doc: DocumentNode): DocumentNode; -export declare function buildQueryFromSelectionSet(document: DocumentNode): DocumentNode; -export declare function removeClientSetsFromDocument(document: DocumentNode): DocumentNode | null; -//# sourceMappingURL=transform.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.d.ts.map b/node_modules/apollo-utilities/lib/transform.d.ts.map deleted file mode 100644 index 5d6140b..0000000 --- a/node_modules/apollo-utilities/lib/transform.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["src/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAKZ,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAgBjB,oBAAY,gBAAgB,CAAC,CAAC,IAAI;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,oBAAY,aAAa,CAAC,CAAC,IAAI;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;CAC7B,CAAC;AAEF,oBAAY,qBAAqB,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;AACpE,oBAAY,kBAAkB,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AAC9D,oBAAY,qBAAqB,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACnE,oBAAY,uBAAuB,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;AACxE,oBAAY,0BAA0B,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;AAC9E,oBAAY,8BAA8B,GAAG,gBAAgB,CAC3D,sBAAsB,CACvB,CAAC;AACF,oBAAY,8BAA8B,GAAG,gBAAgB,CAC3D,sBAAsB,CACvB,CAAC;AA0CF,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,qBAAqB,EAAE,EACnC,GAAG,EAAE,YAAY,GAChB,YAAY,GAAG,IAAI,CAiHrB;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAkDrE;AAqBD,wBAAgB,qCAAqC,CAAC,GAAG,EAAE,YAAY,gBAKtE;AAwCD,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,kBAAkB,EAAE,EAChC,GAAG,EAAE,YAAY,GAChB,YAAY,CAqCd;AAeD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,qBAAqB,EAAE,EAC/B,GAAG,EAAE,YAAY,GAChB,YAAY,CAgDd;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,0BAA0B,EAAE,EACpC,GAAG,EAAE,YAAY,GAChB,YAAY,CAed;AA0BD,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,GACrB,YAAY,CAqBd;AAGD,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,YAAY,GACrB,YAAY,GAAG,IAAI,CAoCrB"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.js b/node_modules/apollo-utilities/lib/transform.js deleted file mode 100644 index b85155c..0000000 --- a/node_modules/apollo-utilities/lib/transform.js +++ /dev/null @@ -1,311 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var visitor_1 = require("graphql/language/visitor"); -var getFromAST_1 = require("./getFromAST"); -var filterInPlace_1 = require("./util/filterInPlace"); -var ts_invariant_1 = require("ts-invariant"); -var storeUtils_1 = require("./storeUtils"); -var TYPENAME_FIELD = { - kind: 'Field', - name: { - kind: 'Name', - value: '__typename', - }, -}; -function isEmpty(op, fragments) { - return op.selectionSet.selections.every(function (selection) { - return selection.kind === 'FragmentSpread' && - isEmpty(fragments[selection.name.value], fragments); - }); -} -function nullIfDocIsEmpty(doc) { - return isEmpty(getFromAST_1.getOperationDefinition(doc) || getFromAST_1.getFragmentDefinition(doc), getFromAST_1.createFragmentMap(getFromAST_1.getFragmentDefinitions(doc))) - ? null - : doc; -} -function getDirectiveMatcher(directives) { - return function directiveMatcher(directive) { - return directives.some(function (dir) { - return (dir.name && dir.name === directive.name.value) || - (dir.test && dir.test(directive)); - }); - }; -} -function removeDirectivesFromDocument(directives, doc) { - var variablesInUse = Object.create(null); - var variablesToRemove = []; - var fragmentSpreadsInUse = Object.create(null); - var fragmentSpreadsToRemove = []; - var modifiedDoc = nullIfDocIsEmpty(visitor_1.visit(doc, { - Variable: { - enter: function (node, _key, parent) { - if (parent.kind !== 'VariableDefinition') { - variablesInUse[node.name.value] = true; - } - }, - }, - Field: { - enter: function (node) { - if (directives && node.directives) { - var shouldRemoveField = directives.some(function (directive) { return directive.remove; }); - if (shouldRemoveField && - node.directives && - node.directives.some(getDirectiveMatcher(directives))) { - if (node.arguments) { - node.arguments.forEach(function (arg) { - if (arg.value.kind === 'Variable') { - variablesToRemove.push({ - name: arg.value.name.value, - }); - } - }); - } - if (node.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach(function (frag) { - fragmentSpreadsToRemove.push({ - name: frag.name.value, - }); - }); - } - return null; - } - } - }, - }, - FragmentSpread: { - enter: function (node) { - fragmentSpreadsInUse[node.name.value] = true; - }, - }, - Directive: { - enter: function (node) { - if (getDirectiveMatcher(directives)(node)) { - return null; - } - }, - }, - })); - if (modifiedDoc && - filterInPlace_1.filterInPlace(variablesToRemove, function (v) { return !variablesInUse[v.name]; }).length) { - modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); - } - if (modifiedDoc && - filterInPlace_1.filterInPlace(fragmentSpreadsToRemove, function (fs) { return !fragmentSpreadsInUse[fs.name]; }) - .length) { - modifiedDoc = removeFragmentSpreadFromDocument(fragmentSpreadsToRemove, modifiedDoc); - } - return modifiedDoc; -} -exports.removeDirectivesFromDocument = removeDirectivesFromDocument; -function addTypenameToDocument(doc) { - return visitor_1.visit(getFromAST_1.checkDocument(doc), { - SelectionSet: { - enter: function (node, _key, parent) { - if (parent && - parent.kind === 'OperationDefinition') { - return; - } - var selections = node.selections; - if (!selections) { - return; - } - var skip = selections.some(function (selection) { - return (storeUtils_1.isField(selection) && - (selection.name.value === '__typename' || - selection.name.value.lastIndexOf('__', 0) === 0)); - }); - if (skip) { - return; - } - var field = parent; - if (storeUtils_1.isField(field) && - field.directives && - field.directives.some(function (d) { return d.name.value === 'export'; })) { - return; - } - return tslib_1.__assign(tslib_1.__assign({}, node), { selections: tslib_1.__spreadArrays(selections, [TYPENAME_FIELD]) }); - }, - }, - }); -} -exports.addTypenameToDocument = addTypenameToDocument; -var connectionRemoveConfig = { - test: function (directive) { - var willRemove = directive.name.value === 'connection'; - if (willRemove) { - if (!directive.arguments || - !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) { - ts_invariant_1.invariant.warn('Removing an @connection directive even though it does not have a key. ' + - 'You may want to use the key parameter to specify a store key.'); - } - } - return willRemove; - }, -}; -function removeConnectionDirectiveFromDocument(doc) { - return removeDirectivesFromDocument([connectionRemoveConfig], getFromAST_1.checkDocument(doc)); -} -exports.removeConnectionDirectiveFromDocument = removeConnectionDirectiveFromDocument; -function hasDirectivesInSelectionSet(directives, selectionSet, nestedCheck) { - if (nestedCheck === void 0) { nestedCheck = true; } - return (selectionSet && - selectionSet.selections && - selectionSet.selections.some(function (selection) { - return hasDirectivesInSelection(directives, selection, nestedCheck); - })); -} -function hasDirectivesInSelection(directives, selection, nestedCheck) { - if (nestedCheck === void 0) { nestedCheck = true; } - if (!storeUtils_1.isField(selection)) { - return true; - } - if (!selection.directives) { - return false; - } - return (selection.directives.some(getDirectiveMatcher(directives)) || - (nestedCheck && - hasDirectivesInSelectionSet(directives, selection.selectionSet, nestedCheck))); -} -function getDirectivesFromDocument(directives, doc) { - getFromAST_1.checkDocument(doc); - var parentPath; - return nullIfDocIsEmpty(visitor_1.visit(doc, { - SelectionSet: { - enter: function (node, _key, _parent, path) { - var currentPath = path.join('-'); - if (!parentPath || - currentPath === parentPath || - !currentPath.startsWith(parentPath)) { - if (node.selections) { - var selectionsWithDirectives = node.selections.filter(function (selection) { return hasDirectivesInSelection(directives, selection); }); - if (hasDirectivesInSelectionSet(directives, node, false)) { - parentPath = currentPath; - } - return tslib_1.__assign(tslib_1.__assign({}, node), { selections: selectionsWithDirectives }); - } - else { - return null; - } - } - }, - }, - })); -} -exports.getDirectivesFromDocument = getDirectivesFromDocument; -function getArgumentMatcher(config) { - return function argumentMatcher(argument) { - return config.some(function (aConfig) { - return argument.value && - argument.value.kind === 'Variable' && - argument.value.name && - (aConfig.name === argument.value.name.value || - (aConfig.test && aConfig.test(argument))); - }); - }; -} -function removeArgumentsFromDocument(config, doc) { - var argMatcher = getArgumentMatcher(config); - return nullIfDocIsEmpty(visitor_1.visit(doc, { - OperationDefinition: { - enter: function (node) { - return tslib_1.__assign(tslib_1.__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) { - return !config.some(function (arg) { return arg.name === varDef.variable.name.value; }); - }) }); - }, - }, - Field: { - enter: function (node) { - var shouldRemoveField = config.some(function (argConfig) { return argConfig.remove; }); - if (shouldRemoveField) { - var argMatchCount_1 = 0; - node.arguments.forEach(function (arg) { - if (argMatcher(arg)) { - argMatchCount_1 += 1; - } - }); - if (argMatchCount_1 === 1) { - return null; - } - } - }, - }, - Argument: { - enter: function (node) { - if (argMatcher(node)) { - return null; - } - }, - }, - })); -} -exports.removeArgumentsFromDocument = removeArgumentsFromDocument; -function removeFragmentSpreadFromDocument(config, doc) { - function enter(node) { - if (config.some(function (def) { return def.name === node.name.value; })) { - return null; - } - } - return nullIfDocIsEmpty(visitor_1.visit(doc, { - FragmentSpread: { enter: enter }, - FragmentDefinition: { enter: enter }, - })); -} -exports.removeFragmentSpreadFromDocument = removeFragmentSpreadFromDocument; -function getAllFragmentSpreadsFromSelectionSet(selectionSet) { - var allFragments = []; - selectionSet.selections.forEach(function (selection) { - if ((storeUtils_1.isField(selection) || storeUtils_1.isInlineFragment(selection)) && - selection.selectionSet) { - getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach(function (frag) { return allFragments.push(frag); }); - } - else if (selection.kind === 'FragmentSpread') { - allFragments.push(selection); - } - }); - return allFragments; -} -function buildQueryFromSelectionSet(document) { - var definition = getFromAST_1.getMainDefinition(document); - var definitionOperation = definition.operation; - if (definitionOperation === 'query') { - return document; - } - var modifiedDoc = visitor_1.visit(document, { - OperationDefinition: { - enter: function (node) { - return tslib_1.__assign(tslib_1.__assign({}, node), { operation: 'query' }); - }, - }, - }); - return modifiedDoc; -} -exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet; -function removeClientSetsFromDocument(document) { - getFromAST_1.checkDocument(document); - var modifiedDoc = removeDirectivesFromDocument([ - { - test: function (directive) { return directive.name.value === 'client'; }, - remove: true, - }, - ], document); - if (modifiedDoc) { - modifiedDoc = visitor_1.visit(modifiedDoc, { - FragmentDefinition: { - enter: function (node) { - if (node.selectionSet) { - var isTypenameOnly = node.selectionSet.selections.every(function (selection) { - return storeUtils_1.isField(selection) && selection.name.value === '__typename'; - }); - if (isTypenameOnly) { - return null; - } - } - }, - }, - }); - } - return modifiedDoc; -} -exports.removeClientSetsFromDocument = removeClientSetsFromDocument; -//# sourceMappingURL=transform.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/transform.js.map b/node_modules/apollo-utilities/lib/transform.js.map deleted file mode 100644 index 4ea0981..0000000 --- a/node_modules/apollo-utilities/lib/transform.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;AAaA,oDAAiD;AAEjD,2CAQsB;AACtB,sDAAqD;AACrD,6CAAyC;AACzC,2CAAyD;AAyBzD,IAAM,cAAc,GAAc;IAChC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,YAAY;KACpB;CACF,CAAC;AAEF,SAAS,OAAO,CACd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I;oBACR,IAAI,IAAI,CAAC,YAAY,EAAE;wBACrB,IAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CACvD,UAAA,SAAS;4BACP,OAAA,oBAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY;wBAA3D,CAA2D,CAC9D,CAAC;wBACF,IAAI,cAAc,EAAE;4BAClB,OAAO,IAAI,CAAC;yBACb;qBACF;gBACH,CAAC;aACF;SACF,CAAC,CAAC;KACJ;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAtCD,oEAsCC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.d.ts b/node_modules/apollo-utilities/lib/util/assign.d.ts deleted file mode 100644 index 222d749..0000000 --- a/node_modules/apollo-utilities/lib/util/assign.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function assign(a: A, b: B): A & B; -export declare function assign(a: A, b: B, c: C): A & B & C; -export declare function assign(a: A, b: B, c: C, d: D): A & B & C & D; -export declare function assign(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; -export declare function assign(target: any, ...sources: Array): any; -//# sourceMappingURL=assign.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.d.ts.map b/node_modules/apollo-utilities/lib/util/assign.d.ts.map deleted file mode 100644 index 20e9dbf..0000000 --- a/node_modules/apollo-utilities/lib/util/assign.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"assign.d.ts","sourceRoot":"","sources":["../src/util/assign.ts"],"names":[],"mappings":"AAMA,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChD,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7D,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1E,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAClC,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,GACH,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrB,wBAAgB,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.js b/node_modules/apollo-utilities/lib/util/assign.js deleted file mode 100644 index 78e3901..0000000 --- a/node_modules/apollo-utilities/lib/util/assign.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function assign(target) { - var sources = []; - for (var _i = 1; _i < arguments.length; _i++) { - sources[_i - 1] = arguments[_i]; - } - sources.forEach(function (source) { - if (typeof source === 'undefined' || source === null) { - return; - } - Object.keys(source).forEach(function (key) { - target[key] = source[key]; - }); - }); - return target; -} -exports.assign = assign; -//# sourceMappingURL=assign.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/assign.js.map b/node_modules/apollo-utilities/lib/util/assign.js.map deleted file mode 100644 index 6a697cc..0000000 --- a/node_modules/apollo-utilities/lib/util/assign.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"assign.js","sourceRoot":"","sources":["../../src/util/assign.ts"],"names":[],"mappings":";;AAiBA,SAAgB,MAAM,CACpB,MAA8B;IAC9B,iBAAyC;SAAzC,UAAyC,EAAzC,qBAAyC,EAAzC,IAAyC;QAAzC,gCAAyC;;IAEzC,OAAO,CAAC,OAAO,CAAC,UAAA,MAAM;QACpB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,IAAI,EAAE;YACpD,OAAO;SACR;QACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;YAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAbD,wBAaC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.d.ts b/node_modules/apollo-utilities/lib/util/canUse.d.ts deleted file mode 100644 index 0975a35..0000000 --- a/node_modules/apollo-utilities/lib/util/canUse.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const canUseWeakMap: boolean; -//# sourceMappingURL=canUse.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.d.ts.map b/node_modules/apollo-utilities/lib/util/canUse.d.ts.map deleted file mode 100644 index 74a2206..0000000 --- a/node_modules/apollo-utilities/lib/util/canUse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canUse.d.ts","sourceRoot":"","sources":["../src/util/canUse.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,SAGzB,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.js b/node_modules/apollo-utilities/lib/util/canUse.js deleted file mode 100644 index c8caab9..0000000 --- a/node_modules/apollo-utilities/lib/util/canUse.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' && - navigator.product === 'ReactNative'); -//# sourceMappingURL=canUse.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/canUse.js.map b/node_modules/apollo-utilities/lib/util/canUse.js.map deleted file mode 100644 index e0e5e56..0000000 --- a/node_modules/apollo-utilities/lib/util/canUse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canUse.js","sourceRoot":"","sources":["../../src/util/canUse.ts"],"names":[],"mappings":";;AAAa,QAAA,aAAa,GAAG,OAAO,OAAO,KAAK,UAAU,IAAI,CAAC,CAC7D,OAAO,SAAS,KAAK,QAAQ;IAC7B,SAAS,CAAC,OAAO,KAAK,aAAa,CACpC,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts b/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts deleted file mode 100644 index f0f64fc..0000000 --- a/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function cloneDeep(value: T): T; -//# sourceMappingURL=cloneDeep.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map b/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map deleted file mode 100644 index a871948..0000000 --- a/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cloneDeep.d.ts","sourceRoot":"","sources":["../src/util/cloneDeep.ts"],"names":[],"mappings":"AAKA,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAExC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.js b/node_modules/apollo-utilities/lib/util/cloneDeep.js deleted file mode 100644 index 8fbfb3f..0000000 --- a/node_modules/apollo-utilities/lib/util/cloneDeep.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var toString = Object.prototype.toString; -function cloneDeep(value) { - return cloneDeepHelper(value, new Map()); -} -exports.cloneDeep = cloneDeep; -function cloneDeepHelper(val, seen) { - switch (toString.call(val)) { - case "[object Array]": { - if (seen.has(val)) - return seen.get(val); - var copy_1 = val.slice(0); - seen.set(val, copy_1); - copy_1.forEach(function (child, i) { - copy_1[i] = cloneDeepHelper(child, seen); - }); - return copy_1; - } - case "[object Object]": { - if (seen.has(val)) - return seen.get(val); - var copy_2 = Object.create(Object.getPrototypeOf(val)); - seen.set(val, copy_2); - Object.keys(val).forEach(function (key) { - copy_2[key] = cloneDeepHelper(val[key], seen); - }); - return copy_2; - } - default: - return val; - } -} -//# sourceMappingURL=cloneDeep.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/cloneDeep.js.map b/node_modules/apollo-utilities/lib/util/cloneDeep.js.map deleted file mode 100644 index 36015d2..0000000 --- a/node_modules/apollo-utilities/lib/util/cloneDeep.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cloneDeep.js","sourceRoot":"","sources":["../../src/util/cloneDeep.ts"],"names":[],"mappings":";;AAAQ,IAAA,oCAAQ,CAAsB;AAKtC,SAAgB,SAAS,CAAI,KAAQ;IACnC,OAAO,eAAe,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAC3C,CAAC;AAFD,8BAEC;AAED,SAAS,eAAe,CAAI,GAAM,EAAE,IAAmB;IACrD,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5B,KAAK,gBAAgB,CAAC,CAAC;YACrB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACxC,IAAM,MAAI,GAAe,GAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAI,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE,CAAC;gBAC7B,MAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED,KAAK,iBAAiB,CAAC,CAAC;YACtB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAGxC,IAAM,MAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;gBAC1B,MAAI,CAAC,GAAG,CAAC,GAAG,eAAe,CAAE,GAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED;YACE,OAAO,GAAG,CAAC;KACZ;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.d.ts b/node_modules/apollo-utilities/lib/util/environment.d.ts deleted file mode 100644 index 238d252..0000000 --- a/node_modules/apollo-utilities/lib/util/environment.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare function getEnv(): string | undefined; -export declare function isEnv(env: string): boolean; -export declare function isProduction(): boolean; -export declare function isDevelopment(): boolean; -export declare function isTest(): boolean; -//# sourceMappingURL=environment.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.d.ts.map b/node_modules/apollo-utilities/lib/util/environment.d.ts.map deleted file mode 100644 index ac39af2..0000000 --- a/node_modules/apollo-utilities/lib/util/environment.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/util/environment.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,IAAI,MAAM,GAAG,SAAS,CAO3C;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED,wBAAgB,MAAM,IAAI,OAAO,CAEhC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.js b/node_modules/apollo-utilities/lib/util/environment.js deleted file mode 100644 index 13f120e..0000000 --- a/node_modules/apollo-utilities/lib/util/environment.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function getEnv() { - if (typeof process !== 'undefined' && process.env.NODE_ENV) { - return process.env.NODE_ENV; - } - return 'development'; -} -exports.getEnv = getEnv; -function isEnv(env) { - return getEnv() === env; -} -exports.isEnv = isEnv; -function isProduction() { - return isEnv('production') === true; -} -exports.isProduction = isProduction; -function isDevelopment() { - return isEnv('development') === true; -} -exports.isDevelopment = isDevelopment; -function isTest() { - return isEnv('test') === true; -} -exports.isTest = isTest; -//# sourceMappingURL=environment.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/environment.js.map b/node_modules/apollo-utilities/lib/util/environment.js.map deleted file mode 100644 index d7b9e1a..0000000 --- a/node_modules/apollo-utilities/lib/util/environment.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/util/environment.ts"],"names":[],"mappings":";;AAAA,SAAgB,MAAM;IACpB,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;QAC1D,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;KAC7B;IAGD,OAAO,aAAa,CAAC;AACvB,CAAC;AAPD,wBAOC;AAED,SAAgB,KAAK,CAAC,GAAW;IAC/B,OAAO,MAAM,EAAE,KAAK,GAAG,CAAC;AAC1B,CAAC;AAFD,sBAEC;AAED,SAAgB,YAAY;IAC1B,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;AACtC,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa;IAC3B,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAFD,sCAEC;AAED,SAAgB,MAAM;IACpB,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC;AAFD,wBAEC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.d.ts b/node_modules/apollo-utilities/lib/util/errorHandling.d.ts deleted file mode 100644 index adb1eb8..0000000 --- a/node_modules/apollo-utilities/lib/util/errorHandling.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ExecutionResult } from 'graphql'; -export declare function tryFunctionOrLogError(f: Function): any; -export declare function graphQLResultHasError(result: ExecutionResult): number; -//# sourceMappingURL=errorHandling.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map b/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map deleted file mode 100644 index 6955d01..0000000 --- a/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../src/util/errorHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,QAAQ,OAQhD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,UAE5D"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.js b/node_modules/apollo-utilities/lib/util/errorHandling.js deleted file mode 100644 index a9955e1..0000000 --- a/node_modules/apollo-utilities/lib/util/errorHandling.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function tryFunctionOrLogError(f) { - try { - return f(); - } - catch (e) { - if (console.error) { - console.error(e); - } - } -} -exports.tryFunctionOrLogError = tryFunctionOrLogError; -function graphQLResultHasError(result) { - return result.errors && result.errors.length; -} -exports.graphQLResultHasError = graphQLResultHasError; -//# sourceMappingURL=errorHandling.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/errorHandling.js.map b/node_modules/apollo-utilities/lib/util/errorHandling.js.map deleted file mode 100644 index 52b9fb6..0000000 --- a/node_modules/apollo-utilities/lib/util/errorHandling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../src/util/errorHandling.ts"],"names":[],"mappings":";;AAEA,SAAgB,qBAAqB,CAAC,CAAW;IAC/C,IAAI;QACF,OAAO,CAAC,EAAE,CAAC;KACZ;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClB;KACF;AACH,CAAC;AARD,sDAQC;AAED,SAAgB,qBAAqB,CAAC,MAAuB;IAC3D,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAC/C,CAAC;AAFD,sDAEC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts b/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts deleted file mode 100644 index 397458d..0000000 --- a/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function filterInPlace(array: T[], test: (elem: T) => boolean, context?: any): T[]; -//# sourceMappingURL=filterInPlace.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map b/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map deleted file mode 100644 index c45757b..0000000 --- a/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filterInPlace.d.ts","sourceRoot":"","sources":["../src/util/filterInPlace.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EAAE,EACV,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,EAC1B,OAAO,CAAC,EAAE,GAAG,GACZ,CAAC,EAAE,CASL"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.js b/node_modules/apollo-utilities/lib/util/filterInPlace.js deleted file mode 100644 index 66b9dd6..0000000 --- a/node_modules/apollo-utilities/lib/util/filterInPlace.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function filterInPlace(array, test, context) { - var target = 0; - array.forEach(function (elem, i) { - if (test.call(this, elem, i, array)) { - array[target++] = elem; - } - }, context); - array.length = target; - return array; -} -exports.filterInPlace = filterInPlace; -//# sourceMappingURL=filterInPlace.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/filterInPlace.js.map b/node_modules/apollo-utilities/lib/util/filterInPlace.js.map deleted file mode 100644 index d0e2a7d..0000000 --- a/node_modules/apollo-utilities/lib/util/filterInPlace.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"filterInPlace.js","sourceRoot":"","sources":["../../src/util/filterInPlace.ts"],"names":[],"mappings":";;AAAA,SAAgB,aAAa,CAC3B,KAAU,EACV,IAA0B,EAC1B,OAAa;IAEb,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;YACnC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;SACxB;IACH,CAAC,EAAE,OAAO,CAAC,CAAC;IACZ,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,OAAO,KAAK,CAAC;AACf,CAAC;AAbD,sCAaC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.d.ts b/node_modules/apollo-utilities/lib/util/isEqual.d.ts deleted file mode 100644 index 08faeb9..0000000 --- a/node_modules/apollo-utilities/lib/util/isEqual.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { equal as isEqual } from '@wry/equality'; -//# sourceMappingURL=isEqual.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map b/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map deleted file mode 100644 index d2078c9..0000000 --- a/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"isEqual.d.ts","sourceRoot":"","sources":["../src/util/isEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.js b/node_modules/apollo-utilities/lib/util/isEqual.js deleted file mode 100644 index f7d228c..0000000 --- a/node_modules/apollo-utilities/lib/util/isEqual.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var equality_1 = require("@wry/equality"); -exports.isEqual = equality_1.equal; -//# sourceMappingURL=isEqual.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/isEqual.js.map b/node_modules/apollo-utilities/lib/util/isEqual.js.map deleted file mode 100644 index c6fe9ba..0000000 --- a/node_modules/apollo-utilities/lib/util/isEqual.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"isEqual.js","sourceRoot":"","sources":["../../src/util/isEqual.ts"],"names":[],"mappings":";;AAAA,0CAAiD;AAAxC,6BAAA,KAAK,CAAW"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts deleted file mode 100644 index 00bba45..0000000 --- a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function maybeDeepFreeze(obj: any): any; -//# sourceMappingURL=maybeDeepFreeze.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map deleted file mode 100644 index 99cb3ef..0000000 --- a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maybeDeepFreeze.d.ts","sourceRoot":"","sources":["../src/util/maybeDeepFreeze.ts"],"names":[],"mappings":"AAoBA,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,OAYvC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js deleted file mode 100644 index 2f7b836..0000000 --- a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var environment_1 = require("./environment"); -function deepFreeze(o) { - Object.freeze(o); - Object.getOwnPropertyNames(o).forEach(function (prop) { - if (o[prop] !== null && - (typeof o[prop] === 'object' || typeof o[prop] === 'function') && - !Object.isFrozen(o[prop])) { - deepFreeze(o[prop]); - } - }); - return o; -} -function maybeDeepFreeze(obj) { - if (environment_1.isDevelopment() || environment_1.isTest()) { - var symbolIsPolyfilled = typeof Symbol === 'function' && typeof Symbol('') === 'string'; - if (!symbolIsPolyfilled) { - return deepFreeze(obj); - } - } - return obj; -} -exports.maybeDeepFreeze = maybeDeepFreeze; -//# sourceMappingURL=maybeDeepFreeze.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map b/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map deleted file mode 100644 index ea62a05..0000000 --- a/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maybeDeepFreeze.js","sourceRoot":"","sources":["../../src/util/maybeDeepFreeze.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AAItD,SAAS,UAAU,CAAC,CAAM;IACxB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAEjB,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;QACjD,IACE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI;YAChB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;YAC9D,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EACzB;YACA,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SACrB;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAgB,eAAe,CAAC,GAAQ;IACtC,IAAI,2BAAa,EAAE,IAAI,oBAAM,EAAE,EAAE;QAG/B,IAAM,kBAAkB,GACtB,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC;QAEjE,IAAI,CAAC,kBAAkB,EAAE;YACvB,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;SACxB;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAZD,0CAYC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts b/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts deleted file mode 100644 index cb0d13d..0000000 --- a/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare type TupleToIntersection = T extends [infer A] ? A : T extends [infer A, infer B] ? A & B : T extends [infer A, infer B, infer C] ? A & B & C : T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : T extends (infer U)[] ? U : any; -export declare function mergeDeep(...sources: T): TupleToIntersection; -export declare function mergeDeepArray(sources: T[]): T; -//# sourceMappingURL=mergeDeep.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map b/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map deleted file mode 100644 index d95732f..0000000 --- a/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mergeDeep.d.ts","sourceRoot":"","sources":["../src/util/mergeDeep.ts"],"names":[],"mappings":"AAgBA,oBAAY,mBAAmB,CAAC,CAAC,SAAS,GAAG,EAAE,IAC7C,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GACvB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GACpC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GACjD,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC9D,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC3E,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;AAElC,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,EAAE,EACvC,GAAG,OAAO,EAAE,CAAC,GACZ,mBAAmB,CAAC,CAAC,CAAC,CAExB;AAQD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAWjD"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.js b/node_modules/apollo-utilities/lib/util/mergeDeep.js deleted file mode 100644 index e4100a2..0000000 --- a/node_modules/apollo-utilities/lib/util/mergeDeep.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -var hasOwnProperty = Object.prototype.hasOwnProperty; -function mergeDeep() { - var sources = []; - for (var _i = 0; _i < arguments.length; _i++) { - sources[_i] = arguments[_i]; - } - return mergeDeepArray(sources); -} -exports.mergeDeep = mergeDeep; -function mergeDeepArray(sources) { - var target = sources[0] || {}; - var count = sources.length; - if (count > 1) { - var pastCopies = []; - target = shallowCopyForMerge(target, pastCopies); - for (var i = 1; i < count; ++i) { - target = mergeHelper(target, sources[i], pastCopies); - } - } - return target; -} -exports.mergeDeepArray = mergeDeepArray; -function isObject(obj) { - return obj !== null && typeof obj === 'object'; -} -function mergeHelper(target, source, pastCopies) { - if (isObject(source) && isObject(target)) { - if (Object.isExtensible && !Object.isExtensible(target)) { - target = shallowCopyForMerge(target, pastCopies); - } - Object.keys(source).forEach(function (sourceKey) { - var sourceValue = source[sourceKey]; - if (hasOwnProperty.call(target, sourceKey)) { - var targetValue = target[sourceKey]; - if (sourceValue !== targetValue) { - target[sourceKey] = mergeHelper(shallowCopyForMerge(targetValue, pastCopies), sourceValue, pastCopies); - } - } - else { - target[sourceKey] = sourceValue; - } - }); - return target; - } - return source; -} -function shallowCopyForMerge(value, pastCopies) { - if (value !== null && - typeof value === 'object' && - pastCopies.indexOf(value) < 0) { - if (Array.isArray(value)) { - value = value.slice(0); - } - else { - value = tslib_1.__assign({ __proto__: Object.getPrototypeOf(value) }, value); - } - pastCopies.push(value); - } - return value; -} -//# sourceMappingURL=mergeDeep.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/mergeDeep.js.map b/node_modules/apollo-utilities/lib/util/mergeDeep.js.map deleted file mode 100644 index 20393f8..0000000 --- a/node_modules/apollo-utilities/lib/util/mergeDeep.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mergeDeep.js","sourceRoot":"","sources":["../../src/util/mergeDeep.ts"],"names":[],"mappings":";;;AAAQ,IAAA,gDAAc,CAAsB;AAwB5C,SAAgB,SAAS;IACvB,iBAAa;SAAb,UAAa,EAAb,qBAAa,EAAb,IAAa;QAAb,4BAAa;;IAEb,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAJD,8BAIC;AAQD,SAAgB,cAAc,CAAI,OAAY;IAC5C,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAO,CAAC;IACnC,IAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;IAC7B,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,IAAM,UAAU,GAAU,EAAE,CAAC;QAC7B,MAAM,GAAG,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC,EAAE;YAC9B,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;SACtD;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,wCAWC;AAED,SAAS,QAAQ,CAAC,GAAQ;IACxB,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC;AAC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CACT,CAAC;SACH;QACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACxB;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts b/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts deleted file mode 100644 index 3dad555..0000000 --- a/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function stripSymbols(data: T): T; -//# sourceMappingURL=stripSymbols.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map b/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map deleted file mode 100644 index 9e0384d..0000000 --- a/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stripSymbols.d.ts","sourceRoot":"","sources":["../src/util/stripSymbols.ts"],"names":[],"mappings":"AAWA,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAE1C"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.js b/node_modules/apollo-utilities/lib/util/stripSymbols.js deleted file mode 100644 index bc978e5..0000000 --- a/node_modules/apollo-utilities/lib/util/stripSymbols.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function stripSymbols(data) { - return JSON.parse(JSON.stringify(data)); -} -exports.stripSymbols = stripSymbols; -//# sourceMappingURL=stripSymbols.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/stripSymbols.js.map b/node_modules/apollo-utilities/lib/util/stripSymbols.js.map deleted file mode 100644 index 3bbcc9c..0000000 --- a/node_modules/apollo-utilities/lib/util/stripSymbols.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stripSymbols.js","sourceRoot":"","sources":["../../src/util/stripSymbols.ts"],"names":[],"mappings":";;AAWA,SAAgB,YAAY,CAAI,IAAO;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.d.ts b/node_modules/apollo-utilities/lib/util/warnOnce.d.ts deleted file mode 100644 index bfc0dd1..0000000 --- a/node_modules/apollo-utilities/lib/util/warnOnce.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function warnOnceInDevelopment(msg: string, type?: string): void; -//# sourceMappingURL=warnOnce.d.ts.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map b/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map deleted file mode 100644 index 1b652a3..0000000 --- a/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"warnOnce.d.ts","sourceRoot":"","sources":["../src/util/warnOnce.ts"],"names":[],"mappings":"AAYA,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAS,QAW/D"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.js b/node_modules/apollo-utilities/lib/util/warnOnce.js deleted file mode 100644 index 167ba8f..0000000 --- a/node_modules/apollo-utilities/lib/util/warnOnce.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var environment_1 = require("./environment"); -var haveWarned = Object.create({}); -function warnOnceInDevelopment(msg, type) { - if (type === void 0) { type = 'warn'; } - if (!environment_1.isProduction() && !haveWarned[msg]) { - if (!environment_1.isTest()) { - haveWarned[msg] = true; - } - if (type === 'error') { - console.error(msg); - } - else { - console.warn(msg); - } - } -} -exports.warnOnceInDevelopment = warnOnceInDevelopment; -//# sourceMappingURL=warnOnce.js.map \ No newline at end of file diff --git a/node_modules/apollo-utilities/lib/util/warnOnce.js.map b/node_modules/apollo-utilities/lib/util/warnOnce.js.map deleted file mode 100644 index 63d8e3d..0000000 --- a/node_modules/apollo-utilities/lib/util/warnOnce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"warnOnce.js","sourceRoot":"","sources":["../../src/util/warnOnce.ts"],"names":[],"mappings":";;AAAA,6CAAqD;AAErD,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAUrC,SAAgB,qBAAqB,CAAC,GAAW,EAAE,IAAa;IAAb,qBAAA,EAAA,aAAa;IAC9D,IAAI,CAAC,0BAAY,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACvC,IAAI,CAAC,oBAAM,EAAE,EAAE;YACb,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;SACxB;QACD,IAAI,IAAI,KAAK,OAAO,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpB;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;AACH,CAAC;AAXD,sDAWC"} \ No newline at end of file diff --git a/node_modules/apollo-utilities/package.json b/node_modules/apollo-utilities/package.json deleted file mode 100644 index ae14ef6..0000000 --- a/node_modules/apollo-utilities/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "apollo-utilities", - "version": "1.3.4", - "description": "Utilities for working with GraphQL ASTs", - "author": "James Baxley ", - "contributors": [ - "James Baxley ", - "Jonas Helfer ", - "Sashko Stubailo ", - "James Burgess " - ], - "license": "MIT", - "main": "./lib/bundle.cjs.js", - "module": "./lib/bundle.esm.js", - "typings": "./lib/index.d.ts", - "sideEffects": false, - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/apollo-client.git" - }, - "bugs": { - "url": "https://github.com/apollographql/apollo-client/issues" - }, - "homepage": "https://github.com/apollographql/apollo-client#readme", - "scripts": { - "prepare": "npm run lint && npm run build", - "test": "tsc -p tsconfig.json --noEmit && jest", - "coverage": "jest --coverage", - "lint": "tslint -c \"../../config/tslint.json\" -p tsconfig.json src/*.ts", - "prebuild": "npm run clean", - "build": "tsc -b .", - "postbuild": "npm run bundle", - "bundle": "npx rollup -c rollup.config.js", - "watch": "../../node_modules/tsc-watch/index.js --onSuccess \"npm run postbuild\"", - "clean": "rm -rf coverage/* lib/*", - "prepublishOnly": "npm run clean && npm run build" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "dependencies": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "gitHead": "d22394c419ff7d678afb5e7d4cd1df16ed803ead" -} diff --git a/node_modules/apollo-utilities/src/__tests__/directives.ts b/node_modules/apollo-utilities/src/__tests__/directives.ts deleted file mode 100644 index eea3500..0000000 --- a/node_modules/apollo-utilities/src/__tests__/directives.ts +++ /dev/null @@ -1,274 +0,0 @@ -import gql from 'graphql-tag'; -import { cloneDeep } from 'lodash'; - -import { shouldInclude, hasDirectives } from '../directives'; -import { getQueryDefinition } from '../getFromAST'; - -describe('hasDirective', () => { - it('should allow searching the ast for a directive', () => { - const query = gql` - query Simple { - field @live - } - `; - expect(hasDirectives(['live'], query)).toBe(true); - expect(hasDirectives(['defer'], query)).toBe(false); - }); - it('works for all operation types', () => { - const query = gql` - { - field @live { - subField { - hello @live - } - } - } - `; - - const mutation = gql` - mutation Directive { - mutate { - field { - subField { - hello @live - } - } - } - } - `; - - const subscription = gql` - subscription LiveDirective { - sub { - field { - subField { - hello @live - } - } - } - } - `; - - [query, mutation, subscription].forEach(x => { - expect(hasDirectives(['live'], x)).toBe(true); - expect(hasDirectives(['defer'], x)).toBe(false); - }); - }); - it('works for simple fragments', () => { - const query = gql` - query Simple { - ...fieldFragment - } - - fragment fieldFragment on Field { - foo @live - } - `; - expect(hasDirectives(['live'], query)).toBe(true); - expect(hasDirectives(['defer'], query)).toBe(false); - }); - it('works for nested fragments', () => { - const query = gql` - query Simple { - ...fieldFragment1 - } - - fragment fieldFragment1 on Field { - bar { - baz { - ...nestedFragment - } - } - } - - fragment nestedFragment on Field { - foo @live - } - `; - expect(hasDirectives(['live'], query)).toBe(true); - expect(hasDirectives(['defer'], query)).toBe(false); - }); -}); - -describe('shouldInclude', () => { - it('should should not include a skipped field', () => { - const query = gql` - query { - fortuneCookie @skip(if: true) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(!shouldInclude(field, {})).toBe(true); - }); - - it('should include an included field', () => { - const query = gql` - query { - fortuneCookie @include(if: true) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(shouldInclude(field, {})).toBe(true); - }); - - it('should not include a not include: false field', () => { - const query = gql` - query { - fortuneCookie @include(if: false) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(!shouldInclude(field, {})).toBe(true); - }); - - it('should include a skip: false field', () => { - const query = gql` - query { - fortuneCookie @skip(if: false) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(shouldInclude(field, {})).toBe(true); - }); - - it('should not include a field if skip: true and include: true', () => { - const query = gql` - query { - fortuneCookie @skip(if: true) @include(if: true) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(!shouldInclude(field, {})).toBe(true); - }); - - it('should not include a field if skip: true and include: false', () => { - const query = gql` - query { - fortuneCookie @skip(if: true) @include(if: false) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(!shouldInclude(field, {})).toBe(true); - }); - - it('should include a field if skip: false and include: true', () => { - const query = gql` - query { - fortuneCookie @skip(if: false) @include(if: true) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(shouldInclude(field, {})).toBe(true); - }); - - it('should not include a field if skip: false and include: false', () => { - const query = gql` - query { - fortuneCookie @skip(if: false) @include(if: false) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(!shouldInclude(field, {})).toBe(true); - }); - - it('should leave the original query unmodified', () => { - const query = gql` - query { - fortuneCookie @skip(if: false) @include(if: false) - } - `; - const queryClone = cloneDeep(query); - const field = getQueryDefinition(query).selectionSet.selections[0]; - shouldInclude(field, {}); - expect(query).toEqual(queryClone); - }); - - it('does not throw an error on an unsupported directive', () => { - const query = gql` - query { - fortuneCookie @dosomething(if: true) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - - expect(() => { - shouldInclude(field, {}); - }).not.toThrow(); - }); - - it('throws an error on an invalid argument for the skip directive', () => { - const query = gql` - query { - fortuneCookie @skip(nothing: true) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - - expect(() => { - shouldInclude(field, {}); - }).toThrow(); - }); - - it('throws an error on an invalid argument for the include directive', () => { - const query = gql` - query { - fortuneCookie @include(nothing: true) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - - expect(() => { - shouldInclude(field, {}); - }).toThrow(); - }); - - it('throws an error on an invalid variable name within a directive argument', () => { - const query = gql` - query { - fortuneCookie @include(if: $neverDefined) - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(() => { - shouldInclude(field, {}); - }).toThrow(); - }); - - it('evaluates variables on skip fields', () => { - const query = gql` - query($shouldSkip: Boolean) { - fortuneCookie @skip(if: $shouldSkip) - } - `; - const variables = { - shouldSkip: true, - }; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(!shouldInclude(field, variables)).toBe(true); - }); - - it('evaluates variables on include fields', () => { - const query = gql` - query($shouldSkip: Boolean) { - fortuneCookie @include(if: $shouldInclude) - } - `; - const variables = { - shouldInclude: false, - }; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(!shouldInclude(field, variables)).toBe(true); - }); - - it('throws an error if the value of the argument is not a variable or boolean', () => { - const query = gql` - query { - fortuneCookie @include(if: "string") - } - `; - const field = getQueryDefinition(query).selectionSet.selections[0]; - expect(() => { - shouldInclude(field, {}); - }).toThrow(); - }); -}); diff --git a/node_modules/apollo-utilities/src/__tests__/fragments.ts b/node_modules/apollo-utilities/src/__tests__/fragments.ts deleted file mode 100644 index 1c6cfa1..0000000 --- a/node_modules/apollo-utilities/src/__tests__/fragments.ts +++ /dev/null @@ -1,327 +0,0 @@ -import { print } from 'graphql/language/printer'; -import gql from 'graphql-tag'; -import { disableFragmentWarnings } from 'graphql-tag'; - -// Turn off warnings for repeated fragment names -disableFragmentWarnings(); - -import { getFragmentQueryDocument } from '../fragments'; - -describe('getFragmentQueryDocument', () => { - it('will throw an error if there is an operation', () => { - expect(() => - getFragmentQueryDocument( - gql` - { - a - b - c - } - `, - ), - ).toThrowError( - 'Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.', - ); - expect(() => - getFragmentQueryDocument( - gql` - query { - a - b - c - } - `, - ), - ).toThrowError( - 'Found a query operation. No operations are allowed when using a fragment as a query. Only fragments are allowed.', - ); - expect(() => - getFragmentQueryDocument( - gql` - query Named { - a - b - c - } - `, - ), - ).toThrowError( - "Found a query operation named 'Named'. No operations are allowed when using a fragment as a query. Only fragments are allowed.", - ); - expect(() => - getFragmentQueryDocument( - gql` - mutation Named { - a - b - c - } - `, - ), - ).toThrowError( - "Found a mutation operation named 'Named'. No operations are allowed when using a fragment as a query. " + - 'Only fragments are allowed.', - ); - expect(() => - getFragmentQueryDocument( - gql` - subscription Named { - a - b - c - } - `, - ), - ).toThrowError( - "Found a subscription operation named 'Named'. No operations are allowed when using a fragment as a query. " + - 'Only fragments are allowed.', - ); - }); - - it('will throw an error if there is not exactly one fragment but no `fragmentName`', () => { - expect(() => { - getFragmentQueryDocument(gql` - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - } - `); - }).toThrowError( - 'Found 2 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.', - ); - expect(() => { - getFragmentQueryDocument(gql` - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - } - - fragment baz on Baz { - g - h - i - } - `); - }).toThrowError( - 'Found 3 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.', - ); - expect(() => { - getFragmentQueryDocument(gql` - scalar Foo - `); - }).toThrowError( - 'Found 0 fragments. `fragmentName` must be provided when there is not exactly 1 fragment.', - ); - }); - - it('will create a query document where the single fragment is spread in the root query', () => { - expect( - print( - getFragmentQueryDocument(gql` - fragment foo on Foo { - a - b - c - } - `), - ), - ).toEqual( - print(gql` - { - ...foo - } - - fragment foo on Foo { - a - b - c - } - `), - ); - }); - - it('will create a query document where the named fragment is spread in the root query', () => { - expect( - print( - getFragmentQueryDocument( - gql` - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - ...foo - } - - fragment baz on Baz { - g - h - i - ...foo - ...bar - } - `, - 'foo', - ), - ), - ).toEqual( - print(gql` - { - ...foo - } - - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - ...foo - } - - fragment baz on Baz { - g - h - i - ...foo - ...bar - } - `), - ); - expect( - print( - getFragmentQueryDocument( - gql` - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - ...foo - } - - fragment baz on Baz { - g - h - i - ...foo - ...bar - } - `, - 'bar', - ), - ), - ).toEqual( - print(gql` - { - ...bar - } - - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - ...foo - } - - fragment baz on Baz { - g - h - i - ...foo - ...bar - } - `), - ); - expect( - print( - getFragmentQueryDocument( - gql` - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - ...foo - } - - fragment baz on Baz { - g - h - i - ...foo - ...bar - } - `, - 'baz', - ), - ), - ).toEqual( - print(gql` - { - ...baz - } - - fragment foo on Foo { - a - b - c - } - - fragment bar on Bar { - d - e - f - ...foo - } - - fragment baz on Baz { - g - h - i - ...foo - ...bar - } - `), - ); - }); -}); diff --git a/node_modules/apollo-utilities/src/__tests__/getFromAST.ts b/node_modules/apollo-utilities/src/__tests__/getFromAST.ts deleted file mode 100644 index a81a5f3..0000000 --- a/node_modules/apollo-utilities/src/__tests__/getFromAST.ts +++ /dev/null @@ -1,316 +0,0 @@ -import { print } from 'graphql/language/printer'; -import gql from 'graphql-tag'; -import { FragmentDefinitionNode, OperationDefinitionNode } from 'graphql'; - -import { - checkDocument, - getFragmentDefinitions, - getQueryDefinition, - getMutationDefinition, - createFragmentMap, - FragmentMap, - getDefaultValues, - getOperationName, -} from '../getFromAST'; - -describe('AST utility functions', () => { - it('should correctly check a document for correctness', () => { - const multipleQueries = gql` - query { - author { - firstName - lastName - } - } - - query { - author { - address - } - } - `; - expect(() => { - checkDocument(multipleQueries); - }).toThrow(); - - const namedFragment = gql` - query { - author { - ...authorDetails - } - } - - fragment authorDetails on Author { - firstName - lastName - } - `; - expect(() => { - checkDocument(namedFragment); - }).not.toThrow(); - }); - - it('should get fragment definitions from a document containing a single fragment', () => { - const singleFragmentDefinition = gql` - query { - author { - ...authorDetails - } - } - - fragment authorDetails on Author { - firstName - lastName - } - `; - const expectedDoc = gql` - fragment authorDetails on Author { - firstName - lastName - } - `; - const expectedResult: FragmentDefinitionNode[] = [ - expectedDoc.definitions[0] as FragmentDefinitionNode, - ]; - const actualResult = getFragmentDefinitions(singleFragmentDefinition); - expect(actualResult.length).toEqual(expectedResult.length); - expect(print(actualResult[0])).toBe(print(expectedResult[0])); - }); - - it('should get fragment definitions from a document containing a multiple fragments', () => { - const multipleFragmentDefinitions = gql` - query { - author { - ...authorDetails - ...moreAuthorDetails - } - } - - fragment authorDetails on Author { - firstName - lastName - } - - fragment moreAuthorDetails on Author { - address - } - `; - const expectedDoc = gql` - fragment authorDetails on Author { - firstName - lastName - } - - fragment moreAuthorDetails on Author { - address - } - `; - const expectedResult: FragmentDefinitionNode[] = [ - expectedDoc.definitions[0] as FragmentDefinitionNode, - expectedDoc.definitions[1] as FragmentDefinitionNode, - ]; - const actualResult = getFragmentDefinitions(multipleFragmentDefinitions); - expect(actualResult.map(print)).toEqual(expectedResult.map(print)); - }); - - it('should get the correct query definition out of a query containing multiple fragments', () => { - const queryWithFragments = gql` - fragment authorDetails on Author { - firstName - lastName - } - - fragment moreAuthorDetails on Author { - address - } - - query { - author { - ...authorDetails - ...moreAuthorDetails - } - } - `; - const expectedDoc = gql` - query { - author { - ...authorDetails - ...moreAuthorDetails - } - } - `; - const expectedResult: OperationDefinitionNode = expectedDoc - .definitions[0] as OperationDefinitionNode; - const actualResult = getQueryDefinition(queryWithFragments); - - expect(print(actualResult)).toEqual(print(expectedResult)); - }); - - it('should throw if we try to get the query definition of a document with no query', () => { - const mutationWithFragments = gql` - fragment authorDetails on Author { - firstName - lastName - } - - mutation { - createAuthor(firstName: "John", lastName: "Smith") { - ...authorDetails - } - } - `; - expect(() => { - getQueryDefinition(mutationWithFragments); - }).toThrow(); - }); - - it('should get the correct mutation definition out of a mutation with multiple fragments', () => { - const mutationWithFragments = gql` - mutation { - createAuthor(firstName: "John", lastName: "Smith") { - ...authorDetails - } - } - - fragment authorDetails on Author { - firstName - lastName - } - `; - const expectedDoc = gql` - mutation { - createAuthor(firstName: "John", lastName: "Smith") { - ...authorDetails - } - } - `; - const expectedResult: OperationDefinitionNode = expectedDoc - .definitions[0] as OperationDefinitionNode; - const actualResult = getMutationDefinition(mutationWithFragments); - expect(print(actualResult)).toEqual(print(expectedResult)); - }); - - it('should create the fragment map correctly', () => { - const fragments = getFragmentDefinitions(gql` - fragment authorDetails on Author { - firstName - lastName - } - - fragment moreAuthorDetails on Author { - address - } - `); - const fragmentMap = createFragmentMap(fragments); - const expectedTable: FragmentMap = { - authorDetails: fragments[0], - moreAuthorDetails: fragments[1], - }; - expect(fragmentMap).toEqual(expectedTable); - }); - - it('should return an empty fragment map if passed undefined argument', () => { - expect(createFragmentMap(undefined)).toEqual({}); - }); - - it('should get the operation name out of a query', () => { - const query = gql` - query nameOfQuery { - fortuneCookie - } - `; - const operationName = getOperationName(query); - expect(operationName).toEqual('nameOfQuery'); - }); - - it('should get the operation name out of a mutation', () => { - const query = gql` - mutation nameOfMutation { - fortuneCookie - } - `; - const operationName = getOperationName(query); - expect(operationName).toEqual('nameOfMutation'); - }); - - it('should return null if the query does not have an operation name', () => { - const query = gql` - { - fortuneCookie - } - `; - const operationName = getOperationName(query); - expect(operationName).toEqual(null); - }); - - it('should throw if type definitions found in document', () => { - const queryWithTypeDefination = gql` - fragment authorDetails on Author { - firstName - lastName - } - - query($search: AuthorSearchInputType) { - author(search: $search) { - ...authorDetails - } - } - - input AuthorSearchInputType { - firstName: String - } - `; - expect(() => { - getQueryDefinition(queryWithTypeDefination); - }).toThrowError( - 'Schema type definitions not allowed in queries. Found: "InputObjectTypeDefinition"', - ); - }); - - describe('getDefaultValues', () => { - it('will create an empty variable object if no default values are provided', () => { - const basicQuery = gql` - query people($first: Int, $second: String) { - allPeople(first: $first) { - people { - name - } - } - } - `; - - expect(getDefaultValues(getQueryDefinition(basicQuery))).toEqual({}); - }); - - it('will create a variable object based on the definition node with default values', () => { - const basicQuery = gql` - query people($first: Int = 1, $second: String!) { - allPeople(first: $first) { - people { - name - } - } - } - `; - - const complexMutation = gql` - mutation complexStuff( - $test: Input = { key1: ["value", "value2"], key2: { key3: 4 } } - ) { - complexStuff(test: $test) { - people { - name - } - } - } - `; - - expect(getDefaultValues(getQueryDefinition(basicQuery))).toEqual({ - first: 1, - }); - expect(getDefaultValues(getMutationDefinition(complexMutation))).toEqual({ - test: { key1: ['value', 'value2'], key2: { key3: 4 } }, - }); - }); - }); -}); diff --git a/node_modules/apollo-utilities/src/__tests__/storeUtils.ts b/node_modules/apollo-utilities/src/__tests__/storeUtils.ts deleted file mode 100644 index ba45943..0000000 --- a/node_modules/apollo-utilities/src/__tests__/storeUtils.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { getStoreKeyName } from '../storeUtils'; - -describe('getStoreKeyName', () => { - it( - 'should return a deterministic version of the store key name no matter ' + - 'which order the args object properties are in', - () => { - const validStoreKeyName = - 'someField({"prop1":"value1","prop2":"value2"})'; - let generatedStoreKeyName = getStoreKeyName('someField', { - prop1: 'value1', - prop2: 'value2', - }); - expect(generatedStoreKeyName).toEqual(validStoreKeyName); - - generatedStoreKeyName = getStoreKeyName('someField', { - prop2: 'value2', - prop1: 'value1', - }); - expect(generatedStoreKeyName).toEqual(validStoreKeyName); - }, - ); -}); diff --git a/node_modules/apollo-utilities/src/__tests__/transform.ts b/node_modules/apollo-utilities/src/__tests__/transform.ts deleted file mode 100644 index 26835f4..0000000 --- a/node_modules/apollo-utilities/src/__tests__/transform.ts +++ /dev/null @@ -1,1242 +0,0 @@ -import { print } from 'graphql/language/printer'; -import gql from 'graphql-tag'; -import { disableFragmentWarnings } from 'graphql-tag'; - -// Turn off warnings for repeated fragment names -disableFragmentWarnings(); - -import { - addTypenameToDocument, - removeDirectivesFromDocument, - getDirectivesFromDocument, - removeConnectionDirectiveFromDocument, - removeArgumentsFromDocument, - removeFragmentSpreadFromDocument, - removeClientSetsFromDocument, -} from '../transform'; -import { getQueryDefinition } from '../getFromAST'; - -describe('removeArgumentsFromDocument', () => { - it('should remove a single variable', () => { - const query = gql` - query Simple($variable: String!) { - field(usingVariable: $variable) { - child - foo - } - network - } - `; - const expected = gql` - query Simple { - field { - child - foo - } - network - } - `; - const doc = removeArgumentsFromDocument([{ name: 'variable' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove a single variable and the field from the query', () => { - const query = gql` - query Simple($variable: String!) { - field(usingVariable: $variable) { - child - foo - } - network - } - `; - const expected = gql` - query Simple { - network - } - `; - const doc = removeArgumentsFromDocument( - [{ name: 'variable', remove: true }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); -}); -describe('removeFragmentSpreadFromDocument', () => { - it('should remove a named fragment spread', () => { - const query = gql` - query Simple { - ...FragmentSpread - property - ...ValidSpread - } - - fragment FragmentSpread on Thing { - foo - bar - baz - } - - fragment ValidSpread on Thing { - oof - rab - zab - } - `; - const expected = gql` - query Simple { - property - ...ValidSpread - } - - fragment ValidSpread on Thing { - oof - rab - zab - } - `; - const doc = removeFragmentSpreadFromDocument( - [{ name: 'FragmentSpread', remove: true }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); -}); -describe('removeDirectivesFromDocument', () => { - it('should not remove unused variable definitions unless the field is removed', () => { - const query = gql` - query Simple($variable: String!) { - field(usingVariable: $variable) @client - networkField - } - `; - - const expected = gql` - query Simple($variable: String!) { - field(usingVariable: $variable) - networkField - } - `; - - const doc = removeDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove unused variable definitions associated with the removed directive', () => { - const query = gql` - query Simple($variable: String!) { - field(usingVariable: $variable) @client - networkField - } - `; - - const expected = gql` - query Simple { - networkField - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'client', remove: true }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); - - it('should not remove used variable definitions', () => { - const query = gql` - query Simple($variable: String!) { - field(usingVariable: $variable) @client - networkField(usingVariable: $variable) - } - `; - - const expected = gql` - query Simple($variable: String!) { - networkField(usingVariable: $variable) - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'client', remove: true }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove fragment spreads and definitions associated with the removed directive', () => { - const query = gql` - query Simple { - networkField - field @client { - ...ClientFragment - } - } - - fragment ClientFragment on Thing { - otherField - bar - } - `; - - const expected = gql` - query Simple { - networkField - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'client', remove: true }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); - - it('should not remove fragment spreads and definitions used without the removed directive', () => { - const query = gql` - query Simple { - networkField { - ...ClientFragment - } - field @client { - ...ClientFragment - } - } - - fragment ClientFragment on Thing { - otherField - bar - } - `; - - const expected = gql` - query Simple { - networkField { - ...ClientFragment - } - } - - fragment ClientFragment on Thing { - otherField - bar - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'client', remove: true }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove a simple directive', () => { - const query = gql` - query Simple { - field @storage(if: true) - } - `; - - const expected = gql` - query Simple { - field - } - `; - const doc = removeDirectivesFromDocument([{ name: 'storage' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove a simple directive [test function]', () => { - const query = gql` - query Simple { - field @storage(if: true) - } - `; - - const expected = gql` - query Simple { - field - } - `; - const test = ({ name: { value } }: { name: any }) => value === 'storage'; - const doc = removeDirectivesFromDocument([{ test }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove only the wanted directive', () => { - const query = gql` - query Simple { - maybe @skip(if: false) - field @storage(if: true) - } - `; - - const expected = gql` - query Simple { - maybe @skip(if: false) - field - } - `; - const doc = removeDirectivesFromDocument([{ name: 'storage' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove only the wanted directive [test function]', () => { - const query = gql` - query Simple { - maybe @skip(if: false) - field @storage(if: true) - } - `; - - const expected = gql` - query Simple { - maybe @skip(if: false) - field - } - `; - const test = ({ name: { value } }: { name: any }) => value === 'storage'; - const doc = removeDirectivesFromDocument([{ test }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove multiple directives in the query', () => { - const query = gql` - query Simple { - field @storage(if: true) - other: field @storage - } - `; - - const expected = gql` - query Simple { - field - other: field - } - `; - const doc = removeDirectivesFromDocument([{ name: 'storage' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove multiple directives of different kinds in the query', () => { - const query = gql` - query Simple { - maybe @skip(if: false) - field @storage(if: true) - other: field @client - } - `; - - const expected = gql` - query Simple { - maybe @skip(if: false) - field - other: field - } - `; - const removed = [ - { name: 'storage' }, - { - test: (directive: any) => directive.name.value === 'client', - }, - ]; - const doc = removeDirectivesFromDocument(removed, query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove a simple directive and its field if needed', () => { - const query = gql` - query Simple { - field @storage(if: true) - keep - } - `; - - const expected = gql` - query Simple { - keep - } - `; - const doc = removeDirectivesFromDocument( - [{ name: 'storage', remove: true }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove a simple directive [test function]', () => { - const query = gql` - query Simple { - field @storage(if: true) - keep - } - `; - - const expected = gql` - query Simple { - keep - } - `; - const test = ({ name: { value } }: { name: any }) => value === 'storage'; - const doc = removeDirectivesFromDocument([{ test, remove: true }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should return null if the query is no longer valid', () => { - const query = gql` - query Simple { - field @storage(if: true) - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'storage', remove: true }], - query, - ); - - expect(doc).toBe(null); - }); - - it('should return null if the query is no longer valid [test function]', () => { - const query = gql` - query Simple { - field @storage(if: true) - } - `; - - const test = ({ name: { value } }: { name: any }) => value === 'storage'; - const doc = removeDirectivesFromDocument([{ test, remove: true }], query); - expect(doc).toBe(null); - }); - - it('should return null only if the query is not valid', () => { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - field - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'storage', remove: true }], - query, - ); - - expect(print(doc)).toBe(print(query)); - }); - - it('should return null only if the query is not valid through nested fragments', () => { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - ...inDirection - } - - fragment inDirection on Thing { - field @storage - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'storage', remove: true }], - query, - ); - - expect(doc).toBe(null); - }); - - it('should only remove values asked through nested fragments', () => { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - ...inDirection - } - - fragment inDirection on Thing { - field @storage - bar - } - `; - - const expectedQuery = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - ...inDirection - } - - fragment inDirection on Thing { - bar - } - `; - const doc = removeDirectivesFromDocument( - [{ name: 'storage', remove: true }], - query, - ); - - expect(print(doc)).toBe(print(expectedQuery)); - }); - - it('should return null even through fragments if needed', () => { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - field @storage - } - `; - - const doc = removeDirectivesFromDocument( - [{ name: 'storage', remove: true }], - query, - ); - - expect(doc).toBe(null); - }); - - it('should not throw in combination with addTypenameToDocument', () => { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - ...inDirection - } - - fragment inDirection on Thing { - field @storage - } - `; - - expect(() => { - removeDirectivesFromDocument( - [{ name: 'storage', remove: true }], - addTypenameToDocument(query), - ); - }).not.toThrow(); - }); -}); - -describe('query transforms', () => { - it('should correctly add typenames', () => { - let testQuery = gql` - query { - author { - name { - firstName - lastName - } - } - } - `; - const newQueryDoc = addTypenameToDocument(testQuery); - - const expectedQuery = gql` - query { - author { - name { - firstName - lastName - __typename - } - __typename - } - } - `; - const expectedQueryStr = print(expectedQuery); - - expect(print(newQueryDoc)).toBe(expectedQueryStr); - }); - - it('should not add duplicates', () => { - let testQuery = gql` - query { - author { - name { - firstName - lastName - __typename - } - } - } - `; - const newQueryDoc = addTypenameToDocument(testQuery); - - const expectedQuery = gql` - query { - author { - name { - firstName - lastName - __typename - } - __typename - } - } - `; - const expectedQueryStr = print(expectedQuery); - - expect(print(newQueryDoc)).toBe(expectedQueryStr); - }); - - it('should not screw up on a FragmentSpread within the query AST', () => { - const testQuery = gql` - query withFragments { - user(id: 4) { - friends(first: 10) { - ...friendFields - } - } - } - `; - const expectedQuery = getQueryDefinition(gql` - query withFragments { - user(id: 4) { - friends(first: 10) { - ...friendFields - __typename - } - __typename - } - } - `); - const modifiedQuery = addTypenameToDocument(testQuery); - expect(print(expectedQuery)).toBe(print(getQueryDefinition(modifiedQuery))); - }); - - it('should modify all definitions in a document', () => { - const testQuery = gql` - query withFragments { - user(id: 4) { - friends(first: 10) { - ...friendFields - } - } - } - - fragment friendFields on User { - firstName - lastName - } - `; - - const newQueryDoc = addTypenameToDocument(testQuery); - - const expectedQuery = gql` - query withFragments { - user(id: 4) { - friends(first: 10) { - ...friendFields - __typename - } - __typename - } - } - - fragment friendFields on User { - firstName - lastName - __typename - } - `; - - expect(print(expectedQuery)).toBe(print(newQueryDoc)); - }); - - it('should be able to apply a QueryTransformer correctly', () => { - const testQuery = gql` - query { - author { - firstName - lastName - } - } - `; - - const expectedQuery = getQueryDefinition(gql` - query { - author { - firstName - lastName - __typename - } - } - `); - - const modifiedQuery = addTypenameToDocument(testQuery); - expect(print(expectedQuery)).toBe(print(getQueryDefinition(modifiedQuery))); - }); - - it('should be able to apply a MutationTransformer correctly', () => { - const testQuery = gql` - mutation { - createAuthor(firstName: "John", lastName: "Smith") { - firstName - lastName - } - } - `; - const expectedQuery = gql` - mutation { - createAuthor(firstName: "John", lastName: "Smith") { - firstName - lastName - __typename - } - } - `; - - const modifiedQuery = addTypenameToDocument(testQuery); - expect(print(expectedQuery)).toBe(print(modifiedQuery)); - }); - - it('should add typename fields correctly on this one query', () => { - const testQuery = gql` - query Feed($type: FeedType!) { - # Eventually move this into a no fetch query right on the entry - # since we literally just need this info to determine whether to - # show upvote/downvote buttons - currentUser { - login - } - feed(type: $type) { - createdAt - score - commentCount - id - postedBy { - login - html_url - } - repository { - name - full_name - description - html_url - stargazers_count - open_issues_count - created_at - owner { - avatar_url - } - } - } - } - `; - const expectedQuery = getQueryDefinition(gql` - query Feed($type: FeedType!) { - currentUser { - login - __typename - } - feed(type: $type) { - createdAt - score - commentCount - id - postedBy { - login - html_url - __typename - } - repository { - name - full_name - description - html_url - stargazers_count - open_issues_count - created_at - owner { - avatar_url - __typename - } - __typename - } - __typename - } - } - `); - const modifiedQuery = addTypenameToDocument(testQuery); - expect(print(expectedQuery)).toBe(print(getQueryDefinition(modifiedQuery))); - }); - - it('should correctly remove connections', () => { - let testQuery = gql` - query { - author { - name @connection(key: "foo") { - firstName - lastName - } - } - } - `; - const newQueryDoc = removeConnectionDirectiveFromDocument(testQuery); - - const expectedQuery = gql` - query { - author { - name { - firstName - lastName - } - } - } - `; - const expectedQueryStr = print(expectedQuery); - - expect(expectedQueryStr).toBe(print(newQueryDoc)); - }); -}); - -describe('getDirectivesFromDocument', () => { - it('should get query with fields of storage directive ', () => { - const query = gql` - query Simple { - field @storage(if: true) - } - `; - - const expected = gql` - query Simple { - field @storage(if: true) - } - `; - const doc = getDirectivesFromDocument([{ name: 'storage' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should get query with fields of storage directive [test function] ', () => { - const query = gql` - query Simple { - field @storage(if: true) - } - `; - - const expected = gql` - query Simple { - field @storage(if: true) - } - `; - const test = ({ name: { value } }: { name: any }) => value === 'storage'; - const doc = getDirectivesFromDocument([{ test }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should only get query with fields of storage directive ', () => { - const query = gql` - query Simple { - maybe @skip(if: false) - field @storage(if: true) - } - `; - - const expected = gql` - query Simple { - field @storage(if: true) - } - `; - const doc = getDirectivesFromDocument([{ name: 'storage' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should only get query with multiple fields of storage directive ', () => { - const query = gql` - query Simple { - maybe @skip(if: false) - field @storage(if: true) - other @storage - } - `; - - const expected = gql` - query Simple { - field @storage(if: true) - other @storage - } - `; - const doc = getDirectivesFromDocument([{ name: 'storage' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should get query with fields of both storage and client directives ', () => { - const query = gql` - query Simple { - maybe @skip(if: false) - field @storage(if: true) - user @client - } - `; - - const expected = gql` - query Simple { - field @storage(if: true) - user @client - } - `; - const doc = getDirectivesFromDocument( - [{ name: 'storage' }, { name: 'client' }], - query, - ); - expect(print(doc)).toBe(print(expected)); - }); - - it('should get query with different types of directive matchers ', () => { - const query = gql` - query Simple { - maybe @skip(if: false) - field @storage(if: true) - user @client - } - `; - - const expected = gql` - query Simple { - field @storage(if: true) - user @client - } - `; - const doc = getDirectivesFromDocument( - [ - { name: 'storage' }, - { test: directive => directive.name.value === 'client' }, - ], - query, - ); - - expect(print(doc)).toBe(print(expected)); - }); - - it('should get query with nested fields ', () => { - const query = gql` - query Simple { - user { - firstName @client - email - } - } - `; - - const expected = gql` - query Simple { - user { - firstName @client - } - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should include all the nested fields of field that has client directive ', () => { - const query = gql` - query Simple { - user @client { - firstName - email - } - } - `; - - const expected = gql` - query Simple { - user @client { - firstName - email - } - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should return null if the query is no longer valid', () => { - const query = gql` - query Simple { - field - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(null); - }); - - it('should get query with client fields in fragment', function() { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - field @client - other - } - `; - const expected = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - field @client - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should get query with client fields in fragment with nested fields', function() { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - user { - firstName @client - lastName - } - } - `; - const expected = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - user { - firstName @client - } - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should get query with client fields in multiple fragments', function() { - const query = gql` - query Simple { - ...fragmentSpread - ...anotherFragmentSpread - } - - fragment fragmentSpread on Thing { - field @client - other - } - - fragment anotherFragmentSpread on AnotherThing { - user @client - product - } - `; - const expected = gql` - query Simple { - ...fragmentSpread - ...anotherFragmentSpread - } - - fragment fragmentSpread on Thing { - field @client - } - - fragment anotherFragmentSpread on AnotherThing { - user @client - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it("should return null if fragment didn't have client fields", function() { - const query = gql` - query Simple { - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - field - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(null)); - }); - - it('should get query with client fields when both fields and fragements are mixed', function() { - const query = gql` - query Simple { - user @client - product @storage - order - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - field @client - other - } - `; - const expected = gql` - query Simple { - user @client - ...fragmentSpread - } - - fragment fragmentSpread on Thing { - field @client - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should get mutation with client fields', () => { - const query = gql` - mutation { - login @client - } - `; - - const expected = gql` - mutation { - login @client - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should get mutation fields of client only', () => { - const query = gql` - mutation { - login @client - updateUser - } - `; - - const expected = gql` - mutation { - login @client - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query); - expect(print(doc)).toBe(print(expected)); - }); - - describe('includeAllFragments', () => { - it('= false: should remove the values without a client in fragment', () => { - const query = gql` - fragment client on ClientData { - hi @client - bye @storage - bar - } - - query Mixed { - foo @client { - ...client - } - bar { - baz - } - } - `; - - const expected = gql` - fragment client on ClientData { - hi @client - } - - query Mixed { - foo @client { - ...client - } - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query, false); - expect(print(doc)).toBe(print(expected)); - }); - - it('= true: should include the values without a client in fragment', () => { - const query = gql` - fragment client on ClientData { - hi @client - bye @storage - bar - } - - query Mixed { - foo @client { - ...client - } - bar { - baz - } - } - `; - - const expected = gql` - fragment client on ClientData { - hi @client - } - - query Mixed { - foo @client { - ...client - } - } - `; - const doc = getDirectivesFromDocument([{ name: 'client' }], query, true); - expect(print(doc)).toBe(print(expected)); - }); - }); -}); - -describe('removeClientSetsFromDocument', () => { - it('should remove @client fields from document', () => { - const query = gql` - query Author { - name - isLoggedIn @client - } - `; - - const expected = gql` - query Author { - name - } - `; - const doc = removeClientSetsFromDocument(query); - expect(print(doc)).toBe(print(expected)); - }); - - it('should remove @client fields from fragments', () => { - const query = gql` - fragment authorInfo on Author { - name - isLoggedIn @client - } - `; - - const expected = gql` - fragment authorInfo on Author { - name - } - `; - const doc = removeClientSetsFromDocument(query); - expect(print(doc)).toBe(print(expected)); - }); -}); diff --git a/node_modules/apollo-utilities/src/declarations.d.ts b/node_modules/apollo-utilities/src/declarations.d.ts deleted file mode 100644 index 6954665..0000000 --- a/node_modules/apollo-utilities/src/declarations.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'fast-json-stable-stringify'; diff --git a/node_modules/apollo-utilities/src/directives.ts b/node_modules/apollo-utilities/src/directives.ts deleted file mode 100644 index 84c14ab..0000000 --- a/node_modules/apollo-utilities/src/directives.ts +++ /dev/null @@ -1,127 +0,0 @@ -// Provides the methods that allow QueryManager to handle the `skip` and -// `include` directives within GraphQL. -import { - FieldNode, - SelectionNode, - VariableNode, - BooleanValueNode, - DirectiveNode, - DocumentNode, - ArgumentNode, - ValueNode, -} from 'graphql'; - -import { visit } from 'graphql/language/visitor'; - -import { invariant } from 'ts-invariant'; - -import { argumentsObjectFromField } from './storeUtils'; - -export type DirectiveInfo = { - [fieldName: string]: { [argName: string]: any }; -}; - -export function getDirectiveInfoFromField( - field: FieldNode, - variables: Object, -): DirectiveInfo { - if (field.directives && field.directives.length) { - const directiveObj: DirectiveInfo = {}; - field.directives.forEach((directive: DirectiveNode) => { - directiveObj[directive.name.value] = argumentsObjectFromField( - directive, - variables, - ); - }); - return directiveObj; - } - return null; -} - -export function shouldInclude( - selection: SelectionNode, - variables: { [name: string]: any } = {}, -): boolean { - return getInclusionDirectives( - selection.directives, - ).every(({ directive, ifArgument }) => { - let evaledValue: boolean = false; - if (ifArgument.value.kind === 'Variable') { - evaledValue = variables[(ifArgument.value as VariableNode).name.value]; - invariant( - evaledValue !== void 0, - `Invalid variable referenced in @${directive.name.value} directive.`, - ); - } else { - evaledValue = (ifArgument.value as BooleanValueNode).value; - } - return directive.name.value === 'skip' ? !evaledValue : evaledValue; - }); -} - -export function getDirectiveNames(doc: DocumentNode) { - const names: string[] = []; - - visit(doc, { - Directive(node) { - names.push(node.name.value); - }, - }); - - return names; -} - -export function hasDirectives(names: string[], doc: DocumentNode) { - return getDirectiveNames(doc).some( - (name: string) => names.indexOf(name) > -1, - ); -} - -export function hasClientExports(document: DocumentNode) { - return ( - document && - hasDirectives(['client'], document) && - hasDirectives(['export'], document) - ); -} - -export type InclusionDirectives = Array<{ - directive: DirectiveNode; - ifArgument: ArgumentNode; -}>; - -function isInclusionDirective({ name: { value } }: DirectiveNode): boolean { - return value === 'skip' || value === 'include'; -} - -export function getInclusionDirectives( - directives: ReadonlyArray, -): InclusionDirectives { - return directives ? directives.filter(isInclusionDirective).map(directive => { - const directiveArguments = directive.arguments; - const directiveName = directive.name.value; - - invariant( - directiveArguments && directiveArguments.length === 1, - `Incorrect number of arguments for the @${directiveName} directive.`, - ); - - const ifArgument = directiveArguments[0]; - invariant( - ifArgument.name && ifArgument.name.value === 'if', - `Invalid argument for the @${directiveName} directive.`, - ); - - const ifValue: ValueNode = ifArgument.value; - - // means it has to be a variable value if this is a valid @skip or @include directive - invariant( - ifValue && - (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), - `Argument for the @${directiveName} directive must be a variable or a boolean value.`, - ); - - return { directive, ifArgument }; - }) : []; -} - diff --git a/node_modules/apollo-utilities/src/fragments.ts b/node_modules/apollo-utilities/src/fragments.ts deleted file mode 100644 index f60c86a..0000000 --- a/node_modules/apollo-utilities/src/fragments.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { DocumentNode, FragmentDefinitionNode } from 'graphql'; -import { invariant, InvariantError } from 'ts-invariant'; - -/** - * Returns a query document which adds a single query operation that only - * spreads the target fragment inside of it. - * - * So for example a document of: - * - * ```graphql - * fragment foo on Foo { a b c } - * ``` - * - * Turns into: - * - * ```graphql - * { ...foo } - * - * fragment foo on Foo { a b c } - * ``` - * - * The target fragment will either be the only fragment in the document, or a - * fragment specified by the provided `fragmentName`. If there is more than one - * fragment, but a `fragmentName` was not defined then an error will be thrown. - */ -export function getFragmentQueryDocument( - document: DocumentNode, - fragmentName?: string, -): DocumentNode { - let actualFragmentName = fragmentName; - - // Build an array of all our fragment definitions that will be used for - // validations. We also do some validations on the other definitions in the - // document while building this list. - const fragments: Array = []; - document.definitions.forEach(definition => { - // Throw an error if we encounter an operation definition because we will - // define our own operation definition later on. - if (definition.kind === 'OperationDefinition') { - throw new InvariantError( - `Found a ${definition.operation} operation${ - definition.name ? ` named '${definition.name.value}'` : '' - }. ` + - 'No operations are allowed when using a fragment as a query. Only fragments are allowed.', - ); - } - // Add our definition to the fragments array if it is a fragment - // definition. - if (definition.kind === 'FragmentDefinition') { - fragments.push(definition); - } - }); - - // If the user did not give us a fragment name then let us try to get a - // name from a single fragment in the definition. - if (typeof actualFragmentName === 'undefined') { - invariant( - fragments.length === 1, - `Found ${ - fragments.length - } fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`, - ); - actualFragmentName = fragments[0].name.value; - } - - // Generate a query document with an operation that simply spreads the - // fragment inside of it. - const query: DocumentNode = { - ...document, - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName, - }, - }, - ], - }, - }, - ...document.definitions, - ], - }; - - return query; -} diff --git a/node_modules/apollo-utilities/src/getFromAST.ts b/node_modules/apollo-utilities/src/getFromAST.ts deleted file mode 100644 index febe526..0000000 --- a/node_modules/apollo-utilities/src/getFromAST.ts +++ /dev/null @@ -1,233 +0,0 @@ -import { - DocumentNode, - OperationDefinitionNode, - FragmentDefinitionNode, - ValueNode, -} from 'graphql'; - -import { invariant, InvariantError } from 'ts-invariant'; - -import { assign } from './util/assign'; - -import { valueToObjectRepresentation, JsonValue } from './storeUtils'; - -export function getMutationDefinition( - doc: DocumentNode, -): OperationDefinitionNode { - checkDocument(doc); - - let mutationDef: OperationDefinitionNode | null = doc.definitions.filter( - definition => - definition.kind === 'OperationDefinition' && - definition.operation === 'mutation', - )[0] as OperationDefinitionNode; - - invariant(mutationDef, 'Must contain a mutation definition.'); - - return mutationDef; -} - -// Checks the document for errors and throws an exception if there is an error. -export function checkDocument(doc: DocumentNode) { - invariant( - doc && doc.kind === 'Document', - `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \ -string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`, - ); - - const operations = doc.definitions - .filter(d => d.kind !== 'FragmentDefinition') - .map(definition => { - if (definition.kind !== 'OperationDefinition') { - throw new InvariantError( - `Schema type definitions not allowed in queries. Found: "${ - definition.kind - }"`, - ); - } - return definition; - }); - - invariant( - operations.length <= 1, - `Ambiguous GraphQL document: contains ${operations.length} operations`, - ); - - return doc; -} - -export function getOperationDefinition( - doc: DocumentNode, -): OperationDefinitionNode | undefined { - checkDocument(doc); - return doc.definitions.filter( - definition => definition.kind === 'OperationDefinition', - )[0] as OperationDefinitionNode; -} - -export function getOperationDefinitionOrDie( - document: DocumentNode, -): OperationDefinitionNode { - const def = getOperationDefinition(document); - invariant(def, `GraphQL document is missing an operation`); - return def; -} - -export function getOperationName(doc: DocumentNode): string | null { - return ( - doc.definitions - .filter( - definition => - definition.kind === 'OperationDefinition' && definition.name, - ) - .map((x: OperationDefinitionNode) => x.name.value)[0] || null - ); -} - -// Returns the FragmentDefinitions from a particular document as an array -export function getFragmentDefinitions( - doc: DocumentNode, -): FragmentDefinitionNode[] { - return doc.definitions.filter( - definition => definition.kind === 'FragmentDefinition', - ) as FragmentDefinitionNode[]; -} - -export function getQueryDefinition(doc: DocumentNode): OperationDefinitionNode { - const queryDef = getOperationDefinition(doc) as OperationDefinitionNode; - - invariant( - queryDef && queryDef.operation === 'query', - 'Must contain a query definition.', - ); - - return queryDef; -} - -export function getFragmentDefinition( - doc: DocumentNode, -): FragmentDefinitionNode { - invariant( - doc.kind === 'Document', - `Expecting a parsed GraphQL document. Perhaps you need to wrap the query \ -string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql`, - ); - - invariant( - doc.definitions.length <= 1, - 'Fragment must have exactly one definition.', - ); - - const fragmentDef = doc.definitions[0] as FragmentDefinitionNode; - - invariant( - fragmentDef.kind === 'FragmentDefinition', - 'Must be a fragment definition.', - ); - - return fragmentDef as FragmentDefinitionNode; -} - -/** - * Returns the first operation definition found in this document. - * If no operation definition is found, the first fragment definition will be returned. - * If no definitions are found, an error will be thrown. - */ -export function getMainDefinition( - queryDoc: DocumentNode, -): OperationDefinitionNode | FragmentDefinitionNode { - checkDocument(queryDoc); - - let fragmentDefinition; - - for (let definition of queryDoc.definitions) { - if (definition.kind === 'OperationDefinition') { - const operation = (definition as OperationDefinitionNode).operation; - if ( - operation === 'query' || - operation === 'mutation' || - operation === 'subscription' - ) { - return definition as OperationDefinitionNode; - } - } - if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) { - // we do this because we want to allow multiple fragment definitions - // to precede an operation definition. - fragmentDefinition = definition as FragmentDefinitionNode; - } - } - - if (fragmentDefinition) { - return fragmentDefinition; - } - - throw new InvariantError( - 'Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.', - ); -} - -/** - * This is an interface that describes a map from fragment names to fragment definitions. - */ -export interface FragmentMap { - [fragmentName: string]: FragmentDefinitionNode; -} - -// Utility function that takes a list of fragment definitions and makes a hash out of them -// that maps the name of the fragment to the fragment definition. -export function createFragmentMap( - fragments: FragmentDefinitionNode[] = [], -): FragmentMap { - const symTable: FragmentMap = {}; - fragments.forEach(fragment => { - symTable[fragment.name.value] = fragment; - }); - - return symTable; -} - -export function getDefaultValues( - definition: OperationDefinitionNode | undefined, -): { [key: string]: JsonValue } { - if ( - definition && - definition.variableDefinitions && - definition.variableDefinitions.length - ) { - const defaultValues = definition.variableDefinitions - .filter(({ defaultValue }) => defaultValue) - .map( - ({ variable, defaultValue }): { [key: string]: JsonValue } => { - const defaultValueObj: { [key: string]: JsonValue } = {}; - valueToObjectRepresentation( - defaultValueObj, - variable.name, - defaultValue as ValueNode, - ); - - return defaultValueObj; - }, - ); - - return assign({}, ...defaultValues); - } - - return {}; -} - -/** - * Returns the names of all variables declared by the operation. - */ -export function variablesInOperation( - operation: OperationDefinitionNode, -): Set { - const names = new Set(); - if (operation.variableDefinitions) { - for (const definition of operation.variableDefinitions) { - names.add(definition.variable.name.value); - } - } - - return names; -} diff --git a/node_modules/apollo-utilities/src/index.js.flow b/node_modules/apollo-utilities/src/index.js.flow deleted file mode 100644 index a7fc594..0000000 --- a/node_modules/apollo-utilities/src/index.js.flow +++ /dev/null @@ -1,220 +0,0 @@ -// @flow -import type { - DirectiveNode, - StringValueNode, - BooleanValueNode, - IntValueNode, - FloatValueNode, - EnumValueNode, - VariableNode, - FieldNode, - FragmentDefinitionNode, - OperationDefinitionNode, - SelectionNode, - DocumentNode, - DefinitionNode, - ValueNode, - NameNode, -} from 'graphql'; - -declare module 'apollo-utilities' { - // storeUtils - declare export interface IdValue { - type: 'id'; - id: string; - generated: boolean; - typename: string | void; - } - - declare export interface JsonValue { - type: 'json'; - json: any; - } - - declare export type ListValue = Array; - - declare export type StoreValue = - | number - | string - | Array - | IdValue - | ListValue - | JsonValue - | null - | void - | Object; - - declare export type ScalarValue = - | StringValueNode - | BooleanValueNode - | EnumValueNode; - - declare export type NumberValue = IntValueNode | FloatValueNode; - - declare type isValueFn = (value: ValueNode) => boolean; - - declare export type isScalarValue = isValueFn; - declare export type isNumberValue = isValueFn; - declare export type isStringValue = isValueFn; - declare export type isBooleanValue = isValueFn; - declare export type isIntValue = isValueFn; - declare export type isFloatValue = isValueFn; - declare export type isVariable = isValueFn; - declare export type isObjectValue = isValueFn; - declare export type isListValue = isValueFn; - declare export type isEnumValue = isValueFn; - - declare export function valueToObjectRepresentation( - argObj: any, - name: NameNode, - value: ValueNode, - variables?: Object, - ): any; - - declare export function storeKeyNameFromField( - field: FieldNode, - variables?: Object, - ): string; - - declare export type Directives = { - [directiveName: string]: { - [argName: string]: any, - }, - }; - - declare export function getStoreKeyName( - fieldName: string, - args?: Object, - directives?: Directives, - ): string; - - declare export function argumentsObjectFromField( - field: FieldNode | DirectiveNode, - variables: Object, - ): ?Object; - - declare export function resultKeyNameFromField(field: FieldNode): string; - - declare export function isField(selection: SelectionNode): boolean; - - declare export function isInlineFragment(selection: SelectionNode): boolean; - - declare export function isIdValue(idObject: StoreValue): boolean; - - declare export type IdConfig = { - id: string, - typename: string | void, - }; - - declare export function toIdValue( - id: string | IdConfig, - generated?: boolean, - ): IdValue; - - declare export function isJsonValue(jsonObject: StoreValue): boolean; - - declare export type VariableValue = (node: VariableNode) => any; - - declare export function valueFromNode( - node: ValueNode, - onVariable: VariableValue, - ): any; - - // getFromAST - declare export function getMutationDefinition( - doc: DocumentNode, - ): OperationDefinitionNode; - - declare export function checkDocument(doc: DocumentNode): void; - - declare export function getOperationDefinition( - doc: DocumentNode, - ): ?OperationDefinitionNode; - - declare export function getOperationDefinitionOrDie( - document: DocumentNode, - ): OperationDefinitionNode; - - declare export function getOperationName(doc: DocumentNode): ?string; - - declare export function getFragmentDefinitions( - doc: DocumentNode, - ): Array; - - declare export function getQueryDefinition( - doc: DocumentNode, - ): OperationDefinitionNode; - - declare export function getFragmentDefinition( - doc: DocumentNode, - ): FragmentDefinitionNode; - - declare export function getMainDefinition( - queryDoc: DocumentNode, - ): OperationDefinitionNode | FragmentDefinitionNode; - - declare export interface FragmentMap { - [fragmentName: string]: FragmentDefinitionNode; - } - - declare export function createFragmentMap( - fragments: Array, - ): FragmentMap; - - declare export function getDefaultValues( - definition: ?OperationDefinitionNode, - ): { [key: string]: JsonValue }; - - // fragments - declare export function getFragmentQueryDocument( - document: DocumentNode, - fragmentName?: string, - ): DocumentNode; - - declare export function variablesInOperation( - operation: OperationDefinitionNode, - ): Set; - - // directives - declare type DirectiveInfo = { - [fieldName: string]: { [argName: string]: any }, - }; - - declare export function getDirectiveInfoFromField( - field: FieldNode, - object: Object, - ): ?DirectiveInfo; - - declare export function shouldInclude( - selection: SelectionNode, - variables: { [name: string]: any }, - ): boolean; - - declare export function flattenSelections( - selection: SelectionNode, - ): Array; - - declare export function getDirectiveNames(doc: DocumentNode): Array; - - declare export function hasDirectives( - names: Array, - doc: DocumentNode, - ): boolean; - - // transform - declare export type RemoveDirectiveConfig = { - name?: string, - test?: (directive: DirectiveNode) => boolean, - }; - - declare export function removeDirectivesFromDocument( - directives: Array, - doc: DocumentNode, - ): DocumentNode; - - declare export function addTypenameToDocument(doc: DocumentNode): void; - - declare export function removeConnectionDirectiveFromDocument( - doc: DocumentNode, - ): DocumentNode; -} diff --git a/node_modules/apollo-utilities/src/index.ts b/node_modules/apollo-utilities/src/index.ts deleted file mode 100644 index 18b0a81..0000000 --- a/node_modules/apollo-utilities/src/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -export * from './directives'; -export * from './fragments'; -export * from './getFromAST'; -export * from './transform'; -export * from './storeUtils'; -export * from './util/assign'; -export * from './util/canUse'; -export * from './util/cloneDeep'; -export * from './util/environment'; -export * from './util/errorHandling'; -export * from './util/isEqual'; -export * from './util/maybeDeepFreeze'; -export * from './util/mergeDeep'; -export * from './util/warnOnce'; -export * from './util/stripSymbols'; -export * from './util/mergeDeep'; diff --git a/node_modules/apollo-utilities/src/storeUtils.ts b/node_modules/apollo-utilities/src/storeUtils.ts deleted file mode 100644 index 2bd1e53..0000000 --- a/node_modules/apollo-utilities/src/storeUtils.ts +++ /dev/null @@ -1,340 +0,0 @@ -import { - DirectiveNode, - FieldNode, - IntValueNode, - FloatValueNode, - StringValueNode, - BooleanValueNode, - ObjectValueNode, - ListValueNode, - EnumValueNode, - NullValueNode, - VariableNode, - InlineFragmentNode, - ValueNode, - SelectionNode, - NameNode, -} from 'graphql'; - -import stringify from 'fast-json-stable-stringify'; -import { InvariantError } from 'ts-invariant'; - -export interface IdValue { - type: 'id'; - id: string; - generated: boolean; - typename: string | undefined; -} - -export interface JsonValue { - type: 'json'; - json: any; -} - -export type ListValue = Array; - -export type StoreValue = - | number - | string - | string[] - | IdValue - | ListValue - | JsonValue - | null - | undefined - | void - | Object; - -export type ScalarValue = StringValueNode | BooleanValueNode | EnumValueNode; - -export function isScalarValue(value: ValueNode): value is ScalarValue { - return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1; -} - -export type NumberValue = IntValueNode | FloatValueNode; - -export function isNumberValue(value: ValueNode): value is NumberValue { - return ['IntValue', 'FloatValue'].indexOf(value.kind) > -1; -} - -function isStringValue(value: ValueNode): value is StringValueNode { - return value.kind === 'StringValue'; -} - -function isBooleanValue(value: ValueNode): value is BooleanValueNode { - return value.kind === 'BooleanValue'; -} - -function isIntValue(value: ValueNode): value is IntValueNode { - return value.kind === 'IntValue'; -} - -function isFloatValue(value: ValueNode): value is FloatValueNode { - return value.kind === 'FloatValue'; -} - -function isVariable(value: ValueNode): value is VariableNode { - return value.kind === 'Variable'; -} - -function isObjectValue(value: ValueNode): value is ObjectValueNode { - return value.kind === 'ObjectValue'; -} - -function isListValue(value: ValueNode): value is ListValueNode { - return value.kind === 'ListValue'; -} - -function isEnumValue(value: ValueNode): value is EnumValueNode { - return value.kind === 'EnumValue'; -} - -function isNullValue(value: ValueNode): value is NullValueNode { - return value.kind === 'NullValue'; -} - -export function valueToObjectRepresentation( - argObj: any, - name: NameNode, - value: ValueNode, - variables?: Object, -) { - if (isIntValue(value) || isFloatValue(value)) { - argObj[name.value] = Number(value.value); - } else if (isBooleanValue(value) || isStringValue(value)) { - argObj[name.value] = value.value; - } else if (isObjectValue(value)) { - const nestedArgObj = {}; - value.fields.map(obj => - valueToObjectRepresentation(nestedArgObj, obj.name, obj.value, variables), - ); - argObj[name.value] = nestedArgObj; - } else if (isVariable(value)) { - const variableValue = (variables || ({} as any))[value.name.value]; - argObj[name.value] = variableValue; - } else if (isListValue(value)) { - argObj[name.value] = value.values.map(listValue => { - const nestedArgArrayObj = {}; - valueToObjectRepresentation( - nestedArgArrayObj, - name, - listValue, - variables, - ); - return (nestedArgArrayObj as any)[name.value]; - }); - } else if (isEnumValue(value)) { - argObj[name.value] = (value as EnumValueNode).value; - } else if (isNullValue(value)) { - argObj[name.value] = null; - } else { - throw new InvariantError( - `The inline argument "${name.value}" of kind "${(value as any).kind}"` + - 'is not supported. Use variables instead of inline arguments to ' + - 'overcome this limitation.', - ); - } -} - -export function storeKeyNameFromField( - field: FieldNode, - variables?: Object, -): string { - let directivesObj: any = null; - if (field.directives) { - directivesObj = {}; - field.directives.forEach(directive => { - directivesObj[directive.name.value] = {}; - - if (directive.arguments) { - directive.arguments.forEach(({ name, value }) => - valueToObjectRepresentation( - directivesObj[directive.name.value], - name, - value, - variables, - ), - ); - } - }); - } - - let argObj: any = null; - if (field.arguments && field.arguments.length) { - argObj = {}; - field.arguments.forEach(({ name, value }) => - valueToObjectRepresentation(argObj, name, value, variables), - ); - } - - return getStoreKeyName(field.name.value, argObj, directivesObj); -} - -export type Directives = { - [directiveName: string]: { - [argName: string]: any; - }; -}; - -const KNOWN_DIRECTIVES: string[] = [ - 'connection', - 'include', - 'skip', - 'client', - 'rest', - 'export', -]; - -export function getStoreKeyName( - fieldName: string, - args?: Object, - directives?: Directives, -): string { - if ( - directives && - directives['connection'] && - directives['connection']['key'] - ) { - if ( - directives['connection']['filter'] && - (directives['connection']['filter'] as string[]).length > 0 - ) { - const filterKeys = directives['connection']['filter'] - ? (directives['connection']['filter'] as string[]) - : []; - filterKeys.sort(); - - const queryArgs = args as { [key: string]: any }; - const filteredArgs = {} as { [key: string]: any }; - filterKeys.forEach(key => { - filteredArgs[key] = queryArgs[key]; - }); - - return `${directives['connection']['key']}(${JSON.stringify( - filteredArgs, - )})`; - } else { - return directives['connection']['key']; - } - } - - let completeFieldName: string = fieldName; - - if (args) { - // We can't use `JSON.stringify` here since it's non-deterministic, - // and can lead to different store key names being created even though - // the `args` object used during creation has the same properties/values. - const stringifiedArgs: string = stringify(args); - completeFieldName += `(${stringifiedArgs})`; - } - - if (directives) { - Object.keys(directives).forEach(key => { - if (KNOWN_DIRECTIVES.indexOf(key) !== -1) return; - if (directives[key] && Object.keys(directives[key]).length) { - completeFieldName += `@${key}(${JSON.stringify(directives[key])})`; - } else { - completeFieldName += `@${key}`; - } - }); - } - - return completeFieldName; -} - -export function argumentsObjectFromField( - field: FieldNode | DirectiveNode, - variables: Object, -): Object { - if (field.arguments && field.arguments.length) { - const argObj: Object = {}; - field.arguments.forEach(({ name, value }) => - valueToObjectRepresentation(argObj, name, value, variables), - ); - return argObj; - } - - return null; -} - -export function resultKeyNameFromField(field: FieldNode): string { - return field.alias ? field.alias.value : field.name.value; -} - -export function isField(selection: SelectionNode): selection is FieldNode { - return selection.kind === 'Field'; -} - -export function isInlineFragment( - selection: SelectionNode, -): selection is InlineFragmentNode { - return selection.kind === 'InlineFragment'; -} - -export function isIdValue(idObject: StoreValue): idObject is IdValue { - return idObject && - (idObject as IdValue | JsonValue).type === 'id' && - typeof (idObject as IdValue).generated === 'boolean'; -} - -export type IdConfig = { - id: string; - typename: string | undefined; -}; - -export function toIdValue( - idConfig: string | IdConfig, - generated = false, -): IdValue { - return { - type: 'id', - generated, - ...(typeof idConfig === 'string' - ? { id: idConfig, typename: undefined } - : idConfig), - }; -} - -export function isJsonValue(jsonObject: StoreValue): jsonObject is JsonValue { - return ( - jsonObject != null && - typeof jsonObject === 'object' && - (jsonObject as IdValue | JsonValue).type === 'json' - ); -} - -function defaultValueFromVariable(node: VariableNode) { - throw new InvariantError(`Variable nodes are not supported by valueFromNode`); -} - -export type VariableValue = (node: VariableNode) => any; - -/** - * Evaluate a ValueNode and yield its value in its natural JS form. - */ -export function valueFromNode( - node: ValueNode, - onVariable: VariableValue = defaultValueFromVariable, -): any { - switch (node.kind) { - case 'Variable': - return onVariable(node); - case 'NullValue': - return null; - case 'IntValue': - return parseInt(node.value, 10); - case 'FloatValue': - return parseFloat(node.value); - case 'ListValue': - return node.values.map(v => valueFromNode(v, onVariable)); - case 'ObjectValue': { - const value: { [key: string]: any } = {}; - for (const field of node.fields) { - value[field.name.value] = valueFromNode(field.value, onVariable); - } - return value; - } - default: - return node.value; - } -} diff --git a/node_modules/apollo-utilities/src/transform.ts b/node_modules/apollo-utilities/src/transform.ts deleted file mode 100644 index d77b8e5..0000000 --- a/node_modules/apollo-utilities/src/transform.ts +++ /dev/null @@ -1,542 +0,0 @@ -import { - DocumentNode, - SelectionNode, - SelectionSetNode, - OperationDefinitionNode, - FieldNode, - DirectiveNode, - FragmentDefinitionNode, - ArgumentNode, - FragmentSpreadNode, - VariableDefinitionNode, - VariableNode, -} from 'graphql'; -import { visit } from 'graphql/language/visitor'; - -import { - checkDocument, - getOperationDefinition, - getFragmentDefinition, - getFragmentDefinitions, - createFragmentMap, - FragmentMap, - getMainDefinition, -} from './getFromAST'; -import { filterInPlace } from './util/filterInPlace'; -import { invariant } from 'ts-invariant'; -import { isField, isInlineFragment } from './storeUtils'; - -export type RemoveNodeConfig = { - name?: string; - test?: (node: N) => boolean; - remove?: boolean; -}; - -export type GetNodeConfig = { - name?: string; - test?: (node: N) => boolean; -}; - -export type RemoveDirectiveConfig = RemoveNodeConfig; -export type GetDirectiveConfig = GetNodeConfig; -export type RemoveArgumentsConfig = RemoveNodeConfig; -export type GetFragmentSpreadConfig = GetNodeConfig; -export type RemoveFragmentSpreadConfig = RemoveNodeConfig; -export type RemoveFragmentDefinitionConfig = RemoveNodeConfig< - FragmentDefinitionNode ->; -export type RemoveVariableDefinitionConfig = RemoveNodeConfig< - VariableDefinitionNode ->; - -const TYPENAME_FIELD: FieldNode = { - kind: 'Field', - name: { - kind: 'Name', - value: '__typename', - }, -}; - -function isEmpty( - op: OperationDefinitionNode | FragmentDefinitionNode, - fragments: FragmentMap, -): boolean { - return op.selectionSet.selections.every( - selection => - selection.kind === 'FragmentSpread' && - isEmpty(fragments[selection.name.value], fragments), - ); -} - -function nullIfDocIsEmpty(doc: DocumentNode) { - return isEmpty( - getOperationDefinition(doc) || getFragmentDefinition(doc), - createFragmentMap(getFragmentDefinitions(doc)), - ) - ? null - : doc; -} - -function getDirectiveMatcher( - directives: (RemoveDirectiveConfig | GetDirectiveConfig)[], -) { - return function directiveMatcher(directive: DirectiveNode) { - return directives.some( - dir => - (dir.name && dir.name === directive.name.value) || - (dir.test && dir.test(directive)), - ); - }; -} - -export function removeDirectivesFromDocument( - directives: RemoveDirectiveConfig[], - doc: DocumentNode, -): DocumentNode | null { - const variablesInUse: Record = Object.create(null); - let variablesToRemove: RemoveArgumentsConfig[] = []; - - const fragmentSpreadsInUse: Record = Object.create(null); - let fragmentSpreadsToRemove: RemoveFragmentSpreadConfig[] = []; - - let modifiedDoc = nullIfDocIsEmpty( - visit(doc, { - Variable: { - enter(node, _key, parent) { - // Store each variable that's referenced as part of an argument - // (excluding operation definition variables), so we know which - // variables are being used. If we later want to remove a variable - // we'll fist check to see if it's being used, before continuing with - // the removal. - if ( - (parent as VariableDefinitionNode).kind !== 'VariableDefinition' - ) { - variablesInUse[node.name.value] = true; - } - }, - }, - - Field: { - enter(node) { - if (directives && node.directives) { - // If `remove` is set to true for a directive, and a directive match - // is found for a field, remove the field as well. - const shouldRemoveField = directives.some( - directive => directive.remove, - ); - - if ( - shouldRemoveField && - node.directives && - node.directives.some(getDirectiveMatcher(directives)) - ) { - if (node.arguments) { - // Store field argument variables so they can be removed - // from the operation definition. - node.arguments.forEach(arg => { - if (arg.value.kind === 'Variable') { - variablesToRemove.push({ - name: (arg.value as VariableNode).name.value, - }); - } - }); - } - - if (node.selectionSet) { - // Store fragment spread names so they can be removed from the - // docuemnt. - getAllFragmentSpreadsFromSelectionSet(node.selectionSet).forEach( - frag => { - fragmentSpreadsToRemove.push({ - name: frag.name.value, - }); - }, - ); - } - - // Remove the field. - return null; - } - } - }, - }, - - FragmentSpread: { - enter(node) { - // Keep track of referenced fragment spreads. This is used to - // determine if top level fragment definitions should be removed. - fragmentSpreadsInUse[node.name.value] = true; - }, - }, - - Directive: { - enter(node) { - // If a matching directive is found, remove it. - if (getDirectiveMatcher(directives)(node)) { - return null; - } - }, - }, - }), - ); - - // If we've removed fields with arguments, make sure the associated - // variables are also removed from the rest of the document, as long as they - // aren't being used elsewhere. - if ( - modifiedDoc && - filterInPlace(variablesToRemove, v => !variablesInUse[v.name]).length - ) { - modifiedDoc = removeArgumentsFromDocument(variablesToRemove, modifiedDoc); - } - - // If we've removed selection sets with fragment spreads, make sure the - // associated fragment definitions are also removed from the rest of the - // document, as long as they aren't being used elsewhere. - if ( - modifiedDoc && - filterInPlace(fragmentSpreadsToRemove, fs => !fragmentSpreadsInUse[fs.name]) - .length - ) { - modifiedDoc = removeFragmentSpreadFromDocument( - fragmentSpreadsToRemove, - modifiedDoc, - ); - } - - return modifiedDoc; -} - -export function addTypenameToDocument(doc: DocumentNode): DocumentNode { - return visit(checkDocument(doc), { - SelectionSet: { - enter(node, _key, parent) { - // Don't add __typename to OperationDefinitions. - if ( - parent && - (parent as OperationDefinitionNode).kind === 'OperationDefinition' - ) { - return; - } - - // No changes if no selections. - const { selections } = node; - if (!selections) { - return; - } - - // If selections already have a __typename, or are part of an - // introspection query, do nothing. - const skip = selections.some(selection => { - return ( - isField(selection) && - (selection.name.value === '__typename' || - selection.name.value.lastIndexOf('__', 0) === 0) - ); - }); - if (skip) { - return; - } - - // If this SelectionSet is @export-ed as an input variable, it should - // not have a __typename field (see issue #4691). - const field = parent as FieldNode; - if ( - isField(field) && - field.directives && - field.directives.some(d => d.name.value === 'export') - ) { - return; - } - - // Create and return a new SelectionSet with a __typename Field. - return { - ...node, - selections: [...selections, TYPENAME_FIELD], - }; - }, - }, - }); -} - -const connectionRemoveConfig = { - test: (directive: DirectiveNode) => { - const willRemove = directive.name.value === 'connection'; - if (willRemove) { - if ( - !directive.arguments || - !directive.arguments.some(arg => arg.name.value === 'key') - ) { - invariant.warn( - 'Removing an @connection directive even though it does not have a key. ' + - 'You may want to use the key parameter to specify a store key.', - ); - } - } - - return willRemove; - }, -}; - -export function removeConnectionDirectiveFromDocument(doc: DocumentNode) { - return removeDirectivesFromDocument( - [connectionRemoveConfig], - checkDocument(doc), - ); -} - -function hasDirectivesInSelectionSet( - directives: GetDirectiveConfig[], - selectionSet: SelectionSetNode, - nestedCheck = true, -): boolean { - return ( - selectionSet && - selectionSet.selections && - selectionSet.selections.some(selection => - hasDirectivesInSelection(directives, selection, nestedCheck), - ) - ); -} - -function hasDirectivesInSelection( - directives: GetDirectiveConfig[], - selection: SelectionNode, - nestedCheck = true, -): boolean { - if (!isField(selection)) { - return true; - } - - if (!selection.directives) { - return false; - } - - return ( - selection.directives.some(getDirectiveMatcher(directives)) || - (nestedCheck && - hasDirectivesInSelectionSet( - directives, - selection.selectionSet, - nestedCheck, - )) - ); -} - -export function getDirectivesFromDocument( - directives: GetDirectiveConfig[], - doc: DocumentNode, -): DocumentNode { - checkDocument(doc); - - let parentPath: string; - - return nullIfDocIsEmpty( - visit(doc, { - SelectionSet: { - enter(node, _key, _parent, path) { - const currentPath = path.join('-'); - - if ( - !parentPath || - currentPath === parentPath || - !currentPath.startsWith(parentPath) - ) { - if (node.selections) { - const selectionsWithDirectives = node.selections.filter( - selection => hasDirectivesInSelection(directives, selection), - ); - - if (hasDirectivesInSelectionSet(directives, node, false)) { - parentPath = currentPath; - } - - return { - ...node, - selections: selectionsWithDirectives, - }; - } else { - return null; - } - } - }, - }, - }), - ); -} - -function getArgumentMatcher(config: RemoveArgumentsConfig[]) { - return function argumentMatcher(argument: ArgumentNode) { - return config.some( - (aConfig: RemoveArgumentsConfig) => - argument.value && - argument.value.kind === 'Variable' && - argument.value.name && - (aConfig.name === argument.value.name.value || - (aConfig.test && aConfig.test(argument))), - ); - }; -} - -export function removeArgumentsFromDocument( - config: RemoveArgumentsConfig[], - doc: DocumentNode, -): DocumentNode { - const argMatcher = getArgumentMatcher(config); - - return nullIfDocIsEmpty( - visit(doc, { - OperationDefinition: { - enter(node) { - return { - ...node, - // Remove matching top level variables definitions. - variableDefinitions: node.variableDefinitions.filter( - varDef => - !config.some(arg => arg.name === varDef.variable.name.value), - ), - }; - }, - }, - - Field: { - enter(node) { - // If `remove` is set to true for an argument, and an argument match - // is found for a field, remove the field as well. - const shouldRemoveField = config.some(argConfig => argConfig.remove); - - if (shouldRemoveField) { - let argMatchCount = 0; - node.arguments.forEach(arg => { - if (argMatcher(arg)) { - argMatchCount += 1; - } - }); - if (argMatchCount === 1) { - return null; - } - } - }, - }, - - Argument: { - enter(node) { - // Remove all matching arguments. - if (argMatcher(node)) { - return null; - } - }, - }, - }), - ); -} - -export function removeFragmentSpreadFromDocument( - config: RemoveFragmentSpreadConfig[], - doc: DocumentNode, -): DocumentNode { - function enter( - node: FragmentSpreadNode | FragmentDefinitionNode, - ): null | void { - if (config.some(def => def.name === node.name.value)) { - return null; - } - } - - return nullIfDocIsEmpty( - visit(doc, { - FragmentSpread: { enter }, - FragmentDefinition: { enter }, - }), - ); -} - -function getAllFragmentSpreadsFromSelectionSet( - selectionSet: SelectionSetNode, -): FragmentSpreadNode[] { - const allFragments: FragmentSpreadNode[] = []; - - selectionSet.selections.forEach(selection => { - if ( - (isField(selection) || isInlineFragment(selection)) && - selection.selectionSet - ) { - getAllFragmentSpreadsFromSelectionSet(selection.selectionSet).forEach( - frag => allFragments.push(frag), - ); - } else if (selection.kind === 'FragmentSpread') { - allFragments.push(selection); - } - }); - - return allFragments; -} - -// If the incoming document is a query, return it as is. Otherwise, build a -// new document containing a query operation based on the selection set -// of the previous main operation. -export function buildQueryFromSelectionSet( - document: DocumentNode, -): DocumentNode { - const definition = getMainDefinition(document); - const definitionOperation = (definition).operation; - - if (definitionOperation === 'query') { - // Already a query, so return the existing document. - return document; - } - - // Build a new query using the selection set of the main operation. - const modifiedDoc = visit(document, { - OperationDefinition: { - enter(node) { - return { - ...node, - operation: 'query', - }; - }, - }, - }); - return modifiedDoc; -} - -// Remove fields / selection sets that include an @client directive. -export function removeClientSetsFromDocument( - document: DocumentNode, -): DocumentNode | null { - checkDocument(document); - - let modifiedDoc = removeDirectivesFromDocument( - [ - { - test: (directive: DirectiveNode) => directive.name.value === 'client', - remove: true, - }, - ], - document, - ); - - // After a fragment definition has had its @client related document - // sets removed, if the only field it has left is a __typename field, - // remove the entire fragment operation to prevent it from being fired - // on the server. - if (modifiedDoc) { - modifiedDoc = visit(modifiedDoc, { - FragmentDefinition: { - enter(node) { - if (node.selectionSet) { - const isTypenameOnly = node.selectionSet.selections.every( - selection => - isField(selection) && selection.name.value === '__typename', - ); - if (isTypenameOnly) { - return null; - } - } - }, - }, - }); - } - - return modifiedDoc; -} diff --git a/node_modules/apollo-utilities/src/util/__tests__/assign.ts b/node_modules/apollo-utilities/src/util/__tests__/assign.ts deleted file mode 100644 index 6d3ef04..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/assign.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { assign } from '../assign'; - -describe('assign', () => { - it('will merge many objects together', () => { - expect(assign({ a: 1 }, { b: 2 })).toEqual({ a: 1, b: 2 }); - expect(assign({ a: 1 }, { b: 2 }, { c: 3 })).toEqual({ - a: 1, - b: 2, - c: 3, - }); - expect(assign({ a: 1 }, { b: 2 }, { c: 3 }, { d: 4 })).toEqual({ - a: 1, - b: 2, - c: 3, - d: 4, - }); - }); - - it('will merge many objects together shallowly', () => { - expect(assign({ x: { a: 1 } }, { x: { b: 2 } })).toEqual({ x: { b: 2 } }); - expect(assign({ x: { a: 1 } }, { x: { b: 2 } }, { x: { c: 3 } })).toEqual({ - x: { c: 3 }, - }); - expect( - assign( - { x: { a: 1 } }, - { x: { b: 2 } }, - { x: { c: 3 } }, - { x: { d: 4 } }, - ), - ).toEqual({ x: { d: 4 } }); - }); - - it('will mutate and return the source objects', () => { - const source1 = { a: 1 }; - const source2 = { a: 1 }; - const source3 = { a: 1 }; - - expect(assign(source1, { b: 2 })).toEqual(source1); - expect(assign(source2, { b: 2 }, { c: 3 })).toEqual(source2); - expect(assign(source3, { b: 2 }, { c: 3 }, { d: 4 })).toEqual(source3); - - expect(source1).toEqual({ a: 1, b: 2 }); - expect(source2).toEqual({ a: 1, b: 2, c: 3 }); - expect(source3).toEqual({ a: 1, b: 2, c: 3, d: 4 }); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts b/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts deleted file mode 100644 index 52b491b..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { cloneDeep } from '../cloneDeep'; - -describe('cloneDeep', () => { - it('will clone primitive values', () => { - expect(cloneDeep(undefined)).toEqual(undefined); - expect(cloneDeep(null)).toEqual(null); - expect(cloneDeep(true)).toEqual(true); - expect(cloneDeep(false)).toEqual(false); - expect(cloneDeep(-1)).toEqual(-1); - expect(cloneDeep(+1)).toEqual(+1); - expect(cloneDeep(0.5)).toEqual(0.5); - expect(cloneDeep('hello')).toEqual('hello'); - expect(cloneDeep('world')).toEqual('world'); - }); - - it('will clone objects', () => { - const value1 = {}; - const value2 = { a: 1, b: 2, c: 3 }; - const value3 = { x: { a: 1, b: 2, c: 3 }, y: { a: 1, b: 2, c: 3 } }; - - const clonedValue1 = cloneDeep(value1); - const clonedValue2 = cloneDeep(value2); - const clonedValue3 = cloneDeep(value3); - - expect(clonedValue1).toEqual(value1); - expect(clonedValue2).toEqual(value2); - expect(clonedValue3).toEqual(value3); - - expect(clonedValue1).toEqual(value1); - expect(clonedValue2).toEqual(value2); - expect(clonedValue3).toEqual(value3); - expect(clonedValue3.x).toEqual(value3.x); - expect(clonedValue3.y).toEqual(value3.y); - }); - - it('will clone arrays', () => { - const value1: Array = []; - const value2 = [1, 2, 3]; - const value3 = [[1, 2, 3], [1, 2, 3]]; - - const clonedValue1 = cloneDeep(value1); - const clonedValue2 = cloneDeep(value2); - const clonedValue3 = cloneDeep(value3); - - expect(clonedValue1).toEqual(value1); - expect(clonedValue2).toEqual(value2); - expect(clonedValue3).toEqual(value3); - - expect(clonedValue1).toEqual(value1); - expect(clonedValue2).toEqual(value2); - expect(clonedValue3).toEqual(value3); - expect(clonedValue3[0]).toEqual(value3[0]); - expect(clonedValue3[1]).toEqual(value3[1]); - }); - - it('should not attempt to follow circular references', () => { - const someObject = { - prop1: 'value1', - anotherObject: null, - }; - const anotherObject = { - someObject, - }; - someObject.anotherObject = anotherObject; - let chk; - expect(() => { - chk = cloneDeep(someObject); - }).not.toThrow(); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/environment.ts b/node_modules/apollo-utilities/src/util/__tests__/environment.ts deleted file mode 100644 index dcb7153..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/environment.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { isEnv, isProduction, isDevelopment, isTest } from '../environment'; - -describe('environment', () => { - let keepEnv: string | undefined; - - beforeEach(() => { - // save the NODE_ENV - keepEnv = process.env.NODE_ENV; - }); - - afterEach(() => { - // restore the NODE_ENV - process.env.NODE_ENV = keepEnv; - }); - - describe('isEnv', () => { - it(`should match when there's a value`, () => { - ['production', 'development', 'test'].forEach(env => { - process.env.NODE_ENV = env; - expect(isEnv(env)).toBe(true); - }); - }); - - it(`should treat no proces.env.NODE_ENV as it'd be in development`, () => { - delete process.env.NODE_ENV; - expect(isEnv('development')).toBe(true); - }); - }); - - describe('isProduction', () => { - it('should return true if in production', () => { - process.env.NODE_ENV = 'production'; - expect(isProduction()).toBe(true); - }); - - it('should return false if not in production', () => { - process.env.NODE_ENV = 'test'; - expect(!isProduction()).toBe(true); - }); - }); - - describe('isTest', () => { - it('should return true if in test', () => { - process.env.NODE_ENV = 'test'; - expect(isTest()).toBe(true); - }); - - it('should return true if not in test', () => { - process.env.NODE_ENV = 'development'; - expect(!isTest()).toBe(true); - }); - }); - - describe('isDevelopment', () => { - it('should return true if in development', () => { - process.env.NODE_ENV = 'development'; - expect(isDevelopment()).toBe(true); - }); - - it('should return true if not in development and environment is defined', () => { - process.env.NODE_ENV = 'test'; - expect(!isDevelopment()).toBe(true); - }); - - it('should make development as the default environment', () => { - delete process.env.NODE_ENV; - expect(isDevelopment()).toBe(true); - }); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts b/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts deleted file mode 100644 index e621a83..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts +++ /dev/null @@ -1,174 +0,0 @@ -import { isEqual } from '../isEqual'; - -describe('isEqual', () => { - it('should return true for equal primitive values', () => { - expect(isEqual(undefined, undefined)).toBe(true); - expect(isEqual(null, null)).toBe(true); - expect(isEqual(true, true)).toBe(true); - expect(isEqual(false, false)).toBe(true); - expect(isEqual(-1, -1)).toBe(true); - expect(isEqual(+1, +1)).toBe(true); - expect(isEqual(42, 42)).toBe(true); - expect(isEqual(0, 0)).toBe(true); - expect(isEqual(0.5, 0.5)).toBe(true); - expect(isEqual('hello', 'hello')).toBe(true); - expect(isEqual('world', 'world')).toBe(true); - }); - - it('should return false for not equal primitive values', () => { - expect(!isEqual(undefined, null)).toBe(true); - expect(!isEqual(null, undefined)).toBe(true); - expect(!isEqual(true, false)).toBe(true); - expect(!isEqual(false, true)).toBe(true); - expect(!isEqual(-1, +1)).toBe(true); - expect(!isEqual(+1, -1)).toBe(true); - expect(!isEqual(42, 42.00000000000001)).toBe(true); - expect(!isEqual(0, 0.5)).toBe(true); - expect(!isEqual('hello', 'world')).toBe(true); - expect(!isEqual('world', 'hello')).toBe(true); - }); - - it('should return false when comparing primitives with objects', () => { - expect(!isEqual({}, null)).toBe(true); - expect(!isEqual(null, {})).toBe(true); - expect(!isEqual({}, true)).toBe(true); - expect(!isEqual(true, {})).toBe(true); - expect(!isEqual({}, 42)).toBe(true); - expect(!isEqual(42, {})).toBe(true); - expect(!isEqual({}, 'hello')).toBe(true); - expect(!isEqual('hello', {})).toBe(true); - }); - - it('should correctly compare shallow objects', () => { - expect(isEqual({}, {})).toBe(true); - expect(isEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 })).toBe(true); - expect(!isEqual({ a: 1, b: 2, c: 3 }, { a: 3, b: 2, c: 1 })).toBe(true); - expect(!isEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 })).toBe(true); - expect(!isEqual({ a: 1, b: 2 }, { a: 1, b: 2, c: 3 })).toBe(true); - }); - - it('should correctly compare deep objects', () => { - expect(isEqual({ x: {} }, { x: {} })).toBe(true); - expect( - isEqual({ x: { a: 1, b: 2, c: 3 } }, { x: { a: 1, b: 2, c: 3 } }), - ).toBe(true); - expect( - !isEqual({ x: { a: 1, b: 2, c: 3 } }, { x: { a: 3, b: 2, c: 1 } }), - ).toBe(true); - expect(!isEqual({ x: { a: 1, b: 2, c: 3 } }, { x: { a: 1, b: 2 } })).toBe( - true, - ); - expect(!isEqual({ x: { a: 1, b: 2 } }, { x: { a: 1, b: 2, c: 3 } })).toBe( - true, - ); - }); - - it('should correctly compare deep objects without object prototype ', () => { - // Solves https://github.com/apollographql/apollo-client/issues/2132 - const objNoProto = Object.create(null); - objNoProto.a = { b: 2, c: [3, 4] }; - objNoProto.e = Object.create(null); - objNoProto.e.f = 5; - expect(isEqual(objNoProto, { a: { b: 2, c: [3, 4] }, e: { f: 5 } })).toBe( - true, - ); - expect(!isEqual(objNoProto, { a: { b: 2, c: [3, 4] }, e: { f: 6 } })).toBe( - true, - ); - expect(!isEqual(objNoProto, { a: { b: 2, c: [3, 4] }, e: null })).toBe( - true, - ); - expect(!isEqual(objNoProto, { a: { b: 2, c: [3] }, e: { f: 5 } })).toBe( - true, - ); - expect(!isEqual(objNoProto, null)).toBe(true); - }); - - it('should correctly handle modified prototypes', () => { - Array.prototype.foo = null; - expect(isEqual([1, 2, 3], [1, 2, 3])).toBe(true); - expect(!isEqual([1, 2, 3], [1, 2, 4])).toBe(true); - delete Array.prototype.foo; - }); - - describe('comparing objects with circular refs', () => { - // copied with slight modification from lodash test suite - it('should compare objects with circular references', () => { - const object1 = {}, - object2 = {}; - - object1.a = object1; - object2.a = object2; - - expect(isEqual(object1, object2)).toBe(true); - - object1.b = 0; - object2.b = Object(0); - - expect(isEqual(object1, object2)).toBe(true); - - object1.c = Object(1); - object2.c = Object(2); - - expect(isEqual(object1, object2)).toBe(false); - - object1 = { a: 1, b: 2, c: 3 }; - object1.b = object1; - object2 = { a: 1, b: { a: 1, b: 2, c: 3 }, c: 3 }; - - expect(isEqual(object1, object2)).toBe(false); - }); - - it('should have transitive equivalence for circular references of objects', () => { - const object1 = {}, - object2 = { a: object1 }, - object3 = { a: object2 }; - - object1.a = object1; - - expect(isEqual(object1, object2)).toBe(true); - expect(isEqual(object2, object3)).toBe(true); - expect(isEqual(object1, object3)).toBe(true); - }); - - it('should compare objects with multiple circular references', () => { - const array1 = [{}], - array2 = [{}]; - - (array1[0].a = array1).push(array1); - (array2[0].a = array2).push(array2); - - expect(isEqual(array1, array2)).toBe(true); - - array1[0].b = 0; - array2[0].b = Object(0); - - expect(isEqual(array1, array2)).toBe(true); - - array1[0].c = Object(1); - array2[0].c = Object(2); - - expect(isEqual(array1, array2)).toBe(false); - }); - - it('should compare objects with complex circular references', () => { - const object1 = { - foo: { b: { c: { d: {} } } }, - bar: { a: 2 }, - }; - - const object2 = { - foo: { b: { c: { d: {} } } }, - bar: { a: 2 }, - }; - - object1.foo.b.c.d = object1; - object1.bar.b = object1.foo.b; - - object2.foo.b.c.d = object2; - object2.bar.b = object2.foo.b; - - expect(isEqual(object1, object2)).toBe(true); - }); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts b/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts deleted file mode 100644 index c33cc60..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { maybeDeepFreeze } from '../maybeDeepFreeze'; - -describe('maybeDeepFreeze', () => { - it('should deep freeze', () => { - const foo: any = { bar: undefined }; - maybeDeepFreeze(foo); - expect(() => (foo.bar = 1)).toThrow(); - expect(foo.bar).toBeUndefined(); - }); - - it('should properly freeze objects without hasOwnProperty', () => { - const foo = Object.create(null); - foo.bar = undefined; - maybeDeepFreeze(foo); - expect(() => (foo.bar = 1)).toThrow(); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts b/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts deleted file mode 100644 index 1377806..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { mergeDeep, mergeDeepArray } from '../mergeDeep'; - -describe('mergeDeep', function() { - it('should return an object if first argument falsy', function() { - expect(mergeDeep()).toEqual({}); - expect(mergeDeep(null)).toEqual({}); - expect(mergeDeep(null, { foo: 42 })).toEqual({ foo: 42 }); - }); - - it('should preserve identity for single arguments', function() { - const arg = Object.create(null); - expect(mergeDeep(arg)).toBe(arg); - }); - - it('should preserve identity when merging non-conflicting objects', function() { - const a = { a: { name: 'ay' } }; - const b = { b: { name: 'bee' } }; - const c = mergeDeep(a, b); - expect(c.a).toBe(a.a); - expect(c.b).toBe(b.b); - expect(c).toEqual({ - a: { name: 'ay' }, - b: { name: 'bee' }, - }); - }); - - it('should shallow-copy conflicting fields', function() { - const a = { conflict: { fromA: [1, 2, 3] } }; - const b = { conflict: { fromB: [4, 5] } }; - const c = mergeDeep(a, b); - expect(c.conflict).not.toBe(a.conflict); - expect(c.conflict).not.toBe(b.conflict); - expect(c.conflict.fromA).toBe(a.conflict.fromA); - expect(c.conflict.fromB).toBe(b.conflict.fromB); - expect(c).toEqual({ - conflict: { - fromA: [1, 2, 3], - fromB: [4, 5], - }, - }); - }); - - it('should resolve conflicts among more than two objects', function() { - const sources = []; - - for (let i = 0; i < 100; ++i) { - sources.push({ - ['unique' + i]: { value: i }, - conflict: { - ['from' + i]: { value: i }, - nested: { - ['nested' + i]: { value: i }, - }, - }, - }); - } - - const merged = mergeDeep(...sources); - - sources.forEach((source, i) => { - expect(merged['unique' + i].value).toBe(i); - expect(source['unique' + i]).toBe(merged['unique' + i]); - - expect(merged.conflict).not.toBe(source.conflict); - expect(merged.conflict['from' + i].value).toBe(i); - expect(merged.conflict['from' + i]).toBe(source.conflict['from' + i]); - - expect(merged.conflict.nested).not.toBe(source.conflict.nested); - expect(merged.conflict.nested['nested' + i].value).toBe(i); - expect(merged.conflict.nested['nested' + i]).toBe( - source.conflict.nested['nested' + i], - ); - }); - }); - - it('can merge array elements', function() { - const a = [{ a: 1 }, { a: 'ay' }, 'a']; - const b = [{ b: 2 }, { b: 'bee' }, 'b']; - const c = [{ c: 3 }, { c: 'cee' }, 'c']; - const d = { 1: { d: 'dee' } }; - - expect(mergeDeep(a, b, c, d)).toEqual([ - { a: 1, b: 2, c: 3 }, - { a: 'ay', b: 'bee', c: 'cee', d: 'dee' }, - 'c', - ]); - }); - - it('lets the last conflicting value win', function() { - expect(mergeDeep('a', 'b', 'c')).toBe('c'); - - expect( - mergeDeep( - { a: 'a', conflict: 1 }, - { b: 'b', conflict: 2 }, - { c: 'c', conflict: 3 }, - ), - ).toEqual({ - a: 'a', - b: 'b', - c: 'c', - conflict: 3, - }); - - expect(mergeDeep( - ['a', ['b', 'c'], 'd'], - [/*empty*/, ['B'], 'D'], - )).toEqual( - ['a', ['B', 'c'], 'D'], - ); - - expect(mergeDeep( - ['a', ['b', 'c'], 'd'], - ['A', [/*empty*/, 'C']], - )).toEqual( - ['A', ['b', 'C'], 'd'], - ); - }); - - it('mergeDeep returns the intersection of its argument types', function() { - const abc = mergeDeep({ str: "hi", a: 1 }, { a: 3, b: 2 }, { b: 1, c: 2 }); - // The point of this test is that the following lines type-check without - // resorting to any `any` loopholes: - expect(abc.str.slice(0)).toBe("hi"); - expect(abc.a * 2).toBe(6); - expect(abc.b - 0).toBe(1); - expect(abc.c / 2).toBe(1); - }); - - it('mergeDeepArray returns the supertype of its argument types', function() { - class F { - check() { return "ok" }; - } - const fs: F[] = [new F, new F, new F]; - // Although mergeDeepArray doesn't have the same tuple type awareness as - // mergeDeep, it does infer that F should be the return type here: - expect(mergeDeepArray(fs).check()).toBe("ok"); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts b/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts deleted file mode 100644 index fd5594b..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { stripSymbols } from '../stripSymbols'; - -interface SymbolConstructor { - (description?: string | number): symbol; -} - -declare const Symbol: SymbolConstructor; - -describe('stripSymbols', () => { - it('should strip symbols (only)', () => { - const sym = Symbol('id'); - const data = { foo: 'bar', [sym]: 'ROOT_QUERY' }; - expect(stripSymbols(data)).toEqual({ foo: 'bar' }); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts b/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts deleted file mode 100644 index 35c8753..0000000 --- a/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { warnOnceInDevelopment } from '../warnOnce'; - -let lastWarning: string | null; -let keepEnv: string | undefined; -let numCalls = 0; -let oldConsoleWarn: any; - -describe('warnOnce', () => { - beforeEach(() => { - keepEnv = process.env.NODE_ENV; - numCalls = 0; - lastWarning = null; - oldConsoleWarn = console.warn; - console.warn = (msg: any) => { - numCalls++; - lastWarning = msg; - }; - }); - afterEach(() => { - process.env.NODE_ENV = keepEnv; - console.warn = oldConsoleWarn; - }); - it('actually warns', () => { - process.env.NODE_ENV = 'development'; - warnOnceInDevelopment('hi'); - expect(lastWarning).toBe('hi'); - expect(numCalls).toEqual(1); - }); - - it('does not warn twice', () => { - process.env.NODE_ENV = 'development'; - warnOnceInDevelopment('ho'); - warnOnceInDevelopment('ho'); - expect(lastWarning).toEqual('ho'); - expect(numCalls).toEqual(1); - }); - - it('warns two different things once each', () => { - process.env.NODE_ENV = 'development'; - warnOnceInDevelopment('slow'); - expect(lastWarning).toEqual('slow'); - warnOnceInDevelopment('mo'); - expect(lastWarning).toEqual('mo'); - expect(numCalls).toEqual(2); - }); - - it('does not warn in production', () => { - process.env.NODE_ENV = 'production'; - warnOnceInDevelopment('lo'); - warnOnceInDevelopment('lo'); - expect(numCalls).toEqual(0); - }); - - it('warns many times in test', () => { - process.env.NODE_ENV = 'test'; - warnOnceInDevelopment('yo'); - warnOnceInDevelopment('yo'); - expect(lastWarning).toEqual('yo'); - expect(numCalls).toEqual(2); - }); -}); diff --git a/node_modules/apollo-utilities/src/util/assign.ts b/node_modules/apollo-utilities/src/util/assign.ts deleted file mode 100644 index 3a22432..0000000 --- a/node_modules/apollo-utilities/src/util/assign.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Adds the properties of one or more source objects to a target object. Works exactly like - * `Object.assign`, but as a utility to maintain support for IE 11. - * - * @see https://github.com/apollostack/apollo-client/pull/1009 - */ -export function assign(a: A, b: B): A & B; -export function assign(a: A, b: B, c: C): A & B & C; -export function assign(a: A, b: B, c: C, d: D): A & B & C & D; -export function assign( - a: A, - b: B, - c: C, - d: D, - e: E, -): A & B & C & D & E; -export function assign(target: any, ...sources: Array): any; -export function assign( - target: { [key: string]: any }, - ...sources: Array<{ [key: string]: any }> -): { [key: string]: any } { - sources.forEach(source => { - if (typeof source === 'undefined' || source === null) { - return; - } - Object.keys(source).forEach(key => { - target[key] = source[key]; - }); - }); - return target; -} diff --git a/node_modules/apollo-utilities/src/util/canUse.ts b/node_modules/apollo-utilities/src/util/canUse.ts deleted file mode 100644 index d985867..0000000 --- a/node_modules/apollo-utilities/src/util/canUse.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const canUseWeakMap = typeof WeakMap === 'function' && !( - typeof navigator === 'object' && - navigator.product === 'ReactNative' -); diff --git a/node_modules/apollo-utilities/src/util/cloneDeep.ts b/node_modules/apollo-utilities/src/util/cloneDeep.ts deleted file mode 100644 index 961b4a8..0000000 --- a/node_modules/apollo-utilities/src/util/cloneDeep.ts +++ /dev/null @@ -1,37 +0,0 @@ -const { toString } = Object.prototype; - -/** - * Deeply clones a value to create a new instance. - */ -export function cloneDeep(value: T): T { - return cloneDeepHelper(value, new Map()); -} - -function cloneDeepHelper(val: T, seen: Map): T { - switch (toString.call(val)) { - case "[object Array]": { - if (seen.has(val)) return seen.get(val); - const copy: T & any[] = (val as any).slice(0); - seen.set(val, copy); - copy.forEach(function (child, i) { - copy[i] = cloneDeepHelper(child, seen); - }); - return copy; - } - - case "[object Object]": { - if (seen.has(val)) return seen.get(val); - // High fidelity polyfills of Object.create and Object.getPrototypeOf are - // possible in all JS environments, so we will assume they exist/work. - const copy = Object.create(Object.getPrototypeOf(val)); - seen.set(val, copy); - Object.keys(val).forEach(key => { - copy[key] = cloneDeepHelper((val as any)[key], seen); - }); - return copy; - } - - default: - return val; - } -} diff --git a/node_modules/apollo-utilities/src/util/environment.ts b/node_modules/apollo-utilities/src/util/environment.ts deleted file mode 100644 index f4ad04e..0000000 --- a/node_modules/apollo-utilities/src/util/environment.ts +++ /dev/null @@ -1,24 +0,0 @@ -export function getEnv(): string | undefined { - if (typeof process !== 'undefined' && process.env.NODE_ENV) { - return process.env.NODE_ENV; - } - - // default environment - return 'development'; -} - -export function isEnv(env: string): boolean { - return getEnv() === env; -} - -export function isProduction(): boolean { - return isEnv('production') === true; -} - -export function isDevelopment(): boolean { - return isEnv('development') === true; -} - -export function isTest(): boolean { - return isEnv('test') === true; -} diff --git a/node_modules/apollo-utilities/src/util/errorHandling.ts b/node_modules/apollo-utilities/src/util/errorHandling.ts deleted file mode 100644 index 25a16ca..0000000 --- a/node_modules/apollo-utilities/src/util/errorHandling.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ExecutionResult } from 'graphql'; - -export function tryFunctionOrLogError(f: Function) { - try { - return f(); - } catch (e) { - if (console.error) { - console.error(e); - } - } -} - -export function graphQLResultHasError(result: ExecutionResult) { - return result.errors && result.errors.length; -} diff --git a/node_modules/apollo-utilities/src/util/filterInPlace.ts b/node_modules/apollo-utilities/src/util/filterInPlace.ts deleted file mode 100644 index d5787ca..0000000 --- a/node_modules/apollo-utilities/src/util/filterInPlace.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function filterInPlace( - array: T[], - test: (elem: T) => boolean, - context?: any, -): T[] { - let target = 0; - array.forEach(function (elem, i) { - if (test.call(this, elem, i, array)) { - array[target++] = elem; - } - }, context); - array.length = target; - return array; -} diff --git a/node_modules/apollo-utilities/src/util/isEqual.ts b/node_modules/apollo-utilities/src/util/isEqual.ts deleted file mode 100644 index debf742..0000000 --- a/node_modules/apollo-utilities/src/util/isEqual.ts +++ /dev/null @@ -1 +0,0 @@ -export { equal as isEqual } from '@wry/equality'; diff --git a/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts b/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts deleted file mode 100644 index d966d33..0000000 --- a/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { isDevelopment, isTest } from './environment'; - -// Taken (mostly) from https://github.com/substack/deep-freeze to avoid -// import hassles with rollup. -function deepFreeze(o: any) { - Object.freeze(o); - - Object.getOwnPropertyNames(o).forEach(function(prop) { - if ( - o[prop] !== null && - (typeof o[prop] === 'object' || typeof o[prop] === 'function') && - !Object.isFrozen(o[prop]) - ) { - deepFreeze(o[prop]); - } - }); - - return o; -} - -export function maybeDeepFreeze(obj: any) { - if (isDevelopment() || isTest()) { - // Polyfilled Symbols potentially cause infinite / very deep recursion while deep freezing - // which is known to crash IE11 (https://github.com/apollographql/apollo-client/issues/3043). - const symbolIsPolyfilled = - typeof Symbol === 'function' && typeof Symbol('') === 'string'; - - if (!symbolIsPolyfilled) { - return deepFreeze(obj); - } - } - return obj; -} diff --git a/node_modules/apollo-utilities/src/util/mergeDeep.ts b/node_modules/apollo-utilities/src/util/mergeDeep.ts deleted file mode 100644 index d83a33f..0000000 --- a/node_modules/apollo-utilities/src/util/mergeDeep.ts +++ /dev/null @@ -1,115 +0,0 @@ -const { hasOwnProperty } = Object.prototype; - -// These mergeDeep and mergeDeepArray utilities merge any number of objects -// together, sharing as much memory as possible with the source objects, while -// remaining careful to avoid modifying any source objects. - -// Logically, the return type of mergeDeep should be the intersection of -// all the argument types. The binary call signature is by far the most -// common, but we support 0- through 5-ary as well. After that, the -// resulting type is just the inferred array element type. Note to nerds: -// there is a more clever way of doing this that converts the tuple type -// first to a union type (easy enough: T[number]) and then converts the -// union to an intersection type using distributive conditional type -// inference, but that approach has several fatal flaws (boolean becomes -// true & false, and the inferred type ends up as unknown in many cases), -// in addition to being nearly impossible to explain/understand. -export type TupleToIntersection = - T extends [infer A] ? A : - T extends [infer A, infer B] ? A & B : - T extends [infer A, infer B, infer C] ? A & B & C : - T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : - T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : - T extends (infer U)[] ? U : any; - -export function mergeDeep( - ...sources: T -): TupleToIntersection { - return mergeDeepArray(sources); -} - -// In almost any situation where you could succeed in getting the -// TypeScript compiler to infer a tuple type for the sources array, you -// could just use mergeDeep instead of mergeDeepArray, so instead of -// trying to convert T[] to an intersection type we just infer the array -// element type, which works perfectly when the sources array has a -// consistent element type. -export function mergeDeepArray(sources: T[]): T { - let target = sources[0] || {} as T; - const count = sources.length; - if (count > 1) { - const pastCopies: any[] = []; - target = shallowCopyForMerge(target, pastCopies); - for (let i = 1; i < count; ++i) { - target = mergeHelper(target, sources[i], pastCopies); - } - } - return target; -} - -function isObject(obj: any): obj is Record { - return obj !== null && typeof obj === 'object'; -} - -function mergeHelper( - target: any, - source: any, - pastCopies: any[], -) { - if (isObject(source) && isObject(target)) { - // In case the target has been frozen, make an extensible copy so that - // we can merge properties into the copy. - if (Object.isExtensible && !Object.isExtensible(target)) { - target = shallowCopyForMerge(target, pastCopies); - } - - Object.keys(source).forEach(sourceKey => { - const sourceValue = source[sourceKey]; - if (hasOwnProperty.call(target, sourceKey)) { - const targetValue = target[sourceKey]; - if (sourceValue !== targetValue) { - // When there is a key collision, we need to make a shallow copy of - // target[sourceKey] so the merge does not modify any source objects. - // To avoid making unnecessary copies, we use a simple array to track - // past copies, since it's safe to modify copies created earlier in - // the merge. We use an array for pastCopies instead of a Map or Set, - // since the number of copies should be relatively small, and some - // Map/Set polyfills modify their keys. - target[sourceKey] = mergeHelper( - shallowCopyForMerge(targetValue, pastCopies), - sourceValue, - pastCopies, - ); - } - } else { - // If there is no collision, the target can safely share memory with - // the source, and the recursion can terminate here. - target[sourceKey] = sourceValue; - } - }); - - return target; - } - - // If source (or target) is not an object, let source replace target. - return source; -} - -function shallowCopyForMerge(value: T, pastCopies: any[]): T { - if ( - value !== null && - typeof value === 'object' && - pastCopies.indexOf(value) < 0 - ) { - if (Array.isArray(value)) { - value = (value as any).slice(0); - } else { - value = { - __proto__: Object.getPrototypeOf(value), - ...value, - }; - } - pastCopies.push(value); - } - return value; -} diff --git a/node_modules/apollo-utilities/src/util/stripSymbols.ts b/node_modules/apollo-utilities/src/util/stripSymbols.ts deleted file mode 100644 index 41cabae..0000000 --- a/node_modules/apollo-utilities/src/util/stripSymbols.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * In order to make assertions easier, this function strips `symbol`'s from - * the incoming data. - * - * This can be handy when running tests against `apollo-client` for example, - * since it adds `symbol`'s to the data in the store. Jest's `toEqual` - * function now covers `symbol`'s (https://github.com/facebook/jest/pull/3437), - * which means all test data used in a `toEqual` comparison would also have to - * include `symbol`'s, to pass. By stripping `symbol`'s from the cache data - * we can compare against more simplified test data. - */ -export function stripSymbols(data: T): T { - return JSON.parse(JSON.stringify(data)); -} diff --git a/node_modules/apollo-utilities/src/util/warnOnce.ts b/node_modules/apollo-utilities/src/util/warnOnce.ts deleted file mode 100644 index 90f3232..0000000 --- a/node_modules/apollo-utilities/src/util/warnOnce.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { isProduction, isTest } from './environment'; - -const haveWarned = Object.create({}); - -/** - * Print a warning only once in development. - * In production no warnings are printed. - * In test all warnings are printed. - * - * @param msg The warning message - * @param type warn or error (will call console.warn or console.error) - */ -export function warnOnceInDevelopment(msg: string, type = 'warn') { - if (!isProduction() && !haveWarned[msg]) { - if (!isTest()) { - haveWarned[msg] = true; - } - if (type === 'error') { - console.error(msg); - } else { - console.warn(msg); - } - } -} diff --git a/node_modules/cross-fetch/LICENSE b/node_modules/cross-fetch/LICENSE deleted file mode 100644 index 9198b86..0000000 --- a/node_modules/cross-fetch/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Leonardo Quixadá - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/cross-fetch/README.md b/node_modules/cross-fetch/README.md deleted file mode 100644 index 92434d5..0000000 --- a/node_modules/cross-fetch/README.md +++ /dev/null @@ -1,169 +0,0 @@ -cross-fetch
-[![NPM Version](https://img.shields.io/npm/v/cross-fetch.svg?branch=main)](https://www.npmjs.com/package/cross-fetch) -[![Downloads Per Week](https://img.shields.io/npm/dw/cross-fetch.svg?color=blue)](https://www.npmjs.com/package/cross-fetch) -[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) -![CI](https://github.com/lquixada/cross-fetch/workflows/CI/badge.svg) -[![codecov](https://codecov.io/gh/lquixada/cross-fetch/branch/main/graph/badge.svg)](https://codecov.io/gh/lquixada/cross-fetch) -================ - -Universal WHATWG Fetch API for Node, Browsers and React Native. The scenario that cross-fetch really shines is when the same JavaScript codebase needs to run on different platforms. - -- **Platform agnostic**: browsers, Node or React Native -- **Optional polyfill**: it's up to you if something is going to be added to the global object or not -- **Simple interface**: no instantiation, no configuration and no extra dependency -- **WHATWG compliant**: it works the same way wherever your code runs -- **TypeScript support**: better development experience with types. - - -* * * - -## Table of Contents - -- [Install](#install) -- [Usage](#usage) -- [Demo & API](#demo--api) -- [FAQ](#faq) -- [Thanks](#thanks) -- [License](#license) -- [Author](#author) - -* * * - -## Install - -```sh -npm install --save cross-fetch -``` - -As a [ponyfill](https://github.com/sindresorhus/ponyfill): - -```javascript -// Using ES6 modules with Babel or TypeScript -import fetch from 'cross-fetch'; - -// Using CommonJS modules -const fetch = require('cross-fetch'); -``` - -As a polyfill: - -```javascript -// Using ES6 modules -import 'cross-fetch/polyfill'; - -// Using CommonJS modules -require('cross-fetch/polyfill'); -``` - - -The CDN build is also available on unpkg: - -```html - -``` - -This adds the fetch function to the window object. Note that this is not UMD compatible. - - -* * * - -## Usage - -With [promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise): - -```javascript -import fetch from 'cross-fetch'; -// Or just: import 'cross-fetch/polyfill'; - -fetch('//api.github.com/users/lquixada') - .then(res => { - if (res.status >= 400) { - throw new Error("Bad response from server"); - } - return res.json(); - }) - .then(user => { - console.log(user); - }) - .catch(err => { - console.error(err); - }); -``` - -With [async/await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function): - -```javascript -import fetch from 'cross-fetch'; -// Or just: import 'cross-fetch/polyfill'; - -(async () => { - try { - const res = await fetch('//api.github.com/users/lquixada'); - - if (res.status >= 400) { - throw new Error("Bad response from server"); - } - - const user = await res.json(); - - console.log(user); - } catch (err) { - console.error(err); - } -})(); -``` - -> ⚠️ **Warning**: If you're in an environment that doesn't support Promises such as Internet Explorer, you must install an ES6 Promise compatible polyfill. [es6-promise](https://github.com/jakearchibald/es6-promise) is suggested. - - -## Demo & API - -You can find a comprehensive doc at [Github's fetch](https://github.github.io/fetch/) page. If you want to play with cross-fetch, check our [**JSFiddle playground**](https://jsfiddle.net/lquixada/3ypqgacp/). - -> **Tip**: Run the fiddle on various browsers and with different settings (for instance: cross-domain requests, wrong urls or text requests). Don't forget to open the console in the test suite page and play around. - - -## FAQ - -#### Yet another fetch library? - -I did a lot of research in order to find a fetch library that could be simple, cross-platform and provide polyfill as an option. There's a plethora of libs out there but none could match those requirements. - - -#### Why not isomorphic-fetch? - -My preferred library used to be [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) but it has this [bug](https://github.com/matthew-andrews/isomorphic-fetch/issues/125) that prevents it from running in a react native environment. It seems unlikely to be fixed since there haven't been any new commits to it since 2016. That means dependencies are outdated as well. - - -#### Why polyfill might not be a good idea? - -In a word? Risk. If the spec changes in the future, it might be problematic to debug. Read more about it on [sindresorhus's ponyfill](https://github.com/sindresorhus/ponyfill#how-are-ponyfills-better-than-polyfills) page. It's up to you if you're fine with it or not. - - -#### How does cross-fetch work? - -Just like isomorphic-fetch, it is just a proxy. If you're in node, it delivers you the [node-fetch](https://github.com/bitinn/node-fetch/) library, if you're in a browser or React Native, it delivers you the github's [whatwg-fetch](https://github.com/github/fetch/). The same strategy applies whether you're using polyfill or ponyfill. - - -## Who's Using It? - -|[![The New York Times](./docs/images/logo-nytimes.png)](https://www.nytimes.com/)|[![Apollo GraphQL](./docs/images/logo-apollo.png)](https://github.com/apollographql/apollo-client/)|[![Facebook](./docs/images/logo-facebook.png)](https://github.com/facebook/fbjs/)|[![Swagger](./docs/images/logo-swagger.png)](https://swagger.io/)|[![VulcanJS](./docs/images/logo-vulcanjs.png)](http://vulcanjs.org)|[![graphql-request](./docs/images/logo-graphql-request.png)](https://github.com/prisma/graphql-request)| -|:---:|:---:|:---:|:---:|:---:|:---:| -|The New York Times|Apollo GraphQL|Facebook|Swagger|VulcanJS|graphql-request| - - -## Thanks - -Heavily inspired by the works of [matthew-andrews](https://github.com/matthew-andrews). Kudos to him! - - -## License - -cross-fetch is licensed under the [MIT license](https://github.com/lquixada/cross-fetch/blob/main/LICENSE) © [Leonardo Quixadá](https://twitter.com/lquixada/) - - -## Author - -|[![@lquixada](https://avatars0.githubusercontent.com/u/195494?v=4&s=96)](https://github.com/lquixada)| -|:---:| -|[@lquixada](http://www.github.com/lquixada)| diff --git a/node_modules/cross-fetch/dist/browser-polyfill.js b/node_modules/cross-fetch/dist/browser-polyfill.js deleted file mode 100644 index da6342e..0000000 --- a/node_modules/cross-fetch/dist/browser-polyfill.js +++ /dev/null @@ -1,532 +0,0 @@ -(function(self) { - -var irrelevant = (function (exports) { - - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: - 'FileReader' in self && - 'Blob' in self && - (function() { - try { - new Blob(); - return true - } catch (e) { - return false - } - })(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - - function isDataView(obj) { - return obj && DataView.prototype.isPrototypeOf(obj) - } - - if (support.arrayBuffer) { - var viewClasses = [ - '[object Int8Array]', - '[object Uint8Array]', - '[object Uint8ClampedArray]', - '[object Int16Array]', - '[object Uint16Array]', - '[object Int32Array]', - '[object Uint32Array]', - '[object Float32Array]', - '[object Float64Array]' - ]; - - var isArrayBufferView = - ArrayBuffer.isView || - function(obj) { - return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 - }; - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name') - } - return name.toLowerCase() - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function() { - var value = items.shift(); - return {done: value === undefined, value: value} - } - }; - - if (support.iterable) { - iterator[Symbol.iterator] = function() { - return iterator - }; - } - - return iterator - } - - function Headers(headers) { - this.map = {}; - - if (headers instanceof Headers) { - headers.forEach(function(value, name) { - this.append(name, value); - }, this); - } else if (Array.isArray(headers)) { - headers.forEach(function(header) { - this.append(header[0], header[1]); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function(name) { - this.append(name, headers[name]); - }, this); - } - } - - Headers.prototype.append = function(name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var oldValue = this.map[name]; - this.map[name] = oldValue ? oldValue + ', ' + value : value; - }; - - Headers.prototype['delete'] = function(name) { - delete this.map[normalizeName(name)]; - }; - - Headers.prototype.get = function(name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null - }; - - Headers.prototype.has = function(name) { - return this.map.hasOwnProperty(normalizeName(name)) - }; - - Headers.prototype.set = function(name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; - - Headers.prototype.forEach = function(callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); - } - } - }; - - Headers.prototype.keys = function() { - var items = []; - this.forEach(function(value, name) { - items.push(name); - }); - return iteratorFor(items) - }; - - Headers.prototype.values = function() { - var items = []; - this.forEach(function(value) { - items.push(value); - }); - return iteratorFor(items) - }; - - Headers.prototype.entries = function() { - var items = []; - this.forEach(function(value, name) { - items.push([name, value]); - }); - return iteratorFor(items) - }; - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')) - } - body.bodyUsed = true; - } - - function fileReaderReady(reader) { - return new Promise(function(resolve, reject) { - reader.onload = function() { - resolve(reader.result); - }; - reader.onerror = function() { - reject(reader.error); - }; - }) - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise - } - - function readBlobAsText(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise - } - - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf); - var chars = new Array(view.length); - - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); - } - return chars.join('') - } - - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0) - } else { - var view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer - } - } - - function Body() { - this.bodyUsed = false; - - this._initBody = function(body) { - this._bodyInit = body; - if (!body) { - this._bodyText = ''; - } else if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); - } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer); - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); - } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { - this._bodyArrayBuffer = bufferClone(body); - } else { - this._bodyText = body = Object.prototype.toString.call(body); - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - } - }; - - if (support.blob) { - this.blob = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob') - } else { - return Promise.resolve(new Blob([this._bodyText])) - } - }; - - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) - } else { - return this.blob().then(readBlobAsArrayBuffer) - } - }; - } - - this.text = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text') - } else { - return Promise.resolve(this._bodyText) - } - }; - - if (support.formData) { - this.formData = function() { - return this.text().then(decode) - }; - } - - this.json = function() { - return this.text().then(JSON.parse) - }; - - return this - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method - } - - function Request(input, options) { - options = options || {}; - var body = options.body; - - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError('Already read') - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - this.signal = input.signal; - if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = String(input); - } - - this.credentials = options.credentials || this.credentials || 'same-origin'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.signal = options.signal || this.signal; - this.referrer = null; - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests') - } - this._initBody(body); - } - - Request.prototype.clone = function() { - return new Request(this, {body: this._bodyInit}) - }; - - function decode(body) { - var form = new FormData(); - body - .trim() - .split('&') - .forEach(function(bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form - } - - function parseHeaders(rawHeaders) { - var headers = new Headers(); - // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space - // https://tools.ietf.org/html/rfc7230#section-3.2 - var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); - preProcessedHeaders.split(/\r?\n/).forEach(function(line) { - var parts = line.split(':'); - var key = parts.shift().trim(); - if (key) { - var value = parts.join(':').trim(); - headers.append(key, value); - } - }); - return headers - } - - Body.call(Request.prototype); - - function Response(bodyInit, options) { - if (!options) { - options = {}; - } - - this.type = 'default'; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = 'statusText' in options ? options.statusText : 'OK'; - this.headers = new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - - Body.call(Response.prototype); - - Response.prototype.clone = function() { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }) - }; - - Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}); - response.type = 'error'; - return response - }; - - var redirectStatuses = [301, 302, 303, 307, 308]; - - Response.redirect = function(url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code') - } - - return new Response(null, {status: status, headers: {location: url}}) - }; - - exports.DOMException = self.DOMException; - try { - new exports.DOMException(); - } catch (err) { - exports.DOMException = function(message, name) { - this.message = message; - this.name = name; - var error = Error(message); - this.stack = error.stack; - }; - exports.DOMException.prototype = Object.create(Error.prototype); - exports.DOMException.prototype.constructor = exports.DOMException; - } - - function fetch(input, init) { - return new Promise(function(resolve, reject) { - var request = new Request(input, init); - - if (request.signal && request.signal.aborted) { - return reject(new exports.DOMException('Aborted', 'AbortError')) - } - - var xhr = new XMLHttpRequest(); - - function abortXhr() { - xhr.abort(); - } - - xhr.onload = function() { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || '') - }; - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - - xhr.onerror = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.ontimeout = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.onabort = function() { - reject(new exports.DOMException('Aborted', 'AbortError')); - }; - - xhr.open(request.method, request.url, true); - - if (request.credentials === 'include') { - xhr.withCredentials = true; - } else if (request.credentials === 'omit') { - xhr.withCredentials = false; - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value); - }); - - if (request.signal) { - request.signal.addEventListener('abort', abortXhr); - - xhr.onreadystatechange = function() { - // DONE (success or failure) - if (xhr.readyState === 4) { - request.signal.removeEventListener('abort', abortXhr); - } - }; - } - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }) - } - - fetch.polyfill = true; - - if (!self.fetch) { - self.fetch = fetch; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - } - - exports.Headers = Headers; - exports.Request = Request; - exports.Response = Response; - exports.fetch = fetch; - - Object.defineProperty(exports, '__esModule', { value: true }); - - return exports; - -}({})); -})(typeof self !== 'undefined' ? self : this); diff --git a/node_modules/cross-fetch/dist/browser-ponyfill.js b/node_modules/cross-fetch/dist/browser-ponyfill.js deleted file mode 100644 index f26eb09..0000000 --- a/node_modules/cross-fetch/dist/browser-ponyfill.js +++ /dev/null @@ -1,554 +0,0 @@ -var global = typeof self !== 'undefined' ? self : this; -var __self__ = (function () { -function F() { -this.fetch = false; -this.DOMException = global.DOMException -} -F.prototype = global; -return new F(); -})(); -(function(self) { - -var irrelevant = (function (exports) { - - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: - 'FileReader' in self && - 'Blob' in self && - (function() { - try { - new Blob(); - return true - } catch (e) { - return false - } - })(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - - function isDataView(obj) { - return obj && DataView.prototype.isPrototypeOf(obj) - } - - if (support.arrayBuffer) { - var viewClasses = [ - '[object Int8Array]', - '[object Uint8Array]', - '[object Uint8ClampedArray]', - '[object Int16Array]', - '[object Uint16Array]', - '[object Int32Array]', - '[object Uint32Array]', - '[object Float32Array]', - '[object Float64Array]' - ]; - - var isArrayBufferView = - ArrayBuffer.isView || - function(obj) { - return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 - }; - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name') - } - return name.toLowerCase() - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function() { - var value = items.shift(); - return {done: value === undefined, value: value} - } - }; - - if (support.iterable) { - iterator[Symbol.iterator] = function() { - return iterator - }; - } - - return iterator - } - - function Headers(headers) { - this.map = {}; - - if (headers instanceof Headers) { - headers.forEach(function(value, name) { - this.append(name, value); - }, this); - } else if (Array.isArray(headers)) { - headers.forEach(function(header) { - this.append(header[0], header[1]); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function(name) { - this.append(name, headers[name]); - }, this); - } - } - - Headers.prototype.append = function(name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var oldValue = this.map[name]; - this.map[name] = oldValue ? oldValue + ', ' + value : value; - }; - - Headers.prototype['delete'] = function(name) { - delete this.map[normalizeName(name)]; - }; - - Headers.prototype.get = function(name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null - }; - - Headers.prototype.has = function(name) { - return this.map.hasOwnProperty(normalizeName(name)) - }; - - Headers.prototype.set = function(name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; - - Headers.prototype.forEach = function(callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); - } - } - }; - - Headers.prototype.keys = function() { - var items = []; - this.forEach(function(value, name) { - items.push(name); - }); - return iteratorFor(items) - }; - - Headers.prototype.values = function() { - var items = []; - this.forEach(function(value) { - items.push(value); - }); - return iteratorFor(items) - }; - - Headers.prototype.entries = function() { - var items = []; - this.forEach(function(value, name) { - items.push([name, value]); - }); - return iteratorFor(items) - }; - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')) - } - body.bodyUsed = true; - } - - function fileReaderReady(reader) { - return new Promise(function(resolve, reject) { - reader.onload = function() { - resolve(reader.result); - }; - reader.onerror = function() { - reject(reader.error); - }; - }) - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise - } - - function readBlobAsText(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise - } - - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf); - var chars = new Array(view.length); - - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); - } - return chars.join('') - } - - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0) - } else { - var view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer - } - } - - function Body() { - this.bodyUsed = false; - - this._initBody = function(body) { - this._bodyInit = body; - if (!body) { - this._bodyText = ''; - } else if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); - } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer); - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); - } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { - this._bodyArrayBuffer = bufferClone(body); - } else { - this._bodyText = body = Object.prototype.toString.call(body); - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - } - }; - - if (support.blob) { - this.blob = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob') - } else { - return Promise.resolve(new Blob([this._bodyText])) - } - }; - - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) - } else { - return this.blob().then(readBlobAsArrayBuffer) - } - }; - } - - this.text = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text') - } else { - return Promise.resolve(this._bodyText) - } - }; - - if (support.formData) { - this.formData = function() { - return this.text().then(decode) - }; - } - - this.json = function() { - return this.text().then(JSON.parse) - }; - - return this - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method - } - - function Request(input, options) { - options = options || {}; - var body = options.body; - - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError('Already read') - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - this.signal = input.signal; - if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = String(input); - } - - this.credentials = options.credentials || this.credentials || 'same-origin'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.signal = options.signal || this.signal; - this.referrer = null; - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests') - } - this._initBody(body); - } - - Request.prototype.clone = function() { - return new Request(this, {body: this._bodyInit}) - }; - - function decode(body) { - var form = new FormData(); - body - .trim() - .split('&') - .forEach(function(bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form - } - - function parseHeaders(rawHeaders) { - var headers = new Headers(); - // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space - // https://tools.ietf.org/html/rfc7230#section-3.2 - var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); - preProcessedHeaders.split(/\r?\n/).forEach(function(line) { - var parts = line.split(':'); - var key = parts.shift().trim(); - if (key) { - var value = parts.join(':').trim(); - headers.append(key, value); - } - }); - return headers - } - - Body.call(Request.prototype); - - function Response(bodyInit, options) { - if (!options) { - options = {}; - } - - this.type = 'default'; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = 'statusText' in options ? options.statusText : 'OK'; - this.headers = new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - - Body.call(Response.prototype); - - Response.prototype.clone = function() { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }) - }; - - Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}); - response.type = 'error'; - return response - }; - - var redirectStatuses = [301, 302, 303, 307, 308]; - - Response.redirect = function(url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code') - } - - return new Response(null, {status: status, headers: {location: url}}) - }; - - exports.DOMException = self.DOMException; - try { - new exports.DOMException(); - } catch (err) { - exports.DOMException = function(message, name) { - this.message = message; - this.name = name; - var error = Error(message); - this.stack = error.stack; - }; - exports.DOMException.prototype = Object.create(Error.prototype); - exports.DOMException.prototype.constructor = exports.DOMException; - } - - function fetch(input, init) { - return new Promise(function(resolve, reject) { - var request = new Request(input, init); - - if (request.signal && request.signal.aborted) { - return reject(new exports.DOMException('Aborted', 'AbortError')) - } - - var xhr = new XMLHttpRequest(); - - function abortXhr() { - xhr.abort(); - } - - xhr.onload = function() { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || '') - }; - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - - xhr.onerror = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.ontimeout = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.onabort = function() { - reject(new exports.DOMException('Aborted', 'AbortError')); - }; - - xhr.open(request.method, request.url, true); - - if (request.credentials === 'include') { - xhr.withCredentials = true; - } else if (request.credentials === 'omit') { - xhr.withCredentials = false; - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value); - }); - - if (request.signal) { - request.signal.addEventListener('abort', abortXhr); - - xhr.onreadystatechange = function() { - // DONE (success or failure) - if (xhr.readyState === 4) { - request.signal.removeEventListener('abort', abortXhr); - } - }; - } - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }) - } - - fetch.polyfill = true; - - if (!self.fetch) { - self.fetch = fetch; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - } - - exports.Headers = Headers; - exports.Request = Request; - exports.Response = Response; - exports.fetch = fetch; - - Object.defineProperty(exports, '__esModule', { value: true }); - - return exports; - -}({})); -})(__self__); -__self__.fetch.ponyfill = true; -// Remove "polyfill" property added by whatwg-fetch -delete __self__.fetch.polyfill; -// Choose between native implementation (global) or custom implementation (__self__) -// var ctx = global.fetch ? global : __self__; -var ctx = __self__; // this line disable service worker support temporarily -exports = ctx.fetch // To enable: import fetch from 'cross-fetch' -exports.default = ctx.fetch // For TypeScript consumers without esModuleInterop. -exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch' -exports.Headers = ctx.Headers -exports.Request = ctx.Request -exports.Response = ctx.Response -module.exports = exports diff --git a/node_modules/cross-fetch/dist/cross-fetch.js b/node_modules/cross-fetch/dist/cross-fetch.js deleted file mode 100644 index 865dd5d..0000000 --- a/node_modules/cross-fetch/dist/cross-fetch.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t){!function(e){var r="URLSearchParams"in t,o="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,s="ArrayBuffer"in t;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function d(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function y(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function l(t){var e=new FileReader,r=y(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&n&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||h(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t,e,r,o=p(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=y(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o-1?o:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function E(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}})),e}function A(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},A.error=function(){var t=new A(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];A.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new A(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function g(t,r){return new Promise((function(o,i){var s=new v(t,r);if(s.signal&&s.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),o=r.shift().trim();if(o){var n=r.join(":").trim();e.append(o,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;o(new A(n,r))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",h)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}g.polyfill=!0,t.fetch||(t.fetch=g,t.Headers=c,t.Request=v,t.Response=A),e.Headers=c,e.Request=v,e.Response=A,e.fetch=g,Object.defineProperty(e,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:this); -//# sourceMappingURL=cross-fetch.js.map diff --git a/node_modules/cross-fetch/dist/cross-fetch.js.map b/node_modules/cross-fetch/dist/cross-fetch.js.map deleted file mode 100644 index ddcd1e8..0000000 --- a/node_modules/cross-fetch/dist/cross-fetch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cross-fetch.js","sources":["../node_modules/whatwg-fetch/fetch.js"],"sourcesContent":["var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!options) {\n option