@medusajs/js-sdk 0.0.2-snapshot-20240531102054 → 0.0.2-snapshot-20240701122250

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/dist/admin/customer.d.ts +20 -0
  2. package/dist/admin/customer.js +40 -0
  3. package/dist/admin/customer.js.map +1 -0
  4. package/dist/admin/fulfillment-provider.d.ts +8 -0
  5. package/dist/admin/fulfillment-provider.js +13 -0
  6. package/dist/admin/fulfillment-provider.js.map +1 -0
  7. package/dist/admin/fulfillment-set.d.ts +12 -0
  8. package/dist/admin/fulfillment-set.js +41 -0
  9. package/dist/admin/fulfillment-set.js.map +1 -0
  10. package/dist/admin/fulfillment.d.ts +10 -0
  11. package/dist/admin/fulfillment.js +29 -0
  12. package/dist/admin/fulfillment.js.map +1 -0
  13. package/dist/admin/index.d.ts +42 -76
  14. package/dist/admin/index.js +42 -168
  15. package/dist/admin/index.js.map +1 -1
  16. package/dist/admin/inventory-item.d.ts +16 -0
  17. package/dist/admin/inventory-item.js +68 -0
  18. package/dist/admin/inventory-item.js.map +1 -0
  19. package/dist/admin/invite.d.ts +25 -0
  20. package/dist/admin/invite.js +46 -0
  21. package/dist/admin/invite.js.map +1 -0
  22. package/dist/admin/order.d.ts +22 -0
  23. package/dist/admin/order.js +39 -0
  24. package/dist/admin/order.js.map +1 -0
  25. package/dist/admin/price-list.d.ts +14 -0
  26. package/dist/admin/price-list.js +58 -0
  27. package/dist/admin/price-list.js.map +1 -0
  28. package/dist/admin/product-category.d.ts +13 -0
  29. package/dist/admin/product-category.js +48 -0
  30. package/dist/admin/product-category.js.map +1 -0
  31. package/dist/admin/product-collection.d.ts +23 -0
  32. package/dist/admin/product-collection.js +47 -0
  33. package/dist/admin/product-collection.js.map +1 -0
  34. package/dist/admin/product-type.d.ts +12 -0
  35. package/dist/admin/product-type.js +40 -0
  36. package/dist/admin/product-type.js.map +1 -0
  37. package/dist/admin/product.d.ts +25 -0
  38. package/dist/admin/product.js +132 -0
  39. package/dist/admin/product.js.map +1 -0
  40. package/dist/admin/region.d.ts +20 -0
  41. package/dist/admin/region.js +40 -0
  42. package/dist/admin/region.js.map +1 -0
  43. package/dist/admin/sales-channel.d.ts +13 -0
  44. package/dist/admin/sales-channel.js +49 -0
  45. package/dist/admin/sales-channel.js.map +1 -0
  46. package/dist/admin/shipping-option.d.ts +12 -0
  47. package/dist/admin/shipping-option.js +42 -0
  48. package/dist/admin/shipping-option.js.map +1 -0
  49. package/dist/admin/shipping-profile.d.ts +12 -0
  50. package/dist/admin/shipping-profile.js +42 -0
  51. package/dist/admin/shipping-profile.js.map +1 -0
  52. package/dist/admin/stock-location.d.ts +14 -0
  53. package/dist/admin/stock-location.js +56 -0
  54. package/dist/admin/stock-location.js.map +1 -0
  55. package/dist/admin/store.d.ts +10 -0
  56. package/dist/admin/store.js +28 -0
  57. package/dist/admin/store.js.map +1 -0
  58. package/dist/admin/tax-rate.d.ts +12 -0
  59. package/dist/admin/tax-rate.js +43 -0
  60. package/dist/admin/tax-rate.js.map +1 -0
  61. package/dist/admin/tax-region.d.ts +11 -0
  62. package/dist/admin/tax-region.js +36 -0
  63. package/dist/admin/tax-region.js.map +1 -0
  64. package/dist/admin/upload.d.ts +14 -0
  65. package/dist/admin/upload.js +46 -0
  66. package/dist/admin/upload.js.map +1 -0
  67. package/dist/client.js +6 -1
  68. package/dist/client.js.map +1 -1
  69. package/dist/store/index.d.ts +3 -7
  70. package/dist/store/index.js.map +1 -1
  71. package/dist/types.d.ts +1 -1
  72. package/package.json +3 -4
