@voxgig/sdkgen 0.43.0 → 0.45.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.
Files changed (127) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ReadmeEntity.js +9 -153
  3. package/dist/cmp/ReadmeEntity.js.map +1 -1
  4. package/dist/cmp/ReadmeIntro.js +9 -14
  5. package/dist/cmp/ReadmeIntro.js.map +1 -1
  6. package/dist/cmp/ReadmeModel.js +6 -4
  7. package/dist/cmp/ReadmeModel.js.map +1 -1
  8. package/dist/cmp/ReadmeOptions.js +9 -61
  9. package/dist/cmp/ReadmeOptions.js.map +1 -1
  10. package/dist/cmp/ReadmeRef.js +10 -1328
  11. package/dist/cmp/ReadmeRef.js.map +1 -1
  12. package/dist/sdkgen.d.ts +2 -2
  13. package/dist/sdkgen.js +2 -1
  14. package/dist/sdkgen.js.map +1 -1
  15. package/dist/utility.d.ts +2 -1
  16. package/dist/utility.js +9 -0
  17. package/dist/utility.js.map +1 -1
  18. package/package.json +1 -1
  19. package/project/.sdk/src/cmp/go/Config_go.ts +9 -4
  20. package/project/.sdk/src/cmp/go/Gitignore_go.ts +47 -0
  21. package/project/.sdk/src/cmp/go/Main_go.ts +3 -0
  22. package/project/.sdk/src/cmp/go/ReadmeEntity_go.ts +138 -0
  23. package/project/.sdk/src/cmp/go/ReadmeHowto_go.ts +6 -3
  24. package/project/.sdk/src/cmp/go/ReadmeIntro_go.ts +18 -0
  25. package/project/.sdk/src/cmp/go/ReadmeModel_go.ts +6 -3
  26. package/project/.sdk/src/cmp/go/ReadmeOptions_go.ts +58 -0
  27. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +11 -7
  28. package/project/.sdk/src/cmp/go/ReadmeRef_go.ts +354 -0
  29. package/project/.sdk/src/cmp/go/ReadmeTopQuick_go.ts +6 -4
  30. package/project/.sdk/src/cmp/go/TestDirect_go.ts +18 -8
  31. package/project/.sdk/src/cmp/go/TestEntity_go.ts +105 -54
  32. package/project/.sdk/src/cmp/js/Config_js.ts +18 -0
  33. package/project/.sdk/src/cmp/js/Gitignore_js.ts +35 -0
  34. package/project/.sdk/src/cmp/js/Main_js.ts +3 -0
  35. package/project/.sdk/src/cmp/js/ReadmeEntity_js.ts +138 -0
  36. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +11 -6
  37. package/project/.sdk/src/cmp/js/ReadmeIntro_js.ts +18 -0
  38. package/project/.sdk/src/cmp/js/ReadmeModel_js.ts +6 -3
  39. package/project/.sdk/src/cmp/js/ReadmeOptions_js.ts +58 -0
  40. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +6 -4
  41. package/project/.sdk/src/cmp/js/ReadmeRef_js.ts +384 -0
  42. package/project/.sdk/src/cmp/js/ReadmeTopQuick_js.ts +6 -4
  43. package/project/.sdk/src/cmp/js/TestDirect_js.ts +23 -12
  44. package/project/.sdk/src/cmp/js/TestEntity_js.ts +107 -74
  45. package/project/.sdk/src/cmp/js/fragment/Config.fragment.js +1 -5
  46. package/project/.sdk/src/cmp/lua/Config_lua.ts +9 -4
  47. package/project/.sdk/src/cmp/lua/Gitignore_lua.ts +39 -0
  48. package/project/.sdk/src/cmp/lua/Main_lua.ts +3 -0
  49. package/project/.sdk/src/cmp/lua/ReadmeEntity_lua.ts +138 -0
  50. package/project/.sdk/src/cmp/lua/ReadmeHowto_lua.ts +6 -3
  51. package/project/.sdk/src/cmp/lua/ReadmeIntro_lua.ts +18 -0
  52. package/project/.sdk/src/cmp/lua/ReadmeModel_lua.ts +6 -3
  53. package/project/.sdk/src/cmp/lua/ReadmeOptions_lua.ts +58 -0
  54. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +6 -4
  55. package/project/.sdk/src/cmp/lua/ReadmeRef_lua.ts +360 -0
  56. package/project/.sdk/src/cmp/lua/ReadmeTopQuick_lua.ts +6 -4
  57. package/project/.sdk/src/cmp/lua/TestDirect_lua.ts +18 -8
  58. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +95 -51
  59. package/project/.sdk/src/cmp/php/Config_php.ts +10 -8
  60. package/project/.sdk/src/cmp/php/Gitignore_php.ts +33 -0
  61. package/project/.sdk/src/cmp/php/Main_php.ts +3 -0
  62. package/project/.sdk/src/cmp/php/ReadmeEntity_php.ts +138 -0
  63. package/project/.sdk/src/cmp/php/ReadmeHowto_php.ts +6 -3
  64. package/project/.sdk/src/cmp/php/ReadmeIntro_php.ts +18 -0
  65. package/project/.sdk/src/cmp/php/ReadmeModel_php.ts +6 -3
  66. package/project/.sdk/src/cmp/php/ReadmeOptions_php.ts +58 -0
  67. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +6 -4
  68. package/project/.sdk/src/cmp/php/ReadmeRef_php.ts +358 -0
  69. package/project/.sdk/src/cmp/php/ReadmeTopQuick_php.ts +6 -4
  70. package/project/.sdk/src/cmp/php/TestDirect_php.ts +18 -8
  71. package/project/.sdk/src/cmp/php/TestEntity_php.ts +101 -54
  72. package/project/.sdk/src/cmp/py/Config_py.ts +9 -4
  73. package/project/.sdk/src/cmp/py/Gitignore_py.ts +55 -0
  74. package/project/.sdk/src/cmp/py/Main_py.ts +3 -0
  75. package/project/.sdk/src/cmp/py/ReadmeEntity_py.ts +138 -0
  76. package/project/.sdk/src/cmp/py/ReadmeHowto_py.ts +6 -3
  77. package/project/.sdk/src/cmp/py/ReadmeIntro_py.ts +18 -0
  78. package/project/.sdk/src/cmp/py/ReadmeModel_py.ts +6 -3
  79. package/project/.sdk/src/cmp/py/ReadmeOptions_py.ts +58 -0
  80. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +9 -6
  81. package/project/.sdk/src/cmp/py/ReadmeRef_py.ts +356 -0
  82. package/project/.sdk/src/cmp/py/ReadmeTopQuick_py.ts +9 -6
  83. package/project/.sdk/src/cmp/py/TestDirect_py.ts +18 -8
  84. package/project/.sdk/src/cmp/py/TestEntity_py.ts +100 -50
  85. package/project/.sdk/src/cmp/rb/Config_rb.ts +9 -4
  86. package/project/.sdk/src/cmp/rb/Gitignore_rb.ts +38 -0
  87. package/project/.sdk/src/cmp/rb/Main_rb.ts +3 -0
  88. package/project/.sdk/src/cmp/rb/ReadmeEntity_rb.ts +138 -0
  89. package/project/.sdk/src/cmp/rb/ReadmeHowto_rb.ts +6 -3
  90. package/project/.sdk/src/cmp/rb/ReadmeIntro_rb.ts +18 -0
  91. package/project/.sdk/src/cmp/rb/ReadmeModel_rb.ts +6 -3
  92. package/project/.sdk/src/cmp/rb/ReadmeOptions_rb.ts +58 -0
  93. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +6 -4
  94. package/project/.sdk/src/cmp/rb/ReadmeRef_rb.ts +361 -0
  95. package/project/.sdk/src/cmp/rb/ReadmeTopQuick_rb.ts +6 -4
  96. package/project/.sdk/src/cmp/rb/TestDirect_rb.ts +18 -8
  97. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +95 -51
  98. package/project/.sdk/src/cmp/ts/Config_ts.ts +18 -0
  99. package/project/.sdk/src/cmp/ts/Gitignore_ts.ts +37 -0
  100. package/project/.sdk/src/cmp/ts/Main_ts.ts +3 -0
  101. package/project/.sdk/src/cmp/ts/ReadmeEntity_ts.ts +138 -0
  102. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +11 -6
  103. package/project/.sdk/src/cmp/ts/ReadmeIntro_ts.ts +18 -0
  104. package/project/.sdk/src/cmp/ts/ReadmeModel_ts.ts +9 -5
  105. package/project/.sdk/src/cmp/ts/ReadmeOptions_ts.ts +58 -0
  106. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +6 -4
  107. package/project/.sdk/src/cmp/ts/ReadmeRef_ts.ts +384 -0
  108. package/project/.sdk/src/cmp/ts/ReadmeTopQuick_ts.ts +6 -4
  109. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +68 -20
  110. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +109 -74
  111. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +1 -5
  112. package/project/.sdk/tm/go/utility/prepare_auth.go +15 -1
  113. package/project/.sdk/tm/js/src/utility/PrepareAuthUtility.js +7 -1
  114. package/project/.sdk/tm/lua/utility/prepare_auth.lua +9 -1
  115. package/project/.sdk/tm/php/utility/PrepareAuth.php +11 -1
  116. package/project/.sdk/tm/py/utility/prepare_auth.py +10 -1
  117. package/project/.sdk/tm/rb/utility/prepare_auth.rb +8 -1
  118. package/project/.sdk/tm/ts/src/utility/MakeUrlUtility.ts +7 -8
  119. package/project/.sdk/tm/ts/src/utility/PrepareAuthUtility.ts +7 -1
  120. package/src/cmp/ReadmeEntity.ts +11 -178
  121. package/src/cmp/ReadmeIntro.ts +11 -25
  122. package/src/cmp/ReadmeModel.ts +7 -5
  123. package/src/cmp/ReadmeOptions.ts +12 -74
  124. package/src/cmp/ReadmeRef.ts +11 -1372
  125. package/src/sdkgen.ts +2 -1
  126. package/src/utility.ts +12 -0
  127. /package/project/.sdk/tm/go/utility/{make_target.go → make_point.go} +0 -0
