@go-avro/avro-js 1.6.6-rc10 → 1.6.6-rc12
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 +4 -4
- package/dist/client/hooks/{proposal_terms.js → terms.js} +14 -14
- package/dist/client/realtime.js +3 -3
- package/dist/client/requests.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/types/api/Avro.d.ts +5 -0
- package/dist/types/api/Proposal.d.ts +2 -2
- package/dist/types/api/{ProposalTerms.d.ts → Terms.d.ts} +3 -3
- package/dist/types/api.d.ts +1 -1
- package/dist/types/api.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- /package/dist/client/hooks/{proposal_terms.d.ts → terms.d.ts} +0 -0
- /package/dist/types/api/{ProposalTerms.js → Terms.js} +0 -0
|
@@ -8,7 +8,7 @@ import { StandardError } from '../types/error.js';
|
|
|
8
8
|
import { CacheData } from '../types/cache.js';
|
|
9
9
|
import { Waiver } from '../types/api/Waiver.js';
|
|
10
10
|
import { Proposal } from '../types/api/Proposal.js';
|
|
11
|
-
import {
|
|
11
|
+
import { Terms } from '../types/api/Terms.js';
|
|
12
12
|
import type { EmailSucceededPayload, EmailFailedPayload, EmailType } from '../types/api/EmailNotification.js';
|
|
13
13
|
import type { BulkDeleteBillsResponse, BulkEmailBillsResponse } from './hooks/bills.js';
|
|
14
14
|
import type { BillWritePayload, BreakWritePayload, CatalogItemCreatePayload, CatalogItemUpdatePayload, CompanyCreatePayload, CompanyUpdatePayload, EventCreatePayload, IntuitSyncStatus, MemberAddPayload, MemberUpdatePayload, PayoutStatusFilter, ProposalReviewPayload, ProposalWritePayload, SessionCreatePayload, SessionUpdatePayload, SkillCreatePayload, SkillUpdatePayload, TeamWritePayload, UserCreatePayload, UserUpdatePayload } from './requests.js';
|
|
@@ -193,8 +193,8 @@ declare module './QueryClient.js' {
|
|
|
193
193
|
msg: string;
|
|
194
194
|
}>;
|
|
195
195
|
useGetProposal(proposal_id: string): UseQueryResult<Proposal, StandardError>;
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
useGetTerms(): UseQueryResult<Terms[], StandardError>;
|
|
197
|
+
useCreateTerms(): ReturnType<typeof useMutation<{
|
|
198
198
|
msg: string;
|
|
199
199
|
id: string;
|
|
200
200
|
}, StandardError, {
|
|
@@ -202,7 +202,7 @@ declare module './QueryClient.js' {
|
|
|
202
202
|
body: string;
|
|
203
203
|
archived?: boolean;
|
|
204
204
|
}>>;
|
|
205
|
-
|
|
205
|
+
useUpdateTerms(): ReturnType<typeof useMutation<{
|
|
206
206
|
msg: string;
|
|
207
207
|
}, StandardError, {
|
|
208
208
|
termsId: string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
2
2
|
import { AvroQueryClient } from '../QueryClient.js';
|
|
3
3
|
import { keys } from '../realtime.js';
|
|
4
|
-
AvroQueryClient.prototype.
|
|
4
|
+
AvroQueryClient.prototype.useGetTerms = function () {
|
|
5
5
|
return useQuery({
|
|
6
|
-
queryKey: keys.list('
|
|
7
|
-
queryFn: () => this.get({ path: `/company/${this.companyId}/
|
|
6
|
+
queryKey: keys.list('terms', this.companyId),
|
|
7
|
+
queryFn: () => this.get({ path: `/company/${this.companyId}/terms` }),
|
|
8
8
|
enabled: Boolean(this.companyId),
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
AvroQueryClient.prototype.
|
|
11
|
+
AvroQueryClient.prototype.useCreateTerms = function () {
|
|
12
12
|
const queryClient = this.getQueryClient();
|
|
13
|
-
const listKey = keys.list('
|
|
13
|
+
const listKey = keys.list('terms', this.companyId);
|
|
14
14
|
return useMutation({
|
|
15
15
|
mutationFn: async (data) => {
|
|
16
16
|
return this.post({
|
|
17
|
-
path: `/company/${this.companyId}/
|
|
17
|
+
path: `/company/${this.companyId}/terms`,
|
|
18
18
|
data: JSON.stringify(data),
|
|
19
19
|
headers: { 'Content-Type': 'application/json' },
|
|
20
20
|
});
|
|
@@ -40,26 +40,26 @@ AvroQueryClient.prototype.useCreateProposalTerms = function () {
|
|
|
40
40
|
time_created: now,
|
|
41
41
|
time_updated: now,
|
|
42
42
|
};
|
|
43
|
-
queryClient.setQueryData(listKey, (old) => old ? [...old, optimistic] : old);
|
|
43
|
+
queryClient.setQueryData(listKey, (old) => (old ? [...old, optimistic] : old));
|
|
44
44
|
return { previous, tempId };
|
|
45
45
|
},
|
|
46
46
|
onSuccess: ({ id }, _variables, context) => {
|
|
47
47
|
queryClient.setQueryData(listKey, (old) => old?.some((t) => t.id === id)
|
|
48
48
|
? old.filter((t) => t.id !== context?.tempId)
|
|
49
49
|
: old?.map((t) => (t.id === context?.tempId ? { ...t, id } : t)));
|
|
50
|
-
this.syncAfterMutation('
|
|
50
|
+
this.syncAfterMutation('terms');
|
|
51
51
|
},
|
|
52
52
|
onError: (_err, _variables, context) => {
|
|
53
53
|
queryClient.setQueryData(listKey, context?.previous);
|
|
54
54
|
},
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
|
-
AvroQueryClient.prototype.
|
|
57
|
+
AvroQueryClient.prototype.useUpdateTerms = function () {
|
|
58
58
|
const queryClient = this.getQueryClient();
|
|
59
59
|
return useMutation({
|
|
60
60
|
mutationFn: async ({ termsId, updates, }) => {
|
|
61
61
|
return this.put({
|
|
62
|
-
path: `/
|
|
62
|
+
path: `/terms/${termsId}`,
|
|
63
63
|
data: JSON.stringify(updates),
|
|
64
64
|
headers: { 'Content-Type': 'application/json' },
|
|
65
65
|
});
|
|
@@ -78,13 +78,13 @@ AvroQueryClient.prototype.useUpdateProposalTerms = function () {
|
|
|
78
78
|
body: body ?? t.current_version.body,
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
|
-
await queryClient.cancelQueries({ queryKey: ['
|
|
82
|
-
const previous = queryClient.getQueriesData({ queryKey: ['
|
|
83
|
-
queryClient.setQueriesData({ queryKey: ['
|
|
81
|
+
await queryClient.cancelQueries({ queryKey: ['terms'] });
|
|
82
|
+
const previous = queryClient.getQueriesData({ queryKey: ['terms'] });
|
|
83
|
+
queryClient.setQueriesData({ queryKey: ['terms'] }, (old) => Array.isArray(old) ? old.map(patch) : old && patch(old));
|
|
84
84
|
return { previous };
|
|
85
85
|
},
|
|
86
86
|
onSuccess: () => {
|
|
87
|
-
this.syncAfterMutation('
|
|
87
|
+
this.syncAfterMutation('terms');
|
|
88
88
|
},
|
|
89
89
|
onError: (_err, _variables, context) => {
|
|
90
90
|
context?.previous.forEach(([key, data]) => queryClient.setQueryData(key, data));
|
package/dist/client/realtime.js
CHANGED
|
@@ -253,9 +253,9 @@ export const REGISTRY = {
|
|
|
253
253
|
fetchOne: (client, id) => client.get({ path: `/proposal/${id}` }),
|
|
254
254
|
alsoInvalidate: [['tasks']],
|
|
255
255
|
},
|
|
256
|
-
|
|
257
|
-
ns: '
|
|
258
|
-
fetchOne: (client, id) => client.get({ path: `/
|
|
256
|
+
terms: {
|
|
257
|
+
ns: 'terms',
|
|
258
|
+
fetchOne: (client, id) => client.get({ path: `/terms/${id}` }),
|
|
259
259
|
},
|
|
260
260
|
month: {
|
|
261
261
|
ns: 'months',
|
|
@@ -302,7 +302,7 @@ export interface CatalogItemUpdatePayload {
|
|
|
302
302
|
recommended_expire_on?: number | null;
|
|
303
303
|
/** Skill GUIDs; replaces the item's skills. */
|
|
304
304
|
skills?: string[];
|
|
305
|
-
/**
|
|
305
|
+
/** Terms GUIDs; replaces the item's suggested terms. */
|
|
306
306
|
terms?: string[];
|
|
307
307
|
/** Replaces the item's payment options. */
|
|
308
308
|
payment_options?: PaymentOptionInput[];
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ import './client/hooks/labels.js';
|
|
|
37
37
|
import './client/hooks/groups.js';
|
|
38
38
|
import './client/hooks/skills.js';
|
|
39
39
|
import './client/hooks/proposal.js';
|
|
40
|
-
import './client/hooks/
|
|
40
|
+
import './client/hooks/terms.js';
|
|
41
41
|
import './client/hooks/timecards.js';
|
|
42
42
|
import './client/hooks/waivers.js';
|
|
43
43
|
import './client/hooks/email.js';
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import './client/hooks/labels.js';
|
|
|
33
33
|
import './client/hooks/groups.js';
|
|
34
34
|
import './client/hooks/skills.js';
|
|
35
35
|
import './client/hooks/proposal.js';
|
|
36
|
-
import './client/hooks/
|
|
36
|
+
import './client/hooks/terms.js';
|
|
37
37
|
import './client/hooks/timecards.js';
|
|
38
38
|
import './client/hooks/waivers.js';
|
|
39
39
|
import './client/hooks/email.js';
|
package/dist/types/api/Avro.d.ts
CHANGED
|
@@ -165,6 +165,11 @@ export interface ErrorLogEntry {
|
|
|
165
165
|
status?: number | null;
|
|
166
166
|
message: string | null;
|
|
167
167
|
traceback?: string | null;
|
|
168
|
+
/**
|
|
169
|
+
* Per-field problems of a rejected request (`"field: problem"`). A
|
|
170
|
+
* string when the list was too long and was stored truncated.
|
|
171
|
+
*/
|
|
172
|
+
errors?: string[] | string | null;
|
|
168
173
|
stack?: string | null;
|
|
169
174
|
fatal?: boolean | null;
|
|
170
175
|
platform?: string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TermsVersion } from './Terms.js';
|
|
2
2
|
import { Task } from './Task.js';
|
|
3
3
|
export interface Proposal {
|
|
4
4
|
id: string;
|
|
@@ -6,7 +6,7 @@ export interface Proposal {
|
|
|
6
6
|
job_id: string;
|
|
7
7
|
expire_on: number | null;
|
|
8
8
|
expired: boolean;
|
|
9
|
-
terms:
|
|
9
|
+
terms: TermsVersion[];
|
|
10
10
|
accepted_at: number | null;
|
|
11
11
|
tasks: Task[];
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface TermsVersion {
|
|
2
2
|
id: string;
|
|
3
3
|
terms_id: string;
|
|
4
4
|
name: string;
|
|
@@ -6,12 +6,12 @@ export interface ProposalTermsVersion {
|
|
|
6
6
|
body: string;
|
|
7
7
|
time_created: number | null;
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface Terms {
|
|
10
10
|
id: string;
|
|
11
11
|
company_id: string;
|
|
12
12
|
name: string | null;
|
|
13
13
|
archived: boolean;
|
|
14
|
-
current_version:
|
|
14
|
+
current_version: TermsVersion | null;
|
|
15
15
|
time_created: number | null;
|
|
16
16
|
time_updated: number | null;
|
|
17
17
|
}
|
package/dist/types/api.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export * from './api/PlanPayment.js';
|
|
|
36
36
|
export * from './api/Prepayment.js';
|
|
37
37
|
export * from './api/ProcessingFeeLineItem.js';
|
|
38
38
|
export * from './api/Proposal.js';
|
|
39
|
-
export * from './api/
|
|
39
|
+
export * from './api/Terms.js';
|
|
40
40
|
export * from './api/Reaction.js';
|
|
41
41
|
export * from './api/Route.js';
|
|
42
42
|
export * from './api/RouteJob.js';
|
package/dist/types/api.js
CHANGED
|
@@ -34,7 +34,7 @@ export * from './api/PlanPayment.js';
|
|
|
34
34
|
export * from './api/Prepayment.js';
|
|
35
35
|
export * from './api/ProcessingFeeLineItem.js';
|
|
36
36
|
export * from './api/Proposal.js';
|
|
37
|
-
export * from './api/
|
|
37
|
+
export * from './api/Terms.js';
|
|
38
38
|
export * from './api/Reaction.js';
|
|
39
39
|
export * from './api/Route.js';
|
|
40
40
|
export * from './api/RouteJob.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AVRO_JS_VERSION = "1.6.6-
|
|
1
|
+
export declare const AVRO_JS_VERSION = "1.6.6-rc12";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|