@01.software/sdk 0.33.0 → 0.35.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.
Files changed (76) hide show
  1. package/README.md +214 -22
  2. package/dist/analytics/react.cjs.map +1 -1
  3. package/dist/analytics/react.js.map +1 -1
  4. package/dist/analytics.cjs.map +1 -1
  5. package/dist/analytics.js.map +1 -1
  6. package/dist/client.cjs +342 -27
  7. package/dist/client.cjs.map +1 -1
  8. package/dist/client.d.cts +7 -6
  9. package/dist/client.d.ts +7 -6
  10. package/dist/client.js +342 -27
  11. package/dist/client.js.map +1 -1
  12. package/dist/{collection-client-De6eKW1J.d.cts → collection-client-CR2B8c1v.d.cts} +7 -3
  13. package/dist/{collection-client-B6SlhzIP.d.ts → collection-client-DkREjhQ9.d.ts} +7 -3
  14. package/dist/{const-sPR2IkCe.d.cts → const-BTvdrXtY.d.cts} +4 -4
  15. package/dist/{const-DwmSDeWq.d.ts → const-CdqCauHQ.d.ts} +4 -4
  16. package/dist/errors.cjs +300 -0
  17. package/dist/errors.cjs.map +1 -0
  18. package/dist/{index-BGEhoDUs.d.cts → errors.d.cts} +13 -1
  19. package/dist/{index-BGEhoDUs.d.ts → errors.d.ts} +13 -1
  20. package/dist/errors.js +277 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/index-CjA3U6X3.d.cts +186 -0
  23. package/dist/index-DK8_NXkh.d.ts +186 -0
  24. package/dist/index.cjs +1402 -177
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +75 -10
  27. package/dist/index.d.ts +75 -10
  28. package/dist/index.js +1402 -177
  29. package/dist/index.js.map +1 -1
  30. package/dist/{payload-types-dkeQyrDC.d.cts → payload-types-C7tb7Xbs.d.cts} +208 -52
  31. package/dist/{payload-types-dkeQyrDC.d.ts → payload-types-C7tb7Xbs.d.ts} +208 -52
  32. package/dist/query.cjs +195 -36
  33. package/dist/query.cjs.map +1 -1
  34. package/dist/query.d.cts +45 -18
  35. package/dist/query.d.ts +45 -18
  36. package/dist/query.js +195 -36
  37. package/dist/query.js.map +1 -1
  38. package/dist/realtime.cjs.map +1 -1
  39. package/dist/realtime.d.cts +2 -2
  40. package/dist/realtime.d.ts +2 -2
  41. package/dist/realtime.js.map +1 -1
  42. package/dist/{server-CrsPyqEc.d.cts → server-nXOezi4b.d.cts} +22 -6
  43. package/dist/{server-CrsPyqEc.d.ts → server-nXOezi4b.d.ts} +22 -6
  44. package/dist/server.cjs +440 -33
  45. package/dist/server.cjs.map +1 -1
  46. package/dist/server.d.cts +11 -179
  47. package/dist/server.d.ts +11 -179
  48. package/dist/server.js +440 -33
  49. package/dist/server.js.map +1 -1
  50. package/dist/{types-Cel_4L9t.d.ts → types-1ylMrCuW.d.ts} +1 -1
  51. package/dist/{types-B3YT092I.d.cts → types-Bx558PU6.d.cts} +1 -1
  52. package/dist/{types-BHh0YLmq.d.ts → types-Byo_Rty4.d.ts} +705 -69
  53. package/dist/{types-BZKxss8Y.d.cts → types-DDhtZI6E.d.cts} +705 -69
  54. package/dist/ui/canvas/server.cjs +231 -38
  55. package/dist/ui/canvas/server.cjs.map +1 -1
  56. package/dist/ui/canvas/server.d.cts +1 -1
  57. package/dist/ui/canvas/server.d.ts +1 -1
  58. package/dist/ui/canvas/server.js +221 -38
  59. package/dist/ui/canvas/server.js.map +1 -1
  60. package/dist/ui/canvas.cjs +320 -257
  61. package/dist/ui/canvas.cjs.map +1 -1
  62. package/dist/ui/canvas.d.cts +5 -19
  63. package/dist/ui/canvas.d.ts +5 -19
  64. package/dist/ui/canvas.js +323 -260
  65. package/dist/ui/canvas.js.map +1 -1
  66. package/dist/ui/form.d.cts +1 -1
  67. package/dist/ui/form.d.ts +1 -1
  68. package/dist/ui/video.d.cts +1 -1
  69. package/dist/ui/video.d.ts +1 -1
  70. package/dist/webhook.cjs +2 -1
  71. package/dist/webhook.cjs.map +1 -1
  72. package/dist/webhook.d.cts +20 -179
  73. package/dist/webhook.d.ts +20 -179
  74. package/dist/webhook.js +2 -1
  75. package/dist/webhook.js.map +1 -1
  76. package/package.json +12 -3
