neon 2.1.2 → 2.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/LICENSE.md +178 -0
  2. package/README.md +601 -0
  3. package/dist/analytics.js +156 -0
  4. package/dist/api.js +665 -0
  5. package/dist/auth.js +127 -0
  6. package/dist/callback.html +51 -0
  7. package/dist/cli.js +9 -0
  8. package/dist/commands/auth.js +214 -0
  9. package/dist/commands/bootstrap.js +481 -0
  10. package/dist/commands/branches.js +481 -0
  11. package/dist/commands/bucket.js +543 -0
  12. package/dist/commands/checkout.js +289 -0
  13. package/dist/commands/config.js +544 -0
  14. package/dist/commands/connection_string.js +172 -0
  15. package/dist/commands/data_api.js +285 -0
  16. package/dist/commands/databases.js +82 -0
  17. package/dist/commands/deploy.js +26 -0
  18. package/dist/commands/dev.js +698 -0
  19. package/dist/commands/env.js +166 -0
  20. package/dist/commands/functions.js +373 -0
  21. package/dist/commands/index.js +54 -0
  22. package/dist/commands/init.js +73 -0
  23. package/dist/commands/ip_allow.js +137 -0
  24. package/dist/commands/link.js +1121 -0
  25. package/dist/commands/neon_auth.js +1028 -0
  26. package/dist/commands/operations.js +28 -0
  27. package/dist/commands/orgs.js +24 -0
  28. package/dist/commands/projects.js +372 -0
  29. package/dist/commands/psql.js +62 -0
  30. package/dist/commands/roles.js +65 -0
  31. package/dist/commands/schema_diff.js +151 -0
  32. package/dist/commands/set_context.js +29 -0
  33. package/dist/commands/status.js +40 -0
  34. package/dist/commands/user.js +15 -0
  35. package/dist/commands/vpc_endpoints.js +134 -0
  36. package/dist/config.js +11 -0
  37. package/dist/config_format.js +72 -0
  38. package/dist/context.js +177 -0
  39. package/dist/current_branch_fast_path.js +55 -0
  40. package/dist/dev/env.js +240 -0
  41. package/dist/dev/functions.js +70 -0
  42. package/dist/dev/inputs.js +63 -0
  43. package/dist/dev/runtime.js +146 -0
  44. package/dist/env.js +36 -0
  45. package/dist/env_file.js +159 -0
  46. package/dist/errors.js +80 -0
  47. package/dist/functions_api.js +44 -0
  48. package/dist/help.js +146 -0
  49. package/dist/index.js +234 -0
  50. package/dist/log.js +18 -0
  51. package/dist/parameters.gen.js +480 -0
  52. package/dist/pkg.js +25 -0
  53. package/dist/psql/cli.js +53 -0
  54. package/dist/psql/command/cmd_cond.js +437 -0
  55. package/dist/psql/command/cmd_connect.js +820 -0
  56. package/dist/psql/command/cmd_copy.js +1035 -0
  57. package/dist/psql/command/cmd_describe.js +1815 -0
  58. package/dist/psql/command/cmd_format.js +922 -0
  59. package/dist/psql/command/cmd_io.js +2193 -0
  60. package/dist/psql/command/cmd_lo.js +393 -0
  61. package/dist/psql/command/cmd_meta.js +970 -0
  62. package/dist/psql/command/cmd_misc.js +187 -0
  63. package/dist/psql/command/cmd_pipeline.js +1148 -0
  64. package/dist/psql/command/cmd_restrict.js +171 -0
  65. package/dist/psql/command/cmd_show.js +766 -0
  66. package/dist/psql/command/dispatch.js +343 -0
  67. package/dist/psql/command/inputQueue.js +42 -0
  68. package/dist/psql/command/shared.js +71 -0
  69. package/dist/psql/complete/filenames.js +139 -0
  70. package/dist/psql/complete/index.js +104 -0
  71. package/dist/psql/complete/matcher.js +315 -0
  72. package/dist/psql/complete/psqlVars.js +247 -0
  73. package/dist/psql/complete/queries.js +493 -0
  74. package/dist/psql/complete/rules.js +2424 -0
  75. package/dist/psql/core/common.js +1253 -0
  76. package/dist/psql/core/help.js +576 -0
  77. package/dist/psql/core/mainloop.js +1360 -0
  78. package/dist/psql/core/prompt.js +440 -0
  79. package/dist/psql/core/settings.js +684 -0
  80. package/dist/psql/core/sqlHelp.js +1066 -0
  81. package/dist/psql/core/startup.js +846 -0
  82. package/dist/psql/core/syncVars.js +116 -0
  83. package/dist/psql/core/variables.js +287 -0
  84. package/dist/psql/describe/formatters.js +1290 -0
  85. package/dist/psql/describe/processNamePattern.js +270 -0
  86. package/dist/psql/describe/queries.js +2378 -0
  87. package/dist/psql/describe/versionGate.js +43 -0
  88. package/dist/psql/index.js +2030 -0
  89. package/dist/psql/io/history.js +299 -0
  90. package/dist/psql/io/input.js +120 -0
  91. package/dist/psql/io/lineEditor/buffer.js +325 -0
  92. package/dist/psql/io/lineEditor/complete.js +227 -0
  93. package/dist/psql/io/lineEditor/filename.js +159 -0
  94. package/dist/psql/io/lineEditor/index.js +894 -0
  95. package/dist/psql/io/lineEditor/keymap.js +745 -0
  96. package/dist/psql/io/lineEditor/vt100.js +363 -0
  97. package/dist/psql/io/pgpass.js +202 -0
  98. package/dist/psql/io/pgservice.js +194 -0
  99. package/dist/psql/io/psqlrc.js +422 -0
  100. package/dist/psql/print/aligned.js +1765 -0
  101. package/dist/psql/print/asciidoc.js +248 -0
  102. package/dist/psql/print/crosstab.js +463 -0
  103. package/dist/psql/print/csv.js +95 -0
  104. package/dist/psql/print/html.js +258 -0
  105. package/dist/psql/print/json.js +96 -0
  106. package/dist/psql/print/latex.js +396 -0
  107. package/dist/psql/print/pager.js +267 -0
  108. package/dist/psql/print/troff.js +258 -0
  109. package/dist/psql/print/unaligned.js +119 -0
  110. package/dist/psql/print/units.js +135 -0
  111. package/dist/psql/scanner/slash.js +515 -0
  112. package/dist/psql/scanner/sql.js +914 -0
  113. package/dist/psql/scanner/stringutils.js +394 -0
  114. package/dist/psql/types/backslash.js +1 -0
  115. package/dist/psql/types/connection.js +1 -0
  116. package/dist/psql/types/index.js +7 -0
  117. package/dist/psql/types/printer.js +1 -0
  118. package/dist/psql/types/repl.js +1 -0
  119. package/dist/psql/types/scanner.js +24 -0
  120. package/dist/psql/types/settings.js +1 -0
  121. package/dist/psql/types/variables.js +1 -0
  122. package/dist/psql/wire/connection.js +2858 -0
  123. package/dist/psql/wire/copy.js +108 -0
  124. package/dist/psql/wire/notify.js +59 -0
  125. package/dist/psql/wire/pipeline.js +521 -0
  126. package/dist/psql/wire/protocol.js +466 -0
  127. package/dist/psql/wire/sasl.js +296 -0
  128. package/dist/psql/wire/tls.js +602 -0
  129. package/dist/storage_api.js +147 -0
  130. package/dist/test_utils/fixtures.js +122 -0
  131. package/dist/test_utils/oauth_server.js +9 -0
  132. package/dist/types.js +1 -0
  133. package/dist/utils/api_enums.js +33 -0
  134. package/dist/utils/auth.js +5 -0
  135. package/dist/utils/branch_notice.js +22 -0
  136. package/dist/utils/branch_picker.js +103 -0
  137. package/dist/utils/compute_units.js +28 -0
  138. package/dist/utils/enrichers.js +161 -0
  139. package/dist/utils/esbuild.js +158 -0
  140. package/dist/utils/formats.js +18 -0
  141. package/dist/utils/middlewares.js +20 -0
  142. package/dist/utils/package_manager.js +68 -0
  143. package/dist/utils/point_in_time.js +56 -0
  144. package/dist/utils/psql.js +120 -0
  145. package/dist/utils/string.js +5 -0
  146. package/dist/utils/ui.js +59 -0
  147. package/dist/utils/zip.js +4 -0
  148. package/dist/writer.js +97 -0
  149. package/package.json +117 -14
  150. package/.jshintrc +0 -3
  151. package/CHANGELOG.markdown +0 -22
  152. package/LICENSE +0 -21
  153. package/README.markdown +0 -76
  154. package/bower.json +0 -23
  155. package/license.txt +0 -9
  156. package/neon.js +0 -234
  157. package/stdlib/bubbling_support.js +0 -32
  158. package/stdlib/custom_event.js +0 -54
  159. package/stdlib/custom_event_support.js +0 -195
  160. package/stdlib/index.js +0 -7
  161. package/stdlib/node_support.js +0 -123
  162. package/stdlib/widget.js +0 -340
  163. package/test/neon_browser.html +0 -11
  164. package/test/neon_stdlib_browser.html +0 -15
  165. package/test/neon_stdlib_test.js +0 -84
  166. package/test/neon_test.js +0 -64
