@campfirecommerce/store-client 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/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # @campfirecommerce/store-client
2
+
3
+ Typed TypeScript client for the [Campfire Commerce](https://campfirecommerce.com) storefront API. Browse a store's public catalog, manage checkouts, and initiate Stripe payments — from the browser or the server.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i @campfirecommerce/store-client
9
+ ```
10
+
11
+ ## Quickstart
12
+
13
+ ```ts
14
+ import { StoreClient } from '@campfirecommerce/store-client';
15
+
16
+ // In a browser on a registered store domain, no key is needed —
17
+ // the API resolves the store from the request Origin.
18
+ const client = new StoreClient();
19
+
20
+ // Server-side (or local dev), pass a storefront API key instead:
21
+ const server = new StoreClient({
22
+ baseUrl: 'https://api.campfirecommerce.com/api/store',
23
+ storeKey: process.env.STORE_KEY,
24
+ });
25
+
26
+ const { store } = await client.getStore();
27
+ const { products } = await client.listProducts({ query: 'mug', page: 1 });
28
+ ```
29
+
30
+ ## Methods
31
+
32
+ - `getStore()` — public store info (name, currency, settings/branding, Stripe publishable key)
33
+ - `listProducts(params?)` — active catalog; supports `query`, `tag`, `page`, `per_page`
34
+ - `getProduct(slug)` — a single product with variants and live availability
35
+ - `createCheckout(input)` — create a cart (reserves stock)
36
+ - `getCheckout(token)` — fetch/poll a checkout
37
+ - `updateCheckout(token, input)` — update line items, email, or shipping address
38
+ - `payCheckout(token)` — reprice server-side and get a Stripe PaymentIntent `client_secret`
39
+
40
+ Errors are thrown as `StoreApiError` (`status` + message). All request/response types are exported.
41
+
42
+ ## Learn more
43
+
44
+ See [campfirecommerce.com](https://campfirecommerce.com).
@@ -0,0 +1,40 @@
1
+ import type { CheckoutInput, CheckoutResponse, PayResponse, ProductListParams, ProductListResponse, ProductResponse, StoreResponse } from './types';
2
+ export interface StoreClientOptions {
3
+ /** API base URL. Defaults to '/api/store' (the gateway prefix). */
4
+ baseUrl?: string;
5
+ /**
6
+ * Storefront API key, sent as X-Store-Key. Needed for server-side callers
7
+ * and local dev; browsers on a registered store domain can omit it — the
8
+ * backend resolves the store from the Origin header.
9
+ */
10
+ storeKey?: string;
11
+ }
12
+ export declare class StoreApiError extends Error {
13
+ status: number;
14
+ constructor(status: number, message: string);
15
+ }
16
+ /** Typed client for the public Campfire Store Storefront API. */
17
+ export declare class StoreClient {
18
+ private baseUrl;
19
+ private storeKey;
20
+ constructor(options?: StoreClientOptions);
21
+ private request;
22
+ /** GET /storefront/store — public store info + Stripe publishable key. */
23
+ getStore(): Promise<StoreResponse>;
24
+ /** GET /storefront/products — active catalog, searchable and paginated. */
25
+ listProducts(params?: ProductListParams): Promise<ProductListResponse>;
26
+ /** GET /storefront/products/:slug */
27
+ getProduct(slug: string): Promise<ProductResponse>;
28
+ /** POST /storefront/checkouts — create a cart (reserves stock). */
29
+ createCheckout(input: CheckoutInput): Promise<CheckoutResponse>;
30
+ /** GET /storefront/checkouts/:token — fetch/poll a checkout. */
31
+ getCheckout(token: string): Promise<CheckoutResponse>;
32
+ /** PUT /storefront/checkouts/:token — update lines, email, or address. */
33
+ updateCheckout(token: string, input: CheckoutInput): Promise<CheckoutResponse>;
34
+ /**
35
+ * POST /storefront/checkouts/:token/pay — reprices the cart server-side and
36
+ * returns a Stripe PaymentIntent client_secret for the Payment Element.
37
+ */
38
+ payCheckout(token: string): Promise<PayResponse>;
39
+ }
40
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,aAAa,EACd,MAAM,SAAS,CAAC;AAIjB,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,aAAc,SAAQ,KAAK;IAE7B,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKlB;AAMD,iEAAiE;AACjE,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAqB;gBAEzB,OAAO,GAAE,kBAAuB;YAK9B,OAAO;IAyBrB,0EAA0E;IAC1E,QAAQ,IAAI,OAAO,CAAC,aAAa,CAAC;IAIlC,2EAA2E;IAC3E,YAAY,CAAC,MAAM,GAAE,iBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAU1E,qCAAqC;IACrC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIlD,mEAAmE;IACnE,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAO/D,gEAAgE;IAChE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMrD,0EAA0E;IAC1E,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAO9E;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;CAMjD"}
package/dist/client.js ADDED
@@ -0,0 +1,80 @@
1
+ const DEFAULT_BASE_URL = '/api/store';
2
+ export class StoreApiError extends Error {
3
+ constructor(status, message) {
4
+ super(message);
5
+ this.status = status;
6
+ this.name = 'StoreApiError';
7
+ }
8
+ }
9
+ /** Typed client for the public Campfire Store Storefront API. */
10
+ export class StoreClient {
11
+ constructor(options = {}) {
12
+ this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
13
+ this.storeKey = options.storeKey;
14
+ }
15
+ async request(path, options = {}) {
16
+ const { body, headers: customHeaders, ...rest } = options;
17
+ const headers = {
18
+ 'Content-Type': 'application/json',
19
+ ...customHeaders,
20
+ };
21
+ if (this.storeKey) {
22
+ headers['X-Store-Key'] = this.storeKey;
23
+ }
24
+ const response = await fetch(`${this.baseUrl}${path}`, {
25
+ ...rest,
26
+ headers,
27
+ body: body ? JSON.stringify(body) : undefined,
28
+ });
29
+ if (!response.ok) {
30
+ const error = await response.json().catch(() => ({ error: response.statusText }));
31
+ throw new StoreApiError(response.status, error.error || response.statusText);
32
+ }
33
+ return response.json();
34
+ }
35
+ /** GET /storefront/store — public store info + Stripe publishable key. */
36
+ getStore() {
37
+ return this.request('/storefront/store');
38
+ }
39
+ /** GET /storefront/products — active catalog, searchable and paginated. */
40
+ listProducts(params = {}) {
41
+ const search = new URLSearchParams();
42
+ if (params.query)
43
+ search.set('query', params.query);
44
+ if (params.tag)
45
+ search.set('tag', params.tag);
46
+ if (params.page)
47
+ search.set('page', String(params.page));
48
+ if (params.per_page)
49
+ search.set('per_page', String(params.per_page));
50
+ const qs = search.toString();
51
+ return this.request(`/storefront/products${qs ? `?${qs}` : ''}`);
52
+ }
53
+ /** GET /storefront/products/:slug */
54
+ getProduct(slug) {
55
+ return this.request(`/storefront/products/${encodeURIComponent(slug)}`);
56
+ }
57
+ /** POST /storefront/checkouts — create a cart (reserves stock). */
58
+ createCheckout(input) {
59
+ return this.request('/storefront/checkouts', {
60
+ method: 'POST',
61
+ body: input,
62
+ });
63
+ }
64
+ /** GET /storefront/checkouts/:token — fetch/poll a checkout. */
65
+ getCheckout(token) {
66
+ return this.request(`/storefront/checkouts/${encodeURIComponent(token)}`);
67
+ }
68
+ /** PUT /storefront/checkouts/:token — update lines, email, or address. */
69
+ updateCheckout(token, input) {
70
+ return this.request(`/storefront/checkouts/${encodeURIComponent(token)}`, { method: 'PUT', body: input });
71
+ }
72
+ /**
73
+ * POST /storefront/checkouts/:token/pay — reprices the cart server-side and
74
+ * returns a Stripe PaymentIntent client_secret for the Payment Element.
75
+ */
76
+ payCheckout(token) {
77
+ return this.request(`/storefront/checkouts/${encodeURIComponent(token)}/pay`, { method: 'POST' });
78
+ }
79
+ }
80
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAUA,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAatC,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YACS,MAAc,EACrB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,WAAM,GAAN,MAAM,CAAQ;QAIrB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAMD,iEAAiE;AACjE,MAAM,OAAO,WAAW;IAItB,YAAY,UAA8B,EAAE;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,gBAAgB,CAAC;QACnD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnC,CAAC;IAEO,KAAK,CAAC,OAAO,CAAI,IAAY,EAAE,UAA0B,EAAE;QACjE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;QAE1D,MAAM,OAAO,GAA2B;YACtC,cAAc,EAAE,kBAAkB;YAClC,GAAI,aAAwC;SAC7C,CAAC;QACF,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QACzC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,EAAE;YACrD,GAAG,IAAI;YACP,OAAO;YACP,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;SAC9C,CAAC,CAAC;QAEH,IAAI,CA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AU,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,OAAO,CAAkB,wBAAwB,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,mEAAmE;IACnE,cAAc,CAAC,KAAoB;QACjC,OAAO,IAAI,CAAC,OAAO,CAAmB,uBAAuB,EAAE;YAC7D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;IAED,gEAAgE;IAChE,WAAW,CAAC,KAAa;QACvB,OAAO,IAAI,CAAC,OAAO,CACjB,yBAAyB,kBAAkB,CAAC,KAAK,CAAC,EAAE,CACrD,CAAC;IACJ,CAAC;IAED,0EAA0E;IAC1E,cAAc,CAAC,KAAa,EAAE,KAAoB;QAChD,OAAO,IAAI,CAAC,OAAO,CACjB,yBAAyB,kBAAkB,CAAC,KAAK,CAAC,EAAE,EACpD,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAC/B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,WAAW,CAAC,KAAa;QACvB,OAAO,IAAI,CAAC,OAAO,CACjB,yBAAyB,kBAAkB,CAAC,KAAK,CAAC,MAAM,EACxD,EAAE,MAAM,EAAE,MAAM,EAAE,CACnB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { StoreClient, StoreApiError } from './client';
2
+ export type { StoreClientOptions } from './client';
3
+ export type { StoreSettings, StorefrontStore, StoreResponse, StorefrontVariant, StorefrontProduct, ProductListParams, ProductListResponse, ProductResponse, CheckoutStatus, LineItem, Address, Checkout, CheckoutLineInput, CheckoutInput, CheckoutResponse, PayResponse, } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,YAAY,EACV,aAAa,EACb,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,WAAW,GACZ,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { StoreClient, StoreApiError } from './client';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,126 @@
1
+ /** Per-store checkout configuration (phase-1 pricing) plus storefront branding. */
2
+ export interface StoreSettings {
3
+ flat_shipping_cents: number;
4
+ free_shipping_min_cents: number;
5
+ tax_rate_bps: number;
6
+ /** Store logo image URL, if configured. */
7
+ logo_url?: string;
8
+ /** Brand primary color as hex, e.g. "#c2410c". */
9
+ primary_color?: string;
10
+ /** Short "about the store" blurb for the storefront footer. */
11
+ about?: string;
12
+ /** Customer support email address. */
13
+ support_email?: string;
14
+ }
15
+ /** Public store info from GET /storefront/store. */
16
+ export interface StorefrontStore {
17
+ name: string;
18
+ slug: string;
19
+ currency: string;
20
+ settings: StoreSettings;
21
+ /** Stripe publishable key for the Payment Element. */
22
+ stripe_publishable_key: string;
23
+ }
24
+ export interface StoreResponse {
25
+ store: StorefrontStore;
26
+ }
27
+ /** Public variant shape: price + live availability. */
28
+ export interface StorefrontVariant {
29
+ id: number;
30
+ title: string;
31
+ sku: string;
32
+ price_cents: number;
33
+ compare_at_cents: number;
34
+ requires_shipping: boolean;
35
+ /** Sellable stock (available - reserved), floored at 0. */
36
+ available: number;
37
+ }
38
+ /** Public product shape from the storefront catalog. */
39
+ export interface StorefrontProduct {
40
+ id: number;
41
+ title: string;
42
+ slug: string;
43
+ description: string;
44
+ images: string[] | null;
45
+ tags: string[] | null;
46
+ variants: StorefrontVariant[];
47
+ }
48
+ export interface ProductListParams {
49
+ query?: string;
50
+ tag?: string;
51
+ page?: number;
52
+ per_page?: number;
53
+ }
54
+ export interface ProductListResponse {
55
+ products: StorefrontProduct[];
56
+ total: number;
57
+ page: number;
58
+ per_page: number;
59
+ total_pages: number;
60
+ }
61
+ export interface ProductResponse {
62
+ product: StorefrontProduct;
63
+ }
64
+ export type CheckoutStatus = 'open' | 'completed' | 'expired';
65
+ /** A checkout/order line, snapshotted at pricing time. */
66
+ export interface LineItem {
67
+ variant_id: number;
68
+ product_id: number;
69
+ title: string;
70
+ variant_title: string;
71
+ sku: string;
72
+ quantity: number;
73
+ price_cents: number;
74
+ requires_shipping: boolean;
75
+ }
76
+ /** Shipping destination. */
77
+ export interface Address {
78
+ name: string;
79
+ line1: string;
80
+ line2: string;
81
+ city: string;
82
+ region: string;
83
+ postal_code: string;
84
+ country: string;
85
+ }
86
+ /**
87
+ * A checkout (cart working toward payment). Capitalized fields come from
88
+ * gorm.Model, which serializes without JSON tags.
89
+ */
90
+ export interface Checkout {
91
+ ID: number;
92
+ CreatedAt: string;
93
+ UpdatedAt: string;
94
+ store_id: number;
95
+ token: string;
96
+ status: CheckoutStatus;
97
+ line_items: LineItem[];
98
+ email: string;
99
+ shipping_address: Address;
100
+ subtotal_cents: number;
101
+ tax_cents: number;
102
+ shipping_cents: number;
103
+ total_cents: number;
104
+ expires_at: string;
105
+ }
106
+ export interface CheckoutLineInput {
107
+ variant_id: number;
108
+ quantity: number;
109
+ }
110
+ /** Body for POST /storefront/checkouts and PUT /storefront/checkouts/:token. */
111
+ export interface CheckoutInput {
112
+ /** Omit on PUT to leave lines unchanged; required on create. */
113
+ line_items?: CheckoutLineInput[];
114
+ email?: string;
115
+ shipping_address?: Address;
116
+ }
117
+ export interface CheckoutResponse {
118
+ checkout: Checkout;
119
+ }
120
+ /** Response from POST /storefront/checkouts/:token/pay. */
121
+ export interface PayResponse {
122
+ checkout: Checkout;
123
+ /** Stripe PaymentIntent client secret for the Payment Element. */
124
+ client_secret: string;
125
+ }
126
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IAErB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,sDAAsD;IACtD,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,M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M,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;CACvB"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ // Types for the Campfire Store Storefront API (services/store, public
2
+ // routes under /storefront). Shapes mirror the JSON emitted by
3
+ // services/store/storefront.go, checkout.go, and models/models.go.
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+DAA+D;AAC/D,mEAAmE"}
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@campfirecommerce/store-client",
3
+ "version": "0.1.0",
4
+ "description": "Typed TypeScript client for the Campfire Store storefront API: catalog browsing, checkout lifecycle, and Stripe payment initiation.",
5
+ "license": "MIT",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "clean": "rimraf dist"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "~5.6.0",
20
+ "rimraf": "~5.0.0"
21
+ }
22
+ }