package/dist/server.d.cts CHANGED
@@ -1,181 +1,11 @@
1
- import { S as ServerCollectionClient } from './collection-client-De6eKW1J.cjs';
2
- export { C as CollectionClient } from './collection-client-De6eKW1J.cjs';
3
- import { B as BaseApi, aU as ServerApiOptions, aX as StockCheckParams, aY as StockCheckResponse, _ as ListingGroupsParams, av as ProductListingGroupsResponse, ad as ProductDetailParams, ae as ProductDetailResult, bo as ProductDetailPreviewParams, bp as ProductDetailPreviewOptions, a4 as ProductDetail, bq as ProductUpsertParams, br as ProductUpsertResponse, k as AddItemParams, a$ as UpdateItemParams, aO as RemoveItemParams, l as ApplyDiscountParams, aN as RemoveDiscountParams, t as ClearCartParams, s as CheckoutParams, H as CreateOrderParams, b0 as UpdateOrderParams, b3 as UpdateTransactionParams, y as ConfirmPaymentParams, z as ConfirmPaymentResponse, F as CreateFulfillmentParams, a_ as UpdateFulfillmentParams, m as BulkImportFulfillmentsParams, n as BulkImportFulfillmentsResponse, I as CreateReturnParams, b2 as UpdateReturnParams, aT as ReturnWithRefundParams, b4 as ValidateDiscountParams, b5 as ValidateDiscountResult, o as CalculateShippingParams, p as CalculateShippingResult, a as CommunityClient, c as ClientState, bs as ClientServerConfig } from './types-BZKxss8Y.cjs';
4
- import { i as Cart, j as CartItem, O as Order, m as Transaction, n as Fulfillment, o as Return } from './payload-types-dkeQyrDC.cjs';
1
+ import { S as ServerCollectionClient } from './collection-client-CR2B8c1v.cjs';
2
+ export { C as CollectionClient } from './collection-client-CR2B8c1v.cjs';
3
+ import { B as BaseApi, l as ServerApiOptions, m as ServerCommerceClient, T as TenantIntrospectionClient, a as CommunityClient, n as BanCustomerParams, o as CommunityBan, U as UnbanCustomerParams, c as ClientState, p as ClientServerConfig, E as EventsClient, q as RootServerClientWithEvents } from './types-DDhtZI6E.cjs';
4
+ export { r as CollectionFieldSchema, s as CollectionSchemaResponse, t as EventGuestCancelParams, u as EventGuestRegistration, v as EventGuestRegistrationResponse, w as EventRegistrationAnswerInput, x as EventRegistrationAttendeeInput, y as EventRegistrationPublic, z as EventRegistrationRegisterParams, F as EventRegistrationRegisterResponse, G as EventsCalendarItem, H as EventsClientOptions, I as EventsDateParam, J as EventsExternalSource, K as EventsLocation, L as EventsOccurrenceLocation, M as EventsRangeEvent, N as EventsRangeOccurrence, O as EventsRangeParams, Q as EventsRangeResponse, V as EventsTaxonomyItem, X as ModerationApi, Y as RootServerClient, Z as TenantFeatureProgressEvidenceValue, _ as TenantFeatureProgressFeature, $ as TenantFeatureProgressGroup, a0 as TenantFeatureProgressInput, a1 as TenantFeatureProgressItem, a2 as TenantFeatureProgressItemState, a3 as TenantFeatureProgressResponse, a4 as TenantFeatureProgressSeverity, a5 as TenantFeatureProgressStatus, a6 as TenantIntrospectionApi, a7 as TenantIntrospectionApiOptions } from './types-DDhtZI6E.cjs';
5
+ import './payload-types-C7tb7Xbs.cjs';
5
6
  import './metadata.cjs';
