openxiangda 1.0.131 → 1.0.132
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/lib/cli.js +132 -79
- package/package.json +1 -1
- package/packages/sdk/dist/components/index.cjs +3 -3
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.mjs +3 -3
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +35 -28
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.mjs +35 -28
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +32 -25
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.mjs +32 -25
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/packages/sdk/src/build-source/scripts/sync-schema.mjs +1 -1
package/lib/cli.js
CHANGED
|
@@ -1952,8 +1952,10 @@ async function menu(args) {
|
|
|
1952
1952
|
const data = await requestWithAuth(
|
|
1953
1953
|
config,
|
|
1954
1954
|
target.profileName,
|
|
1955
|
-
|
|
1956
|
-
|
|
1955
|
+
apiPathWithPostDeleteAction(
|
|
1956
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/menus/${encodeURIComponent(menuId)}`
|
|
1957
|
+
),
|
|
1958
|
+
{ method: 'POST' }
|
|
1957
1959
|
);
|
|
1958
1960
|
if (target.bound.resources?.menus?.[menuKey]) {
|
|
1959
1961
|
delete target.bound.resources.menus[menuKey];
|
|
@@ -1973,7 +1975,7 @@ async function menu(args) {
|
|
|
1973
1975
|
const menuId = resolveMenuId(target.bound, menuCode, flags);
|
|
1974
1976
|
const desired = normalizeMenuDirectBody(target.bound, { ...body, code: body.code || menuCode });
|
|
1975
1977
|
const data = await runDirectRequest(config, target, flags, {
|
|
1976
|
-
method: '
|
|
1978
|
+
method: 'POST',
|
|
1977
1979
|
path: `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/menus/${encodeURIComponent(menuId)}`,
|
|
1978
1980
|
body: desired,
|
|
1979
1981
|
}, { returnData: true });
|
|
@@ -2180,8 +2182,10 @@ async function workflow(args) {
|
|
|
2180
2182
|
const data = await requestWithAuth(
|
|
2181
2183
|
config,
|
|
2182
2184
|
target.profileName,
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
+
apiPathWithPostDeleteAction(
|
|
2186
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/workflows/${encodeURIComponent(workflowId)}`
|
|
2187
|
+
),
|
|
2188
|
+
{ method: 'POST' }
|
|
2185
2189
|
);
|
|
2186
2190
|
if (target.bound.resources?.workflows?.[workflowKey]) {
|
|
2187
2191
|
delete target.bound.resources.workflows[workflowKey];
|
|
@@ -2485,8 +2489,10 @@ async function automation(args) {
|
|
|
2485
2489
|
const data = await requestWithAuth(
|
|
2486
2490
|
config,
|
|
2487
2491
|
target.profileName,
|
|
2488
|
-
|
|
2489
|
-
|
|
2492
|
+
apiPathWithPostDeleteAction(
|
|
2493
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/automations/${encodeURIComponent(automationId)}`
|
|
2494
|
+
),
|
|
2495
|
+
{ method: 'POST' }
|
|
2490
2496
|
);
|
|
2491
2497
|
if (target.bound.resources?.automations?.[automationKey]) {
|
|
2492
2498
|
delete target.bound.resources.automations[automationKey];
|
|
@@ -2981,7 +2987,7 @@ async function notification(args) {
|
|
|
2981
2987
|
if (!code) fail('notification template-upsert 缺少 template code');
|
|
2982
2988
|
const normalized = normalizeNotificationTemplateManifest(target.bound, { ...body, ...template, code });
|
|
2983
2989
|
const data = await runDirectRequest(config, target, flags, {
|
|
2984
|
-
method: '
|
|
2990
|
+
method: 'POST',
|
|
2985
2991
|
path: `${appPrefix}/templates/${encodeURIComponent(code)}`,
|
|
2986
2992
|
body: normalized,
|
|
2987
2993
|
}, { returnData: true });
|
|
@@ -2998,8 +3004,8 @@ async function notification(args) {
|
|
|
2998
3004
|
const code = positional[0] || flags.code;
|
|
2999
3005
|
if (!code || !flags.force) fail('用法: openxiangda notification template-delete <templateCode> --force');
|
|
3000
3006
|
return runDirectRequest(config, target, flags, {
|
|
3001
|
-
method: '
|
|
3002
|
-
path: `${appPrefix}/templates/${encodeURIComponent(code)}
|
|
3007
|
+
method: 'POST',
|
|
3008
|
+
path: apiPathWithPostDeleteAction(`${appPrefix}/templates/${encodeURIComponent(code)}`),
|
|
3003
3009
|
});
|
|
3004
3010
|
}
|
|
3005
3011
|
if (subcommand === 'type-list') {
|
|
@@ -3023,7 +3029,7 @@ async function notification(args) {
|
|
|
3023
3029
|
if (!code) fail('notification type-upsert 缺少 notificationType');
|
|
3024
3030
|
const normalized = normalizeNotificationTypeConfigManifest(target.bound, { ...body, ...configBody, notificationType: code });
|
|
3025
3031
|
const data = await runDirectRequest(config, target, flags, {
|
|
3026
|
-
method: '
|
|
3032
|
+
method: 'POST',
|
|
3027
3033
|
path: `${appPrefix}/type-configs/${encodeURIComponent(code)}`,
|
|
3028
3034
|
body: normalized,
|
|
3029
3035
|
}, { returnData: true });
|
|
@@ -3043,8 +3049,8 @@ async function notification(args) {
|
|
|
3043
3049
|
const code = positional[0] || flags.code;
|
|
3044
3050
|
if (!code || !flags.force) fail('用法: openxiangda notification type-delete <notificationType> --force');
|
|
3045
3051
|
return runDirectRequest(config, target, flags, {
|
|
3046
|
-
method: '
|
|
3047
|
-
path: `${appPrefix}/type-configs/${encodeURIComponent(code)}
|
|
3052
|
+
method: 'POST',
|
|
3053
|
+
path: apiPathWithPostDeleteAction(`${appPrefix}/type-configs/${encodeURIComponent(code)}`),
|
|
3048
3054
|
});
|
|
3049
3055
|
}
|
|
3050
3056
|
if (['preview', 'send', 'batch-send'].includes(subcommand)) {
|
|
@@ -3213,7 +3219,7 @@ async function permission(args) {
|
|
|
3213
3219
|
const target = getWorkspaceTarget(config, profileName, flags);
|
|
3214
3220
|
const roleId = resolveRoleId(target.bound, roleCode, flags);
|
|
3215
3221
|
const data = await runDirectRequest(config, target, flags, {
|
|
3216
|
-
method: '
|
|
3222
|
+
method: 'POST',
|
|
3217
3223
|
path: `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/roles/${encodeURIComponent(roleId)}`,
|
|
3218
3224
|
body: {
|
|
3219
3225
|
code: body.code || roleCode,
|
|
@@ -3235,8 +3241,10 @@ async function permission(args) {
|
|
|
3235
3241
|
const target = getWorkspaceTarget(config, profileName, flags);
|
|
3236
3242
|
const roleId = resolveRoleId(target.bound, roleKey, flags);
|
|
3237
3243
|
const data = await runDirectRequest(config, target, flags, {
|
|
3238
|
-
method: '
|
|
3239
|
-
path:
|
|
3244
|
+
method: 'POST',
|
|
3245
|
+
path: apiPathWithPostDeleteAction(
|
|
3246
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/roles/${encodeURIComponent(roleId)}`
|
|
3247
|
+
),
|
|
3240
3248
|
}, { returnData: true });
|
|
3241
3249
|
if (!flags['dry-run'] && target.bound.resources?.roles?.[roleKey]) {
|
|
3242
3250
|
delete target.bound.resources.roles[roleKey];
|
|
@@ -3391,7 +3399,7 @@ async function permission(args) {
|
|
|
3391
3399
|
const groupId = flags['group-id'] || target.bound.resources?.pagePermissionGroups?.[groupCode]?.groupId || groupCode;
|
|
3392
3400
|
const normalized = normalizePagePermissionGroupDirectBody(target.bound, { ...body, code: body.code || groupCode });
|
|
3393
3401
|
const data = await runDirectRequest(config, target, flags, {
|
|
3394
|
-
method: '
|
|
3402
|
+
method: 'POST',
|
|
3395
3403
|
path: `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/page-permission-groups/${encodeURIComponent(groupId)}`,
|
|
3396
3404
|
body: normalized,
|
|
3397
3405
|
}, { returnData: true });
|
|
@@ -3408,8 +3416,10 @@ async function permission(args) {
|
|
|
3408
3416
|
const target = getWorkspaceTarget(config, profileName, flags);
|
|
3409
3417
|
const groupId = flags['group-id'] || target.bound.resources?.pagePermissionGroups?.[groupKey]?.groupId || groupKey;
|
|
3410
3418
|
const data = await runDirectRequest(config, target, flags, {
|
|
3411
|
-
method: '
|
|
3412
|
-
path:
|
|
3419
|
+
method: 'POST',
|
|
3420
|
+
path: apiPathWithPostDeleteAction(
|
|
3421
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/page-permission-groups/${encodeURIComponent(groupId)}`
|
|
3422
|
+
),
|
|
3413
3423
|
}, { returnData: true });
|
|
3414
3424
|
if (!flags['dry-run'] && target.bound.resources?.pagePermissionGroups?.[groupKey]) {
|
|
3415
3425
|
delete target.bound.resources.pagePermissionGroups[groupKey];
|
|
@@ -3525,7 +3535,7 @@ async function permission(args) {
|
|
|
3525
3535
|
const groupId = flags['group-id'] || target.bound.resources?.formPermissionGroups?.[groupCode]?.groupId || groupCode;
|
|
3526
3536
|
const normalized = normalizeFormPermissionGroupManifest(target.bound, { ...body, code: body.code || groupCode, formUuid });
|
|
3527
3537
|
const data = await runDirectRequest(config, target, flags, {
|
|
3528
|
-
method: '
|
|
3538
|
+
method: 'POST',
|
|
3529
3539
|
path: `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/permission-groups/${encodeURIComponent(groupId)}`,
|
|
3530
3540
|
body: normalized,
|
|
3531
3541
|
}, { returnData: true });
|
|
@@ -3543,8 +3553,10 @@ async function permission(args) {
|
|
|
3543
3553
|
if (!groupKey || !formUuid || !flags.force) fail('用法: openxiangda permission form-group-delete <groupCode|groupId> --form-code code|--form-uuid FORM --force');
|
|
3544
3554
|
const groupId = flags['group-id'] || target.bound.resources?.formPermissionGroups?.[groupKey]?.groupId || groupKey;
|
|
3545
3555
|
const data = await runDirectRequest(config, target, flags, {
|
|
3546
|
-
method: '
|
|
3547
|
-
path:
|
|
3556
|
+
method: 'POST',
|
|
3557
|
+
path: apiPathWithPostDeleteAction(
|
|
3558
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/permission-groups/${encodeURIComponent(groupId)}`
|
|
3559
|
+
),
|
|
3548
3560
|
}, { returnData: true });
|
|
3549
3561
|
if (!flags['dry-run'] && target.bound.resources?.formPermissionGroups?.[groupKey]) {
|
|
3550
3562
|
delete target.bound.resources.formPermissionGroups[groupKey];
|
|
@@ -3659,7 +3671,7 @@ async function settings(args) {
|
|
|
3659
3671
|
target.profileName,
|
|
3660
3672
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/settings`,
|
|
3661
3673
|
{
|
|
3662
|
-
method: '
|
|
3674
|
+
method: 'POST',
|
|
3663
3675
|
body: {
|
|
3664
3676
|
settings: readJsonArg(flags['settings-json'], 'settings-json'),
|
|
3665
3677
|
},
|
|
@@ -3694,7 +3706,7 @@ async function settings(args) {
|
|
|
3694
3706
|
target.profileName,
|
|
3695
3707
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/field-indexes`,
|
|
3696
3708
|
{
|
|
3697
|
-
method: '
|
|
3709
|
+
method: 'POST',
|
|
3698
3710
|
body: {
|
|
3699
3711
|
indexes: readJsonArg(flags['indexes-json'], 'indexes-json'),
|
|
3700
3712
|
},
|
|
@@ -3729,7 +3741,7 @@ async function settings(args) {
|
|
|
3729
3741
|
target.profileName,
|
|
3730
3742
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/data-management`,
|
|
3731
3743
|
{
|
|
3732
|
-
method: '
|
|
3744
|
+
method: 'POST',
|
|
3733
3745
|
body: {
|
|
3734
3746
|
config: readJsonArg(flags['config-json'], 'config-json'),
|
|
3735
3747
|
},
|
|
@@ -3761,7 +3773,7 @@ async function settings(args) {
|
|
|
3761
3773
|
target.profileName,
|
|
3762
3774
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/public-access`,
|
|
3763
3775
|
{
|
|
3764
|
-
method: '
|
|
3776
|
+
method: 'POST',
|
|
3765
3777
|
body: {
|
|
3766
3778
|
isPublic: flags.public === undefined ? true : String(flags.public) !== 'false',
|
|
3767
3779
|
description: flags.description || '',
|
|
@@ -3779,8 +3791,10 @@ async function settings(args) {
|
|
|
3779
3791
|
const data = await requestWithAuth(
|
|
3780
3792
|
config,
|
|
3781
3793
|
target.profileName,
|
|
3782
|
-
|
|
3783
|
-
|
|
3794
|
+
apiPathWithPostDeleteAction(
|
|
3795
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/public-access`
|
|
3796
|
+
),
|
|
3797
|
+
{ method: 'POST' }
|
|
3784
3798
|
);
|
|
3785
3799
|
if (flags.json) return writeJson(data);
|
|
3786
3800
|
print(JSON.stringify(data, null, 2));
|
|
@@ -4773,8 +4787,8 @@ async function directResourceCrud(config, target, spec) {
|
|
|
4773
4787
|
const code = positional[0] || flags.code;
|
|
4774
4788
|
if (!code || !flags.force) fail(`用法: openxiangda ${spec.commandName} delete <code> --force`);
|
|
4775
4789
|
const data = await runDirectRequest(config, target, flags, {
|
|
4776
|
-
method: '
|
|
4777
|
-
path: `${basePath}/${encodeURIComponent(code)}
|
|
4790
|
+
method: 'POST',
|
|
4791
|
+
path: apiPathWithPostDeleteAction(`${basePath}/${encodeURIComponent(code)}`),
|
|
4778
4792
|
}, { returnData: true });
|
|
4779
4793
|
if (!flags['dry-run']) removeDirectStateResource(target, spec.resourceType, code);
|
|
4780
4794
|
return outputDirectResult(data, flags);
|
|
@@ -4797,7 +4811,7 @@ async function directResourceCrud(config, target, spec) {
|
|
|
4797
4811
|
? spec.normalizeBody(rawBody)
|
|
4798
4812
|
: rawBody;
|
|
4799
4813
|
|
|
4800
|
-
let method = subcommand === 'create' ? (spec.createMethod || 'POST') : (spec.updateMethod || '
|
|
4814
|
+
let method = subcommand === 'create' ? (spec.createMethod || 'POST') : (spec.updateMethod || 'POST');
|
|
4801
4815
|
let requestPath = subcommand === 'create'
|
|
4802
4816
|
? (spec.createPath || basePath)
|
|
4803
4817
|
: (spec.updatePath || `${basePath}/${encodeURIComponent(code)}`);
|
|
@@ -4818,7 +4832,7 @@ async function directResourceCrud(config, target, spec) {
|
|
|
4818
4832
|
body: spec.createBody ? spec.createBody(rawBody, normalizedBody) : normalizedBody,
|
|
4819
4833
|
},
|
|
4820
4834
|
update: {
|
|
4821
|
-
method: spec.updateMethod || '
|
|
4835
|
+
method: spec.updateMethod || 'POST',
|
|
4822
4836
|
path: spec.updatePath || `${basePath}/${encodeURIComponent(code)}`,
|
|
4823
4837
|
body: spec.updateBody ? spec.updateBody(rawBody, normalizedBody) : normalizedBody,
|
|
4824
4838
|
},
|
|
@@ -4830,7 +4844,7 @@ async function directResourceCrud(config, target, spec) {
|
|
|
4830
4844
|
`${basePath}/${encodeURIComponent(code)}`
|
|
4831
4845
|
);
|
|
4832
4846
|
action = existing ? 'update' : 'create';
|
|
4833
|
-
method = existing ? (spec.updateMethod || '
|
|
4847
|
+
method = existing ? (spec.updateMethod || 'POST') : (spec.createMethod || 'POST');
|
|
4834
4848
|
requestPath = existing
|
|
4835
4849
|
? (spec.updatePath || `${basePath}/${encodeURIComponent(code)}`)
|
|
4836
4850
|
: (spec.createPath || basePath);
|
|
@@ -7178,7 +7192,7 @@ async function publishRoleResources(config, target, roles, result, options = {})
|
|
|
7178
7192
|
config,
|
|
7179
7193
|
target.profileName,
|
|
7180
7194
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/roles/${encodeURIComponent(existing.id)}`,
|
|
7181
|
-
{ method: '
|
|
7195
|
+
{ method: 'POST', body }
|
|
7182
7196
|
)
|
|
7183
7197
|
: await requestWithAuth(
|
|
7184
7198
|
config,
|
|
@@ -7236,7 +7250,7 @@ async function publishFormSettingsResources(config, target, settingsItems, resul
|
|
|
7236
7250
|
config,
|
|
7237
7251
|
target.profileName,
|
|
7238
7252
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/settings`,
|
|
7239
|
-
{ method: '
|
|
7253
|
+
{ method: 'POST', body: { settings: item.settings } }
|
|
7240
7254
|
);
|
|
7241
7255
|
}
|
|
7242
7256
|
if (item.indexes !== undefined) {
|
|
@@ -7244,7 +7258,7 @@ async function publishFormSettingsResources(config, target, settingsItems, resul
|
|
|
7244
7258
|
config,
|
|
7245
7259
|
target.profileName,
|
|
7246
7260
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/field-indexes`,
|
|
7247
|
-
{ method: '
|
|
7261
|
+
{ method: 'POST', body: { indexes: item.indexes } }
|
|
7248
7262
|
);
|
|
7249
7263
|
}
|
|
7250
7264
|
if (item.dataManagement !== undefined) {
|
|
@@ -7252,7 +7266,7 @@ async function publishFormSettingsResources(config, target, settingsItems, resul
|
|
|
7252
7266
|
config,
|
|
7253
7267
|
target.profileName,
|
|
7254
7268
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/data-management`,
|
|
7255
|
-
{ method: '
|
|
7269
|
+
{ method: 'POST', body: { config: item.dataManagement } }
|
|
7256
7270
|
);
|
|
7257
7271
|
}
|
|
7258
7272
|
if (item.publicAccess !== undefined) {
|
|
@@ -7260,12 +7274,15 @@ async function publishFormSettingsResources(config, target, settingsItems, resul
|
|
|
7260
7274
|
typeof item.publicAccess === 'object'
|
|
7261
7275
|
? item.publicAccess
|
|
7262
7276
|
: { isPublic: Boolean(item.publicAccess) };
|
|
7277
|
+
const publicAccessPath = `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/public-access`;
|
|
7263
7278
|
await requestWithAuth(
|
|
7264
7279
|
config,
|
|
7265
7280
|
target.profileName,
|
|
7266
|
-
|
|
7281
|
+
publicAccess.isPublic === false
|
|
7282
|
+
? apiPathWithPostDeleteAction(publicAccessPath)
|
|
7283
|
+
: publicAccessPath,
|
|
7267
7284
|
{
|
|
7268
|
-
method:
|
|
7285
|
+
method: 'POST',
|
|
7269
7286
|
body: {
|
|
7270
7287
|
isPublic: publicAccess.isPublic !== false,
|
|
7271
7288
|
description: publicAccess.description || '',
|
|
@@ -7309,7 +7326,7 @@ async function publishMenuResources(config, target, menus, result, options = {})
|
|
|
7309
7326
|
config,
|
|
7310
7327
|
target.profileName,
|
|
7311
7328
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/menus/${encodeURIComponent(existing.id)}`,
|
|
7312
|
-
{ method: '
|
|
7329
|
+
{ method: 'POST', body }
|
|
7313
7330
|
)
|
|
7314
7331
|
: await requestWithAuth(
|
|
7315
7332
|
config,
|
|
@@ -7401,7 +7418,7 @@ async function publishNotificationResources(config, target, notifications, resul
|
|
|
7401
7418
|
config,
|
|
7402
7419
|
target.profileName,
|
|
7403
7420
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/notifications/templates/${encodeURIComponent(template.code)}`,
|
|
7404
|
-
{ method: '
|
|
7421
|
+
{ method: 'POST', body }
|
|
7405
7422
|
);
|
|
7406
7423
|
if (data?.id) {
|
|
7407
7424
|
saveNotificationTemplateResource(target, template.code, data.id, {
|
|
@@ -7428,7 +7445,7 @@ async function publishNotificationResources(config, target, notifications, resul
|
|
|
7428
7445
|
config,
|
|
7429
7446
|
target.profileName,
|
|
7430
7447
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/notifications/type-configs/${encodeURIComponent(configItem.notificationType)}`,
|
|
7431
|
-
{ method: '
|
|
7448
|
+
{ method: 'POST', body }
|
|
7432
7449
|
);
|
|
7433
7450
|
const stateCode = configItem.code || notificationTypeConfigDesiredKey(target.bound, configItem);
|
|
7434
7451
|
if (data?.id) {
|
|
@@ -7494,7 +7511,7 @@ async function publishWorkflowResources(config, target, workflows, result, optio
|
|
|
7494
7511
|
config,
|
|
7495
7512
|
target.profileName,
|
|
7496
7513
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/workflows/${encodeURIComponent(existing.id)}`,
|
|
7497
|
-
{ method: '
|
|
7514
|
+
{ method: 'POST', body }
|
|
7498
7515
|
)
|
|
7499
7516
|
: await requestWithAuth(
|
|
7500
7517
|
config,
|
|
@@ -7586,7 +7603,7 @@ async function publishAutomationResources(config, target, automations, result, o
|
|
|
7586
7603
|
config,
|
|
7587
7604
|
target.profileName,
|
|
7588
7605
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/automations/${encodeURIComponent(existing.id)}`,
|
|
7589
|
-
{ method: '
|
|
7606
|
+
{ method: 'POST', body }
|
|
7590
7607
|
)
|
|
7591
7608
|
: await requestWithAuth(
|
|
7592
7609
|
config,
|
|
@@ -7649,7 +7666,7 @@ async function publishFunctionResources(config, target, functions, result, optio
|
|
|
7649
7666
|
config,
|
|
7650
7667
|
target.profileName,
|
|
7651
7668
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/functions/${encodeURIComponent(code)}`,
|
|
7652
|
-
{ method: '
|
|
7669
|
+
{ method: 'POST', body }
|
|
7653
7670
|
)
|
|
7654
7671
|
: await requestWithAuth(
|
|
7655
7672
|
config,
|
|
@@ -7685,7 +7702,7 @@ async function publishAuthConfigResources(config, target, authConfigs, result, o
|
|
|
7685
7702
|
config,
|
|
7686
7703
|
target.profileName,
|
|
7687
7704
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/auth/configs/${encodeURIComponent(code)}`,
|
|
7688
|
-
{ method: '
|
|
7705
|
+
{ method: 'POST', body }
|
|
7689
7706
|
)
|
|
7690
7707
|
: await requestWithAuth(
|
|
7691
7708
|
config,
|
|
@@ -7720,7 +7737,7 @@ async function publishDataViewResources(config, target, dataViews, result, optio
|
|
|
7720
7737
|
config,
|
|
7721
7738
|
target.profileName,
|
|
7722
7739
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/data-views/${encodeURIComponent(dataViewItem.code)}`,
|
|
7723
|
-
{ method: '
|
|
7740
|
+
{ method: 'POST', body }
|
|
7724
7741
|
)
|
|
7725
7742
|
: await requestWithAuth(
|
|
7726
7743
|
config,
|
|
@@ -7766,7 +7783,7 @@ async function publishStorageConfigResources(config, target, storageConfigs, res
|
|
|
7766
7783
|
config,
|
|
7767
7784
|
target.profileName,
|
|
7768
7785
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/storage-configs/${encodeURIComponent(code)}`,
|
|
7769
|
-
{ method: '
|
|
7786
|
+
{ method: 'POST', body }
|
|
7770
7787
|
)
|
|
7771
7788
|
: await requestWithAuth(
|
|
7772
7789
|
config,
|
|
@@ -7796,7 +7813,7 @@ async function publishDataViewPermissionGroups(config, target, dataViewCode, per
|
|
|
7796
7813
|
target.profileName,
|
|
7797
7814
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/data-views/${encodeURIComponent(dataViewCode)}/permission-groups`,
|
|
7798
7815
|
{
|
|
7799
|
-
method: '
|
|
7816
|
+
method: 'POST',
|
|
7800
7817
|
body: {
|
|
7801
7818
|
groups: permissionGroups,
|
|
7802
7819
|
},
|
|
@@ -7818,7 +7835,7 @@ async function publishRouteResources(config, target, routes, result, options = {
|
|
|
7818
7835
|
config,
|
|
7819
7836
|
target.profileName,
|
|
7820
7837
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/routes/${encodeURIComponent(code)}`,
|
|
7821
|
-
{ method: '
|
|
7838
|
+
{ method: 'POST', body }
|
|
7822
7839
|
)
|
|
7823
7840
|
: await requestWithAuth(
|
|
7824
7841
|
config,
|
|
@@ -7856,7 +7873,7 @@ async function publishPublicAccessPolicyResources(config, target, policies, resu
|
|
|
7856
7873
|
config,
|
|
7857
7874
|
target.profileName,
|
|
7858
7875
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/public-access/policies/${encodeURIComponent(code)}`,
|
|
7859
|
-
{ method: '
|
|
7876
|
+
{ method: 'POST', body }
|
|
7860
7877
|
)
|
|
7861
7878
|
: await requestWithAuth(
|
|
7862
7879
|
config,
|
|
@@ -7997,7 +8014,7 @@ async function publishPagePermissionGroupResources(config, target, groups, resul
|
|
|
7997
8014
|
config,
|
|
7998
8015
|
target.profileName,
|
|
7999
8016
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/page-permission-groups/${encodeURIComponent(existing.id)}`,
|
|
8000
|
-
{ method: '
|
|
8017
|
+
{ method: 'POST', body }
|
|
8001
8018
|
)
|
|
8002
8019
|
: await requestWithAuth(
|
|
8003
8020
|
config,
|
|
@@ -8056,7 +8073,7 @@ async function publishFormPermissionGroupResources(config, target, groups, resul
|
|
|
8056
8073
|
config,
|
|
8057
8074
|
target.profileName,
|
|
8058
8075
|
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/permission-groups/${encodeURIComponent(existing.id)}`,
|
|
8059
|
-
{ method: '
|
|
8076
|
+
{ method: 'POST', body }
|
|
8060
8077
|
)
|
|
8061
8078
|
: await requestWithAuth(
|
|
8062
8079
|
config,
|
|
@@ -8146,8 +8163,10 @@ async function pruneRoles(config, target, desired, result) {
|
|
|
8146
8163
|
await requestWithAuth(
|
|
8147
8164
|
config,
|
|
8148
8165
|
target.profileName,
|
|
8149
|
-
|
|
8150
|
-
|
|
8166
|
+
apiPathWithPostDeleteAction(
|
|
8167
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/roles/${encodeURIComponent(role.id)}`
|
|
8168
|
+
),
|
|
8169
|
+
{ method: 'POST' }
|
|
8151
8170
|
);
|
|
8152
8171
|
});
|
|
8153
8172
|
}
|
|
@@ -8166,8 +8185,10 @@ async function pruneConnectors(config, target, desired, result) {
|
|
|
8166
8185
|
await requestWithAuth(
|
|
8167
8186
|
config,
|
|
8168
8187
|
target.profileName,
|
|
8169
|
-
|
|
8170
|
-
|
|
8188
|
+
apiPathWithPostDeleteAction(
|
|
8189
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/connectors/${encodeURIComponent(code)}`
|
|
8190
|
+
),
|
|
8191
|
+
{ method: 'POST' }
|
|
8171
8192
|
);
|
|
8172
8193
|
});
|
|
8173
8194
|
}
|
|
@@ -8187,8 +8208,10 @@ async function pruneMenus(config, target, desired, result) {
|
|
|
8187
8208
|
await requestWithAuth(
|
|
8188
8209
|
config,
|
|
8189
8210
|
target.profileName,
|
|
8190
|
-
|
|
8191
|
-
|
|
8211
|
+
apiPathWithPostDeleteAction(
|
|
8212
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/menus/${encodeURIComponent(menu.id)}`
|
|
8213
|
+
),
|
|
8214
|
+
{ method: 'POST' }
|
|
8192
8215
|
);
|
|
8193
8216
|
});
|
|
8194
8217
|
}
|
|
@@ -8218,8 +8241,10 @@ async function pruneWorkflows(config, target, desired, result) {
|
|
|
8218
8241
|
await requestWithAuth(
|
|
8219
8242
|
config,
|
|
8220
8243
|
target.profileName,
|
|
8221
|
-
|
|
8222
|
-
|
|
8244
|
+
apiPathWithPostDeleteAction(
|
|
8245
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/workflows/${encodeURIComponent(workflow.id)}`
|
|
8246
|
+
),
|
|
8247
|
+
{ method: 'POST' }
|
|
8223
8248
|
);
|
|
8224
8249
|
});
|
|
8225
8250
|
}
|
|
@@ -8249,8 +8274,10 @@ async function pruneAutomations(config, target, desired, result) {
|
|
|
8249
8274
|
await requestWithAuth(
|
|
8250
8275
|
config,
|
|
8251
8276
|
target.profileName,
|
|
8252
|
-
|
|
8253
|
-
|
|
8277
|
+
apiPathWithPostDeleteAction(
|
|
8278
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/automations/${encodeURIComponent(automation.id)}`
|
|
8279
|
+
),
|
|
8280
|
+
{ method: 'POST' }
|
|
8254
8281
|
);
|
|
8255
8282
|
});
|
|
8256
8283
|
}
|
|
@@ -8272,8 +8299,10 @@ async function pruneDataViews(config, target, desired, result) {
|
|
|
8272
8299
|
await requestWithAuth(
|
|
8273
8300
|
config,
|
|
8274
8301
|
target.profileName,
|
|
8275
|
-
|
|
8276
|
-
|
|
8302
|
+
apiPathWithPostDeleteAction(
|
|
8303
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/data-views/${encodeURIComponent(code)}`
|
|
8304
|
+
),
|
|
8305
|
+
{ method: 'POST' }
|
|
8277
8306
|
);
|
|
8278
8307
|
});
|
|
8279
8308
|
}
|
|
@@ -8295,8 +8324,10 @@ async function pruneStorageConfigs(config, target, desired, result) {
|
|
|
8295
8324
|
await requestWithAuth(
|
|
8296
8325
|
config,
|
|
8297
8326
|
target.profileName,
|
|
8298
|
-
|
|
8299
|
-
|
|
8327
|
+
apiPathWithPostDeleteAction(
|
|
8328
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/storage-configs/${encodeURIComponent(code)}`
|
|
8329
|
+
),
|
|
8330
|
+
{ method: 'POST' }
|
|
8300
8331
|
);
|
|
8301
8332
|
});
|
|
8302
8333
|
}
|
|
@@ -8318,8 +8349,10 @@ async function pruneFunctions(config, target, desired, result) {
|
|
|
8318
8349
|
await requestWithAuth(
|
|
8319
8350
|
config,
|
|
8320
8351
|
target.profileName,
|
|
8321
|
-
|
|
8322
|
-
|
|
8352
|
+
apiPathWithPostDeleteAction(
|
|
8353
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/functions/${encodeURIComponent(code)}`
|
|
8354
|
+
),
|
|
8355
|
+
{ method: 'POST' }
|
|
8323
8356
|
);
|
|
8324
8357
|
});
|
|
8325
8358
|
}
|
|
@@ -8341,8 +8374,10 @@ async function pruneAuthConfigs(config, target, desired, result) {
|
|
|
8341
8374
|
await requestWithAuth(
|
|
8342
8375
|
config,
|
|
8343
8376
|
target.profileName,
|
|
8344
|
-
|
|
8345
|
-
|
|
8377
|
+
apiPathWithPostDeleteAction(
|
|
8378
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/auth/configs/${encodeURIComponent(code)}`
|
|
8379
|
+
),
|
|
8380
|
+
{ method: 'POST' }
|
|
8346
8381
|
);
|
|
8347
8382
|
});
|
|
8348
8383
|
}
|
|
@@ -8364,8 +8399,10 @@ async function pruneRoutes(config, target, desired, result) {
|
|
|
8364
8399
|
await requestWithAuth(
|
|
8365
8400
|
config,
|
|
8366
8401
|
target.profileName,
|
|
8367
|
-
|
|
8368
|
-
|
|
8402
|
+
apiPathWithPostDeleteAction(
|
|
8403
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/routes/${encodeURIComponent(code)}`
|
|
8404
|
+
),
|
|
8405
|
+
{ method: 'POST' }
|
|
8369
8406
|
);
|
|
8370
8407
|
});
|
|
8371
8408
|
}
|
|
@@ -8387,8 +8424,10 @@ async function prunePublicAccessPolicies(config, target, desired, result) {
|
|
|
8387
8424
|
await requestWithAuth(
|
|
8388
8425
|
config,
|
|
8389
8426
|
target.profileName,
|
|
8390
|
-
|
|
8391
|
-
|
|
8427
|
+
apiPathWithPostDeleteAction(
|
|
8428
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/public-access/policies/${encodeURIComponent(code)}`
|
|
8429
|
+
),
|
|
8430
|
+
{ method: 'POST' }
|
|
8392
8431
|
);
|
|
8393
8432
|
});
|
|
8394
8433
|
}
|
|
@@ -8410,8 +8449,10 @@ async function prunePagePermissionGroups(config, target, desired, result) {
|
|
|
8410
8449
|
await requestWithAuth(
|
|
8411
8450
|
config,
|
|
8412
8451
|
target.profileName,
|
|
8413
|
-
|
|
8414
|
-
|
|
8452
|
+
apiPathWithPostDeleteAction(
|
|
8453
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/page-permission-groups/${encodeURIComponent(group.id)}`
|
|
8454
|
+
),
|
|
8455
|
+
{ method: 'POST' }
|
|
8415
8456
|
);
|
|
8416
8457
|
});
|
|
8417
8458
|
}
|
|
@@ -8441,8 +8482,10 @@ async function pruneFormPermissionGroups(config, target, desired, result) {
|
|
|
8441
8482
|
await requestWithAuth(
|
|
8442
8483
|
config,
|
|
8443
8484
|
target.profileName,
|
|
8444
|
-
|
|
8445
|
-
|
|
8485
|
+
apiPathWithPostDeleteAction(
|
|
8486
|
+
`/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/forms/${encodeURIComponent(formUuid)}/permission-groups/${encodeURIComponent(group.id)}`
|
|
8487
|
+
),
|
|
8488
|
+
{ method: 'POST' }
|
|
8446
8489
|
);
|
|
8447
8490
|
});
|
|
8448
8491
|
}
|
|
@@ -10529,6 +10572,16 @@ function findWorkspaceRoot(startPath) {
|
|
|
10529
10572
|
return process.cwd();
|
|
10530
10573
|
}
|
|
10531
10574
|
|
|
10575
|
+
function apiPathWithPostDeleteAction(apiPath) {
|
|
10576
|
+
const value = String(apiPath || '');
|
|
10577
|
+
const queryIndex = value.indexOf('?');
|
|
10578
|
+
const base = queryIndex >= 0 ? value.slice(0, queryIndex) : value;
|
|
10579
|
+
const suffix = queryIndex >= 0 ? value.slice(queryIndex) : '';
|
|
10580
|
+
if (!base || base === '/') return '/delete' + suffix;
|
|
10581
|
+
if (/(^|\/)delete(\/|$)/.test(base)) return value;
|
|
10582
|
+
return base.replace(/\/$/, '') + '/delete' + suffix;
|
|
10583
|
+
}
|
|
10584
|
+
|
|
10532
10585
|
function apiPathWithQuery(apiPath, query) {
|
|
10533
10586
|
const params = new URLSearchParams();
|
|
10534
10587
|
for (const [key, value] of Object.entries(query || {})) {
|
package/package.json
CHANGED
|
@@ -12259,7 +12259,7 @@ async function handleApproval(request, params) {
|
|
|
12259
12259
|
async function withdrawProcess(request, params) {
|
|
12260
12260
|
const response = await request({
|
|
12261
12261
|
url: `/workflow/instance/${params.instanceId}/withdraw`,
|
|
12262
|
-
method: "
|
|
12262
|
+
method: "post",
|
|
12263
12263
|
data: { reason: params.reason }
|
|
12264
12264
|
});
|
|
12265
12265
|
return unwrapRuntimeResponse(response);
|
|
@@ -12267,7 +12267,7 @@ async function withdrawProcess(request, params) {
|
|
|
12267
12267
|
async function transferTask(request, params) {
|
|
12268
12268
|
const response = await request({
|
|
12269
12269
|
url: `/workflow/task/${params.taskId}/transfer`,
|
|
12270
|
-
method: "
|
|
12270
|
+
method: "post",
|
|
12271
12271
|
data: { newAssignee: params.newAssignee, reason: params.reason }
|
|
12272
12272
|
});
|
|
12273
12273
|
return unwrapRuntimeResponse(response);
|
|
@@ -12275,7 +12275,7 @@ async function transferTask(request, params) {
|
|
|
12275
12275
|
async function returnTask(request, params) {
|
|
12276
12276
|
const response = await request({
|
|
12277
12277
|
url: `/workflow/task/${params.taskId}/return`,
|
|
12278
|
-
method: "
|
|
12278
|
+
method: "post",
|
|
12279
12279
|
data: { targetNodeId: params.targetNodeId, reason: params.reason }
|
|
12280
12280
|
});
|
|
12281
12281
|
return unwrapRuntimeResponse(response);
|