@sasjs/api 0.44.4 → 0.44.5
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/build/browser.js +529 -65
- package/build/cjs/corpus/records.js +272 -34
- package/build/cjs/host/dispatch.js +299 -24
- package/build/cjs/identity/records.js +5 -3
- package/build/cjs/routes/generated.js +35 -7
- package/build/esm/corpus/records.d.ts.map +1 -1
- package/build/esm/corpus/records.js +272 -34
- package/build/esm/host/dispatch.d.ts.map +1 -1
- package/build/esm/host/dispatch.js +299 -24
- package/build/esm/identity/records.d.ts +1 -1
- package/build/esm/identity/records.d.ts.map +1 -1
- package/build/esm/identity/records.js +5 -3
- package/build/esm/routes/generated.d.ts.map +1 -1
- package/build/esm/routes/generated.js +35 -7
- package/package.json +1 -1
package/build/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @sasjs/api 0.44.
|
|
1
|
+
/* @sasjs/api 0.44.5 - the SASjs Server API, for a service worker. https://github.com/sasjs/api */
|
|
2
2
|
"use strict";
|
|
3
3
|
var SASjsApi = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -2224,7 +2224,7 @@ var SASjsApi = (() => {
|
|
|
2224
2224
|
{
|
|
2225
2225
|
name: "description",
|
|
2226
2226
|
in: "body",
|
|
2227
|
-
required:
|
|
2227
|
+
required: false,
|
|
2228
2228
|
type: "string"
|
|
2229
2229
|
},
|
|
2230
2230
|
{
|
|
@@ -2240,6 +2240,10 @@ var SASjsApi = (() => {
|
|
|
2240
2240
|
status: 200,
|
|
2241
2241
|
description: "Ok"
|
|
2242
2242
|
},
|
|
2243
|
+
{
|
|
2244
|
+
status: 400,
|
|
2245
|
+
description: 'A body the schema refuses, e.g. `"isActive" must be a boolean`.'
|
|
2246
|
+
},
|
|
2243
2247
|
{
|
|
2244
2248
|
status: 401,
|
|
2245
2249
|
description: "Admin account required"
|
|
@@ -2938,6 +2942,10 @@ var SASjsApi = (() => {
|
|
|
2938
2942
|
status: 200,
|
|
2939
2943
|
description: "Ok"
|
|
2940
2944
|
},
|
|
2945
|
+
{
|
|
2946
|
+
status: 400,
|
|
2947
|
+
description: 'A body the schema refuses, e.g. `"isAdmin" must be a boolean`.'
|
|
2948
|
+
},
|
|
2941
2949
|
{
|
|
2942
2950
|
status: 401,
|
|
2943
2951
|
description: "Admin account required"
|
|
@@ -2974,6 +2982,10 @@ var SASjsApi = (() => {
|
|
|
2974
2982
|
status: 200,
|
|
2975
2983
|
description: "Account Deleted!"
|
|
2976
2984
|
},
|
|
2985
|
+
{
|
|
2986
|
+
status: 400,
|
|
2987
|
+
description: 'A password shorter than six characters, or a key the deletion takes none of; e.g. `"password" is required`'
|
|
2988
|
+
},
|
|
2977
2989
|
{
|
|
2978
2990
|
status: 401,
|
|
2979
2991
|
description: "Admin account required, or invalid password"
|
|
@@ -3030,19 +3042,19 @@ var SASjsApi = (() => {
|
|
|
3030
3042
|
{
|
|
3031
3043
|
name: "displayName",
|
|
3032
3044
|
in: "body",
|
|
3033
|
-
required:
|
|
3045
|
+
required: false,
|
|
3034
3046
|
type: "string"
|
|
3035
3047
|
},
|
|
3036
3048
|
{
|
|
3037
3049
|
name: "username",
|
|
3038
3050
|
in: "body",
|
|
3039
|
-
required:
|
|
3051
|
+
required: false,
|
|
3040
3052
|
type: "string"
|
|
3041
3053
|
},
|
|
3042
3054
|
{
|
|
3043
3055
|
name: "password",
|
|
3044
3056
|
in: "body",
|
|
3045
|
-
required:
|
|
3057
|
+
required: false,
|
|
3046
3058
|
type: "string"
|
|
3047
3059
|
},
|
|
3048
3060
|
{
|
|
@@ -3070,6 +3082,10 @@ var SASjsApi = (() => {
|
|
|
3070
3082
|
status: 200,
|
|
3071
3083
|
description: "Ok"
|
|
3072
3084
|
},
|
|
3085
|
+
{
|
|
3086
|
+
status: 400,
|
|
3087
|
+
description: 'A body the schema refuses, e.g. `"isAdmin" must be a boolean`.'
|
|
3088
|
+
},
|
|
3073
3089
|
{
|
|
3074
3090
|
status: 401,
|
|
3075
3091
|
description: "Admin account required"
|
|
@@ -3114,6 +3130,10 @@ var SASjsApi = (() => {
|
|
|
3114
3130
|
status: 200,
|
|
3115
3131
|
description: "Account Deleted!"
|
|
3116
3132
|
},
|
|
3133
|
+
{
|
|
3134
|
+
status: 400,
|
|
3135
|
+
description: 'A username the schema refuses, a password shorter than six characters, or a key an administrator\'s deletion takes none of; e.g. `"password" is required`'
|
|
3136
|
+
},
|
|
3117
3137
|
{
|
|
3118
3138
|
status: 401,
|
|
3119
3139
|
description: "Admin account required, or invalid password"
|
|
@@ -3144,6 +3164,10 @@ var SASjsApi = (() => {
|
|
|
3144
3164
|
status: 200,
|
|
3145
3165
|
description: "Ok"
|
|
3146
3166
|
},
|
|
3167
|
+
{
|
|
3168
|
+
status: 400,
|
|
3169
|
+
description: 'A username the schema refuses, e.g. `"username" must only contain alpha-numeric characters`'
|
|
3170
|
+
},
|
|
3147
3171
|
{
|
|
3148
3172
|
status: 401,
|
|
3149
3173
|
description: "Unauthorized"
|
|
@@ -3170,19 +3194,19 @@ var SASjsApi = (() => {
|
|
|
3170
3194
|
{
|
|
3171
3195
|
name: "displayName",
|
|
3172
3196
|
in: "body",
|
|
3173
|
-
required:
|
|
3197
|
+
required: false,
|
|
3174
3198
|
type: "string"
|
|
3175
3199
|
},
|
|
3176
3200
|
{
|
|
3177
3201
|
name: "username",
|
|
3178
3202
|
in: "body",
|
|
3179
|
-
required:
|
|
3203
|
+
required: false,
|
|
3180
3204
|
type: "string"
|
|
3181
3205
|
},
|
|
3182
3206
|
{
|
|
3183
3207
|
name: "password",
|
|
3184
3208
|
in: "body",
|
|
3185
|
-
required:
|
|
3209
|
+
required: false,
|
|
3186
3210
|
type: "string"
|
|
3187
3211
|
},
|
|
3188
3212
|
{
|
|
@@ -3210,6 +3234,10 @@ var SASjsApi = (() => {
|
|
|
3210
3234
|
status: 200,
|
|
3211
3235
|
description: "Ok"
|
|
3212
3236
|
},
|
|
3237
|
+
{
|
|
3238
|
+
status: 400,
|
|
3239
|
+
description: 'A body the schema refuses, e.g. `"isAdmin" must be a boolean`.'
|
|
3240
|
+
},
|
|
3213
3241
|
{
|
|
3214
3242
|
status: 401,
|
|
3215
3243
|
description: "Admin account required"
|
|
@@ -6790,7 +6818,147 @@ var SASjsApi = (() => {
|
|
|
6790
6818
|
}
|
|
6791
6819
|
};
|
|
6792
6820
|
var APP_ENTRY_FILE = "index.html";
|
|
6793
|
-
var
|
|
6821
|
+
var refused = (message) => new ApiError(400, message);
|
|
6822
|
+
var stringField = (field, value, allowEmpty = false) => {
|
|
6823
|
+
if (typeof value !== "string") throw refused(`"${field}" must be a string`);
|
|
6824
|
+
if (value === "" && !allowEmpty)
|
|
6825
|
+
throw refused(`"${field}" is not allowed to be empty`);
|
|
6826
|
+
return value;
|
|
6827
|
+
};
|
|
6828
|
+
var requiredField = (field, value) => {
|
|
6829
|
+
if (value === void 0) throw refused(`"${field}" is required`);
|
|
6830
|
+
return stringField(field, value);
|
|
6831
|
+
};
|
|
6832
|
+
var alphanumeric = (field, value, min, max) => {
|
|
6833
|
+
if (!/^[A-Za-z0-9]+$/.test(value))
|
|
6834
|
+
throw refused(`"${field}" must only contain alpha-numeric characters`);
|
|
6835
|
+
if (value.length < min)
|
|
6836
|
+
throw refused(`"${field}" length must be at least ${min} characters long`);
|
|
6837
|
+
if (value.length > max)
|
|
6838
|
+
throw refused(
|
|
6839
|
+
`"${field}" length must be less than or equal to ${max} characters long`
|
|
6840
|
+
);
|
|
6841
|
+
return value;
|
|
6842
|
+
};
|
|
6843
|
+
var lengthBetween = (field, value, min, max) => {
|
|
6844
|
+
if (value.length < min)
|
|
6845
|
+
throw refused(`"${field}" length must be at least ${min} characters long`);
|
|
6846
|
+
if (value.length > max)
|
|
6847
|
+
throw refused(
|
|
6848
|
+
`"${field}" length must be less than or equal to ${max} characters long`
|
|
6849
|
+
);
|
|
6850
|
+
return value;
|
|
6851
|
+
};
|
|
6852
|
+
var trimmedName = (field, value) => {
|
|
6853
|
+
const name = value.trim();
|
|
6854
|
+
if (name === "") throw refused(`"${field}" is not allowed to be empty`);
|
|
6855
|
+
if (name.length < 6)
|
|
6856
|
+
throw refused(`"${field}" length must be at least 6 characters long`);
|
|
6857
|
+
return name;
|
|
6858
|
+
};
|
|
6859
|
+
var refuseUnknown = (body, keys) => {
|
|
6860
|
+
for (const key of Object.keys(body))
|
|
6861
|
+
if (!keys.includes(key)) throw refused(`"${key}" is not allowed`);
|
|
6862
|
+
};
|
|
6863
|
+
var ADMIN_GATED_ROUTES = /* @__PURE__ */ new Set([
|
|
6864
|
+
"POST /SASjsApi/permission",
|
|
6865
|
+
"PATCH /SASjsApi/permission/{uid}",
|
|
6866
|
+
"DELETE /SASjsApi/permission/{uid}",
|
|
6867
|
+
"GET /SASjsApi/client",
|
|
6868
|
+
"POST /SASjsApi/client"
|
|
6869
|
+
]);
|
|
6870
|
+
var foldedUsername = (value) => alphanumeric(
|
|
6871
|
+
"username",
|
|
6872
|
+
requiredField("username", value).toLowerCase(),
|
|
6873
|
+
3,
|
|
6874
|
+
16
|
|
6875
|
+
);
|
|
6876
|
+
var deletionBody = (body, admin) => {
|
|
6877
|
+
if (admin) {
|
|
6878
|
+
for (const key of Object.keys(body))
|
|
6879
|
+
throw refused(`"${key}" is not allowed`);
|
|
6880
|
+
return {};
|
|
6881
|
+
}
|
|
6882
|
+
const password = lengthBetween(
|
|
6883
|
+
"password",
|
|
6884
|
+
requiredField("password", body.password),
|
|
6885
|
+
6,
|
|
6886
|
+
1024
|
|
6887
|
+
);
|
|
6888
|
+
for (const key of Object.keys(body))
|
|
6889
|
+
if (key !== "password") throw refused(`"${key}" is not allowed`);
|
|
6890
|
+
return { password };
|
|
6891
|
+
};
|
|
6892
|
+
var USER_KEYS = [
|
|
6893
|
+
"displayName",
|
|
6894
|
+
"username",
|
|
6895
|
+
"password",
|
|
6896
|
+
"isAdmin",
|
|
6897
|
+
"isActive",
|
|
6898
|
+
"autoExec"
|
|
6899
|
+
];
|
|
6900
|
+
var userCreate = (body) => {
|
|
6901
|
+
const displayName = trimmedName(
|
|
6902
|
+
"displayName",
|
|
6903
|
+
requiredField("displayName", body.displayName)
|
|
6904
|
+
);
|
|
6905
|
+
const username = alphanumeric(
|
|
6906
|
+
"username",
|
|
6907
|
+
requiredField("username", body.username).toLowerCase(),
|
|
6908
|
+
3,
|
|
6909
|
+
16
|
|
6910
|
+
);
|
|
6911
|
+
const password = lengthBetween(
|
|
6912
|
+
"password",
|
|
6913
|
+
requiredField("password", body.password),
|
|
6914
|
+
6,
|
|
6915
|
+
1024
|
|
6916
|
+
);
|
|
6917
|
+
const isAdmin = booleanOf(body.isAdmin, "isAdmin");
|
|
6918
|
+
const isActive = booleanOf(body.isActive, "isActive");
|
|
6919
|
+
const autoExec = body.autoExec === void 0 ? void 0 : stringField("autoExec", body.autoExec, true);
|
|
6920
|
+
refuseUnknown(body, USER_KEYS);
|
|
6921
|
+
return { displayName, username, password, isAdmin, isActive, autoExec };
|
|
6922
|
+
};
|
|
6923
|
+
var GROUP_CREATE_KEYS = ["name", "description", "isActive"];
|
|
6924
|
+
var groupCreate = (body) => {
|
|
6925
|
+
const name = alphanumeric("name", requiredField("name", body.name), 3, 16);
|
|
6926
|
+
const description = body.description === void 0 ? void 0 : stringField("description", body.description);
|
|
6927
|
+
const isActive = booleanOf(body.isActive, "isActive");
|
|
6928
|
+
refuseUnknown(body, GROUP_CREATE_KEYS);
|
|
6929
|
+
return { name, description, isActive };
|
|
6930
|
+
};
|
|
6931
|
+
var userUpdate = (body, admin) => {
|
|
6932
|
+
const changes = { ...body };
|
|
6933
|
+
if (changes.displayName !== void 0)
|
|
6934
|
+
changes.displayName = trimmedName(
|
|
6935
|
+
"displayName",
|
|
6936
|
+
stringField("displayName", changes.displayName)
|
|
6937
|
+
);
|
|
6938
|
+
if (changes.username !== void 0)
|
|
6939
|
+
changes.username = alphanumeric(
|
|
6940
|
+
"username",
|
|
6941
|
+
stringField("username", changes.username).toLowerCase(),
|
|
6942
|
+
3,
|
|
6943
|
+
16
|
|
6944
|
+
);
|
|
6945
|
+
if (changes.password !== void 0)
|
|
6946
|
+
lengthBetween(
|
|
6947
|
+
"password",
|
|
6948
|
+
stringField("password", changes.password),
|
|
6949
|
+
6,
|
|
6950
|
+
1024
|
|
6951
|
+
);
|
|
6952
|
+
if (changes.autoExec !== void 0)
|
|
6953
|
+
stringField("autoExec", changes.autoExec, true);
|
|
6954
|
+
const declared = admin ? USER_KEYS : USER_KEYS.filter((key) => key !== "isAdmin" && key !== "isActive");
|
|
6955
|
+
for (const field of ["isAdmin", "isActive"])
|
|
6956
|
+
if (admin && field in changes)
|
|
6957
|
+
changes[field] = booleanOf(changes[field], field);
|
|
6958
|
+
refuseUnknown(changes, declared);
|
|
6959
|
+
return changes;
|
|
6960
|
+
};
|
|
6961
|
+
var booleanOf = (value, field) => {
|
|
6794
6962
|
if (value === void 0) return void 0;
|
|
6795
6963
|
if (typeof value === "boolean") return value;
|
|
6796
6964
|
if (typeof value === "string") {
|
|
@@ -6798,7 +6966,7 @@ var SASjsApi = (() => {
|
|
|
6798
6966
|
if (text2 === "true") return true;
|
|
6799
6967
|
if (text2 === "false") return false;
|
|
6800
6968
|
}
|
|
6801
|
-
throw new ApiError(400,
|
|
6969
|
+
throw new ApiError(400, `"${field}" must be a boolean`);
|
|
6802
6970
|
};
|
|
6803
6971
|
var APP_NOT_REGISTERED = "No App Stream is registered with that id.";
|
|
6804
6972
|
var appNotRegistered = () => new ApiError(404, APP_NOT_REGISTERED, {
|
|
@@ -6874,7 +7042,6 @@ var SASjsApi = (() => {
|
|
|
6874
7042
|
if (grantScoped && records && !publicGrant && !await records.mayUseRoute(callerSubject, grantScoped))
|
|
6875
7043
|
throw new ApiError(401, "Unauthorized");
|
|
6876
7044
|
}
|
|
6877
|
-
validate(route, request);
|
|
6878
7045
|
const query = request.query || {};
|
|
6879
7046
|
const body = request.body || {};
|
|
6880
7047
|
const params = request.params || {};
|
|
@@ -6906,6 +7073,20 @@ var SASjsApi = (() => {
|
|
|
6906
7073
|
status: 200,
|
|
6907
7074
|
contents: output.contents
|
|
6908
7075
|
});
|
|
7076
|
+
const callerRecord = async () => {
|
|
7077
|
+
const recordsService = required();
|
|
7078
|
+
const subject2 = await caller();
|
|
7079
|
+
return recordsService.getUser(subject2, {
|
|
7080
|
+
uid: String(subject2?.userId ?? "")
|
|
7081
|
+
});
|
|
7082
|
+
};
|
|
7083
|
+
const verifyAdminIfNeeded = async (target) => {
|
|
7084
|
+
const me = await callerRecord();
|
|
7085
|
+
if (me.isAdmin) return true;
|
|
7086
|
+
const ownAccount = target.uid !== void 0 && target.uid === me.uid || target.username !== void 0 && target.username === me.username;
|
|
7087
|
+
if (!ownAccount) throw new ApiError(401, "Admin account required");
|
|
7088
|
+
return false;
|
|
7089
|
+
};
|
|
6909
7090
|
const required = () => {
|
|
6910
7091
|
if (!records)
|
|
6911
7092
|
throw new ApiError(
|
|
@@ -6914,6 +7095,51 @@ var SASjsApi = (() => {
|
|
|
6914
7095
|
);
|
|
6915
7096
|
return records;
|
|
6916
7097
|
};
|
|
7098
|
+
const controllerRules = {
|
|
7099
|
+
"POST /SASjsApi/user": async (request2) => {
|
|
7100
|
+
if (!(await callerRecord()).isAdmin)
|
|
7101
|
+
throw new ApiError(401, "Admin account required");
|
|
7102
|
+
return { body: userCreate(request2.body || {}) };
|
|
7103
|
+
},
|
|
7104
|
+
"POST /SASjsApi/group": async (request2) => {
|
|
7105
|
+
if (!(await callerRecord()).isAdmin)
|
|
7106
|
+
throw new ApiError(401, "Admin account required");
|
|
7107
|
+
return { body: groupCreate(request2.body || {}) };
|
|
7108
|
+
},
|
|
7109
|
+
"PATCH /SASjsApi/user/{uid}": async (request2) => {
|
|
7110
|
+
const admin = await verifyAdminIfNeeded({
|
|
7111
|
+
uid: String(request2.params?.uid ?? "")
|
|
7112
|
+
});
|
|
7113
|
+
return { body: userUpdate(request2.body || {}, admin) };
|
|
7114
|
+
},
|
|
7115
|
+
"PATCH /SASjsApi/user/by/username/{username}": async (request2) => {
|
|
7116
|
+
const admin = await verifyAdminIfNeeded({
|
|
7117
|
+
username: String(request2.params?.username ?? "")
|
|
7118
|
+
});
|
|
7119
|
+
const username = foldedUsername(request2.params?.username);
|
|
7120
|
+
return { body: userUpdate(request2.body || {}, admin), username };
|
|
7121
|
+
},
|
|
7122
|
+
"DELETE /SASjsApi/user/by/username/{username}": async (request2) => {
|
|
7123
|
+
const admin = await verifyAdminIfNeeded({
|
|
7124
|
+
username: String(request2.params?.username ?? "")
|
|
7125
|
+
});
|
|
7126
|
+
const username = foldedUsername(request2.params?.username);
|
|
7127
|
+
return { body: deletionBody(request2.body || {}, admin), username };
|
|
7128
|
+
},
|
|
7129
|
+
"DELETE /SASjsApi/user/{uid}": async (request2) => {
|
|
7130
|
+
const admin = await verifyAdminIfNeeded({
|
|
7131
|
+
uid: String(request2.params?.uid ?? "")
|
|
7132
|
+
});
|
|
7133
|
+
return { body: deletionBody(request2.body || {}, admin) };
|
|
7134
|
+
}
|
|
7135
|
+
};
|
|
7136
|
+
const controllerRule = controllerRules[routeId];
|
|
7137
|
+
const controllerAnswer = controllerRule ? await controllerRule(request) : void 0;
|
|
7138
|
+
if (!controllerRule) {
|
|
7139
|
+
if (ADMIN_GATED_ROUTES.has(routeId) && !(await callerRecord()).isAdmin)
|
|
7140
|
+
throw new ApiError(401, "Admin account required");
|
|
7141
|
+
validate(route, request);
|
|
7142
|
+
}
|
|
6917
7143
|
if (routeId.startsWith("POST /SASjsApi/auth/") || routeId.startsWith("POST /SASLogon/") || routeId === "GET /SASLogon/logout" || routeId === "GET /SASjsApi/session") {
|
|
6918
7144
|
if (!identity)
|
|
6919
7145
|
throw new ApiError(
|
|
@@ -7344,20 +7570,16 @@ var SASjsApi = (() => {
|
|
|
7344
7570
|
return {
|
|
7345
7571
|
status: 200,
|
|
7346
7572
|
body: await required().getUser(await caller(), {
|
|
7347
|
-
username:
|
|
7573
|
+
username: foldedUsername(params.username)
|
|
7348
7574
|
})
|
|
7349
7575
|
};
|
|
7350
7576
|
case "POST /SASjsApi/user":
|
|
7351
7577
|
return {
|
|
7352
7578
|
status: 200,
|
|
7353
|
-
body: await required().createUser(
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
isAdmin: body.isAdmin,
|
|
7358
|
-
isActive: body.isActive,
|
|
7359
|
-
autoExec: body.autoExec
|
|
7360
|
-
})
|
|
7579
|
+
body: await required().createUser(
|
|
7580
|
+
await caller(),
|
|
7581
|
+
controllerAnswer.body
|
|
7582
|
+
)
|
|
7361
7583
|
};
|
|
7362
7584
|
case "PATCH /SASjsApi/user/{uid}":
|
|
7363
7585
|
return {
|
|
@@ -7365,7 +7587,9 @@ var SASjsApi = (() => {
|
|
|
7365
7587
|
body: await required().updateUser(
|
|
7366
7588
|
await caller(),
|
|
7367
7589
|
{ uid: String(params.uid ?? "") },
|
|
7368
|
-
body
|
|
7590
|
+
// the body the controller's own schema accepted, with what Joi converts
|
|
7591
|
+
// already converted
|
|
7592
|
+
controllerAnswer.body
|
|
7369
7593
|
)
|
|
7370
7594
|
};
|
|
7371
7595
|
case "PATCH /SASjsApi/user/by/username/{username}":
|
|
@@ -7373,8 +7597,8 @@ var SASjsApi = (() => {
|
|
|
7373
7597
|
status: 200,
|
|
7374
7598
|
body: await required().updateUser(
|
|
7375
7599
|
await caller(),
|
|
7376
|
-
{ username:
|
|
7377
|
-
body
|
|
7600
|
+
{ username: controllerAnswer.username ?? "" },
|
|
7601
|
+
controllerAnswer.body
|
|
7378
7602
|
)
|
|
7379
7603
|
};
|
|
7380
7604
|
case "DELETE /SASjsApi/user/{uid}":
|
|
@@ -7383,7 +7607,7 @@ var SASjsApi = (() => {
|
|
|
7383
7607
|
body: await required().deleteUser(
|
|
7384
7608
|
await caller(),
|
|
7385
7609
|
{ uid: String(params.uid ?? "") },
|
|
7386
|
-
{ password: body.password }
|
|
7610
|
+
{ password: controllerAnswer.body.password }
|
|
7387
7611
|
)
|
|
7388
7612
|
};
|
|
7389
7613
|
case "DELETE /SASjsApi/user/by/username/{username}":
|
|
@@ -7391,7 +7615,7 @@ var SASjsApi = (() => {
|
|
|
7391
7615
|
status: 200,
|
|
7392
7616
|
body: await required().deleteUser(
|
|
7393
7617
|
await caller(),
|
|
7394
|
-
{ username:
|
|
7618
|
+
{ username: controllerAnswer.username ?? "" },
|
|
7395
7619
|
{ password: body.password }
|
|
7396
7620
|
)
|
|
7397
7621
|
};
|
|
@@ -7421,7 +7645,7 @@ var SASjsApi = (() => {
|
|
|
7421
7645
|
filePath: body.filePath,
|
|
7422
7646
|
// the body is rebuilt field by field here, so a flag the service reads
|
|
7423
7647
|
// has to be named or the request's own answer is lost on the way
|
|
7424
|
-
layout:
|
|
7648
|
+
layout: booleanOf(body.layout, "layout")
|
|
7425
7649
|
})
|
|
7426
7650
|
};
|
|
7427
7651
|
case "GET /SASjsApi/info/authorizedRoutes":
|
|
@@ -7454,9 +7678,10 @@ var SASjsApi = (() => {
|
|
|
7454
7678
|
return {
|
|
7455
7679
|
status: 200,
|
|
7456
7680
|
body: await required().createGroup(await caller(), {
|
|
7457
|
-
name: String(body.name ?? ""),
|
|
7458
|
-
|
|
7459
|
-
|
|
7681
|
+
name: String(controllerAnswer.body.name ?? ""),
|
|
7682
|
+
// left absent rather than made empty: the service applies the model's default
|
|
7683
|
+
description: controllerAnswer.body.description,
|
|
7684
|
+
isActive: controllerAnswer.body.isActive
|
|
7460
7685
|
})
|
|
7461
7686
|
};
|
|
7462
7687
|
case "POST /SASjsApi/group/{groupUid}/{userUid}":
|
|
@@ -7838,7 +8063,7 @@ var SASjsApi = (() => {
|
|
|
7838
8063
|
throw new ApiError(409, "Username already exists.");
|
|
7839
8064
|
change.username = body.username;
|
|
7840
8065
|
}
|
|
7841
|
-
|
|
8066
|
+
change.displayName = displayName;
|
|
7842
8067
|
if (body.isAdmin !== void 0) change.isAdmin = body.isAdmin;
|
|
7843
8068
|
if (body.isActive !== void 0) change.isActive = body.isActive;
|
|
7844
8069
|
if (body.autoExec !== void 0) change.autoExec = body.autoExec;
|
|
@@ -7880,7 +8105,8 @@ var SASjsApi = (() => {
|
|
|
7880
8105
|
throw new ApiError(409, "Group name already exists.");
|
|
7881
8106
|
const created = await store.createGroup({
|
|
7882
8107
|
name: body.name,
|
|
7883
|
-
description
|
|
8108
|
+
// the model defaults the field, so an absent description is the model's
|
|
8109
|
+
description: body.description ?? "Group description.",
|
|
7884
8110
|
isActive: body.isActive !== false
|
|
7885
8111
|
});
|
|
7886
8112
|
return groupDetails(created);
|
|
@@ -11893,6 +12119,25 @@ var SASjsApi = (() => {
|
|
|
11893
12119
|
partial: { uid: RESTRICTED_UID, username: "sasjsuser", isAdmin: false }
|
|
11894
12120
|
}
|
|
11895
12121
|
},
|
|
12122
|
+
{
|
|
12123
|
+
id: "get-user-by-username-mixed-case",
|
|
12124
|
+
route: "GET /SASjsApi/user/by/username/{username}",
|
|
12125
|
+
description: "finds the account when the path names it in another case",
|
|
12126
|
+
identity: ADMIN_SIGNED_IN,
|
|
12127
|
+
request: { token: ADMIN5, params: { username: "SASJSUSER" } },
|
|
12128
|
+
expect: { status: 200, partial: { uid: RESTRICTED_UID } }
|
|
12129
|
+
},
|
|
12130
|
+
{
|
|
12131
|
+
id: "get-user-by-username-refused-name",
|
|
12132
|
+
route: "GET /SASjsApi/user/by/username/{username}",
|
|
12133
|
+
description: "refuses a path parameter the username schema does not allow",
|
|
12134
|
+
identity: ADMIN_SIGNED_IN,
|
|
12135
|
+
request: { token: ADMIN5, params: { username: "a-b" } },
|
|
12136
|
+
expect: {
|
|
12137
|
+
status: 400,
|
|
12138
|
+
error: '"username" must only contain alpha-numeric characters'
|
|
12139
|
+
}
|
|
12140
|
+
},
|
|
11896
12141
|
{
|
|
11897
12142
|
id: "get-user-by-username-unauthenticated",
|
|
11898
12143
|
route: "GET /SASjsApi/user/by/username/{username}",
|
|
@@ -11972,6 +12217,49 @@ var SASjsApi = (() => {
|
|
|
11972
12217
|
},
|
|
11973
12218
|
expect: { status: 409, error: "Username already exists." }
|
|
11974
12219
|
},
|
|
12220
|
+
{
|
|
12221
|
+
id: "create-user-bad-admin-flag",
|
|
12222
|
+
route: "POST /SASjsApi/user",
|
|
12223
|
+
description: "refuses an isAdmin the schema does not call a boolean",
|
|
12224
|
+
identity: ADMIN_SIGNED_IN,
|
|
12225
|
+
request: {
|
|
12226
|
+
token: ADMIN5,
|
|
12227
|
+
body: {
|
|
12228
|
+
username: "flaguser",
|
|
12229
|
+
displayName: "Flag User",
|
|
12230
|
+
password: "password",
|
|
12231
|
+
isAdmin: "yes"
|
|
12232
|
+
}
|
|
12233
|
+
},
|
|
12234
|
+
expect: { status: 400, error: '"isAdmin" must be a boolean' }
|
|
12235
|
+
},
|
|
12236
|
+
{
|
|
12237
|
+
id: "create-user-bad-active-flag",
|
|
12238
|
+
route: "POST /SASjsApi/user",
|
|
12239
|
+
description: "refuses an isActive the schema does not call a boolean",
|
|
12240
|
+
identity: ADMIN_SIGNED_IN,
|
|
12241
|
+
request: {
|
|
12242
|
+
token: ADMIN5,
|
|
12243
|
+
body: {
|
|
12244
|
+
username: "flaguser",
|
|
12245
|
+
displayName: "Flag User",
|
|
12246
|
+
password: "password",
|
|
12247
|
+
isActive: "sometimes"
|
|
12248
|
+
}
|
|
12249
|
+
},
|
|
12250
|
+
expect: { status: 400, error: '"isActive" must be a boolean' }
|
|
12251
|
+
},
|
|
12252
|
+
{
|
|
12253
|
+
id: "create-user-not-admin-incomplete",
|
|
12254
|
+
route: "POST /SASjsApi/user",
|
|
12255
|
+
description: "refuses a non-admin before it reads the body it sent",
|
|
12256
|
+
identity: ADMIN_SIGNED_IN,
|
|
12257
|
+
request: {
|
|
12258
|
+
token: RESTRICTED5,
|
|
12259
|
+
body: { username: "incomplete" }
|
|
12260
|
+
},
|
|
12261
|
+
expect: { status: 401, error: "Admin account required" }
|
|
12262
|
+
},
|
|
11975
12263
|
{
|
|
11976
12264
|
id: "update-user",
|
|
11977
12265
|
route: "PATCH /SASjsApi/user/{uid}",
|
|
@@ -11999,14 +12287,49 @@ var SASjsApi = (() => {
|
|
|
11999
12287
|
request: {
|
|
12000
12288
|
token: RESTRICTED5,
|
|
12001
12289
|
params: { uid: ADMIN_UID },
|
|
12002
|
-
body
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
password: "Orion123"
|
|
12006
|
-
}
|
|
12290
|
+
// the body is one the schema would refuse too, so the case only passes when
|
|
12291
|
+
// the caller is gated before the body is read, as the middleware order has it
|
|
12292
|
+
body: { isAdmin: "yes" }
|
|
12007
12293
|
},
|
|
12008
12294
|
expect: { status: 401, error: "Admin account required" }
|
|
12009
12295
|
},
|
|
12296
|
+
{
|
|
12297
|
+
id: "update-user-empty-body",
|
|
12298
|
+
route: "PATCH /SASjsApi/user/{uid}",
|
|
12299
|
+
description: "applies an update that omits every field, which the controller stores as an empty name",
|
|
12300
|
+
identity: ADMIN_SIGNED_IN,
|
|
12301
|
+
request: { token: ADMIN5, params: { uid: RESTRICTED_UID }, body: {} },
|
|
12302
|
+
// the controller always puts the sanitised display name into the update, so an
|
|
12303
|
+
// omitted one is written as the empty string rather than left as it was
|
|
12304
|
+
expect: {
|
|
12305
|
+
status: 200,
|
|
12306
|
+
partial: { uid: RESTRICTED_UID, displayName: "" }
|
|
12307
|
+
}
|
|
12308
|
+
},
|
|
12309
|
+
{
|
|
12310
|
+
id: "update-user-self-admin-flag",
|
|
12311
|
+
route: "PATCH /SASjsApi/user/{uid}",
|
|
12312
|
+
description: "refuses a flag only an administrator may send, on the caller's own account",
|
|
12313
|
+
identity: ADMIN_SIGNED_IN,
|
|
12314
|
+
request: {
|
|
12315
|
+
token: RESTRICTED5,
|
|
12316
|
+
params: { uid: RESTRICTED_UID },
|
|
12317
|
+
body: { isAdmin: true }
|
|
12318
|
+
},
|
|
12319
|
+
expect: { status: 400, error: '"isAdmin" is not allowed' }
|
|
12320
|
+
},
|
|
12321
|
+
{
|
|
12322
|
+
id: "update-user-by-username-self-admin-flag",
|
|
12323
|
+
route: "PATCH /SASjsApi/user/by/username/{username}",
|
|
12324
|
+
description: "refuses a flag only an administrator may send, by username",
|
|
12325
|
+
identity: ADMIN_SIGNED_IN,
|
|
12326
|
+
request: {
|
|
12327
|
+
token: RESTRICTED5,
|
|
12328
|
+
params: { username: "sasjsuser" },
|
|
12329
|
+
body: { isAdmin: true }
|
|
12330
|
+
},
|
|
12331
|
+
expect: { status: 400, error: '"isAdmin" is not allowed' }
|
|
12332
|
+
},
|
|
12010
12333
|
{
|
|
12011
12334
|
id: "update-user-missing",
|
|
12012
12335
|
route: "PATCH /SASjsApi/user/{uid}",
|
|
@@ -12079,14 +12402,57 @@ var SASjsApi = (() => {
|
|
|
12079
12402
|
request: {
|
|
12080
12403
|
token: RESTRICTED5,
|
|
12081
12404
|
params: { username: "sasjsadmin" },
|
|
12082
|
-
body
|
|
12083
|
-
|
|
12084
|
-
|
|
12085
|
-
password: "Orion123"
|
|
12086
|
-
}
|
|
12405
|
+
// a body the schema would refuse for this caller, so the case only passes
|
|
12406
|
+
// when the caller is gated before the body is read
|
|
12407
|
+
body: { isAdmin: "yes" }
|
|
12087
12408
|
},
|
|
12088
12409
|
expect: { status: 401, error: "Admin account required" }
|
|
12089
12410
|
},
|
|
12411
|
+
{
|
|
12412
|
+
id: "update-user-by-username-mixed-case",
|
|
12413
|
+
route: "PATCH /SASjsApi/user/by/username/{username}",
|
|
12414
|
+
description: "finds the account when the path names it in another case",
|
|
12415
|
+
identity: ADMIN_SIGNED_IN,
|
|
12416
|
+
request: {
|
|
12417
|
+
token: ADMIN5,
|
|
12418
|
+
params: { username: "SASJSUSER" },
|
|
12419
|
+
body: { displayName: "Renamed User" }
|
|
12420
|
+
},
|
|
12421
|
+
expect: {
|
|
12422
|
+
status: 200,
|
|
12423
|
+
partial: { uid: RESTRICTED_UID, displayName: "Renamed User" }
|
|
12424
|
+
}
|
|
12425
|
+
},
|
|
12426
|
+
{
|
|
12427
|
+
id: "update-user-by-username-parameter-before-body",
|
|
12428
|
+
route: "PATCH /SASjsApi/user/by/username/{username}",
|
|
12429
|
+
description: "refuses the path parameter before the body it is sent with",
|
|
12430
|
+
identity: ADMIN_SIGNED_IN,
|
|
12431
|
+
request: {
|
|
12432
|
+
token: ADMIN5,
|
|
12433
|
+
params: { username: "a-b" },
|
|
12434
|
+
body: { displayName: "x" }
|
|
12435
|
+
},
|
|
12436
|
+
expect: {
|
|
12437
|
+
status: 400,
|
|
12438
|
+
error: '"username" must only contain alpha-numeric characters'
|
|
12439
|
+
}
|
|
12440
|
+
},
|
|
12441
|
+
{
|
|
12442
|
+
id: "update-user-by-username-refused-name",
|
|
12443
|
+
route: "PATCH /SASjsApi/user/by/username/{username}",
|
|
12444
|
+
description: "refuses a path parameter the username schema does not allow",
|
|
12445
|
+
identity: ADMIN_SIGNED_IN,
|
|
12446
|
+
request: {
|
|
12447
|
+
token: ADMIN5,
|
|
12448
|
+
params: { username: "a-b" },
|
|
12449
|
+
body: { displayName: "Renamed User" }
|
|
12450
|
+
},
|
|
12451
|
+
expect: {
|
|
12452
|
+
status: 400,
|
|
12453
|
+
error: '"username" must only contain alpha-numeric characters'
|
|
12454
|
+
}
|
|
12455
|
+
},
|
|
12090
12456
|
{
|
|
12091
12457
|
id: "update-user-by-username-missing",
|
|
12092
12458
|
route: "PATCH /SASjsApi/user/by/username/{username}",
|
|
@@ -12146,6 +12512,18 @@ var SASjsApi = (() => {
|
|
|
12146
12512
|
request: { token: RESTRICTED5, params: { uid: ADMIN_UID }, body: {} },
|
|
12147
12513
|
expect: { status: 401, error: "Admin account required" }
|
|
12148
12514
|
},
|
|
12515
|
+
{
|
|
12516
|
+
id: "delete-user-not-admin-no-password",
|
|
12517
|
+
route: "DELETE /SASjsApi/user/{uid}",
|
|
12518
|
+
description: "requires the caller's own password when it is not an admin",
|
|
12519
|
+
identity: ADMIN_SIGNED_IN,
|
|
12520
|
+
request: {
|
|
12521
|
+
token: RESTRICTED5,
|
|
12522
|
+
params: { uid: RESTRICTED_UID },
|
|
12523
|
+
body: {}
|
|
12524
|
+
},
|
|
12525
|
+
expect: { status: 400, error: '"password" is required' }
|
|
12526
|
+
},
|
|
12149
12527
|
{
|
|
12150
12528
|
id: "delete-user-missing",
|
|
12151
12529
|
route: "DELETE /SASjsApi/user/{uid}",
|
|
@@ -12166,6 +12544,72 @@ var SASjsApi = (() => {
|
|
|
12166
12544
|
},
|
|
12167
12545
|
expect: { status: 200, body: "Account Deleted!" }
|
|
12168
12546
|
},
|
|
12547
|
+
{
|
|
12548
|
+
id: "delete-user-admin-bodys-refused",
|
|
12549
|
+
route: "DELETE /SASjsApi/user/by/username/{username}",
|
|
12550
|
+
description: "refuses a body an administrator's deletion takes none of",
|
|
12551
|
+
identity: ADMIN_SIGNED_IN,
|
|
12552
|
+
request: {
|
|
12553
|
+
token: ADMIN5,
|
|
12554
|
+
params: { username: "sasjsuser" },
|
|
12555
|
+
body: { password: "Orion123" }
|
|
12556
|
+
},
|
|
12557
|
+
expect: { status: 400, error: '"password" is not allowed' }
|
|
12558
|
+
},
|
|
12559
|
+
{
|
|
12560
|
+
id: "delete-user-by-username-extra-key",
|
|
12561
|
+
route: "DELETE /SASjsApi/user/by/username/{username}",
|
|
12562
|
+
description: "refuses a key outside the password a self-deletion carries",
|
|
12563
|
+
identity: ADMIN_SIGNED_IN,
|
|
12564
|
+
request: {
|
|
12565
|
+
token: RESTRICTED5,
|
|
12566
|
+
params: { username: "sasjsuser" },
|
|
12567
|
+
body: { password: "Orion123", extra: 1 }
|
|
12568
|
+
},
|
|
12569
|
+
expect: { status: 400, error: '"extra" is not allowed' }
|
|
12570
|
+
},
|
|
12571
|
+
{
|
|
12572
|
+
id: "delete-user-by-username-parameter-before-body",
|
|
12573
|
+
route: "DELETE /SASjsApi/user/by/username/{username}",
|
|
12574
|
+
description: "refuses the path parameter before the body it is sent with",
|
|
12575
|
+
identity: ADMIN_SIGNED_IN,
|
|
12576
|
+
request: {
|
|
12577
|
+
token: ADMIN5,
|
|
12578
|
+
params: { username: "a-b" },
|
|
12579
|
+
body: { password: "Orion123" }
|
|
12580
|
+
},
|
|
12581
|
+
expect: {
|
|
12582
|
+
status: 400,
|
|
12583
|
+
error: '"username" must only contain alpha-numeric characters'
|
|
12584
|
+
}
|
|
12585
|
+
},
|
|
12586
|
+
{
|
|
12587
|
+
id: "delete-user-by-username-short-password",
|
|
12588
|
+
route: "DELETE /SASjsApi/user/by/username/{username}",
|
|
12589
|
+
description: "refuses a password shorter than the schema allows, uncompared",
|
|
12590
|
+
identity: ADMIN_SIGNED_IN,
|
|
12591
|
+
request: {
|
|
12592
|
+
token: RESTRICTED5,
|
|
12593
|
+
params: { username: "sasjsuser" },
|
|
12594
|
+
body: { password: "abc" }
|
|
12595
|
+
},
|
|
12596
|
+
expect: {
|
|
12597
|
+
status: 400,
|
|
12598
|
+
error: '"password" length must be at least 6 characters long'
|
|
12599
|
+
}
|
|
12600
|
+
},
|
|
12601
|
+
{
|
|
12602
|
+
id: "delete-user-by-username-no-password",
|
|
12603
|
+
route: "DELETE /SASjsApi/user/by/username/{username}",
|
|
12604
|
+
description: "requires the caller's own password for a self-deletion",
|
|
12605
|
+
identity: ADMIN_SIGNED_IN,
|
|
12606
|
+
request: {
|
|
12607
|
+
token: RESTRICTED5,
|
|
12608
|
+
params: { username: "sasjsuser" },
|
|
12609
|
+
body: {}
|
|
12610
|
+
},
|
|
12611
|
+
expect: { status: 400, error: '"password" is required' }
|
|
12612
|
+
},
|
|
12169
12613
|
{
|
|
12170
12614
|
id: "delete-user-by-username-wrong-password",
|
|
12171
12615
|
route: "DELETE /SASjsApi/user/by/username/{username}",
|
|
@@ -12297,6 +12741,42 @@ var SASjsApi = (() => {
|
|
|
12297
12741
|
request: { token: ADMIN5, body: { name: "DCGroup", description: "again" } },
|
|
12298
12742
|
expect: { status: 409, error: "Group name already exists." }
|
|
12299
12743
|
},
|
|
12744
|
+
{
|
|
12745
|
+
id: "create-group-empty-description",
|
|
12746
|
+
route: "POST /SASjsApi/group",
|
|
12747
|
+
description: "refuses an empty description, which the schema does not allow",
|
|
12748
|
+
identity: ADMIN_SIGNED_IN,
|
|
12749
|
+
request: {
|
|
12750
|
+
token: ADMIN5,
|
|
12751
|
+
body: { name: "EmptyDescription", description: "" }
|
|
12752
|
+
},
|
|
12753
|
+
expect: {
|
|
12754
|
+
status: 400,
|
|
12755
|
+
error: '"description" is not allowed to be empty'
|
|
12756
|
+
}
|
|
12757
|
+
},
|
|
12758
|
+
{
|
|
12759
|
+
id: "create-group-no-description",
|
|
12760
|
+
route: "POST /SASjsApi/group",
|
|
12761
|
+
description: "creates a group whose description the caller left out",
|
|
12762
|
+
identity: ADMIN_SIGNED_IN,
|
|
12763
|
+
request: { token: ADMIN5, body: { name: "NoDescription" } },
|
|
12764
|
+
expect: {
|
|
12765
|
+
status: 200,
|
|
12766
|
+
partial: { name: "NoDescription", description: "Group description." }
|
|
12767
|
+
}
|
|
12768
|
+
},
|
|
12769
|
+
{
|
|
12770
|
+
id: "create-group-bad-active-flag",
|
|
12771
|
+
route: "POST /SASjsApi/group",
|
|
12772
|
+
description: "refuses an isActive the schema does not call a boolean",
|
|
12773
|
+
identity: ADMIN_SIGNED_IN,
|
|
12774
|
+
request: {
|
|
12775
|
+
token: ADMIN5,
|
|
12776
|
+
body: { name: "FlagGroup", description: "a group", isActive: "yes" }
|
|
12777
|
+
},
|
|
12778
|
+
expect: { status: 400, error: '"isActive" must be a boolean' }
|
|
12779
|
+
},
|
|
12300
12780
|
{
|
|
12301
12781
|
id: "add-user-to-group",
|
|
12302
12782
|
route: "POST /SASjsApi/group/{groupUid}/{userUid}",
|
|
@@ -12707,16 +13187,9 @@ var SASjsApi = (() => {
|
|
|
12707
13187
|
route: "POST /SASjsApi/permission",
|
|
12708
13188
|
description: "refuses a creation by a non-administrator",
|
|
12709
13189
|
identity: ADMIN_SIGNED_IN,
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
path: "/SASjsApi/drive/folder",
|
|
12714
|
-
type: "Route",
|
|
12715
|
-
setting: "Grant",
|
|
12716
|
-
principalType: "user",
|
|
12717
|
-
principalId: RESTRICTED_UID
|
|
12718
|
-
}
|
|
12719
|
-
},
|
|
13190
|
+
// an empty body, which the document requires five fields of, so the case only
|
|
13191
|
+
// passes when the caller is refused before the schema is consulted
|
|
13192
|
+
request: { token: RESTRICTED5, body: {} },
|
|
12720
13193
|
expect: { status: 401, error: "Admin account required" }
|
|
12721
13194
|
},
|
|
12722
13195
|
{
|
|
@@ -12793,11 +13266,8 @@ var SASjsApi = (() => {
|
|
|
12793
13266
|
route: "PATCH /SASjsApi/permission/{uid}",
|
|
12794
13267
|
description: "refuses a change by a non-administrator",
|
|
12795
13268
|
identity: ADMIN_SIGNED_IN,
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
params: { uid: "rule-code" },
|
|
12799
|
-
body: { setting: "Grant" }
|
|
12800
|
-
},
|
|
13269
|
+
// `setting` is required, so an empty body only reaches 401 when the gate runs first
|
|
13270
|
+
request: { token: RESTRICTED5, params: { uid: "rule-code" }, body: {} },
|
|
12801
13271
|
expect: { status: 401, error: "Admin account required" }
|
|
12802
13272
|
},
|
|
12803
13273
|
{
|
|
@@ -12917,15 +13387,9 @@ var SASjsApi = (() => {
|
|
|
12917
13387
|
route: "POST /SASjsApi/client",
|
|
12918
13388
|
description: "refuses a registration by a non-administrator",
|
|
12919
13389
|
identity: ADMIN_SIGNED_IN,
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
clientId: "new_app",
|
|
12924
|
-
clientSecret: "new_secret",
|
|
12925
|
-
accessTokenExpiration: 3600,
|
|
12926
|
-
refreshTokenExpiration: 86400
|
|
12927
|
-
}
|
|
12928
|
-
},
|
|
13390
|
+
// the document requires `clientId` here, so an empty body would be refused
|
|
13391
|
+
// first by a host that validated before it gated
|
|
13392
|
+
request: { token: RESTRICTED5, body: {} },
|
|
12929
13393
|
expect: { status: 401, error: "Admin account required" }
|
|
12930
13394
|
},
|
|
12931
13395
|
{
|