sparkling-method-cli 2.0.0-rc.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.
- package/LICENSE +201 -0
- package/README.md +37 -0
- package/dist/codegen/definition-parser.d.ts +5 -0
- package/dist/codegen/definition-parser.d.ts.map +1 -0
- package/dist/codegen/definition-parser.js +376 -0
- package/dist/codegen/definition-parser.js.map +1 -0
- package/dist/codegen/index.d.ts +3 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +99 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/codegen/kotlin.d.ts +4 -0
- package/dist/codegen/kotlin.d.ts.map +1 -0
- package/dist/codegen/kotlin.js +273 -0
- package/dist/codegen/kotlin.js.map +1 -0
- package/dist/codegen/metadata.d.ts +4 -0
- package/dist/codegen/metadata.d.ts.map +1 -0
- package/dist/codegen/metadata.js +78 -0
- package/dist/codegen/metadata.js.map +1 -0
- package/dist/codegen/swift.d.ts +4 -0
- package/dist/codegen/swift.d.ts.map +1 -0
- package/dist/codegen/swift.js +145 -0
- package/dist/codegen/swift.js.map +1 -0
- package/dist/codegen/template/android/kotlin-idl-template +119 -0
- package/dist/codegen/template/android/kotlin-impl-template +0 -0
- package/dist/codegen/template/ios/oc-idl-template +0 -0
- package/dist/codegen/template/ios/oc-impl-template +0 -0
- package/dist/codegen/template/ios/swift-idl-template +83 -0
- package/dist/codegen/template/ios/swift-impl-template +0 -0
- package/dist/codegen/template/ts/call-template +0 -0
- package/dist/codegen/template/ts/ts-idl-template +66 -0
- package/dist/codegen/template/ts/ts-impl-template +78 -0
- package/dist/codegen/template/ts/ts-index-template +13 -0
- package/dist/codegen/types.d.ts +157 -0
- package/dist/codegen/types.d.ts.map +1 -0
- package/dist/codegen/types.js +3 -0
- package/dist/codegen/types.js.map +1 -0
- package/dist/codegen/typescript.d.ts +8 -0
- package/dist/codegen/typescript.d.ts.map +1 -0
- package/dist/codegen/typescript.js +232 -0
- package/dist/codegen/typescript.js.map +1 -0
- package/dist/codegen/utils.d.ts +10 -0
- package/dist/codegen/utils.d.ts.map +1 -0
- package/dist/codegen/utils.js +144 -0
- package/dist/codegen/utils.js.map +1 -0
- package/dist/create/index.d.ts +3 -0
- package/dist/create/index.d.ts.map +1 -0
- package/dist/create/index.js +44 -0
- package/dist/create/index.js.map +1 -0
- package/dist/create/prompts.d.ts +7 -0
- package/dist/create/prompts.d.ts.map +1 -0
- package/dist/create/prompts.js +61 -0
- package/dist/create/prompts.js.map +1 -0
- package/dist/create/scaffold.d.ts +9 -0
- package/dist/create/scaffold.d.ts.map +1 -0
- package/dist/create/scaffold.js +131 -0
- package/dist/create/scaffold.js.map +1 -0
- package/dist/create/template/README.md +17 -0
- package/dist/create/template/android/.gitkeep +1 -0
- package/dist/create/template/ios/.gitkeep +1 -0
- package/dist/create/template/src/method.d.ts +17 -0
- package/dist/create/templates.d.ts +5 -0
- package/dist/create/templates.d.ts.map +1 -0
- package/dist/create/templates.js +75 -0
- package/dist/create/templates.js.map +1 -0
- package/dist/create/types.d.ts +12 -0
- package/dist/create/types.d.ts.map +1 -0
- package/dist/create/types.js +3 -0
- package/dist/create/types.js.map +1 -0
- package/dist/create/utils.d.ts +3 -0
- package/dist/create/utils.d.ts.map +1 -0
- package/dist/create/utils.js +19 -0
- package/dist/create/utils.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/ui.d.ts +13 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +82 -0
- package/dist/ui.js.map +1 -0
- package/dist/verbose.d.ts +4 -0
- package/dist/verbose.d.ts.map +1 -0
- package/dist/verbose.js +25 -0
- package/dist/verbose.js.map +1 -0
- package/package.json +44 -0
- package/templates/sparkling-app-template-android-groovy/android/sparkling-method-media/build.gradle +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swift.js","sourceRoot":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,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACxC,KAAK,QAAQ;YACX,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrC;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,cAAc,CAClC,IAAY,EACZ,MAAoB,EACpB,MAAwB,EACxB,IAAuB,EACvB,QAAgB;IAEhB,MAAM,SAAS,GAAG,IAAA,oBAAY,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAA,oBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAChF,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,SAAS,WAAW,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,kBAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACjD,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
package {{packageName}}.{{moduleName}}.{{methodName}}
|
|
2
|
+
|
|
3
|
+
import com.tiktok.sparkling.method.registry.core.annotation.DefaultType
|
|
4
|
+
import com.tiktok.sparkling.method.registry.core.annotation.IDLMethodIntEnum
|
|
5
|
+
import com.tiktok.sparkling.method.registry.core.annotation.IDLMethodName
|
|
6
|
+
import com.tiktok.sparkling.method.registry.core.annotation.IDLMethodParamField
|
|
7
|
+
import com.tiktok.sparkling.method.registry.core.annotation.IDLMethodParamModel
|
|
8
|
+
import com.tiktok.sparkling.method.registry.core.annotation.IDLMethodResultModel
|
|
9
|
+
import com.tiktok.sparkling.method.registry.core.annotation.IDLMethodStringEnum
|
|
10
|
+
import com.tiktok.sparkling.method.registry.core.annotation.MethodParamDefaultValue
|
|
11
|
+
import com.tiktok.sparkling.method.registry.core.base.AbsSparklingIDLMethod
|
|
12
|
+
import com.tiktok.sparkling.method.registry.core.model.idl.IDLMethodBaseModel
|
|
13
|
+
import com.tiktok.sparkling.method.registry.core.model.idl.IDLMethodBaseParamModel
|
|
14
|
+
import com.tiktok.sparkling.method.registry.core.model.idl.IDLMethodBaseResultModel
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* GENERATED BY SPARKLING METHOD CLI.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
abstract class {{className}} : AbsSparklingIDLMethod<{{className}}.IDLMethod{{fullName}}InputModel, {{className}}.IDLMethod{{fullName}}ResultModel>() {
|
|
22
|
+
|
|
23
|
+
@IDLMethodName(name = "{{moduleName}}.{{methodName}}"{{#params}}, params = [{{{str}}}]{{/params}}{{#results}}, results = [{{{str}}}]{{/results}})
|
|
24
|
+
final override val name: String = "{{moduleName}}.{{methodName}}"
|
|
25
|
+
|
|
26
|
+
@IDLMethodParamModel
|
|
27
|
+
interface IDLMethod{{fullName}}InputModel : IDLMethodBaseParamModel {
|
|
28
|
+
{{#request.topItem.needCompanion}}
|
|
29
|
+
companion object{
|
|
30
|
+
{{#request.topItem.items}}
|
|
31
|
+
{{#enum}}
|
|
32
|
+
const val {{wrapperName}} = {{{wrapperValue}}}
|
|
33
|
+
{{/enum}}
|
|
34
|
+
{{/request.topItem.items}}
|
|
35
|
+
}
|
|
36
|
+
{{/request.topItem.needCompanion}}
|
|
37
|
+
{{#request.topItem.items}}
|
|
38
|
+
|
|
39
|
+
{{#enumType}}
|
|
40
|
+
@get:{{.}}({{#enum}}{{wrapperName}}{{#comma}},{{/comma}}{{/enum}})
|
|
41
|
+
{{/enumType}}
|
|
42
|
+
@get:IDLMethodParamField(required = {{required}}, isGetter = true, keyPath = "{{title}}"{{#annotation}}, {{{.}}}{{/annotation}}{{#enumType}}, isEnum = true{{/enumType}}{{#default}}, defaultValue = {{{default}}}{{/default}})
|
|
43
|
+
val {{field}}: {{{className}}}{{#nullable}}?{{/nullable}} {{explanation}}
|
|
44
|
+
{{/request.topItem.items}}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@IDLMethodResultModel
|
|
48
|
+
interface IDLMethod{{fullName}}ResultModel: IDLMethodBaseResultModel {
|
|
49
|
+
{{#response.topItem.needCompanion}}
|
|
50
|
+
companion object{
|
|
51
|
+
{{#response.topItem.items}}
|
|
52
|
+
{{#enum}}
|
|
53
|
+
const val {{wrapperName}} = {{{wrapperValue}}}
|
|
54
|
+
{{/enum}}
|
|
55
|
+
{{/response.topItem.items}}
|
|
56
|
+
}
|
|
57
|
+
{{/response.topItem.needCompanion}}
|
|
58
|
+
{{#response.topItem.items}}
|
|
59
|
+
|
|
60
|
+
{{#enumType}}
|
|
61
|
+
@get:{{.}}({{#enum}}{{wrapperName}}{{#comma}}, {{/comma}}{{/enum}})
|
|
62
|
+
{{/enumType}}
|
|
63
|
+
{{#enumType}}
|
|
64
|
+
@set:{{.}}({{#enum}}{{wrapperName}}{{#comma}}, {{/comma}}{{/enum}})
|
|
65
|
+
{{/enumType}}
|
|
66
|
+
@get:IDLMethodParamField(required = {{required}}, isGetter = true, keyPath = "{{title}}"{{#annotation}}, {{{.}}}{{/annotation}}{{#enumType}}, isEnum = true{{/enumType}})
|
|
67
|
+
@set:IDLMethodParamField(required = {{required}}, isGetter = false, keyPath = "{{title}}"{{#annotation}}, {{{.}}}{{/annotation}}{{#enumType}}, isEnum = true{{/enumType}})
|
|
68
|
+
var {{field}}: {{{className}}}? {{explanation}}
|
|
69
|
+
{{/response.topItem.items}}
|
|
70
|
+
}
|
|
71
|
+
{{#request.clazz}}
|
|
72
|
+
|
|
73
|
+
interface {{name}} : IDLMethodBaseModel {
|
|
74
|
+
{{#needCompanion}}
|
|
75
|
+
companion object{
|
|
76
|
+
{{#items}}
|
|
77
|
+
{{#enum}}
|
|
78
|
+
const val {{wrapperName}} = {{{wrapperValue}}}
|
|
79
|
+
{{/enum}}
|
|
80
|
+
{{/items}}
|
|
81
|
+
}
|
|
82
|
+
{{/needCompanion}}
|
|
83
|
+
{{#items}}
|
|
84
|
+
|
|
85
|
+
{{#enumType}}
|
|
86
|
+
@get:{{.}}({{#enum}}{{wrapperName}}{{#comma}},{{/comma}}{{/enum}})
|
|
87
|
+
{{/enumType}}
|
|
88
|
+
@get:IDLMethodParamField(required = {{required}}, isGetter = true, keyPath = "{{title}}"{{#annotation}}, {{{.}}}{{/annotation}}{{#enumType}}, isEnum = true{{/enumType}}{{#default}}, defaultValue = {{{default}}}{{/default}})
|
|
89
|
+
val {{field}}: {{{className}}}{{#nullable}}?{{/nullable}} {{explanation}}
|
|
90
|
+
{{/items}}
|
|
91
|
+
}
|
|
92
|
+
{{/request.clazz}}
|
|
93
|
+
{{#response.clazz}}
|
|
94
|
+
|
|
95
|
+
interface {{name}} : IDLMethodBaseModel {
|
|
96
|
+
{{#needCompanion}}
|
|
97
|
+
companion object{
|
|
98
|
+
{{#items}}
|
|
99
|
+
{{#enum}}
|
|
100
|
+
const val {{wrapperName}} = {{{wrapperValue}}}
|
|
101
|
+
{{/enum}}
|
|
102
|
+
{{/items}}
|
|
103
|
+
}
|
|
104
|
+
{{/needCompanion}}
|
|
105
|
+
{{#items}}
|
|
106
|
+
|
|
107
|
+
{{#enumType}}
|
|
108
|
+
@get:{{.}}({{#enum}}{{wrapperName}}{{#comma}},{{/comma}}{{/enum}})
|
|
109
|
+
{{/enumType}}
|
|
110
|
+
{{#enumType}}
|
|
111
|
+
@set:{{.}}({{#enum}}{{wrapperName}}{{#comma}},{{/comma}}{{/enum}})
|
|
112
|
+
{{/enumType}}
|
|
113
|
+
@get:IDLMethodParamField(required = {{required}}, isGetter = true, keyPath = "{{title}}"{{#annotation}}, {{{.}}}{{/annotation}}{{#enumType}}, isEnum = true{{/enumType}})
|
|
114
|
+
@set:IDLMethodParamField(required = {{required}}, isGetter = false, keyPath = "{{title}}"{{#annotation}}, {{{.}}}{{/annotation}}{{#enumType}}, isEnum = true{{/enumType}})
|
|
115
|
+
var {{field}}: {{{className}}}? {{explanation}}
|
|
116
|
+
{{/items}}
|
|
117
|
+
}
|
|
118
|
+
{{/response.clazz}}
|
|
119
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Copyright 2025 The Sparkling Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import Foundation
|
|
6
|
+
import SparklingMethod
|
|
7
|
+
|
|
8
|
+
// Auto-generated temporary model types
|
|
9
|
+
{{#extraTypes}}
|
|
10
|
+
@objc({{{objcName}}})
|
|
11
|
+
public class {{structName}}: NSObject {
|
|
12
|
+
{{#hasFields}}
|
|
13
|
+
@objc public var {{name}}: {{type}}{{#optional}}?{{/optional}}
|
|
14
|
+
{{/hasFields}}
|
|
15
|
+
{{^hasFields}}
|
|
16
|
+
// No fields defined.
|
|
17
|
+
{{/hasFields}}
|
|
18
|
+
|
|
19
|
+
@objc public class func jsonKeyPathsByPropertyKey() -> [AnyHashable: Any] {
|
|
20
|
+
return {
|
|
21
|
+
{{#hasFields}}
|
|
22
|
+
"{{name}}": "{{name}}"{{^isLast}},{{/isLast}}
|
|
23
|
+
{{/hasFields}}
|
|
24
|
+
}()
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
{{/extraTypes}}
|
|
29
|
+
// Parameter model
|
|
30
|
+
@objc({{request.objcName}})
|
|
31
|
+
public class {{request.structName}}: SPKMethodModel {
|
|
32
|
+
{{#request.hasFields}}
|
|
33
|
+
@objc public var {{name}}: {{type}}{{#optional}}?{{/optional}}{{#defaultValue}} = {{.}}{{/defaultValue}}
|
|
34
|
+
{{/request.hasFields}}
|
|
35
|
+
|
|
36
|
+
@objc public override class func requiredKeyPaths() -> Set<String>? {
|
|
37
|
+
return nil
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@objc public override class func jsonKeyPathsByPropertyKey() -> [AnyHashable: Any] {
|
|
41
|
+
return {
|
|
42
|
+
{{#request.hasFields}}
|
|
43
|
+
"{{name}}": "{{name}}"{{^isLast}},{{/isLast}}
|
|
44
|
+
{{/request.hasFields}}
|
|
45
|
+
}()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Result model
|
|
50
|
+
@objc({{response.objcName}})
|
|
51
|
+
public class {{response.structName}}: SPKMethodModel {
|
|
52
|
+
{{#response.hasFields}}
|
|
53
|
+
@objc public var {{name}}: {{type}}{{#optional}}?{{/optional}}{{#defaultValue}} = {{.}}{{/defaultValue}}
|
|
54
|
+
{{/response.hasFields}}
|
|
55
|
+
|
|
56
|
+
@objc public override class func jsonKeyPathsByPropertyKey() -> [AnyHashable: Any] {
|
|
57
|
+
return {
|
|
58
|
+
{{#response.hasFields}}
|
|
59
|
+
"{{name}}": "{{name}}"{{^isLast}},{{/isLast}}
|
|
60
|
+
{{/response.hasFields}}
|
|
61
|
+
}()
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Main method class
|
|
66
|
+
@objc({{methodObjcName}})
|
|
67
|
+
public class {{methodClassName}}: PipeMethod {
|
|
68
|
+
@objc public override var paramsModelClass: AnyClass {
|
|
69
|
+
return {{request.structName}}.self
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@objc public override var resultModelClass: AnyClass {
|
|
73
|
+
return {{response.structName}}.self
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public override var methodName: String {
|
|
77
|
+
return "{{moduleName}}.{{methodName}}"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public override class func methodName() -> String {
|
|
81
|
+
return "{{moduleName}}.{{methodName}}"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright (c) 2025 TikTok Pte. Ltd.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
{{#extraInterfaces}}
|
|
6
|
+
{{#description}}
|
|
7
|
+
/**
|
|
8
|
+
* {{description}}
|
|
9
|
+
*/
|
|
10
|
+
{{/description}}
|
|
11
|
+
export interface {{name}} {
|
|
12
|
+
{{#fields}}
|
|
13
|
+
{{#description}}
|
|
14
|
+
/**
|
|
15
|
+
* {{description}}
|
|
16
|
+
*/
|
|
17
|
+
{{/description}}
|
|
18
|
+
{{name}}{{#optional}}?{{/optional}}: {{type}};
|
|
19
|
+
{{/fields}}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
{{/extraInterfaces}}
|
|
23
|
+
{{#requestInterface}}
|
|
24
|
+
{{#description}}
|
|
25
|
+
/**
|
|
26
|
+
* {{description}}
|
|
27
|
+
*/
|
|
28
|
+
{{/description}}
|
|
29
|
+
export interface {{name}} {
|
|
30
|
+
{{#fields}}
|
|
31
|
+
{{#description}}
|
|
32
|
+
/**
|
|
33
|
+
* {{description}}
|
|
34
|
+
*/
|
|
35
|
+
{{/description}}
|
|
36
|
+
{{name}}{{#optional}}?{{/optional}}: {{type}};
|
|
37
|
+
{{/fields}}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
{{/requestInterface}}
|
|
41
|
+
{{#responseInterface}}
|
|
42
|
+
{{#description}}
|
|
43
|
+
/**
|
|
44
|
+
* {{description}}
|
|
45
|
+
*/
|
|
46
|
+
{{/description}}
|
|
47
|
+
export interface {{name}} {
|
|
48
|
+
{{#fields}}
|
|
49
|
+
{{#description}}
|
|
50
|
+
/**
|
|
51
|
+
* {{description}}
|
|
52
|
+
*/
|
|
53
|
+
{{/description}}
|
|
54
|
+
{{name}}{{#optional}}?{{/optional}}: {{type}};
|
|
55
|
+
{{/fields}}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
{{/responseInterface}}
|
|
59
|
+
/**
|
|
60
|
+
* {{methodName}} method
|
|
61
|
+
{{#hasRequestParams}}
|
|
62
|
+
* @param params - The request parameters
|
|
63
|
+
{{/hasRequestParams}}
|
|
64
|
+
* @param callback - Callback function to handle the response
|
|
65
|
+
*/
|
|
66
|
+
declare function {{methodCamelCase}}({{#hasRequestParams}}params: {{requestInterface.name}}, {{/hasRequestParams}}callback: (result: {{responseInterface.name}}) => void): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import pipe from '{{packageName}}';
|
|
2
|
+
import type { {{requestInterface.name}}, {{responseInterface.name}}{{#extraInterfaces}}, {{name}}{{/extraInterfaces}} } from './{{methodName}}.d';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* {{methodName}} method
|
|
6
|
+
{{#hasRequestParams}}
|
|
7
|
+
* @param params - The request parameters
|
|
8
|
+
{{/hasRequestParams}}
|
|
9
|
+
* @param callback - Callback function to handle the response
|
|
10
|
+
{{#validationRules}}
|
|
11
|
+
{{#field}}
|
|
12
|
+
* @throws Will call callback with error if {{field}} validation fails
|
|
13
|
+
{{/field}}
|
|
14
|
+
{{/validationRules}}
|
|
15
|
+
*/
|
|
16
|
+
export function {{methodCamelCase}}({{#hasRequestParams}}params: {{requestInterface.name}}, {{/hasRequestParams}}callback: (result: {{responseInterface.name}}) => void): void {
|
|
17
|
+
// Parameter validation
|
|
18
|
+
if (!params) {
|
|
19
|
+
const errorResponse: {{responseInterface.name}} = {
|
|
20
|
+
code: -1,
|
|
21
|
+
msg: 'Invalid params: params cannot be null or undefined',
|
|
22
|
+
{{#hasResponseData}}
|
|
23
|
+
data: undefined,
|
|
24
|
+
{{/hasResponseData}}
|
|
25
|
+
};
|
|
26
|
+
if (typeof callback === 'function') {
|
|
27
|
+
callback(errorResponse);
|
|
28
|
+
}
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
{{#validationRules}}
|
|
33
|
+
{{#field}}
|
|
34
|
+
{{^jsType}}
|
|
35
|
+
// null-check validation for params
|
|
36
|
+
{{/jsType}}
|
|
37
|
+
{{#jsType}}
|
|
38
|
+
// type-check validation for {{field}}
|
|
39
|
+
if (!params.{{field}} || typeof params.{{field}} !== '{{jsType}}'{{#trimValue}} || !params.{{field}}.trim(){{/trimValue}}) {
|
|
40
|
+
const errorResponse: {{../responseInterface.name}} = {
|
|
41
|
+
code: -1,
|
|
42
|
+
msg: '{{errorMessage}}',
|
|
43
|
+
{{#../hasResponseData}}
|
|
44
|
+
data: undefined,
|
|
45
|
+
{{/../hasResponseData}}
|
|
46
|
+
};
|
|
47
|
+
if (typeof callback === 'function') {
|
|
48
|
+
callback(errorResponse);
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
{{/jsType}}
|
|
53
|
+
{{/field}}
|
|
54
|
+
{{/validationRules}}
|
|
55
|
+
|
|
56
|
+
// Callback validation
|
|
57
|
+
if (typeof callback !== 'function') {
|
|
58
|
+
console.error('[{{moduleName}}] {{methodCamelCase}}: callback must be a function');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Pipe call
|
|
63
|
+
pipe.call('{{pipeCall.methodString}}', {
|
|
64
|
+
{{#pipeCall.params}}
|
|
65
|
+
{{.}},
|
|
66
|
+
{{/pipeCall.params}}
|
|
67
|
+
}, (v: unknown) => {
|
|
68
|
+
// Type assertion and response normalization
|
|
69
|
+
const response = v as {{responseInterface.name}};
|
|
70
|
+
callback({
|
|
71
|
+
code: response?.code ?? -1,
|
|
72
|
+
msg: response?.msg ?? 'Unknown error',
|
|
73
|
+
{{#hasResponseData}}
|
|
74
|
+
data: response?.data,
|
|
75
|
+
{{/hasResponseData}}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright (c) 2025 TikTok Pte. Ltd.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
// Re-export implementations
|
|
6
|
+
{{#methods}}
|
|
7
|
+
export * from './src/{{methodKebab}}/{{methodKebab}}';
|
|
8
|
+
{{/methods}}
|
|
9
|
+
|
|
10
|
+
// Explicitly export types
|
|
11
|
+
{{#methods}}
|
|
12
|
+
export type { {{requestInterface}}{{#responseInterface}}, {{responseInterface}}{{/responseInterface}}{{#extraInterfaces}}{{#.}}, {{.}}{{/.}}{{/extraInterfaces}} } from './src/{{methodKebab}}/{{methodKebab}}.d';
|
|
13
|
+
{{/methods}}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export interface CodegenOptions {
|
|
2
|
+
src?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ModuleConfig {
|
|
5
|
+
packageName: string;
|
|
6
|
+
moduleName: string;
|
|
7
|
+
}
|
|
8
|
+
export type PrimitiveKind = 'string' | 'number' | 'boolean' | 'void' | 'object' | 'any';
|
|
9
|
+
export interface DefaultValue {
|
|
10
|
+
kind: 'string' | 'number' | 'boolean';
|
|
11
|
+
value: string | number | boolean;
|
|
12
|
+
}
|
|
13
|
+
export type TypeSummary = {
|
|
14
|
+
kind: 'primitive';
|
|
15
|
+
name: PrimitiveKind;
|
|
16
|
+
text?: string;
|
|
17
|
+
enumValues?: Array<string | number | boolean>;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'array';
|
|
20
|
+
elementType: TypeSummary;
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'reference';
|
|
23
|
+
name: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'object';
|
|
26
|
+
fields: FieldSummary[];
|
|
27
|
+
};
|
|
28
|
+
export interface FieldSummary {
|
|
29
|
+
name: string;
|
|
30
|
+
optional: boolean;
|
|
31
|
+
description?: string;
|
|
32
|
+
type: TypeSummary;
|
|
33
|
+
defaultValue?: DefaultValue;
|
|
34
|
+
}
|
|
35
|
+
export interface ObjectDefinition {
|
|
36
|
+
name?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
fields: FieldSummary[];
|
|
39
|
+
}
|
|
40
|
+
export interface MethodDefinition {
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
request?: TypeSummary;
|
|
44
|
+
response?: TypeSummary;
|
|
45
|
+
source: string;
|
|
46
|
+
interfaces: Record<string, ObjectDefinition>;
|
|
47
|
+
}
|
|
48
|
+
export interface KotlinTemplateView {
|
|
49
|
+
packageName: string;
|
|
50
|
+
moduleName: string;
|
|
51
|
+
methodName: string;
|
|
52
|
+
className: string;
|
|
53
|
+
fullName: string;
|
|
54
|
+
params?: {
|
|
55
|
+
value: string[];
|
|
56
|
+
str: string;
|
|
57
|
+
};
|
|
58
|
+
results?: {
|
|
59
|
+
value: string[];
|
|
60
|
+
str: string;
|
|
61
|
+
};
|
|
62
|
+
request: KotlinModelView;
|
|
63
|
+
response: KotlinModelView;
|
|
64
|
+
}
|
|
65
|
+
export interface KotlinModelView {
|
|
66
|
+
topItem?: KotlinObjectView;
|
|
67
|
+
clazz: KotlinInnerClass[];
|
|
68
|
+
}
|
|
69
|
+
export interface KotlinObjectView {
|
|
70
|
+
needCompanion: boolean;
|
|
71
|
+
items: KotlinFieldView[];
|
|
72
|
+
}
|
|
73
|
+
export interface KotlinInnerClass extends KotlinObjectView {
|
|
74
|
+
name: string;
|
|
75
|
+
}
|
|
76
|
+
export interface KotlinFieldView {
|
|
77
|
+
title: string;
|
|
78
|
+
field: string;
|
|
79
|
+
className: string;
|
|
80
|
+
required: boolean;
|
|
81
|
+
nullable: boolean;
|
|
82
|
+
annotation?: string;
|
|
83
|
+
default?: string;
|
|
84
|
+
enumType?: string;
|
|
85
|
+
enum?: KotlinEnumEntry[];
|
|
86
|
+
explanation?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface KotlinEnumEntry {
|
|
89
|
+
wrapperName: string;
|
|
90
|
+
wrapperValue: string;
|
|
91
|
+
comma: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface SwiftFieldView {
|
|
94
|
+
name: string;
|
|
95
|
+
type: string;
|
|
96
|
+
optional: boolean;
|
|
97
|
+
comment?: string;
|
|
98
|
+
defaultValue?: string;
|
|
99
|
+
isLast: boolean;
|
|
100
|
+
}
|
|
101
|
+
export interface SwiftStructView {
|
|
102
|
+
structName: string;
|
|
103
|
+
objcName: string;
|
|
104
|
+
hasFields: boolean;
|
|
105
|
+
fields: SwiftFieldView[];
|
|
106
|
+
}
|
|
107
|
+
export interface SwiftTemplateView {
|
|
108
|
+
moduleName: string;
|
|
109
|
+
methodName: string;
|
|
110
|
+
methodClassName: string;
|
|
111
|
+
methodObjcName: string;
|
|
112
|
+
request: SwiftStructView;
|
|
113
|
+
response: SwiftStructView;
|
|
114
|
+
extraTypes: SwiftStructView[];
|
|
115
|
+
}
|
|
116
|
+
export interface TypeScriptFieldView {
|
|
117
|
+
name: string;
|
|
118
|
+
type: string;
|
|
119
|
+
optional: boolean;
|
|
120
|
+
description?: string;
|
|
121
|
+
defaultValue?: string;
|
|
122
|
+
jsType?: string;
|
|
123
|
+
isLast: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface TypeScriptInterfaceView {
|
|
126
|
+
name: string;
|
|
127
|
+
fields: TypeScriptFieldView[];
|
|
128
|
+
hasFields: boolean;
|
|
129
|
+
description?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface TypeScriptValidationRule {
|
|
132
|
+
field: string;
|
|
133
|
+
type: 'null-check' | 'type-check' | 'range-check' | 'custom';
|
|
134
|
+
jsType?: string;
|
|
135
|
+
condition?: string;
|
|
136
|
+
errorMessage: string;
|
|
137
|
+
trimValue?: boolean;
|
|
138
|
+
defaultValue?: string;
|
|
139
|
+
}
|
|
140
|
+
export interface TypeScriptTemplateView {
|
|
141
|
+
moduleName: string;
|
|
142
|
+
methodName: string;
|
|
143
|
+
methodCamelCase: string;
|
|
144
|
+
methodPascalCase: string;
|
|
145
|
+
packageName: string;
|
|
146
|
+
requestInterface: TypeScriptInterfaceView;
|
|
147
|
+
responseInterface: TypeScriptInterfaceView;
|
|
148
|
+
extraInterfaces: TypeScriptInterfaceView[];
|
|
149
|
+
validationRules: TypeScriptValidationRule[];
|
|
150
|
+
pipeCall: {
|
|
151
|
+
methodString: string;
|
|
152
|
+
params: string[];
|
|
153
|
+
};
|
|
154
|
+
hasRequestParams: boolean;
|
|
155
|
+
hasResponseData: boolean;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/codegen/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAA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;IAC1C,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C,eAAe,EAAE,uBAAuB,EAAE,CAAC;IAC3C,eAAe,EAAE,wBAAwB,EAAE,CAAC;IAC5C,QAAQ,EAAE;QACR,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/codegen/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MethodDefinition, ModuleConfig, TypeScriptTemplateView } from './types';
|
|
2
|
+
export declare function buildTypeScriptView(method: MethodDefinition, config: ModuleConfig): TypeScriptTemplateView;
|
|
3
|
+
export declare function writeTypeScriptFiles(root: string, config: ModuleConfig, method: MethodDefinition, view: TypeScriptTemplateView, templates: {
|
|
4
|
+
idl: string;
|
|
5
|
+
impl: string;
|
|
6
|
+
index: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=typescript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/codegen/typescript.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,gBAAgB,EAChB,YAAY,EAKZ,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAIjB,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,GAAG,sBAAsB,CAgD1G;AAwKD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,sBAAsB,EAC5B,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACtD,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|