@@ -2,1335 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ReadmeRef = void 0;
4
4
  const jostraca_1 = require("jostraca");
5
- const types_1 = require("../types");
6
- const OP_SIGNATURES_TS = {
7
- load: {
8
- sig: 'load(match: object, ctrl?: object)',
9
- returns: 'Promise<object>',
10
- desc: 'Load a single entity matching the given criteria.',
11
- },
12
- list: {
13
- sig: 'list(match: object, ctrl?: object)',
14
- returns: 'Promise<object[]>',
15
- desc: 'List entities matching the given criteria. Returns an array.',
16
- },
17
- create: {
18
- sig: 'create(data: object, ctrl?: object)',
19
- returns: 'Promise<object>',
20
- desc: 'Create a new entity with the given data.',
21
- },
22
- update: {
23
- sig: 'update(data: object, ctrl?: object)',
24
- returns: 'Promise<object>',
25
- desc: 'Update an existing entity. The data must include the entity `id`.',
26
- },
27
- remove: {
28
- sig: 'remove(match: object, ctrl?: object)',
29
- returns: 'Promise<void>',
30
- desc: 'Remove the entity matching the given criteria.',
31
- },
32
- };
33
- const OP_SIGNATURES_LUA = {
34
- load: {
35
- sig: 'load(reqmatch, ctrl) -> any, err',
36
- returns: 'any, err',
37
- desc: 'Load a single entity matching the given criteria.',
38
- },
39
- list: {
40
- sig: 'list(reqmatch, ctrl) -> any, err',
41
- returns: 'any, err',
42
- desc: 'List entities matching the given criteria. Returns an array.',
43
- },
44
- create: {
45
- sig: 'create(reqdata, ctrl) -> any, err',
46
- returns: 'any, err',
47
- desc: 'Create a new entity with the given data.',
48
- },
49
- update: {
50
- sig: 'update(reqdata, ctrl) -> any, err',
51
- returns: 'any, err',
52
- desc: 'Update an existing entity. The data must include the entity `id`.',
53
- },
54
- remove: {
55
- sig: 'remove(reqmatch, ctrl) -> any, err',
56
- returns: 'any, err',
57
- desc: 'Remove the entity matching the given criteria.',
58
- },
59
- };
60
- const OP_SIGNATURES_RB = {
61
- load: {
62
- sig: 'load(reqmatch, ctrl = nil) -> result, err',
63
- returns: 'result, err',
64
- desc: 'Load a single entity matching the given criteria.',
65
- },
66
- list: {
67
- sig: 'list(reqmatch, ctrl = nil) -> result, err',
68
- returns: 'result, err',
69
- desc: 'List entities matching the given criteria. Returns an array.',
70
- },
71
- create: {
72
- sig: 'create(reqdata, ctrl = nil) -> result, err',
73
- returns: 'result, err',
74
- desc: 'Create a new entity with the given data.',
75
- },
76
- update: {
77
- sig: 'update(reqdata, ctrl = nil) -> result, err',
78
- returns: 'result, err',
79
- desc: 'Update an existing entity. The data must include the entity `id`.',
80
- },
81
- remove: {
82
- sig: 'remove(reqmatch, ctrl = nil) -> result, err',
83
- returns: 'result, err',
84
- desc: 'Remove the entity matching the given criteria.',
85
- },
86
- };
87
- const OP_SIGNATURES_PY = {
88
- load: {
89
- sig: 'load(reqmatch, ctrl=None) -> tuple',
90
- returns: '(result, err)',
91
- desc: 'Load a single entity matching the given criteria.',
92
- },
93
- list: {
94
- sig: 'list(reqmatch, ctrl=None) -> tuple',
95
- returns: '(result, err)',
96
- desc: 'List entities matching the given criteria. Returns an array.',
97
- },
98
- create: {
99
- sig: 'create(reqdata, ctrl=None) -> tuple',
100
- returns: '(result, err)',
101
- desc: 'Create a new entity with the given data.',
102
- },
103
- update: {
104
- sig: 'update(reqdata, ctrl=None) -> tuple',
105
- returns: '(result, err)',
106
- desc: 'Update an existing entity. The data must include the entity `id`.',
107
- },
108
- remove: {
109
- sig: 'remove(reqmatch, ctrl=None) -> tuple',
110
- returns: '(result, err)',
111
- desc: 'Remove the entity matching the given criteria.',
112
- },
113
- };
114
- const OP_SIGNATURES_PHP = {
115
- load: {
116
- sig: 'load(array $reqmatch, ?array $ctrl = null): array',
117
- returns: 'array [$result, $err]',
118
- desc: 'Load a single entity matching the given criteria.',
119
- },
120
- list: {
121
- sig: 'list(array $reqmatch, ?array $ctrl = null): array',
122
- returns: 'array [$result, $err]',
123
- desc: 'List entities matching the given criteria. Returns an array.',
124
- },
125
- create: {
126
- sig: 'create(array $reqdata, ?array $ctrl = null): array',
127
- returns: 'array [$result, $err]',
128
- desc: 'Create a new entity with the given data.',
129
- },
130
- update: {
131
- sig: 'update(array $reqdata, ?array $ctrl = null): array',
132
- returns: 'array [$result, $err]',
133
- desc: 'Update an existing entity. The data must include the entity `id`.',
134
- },
135
- remove: {
136
- sig: 'remove(array $reqmatch, ?array $ctrl = null): array',
137
- returns: 'array [$result, $err]',
138
- desc: 'Remove the entity matching the given criteria.',
139
- },
140
- };
141
- const OP_SIGNATURES_GO = {
142
- load: {
143
- sig: 'Load(reqmatch, ctrl map[string]any) (any, error)',
144
- returns: '(any, error)',
145
- desc: 'Load a single entity matching the given criteria.',
146
- },
147
- list: {
148
- sig: 'List(reqmatch, ctrl map[string]any) (any, error)',
149
- returns: '(any, error)',
150
- desc: 'List entities matching the given criteria. Returns an array.',
151
- },
152
- create: {
153
- sig: 'Create(reqdata, ctrl map[string]any) (any, error)',
154
- returns: '(any, error)',
155
- desc: 'Create a new entity with the given data.',
156
- },
157
- update: {
158
- sig: 'Update(reqdata, ctrl map[string]any) (any, error)',
159
- returns: '(any, error)',
160
- desc: 'Update an existing entity. The data must include the entity `id`.',
161
- },
162
- remove: {
163
- sig: 'Remove(reqmatch, ctrl map[string]any) (any, error)',
164
- returns: '(any, error)',
165
- desc: 'Remove the entity matching the given criteria.',
166
- },
167
- };
5
+ const utility_1 = require("../utility");
6
+ // Per-language REFERENCE.md generator lives in
7
+ // `project/.sdk/src/cmp/<lang>/ReadmeRef_<lang>.ts`. Each language emits
8
+ // its own constructor signature, op spelling, and code-block fence — a
9
+ // shared template would have to inline-switch on every line.
168
10
  const ReadmeRef = (0, jostraca_1.cmp)(function ReadmeRef(props) {
169
- const { target } = props;
170
- const { model } = props.ctx$;
171
- const entity = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.entity`);
172
- const feature = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.feature`);
173
- const publishedEntities = (0, jostraca_1.each)(entity).filter((e) => e.active !== false);
174
- const isGo = target.name === 'go';
175
- const isLua = target.name === 'lua';
176
- const isRb = target.name === 'rb';
177
- const isPhp = target.name === 'php';
178
- const isPy = target.name === 'py';
179
- const lang = isGo ? 'go' : isLua ? 'lua' : isRb ? 'rb' : isPhp ? 'php' : isPy ? 'py' : 'ts';
180
- const OP_SIGNATURES = isGo ? OP_SIGNATURES_GO : isLua ? OP_SIGNATURES_LUA : isRb ? OP_SIGNATURES_RB : isPhp ? OP_SIGNATURES_PHP : isPy ? OP_SIGNATURES_PY : OP_SIGNATURES_TS;
181
- (0, jostraca_1.File)({ name: 'REFERENCE.md' }, () => {
182
- (0, jostraca_1.Content)(`# ${model.Name} ${target.title} SDK Reference
183
-
184
- Complete API reference for the ${model.Name} ${target.title} SDK.
185
-
186
-
187
- ## ${model.Name}SDK
188
-
189
- ### Constructor
190
-
191
- `);
192
- if (isPy) {
193
- (0, jostraca_1.Content)(`\`\`\`python
194
- from ${model.name}_sdk import ${model.const.Name}SDK
195
-
196
- client = ${model.const.Name}SDK(options)
197
- \`\`\`
198
-
199
- Create a new SDK client instance.
200
-
201
- **Parameters:**
202
-
203
- | Name | Type | Description |
204
- | --- | --- | --- |
205
- | \`options\` | \`dict\` | SDK configuration options. |
206
- | \`options["apikey"]\` | \`str\` | API key for authentication. |
207
- | \`options["base"]\` | \`str\` | Base URL for API requests. |
208
- | \`options["prefix"]\` | \`str\` | URL prefix appended after base. |
209
- | \`options["suffix"]\` | \`str\` | URL suffix appended after path. |
210
- | \`options["headers"]\` | \`dict\` | Custom headers for all requests. |
211
- | \`options["feature"]\` | \`dict\` | Feature configuration. |
212
- | \`options["system"]\` | \`dict\` | System overrides (e.g. custom fetch). |
213
-
214
- `);
215
- }
216
- else if (isPhp) {
217
- (0, jostraca_1.Content)(`\`\`\`php
218
- require_once __DIR__ . '/${model.name}_sdk.php';
219
-
220
- $client = new ${model.const.Name}SDK($options);
221
- \`\`\`
222
-
223
- Create a new SDK client instance.
224
-
225
- **Parameters:**
226
-
227
- | Name | Type | Description |
228
- | --- | --- | --- |
229
- | \`$options\` | \`array\` | SDK configuration options. |
230
- | \`$options["apikey"]\` | \`string\` | API key for authentication. |
231
- | \`$options["base"]\` | \`string\` | Base URL for API requests. |
232
- | \`$options["prefix"]\` | \`string\` | URL prefix appended after base. |
233
- | \`$options["suffix"]\` | \`string\` | URL suffix appended after path. |
234
- | \`$options["headers"]\` | \`array\` | Custom headers for all requests. |
235
- | \`$options["feature"]\` | \`array\` | Feature configuration. |
236
- | \`$options["system"]\` | \`array\` | System overrides (e.g. custom fetch). |
237
-
238
- `);
239
- }
240
- else if (isRb) {
241
- (0, jostraca_1.Content)(`\`\`\`ruby
242
- require_relative '${model.name}_sdk'
243
-
244
- client = ${model.const.Name}SDK.new(options)
245
- \`\`\`
246
-
247
- Create a new SDK client instance.
248
-
249
- **Parameters:**
250
-
251
- | Name | Type | Description |
252
- | --- | --- | --- |
253
- | \`options\` | \`Hash\` | SDK configuration options. |
254
- | \`options["apikey"]\` | \`String\` | API key for authentication. |
255
- | \`options["base"]\` | \`String\` | Base URL for API requests. |
256
- | \`options["prefix"]\` | \`String\` | URL prefix appended after base. |
257
- | \`options["suffix"]\` | \`String\` | URL suffix appended after path. |
258
- | \`options["headers"]\` | \`Hash\` | Custom headers for all requests. |
259
- | \`options["feature"]\` | \`Hash\` | Feature configuration. |
260
- | \`options["system"]\` | \`Hash\` | System overrides (e.g. custom fetch). |
261
-
262
- `);
263
- }
264
- else if (isLua) {
265
- (0, jostraca_1.Content)(`\`\`\`lua
266
- local sdk = require("${model.name}_sdk")
267
- local client = sdk.new(options)
268
- \`\`\`
269
-
270
- Create a new SDK client instance.
271
-
272
- **Parameters:**
273
-
274
- | Name | Type | Description |
275
- | --- | --- | --- |
276
- | \`options\` | \`table\` | SDK configuration options. |
277
- | \`options.apikey\` | \`string\` | API key for authentication. |
278
- | \`options.base\` | \`string\` | Base URL for API requests. |
279
- | \`options.prefix\` | \`string\` | URL prefix appended after base. |
280
- | \`options.suffix\` | \`string\` | URL suffix appended after path. |
281
- | \`options.headers\` | \`table\` | Custom headers for all requests. |
282
- | \`options.feature\` | \`table\` | Feature configuration. |
283
- | \`options.system\` | \`table\` | System overrides (e.g. custom fetch). |
284
-
285
- `);
286
- }
287
- else if (isGo) {
288
- (0, jostraca_1.Content)(`\`\`\`go
289
- func New${model.const.Name}SDK(options map[string]any) *${model.const.Name}SDK
290
- \`\`\`
291
-
292
- Create a new SDK client instance.
293
-
294
- **Parameters:**
295
-
296
- | Name | Type | Description |
297
- | --- | --- | --- |
298
- | \`options\` | \`map[string]any\` | SDK configuration options. |
299
- | \`options["apikey"]\` | \`string\` | API key for authentication. |
300
- | \`options["base"]\` | \`string\` | Base URL for API requests. |
301
- | \`options["prefix"]\` | \`string\` | URL prefix appended after base. |
302
- | \`options["suffix"]\` | \`string\` | URL suffix appended after path. |
303
- | \`options["headers"]\` | \`map[string]any\` | Custom headers for all requests. |
304
- | \`options["feature"]\` | \`map[string]any\` | Feature configuration. |
305
- | \`options["system"]\` | \`map[string]any\` | System overrides (e.g. custom fetch). |
306
-
307
- `);
308
- }
309
- else {
310
- (0, jostraca_1.Content)(`\`\`\`ts
311
- new ${model.Name}SDK(options?: object)
312
- \`\`\`
313
-
314
- Create a new SDK client instance.
315
-
316
- **Parameters:**
317
-
318
- | Name | Type | Description |
319
- | --- | --- | --- |
320
- | \`options\` | \`object\` | SDK configuration options. |
321
- | \`options.apikey\` | \`string\` | API key for authentication. |
322
- | \`options.base\` | \`string\` | Base URL for API requests. |
323
- | \`options.prefix\` | \`string\` | URL prefix appended after base. |
324
- | \`options.suffix\` | \`string\` | URL suffix appended after path. |
325
- | \`options.headers\` | \`object\` | Custom headers for all requests. |
326
- | \`options.feature\` | \`object\` | Feature configuration. |
327
- | \`options.system\` | \`object\` | System overrides (e.g. custom fetch). |
328
-
329
- `);
330
- }
331
- (0, jostraca_1.Content)(`
332
- ### Static Methods
333
-
334
- `);
335
- if (isPy) {
336
- (0, jostraca_1.Content)(`#### \`${model.const.Name}SDK.test(testopts=None, sdkopts=None)\`
337
-
338
- Create a test client with mock features active. Both arguments may be \`None\`.
339
-
340
- \`\`\`python
341
- client = ${model.const.Name}SDK.test()
342
- \`\`\`
343
-
344
- `);
345
- }
346
- else if (isPhp) {
347
- (0, jostraca_1.Content)(`#### \`${model.const.Name}SDK::test($testopts = null, $sdkopts = null)\`
348
-
349
- Create a test client with mock features active. Both arguments may be \`null\`.
350
-
351
- \`\`\`php
352
- $client = ${model.const.Name}SDK::test();
353
- \`\`\`
354
-
355
- `);
356
- }
357
- else if (isRb) {
358
- (0, jostraca_1.Content)(`#### \`${model.const.Name}SDK.test(testopts = nil, sdkopts = nil)\`
359
-
360
- Create a test client with mock features active. Both arguments may be \`nil\`.
361
-
362
- \`\`\`ruby
363
- client = ${model.const.Name}SDK.test
364
- \`\`\`
365
-
366
- `);
367
- }
368
- else if (isLua) {
369
- (0, jostraca_1.Content)(`#### \`sdk.test(testopts, sdkopts)\`
370
-
371
- Create a test client with mock features active. Both arguments may be \`nil\`.
372
-
373
- \`\`\`lua
374
- local client = sdk.test(nil, nil)
375
- \`\`\`
376
-
377
- `);
378
- }
379
- else if (isGo) {
380
- (0, jostraca_1.Content)(`#### \`TestSDK(testopts, sdkopts map[string]any) *${model.const.Name}SDK\`
381
-
382
- Create a test client with mock features active. Both arguments may be \`nil\`.
383
-
384
- \`\`\`go
385
- client := sdk.TestSDK(nil, nil)
386
- \`\`\`
387
-
388
- `);
389
- }
390
- else {
391
- (0, jostraca_1.Content)(`#### \`${model.Name}SDK.test(testopts?, sdkopts?)\`
392
-
393
- Create a test client with mock features active.
394
-
395
- \`\`\`ts
396
- const client = ${model.Name}SDK.test()
397
- \`\`\`
398
-
399
- **Parameters:**
400
-
401
- | Name | Type | Description |
402
- | --- | --- | --- |
403
- | \`testopts\` | \`object\` | Test feature options. |
404
- | \`sdkopts\` | \`object\` | Additional SDK options merged with test defaults. |
405
-
406
- **Returns:** \`${model.Name}SDK\` instance in test mode.
407
-
408
- `);
409
- }
410
- (0, jostraca_1.Content)(`
411
- ### Instance Methods
412
-
413
- `);
414
- // Entity factory methods
415
- publishedEntities.map((ent) => {
416
- if (isPy) {
417
- (0, jostraca_1.Content)(`#### \`${ent.Name}(data=None)\`
418
-
419
- Create a new \`${ent.Name}Entity\` instance. Pass \`None\` for no initial data.
420
-
421
- `);
422
- }
423
- else if (isPhp) {
424
- (0, jostraca_1.Content)(`#### \`${ent.Name}($data = null)\`
425
-
426
- Create a new \`${ent.Name}Entity\` instance. Pass \`null\` for no initial data.
427
-
428
- `);
429
- }
430
- else if (isRb) {
431
- (0, jostraca_1.Content)(`#### \`${ent.Name}(data = nil)\`
432
-
433
- Create a new \`${ent.Name}\` entity instance. Pass \`nil\` for no initial data.
434
-
435
- `);
436
- }
437
- else if (isLua) {
438
- (0, jostraca_1.Content)(`#### \`${ent.Name}(data)\`
439
-
440
- Create a new \`${ent.Name}\` entity instance. Pass \`nil\` for no initial data.
441
-
442
- `);
443
- }
444
- else if (isGo) {
445
- (0, jostraca_1.Content)(`#### \`${ent.Name}(data map[string]any) ${model.const.Name}Entity\`
446
-
447
- Create a new \`${ent.Name}\` entity instance. Pass \`nil\` for no initial data.
448
-
449
- `);
450
- }
451
- else {
452
- (0, jostraca_1.Content)(`#### \`${ent.Name}(data?: object)\`
453
-
454
- Create a new \`${ent.Name}\` entity instance.
455
-
456
- **Parameters:**
457
-
458
- | Name | Type | Description |
459
- | --- | --- | --- |
460
- | \`data\` | \`object\` | Initial entity data. |
461
-
462
- **Returns:** \`${ent.Name}Entity\` instance.
463
-
464
- `);
465
- }
466
- });
467
- if (isPy) {
468
- (0, jostraca_1.Content)(`#### \`options_map() -> dict\`
469
-
470
- Return a deep copy of the current SDK options.
471
-
472
- #### \`get_utility() -> Utility\`
473
-
474
- Return a copy of the SDK utility object.
475
-
476
- #### \`direct(fetchargs=None) -> tuple\`
477
-
478
- Make a direct HTTP request to any API endpoint. Returns \`(result, err)\`.
479
-
480
- **Parameters:**
481
-
482
- | Name | Type | Description |
483
- | --- | --- | --- |
484
- | \`fetchargs["path"]\` | \`str\` | URL path with optional \`{param}\` placeholders. |
485
- | \`fetchargs["method"]\` | \`str\` | HTTP method (default: \`"GET"\`). |
486
- | \`fetchargs["params"]\` | \`dict\` | Path parameter values. |
487
- | \`fetchargs["query"]\` | \`dict\` | Query string parameters. |
488
- | \`fetchargs["headers"]\` | \`dict\` | Request headers (merged with defaults). |
489
- | \`fetchargs["body"]\` | \`any\` | Request body (dicts are JSON-serialized). |
490
-
491
- **Returns:** \`(result_dict, err)\`
492
-
493
- #### \`prepare(fetchargs=None) -> tuple\`
494
-
495
- Prepare a fetch definition without sending. Returns \`(fetchdef, err)\`.
496
-
497
- `);
498
- }
499
- else if (isPhp) {
500
- (0, jostraca_1.Content)(`#### \`optionsMap(): array\`
501
-
502
- Return a deep copy of the current SDK options.
503
-
504
- #### \`getUtility(): ProjectNameUtility\`
505
-
506
- Return a copy of the SDK utility object.
507
-
508
- #### \`direct(array $fetchargs = []): array\`
509
-
510
- Make a direct HTTP request to any API endpoint. Returns \`[$result, $err]\`.
511
-
512
- **Parameters:**
513
-
514
- | Name | Type | Description |
515
- | --- | --- | --- |
516
- | \`$fetchargs["path"]\` | \`string\` | URL path with optional \`{param}\` placeholders. |
517
- | \`$fetchargs["method"]\` | \`string\` | HTTP method (default: \`"GET"\`). |
518
- | \`$fetchargs["params"]\` | \`array\` | Path parameter values for \`{param}\` substitution. |
519
- | \`$fetchargs["query"]\` | \`array\` | Query string parameters. |
520
- | \`$fetchargs["headers"]\` | \`array\` | Request headers (merged with defaults). |
521
- | \`$fetchargs["body"]\` | \`mixed\` | Request body (arrays are JSON-serialized). |
522
- | \`$fetchargs["ctrl"]\` | \`array\` | Control options. |
523
-
524
- **Returns:** \`array [$result, $err]\`
525
-
526
- #### \`prepare(array $fetchargs = []): array\`
527
-
528
- Prepare a fetch definition without sending the request. Returns \`[$fetchdef, $err]\`.
529
-
530
- `);
531
- }
532
- else if (isRb) {
533
- (0, jostraca_1.Content)(`#### \`options_map -> Hash\`
534
-
535
- Return a deep copy of the current SDK options.
536
-
537
- #### \`get_utility -> Utility\`
538
-
539
- Return a copy of the SDK utility object.
540
-
541
- #### \`direct(fetchargs = {}) -> Hash, err\`
542
-
543
- Make a direct HTTP request to any API endpoint.
544
-
545
- **Parameters:**
546
-
547
- | Name | Type | Description |
548
- | --- | --- | --- |
549
- | \`fetchargs["path"]\` | \`String\` | URL path with optional \`{param}\` placeholders. |
550
- | \`fetchargs["method"]\` | \`String\` | HTTP method (default: \`"GET"\`). |
551
- | \`fetchargs["params"]\` | \`Hash\` | Path parameter values for \`{param}\` substitution. |
552
- | \`fetchargs["query"]\` | \`Hash\` | Query string parameters. |
553
- | \`fetchargs["headers"]\` | \`Hash\` | Request headers (merged with defaults). |
554
- | \`fetchargs["body"]\` | \`any\` | Request body (hashes are JSON-serialized). |
555
- | \`fetchargs["ctrl"]\` | \`Hash\` | Control options (e.g. \`{ "explain" => true }\`). |
556
-
557
- **Returns:** \`Hash, err\`
558
-
559
- #### \`prepare(fetchargs = {}) -> Hash, err\`
560
-
561
- Prepare a fetch definition without sending the request. Accepts the
562
- same parameters as \`direct()\`.
563
-
564
- **Returns:** \`Hash, err\`
565
-
566
- `);
567
- }
568
- else if (isLua) {
569
- (0, jostraca_1.Content)(`#### \`options_map() -> table\`
570
-
571
- Return a deep copy of the current SDK options.
572
-
573
- #### \`get_utility() -> Utility\`
574
-
575
- Return a copy of the SDK utility object.
576
-
577
- #### \`direct(fetchargs) -> table, err\`
578
-
579
- Make a direct HTTP request to any API endpoint.
580
-
581
- **Parameters:**
582
-
583
- | Name | Type | Description |
584
- | --- | --- | --- |
585
- | \`fetchargs.path\` | \`string\` | URL path with optional \`{param}\` placeholders. |
586
- | \`fetchargs.method\` | \`string\` | HTTP method (default: \`"GET"\`). |
587
- | \`fetchargs.params\` | \`table\` | Path parameter values for \`{param}\` substitution. |
588
- | \`fetchargs.query\` | \`table\` | Query string parameters. |
589
- | \`fetchargs.headers\` | \`table\` | Request headers (merged with defaults). |
590
- | \`fetchargs.body\` | \`any\` | Request body (tables are JSON-serialized). |
591
- | \`fetchargs.ctrl\` | \`table\` | Control options (e.g. \`{ explain = true }\`). |
592
-
593
- **Returns:** \`table, err\`
594
-
595
- #### \`prepare(fetchargs) -> table, err\`
596
-
597
- Prepare a fetch definition without sending the request. Accepts the
598
- same parameters as \`direct()\`.
599
-
600
- **Returns:** \`table, err\`
601
-
602
- `);
603
- }
604
- else if (isGo) {
605
- (0, jostraca_1.Content)(`#### \`OptionsMap() map[string]any\`
606
-
607
- Return a deep copy of the current SDK options.
608
-
609
- #### \`GetUtility() *Utility\`
610
-
611
- Return a copy of the SDK utility object.
612
-
613
- #### \`Direct(fetchargs map[string]any) (map[string]any, error)\`
614
-
615
- Make a direct HTTP request to any API endpoint.
616
-
617
- **Parameters:**
618
-
619
- | Name | Type | Description |
620
- | --- | --- | --- |
621
- | \`fetchargs["path"]\` | \`string\` | URL path with optional \`{param}\` placeholders. |
622
- | \`fetchargs["method"]\` | \`string\` | HTTP method (default: \`"GET"\`). |
623
- | \`fetchargs["params"]\` | \`map[string]any\` | Path parameter values for \`{param}\` substitution. |
624
- | \`fetchargs["query"]\` | \`map[string]any\` | Query string parameters. |
625
- | \`fetchargs["headers"]\` | \`map[string]any\` | Request headers (merged with defaults). |
626
- | \`fetchargs["body"]\` | \`any\` | Request body (maps are JSON-serialized). |
627
- | \`fetchargs["ctrl"]\` | \`map[string]any\` | Control options (e.g. \`map[string]any{"explain": true}\`). |
628
-
629
- **Returns:** \`(map[string]any, error)\`
630
-
631
- #### \`Prepare(fetchargs map[string]any) (map[string]any, error)\`
632
-
633
- Prepare a fetch definition without sending the request. Accepts the
634
- same parameters as \`Direct()\`.
635
-
636
- **Returns:** \`(map[string]any, error)\`
637
-
638
- `);
639
- }
640
- else {
641
- (0, jostraca_1.Content)(`#### \`options()\`
642
-
643
- Return a deep copy of the current SDK options.
644
-
645
- **Returns:** \`object\`
646
-
647
- #### \`utility()\`
648
-
649
- Return a copy of the SDK utility object.
650
-
651
- **Returns:** \`object\`
652
-
653
- #### \`direct(fetchargs?: object)\`
654
-
655
- Make a direct HTTP request to any API endpoint.
656
-
657
- **Parameters:**
658
-
659
- | Name | Type | Description |
660
- | --- | --- | --- |
661
- | \`fetchargs.path\` | \`string\` | URL path with optional \`{param}\` placeholders. |
662
- | \`fetchargs.method\` | \`string\` | HTTP method (default: \`GET\`). |
663
- | \`fetchargs.params\` | \`object\` | Path parameter values for \`{param}\` substitution. |
664
- | \`fetchargs.query\` | \`object\` | Query string parameters. |
665
- | \`fetchargs.headers\` | \`object\` | Request headers (merged with defaults). |
666
- | \`fetchargs.body\` | \`any\` | Request body (objects are JSON-serialized). |
667
- | \`fetchargs.ctrl\` | \`object\` | Control options (e.g. \`{ explain: true }\`). |
668
-
669
- **Returns:** \`Promise<{ ok, status, headers, data } | Error>\`
670
-
671
- #### \`prepare(fetchargs?: object)\`
672
-
673
- Prepare a fetch definition without sending the request. Accepts the
674
- same parameters as \`direct()\`.
675
-
676
- **Returns:** \`Promise<{ url, method, headers, body } | Error>\`
677
-
678
- #### \`tester(testopts?, sdkopts?)\`
679
-
680
- Alias for \`${model.Name}SDK.test()\`.
681
-
682
- **Returns:** \`${model.Name}SDK\` instance in test mode.
683
-
684
- `);
685
- }
686
- // Entity reference sections
687
- publishedEntities.map((ent) => {
688
- const opnames = Object.keys(ent.op || {});
689
- const fields = ent.fields || [];
690
- (0, jostraca_1.Content)(`
691
- ---
692
-
693
- ## ${ent.Name}Entity
694
-
695
- `);
696
- if (ent.short) {
697
- (0, jostraca_1.Content)(`${ent.short}
698
-
699
- `);
700
- }
701
- if (isPy) {
702
- (0, jostraca_1.Content)(`\`\`\`python
703
- ${ent.name} = client.${ent.Name}()
704
- \`\`\`
705
-
706
- `);
707
- }
708
- else if (isPhp) {
709
- (0, jostraca_1.Content)(`\`\`\`php
710
- $${ent.name} = $client->${ent.Name}();
711
- \`\`\`
712
-
713
- `);
714
- }
715
- else if (isRb) {
716
- (0, jostraca_1.Content)(`\`\`\`ruby
717
- ${ent.name} = client.${ent.Name}
718
- \`\`\`
719
-
720
- `);
721
- }
722
- else if (isLua) {
723
- (0, jostraca_1.Content)(`\`\`\`lua
724
- local ${ent.name} = client:${ent.Name}(nil)
725
- \`\`\`
726
-
727
- `);
728
- }
729
- else if (isGo) {
730
- (0, jostraca_1.Content)(`\`\`\`go
731
- ${ent.name} := client.${ent.Name}(nil)
732
- \`\`\`
733
-
734
- `);
735
- }
736
- else {
737
- (0, jostraca_1.Content)(`\`\`\`ts
738
- const ${ent.name} = client.${ent.Name}()
739
- \`\`\`
740
-
741
- `);
742
- }
743
- // Field schema
744
- if (fields.length > 0) {
745
- (0, jostraca_1.Content)(`### Fields
746
-
747
- | Field | Type | Required | Description |
748
- | --- | --- | --- | --- |
749
- `);
750
- (0, jostraca_1.each)(fields, (field) => {
751
- const req = field.req ? 'Yes' : 'No';
752
- const desc = field.short || '';
753
- (0, jostraca_1.Content)(`| \`${field.name}\` | \`${field.type || 'any'}\` | ${req} | ${desc} |
754
- `);
755
- });
756
- (0, jostraca_1.Content)(`
757
- `);
758
- // Field operations breakdown
759
- const hasFieldOps = fields.some((f) => f.op && Object.keys(f.op).length > 0);
760
- if (hasFieldOps) {
761
- (0, jostraca_1.Content)(`### Field Usage by Operation
762
-
763
- | Field | load | list | create | update | remove |
764
- | --- | --- | --- | --- | --- | --- |
765
- `);
766
- (0, jostraca_1.each)(fields, (field) => {
767
- const fops = field.op || {};
768
- const cols = ['load', 'list', 'create', 'update', 'remove'].map((op) => {
769
- if (!opnames.includes(op))
770
- return '-';
771
- const fop = fops[op];
772
- if (null == fop)
773
- return '-';
774
- if (fop.active === false)
775
- return '-';
776
- return 'Yes';
777
- });
778
- (0, jostraca_1.Content)(`| \`${field.name}\` | ${cols.join(' | ')} |
779
- `);
780
- });
781
- (0, jostraca_1.Content)(`
782
- `);
783
- }
784
- }
785
- // Operation details
786
- if (opnames.length > 0) {
787
- (0, jostraca_1.Content)(`### Operations
788
-
789
- `);
790
- opnames.map((opname) => {
791
- const info = OP_SIGNATURES[opname];
792
- if (!info)
793
- return;
794
- (0, jostraca_1.Content)(`#### \`${info.sig}\`
795
-
796
- ${info.desc}
797
-
798
- `);
799
- // Show example
800
- if (isPy) {
801
- if ('load' === opname || 'remove' === opname) {
802
- (0, jostraca_1.Content)(`\`\`\`python
803
- result, err = client.${ent.Name}().${opname}({"id": "${ent.name}_id"})
804
- \`\`\`
805
-
806
- `);
807
- }
808
- else if ('list' === opname) {
809
- (0, jostraca_1.Content)(`\`\`\`python
810
- results, err = client.${ent.Name}().list({})
811
- \`\`\`
812
-
813
- `);
814
- }
815
- else if ('create' === opname) {
816
- (0, jostraca_1.Content)(`\`\`\`python
817
- result, err = client.${ent.Name}().create({
818
- `);
819
- (0, jostraca_1.each)(fields, (field) => {
820
- if ('id' !== field.name && field.req) {
821
- (0, jostraca_1.Content)(` "${field.name}": # ${field.type || 'value'},
822
- `);
823
- }
824
- });
825
- (0, jostraca_1.Content)(`})
826
- \`\`\`
827
-
828
- `);
829
- }
830
- else if ('update' === opname) {
831
- (0, jostraca_1.Content)(`\`\`\`python
832
- result, err = client.${ent.Name}().update({
833
- "id": "${ent.name}_id",
834
- # Fields to update
835
- })
836
- \`\`\`
837
-
838
- `);
839
- }
840
- }
841
- else if (isPhp) {
842
- if ('load' === opname || 'remove' === opname) {
843
- (0, jostraca_1.Content)(`\`\`\`php
844
- [$result, $err] = $client->${ent.Name}()->${opname}(["id" => "${ent.name}_id"]);
845
- \`\`\`
846
-
847
- `);
848
- }
849
- else if ('list' === opname) {
850
- (0, jostraca_1.Content)(`\`\`\`php
851
- [$results, $err] = $client->${ent.Name}()->list([]);
852
- \`\`\`
853
-
854
- `);
855
- }
856
- else if ('create' === opname) {
857
- (0, jostraca_1.Content)(`\`\`\`php
858
- [$result, $err] = $client->${ent.Name}()->create([
859
- `);
860
- (0, jostraca_1.each)(fields, (field) => {
861
- if ('id' !== field.name && field.req) {
862
- (0, jostraca_1.Content)(` "${field.name}" => /* ${field.type || 'value'} */,
863
- `);
864
- }
865
- });
866
- (0, jostraca_1.Content)(`]);
867
- \`\`\`
868
-
869
- `);
870
- }
871
- else if ('update' === opname) {
872
- (0, jostraca_1.Content)(`\`\`\`php
873
- [$result, $err] = $client->${ent.Name}()->update([
874
- "id" => "${ent.name}_id",
875
- // Fields to update
876
- ]);
877
- \`\`\`
878
-
879
- `);
880
- }
881
- }
882
- else if (isRb) {
883
- if ('load' === opname || 'remove' === opname) {
884
- (0, jostraca_1.Content)(`\`\`\`ruby
885
- result, err = client.${ent.Name}.${opname}({ "id" => "${ent.name}_id" })
886
- \`\`\`
887
-
888
- `);
889
- }
890
- else if ('list' === opname) {
891
- (0, jostraca_1.Content)(`\`\`\`ruby
892
- results, err = client.${ent.Name}.list(nil)
893
- \`\`\`
894
-
895
- `);
896
- }
897
- else if ('create' === opname) {
898
- (0, jostraca_1.Content)(`\`\`\`ruby
899
- result, err = client.${ent.Name}.create({
900
- `);
901
- (0, jostraca_1.each)(fields, (field) => {
902
- if ('id' !== field.name && field.req) {
903
- (0, jostraca_1.Content)(` "${field.name}" => # ${field.type || 'value'},
904
- `);
905
- }
906
- });
907
- (0, jostraca_1.Content)(`})
908
- \`\`\`
909
-
910
- `);
911
- }
912
- else if ('update' === opname) {
913
- (0, jostraca_1.Content)(`\`\`\`ruby
914
- result, err = client.${ent.Name}.update({
915
- "id" => "${ent.name}_id",
916
- # Fields to update
917
- })
918
- \`\`\`
919
-
920
- `);
921
- }
922
- }
923
- else if (isLua) {
924
- if ('load' === opname || 'remove' === opname) {
925
- (0, jostraca_1.Content)(`\`\`\`lua
926
- local result, err = client:${ent.Name}(nil):${opname}({ id = "${ent.name}_id" }, nil)
927
- \`\`\`
928
-
929
- `);
930
- }
931
- else if ('list' === opname) {
932
- (0, jostraca_1.Content)(`\`\`\`lua
933
- local results, err = client:${ent.Name}(nil):list(nil, nil)
934
- \`\`\`
935
-
936
- `);
937
- }
938
- else if ('create' === opname) {
939
- (0, jostraca_1.Content)(`\`\`\`lua
940
- local result, err = client:${ent.Name}(nil):create({
941
- `);
942
- (0, jostraca_1.each)(fields, (field) => {
943
- if ('id' !== field.name && field.req) {
944
- (0, jostraca_1.Content)(` ${field.name} = --[[ ${field.type || 'value'} ]],
945
- `);
946
- }
947
- });
948
- (0, jostraca_1.Content)(`}, nil)
949
- \`\`\`
950
-
951
- `);
952
- }
953
- else if ('update' === opname) {
954
- (0, jostraca_1.Content)(`\`\`\`lua
955
- local result, err = client:${ent.Name}(nil):update({
956
- id = "${ent.name}_id",
957
- -- Fields to update
958
- }, nil)
959
- \`\`\`
960
-
961
- `);
962
- }
963
- }
964
- else if (isGo) {
965
- if ('load' === opname || 'remove' === opname) {
966
- const goOpName = opname.charAt(0).toUpperCase() + opname.slice(1);
967
- (0, jostraca_1.Content)(`\`\`\`go
968
- result, err := client.${ent.Name}(nil).${goOpName}(map[string]any{"id": "${ent.name}_id"}, nil)
969
- \`\`\`
970
-
971
- `);
972
- }
973
- else if ('list' === opname) {
974
- (0, jostraca_1.Content)(`\`\`\`go
975
- results, err := client.${ent.Name}(nil).List(nil, nil)
976
- \`\`\`
977
-
978
- `);
979
- }
980
- else if ('create' === opname) {
981
- (0, jostraca_1.Content)(`\`\`\`go
982
- result, err := client.${ent.Name}(nil).Create(map[string]any{
983
- `);
984
- (0, jostraca_1.each)(fields, (field) => {
985
- if ('id' !== field.name && field.req) {
986
- (0, jostraca_1.Content)(` "${field.name}": /* ${field.type || 'value'} */,
987
- `);
988
- }
989
- });
990
- (0, jostraca_1.Content)(`}, nil)
991
- \`\`\`
992
-
993
- `);
994
- }
995
- else if ('update' === opname) {
996
- (0, jostraca_1.Content)(`\`\`\`go
997
- result, err := client.${ent.Name}(nil).Update(map[string]any{
998
- "id": "${ent.name}_id",
999
- // Fields to update
1000
- }, nil)
1001
- \`\`\`
1002
-
1003
- `);
1004
- }
1005
- }
1006
- else {
1007
- if ('load' === opname || 'remove' === opname) {
1008
- (0, jostraca_1.Content)(`\`\`\`ts
1009
- const result = await client.${ent.Name}().${opname}({ id: '${ent.name}_id' })
1010
- \`\`\`
1011
-
1012
- `);
1013
- }
1014
- else if ('list' === opname) {
1015
- (0, jostraca_1.Content)(`\`\`\`ts
1016
- const results = await client.${ent.Name}().${opname}()
1017
- \`\`\`
1018
-
1019
- `);
1020
- }
1021
- else if ('create' === opname) {
1022
- (0, jostraca_1.Content)(`\`\`\`ts
1023
- const result = await client.${ent.Name}().create({
1024
- `);
1025
- (0, jostraca_1.each)(fields, (field) => {
1026
- if ('id' !== field.name && field.req) {
1027
- (0, jostraca_1.Content)(` ${field.name}: /* ${field.type || 'value'} */,
1028
- `);
1029
- }
1030
- });
1031
- (0, jostraca_1.Content)(`})
1032
- \`\`\`
1033
-
1034
- `);
1035
- }
1036
- else if ('update' === opname) {
1037
- (0, jostraca_1.Content)(`\`\`\`ts
1038
- const result = await client.${ent.Name}().update({
1039
- id: '${ent.name}_id',
1040
- // Fields to update
1041
- })
1042
- \`\`\`
1043
-
1044
- `);
1045
- }
1046
- }
1047
- });
1048
- }
1049
- // Common methods
1050
- if (isPy) {
1051
- (0, jostraca_1.Content)(`### Common Methods
1052
-
1053
- #### \`data_get() -> dict\`
1054
-
1055
- Get the entity data.
1056
-
1057
- #### \`data_set(data)\`
1058
-
1059
- Set the entity data.
1060
-
1061
- #### \`match_get() -> dict\`
1062
-
1063
- Get the entity match criteria.
1064
-
1065
- #### \`match_set(match)\`
1066
-
1067
- Set the entity match criteria.
1068
-
1069
- #### \`make() -> Entity\`
1070
-
1071
- Create a new \`${ent.Name}Entity\` instance with the same options.
1072
-
1073
- #### \`get_name() -> str\`
1074
-
1075
- Return the entity name.
1076
-
1077
- `);
1078
- }
1079
- else if (isPhp) {
1080
- (0, jostraca_1.Content)(`### Common Methods
1081
-
1082
- #### \`dataGet(): array\`
1083
-
1084
- Get the entity data. Returns a copy of the current data.
1085
-
1086
- #### \`dataSet($data): void\`
1087
-
1088
- Set the entity data.
1089
-
1090
- #### \`matchGet(): array\`
1091
-
1092
- Get the entity match criteria.
1093
-
1094
- #### \`matchSet($match): void\`
1095
-
1096
- Set the entity match criteria.
1097
-
1098
- #### \`make(): ${ent.Name}Entity\`
1099
-
1100
- Create a new \`${ent.Name}Entity\` instance with the same client and
1101
- options.
1102
-
1103
- #### \`getName(): string\`
1104
-
1105
- Return the entity name.
1106
-
1107
- `);
1108
- }
1109
- else if (isRb) {
1110
- (0, jostraca_1.Content)(`### Common Methods
1111
-
1112
- #### \`data_get -> Hash\`
1113
-
1114
- Get the entity data. Returns a copy of the current data.
1115
-
1116
- #### \`data_set(data)\`
1117
-
1118
- Set the entity data.
1119
-
1120
- #### \`match_get -> Hash\`
1121
-
1122
- Get the entity match criteria.
1123
-
1124
- #### \`match_set(match)\`
1125
-
1126
- Set the entity match criteria.
1127
-
1128
- #### \`make -> Entity\`
1129
-
1130
- Create a new \`${ent.Name}Entity\` instance with the same client and
1131
- options.
1132
-
1133
- #### \`get_name -> String\`
1134
-
1135
- Return the entity name.
1136
-
1137
- `);
1138
- }
1139
- else if (isLua) {
1140
- (0, jostraca_1.Content)(`### Common Methods
1141
-
1142
- #### \`data_get() -> table\`
1143
-
1144
- Get the entity data. Returns a copy of the current data.
1145
-
1146
- #### \`data_set(data)\`
1147
-
1148
- Set the entity data.
1149
-
1150
- #### \`match_get() -> table\`
1151
-
1152
- Get the entity match criteria.
1153
-
1154
- #### \`match_set(match)\`
1155
-
1156
- Set the entity match criteria.
1157
-
1158
- #### \`make() -> Entity\`
1159
-
1160
- Create a new \`${ent.Name}Entity\` instance with the same client and
1161
- options.
1162
-
1163
- #### \`get_name() -> string\`
1164
-
1165
- Return the entity name.
1166
-
1167
- `);
1168
- }
1169
- else if (isGo) {
1170
- (0, jostraca_1.Content)(`### Common Methods
1171
-
1172
- #### \`Data(args ...any) any\`
1173
-
1174
- Get or set the entity data. When called with data, sets the entity's
1175
- internal data and returns the current data. When called without
1176
- arguments, returns a copy of the current data.
1177
-
1178
- #### \`Match(args ...any) any\`
1179
-
1180
- Get or set the entity match criteria. Works the same as \`Data()\`.
1181
-
1182
- #### \`Make() Entity\`
1183
-
1184
- Create a new \`${ent.Name}Entity\` instance with the same client and
1185
- options.
1186
-
1187
- #### \`GetName() string\`
1188
-
1189
- Return the entity name.
1190
-
1191
- `);
1192
- }
1193
- else {
1194
- (0, jostraca_1.Content)(`### Common Methods
1195
-
1196
- #### \`data(data?: object)\`
1197
-
1198
- Get or set the entity data. When called with data, sets the entity's
1199
- internal data and returns the current data. When called without
1200
- arguments, returns a copy of the current data.
1201
-
1202
- #### \`match(match?: object)\`
1203
-
1204
- Get or set the entity match criteria. Works the same as \`data()\`.
1205
-
1206
- #### \`make()\`
1207
-
1208
- Create a new \`${ent.Name}Entity\` instance with the same client and
1209
- options.
1210
-
1211
- #### \`client()\`
1212
-
1213
- Return the parent \`${model.Name}SDK\` instance.
1214
-
1215
- #### \`entopts()\`
1216
-
1217
- Return a copy of the entity options.
1218
-
1219
- `);
1220
- }
1221
- });
1222
- // Features section
1223
- const activeFeatures = (0, jostraca_1.each)(feature).filter((f) => f.active);
1224
- if (activeFeatures.length > 0) {
1225
- (0, jostraca_1.Content)(`
1226
- ---
1227
-
1228
- ## Features
1229
-
1230
- | Feature | Version | Description |
1231
- | --- | --- | --- |
1232
- `);
1233
- activeFeatures.map((f) => {
1234
- (0, jostraca_1.Content)(`| \`${f.name}\` | ${f.version || '0.0.1'} | ${f.title || ''} |
1235
- `);
1236
- });
1237
- (0, jostraca_1.Content)(`
1238
-
1239
- Features are activated via the \`feature\` option:
1240
-
1241
- `);
1242
- if (isPy) {
1243
- (0, jostraca_1.Content)(`\`\`\`python
1244
- client = ${model.const.Name}SDK({
1245
- "feature": {
1246
- `);
1247
- activeFeatures.map((f) => {
1248
- (0, jostraca_1.Content)(` "${f.name}": {"active": True},
1249
- `);
1250
- });
1251
- (0, jostraca_1.Content)(` },
1252
- })
1253
- \`\`\`
1254
-
1255
- `);
1256
- }
1257
- else if (isPhp) {
1258
- (0, jostraca_1.Content)(`\`\`\`php
1259
- $client = new ${model.const.Name}SDK([
1260
- "feature" => [
1261
- `);
1262
- activeFeatures.map((f) => {
1263
- (0, jostraca_1.Content)(` "${f.name}" => ["active" => true],
1264
- `);
1265
- });
1266
- (0, jostraca_1.Content)(` ],
1267
- ]);
1268
- \`\`\`
1269
-
1270
- `);
1271
- }
1272
- else if (isRb) {
1273
- (0, jostraca_1.Content)(`\`\`\`ruby
1274
- client = ${model.const.Name}SDK.new({
1275
- "feature" => {
1276
- `);
1277
- activeFeatures.map((f) => {
1278
- (0, jostraca_1.Content)(` "${f.name}" => { "active" => true },
1279
- `);
1280
- });
1281
- (0, jostraca_1.Content)(` },
1282
- })
1283
- \`\`\`
1284
-
1285
- `);
1286
- }
1287
- else if (isLua) {
1288
- (0, jostraca_1.Content)(`\`\`\`lua
1289
- local client = sdk.new({
1290
- feature = {
1291
- `);
1292
- activeFeatures.map((f) => {
1293
- (0, jostraca_1.Content)(` ${f.name} = { active = true },
1294
- `);
1295
- });
1296
- (0, jostraca_1.Content)(` },
1297
- })
1298
- \`\`\`
1299
-
1300
- `);
1301
- }
1302
- else if (isGo) {
1303
- (0, jostraca_1.Content)(`\`\`\`go
1304
- client := sdk.New${model.const.Name}SDK(map[string]any{
1305
- "feature": map[string]any{
1306
- `);
1307
- activeFeatures.map((f) => {
1308
- (0, jostraca_1.Content)(` "${f.name}": map[string]any{"active": true},
1309
- `);
1310
- });
1311
- (0, jostraca_1.Content)(` },
1312
- })
1313
- \`\`\`
1314
-
1315
- `);
1316
- }
1317
- else {
1318
- (0, jostraca_1.Content)(`\`\`\`ts
1319
- const client = new ${model.Name}SDK({
1320
- feature: {
1321
- `);
1322
- activeFeatures.map((f) => {
1323
- (0, jostraca_1.Content)(` ${f.name}: { active: true },
1324
- `);
1325
- });
1326
- (0, jostraca_1.Content)(` }
1327
- })
1328
- \`\`\`
1329
-
1330
- `);
1331
- }
1332
- }
1333
- });
11
+ const { target, ctx$ } = props;
12
+ const ReadmeRef_sdk = (0, utility_1.requirePath)(ctx$, `./cmp/${target.name}/ReadmeRef_${target.name}`, { ignore: true });
13
+ if (ReadmeRef_sdk) {
14
+ ReadmeRef_sdk['ReadmeRef']({ target });
15
+ }
1334
16
  });
1335
17
  exports.ReadmeRef = ReadmeRef;
1336
18
  //# sourceMappingURL=ReadmeRef.js.map