@devkong/cli-nx 0.0.17-0 → 0.0.18-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 (26) hide show
  1. package/package.json +2 -2
  2. package/README.md +0 -11
  3. package/generators.json +0 -10
  4. package/src/generators/preset/files/python/.dockerignore +0 -5
  5. package/src/generators/preset/files/python/.editorconfig +0 -16
  6. package/src/generators/preset/files/python/.gitattributes +0 -25
  7. package/src/generators/preset/files/python/.gitignore.template +0 -69
  8. package/src/generators/preset/files/python/.idea/inspectionProfiles/Project_Default.xml +0 -7
  9. package/src/generators/preset/files/python/.idea/inspectionProfiles/profiles_settings.xml +0 -6
  10. package/src/generators/preset/files/python/.idea/kong-cli-python-template.iml +0 -10
  11. package/src/generators/preset/files/python/.pylintrc +0 -547
  12. package/src/generators/preset/files/python/.vscode/extensions.json +0 -14
  13. package/src/generators/preset/files/python/.vscode/launch.json +0 -18
  14. package/src/generators/preset/files/python/.vscode/settings.json +0 -62
  15. package/src/generators/preset/files/python/Dockerfile +0 -13
  16. package/src/generators/preset/files/python/README.md +0 -115
  17. package/src/generators/preset/files/python/kong.json +0 -7
  18. package/src/generators/preset/files/python/project.json.template +0 -8
  19. package/src/generators/preset/files/python/pyproject.toml +0 -3
  20. package/src/generators/preset/files/python/requirements-dev.txt +0 -10
  21. package/src/generators/preset/files/python/requirements.txt +0 -4
  22. package/src/generators/preset/files/python/src/__init__.py +0 -0
  23. package/src/generators/preset/files/python/src/main.py +0 -67
  24. package/src/generators/preset/files/python/src/main_test.py +0 -18
  25. package/src/generators/preset/schema.d.ts +0 -5
  26. package/src/generators/preset/schema.json +0 -27
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@devkong/cli-nx",
3
- "version": "0.0.17-0",
3
+ "version": "0.0.18-1",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
7
7
  "generators": "./generators.json",
8
- "types": "./src/index.d.ts"
8
+ "types": "./../kong-sdk-python/packages/kong-cli-nx/src/index.d.ts"
9
9
  }