6
- import './const-sPR2IkCe.cjs';
7
- import './types-B3YT092I.cjs';
8
-
9
- type ModerationApiOptions = ServerApiOptions;
10
- interface CommunityBan {
11
- id: string;
12
- customer: string;
13
- isPermanent?: boolean;
14
- bannedUntil?: string;
15
- reason?: string;
16
- createdAt?: string;
17
- updatedAt?: string;
18
- [key: string]: unknown;
19
- }
20
- type BanCustomerParams = {
21
- customerId: string;
22
- isPermanent?: boolean;
23
- bannedUntil?: string;
24
- reason?: string;
25
- };
26
- type UnbanCustomerParams = {
27
- customerId: string;
28
- };
29
- declare class ModerationApi extends BaseApi {
30
- constructor(options: ModerationApiOptions);
31
- banCustomer(params: BanCustomerParams): Promise<CommunityBan>;
32
- unbanCustomer(params: UnbanCustomerParams): Promise<{
33
- success: true;
34
- }>;
35
- }
36
-
37
- interface ServerCommerceClientOptions {
38
- publishableKey?: string;
39
- secretKey: string;
40
- apiUrl?: string;
41
- onRequestId?: (id: string | null) => void;
42
- }
43
- declare class ServerCommerceClient {
44
- readonly product: {
45
- stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
46
- listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
47
- detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
48
- previewDetail: (params: ProductDetailPreviewParams, options: ProductDetailPreviewOptions) => Promise<ProductDetail | null>;
49
- upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
50
- };
51
- readonly cart: {
52
- get: (cartId: string) => Promise<Cart>;
53
- addItem: (params: AddItemParams) => Promise<CartItem>;
54
- updateItem: (params: UpdateItemParams) => Promise<CartItem>;
55
- removeItem: (params: RemoveItemParams) => Promise<{
56
- success: boolean;
57
- }>;
58
- applyDiscount: (params: ApplyDiscountParams) => Promise<Cart>;
59
- removeDiscount: (params: RemoveDiscountParams) => Promise<Cart>;
60
- clear: (params: ClearCartParams) => Promise<{
61
- success: boolean;
62
- }>;
63
- };
64
- readonly orders: {
65
- checkout: (params: CheckoutParams) => Promise<Order>;
66
- create: (params: CreateOrderParams) => Promise<Order>;
67
- update: (params: UpdateOrderParams) => Promise<Order>;
68
- updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
69
- confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
70
- createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
71
- updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
72
- bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
73
- createReturn: (params: CreateReturnParams) => Promise<Return>;
74
- updateReturn: (params: UpdateReturnParams) => Promise<Return>;
75
- returnWithRefund: (params: ReturnWithRefundParams) => Promise<{
76
- return: Return;
77
- transaction: Transaction | null;
78
- }>;
79
- };
80
- readonly discounts: {
81
- validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
82
- };
83
- readonly shipping: {
84
- calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
85
- };
86
- constructor(options: ServerCommerceClientOptions);
87
- }
88
-
89
- type TenantIntrospectionApiOptions = ServerApiOptions;
90
- type TenantFeatureProgressFeature = 'ecommerce';
91
- interface TenantFeatureProgressInput {
92
- feature: TenantFeatureProgressFeature;
93
- includeEvidence?: boolean;
94
- }
95
- type TenantFeatureProgressStatus = 'ready' | 'attention' | 'blocked';
96
- type TenantFeatureProgressItemState = 'complete' | 'incomplete' | 'blocked' | 'attention' | 'optional' | 'unknown' | 'manual' | 'not-applicable';
97
- type TenantFeatureProgressSeverity = 'required' | 'recommended' | 'optional';
98
- type TenantFeatureProgressEvidenceValue = string | number | boolean | null;
99
- interface TenantFeatureProgressItem {
100
- id: string;
101
- title: string;
102
- state: TenantFeatureProgressItemState;
103
- severity: TenantFeatureProgressSeverity;
104
- summary: string;
105
- evidence?: Record<string, TenantFeatureProgressEvidenceValue>;
106
- }
107
- interface TenantFeatureProgressGroup {
108
- id: string;
109
- title: string;
110
- summary?: string;
111
- items: TenantFeatureProgressItem[];
112
- }
113
- interface TenantFeatureProgressResponse {
114
- schemaVersion: 1;
115
- feature: TenantFeatureProgressFeature;
116
- status: TenantFeatureProgressStatus;
117
- generatedAt: string;
118
- tenant: {
119
- id: string;
120
- name: string;
121
- plan: string;
122
- };
123
- capability: {
124
- effectiveFeatures: string[];
125
- planBlocked: string[];
126
- closureAdded: string[];
127
- };
128
- summary: {
129
- complete: number;
130
- total: number;
131
- blocking: number;
132
- manual: number;
133
- unknown: number;
134
- };
135
- groups: TenantFeatureProgressGroup[];
136
- }
137
- interface CollectionFieldSchema {
138
- name: string;
139
- path: string;
140
- type: string;
141
- required?: true;
142
- unique?: true;
143
- hasMany?: true;
144
- relationTo?: string | string[];
145
- options?: Array<{
146
- label: string;
147
- value: string;
148
- }>;
149
- hidden?: true;
150
- systemManaged?: true;
151
- writable?: boolean;
152
- fields?: CollectionFieldSchema[];
153
- }
154
- interface CollectionSchemaResponse {
155
- contractVersion: 1;
156
- mode: 'effective';
157
- collection: {
158
- slug: string;
159
- timestamps: boolean;
160
- alwaysActive: boolean;
161
- feature: string | null;
162
- systemFields: string[];
163
- visibility: {
164
- collectionHidden: boolean;
165
- hiddenFields: string[];
166
- };
167
- fields: CollectionFieldSchema[];
168
- };
169
- }
170
- interface TenantIntrospectionClient {
171
- collectionSchema: (collection: string) => Promise<CollectionSchemaResponse>;
172
- featureProgress: (params: TenantFeatureProgressInput) => Promise<TenantFeatureProgressResponse>;
173
- }
174
- declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospectionClient {
175
- constructor(options: TenantIntrospectionApiOptions);
176
- collectionSchema(collection: string): Promise<CollectionSchemaResponse>;
177
- featureProgress(params: TenantFeatureProgressInput): Promise<TenantFeatureProgressResponse>;
178
- }
7
+ import './const-BTvdrXtY.cjs';
8
+ import './types-Bx558PU6.cjs';
179
9
 
