busabase-sdk 0.16.0 → 0.16.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.
- package/dist/airapp.d.ts +17 -6
- package/dist/airapp.js +4 -0
- package/package.json +4 -4
package/dist/airapp.d.ts
CHANGED
|
@@ -47,14 +47,25 @@ import 'zod';
|
|
|
47
47
|
|
|
48
48
|
type NodeChangeRequestInput = Parameters<BusabaseClient["nodes"]["createChangeRequest"]>[0];
|
|
49
49
|
type NodeOperationInput = NodeChangeRequestInput["operations"][number];
|
|
50
|
-
type CreateNodeOperationInput = Extract<NodeOperationInput, {
|
|
51
|
-
kind: "create";
|
|
52
|
-
}>;
|
|
53
50
|
/**
|
|
54
|
-
* A Base field,
|
|
55
|
-
*
|
|
51
|
+
* A Base field, as an app declares it.
|
|
52
|
+
*
|
|
53
|
+
* `type` is a plain `string`, not the contract's narrow field-type union — an
|
|
54
|
+
* app's declaration is ordinarily a hand-authored object literal (`type:
|
|
55
|
+
* "text"`), and TypeScript infers a plain-JS object literal's string
|
|
56
|
+
* properties as `string`, not as that literal. Deriving this type straight
|
|
57
|
+
* from the contract made every such declaration a type error. The contract's
|
|
58
|
+
* narrow union still applies where it actually matters — the server validates
|
|
59
|
+
* every field type on the wire — this type only relaxes the *declaration*
|
|
60
|
+
* surface to match how declarations are actually written.
|
|
56
61
|
*/
|
|
57
|
-
|
|
62
|
+
interface AirAppFieldDeclaration {
|
|
63
|
+
slug: string;
|
|
64
|
+
name: string;
|
|
65
|
+
type: string;
|
|
66
|
+
required?: boolean;
|
|
67
|
+
options?: Record<string, unknown>;
|
|
68
|
+
}
|
|
58
69
|
/** The client surface provisioning needs. Both `BusabaseClient` and `Busabase` satisfy it. */
|
|
59
70
|
type AirAppProvisioningClient = Pick<BusabaseClient, "nodes" | "bases">;
|
|
60
71
|
/** One Base the app declares it needs. `key` is the app's stable internal handle. */
|
package/dist/airapp.js
CHANGED
|
@@ -144,6 +144,8 @@ function buildProvisionOperations(config, folder, missingBases) {
|
|
|
144
144
|
name: base.name,
|
|
145
145
|
description: base.description ?? "",
|
|
146
146
|
metadata: resourceMetadata(config, base.key),
|
|
147
|
+
// The declaration's `type` is a plain `string` (see AirAppFieldDeclaration);
|
|
148
|
+
// the server validates the real field-type enum on the wire.
|
|
147
149
|
fields: base.fields
|
|
148
150
|
});
|
|
149
151
|
}
|
|
@@ -250,6 +252,8 @@ async function repairResourceOwnership(client, config, current) {
|
|
|
250
252
|
baseId: migration.repair.baseId,
|
|
251
253
|
slug: field.slug,
|
|
252
254
|
name: field.name,
|
|
255
|
+
// The declaration's `type` is a plain `string` (see AirAppFieldDeclaration);
|
|
256
|
+
// the server validates the real field-type enum on the wire.
|
|
253
257
|
type: field.type,
|
|
254
258
|
required: field.required,
|
|
255
259
|
message: `Upgrade ${config.appName}: add ${field.slug}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busabase-sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "Typed TypeScript/JavaScript SDK for the Busabase OpenAPI REST API. Talks to a local or remote `busabase server` (or Busabase Cloud).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/busabase/busabase/tree/main/apps/busabase-sdk",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"tsx": "^4.20.5",
|
|
64
64
|
"typescript": "^5.9.3",
|
|
65
65
|
"vitest": "^2.1.8",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
66
|
+
"busabase-contract": "0.16.1",
|
|
67
|
+
"openlib": "0.1.1",
|
|
68
|
+
"open-domains": "0.0.2"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=24.18.0"
|