@carthooks/arcubase-cli 0.1.24 → 0.1.26
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/bundle/arcubase-admin.mjs +527 -183
- package/bundle/arcubase.mjs +527 -183
- package/dist/generated/zod_registry.generated.d.ts.map +1 -1
- package/dist/generated/zod_registry.generated.js +3 -3
- package/dist/runtime/dev_sdk_gen.d.ts.map +1 -1
- package/dist/runtime/dev_sdk_gen.js +423 -144
- package/dist/runtime/execute.d.ts.map +1 -1
- package/dist/runtime/execute.js +122 -48
- package/package.json +1 -1
- package/sdk-dist/docs/runtime-reference/dev-sdk-gen.md +27 -12
- package/sdk-dist/generated/zod_registry.generated.ts +3 -3
- package/sdk-dist/types/common.ts +1 -0
- package/sdk-dist/types/ingress.ts +15 -0
- package/sdk-dist/types/user-action.ts +1 -0
- package/src/generated/zod_registry.generated.ts +3 -3
- package/src/runtime/dev_sdk_gen.ts +453 -147
- package/src/runtime/execute.ts +128 -51
- package/src/tests/dev_sdk_gen.test.ts +134 -61
- package/src/tests/help.test.ts +2 -1
- package/src/tests/zod_registry.test.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/runtime/execute.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1D,OAAO,EAAyF,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAShJ,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9B,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAe1D;AAaD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,GAAE,QAAsB,GAAG,MAAM,CAoB7G;AA8BD,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;AAUlD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,QAAsB,GAAG,MAAM,CA8HpI;
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/runtime/execute.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1D,OAAO,EAAyF,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAShJ,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9B,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAe1D;AAaD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,GAAE,QAAsB,GAAG,MAAM,CAoB7G;AA8BD,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;AAUlD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,QAAsB,GAAG,MAAM,CA8HpI;AAkzED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,uBAAuB,CActH;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,GAAE,OAAO,KAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAyOrI"}
|
package/dist/runtime/execute.js
CHANGED
|
@@ -267,10 +267,10 @@ function renderDevSDKGenHelp() {
|
|
|
267
267
|
' - arcubase-admin dev sdk-gen --app-id <app_id> --out src/arcubase',
|
|
268
268
|
'',
|
|
269
269
|
'requirements:',
|
|
270
|
-
' -
|
|
271
|
-
' -
|
|
272
|
-
' -
|
|
273
|
-
' - generated code accepts
|
|
270
|
+
' - every generated ingress must have a configured ingress.key; sdk-gen fails fast when keys are missing',
|
|
271
|
+
' - every generated field must have a configured field.key; sdk-gen fails fast when keys are missing',
|
|
272
|
+
' - ingress.key and field.key values must be stable unique TypeScript identifiers',
|
|
273
|
+
' - generated code accepts createArcubaseClient({ baseURL, accessToken, refreshToken }).ingress("<IngressKey>")',
|
|
274
274
|
].join('\n');
|
|
275
275
|
}
|
|
276
276
|
function resolveEndpoint(command, flags) {
|
|
@@ -1647,45 +1647,120 @@ function walkSDKGenFields(fields, visit) {
|
|
|
1647
1647
|
walkSDKGenFields(field.children, visit);
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1651
|
-
const
|
|
1650
|
+
function assertSDKGenFieldKeysPresent(entity) {
|
|
1651
|
+
const missing = [];
|
|
1652
1652
|
walkSDKGenFields(entity.fields, (field) => {
|
|
1653
|
+
if (typeof field.id !== 'number') {
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1653
1656
|
if (typeof field.key === 'string' && field.key.trim() !== '') {
|
|
1654
|
-
|
|
1657
|
+
return;
|
|
1655
1658
|
}
|
|
1659
|
+
missing.push({
|
|
1660
|
+
id: field.id,
|
|
1661
|
+
label: typeof field.label === 'string' && field.label.trim() ? field.label.trim() : `field ${field.id}`,
|
|
1662
|
+
});
|
|
1663
|
+
});
|
|
1664
|
+
if (missing.length === 0) {
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
const entityName = typeof entity.name === 'string' && entity.name.trim() ? entity.name.trim() : `entity ${String(entity.id ?? '')}`.trim();
|
|
1668
|
+
const preview = missing.slice(0, 8).map((field) => `${entityName}.${field.label} (${field.id})`);
|
|
1669
|
+
const suffix = missing.length > preview.length ? `, and ${missing.length - preview.length} more` : '';
|
|
1670
|
+
throw new CLIError('SDK_GEN_FIELD_KEY_REQUIRED', `missing field.key values: ${preview.join(', ')}${suffix}`, 2, {
|
|
1671
|
+
operation: 'dev sdk-gen',
|
|
1672
|
+
issues: missing.map((field) => ({
|
|
1673
|
+
path: `entity.${String(entity.id ?? 'unknown')}.field.${field.id}.key`,
|
|
1674
|
+
message: `field.key is required for ${entityName}.${field.label}`,
|
|
1675
|
+
})),
|
|
1676
|
+
suggestions: [
|
|
1677
|
+
'set stable field.key values in Arcubase admin before running sdk-gen',
|
|
1678
|
+
'rerun arcubase-admin dev sdk-gen after the schema keys are complete',
|
|
1679
|
+
],
|
|
1656
1680
|
});
|
|
1657
|
-
return keys;
|
|
1658
1681
|
}
|
|
1659
|
-
function
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1682
|
+
function extractSDKGenIngressRefs(payload) {
|
|
1683
|
+
const data = unwrapResponseData(payload);
|
|
1684
|
+
const source = Array.isArray(data)
|
|
1685
|
+
? data
|
|
1686
|
+
: isRecord(data) && Array.isArray(data.list)
|
|
1687
|
+
? data.list
|
|
1688
|
+
: [];
|
|
1689
|
+
return source.filter((item) => isRecord(item));
|
|
1690
|
+
}
|
|
1691
|
+
function ingressKeyOf(ingress) {
|
|
1692
|
+
return typeof ingress.key === 'string' ? ingress.key.trim() : '';
|
|
1693
|
+
}
|
|
1694
|
+
function ingressHashIDOf(ingress) {
|
|
1695
|
+
if (typeof ingress.hash_id === 'string' && ingress.hash_id.trim()) {
|
|
1696
|
+
return ingress.hash_id.trim();
|
|
1664
1697
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
index++;
|
|
1698
|
+
if (typeof ingress.hashId === 'string' && ingress.hashId.trim()) {
|
|
1699
|
+
return ingress.hashId.trim();
|
|
1668
1700
|
}
|
|
1669
|
-
|
|
1670
|
-
usedKeys.add(key);
|
|
1671
|
-
return key;
|
|
1701
|
+
return '';
|
|
1672
1702
|
}
|
|
1673
|
-
function
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1703
|
+
function assertSDKGenIngressesReady(ingresses) {
|
|
1704
|
+
if (ingresses.length === 0) {
|
|
1705
|
+
throw new CLIError('SDK_GEN_NO_INGRESSES', 'sdk-gen could not find ingress definitions for this app', 2, {
|
|
1706
|
+
operation: 'dev sdk-gen',
|
|
1707
|
+
suggestions: ['create at least one access rule with a stable ingress.key before running sdk-gen'],
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
const seen = new Set();
|
|
1711
|
+
const missingKey = [];
|
|
1712
|
+
const missingHash = [];
|
|
1713
|
+
const invalidKey = [];
|
|
1714
|
+
const duplicateKey = [];
|
|
1715
|
+
for (const ingress of ingresses) {
|
|
1716
|
+
const key = ingressKeyOf(ingress);
|
|
1717
|
+
if (!key) {
|
|
1718
|
+
missingKey.push(ingress);
|
|
1719
|
+
continue;
|
|
1679
1720
|
}
|
|
1680
|
-
if (
|
|
1681
|
-
|
|
1682
|
-
return;
|
|
1721
|
+
if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(key)) {
|
|
1722
|
+
invalidKey.push(key);
|
|
1683
1723
|
}
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1724
|
+
if (seen.has(key)) {
|
|
1725
|
+
duplicateKey.push(key);
|
|
1726
|
+
}
|
|
1727
|
+
seen.add(key);
|
|
1728
|
+
if (!ingressHashIDOf(ingress)) {
|
|
1729
|
+
missingHash.push(ingress);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
if (missingKey.length > 0) {
|
|
1733
|
+
const preview = missingKey.slice(0, 8).map((ingress) => String(ingress.name ?? ingress.id ?? 'unnamed ingress'));
|
|
1734
|
+
const suffix = missingKey.length > preview.length ? `, and ${missingKey.length - preview.length} more` : '';
|
|
1735
|
+
throw new CLIError('SDK_GEN_INGRESS_KEY_REQUIRED', `missing ingress.key values: ${preview.join(', ')}${suffix}`, 2, {
|
|
1736
|
+
operation: 'dev sdk-gen',
|
|
1737
|
+
issues: missingKey.map((ingress) => ({
|
|
1738
|
+
path: `ingress.${String(ingress.id ?? 'unknown')}.key`,
|
|
1739
|
+
message: `ingress.key is required for ${String(ingress.name ?? ingress.id ?? 'unnamed ingress')}`,
|
|
1740
|
+
})),
|
|
1741
|
+
suggestions: [
|
|
1742
|
+
'set stable ingress.key values in Arcubase admin before running sdk-gen',
|
|
1743
|
+
'rerun arcubase-admin dev sdk-gen after ingress keys are complete',
|
|
1744
|
+
],
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
if (invalidKey.length > 0) {
|
|
1748
|
+
throw new CLIError('SDK_GEN_INVALID_INGRESS_KEY', `invalid ingress.key values: ${invalidKey.join(', ')}`, 2, {
|
|
1749
|
+
operation: 'dev sdk-gen',
|
|
1750
|
+
suggestions: ['use TypeScript identifier keys such as publicEntry or customerPortal'],
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
if (duplicateKey.length > 0) {
|
|
1754
|
+
throw new CLIError('SDK_GEN_DUPLICATE_INGRESS_KEY', `duplicate ingress.key values: ${duplicateKey.join(', ')}`, 2, {
|
|
1755
|
+
operation: 'dev sdk-gen',
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1758
|
+
if (missingHash.length > 0) {
|
|
1759
|
+
throw new CLIError('SDK_GEN_INGRESS_HASH_ID_REQUIRED', 'sdk-gen expected hash_id for every ingress definition', 2, {
|
|
1760
|
+
operation: 'dev sdk-gen',
|
|
1761
|
+
suggestions: ['upgrade Arcubase server so admin access-rule list returns hash_id'],
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1689
1764
|
}
|
|
1690
1765
|
async function executeDevSDKGen(runtimeEnv, flags, fetchImpl) {
|
|
1691
1766
|
validateDevSDKGenFlags(flags);
|
|
@@ -1713,8 +1788,7 @@ async function executeDevSDKGen(runtimeEnv, flags, fetchImpl) {
|
|
|
1713
1788
|
if (entityRefs.length === 0) {
|
|
1714
1789
|
throw new CLIError('SDK_GEN_NO_ENTITIES', 'sdk-gen could not find entities in app detail response', 2);
|
|
1715
1790
|
}
|
|
1716
|
-
const
|
|
1717
|
-
const initializedFieldKeys = [];
|
|
1791
|
+
const ingresses = [];
|
|
1718
1792
|
for (const entityRef of entityRefs) {
|
|
1719
1793
|
const entityEndpoint = `/api/apps/${encodeURIComponent(appId)}/entity/${encodeURIComponent(entityRef.id)}`;
|
|
1720
1794
|
const entityDetail = await requestJSON(runtimeEnv, 'GET', entityEndpoint, undefined, fetchImpl);
|
|
@@ -1722,21 +1796,22 @@ async function executeDevSDKGen(runtimeEnv, flags, fetchImpl) {
|
|
|
1722
1796
|
if (!isRecord(entityPayload)) {
|
|
1723
1797
|
throw new CLIError('SDK_GEN_INVALID_SCHEMA', 'sdk-gen expected entity detail response data', 2);
|
|
1724
1798
|
}
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
}
|
|
1799
|
+
assertSDKGenFieldKeysPresent(entityPayload);
|
|
1800
|
+
const ingressEndpoint = `/api/apps/${encodeURIComponent(appId)}/entity/${encodeURIComponent(entityRef.id)}/ingress`;
|
|
1801
|
+
const ingressList = await requestJSON(runtimeEnv, 'GET', ingressEndpoint, undefined, fetchImpl);
|
|
1802
|
+
const entityIngresses = extractSDKGenIngressRefs(ingressList.data).map((ingress) => ({
|
|
1803
|
+
...ingress,
|
|
1804
|
+
hash_id: ingressHashIDOf(ingress),
|
|
1805
|
+
key: ingressKeyOf(ingress),
|
|
1806
|
+
entity: entityPayload,
|
|
1807
|
+
}));
|
|
1808
|
+
ingresses.push(...entityIngresses);
|
|
1809
|
+
}
|
|
1810
|
+
assertSDKGenIngressesReady(ingresses);
|
|
1736
1811
|
const generated = generateArcubaseProjectSDK({
|
|
1737
1812
|
id: resolveSDKGenAppId(appId, appPayload),
|
|
1738
1813
|
name: typeof appPayload.name === 'string' ? appPayload.name : undefined,
|
|
1739
|
-
|
|
1814
|
+
ingresses,
|
|
1740
1815
|
});
|
|
1741
1816
|
const absoluteOutDir = path.resolve(process.cwd(), outDir);
|
|
1742
1817
|
for (const file of generated.files) {
|
|
@@ -1754,7 +1829,6 @@ async function executeDevSDKGen(runtimeEnv, flags, fetchImpl) {
|
|
|
1754
1829
|
data: {
|
|
1755
1830
|
out: absoluteOutDir,
|
|
1756
1831
|
files: generated.files.map((file) => file.path),
|
|
1757
|
-
initializedFieldKeys,
|
|
1758
1832
|
},
|
|
1759
1833
|
};
|
|
1760
1834
|
}
|
package/package.json
CHANGED
|
@@ -8,34 +8,49 @@ arcubase-admin dev sdk-gen \
|
|
|
8
8
|
--out src/arcubase
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
The command reads the app schema from Arcubase through the normal
|
|
11
|
+
The command reads the app schema from Arcubase through the normal
|
|
12
|
+
`arcubase-admin` runtime auth and writes project-local source files under
|
|
13
|
+
`--out`. This is the direct Arcubase admin/runtime path.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
Workbench local ordinary-user codegen must not receive Arcubase admin tokens.
|
|
16
|
+
It should use the BotWorks Host/JCode schema flow documented in
|
|
17
|
+
`docs/design/workbench/03-workbench-vibe-coding-arcubase-codegen.md`.
|
|
18
|
+
|
|
19
|
+
Generated code is ingress and key based. Application code selects a stable `ingress.key`, then uses stable `field.key` names. Generated runtime code converts those keys to the internal ingress id and numeric field ids.
|
|
20
|
+
If any generated ingress is missing `ingress.key`, or any generated field is missing `field.key`, the command fails before generation and prints the missing keys. Set stable keys in Arcubase admin, then rerun the command.
|
|
15
21
|
|
|
16
22
|
```ts
|
|
17
|
-
import {
|
|
23
|
+
import { createArcubaseClient } from './arcubase'
|
|
18
24
|
|
|
19
|
-
const
|
|
25
|
+
const client = createArcubaseClient({
|
|
20
26
|
baseURL: 'https://team.example.arcubase.co/api',
|
|
21
27
|
accessToken,
|
|
22
28
|
refreshToken,
|
|
23
29
|
})
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
const api = client.ingress('<IngressKey>')
|
|
32
|
+
|
|
33
|
+
await api.create({
|
|
34
|
+
'<FieldKey>': value,
|
|
27
35
|
})
|
|
28
36
|
|
|
29
|
-
await
|
|
30
|
-
|
|
37
|
+
await api.update(rowId, {
|
|
38
|
+
'<FieldKey>': nextValue,
|
|
31
39
|
})
|
|
32
40
|
```
|
|
33
41
|
|
|
42
|
+
The direct `baseURL` and token construction above is for direct Arcubase
|
|
43
|
+
runtime consumers. Workbench browser runtime should wrap generated SDK calls
|
|
44
|
+
with BotWorks Workbench auth and the Host Arcubase proxy instead of exposing
|
|
45
|
+
Arcubase runtime credentials in browser code.
|
|
46
|
+
|
|
34
47
|
Rules:
|
|
35
48
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
49
|
+
- every generated ingress must have a configured `ingress.key`; sdk-gen does not invent fallback keys
|
|
50
|
+
- every visible SDK field must have a configured `field.key`; sdk-gen does not invent fallback keys
|
|
51
|
+
- existing `ingress.key` and `field.key` values must be stable unique TypeScript identifiers
|
|
52
|
+
- `ingress.key` is the Web SDK entry contract and should not track display labels
|
|
38
53
|
- `field.key` is a developer API contract and should not track display labels
|
|
39
|
-
-
|
|
54
|
+
- generated Web code starts from `createArcubaseClient(...).ingress('<IngressKey>')`, not entity CRUD
|
|
40
55
|
- row create/update/query code should use generated types, not raw field ids
|
|
41
56
|
- rerun the command after schema changes and commit the regenerated source with the Web project
|
|
@@ -34,13 +34,13 @@ export const PermitUserScopeSchema: z.ZodTypeAny = z.lazy(() => z.object({ "data
|
|
|
34
34
|
|
|
35
35
|
export const EntityIngressOptionsSchema: z.ZodTypeAny = z.lazy(() => z.object({ "i18n_name": I18NTextSchema.optional(), "list_options": PermitEntityListOptionsSchema.optional(), "policy": PermitPolicySchema.optional(), "user_scope": z.array(PermitUserScopeSchema).optional() }).strict())
|
|
36
36
|
|
|
37
|
-
export const AppIngressBulkApplyItemVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "rule_id": z.number().optional(), "table_id": z.number().optional(), "type": z.string().optional() }).strict())
|
|
37
|
+
export const AppIngressBulkApplyItemVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "key": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "rule_id": z.number().optional(), "table_id": z.number().optional(), "type": z.string().optional() }).strict())
|
|
38
38
|
|
|
39
39
|
export const AppIngressBulkApplyReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "dry_run": z.boolean().optional(), "items": z.array(AppIngressBulkApplyItemVOSchema).optional(), "mode": z.string().optional() }).strict())
|
|
40
40
|
|
|
41
|
-
export const AppIngressCreateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "entity_id": z.number().optional(), "icon_name": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "type": z.string().optional(), "url": z.string().optional() }).strict())
|
|
41
|
+
export const AppIngressCreateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "entity_id": z.number().optional(), "icon_name": z.string().optional(), "key": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "type": z.string().optional(), "url": z.string().optional() }).strict())
|
|
42
42
|
|
|
43
|
-
export const AppIngressUpdateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "update": z.array(z.string()).optional() }).strict())
|
|
43
|
+
export const AppIngressUpdateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "key": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "update": z.array(z.string()).optional() }).strict())
|
|
44
44
|
|
|
45
45
|
export const WidgetsTypeCodeSchema: z.ZodTypeAny = z.lazy(() => z.union([z.literal(1), z.literal(2)]))
|
|
46
46
|
|
package/sdk-dist/types/common.ts
CHANGED
|
@@ -23,7 +23,9 @@ export interface EntityIngress {
|
|
|
23
23
|
app_id?: number;
|
|
24
24
|
enabled?: boolean;
|
|
25
25
|
entity_id?: number;
|
|
26
|
+
hash_id?: string;
|
|
26
27
|
icon_name?: string;
|
|
28
|
+
key?: string;
|
|
27
29
|
last_modified_by?: number;
|
|
28
30
|
menu_group_id?: number;
|
|
29
31
|
mode?: string;
|
|
@@ -64,6 +66,7 @@ export interface AppIngressBulkApplyItemRespVO {
|
|
|
64
66
|
|
|
65
67
|
export interface AppIngressBulkApplyItemVO {
|
|
66
68
|
enabled?: boolean;
|
|
69
|
+
key?: string;
|
|
67
70
|
name?: string;
|
|
68
71
|
options?: EntityIngressOptions;
|
|
69
72
|
rule_id?: number;
|
|
@@ -88,6 +91,7 @@ export interface AppIngressCreateReqVO {
|
|
|
88
91
|
enabled?: boolean;
|
|
89
92
|
entity_id?: number;
|
|
90
93
|
icon_name?: string;
|
|
94
|
+
key?: string;
|
|
91
95
|
name?: string;
|
|
92
96
|
options?: EntityIngressOptions;
|
|
93
97
|
type?: string;
|
|
@@ -99,8 +103,10 @@ export interface AppIngressCreateRespVO {
|
|
|
99
103
|
created_at?: number;
|
|
100
104
|
enabled?: boolean;
|
|
101
105
|
entity_id?: number;
|
|
106
|
+
hash_id?: string;
|
|
102
107
|
icon_name?: string;
|
|
103
108
|
id?: number;
|
|
109
|
+
key?: string;
|
|
104
110
|
last_modified_by?: number;
|
|
105
111
|
menu_group_id?: number;
|
|
106
112
|
mode?: string;
|
|
@@ -117,8 +123,10 @@ export interface AppIngressDeleteRespVO {
|
|
|
117
123
|
created_at?: number;
|
|
118
124
|
enabled?: boolean;
|
|
119
125
|
entity_id?: number;
|
|
126
|
+
hash_id?: string;
|
|
120
127
|
icon_name?: string;
|
|
121
128
|
id?: number;
|
|
129
|
+
key?: string;
|
|
122
130
|
last_modified_by?: number;
|
|
123
131
|
menu_group_id?: number;
|
|
124
132
|
mode?: string;
|
|
@@ -135,8 +143,10 @@ export interface AppIngressGetByHashIDRespVO {
|
|
|
135
143
|
created_at?: number;
|
|
136
144
|
enabled?: boolean;
|
|
137
145
|
entity_id?: number;
|
|
146
|
+
hash_id?: string;
|
|
138
147
|
icon_name?: string;
|
|
139
148
|
id?: number;
|
|
149
|
+
key?: string;
|
|
140
150
|
last_modified_by?: number;
|
|
141
151
|
menu_group_id?: number;
|
|
142
152
|
mode?: string;
|
|
@@ -153,8 +163,10 @@ export interface AppIngressGetRespVO {
|
|
|
153
163
|
created_at?: number;
|
|
154
164
|
enabled?: boolean;
|
|
155
165
|
entity_id?: number;
|
|
166
|
+
hash_id?: string;
|
|
156
167
|
icon_name?: string;
|
|
157
168
|
id?: number;
|
|
169
|
+
key?: string;
|
|
158
170
|
last_modified_by?: number;
|
|
159
171
|
menu_group_id?: number;
|
|
160
172
|
mode?: string;
|
|
@@ -176,6 +188,7 @@ export interface AppIngressUpdateBlocksRespVO {
|
|
|
176
188
|
|
|
177
189
|
export interface AppIngressUpdateReqVO {
|
|
178
190
|
enabled?: boolean;
|
|
191
|
+
key?: string;
|
|
179
192
|
name?: string;
|
|
180
193
|
options?: EntityIngressOptions;
|
|
181
194
|
update?: string[];
|
|
@@ -186,8 +199,10 @@ export interface AppIngressUpdateRespVO {
|
|
|
186
199
|
created_at?: number;
|
|
187
200
|
enabled?: boolean;
|
|
188
201
|
entity_id?: number;
|
|
202
|
+
hash_id?: string;
|
|
189
203
|
icon_name?: string;
|
|
190
204
|
id?: number;
|
|
205
|
+
key?: string;
|
|
191
206
|
last_modified_by?: number;
|
|
192
207
|
menu_group_id?: number;
|
|
193
208
|
mode?: string;
|
|
@@ -34,13 +34,13 @@ export const PermitUserScopeSchema: z.ZodTypeAny = z.lazy(() => z.object({ "data
|
|
|
34
34
|
|
|
35
35
|
export const EntityIngressOptionsSchema: z.ZodTypeAny = z.lazy(() => z.object({ "i18n_name": I18NTextSchema.optional(), "list_options": PermitEntityListOptionsSchema.optional(), "policy": PermitPolicySchema.optional(), "user_scope": z.array(PermitUserScopeSchema).optional() }).strict())
|
|
36
36
|
|
|
37
|
-
export const AppIngressBulkApplyItemVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "rule_id": z.number().optional(), "table_id": z.number().optional(), "type": z.string().optional() }).strict())
|
|
37
|
+
export const AppIngressBulkApplyItemVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "key": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "rule_id": z.number().optional(), "table_id": z.number().optional(), "type": z.string().optional() }).strict())
|
|
38
38
|
|
|
39
39
|
export const AppIngressBulkApplyReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "dry_run": z.boolean().optional(), "items": z.array(AppIngressBulkApplyItemVOSchema).optional(), "mode": z.string().optional() }).strict())
|
|
40
40
|
|
|
41
|
-
export const AppIngressCreateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "entity_id": z.number().optional(), "icon_name": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "type": z.string().optional(), "url": z.string().optional() }).strict())
|
|
41
|
+
export const AppIngressCreateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "entity_id": z.number().optional(), "icon_name": z.string().optional(), "key": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "type": z.string().optional(), "url": z.string().optional() }).strict())
|
|
42
42
|
|
|
43
|
-
export const AppIngressUpdateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "update": z.array(z.string()).optional() }).strict())
|
|
43
|
+
export const AppIngressUpdateReqVOSchema: z.ZodTypeAny = z.lazy(() => z.object({ "enabled": z.boolean().optional(), "key": z.string().optional(), "name": z.string().optional(), "options": EntityIngressOptionsSchema.optional(), "update": z.array(z.string()).optional() }).strict())
|
|
44
44
|
|
|
45
45
|
export const WidgetsTypeCodeSchema: z.ZodTypeAny = z.lazy(() => z.union([z.literal(1), z.literal(2)]))
|
|
46
46
|
|