-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathjs-sdk-demo.cast
95 lines (95 loc) · 5.96 KB
/
js-sdk-demo.cast
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{"version": 2, "width": 117, "height": 45, "timestamp": 1530134182, "idle_time_limit": 1.0, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
[0.010229, "o", "\u001b[?1034h$ "]
[0.467947, "o", "n"]
[0.524226, "o", "p"]
[0.70808, "o", "m"]
[1.052436, "o", " "]
[1.348151, "o", "i"]
[1.452182, "o", "n"]
[1.523968, "o", "s"]
[1.667973, "o", "t"]
[1.764448, "o", "a"]
[1.907995, "o", "l"]
[2.052337, "o", "l"]
[2.196398, "o", " "]
[2.68405, "o", "s"]
[2.804179, "o", "m"]
[2.915962, "o", "a"]
[3.10013, "o", "r"]
[3.315956, "o", "t"]
[3.796418, "o", "y"]
[4.068496, "o", "s"]
[4.244361, "o", "t"]
[4.332117, "o", "r"]
[4.620157, "o", "e"]
[4.748372, "o", "e"]
[4.93247, "o", "t"]
[5.756319, "o", "s"]
[6.340584, "o", "-"]
[6.860414, "o", "j"]
[6.971776, "o", "a"]
[7.268031, "o", "v"]
[7.427947, "o", "a"]
[7.900124, "o", "s"]
[8.06054, "o", "c"]
[8.340057, "o", "r"]
[8.604094, "o", "i"]
[8.708032, "o", "p"]
[9.020098, "o", "t"]
[9.443566, "o", "-"]
[10.420419, "o", "s"]
[10.578756, "o", "d"]
[11.075609, "o", "k"]
[11.619051, "o", "\r\n"]
[11.994868, "o", "\u001b[?25l"]
[11.997323, "o", "⸨\u001b[90m░░░░░░░░░░░░░░░░░░\u001b[0m⸩ ⠇ rollbackFailedOptional: \u001b[34;40mverb\u001b[0m \u001b[35mnpm-session\u001b[0m 80cbcd75622a93e0\u001b[0m\u001b[K\r"]
[12.392273, "o", "⸨\u001b[90m░░░░░░░░░░░░░░░░░░\u001b[0m⸩ ⠇ rollbackFailedOptional: \u001b[34;40mverb\u001b[0m \u001b[35mnpm-session\u001b[0m 80cbcd75622a93e0\u001b[0m\u001b[K\r"]
[12.443351, "o", "⸨\u001b[90m░░░░░░░░░░░░░░░░░░\u001b[0m⸩ ⠇ rollbackFailedOptional: \u001b[34;40mverb\u001b[0m \u001b[35mnpm-session\u001b[0m 80cbcd75622a93e0\u001b[0m\u001b[K\r"]
[12.493195, "o", "⸨\u001b[90m░░░░░░░░░░░░░░░░░░\u001b[0m⸩ ⠇ rollbackFailedOptional: \u001b[34;40mverb\u001b[0m \u001b[35mnpm-session\u001b[0m 80cbcd75622a93e0\u001b[0m\u001b[K\r"]
[12.547335, "o", "⸨\u001b[90m░░░░░░░░░░░░░░░░░░\u001b[0m⸩ ⠴ loadDep:promise: \u001b[7msill\u001b[0m \u001b[35mresolveWithNewModule\u001b[0m [email protected].\u001b[0m\u001b[K\r"]
[12.601971, "o", "⸨\u001b[7m \u001b[27m\u001b[90m░░░░░░░░░░░\u001b[0m⸩ ⠴ extract:smartystreets-javascript-sdk: \u001b[34;40mverb\u001b[0m \u001b[35mlock\u001b[0m using /Users/Neo/.npm/_locks\u001b[0m\u001b[K\r"]
[12.656729, "o", "⸨\u001b[7m \u001b[27m\u001b[90m░░░░░░░░░░░\u001b[0m⸩ ⠴ extract:smartystreets-javascript-sdk: \u001b[34;40mverb\u001b[0m \u001b[35mlock\u001b[0m using /Users/Neo/.npm/_locks\u001b[0m\u001b[K\r"]
[12.712334, "o", "⸨\u001b[7m \u001b[27m\u001b[90m░░░░░░░░░░░\u001b[0m⸩ ⠴ extract:smartystreets-javascript-sdk: \u001b[34;40mverb\u001b[0m \u001b[35mlock\u001b[0m using /Users/Neo/.npm/_locks\u001b[0m\u001b[K\r"]
[12.765091, "o", "⸨\u001b[7m \u001b[27m\u001b[90m░░░░░░░░░░░\u001b[0m⸩ ⠴ extract:smartystreets-javascript-sdk: \u001b[34;40mverb\u001b[0m \u001b[35mlock\u001b[0m using /Users/Neo/.npm/_locks\u001b[0m\u001b[K\r"]
[12.815536, "o", "⸨\u001b[7m \u001b[27m\u001b[90m░░░░░░░░░░░\u001b[0m⸩ ⠴ extract:smartystreets-javascript-sdk: \u001b[34;40mverb\u001b[0m \u001b[35mlock\u001b[0m using /Users/Neo/.npm/_locks\u001b[0m\u001b[K\r"]
[12.837371, "o", "\r\u001b[K\u001b[?25h"]
[12.854763, "o", "\r\n"]
[12.855413, "o", "+ [email protected]\r\nadded 1 package in 0.872s\r\n"]
[12.863697, "o", "$ "]
[14.195072, "o", "\r\n"]
[14.195235, "o", "$ "]
[14.354464, "o", "\r\n"]
[14.354626, "o", "$ "]
[14.546544, "o", "\r\n"]
[14.546779, "o", "$ "]
[15.211593, "o", "c"]
[15.355119, "o", "a"]
[15.692111, "o", "t"]
[15.892141, "o", " "]
[16.956311, "o", "e"]
[17.788102, "o", "x"]
[18.03553, "o", "ample.js "]
[18.522916, "o", "\r\n"]
[18.527357, "o", "const SmartyStreetsSDK = require(\"smartystreets-javascript-sdk\");\r\nconst SmartyStreetsCore = SmartyStreetsSDK.core;\r\nconst Lookup = SmartyStreetsSDK.usStreet.Lookup;\r\n\r\n// This keypair will have been deleted by the time you are watching this video...\r\nlet authId = \"41c45025-e7a5-1ae5-bb76-8647a26f45ba\";\r\nlet authToken = \"xmztSBdqN6TVO5nUvAa8\";\r\n\r\nconsole.log(\"Step 0. Wire up the client with your keypair.\");\r\nlet clientBuilder = new SmartyStreetsCore.ClientBuilder(new SmartyStreetsCore.StaticCredentials(authId, authToken));\r\nlet client = clientBuilder.buildUsStreetApiClient();\r\n\r\nconsole.log(\"Step 1. Make a lookup. (BTW, you can also send entire batches of lookups...)\");\r\nlet lookup = new Lookup();\r\nlookup.street = \"1 Rosedale\";\r\nlookup.city = \"Baltimore\";\r\nlookup.state = \"MD\";\r\nlookup.maxCandidates = 10;\r\n\r\nconsole.log(\"Step 2. Send the lookup.\");\r\nclient.send(lookup)\r\n\t.then(handleSuccess)\r\n\t.catch(handleError);\r\n\r\nfunction handleSuccess(response) {\r\n\tconsole.log(\"Step 3. Show the resulting candidate address"]
[18.527549, "o", "es:\");\r\n\tlet lookup = response.lookups[0];\r\n\tlookup.result.map(candidate => console.log(` ${candidate.deliveryLine1}, ${candidate.lastLine}`));\r\n}\r\n\r\nfunction handleError(response) {\r\n\tconsole.log(response);\r\n}\r\n"]
[18.527961, "o", "$ "]
[20.515216, "o", "\r\n"]
[20.515496, "o", "$ "]
[20.698906, "o", "\r\n"]
[20.698986, "o", "$ "]
[23.308251, "o", "n"]
[23.396131, "o", "o"]
[23.492332, "o", "d"]
[23.587821, "o", "e"]
[23.940086, "o", " "]
[25.244151, "o", "e"]
[25.476053, "o", "x"]
[25.627144, "o", "ample.js "]
[26.819458, "o", "\r\n"]
[26.925891, "o", "Step 0. Wire up the client with your keypair.\r\n"]
[26.926939, "o", "Step 1. Make a lookup. (BTW, you can also send entire batches of lookups...)\r\n"]
[26.927133, "o", "Step 2. Send the lookup.\r\n"]
[27.183185, "o", "Step 3. Show the resulting candidate addresses:\r\n"]
[27.183252, "o", " 1 N Rosedale St, Baltimore MD 21229-3737\r\n 1 S Rosedale St, Baltimore MD 21229-3739\r\n"]
[27.18749, "o", "$ "]
[32.083944, "o", "exit\r\n"]