@01.software/sdk 0.28.0 → 0.30.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/README.md +273 -73
- package/dist/analytics/react.cjs +4 -1
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.js +4 -1
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs +4 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js +4 -1
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +1476 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +28 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.js +1453 -0
- package/dist/client.js.map +1 -0
- package/dist/collection-client-B9d9kr1d.d.ts +218 -0
- package/dist/collection-client-QPbwimkU.d.cts +218 -0
- package/dist/{const-mdQQtIOz.d.ts → const-B75IFDRi.d.ts} +2 -4
- package/dist/{const-Cz9Ki_I7.d.cts → const-VZuk2tWc.d.cts} +2 -4
- package/dist/index-B2WbhEgT.d.cts +106 -0
- package/dist/index-B2WbhEgT.d.ts +106 -0
- package/dist/index.cjs +1291 -1501
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -115
- package/dist/index.d.ts +11 -115
- package/dist/index.js +1292 -1520
- package/dist/index.js.map +1 -1
- package/dist/metadata.cjs +91 -0
- package/dist/metadata.cjs.map +1 -0
- package/dist/metadata.d.cts +58 -0
- package/dist/metadata.d.ts +58 -0
- package/dist/metadata.js +68 -0
- package/dist/metadata.js.map +1 -0
- package/dist/{payload-types-BrSYb-sh.d.cts → payload-types-DPjO_IbQ.d.cts} +17 -6
- package/dist/{payload-types-BrSYb-sh.d.ts → payload-types-DPjO_IbQ.d.ts} +17 -6
- package/dist/query.cjs +1791 -0
- package/dist/query.cjs.map +1 -0
- package/dist/query.d.cts +244 -0
- package/dist/query.d.ts +244 -0
- package/dist/query.js +1786 -0
- package/dist/query.js.map +1 -0
- package/dist/realtime.cjs +4 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js +4 -1
- package/dist/realtime.js.map +1 -1
- package/dist/{server-BINWywT8.d.cts → server-CrsPyqEc.d.cts} +14 -31
- package/dist/{server-BINWywT8.d.ts → server-CrsPyqEc.d.ts} +14 -31
- package/dist/server.cjs +300 -844
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +112 -7
- package/dist/server.d.ts +112 -7
- package/dist/server.js +300 -862
- package/dist/server.js.map +1 -1
- package/dist/{types-BLUb4cYq.d.ts → types-1fBLrYU7.d.ts} +1 -1
- package/dist/{types-CW4PaIL7.d.cts → types-BwT0eeaz.d.cts} +1 -1
- package/dist/types-Dlb2mwpX.d.cts +1249 -0
- package/dist/types-DuSKPiY5.d.ts +1249 -0
- package/dist/ui/canvas/server.cjs +7 -6
- package/dist/ui/canvas/server.cjs.map +1 -1
- package/dist/ui/canvas/server.d.cts +1 -3
- package/dist/ui/canvas/server.d.ts +1 -3
- package/dist/ui/canvas/server.js +7 -6
- package/dist/ui/canvas/server.js.map +1 -1
- package/dist/ui/canvas.cjs +11 -10
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +29 -6
- package/dist/ui/canvas.d.ts +29 -6
- package/dist/ui/canvas.js +11 -10
- package/dist/ui/canvas.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +82 -13
- package/dist/server-C2Q9R-Lu.d.ts +0 -1662
- package/dist/server-D369bCVJ.d.cts +0 -1662
package/dist/server.d.cts
CHANGED
|
@@ -1,7 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '
|
|
4
|
-
import 'payload';
|
|
5
|
-
import '
|
|
6
|
-
import './
|
|
7
|
-
import './
|
|
1
|
+
import { S as ServerCollectionClient } from './collection-client-QPbwimkU.cjs';
|
|
2
|
+
export { C as CollectionClient } from './collection-client-QPbwimkU.cjs';
|
|
3
|
+
import { B as BaseApi, aJ as ServerApiOptions, aM as StockCheckParams, aN as StockCheckResponse, Y as ListingGroupsParams, am as ProductListingGroupsResponse, ab as ProductDetailParams, a2 as ProductDetail, bc as ProductUpsertParams, bd as ProductUpsertResponse, k as AddItemParams, aQ as UpdateItemParams, aE as RemoveItemParams, l as ApplyDiscountParams, aD as RemoveDiscountParams, t as ClearCartParams, s as CheckoutParams, G as CreateOrderParams, aR as UpdateOrderParams, aU as UpdateTransactionParams, y as ConfirmPaymentParams, z as ConfirmPaymentResponse, F as CreateFulfillmentParams, aP as UpdateFulfillmentParams, m as BulkImportFulfillmentsParams, n as BulkImportFulfillmentsResponse, H as CreateReturnParams, aT as UpdateReturnParams, aI as ReturnWithRefundParams, aV as ValidateDiscountParams, aW as ValidateDiscountResult, o as CalculateShippingParams, p as CalculateShippingResult, a as CommunityClient, c as ClientState, be as ClientServerConfig } from './types-Dlb2mwpX.cjs';
|
|
4
|
+
import { h as Cart, i as CartItem, O as Order, m as Transaction, n as Fulfillment, o as Return } from './payload-types-DPjO_IbQ.cjs';
|
|
5
|
+
import './metadata.cjs';
|
|
6
|
+
import './const-VZuk2tWc.cjs';
|
|
7
|
+
import './types-BwT0eeaz.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<ProductDetail | null>;
|
|
48
|
+
upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
|
|
49
|
+
};
|
|
50
|
+
readonly cart: {
|
|
51
|
+
get: (cartId: string) => Promise<Cart>;
|
|
52
|
+
addItem: (params: AddItemParams) => Promise<CartItem>;
|
|
53
|
+
updateItem: (params: UpdateItemParams) => Promise<CartItem>;
|
|
54
|
+
removeItem: (params: RemoveItemParams) => Promise<{
|
|
55
|
+
success: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
applyDiscount: (params: ApplyDiscountParams) => Promise<Cart>;
|
|
58
|
+
removeDiscount: (params: RemoveDiscountParams) => Promise<Cart>;
|
|
59
|
+
clear: (params: ClearCartParams) => Promise<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
readonly orders: {
|
|
64
|
+
checkout: (params: CheckoutParams) => Promise<Order>;
|
|
65
|
+
create: (params: CreateOrderParams) => Promise<Order>;
|
|
66
|
+
update: (params: UpdateOrderParams) => Promise<Order>;
|
|
67
|
+
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
68
|
+
confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
|
|
69
|
+
createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
|
|
70
|
+
updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
|
|
71
|
+
bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
|
|
72
|
+
createReturn: (params: CreateReturnParams) => Promise<Return>;
|
|
73
|
+
updateReturn: (params: UpdateReturnParams) => Promise<Return>;
|
|
74
|
+
returnWithRefund: (params: ReturnWithRefundParams) => Promise<{
|
|
75
|
+
return: Return;
|
|
76
|
+
transaction: Transaction | null;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
readonly discounts: {
|
|
80
|
+
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
81
|
+
};
|
|
82
|
+
readonly shipping: {
|
|
83
|
+
calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
|
|
84
|
+
};
|
|
85
|
+
constructor(options: ServerCommerceClientOptions);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class ServerClient {
|
|
89
|
+
commerce: ServerCommerceClient;
|
|
90
|
+
community: CommunityClient & {
|
|
91
|
+
moderation: {
|
|
92
|
+
banCustomer: (p: BanCustomerParams) => Promise<CommunityBan>;
|
|
93
|
+
unbanCustomer: (p: UnbanCustomerParams) => Promise<{
|
|
94
|
+
success: true;
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
collections: ServerCollectionClient;
|
|
99
|
+
lastRequestId: string | null;
|
|
100
|
+
protected state: ClientState;
|
|
101
|
+
protected config: ClientServerConfig;
|
|
102
|
+
constructor(options: ClientServerConfig);
|
|
103
|
+
getState(): ClientState;
|
|
104
|
+
getConfig(): Omit<ClientServerConfig, 'secretKey'>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Create a server-only client with full read/write access. Requires secretKey.
|
|
108
|
+
* For read-only usage, prefer `createClient()` (no secretKey needed).
|
|
109
|
+
*/
|
|
110
|
+
declare function createServerClient(options: ClientServerConfig): ServerClient;
|
|
111
|
+
|
|
112
|
+
export { ClientServerConfig, CommunityClient, ModerationApi, ServerClient, ServerCollectionClient, ServerCommerceClient, createServerClient };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '
|
|
4
|
-
import 'payload';
|
|
5
|
-
import '
|
|
6
|
-
import './
|
|
7
|
-
import './
|
|
1
|
+
import { S as ServerCollectionClient } from './collection-client-B9d9kr1d.js';
|
|
2
|
+
export { C as CollectionClient } from './collection-client-B9d9kr1d.js';
|
|
3
|
+
import { B as BaseApi, aJ as ServerApiOptions, aM as StockCheckParams, aN as StockCheckResponse, Y as ListingGroupsParams, am as ProductListingGroupsResponse, ab as ProductDetailParams, a2 as ProductDetail, bc as ProductUpsertParams, bd as ProductUpsertResponse, k as AddItemParams, aQ as UpdateItemParams, aE as RemoveItemParams, l as ApplyDiscountParams, aD as RemoveDiscountParams, t as ClearCartParams, s as CheckoutParams, G as CreateOrderParams, aR as UpdateOrderParams, aU as UpdateTransactionParams, y as ConfirmPaymentParams, z as ConfirmPaymentResponse, F as CreateFulfillmentParams, aP as UpdateFulfillmentParams, m as BulkImportFulfillmentsParams, n as BulkImportFulfillmentsResponse, H as CreateReturnParams, aT as UpdateReturnParams, aI as ReturnWithRefundParams, aV as ValidateDiscountParams, aW as ValidateDiscountResult, o as CalculateShippingParams, p as CalculateShippingResult, a as CommunityClient, c as ClientState, be as ClientServerConfig } from './types-DuSKPiY5.js';
|
|
4
|
+
import { h as Cart, i as CartItem, O as Order, m as Transaction, n as Fulfillment, o as Return } from './payload-types-DPjO_IbQ.js';
|
|
5
|
+
import './metadata.js';
|
|
6
|
+
import './const-B75IFDRi.js';
|
|
7
|
+
import './types-1fBLrYU7.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<ProductDetail | null>;
|
|
48
|
+
upsert: (params: ProductUpsertParams) => Promise<ProductUpsertResponse>;
|
|
49
|
+
};
|
|
50
|
+
readonly cart: {
|
|
51
|
+
get: (cartId: string) => Promise<Cart>;
|
|
52
|
+
addItem: (params: AddItemParams) => Promise<CartItem>;
|
|
53
|
+
updateItem: (params: UpdateItemParams) => Promise<CartItem>;
|
|
54
|
+
removeItem: (params: RemoveItemParams) => Promise<{
|
|
55
|
+
success: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
applyDiscount: (params: ApplyDiscountParams) => Promise<Cart>;
|
|
58
|
+
removeDiscount: (params: RemoveDiscountParams) => Promise<Cart>;
|
|
59
|
+
clear: (params: ClearCartParams) => Promise<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
readonly orders: {
|
|
64
|
+
checkout: (params: CheckoutParams) => Promise<Order>;
|
|
65
|
+
create: (params: CreateOrderParams) => Promise<Order>;
|
|
66
|
+
update: (params: UpdateOrderParams) => Promise<Order>;
|
|
67
|
+
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
68
|
+
confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
|
|
69
|
+
createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
|
|
70
|
+
updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
|
|
71
|
+
bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
|
|
72
|
+
createReturn: (params: CreateReturnParams) => Promise<Return>;
|
|
73
|
+
updateReturn: (params: UpdateReturnParams) => Promise<Return>;
|
|
74
|
+
returnWithRefund: (params: ReturnWithRefundParams) => Promise<{
|
|
75
|
+
return: Return;
|
|
76
|
+
transaction: Transaction | null;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
readonly discounts: {
|
|
80
|
+
validate: (params: ValidateDiscountParams) => Promise<ValidateDiscountResult>;
|
|
81
|
+
};
|
|
82
|
+
readonly shipping: {
|
|
83
|
+
calculate: (params: CalculateShippingParams) => Promise<CalculateShippingResult>;
|
|
84
|
+
};
|
|
85
|
+
constructor(options: ServerCommerceClientOptions);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class ServerClient {
|
|
89
|
+
commerce: ServerCommerceClient;
|
|
90
|
+
community: CommunityClient & {
|
|
91
|
+
moderation: {
|
|
92
|
+
banCustomer: (p: BanCustomerParams) => Promise<CommunityBan>;
|
|
93
|
+
unbanCustomer: (p: UnbanCustomerParams) => Promise<{
|
|
94
|
+
success: true;
|
|
95
|
+
}>;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
collections: ServerCollectionClient;
|
|
99
|
+
lastRequestId: string | null;
|
|
100
|
+
protected state: ClientState;
|
|
101
|
+
protected config: ClientServerConfig;
|
|
102
|
+
constructor(options: ClientServerConfig);
|
|
103
|
+
getState(): ClientState;
|
|
104
|
+
getConfig(): Omit<ClientServerConfig, 'secretKey'>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Create a server-only client with full read/write access. Requires secretKey.
|
|
108
|
+
* For read-only usage, prefer `createClient()` (no secretKey needed).
|
|
109
|
+
*/
|
|
110
|
+
declare function createServerClient(options: ClientServerConfig): ServerClient;
|
|
111
|
+
|
|
112
|
+
export { ClientServerConfig, CommunityClient, ModerationApi, ServerClient, ServerCollectionClient, ServerCommerceClient, createServerClient };
|