@acm-uiuc/core-client 0.0.1

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.
Files changed (83) hide show
  1. package/.openapi-generator/FILES +127 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +277 -0
  5. package/dist/apis/APIKeysApi.d.ts +54 -0
  6. package/dist/apis/APIKeysApi.js +143 -0
  7. package/dist/apis/EventsApi.d.ts +86 -0
  8. package/dist/apis/EventsApi.js +250 -0
  9. package/dist/apis/GenericApi.d.ts +88 -0
  10. package/dist/apis/GenericApi.js +249 -0
  11. package/dist/apis/IAMApi.d.ts +108 -0
  12. package/dist/apis/IAMApi.js +327 -0
  13. package/dist/apis/ICalendarIntegrationApi.d.ts +29 -0
  14. package/dist/apis/ICalendarIntegrationApi.js +61 -0
  15. package/dist/apis/LinkryApi.d.ts +100 -0
  16. package/dist/apis/LinkryApi.js +330 -0
  17. package/dist/apis/LoggingApi.d.ts +51 -0
  18. package/dist/apis/LoggingApi.js +103 -0
  19. package/dist/apis/MembershipApi.d.ts +107 -0
  20. package/dist/apis/MembershipApi.js +330 -0
  21. package/dist/apis/MobileWalletApi.d.ts +28 -0
  22. package/dist/apis/MobileWalletApi.js +64 -0
  23. package/dist/apis/OrganizationsApi.d.ts +65 -0
  24. package/dist/apis/OrganizationsApi.js +192 -0
  25. package/dist/apis/RSVPApi.d.ts +109 -0
  26. package/dist/apis/RSVPApi.js +345 -0
  27. package/dist/apis/RoomRequestsApi.d.ts +102 -0
  28. package/dist/apis/RoomRequestsApi.js +279 -0
  29. package/dist/apis/StoreApi.d.ts +141 -0
  30. package/dist/apis/StoreApi.js +449 -0
  31. package/dist/apis/StripeApi.d.ts +54 -0
  32. package/dist/apis/StripeApi.js +152 -0
  33. package/dist/apis/VendingApi.d.ts +33 -0
  34. package/dist/apis/VendingApi.js +83 -0
  35. package/dist/apis/index.d.ts +15 -0
  36. package/dist/apis/index.js +33 -0
  37. package/dist/esm/apis/APIKeysApi.d.ts +54 -0
  38. package/dist/esm/apis/APIKeysApi.js +139 -0
  39. package/dist/esm/apis/EventsApi.d.ts +86 -0
  40. package/dist/esm/apis/EventsApi.js +246 -0
  41. package/dist/esm/apis/GenericApi.d.ts +88 -0
  42. package/dist/esm/apis/GenericApi.js +245 -0
  43. package/dist/esm/apis/IAMApi.d.ts +108 -0
  44. package/dist/esm/apis/IAMApi.js +323 -0
  45. package/dist/esm/apis/ICalendarIntegrationApi.d.ts +29 -0
  46. package/dist/esm/apis/ICalendarIntegrationApi.js +57 -0
  47. package/dist/esm/apis/LinkryApi.d.ts +100 -0
  48. package/dist/esm/apis/LinkryApi.js +326 -0
  49. package/dist/esm/apis/LoggingApi.d.ts +51 -0
  50. package/dist/esm/apis/LoggingApi.js +99 -0
  51. package/dist/esm/apis/MembershipApi.d.ts +107 -0
  52. package/dist/esm/apis/MembershipApi.js +326 -0
  53. package/dist/esm/apis/MobileWalletApi.d.ts +28 -0
  54. package/dist/esm/apis/MobileWalletApi.js +60 -0
  55. package/dist/esm/apis/OrganizationsApi.d.ts +65 -0
  56. package/dist/esm/apis/OrganizationsApi.js +188 -0
  57. package/dist/esm/apis/RSVPApi.d.ts +109 -0
  58. package/dist/esm/apis/RSVPApi.js +341 -0
  59. package/dist/esm/apis/RoomRequestsApi.d.ts +102 -0
  60. package/dist/esm/apis/RoomRequestsApi.js +275 -0
  61. package/dist/esm/apis/StoreApi.d.ts +141 -0
  62. package/dist/esm/apis/StoreApi.js +445 -0
  63. package/dist/esm/apis/StripeApi.d.ts +54 -0
  64. package/dist/esm/apis/StripeApi.js +148 -0
  65. package/dist/esm/apis/VendingApi.d.ts +33 -0
  66. package/dist/esm/apis/VendingApi.js +79 -0
  67. package/dist/esm/apis/index.d.ts +15 -0
  68. package/dist/esm/apis/index.js +17 -0
  69. package/dist/esm/index.d.ts +3 -0
  70. package/dist/esm/index.js +5 -0
  71. package/dist/esm/models/index.d.ts +3567 -0
  72. package/dist/esm/models/index.js +539 -0
  73. package/dist/esm/runtime.d.ts +181 -0
  74. package/dist/esm/runtime.js +327 -0
  75. package/dist/index.d.ts +3 -0
  76. package/dist/index.js +21 -0
  77. package/dist/models/index.d.ts +3567 -0
  78. package/dist/models/index.js +543 -0
  79. package/dist/runtime.d.ts +181 -0
  80. package/dist/runtime.js +342 -0
  81. package/package.json +23 -0
  82. package/tsconfig.esm.json +7 -0
  83. package/tsconfig.json +16 -0