package/README.md DELETED
@@ -1,11 +0,0 @@
1
- # kong-cli-nx
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Building
6
-
7
- Run `nx build kong-cli-nx` to build the library.
8
-
9
- ## Running unit tests
10
-
11
- Run `nx test kong-cli-nx` to execute the unit tests via [Jest](https://jestjs.io).
package/generators.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "generators": {
3
- "preset": {
4
- "factory": "./src/generators/preset/generator",
5
- "schema": "./src/generators/preset/schema.json",
6
- "description": "preset generator",
7
- "x-use-standalone-layout": true
8
- }
9
- }
10
- }
@@ -1,5 +0,0 @@
1
- node_modules
2
- .nx
3
- .idea
4
- .vscode
5
- .venv
@@ -1,16 +0,0 @@
1
- # Editor configuration, see http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- end_of_line = lf
6
- insert_final_newline = true
7
- trim_trailing_whitespace = true
8
-
9
- [*.py]
10
- charset = utf-8
11
- indent_style = space
12
- indent_size = 2
13
-
14
- [*.md]
15
- insert_final_newline = false
16
- trim_trailing_whitespace = false
@@ -1,25 +0,0 @@
1
- # Autodetect text files
2
- * text=auto
3
-
4
- # Force the following filetypes to have unix eols, so Windows does not break them
5
- *.* text eol=lf
6
-
7
- # Force images/fonts to be handled as binaries
8
- *.jpg binary
9
- *.jpeg binary
10
- *.gif binary
11
- *.png binary
12
- *.t3x binary
13
- *.t3d binary
14
- *.exe binary
15
- *.data binary
16
- *.ttf binary
17
- *.eof binary
18
- *.eot binary
19
- *.swf binary
20
- *.mov binary
21
- *.mp4 binary
22
- *.mp3 binary
23
- *.ogg binary
24
- *.flv binary
25
- *.xlsx binary
@@ -1,69 +0,0 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
2
-
3
- # compiled output
4
- dist
5
- bin
6
- tmp
7
- /out-tsc
8
- **/target
9
-
10
- # dependencies
11
- node_modules
12
- .nx
13
- .poetry
14
- .venv
15
-
16
- # IDEs and editors
17
- .project
18
- .classpath
19
- .c9/
20
- *.launch
21
- .settings/
22
- *.sublime-workspace
23
-
24
- # misc
25
- /.sass-cache
26
- /connect.lock
27
- /coverage
28
- /libpeerconnection.log
29
- npm-debug.log
30
- yarn-error.log
31
- testem.log
32
- /typings
33
- .kotlin
34
- **/pylint.txt
35
- .pytest_cache
36
- __pycache__
37
-
38
- # System Files
39
- .DS_Store
40
- Thumbs.db
41
-
42
- # Gradle
43
- .gradle
44
- build
45
-
46
- # Maven
47
- **/.mvn/repository
48
-
49
- # Idea
50
- **/.idea/aws.xml
51
- **/.idea/dataSources
52
- **/.idea/dataSources.local.xml
53
- **/.idea/dataSources.xml
54
- **/.idea/httpRequests
55
- **/.idea/jarRepositories.xml
56
- **/.idea/jsLibraryMappings.xml
57
- **/.idea/kotlinScripting.xml
58
- **/.idea/modules
59
- **/.idea/modules.xml
60
- **/.idea/protoeditor.xml
61
- **/.idea/protoeditor.xml
62
- **/.idea/shelf
63
- **/.idea/tasks.xml
64
- **/.idea/workspace.xml
65
-
66
- # tests
67
- **/.coverage
68
- **/coverage.xml
69
- **/reports/**/unittests
@@ -1,7 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- <inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
6
- </profile>
7
- </component>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <settings>
3
- <option name="USE_PROJECT_PROFILE" value="false" />
4
- <version value="1.0" />
5
- </settings>
6
- </component>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="PYTHON_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
6
- </content>
7
- <orderEntry type="jdk" jdkName="Pipenv (kong-cli-python-template)" jdkType="Python SDK" />
8
- <orderEntry type="sourceFolder" forTests="false" />
9
- </component>
10
- </module>
@@ -1,547 +0,0 @@
1
- [MAIN]
2
-
3
- # List of plugins (as comma separated values of python modules names) to load,
4
- # usually to register additional checkers.
5
- load-plugins=
6
- pylint.extensions.check_elif,
7
- pylint.extensions.bad_builtin,
8
- pylint.extensions.docparams,
9
- pylint.extensions.for_any_all,
10
- pylint.extensions.set_membership,
11
- pylint.extensions.code_style,
12
- pylint.extensions.overlapping_exceptions,
13
- pylint.extensions.typing,
14
- pylint.extensions.redefined_variable_type,
15
- pylint.extensions.comparison_placement,
16
- pylint_pydantic,
17
-
18
-
19
- # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
20
- # number of processors available to use.
21
- jobs=1
22
-
23
- # When enabled, pylint would attempt to guess common misconfiguration and emit
24
- # user-friendly hints instead of false-positive error messages.
25
- suggestion-mode=yes
26
-
27
- # Allow loading of arbitrary C extensions. Extensions are imported into the
28
- # active Python interpreter and may run arbitrary code.
29
- unsafe-load-any-extension=no
30
-
31
- # A comma-separated list of package or module names from where C extensions may
32
- # be loaded. Extensions are loading into the active Python interpreter and may
33
- # run arbitrary code
34
- extension-pkg-allow-list=pydantic,dependency_injector
35
-
36
- # Minimum supported python version
37
- py-version = 3.10.5
38
-
39
- # Control the amount of potential inferred values when inferring a single
40
- # object. This can help the performance when dealing with large functions or
41
- # complex, nested conditions.
42
- limit-inference-results=100
43
-
44
- # Specify a score threshold under which the program will exit with error.
45
- fail-under=10.0
46
-
47
- # Return non-zero exit code if any of these messages/categories are detected,
48
- # even if score is above --fail-under value. Syntax same as enable. Messages
49
- # specified are enabled, while categories only check already-enabled messages.
50
- fail-on=
51
-
52
-
53
- [MESSAGES CONTROL]
54
-
55
- # Only show warnings with the listed confidence levels. Leave empty to show
56
- # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
57
- # confidence=
58
-
59
- # Enable the message, report, category or checker with the given id(s). You can
60
- # either give multiple identifier separated by comma (,) or put this option
61
- # multiple time (only on the command line, not in the configuration file where
62
- # it should appear only once). See also the "--disable" option for examples.
63
- enable=
64
- use-symbolic-message-instead,
65
- useless-suppression,
66
-
67
- # Disable the message, report, category or checker with the given id(s). You
68
- # can either give multiple identifiers separated by comma (,) or put this
69
- # option multiple times (only on the command line, not in the configuration
70
- # file where it should appear only once).You can also use "--disable=all" to
71
- # disable everything first and then re-enable specific checks. For example, if
72
- # you want to run only the similarities checker, you can use "--disable=all
73
- # --enable=similarities". If you want to run only the classes checker, but have
74
- # no Warning level messages displayed, use"--disable=all --enable=classes
75
- # --disable=W"
76
-
77
- disable=
78
- attribute-defined-outside-init,
79
- invalid-name,
80
- missing-docstring,
81
- protected-access,
82
- too-few-public-methods,
83
- # handled by black
84
- format,
85
- # We anticipate #3512 where it will become optional
86
- fixme,
87
- not-context-manager,
88
- relative-beyond-top-level,
89
-
90
-
91
- [REPORTS]
92
-
93
- # Set the output format. Available formats are text, parseable, colorized, msvs
94
- # (visual studio) and html. You can also give a reporter class, eg
95
- # mypackage.mymodule.MyReporterClass.
96
- output-format=text
97
-
98
- # Tells whether to display a full report or only the messages
99
- reports=no
100
-
101
- # Python expression which should return a note less than 10 (10 is the highest
102
- # note). You have access to the variables "fatal", "error", "warning", "refactor", "convention"
103
- # and "info", which contain the number of messages in each category, as
104
- # well as "statement", which is the total number of statements analyzed. This
105
- # score is used by the global evaluation report (RP0004).
106
- evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
107
-
108
- # Template used to display messages. This is a python new-style format string
109
- # used to format the message information. See doc for all details
110
- #msg-template=
111
-
112
- # Activate the evaluation score.
113
- score=yes
114
-
115
-
116
- [LOGGING]
117
-
118
- # Logging modules to check that the string format arguments are in logging
119
- # function parameter format
120
- logging-modules=logging
121
-
122
- # The type of string formatting that logging methods do. `old` means using %
123
- # formatting, `new` is for `{}` formatting.
124
- logging-format-style=new
125
-
126
-
127
- [MISCELLANEOUS]
128
-
129
- # List of note tags to take in consideration, separated by a comma.
130
- notes=FIXME,XXX,TODO
131
-
132
- # Regular expression of note tags to take in consideration.
133
- #notes-rgx=
134
-
135
-
136
- [SIMILARITIES]
137
-
138
- # Minimum lines number of a similarity.
139
- min-similarity-lines=6
140
-
141
- # Ignore comments when computing similarities.
142
- ignore-comments=yes
143
-
144
- # Ignore docstrings when computing similarities.
145
- ignore-docstrings=yes
146
-
147
- # Ignore imports when computing similarities.
148
- ignore-imports=yes
149
-
150
- # Signatures are removed from the similarity computation
151
- ignore-signatures=yes
152
-
153
-
154
- [VARIABLES]
155
-
156
- # Tells whether we should check for unused import in __init__ files.
157
- init-import=no
158
-
159
- # A regular expression matching the name of dummy variables (i.e. expectedly
160
- # not used).
161
- dummy-variables-rgx=_$|dummy
162
-
163
- # List of additional names supposed to be defined in builtins. Remember that
164
- # you should avoid defining new builtins when possible.
165
- additional-builtins=
166
-
167
- # List of strings which can identify a callback function by name. A callback
168
- # name must start or end with one of those strings.
169
- callbacks=cb_,_cb
170
-
171
- # Tells whether unused global variables should be treated as a violation.
172
- allow-global-unused-variables=yes
173
-
174
- # List of names allowed to shadow builtins
175
- allowed-redefined-builtins=
176
-
177
- # Argument names that match this expression will be ignored. Default to name
178
- # with leading underscore.
179
- ignored-argument-names=_.*
180
-
181
- # List of qualified module names which can have objects that can redefine
182
- # builtins.
183
- redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
184
-
185
-
186
- [FORMAT]
187
- disable=logging-fstring-interpolation
188
-
189
- # Maximum number of characters on a single line.
190
- max-line-length=100
191
-
192
- # Regexp for a line that is allowed to be longer than the limit.
193
- ignore-long-lines=^\s*(# )?<?https?://\S+>?$
194
-
195
- # Allow the body of an if to be on the same line as the test if there is no
196
- # else.
197
- single-line-if-stmt=no
198
-
199
- # Allow the body of a class to be on the same line as the declaration if body
200
- # contains single statement.
201
- single-line-class-stmt=no
202
-
203
- # Maximum number of lines in a module
204
- max-module-lines=2000
205
-
206
- # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
207
- # tab).
208
- indent-string=" "
209
-
210
- # Number of spaces of indent required inside a hanging or continued line.
211
- indent-after-paren=4
212
-
213
- # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
214
- expected-line-ending-format=
215
-
216
-
217
- [BASIC]
218
-
219
- # Good variable names which should always be accepted, separated by a comma
220
- good-names=i,j,k,ex,Run,_
221
-
222
- # Good variable names regexes, separated by a comma. If names match any regex,
223
- # they will always be accepted
224
- good-names-rgxs=
225
-
226
- # Bad variable names which should always be refused, separated by a comma
227
- bad-names=foo,bar,baz,toto,tutu,tata
228
-
229
- # Bad variable names regexes, separated by a comma. If names match any regex,
230
- # they will always be refused
231
- bad-names-rgxs=
232
-
233
- # Colon-delimited sets of names that determine each other's naming style when
234
- # the name regexes allow several styles.
235
- name-group=
236
-
237
- # Include a hint for the correct naming format with invalid-name
238
- include-naming-hint=no
239
-
240
- # Naming style matching correct function names.
241
- function-naming-style=snake_case
242
-
243
- # Regular expression matching correct function names
244
- function-rgx=[a-z_][a-z0-9_]{2,30}$
245
-
246
- # Naming style matching correct variable names.
247
- variable-naming-style=snake_case
248
-
249
- # Regular expression matching correct variable names
250
- variable-rgx=[a-z_][a-z0-9_]{2,30}$
251
-
252
- # Naming style matching correct constant names.
253
- const-naming-style=UPPER_CASE
254
-
255
- # Regular expression matching correct constant names
256
- const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
257
-
258
- # Naming style matching correct attribute names.
259
- attr-naming-style=snake_case
260
-
261
- # Regular expression matching correct attribute names
262
- attr-rgx=[a-z_][a-z0-9_]{2,}$
263
-
264
- # Naming style matching correct argument names.
265
- argument-naming-style=snake_case
266
-
267
- # Regular expression matching correct argument names
268
- argument-rgx=[a-z_][a-z0-9_]{2,30}$
269
-
270
- # Naming style matching correct class attribute names.
271
- class-attribute-naming-style=any
272
-
273
- # Regular expression matching correct class attribute names
274
- class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
275
-
276
- # Naming style matching correct class constant names.
277
- class-const-naming-style=UPPER_CASE
278
-
279
- # Regular expression matching correct class constant names. Overrides class-
280
- # const-naming-style.
281
- #class-const-rgx=
282
-
283
- # Naming style matching correct inline iteration names.
284
- inlinevar-naming-style=any
285
-
286
- # Regular expression matching correct inline iteration names
287
- inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
288
-
289
- # Naming style matching correct class names.
290
- class-naming-style=PascalCase
291
-
292
- # Regular expression matching correct class names
293
- class-rgx=[A-Z_][a-zA-Z0-9]+$
294
-
295
-
296
- # Naming style matching correct module names.
297
- module-naming-style=snake_case
298
-
299
- # Regular expression matching correct module names
300
- module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
301
-
302
-
303
- # Naming style matching correct method names.
304
- method-naming-style=snake_case
305
-
306
- # Regular expression matching correct method names
307
- method-rgx=[a-z_][a-z0-9_]{2,}$
308
-
309
- # Regular expression which can overwrite the naming style set by typevar-naming-style.
310
- #typevar-rgx=
311
-
312
- # Regular expression which should only match function or class names that do
313
- # not require a docstring. Use ^(?!__init__$)_ to also check __init__.
314
- no-docstring-rgx=__.*__
315
-
316
- # Minimum line length for functions/classes that require docstrings, shorter
317
- # ones are exempt.
318
- docstring-min-length=-1
319
-
320
- # List of decorators that define properties, such as abc.abstractproperty.
321
- property-classes=abc.abstractproperty
322
-
323
-
324
- [TYPECHECK]
325
-
326
- # Regex pattern to define which classes are considered mixins if ignore-mixin-
327
- # members is set to "yes"
328
- mixin-class-rgx=.*MixIn
329
-
330
- # List of module names for which member attributes should not be checked
331
- # (useful for modules/projects where namespaces are manipulated during runtime
332
- # and thus existing member attributes cannot be deduced by static analysis). It
333
- # supports qualified module names, as well as Unix pattern matching.
334
- ignored-modules=
335
-
336
- # List of class names for which member attributes should not be checked (useful
337
- # for classes with dynamically set attributes). This supports the use of
338
- # qualified names.
339
- ignored-classes=SQLObject, optparse.Values, thread._local, _thread._local
340
-
341
- # List of members which are set dynamically and missed by pylint inference
342
- # system, and so shouldn't trigger E1101 when accessed. Python regular
343
- # expressions are accepted.
344
- generated-members=REQUEST,acl_users,aq_parent,argparse.Namespace
345
-
346
- # List of decorators that create context managers from functions, such as
347
- # contextlib.contextmanager.
348
- contextmanager-decorators=contextlib.contextmanager
349
-
350
- # Tells whether to warn about missing members when the owner of the attribute
351
- # is inferred to be None.
352
- ignore-none=yes
353
-
354
- # This flag controls whether pylint should warn about no-member and similar
355
- # checks whenever an opaque object is returned when inferring. The inference
356
- # can return multiple potential results while evaluating a Python object, but
357
- # some branches might not be evaluated, which results in partial inference. In
358
- # that case, it might be useful to still emit no-member and other checks for
359
- # the rest of the inferred objects.
360
- ignore-on-opaque-inference=yes
361
-
362
- # Show a hint with possible names when a member name was not found. The aspect
363
- # of finding the hint is based on edit distance.
364
- missing-member-hint=yes
365
-
366
- # The minimum edit distance a name should have in order to be considered a
367
- # similar match for a missing member name.
368
- missing-member-hint-distance=1
369
-
370
- # The total number of similar names that should be taken in consideration when
371
- # showing a hint for a missing member.
372
- missing-member-max-choices=1
373
-
374
- [SPELLING]
375
-
376
- # Spelling dictionary name. Available dictionaries: none. To make it working
377
- # install python-enchant package.
378
- spelling-dict=
379
-
380
- # List of comma separated words that should not be checked.
381
- spelling-ignore-words=
382
-
383
- # List of comma separated words that should be considered directives if they
384
- # appear and the beginning of a comment and should not be checked.
385
- spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:,pragma:,# noinspection
386
-
387
- # A path to a file that contains private dictionary; one word per line.
388
- spelling-private-dict-file=.pyenchant_pylint_custom_dict.txt
389
-
390
- # Tells whether to store unknown words to indicated private dictionary in
391
- # --spelling-private-dict-file option instead of raising a message.
392
- spelling-store-unknown-words=no
393
-
394
- # Limits count of emitted suggestions for spelling mistakes.
395
- max-spelling-suggestions=2
396
-
397
-
398
- [DESIGN]
399
-
400
- # Maximum number of arguments for function / method
401
- max-args=10
402
-
403
- # Maximum number of locals for function / method body
404
- max-locals=25
405
-
406
- # Maximum number of return / yield for function / method body
407
- max-returns=11
408
-
409
- # Maximum number of branch for function / method body
410
- max-branches=27
411
-
412
- # Maximum number of statements in function / method body
413
- max-statements=100
414
-
415
- # Maximum number of parents for a class (see R0901).
416
- max-parents=7
417
-
418
- # List of qualified class names to ignore when counting class parents (see R0901).
419
- ignored-parents=
420
-
421
- # Maximum number of attributes for a class (see R0902).
422
- max-attributes=11
423
-
424
- # Minimum number of public methods for a class (see R0903).
425
- min-public-methods=2
426
-
427
- # Maximum number of public methods for a class (see R0904).
428
- max-public-methods=25
429
-
430
- # Maximum number of boolean expressions in an if statement (see R0916).
431
- max-bool-expr=5
432
-
433
- # List of regular expressions of class ancestor names to
434
- # ignore when counting public methods (see R0903).
435
- exclude-too-few-public-methods=
436
-
437
- [CLASSES]
438
-
439
- # List of method names used to declare (i.e. assign) instance attributes.
440
- defining-attr-methods=__init__,__new__,setUp,__post_init__
441
-
442
- # List of valid names for the first argument in a class method.
443
- valid-classmethod-first-arg=cls
444
-
445
- # List of valid names for the first argument in a metaclass class method.
446
- valid-metaclass-classmethod-first-arg=mcs
447
-
448
- # List of member names, which should be excluded from the protected access
449
- # warning.
450
- exclude-protected=_asdict,_fields,_replace,_source,_make
451
-
452
- # Warn about protected attribute access inside special methods
453
- check-protected-access-in-special-methods=no
454
-
455
- [IMPORTS]
456
-
457
- # List of modules that can be imported at any level, not just the top level
458
- # one.
459
- allow-any-import-level=
460
-
461
- # Allow wildcard imports from modules that define __all__.
462
- allow-wildcard-with-all=no
463
-
464
- # Analyse import fallback blocks. This can be used to support both Python 2 and
465
- # 3 compatible code, which means that the block might have code that exists
466
- # only in one or another interpreter, leading to false positives when analysed.
467
- analyse-fallback-blocks=no
468
-
469
- # Deprecated modules which should not be used, separated by a comma
470
- deprecated-modules=regsub,TERMIOS,Bastion,rexec
471
-
472
- # Create a graph of every (i.e. internal and external) dependencies in the
473
- # given file (report RP0402 must not be disabled)
474
- import-graph=
475
-
476
- # Create a graph of external dependencies in the given file (report RP0402 must
477
- # not be disabled)
478
- ext-import-graph=
479
-
480
- # Create a graph of internal dependencies in the given file (report RP0402 must
481
- # not be disabled)
482
- int-import-graph=
483
-
484
- # Force import order to recognize a module as part of the standard
485
- # compatibility libraries.
486
- known-standard-library=
487
-
488
- # Force import order to recognize a module as part of a third party library.
489
- known-third-party=enchant
490
-
491
- # Couples of modules and preferred modules, separated by a comma.
492
- preferred-modules=
493
-
494
-
495
- [EXCEPTIONS]
496
-
497
- # Exceptions that will emit a warning when being caught. Defaults to
498
- # "Exception"
499
- overgeneral-exceptions=Exception
500
-
501
-
502
- [TYPING]
503
-
504
- # Set to ``no`` if the app / library does **NOT** need to support runtime
505
- # introspection of type annotations. If you use type annotations
506
- # **exclusively** for type checking of an application, you're probably fine.
507
- # For libraries, evaluate if some users what to access the type hints at
508
- # runtime first, e.g., through ``typing.get_type_hints``. Applies to Python
509
- # versions 3.7 - 3.9
510
- runtime-typing = no
511
-
512
-
513
- [DEPRECATED_BUILTINS]
514
-
515
- # List of builtins function names that should not be used, separated by a comma
516
- bad-functions=map,input
517
-
518
-
519
- [REFACTORING]
520
-
521
- # Maximum number of nested blocks for function / method body
522
- max-nested-blocks=5
523
-
524
- # Complete name of functions that never returns. When checking for
525
- # inconsistent-return-statements if a never returning function is called then
526
- # it will be considered as an explicit return statement and no message will be
527
- # printed.
528
- never-returning-functions=sys.exit,argparse.parse_error
529
-
530
-
531
- [STRING]
532
-
533
- # This flag controls whether inconsistent-quotes generates a warning when the
534
- # character used as a quote delimiter is used inconsistently within a module.
535
- check-quote-consistency=no
536
-
537
- # This flag controls whether the implicit-str-concat should generate a warning
538
- # on implicit string concatenation in sequences defined over several lines.
539
- check-str-concat-over-line-jumps=no
540
-
541
-
542
- [CODE_STYLE]
543
-
544
- # Max line length for which to sill emit suggestions. Used to prevent optional
545
- # suggestions which would get split by a code formatter (e.g., black). Will
546
- # default to the setting for ``max-line-length``.
547
- #max-line-length-suggestions=
@@ -1,14 +0,0 @@
1
- {
2
- "recommendations": [
3
- "dbaeumer.vscode-eslint",
4
- "esbenp.prettier-vscode",
5
- "ms-python.black-formatter",
6
- "ms-python.isort",
7
- "ms-python.pylint",
8
- "ms-python.python",
9
- "ms-python.vscode-pylance",
10
- "nrwl.angular-console",
11
- "streetsidesoftware.code-spell-checker",
12
- "stylelint.vscode-stylelint"
13
- ]
14
- }
@@ -1,18 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "name": "test",
6
- "type": "debugpy",
7
- "request": "launch",
8
- "module": "pytest",
9
- "windows": {
10
- "python": ".venv\\Scripts\\python.exe"
11
- },
12
- "linux": {
13
- "python": ".venv/bin/python"
14
- },
15
- "justMyCode": true
16
- }
17
- ]
18
- }
@@ -1,62 +0,0 @@
1
- {
2
- "files.eol": "\n",
3
- "python.languageServer": "Pylance",
4
- "[python]": {
5
- "editor.defaultFormatter": "ms-python.black-formatter",
6
- "editor.formatOnSave": true,
7
- "editor.codeActionsOnSave": {
8
- "source.organizeImports": "explicit"
9
- }
10
- },
11
- "isort.args": ["--profile", "black"],
12
- "json.schemas": [
13
- {
14
- "fileMatch": ["**/kong.json"],
15
- "url": "https://kong.dev.app-dts.net/kong-cli-schema.json"
16
- }
17
- ],
18
- "cSpell.words": [
19
- "abstractproperty",
20
- "Analyse",
21
- "analysed",
22
- "argparse",
23
- "asdict",
24
- "asyncio",
25
- "classmethod",
26
- "condecimal",
27
- "conint",
28
- "contextlib",
29
- "contextmanager",
30
- "devkong",
31
- "docparams",
32
- "docstrings",
33
- "elif",
34
- "fstring",
35
- "inlinevar",
36
- "isort",
37
- "libpeerconnection",
38
- "metaclass",
39
- "msvs",
40
- "mymodule",
41
- "mypackage",
42
- "mypy",
43
- "noqa",
44
- "nosec",
45
- "optparse",
46
- "overgeneral",
47
- "parseable",
48
- "protoeditor",
49
- "pycache",
50
- "pyenchant",
51
- "pylint",
52
- "pytest",
53
- "regsub",
54
- "rexec",
55
- "rgxs",
56
- "TERMIOS",
57
- "testem",
58
- "typevar",
59
- "unittests",
60
- "venv"
61
- ]
62
- }
@@ -1,13 +0,0 @@
1
- # syntax=docker/dockerfile:1
2
-
3
- FROM --platform=linux/amd64 python:3.13.1-slim-bullseye
4
-
5
- ENV APP_DIR=/deployments/app
6
-
7
- COPY ./requirements.txt $APP_DIR/requirements.txt
8
- RUN pip install -r $APP_DIR/requirements.txt
9
-
10
- COPY ./src $APP_DIR/src
11
- WORKDIR $APP_DIR
12
-
13
- CMD ["python", "./src/main.py"]
@@ -1,115 +0,0 @@
1
- # Kong Extension
2
-
3
- Welcome to the Kong extension development workspace!
4
-
5
- ### Prerequisites
6
-
7
- Before you start, make sure you have the following installed:
8
-
9
- - [Node.js](https://nodejs.org/en/download/prebuilt-installer). Version >= 20.0
10
- - [Python](https://www.python.org/downloads/). Version >= 3.10
11
- - [Docker](https://docs.docker.com/desktop/). If using Docker Desktop, start it
12
- - Mac M2 users, see [Troubleshooting](#Troubleshooting)
13
-
14
- To verify the installation and check the versions, run the following commands:
15
-
16
- ```shell script
17
- node --version
18
- python --version # or python3 --version
19
- docker info
20
- ```
21
-
22
- ### Getting Started
23
-
24
- 1. Add your username to the `ownership` field in the `kong.json` file (e.g., "kong-dev", "kong-qa")
25
- 2. Make sure you're in the terminal and inside the extension folder you generated
26
- 3. Run the following commands in your terminal:
27
-
28
- ```shell script
29
- # configure the base Kong URL (e.g., https://kong.dev.app-dts.net)
30
- kong configure
31
-
32
- # install Python dependencies from requirements.txt
33
- kong install --verbose
34
- ```
35
-
36
- That's it! Now, modify [main.py](./src/main.py), tag it by publishing a new version, and assign aliases for use in the workflow.
37
-
38
- ### Publish a New Version
39
-
40
- To automatically tag your code with an incremented version number (e.g., 1, 2, 3), run:
41
-
42
- ```shell script
43
- kong publish-version --verbose
44
- ```
45
-
46
- ### List Available Versions
47
-
48
- To see all available versions of your extension, run:
49
-
50
- ```shell script
51
- kong list-versions
52
- ```
53
-
54
- ### Assign an Alias to a Version
55
-
56
- You can assign an alias (e.g., stable, beta) to a specific version. This alias will appear in the UI as a separate step in the workflow. For example, to assign the alias stable to version 1, use:
57
-
58
- ```shell script
59
- kong set-alias stable 1
60
- ```
61
-
62
- ### Running and Debugging Tests
63
-
64
- To run the tests, execute the following command:
65
-
66
- ```shell script
67
- pytest ./src
68
- ```
69
-
70
- This will run the tests located in the `src` directory.
71
- The debugging process depends on the IDE you're using. For example, in [VSCode](https://code.visualstudio.com/), follow these steps:
72
-
73
- 1. Open the Run and Debug panel from the left sidebar
74
- 2. In the top combobox (dropdown), select "test" to configure the test environment
75
- 3. Click the green play button to start debugging the tests
76
-
77
- This will allow you to set breakpoints and step through your tests.
78
-
79
- ### Update Python Dependencies
80
-
81
- If you modify requirements.txt or requirements-dev.txt, run the following to apply the changes:
82
-
83
- ```shell script
84
- kong install --verbose
85
- ```
86
-
87
- ### Using a Custom Profile
88
-
89
- If you're developing an extension that will be used in different regions (or need to work with a specific profile), you can create a new profile using `kong configure`. Then, include the `--profile <name>` parameter when running the publish-version and set-alias commands to use the desired profile.
90
-
91
- ### Update CLI
92
-
93
- To install the latest version of the CLI, run:
94
-
95
- ```shell script
96
- npm i -g @devkong/cli@latest
97
- ```
98
-
99
- ### Troubleshooting
100
-
101
- #### Mac M2 Users
102
-
103
- To emulate a Linux platform, you need to install Rosetta:
104
-
105
- ```shell script
106
- softwareupdate --install-rosetta
107
- ```
108
-
109
- #### Using a Different Python Version
110
-
111
- To change the Python version, update the `FROM` statement in the `Dockerfile` to the desired version from [Docker Hub](https://hub.docker.com/_/python/):
112
-
113
- ```docker
114
- FROM --platform=linux/amd64 python:3.13.1-slim-bullseye
115
- ```
@@ -1,7 +0,0 @@
1
- {
2
- "id": "<%=id%>",
3
- "name": "<%=name%>",
4
- "sdk": "<%=platform%>",
5
- "ownership": [],
6
- "alias": {}
7
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "<%=name%>",
3
- "$schema": "./node_modules/nx/schemas/project-schema.json",
4
- "projectType": "application",
5
- "sourceRoot": "./src",
6
- "targets": {},
7
- "tags": []
8
- }
@@ -1,3 +0,0 @@
1
- [tool.pytest.ini_options]
2
- asyncio_mode = "auto"
3
- asyncio_default_fixture_loop_scope = "function"
@@ -1,10 +0,0 @@
1
- black==24.10.0
2
- flake8==7.1.1
3
- isort==5.13.2
4
- pylint==3.3.2
5
- pylint-pydantic==0.3.4
6
- pytest==8.3.4
7
- pytest-asyncio==0.25.0
8
- pytest-cov==6.0.0
9
- pytest-html==4.1.1
10
- pytest-sugar==1.0.0
@@ -1,4 +0,0 @@
1
- --extra-index-url https://nexus.shared.app-dts.net/repository/python-hosted/simple
2
- pydantic==2.10.3
3
- kong-sdk==0.0.31
4
- email-validator==2.2.0
@@ -1,67 +0,0 @@
1
- import sys
2
- from typing import Optional
3
-
4
- from kong.sdk.app import App
5
- from kong.sdk.kong_function import KongFunction
6
- from pydantic import BaseModel, Field
7
-
8
- # This script is for developing an extension for Kong.
9
- # For more details, please refer to the README.md file.
10
-
11
-
12
- class InputData(BaseModel):
13
- # Define the structure of the input data that your extension will accept.
14
- # Be sure to include example values for each field. These examples help generate
15
- # sample objects in the UI, making it easier to work with the models.
16
- # For more standard types, refer to: https://docs.pydantic.dev/latest/concepts/types/
17
-
18
- # REPLACE BELLOW WITH YOUR FIELDS
19
-
20
- a: int = Field(
21
- examples=[1],
22
- description="An integer number",
23
- )
24
-
25
- b: int = Field(
26
- examples=[2],
27
- description="An integer number",
28
- )
29
-
30
-
31
- class OutputData(BaseModel):
32
- # Define the structure of the output data that your extension will return.
33
-
34
- # REPLACE BELLOW WITH YOUR FIELDS
35
-
36
- sum_of: int = Field(
37
- examples=[3],
38
- description="Result of a + b",
39
- )
40
-
41
- comment: Optional[str] = Field(
42
- examples=["This example extension returns sum of a and b"],
43
- description="A string field",
44
- )
45
-
46
-
47
- class MyExtension(KongFunction):
48
- # This is where you implement the logic to handle the input data
49
- # and produce the output.
50
-
51
- # OVERRIDE BELLOW TO CUSTOMIZE THE PROCESSING.
52
-
53
- async def handle(self, data: InputData) -> OutputData:
54
- return OutputData(
55
- sum_of=data.a + data.b,
56
- comment=f"sum of {data.a} and {data.b}",
57
- )
58
-
59
-
60
- app = App(
61
- InputData,
62
- OutputData,
63
- MyExtension,
64
- )
65
-
66
- if __name__ == "__main__":
67
- app.run(sys.argv)
@@ -1,18 +0,0 @@
1
- from kong.sdk.conftest import ExtensionFixture
2
- from src.main import InputData, MyExtension
3
-
4
-
5
- # The test function to validate the behavior of the extension
6
- async def test_should_return_value_from_string_field_when_input_is_provided(
7
- create_extension: ExtensionFixture,
8
- ):
9
- extension = create_extension(MyExtension, InputData)
10
-
11
- # Prepare the input data
12
- input_data = InputData(
13
- a=1,
14
- b=2,
15
- )
16
-
17
- output = await extension.handle(input_data)
18
- assert output.sum_of == 3
@@ -1,5 +0,0 @@
1
- export interface PresetGeneratorSchema {
2
- name: string;
3
- os: string;
4
- platform: "python" | "kotlin";
5
- }
@@ -1,27 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "Preset",
4
- "title": "",
5
- "type": "object",
6
- "properties": {
7
- "name": {
8
- "type": "string",
9
- "description": "",
10
- "$default": {
11
- "$source": "argv",
12
- "index": 0
13
- },
14
- "x-prompt": "What name would you like to use?"
15
- },
16
- "platform": {
17
- "type": "string",
18
- "description": "",
19
- "$default": {
20
- "$source": "argv",
21
- "index": 1
22
- },
23
- "x-prompt": "What platform would you like to use?"
24
- }
25
- },
26
- "required": ["name"]
27
- }