feeef 0.11.3 → 0.12.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 +11 -0
- package/build/index.js +59 -3
- package/build/index.js.map +1 -1
- package/build/src/core/entities/store.d.ts +6 -1
- package/build/src/core/entities/store_template.d.ts +22 -0
- package/build/src/feeef/repositories/oauth.d.ts +3 -1
- package/build/src/feeef/repositories/orders.d.ts +8 -1
- package/build/src/feeef/repositories/store_templates.d.ts +11 -1
- package/build/src/feeef/repositories/stores.d.ts +25 -0
- package/package.json +6 -1
|
@@ -273,6 +273,11 @@ export interface InventoryIntegration {
|
|
|
273
273
|
* @default ignore
|
|
274
274
|
*/
|
|
275
275
|
missing_bucket_policy?: MissingInventoryBucketPolicy;
|
|
276
|
+
/**
|
|
277
|
+
* When true, reservation may exceed on-hand quantity so availability can go negative.
|
|
278
|
+
* @default true
|
|
279
|
+
*/
|
|
280
|
+
allow_backorder?: boolean;
|
|
276
281
|
}
|
|
277
282
|
export type FinancePdfPaperSize = 'a4' | 'letter' | 'a5' | 'legal';
|
|
278
283
|
/** Layout and content options for finance PDF documents. */
|
|
@@ -774,7 +779,7 @@ export type ConnectorAuth = {
|
|
|
774
779
|
authType: 'public';
|
|
775
780
|
baseUrl?: string;
|
|
776
781
|
};
|
|
777
|
-
export type ConnectorType = 'shopify' | 'youcan' | 'google_sheets';
|
|
782
|
+
export type ConnectorType = 'shopify' | 'youcan' | 'google_sheets' | 'facebook_leads';
|
|
778
783
|
export type ConnectorStatus = 'connected' | 'reauth_needed' | 'uninstalled' | 'error';
|
|
779
784
|
export interface ConnectorFieldMapping {
|
|
780
785
|
order?: Record<string, string>;
|
|
@@ -66,3 +66,25 @@ export interface StoreTemplateUpdateInput {
|
|
|
66
66
|
data?: Record<string, unknown>;
|
|
67
67
|
policy?: TemplateComponentPolicy;
|
|
68
68
|
}
|
|
69
|
+
/** One row in `store_template_locales`. */
|
|
70
|
+
export interface StoreTemplateLocaleEntity {
|
|
71
|
+
id: string;
|
|
72
|
+
storeTemplateId: string;
|
|
73
|
+
locale: string;
|
|
74
|
+
messages: Record<string, unknown>;
|
|
75
|
+
isDefault: boolean;
|
|
76
|
+
createdAt?: unknown;
|
|
77
|
+
updatedAt?: unknown | null;
|
|
78
|
+
}
|
|
79
|
+
export interface StoreTemplateLocaleInput {
|
|
80
|
+
locale: string;
|
|
81
|
+
messages: Record<string, unknown>;
|
|
82
|
+
isDefault?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** Storefront-friendly i18n bundle from GET/PUT locales. */
|
|
85
|
+
export interface StoreTemplateLocalesBundle {
|
|
86
|
+
defaultLocale: string;
|
|
87
|
+
locales: string[];
|
|
88
|
+
messages: Record<string, Record<string, unknown>>;
|
|
89
|
+
rows?: StoreTemplateLocaleEntity[];
|
|
90
|
+
}
|
|
@@ -39,12 +39,13 @@ export interface OAuthAuthorizeUrlParams {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Parameters for exchanging authorization code to access token.
|
|
42
|
+
* `clientSecret` is omitted for public PKCE clients (`token_endpoint_auth_method: none`).
|
|
42
43
|
*/
|
|
43
44
|
export interface OAuthExchangeCodeParams {
|
|
44
45
|
code: string;
|
|
45
46
|
redirectUri: string;
|
|
46
47
|
clientId: string;
|
|
47
|
-
clientSecret
|
|
48
|
+
clientSecret?: string;
|
|
48
49
|
codeVerifier?: string;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
@@ -64,6 +65,7 @@ export declare class OAuthRepository {
|
|
|
64
65
|
static buildAuthorizeUrl(params: OAuthAuthorizeUrlParams): string;
|
|
65
66
|
/**
|
|
66
67
|
* Exchanges an authorization code for an access token.
|
|
68
|
+
* Public clients omit `clientSecret` and must send `codeVerifier` (PKCE).
|
|
67
69
|
*/
|
|
68
70
|
exchangeAuthorizationCode(params: OAuthExchangeCodeParams): Promise<OAuthTokenResponse>;
|
|
69
71
|
/**
|
|
@@ -70,6 +70,7 @@ export interface AssignManyOrdersSchema {
|
|
|
70
70
|
* Delivery service filter enum
|
|
71
71
|
*/
|
|
72
72
|
export declare enum DeliveryServiceFilter {
|
|
73
|
+
none = "none",
|
|
73
74
|
yalidine = "yalidine",
|
|
74
75
|
ecotrack = "ecotrack",
|
|
75
76
|
procolis = "procolis",
|
|
@@ -78,6 +79,8 @@ export declare enum DeliveryServiceFilter {
|
|
|
78
79
|
maystro = "maystro",
|
|
79
80
|
ecomanager = "ecomanager"
|
|
80
81
|
}
|
|
82
|
+
/** Reserved token for “any non-empty” variant/offer presence filters. */
|
|
83
|
+
export declare const ORDER_FILTER_ANY: "$$any";
|
|
81
84
|
/**
|
|
82
85
|
* Options for listing orders
|
|
83
86
|
*/
|
|
@@ -102,7 +105,11 @@ export interface OrderListOptions {
|
|
|
102
105
|
products?: string[];
|
|
103
106
|
shippingState?: string;
|
|
104
107
|
shippingCity?: string;
|
|
105
|
-
deliveryService?: DeliveryServiceFilter;
|
|
108
|
+
deliveryService?: DeliveryServiceFilter | string;
|
|
109
|
+
/** Presence (`ORDER_FILTER_ANY`) or a specific variant path. */
|
|
110
|
+
variant?: string;
|
|
111
|
+
/** Presence (`ORDER_FILTER_ANY`) or a specific offer code. */
|
|
112
|
+
offer?: string;
|
|
106
113
|
/** Filter orders whose `references` jsonb contains this token (repeat param or comma-separated). */
|
|
107
114
|
references?: string | string[];
|
|
108
115
|
params?: Record<string, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import { ListResponse, ModelRepository } from './repository.js';
|
|
3
|
-
import { StoreTemplateEntity, StoreTemplateCreateInput, StoreTemplateUpdateInput } from '../../core/entities/store_template.js';
|
|
3
|
+
import { StoreTemplateEntity, StoreTemplateCreateInput, StoreTemplateUpdateInput, StoreTemplateLocaleEntity, StoreTemplateLocaleInput, StoreTemplateLocalesBundle } from '../../core/entities/store_template.js';
|
|
4
4
|
import { TemplateComponentPolicy } from '../../core/entities/template_component.js';
|
|
5
5
|
export interface StoreTemplateListOptions {
|
|
6
6
|
page?: number;
|
|
@@ -37,4 +37,14 @@ export declare class StoreTemplatesRepository extends ModelRepository<StoreTempl
|
|
|
37
37
|
storeTemplate: StoreTemplateEntity;
|
|
38
38
|
store: Record<string, unknown>;
|
|
39
39
|
}>;
|
|
40
|
+
/** GET locales bundle (`defaultLocale`, `locales`, `messages`). */
|
|
41
|
+
listLocales(templateId: string): Promise<StoreTemplateLocalesBundle>;
|
|
42
|
+
/** Create one locale row. */
|
|
43
|
+
createLocale(templateId: string, input: StoreTemplateLocaleInput): Promise<StoreTemplateLocaleEntity>;
|
|
44
|
+
/** Update one locale by language code. */
|
|
45
|
+
updateLocale(templateId: string, locale: string, input: Partial<Pick<StoreTemplateLocaleInput, 'messages' | 'isDefault'>>): Promise<StoreTemplateLocaleEntity>;
|
|
46
|
+
/** Delete one locale by language code. */
|
|
47
|
+
deleteLocale(templateId: string, locale: string): Promise<void>;
|
|
48
|
+
/** Replace the full locale set (CLI publish). */
|
|
49
|
+
replaceLocales(templateId: string, locales: StoreTemplateLocaleInput[]): Promise<StoreTemplateLocalesBundle>;
|
|
40
50
|
}
|
|
@@ -113,4 +113,29 @@ export declare class StoreRepository extends ModelRepository<StoreEntity, StoreC
|
|
|
113
113
|
* @returns A Promise that resolves to the payment result.
|
|
114
114
|
*/
|
|
115
115
|
payDue(storeId: string, amount: number): Promise<PayDueResult>;
|
|
116
|
+
/**
|
|
117
|
+
* Upserts a draft theme preview (does not change live `metadata.templateData`).
|
|
118
|
+
*/
|
|
119
|
+
putTemplatePreview(storeId: string, body: {
|
|
120
|
+
data: unknown;
|
|
121
|
+
schema?: unknown;
|
|
122
|
+
}): Promise<{
|
|
123
|
+
previewUrl: string;
|
|
124
|
+
previewToken: string;
|
|
125
|
+
expiresAt: string;
|
|
126
|
+
}>;
|
|
127
|
+
/**
|
|
128
|
+
* Clears the draft theme preview for a store.
|
|
129
|
+
*/
|
|
130
|
+
clearTemplatePreview(storeId: string): Promise<{
|
|
131
|
+
cleared: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* Fetches draft TemplateData with a signed preview token (public, token-gated).
|
|
135
|
+
*/
|
|
136
|
+
getTemplatePreview(storeId: string, token: string): Promise<{
|
|
137
|
+
data: unknown;
|
|
138
|
+
schema?: unknown;
|
|
139
|
+
updatedAt?: string | null;
|
|
140
|
+
}>;
|
|
116
141
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feeef",
|
|
3
3
|
"description": "feeef sdk for javascript",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.1",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
|
|
22
22
|
"build": "npm run compile",
|
|
23
23
|
"release": "npx release-it",
|
|
24
|
+
"publish:npm": "bash ./scripts/publish.sh",
|
|
24
25
|
"version": "npm run build",
|
|
25
26
|
"prepublishOnly": "npm run build",
|
|
26
27
|
"lint": "eslint . --ext=.ts",
|
|
@@ -96,6 +97,10 @@
|
|
|
96
97
|
"release": true,
|
|
97
98
|
"releaseName": "v${version}",
|
|
98
99
|
"web": true
|
|
100
|
+
},
|
|
101
|
+
"npm": {
|
|
102
|
+
"publish": true,
|
|
103
|
+
"skipChecks": false
|
|
99
104
|
}
|
|
100
105
|
},
|
|
101
106
|
"c8": {
|