@visa-check-r/integrations 0.0.30 → 0.0.32

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.d.mts CHANGED
@@ -158,6 +158,8 @@ interface VisaProfileReviewComment {
158
158
  createdAt: string;
159
159
  visaProfileChecklistItemId?: string;
160
160
  visaProfileChecklistItem?: VisaProfileChecklistItem;
161
+ userId: string;
162
+ user?: User;
161
163
  }
162
164
  interface VisaApplication {
163
165
  id: string;
@@ -922,6 +924,7 @@ type DeleteVisaProfileChecklistItemResponse = DeleteVisaProfileChecklistItemRequ
922
924
  declare const deleteVisaProfileChecklistItemResponse: (keyof DeleteVisaProfileChecklistItemResponse)[];
923
925
 
924
926
  declare const createVisaProfileChecklistItemService: (client: GraphQLClient) => {
927
+ uploadChecklistImage(form: FormData): Promise<VisaProfileChecklistItem>;
925
928
  deleteVisaProfileChecklistItem(input: DeleteVisaProfileChecklistItemRequest, fetchFields?: {
926
929
  root?: (keyof DeleteVisaProfileChecklistItemResponse)[];
927
930
  }, option?: RequestOption): Promise<DeleteVisaProfileChecklistItemResponse | undefined>;
package/dist/index.d.ts CHANGED
@@ -158,6 +158,8 @@ interface VisaProfileReviewComment {
158
158
  createdAt: string;
159
159
  visaProfileChecklistItemId?: string;
160
160
  visaProfileChecklistItem?: VisaProfileChecklistItem;
161
+ userId: string;
162
+ user?: User;
161
163
  }
162
164
  interface VisaApplication {
163
165
  id: string;
@@ -922,6 +924,7 @@ type DeleteVisaProfileChecklistItemResponse = DeleteVisaProfileChecklistItemRequ
922
924
  declare const deleteVisaProfileChecklistItemResponse: (keyof DeleteVisaProfileChecklistItemResponse)[];
923
925
 
924
926
  declare const createVisaProfileChecklistItemService: (client: GraphQLClient) => {
927
+ uploadChecklistImage(form: FormData): Promise<VisaProfileChecklistItem>;
925
928
  deleteVisaProfileChecklistItem(input: DeleteVisaProfileChecklistItemRequest, fetchFields?: {
926
929
  root?: (keyof DeleteVisaProfileChecklistItemResponse)[];
927
930
  }, option?: RequestOption): Promise<DeleteVisaProfileChecklistItemResponse | undefined>;
package/dist/index.esm.js CHANGED
@@ -1280,6 +1280,30 @@ var createChecklistItemService = (client) => ({
1280
1280
  }
1281
1281
  });
1282
1282
 
1283
+ // src/services/file/file.service.ts
1284
+ var createFileService = (client) => ({
1285
+ async uploadFile(formData) {
1286
+ const url = client["url"].replace("/graphql", "") + "/api/upload";
1287
+ const token = await client.token();
1288
+ const headers = {
1289
+ ...token ? { Authorization: `Bearer ${token}` } : {}
1290
+ };
1291
+ const res = await fetch(url, {
1292
+ method: "POST",
1293
+ headers,
1294
+ body: formData
1295
+ // native FormData works fine
1296
+ });
1297
+ const text = await res.text();
1298
+ if (!res.ok) throw new Error(`File upload failed: ${res.status} - ${text}`);
1299
+ try {
1300
+ return JSON.parse(text);
1301
+ } catch (e) {
1302
+ return text;
1303
+ }
1304
+ }
1305
+ });
1306
+
1283
1307
  // src/services/checklist/schemas/visaprofile-checklist-item.schema.ts
1284
1308
  var visaProfileChecklistItemSchema = {
1285
1309
  createVisaProfileChecklistItems: (query) => `
@@ -1367,6 +1391,11 @@ var deleteVisaProfileChecklistItemResponse = ["visaProfileChecklistItemId"];
1367
1391
 
1368
1392
  // src/services/checklist/visa-profile-checklist-item.service.ts
1369
1393
  var createVisaProfileChecklistItemService = (client) => ({
1394
+ // upload file
1395
+ async uploadChecklistImage(form) {
1396
+ const fileClient = createFileService(client);
1397
+ return (await fileClient.uploadFile(form)).visaProfileChecklistItem;
1398
+ },
1370
1399
  async deleteVisaProfileChecklistItem(input, fetchFields, option) {
1371
1400
  var _a, _b;
1372
1401
  const res = await client.request(