@lark-apaas/db-schema-sync 0.1.0-alpha.5 → 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/dist/bin.js +1 -1
- package/dist/{chunk-OF4XHR3O.js → chunk-MTFKSLNU.js} +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -973,7 +973,10 @@ Body: ${body.slice(0, 500)}`);
|
|
|
973
973
|
}
|
|
974
974
|
const json = await response.json();
|
|
975
975
|
const data = json.data;
|
|
976
|
-
|
|
976
|
+
if (!data) {
|
|
977
|
+
return {};
|
|
978
|
+
}
|
|
979
|
+
return data?.data ?? data?.schema ?? data ?? {};
|
|
977
980
|
} catch (err) {
|
|
978
981
|
if (err?.response) {
|
|
979
982
|
const headers = err.response.headers;
|
|
@@ -1153,6 +1156,9 @@ function extractSyncedTableMap(tables) {
|
|
|
1153
1156
|
return map;
|
|
1154
1157
|
}
|
|
1155
1158
|
function normalizeApiResponse(response) {
|
|
1159
|
+
if (!response) {
|
|
1160
|
+
return { tables: [], views: [], materializedViews: [], enums: [], sequences: [], syncedTableMap: /* @__PURE__ */ new Map() };
|
|
1161
|
+
}
|
|
1156
1162
|
const usedTableIdentifiers = /* @__PURE__ */ new Set();
|
|
1157
1163
|
const usedViewIdentifiers = /* @__PURE__ */ new Set();
|
|
1158
1164
|
const usedMViewIdentifiers = /* @__PURE__ */ new Set();
|
package/dist/index.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ interface FetchOptions {
|
|
|
162
162
|
}
|
|
163
163
|
declare function resolveEnvOptions(env?: Record<string, string | undefined>): FetchOptions;
|
|
164
164
|
|
|
165
|
-
declare function normalizeApiResponse(response: ApiTableViewResponse): SchemaData;
|
|
165
|
+
declare function normalizeApiResponse(response: ApiTableViewResponse | null | undefined): SchemaData;
|
|
166
166
|
|
|
167
167
|
declare function generateSchemaCode(data: SchemaData): string;
|
|
168
168
|
|
package/dist/index.js
CHANGED