@dianemo/plugin-newegg 1.0.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.
Files changed (80) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +5 -0
  3. package/README.md +59 -0
  4. package/dist/client.d.ts +16 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +92 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/index.d.ts +12 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +26 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/requests/feeds/index.d.ts +4 -0
  13. package/dist/requests/feeds/index.d.ts.map +1 -0
  14. package/dist/requests/feeds/index.js +49 -0
  15. package/dist/requests/feeds/index.js.map +1 -0
  16. package/dist/requests/feeds/types.d.ts +43 -0
  17. package/dist/requests/feeds/types.d.ts.map +1 -0
  18. package/dist/requests/feeds/types.js +2 -0
  19. package/dist/requests/feeds/types.js.map +1 -0
  20. package/dist/requests/index.d.ts +6 -0
  21. package/dist/requests/index.d.ts.map +1 -0
  22. package/dist/requests/index.js +6 -0
  23. package/dist/requests/index.js.map +1 -0
  24. package/dist/requests/inventory/index.d.ts +10 -0
  25. package/dist/requests/inventory/index.d.ts.map +1 -0
  26. package/dist/requests/inventory/index.js +55 -0
  27. package/dist/requests/inventory/index.js.map +1 -0
  28. package/dist/requests/inventory/types.d.ts +70 -0
  29. package/dist/requests/inventory/types.d.ts.map +1 -0
  30. package/dist/requests/inventory/types.js +2 -0
  31. package/dist/requests/inventory/types.js.map +1 -0
  32. package/dist/requests/orders/index.d.ts +10 -0
  33. package/dist/requests/orders/index.d.ts.map +1 -0
  34. package/dist/requests/orders/index.js +59 -0
  35. package/dist/requests/orders/index.js.map +1 -0
  36. package/dist/requests/orders/types.d.ts +241 -0
  37. package/dist/requests/orders/types.d.ts.map +1 -0
  38. package/dist/requests/orders/types.js +40 -0
  39. package/dist/requests/orders/types.js.map +1 -0
  40. package/dist/requests/pricing/index.d.ts +5 -0
  41. package/dist/requests/pricing/index.d.ts.map +1 -0
  42. package/dist/requests/pricing/index.js +40 -0
  43. package/dist/requests/pricing/index.js.map +1 -0
  44. package/dist/requests/pricing/types.d.ts +80 -0
  45. package/dist/requests/pricing/types.d.ts.map +1 -0
  46. package/dist/requests/pricing/types.js +11 -0
  47. package/dist/requests/pricing/types.js.map +1 -0
  48. package/dist/requests/returns/index.d.ts +3 -0
  49. package/dist/requests/returns/index.d.ts.map +1 -0
  50. package/dist/requests/returns/index.js +18 -0
  51. package/dist/requests/returns/index.js.map +1 -0
  52. package/dist/requests/returns/types.d.ts +93 -0
  53. package/dist/requests/returns/types.d.ts.map +1 -0
  54. package/dist/requests/returns/types.js +2 -0
  55. package/dist/requests/returns/types.js.map +1 -0
  56. package/dist/requests/types.d.ts +32 -0
  57. package/dist/requests/types.d.ts.map +1 -0
  58. package/dist/requests/types.js +26 -0
  59. package/dist/requests/types.js.map +1 -0
  60. package/dist/requests/utils.d.ts +22 -0
  61. package/dist/requests/utils.d.ts.map +1 -0
  62. package/dist/requests/utils.js +26 -0
  63. package/dist/requests/utils.js.map +1 -0
  64. package/docs/newegg-api.md +155 -0
  65. package/package.json +128 -0
  66. package/src/client.ts +120 -0
  67. package/src/index.ts +34 -0
  68. package/src/requests/feeds/index.ts +70 -0
  69. package/src/requests/feeds/types.ts +56 -0
  70. package/src/requests/index.ts +5 -0
  71. package/src/requests/inventory/index.ts +94 -0
  72. package/src/requests/inventory/types.ts +83 -0
  73. package/src/requests/orders/index.ts +94 -0
  74. package/src/requests/orders/types.ts +284 -0
  75. package/src/requests/pricing/index.ts +70 -0
  76. package/src/requests/pricing/types.ts +95 -0
  77. package/src/requests/returns/index.ts +30 -0
  78. package/src/requests/returns/types.ts +113 -0
  79. package/src/requests/types.ts +36 -0
  80. package/src/requests/utils.ts +26 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/requests/pricing/types.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EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;QAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,aAAa,CAAC;KAChC,CAAC;CACH;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QACT,KAAK,EAAE,qBAAqB,EAAE,CAAC;KAChC,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE;QACT,KAAK,EAAE,qBAAqB,EAAE,CAAC;KAChC,CAAC;CACH"}
