@go-avro/avro-js 1.6.6-rc10 → 1.6.6-rc11

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.
@@ -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 { ProposalTerms } from '../types/api/ProposalTerms.js';
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
- useGetProposalTerms(): UseQueryResult<ProposalTerms[], StandardError>;
197
- useCreateProposalTerms(): ReturnType<typeof useMutation<{
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
- useUpdateProposalTerms(): ReturnType<typeof useMutation<{
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.useGetProposalTerms = function () {
4
+ AvroQueryClient.prototype.useGetTerms = function () {
5
5
  return useQuery({
6
- queryKey: keys.list('proposal_terms', this.companyId),
7
- queryFn: () => this.get({ path: `/company/${this.companyId}/proposal_terms` }),
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.useCreateProposalTerms = function () {
11
+ AvroQueryClient.prototype.useCreateTerms = function () {
12
12
  const queryClient = this.getQueryClient();
13
- const listKey = keys.list('proposal_terms', this.companyId);
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}/proposal_terms`,
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('proposal_terms');
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.useUpdateProposalTerms = function () {
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: `/proposal_terms/${termsId}`,
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: ['proposal_terms'] });
82
- const previous = queryClient.getQueriesData({ queryKey: ['proposal_terms'] });
83
- queryClient.setQueriesData({ queryKey: ['proposal_terms'] }, (old) => (Array.isArray(old) ? old.map(patch) : old && patch(old)));
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('proposal_terms');
87
+ this.syncAfterMutation('terms');
88
88
  },
89
89
  onError: (_err, _variables, context) => {
90
90
  context?.previous.forEach(([key, data]) => queryClient.setQueryData(key, data));
@@ -253,9 +253,9 @@ export const REGISTRY = {
253
253
  fetchOne: (client, id) => client.get({ path: `/proposal/${id}` }),
254
254
  alsoInvalidate: [['tasks']],
255
255
  },
256
- proposal_terms: {
257
- ns: 'proposal_terms',
258
- fetchOne: (client, id) => client.get({ path: `/proposal_terms/${id}` }),
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
- /** ProposalTerms GUIDs; replaces the item's suggested terms. */
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/proposal_terms.js';
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/proposal_terms.js';
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';
@@ -1,4 +1,4 @@
1
- import { ProposalTermsVersion } from './ProposalTerms.js';
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: ProposalTermsVersion[];
9
+ terms: TermsVersion[];
10
10
  accepted_at: number | null;
11
11
  tasks: Task[];
12
12
  }
@@ -1,4 +1,4 @@
1
- export interface ProposalTermsVersion {
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 ProposalTerms {
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: ProposalTermsVersion | null;
14
+ current_version: TermsVersion | null;
15
15
  time_created: number | null;
16
16
  time_updated: number | null;
17
17
  }
@@ -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/ProposalTerms.js';
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/ProposalTerms.js';
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-rc10";
1
+ export declare const AVRO_JS_VERSION = "1.6.6-rc11";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
2
2
  // Regenerated from package.json by the `prebuild` npm hook.
3
- export const AVRO_JS_VERSION = '1.6.6-rc10';
3
+ export const AVRO_JS_VERSION = '1.6.6-rc11';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "1.6.6-rc10",
3
+ "version": "1.6.6-rc11",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
File without changes