@voxgig/sdkgen 0.41.1 → 0.42.0
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.
- package/bin/voxgig-sdkgen +1 -1
- package/package.json +1 -1
- package/project/.sdk/model/target/go.jsonic +1 -1
- package/project/.sdk/model/target/js.jsonic +1 -1
- package/project/.sdk/model/target/lua.jsonic +1 -1
- package/project/.sdk/model/target/php.jsonic +1 -1
- package/project/.sdk/model/target/py.jsonic +1 -1
- package/project/.sdk/model/target/rb.jsonic +1 -1
- package/project/.sdk/src/cmp/go/Entity_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Main_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Package_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeExplanation_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeInstall_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +1 -1
- package/project/.sdk/src/cmp/go/ReadmeTopTest_go.ts +1 -1
- package/project/.sdk/src/cmp/go/Test_go.ts +1 -1
- package/project/.sdk/src/cmp/php/Main_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeExplanation_php.ts +2 -2
- package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +1 -1
- package/project/.sdk/src/cmp/php/TestDirect_php.ts +1 -1
- package/project/.sdk/src/cmp/php/TestEntity_php.ts +1 -1
- package/project/.sdk/src/cmp/php/Test_php.ts +1 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeExplanation_py.ts +2 -2
- package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +1 -1
- package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +1 -1
- package/project/.sdk/src/cmp/py/TestDirect_py.ts +1 -1
- package/project/.sdk/src/cmp/py/TestEntity_py.ts +1 -1
- package/project/.sdk/src/cmp/py/Test_py.ts +1 -1
- package/project/.sdk/src/cmp/rb/Main_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/Package_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeExplanation_rb.ts +2 -2
- package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +1 -1
- package/project/.sdk/src/cmp/rb/Test_rb.ts +1 -1
package/bin/voxgig-sdkgen
CHANGED
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ const Entity = cmp(function Entity(props: any) {
|
|
|
15
15
|
|
|
16
16
|
// Module name: concatenated lowercase
|
|
17
17
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
18
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
18
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
19
19
|
|
|
20
20
|
const entrep = {
|
|
21
21
|
...stdrep,
|
|
@@ -33,7 +33,7 @@ const Main = cmp(async function Main(props: any) {
|
|
|
33
33
|
|
|
34
34
|
// Module name: concatenated lowercase (e.g., voxgigsolardemosdk)
|
|
35
35
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
36
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
36
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
37
37
|
|
|
38
38
|
Package({ target })
|
|
39
39
|
|
|
@@ -20,7 +20,7 @@ const Package = cmp(async function Package(props: any) {
|
|
|
20
20
|
|
|
21
21
|
// Module name: concatenated lowercase (e.g., voxgigsolardemosdk)
|
|
22
22
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
23
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
23
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
24
24
|
|
|
25
25
|
File({ name: 'go.mod' }, () => {
|
|
26
26
|
Content(`module ${gomodule}
|
|
@@ -6,7 +6,7 @@ const ReadmeExplanation = cmp(function ReadmeExplanation(props: any) {
|
|
|
6
6
|
const { target, ctx$: { model } } = props
|
|
7
7
|
|
|
8
8
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
9
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
9
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
10
10
|
|
|
11
11
|
Content(`### Data as maps
|
|
12
12
|
|
|
@@ -11,7 +11,7 @@ const ReadmeHowto = cmp(function ReadmeHowto(props: any) {
|
|
|
11
11
|
const { target, ctx$: { model } } = props
|
|
12
12
|
|
|
13
13
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
14
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
14
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
15
15
|
|
|
16
16
|
Content(`### Make a direct HTTP request
|
|
17
17
|
|
|
@@ -7,7 +7,7 @@ const ReadmeInstall = cmp(function ReadmeInstall(props: any) {
|
|
|
7
7
|
const { model } = ctx$
|
|
8
8
|
|
|
9
9
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
10
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
10
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
11
11
|
|
|
12
12
|
Content(`\`\`\`bash
|
|
13
13
|
go get ${gomodule}
|
|
@@ -14,7 +14,7 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
14
14
|
const entityList = each(entity).filter((e: any) => e.active !== false)
|
|
15
15
|
|
|
16
16
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
17
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
17
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
18
18
|
|
|
19
19
|
Content(`### New${model.const.Name}SDK
|
|
20
20
|
|
|
@@ -13,7 +13,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
13
13
|
|
|
14
14
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
15
15
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
16
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
16
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
17
17
|
|
|
18
18
|
// Find the first published entity for examples
|
|
19
19
|
const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
|
|
@@ -13,7 +13,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
13
13
|
|
|
14
14
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
15
15
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
16
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
16
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
17
17
|
|
|
18
18
|
const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ const ReadmeTopTest = cmp(function ReadmeTopTest(props: any) {
|
|
|
13
13
|
|
|
14
14
|
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
15
15
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
16
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
16
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
17
17
|
|
|
18
18
|
const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ const Test = cmp(function Test(props: any) {
|
|
|
21
21
|
|
|
22
22
|
// Module name: concatenated lowercase
|
|
23
23
|
const orgPrefix = (model.origin || '').replace(/-sdk$/, '').replace(/[^a-z0-9]/gi, '')
|
|
24
|
-
const gomodule = orgPrefix + model.name + 'sdk'
|
|
24
|
+
const gomodule = orgPrefix + model.name.replace(/[^a-z0-9]/gi, '').toLowerCase() + 'sdk'
|
|
25
25
|
|
|
26
26
|
Folder({ name: 'test' }, () => {
|
|
27
27
|
|
|
@@ -18,7 +18,7 @@ Use \`Helpers::to_map()\` to safely validate that a value is an array.
|
|
|
18
18
|
|
|
19
19
|
\`\`\`
|
|
20
20
|
php/
|
|
21
|
-
├── ${model.
|
|
21
|
+
├── ${model.const.Name.toLowerCase()}_sdk.php -- Main SDK class
|
|
22
22
|
├── config.php -- Configuration
|
|
23
23
|
├── features.php -- Feature factory
|
|
24
24
|
├── core/ -- Core types and context
|
|
@@ -28,7 +28,7 @@ php/
|
|
|
28
28
|
└── test/ -- Test suites
|
|
29
29
|
\`\`\`
|
|
30
30
|
|
|
31
|
-
The main class (\`${model.
|
|
31
|
+
The main class (\`${model.const.Name.toLowerCase()}_sdk.php\`) exports the SDK class
|
|
32
32
|
and test helper. Import entity or utility modules directly only
|
|
33
33
|
when needed.
|
|
34
34
|
|
|
@@ -16,7 +16,7 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
16
16
|
Content(`### ${model.const.Name}SDK
|
|
17
17
|
|
|
18
18
|
\`\`\`php
|
|
19
|
-
require_once '${model.
|
|
19
|
+
require_once '${model.const.Name.toLowerCase()}_sdk.php';
|
|
20
20
|
$client = new ${model.const.Name}SDK($options);
|
|
21
21
|
\`\`\`
|
|
22
22
|
|
|
@@ -22,7 +22,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
22
22
|
|
|
23
23
|
\`\`\`php
|
|
24
24
|
<?php
|
|
25
|
-
require_once '${model.
|
|
25
|
+
require_once '${model.const.Name.toLowerCase()}_sdk.php';
|
|
26
26
|
|
|
27
27
|
$client = new ${model.const.Name}SDK([
|
|
28
28
|
"apikey" => getenv("${model.NAME}_APIKEY"),
|
|
@@ -17,7 +17,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
17
17
|
|
|
18
18
|
Content(`\`\`\`php
|
|
19
19
|
<?php
|
|
20
|
-
require_once '${model.
|
|
20
|
+
require_once '${model.const.Name.toLowerCase()}_sdk.php';
|
|
21
21
|
|
|
22
22
|
$client = new ${model.const.Name}SDK([
|
|
23
23
|
"apikey" => getenv("${model.NAME}_APIKEY"),
|
|
@@ -86,7 +86,7 @@ declare(strict_types=1);
|
|
|
86
86
|
|
|
87
87
|
// ${entity.Name} direct test
|
|
88
88
|
|
|
89
|
-
require_once __DIR__ . '/../${model.
|
|
89
|
+
require_once __DIR__ . '/../${model.const.Name.toLowerCase()}_sdk.php';
|
|
90
90
|
require_once __DIR__ . '/Runner.php';
|
|
91
91
|
|
|
92
92
|
use PHPUnit\\Framework\\TestCase;
|
|
@@ -74,7 +74,7 @@ declare(strict_types=1);
|
|
|
74
74
|
|
|
75
75
|
// ${entity.Name} entity test
|
|
76
76
|
|
|
77
|
-
require_once __DIR__ . '/../${model.
|
|
77
|
+
require_once __DIR__ . '/../${model.const.Name.toLowerCase()}_sdk.php';
|
|
78
78
|
require_once __DIR__ . '/Runner.php';
|
|
79
79
|
|
|
80
80
|
use PHPUnit\\Framework\\TestCase;
|
|
@@ -18,7 +18,7 @@ Use \`helpers.to_map()\` to safely validate that a value is a dict.
|
|
|
18
18
|
|
|
19
19
|
\`\`\`
|
|
20
20
|
py/
|
|
21
|
-
├── ${model.
|
|
21
|
+
├── ${model.const.Name.toLowerCase()}_sdk.py -- Main SDK module
|
|
22
22
|
├── config.py -- Configuration
|
|
23
23
|
├── features.py -- Feature factory
|
|
24
24
|
├── core/ -- Core types and context
|
|
@@ -28,7 +28,7 @@ py/
|
|
|
28
28
|
└── test/ -- Test suites
|
|
29
29
|
\`\`\`
|
|
30
30
|
|
|
31
|
-
The main module (\`${model.
|
|
31
|
+
The main module (\`${model.const.Name.toLowerCase()}_sdk\`) exports the SDK class.
|
|
32
32
|
Import entity or utility modules directly only when needed.
|
|
33
33
|
|
|
34
34
|
`)
|
|
@@ -16,7 +16,7 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
16
16
|
Content(`### ${model.const.Name}SDK
|
|
17
17
|
|
|
18
18
|
\`\`\`python
|
|
19
|
-
from ${model.
|
|
19
|
+
from ${model.const.Name.toLowerCase()}_sdk import ${model.const.Name}SDK
|
|
20
20
|
|
|
21
21
|
client = ${model.const.Name}SDK(options)
|
|
22
22
|
\`\`\`
|
|
@@ -22,7 +22,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
22
22
|
|
|
23
23
|
\`\`\`python
|
|
24
24
|
import os
|
|
25
|
-
from ${model.
|
|
25
|
+
from ${model.const.Name.toLowerCase()}_sdk import ${model.const.Name}SDK
|
|
26
26
|
|
|
27
27
|
client = ${model.const.Name}SDK({
|
|
28
28
|
"apikey": os.environ.get("${model.NAME}_APIKEY"),
|
|
@@ -17,7 +17,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
17
17
|
|
|
18
18
|
Content(`\`\`\`python
|
|
19
19
|
import os
|
|
20
|
-
from ${model.
|
|
20
|
+
from ${model.const.Name.toLowerCase()}_sdk import ${model.const.Name}SDK
|
|
21
21
|
|
|
22
22
|
client = ${model.const.Name}SDK({
|
|
23
23
|
"apikey": os.environ.get("${model.NAME}_APIKEY"),
|
|
@@ -87,7 +87,7 @@ import json
|
|
|
87
87
|
import pytest
|
|
88
88
|
|
|
89
89
|
from utility.voxgig_struct import voxgig_struct as vs
|
|
90
|
-
from ${model.
|
|
90
|
+
from ${model.const.Name.toLowerCase()}_sdk import ${model.const.Name}SDK
|
|
91
91
|
from core import helpers
|
|
92
92
|
from test import runner
|
|
93
93
|
|
|
@@ -70,7 +70,7 @@ import time
|
|
|
70
70
|
import pytest
|
|
71
71
|
|
|
72
72
|
from utility.voxgig_struct import voxgig_struct as vs
|
|
73
|
-
from ${model.
|
|
73
|
+
from ${model.const.Name.toLowerCase()}_sdk import ${model.const.Name}SDK
|
|
74
74
|
from core import helpers
|
|
75
75
|
|
|
76
76
|
_TEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
@@ -31,7 +31,7 @@ const Test = cmp(function Test(props: any) {
|
|
|
31
31
|
Content(`# ProjectName SDK exists test
|
|
32
32
|
|
|
33
33
|
import pytest
|
|
34
|
-
from ${model.
|
|
34
|
+
from ${model.const.Name.toLowerCase()}_sdk import ${model.const.Name}SDK
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
class TestExists:
|
|
@@ -36,7 +36,7 @@ gemspec
|
|
|
36
36
|
})
|
|
37
37
|
|
|
38
38
|
// Generate gemspec
|
|
39
|
-
File({ name: model.
|
|
39
|
+
File({ name: model.const.Name + '_sdk.gemspec' }, () => {
|
|
40
40
|
Content(`Gem::Specification.new do |spec|
|
|
41
41
|
spec.name = "${model.name}-sdk"
|
|
42
42
|
spec.version = "0.0.1"
|
|
@@ -18,7 +18,7 @@ Use \`Helpers.to_map()\` to safely validate that a value is a hash.
|
|
|
18
18
|
|
|
19
19
|
\`\`\`
|
|
20
20
|
rb/
|
|
21
|
-
├── ${model.
|
|
21
|
+
├── ${model.const.Name}_sdk.rb -- Main SDK module
|
|
22
22
|
├── config.rb -- Configuration
|
|
23
23
|
├── features.rb -- Feature factory
|
|
24
24
|
├── core/ -- Core types and context
|
|
@@ -28,7 +28,7 @@ rb/
|
|
|
28
28
|
└── test/ -- Test suites
|
|
29
29
|
\`\`\`
|
|
30
30
|
|
|
31
|
-
The main module (\`${model.
|
|
31
|
+
The main module (\`${model.const.Name}_sdk\`) exports the SDK class
|
|
32
32
|
and test helper. Import entity or utility modules directly only
|
|
33
33
|
when needed.
|
|
34
34
|
|
|
@@ -16,7 +16,7 @@ const ReadmeModel = cmp(function ReadmeModel(props: any) {
|
|
|
16
16
|
Content(`### ${model.const.Name}SDK
|
|
17
17
|
|
|
18
18
|
\`\`\`ruby
|
|
19
|
-
require_relative "${model.
|
|
19
|
+
require_relative "${model.const.Name}_sdk"
|
|
20
20
|
client = ${model.const.Name}SDK.new(options)
|
|
21
21
|
\`\`\`
|
|
22
22
|
|
|
@@ -21,7 +21,7 @@ const ReadmeQuick = cmp(function ReadmeQuick(props: any) {
|
|
|
21
21
|
Content(`### 1. Create a client
|
|
22
22
|
|
|
23
23
|
\`\`\`ruby
|
|
24
|
-
require_relative "${model.
|
|
24
|
+
require_relative "${model.const.Name}_sdk"
|
|
25
25
|
|
|
26
26
|
client = ${model.const.Name}SDK.new({
|
|
27
27
|
"apikey" => ENV["${model.NAME}_APIKEY"],
|
|
@@ -16,7 +16,7 @@ const ReadmeTopQuick = cmp(function ReadmeTopQuick(props: any) {
|
|
|
16
16
|
const exampleEntity = Object.values(entity).find((e: any) => e.active !== false) as any
|
|
17
17
|
|
|
18
18
|
Content(`\`\`\`ruby
|
|
19
|
-
require_relative "${model.
|
|
19
|
+
require_relative "${model.const.Name}_sdk"
|
|
20
20
|
|
|
21
21
|
client = ${model.const.Name}SDK.new({
|
|
22
22
|
"apikey" => ENV["${model.NAME}_APIKEY"],
|
|
@@ -85,7 +85,7 @@ const TestDirect = cmp(function TestDirect(props: any) {
|
|
|
85
85
|
|
|
86
86
|
require "minitest/autorun"
|
|
87
87
|
require "json"
|
|
88
|
-
require_relative "../${model.
|
|
88
|
+
require_relative "../${model.const.Name}_sdk"
|
|
89
89
|
require_relative "runner"
|
|
90
90
|
|
|
91
91
|
class ${entity.Name}DirectTest < Minitest::Test
|
|
@@ -65,7 +65,7 @@ const TestEntity = cmp(function TestEntity(props: any) {
|
|
|
65
65
|
|
|
66
66
|
require "minitest/autorun"
|
|
67
67
|
require "json"
|
|
68
|
-
require_relative "../${model.
|
|
68
|
+
require_relative "../${model.const.Name}_sdk"
|
|
69
69
|
require_relative "runner"
|
|
70
70
|
|
|
71
71
|
class ${entity.Name}EntityTest < Minitest::Test
|
|
@@ -26,7 +26,7 @@ const Test = cmp(function Test(props: any) {
|
|
|
26
26
|
Content(`# ${model.const.Name} SDK exists test
|
|
27
27
|
|
|
28
28
|
require "minitest/autorun"
|
|
29
|
-
require_relative "../${model.
|
|
29
|
+
require_relative "../${model.const.Name}_sdk"
|
|
30
30
|
|
|
31
31
|
class ExistsTest < Minitest::Test
|
|
32
32
|
def test_create_test_sdk
|