180
10
  type PreviewDetailParams = {
181
11
  collection: string;
@@ -201,6 +31,7 @@ declare class ServerPreviewClient extends BaseApi {
201
31
  declare class ServerClient {
202
32
  commerce: ServerCommerceClient;
203
33
  tenant: TenantIntrospectionClient;
34
+ private _events?;
204
35
  community: CommunityClient & {
205
36
  moderation: {
206
37
  banCustomer: (p: BanCustomerParams) => Promise<CommunityBan>;
@@ -217,6 +48,7 @@ declare class ServerClient {
217
48
  protected state: ClientState;
218
49
  protected config: ClientServerConfig;
219
50
  constructor(options: ClientServerConfig);
51
+ get events(): EventsClient;
220
52
  getState(): ClientState;
221
53
  getConfig(): Omit<ClientServerConfig, 'secretKey'>;
222
54
  }
@@ -224,6 +56,6 @@ declare class ServerClient {
224
56
  * Create a server-only client with full read/write access. Requires secretKey.
225
57
  * For read-only usage, prefer `createClient()` (no secretKey needed).
226
58
  */
227
- declare function createServerClient(options: ClientServerConfig): ServerClient;
59
+ declare function createServerClient(options: ClientServerConfig): RootServerClientWithEvents;
228
60
 
229
- export { ClientServerConfig, type CollectionFieldSchema, type CollectionSchemaResponse, CommunityClient, ModerationApi, type PreviewDetailOptions, type PreviewDetailParams, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, type TenantFeatureProgressEvidenceValue, type TenantFeatureProgressFeature, type TenantFeatureProgressGroup, type TenantFeatureProgressInput, type TenantFeatureProgressItem, type TenantFeatureProgressItemState, type TenantFeatureProgressResponse, type TenantFeatureProgressSeverity, type TenantFeatureProgressStatus, TenantIntrospectionApi, type TenantIntrospectionApiOptions, type TenantIntrospectionClient, createServerClient };
61
+ export { ClientServerConfig, CommunityClient, EventsClient, type PreviewDetailOptions, type PreviewDetailParams, RootServerClientWithEvents, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, TenantIntrospectionClient, createServerClient };
package/dist/server.d.ts CHANGED
@@ -1,181 +1,11 @@
1
- import { S as ServerCollectionClient } from './collection-client-B6SlhzIP.js';
2
- export { C as CollectionClient } from './collection-client-B6SlhzIP.js';
3
- import { B as BaseApi, aU as ServerApiOptions, aX as StockCheckParams, aY as StockCheckResponse, _ as ListingGroupsParams, av as ProductListingGroupsResponse, ad as ProductDetailParams, ae as ProductDetailResult, bo as ProductDetailPreviewParams, bp as ProductDetailPreviewOptions, a4 as ProductDetail, bq as ProductUpsertParams, br as ProductUpsertResponse, k as AddItemParams, a$ as UpdateItemParams, aO as RemoveItemParams, l as ApplyDiscountParams, aN as RemoveDiscountParams, t as ClearCartParams, s as CheckoutParams, H as CreateOrderParams, b0 as UpdateOrderParams, b3 as UpdateTransactionParams, y as ConfirmPaymentParams, z as ConfirmPaymentResponse, F as CreateFulfillmentParams, a_ as UpdateFulfillmentParams, m as BulkImportFulfillmentsParams, n as BulkImportFulfillmentsResponse, I as CreateReturnParams, b2 as UpdateReturnParams, aT as ReturnWithRefundParams, b4 as ValidateDiscountParams, b5 as ValidateDiscountResult, o as CalculateShippingParams, p as CalculateShippingResult, a as CommunityClient, c as ClientState, bs as ClientServerConfig } from './types-BHh0YLmq.js';
4
- import { i as Cart, j as CartItem, O as Order, m as Transaction, n as Fulfillment, o as Return } from './payload-types-dkeQyrDC.js';
1
+ import { S as ServerCollectionClient } from './collection-client-DkREjhQ9.js';
2
+ export { C as CollectionClient } from './collection-client-DkREjhQ9.js';
3
+ import { B as BaseApi, l as ServerApiOptions, m as ServerCommerceClient, T as TenantIntrospectionClient, a as CommunityClient, n as BanCustomerParams, o as CommunityBan, U as UnbanCustomerParams, c as ClientState, p as ClientServerConfig, E as EventsClient, q as RootServerClientWithEvents } from './types-Byo_Rty4.js';
4
+ export { r as CollectionFieldSchema, s as CollectionSchemaResponse, t as EventGuestCancelParams, u as EventGuestRegistration, v as EventGuestRegistrationResponse, w as EventRegistrationAnswerInput, x as EventRegistrationAttendeeInput, y as EventRegistrationPublic, z as EventRegistrationRegisterParams, F as EventRegistrationRegisterResponse, G as EventsCalendarItem, H as EventsClientOptions, I as EventsDateParam, J as EventsExternalSource, K as EventsLocation, L as EventsOccurrenceLocation, M as EventsRangeEvent, N as EventsRangeOccurrence, O as EventsRangeParams, Q as EventsRangeResponse, V as EventsTaxonomyItem, X as ModerationApi, Y as RootServerClient, Z as TenantFeatureProgressEvidenceValue, _ as TenantFeatureProgressFeature, $ as TenantFeatureProgressGroup, a0 as TenantFeatureProgressInput, a1 as TenantFeatureProgressItem, a2 as TenantFeatureProgressItemState, a3 as TenantFeatureProgressResponse, a4 as TenantFeatureProgressSeverity, a5 as TenantFeatureProgressStatus, a6 as TenantIntrospectionApi, a7 as TenantIntrospectionApiOptions } from './types-Byo_Rty4.js';
5
+ import './payload-types-C7tb7Xbs.js';
5
6
  import './metadata.js';
6
- import './const-DwmSDeWq.js';
7
- import './types-Cel_4L9t.js';
8
-
9
- type ModerationApiOptions = ServerApiOptions;
10
- interface CommunityBan {
11
- id: string;
12
- customer: string;
13
- isPermanent?: boolean;
14
- bannedUntil?: string;
15
- reason?: string;
16
- createdAt?: string;
17
- updatedAt?: string;
18
- [key: string]: unknown;
19
- }
20
- type BanCustomerParams = {
21
- customerId: string;
22
- isPermanent?: boolean;
23
- bannedUntil?: string;
24
- reason?: string;
25
- };
26
- type UnbanCustomerParams = {
27
- customerId: string;
28
- };
29
- declare class ModerationApi extends BaseApi {
30
- constructor(options: ModerationApiOptions);
31
- banCustomer(params: BanCustomerParams): Promise<CommunityBan>;
32
- unbanCustomer(params: UnbanCustomerParams): Promise<{
33
- success: true;
34
- }>;
35
- }
36
-
37
- interface ServerCommerceClientOptions {
38
- publishableKey?: string;
39
- secretKey: string;
40
- apiUrl?: string;
41
- onRequestId?: (id: string | null) => void;
42
- }
43
- declare class ServerCommerceClient {
44
- readonly product: {
45
- stockCheck: (params: StockCheckParams) => Promise<StockCheckResponse>;
46
- listingGroups: (params: ListingGroupsParams) => Promise<ProductListingGroupsResponse>;
47
- detail: (params: ProductDetailParams) => Promise<ProductDetailResult>;
48
- previewDetail: (params: ProductDetailPreviewParams, options: ProductDetailPreviewOptions) => Promise<ProductDetail | null>;
49
- upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
50
- };
51
- readonly cart: {
52
- get: (cartId: string) => Promise<Cart>;
53
- addItem: (params: AddItemParams) => Promise<CartItem>;
54
- updateItem: (params: UpdateItemParams) => Promise<CartItem>;
55
- removeItem: (params: RemoveItemParams) => Promise<{
56
- success: boolean;
57
- }>;
58
- applyDiscount: (params: ApplyDiscountParams) => Promise<Cart>;
59
- removeDiscount: (params: RemoveDiscountParams) => Promise<Cart>;
60
- clear: (params: ClearCartParams) => Promise<{
61
- success: boolean;
62
- }>;
63
- };
64
- readonly orders: {
65
- checkout: (params: CheckoutParams) => Promise<Order>;
66
- create: (params: CreateOrderParams) => Promise<Order>;
67
- update: (params: UpdateOrderParams) => Promise<Order>;
68
- updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
69
- confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
70
- createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
71
- updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
72
- bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
73
- createReturn: (params: CreateReturnParams) => Promise<Return>;
74
- updateReturn: (params: UpdateReturnParams) => Promise<Return>;
75
- returnWithRefund: (params: ReturnWithRefundParams) => Promise<{
76
- return: Return;
77
- transaction: Transaction | null;
78
- }>;
79
- };
80
- readonly discounts: {
81
- validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
82
- };
83
- readonly shipping: {
84
- calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
85
- };
86
- constructor(options: ServerCommerceClientOptions);
87
- }
88
-
89
- type TenantIntrospectionApiOptions = ServerApiOptions;
90
- type TenantFeatureProgressFeature = 'ecommerce';
91
- interface TenantFeatureProgressInput {
92
- feature: TenantFeatureProgressFeature;
93
- includeEvidence?: boolean;
94
- }
95
- type TenantFeatureProgressStatus = 'ready' | 'attention' | 'blocked';
96
- type TenantFeatureProgressItemState = 'complete' | 'incomplete' | 'blocked' | 'attention' | 'optional' | 'unknown' | 'manual' | 'not-applicable';
97
- type TenantFeatureProgressSeverity = 'required' | 'recommended' | 'optional';
98
- type TenantFeatureProgressEvidenceValue = string | number | boolean | null;
99
- interface TenantFeatureProgressItem {
100
- id: string;
101
- title: string;
102
- state: TenantFeatureProgressItemState;
103
- severity: TenantFeatureProgressSeverity;
104
- summary: string;
105
- evidence?: Record<string, TenantFeatureProgressEvidenceValue>;
106
- }
107
- interface TenantFeatureProgressGroup {
108
- id: string;
109
- title: string;
110
- summary?: string;
111
- items: TenantFeatureProgressItem[];
112
- }
113
- interface TenantFeatureProgressResponse {
114
- schemaVersion: 1;
115
- feature: TenantFeatureProgressFeature;
116
- status: TenantFeatureProgressStatus;
117
- generatedAt: string;
118
- tenant: {
119
- id: string;
120
- name: string;
121
- plan: string;
122
- };
123
- capability: {
124
- effectiveFeatures: string[];
125
- planBlocked: string[];
126
- closureAdded: string[];
127
- };
128
- summary: {
129
- complete: number;
130
- total: number;
131
- blocking: number;
132
- manual: number;
133
- unknown: number;
134
- };
135
- groups: TenantFeatureProgressGroup[];
136
- }
137
- interface CollectionFieldSchema {
138
- name: string;
139
- path: string;
140
- type: string;
141
- required?: true;
142
- unique?: true;
143
- hasMany?: true;
144
- relationTo?: string | string[];
145
- options?: Array<{
146
- label: string;
147
- value: string;
148
- }>;
149
- hidden?: true;
150
- systemManaged?: true;
151
- writable?: boolean;
152
- fields?: CollectionFieldSchema[];
153
- }
154
- interface CollectionSchemaResponse {
155
- contractVersion: 1;
156
- mode: 'effective';
157
- collection: {
158
- slug: string;
159
- timestamps: boolean;
160
- alwaysActive: boolean;
161
- feature: string | null;
162
- systemFields: string[];
163
- visibility: {
164
- collectionHidden: boolean;
165
- hiddenFields: string[];
166
- };
167
- fields: CollectionFieldSchema[];
168
- };
169
- }
170
- interface TenantIntrospectionClient {
171
- collectionSchema: (collection: string) => Promise<CollectionSchemaResponse>;
172
- featureProgress: (params: TenantFeatureProgressInput) => Promise<TenantFeatureProgressResponse>;
173
- }
174
- declare class TenantIntrospectionApi extends BaseApi implements TenantIntrospectionClient {
175
- constructor(options: TenantIntrospectionApiOptions);
176
- collectionSchema(collection: string): Promise<CollectionSchemaResponse>;
177
- featureProgress(params: TenantFeatureProgressInput): Promise<TenantFeatureProgressResponse>;
178
- }
7
+ import './const-CdqCauHQ.js';
8
+ import './types-1ylMrCuW.js';
179
9
 
180
10
  type PreviewDetailParams = {
181
11
  collection: string;
@@ -201,6 +31,7 @@ declare class ServerPreviewClient extends BaseApi {
201
31
  declare class ServerClient {
202
32
  commerce: ServerCommerceClient;
203
33
  tenant: TenantIntrospectionClient;
34
+ private _events?;
204
35
  community: CommunityClient & {
205
36
  moderation: {
206
37
  banCustomer: (p: BanCustomerParams) => Promise<CommunityBan>;
@@ -217,6 +48,7 @@ declare class ServerClient {
217
48
  protected state: ClientState;
218
49
  protected config: ClientServerConfig;
219
50
  constructor(options: ClientServerConfig);
51
+ get events(): EventsClient;
220
52
  getState(): ClientState;
221
53
  getConfig(): Omit<ClientServerConfig, 'secretKey'>;
222
54
  }
@@ -224,6 +56,6 @@ declare class ServerClient {
224
56
  * Create a server-only client with full read/write access. Requires secretKey.
225
57
  * For read-only usage, prefer `createClient()` (no secretKey needed).
226
58
  */
227
- declare function createServerClient(options: ClientServerConfig): ServerClient;
59
+ declare function createServerClient(options: ClientServerConfig): RootServerClientWithEvents;
228
60
 
229
- export { ClientServerConfig, type CollectionFieldSchema, type CollectionSchemaResponse, CommunityClient, ModerationApi, type PreviewDetailOptions, type PreviewDetailParams, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, type TenantFeatureProgressEvidenceValue, type TenantFeatureProgressFeature, type TenantFeatureProgressGroup, type TenantFeatureProgressInput, type TenantFeatureProgressItem, type TenantFeatureProgressItemState, type TenantFeatureProgressResponse, type TenantFeatureProgressSeverity, type TenantFeatureProgressStatus, TenantIntrospectionApi, type TenantIntrospectionApiOptions, type TenantIntrospectionClient, createServerClient };
61
+ export { ClientServerConfig, CommunityClient, EventsClient, type PreviewDetailOptions, type PreviewDetailParams, RootServerClientWithEvents, ServerClient, ServerCollectionClient, ServerCommerceClient, ServerPreviewClient, TenantIntrospectionClient, createServerClient };