@fluid-app/portal-sdk 0.1.140 → 0.1.142
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/{ContactsScreen-DlLy87h_.cjs → ContactsScreen-BPeQemgG.cjs} +28 -33
- package/dist/ContactsScreen-BPeQemgG.cjs.map +1 -0
- package/dist/{ContactsScreen-DNQMiNlS.mjs → ContactsScreen-cWDFP8e-.mjs} +28 -33
- package/dist/ContactsScreen-cWDFP8e-.mjs.map +1 -0
- package/dist/{ContactsScreen-Ch84WukS.cjs → ContactsScreen-gJB99SIY.cjs} +1 -1
- package/dist/{OrdersScreen-Bnb_9MmQ.cjs → OrdersScreen-BB_n4hgl.cjs} +1 -1
- package/dist/{OrdersScreen-3ekrgdeJ.mjs → OrdersScreen-BHtq-tvn.mjs} +2 -2
- package/dist/{OrdersScreen-3ekrgdeJ.mjs.map → OrdersScreen-BHtq-tvn.mjs.map} +1 -1
- package/dist/{OrdersScreen-BpgyybYv.cjs → OrdersScreen-CbCus7pT.cjs} +2 -2
- package/dist/{OrdersScreen-BpgyybYv.cjs.map → OrdersScreen-CbCus7pT.cjs.map} +1 -1
- package/dist/{ProductsScreen-DTpNKgt-.cjs → ProductsScreen-CP29k8Z3.cjs} +1 -1
- package/dist/{ProductsScreen-DWdePYt1.mjs → ProductsScreen-CU8nGFN5.mjs} +2 -2
- package/dist/{ProductsScreen-DWdePYt1.mjs.map → ProductsScreen-CU8nGFN5.mjs.map} +1 -1
- package/dist/{ProductsScreen-CdkcbVlB.cjs → ProductsScreen-CuMgdka9.cjs} +2 -2
- package/dist/{ProductsScreen-CdkcbVlB.cjs.map → ProductsScreen-CuMgdka9.cjs.map} +1 -1
- package/dist/{ProductsScreen-DvZu_1eL.mjs → ProductsScreen-DSgwSnVj.mjs} +1 -1
- package/dist/{ProfileScreen-LHDIyy7E.mjs → ProfileScreen-BajH0_kR.mjs} +2 -2
- package/dist/{ProfileScreen-LHDIyy7E.mjs.map → ProfileScreen-BajH0_kR.mjs.map} +1 -1
- package/dist/{ProfileScreen-B8M9aU0e.cjs → ProfileScreen-CDZ632ue.cjs} +2 -2
- package/dist/{ProfileScreen-B8M9aU0e.cjs.map → ProfileScreen-CDZ632ue.cjs.map} +1 -1
- package/dist/{ProfileScreen-cfqauoLb.cjs → ProfileScreen-CjrhOuY3.cjs} +1 -1
- package/dist/{ShareablesScreen-B6ZvbSB9.mjs → ShareablesScreen-B63fbgRJ.mjs} +1 -1
- package/dist/{ShareablesScreen--gmqmzBa.mjs → ShareablesScreen-F3ockfKE.mjs} +2 -2
- package/dist/{ShareablesScreen--gmqmzBa.mjs.map → ShareablesScreen-F3ockfKE.mjs.map} +1 -1
- package/dist/{ShareablesScreen-Cik6hIjb.cjs → ShareablesScreen-ITLkfDHV.cjs} +2 -2
- package/dist/{ShareablesScreen-Cik6hIjb.cjs.map → ShareablesScreen-ITLkfDHV.cjs.map} +1 -1
- package/dist/{ShareablesScreen-DAyoNLBd.cjs → ShareablesScreen-acj-gCLe.cjs} +1 -1
- package/dist/{SubscriptionsScreen-BK8qvbi5.cjs → SubscriptionsScreen-01RuJl73.cjs} +1 -1
- package/dist/{SubscriptionsScreen-DabXd_9r.mjs → SubscriptionsScreen-B2-iZojm.mjs} +2 -2
- package/dist/{SubscriptionsScreen-DabXd_9r.mjs.map → SubscriptionsScreen-B2-iZojm.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-CMiwa63C.cjs → SubscriptionsScreen-DV5RUV66.cjs} +2 -2
- package/dist/{SubscriptionsScreen-CMiwa63C.cjs.map → SubscriptionsScreen-DV5RUV66.cjs.map} +1 -1
- package/dist/index.cjs +18 -18
- package/dist/index.mjs +18 -18
- package/dist/{use-account-clients-D7oen4jF.mjs → use-account-clients-CNDyBxm7.mjs} +1 -7
- package/dist/use-account-clients-CNDyBxm7.mjs.map +1 -0
- package/dist/{use-account-clients-CFT974q2.cjs → use-account-clients-nmrVvm98.cjs} +1 -7
- package/dist/use-account-clients-nmrVvm98.cjs.map +1 -0
- package/package.json +10 -10
- package/dist/ContactsScreen-DNQMiNlS.mjs.map +0 -1
- package/dist/ContactsScreen-DlLy87h_.cjs.map +0 -1
- package/dist/use-account-clients-CFT974q2.cjs.map +0 -1
- package/dist/use-account-clients-D7oen4jF.mjs.map +0 -1
|
@@ -2183,7 +2183,7 @@ function useToggleTaskCompletion(contactId) {
|
|
|
2183
2183
|
const queryClient = useQueryClient();
|
|
2184
2184
|
const api = useTasksApi();
|
|
2185
2185
|
return useMutation({
|
|
2186
|
-
mutationFn: ({ taskId, isCompleted }) => api.updateTask(taskId, { completed_at: isCompleted ? null : (/* @__PURE__ */ new Date()).toISOString() }),
|
|
2186
|
+
mutationFn: ({ taskId, isCompleted }) => api.updateTask(taskId, contactId, { completed_at: isCompleted ? null : (/* @__PURE__ */ new Date()).toISOString() }),
|
|
2187
2187
|
onSuccess: () => {
|
|
2188
2188
|
queryClient.invalidateQueries({ queryKey: contactsKeys.tasks(contactId) });
|
|
2189
2189
|
},
|
|
@@ -2202,7 +2202,7 @@ function useDeleteContactTask(contactId, options) {
|
|
|
2202
2202
|
const queryClient = useQueryClient();
|
|
2203
2203
|
const api = useTasksApi();
|
|
2204
2204
|
return useMutation({
|
|
2205
|
-
mutationFn: (taskId) => api.deleteTask(taskId),
|
|
2205
|
+
mutationFn: (taskId) => api.deleteTask(taskId, contactId),
|
|
2206
2206
|
onSuccess: () => {
|
|
2207
2207
|
fluidToast({
|
|
2208
2208
|
title: "Task deleted",
|
|
@@ -2250,7 +2250,7 @@ function useUpdateContactTask(contactId, options) {
|
|
|
2250
2250
|
const queryClient = useQueryClient();
|
|
2251
2251
|
const api = useTasksApi();
|
|
2252
2252
|
return useMutation({
|
|
2253
|
-
mutationFn: ({ taskId, input }) => api.updateTask(taskId, input),
|
|
2253
|
+
mutationFn: ({ taskId, input }) => api.updateTask(taskId, contactId, input),
|
|
2254
2254
|
onSuccess: () => {
|
|
2255
2255
|
fluidToast({
|
|
2256
2256
|
title: "Task updated",
|
|
@@ -2534,8 +2534,11 @@ function useContactActivities(contactId, options) {
|
|
|
2534
2534
|
const api = useContactsCrud();
|
|
2535
2535
|
return useQuery({
|
|
2536
2536
|
queryKey: contactsKeys.activities(contactId),
|
|
2537
|
-
queryFn: () =>
|
|
2538
|
-
|
|
2537
|
+
queryFn: () => {
|
|
2538
|
+
if (!api.listActivities) throw new Error("listActivities is not available in this adapter");
|
|
2539
|
+
return api.listActivities(contactId);
|
|
2540
|
+
},
|
|
2541
|
+
enabled: options?.enabled !== false && !!contactId && !!api.listActivities,
|
|
2539
2542
|
select: (data) => data.activities
|
|
2540
2543
|
});
|
|
2541
2544
|
}
|
|
@@ -2568,7 +2571,10 @@ function useMarkContactRead(contactId) {
|
|
|
2568
2571
|
const api = useContactsCrud();
|
|
2569
2572
|
const queryKey = contactsKeys.activities(contactId);
|
|
2570
2573
|
return useMutation({
|
|
2571
|
-
mutationFn: () =>
|
|
2574
|
+
mutationFn: () => {
|
|
2575
|
+
if (!api.markRead) return Promise.resolve({});
|
|
2576
|
+
return api.markRead(contactId);
|
|
2577
|
+
},
|
|
2572
2578
|
onMutate: () => {
|
|
2573
2579
|
const previous = queryClient.getQueryData(queryKey);
|
|
2574
2580
|
if (previous) {
|
|
@@ -3276,8 +3282,11 @@ function useContactOrders(contactId, params) {
|
|
|
3276
3282
|
params?.per_page,
|
|
3277
3283
|
params?.status
|
|
3278
3284
|
],
|
|
3279
|
-
queryFn: () =>
|
|
3280
|
-
|
|
3285
|
+
queryFn: () => {
|
|
3286
|
+
if (!api.listOrders) throw new Error("listOrders is not available in this adapter");
|
|
3287
|
+
return api.listOrders(contactId, params);
|
|
3288
|
+
},
|
|
3289
|
+
enabled: !!contactId && !!api.listOrders,
|
|
3281
3290
|
placeholderData: keepPreviousData
|
|
3282
3291
|
});
|
|
3283
3292
|
}
|
|
@@ -3556,8 +3565,11 @@ function useContactSubscriptionOrders(contactId, params) {
|
|
|
3556
3565
|
params?.per_page,
|
|
3557
3566
|
params?.status
|
|
3558
3567
|
],
|
|
3559
|
-
queryFn: () =>
|
|
3560
|
-
|
|
3568
|
+
queryFn: () => {
|
|
3569
|
+
if (!api.listSubscriptionOrders) throw new Error("listSubscriptionOrders is not available in this adapter");
|
|
3570
|
+
return api.listSubscriptionOrders(contactId, params);
|
|
3571
|
+
},
|
|
3572
|
+
enabled: !!contactId && !!api.listSubscriptionOrders,
|
|
3561
3573
|
placeholderData: keepPreviousData
|
|
3562
3574
|
});
|
|
3563
3575
|
}
|
|
@@ -4327,20 +4339,7 @@ function createContactsAdapter(client) {
|
|
|
4327
4339
|
},
|
|
4328
4340
|
bulkDeleteContacts: async (ids) => {
|
|
4329
4341
|
return contacts_bulk_destroy(client, { ids });
|
|
4330
|
-
}
|
|
4331
|
-
listActivities: async () => ({
|
|
4332
|
-
activities: [],
|
|
4333
|
-
meta: EMPTY_META
|
|
4334
|
-
}),
|
|
4335
|
-
markRead: async () => ({}),
|
|
4336
|
-
listOrders: async () => ({
|
|
4337
|
-
orders: [],
|
|
4338
|
-
meta: EMPTY_META
|
|
4339
|
-
}),
|
|
4340
|
-
listSubscriptionOrders: async () => ({
|
|
4341
|
-
subscription_orders: [],
|
|
4342
|
-
meta: EMPTY_META
|
|
4343
|
-
})
|
|
4342
|
+
}
|
|
4344
4343
|
};
|
|
4345
4344
|
}
|
|
4346
4345
|
function createNotesAdapter(client) {
|
|
@@ -4360,29 +4359,25 @@ function createNotesAdapter(client) {
|
|
|
4360
4359
|
};
|
|
4361
4360
|
}
|
|
4362
4361
|
function createTasksAdapter(client) {
|
|
4363
|
-
let lastContactId = 0;
|
|
4364
4362
|
return {
|
|
4365
4363
|
listTasks: async (contactId) => {
|
|
4366
|
-
lastContactId = contactId;
|
|
4367
4364
|
return { tasks: ((await contacts_tasks_list(client, contactId)).tasks ?? []).map(mapTask) };
|
|
4368
4365
|
},
|
|
4369
4366
|
createTask: async (contactId, input) => {
|
|
4370
|
-
lastContactId = contactId;
|
|
4371
4367
|
return contacts_tasks_create(client, contactId, { task: {
|
|
4372
4368
|
title: input.body,
|
|
4373
4369
|
due_date: input.due_at
|
|
4374
4370
|
} });
|
|
4375
4371
|
},
|
|
4376
|
-
updateTask: async (taskId, input) => {
|
|
4377
|
-
return contacts_tasks_update(client,
|
|
4372
|
+
updateTask: async (taskId, contactId, input) => {
|
|
4373
|
+
return contacts_tasks_update(client, contactId, taskId, { task: {
|
|
4378
4374
|
title: input.body ?? void 0,
|
|
4379
4375
|
completed: input.completed_at !== void 0 ? input.completed_at !== null : void 0,
|
|
4380
4376
|
due_date: input.due_at
|
|
4381
4377
|
} });
|
|
4382
4378
|
},
|
|
4383
|
-
deleteTask: async (taskId) => {
|
|
4384
|
-
|
|
4385
|
-
return contacts_tasks_destroy(client, lastContactId, taskId);
|
|
4379
|
+
deleteTask: async (taskId, contactId) => {
|
|
4380
|
+
return contacts_tasks_destroy(client, contactId, taskId);
|
|
4386
4381
|
}
|
|
4387
4382
|
};
|
|
4388
4383
|
}
|
|
@@ -4629,4 +4624,4 @@ const contactsScreenPropertySchema = {
|
|
|
4629
4624
|
//#endregion
|
|
4630
4625
|
export { ContactsScreen_exports as n, contactsScreenPropertySchema as r, ContactsScreen as t };
|
|
4631
4626
|
|
|
4632
|
-
//# sourceMappingURL=ContactsScreen-
|
|
4627
|
+
//# sourceMappingURL=ContactsScreen-cWDFP8e-.mjs.map
|