@bagelink/sdk 0.0.955 → 0.0.959
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/dist/index.cjs +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
- package/src/openAPITools/index.ts +3 -1
package/dist/index.cjs
CHANGED
|
@@ -286,9 +286,10 @@ function generateTypes(schemas) {
|
|
|
286
286
|
}).join("\n");
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
const basicAuthHeader = { Authorization: "Basic YmFnZWxfdXNlcm5hbWU6Tm90U2VjdXJlQGJhZ2Vs" };
|
|
289
290
|
const index = async (openApiUrl, baseUrl) => {
|
|
290
291
|
try {
|
|
291
|
-
const { data: openApi } = await axios__default.get(openApiUrl);
|
|
292
|
+
const { data: openApi } = await axios__default.get(openApiUrl, { headers: basicAuthHeader });
|
|
292
293
|
const schemas = openApi.components?.schemas;
|
|
293
294
|
if (!schemas)
|
|
294
295
|
throw new Error("No schemas found in OpenAPI document");
|
package/dist/index.mjs
CHANGED
|
@@ -280,9 +280,10 @@ function generateTypes(schemas) {
|
|
|
280
280
|
}).join("\n");
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
+
const basicAuthHeader = { Authorization: "Basic YmFnZWxfdXNlcm5hbWU6Tm90U2VjdXJlQGJhZ2Vs" };
|
|
283
284
|
const index = async (openApiUrl, baseUrl) => {
|
|
284
285
|
try {
|
|
285
|
-
const { data: openApi } = await axios$1.get(openApiUrl);
|
|
286
|
+
const { data: openApi } = await axios$1.get(openApiUrl, { headers: basicAuthHeader });
|
|
286
287
|
const schemas = openApi.components?.schemas;
|
|
287
288
|
if (!schemas)
|
|
288
289
|
throw new Error("No schemas found in OpenAPI document");
|
package/package.json
CHANGED
|
@@ -8,9 +8,11 @@ interface OpenAPIResponse {
|
|
|
8
8
|
code: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
const basicAuthHeader = { Authorization: 'Basic YmFnZWxfdXNlcm5hbWU6Tm90U2VjdXJlQGJhZ2Vs' }
|
|
12
|
+
|
|
11
13
|
export default async (openApiUrl: string, baseUrl: string): Promise<OpenAPIResponse> => {
|
|
12
14
|
try {
|
|
13
|
-
const { data: openApi } = await axios.get<OpenAPIDocument>(openApiUrl)
|
|
15
|
+
const { data: openApi } = await axios.get<OpenAPIDocument>(openApiUrl, { headers: basicAuthHeader })
|
|
14
16
|
const schemas = openApi.components?.schemas
|
|
15
17
|
if (!schemas) throw new Error('No schemas found in OpenAPI document')
|
|
16
18
|
const types = generateTypes(schemas)
|