authing_ruby 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/lib/authing_ruby/authentication/AuthenticationClient.rb +7 -4
  3. data/lib/authing_ruby/common/GraphqlClient.rb +44 -4
  4. data/lib/authing_ruby/management/ManagementClient.rb +1 -1
  5. data/lib/authing_ruby/management/ManagementTokenProvider.rb +7 -3
  6. data/lib/authing_ruby/test/js_sdk_test/2.registerByPhoneCode.js +130 -0
  7. data/lib/authing_ruby/test/js_sdk_test/3.sendSMS.js +23 -0
  8. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/browser/index.min.js +1 -1
  9. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/AuthenticationClient.d.ts +41 -1
  10. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/AuthenticationClient.js +60 -2
  11. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/QrCodeAuthenticationClient.js +6 -3
  12. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/SocialAuthenticationClient.d.ts +4 -0
  13. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/SocialAuthenticationClient.js +6 -5
  14. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/types.d.ts +10 -0
  15. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/authentication/types.js +1 -1
  16. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/common/GraphqlClient.js +10 -8
  17. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/common/HttpClient.js +17 -15
  18. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/graphqlapi.d.ts +12 -1
  19. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/graphqlapi.js +192 -2
  20. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/ApplicationsManagementClient.js +5 -3
  21. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/GroupsManagementClient.d.ts +5 -1
  22. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/GroupsManagementClient.js +29 -11
  23. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/ManagementClient.d.ts +5 -0
  24. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/ManagementClient.js +15 -2
  25. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/OrgManagementClient.d.ts +34 -1
  26. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/OrgManagementClient.js +71 -3
  27. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/RolesManagementClient.d.ts +6 -1
  28. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/RolesManagementClient.js +45 -10
  29. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/UsersManagementClient.d.ts +34 -3
  30. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/UsersManagementClient.js +189 -52
  31. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/types.d.ts +10 -0
  32. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/management/types.js +1 -1
  33. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/utils.d.ts +1 -1
  34. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/utils.js +1 -1
  35. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/version.d.ts +1 -1
  36. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/lib/version.js +2 -2
  37. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/types/graphql.v2.d.ts +661 -32
  38. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/main/types/graphql.v2.js +30 -19
  39. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/AuthenticationClient.d.ts +41 -1
  40. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/AuthenticationClient.js +61 -3
  41. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/QrCodeAuthenticationClient.js +6 -3
  42. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/SocialAuthenticationClient.d.ts +4 -0
  43. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/SocialAuthenticationClient.js +6 -5
  44. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/types.d.ts +10 -0
  45. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/authentication/types.js +1 -1
  46. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/common/GraphqlClient.js +10 -8
  47. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/common/HttpClient.js +17 -15
  48. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/graphqlapi.d.ts +12 -1
  49. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/graphqlapi.js +192 -2
  50. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/ApplicationsManagementClient.js +5 -3
  51. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/GroupsManagementClient.d.ts +5 -1
  52. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/GroupsManagementClient.js +30 -12
  53. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/ManagementClient.d.ts +5 -0
  54. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/ManagementClient.js +15 -2
  55. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/OrgManagementClient.d.ts +34 -1
  56. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/OrgManagementClient.js +72 -4
  57. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/RolesManagementClient.d.ts +6 -1
  58. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/RolesManagementClient.js +46 -11
  59. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/UsersManagementClient.d.ts +34 -3
  60. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/UsersManagementClient.js +190 -53
  61. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/types.d.ts +10 -0
  62. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/management/types.js +1 -1
  63. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/utils.d.ts +1 -1
  64. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/utils.js +1 -1
  65. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/version.d.ts +1 -1
  66. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/lib/version.js +2 -2
  67. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/types/graphql.v2.d.ts +661 -32
  68. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/module/types/graphql.v2.js +29 -18
  69. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/AuthenticationClient.d.ts +41 -1
  70. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/AuthenticationClient.js +60 -2
  71. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/QrCodeAuthenticationClient.js +6 -3
  72. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/SocialAuthenticationClient.d.ts +4 -0
  73. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/SocialAuthenticationClient.js +6 -5
  74. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/types.d.ts +10 -0
  75. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/authentication/types.js +1 -1
  76. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/common/GraphqlClient.js +10 -8
  77. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/common/HttpClient.js +17 -15
  78. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/graphqlapi.d.ts +12 -1
  79. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/graphqlapi.js +192 -2
  80. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/ApplicationsManagementClient.js +5 -3
  81. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/GroupsManagementClient.d.ts +5 -1
  82. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/GroupsManagementClient.js +29 -11
  83. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/ManagementClient.d.ts +5 -0
  84. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/ManagementClient.js +15 -2
  85. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/OrgManagementClient.d.ts +34 -1
  86. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/OrgManagementClient.js +71 -3
  87. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/RolesManagementClient.d.ts +6 -1
  88. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/RolesManagementClient.js +45 -10
  89. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/UsersManagementClient.d.ts +34 -3
  90. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/UsersManagementClient.js +189 -52
  91. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/types.d.ts +10 -0
  92. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/management/types.js +1 -1
  93. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/utils.d.ts +1 -1
  94. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/utils.js +1 -1
  95. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/version.d.ts +1 -1
  96. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/lib/version.js +2 -2
  97. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/types/graphql.v2.d.ts +661 -32
  98. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/build/umd/types/graphql.v2.js +30 -19
  99. data/lib/authing_ruby/test/js_sdk_test/node_modules/authing-js-sdk/package.json +1 -1
  100. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/CHANGELOG.md +210 -0
  101. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/LICENSE +23 -0
  102. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/README.md +275 -0
  103. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/config.js +11 -0
  104. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/cli-options.js +13 -0
  105. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/env-options.js +18 -0
  106. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/lib/main.js +118 -0
  107. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/package.json +57 -0
  108. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/index.d.ts +59 -0
  109. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/test.ts +19 -0
  110. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/tsconfig.json +15 -0
  111. data/lib/authing_ruby/test/js_sdk_test/node_modules/dotenv/types/tslint.json +6 -0
  112. data/lib/authing_ruby/test/js_sdk_test/node_modules/follow-redirects/index.js +0 -4
  113. data/lib/authing_ruby/test/js_sdk_test/node_modules/follow-redirects/package.json +1 -1
  114. data/lib/authing_ruby/test/js_sdk_test/package-lock.json +7 -7
  115. data/lib/authing_ruby/test/js_sdk_test/package.json +3 -2
  116. data/lib/authing_ruby/test/js_sdk_test/yarn.lock +71 -0
  117. data/lib/authing_ruby/test/mini_test/TestAuthenticationClient.rb +21 -6
  118. data/lib/authing_ruby/test/mini_test/TestManagementClient.rb +4 -3
  119. data/lib/authing_ruby/test/sms.rb +18 -0
  120. data/lib/authing_ruby/utils/utils.rb +32 -1
  121. data/lib/authing_ruby/version.rb +1 -1
  122. metadata +18 -2
