@medusajs/js-sdk 0.0.2-snapshot-20240528143001 → 0.0.2-snapshot-20240529101443

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,7 +52,7 @@ export declare class Admin {
52
52
  update: (id: string, body: HttpTypes.AdminUpdateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<{
53
53
  customer: HttpTypes.AdminCustomer;
54
54
  }>;
55
- list: (queryParams?: FindParams, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
55
+ list: (queryParams?: FindParams & HttpTypes.AdminCollectionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
56
56
  customers: HttpTypes.AdminCustomer[];
57
57
  }>>;
58
58
  retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
@@ -60,4 +60,22 @@ export declare class Admin {
60
60
  }>;
61
61
  delete: (id: string, headers?: ClientHeaders) => Promise<DeleteResponse<"customer">>;
62
62
  };
63
+ collection: {
64
+ create: (body: HttpTypes.AdminCreateCollection, query?: SelectParams, headers?: ClientHeaders) => Promise<{
65
+ collection: HttpTypes.AdminCollection;
66
+ }>;
67
+ update: (id: string, body: HttpTypes.AdminUpdateCollection, query?: SelectParams, headers?: ClientHeaders) => Promise<{
68
+ collection: HttpTypes.AdminCollection;
69
+ }>;
70
+ list: (queryParams?: FindParams, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
71
+ collections: HttpTypes.AdminCollection[];
72
+ }>>;
73
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
74
+ collection: HttpTypes.AdminCollection;
75
+ }>;
76
+ delete: (id: string, headers?: ClientHeaders) => Promise<DeleteResponse<"collection">>;
77
+ updateProducts: (id: string, body: HttpTypes.AdminUpdateCollectionProducts, headers?: ClientHeaders) => Promise<{
78
+ collection: HttpTypes.AdminCollection;
79
+ }>;
80
+ };
63
81
  }
@@ -124,6 +124,49 @@ export class Admin {
124
124
  });
125
125
  },
126
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
+ };
127
170
  this.client = client;
128
171
  }
129
172
  }
@@ -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;oBACP,IAAI;oBACJ,KAAK;iB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AE;oBACrB,MAAM,EAAE,MAAM;oBACd,OAAO;oBACP,IAAI;oBACJ,KAAK;iBACN,CAAC,CAAA;YACJ,CAAC;YACD,MAAM,EAAE,KAAK,EACX,EAAU,EACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;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,kBAAkB,EAAE;oBACpB,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,oBAAoB,EAAE,EAAE,EACxB;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,oBAAoB,EAAE,EAAE,EACxB;oBACE,MAAM,EAAE,QAAQ;oBAChB,OAAO;iBACR,CACF,CAAA;YACH,CAAC;SACF,CAAA;QA9NC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CA8NF"}
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,MAA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7C,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;QA/SC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CA+SF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/js-sdk",
3
- "version": "0.0.2-snapshot-20240528143001",
3
+ "version": "0.0.2-snapshot-20240529101443",
4
4
  "description": "SDK for the Medusa API",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "typescript": "^5.1.6"
29
29
  },
30
30
  "dependencies": {
31
- "@medusajs/types": "1.12.0-snapshot-20240528143001",
31
+ "@medusajs/types": "1.12.0-snapshot-20240529101443",
32
32
  "qs": "^6.12.1"
33
33
  },
34
34
  "scripts": {