package/package.json CHANGED
@@ -1,19 +1,122 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "2.1.2",
4
- "description": "Javascript DSL for Classical Inheritance",
5
- "main": "./neon",
6
- "directories": {
7
- "lib": "./lib"
8
- },
3
+ "version": "2.29.1",
4
+ "description": "CLI tool for Neon Serverless Postgres",
5
+ "keywords": [
6
+ "neon",
7
+ "neonctl",
8
+ "cli",
9
+ "postgres",
10
+ "database",
11
+ "serverless"
12
+ ],
9
13
  "repository": {
10
14
  "type": "git",
11
- "url": "https://github.com/azendal/neon.git"
15
+ "url": "git+https://github.com/neondatabase/neon-pkgs.git"
12
16
  },
13
- "keywords": [
14
- "class",
15
- "prototype",
16
- "inheritance",
17
- "oop"
18
- ]
19
- }
17
+ "license": "Apache-2.0",
18
+ "author": {
19
+ "name": "Neon",
20
+ "url": "https://neon.com"
21
+ },
22
+ "type": "module",
23
+ "main": "dist/index.js",
24
+ "bin": {
25
+ "neonctl": "dist/cli.js",
26
+ "neon": "dist/cli.js"
27
+ },
28
+ "files": [
29
+ "README.md",
30
+ "dist/",
31
+ "package.json"
32
+ ],
33
+ "engines": {
34
+ "node": ">=22"
35
+ },
36
+ "dependencies": {
37
+ "@hono/node-server": "2.0.4",
38
+ "@segment/analytics-node": "1.3.0",
39
+ "chalk": "5.3.0",
40
+ "chokidar": "5.0.0",
41
+ "cli-table": "0.3.11",
42
+ "cliui": "8.0.1",
43
+ "diff": "5.2.0",
44
+ "fflate": "^0.8.3",
45
+ "neon-init": "0.19.0",
46
+ "open": "10.1.0",
47
+ "openid-client": "6.8.1",
48
+ "pg-protocol": "^1.14.0",
49
+ "prompts": "2.4.2",
50
+ "undici": "^8.5.0",
51
+ "which": "3.0.1",
52
+ "yaml": "2.4.5",
53
+ "yargs": "17.7.2",
54
+ "@neon/config": "0.8.1",
55
+ "@neon/config-runtime": "0.8.1",
56
+ "@neon/env": "0.9.0",
57
+ "@neon/sdk": "0.1.0"
58
+ },
59
+ "optionalDependencies": {
60
+ "esbuild": "0.28.0"
61
+ },
62
+ "devDependencies": {
63
+ "@apidevtools/swagger-parser": "12.1.0",
64
+ "@eslint/js": "9.29.0",
65
+ "@rollup/plugin-commonjs": "25.0.8",
66
+ "@rollup/plugin-json": "6.1.0",
67
+ "@rollup/plugin-node-resolve": "15.2.3",
68
+ "@testcontainers/postgresql": "^11.14.0",
69
+ "@types/cli-table": "0.3.4",
70
+ "@types/diff": "5.2.1",
71
+ "@types/eslint__js": "8.42.3",
72
+ "@types/express": "4.17.21",
73
+ "@types/node": "18.19.41",
74
+ "@types/prompts": "2.4.9",
75
+ "@types/which": "3.0.4",
76
+ "@types/yargs": "17.0.32",
77
+ "@vitest/coverage-v8": "1.6.1",
78
+ "@yao-pkg/pkg": "6.10.0",
79
+ "emocks": "3.0.4",
80
+ "eslint": "9.29.0",
81
+ "express": "4.19.2",
82
+ "node-pty": "1.1.0",
83
+ "oauth2-mock-server": "8.1.0",
84
+ "openapi-types": "12.1.3",
85
+ "rollup": "3.29.4",
86
+ "strip-ansi": "7.1.0",
87
+ "tsx": "4.22.3",
88
+ "typescript": "5.8.3",
89
+ "typescript-eslint": "8.28.0",
90
+ "vitest": "1.6.1"
91
+ },
92
+ "publishConfig": {
93
+ "access": "public",
94
+ "provenance": false
95
+ },
96
+ "pkg": {
97
+ "assets": [
98
+ "callback.html"
99
+ ],
100
+ "scripts": [
101
+ "bundle/*.js"
102
+ ],
103
+ "targets": [
104
+ "node22-linux-x64",
105
+ "node22-macos-x64",
106
+ "node22-win-x64",
107
+ "node22-linux-arm64"
108
+ ]
109
+ },
110
+ "scripts": {
111
+ "generateParams": "tsx generateOptionsFromSpec.ts",
112
+ "clean": "rm -rf dist",
113
+ "build": "pnpm generateParams && pnpm clean && tsc -p tsconfig.build.json && cp src/*.html ./dist",
114
+ "bundle": "node pkg.js",
115
+ "typecheck": "tsc --noEmit",
116
+ "lint": "pnpm typecheck && eslint src",
117
+ "lint:fix": "pnpm typecheck && eslint src --fix",
118
+ "test": "pnpm build && vitest run",
119
+ "test:ci": "pnpm build && vitest run",
120
+ "test:conformance": "vitest run --config tests/psql-conformance/vitest.config.ts"
121
+ }
122
+ }
package/.jshintrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "laxbreak": false
3
- }
@@ -1,22 +0,0 @@
1
- 2.0.0 (2014-02-15)
2
-
3
- - Requiring now adds Class, Module, Interface to global scope (neon)
4
- - You can now require the stdlib with require('neon/stdlib')
5
- - Requiring now adds CustomEvent, CustomEventSupport, NodeSupport
6
- and BubblingSupport to the global scope (stdlib)
7
- - Major version bump because it's not compatible with 1.x (The other
8
- was loaded in a namespace)
9
-
10
- 1.1.0 (2014-01-29)
11
-
12
- - Added stdlib, consisting on:
13
- - NodeSupport
14
- - CustomEvent and CustomEventSupport
15
- - BubblingSupport
16
- - Added tests for stdlib
17
- - Moved files to /lib
18
-
19
- 1.0.0 (2012-06-23)
20
-
21
- - Cleaned up and packed Neon library, used already in production.
22
- Added usage files, improved documentation.
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Freshout.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
package/README.markdown DELETED
@@ -1,76 +0,0 @@
1
- # Neon
2
-
3
- ## JavaScript DSL for Classical Inheritance
4
-
5
- This files provides a DSL for the following design patterns:
6
-
7
- * inheritance
8
- * interface
9
- * module
10
-
11
- Neon packs a DSL for Class creation, that helps in making programs following an object oriented design.
12
-
13
- The philosophy is that it should not try to emulate other languages, so it preserves the JavaScript good parts,
14
- but with a nicer syntax to create classes that ensure interfaces and include reusable functionality as modules.
15
-
16
- ## Why another Class System?
17
-
18
- As the web applications are getting more complex these times, backend and frontend engineers work has fusioned, and they need to be able to establish a common language. It was created for people coming from OOP languages like Ruby to Javascript.
19
-
20
- ### Usage
21
-
22
- Interface('Editable')({
23
- constructor : ['x'],
24
- prototype : ['x']
25
- });
26
-
27
- Module('Composition')({
28
- y : 5,
29
- prototype : {
30
- z : 3
31
- }
32
- });
33
-
34
- Module('Other')({
35
- a : 5,
36
- prototype : {
37
- b : 3
38
- }
39
- });
40
-
41
- Class('Overlay').inherits(Widget).ensures(Editable).includes(Composition, Other)({
42
- html : '<div></div>',
43
- prototype : {
44
- init : function (element){
45
- if(!element){
46
- element = document.createElement('div');
47
- element.innerHTML = 'hello';
48
- document.body.appendChild(element);
49
- }
50
- },
51
- b : 5
52
- }
53
- });
54
-
55
- ## License
56
-
57
- Copyright (c) 2009 Fernando Trasviña
58
-
59
- Permission is hereby granted, free of charge, to any person obtaining
60
- a copy of this software and associated documentation files (the
61
- "Software"), to deal in the Software without restriction, including
62
- without limitation the rights to use, copy, modify, merge, publish,
63
- distribute, sublicense, and/or sell copies of the Software, and to
64
- permit persons to whom the Software is furnished to do so, subject to
65
- the following conditions:
66
-
67
- The above copyright notice and this permission notice shall be
68
- included in all copies or substantial portions of the Software.
69
-
70
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
71
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
72
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
73
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
74
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
75
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
76
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/bower.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "name": "neon",
3
- "main": "neon.js",
4
- "version": "2.0.0",
5
- "homepage": "https://github.com/azendal/neon",
6
- "authors": [
7
- "Fernando Trasviña <fernando@freshout.us>"
8
- ],
9
- "description": "JavaScript DSL for Classical Inheritance",
10
- "keywords": [
11
- "DSL",
12
- "class",
13
- "inheritance"
14
- ],
15
- "license": "MIT",
16
- "ignore": [
17
- "**/.*",
18
- "node_modules",
19
- "bower_components",
20
- "test",
21
- "tests"
22
- ]
23
- }
package/license.txt DELETED
@@ -1,9 +0,0 @@
1
- The MIT License
2
-
3
- Copyright 2009-2017 Fernando Trasvina
4
-
5
- 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:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- 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.
package/neon.js DELETED
@@ -1,234 +0,0 @@
1
-
2
- if (typeof global === "undefined") {
3
- global = window;
4
- }
5
-
6
- global.Interface = function Interface(nameOrNameSpace, name) {
7
- var nameSpace, interfaceName, factory;
8
- nameSpace = (nameOrNameSpace && name) ? nameOrNameSpace : this;
9
- interfaceName = (nameOrNameSpace && name) ? name :
10
- (nameOrNameSpace) ? nameOrNameSpace : 'interface' + Math.random().toString();
11
- factory = function(definition) {
12
- definition.isInterface = true;
13
- definition.name = interfaceName;
14
- nameSpace[interfaceName] = definition;
15
- return nameSpace[interfaceName];
16
- };
17
- return factory;
18
- };
19
-
20
- global.Module = function Module(nameOrNameSpace, name) {
21
- var nameSpace, moduleName, factory, newModule;
22
-
23
- nameSpace = (nameOrNameSpace && name) ? nameOrNameSpace : this;
24
- moduleName = (nameOrNameSpace && name) ? name :
25
- (nameOrNameSpace) ? nameOrNameSpace : 'module' + Math.random().toString();
26
-
27
- newModule = {
28
- moduleName : moduleName,
29
- prototype : {},
30
- __includedModules : [],
31
- include : function(module) {
32
- var property;
33
- for (property in module) {
34
- if (module.hasOwnProperty(property)
35
- && property !== 'prototype'
36
- && property !== 'isModule'
37
- && property !== '__includedModules'
38
- && property !== 'include'
39
- && property !== 'moduleName') {
40
- newModule[property] = module[property];
41
- }
42
- }
43
-
44
- if (module.hasOwnProperty('prototype') && module.prototype) {
45
- for (property in module.prototype) {
46
- if (module.prototype.hasOwnProperty(property)) {
47
- newModule.prototype[property] = module.prototype[property];
48
- }
49
- }
50
- }
51
- else {
52
- module.prototype = {};
53
- }
54
-
55
- this.__includedModules.push(module);
56
-
57
- return this;
58
- }
59
- };
60
-
61
- factory = function(definition){
62
- var property;
63
-
64
- newModule.isModule = true;
65
-
66
- for (property in definition) {
67
- if (definition.hasOwnProperty(property)
68
- && property !== 'prototype'
69
- && property !== 'isModule'
70
- && property !== '__includedModules'
71
- && property !== 'include'
72
- && property !== 'moduleName') {
73
- newModule[property] = definition[property];
74
- }
75
- }
76
-
77
- if (definition.hasOwnProperty('prototype') && definition.prototype) {
78
- for (property in definition.prototype) {
79
- if (definition.prototype.hasOwnProperty(property)) {
80
- newModule.prototype[property] = definition.prototype[property];
81
- }
82
- }
83
- }
84
-
85
- nameSpace[moduleName] = newModule;
86
-
87
- return nameSpace[moduleName];
88
- };
89
-
90
- factory.includes = function () {
91
- for(var i = 0; i < arguments.length; i++){
92
- newModule.include(arguments[i]);
93
- }
94
- return factory;
95
- };
96
-
97
- return factory;
98
- };
99
-
100
- global.Class = function Class(classNameOrNameSpace, className) {
101
- var nameSpace, newClass, classFactory;
102
- nameSpace = (classNameOrNameSpace && className) ? classNameOrNameSpace : global;
103
- className = (classNameOrNameSpace && className) ? className :
104
- (classNameOrNameSpace) ? classNameOrNameSpace : 'class' + Math.random().toString();
105
-
106
- newClass = function() {
107
- if (this.init) {
108
- this.init.apply(this, arguments);
109
- }
110
- };
111
-
112
- newClass.__descendants = [];
113
- newClass.__implementedInterfaces = [];
114
- newClass.__includedModules = [];
115
- newClass.className = className;
116
- newClass.include = function(module) {
117
- var property;
118
- for (property in module) {
119
- if (module.hasOwnProperty(property)
120
- && property != 'prototype'
121
- && property != 'constructor'
122
- && property != 'isModule'
123
- && property != 'superClass'
124
- && property != 'include') {
125
- newClass[property] = module[property];
126
- }
127
- }
128
-
129
- if (module.hasOwnProperty('prototype') && module.prototype) {
130
- for (property in module.prototype) {
131
- if (module.prototype.hasOwnProperty(property)) {
132
- newClass.prototype[property] = module.prototype[property];
133
- }
134
- }
135
- } else {
136
- module.prototype = {};
137
- }
138
-
139
- newClass.__includedModules.push(module);
140
- return this;
141
- };
142
-
143
- classFactory = function(classDefinition) {
144
- var i, il, j, jl, property, classPrototype = classDefinition.prototype;
145
- if (classPrototype) {
146
- for (property in classPrototype) {
147
- if (classPrototype.hasOwnProperty(property)) {
148
- newClass.prototype[property] = classPrototype[property];
149
- }
150
- }
151
- delete classDefinition.prototype;
152
- }
153
- for (property in classDefinition) {
154
- if (classDefinition.hasOwnProperty(property)) {
155
- newClass[property] = classDefinition[property];
156
- }
157
- }
158
-
159
- for (i = 0, il = newClass.__implementedInterfaces.length; i < il; i++) {
160
- for (j = 0, jl = newClass.__implementedInterfaces[i].constructor.length; j < jl; j++) {
161
- if (!newClass[ newClass.__implementedInterfaces[i].constructor[j] ]) {
162
- console.log('must implement static ' + newClass.__implementedInterfaces[i].name);
163
- break;
164
- }
165
- }
166
-
167
- if (newClass.__implementedInterfaces[i].hasOwnProperty('prototype')
168
- && newClass.__implementedInterfaces[i].prototype) {
169
- for (j = 0, jl = newClass.__implementedInterfaces[i].prototype.length; j < jl; j++) {
170
- if (!newClass.prototype[newClass.__implementedInterfaces[i].prototype[j]]) {
171
- console.log('must implement prototype ' + newClass.__implementedInterfaces[i].name);
172
- break;
173
- }
174
- }
175
- }
176
- }
177
-
178
- try {
179
- if (Li && Li.ObjectSpy && Li.Spy) {
180
- newClass.__objectSpy = new Li.ObjectSpy();
181
- newClass.__objectSpy.spy(newClass);
182
- newClass.__objectSpy.spy(newClass.prototype);
183
- }
184
- } catch (error) {}
185
-
186
- nameSpace[className] = newClass;
187
- return newClass;
188
- };
189
-
190
- classFactory.inherits = function(superClass) {
191
- var i, inheritedClass;
192
- newClass.superClass = superClass;
193
- if (superClass.hasOwnProperty('__descendants')) {
194
- superClass.__descendants.push(newClass);
195
- }
196
- inheritedClass = function() {
197
- };
198
- inheritedClass.prototype = superClass.prototype;
199
- newClass.prototype = new inheritedClass();
200
- newClass.prototype.constructor = newClass;
201
-
202
- for (i in superClass) {
203
- if (superClass.hasOwnProperty(i)
204
- && i != 'prototype'
205
- && i !== 'className'
206
- && i !== 'superClass'
207
- && i !== 'include'
208
- && i != '__descendants') {
209
- newClass[i] = superClass[i];
210
- }
211
- }
212
-
213
- delete this.inherits;
214
- return this;
215
- };
216
-
217
- classFactory.ensures = function(interfaces) {
218
- for (var i = 0; i < arguments.length; i++) {
219
- newClass.__implementedInterfaces.push(arguments[i]);
220
- }
221
- delete this.ensures;
222
- return classFactory;
223
- };
224
-
225
- classFactory.includes = function() {
226
- for (var i = 0; i < arguments.length; i++) {
227
- newClass.include(arguments[i]);
228
- }
229
- return classFactory;
230
- };
231
-
232
- return classFactory;
233
-
234
- };
@@ -1,32 +0,0 @@
1
- Module('BubblingSupport')({
2
- dispatch : function (type, data) {
3
- data = data || {};
4
- var event = NeCustomEventSupport.prototype.dispatch.call(this, type, data);
5
- if (event.isPropagationStopped === false) {
6
- if (this.parent && this.parent.dispatch) {
7
- data.target = event.target;
8
- data.currentTarget = this.parent;
9
- this.parent.dispatch(event.type, data);
10
- }
11
- }
12
- return event;
13
- },
14
-
15
- prototype : {
16
- dispatch : function (type, data) {
17
- data = data || {};
18
-
19
- var event = NeCustomEventSupport.prototype.dispatch.call(this, type, data);
20
-
21
- if (event.isPropagationStopped === false && event.bubbles === true) {
22
- if (this.parent && this.parent.dispatch) {
23
- data.target = event.target;
24
- data.currentTarget = this.parent;
25
- this.parent.dispatch(event.type, data);
26
- }
27
- }
28
-
29
- return event;
30
- }
31
- }
32
- });
@@ -1,54 +0,0 @@
1
- /**
2
- * @deprecated CustomEvent is deprecated and will be removed on February 1st, 2026. Use NeCustomEvent instead.
3
- */
4
- Class('NeCustomEvent')({
5
- prototype : {
6
- bubbles : true,
7
- cancelable : true,
8
- currentTarget : null,
9
- timeStamp : 0,
10
- target : null,
11
- type : '',
12
- isPropagationStopped : false,
13
- isDefaultPrevented : false,
14
- isImmediatePropagationStopped : false,
15
- areImmediateHandlersPrevented : false,
16
- init : function init(type, data) {
17
- this.type = type;
18
- if (typeof data !== 'undefined') {
19
- for(var property in data) {
20
- if (data.hasOwnProperty(property)) {
21
- this[property] = data[property];
22
- }
23
- }
24
- }
25
- },
26
- stopPropagation : function stopPropagation() {
27
- this.isPropagationStopped = true;
28
- },
29
- preventDefault : function preventDefault() {
30
- this.isDefaultPrevented = true;
31
- },
32
- stopImmediatePropagation : function stopImmediatePropagation() {
33
- this.preventImmediateHandlers();
34
- this.stopPropagation();
35
- },
36
- preventImmediateHandlers : function preventImmediateHandlers() {
37
- this.areImmediateHandlersPrevented = true;
38
- }
39
- }
40
-
41
- });
42
-
43
- if (typeof window !== 'undefined') {
44
- window.CustomEvent = new Proxy(NeCustomEvent, {
45
- construct(target, args) {
46
- console.warn('DEPRECATION NOTICE: CustomEvent is deprecated and will be removed on February 1st, 2026. Use NeCustomEvent instead.');
47
- return new target(...args);
48
- },
49
- get(target, prop, receiver) {
50
- console.warn('DEPRECATION NOTICE: CustomEvent is deprecated and will be removed on February 1st, 2026. Use NeCustomEvent instead.');
51
- return Reflect.get(target, prop, receiver);
52
- }
53
- });
54
- }