@@ -0,0 +1,11 @@
1
+ export var NeweggItemPriceActive;
2
+ (function (NeweggItemPriceActive) {
3
+ NeweggItemPriceActive[NeweggItemPriceActive["Inactive"] = 0] = "Inactive";
4
+ NeweggItemPriceActive[NeweggItemPriceActive["Active"] = 1] = "Active";
5
+ })(NeweggItemPriceActive || (NeweggItemPriceActive = {}));
6
+ export var NeweggShippingOption;
7
+ (function (NeweggShippingOption) {
8
+ NeweggShippingOption[NeweggShippingOption["Default"] = 0] = "Default";
9
+ NeweggShippingOption[NeweggShippingOption["FreeShipping"] = 1] = "FreeShipping";
10
+ })(NeweggShippingOption || (NeweggShippingOption = {}));
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/requests/pricing/types.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,yEAAY,CAAA;IACZ,qEAAU,CAAA;AACZ,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qEAAW,CAAA;IACX,+EAAgB,CAAA;AAClB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
@@ -0,0 +1,3 @@
1
+ import { GetNeweggReturnsFilters, NeweggReturnResponse } from "./types.js";
2
+ export declare const getRmaInfo: (clientName: string, filters?: GetNeweggReturnsFilters) => Promise<NeweggReturnResponse>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/requests/returns/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EAErB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,UAAU,GACrB,YAAY,MAAM,EAClB,UAAU,uBAAuB,kCAmBlC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { tryHandleRequest } from "@dianemo/plugin-kit";
2
+ import { neweggSubClient } from "../utils.js";
3
+ export const getRmaInfo = async (clientName, filters) => {
4
+ const apiVersion = 320;
5
+ const res = await tryHandleRequest({
6
+ clientName: neweggSubClient(clientName, "getRmaInfo"),
7
+ requestName: "newegg.returns.getRmaInfo",
8
+ method: "PUT",
9
+ url: "/servicemgmt/rma/rmainfo",
10
+ params: { version: apiVersion },
11
+ data: {
12
+ OperationType: "GetRMAInfoRequest",
13
+ RequestBody: { ...filters },
14
+ },
15
+ }, "NWG_0004", "Failed to get Newegg RMA information");
16
+ return res.data;
17
+ };
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/requests/returns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,UAAkB,EAClB,OAAiC,EACjC,EAAE;IACF,MAAM,UAAU,GAA4B,GAAG,CAAC;IAChD,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAChC;QACE,UAAU,EAAE,eAAe,CAAC,UAAU,EAAE,YAAY,CAAC;QACrD,WAAW,EAAE,2BAA2B;QACxC,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,0BAA0B;QAC/B,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;QAC/B,IAAI,EAAE;YACJ,aAAa,EAAE,mBAAmB;YAClC,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE;SAC5B;KACF,EACD,UAAU,EACV,sCAAsC,CACvC,CAAC;IACF,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC,CAAC"}
@@ -0,0 +1,93 @@
1
+ export type NeweggReturnsApiVersion = 307 | 309 | 320;
2
+ export interface GetNeweggReturnsFilters {
3
+ IssueUser?: string;
4
+ PageInfo?: {
5
+ PageIndex?: number;
6
+ PageSize?: number;
7
+ };
8
+ KeywordsType?: GetNeweggReturnsKeywordsType;
9
+ KeywordsValue?: string;
10
+ Status?: NeweggReturnsStatusType;
11
+ RMADateFrom?: Date;
12
+ RMADateTo?: Date;
13
+ RMAType?: NeweggRMAType;
14
+ ProcessedBy?: NeweggProcessedByType;
15
+ }
16
+ export interface NeweggReturnResponse {
17
+ NeweggAPIResponse: {
18
+ IsSuccess: "true" | "false";
19
+ OperationType: string;
20
+ SellerID: string;
21
+ ResponseBody: {
22
+ PageInfo: {
23
+ TotalCount: number;
24
+ TotalPageCount: number;
25
+ PageIndex: number;
26
+ PageSize: number;
27
+ };
28
+ RMAInfoList?: {
29
+ RMAInfo: NeweggRMAInfo[] | NeweggRMAInfo;
30
+ };
31
+ };
32
+ ResponseDate: string;
33
+ };
34
+ }
35
+ export interface NeweggRMAInfo {
36
+ RMANumber: number;
37
+ RMAType: 1 | 2;
38
+ RMATypeDescription: "Refund" | "Replacement";
39
+ SellerRMANumber: string;
40
+ IssueUser: string;
41
+ RMADate: string;
42
+ RMAStatus: NeweggReturnsStatusType;
43
+ RMAStatusDescription: "Open" | "Received" | "Rejected" | "Voided" | "Closed" | "Processing";
44
+ OrderNumber: number;
45
+ OrderDate: string;
46
+ InvoiceNumber: number;
47
+ OrderAmount: number;
48
+ AvailableRefundAmount: number;
49
+ RMAProcessedBy: "Newegg" | "Seller";
50
+ RMANote: string;
51
+ PriorRefundAmount: number;
52
+ CustomerName: string;
53
+ CustomerPhoneNumber: string;
54
+ CustomerEmailAddress: string;
55
+ ShipToAddress1: string;
56
+ ShipToAddress2: string;
57
+ ShipToCityName: string;
58
+ ShipToStateCode: string;
59
+ ShipToZipCode: string;
60
+ ShipToCountryCode: string;
61
+ ShipToLastName: string;
62
+ ShipToFirstName: string;
63
+ ShipToCompany: string;
64
+ ReturnShippingLabel?: {
65
+ Label: {
66
+ TrackingNumber: string;
67
+ TrackingURL: string;
68
+ LabelEstimateCost: number;
69
+ PaidBy: string;
70
+ };
71
+ };
72
+ RMATransactionList: {
73
+ RMATransaction: {
74
+ SellerPartNumber: string;
75
+ MfrPartNumber: string;
76
+ NeweggItemNumber: string;
77
+ Description: string;
78
+ UnitPrice: number;
79
+ ReturnQuantity: number;
80
+ ReturnUnitPrice: number;
81
+ RefundShippingPrice: number;
82
+ RMAReason: NeweggReturnReasonNumber;
83
+ RMAReasonDescription: "Item damage" | "Item is defective or is not working" | "Incompatible" | "No longer needed" | "Inaccurate item description on website" | "Ordered wrong item" | "Sent wrong item" | "Product dissatisfaction" | "Other Reason";
84
+ };
85
+ };
86
+ }
87
+ export type NeweggReturnsStatusType = 1 | 2 | 3 | 4 | 5 | 6;
88
+ type GetNeweggReturnsKeywordsType = 1 | 2 | 3;
89
+ type NeweggRMAType = 0 | 1 | 2;
90
+ type NeweggProcessedByType = 0 | 1 | 2;
91
+ type NeweggReturnReasonNumber = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
92
+ export {};
93
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/requests/returns/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,EAAE;QACjB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAC5B,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE;YACZ,QAAQ,EAAE;gBACR,UAAU,EAAE,M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","sources":["../../../src/requests/returns/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ export declare enum NeweggItemUpdateType {
2
+ NeweggPartNumber = "0",
3
+ SellerPartNumber = "1",
4
+ UPC = "2"
5
+ }
6
+ export declare enum NeweggItemCondition {
7
+ New = "1",
8
+ Refurbished = "2",
9
+ "Used - Like New" = "3",
10
+ "Used - Very Good" = "4",
11
+ "Used - Good" = "5",
12
+ "Used - Acceptable" = "6"
13
+ }
14
+ export declare enum NeweggItemFulfillmentOption {
15
+ Seller = 0,
16
+ Newegg = 1
17
+ }
18
+ export declare enum NeweggNumericBoolean {
19
+ False = 0,
20
+ True = 1
21
+ }
22
+ export type NeweggBoolean = "True" | "False";
23
+ export interface NeweggFeedWrapper<T> {
24
+ NeweggEnvelope: {
25
+ Header: {
26
+ DocumentVersion: "2.0";
27
+ };
28
+ MessageType: string;
29
+ Message: T;
30
+ };
31
+ }
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/requests/types.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,gBAAgB,MAAM;IACtB,gBAAgB,MAAM;IACtB,GAAG,MAAM;CACV;AAED,oBAAY,mBAAmB;IAC7B,GAAG,MAAM;IACT,WAAW,MAAM;IACjB,iBAAiB,MAAM;IACvB,kBAAkB,MAAM;IACxB,aAAa,MAAM;IACnB,mBAAmB,MAAM;CAC1B;AAED,oBAAY,2BAA2B;IACrC,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED,oBAAY,oBAAoB;IAC9B,KAAK,IAAI;IACT,IAAI,IAAI;CACT;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7C,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,cAAc,EAAE;QACd,MAAM,EAAE;YACN,eAAe,EAAE,KAAK,CAAC;SACxB,CAAC;QACF,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,CAAC,CAAC;KACZ,CAAC;CACH"}
@@ -0,0 +1,26 @@
1
+ export var NeweggItemUpdateType;
2
+ (function (NeweggItemUpdateType) {
3
+ NeweggItemUpdateType["NeweggPartNumber"] = "0";
4
+ NeweggItemUpdateType["SellerPartNumber"] = "1";
5
+ NeweggItemUpdateType["UPC"] = "2";
6
+ })(NeweggItemUpdateType || (NeweggItemUpdateType = {}));
7
+ export var NeweggItemCondition;
8
+ (function (NeweggItemCondition) {
9
+ NeweggItemCondition["New"] = "1";
10
+ NeweggItemCondition["Refurbished"] = "2";
11
+ NeweggItemCondition["Used - Like New"] = "3";
12
+ NeweggItemCondition["Used - Very Good"] = "4";
13
+ NeweggItemCondition["Used - Good"] = "5";
14
+ NeweggItemCondition["Used - Acceptable"] = "6";
15
+ })(NeweggItemCondition || (NeweggItemCondition = {}));
16
+ export var NeweggItemFulfillmentOption;
17
+ (function (NeweggItemFulfillmentOption) {
18
+ NeweggItemFulfillmentOption[NeweggItemFulfillmentOption["Seller"] = 0] = "Seller";
19
+ NeweggItemFulfillmentOption[NeweggItemFulfillmentOption["Newegg"] = 1] = "Newegg";
20
+ })(NeweggItemFulfillmentOption || (NeweggItemFulfillmentOption = {}));
21
+ export var NeweggNumericBoolean;
22
+ (function (NeweggNumericBoolean) {
23
+ NeweggNumericBoolean[NeweggNumericBoolean["False"] = 0] = "False";
24
+ NeweggNumericBoolean[NeweggNumericBoolean["True"] = 1] = "True";
25
+ })(NeweggNumericBoolean || (NeweggNumericBoolean = {}));
26
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/requests/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,8CAAsB,CAAA;IACtB,8CAAsB,CAAA;IACtB,iCAAS,CAAA;AACX,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,gCAAS,CAAA;IACT,wCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,6CAAwB,CAAA;IACxB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;AAC3B,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,iFAAU,CAAA;IACV,iFAAU,CAAA;AACZ,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC;AAED,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,iEAAS,CAAA;IACT,+DAAQ,CAAA;AACV,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Names the sub-client carrying an endpoint's rate limit.
3
+ *
4
+ * Newegg meters each endpoint separately, so the template registers one
5
+ * sub-client per endpoint beneath the account's client. Callers pass the
6
+ * account name from `buildClientName("newegg" | "neweggBusiness", creds)` —
7
+ * which marketplace an account belongs to is already encoded there — and each
8
+ * request appends the endpoint segment itself.
9
+ */
10
+ export declare const neweggSubClient: (clientName: string, endpoint: string) => string;
11
+ /**
12
+ * The *value* of `IsSuccess` varies by endpoint — the feed endpoints send a JSON
13
+ * boolean, Order Confirmation sends the string `"true"` — which is why this is a
14
+ * helper and not a comparison. An absent flag reads as a failure: a noisy false
15
+ * alarm is recoverable, a silently dropped feed is not.
16
+ *
17
+ * Published samples: docs/newegg-api.md#issuccess-the-casing-and-the-value-type
18
+ */
19
+ export declare const neweggSucceeded: (body: {
20
+ IsSuccess?: boolean | string;
21
+ }) => boolean;
22
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/requests/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM,WACvC,CAAC;AAE9B;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM;IAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAAE,YAKrE,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Names the sub-client carrying an endpoint's rate limit.
3
+ *
4
+ * Newegg meters each endpoint separately, so the template registers one
5
+ * sub-client per endpoint beneath the account's client. Callers pass the
6
+ * account name from `buildClientName("newegg" | "neweggBusiness", creds)` —
7
+ * which marketplace an account belongs to is already encoded there — and each
8
+ * request appends the endpoint segment itself.
9
+ */
10
+ export const neweggSubClient = (clientName, endpoint) => `${clientName}:${endpoint}`;
11
+ /**
12
+ * The *value* of `IsSuccess` varies by endpoint — the feed endpoints send a JSON
13
+ * boolean, Order Confirmation sends the string `"true"` — which is why this is a
14
+ * helper and not a comparison. An absent flag reads as a failure: a noisy false
15
+ * alarm is recoverable, a silently dropped feed is not.
16
+ *
17
+ * Published samples: docs/newegg-api.md#issuccess-the-casing-and-the-value-type
18
+ */
19
+ export const neweggSucceeded = (body) => {
20
+ if (typeof body.IsSuccess === "boolean")
21
+ return body.IsSuccess;
22
+ if (typeof body.IsSuccess === "string")
23
+ return body.IsSuccess.toLowerCase() === "true";
24
+ return false;
25
+ };
26
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/requests/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,QAAgB,EAAE,EAAE,CACtE,GAAG,UAAU,IAAI,QAAQ,EAAE,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAsC,EAAE,EAAE;IACxE,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC;IAC/D,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ;QACpC,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,155 @@
1
+ # Newegg Marketplace API
2
+
3
+ Findings behind `@dianemo/plugin-newegg`. Everything quoted here was checked
4
+ against Newegg's published JSON samples on **2026-08-25**.
5
+
6
+ ## `IsSuccess`: the casing, and the value type
7
+
8
+ The success flag on a Newegg response envelope is `IsSuccess` — capital `I`,
9
+ capital `S`. Before 1.0.0 the feed types spelled it `isSuccess` and the feed
10
+ guards compared it to the string `"False"`:
11
+
12
+ ```ts
13
+ if (!feedData || resData.isSuccess === "False") {
14
+ /* throw */
15
+ }
16
+ ```
17
+
18
+ `resData.isSuccess` is `undefined` on every real response, so the comparison was
19
+ never true. A rejected feed read as an accepted submission and the seller's
20
+ catalogue then stopped updating with nothing logged — the failure mode with no
21
+ signal at all.
22
+
23
+ The **value** genuinely varies by endpoint, which is why `neweggSucceeded` in
24
+ `src/requests/utils.ts` is a helper rather than a comparison. Both spellings are
25
+ published:
26
+
27
+ - Inventory update feed — a JSON boolean:
28
+ <https://developer.newegg.com/newegg_marketplace_api/datafeed_management/submit_feed/inventory_update_feed/>
29
+ ```json
30
+ "IsSuccess": true
31
+ ```
32
+ - Order confirmation — the string:
33
+ <https://developer.newegg.com/newegg_marketplace_api/order_management/order_confirmation/>
34
+ ```json
35
+ "IsSuccess": "true"
36
+ ```
37
+
38
+ `neweggSucceeded` normalises the value across both. It does not normalise the
39
+ key — `IsSuccess` is the only spelling Newegg publishes, and reading a second one
40
+ would only re-hide a genuinely absent flag. An absent flag reads as a **failure**:
41
+ a noisy false alarm is recoverable, a silently dropped feed is not.
42
+
43
+ ## `RequestID` on the way in, `RequestId` on the way out
44
+
45
+ Newegg spells the same key differently by direction on the Get Feed Status
46
+ endpoint:
47
+
48
+ - request body: `RequestBody.GetRequestStatus.RequestIDList[].RequestID`
49
+ - response body: `ResponseBody.ResponseList[].RequestId`
50
+
51
+ <https://developer.newegg.com/newegg_marketplace_api/datafeed_management/get_feed_status/>
52
+
53
+ Both spellings are in the published samples and both are correct as written. The
54
+ asymmetry looks like a typo from either side, so `NeweggFeedResponse.RequestId`
55
+ carries a comment saying not to "fix" it.
56
+
57
+ ### Open question: is `RequestIDList` an object or an array?
58
+
59
+ `NeweggGetFeedStatusData` types it as an array of `{ RequestID: string }`, which
60
+ is what a multi-id query needs. The published request sample shows it as a bare
61
+ object with one `RequestID` inside:
62
+
63
+ ```json
64
+ "RequestIDList": { "RequestID": "..." }
65
+ ```
66
+
67
+ Newegg's JSON surface is derived from its XML one, where a repeated element and a
68
+ single element are written identically, and such endpoints commonly accept either
69
+ form. The array typing was left as it is on that basis — but it is untested
70
+ against a real account for the single-id case, and one call with one id settles
71
+ it. If Newegg rejects the array, the type has to become
72
+ `{ RequestID: string } | { RequestID: string }[]`.
73
+
74
+ ## The business marketplace has its own inventory endpoint
75
+
76
+ `neweggBusiness` **404s** on the international inventory path that serves the
77
+ consumer marketplace. The two are different endpoints, with a different verb and
78
+ an explicit API version:
79
+
80
+ | template | request |
81
+ | ---------------- | ------------------------------------------------------ |
82
+ | `newegg` | `PUT /contentmgmt/item/international/inventory` |
83
+ | `neweggBusiness` | `POST /contentmgmt/item/inventory` with `?version=304` |
84
+
85
+ **Established by a live call, 2026-08-25.** The international path returned 404
86
+ for a real business SKU; the business path returned real stock for the same one.
87
+ Source: **observed responses**, plus the pre-1.0.0 implementation, which shipped
88
+ both as separate functions (`getItemInventory` and `getB2BCAItemInventory`) and
89
+ whose split this restores — the 1.0.0 port carried only the consumer one across
90
+ and pointed both templates at it.
91
+
92
+ **The response shapes differ, which is why these are two functions rather than
93
+ one branching on the client name.** The consumer endpoint nests an
94
+ `InventoryAllocation` array; the business endpoint answers a flat record. A
95
+ merged function could only switch on the `clientName` string, so its return type
96
+ would be a union no caller could narrow.
97
+
98
+ The flat record also sends two fields as **strings** where the rest of this
99
+ package models them as numeric enums — `FulfillmentOption: "0"` against
100
+ `NeweggItemFulfillmentOption.Seller = 0`, and `Active: "1"` against
101
+ `NeweggNumericBoolean.True = 1`. `NeweggBusinessInventoryResponse` types them as
102
+ the wire sends them. Coercing them to the enums would read as a documented
103
+ vendor guarantee, and this is one observed response from one seller.
104
+
105
+ ## Rate limits: the mechanism is documented, the numbers are not
106
+
107
+ **Vendor documentation for the framework, nothing for the figures.** Checked
108
+ 2026-08-25 against
109
+ [Throttling](https://developer.newegg.com/documents/newegg-marketplace-api/throttling/).
110
+
111
+ Newegg documents two mechanisms and no quantities:
112
+
113
+ > Rate limits are divided into minute intervals. This means you have a maximum
114
+ > number of requests you can submit to a specific function in a one-minute
115
+ > period.
116
+
117
+ > Datafeed related functions have the hourly limitation of request and the
118
+ > maximum size of each request.
119
+
120
+ Exceeding either returns HTTP 429 with `"Too many request."`. No per-function
121
+ table is published anywhere on the developer site.
122
+
123
+ ### What this package declares, and why it is a guess
124
+
125
+ **Every figure below is this repo's own ceiling.** They are not Newegg's, and
126
+ nothing on the developer site corroborates them.
127
+
128
+ | Sub-client group | Declared |
129
+ | ------------------------------------------------------------------------------------------------- | ------------- |
130
+ | `getItemInventory`, `updateItemInventory`, `getItemPricing`, `updateItemPricing`, `getFeedStatus` | 10,000 / hour |
131
+ | `getOrders`, `markOrderDownloaded`, `shipOrder`, `getRmaInfo` | 1,000 / hour |
132
+ | `submitFeed` | 10 / minute |
133
+
134
+ There is also a **modelling mismatch worth knowing**: Newegg meters the
135
+ non-datafeed functions _per minute_, but these buckets are expressed per hour and
136
+ drip-fed (`interval: 360`, one token at a time, up to 10,000). That smooths an
137
+ hourly allowance into a steady trickle, which is safe against a per-minute limit
138
+ by construction — a drip can never burst — but it does mean the shape of the
139
+ budget does not match the shape of the limit, and a caller that could legitimately
140
+ burst 60 calls in a minute is instead paced at roughly 10 per second.
141
+
142
+ `submitFeed` is the one that matches its mechanism: it is a datafeed function, and
143
+ datafeed limits genuinely are hourly.
144
+
145
+ ### How to get the real numbers without asking Newegg
146
+
147
+ Newegg returns them on every response:
148
+
149
+ - `X-RateLimit-Limit` / `X-RateLimit-Remaining` — the per-minute function limit
150
+ - `X-RecordCount-Limit` / `X-RecordCount-Remaining` — the datafeed record ceiling
151
+
152
+ Reading `X-RateLimit-Limit` off a single live call to each function would replace
153
+ this entire section with vendor-stated figures. That has not been done. Until it
154
+ is, set anything you learn per client with the `rateLimitOverrides` argument to
155
+ `addTemplateClient` rather than editing the template.
package/package.json ADDED
@@ -0,0 +1,128 @@
1
+ {
2
+ "name": "@dianemo/plugin-newegg",
3
+ "version": "1.0.0",
4
+ "description": "Newegg plugin — Newegg and Newegg Business marketplaces",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./requests": {
14
+ "types": "./dist/requests/index.d.ts",
15
+ "default": "./dist/requests/index.js"
16
+ },
17
+ "./requests/feeds": {
18
+ "types": "./dist/requests/feeds/index.d.ts",
19
+ "default": "./dist/requests/feeds/index.js"
20
+ },
21
+ "./requests/index": {
22
+ "types": "./dist/requests/index.d.ts",
23
+ "default": "./dist/requests/index.js"
24
+ },
25
+ "./requests/inventory": {
26
+ "types": "./dist/requests/inventory/index.d.ts",
27
+ "default": "./dist/requests/inventory/index.js"
28
+ },
29
+ "./requests/orders": {
30
+ "types": "./dist/requests/orders/index.d.ts",
31
+ "default": "./dist/requests/orders/index.js"
32
+ },
33
+ "./requests/pricing": {
34
+ "types": "./dist/requests/pricing/index.d.ts",
35
+ "default": "./dist/requests/pricing/index.js"
36
+ },
37
+ "./requests/returns": {
38
+ "types": "./dist/requests/returns/index.d.ts",
39
+ "default": "./dist/requests/returns/index.js"
40
+ },
41
+ "./requests/types": {
42
+ "types": "./dist/requests/types.d.ts",
43
+ "default": "./dist/requests/types.js"
44
+ },
45
+ "./requests/utils": {
46
+ "types": "./dist/requests/utils.d.ts",
47
+ "default": "./dist/requests/utils.js"
48
+ },
49
+ "./requests/feeds/index": {
50
+ "types": "./dist/requests/feeds/index.d.ts",
51
+ "default": "./dist/requests/feeds/index.js"
52
+ },
53
+ "./requests/feeds/types": {
54
+ "types": "./dist/requests/feeds/types.d.ts",
55
+ "default": "./dist/requests/feeds/types.js"
56
+ },
57
+ "./requests/inventory/index": {
58
+ "types": "./dist/requests/inventory/index.d.ts",
59
+ "default": "./dist/requests/inventory/index.js"
60
+ },
61
+ "./requests/inventory/types": {
62
+ "types": "./dist/requests/inventory/types.d.ts",
63
+ "default": "./dist/requests/inventory/types.js"
64
+ },
65
+ "./requests/orders/index": {
66
+ "types": "./dist/requests/orders/index.d.ts",
67
+ "default": "./dist/requests/orders/index.js"
68
+ },
69
+ "./requests/orders/types": {
70
+ "types": "./dist/requests/orders/types.d.ts",
71
+ "default": "./dist/requests/orders/types.js"
72
+ },
73
+ "./requests/pricing/index": {
74
+ "types": "./dist/requests/pricing/index.d.ts",
75
+ "default": "./dist/requests/pricing/index.js"
76
+ },
77
+ "./requests/pricing/types": {
78
+ "types": "./dist/requests/pricing/types.d.ts",
79
+ "default": "./dist/requests/pricing/types.js"
80
+ },
81
+ "./requests/returns/index": {
82
+ "types": "./dist/requests/returns/index.d.ts",
83
+ "default": "./dist/requests/returns/index.js"
84
+ },
85
+ "./requests/returns/types": {
86
+ "types": "./dist/requests/returns/types.d.ts",
87
+ "default": "./dist/requests/returns/types.js"
88
+ }
89
+ },
90
+ "files": [
91
+ "LICENSE",
92
+ "NOTICE",
93
+ "README.md",
94
+ "dist",
95
+ "docs",
96
+ "src"
97
+ ],
98
+ "engines": {
99
+ "node": ">=20"
100
+ },
101
+ "scripts": {
102
+ "build": "npm run clean && tsc -p tsconfig.json",
103
+ "check": "tsc -p tsconfig.json --noEmit",
104
+ "clean": "rm -rf dist *.tsbuildinfo",
105
+ "prepublishOnly": "npm run clean && npm run build"
106
+ },
107
+ "keywords": [
108
+ "newegg",
109
+ "marketplace",
110
+ "dianemo",
111
+ "dianemo-plugin",
112
+ "rate-limit"
113
+ ],
114
+ "author": "Aaron Leman",
115
+ "license": "Apache-2.0",
116
+ "peerDependencies": {
117
+ "@dianemo/core": "^1.0.0",
118
+ "@dianemo/plugin-kit": "^1.0.0"
119
+ },
120
+ "repository": {
121
+ "type": "git",
122
+ "url": "git+https://github.com/vivo-us/dianemo-plugins.git",
123
+ "directory": "packages/plugin-newegg"
124
+ },
125
+ "publishConfig": {
126
+ "access": "public"
127
+ }
128
+ }