@fabriktor/client 0.0.71 → 0.0.72
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type Bill, type BillableFolder, type Charge, type Equipment, type InBill, type InBillableFolder, type InCharge, type InEquipment, type InItem, type InLaborRate, type InMeterReading, type InQuantifier, type InTax, type InTmpBillNumber, type InVendorInvoice, type InWarehouse, type Item, type LaborRate, type MeterReading, type OperationResult, type PLBillablePeriodsFromDates, type PLBillableSetItemQuantity, type PLBillableVendorInvoiceFromBill, type PLBillableYearSpan, type Quantifier, type RPBillablePeriodsFromDates, type Tax, type TmpBillNumber, type VendorInvoice, type Warehouse, type YearSpan } from "@fabriktor/schema";
|
|
1
|
+
import { type Bill, type BillableFolder, type Charge, type Equipment, type InBill, type InBillableFolder, type InCharge, type InEquipment, type InItem, type InLaborRate, type InMeterReading, type InQuantifier, type InTax, type InTmpBillNumber, type InVendorInvoice, type InWarehouse, type Item, type LaborRate, type MeterReading, type OperationResult, type PLBillableAcceptFixedEstimate, type PLBillablePeriodsFromDates, type PLBillableSetItemQuantity, type PLBillableVendorInvoiceFromBill, type PLBillableYearSpan, type Quantifier, type RPBillablePeriodsFromDates, type Tax, type TmpBillNumber, type VendorInvoice, type Warehouse, type YearSpan } from "@fabriktor/schema";
|
|
2
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
3
|
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
4
|
import type { HTTPDoer } from "../core/http.js";
|
|
5
5
|
import type { CompletePayload } from "../core/type.js";
|
|
6
6
|
export type GenerateBillOptions = CompletePayload<InBill>;
|
|
7
|
+
export type AcceptFixedEstimateOptions = CompletePayload<PLBillableAcceptFixedEstimate>;
|
|
7
8
|
export type YearSpanOptions = CompletePayload<PLBillableYearSpan>;
|
|
8
9
|
export type PeriodsFromDatesOptions = CompletePayload<PLBillablePeriodsFromDates>;
|
|
9
10
|
export type VendorInvoiceFromBillOptions = CompletePayload<PLBillableVendorInvoiceFromBill>;
|
|
@@ -87,6 +88,7 @@ export interface BillableOperator {
|
|
|
87
88
|
deleteOneWarehouse(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
88
89
|
searchManyWarehouses(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Warehouse>>>;
|
|
89
90
|
generateBill(opts: GenerateBillOptions): Promise<OperationResult>;
|
|
91
|
+
acceptFixedEstimate(opts: AcceptFixedEstimateOptions): Promise<OperationResult>;
|
|
90
92
|
yearSpan(opts: YearSpanOptions): Promise<OperationResultOf<YearSpan>>;
|
|
91
93
|
periodsFromDates(opts: PeriodsFromDatesOptions): Promise<OperationResultOf<RPBillablePeriodsFromDates>>;
|
|
92
94
|
vendorInvoiceFromBill(opts: VendorInvoiceFromBillOptions): Promise<OperationResult>;
|
|
@@ -182,6 +184,7 @@ export declare class BillableClient implements BillableOperator {
|
|
|
182
184
|
deleteOneWarehouse(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
183
185
|
searchManyWarehouses(opts?: SearchManyOptionsCRUD): Promise<OperationResultOf<SearchResultOf<Warehouse>>>;
|
|
184
186
|
generateBill(opts: GenerateBillOptions): Promise<OperationResult>;
|
|
187
|
+
acceptFixedEstimate(opts: AcceptFixedEstimateOptions): Promise<OperationResult>;
|
|
185
188
|
yearSpan(opts: YearSpanOptions): Promise<OperationResultOf<YearSpan>>;
|
|
186
189
|
periodsFromDates(opts: PeriodsFromDatesOptions): Promise<OperationResultOf<RPBillablePeriodsFromDates>>;
|
|
187
190
|
vendorInvoiceFromBill(opts: VendorInvoiceFromBillOptions): Promise<OperationResult>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
4
4
|
// not use this file except in compliance with the License. You may obtain
|
|
5
5
|
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
import { ColBillableBills, ColBillableCharges, ColBillableEquipments, ColBillableFolders, ColBillableItems, ColBillableLaborRates, ColBillableMeterReadings, ColBillableQuantifiers, ColBillableTaxes, ColBillableTmpBillNumbers, ColBillableVendorInvoices, ColBillableWarehouses, HTTPMethodPost, PathBillableFromBill, PathBillableGenerate, PathBillablePeriodsFromDates, PathBillableSetQuantity, PathBillableYearSpan, SvcBillable, } from "@fabriktor/schema";
|
|
6
|
+
import { ColBillableBills, ColBillableCharges, ColBillableEquipments, ColBillableFolders, ColBillableItems, ColBillableLaborRates, ColBillableMeterReadings, ColBillableQuantifiers, ColBillableTaxes, ColBillableTmpBillNumbers, ColBillableVendorInvoices, ColBillableWarehouses, HTTPMethodPost, PathBillableAcceptFixedEstimate, PathBillableFromBill, PathBillableGenerate, PathBillablePeriodsFromDates, PathBillableSetQuantity, PathBillableYearSpan, SvcBillable, } from "@fabriktor/schema";
|
|
7
7
|
import { requiredToken } from "../core/auth.js";
|
|
8
8
|
import { newCRUDClient } from "../core/crud.js";
|
|
9
9
|
import { buildPath } from "../core/path.js";
|
|
@@ -338,6 +338,16 @@ export class BillableClient {
|
|
|
338
338
|
body: opts,
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
+
async acceptFixedEstimate(opts) {
|
|
342
|
+
const token = await requiredToken(this.get_token);
|
|
343
|
+
return await this.http.do({
|
|
344
|
+
base_url: this.base_url,
|
|
345
|
+
path: billPath(PathBillableAcceptFixedEstimate),
|
|
346
|
+
method: HTTPMethodPost,
|
|
347
|
+
token,
|
|
348
|
+
body: opts,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
341
351
|
async yearSpan(opts) {
|
|
342
352
|
const token = await requiredToken(this.get_token);
|
|
343
353
|
return await this.http.do({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InUser, type OperationResult, type PLUsersContactList, type PLUsersForgotPassword, type PLUsersResolveUsername, type PLUsersSignInLink, type PLUsersVerifyEmail, type UpsertResult, type User } from "@fabriktor/schema";
|
|
2
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
|
-
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
3
|
+
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
4
|
import type { HTTPDoer } from "../core/http.js";
|
|
5
5
|
import type { CompletePayload } from "../core/type.js";
|
|
6
6
|
export type BootstrapOptions = {
|
|
@@ -17,10 +17,12 @@ export type GetByUIDOptions = {
|
|
|
17
17
|
export type SearchManyUsersOptions = SearchManyOptionsCRUD & GetByUIDOptions;
|
|
18
18
|
export interface UsersOperator {
|
|
19
19
|
queryUsers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<User[]>>;
|
|
20
|
+
insertOneUser(opts: InsertOneOptionsCRUD<InUser>): Promise<OperationResult>;
|
|
20
21
|
findOneUser(opts: FindOneOptionsCRUD): Promise<OperationResultOf<User>>;
|
|
21
22
|
replaceOneUser(opts: ReplaceOneOptionsCRUD<InUser>): Promise<OperationResult>;
|
|
22
23
|
deleteOneUser(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
23
24
|
searchManyUsers(opts: SearchManyUsersOptions): Promise<OperationResultOf<SearchResultOf<User>>>;
|
|
25
|
+
searchManyExternalUsers(opts: SearchManyUsersOptions): Promise<OperationResultOf<SearchResultOf<User>>>;
|
|
24
26
|
bootstrap(opts: BootstrapOptions): Promise<OperationResultOf<UpsertResult>>;
|
|
25
27
|
sync(): Promise<OperationResult>;
|
|
26
28
|
sendEmailVerification(opts: SendEmailVerificationOptions): Promise<void>;
|
|
@@ -42,10 +44,12 @@ export declare class UsersClient implements UsersOperator {
|
|
|
42
44
|
private get_token?;
|
|
43
45
|
constructor(opts: UsersClientOptions);
|
|
44
46
|
queryUsers(opts?: QueryOptionsCRUD): Promise<OperationResultOf<User[]>>;
|
|
47
|
+
insertOneUser(opts: InsertOneOptionsCRUD<InUser>): Promise<OperationResult>;
|
|
45
48
|
findOneUser(opts: FindOneOptionsCRUD): Promise<OperationResultOf<User>>;
|
|
46
49
|
replaceOneUser(opts: ReplaceOneOptionsCRUD<InUser>): Promise<OperationResult>;
|
|
47
50
|
deleteOneUser(opts: DeleteOneOptionsCRUD): Promise<OperationResult>;
|
|
48
51
|
searchManyUsers(opts: SearchManyUsersOptions): Promise<OperationResultOf<SearchResultOf<User>>>;
|
|
52
|
+
searchManyExternalUsers(opts: SearchManyUsersOptions): Promise<OperationResultOf<SearchResultOf<User>>>;
|
|
49
53
|
bootstrap(opts: BootstrapOptions): Promise<OperationResultOf<UpsertResult>>;
|
|
50
54
|
sync(): Promise<OperationResult>;
|
|
51
55
|
sendEmailVerification(opts: SendEmailVerificationOptions): Promise<void>;
|
package/dist/src/users/users.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
4
4
|
// not use this file except in compliance with the License. You may obtain
|
|
5
5
|
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
import { ColUsersUsers, HTTPMethodPost, PathUsersBootstrap, PathUsersForgotPassword, PathUsersMatch, PathUsersResolveUsername, PathUsersSendEmailVerification, PathUsersSendSignInLink, PathUsersSync, SvcUsers, } from "@fabriktor/schema";
|
|
6
|
+
import { ColUsersUsers, HTTPMethodGet, HTTPMethodPost, PathUsersBootstrap, PathUsersExternal, PathUsersForgotPassword, PathUsersMatch, PathUsersResolveUsername, PathUsersSendEmailVerification, PathUsersSendSignInLink, PathUsersSync, SvcUsers, } from "@fabriktor/schema";
|
|
7
7
|
import { requiredToken } from "../core/auth.js";
|
|
8
|
-
import { queryParam } from "../core/col.js";
|
|
8
|
+
import { mergeQueryOptions, queryParam, withQuery } from "../core/col.js";
|
|
9
9
|
import { newCRUDClient } from "../core/crud.js";
|
|
10
10
|
import { buildPath } from "../core/path.js";
|
|
11
11
|
export class UsersClient {
|
|
@@ -28,6 +28,9 @@ export class UsersClient {
|
|
|
28
28
|
async queryUsers(opts) {
|
|
29
29
|
return await this.users.query(opts);
|
|
30
30
|
}
|
|
31
|
+
async insertOneUser(opts) {
|
|
32
|
+
return await this.users.insertOne(opts);
|
|
33
|
+
}
|
|
31
34
|
async findOneUser(opts) {
|
|
32
35
|
return await this.users.findOne(opts);
|
|
33
36
|
}
|
|
@@ -47,6 +50,18 @@ export class UsersClient {
|
|
|
47
50
|
},
|
|
48
51
|
});
|
|
49
52
|
}
|
|
53
|
+
async searchManyExternalUsers(opts) {
|
|
54
|
+
const token = await requiredToken(this.get_token);
|
|
55
|
+
const { uid, query } = opts;
|
|
56
|
+
return await this.http.do({
|
|
57
|
+
base_url: this.base_url,
|
|
58
|
+
path: withQuery(userPath(PathUsersExternal), {
|
|
59
|
+
query: mergeQueryOptions(query, userUIDQuery(uid)),
|
|
60
|
+
}),
|
|
61
|
+
method: HTTPMethodGet,
|
|
62
|
+
token,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
50
65
|
async bootstrap(opts) {
|
|
51
66
|
const token = await requiredToken(this.get_token);
|
|
52
67
|
return await this.http.do({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabriktor/client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.72",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"typescript": "^6.0.3"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@fabriktor/schema": "0.0.
|
|
20
|
+
"@fabriktor/schema": "0.0.55"
|
|
21
21
|
}
|
|
22
22
|
}
|