@lovable.dev/sdk 1.3.0 → 1.4.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.
@@ -379,6 +379,50 @@ export interface paths {
379
379
  patch?: never;
380
380
  trace?: never;
381
381
  };
382
+ "/v1/members/bulk-set-credit-limit": {
383
+ parameters: {
384
+ query?: never;
385
+ header?: never;
386
+ path?: never;
387
+ cookie?: never;
388
+ };
389
+ get?: never;
390
+ put?: never;
391
+ /**
392
+ * Bulk-set member credit limits (Preview)
393
+ * @description Sets or clears the monthly credit limit for up to 50 members in one request. Returns HTTP 200 with a per-member result; an individual failure does not fail the request. Pass workspace_id in the request body.
394
+ *
395
+ * This operation is in public preview (beta): send `X-Enable-Beta: true` on every request. Requests without the header are rejected with HTTP 400 and type `beta_required` in the standard error envelope. Request and response shapes may change before the operation graduates to the stable surface.
396
+ */
397
+ post: operations["post-v1-members-bulk-set-credit-limit"];
398
+ delete?: never;
399
+ options?: never;
400
+ head?: never;
401
+ patch?: never;
402
+ trace?: never;
403
+ };
404
+ "/v1/members/{user_id}": {
405
+ parameters: {
406
+ query?: never;
407
+ header?: never;
408
+ path?: never;
409
+ cookie?: never;
410
+ };
411
+ get?: never;
412
+ put?: never;
413
+ post?: never;
414
+ delete?: never;
415
+ options?: never;
416
+ head?: never;
417
+ /**
418
+ * Update a member's credit limit (Preview)
419
+ * @description Sets or clears a workspace member's monthly credit limit. Pass workspace_id in the request body and the member's user_id in the path.
420
+ *
421
+ * This operation is in public preview (beta): send `X-Enable-Beta: true` on every request. Requests without the header are rejected with HTTP 400 and type `beta_required` in the standard error envelope. Request and response shapes may change before the operation graduates to the stable surface.
422
+ */
423
+ patch: operations["patch-v1-members-user_id"];
424
+ trace?: never;
425
+ };
382
426
  "/v1/messages": {
383
427
  parameters: {
384
428
  query?: never;
@@ -1100,7 +1144,13 @@ export interface paths {
1100
1144
  delete?: never;
1101
1145
  options?: never;
1102
1146
  head?: never;
1103
- patch?: never;
1147
+ /**
1148
+ * Update workspace settings (Preview)
1149
+ * @description Updates writable workspace settings. Currently supports the default per-member monthly credit limit. Pass workspace_id in the request body.
1150
+ *
1151
+ * This operation is in public preview (beta): send `X-Enable-Beta: true` on every request. Requests without the header are rejected with HTTP 400 and type `beta_required` in the standard error envelope. Request and response shapes may change before the operation graduates to the stable surface.
1152
+ */
1153
+ patch: operations["patch-v1-settings"];
1104
1154
  trace?: never;
1105
1155
  };
1106
1156
  "/v1/skills": {
@@ -2028,6 +2078,16 @@ export interface components {
2028
2078
  /** @description Project ID */
2029
2079
  project_id: string;
2030
2080
  };
2081
+ PublicV1GetEditsOutputBody: {
2082
+ /** @description List of edits */
2083
+ data: components["schemas"]["V1EditSummary"][] | null;
2084
+ /** @description Deprecated: use data. Legacy edits list kept for backward compatibility */
2085
+ edits: components["schemas"]["V1EditSummary"][] | null;
2086
+ /** @description Deprecated: use pagination.has_more */
2087
+ has_more: boolean;
2088
+ /** @description Cursor pagination metadata */
2089
+ pagination: components["schemas"]["Pagination"];
2090
+ };
2031
2091
  PublicV1GetWorkspaceBody: {
2032
2092
  /** @description Caller's membership in this workspace. */
2033
2093
  current_member?: components["schemas"]["PublicV1WorkspaceMember"];
@@ -2549,6 +2609,48 @@ export interface components {
2549
2609
  */
2550
2610
  start: string;
2551
2611
  };
2612
+ V1BulkMemberCreditLimitItem: {
2613
+ /**
2614
+ * Format: double
2615
+ * @description A number (0 blocks all spend) to set the cap, or null to clear it (the member inherits the workspace default).
2616
+ */
2617
+ monthly_credit_limit: number | null;
2618
+ /** @description Member user_id (from GET /v1/members; active members only). */
2619
+ user_id: string;
2620
+ };
2621
+ V1BulkMemberCreditLimitResult: {
2622
+ /** @description Failure reason when status is error. */
2623
+ error?: string;
2624
+ /** @description success or error. */
2625
+ status: string;
2626
+ /** @description The member this result is for. */
2627
+ user_id: string;
2628
+ };
2629
+ V1BulkSetMemberCreditLimitInputBody: {
2630
+ /** @description Per-member limits to apply (1-50 entries). Use the workspace default (PATCH /v1/settings) to cap everyone at once. */
2631
+ members: components["schemas"]["V1BulkMemberCreditLimitItem"][];
2632
+ /** @description Workspace ID. */
2633
+ workspace_id: string;
2634
+ };
2635
+ V1BulkSetMemberCreditLimitOutputBody: {
2636
+ /**
2637
+ * Format: int64
2638
+ * @description Number that failed (see per-item error).
2639
+ */
2640
+ failed: number;
2641
+ /** @description Per-member outcome, in request order. */
2642
+ results: components["schemas"]["V1BulkMemberCreditLimitResult"][] | null;
2643
+ /**
2644
+ * Format: int64
2645
+ * @description Number applied successfully.
2646
+ */
2647
+ successful: number;
2648
+ /**
2649
+ * Format: int64
2650
+ * @description Number of members in the request.
2651
+ */
2652
+ total: number;
2653
+ };
2552
2654
  V1ConnectionItem: {
2553
2655
  /** @description Connector type (e.g. google_drive, stripe) */
2554
2656
  connector_id: string;
@@ -2742,7 +2844,6 @@ export interface components {
2742
2844
  };
2743
2845
  V1DiffResponse: {
2744
2846
  diffs: components["schemas"]["V1DiffEntry"][] | null;
2745
- error?: string;
2746
2847
  };
2747
2848
  V1EditSummary: {
2748
2849
  /** @description Commit message */
@@ -3283,6 +3384,24 @@ export interface components {
3283
3384
  /** @description File type (e.g. user_upload) */
3284
3385
  type?: string;
3285
3386
  };
3387
+ V1UpdateMemberCreditLimitInputBody: {
3388
+ /**
3389
+ * Format: double
3390
+ * @description The member's monthly credit cap. Send a number >= 0 (0 blocks all spend) to set it, or null to clear it (the member then inherits the workspace default).
3391
+ */
3392
+ monthly_credit_limit?: number | null;
3393
+ /** @description Workspace ID. */
3394
+ workspace_id: string;
3395
+ };
3396
+ V1UpdateWorkspaceSettingsInputBody: {
3397
+ /**
3398
+ * Format: double
3399
+ * @description Default monthly credit cap applied to each member without an explicit per-member limit. Send a number >= 0 (0 blocks all member spend) to set it, or null to clear it (members are then bounded only by the workspace balance).
3400
+ */
3401
+ default_monthly_member_credit_limit?: number | null;
3402
+ /** @description Workspace ID. */
3403
+ workspace_id: string;
3404
+ };
3286
3405
  V1UsagePeriod: {
3287
3406
  /** @description Inclusive end of the covered window (YYYY-MM-DD, UTC). */
3288
3407
  end: string;
@@ -4319,7 +4438,9 @@ export interface operations {
4319
4438
  project_id: string;
4320
4439
  /** @description Maximum number of edits to return */
4321
4440
  limit?: number;
4322
- /** @description ISO 8601 timestamp to fetch edits older than */
4441
+ /** @description Opaque pagination cursor returned by the previous page */
4442
+ cursor?: string;
4443
+ /** @description Deprecated: use cursor. ISO 8601 timestamp to fetch edits older than */
4323
4444
  before?: string;
4324
4445
  };
4325
4446
  header?: never;
@@ -4334,7 +4455,7 @@ export interface operations {
4334
4455
  [name: string]: unknown;
4335
4456
  };
4336
4457
  content: {
4337
- "application/json": components["schemas"]["V1GetEditsOutputBody"];
4458
+ "application/json": components["schemas"]["PublicV1GetEditsOutputBody"];
4338
4459
  };
4339
4460
  };
4340
4461
  /** @description Error */
@@ -4640,6 +4761,81 @@ export interface operations {
4640
4761
  };
4641
4762
  };
4642
4763
  };
4764
+ "post-v1-members-bulk-set-credit-limit": {
4765
+ parameters: {
4766
+ query?: never;
4767
+ header: {
4768
+ /** @description Required for public preview endpoints. Set to true on every request. */
4769
+ "X-Enable-Beta": "true";
4770
+ };
4771
+ path?: never;
4772
+ cookie?: never;
4773
+ };
4774
+ requestBody: {
4775
+ content: {
4776
+ "application/json": components["schemas"]["V1BulkSetMemberCreditLimitInputBody"];
4777
+ };
4778
+ };
4779
+ responses: {
4780
+ /** @description OK */
4781
+ 200: {
4782
+ headers: {
4783
+ [name: string]: unknown;
4784
+ };
4785
+ content: {
4786
+ "application/json": components["schemas"]["V1BulkSetMemberCreditLimitOutputBody"];
4787
+ };
4788
+ };
4789
+ /** @description Error */
4790
+ default: {
4791
+ headers: {
4792
+ [name: string]: unknown;
4793
+ };
4794
+ content: {
4795
+ "application/problem+json": components["schemas"]["ErrorModel"];
4796
+ };
4797
+ };
4798
+ };
4799
+ };
4800
+ "patch-v1-members-user_id": {
4801
+ parameters: {
4802
+ query?: never;
4803
+ header: {
4804
+ /** @description Required for public preview endpoints. Set to true on every request. */
4805
+ "X-Enable-Beta": "true";
4806
+ };
4807
+ path: {
4808
+ /** @description User ID of the member to update (the user_id returned by GET /v1/members; active members only). */
4809
+ user_id: string;
4810
+ };
4811
+ cookie?: never;
4812
+ };
4813
+ requestBody: {
4814
+ content: {
4815
+ "application/json": components["schemas"]["V1UpdateMemberCreditLimitInputBody"];
4816
+ };
4817
+ };
4818
+ responses: {
4819
+ /** @description OK */
4820
+ 200: {
4821
+ headers: {
4822
+ [name: string]: unknown;
4823
+ };
4824
+ content: {
4825
+ "application/json": components["schemas"]["V1WorkspaceMember"];
4826
+ };
4827
+ };
4828
+ /** @description Error */
4829
+ default: {
4830
+ headers: {
4831
+ [name: string]: unknown;
4832
+ };
4833
+ content: {
4834
+ "application/problem+json": components["schemas"]["ErrorModel"];
4835
+ };
4836
+ };
4837
+ };
4838
+ };
4643
4839
  "get-v1-messages": {
4644
4840
  parameters: {
4645
4841
  query: {
@@ -6096,6 +6292,42 @@ export interface operations {
6096
6292
  };
6097
6293
  };
6098
6294
  };
6295
+ "patch-v1-settings": {
6296
+ parameters: {
6297
+ query?: never;
6298
+ header: {
6299
+ /** @description Required for public preview endpoints. Set to true on every request. */
6300
+ "X-Enable-Beta": "true";
6301
+ };
6302
+ path?: never;
6303
+ cookie?: never;
6304
+ };
6305
+ requestBody: {
6306
+ content: {
6307
+ "application/json": components["schemas"]["V1UpdateWorkspaceSettingsInputBody"];
6308
+ };
6309
+ };
6310
+ responses: {
6311
+ /** @description OK */
6312
+ 200: {
6313
+ headers: {
6314
+ [name: string]: unknown;
6315
+ };
6316
+ content: {
6317
+ "application/json": components["schemas"]["V1WorkspaceSettingsBody"];
6318
+ };
6319
+ };
6320
+ /** @description Error */
6321
+ default: {
6322
+ headers: {
6323
+ [name: string]: unknown;
6324
+ };
6325
+ content: {
6326
+ "application/problem+json": components["schemas"]["ErrorModel"];
6327
+ };
6328
+ };
6329
+ };
6330
+ };
6099
6331
  "get-v1-skills": {
6100
6332
  parameters: {
6101
6333
  query: {
@@ -646,6 +646,29 @@ export const V1BillingPeriodSchema = z.object({
646
646
  start: z.iso.datetime()
647
647
  });
648
648
 
649
+ export const V1BulkMemberCreditLimitItemSchema = z.object({
650
+ monthly_credit_limit: z.number().gte(0).nullable(),
651
+ user_id: z.string()
652
+ });
653
+
654
+ export const V1BulkMemberCreditLimitResultSchema = z.object({
655
+ error: z.string().optional(),
656
+ status: z.string(),
657
+ user_id: z.string()
658
+ });
659
+
660
+ export const V1BulkSetMemberCreditLimitInputBodySchema = z.object({
661
+ members: z.array(V1BulkMemberCreditLimitItemSchema).min(1).max(50),
662
+ workspace_id: z.string()
663
+ });
664
+
665
+ export const V1BulkSetMemberCreditLimitOutputBodySchema = z.object({
666
+ failed: z.number(),
667
+ results: z.array(V1BulkMemberCreditLimitResultSchema).nullable(),
668
+ successful: z.number(),
669
+ total: z.number()
670
+ });
671
+
649
672
  export const V1ConnectionItemSchema = z.object({
650
673
  connector_id: z.string(),
651
674
  created_at: z.string(),
@@ -759,8 +782,7 @@ export const V1DiffEntrySchema = z.object({
759
782
  });
760
783
 
761
784
  export const V1DiffResponseSchema = z.object({
762
- diffs: z.array(V1DiffEntrySchema).nullable(),
763
- error: z.string().optional()
785
+ diffs: z.array(V1DiffEntrySchema).nullable()
764
786
  });
765
787
 
766
788
  export const V1EditSummarySchema = z.object({
@@ -772,6 +794,13 @@ export const V1EditSummarySchema = z.object({
772
794
  type: z.string()
773
795
  });
774
796
 
797
+ export const PublicV1GetEditsOutputBodySchema = z.object({
798
+ data: z.array(V1EditSummarySchema).nullable(),
799
+ edits: z.array(V1EditSummarySchema).nullable(),
800
+ has_more: z.boolean(),
801
+ pagination: PaginationSchema
802
+ });
803
+
775
804
  export const V1EnableDatabaseOutputBodySchema = z.object({
776
805
  enabled: z.boolean(),
777
806
  stack: z.string()
@@ -1173,6 +1202,16 @@ export const V1SendMessageInputBodySchema = z.object({
1173
1202
  variant_id: z.string().optional()
1174
1203
  });
1175
1204
 
1205
+ export const V1UpdateMemberCreditLimitInputBodySchema = z.object({
1206
+ monthly_credit_limit: z.number().gte(0).nullish(),
1207
+ workspace_id: z.string()
1208
+ });
1209
+
1210
+ export const V1UpdateWorkspaceSettingsInputBodySchema = z.object({
1211
+ default_monthly_member_credit_limit: z.number().gte(0).nullish(),
1212
+ workspace_id: z.string()
1213
+ });
1214
+
1176
1215
  export const V1UsagePeriodSchema = z.object({
1177
1216
  end: z.string(),
1178
1217
  granularity: z.string().optional(),
package/src/types.ts CHANGED
@@ -136,7 +136,7 @@ export type GitDiffResponse = Schemas["V1DiffResponse"];
136
136
  export type GitFileEntry = Schemas["GitFileEntryLite"];
137
137
  export type GitFilesResponse = Schemas["PublicV1GitFilesResponse"] & { files: GitFileEntry[] };
138
138
  export type EditSummary = Schemas["V1EditSummary"];
139
- export type EditsResponse = Schemas["V1GetEditsOutputBody"];
139
+ export type EditsResponse = Schemas["PublicV1GetEditsOutputBody"];
140
140
 
141
141
  // --- Libraries & templates ---
142
142