@amboras-dev/aliexpress-dropshipping 1.1.0 → 1.2.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 +7 -3
- package/dist/admin/index.d.mts +50 -0
- package/dist/admin/index.d.ts +50 -0
- package/dist/admin/index.js +253 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/index.mjs +7 -0
- package/dist/admin/index.mjs.map +1 -0
- package/dist/chunk-65TJ4JF6.mjs +224 -0
- package/dist/chunk-65TJ4JF6.mjs.map +1 -0
- package/dist/chunk-PK4PMTFZ.mjs +47 -0
- package/dist/chunk-PK4PMTFZ.mjs.map +1 -0
- package/dist/client/index.d.mts +30 -0
- package/dist/client/index.d.ts +30 -0
- package/dist/client/index.js +74 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/index.mjs +9 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/index.d.mts +4 -171
- package/dist/index.d.ts +4 -171
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -222
- package/dist/index.mjs.map +1 -1
- package/dist/types-CLTkhq_u.d.mts +151 -0
- package/dist/types-CLTkhq_u.d.ts +151 -0
- package/package.json +12 -3
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types for @amboras-dev/aliexpress-dropshipping.
|
|
3
|
+
*
|
|
4
|
+
* These are the single source of truth for the wire shape between the
|
|
5
|
+
* Amboras admin settings form and the medusa-backend-orchestrator
|
|
6
|
+
* Store API routes under `/store/aliexpress-dropshipping/*`. The DTO
|
|
7
|
+
* files on the medusa side must stay byte-compatible with these.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Sentinel returned in place of a stored secret when the settings form
|
|
11
|
+
* reads back current config. Matches the pattern used by meta-ads and
|
|
12
|
+
* pinterest so the admin never sees the plaintext secret after write.
|
|
13
|
+
*/
|
|
14
|
+
declare const SECRET_SET_SENTINEL: "__SECRET_SET__";
|
|
15
|
+
type SecretSetSentinel = typeof SECRET_SET_SENTINEL;
|
|
16
|
+
/**
|
|
17
|
+
* Per-store AliExpress plugin configuration.
|
|
18
|
+
*
|
|
19
|
+
* - `appKey` / `appSecret` are per-store developer app credentials
|
|
20
|
+
* supplied by the merchant. The admin form receives
|
|
21
|
+
* `SECRET_SET_SENTINEL` for `appSecret` on read, and only sends a
|
|
22
|
+
* real value on user edit.
|
|
23
|
+
* - `connectedSellerId` is populated after the merchant completes the
|
|
24
|
+
* OAuth flow to `/rest/auth/token/create`.
|
|
25
|
+
* - `needsReauth` is flipped by the backend runtime detector when it
|
|
26
|
+
* sees `MissingParameter access_token` or `IllegalAccessToken`
|
|
27
|
+
* sub-codes on any envelope.
|
|
28
|
+
* - `lastSuccessfulCallAt` is an ISO-8601 timestamp for the status card.
|
|
29
|
+
*/
|
|
30
|
+
interface AliExpressPluginConfig {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
appKey: string | null;
|
|
33
|
+
appSecret: string | SecretSetSentinel | null;
|
|
34
|
+
connectedSellerId: string | null;
|
|
35
|
+
needsReauth: boolean;
|
|
36
|
+
lastSuccessfulCallAt: string | null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Reasons the backend surfaces when a merchant token becomes invalid.
|
|
40
|
+
* Kept narrow so the admin banner can render a specific message.
|
|
41
|
+
*/
|
|
42
|
+
declare enum AliExpressReauthReason {
|
|
43
|
+
MissingAccessToken = "missing_access_token",
|
|
44
|
+
IllegalAccessToken = "illegal_access_token",
|
|
45
|
+
RefreshFailed = "refresh_failed",
|
|
46
|
+
Disconnected = "disconnected"
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Category node returned by `aliexpress.ds.category.get`. The API
|
|
50
|
+
* returns a flat list; the admin renders it as a tree by walking
|
|
51
|
+
* `parentCategoryId`.
|
|
52
|
+
*/
|
|
53
|
+
interface AliExpressCategoryDto {
|
|
54
|
+
categoryId: string;
|
|
55
|
+
categoryName: string;
|
|
56
|
+
parentCategoryId: string | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Product summary shape returned by `aliexpress.ds.recommend.feed.get`.
|
|
60
|
+
* Used by the "browse products" admin surface.
|
|
61
|
+
*/
|
|
62
|
+
interface AliExpressProductSummaryDto {
|
|
63
|
+
productId: string;
|
|
64
|
+
title: string;
|
|
65
|
+
imageUrl: string | null;
|
|
66
|
+
minPrice: number | null;
|
|
67
|
+
maxPrice: number | null;
|
|
68
|
+
currency: string | null;
|
|
69
|
+
productDetailUrl: string | null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Full product shape returned by `aliexpress.ds.product.get`. Consumed
|
|
73
|
+
* by the medusa-side mapper `aliexpressProductToMedusaDraft`.
|
|
74
|
+
*/
|
|
75
|
+
interface AliExpressProductDto {
|
|
76
|
+
productId: string;
|
|
77
|
+
title: string;
|
|
78
|
+
description: string | null;
|
|
79
|
+
images: string[];
|
|
80
|
+
variants: AliExpressProductVariantDto[];
|
|
81
|
+
weightGrams: number | null;
|
|
82
|
+
sourceUrl: string | null;
|
|
83
|
+
}
|
|
84
|
+
interface AliExpressProductVariantDto {
|
|
85
|
+
skuId: string;
|
|
86
|
+
title: string | null;
|
|
87
|
+
price: number;
|
|
88
|
+
currency: string;
|
|
89
|
+
stock: number | null;
|
|
90
|
+
attributes: Record<string, string>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Return shape from `POST /store/aliexpress-dropshipping/products/:id/import`.
|
|
94
|
+
*/
|
|
95
|
+
interface AliExpressImportResultDto {
|
|
96
|
+
medusaProductId: string;
|
|
97
|
+
sourceProductId: string;
|
|
98
|
+
importedVariants: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Return shape from `GET /store/aliexpress-dropshipping/status` - drives
|
|
102
|
+
* the admin status card.
|
|
103
|
+
*/
|
|
104
|
+
interface AliExpressConnectionStatusDto {
|
|
105
|
+
connected: boolean;
|
|
106
|
+
sellerId: string | null;
|
|
107
|
+
needsReauth: boolean;
|
|
108
|
+
reauthReason: AliExpressReauthReason | null;
|
|
109
|
+
lastSuccessfulCallAt: string | null;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Return shape from `POST /store/aliexpress-dropshipping/test-connection`.
|
|
113
|
+
*/
|
|
114
|
+
type AliExpressTestConnectionResult = {
|
|
115
|
+
ok: true;
|
|
116
|
+
categoryCount: number;
|
|
117
|
+
} | {
|
|
118
|
+
ok: false;
|
|
119
|
+
code: string;
|
|
120
|
+
msg: string;
|
|
121
|
+
};
|
|
122
|
+
interface PreflightMerchantError {
|
|
123
|
+
code: string;
|
|
124
|
+
message: string;
|
|
125
|
+
}
|
|
126
|
+
interface PreflightAddressError {
|
|
127
|
+
code: string;
|
|
128
|
+
message: string;
|
|
129
|
+
field: string;
|
|
130
|
+
}
|
|
131
|
+
interface PreflightItemError {
|
|
132
|
+
variantId: string;
|
|
133
|
+
productTitle: string;
|
|
134
|
+
code: 'CORRUPT_METADATA' | 'PRODUCT_OFFLINE' | 'OUT_OF_STOCK' | 'CANNOT_SHIP' | 'PRICE_DRIFT';
|
|
135
|
+
message: string;
|
|
136
|
+
removable: boolean;
|
|
137
|
+
}
|
|
138
|
+
interface PreflightResult {
|
|
139
|
+
ok: boolean;
|
|
140
|
+
merchantErrors: PreflightMerchantError[];
|
|
141
|
+
addressErrors: PreflightAddressError[];
|
|
142
|
+
itemErrors: PreflightItemError[];
|
|
143
|
+
warnings: Array<{
|
|
144
|
+
code: string;
|
|
145
|
+
message: string;
|
|
146
|
+
}>;
|
|
147
|
+
degraded?: boolean;
|
|
148
|
+
warning?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { type AliExpressCategoryDto as A, type PreflightResult as P, SECRET_SET_SENTINEL as S, type AliExpressConnectionStatusDto as a, type AliExpressImportResultDto as b, type AliExpressPluginConfig as c, type AliExpressProductDto as d, type AliExpressProductSummaryDto as e, type AliExpressProductVariantDto as f, AliExpressReauthReason as g, type AliExpressTestConnectionResult as h, type SecretSetSentinel as i, type PreflightAddressError as j, type PreflightItemError as k, type PreflightMerchantError as l };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amboras-dev/aliexpress-dropshipping",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AliExpress Dropshipping integration
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "AliExpress Dropshipping integration for Amboras - storefront preflight and admin settings",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
"import": "./dist/index.mjs",
|
|
12
12
|
"require": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./client": {
|
|
15
|
+
"types": "./dist/client/index.d.ts",
|
|
16
|
+
"import": "./dist/client/index.mjs",
|
|
17
|
+
"require": "./dist/client/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./admin": {
|
|
20
|
+
"types": "./dist/admin/index.d.ts",
|
|
21
|
+
"import": "./dist/admin/index.mjs",
|
|
22
|
+
"require": "./dist/admin/index.js"
|
|
23
|
+
},
|
|
14
24
|
"./package.json": "./package.json"
|
|
15
25
|
},
|
|
16
26
|
"files": [
|
|
@@ -20,7 +30,6 @@
|
|
|
20
30
|
"react": ">=18",
|
|
21
31
|
"next": ">=15"
|
|
22
32
|
},
|
|
23
|
-
"dependencies": {},
|
|
24
33
|
"devDependencies": {
|
|
25
34
|
"@types/node": "^20.0.0",
|
|
26
35
|
"@types/react": "^19.0.0",
|