@waffo/pancake-nextjs 0.1.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.
- package/CHANGELOG.md +22 -0
- package/README.md +371 -0
- package/dist/index.cjs +466 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +560 -0
- package/dist/index.d.ts +560 -0
- package/dist/index.js +427 -0
- package/dist/index.js.map +1 -0
- package/dist/server.cjs +82 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +96 -0
- package/dist/server.d.ts +96 -0
- package/dist/server.js +54 -0
- package/dist/server.js.map +1 -0
- package/package.json +96 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { IssueSessionTokenParams, SessionToken, AnonymousCheckoutParams, AuthenticatedCheckoutParams, CheckoutSessionResult, AuthenticatedCheckoutResult, GraphQLParams, GraphQLResponse, WaffoPancakeConfig } from '@waffo/pancake-ts';
|
|
2
|
+
|
|
3
|
+
/** Parameters for the checkout server action */
|
|
4
|
+
type CheckoutActionParams = ({
|
|
5
|
+
type?: "anonymous";
|
|
6
|
+
} & AnonymousCheckoutParams) | ({
|
|
7
|
+
type: "authenticated";
|
|
8
|
+
} & AuthenticatedCheckoutParams);
|
|
9
|
+
/** Result of the checkout server action */
|
|
10
|
+
type CheckoutActionResult = CheckoutSessionResult | AuthenticatedCheckoutResult;
|
|
11
|
+
/** Server action signature for checkout */
|
|
12
|
+
type CheckoutAction = (params: CheckoutActionParams) => Promise<CheckoutActionResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Create a server action that handles checkout session creation.
|
|
15
|
+
*
|
|
16
|
+
* The private key is captured in the closure and never sent to the client.
|
|
17
|
+
*
|
|
18
|
+
* @param config - WaffoPancake client configuration (merchantId + privateKey)
|
|
19
|
+
* @returns A server action function
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* "use server";
|
|
24
|
+
* import { createCheckoutAction } from "@waffo/pancake-nextjs/server";
|
|
25
|
+
*
|
|
26
|
+
* export const checkout = createCheckoutAction({
|
|
27
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
28
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare function createCheckoutAction(config: WaffoPancakeConfig): CheckoutAction;
|
|
33
|
+
/** Server action signature for issuing buyer tokens */
|
|
34
|
+
type BuyerTokenAction = (params: IssueSessionTokenParams) => Promise<SessionToken>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a server action that issues buyer session tokens.
|
|
37
|
+
*
|
|
38
|
+
* @param config - WaffoPancake client configuration
|
|
39
|
+
* @returns A server action function
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* "use server";
|
|
44
|
+
* import { createBuyerTokenAction } from "@waffo/pancake-nextjs/server";
|
|
45
|
+
*
|
|
46
|
+
* export const issueBuyerToken = createBuyerTokenAction({
|
|
47
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
48
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare function createBuyerTokenAction(config: WaffoPancakeConfig): BuyerTokenAction;
|
|
53
|
+
/** Buyer action types */
|
|
54
|
+
type BuyerSessionActionType = "cancelSubscription" | "cancelOnetimeOrder" | "reactivateSubscription" | "createRefundTicket" | "resubmitRefundTicket" | "query";
|
|
55
|
+
/** Server action signature for buyer session operations */
|
|
56
|
+
type BuyerSessionAction = (token: string, actionType: BuyerSessionActionType, params: unknown) => Promise<unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* Create a server action that executes buyer self-service operations.
|
|
59
|
+
*
|
|
60
|
+
* @param config - WaffoPancake client configuration
|
|
61
|
+
* @returns A server action function
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* "use server";
|
|
66
|
+
* import { createBuyerSessionAction } from "@waffo/pancake-nextjs/server";
|
|
67
|
+
*
|
|
68
|
+
* export const buyerAction = createBuyerSessionAction({
|
|
69
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
70
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare function createBuyerSessionAction(config: WaffoPancakeConfig): BuyerSessionAction;
|
|
75
|
+
/** Server action signature for merchant GraphQL queries */
|
|
76
|
+
type MerchantQueryAction = (params: GraphQLParams) => Promise<GraphQLResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Create a server action that executes merchant GraphQL queries.
|
|
79
|
+
*
|
|
80
|
+
* @param config - WaffoPancake client configuration
|
|
81
|
+
* @returns A server action function
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* "use server";
|
|
86
|
+
* import { createMerchantQueryAction } from "@waffo/pancake-nextjs/server";
|
|
87
|
+
*
|
|
88
|
+
* export const merchantQuery = createMerchantQueryAction({
|
|
89
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
90
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
declare function createMerchantQueryAction(config: WaffoPancakeConfig): MerchantQueryAction;
|
|
95
|
+
|
|
96
|
+
export { type BuyerSessionAction, type BuyerSessionActionType, type BuyerTokenAction, type CheckoutAction, type CheckoutActionParams, type CheckoutActionResult, type MerchantQueryAction, createBuyerSessionAction, createBuyerTokenAction, createCheckoutAction, createMerchantQueryAction };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { IssueSessionTokenParams, SessionToken, AnonymousCheckoutParams, AuthenticatedCheckoutParams, CheckoutSessionResult, AuthenticatedCheckoutResult, GraphQLParams, GraphQLResponse, WaffoPancakeConfig } from '@waffo/pancake-ts';
|
|
2
|
+
|
|
3
|
+
/** Parameters for the checkout server action */
|
|
4
|
+
type CheckoutActionParams = ({
|
|
5
|
+
type?: "anonymous";
|
|
6
|
+
} & AnonymousCheckoutParams) | ({
|
|
7
|
+
type: "authenticated";
|
|
8
|
+
} & AuthenticatedCheckoutParams);
|
|
9
|
+
/** Result of the checkout server action */
|
|
10
|
+
type CheckoutActionResult = CheckoutSessionResult | AuthenticatedCheckoutResult;
|
|
11
|
+
/** Server action signature for checkout */
|
|
12
|
+
type CheckoutAction = (params: CheckoutActionParams) => Promise<CheckoutActionResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Create a server action that handles checkout session creation.
|
|
15
|
+
*
|
|
16
|
+
* The private key is captured in the closure and never sent to the client.
|
|
17
|
+
*
|
|
18
|
+
* @param config - WaffoPancake client configuration (merchantId + privateKey)
|
|
19
|
+
* @returns A server action function
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* "use server";
|
|
24
|
+
* import { createCheckoutAction } from "@waffo/pancake-nextjs/server";
|
|
25
|
+
*
|
|
26
|
+
* export const checkout = createCheckoutAction({
|
|
27
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
28
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare function createCheckoutAction(config: WaffoPancakeConfig): CheckoutAction;
|
|
33
|
+
/** Server action signature for issuing buyer tokens */
|
|
34
|
+
type BuyerTokenAction = (params: IssueSessionTokenParams) => Promise<SessionToken>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a server action that issues buyer session tokens.
|
|
37
|
+
*
|
|
38
|
+
* @param config - WaffoPancake client configuration
|
|
39
|
+
* @returns A server action function
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* "use server";
|
|
44
|
+
* import { createBuyerTokenAction } from "@waffo/pancake-nextjs/server";
|
|
45
|
+
*
|
|
46
|
+
* export const issueBuyerToken = createBuyerTokenAction({
|
|
47
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
48
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare function createBuyerTokenAction(config: WaffoPancakeConfig): BuyerTokenAction;
|
|
53
|
+
/** Buyer action types */
|
|
54
|
+
type BuyerSessionActionType = "cancelSubscription" | "cancelOnetimeOrder" | "reactivateSubscription" | "createRefundTicket" | "resubmitRefundTicket" | "query";
|
|
55
|
+
/** Server action signature for buyer session operations */
|
|
56
|
+
type BuyerSessionAction = (token: string, actionType: BuyerSessionActionType, params: unknown) => Promise<unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* Create a server action that executes buyer self-service operations.
|
|
59
|
+
*
|
|
60
|
+
* @param config - WaffoPancake client configuration
|
|
61
|
+
* @returns A server action function
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* "use server";
|
|
66
|
+
* import { createBuyerSessionAction } from "@waffo/pancake-nextjs/server";
|
|
67
|
+
*
|
|
68
|
+
* export const buyerAction = createBuyerSessionAction({
|
|
69
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
70
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare function createBuyerSessionAction(config: WaffoPancakeConfig): BuyerSessionAction;
|
|
75
|
+
/** Server action signature for merchant GraphQL queries */
|
|
76
|
+
type MerchantQueryAction = (params: GraphQLParams) => Promise<GraphQLResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Create a server action that executes merchant GraphQL queries.
|
|
79
|
+
*
|
|
80
|
+
* @param config - WaffoPancake client configuration
|
|
81
|
+
* @returns A server action function
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* "use server";
|
|
86
|
+
* import { createMerchantQueryAction } from "@waffo/pancake-nextjs/server";
|
|
87
|
+
*
|
|
88
|
+
* export const merchantQuery = createMerchantQueryAction({
|
|
89
|
+
* merchantId: process.env.WAFFO_MERCHANT_ID!,
|
|
90
|
+
* privateKey: process.env.WAFFO_PRIVATE_KEY!,
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
declare function createMerchantQueryAction(config: WaffoPancakeConfig): MerchantQueryAction;
|
|
95
|
+
|
|
96
|
+
export { type BuyerSessionAction, type BuyerSessionActionType, type BuyerTokenAction, type CheckoutAction, type CheckoutActionParams, type CheckoutActionResult, type MerchantQueryAction, createBuyerSessionAction, createBuyerTokenAction, createCheckoutAction, createMerchantQueryAction };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/server.ts
|
|
2
|
+
import { WaffoPancake } from "@waffo/pancake-ts";
|
|
3
|
+
function createCheckoutAction(config) {
|
|
4
|
+
const client = new WaffoPancake(config);
|
|
5
|
+
return async (params) => {
|
|
6
|
+
if (params.type === "authenticated") {
|
|
7
|
+
const { type: type2, ...sdkParams2 } = params;
|
|
8
|
+
return client.checkout.authenticated.create(sdkParams2);
|
|
9
|
+
}
|
|
10
|
+
const { type, ...sdkParams } = params;
|
|
11
|
+
return client.checkout.anonymous.create(sdkParams);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function createBuyerTokenAction(config) {
|
|
15
|
+
const client = new WaffoPancake(config);
|
|
16
|
+
return async (params) => {
|
|
17
|
+
return client.auth.issueSessionToken(params);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function createBuyerSessionAction(config) {
|
|
21
|
+
const client = new WaffoPancake(config);
|
|
22
|
+
return async (token, actionType, params) => {
|
|
23
|
+
const buyer = client.buyer(token);
|
|
24
|
+
switch (actionType) {
|
|
25
|
+
case "cancelSubscription":
|
|
26
|
+
return buyer.cancelSubscription(params);
|
|
27
|
+
case "cancelOnetimeOrder":
|
|
28
|
+
return buyer.cancelOnetimeOrder(params);
|
|
29
|
+
case "reactivateSubscription":
|
|
30
|
+
return buyer.reactivateSubscription(params);
|
|
31
|
+
case "createRefundTicket":
|
|
32
|
+
return buyer.createRefundTicket(params);
|
|
33
|
+
case "resubmitRefundTicket":
|
|
34
|
+
return buyer.resubmitRefundTicket(params);
|
|
35
|
+
case "query":
|
|
36
|
+
return buyer.graphql.query(params);
|
|
37
|
+
default:
|
|
38
|
+
throw new Error(`Unknown buyer action: ${actionType}`);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function createMerchantQueryAction(config) {
|
|
43
|
+
const client = new WaffoPancake(config);
|
|
44
|
+
return async (params) => {
|
|
45
|
+
return client.graphql.query(params);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
createBuyerSessionAction,
|
|
50
|
+
createBuyerTokenAction,
|
|
51
|
+
createCheckoutAction,
|
|
52
|
+
createMerchantQueryAction
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server-side entry point for @waffo/pancake-nextjs.\n *\n * All functions in this module use the private key for RSA signing\n * and must only run on the server (Next.js Server Actions / Route Handlers).\n *\n * @example\n * ```ts\n * // app/lib/waffo.ts\n * \"use server\";\n * import { createCheckoutAction, createBuyerTokenAction, createMerchantQueryAction } from \"@waffo/pancake-nextjs/server\";\n *\n * const config = {\n * merchantId: process.env.WAFFO_MERCHANT_ID!,\n * privateKey: process.env.WAFFO_PRIVATE_KEY!,\n * };\n *\n * export const checkout = createCheckoutAction(config);\n * export const issueBuyerToken = createBuyerTokenAction(config);\n * export const merchantQuery = createMerchantQueryAction(config);\n * ```\n */\nimport { WaffoPancake } from \"@waffo/pancake-ts\";\n\nimport type {\n WaffoPancakeConfig,\n AnonymousCheckoutParams,\n AuthenticatedCheckoutParams,\n CheckoutSessionResult,\n AuthenticatedCheckoutResult,\n IssueSessionTokenParams,\n SessionToken,\n GraphQLParams,\n GraphQLResponse,\n} from \"@waffo/pancake-ts\";\n\n// ============================================================\n// Checkout Action\n// ============================================================\n\n/** Parameters for the checkout server action */\nexport type CheckoutActionParams =\n | ({ type?: \"anonymous\" } & AnonymousCheckoutParams)\n | ({ type: \"authenticated\" } & AuthenticatedCheckoutParams);\n\n/** Result of the checkout server action */\nexport type CheckoutActionResult = CheckoutSessionResult | AuthenticatedCheckoutResult;\n\n/** Server action signature for checkout */\nexport type CheckoutAction = (params: CheckoutActionParams) => Promise<CheckoutActionResult>;\n\n/**\n * Create a server action that handles checkout session creation.\n *\n * The private key is captured in the closure and never sent to the client.\n *\n * @param config - WaffoPancake client configuration (merchantId + privateKey)\n * @returns A server action function\n *\n * @example\n * ```ts\n * \"use server\";\n * import { createCheckoutAction } from \"@waffo/pancake-nextjs/server\";\n *\n * export const checkout = createCheckoutAction({\n * merchantId: process.env.WAFFO_MERCHANT_ID!,\n * privateKey: process.env.WAFFO_PRIVATE_KEY!,\n * });\n * ```\n */\nexport function createCheckoutAction(config: WaffoPancakeConfig): CheckoutAction {\n const client = new WaffoPancake(config);\n\n return async (params: CheckoutActionParams): Promise<CheckoutActionResult> => {\n if (params.type === \"authenticated\") {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- remove type field before passing to SDK\n const { type, ...sdkParams } = params;\n return client.checkout.authenticated.create(sdkParams);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- remove type field before passing to SDK\n const { type, ...sdkParams } = params;\n return client.checkout.anonymous.create(sdkParams);\n };\n}\n\n// ============================================================\n// Buyer Token Action\n// ============================================================\n\n/** Server action signature for issuing buyer tokens */\nexport type BuyerTokenAction = (params: IssueSessionTokenParams) => Promise<SessionToken>;\n\n/**\n * Create a server action that issues buyer session tokens.\n *\n * @param config - WaffoPancake client configuration\n * @returns A server action function\n *\n * @example\n * ```ts\n * \"use server\";\n * import { createBuyerTokenAction } from \"@waffo/pancake-nextjs/server\";\n *\n * export const issueBuyerToken = createBuyerTokenAction({\n * merchantId: process.env.WAFFO_MERCHANT_ID!,\n * privateKey: process.env.WAFFO_PRIVATE_KEY!,\n * });\n * ```\n */\nexport function createBuyerTokenAction(config: WaffoPancakeConfig): BuyerTokenAction {\n const client = new WaffoPancake(config);\n\n return async (params: IssueSessionTokenParams): Promise<SessionToken> => {\n return client.auth.issueSessionToken(params);\n };\n}\n\n// ============================================================\n// Buyer Session Action\n// ============================================================\n\n/** Buyer action types */\nexport type BuyerSessionActionType =\n | \"cancelSubscription\"\n | \"cancelOnetimeOrder\"\n | \"reactivateSubscription\"\n | \"createRefundTicket\"\n | \"resubmitRefundTicket\"\n | \"query\";\n\n/** Server action signature for buyer session operations */\nexport type BuyerSessionAction = (token: string, actionType: BuyerSessionActionType, params: unknown) => Promise<unknown>;\n\n/**\n * Create a server action that executes buyer self-service operations.\n *\n * @param config - WaffoPancake client configuration\n * @returns A server action function\n *\n * @example\n * ```ts\n * \"use server\";\n * import { createBuyerSessionAction } from \"@waffo/pancake-nextjs/server\";\n *\n * export const buyerAction = createBuyerSessionAction({\n * merchantId: process.env.WAFFO_MERCHANT_ID!,\n * privateKey: process.env.WAFFO_PRIVATE_KEY!,\n * });\n * ```\n */\nexport function createBuyerSessionAction(config: WaffoPancakeConfig): BuyerSessionAction {\n const client = new WaffoPancake(config);\n\n return async (token: string, actionType: BuyerSessionActionType, params: unknown): Promise<unknown> => {\n const buyer = client.buyer(token);\n switch (actionType) {\n case \"cancelSubscription\":\n return buyer.cancelSubscription(params as Parameters<typeof buyer.cancelSubscription>[0]);\n case \"cancelOnetimeOrder\":\n return buyer.cancelOnetimeOrder(params as Parameters<typeof buyer.cancelOnetimeOrder>[0]);\n case \"reactivateSubscription\":\n return buyer.reactivateSubscription(params as Parameters<typeof buyer.reactivateSubscription>[0]);\n case \"createRefundTicket\":\n return buyer.createRefundTicket(params as Parameters<typeof buyer.createRefundTicket>[0]);\n case \"resubmitRefundTicket\":\n return buyer.resubmitRefundTicket(params as Parameters<typeof buyer.resubmitRefundTicket>[0]);\n case \"query\":\n return buyer.graphql.query(params as GraphQLParams);\n default:\n throw new Error(`Unknown buyer action: ${actionType}`);\n }\n };\n}\n\n// ============================================================\n// Merchant Query Action\n// ============================================================\n\n/** Server action signature for merchant GraphQL queries */\nexport type MerchantQueryAction = (params: GraphQLParams) => Promise<GraphQLResponse>;\n\n/**\n * Create a server action that executes merchant GraphQL queries.\n *\n * @param config - WaffoPancake client configuration\n * @returns A server action function\n *\n * @example\n * ```ts\n * \"use server\";\n * import { createMerchantQueryAction } from \"@waffo/pancake-nextjs/server\";\n *\n * export const merchantQuery = createMerchantQueryAction({\n * merchantId: process.env.WAFFO_MERCHANT_ID!,\n * privateKey: process.env.WAFFO_PRIVATE_KEY!,\n * });\n * ```\n */\nexport function createMerchantQueryAction(config: WaffoPancakeConfig): MerchantQueryAction {\n const client = new WaffoPancake(config);\n\n return async (params: GraphQLParams): Promise<GraphQLResponse> => {\n return client.graphql.query(params);\n };\n}\n"],"mappings":";AAsBA,SAAS,oBAAoB;AAgDtB,SAAS,qBAAqB,QAA4C;AAC/E,QAAM,SAAS,IAAI,aAAa,MAAM;AAEtC,SAAO,OAAO,WAAgE;AAC5E,QAAI,OAAO,SAAS,iBAAiB;AAEnC,YAAM,EAAE,MAAAA,OAAM,GAAGC,WAAU,IAAI;AAC/B,aAAO,OAAO,SAAS,cAAc,OAAOA,UAAS;AAAA,IACvD;AAEA,UAAM,EAAE,MAAM,GAAG,UAAU,IAAI;AAC/B,WAAO,OAAO,SAAS,UAAU,OAAO,SAAS;AAAA,EACnD;AACF;AA0BO,SAAS,uBAAuB,QAA8C;AACnF,QAAM,SAAS,IAAI,aAAa,MAAM;AAEtC,SAAO,OAAO,WAA2D;AACvE,WAAO,OAAO,KAAK,kBAAkB,MAAM;AAAA,EAC7C;AACF;AAmCO,SAAS,yBAAyB,QAAgD;AACvF,QAAM,SAAS,IAAI,aAAa,MAAM;AAEtC,SAAO,OAAO,OAAe,YAAoC,WAAsC;AACrG,UAAM,QAAQ,OAAO,MAAM,KAAK;AAChC,YAAQ,YAAY;AAAA,MAClB,KAAK;AACH,eAAO,MAAM,mBAAmB,MAAwD;AAAA,MAC1F,KAAK;AACH,eAAO,MAAM,mBAAmB,MAAwD;AAAA,MAC1F,KAAK;AACH,eAAO,MAAM,uBAAuB,MAA4D;AAAA,MAClG,KAAK;AACH,eAAO,MAAM,mBAAmB,MAAwD;AAAA,MAC1F,KAAK;AACH,eAAO,MAAM,qBAAqB,MAA0D;AAAA,MAC9F,KAAK;AACH,eAAO,MAAM,QAAQ,MAAM,MAAuB;AAAA,MACpD;AACE,cAAM,IAAI,MAAM,yBAAyB,UAAU,EAAE;AAAA,IACzD;AAAA,EACF;AACF;AA0BO,SAAS,0BAA0B,QAAiD;AACzF,QAAM,SAAS,IAAI,aAAa,MAAM;AAEtC,SAAO,OAAO,WAAoD;AAChE,WAAO,OAAO,QAAQ,MAAM,MAAM;AAAA,EACpC;AACF;","names":["type","sdkParams"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@waffo/pancake-nextjs",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Next.js SDK for Waffo Pancake — checkout components and hooks",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./server": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/server.d.ts",
|
|
23
|
+
"default": "./dist/server.js"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/server.d.cts",
|
|
27
|
+
"default": "./dist/server.cjs"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"CHANGELOG.md"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup",
|
|
37
|
+
"dev": "tsup --watch",
|
|
38
|
+
"lint": "eslint",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest",
|
|
41
|
+
"test:coverage": "vitest run --coverage",
|
|
42
|
+
"prepare": "husky",
|
|
43
|
+
"prepublishOnly": "npm run lint && npm run test && npm run build"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@waffo/pancake-ts": "^0.3.2",
|
|
47
|
+
"next": ">=14.0.0",
|
|
48
|
+
"react": ">=18.0.0",
|
|
49
|
+
"react-dom": ">=18.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@commitlint/cli": "^20.5.0",
|
|
53
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
54
|
+
"@testing-library/react": "^16.3.0",
|
|
55
|
+
"@types/node": "^20.19.39",
|
|
56
|
+
"@types/react": "^18.2.0",
|
|
57
|
+
"@types/react-dom": "^18.2.0",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
59
|
+
"@typescript-eslint/parser": "^8.20.0",
|
|
60
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
61
|
+
"eslint": "^9",
|
|
62
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
63
|
+
"eslint-plugin-import": "^2.32.0",
|
|
64
|
+
"eslint-plugin-jsdoc": "^62.9.0",
|
|
65
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
66
|
+
"husky": "^9.1.7",
|
|
67
|
+
"jsdom": "^26.1.0",
|
|
68
|
+
"lint-staged": "^16.4.0",
|
|
69
|
+
"prettier": "^3.8.1",
|
|
70
|
+
"react": "^18.2.0",
|
|
71
|
+
"react-dom": "^18.2.0",
|
|
72
|
+
"tsup": "^8.5.1",
|
|
73
|
+
"typescript": "^5.4.0",
|
|
74
|
+
"typescript-eslint": "^8.20.0",
|
|
75
|
+
"vitest": "^4.0.16"
|
|
76
|
+
},
|
|
77
|
+
"lint-staged": {
|
|
78
|
+
"*.{ts,tsx}": [
|
|
79
|
+
"eslint --fix",
|
|
80
|
+
"prettier --write"
|
|
81
|
+
],
|
|
82
|
+
"*.{json,md,css}": "prettier --write"
|
|
83
|
+
},
|
|
84
|
+
"engines": {
|
|
85
|
+
"node": ">=20.0.0"
|
|
86
|
+
},
|
|
87
|
+
"license": "MIT",
|
|
88
|
+
"repository": {
|
|
89
|
+
"type": "git",
|
|
90
|
+
"url": "https://github.com/waffo-com/waffo-pancake-sdk-nextjs.git"
|
|
91
|
+
},
|
|
92
|
+
"bugs": {
|
|
93
|
+
"url": "https://github.com/waffo-com/waffo-pancake-sdk-nextjs/issues"
|
|
94
|
+
},
|
|
95
|
+
"homepage": "https://github.com/waffo-com/waffo-pancake-sdk-nextjs#readme"
|
|
96
|
+
}
|