@kintone/dts-gen
Version:
Types for kintone js api and Types generating tools
37 lines • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.VisibleForTesting = exports.FormsClientImpl = void 0;
const axios_utils_1 = require("./axios-utils");
class FormsClientImpl {
constructor(input) {
this.client = axios_utils_1.AxiosUtils.newAxiosInstance(input);
}
fetchFormProperties(input) {
const config = {
method: "GET",
url: constructUrl(input),
params: {
app: input.appId,
},
};
return this.client.request(config).then((resp) => resp.data.properties);
}
}
exports.FormsClientImpl = FormsClientImpl;
const constructUrl = (input) => {
const guest = input.guestSpaceId;
if (guest !== null && input.preview) {
return `/k/guest/${guest}/v1/preview/app/form/fields.json`;
}
else if (input.guestSpaceId !== null) {
return `/k/guest/${guest}/v1/app/form/fields.json`;
}
else if (input.preview) {
return "/k/v1/preview/app/form/fields.json";
}
return "/k/v1/app/form/fields.json";
};
exports.VisibleForTesting = {
constructUrl,
};
//# sourceMappingURL=forms-client-impl.js.map