@connect-plus-online/ogabai-integrations 0.0.18 → 0.0.19

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/dist/index.cjs.js CHANGED
@@ -1127,12 +1127,13 @@ var productSchema = {
1127
1127
  };
1128
1128
 
1129
1129
  // src/services/file/file.service.ts
1130
- var createFileService = (client) => ({
1130
+ var createFileService = ({
1131
+ url,
1132
+ accessToken
1133
+ }) => ({
1131
1134
  async uploadFile(formData) {
1132
- const url = client["url"].replace("/graphql", "") + "/api/upload";
1133
- const token = await client["tokenProvider"]();
1134
1135
  const headers = {
1135
- ...token ? { Authorization: `Bearer ${token}` } : {}
1136
+ ...accessToken ? { Authorization: `Bearer ${accessToken}` } : {}
1136
1137
  };
1137
1138
  console.log("***************************************");
1138
1139
  console.log({ headers });
@@ -1156,7 +1157,15 @@ var createFileService = (client) => ({
1156
1157
  // src/services/inventory/product.service.ts
1157
1158
  var createProductService = (client) => ({
1158
1159
  async uploadProductImage(form) {
1159
- const fileClient = createFileService(client);
1160
+ const url = client["url"].replace("/graphql", "") + "/api/upload";
1161
+ const accessToken = await client["tokenProvider"]();
1162
+ console.log("*****************************");
1163
+ console.log({ url, accessToken });
1164
+ console.log("*****************************");
1165
+ const fileClient = createFileService({
1166
+ url,
1167
+ accessToken
1168
+ });
1160
1169
  return (await fileClient.uploadFile(form)).product;
1161
1170
  },
1162
1171
  async searchCategoriesAndTemplate(input, fetchFields, option) {