@statezero/core 0.1.3 → 0.1.4
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.
|
@@ -511,8 +511,9 @@ const dtsTemplate = Handlebars.compile(TS_DECLARATION_TEMPLATE);
|
|
|
511
511
|
* @returns {Promise<{model: string, relativePath: string}>}
|
|
512
512
|
*/
|
|
513
513
|
async function generateSchemaForModel(backend, model) {
|
|
514
|
+
const authHeaders = backend.getAuthHeaders ? backend.getAuthHeaders() : {};
|
|
514
515
|
const schemaUrl = `${backend.API_URL}/${model}/get-schema/`;
|
|
515
|
-
const schemaResponse = await axios.get(schemaUrl);
|
|
516
|
+
const schemaResponse = await axios.get(schemaUrl, authHeaders);
|
|
516
517
|
/** @type {SchemaDefinition} */
|
|
517
518
|
let schema;
|
|
518
519
|
if (schemaResponse.data.components?.schemas?.[model]) {
|
|
@@ -1007,7 +1008,10 @@ async function main() {
|
|
|
1007
1008
|
const backend = backendConfigs[key];
|
|
1008
1009
|
backend.NAME = key;
|
|
1009
1010
|
try {
|
|
1010
|
-
const
|
|
1011
|
+
const authHeaders = backend.getAuthHeaders
|
|
1012
|
+
? backend.getAuthHeaders()
|
|
1013
|
+
: {};
|
|
1014
|
+
const response = await axios.get(`${backend.API_URL}/models/`, authHeaders);
|
|
1011
1015
|
return { backend, models: response.data };
|
|
1012
1016
|
}
|
|
1013
1017
|
catch (error) {
|
package/package.json
CHANGED