@nycu-sdc/core-system-sdk 0.1.0
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/LICENSE +201 -0
- package/README.md +74 -0
- package/dist/index.d.ts +756 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +664 -0
- package/dist/model/authLoginGoogleParams.d.ts +17 -0
- package/dist/model/authLoginGoogleParams.d.ts.map +1 -0
- package/dist/model/authLoginGoogleParams.js +7 -0
- package/dist/model/authOAuthProviders.d.ts +11 -0
- package/dist/model/authOAuthProviders.d.ts.map +1 -0
- package/dist/model/authOAuthProviders.js +9 -0
- package/dist/model/authRefreshToken.d.ts +15 -0
- package/dist/model/authRefreshToken.d.ts.map +1 -0
- package/dist/model/authRefreshToken.js +7 -0
- package/dist/model/formsChoice.d.ts +17 -0
- package/dist/model/formsChoice.d.ts.map +1 -0
- package/dist/model/formsChoice.js +1 -0
- package/dist/model/formsChoiceOption.d.ts +14 -0
- package/dist/model/formsChoiceOption.d.ts.map +1 -0
- package/dist/model/formsChoiceOption.js +7 -0
- package/dist/model/formsForm.d.ts +34 -0
- package/dist/model/formsForm.d.ts.map +1 -0
- package/dist/model/formsForm.js +1 -0
- package/dist/model/formsFormRequest.d.ts +20 -0
- package/dist/model/formsFormRequest.d.ts.map +1 -0
- package/dist/model/formsFormRequest.js +7 -0
- package/dist/model/formsFormStatus.d.ts +15 -0
- package/dist/model/formsFormStatus.d.ts.map +1 -0
- package/dist/model/formsFormStatus.js +10 -0
- package/dist/model/formsQuestion.d.ts +35 -0
- package/dist/model/formsQuestion.d.ts.map +1 -0
- package/dist/model/formsQuestion.js +1 -0
- package/dist/model/formsQuestionRequest.d.ts +26 -0
- package/dist/model/formsQuestionRequest.d.ts.map +1 -0
- package/dist/model/formsQuestionRequest.js +1 -0
- package/dist/model/formsQuestionTypes.d.ts +18 -0
- package/dist/model/formsQuestionTypes.d.ts.map +1 -0
- package/dist/model/formsQuestionTypes.js +13 -0
- package/dist/model/formsRecipientSelectionRequest.d.ts +17 -0
- package/dist/model/formsRecipientSelectionRequest.d.ts.map +1 -0
- package/dist/model/formsRecipientSelectionRequest.js +1 -0
- package/dist/model/formsRecipientSelectionResponse.d.ts +14 -0
- package/dist/model/formsRecipientSelectionResponse.d.ts.map +1 -0
- package/dist/model/formsRecipientSelectionResponse.js +1 -0
- package/dist/model/formsRecipientUser.d.ts +15 -0
- package/dist/model/formsRecipientUser.d.ts.map +1 -0
- package/dist/model/formsRecipientUser.js +1 -0
- package/dist/model/inboxGetInboxMessages200.d.ts +16 -0
- package/dist/model/inboxGetInboxMessages200.d.ts.map +1 -0
- package/dist/model/inboxGetInboxMessages200.js +1 -0
- package/dist/model/inboxGetInboxMessagesParams.d.ts +17 -0
- package/dist/model/inboxGetInboxMessagesParams.d.ts.map +1 -0
- package/dist/model/inboxGetInboxMessagesParams.js +1 -0
- package/dist/model/inboxInboxFormMessage.d.ts +34 -0
- package/dist/model/inboxInboxFormMessage.d.ts.map +1 -0
- package/dist/model/inboxInboxFormMessage.js +1 -0
- package/dist/model/inboxInboxFormMessageType.d.ts +15 -0
- package/dist/model/inboxInboxFormMessageType.d.ts.map +1 -0
- package/dist/model/inboxInboxFormMessageType.js +10 -0
- package/dist/model/inboxUpdateInboxMessageFlagBody.d.ts +12 -0
- package/dist/model/inboxUpdateInboxMessageFlagBody.d.ts.map +1 -0
- package/dist/model/inboxUpdateInboxMessageFlagBody.js +7 -0
- package/dist/model/inboxUserInboxMessage.d.ts +24 -0
- package/dist/model/inboxUserInboxMessage.d.ts.map +1 -0
- package/dist/model/inboxUserInboxMessage.js +1 -0
- package/dist/model/inboxUserInboxMessageDetail.d.ts +27 -0
- package/dist/model/inboxUserInboxMessageDetail.d.ts.map +1 -0
- package/dist/model/inboxUserInboxMessageDetail.js +1 -0
- package/dist/model/inboxUserInboxMessageFilters.d.ts +18 -0
- package/dist/model/inboxUserInboxMessageFilters.d.ts.map +1 -0
- package/dist/model/inboxUserInboxMessageFilters.js +7 -0
- package/dist/model/index.d.ts +80 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +79 -0
- package/dist/model/notFound.d.ts +16 -0
- package/dist/model/notFound.d.ts.map +1 -0
- package/dist/model/notFound.js +1 -0
- package/dist/model/notFoundStatus.d.ts +11 -0
- package/dist/model/notFoundStatus.d.ts.map +1 -0
- package/dist/model/notFoundStatus.js +9 -0
- package/dist/model/notFoundTitle.d.ts +11 -0
- package/dist/model/notFoundTitle.d.ts.map +1 -0
- package/dist/model/notFoundTitle.js +9 -0
- package/dist/model/notFoundType.d.ts +11 -0
- package/dist/model/notFoundType.d.ts.map +1 -0
- package/dist/model/notFoundType.js +9 -0
- package/dist/model/problemDetail.d.ts +20 -0
- package/dist/model/problemDetail.d.ts.map +1 -0
- package/dist/model/problemDetail.js +7 -0
- package/dist/model/responsesAnswerForQuestionResponse.d.ts +25 -0
- package/dist/model/responsesAnswerForQuestionResponse.d.ts.map +1 -0
- package/dist/model/responsesAnswerForQuestionResponse.js +1 -0
- package/dist/model/responsesAnswerRequest.d.ts +17 -0
- package/dist/model/responsesAnswerRequest.d.ts.map +1 -0
- package/dist/model/responsesAnswerRequest.js +1 -0
- package/dist/model/responsesAnswersForQuestionResponse.d.ts +18 -0
- package/dist/model/responsesAnswersForQuestionResponse.d.ts.map +1 -0
- package/dist/model/responsesAnswersForQuestionResponse.js +1 -0
- package/dist/model/responsesGetResponse.d.ts +26 -0
- package/dist/model/responsesGetResponse.d.ts.map +1 -0
- package/dist/model/responsesGetResponse.js +1 -0
- package/dist/model/responsesListResponse.d.ts +18 -0
- package/dist/model/responsesListResponse.d.ts.map +1 -0
- package/dist/model/responsesListResponse.js +1 -0
- package/dist/model/responsesQuestionAnswerForGetResponse.d.ts +17 -0
- package/dist/model/responsesQuestionAnswerForGetResponse.d.ts.map +1 -0
- package/dist/model/responsesQuestionAnswerForGetResponse.js +1 -0
- package/dist/model/responsesResponseJSON.d.ts +21 -0
- package/dist/model/responsesResponseJSON.d.ts.map +1 -0
- package/dist/model/responsesResponseJSON.js +1 -0
- package/dist/model/responsesSubmitRequest.d.ts +15 -0
- package/dist/model/responsesSubmitRequest.d.ts.map +1 -0
- package/dist/model/responsesSubmitRequest.js +1 -0
- package/dist/model/responsesSubmitResponse.d.ts +21 -0
- package/dist/model/responsesSubmitResponse.d.ts.map +1 -0
- package/dist/model/responsesSubmitResponse.js +1 -0
- package/dist/model/slugGetSlugHistory200.d.ts +13 -0
- package/dist/model/slugGetSlugHistory200.d.ts.map +1 -0
- package/dist/model/slugGetSlugHistory200.js +1 -0
- package/dist/model/slugHistory.d.ts +21 -0
- package/dist/model/slugHistory.d.ts.map +1 -0
- package/dist/model/slugHistory.js +1 -0
- package/dist/model/slugStatus.d.ts +17 -0
- package/dist/model/slugStatus.d.ts.map +1 -0
- package/dist/model/slugStatus.js +1 -0
- package/dist/model/unauthorized.d.ts +16 -0
- package/dist/model/unauthorized.d.ts.map +1 -0
- package/dist/model/unauthorized.js +1 -0
- package/dist/model/unauthorizedStatus.d.ts +11 -0
- package/dist/model/unauthorizedStatus.d.ts.map +1 -0
- package/dist/model/unauthorizedStatus.js +9 -0
- package/dist/model/unauthorizedTitle.d.ts +11 -0
- package/dist/model/unauthorizedTitle.d.ts.map +1 -0
- package/dist/model/unauthorizedTitle.js +9 -0
- package/dist/model/unauthorizedType.d.ts +11 -0
- package/dist/model/unauthorizedType.d.ts.map +1 -0
- package/dist/model/unauthorizedType.js +9 -0
- package/dist/model/unitBase.d.ts +26 -0
- package/dist/model/unitBase.d.ts.map +1 -0
- package/dist/model/unitBase.js +1 -0
- package/dist/model/unitBaseMetadata.d.ts +13 -0
- package/dist/model/unitBaseMetadata.d.ts.map +1 -0
- package/dist/model/unitBaseMetadata.js +7 -0
- package/dist/model/unitBaseRequest.d.ts +19 -0
- package/dist/model/unitBaseRequest.d.ts.map +1 -0
- package/dist/model/unitBaseRequest.js +1 -0
- package/dist/model/unitBaseRequestMetadata.d.ts +13 -0
- package/dist/model/unitBaseRequestMetadata.d.ts.map +1 -0
- package/dist/model/unitBaseRequestMetadata.js +7 -0
- package/dist/model/unitCreateOrgRequest.d.ts +17 -0
- package/dist/model/unitCreateOrgRequest.d.ts.map +1 -0
- package/dist/model/unitCreateOrgRequest.js +1 -0
- package/dist/model/unitCreateOrgRequestMetadata.d.ts +13 -0
- package/dist/model/unitCreateOrgRequestMetadata.d.ts.map +1 -0
- package/dist/model/unitCreateOrgRequestMetadata.js +7 -0
- package/dist/model/unitCreateUnitRequest.d.ts +16 -0
- package/dist/model/unitCreateUnitRequest.d.ts.map +1 -0
- package/dist/model/unitCreateUnitRequest.js +1 -0
- package/dist/model/unitCreateUnitRequestMetadata.d.ts +13 -0
- package/dist/model/unitCreateUnitRequestMetadata.d.ts.map +1 -0
- package/dist/model/unitCreateUnitRequestMetadata.js +7 -0
- package/dist/model/unitListOrgSubUnitIdsParams.d.ts +14 -0
- package/dist/model/unitListOrgSubUnitIdsParams.d.ts.map +1 -0
- package/dist/model/unitListOrgSubUnitIdsParams.js +1 -0
- package/dist/model/unitListOrgSubUnitsParams.d.ts +14 -0
- package/dist/model/unitListOrgSubUnitsParams.d.ts.map +1 -0
- package/dist/model/unitListOrgSubUnitsParams.js +1 -0
- package/dist/model/unitListUnitSubUnitIdsParams.d.ts +14 -0
- package/dist/model/unitListUnitSubUnitIdsParams.d.ts.map +1 -0
- package/dist/model/unitListUnitSubUnitIdsParams.js +1 -0
- package/dist/model/unitListUnitSubUnitsParams.d.ts +14 -0
- package/dist/model/unitListUnitSubUnitsParams.d.ts.map +1 -0
- package/dist/model/unitListUnitSubUnitsParams.js +1 -0
- package/dist/model/unitOrgMember.d.ts +17 -0
- package/dist/model/unitOrgMember.d.ts.map +1 -0
- package/dist/model/unitOrgMember.js +1 -0
- package/dist/model/unitOrgMemberRequest.d.ts +10 -0
- package/dist/model/unitOrgMemberRequest.d.ts.map +1 -0
- package/dist/model/unitOrgMemberRequest.js +7 -0
- package/dist/model/unitOrganization.d.ts +25 -0
- package/dist/model/unitOrganization.d.ts.map +1 -0
- package/dist/model/unitOrganization.js +1 -0
- package/dist/model/unitOrganizationMetadata.d.ts +13 -0
- package/dist/model/unitOrganizationMetadata.d.ts.map +1 -0
- package/dist/model/unitOrganizationMetadata.js +7 -0
- package/dist/model/unitParentChild.d.ts +19 -0
- package/dist/model/unitParentChild.d.ts.map +1 -0
- package/dist/model/unitParentChild.js +1 -0
- package/dist/model/unitParentChildRequest.d.ts +13 -0
- package/dist/model/unitParentChildRequest.d.ts.map +1 -0
- package/dist/model/unitParentChildRequest.js +1 -0
- package/dist/model/unitUnit.d.ts +23 -0
- package/dist/model/unitUnit.d.ts.map +1 -0
- package/dist/model/unitUnit.js +1 -0
- package/dist/model/unitUnitMember.d.ts +17 -0
- package/dist/model/unitUnitMember.d.ts.map +1 -0
- package/dist/model/unitUnitMember.js +1 -0
- package/dist/model/unitUnitMemberRequest.d.ts +10 -0
- package/dist/model/unitUnitMemberRequest.d.ts.map +1 -0
- package/dist/model/unitUnitMemberRequest.js +7 -0
- package/dist/model/unitUnitMetadata.d.ts +13 -0
- package/dist/model/unitUnitMetadata.d.ts.map +1 -0
- package/dist/model/unitUnitMetadata.js +7 -0
- package/dist/model/unitUpdateOrgRequest.d.ts +17 -0
- package/dist/model/unitUpdateOrgRequest.d.ts.map +1 -0
- package/dist/model/unitUpdateOrgRequest.js +1 -0
- package/dist/model/unitUpdateOrgRequestMetadata.d.ts +13 -0
- package/dist/model/unitUpdateOrgRequestMetadata.d.ts.map +1 -0
- package/dist/model/unitUpdateOrgRequestMetadata.js +7 -0
- package/dist/model/unitUpdateUnitRequest.d.ts +16 -0
- package/dist/model/unitUpdateUnitRequest.d.ts.map +1 -0
- package/dist/model/unitUpdateUnitRequest.js +1 -0
- package/dist/model/unitUpdateUnitRequestMetadata.d.ts +13 -0
- package/dist/model/unitUpdateUnitRequestMetadata.d.ts.map +1 -0
- package/dist/model/unitUpdateUnitRequestMetadata.js +7 -0
- package/dist/model/userRole.d.ts +11 -0
- package/dist/model/userRole.d.ts.map +1 -0
- package/dist/model/userRole.js +9 -0
- package/dist/model/userUser.d.ts +21 -0
- package/dist/model/userUser.d.ts.map +1 -0
- package/dist/model/userUser.js +1 -0
- package/dist/model/uuid.d.ts +8 -0
- package/dist/model/uuid.d.ts.map +1 -0
- package/dist/model/uuid.js +7 -0
- package/dist/model/versions.d.ts +11 -0
- package/dist/model/versions.d.ts.map +1 -0
- package/dist/model/versions.js +9 -0
- package/package.json +17 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
export const getAuthLoginGoogleUrl = (provider, params) => {
|
|
2
|
+
const normalizedParams = new URLSearchParams();
|
|
3
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
4
|
+
if (value !== undefined) {
|
|
5
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
6
|
+
}
|
|
7
|
+
});
|
|
8
|
+
const stringifiedParams = normalizedParams.toString();
|
|
9
|
+
return stringifiedParams.length > 0 ? `/api/auth/login/oauth/${provider}?${stringifiedParams}` : `/api/auth/login/oauth/${provider}`;
|
|
10
|
+
};
|
|
11
|
+
export const authLoginGoogle = async (provider, params, options) => {
|
|
12
|
+
const res = await fetch(getAuthLoginGoogleUrl(provider, params), {
|
|
13
|
+
...options,
|
|
14
|
+
method: 'GET'
|
|
15
|
+
});
|
|
16
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
17
|
+
const data = body ? JSON.parse(body) : {};
|
|
18
|
+
return { data, status: res.status, headers: res.headers };
|
|
19
|
+
};
|
|
20
|
+
export const getAuthRefreshTokenUrl = (refreshToken) => {
|
|
21
|
+
return `/api/auth/refresh/${refreshToken}`;
|
|
22
|
+
};
|
|
23
|
+
export const authRefreshToken = async (refreshToken, options) => {
|
|
24
|
+
const res = await fetch(getAuthRefreshTokenUrl(refreshToken), {
|
|
25
|
+
...options,
|
|
26
|
+
method: 'POST'
|
|
27
|
+
});
|
|
28
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
29
|
+
const data = body ? JSON.parse(body) : {};
|
|
30
|
+
return { data, status: res.status, headers: res.headers };
|
|
31
|
+
};
|
|
32
|
+
;
|
|
33
|
+
export const getFormsListFormsUrl = () => {
|
|
34
|
+
return `/api/forms`;
|
|
35
|
+
};
|
|
36
|
+
export const formsListForms = async (options) => {
|
|
37
|
+
const res = await fetch(getFormsListFormsUrl(), {
|
|
38
|
+
...options,
|
|
39
|
+
method: 'GET'
|
|
40
|
+
});
|
|
41
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
42
|
+
const data = body ? JSON.parse(body) : {};
|
|
43
|
+
return { data, status: res.status, headers: res.headers };
|
|
44
|
+
};
|
|
45
|
+
;
|
|
46
|
+
export const getFormsPreviewRecipientsUrl = () => {
|
|
47
|
+
return `/api/forms/recipients/preview`;
|
|
48
|
+
};
|
|
49
|
+
export const formsPreviewRecipients = async (formsRecipientSelectionRequest, options) => {
|
|
50
|
+
const res = await fetch(getFormsPreviewRecipientsUrl(), {
|
|
51
|
+
...options,
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
54
|
+
body: JSON.stringify(formsRecipientSelectionRequest)
|
|
55
|
+
});
|
|
56
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
57
|
+
const data = body ? JSON.parse(body) : {};
|
|
58
|
+
return { data, status: res.status, headers: res.headers };
|
|
59
|
+
};
|
|
60
|
+
;
|
|
61
|
+
export const getFormsCreateQuestionUrl = (formId) => {
|
|
62
|
+
return `/api/forms/${formId}/questions`;
|
|
63
|
+
};
|
|
64
|
+
export const formsCreateQuestion = async (formId, formsQuestionRequest, options) => {
|
|
65
|
+
const res = await fetch(getFormsCreateQuestionUrl(formId), {
|
|
66
|
+
...options,
|
|
67
|
+
method: 'POST',
|
|
68
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
69
|
+
body: JSON.stringify(formsQuestionRequest)
|
|
70
|
+
});
|
|
71
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
72
|
+
const data = body ? JSON.parse(body) : {};
|
|
73
|
+
return { data, status: res.status, headers: res.headers };
|
|
74
|
+
};
|
|
75
|
+
;
|
|
76
|
+
export const getFormsListQuestionsUrl = (formId) => {
|
|
77
|
+
return `/api/forms/${formId}/questions`;
|
|
78
|
+
};
|
|
79
|
+
export const formsListQuestions = async (formId, options) => {
|
|
80
|
+
const res = await fetch(getFormsListQuestionsUrl(formId), {
|
|
81
|
+
...options,
|
|
82
|
+
method: 'GET'
|
|
83
|
+
});
|
|
84
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
85
|
+
const data = body ? JSON.parse(body) : {};
|
|
86
|
+
return { data, status: res.status, headers: res.headers };
|
|
87
|
+
};
|
|
88
|
+
;
|
|
89
|
+
export const getFormsUpdateQuestionUrl = (formId, questionId) => {
|
|
90
|
+
return `/api/forms/${formId}/questions/${questionId}`;
|
|
91
|
+
};
|
|
92
|
+
export const formsUpdateQuestion = async (formId, questionId, formsQuestionRequest, options) => {
|
|
93
|
+
const res = await fetch(getFormsUpdateQuestionUrl(formId, questionId), {
|
|
94
|
+
...options,
|
|
95
|
+
method: 'PUT',
|
|
96
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
97
|
+
body: JSON.stringify(formsQuestionRequest)
|
|
98
|
+
});
|
|
99
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
100
|
+
const data = body ? JSON.parse(body) : {};
|
|
101
|
+
return { data, status: res.status, headers: res.headers };
|
|
102
|
+
};
|
|
103
|
+
;
|
|
104
|
+
export const getFormsDeleteQuestionUrl = (formId, questionId) => {
|
|
105
|
+
return `/api/forms/${formId}/questions/${questionId}`;
|
|
106
|
+
};
|
|
107
|
+
export const formsDeleteQuestion = async (formId, questionId, options) => {
|
|
108
|
+
const res = await fetch(getFormsDeleteQuestionUrl(formId, questionId), {
|
|
109
|
+
...options,
|
|
110
|
+
method: 'DELETE'
|
|
111
|
+
});
|
|
112
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
113
|
+
const data = body ? JSON.parse(body) : {};
|
|
114
|
+
return { data, status: res.status, headers: res.headers };
|
|
115
|
+
};
|
|
116
|
+
export const getResponsesGetQuestionAnswersUrl = (formId, questionId) => {
|
|
117
|
+
return `/api/forms/${formId}/questions/${questionId}`;
|
|
118
|
+
};
|
|
119
|
+
export const responsesGetQuestionAnswers = async (formId, questionId, options) => {
|
|
120
|
+
const res = await fetch(getResponsesGetQuestionAnswersUrl(formId, questionId), {
|
|
121
|
+
...options,
|
|
122
|
+
method: 'GET'
|
|
123
|
+
});
|
|
124
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
125
|
+
const data = body ? JSON.parse(body) : {};
|
|
126
|
+
return { data, status: res.status, headers: res.headers };
|
|
127
|
+
};
|
|
128
|
+
export const getResponsesSubmitFormResponseUrl = (formId) => {
|
|
129
|
+
return `/api/forms/${formId}/responses`;
|
|
130
|
+
};
|
|
131
|
+
export const responsesSubmitFormResponse = async (formId, responsesSubmitRequest, options) => {
|
|
132
|
+
const res = await fetch(getResponsesSubmitFormResponseUrl(formId), {
|
|
133
|
+
...options,
|
|
134
|
+
method: 'POST',
|
|
135
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
136
|
+
body: JSON.stringify(responsesSubmitRequest)
|
|
137
|
+
});
|
|
138
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
139
|
+
const data = body ? JSON.parse(body) : {};
|
|
140
|
+
return { data, status: res.status, headers: res.headers };
|
|
141
|
+
};
|
|
142
|
+
export const getResponsesListFormResponsesUrl = (formId) => {
|
|
143
|
+
return `/api/forms/${formId}/responses`;
|
|
144
|
+
};
|
|
145
|
+
export const responsesListFormResponses = async (formId, options) => {
|
|
146
|
+
const res = await fetch(getResponsesListFormResponsesUrl(formId), {
|
|
147
|
+
...options,
|
|
148
|
+
method: 'GET'
|
|
149
|
+
});
|
|
150
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
151
|
+
const data = body ? JSON.parse(body) : {};
|
|
152
|
+
return { data, status: res.status, headers: res.headers };
|
|
153
|
+
};
|
|
154
|
+
export const getResponsesGetFormResponseUrl = (formId, responseId) => {
|
|
155
|
+
return `/api/forms/${formId}/responses/${responseId}`;
|
|
156
|
+
};
|
|
157
|
+
export const responsesGetFormResponse = async (formId, responseId, options) => {
|
|
158
|
+
const res = await fetch(getResponsesGetFormResponseUrl(formId, responseId), {
|
|
159
|
+
...options,
|
|
160
|
+
method: 'GET'
|
|
161
|
+
});
|
|
162
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
163
|
+
const data = body ? JSON.parse(body) : {};
|
|
164
|
+
return { data, status: res.status, headers: res.headers };
|
|
165
|
+
};
|
|
166
|
+
export const getResponsesDeleteFormResponseUrl = (formId, responseId) => {
|
|
167
|
+
return `/api/forms/${formId}/responses/${responseId}`;
|
|
168
|
+
};
|
|
169
|
+
export const responsesDeleteFormResponse = async (formId, responseId, options) => {
|
|
170
|
+
const res = await fetch(getResponsesDeleteFormResponseUrl(formId, responseId), {
|
|
171
|
+
...options,
|
|
172
|
+
method: 'DELETE'
|
|
173
|
+
});
|
|
174
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
175
|
+
const data = body ? JSON.parse(body) : {};
|
|
176
|
+
return { data, status: res.status, headers: res.headers };
|
|
177
|
+
};
|
|
178
|
+
;
|
|
179
|
+
export const getFormsUpdateFormUrl = (id) => {
|
|
180
|
+
return `/api/forms/${id}`;
|
|
181
|
+
};
|
|
182
|
+
export const formsUpdateForm = async (id, formsFormRequest, options) => {
|
|
183
|
+
const res = await fetch(getFormsUpdateFormUrl(id), {
|
|
184
|
+
...options,
|
|
185
|
+
method: 'PUT',
|
|
186
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
187
|
+
body: JSON.stringify(formsFormRequest)
|
|
188
|
+
});
|
|
189
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
190
|
+
const data = body ? JSON.parse(body) : {};
|
|
191
|
+
return { data, status: res.status, headers: res.headers };
|
|
192
|
+
};
|
|
193
|
+
;
|
|
194
|
+
export const getFormsDeleteFormUrl = (id) => {
|
|
195
|
+
return `/api/forms/${id}`;
|
|
196
|
+
};
|
|
197
|
+
export const formsDeleteForm = async (id, options) => {
|
|
198
|
+
const res = await fetch(getFormsDeleteFormUrl(id), {
|
|
199
|
+
...options,
|
|
200
|
+
method: 'DELETE'
|
|
201
|
+
});
|
|
202
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
203
|
+
const data = body ? JSON.parse(body) : {};
|
|
204
|
+
return { data, status: res.status, headers: res.headers };
|
|
205
|
+
};
|
|
206
|
+
;
|
|
207
|
+
export const getFormsGetFormByIdUrl = (id) => {
|
|
208
|
+
return `/api/forms/${id}`;
|
|
209
|
+
};
|
|
210
|
+
export const formsGetFormById = async (id, options) => {
|
|
211
|
+
const res = await fetch(getFormsGetFormByIdUrl(id), {
|
|
212
|
+
...options,
|
|
213
|
+
method: 'GET'
|
|
214
|
+
});
|
|
215
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
216
|
+
const data = body ? JSON.parse(body) : {};
|
|
217
|
+
return { data, status: res.status, headers: res.headers };
|
|
218
|
+
};
|
|
219
|
+
;
|
|
220
|
+
export const getFormsPublishFormUrl = (id) => {
|
|
221
|
+
return `/api/forms/${id}/publish`;
|
|
222
|
+
};
|
|
223
|
+
export const formsPublishForm = async (id, formsRecipientSelectionRequest, options) => {
|
|
224
|
+
const res = await fetch(getFormsPublishFormUrl(id), {
|
|
225
|
+
...options,
|
|
226
|
+
method: 'POST',
|
|
227
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
228
|
+
body: JSON.stringify(formsRecipientSelectionRequest)
|
|
229
|
+
});
|
|
230
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
231
|
+
const data = body ? JSON.parse(body) : {};
|
|
232
|
+
return { data, status: res.status, headers: res.headers };
|
|
233
|
+
};
|
|
234
|
+
export const getHealthzCheckHealthzUrl = () => {
|
|
235
|
+
return `/api/healthz`;
|
|
236
|
+
};
|
|
237
|
+
export const healthzCheckHealthz = async (options) => {
|
|
238
|
+
const res = await fetch(getHealthzCheckHealthzUrl(), {
|
|
239
|
+
...options,
|
|
240
|
+
method: 'GET'
|
|
241
|
+
});
|
|
242
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
243
|
+
const data = body ? JSON.parse(body) : {};
|
|
244
|
+
return { data, status: res.status, headers: res.headers };
|
|
245
|
+
};
|
|
246
|
+
export const getInboxGetInboxMessagesUrl = (params) => {
|
|
247
|
+
const normalizedParams = new URLSearchParams();
|
|
248
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
249
|
+
if (value !== undefined) {
|
|
250
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
const stringifiedParams = normalizedParams.toString();
|
|
254
|
+
return stringifiedParams.length > 0 ? `/api/inbox?${stringifiedParams}` : `/api/inbox`;
|
|
255
|
+
};
|
|
256
|
+
export const inboxGetInboxMessages = async (params, options) => {
|
|
257
|
+
const res = await fetch(getInboxGetInboxMessagesUrl(params), {
|
|
258
|
+
...options,
|
|
259
|
+
method: 'GET'
|
|
260
|
+
});
|
|
261
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
262
|
+
const data = body ? JSON.parse(body) : {};
|
|
263
|
+
return { data, status: res.status, headers: res.headers };
|
|
264
|
+
};
|
|
265
|
+
export const getInboxGetInboxMessageUrl = (id) => {
|
|
266
|
+
return `/api/inbox/${id}`;
|
|
267
|
+
};
|
|
268
|
+
export const inboxGetInboxMessage = async (id, options) => {
|
|
269
|
+
const res = await fetch(getInboxGetInboxMessageUrl(id), {
|
|
270
|
+
...options,
|
|
271
|
+
method: 'GET'
|
|
272
|
+
});
|
|
273
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
274
|
+
const data = body ? JSON.parse(body) : {};
|
|
275
|
+
return { data, status: res.status, headers: res.headers };
|
|
276
|
+
};
|
|
277
|
+
export const getInboxUpdateInboxMessageFlagUrl = (id) => {
|
|
278
|
+
return `/api/inbox/${id}`;
|
|
279
|
+
};
|
|
280
|
+
export const inboxUpdateInboxMessageFlag = async (id, inboxUpdateInboxMessageFlagBody, options) => {
|
|
281
|
+
const res = await fetch(getInboxUpdateInboxMessageFlagUrl(id), {
|
|
282
|
+
...options,
|
|
283
|
+
method: 'PUT',
|
|
284
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
285
|
+
body: JSON.stringify(inboxUpdateInboxMessageFlagBody)
|
|
286
|
+
});
|
|
287
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
288
|
+
const data = body ? JSON.parse(body) : {};
|
|
289
|
+
return { data, status: res.status, headers: res.headers };
|
|
290
|
+
};
|
|
291
|
+
;
|
|
292
|
+
export const getUnitGetAllOrganizationsUrl = () => {
|
|
293
|
+
return `/api/orgs`;
|
|
294
|
+
};
|
|
295
|
+
export const unitGetAllOrganizations = async (options) => {
|
|
296
|
+
const res = await fetch(getUnitGetAllOrganizationsUrl(), {
|
|
297
|
+
...options,
|
|
298
|
+
method: 'GET'
|
|
299
|
+
});
|
|
300
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
301
|
+
const data = body ? JSON.parse(body) : {};
|
|
302
|
+
return { data, status: res.status, headers: res.headers };
|
|
303
|
+
};
|
|
304
|
+
;
|
|
305
|
+
export const getUnitCreateOrgUrl = () => {
|
|
306
|
+
return `/api/orgs`;
|
|
307
|
+
};
|
|
308
|
+
export const unitCreateOrg = async (unitCreateOrgRequest, options) => {
|
|
309
|
+
const res = await fetch(getUnitCreateOrgUrl(), {
|
|
310
|
+
...options,
|
|
311
|
+
method: 'POST',
|
|
312
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
313
|
+
body: JSON.stringify(unitCreateOrgRequest)
|
|
314
|
+
});
|
|
315
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
316
|
+
const data = body ? JSON.parse(body) : {};
|
|
317
|
+
return { data, status: res.status, headers: res.headers };
|
|
318
|
+
};
|
|
319
|
+
;
|
|
320
|
+
export const getUnitAddParentChildUrl = () => {
|
|
321
|
+
return `/api/orgs/relations`;
|
|
322
|
+
};
|
|
323
|
+
export const unitAddParentChild = async (unitParentChildRequest, options) => {
|
|
324
|
+
const res = await fetch(getUnitAddParentChildUrl(), {
|
|
325
|
+
...options,
|
|
326
|
+
method: 'POST',
|
|
327
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
328
|
+
body: JSON.stringify(unitParentChildRequest)
|
|
329
|
+
});
|
|
330
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
331
|
+
const data = body ? JSON.parse(body) : {};
|
|
332
|
+
return { data, status: res.status, headers: res.headers };
|
|
333
|
+
};
|
|
334
|
+
export const getUnitRemoveParentChildUrl = (childId) => {
|
|
335
|
+
return `/api/orgs/relations/child-id/${childId}`;
|
|
336
|
+
};
|
|
337
|
+
export const unitRemoveParentChild = async (childId, options) => {
|
|
338
|
+
const res = await fetch(getUnitRemoveParentChildUrl(childId), {
|
|
339
|
+
...options,
|
|
340
|
+
method: 'DELETE'
|
|
341
|
+
});
|
|
342
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
343
|
+
const data = body ? JSON.parse(body) : {};
|
|
344
|
+
return { data, status: res.status, headers: res.headers };
|
|
345
|
+
};
|
|
346
|
+
;
|
|
347
|
+
export const getUnitGetOrgByIdUrl = (slug) => {
|
|
348
|
+
return `/api/orgs/${slug}`;
|
|
349
|
+
};
|
|
350
|
+
export const unitGetOrgById = async (slug, options) => {
|
|
351
|
+
const res = await fetch(getUnitGetOrgByIdUrl(slug), {
|
|
352
|
+
...options,
|
|
353
|
+
method: 'GET'
|
|
354
|
+
});
|
|
355
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
356
|
+
const data = body ? JSON.parse(body) : {};
|
|
357
|
+
return { data, status: res.status, headers: res.headers };
|
|
358
|
+
};
|
|
359
|
+
;
|
|
360
|
+
export const getUnitUpdateOrgUrl = (slug) => {
|
|
361
|
+
return `/api/orgs/${slug}`;
|
|
362
|
+
};
|
|
363
|
+
export const unitUpdateOrg = async (slug, unitUpdateOrgRequest, options) => {
|
|
364
|
+
const res = await fetch(getUnitUpdateOrgUrl(slug), {
|
|
365
|
+
...options,
|
|
366
|
+
method: 'PUT',
|
|
367
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
368
|
+
body: JSON.stringify(unitUpdateOrgRequest)
|
|
369
|
+
});
|
|
370
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
371
|
+
const data = body ? JSON.parse(body) : {};
|
|
372
|
+
return { data, status: res.status, headers: res.headers };
|
|
373
|
+
};
|
|
374
|
+
export const getUnitDeleteOrgUrl = (slug) => {
|
|
375
|
+
return `/api/orgs/${slug}`;
|
|
376
|
+
};
|
|
377
|
+
export const unitDeleteOrg = async (slug, options) => {
|
|
378
|
+
const res = await fetch(getUnitDeleteOrgUrl(slug), {
|
|
379
|
+
...options,
|
|
380
|
+
method: 'DELETE'
|
|
381
|
+
});
|
|
382
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
383
|
+
const data = body ? JSON.parse(body) : {};
|
|
384
|
+
return { data, status: res.status, headers: res.headers };
|
|
385
|
+
};
|
|
386
|
+
export const getSlugGetSlugHistoryUrl = (slug) => {
|
|
387
|
+
return `/api/orgs/${slug}/history`;
|
|
388
|
+
};
|
|
389
|
+
export const slugGetSlugHistory = async (slug, options) => {
|
|
390
|
+
const res = await fetch(getSlugGetSlugHistoryUrl(slug), {
|
|
391
|
+
...options,
|
|
392
|
+
method: 'GET'
|
|
393
|
+
});
|
|
394
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
395
|
+
const data = body ? JSON.parse(body) : {};
|
|
396
|
+
return { data, status: res.status, headers: res.headers };
|
|
397
|
+
};
|
|
398
|
+
;
|
|
399
|
+
export const getUnitAddOrgMemberUrl = (slug) => {
|
|
400
|
+
return `/api/orgs/${slug}/members`;
|
|
401
|
+
};
|
|
402
|
+
export const unitAddOrgMember = async (slug, unitOrgMemberRequest, options) => {
|
|
403
|
+
const res = await fetch(getUnitAddOrgMemberUrl(slug), {
|
|
404
|
+
...options,
|
|
405
|
+
method: 'POST',
|
|
406
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
407
|
+
body: JSON.stringify(unitOrgMemberRequest)
|
|
408
|
+
});
|
|
409
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
410
|
+
const data = body ? JSON.parse(body) : {};
|
|
411
|
+
return { data, status: res.status, headers: res.headers };
|
|
412
|
+
};
|
|
413
|
+
;
|
|
414
|
+
export const getUnitListOrgMembersUrl = (slug) => {
|
|
415
|
+
return `/api/orgs/${slug}/members`;
|
|
416
|
+
};
|
|
417
|
+
export const unitListOrgMembers = async (slug, options) => {
|
|
418
|
+
const res = await fetch(getUnitListOrgMembersUrl(slug), {
|
|
419
|
+
...options,
|
|
420
|
+
method: 'GET'
|
|
421
|
+
});
|
|
422
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
423
|
+
const data = body ? JSON.parse(body) : {};
|
|
424
|
+
return { data, status: res.status, headers: res.headers };
|
|
425
|
+
};
|
|
426
|
+
export const getUnitRemoveOrgMemberUrl = (slug, memberId) => {
|
|
427
|
+
return `/api/orgs/${slug}/members/${memberId}`;
|
|
428
|
+
};
|
|
429
|
+
export const unitRemoveOrgMember = async (slug, memberId, options) => {
|
|
430
|
+
const res = await fetch(getUnitRemoveOrgMemberUrl(slug, memberId), {
|
|
431
|
+
...options,
|
|
432
|
+
method: 'DELETE'
|
|
433
|
+
});
|
|
434
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
435
|
+
const data = body ? JSON.parse(body) : {};
|
|
436
|
+
return { data, status: res.status, headers: res.headers };
|
|
437
|
+
};
|
|
438
|
+
export const getSlugGetSlugStatusUrl = (slug) => {
|
|
439
|
+
return `/api/orgs/${slug}/status`;
|
|
440
|
+
};
|
|
441
|
+
export const slugGetSlugStatus = async (slug, options) => {
|
|
442
|
+
const res = await fetch(getSlugGetSlugStatusUrl(slug), {
|
|
443
|
+
...options,
|
|
444
|
+
method: 'GET'
|
|
445
|
+
});
|
|
446
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
447
|
+
const data = body ? JSON.parse(body) : {};
|
|
448
|
+
return { data, status: res.status, headers: res.headers };
|
|
449
|
+
};
|
|
450
|
+
;
|
|
451
|
+
export const getUnitListOrgSubUnitIdsUrl = (slug, params) => {
|
|
452
|
+
const normalizedParams = new URLSearchParams();
|
|
453
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
454
|
+
if (value !== undefined) {
|
|
455
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
const stringifiedParams = normalizedParams.toString();
|
|
459
|
+
return stringifiedParams.length > 0 ? `/api/orgs/${slug}/unit-ids?${stringifiedParams}` : `/api/orgs/${slug}/unit-ids`;
|
|
460
|
+
};
|
|
461
|
+
export const unitListOrgSubUnitIds = async (slug, params, options) => {
|
|
462
|
+
const res = await fetch(getUnitListOrgSubUnitIdsUrl(slug, params), {
|
|
463
|
+
...options,
|
|
464
|
+
method: 'GET'
|
|
465
|
+
});
|
|
466
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
467
|
+
const data = body ? JSON.parse(body) : {};
|
|
468
|
+
return { data, status: res.status, headers: res.headers };
|
|
469
|
+
};
|
|
470
|
+
;
|
|
471
|
+
export const getUnitListOrgSubUnitsUrl = (slug, params) => {
|
|
472
|
+
const normalizedParams = new URLSearchParams();
|
|
473
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
474
|
+
if (value !== undefined) {
|
|
475
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
const stringifiedParams = normalizedParams.toString();
|
|
479
|
+
return stringifiedParams.length > 0 ? `/api/orgs/${slug}/units?${stringifiedParams}` : `/api/orgs/${slug}/units`;
|
|
480
|
+
};
|
|
481
|
+
export const unitListOrgSubUnits = async (slug, params, options) => {
|
|
482
|
+
const res = await fetch(getUnitListOrgSubUnitsUrl(slug, params), {
|
|
483
|
+
...options,
|
|
484
|
+
method: 'GET'
|
|
485
|
+
});
|
|
486
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
487
|
+
const data = body ? JSON.parse(body) : {};
|
|
488
|
+
return { data, status: res.status, headers: res.headers };
|
|
489
|
+
};
|
|
490
|
+
;
|
|
491
|
+
export const getUnitCreateUnitUrl = (slug) => {
|
|
492
|
+
return `/api/orgs/${slug}/units`;
|
|
493
|
+
};
|
|
494
|
+
export const unitCreateUnit = async (slug, unitCreateUnitRequest, options) => {
|
|
495
|
+
const res = await fetch(getUnitCreateUnitUrl(slug), {
|
|
496
|
+
...options,
|
|
497
|
+
method: 'POST',
|
|
498
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
499
|
+
body: JSON.stringify(unitCreateUnitRequest)
|
|
500
|
+
});
|
|
501
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
502
|
+
const data = body ? JSON.parse(body) : {};
|
|
503
|
+
return { data, status: res.status, headers: res.headers };
|
|
504
|
+
};
|
|
505
|
+
;
|
|
506
|
+
export const getUnitGetUnitByIdUrl = (slug, id) => {
|
|
507
|
+
return `/api/orgs/${slug}/units/${id}`;
|
|
508
|
+
};
|
|
509
|
+
export const unitGetUnitById = async (slug, id, options) => {
|
|
510
|
+
const res = await fetch(getUnitGetUnitByIdUrl(slug, id), {
|
|
511
|
+
...options,
|
|
512
|
+
method: 'GET'
|
|
513
|
+
});
|
|
514
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
515
|
+
const data = body ? JSON.parse(body) : {};
|
|
516
|
+
return { data, status: res.status, headers: res.headers };
|
|
517
|
+
};
|
|
518
|
+
;
|
|
519
|
+
export const getUnitUpdateUnitUrl = (slug, id) => {
|
|
520
|
+
return `/api/orgs/${slug}/units/${id}`;
|
|
521
|
+
};
|
|
522
|
+
export const unitUpdateUnit = async (slug, id, unitUpdateUnitRequest, options) => {
|
|
523
|
+
const res = await fetch(getUnitUpdateUnitUrl(slug, id), {
|
|
524
|
+
...options,
|
|
525
|
+
method: 'PUT',
|
|
526
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
527
|
+
body: JSON.stringify(unitUpdateUnitRequest)
|
|
528
|
+
});
|
|
529
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
530
|
+
const data = body ? JSON.parse(body) : {};
|
|
531
|
+
return { data, status: res.status, headers: res.headers };
|
|
532
|
+
};
|
|
533
|
+
export const getUnitDeleteUnitUrl = (slug, id) => {
|
|
534
|
+
return `/api/orgs/${slug}/units/${id}`;
|
|
535
|
+
};
|
|
536
|
+
export const unitDeleteUnit = async (slug, id, options) => {
|
|
537
|
+
const res = await fetch(getUnitDeleteUnitUrl(slug, id), {
|
|
538
|
+
...options,
|
|
539
|
+
method: 'DELETE'
|
|
540
|
+
});
|
|
541
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
542
|
+
const data = body ? JSON.parse(body) : {};
|
|
543
|
+
return { data, status: res.status, headers: res.headers };
|
|
544
|
+
};
|
|
545
|
+
;
|
|
546
|
+
export const getUnitAddUnitMemberUrl = (slug, id) => {
|
|
547
|
+
return `/api/orgs/${slug}/units/${id}/members`;
|
|
548
|
+
};
|
|
549
|
+
export const unitAddUnitMember = async (slug, id, unitUnitMemberRequest, options) => {
|
|
550
|
+
const res = await fetch(getUnitAddUnitMemberUrl(slug, id), {
|
|
551
|
+
...options,
|
|
552
|
+
method: 'POST',
|
|
553
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
554
|
+
body: JSON.stringify(unitUnitMemberRequest)
|
|
555
|
+
});
|
|
556
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
557
|
+
const data = body ? JSON.parse(body) : {};
|
|
558
|
+
return { data, status: res.status, headers: res.headers };
|
|
559
|
+
};
|
|
560
|
+
;
|
|
561
|
+
export const getUnitListUnitMembersUrl = (slug, id) => {
|
|
562
|
+
return `/api/orgs/${slug}/units/${id}/members`;
|
|
563
|
+
};
|
|
564
|
+
export const unitListUnitMembers = async (slug, id, options) => {
|
|
565
|
+
const res = await fetch(getUnitListUnitMembersUrl(slug, id), {
|
|
566
|
+
...options,
|
|
567
|
+
method: 'GET'
|
|
568
|
+
});
|
|
569
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
570
|
+
const data = body ? JSON.parse(body) : {};
|
|
571
|
+
return { data, status: res.status, headers: res.headers };
|
|
572
|
+
};
|
|
573
|
+
export const getUnitRemoveUnitMemberUrl = (slug, id, memberId) => {
|
|
574
|
+
return `/api/orgs/${slug}/units/${id}/members/${memberId}`;
|
|
575
|
+
};
|
|
576
|
+
export const unitRemoveUnitMember = async (slug, id, memberId, options) => {
|
|
577
|
+
const res = await fetch(getUnitRemoveUnitMemberUrl(slug, id, memberId), {
|
|
578
|
+
...options,
|
|
579
|
+
method: 'DELETE'
|
|
580
|
+
});
|
|
581
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
582
|
+
const data = body ? JSON.parse(body) : {};
|
|
583
|
+
return { data, status: res.status, headers: res.headers };
|
|
584
|
+
};
|
|
585
|
+
;
|
|
586
|
+
export const getUnitListUnitSubUnitIdsUrl = (slug, id, params) => {
|
|
587
|
+
const normalizedParams = new URLSearchParams();
|
|
588
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
589
|
+
if (value !== undefined) {
|
|
590
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
const stringifiedParams = normalizedParams.toString();
|
|
594
|
+
return stringifiedParams.length > 0 ? `/api/orgs/${slug}/units/${id}/subunit-ids?${stringifiedParams}` : `/api/orgs/${slug}/units/${id}/subunit-ids`;
|
|
595
|
+
};
|
|
596
|
+
export const unitListUnitSubUnitIds = async (slug, id, params, options) => {
|
|
597
|
+
const res = await fetch(getUnitListUnitSubUnitIdsUrl(slug, id, params), {
|
|
598
|
+
...options,
|
|
599
|
+
method: 'GET'
|
|
600
|
+
});
|
|
601
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
602
|
+
const data = body ? JSON.parse(body) : {};
|
|
603
|
+
return { data, status: res.status, headers: res.headers };
|
|
604
|
+
};
|
|
605
|
+
;
|
|
606
|
+
export const getUnitListUnitSubUnitsUrl = (slug, id, params) => {
|
|
607
|
+
const normalizedParams = new URLSearchParams();
|
|
608
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
609
|
+
if (value !== undefined) {
|
|
610
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString());
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
const stringifiedParams = normalizedParams.toString();
|
|
614
|
+
return stringifiedParams.length > 0 ? `/api/orgs/${slug}/units/${id}/subunits?${stringifiedParams}` : `/api/orgs/${slug}/units/${id}/subunits`;
|
|
615
|
+
};
|
|
616
|
+
export const unitListUnitSubUnits = async (slug, id, params, options) => {
|
|
617
|
+
const res = await fetch(getUnitListUnitSubUnitsUrl(slug, id, params), {
|
|
618
|
+
...options,
|
|
619
|
+
method: 'GET'
|
|
620
|
+
});
|
|
621
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
622
|
+
const data = body ? JSON.parse(body) : {};
|
|
623
|
+
return { data, status: res.status, headers: res.headers };
|
|
624
|
+
};
|
|
625
|
+
;
|
|
626
|
+
export const getUnitCreateUnitFormUrl = (slug, unitId) => {
|
|
627
|
+
return `/api/orgs/${slug}/units/${unitId}/forms`;
|
|
628
|
+
};
|
|
629
|
+
export const unitCreateUnitForm = async (slug, unitId, formsFormRequest, options) => {
|
|
630
|
+
const res = await fetch(getUnitCreateUnitFormUrl(slug, unitId), {
|
|
631
|
+
...options,
|
|
632
|
+
method: 'POST',
|
|
633
|
+
headers: { 'Content-Type': 'application/json', ...options === null || options === void 0 ? void 0 : options.headers },
|
|
634
|
+
body: JSON.stringify(formsFormRequest)
|
|
635
|
+
});
|
|
636
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
637
|
+
const data = body ? JSON.parse(body) : {};
|
|
638
|
+
return { data, status: res.status, headers: res.headers };
|
|
639
|
+
};
|
|
640
|
+
;
|
|
641
|
+
export const getUnitListFormsByUnitUrl = (slug, unitId) => {
|
|
642
|
+
return `/api/orgs/${slug}/units/${unitId}/forms`;
|
|
643
|
+
};
|
|
644
|
+
export const unitListFormsByUnit = async (slug, unitId, options) => {
|
|
645
|
+
const res = await fetch(getUnitListFormsByUnitUrl(slug, unitId), {
|
|
646
|
+
...options,
|
|
647
|
+
method: 'GET'
|
|
648
|
+
});
|
|
649
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
650
|
+
const data = body ? JSON.parse(body) : {};
|
|
651
|
+
return { data, status: res.status, headers: res.headers };
|
|
652
|
+
};
|
|
653
|
+
export const getUserGetMeUrl = () => {
|
|
654
|
+
return `/api/users/me`;
|
|
655
|
+
};
|
|
656
|
+
export const userGetMe = async (options) => {
|
|
657
|
+
const res = await fetch(getUserGetMeUrl(), {
|
|
658
|
+
...options,
|
|
659
|
+
method: 'GET'
|
|
660
|
+
});
|
|
661
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
662
|
+
const data = body ? JSON.parse(body) : {};
|
|
663
|
+
return { data, status: res.status, headers: res.headers };
|
|
664
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.1.0 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Core System API
|
|
5
|
+
* OpenAPI spec version: 1.0.0
|
|
6
|
+
*/
|
|
7
|
+
export type AuthLoginGoogleParams = {
|
|
8
|
+
/**
|
|
9
|
+
* The callback URL of the OAuth2 login. [See details](https://clustron.atlassian.net/wiki/spaces/CS/pages/41320449/Authentication+Process)
|
|
10
|
+
*/
|
|
11
|
+
c: string;
|
|
12
|
+
/**
|
|
13
|
+
* The redirect URL for login callback.
|
|
14
|
+
*/
|
|
15
|
+
r?: string;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=authLoginGoogleParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authLoginGoogleParams.d.ts","sourceRoot":"","sources":["../../src/model/authLoginGoogleParams.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,qBAAqB,GAAG;IACpC;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;CACV,CAAC"}
|