Skip to content

Commit 6b61cc6

Browse files
committed
Added api key endpoints to configuration API
1 parent e58aafa commit 6b61cc6

File tree

4 files changed

+75
-58
lines changed

4 files changed

+75
-58
lines changed

build/dist/es6/formkiq-client-sdk-es6.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/dist/es6/formkiq-client-sdk-es6.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/dist/web-cjs/formkiq-client-sdk-cjs.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7934,43 +7934,45 @@ class ConfigurationApi {
79347934
return await this.apiClient.fetchAndRespond(url, options);
79357935
}
79367936

7937-
}
7938-
7939-
/*
7940-
export class AddOrUpdateDocumentParameters {
7941-
7942-
documents = [];
7943-
7944-
constructor(content, contentType, path, tags, actions) {
7945-
if (content) {
7946-
this.content = content;
7947-
}
7948-
if (contentType) {
7949-
this.contentType = contentType;
7950-
}
7951-
if (path) {
7952-
this.path = path;
7953-
}
7954-
if (tags) {
7955-
this.tags = tags;
7956-
}
7957-
if (actions) {
7958-
this.actions = actions;
7937+
async getApiKeys(siteId = null) {
7938+
const params = {
7939+
};
7940+
if (siteId) {
7941+
params.siteId = siteId;
79597942
}
7943+
const url = `https://${this.apiClient.host}/configuration/apiKeys${this.apiClient.buildQueryString(params)}`;
7944+
const options = this.apiClient.buildOptions('GET');
7945+
return await this.apiClient.fetchAndRespond(url, options);
79607946
}
79617947

7962-
addChildDocument(content, contentType, path, tags, actions) {
7963-
const document = new AddOrUpdateDocumentParameters(content, contentType, path, tags, actions);
7964-
this.documents.push(document);
7948+
async addApiKey(addApiKeyParameters, siteId = null) {
7949+
const params = {
7950+
};
7951+
if (siteId) {
7952+
params.siteId = siteId;
7953+
}
7954+
const url = `https://${this.apiClient.host}/configuration/apiKeys${this.apiClient.buildQueryString(params)}`;
7955+
const options = this.apiClient.buildOptions('POST', addApiKeyParameters);
7956+
return await this.apiClient.fetchAndRespond(url, options);
79657957
}
79667958

7967-
addAttachment(path, tags) {
7968-
const document = new AddOrUpdateDocumentParameters(null, null, path, tags);
7969-
this.documents.push(document);
7959+
async deleteApiKey(apiKey, siteId = null) {
7960+
if (!apiKey) {
7961+
return JSON.stringify({
7962+
'message': 'No API Key specified'
7963+
});
7964+
}
7965+
const params = {
7966+
};
7967+
if (siteId) {
7968+
params.siteId = siteId;
7969+
}
7970+
const url = `https://${this.apiClient.host}/configuration/apiKeys/${apiKey}${this.apiClient.buildQueryString(params)}`;
7971+
const options = this.apiClient.buildOptions('DELETE');
7972+
return await this.apiClient.fetchAndRespond(url, options);
79707973
}
79717974

79727975
}
7973-
*/
79747976

79757977
class PresetsApi {
79767978

build/src/api/ConfigurationApi.js

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,55 @@ export class ConfigurationApi {
3939
return await this.apiClient.fetchAndRespond(url, options);
4040
}
4141

42-
}
43-
44-
/*
45-
export class AddOrUpdateDocumentParameters {
46-
47-
documents = [];
48-
49-
constructor(content, contentType, path, tags, actions) {
50-
if (content) {
51-
this.content = content;
52-
}
53-
if (contentType) {
54-
this.contentType = contentType;
42+
async getApiKeys(siteId = null) {
43+
const params = {
44+
};
45+
if (siteId) {
46+
params.siteId = siteId;
5547
}
56-
if (path) {
57-
this.path = path;
48+
const url = `https://${this.apiClient.host}/configuration/apiKeys${this.apiClient.buildQueryString(params)}`;
49+
const options = this.apiClient.buildOptions('GET');
50+
return await this.apiClient.fetchAndRespond(url, options);
51+
}
52+
53+
async addApiKey(addApiKeyParameters, siteId = null) {
54+
const params = {
55+
};
56+
if (siteId) {
57+
params.siteId = siteId;
5858
}
59-
if (tags) {
60-
this.tags = tags;
59+
const url = `https://${this.apiClient.host}/configuration/apiKeys${this.apiClient.buildQueryString(params)}`;
60+
const options = this.apiClient.buildOptions('POST', addApiKeyParameters);
61+
return await this.apiClient.fetchAndRespond(url, options);
62+
}
63+
64+
async deleteApiKey(apiKey, siteId = null) {
65+
if (!apiKey) {
66+
return JSON.stringify({
67+
'message': 'No API Key specified'
68+
});
6169
}
62-
if (actions) {
63-
this.actions = actions;
70+
const params = {
71+
};
72+
if (siteId) {
73+
params.siteId = siteId;
6474
}
75+
const url = `https://${this.apiClient.host}/configuration/apiKeys/${apiKey}${this.apiClient.buildQueryString(params)}`;
76+
const options = this.apiClient.buildOptions('DELETE');
77+
return await this.apiClient.fetchAndRespond(url, options);
6578
}
6679

67-
addChildDocument(content, contentType, path, tags, actions) {
68-
const document = new AddOrUpdateDocumentParameters(content, contentType, path, tags, actions);
69-
this.documents.push(document);
70-
}
80+
}
7181

72-
addAttachment(path, tags) {
73-
const document = new AddOrUpdateDocumentParameters(null, null, path, tags);
74-
this.documents.push(document);
82+
export class AddApiKeyParameters {
83+
84+
constructor(name, permissions) {
85+
if (name) {
86+
this.name = name;
87+
}
88+
if (permissions) {
89+
this.permissions = permissions;
90+
}
7591
}
7692

7793
}
78-
*/

0 commit comments

Comments
 (0)