@@ -0,0 +1,11 @@
1
+ /* @flow */
2
+
3
+ (function () {
4
+ require('./lib/main').config(
5
+ Object.assign(
6
+ {},
7
+ require('./lib/env-options'),
8
+ require('./lib/cli-options')(process.argv)
9
+ )
10
+ )
11
+ })()
@@ -0,0 +1,13 @@
1
+ /* @flow */
2
+
3
+ const re = /^dotenv_config_(encoding|path|debug)=(.+)$/
4
+
5
+ module.exports = function optionMatcher (args /*: Array<string> */) {
6
+ return args.reduce(function (acc, cur) {
7
+ const matches = cur.match(re)
8
+ if (matches) {
9
+ acc[matches[1]] = matches[2]
10
+ }
11
+ return acc
12
+ }, {})
13
+ }
@@ -0,0 +1,18 @@
1
+ /* @flow */
2
+
3
+ // ../config.js accepts options via environment variables
4
+ const options = {}
5
+
6
+ if (process.env.DOTENV_CONFIG_ENCODING != null) {
7
+ options.encoding = process.env.DOTENV_CONFIG_ENCODING
8
+ }
9
+
10
+ if (process.env.DOTENV_CONFIG_PATH != null) {
11
+ options.path = process.env.DOTENV_CONFIG_PATH
12
+ }
13
+
14
+ if (process.env.DOTENV_CONFIG_DEBUG != null) {
15
+ options.debug = process.env.DOTENV_CONFIG_DEBUG
16
+ }
17
+
18
+ module.exports = options
@@ -0,0 +1,118 @@
1
+ /* @flow */
2
+ /*::
3
+
4
+ type DotenvParseOptions = {
5
+ debug?: boolean
6
+ }
7
+
8
+ // keys and values from src
9
+ type DotenvParseOutput = { [string]: string }
10
+
11
+ type DotenvConfigOptions = {
12
+ path?: string, // path to .env file
13
+ encoding?: string, // encoding of .env file
14
+ debug?: string // turn on logging for debugging purposes
15
+ }
16
+
17
+ type DotenvConfigOutput = {
18
+ parsed?: DotenvParseOutput,
19
+ error?: Error
20
+ }
21
+
22
+ */
23
+
24
+ const fs = require('fs')
25
+ const path = require('path')
26
+ const os = require('os')
27
+
28
+ function log (message /*: string */) {
29
+ console.log(`[dotenv][DEBUG] ${message}`)
30
+ }
31
+
32
+ const NEWLINE = '\n'
33
+ const RE_INI_KEY_VAL = /^\s*([\w.-]+)\s*=\s*(.*)?\s*$/
34
+ const RE_NEWLINES = /\\n/g
35
+ const NEWLINES_MATCH = /\r\n|\n|\r/
36
+
37
+ // Parses src into an Object
38
+ function parse (src /*: string | Buffer */, options /*: ?DotenvParseOptions */) /*: DotenvParseOutput */ {
39
+ const debug = Boolean(options && options.debug)
40
+ const obj = {}
41
+
42
+ // convert Buffers before splitting into lines and processing
43
+ src.toString().split(NEWLINES_MATCH).forEach(function (line, idx) {
44
+ // matching "KEY' and 'VAL' in 'KEY=VAL'
45
+ const keyValueArr = line.match(RE_INI_KEY_VAL)
46
+ // matched?
47
+ if (keyValueArr != null) {
48
+ const key = keyValueArr[1]
49
+ // default undefined or missing values to empty string
50
+ let val = (keyValueArr[2] || '')
51
+ const end = val.length - 1
52
+ const isDoubleQuoted = val[0] === '"' && val[end] === '"'
53
+ const isSingleQuoted = val[0] === "'" && val[end] === "'"
54
+
55
+ // if single or double quoted, remove quotes
56
+ if (isSingleQuoted || isDoubleQuoted) {
57
+ val = val.substring(1, end)
58
+
59
+ // if double quoted, expand newlines
60
+ if (isDoubleQuoted) {
61
+ val = val.replace(RE_NEWLINES, NEWLINE)
62
+ }
63
+ } else {
64
+ // remove surrounding whitespace
65
+ val = val.trim()
66
+ }
67
+
68
+ obj[key] = val
69
+ } else if (debug) {
70
+ log(`did not match key and value when parsing line ${idx + 1}: ${line}`)
71
+ }
72
+ })
73
+
74
+ return obj
75
+ }
76
+
77
+ function resolveHome (envPath) {
78
+ return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath
79
+ }
80
+
81
+ // Populates process.env from .env file
82
+ function config (options /*: ?DotenvConfigOptions */) /*: DotenvConfigOutput */ {
83
+ let dotenvPath = path.resolve(process.cwd(), '.env')
84
+ let encoding /*: string */ = 'utf8'
85
+ let debug = false
86
+
87
+ if (options) {
88
+ if (options.path != null) {
89
+ dotenvPath = resolveHome(options.path)
90
+ }
91
+ if (options.encoding != null) {
92
+ encoding = options.encoding
93
+ }
94
+ if (options.debug != null) {
95
+ debug = true
96
+ }
97
+ }
98
+
99
+ try {
100
+ // specifying an encoding returns a string instead of a buffer
101
+ const parsed = parse(fs.readFileSync(dotenvPath, { encoding }), { debug })
102
+
103
+ Object.keys(parsed).forEach(function (key) {
104
+ if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
105
+ process.env[key] = parsed[key]
106
+ } else if (debug) {
107
+ log(`"${key}" is already defined in \`process.env\` and will not be overwritten`)
108
+ }
109
+ })
110
+
111
+ return { parsed }
112
+ } catch (e) {
113
+ return { error: e }
114
+ }
115
+ }
116
+
117
+ module.exports.config = config
118
+ module.exports.parse = parse
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "dotenv",
3
+ "version": "10.0.0",
4
+ "description": "Loads environment variables from .env file",
5
+ "main": "lib/main.js",
6
+ "exports": {
7
+ ".": "./lib/main.js",
8
+ "./config": "./config.js",
9
+ "./config.js": "./config.js",
10
+ "./package.json": "./package.json"
11
+ },
12
+ "types": "types/index.d.ts",
13
+ "scripts": {
14
+ "flow": "flow",
15
+ "dtslint": "dtslint types",
16
+ "lint": "standard",
17
+ "postlint": "standard-markdown",
18
+ "pretest": "npm run lint && npm run dtslint",
19
+ "test": "tap tests/*.js --100",
20
+ "prerelease": "npm test",
21
+ "release": "standard-version"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git://github.com/motdotla/dotenv.git"
26
+ },
27
+ "keywords": [
28
+ "dotenv",
29
+ "env",
30
+ ".env",
31
+ "environment",
32
+ "variables",
33
+ "config",
34
+ "settings"
35
+ ],
36
+ "readmeFilename": "README.md",
37
+ "license": "BSD-2-Clause",
38
+ "devDependencies": {
39
+ "decache": "^4.5.1",
40
+ "dtslint": "^0.9.8",
41
+ "flow-bin": "^0.109.0",
42
+ "sinon": "^7.5.0",
43
+ "standard": "^13.1.0",
44
+ "standard-markdown": "^5.1.0",
45
+ "standard-version": "^7.0.0",
46
+ "tap": "^14.7.0"
47
+ },
48
+ "dependencies": {},
49
+ "engines": {
50
+ "node": ">=10"
51
+ },
52
+ "standard": {
53
+ "ignore": [
54
+ "flow-typed/"
55
+ ]
56
+ }
57
+ }
@@ -0,0 +1,59 @@
1
+ // TypeScript Version: 3.0
2
+ /// <reference types="node" />
3
+
4
+ export interface DotenvParseOptions {
5
+ /**
6
+ * You may turn on logging to help debug why certain keys or values are not being set as you expect.
7
+ */
8
+ debug?: boolean;
9
+ }
10
+
11
+ export interface DotenvParseOutput {
12
+ [name: string]: string;
13
+ }
14
+
15
+ /**
16
+ * Parses a string or buffer in the .env file format into an object.
17
+ *
18
+ * @param src - contents to be parsed
19
+ * @param options - additional options
20
+ * @returns an object with keys and values based on `src`
21
+ */
22
+ export function parse<T extends DotenvParseOutput = DotenvParseOutput>(
23
+ src: string | Buffer,
24
+ options?: DotenvParseOptions
25
+ ): T;
26
+
27
+ export interface DotenvConfigOptions {
28
+ /**
29
+ * You may specify a custom path if your file containing environment variables is located elsewhere.
30
+ */
31
+ path?: string;
32
+
33
+ /**
34
+ * You may specify the encoding of your file containing environment variables.
35
+ */
36
+ encoding?: string;
37
+
38
+ /**
39
+ * You may turn on logging to help debug why certain keys or values are not being set as you expect.
40
+ */
41
+ debug?: boolean;
42
+ }
43
+
44
+ export interface DotenvConfigOutput {
45
+ error?: Error;
46
+ parsed?: DotenvParseOutput;
47
+ }
48
+
49
+ /**
50
+ * Loads `.env` file contents into {@link https://nodejs.org/api/process.html#process_process_env `process.env`}.
51
+ * Example: 'KEY=value' becomes { parsed: { KEY: 'value' } }
52
+ *
53
+ * @param options - controls behavior
54
+ * @returns an object with a `parsed` key if successful or `error` key if an error occurred
55
+ *
56
+ */
57
+ export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
58
+ /** @deprecated since v7.0.0 Use config instead. */
59
+ export const load: typeof config;
@@ -0,0 +1,19 @@
1
+ import { config, parse } from "dotenv";
2
+
3
+ const env = config();
4
+ const dbUrl: string | null =
5
+ env.error || !env.parsed ? null : env.parsed["BASIC"];
6
+
7
+ config({
8
+ path: ".env-example",
9
+ encoding: "utf8",
10
+ debug: true
11
+ });
12
+
13
+ const parsed = parse("NODE_ENV=production\nDB_HOST=a.b.c");
14
+ const dbHost: string = parsed["DB_HOST"];
15
+
16
+ const parsedFromBuffer = parse(new Buffer("JUSTICE=league\n"), {
17
+ debug: true
18
+ });
19
+ const justice: string = parsedFromBuffer["JUSTICE"];
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "strictFunctionTypes": true,
9
+ "noEmit": true,
10
+ "baseUrl": ".",
11
+ "paths": {
12
+ "dotenv": ["."]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "strict-export-declare-modifiers": false
5
+ }
6
+ }
@@ -63,12 +63,8 @@ function RedirectableRequest(options, responseCallback) {
63
63
  RedirectableRequest.prototype = Object.create(Writable.prototype);
64
64
 
65
65
  RedirectableRequest.prototype.abort = function () {
66
- // Abort the internal request
67
66
  abortRequest(this._currentRequest);
68
-
69
- // Abort this request
70
67
  this.emit("abort");
71
- this.removeAllListeners();
72
68
  };
73
69
 
74
70
  // Writes buffered data to the current native request
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "follow-redirects",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "HTTP and HTTPS modules that follow redirects.",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -8,14 +8,14 @@
8
8
  "version": "1.0.0",
9
9
  "license": "ISC",
10
10
  "dependencies": {
11
- "authing-js-sdk": "^4.18.8",
11
+ "authing-js-sdk": "^4.20.7",
12
12
  "axios": ">=0.21.1"
13
13
  }
14
14
  },
