busa-sdk 0.16.0 → 0.16.2

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { B as BusabaseClient } from './client-DB7fREZX.js';
1
+ import { B as BusabaseClient } from './client-DN7Ol1g1.js';
2
2
  import '@orpc/contract';
3
3
  import '@orpc/shared';
4
4
  import 'zod';
@@ -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, typed straight off the contract so a declaration can never drift
55
- * from what `nodes.createChangeRequest` actually accepts.
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
- type AirAppFieldDeclaration = NonNullable<CreateNodeOperationInput["fields"]>[number];
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}`,