@@ -0,0 +1,327 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * ACM @ UIUC Core API
5
+ * The ACM @ UIUC Core API provides services for managing chapter operations. ## Usage The primary consumer of the Core API is the Management Portal, which allows members to manage the chapter. Others may call the API with an API key; please contact us to obtain one. This API also integrates into the ACM website and other suborganization to provide calendar services. Calendar clients call the iCal endpoints (available through [ical.acm.illinois.edu](https://ical.acm.illinois.edu)) for calendar services. ## Contact <hr /> If you are an ACM @ UIUC member, please join the Infra Committee Discord for support. Otherwise, email [infra@acm.illinois.edu](mailto:infra@acm.illinois.edu) for support. **For all security concerns, please email [infra@acm.illinois.edu](mailto:infra@acm.illinois.edu) with the subject \"Security Concern\".**
6
+ *
7
+ * The version of the OpenAPI document: 2.0.1
8
+ * Contact: infra@acm.illinois.edu
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ export const BASE_PATH = "https://core.aws.qa.acmuiuc.org".replace(/\/+$/, "");
24
+ export class Configuration {
25
+ constructor(configuration = {}) {
26
+ this.configuration = configuration;
27
+ }
28
+ set config(configuration) {
29
+ this.configuration = configuration;
30
+ }
31
+ get basePath() {
32
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
33
+ }
34
+ get fetchApi() {
35
+ return this.configuration.fetchApi;
36
+ }
37
+ get middleware() {
38
+ return this.configuration.middleware || [];
39
+ }
40
+ get queryParamsStringify() {
41
+ return this.configuration.queryParamsStringify || querystring;
42
+ }
43
+ get username() {
44
+ return this.configuration.username;
45
+ }
46
+ get password() {
47
+ return this.configuration.password;
48
+ }
49
+ get apiKey() {
50
+ const apiKey = this.configuration.apiKey;
51
+ if (apiKey) {
52
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
53
+ }
54
+ return undefined;
55
+ }
56
+ get accessToken() {
57
+ const accessToken = this.configuration.accessToken;
58
+ if (accessToken) {
59
+ return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
60
+ }
61
+ return undefined;
62
+ }
63
+ get headers() {
64
+ return this.configuration.headers;
65
+ }
66
+ get credentials() {
67
+ return this.configuration.credentials;
68
+ }
69
+ }
70
+ export const DefaultConfig = new Configuration();
71
+ /**
72
+ * This is the base class for all generated API classes.
73
+ */
74
+ export class BaseAPI {
75
+ constructor(configuration = DefaultConfig) {
76
+ this.configuration = configuration;
77
+ this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
78
+ let fetchParams = { url, init };
79
+ for (const middleware of this.middleware) {
80
+ if (middleware.pre) {
81
+ fetchParams = (yield middleware.pre(Object.assign({ fetch: this.fetchApi }, fetchParams))) || fetchParams;
82
+ }
83
+ }
84
+ let response = undefined;
85
+ try {
86
+ response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
87
+ }
88
+ catch (e) {
89
+ for (const middleware of this.middleware) {
90
+ if (middleware.onError) {
91
+ response = (yield middleware.onError({
92
+ fetch: this.fetchApi,
93
+ url: fetchParams.url,
94
+ init: fetchParams.init,
95
+ error: e,
96
+ response: response ? response.clone() : undefined,
97
+ })) || response;
98
+ }
99
+ }
100
+ if (response === undefined) {
101
+ if (e instanceof Error) {
102
+ throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
103
+ }
104
+ else {
105
+ throw e;
106
+ }
107
+ }
108
+ }
109
+ for (const middleware of this.middleware) {
110
+ if (middleware.post) {
111
+ response = (yield middleware.post({
112
+ fetch: this.fetchApi,
113
+ url: fetchParams.url,
114
+ init: fetchParams.init,
115
+ response: response.clone(),
116
+ })) || response;
117
+ }
118
+ }
119
+ return response;
120
+ });
121
+ this.middleware = configuration.middleware;
122
+ }
123
+ withMiddleware(...middlewares) {
124
+ const next = this.clone();
125
+ next.middleware = next.middleware.concat(...middlewares);
126
+ return next;
127
+ }
128
+ withPreMiddleware(...preMiddlewares) {
129
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
130
+ return this.withMiddleware(...middlewares);
131
+ }
132
+ withPostMiddleware(...postMiddlewares) {
133
+ const middlewares = postMiddlewares.map((post) => ({ post }));
134
+ return this.withMiddleware(...middlewares);
135
+ }
136
+ /**
137
+ * Check if the given MIME is a JSON MIME.
138
+ * JSON MIME examples:
139
+ * application/json
140
+ * application/json; charset=UTF8
141
+ * APPLICATION/JSON
142
+ * application/vnd.company+json
143
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
144
+ * @return True if the given MIME is JSON, false otherwise.
145
+ */
146
+ isJsonMime(mime) {
147
+ if (!mime) {
148
+ return false;
149
+ }
150
+ return BaseAPI.jsonRegex.test(mime);
151
+ }
152
+ request(context, initOverrides) {
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ const { url, init } = yield this.createFetchParams(context, initOverrides);
155
+ const response = yield this.fetchApi(url, init);
156
+ if (response && (response.status >= 200 && response.status < 300)) {
157
+ return response;
158
+ }
159
+ throw new ResponseError(response, 'Response returned an error code');
160
+ });
161
+ }
162
+ createFetchParams(context, initOverrides) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ let url = this.configuration.basePath + context.path;
165
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
166
+ // only add the querystring to the URL if there are query parameters.
167
+ // this is done to avoid urls ending with a "?" character which buggy webservers
168
+ // do not handle correctly sometimes.
169
+ url += '?' + this.configuration.queryParamsStringify(context.query);
170
+ }
171
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
172
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
173
+ const initOverrideFn = typeof initOverrides === "function"
174
+ ? initOverrides
175
+ : () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
176
+ const initParams = {
177
+ method: context.method,
178
+ headers,
179
+ body: context.body,
180
+ credentials: this.configuration.credentials,
181
+ };
182
+ const overriddenInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
183
+ init: initParams,
184
+ context,
185
+ })));
186
+ let body;
187
+ if (isFormData(overriddenInit.body)
188
+ || (overriddenInit.body instanceof URLSearchParams)
189
+ || isBlob(overriddenInit.body)) {
190
+ body = overriddenInit.body;
191
+ }
192
+ else if (this.isJsonMime(headers['Content-Type'])) {
193
+ body = JSON.stringify(overriddenInit.body);
194
+ }
195
+ else {
196
+ body = overriddenInit.body;
197
+ }
198
+ const init = Object.assign(Object.assign({}, overriddenInit), { body });
199
+ return { url, init };
200
+ });
201
+ }
202
+ /**
203
+ * Create a shallow clone of `this` by constructing a new instance
204
+ * and then shallow cloning data members.
205
+ */
206
+ clone() {
207
+ const constructor = this.constructor;
208
+ const next = new constructor(this.configuration);
209
+ next.middleware = this.middleware.slice();
210
+ return next;
211
+ }
212
+ }
213
+ BaseAPI.jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
214
+ ;
215
+ function isBlob(value) {
216
+ return typeof Blob !== 'undefined' && value instanceof Blob;
217
+ }
218
+ function isFormData(value) {
219
+ return typeof FormData !== "undefined" && value instanceof FormData;
220
+ }
221
+ export class ResponseError extends Error {
222
+ constructor(response, msg) {
223
+ super(msg);
224
+ this.response = response;
225
+ this.name = "ResponseError";
226
+ }
227
+ }
228
+ export class FetchError extends Error {
229
+ constructor(cause, msg) {
230
+ super(msg);
231
+ this.cause = cause;
232
+ this.name = "FetchError";
233
+ }
234
+ }
235
+ export class RequiredError extends Error {
236
+ constructor(field, msg) {
237
+ super(msg);
238
+ this.field = field;
239
+ this.name = "RequiredError";
240
+ }
241
+ }
242
+ export const COLLECTION_FORMATS = {
243
+ csv: ",",
244
+ ssv: " ",
245
+ tsv: "\t",
246
+ pipes: "|",
247
+ };
248
+ export function querystring(params, prefix = '') {
249
+ return Object.keys(params)
250
+ .map(key => querystringSingleKey(key, params[key], prefix))
251
+ .filter(part => part.length > 0)
252
+ .join('&');
253
+ }
254
+ function querystringSingleKey(key, value, keyPrefix = '') {
255
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
256
+ if (value instanceof Array) {
257
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
258
+ .join(`&${encodeURIComponent(fullKey)}=`);
259
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
260
+ }
261
+ if (value instanceof Set) {
262
+ const valueAsArray = Array.from(value);
263
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
264
+ }
265
+ if (value instanceof Date) {
266
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
267
+ }
268
+ if (value instanceof Object) {
269
+ return querystring(value, fullKey);
270
+ }
271
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
272
+ }
273
+ export function exists(json, key) {
274
+ const value = json[key];
275
+ return value !== null && value !== undefined;
276
+ }
277
+ export function canConsumeForm(consumes) {
278
+ for (const consume of consumes) {
279
+ if ('multipart/form-data' === consume.contentType) {
280
+ return true;
281
+ }
282
+ }
283
+ return false;
284
+ }
285
+ export class JSONApiResponse {
286
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
287
+ this.raw = raw;
288
+ this.transformer = transformer;
289
+ }
290
+ value() {
291
+ return __awaiter(this, void 0, void 0, function* () {
292
+ return this.transformer(yield this.raw.json());
293
+ });
294
+ }
295
+ }
296
+ export class VoidApiResponse {
297
+ constructor(raw) {
298
+ this.raw = raw;
299
+ }
300
+ value() {
301
+ return __awaiter(this, void 0, void 0, function* () {
302
+ return undefined;
303
+ });
304
+ }
305
+ }
306
+ export class BlobApiResponse {
307
+ constructor(raw) {
308
+ this.raw = raw;
309
+ }
310
+ value() {
311
+ return __awaiter(this, void 0, void 0, function* () {
312
+ return yield this.raw.blob();
313
+ });
314
+ }
315
+ ;
316
+ }
317
+ export class TextApiResponse {
318
+ constructor(raw) {
319
+ this.raw = raw;
320
+ }
321
+ value() {
322
+ return __awaiter(this, void 0, void 0, function* () {
323
+ return yield this.raw.text();
324
+ });
325
+ }
326
+ ;
327
+ }
@@ -0,0 +1,3 @@
1
+ export * from './runtime.js';
2
+ export * from './apis/index.js';
3
+ export * from './models/index.js';
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./runtime.js"), exports);
20
+ __exportStar(require("./apis/index.js"), exports);
21
+ __exportStar(require("./models/index.js"), exports);