15
15
  "node_modules/authing-js-sdk": {
16
- "version": "4.18.8",
17
- "resolved": "https://registry.npmjs.org/authing-js-sdk/-/authing-js-sdk-4.18.8.tgz",
18
- "integrity": "sha512-AXnTr+k9mdoB2R5tsXP7y9BW8B0fzyZND0sHCyVVdjyb2BEqfVJcBR12POGYe2+bPtN/ViOFxdDMj8V02L25pA==",
16
+ "version": "4.20.7",
17
+ "resolved": "https://registry.npmjs.org/authing-js-sdk/-/authing-js-sdk-4.20.7.tgz",
18
+ "integrity": "sha512-T8rzTgSndkvHZXu+xFkyX63AVAlEvbNv93zmhJlXgM7hgX9QHq6k6CQ3yvgeN8IC9xnv4N75UVgvROxGeWsZpw==",
19
19
  "dependencies": {
20
20
  "axios": "^0.19.2",
21
21
  "crypto-js": "^4.0.0",
@@ -104,9 +104,9 @@
104
104
  },
105
105
  "dependencies": {
106
106
  "authing-js-sdk": {
107
- "version": "4.18.8",
108
- "resolved": "https://registry.npmjs.org/authing-js-sdk/-/authing-js-sdk-4.18.8.tgz",
109
- "integrity": "sha512-AXnTr+k9mdoB2R5tsXP7y9BW8B0fzyZND0sHCyVVdjyb2BEqfVJcBR12POGYe2+bPtN/ViOFxdDMj8V02L25pA==",
107
+ "version": "4.20.7",
108
+ "resolved": "https://registry.npmjs.org/authing-js-sdk/-/authing-js-sdk-4.20.7.tgz",
109
+ "integrity": "sha512-T8rzTgSndkvHZXu+xFkyX63AVAlEvbNv93zmhJlXgM7hgX9QHq6k6CQ3yvgeN8IC9xnv4N75UVgvROxGeWsZpw==",
110
110
  "requires": {
111
111
  "axios": "^0.19.2",
112
112
  "crypto-js": "^4.0.0",
@@ -9,7 +9,8 @@
9
9
  "author": "",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "authing-js-sdk": "^4.18.8",
13
- "axios": ">=0.21.1"
12
+ "authing-js-sdk": "^4.20.7",
13
+ "axios": ">=0.21.1",
14
+ "dotenv": "^10.0.0"
14
15
  }
15
16
  }
@@ -0,0 +1,71 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ authing-js-sdk@^4.20.7:
6
+ version "4.20.7"
7
+ resolved "https://registry.npmjs.org/authing-js-sdk/-/authing-js-sdk-4.20.7.tgz#16783c534fa8c9dadb8e523aced0a730e0ed262e"
8
+ integrity sha512-T8rzTgSndkvHZXu+xFkyX63AVAlEvbNv93zmhJlXgM7hgX9QHq6k6CQ3yvgeN8IC9xnv4N75UVgvROxGeWsZpw==
9
+ dependencies:
10
+ axios "^0.19.2"
11
+ crypto-js "^4.0.0"
12
+ jsencrypt "^3.1.0"
13
+ jwt-decode "^2.2.0"
14
+
15
+ axios@>=0.21.1:
16
+ version "0.21.1"
17
+ resolved "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8"
18
+ integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==
19
+ dependencies:
20
+ follow-redirects "^1.10.0"
21
+
22
+ axios@^0.19.2:
23
+ version "0.19.2"
24
+ resolved "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
25
+ integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
26
+ dependencies:
27
+ follow-redirects "1.5.10"
28
+
29
+ crypto-js@^4.0.0:
30
+ version "4.0.0"
31
+ resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz#2904ab2677a9d042856a2ea2ef80de92e4a36dcc"
32
+ integrity sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==
33
+
34
+ debug@=3.1.0:
35
+ version "3.1.0"
36
+ resolved "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
37
+ integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
38
+ dependencies:
39
+ ms "2.0.0"
40
+
41
+ dotenv@^10.0.0:
42
+ version "10.0.0"
43
+ resolved "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
44
+ integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
45
+
46
+ follow-redirects@1.5.10:
47
+ version "1.5.10"
48
+ resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
49
+ integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
50
+ dependencies:
51
+ debug "=3.1.0"
52
+
53
+ follow-redirects@^1.10.0:
54
+ version "1.14.1"
55
+ resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43"
56
+ integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==
57
+
58
+ jsencrypt@^3.1.0:
59
+ version "3.2.0"
60
+ resolved "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.2.0.tgz#09242aabf1984165dcd7698fe6ed163be77c05f8"
61
+ integrity sha512-Y/WBrCYRP1A2I1OEXxqurO+W3AC5uXhiArprpYQ0Y8/1Dc3NaiINAyCLx7HzXGwN7xvW3s5xpeOTdwD7lD1SQQ==
62
+
63
+ jwt-decode@^2.2.0:
64
+ version "2.2.0"
65
+ resolved "https://registry.npmjs.org/jwt-decode/-/jwt-decode-2.2.0.tgz#7d86bd56679f58ce6a84704a657dd392bba81a79"
66
+ integrity sha1-fYa9VmefWM5qhHBKZX3TkruoGnk=
67
+
68
+ ms@2.0.0:
69
+ version "2.0.0"
70
+ resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
71
+ integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=