@@ -0,0 +1,20 @@
1
+ import { DeleteResponse, FindParams, HttpTypes, SelectParams } from "@medusajs/types";
2
+ import { Client } from "../client";
3
+ import { ClientHeaders } from "../types";
4
+ export declare class Customer {
5
+ private client;
6
+ constructor(client: Client);
7
+ create(body: HttpTypes.AdminCreateCustomer, query?: SelectParams, headers?: ClientHeaders): Promise<{
8
+ customer: HttpTypes.AdminCustomer;
9
+ }>;
10
+ update(id: string, body: HttpTypes.AdminUpdateCustomer, query?: SelectParams, headers?: ClientHeaders): Promise<{
11
+ customer: HttpTypes.AdminCustomer;
12
+ }>;
13
+ list(queryParams?: FindParams & HttpTypes.AdminCollectionFilters, headers?: ClientHeaders): Promise<HttpTypes.PaginatedResponse<{
14
+ customers: HttpTypes.AdminCustomer[];
15
+ }>>;
16
+ retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<{
17
+ customer: HttpTypes.AdminCustomer;
18
+ }>;
19
+ delete(id: string, headers?: ClientHeaders): Promise<DeleteResponse<"customer">>;
20
+ }
@@ -0,0 +1,40 @@
1
+ export class Customer {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ async create(body, query, headers) {
6
+ return this.client.fetch(`/admin/customers`, {
7
+ method: "POST",
8
+ headers,
9
+ body,
10
+ query,
11
+ });
12
+ }
13
+ async update(id, body, query, headers) {
14
+ return this.client.fetch(`/admin/customers/${id}`, {
15
+ method: "POST",
16
+ headers,
17
+ body,
18
+ query,
19
+ });
20
+ }
21
+ async list(queryParams, headers) {
22
+ return this.client.fetch(`/admin/customers`, {
23
+ headers,
24
+ query: queryParams,
25
+ });
26
+ }
27
+ async retrieve(id, query, headers) {
28
+ return this.client.fetch(`/admin/customers/${id}`, {
29
+ query,
30
+ headers,
31
+ });
32
+ }
33
+ async delete(id, headers) {
34
+ return this.client.fetch(`/admin/customers/${id}`, {
35
+ method: "DELETE",
36
+ headers,
37
+ });
38
+ }
39
+ }
40
+ //# sourceMappingURL=customer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.js","sourceRoot":"","sources":["../../src/admin/customer.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,QAAQ;IAEnB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,MAAM,CACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAErB,kBAAkB,EAAE;YACrB,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CACV,EAAU,EACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CACR,WAA2D,EAC3D,OAAuB;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,kBAAkB,EAAE;YACpB,OAAO;YACP,KAAK,EAAE,WAAW;SACnB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAU,EAAE,KAAoB,EAAE,OAAuB;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;YACE,KAAK;YACL,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAuB;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;YACE,MAAM,EAAE,QAAQ;YAChB,OAAO;SACR,CACF,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ import { HttpTypes } from "@medusajs/types";
2
+ import { Client } from "../client";
3
+ import { ClientHeaders } from "../types";
4
+ export declare class FulfillmentProvider {
5
+ private client;
6
+ constructor(client: Client);
7
+ list(query?: HttpTypes.AdminFulfillmentProviderListParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFulfillmentProviderListResponse>;
8
+ }
@@ -0,0 +1,13 @@
1
+ export class FulfillmentProvider {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ async list(query, headers) {
6
+ return await this.client.fetch(`/admin/fulfillment-providers`, {
7
+ method: "GET",
8
+ headers,
9
+ query,
10
+ });
11
+ }
12
+ }
13
+ //# sourceMappingURL=fulfillment-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fulfillment-provider.js","sourceRoot":"","sources":["../../src/admin/fulfillment-provider.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,mBAAmB;IAE9B,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,IAAI,CACR,KAAoD,EACpD,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,8BAA8B,EAC9B;YACE,MAAM,EAAE,KAAK;YACb,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { HttpTypes } from "@medusajs/types";
2
+ import { Client } from "../client";
3
+ import { ClientHeaders } from "../types";
4
+ export declare class FulfillmentSet {
5
+ private client;
6
+ constructor(client: Client);
7
+ delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminFulfillmentSetDeleteResponse>;
8
+ createServiceZone(id: string, body: HttpTypes.AdminCreateFulfillmentSetServiceZone, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFulfillmentSetResponse>;
9
+ retrieveServiceZone(fulfillmentSetId: string, serviceZoneId: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminServiceZoneResponse>;
10
+ updateServiceZone(fulfillmentSetId: string, serviceZoneId: string, body: HttpTypes.AdminUpdateFulfillmentSetServiceZone, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFulfillmentSetResponse>;
11
+ deleteServiceZone(fulfillmentSetId: string, serviceZoneId: string, headers?: ClientHeaders): Promise<HttpTypes.AdminServiceZoneDeleteResponse>;
12
+ }
@@ -0,0 +1,41 @@
1
+ export class FulfillmentSet {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ async delete(id, headers) {
6
+ return await this.client.fetch(`/admin/fulfillment-sets/${id}`, {
7
+ method: "DELETE",
8
+ headers,
9
+ });
10
+ }
11
+ async createServiceZone(id, body, query, headers) {
12
+ return await this.client.fetch(`/admin/fulfillment-sets/${id}/service-zones`, {
13
+ method: "POST",
14
+ headers,
15
+ body,
16
+ query,
17
+ });
18
+ }
19
+ async retrieveServiceZone(fulfillmentSetId, serviceZoneId, query, headers) {
20
+ return await this.client.fetch(`/admin/fulfillment-sets/${fulfillmentSetId}/service-zones/${serviceZoneId}`, {
21
+ method: "GET",
22
+ headers,
23
+ query,
24
+ });
25
+ }
26
+ async updateServiceZone(fulfillmentSetId, serviceZoneId, body, query, headers) {
27
+ return await this.client.fetch(`/admin/fulfillment-sets/${fulfillmentSetId}/service-zones/${serviceZoneId}`, {
28
+ method: "POST",
29
+ headers,
30
+ body,
31
+ query,
32
+ });
33
+ }
34
+ async deleteServiceZone(fulfillmentSetId, serviceZoneId, headers) {
35
+ return await this.client.fetch(`/admin/fulfillment-sets/${fulfillmentSetId}/service-zones/${serviceZoneId}`, {
36
+ method: "DELETE",
37
+ headers,
38
+ });
39
+ }
40
+ }
41
+ //# sourceMappingURL=fulfillment-set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fulfillment-set.js","sourceRoot":"","sources":["../../src/admin/fulfillment-set.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,cAAc;IAEzB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAuB;QAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,2BAA2B,EAAE,EAAE,EAC/B;YACE,MAAM,EAAE,QAAQ;YAChB,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,EAAU,EACV,IAAoD,EACpD,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,2BAA2B,EAAE,gBAAgB,EAC7C;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,gBAAwB,EACxB,aAAqB,EACrB,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,2BAA2B,gBAAgB,kBAAkB,aAAa,EAAE,EAC5E;YACE,MAAM,EAAE,KAAK;YACb,OAAO;YACP,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,gBAAwB,EACxB,aAAqB,EACrB,IAAoD,EACpD,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,2BAA2B,gBAAgB,kBAAkB,aAAa,EAAE,EAC5E;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,gBAAwB,EACxB,aAAqB,EACrB,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,2BAA2B,gBAAgB,kBAAkB,aAAa,EAAE,EAC5E;YACE,MAAM,EAAE,QAAQ;YAChB,OAAO;SACR,CACF,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ import { HttpTypes } from "@medusajs/types";
2
+ import { Client } from "../client";
3
+ import { ClientHeaders } from "../types";
4
+ export declare class Fulfillment {
5
+ private client;
6
+ constructor(client: Client);
7
+ create(body: HttpTypes.AdminCreateFulfillment, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFulfillmentResponse>;
8
+ cancel(id: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFulfillmentResponse>;
9
+ createShipment(id: string, body: HttpTypes.AdminCreateFulfillmentShipment, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminFulfillmentResponse>;
10
+ }
@@ -0,0 +1,29 @@
1
+ export class Fulfillment {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ async create(body, query, headers) {
6
+ return await this.client.fetch(`/admin/fulfillments`, {
7
+ method: "POST",
8
+ headers,
9
+ body,
10
+ query,
11
+ });
12
+ }
13
+ async cancel(id, query, headers) {
14
+ return await this.client.fetch(`/admin/fulfillments/${id}`, {
15
+ method: "POST",
16
+ body: {},
17
+ headers,
18
+ });
19
+ }
20
+ async createShipment(id, body, query, headers) {
21
+ return await this.client.fetch(`/admin/fulfillments/${id}/shipments`, {
22
+ method: "POST",
23
+ headers,
24
+ body,
25
+ query,
26
+ });
27
+ }
28
+ }
29
+ //# sourceMappingURL=fulfillment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fulfillment.js","sourceRoot":"","sources":["../../src/admin/fulfillment.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,WAAW;IAEtB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,MAAM,CACV,IAAsC,EACtC,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,qBAAqB,EACrB;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAAM,CACV,EAAU,EACV,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,uBAAuB,EAAE,EAAE,EAC3B;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE;YACR,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,EAAU,EACV,IAA8C,EAC9C,KAA8B,EAC9B,OAAuB;QAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,uBAAuB,EAAE,YAAY,EACrC;YACE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI;YACJ,KAAK;SACN,CACF,CAAA;IACH,CAAC;CACF"}
@@ -1,80 +1,46 @@
1
- import { DeleteResponse, FindParams, HttpTypes, SelectParams } from "@medusajs/types";
2
1
  import { Client } from "../client";
3
- import { ClientHeaders } from "../types";
2
+ import { Customer } from "./customer";
3
+ import { Fulfillment } from "./fulfillment";
4
+ import { FulfillmentProvider } from "./fulfillment-provider";
5
+ import { FulfillmentSet } from "./fulfillment-set";
6
+ import { InventoryItem } from "./inventory-item";
7
+ import { Invite } from "./invite";
8
+ import { Order } from "./order";
9
+ import { PriceList } from "./price-list";
10
+ import { Product } from "./product";
11
+ import { ProductCategory } from "./product-category";
12
+ import { ProductCollection } from "./product-collection";
13
+ import { ProductType } from "./product-type";
14
+ import { Region } from "./region";
15
+ import { SalesChannel } from "./sales-channel";
16
+ import { ShippingOption } from "./shipping-option";
17
+ import { ShippingProfile } from "./shipping-profile";
18
+ import { StockLocation } from "./stock-location";
19
+ import { Store } from "./store";
20
+ import { TaxRate } from "./tax-rate";
21
+ import { TaxRegion } from "./tax-region";
22
+ import { Upload } from "./upload";
4
23
  export declare class Admin {
5
- private client;
24
+ invite: Invite;
25
+ customer: Customer;
26
+ productCollection: ProductCollection;
27
+ productCategory: ProductCategory;
28
+ priceList: PriceList;
29
+ product: Product;
30
+ productType: ProductType;
31
+ upload: Upload;
32
+ region: Region;
33
+ stockLocation: StockLocation;
34
+ salesChannel: SalesChannel;
35
+ fulfillmentSet: FulfillmentSet;
36
+ fulfillment: Fulfillment;
37
+ fulfillmentProvider: FulfillmentProvider;
38
+ shippingOption: ShippingOption;
39
+ shippingProfile: ShippingProfile;
40
+ inventoryItem: InventoryItem;
41
+ order: Order;
42
+ taxRate: TaxRate;
43
+ taxRegion: TaxRegion;
44
+ store: Store;
6
45
  constructor(client: Client);
7
- region: {
8
- create: (body: HttpTypes.AdminCreateRegion, query?: SelectParams, headers?: ClientHeaders) => Promise<{
9
- region: HttpTypes.AdminRegion;
10
- }>;
11
- update: (id: string, body: HttpTypes.AdminUpdateRegion, query?: SelectParams, headers?: ClientHeaders) => Promise<{
12
- region: HttpTypes.AdminRegion;
13
- }>;
14
- list: (queryParams?: FindParams & HttpTypes.AdminRegionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
15
- regions: HttpTypes.AdminRegion[];
16
- }>>;
17
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
18
- region: HttpTypes.AdminRegion;
19
- }>;
20
- delete: (id: string, headers?: ClientHeaders) => Promise<DeleteResponse<"region">>;
21
- };
22
- invites: {
23
- accept: (input: HttpTypes.AdminAcceptInvite & {
24
- invite_token: string;
25
- }, query?: SelectParams, headers?: ClientHeaders) => Promise<{
26
- user: HttpTypes.AdminUserResponse;
27
- }>;
28
- create: (body: HttpTypes.AdminCreateInvite, query?: SelectParams, headers?: ClientHeaders) => Promise<{
29
- invite: HttpTypes.AdminInviteResponse;
30
- }>;
31
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
32
- invite: HttpTypes.AdminInviteResponse;
33
- }>;
34
- list: (queryParams?: FindParams, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
35
- invites: HttpTypes.AdminInviteResponse[];
36
- }>>;
37
- resend: (id: string, headers?: ClientHeaders) => Promise<{
38
- invite: HttpTypes.AdminInviteResponse;
39
- }>;
40
- delete: (id: string, headers?: ClientHeaders) => Promise<DeleteResponse<"invite">>;
41
- };
42
- products: {
43
- create: (body: HttpTypes.AdminCreateProduct, query?: SelectParams, headers?: ClientHeaders) => Promise<{
44
- product: HttpTypes.AdminProduct;
45
- }>;
46
- };
47
- customer: {
48
- create: (body: HttpTypes.AdminCreateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<{
49
- customer: HttpTypes.AdminCustomer;
50
- }>;
51
- update: (id: string, body: HttpTypes.AdminUpdateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<{
52
- customer: HttpTypes.AdminCustomer;
53
- }>;
54
- list: (queryParams?: FindParams & HttpTypes.AdminCollectionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
55
- customers: HttpTypes.AdminCustomer[];
56
- }>>;
57
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
58
- customer: HttpTypes.AdminCustomer;
59
- }>;
60
- delete: (id: string, headers?: ClientHeaders) => Promise<DeleteResponse<"customer">>;
61
- };
62
- collection: {
63
- create: (body: HttpTypes.AdminCreateCollection, query?: SelectParams, headers?: ClientHeaders) => Promise<{
64
- collection: HttpTypes.AdminCollection;
65
- }>;
66
- update: (id: string, body: HttpTypes.AdminUpdateCollection, query?: SelectParams, headers?: ClientHeaders) => Promise<{
67
- collection: HttpTypes.AdminCollection;
68
- }>;
69
- list: (queryParams?: FindParams, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
70
- collections: HttpTypes.AdminCollection[];
71
- }>>;
72
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
73
- collection: HttpTypes.AdminCollection;
74
- }>;
75
- delete: (id: string, headers?: ClientHeaders) => Promise<DeleteResponse<"collection">>;
76
- updateProducts: (id: string, body: HttpTypes.AdminUpdateCollectionProducts, headers?: ClientHeaders) => Promise<{
77
- collection: HttpTypes.AdminCollection;
78
- }>;
79
- };
80
46
  }
@@ -1,173 +1,47 @@
1
+ import { Customer } from "./customer";
2
+ import { Fulfillment } from "./fulfillment";
3
+ import { FulfillmentProvider } from "./fulfillment-provider";
4
+ import { FulfillmentSet } from "./fulfillment-set";
5
+ import { InventoryItem } from "./inventory-item";
6
+ import { Invite } from "./invite";
7
+ import { Order } from "./order";
8
+ import { PriceList } from "./price-list";
9
+ import { Product } from "./product";
10
+ import { ProductCategory } from "./product-category";
11
+ import { ProductCollection } from "./product-collection";
12
+ import { ProductType } from "./product-type";
13
+ import { Region } from "./region";
14
+ import { SalesChannel } from "./sales-channel";
15
+ import { ShippingOption } from "./shipping-option";
16
+ import { ShippingProfile } from "./shipping-profile";
17
+ import { StockLocation } from "./stock-location";
18
+ import { Store } from "./store";
19
+ import { TaxRate } from "./tax-rate";
20
+ import { TaxRegion } from "./tax-region";
21
+ import { Upload } from "./upload";
1
22
  export class Admin {
2
23
  constructor(client) {
3
- this.region = {
4
- create: async (body, query, headers) => {
5
- return await this.client.fetch(`/admin/regions`, {
6
- method: "POST",
7
- headers,
8
- body,
9
- query,
10
- });
11
- },
12
- update: async (id, body, query, headers) => {
13
- return await this.client.fetch(`/admin/regions/${id}`, {
14
- method: "POST",
15
- headers,
16
- body,
17
- query,
18
- });
19
- },
20
- list: async (queryParams, headers) => {
21
- return await this.client.fetch(`/admin/regions`, {
22
- query: queryParams,
23
- headers,
24
- });
25
- },
26
- retrieve: async (id, query, headers) => {
27
- return await this.client.fetch(`/admin/regions/${id}`, {
28
- query,
29
- headers,
30
- });
31
- },
32
- delete: async (id, headers) => {
33
- return await this.client.fetch(`/admin/regions/${id}`, {
34
- method: "DELETE",
35
- headers,
36
- });
37
- },
38
- };
39
- this.invites = {
40
- accept: async (input, query, headers) => {
41
- const { invite_token, ...rest } = input;
42
- return await this.client.fetch(`/admin/invites/accept?token=${input.invite_token}`, {
43
- method: "POST",
44
- headers,
45
- body: rest,
46
- query,
47
- });
48
- },
49
- create: async (body, query, headers) => {
50
- return await this.client.fetch(`/admin/invites`, {
51
- method: "POST",
52
- headers,
53
- body,
54
- query,
55
- });
56
- },
57
- retrieve: async (id, query, headers) => {
58
- return await this.client.fetch(`/admin/invites/${id}`, {
59
- headers,
60
- query,
61
- });
62
- },
63
- list: async (queryParams, headers) => {
64
- return await this.client.fetch(`/admin/invites`, {
65
- headers,
66
- query: queryParams,
67
- });
68
- },
69
- resend: async (id, headers) => {
70
- return await this.client.fetch(`/admin/invites/${id}/resend`, {
71
- headers,
72
- });
73
- },
74
- delete: async (id, headers) => {
75
- return await this.client.fetch(`/admin/invites/${id}`, {
76
- method: "DELETE",
77
- headers,
78
- });
79
- },
80
- };
81
- this.products = {
82
- create: async (body, query, headers) => {
83
- return await this.client.fetch(`/admin/products`, {
84
- method: "POST",
85
- headers,
86
- body,
87
- query,
88
- });
89
- },
90
- };
91
- this.customer = {
92
- create: async (body, query, headers) => {
93
- return this.client.fetch(`/admin/customers`, {
94
- method: "POST",
95
- headers,
96
- body,
97
- query,
98
- });
99
- },
100
- update: async (id, body, query, headers) => {
101
- return this.client.fetch(`/admin/customers/${id}`, {
102
- method: "POST",
103
- headers,
104
- body,
105
- query,
106
- });
107
- },
108
- list: async (queryParams, headers) => {
109
- return this.client.fetch(`/admin/customers`, {
110
- headers,
111
- query: queryParams,
112
- });
113
- },
114
- retrieve: async (id, query, headers) => {
115
- return this.client.fetch(`/admin/customers/${id}`, {
116
- query,
117
- headers,
118
- });
119
- },
120
- delete: async (id, headers) => {
121
- return this.client.fetch(`/admin/customers/${id}`, {
122
- method: "DELETE",
123
- headers,
124
- });
125
- },
126
- };
127
- this.collection = {
128
- create: async (body, query, headers) => {
129
- return this.client.fetch(`/admin/collections`, {
130
- method: "POST",
131
- headers,
132
- body,
133
- query,
134
- });
135
- },
136
- update: async (id, body, query, headers) => {
137
- return this.client.fetch(`/admin/collections/${id}`, {
138
- method: "POST",
139
- headers,
140
- body,
141
- query,
142
- });
143
- },
144
- list: async (queryParams, headers) => {
145
- return this.client.fetch(`/admin/collections`, {
146
- headers,
147
- query: queryParams,
148
- });
149
- },
150
- retrieve: async (id, query, headers) => {
151
- return this.client.fetch(`/admin/collections/${id}`, {
152
- query,
153
- headers,
154
- });
155
- },
156
- delete: async (id, headers) => {
157
- return this.client.fetch(`/admin/collections/${id}`, {
158
- method: "DELETE",
159
- headers,
160
- });
161
- },
162
- updateProducts: async (id, body, headers) => {
163
- return this.client.fetch(`/admin/collections/${id}/products`, {
164
- method: "POST",
165
- headers,
166
- body,
167
- });
168
- },
169
- };
170
- this.client = client;
24
+ this.invite = new Invite(client);
25
+ this.customer = new Customer(client);
26
+ this.productCollection = new ProductCollection(client);
27
+ this.productCategory = new ProductCategory(client);
28
+ this.priceList = new PriceList(client);
29
+ this.product = new Product(client);
30
+ this.productType = new ProductType(client);
31
+ this.upload = new Upload(client);
32
+ this.region = new Region(client);
33
+ this.stockLocation = new StockLocation(client);
34
+ this.salesChannel = new SalesChannel(client);
35
+ this.fulfillmentSet = new FulfillmentSet(client);
36
+ this.fulfillment = new Fulfillment(client);
37
+ this.fulfillmentProvider = new FulfillmentProvider(client);
38
+ this.shippingOption = new ShippingOption(client);
39
+ this.shippingProfile = new ShippingProfile(client);
40
+ this.inventoryItem = new InventoryItem(client);
41
+ this.order = new Order(client);
42
+ this.taxRate = new TaxRate(client);
43
+ this.taxRegion = new TaxRegion(client);
44
+ this.store = new Store(client);
171
45
  }
172
46
  }
173
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,KAAK;IAEhB,YAAY,MAAc;QAInB,WAAM,GAAG;YACd,MAAM,EAAE,KAAK,EACX,IAAiC,EACjC,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,gBAAgB,EAChB;oBACE,MAAM,EAAE,MAAM;oBACd,OAAO;oBACP,IAAI;oBACJ,KAAK;iBACN,CACF,CAAA;YACH,CAAC;YACD,MAAM,EAAE,KAAK,EACX,EAAU,EACV,IAAiC,EACjC,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,kBAAkB,EAAE,EAAE,EACtB;oBACE,MAAM,EAAE,MAAM;oBACd,OAAO;oB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E,KAAK,EACX,EAAU,EACV,IAAqC,EACrC,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,EAAE,EAC1B;oBACE,MAAM,EAAE,MAAM;oBACd,OAAO;oBACP,IAAI;oBACJ,KAAK;iBACN,CACF,CAAA;YACH,CAAC;YACD,IAAI,EAAE,KAAK,EAAE,WAAwB,EAAE,OAAuB,EAAE,EAAE;gBAChE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,oBAAoB,EAAE;oBACtB,OAAO;oBACP,KAAK,EAAE,WAAW;iBACnB,CAAC,CAAA;YACJ,CAAC;YACD,QAAQ,EAAE,KAAK,EACb,EAAU,EACV,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,EAAE,EAC1B;oBACE,KAAK;oBACL,OAAO;iBACR,CACF,CAAA;YACH,CAAC;YACD,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,OAAuB,EAAE,EAAE;gBACpD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,EAAE,EAC1B;oBACE,MAAM,EAAE,QAAQ;oBAChB,OAAO;iBACR,CACF,CAAA;YACH,CAAC;YACD,cAAc,EAAE,KAAK,EACnB,EAAU,EACV,IAA6C,EAC7C,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,sBAAsB,EAAE,WAAW,EACnC;oBACE,MAAM,EAAE,MAAM;oBACd,OAAO;oBACP,IAAI;iBACL,CACF,CAAA;YACH,CAAC;SACF,CAAA;QA9SC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CA8SF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAA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AAA;IAChC,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import { HttpTypes, SelectParams } from "@medusajs/types";
2
+ import { Client } from "../client";
3
+ import { ClientHeaders } from "../types";
4
+ export declare class InventoryItem {
5
+ private client;
6
+ constructor(client: Client);
7
+ create(body: HttpTypes.AdminCreateInventoryItem, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemResponse>;
8
+ update(id: string, body: HttpTypes.AdminUpdateInventoryItem, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemResponse>;
9
+ list(query?: HttpTypes.AdminInventoryItemParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemListResponse>;
10
+ retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemResponse>;
11
+ delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemDeleteResponse>;
12
+ listLevels(id: string, query?: HttpTypes.AdminInventoryLevelFilters, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryLevelListResponse>;
13
+ updateLevel(id: string, locationId: string, body: HttpTypes.AdminUpdateInventoryLevel, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemResponse>;
14
+ deleteLevel(id: string, locationId: string, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemDeleteResponse>;
15
+ batchUpdateLevels(id: string, body: HttpTypes.AdminBatchUpdateInventoryLevelLocation, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInventoryItemResponse>;
16
+ }
@@ -0,0 +1,68 @@
1
+ export class InventoryItem {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ async create(body, query, headers) {
6
+ return await this.client.fetch(`/admin/inventory-items`, {
7
+ method: "POST",
8
+ headers,
9
+ body,
10
+ query,
11
+ });
12
+ }
13
+ async update(id, body, query, headers) {
14
+ return await this.client.fetch(`/admin/inventory-items/${id}`, {
15
+ method: "POST",
16
+ headers,
17
+ body,
18
+ query,
19
+ });
20
+ }
21
+ async list(query, headers) {
22
+ return await this.client.fetch(`/admin/inventory-items`, {
23
+ query,
24
+ headers,
25
+ });
26
+ }
27
+ async retrieve(id, query, headers) {
28
+ return await this.client.fetch(`/admin/inventory-items/${id}`, {
29
+ query,
30
+ headers,
31
+ });
32
+ }
33
+ async delete(id, headers) {
34
+ return await this.client.fetch(`/admin/inventory-items/${id}`, {
35
+ method: "DELETE",
36
+ headers,
37
+ });
38
+ }
39
+ async listLevels(id, query, headers) {
40
+ return await this.client.fetch(`/admin/inventory-items/${id}/location-levels`, {
41
+ query,
42
+ headers,
43
+ });
44
+ }
45
+ async updateLevel(id, locationId, body, query, headers) {
46
+ return await this.client.fetch(`/admin/inventory-items/${id}/location-levels/${locationId}`, {
47
+ method: "POST",
48
+ headers,
49
+ body,
50
+ query,
51
+ });
52
+ }
53
+ async deleteLevel(id, locationId, headers) {
54
+ return await this.client.fetch(`/admin/inventory-items/${id}/location-levels/${locationId}`, {
55
+ method: "DELETE",
56
+ headers,
57
+ });
58
+ }
59
+ async batchUpdateLevels(id, body, query, headers) {
60
+ return await this.client.fetch(`/admin/inventory-items/${id}/location-levels/batch`, {
61
+ method: "POST",
62
+ headers,
63
+ body,
64
+ query,
65
+ });
66
+ }
67
+ }
68
+ //# sourceMappingURL=inventory-item.js.map