@base44-preview/cli 0.0.1-pr.13.5c2b0ab → 0.0.1-pr.13.61a06bf
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/cli/index.js +3 -14
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -496,26 +496,18 @@ const base44Client = ky.create({
|
|
|
496
496
|
afterResponse: [handleUnauthorized]
|
|
497
497
|
}
|
|
498
498
|
});
|
|
499
|
-
let _appClient = null;
|
|
500
499
|
/**
|
|
501
500
|
* Returns an HTTP client scoped to the current app.
|
|
502
|
-
* Lazily initialized on first call (app ID must be set via BASE44_CLIENT_ID env var).
|
|
503
501
|
*/
|
|
504
502
|
function getAppClient() {
|
|
505
|
-
|
|
506
|
-
return _appClient;
|
|
503
|
+
return base44Client.extend({ prefixUrl: new URL(`/api/apps/${getAppId()}/`, getBase44ApiUrl()).href });
|
|
507
504
|
}
|
|
508
505
|
|
|
509
506
|
//#endregion
|
|
510
507
|
//#region src/core/resources/entity/api.ts
|
|
511
508
|
async function pushEntities(entities) {
|
|
512
509
|
const appClient = getAppClient();
|
|
513
|
-
const schemaSyncPayload = entities.
|
|
514
|
-
return {
|
|
515
|
-
...acc,
|
|
516
|
-
[current.name]: current
|
|
517
|
-
};
|
|
518
|
-
}, {});
|
|
510
|
+
const schemaSyncPayload = Object.fromEntries(entities.map((entity) => [entity.name, entity]));
|
|
519
511
|
const response = await appClient.put("entities-schemas/sync-all", {
|
|
520
512
|
json: { entityNameToSchema: schemaSyncPayload },
|
|
521
513
|
throwHttpErrors: false
|
|
@@ -591,10 +583,7 @@ async function readAllFunctions(functionsDir) {
|
|
|
591
583
|
|
|
592
584
|
//#endregion
|
|
593
585
|
//#region src/core/resources/function/resource.ts
|
|
594
|
-
const functionResource = {
|
|
595
|
-
readAll: readAllFunctions,
|
|
596
|
-
push: async () => {}
|
|
597
|
-
};
|
|
586
|
+
const functionResource = { readAll: readAllFunctions };
|
|
598
587
|
|
|
599
588
|
//#endregion
|
|
600
589
|
//#region src/core/config/project.ts
|
package/package.json
CHANGED