@go-avro/avro-js 1.6.4-rc2 → 1.6.4
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/client/QueryClient.d.ts +5 -10
- package/dist/client/QueryClient.js +4 -5
- package/dist/client/hooks/companies.js +0 -18
- package/dist/types/api.d.ts +1 -14
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Socket } from 'socket.io-client';
|
|
2
2
|
import { InfiniteData, QueryClient, UseInfiniteQueryResult, useMutation, UseQueryResult } from '@tanstack/react-query';
|
|
3
3
|
import { AuthManager } from '../auth/AuthManager.js';
|
|
4
|
-
import { _Event, ActiveSessionSummary, AddressFeatureCollection, ApiInfo, Avro, StorageAnalytics, ClientErrorReport, ErrorLogEntry, PerformanceMetrics, AuditLogEntry, AuditQueryParams, Bill, BillInsightData, BillLineItemStatusUpdate, BillStatus, Break, Chat, CheckIn, Company, DelayEventCreatePayload, EventUpdatePayload, LineItemType, FinancialInsightData, RevenueInsightData, Job, JobUpdate, EventInsightData,
|
|
4
|
+
import { _Event, ActiveSessionSummary, AddressFeatureCollection, ApiInfo, Avro, StorageAnalytics, ClientErrorReport, ErrorLogEntry, PerformanceMetrics, AuditLogEntry, AuditQueryParams, Bill, BillInsightData, BillLineItemStatusUpdate, BillStatus, Break, Chat, CheckIn, Company, DelayEventCreatePayload, EventUpdatePayload, LineItemType, FinancialInsightData, RevenueInsightData, Job, JobUpdate, EventInsightData, AppleLoginResult, LoginResponse, Message, Plan, Route, ServiceMonth, Session, Team, User, UserCompanyAssociation, UserMergeSummary, Skill, Group, Label, RouteScheduleConfig, RouteWritePayload, CatalogItem, Device, DeviceInfo, LocationServicesStatus, Payout, Prepayment, Timecard, TimecardActionType, TimecardStatus } from '../types/api.js';
|
|
5
5
|
import { AuthState, Tokens } from '../types/auth.js';
|
|
6
6
|
import { CancelToken, ClientId, RetryStrategy } from '../types/client.js';
|
|
7
7
|
import { StandardError } from '../types/error.js';
|
|
@@ -652,14 +652,6 @@ declare module './QueryClient.js' {
|
|
|
652
652
|
user_id: string;
|
|
653
653
|
data: Partial<UserCompanyAssociation>;
|
|
654
654
|
}>>;
|
|
655
|
-
useAddUserCompany(): ReturnType<typeof useMutation<{
|
|
656
|
-
msg: string;
|
|
657
|
-
id: string;
|
|
658
|
-
}, StandardError, {
|
|
659
|
-
userId: string;
|
|
660
|
-
groupId?: string;
|
|
661
|
-
companyId?: string;
|
|
662
|
-
}>>;
|
|
663
655
|
useRemoveUserCompany(): ReturnType<typeof useMutation<{
|
|
664
656
|
msg: string;
|
|
665
657
|
}, StandardError, {
|
|
@@ -892,7 +884,10 @@ export declare class AvroQueryClient {
|
|
|
892
884
|
/** Link an Apple ID to the signed-in account (fresh token + raw nonce). */
|
|
893
885
|
useAppleLink(): ReturnType<typeof useMutation<{
|
|
894
886
|
msg: string;
|
|
895
|
-
}, StandardError,
|
|
887
|
+
}, StandardError, {
|
|
888
|
+
token: string;
|
|
889
|
+
nonce: string;
|
|
890
|
+
authorizationCode?: string | null;
|
|
896
891
|
cancelToken?: CancelToken;
|
|
897
892
|
}>>;
|
|
898
893
|
/** Unlink the account's Apple ID; the server revokes Apple's grant. */
|
|
@@ -702,14 +702,13 @@ export class AvroQueryClient {
|
|
|
702
702
|
/** Link an Apple ID to the signed-in account (fresh token + raw nonce). */
|
|
703
703
|
useAppleLink() {
|
|
704
704
|
return useMutation({
|
|
705
|
-
mutationFn: async ({ cancelToken,
|
|
705
|
+
mutationFn: async ({ token, nonce, authorizationCode, cancelToken, }) => {
|
|
706
706
|
return this.post({
|
|
707
707
|
path: '/apple/link',
|
|
708
708
|
data: JSON.stringify({
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
authorization_code: proof.authorizationCode ?? undefined,
|
|
709
|
+
token,
|
|
710
|
+
nonce,
|
|
711
|
+
authorization_code: authorizationCode ?? undefined,
|
|
713
712
|
}),
|
|
714
713
|
cancelToken,
|
|
715
714
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -151,24 +151,6 @@ AvroQueryClient.prototype.useCreateUserCompany = function () {
|
|
|
151
151
|
},
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
|
-
/**
|
|
155
|
-
* Add an existing user to a company (the current one by default), optionally
|
|
156
|
-
* straight into a group such as a user type, in a single request.
|
|
157
|
-
*/
|
|
158
|
-
AvroQueryClient.prototype.useAddUserCompany = function () {
|
|
159
|
-
return useMutation({
|
|
160
|
-
mutationFn: async ({ userId, groupId, companyId, }) => {
|
|
161
|
-
return this.post({
|
|
162
|
-
path: `/company/${companyId ?? this.companyId}/user/${userId}`,
|
|
163
|
-
data: JSON.stringify({ user_id: userId, ...(groupId ? { group: groupId } : {}) }),
|
|
164
|
-
headers: { 'Content-Type': 'application/json' },
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
onSuccess: () => {
|
|
168
|
-
this.syncAfterMutation('member', 'company', 'group');
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
154
|
AvroQueryClient.prototype.useRemoveUserCompany = function () {
|
|
173
155
|
const queryClient = this.getQueryClient();
|
|
174
156
|
return useMutation({
|
package/dist/types/api.d.ts
CHANGED
|
@@ -59,8 +59,7 @@ export declare const LoginResponse: {
|
|
|
59
59
|
export type LoginResponse = (typeof LoginResponse)[keyof typeof LoginResponse];
|
|
60
60
|
/**
|
|
61
61
|
* Outcome of `useAppleLogin`. With no account for the Apple ID yet,
|
|
62
|
-
* `apple_token` is a one-time handle (10 min) for `useAppleRegister
|
|
63
|
-
* `useAppleLink` after signing in another way.
|
|
62
|
+
* `apple_token` is a one-time handle (10 min) for `useAppleRegister`.
|
|
64
63
|
*/
|
|
65
64
|
export type AppleLoginResult = {
|
|
66
65
|
status: typeof LoginResponse.SUCCESS;
|
|
@@ -70,18 +69,6 @@ export type AppleLoginResult = {
|
|
|
70
69
|
email: string | null;
|
|
71
70
|
is_private_email: boolean;
|
|
72
71
|
};
|
|
73
|
-
/**
|
|
74
|
-
* Proof of the Apple ID `useAppleLink` attaches: a fresh identity token and
|
|
75
|
-
* its raw nonce, or the `apple_token` handle from a `NEEDS_ACCOUNT` sign-in.
|
|
76
|
-
*/
|
|
77
|
-
export type AppleLinkProof = {
|
|
78
|
-
token: string;
|
|
79
|
-
nonce: string;
|
|
80
|
-
authorizationCode?: string | null;
|
|
81
|
-
} | {
|
|
82
|
-
appleToken: string;
|
|
83
|
-
authorizationCode?: string | null;
|
|
84
|
-
};
|
|
85
72
|
export interface ApiInfo {
|
|
86
73
|
app_semver: string;
|
|
87
74
|
build_time: string;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AVRO_JS_VERSION = "1.6.4
|
|
1
|
+
export declare const AVRO_JS_VERSION = "1.6.4";
|
package/dist/version.js
CHANGED