masterypath-sdk 0.0.13 → 0.1.2
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/MasterypathSDK.d.ts +8 -8
- package/dist/MasterypathSDK.js +8 -8
- package/dist/cli/cli.d.ts +1 -1
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +1 -1
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/commands/chat.d.ts.map +1 -1
- package/dist/cli/commands/chat.js +10 -5
- package/dist/cli/commands/chat.js.map +1 -1
- package/dist/cli/commands/organizations.d.ts.map +1 -1
- package/dist/cli/commands/organizations.js +9 -70
- package/dist/cli/commands/organizations.js.map +1 -1
- package/dist/cli/commands/uploads.d.ts +2 -2
- package/dist/cli/commands/uploads.d.ts.map +1 -1
- package/dist/cli/commands/uploads.js +8 -8
- package/dist/cli/commands/uploads.js.map +1 -1
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -13
- package/dist/cli/output.js.map +1 -1
- package/dist/domains/chat/ChatClient.d.ts +8 -8
- package/dist/domains/chat/ChatClient.d.ts.map +1 -1
- package/dist/domains/chat/ChatClient.js +24 -16
- package/dist/domains/chat/ChatClient.js.map +1 -1
- package/dist/domains/chat/types.d.ts +6 -0
- package/dist/domains/chat/types.d.ts.map +1 -1
- package/dist/domains/containers/ContainersClient.d.ts +187 -63
- package/dist/domains/containers/ContainersClient.js +542 -376
- package/dist/domains/index.d.ts +9 -9
- package/dist/domains/index.d.ts.map +1 -1
- package/dist/domains/index.js +5 -5
- package/dist/domains/listings/ListingsClient.d.ts +35 -12
- package/dist/domains/listings/ListingsClient.js +100 -84
- package/dist/domains/merchants/MerchantsClient.d.ts +124 -31
- package/dist/domains/merchants/MerchantsClient.js +420 -303
- package/dist/domains/mindmaps/MindmapsClient.d.ts +6 -6
- package/dist/domains/mindmaps/MindmapsClient.d.ts.map +1 -1
- package/dist/domains/mindmaps/MindmapsClient.js +12 -13
- package/dist/domains/mindmaps/MindmapsClient.js.map +1 -1
- package/dist/domains/mindmaps/types.d.ts.map +1 -1
- package/dist/domains/orders/OrdersClient.d.ts +327 -94
- package/dist/domains/orders/OrdersClient.js +934 -662
- package/dist/domains/orders/types.d.ts +45 -36
- package/dist/domains/orders/types.js +1 -1
- package/dist/domains/organizations/OrganizationsClient.d.ts +8 -5
- package/dist/domains/organizations/OrganizationsClient.d.ts.map +1 -1
- package/dist/domains/organizations/OrganizationsClient.js +21 -30
- package/dist/domains/organizations/OrganizationsClient.js.map +1 -1
- package/dist/domains/plants/PlantsClient.d.ts +43 -28
- package/dist/domains/plants/PlantsClient.js +51 -47
- package/dist/domains/products/ProductsClient.d.ts +34 -12
- package/dist/domains/products/ProductsClient.js +94 -83
- package/dist/domains/public-api/PublicApiClient.d.ts +22 -0
- package/dist/domains/public-api/PublicApiClient.d.ts.map +1 -1
- package/dist/domains/public-api/PublicApiClient.js +51 -0
- package/dist/domains/public-api/PublicApiClient.js.map +1 -1
- package/dist/domains/uploads/UploadsClient.d.ts.map +1 -1
- package/dist/domains/uploads/UploadsClient.js +1 -3
- package/dist/domains/uploads/UploadsClient.js.map +1 -1
- package/dist/domains/usdazones/UsdazonesClient.d.ts +6 -6
- package/dist/domains/usdazones/UsdazonesClient.js +15 -15
- package/dist/domains/users/UsersClient.d.ts +4 -4
- package/dist/domains/users/UsersClient.d.ts.map +1 -1
- package/dist/domains/users/UsersClient.js +24 -22
- package/dist/domains/users/UsersClient.js.map +1 -1
- package/dist/generated/graphql.d.ts +1172 -1079
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +5622 -84
- package/dist/generated/graphql.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/shared/fulfillmentWindows.js +4 -4
- package/dist/utils/errors.js +3 -3
- package/package.json +1 -1
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export type {
|
|
2
|
+
CreateBatchOrderInput,
|
|
3
|
+
BatchOrder,
|
|
4
|
+
} from "../../generated/graphql";
|
|
5
|
+
export type FulfillmentMethod =
|
|
6
|
+
| "pickup"
|
|
7
|
+
| "delivery"
|
|
8
|
+
| "meetup"
|
|
9
|
+
| "onsite"
|
|
10
|
+
| "instore"
|
|
11
|
+
| "remote";
|
|
12
|
+
export type BillingType = "fixed_amount" | "time_and_materials";
|
|
4
13
|
export interface TimeLogData {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
id: string;
|
|
15
|
+
milestoneId: string;
|
|
16
|
+
merchantId: string;
|
|
17
|
+
date: string;
|
|
18
|
+
hoursWorked: number;
|
|
19
|
+
description: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
13
22
|
}
|
|
14
23
|
export interface MaterialReceiptData {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
id: string;
|
|
25
|
+
milestoneId: string;
|
|
26
|
+
merchantId: string;
|
|
27
|
+
itemName: string;
|
|
28
|
+
costUsd: number;
|
|
29
|
+
receiptUrl?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
24
33
|
}
|
|
25
34
|
export interface CreateTimeLogInput {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
milestoneId: string;
|
|
36
|
+
date: string;
|
|
37
|
+
hoursWorked: number;
|
|
38
|
+
description: string;
|
|
30
39
|
}
|
|
31
40
|
export interface CreateMaterialReceiptInput {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
milestoneId: string;
|
|
42
|
+
itemName: string;
|
|
43
|
+
costUsd: number;
|
|
44
|
+
receiptUrl?: string;
|
|
45
|
+
description?: string;
|
|
37
46
|
}
|
|
38
47
|
export interface TimeAndMaterialsCalculationResult {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
totalHours: number;
|
|
49
|
+
totalMaterialsCost: number;
|
|
50
|
+
calculatedAmount: number;
|
|
51
|
+
hourlyRate: number;
|
|
52
|
+
timeLogs: TimeLogData[];
|
|
53
|
+
materialReceipts: MaterialReceiptData[];
|
|
45
54
|
}
|
|
46
|
-
//# sourceMappingURL=types.d.ts.map
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { HttpClient } from "../../clients/HttpClient.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CreateOrganizationMutation, CreateOrganizationInput, GetOrganizationQuery, GetOrganizationByIdQuery, GetOrganizationByHandleQuery, UpdateOrganizationMutation, UpdateOrganizationInput, InviteUserToOrganizationMutation, InviteUserToOrganizationInput, AcceptInvitationMutation, UpdateOrganizationUserPermissionsMutation, ListOrganizationUsersQuery, CreateApiKeyMutation, ListApiKeysQuery } from "../../generated/graphql.js";
|
|
3
3
|
export declare class OrganizationsClient {
|
|
4
4
|
private readonly httpClient;
|
|
5
5
|
constructor(httpClient: HttpClient);
|
|
6
|
-
getOnboarding(organizationId?: string): Promise<GetOnboardingQuery["getOnboarding"]>;
|
|
7
6
|
createOrganization(input: CreateOrganizationInput): Promise<CreateOrganizationMutation["createOrganization"]>;
|
|
8
7
|
getOrganization(organizationId: string): Promise<GetOrganizationQuery["getOrganization"]>;
|
|
9
8
|
getOrganizationById(organizationId: string): Promise<GetOrganizationByIdQuery["getOrganizationById"]>;
|
|
10
9
|
getOrganizationByHandle(handle: string): Promise<GetOrganizationByHandleQuery["getOrganizationByHandle"]>;
|
|
11
10
|
updateOrganization(input: UpdateOrganizationInput, organizationId: string): Promise<UpdateOrganizationMutation["updateOrganization"]>;
|
|
12
11
|
listOrganizationUsers(organizationId: string): Promise<ListOrganizationUsersQuery["listOrganizationUsers"]>;
|
|
13
|
-
listRoles(): Promise<ListRolesQuery["listRoles"]>;
|
|
14
12
|
inviteUserToOrganization(input: InviteUserToOrganizationInput, organizationId: string): Promise<InviteUserToOrganizationMutation["inviteUserToOrganization"]>;
|
|
15
13
|
acceptInvitation(email: string, organizationId: string): Promise<AcceptInvitationMutation["acceptInvitation"]>;
|
|
16
14
|
deleteInvitation(email: string, organizationId: string): Promise<boolean>;
|
|
17
15
|
removeUserFromOrganization(userId: string, organizationId: string): Promise<boolean>;
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
updateOrganizationUserPermissions(input: {
|
|
17
|
+
organizationId: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
permissionNames: string[];
|
|
20
|
+
}, organizationId: string): Promise<UpdateOrganizationUserPermissionsMutation["updateOrganizationUserPermissions"]>;
|
|
21
|
+
createApiKey(permissions: string[], organizationId: string): Promise<CreateApiKeyMutation["createApiKey"]>;
|
|
22
|
+
deleteApiKey(apiKey: string, organizationId: string): Promise<boolean>;
|
|
20
23
|
listApiKeys(organizationId: string): Promise<ListApiKeysQuery["listApiKeys"]>;
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=OrganizationsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationsClient.d.ts","sourceRoot":"","sources":["../../../src/domains/organizations/OrganizationsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"OrganizationsClient.d.ts","sour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AAC,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;IAqBlD,gBAAgB,CACpB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC;IAsBb,0BAA0B,CAC9B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC;IAyBb,iCAAiC,CACrC,KAAK,EAAE;QACL,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,EAAE,MAAM,EAAE,CAAC;KAC3B,EACD,cAAc,EAAE,MAAM,GACrB,OAAO,CACR,yCAAyC,CAAC,mCAAmC,CAAC,CAC/E;IAsBK,YAAY,CAChB,WAAW,EAAE,MAAM,EAAE,EACrB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAqB1C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBtE,WAAW,CACf,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAkB5C"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { print } from "graphql";
|
|
2
|
-
import {
|
|
2
|
+
import { CreateOrganizationDocument, GetOrganizationDocument, GetOrganizationByIdDocument, GetOrganizationByHandleDocument, UpdateOrganizationDocument, InviteUserToOrganizationDocument, AcceptInvitationDocument, DeleteInvitationDocument, RemoveUserFromOrganizationDocument, UpdateOrganizationUserPermissionsDocument, ListOrganizationUsersDocument, CreateApiKeyDocument, DeleteApiKeyDocument, ListApiKeysDocument, } from "../../generated/graphql.js";
|
|
3
3
|
export class OrganizationsClient {
|
|
4
4
|
constructor(httpClient) {
|
|
5
5
|
this.httpClient = httpClient;
|
|
6
6
|
}
|
|
7
|
-
async getOnboarding(organizationId) {
|
|
8
|
-
const response = await this.httpClient.request("/graphql-organizations", {
|
|
9
|
-
query: print(GetOnboardingDocument),
|
|
10
|
-
variables: { organizationId },
|
|
11
|
-
});
|
|
12
|
-
return response.data?.getOnboarding ?? null;
|
|
13
|
-
}
|
|
14
7
|
async createOrganization(input) {
|
|
15
8
|
const response = await this.httpClient.request("/graphql-organizations", {
|
|
16
9
|
query: print(CreateOrganizationDocument),
|
|
@@ -75,16 +68,6 @@ export class OrganizationsClient {
|
|
|
75
68
|
}
|
|
76
69
|
return response.data.listOrganizationUsers;
|
|
77
70
|
}
|
|
78
|
-
async listRoles() {
|
|
79
|
-
const response = await this.httpClient.request("/graphql-organizations", {
|
|
80
|
-
query: print(ListRolesDocument),
|
|
81
|
-
variables: {},
|
|
82
|
-
});
|
|
83
|
-
if (!response.data?.listRoles) {
|
|
84
|
-
throw new Error("Failed to list roles: No data returned");
|
|
85
|
-
}
|
|
86
|
-
return response.data.listRoles;
|
|
87
|
-
}
|
|
88
71
|
async inviteUserToOrganization(input, organizationId) {
|
|
89
72
|
const response = await this.httpClient.request("/graphql-organizations", {
|
|
90
73
|
query: print(InviteUserToOrganizationDocument),
|
|
@@ -145,28 +128,24 @@ export class OrganizationsClient {
|
|
|
145
128
|
}
|
|
146
129
|
return response.data.removeUserFromOrganization;
|
|
147
130
|
}
|
|
148
|
-
async
|
|
131
|
+
async updateOrganizationUserPermissions(input, organizationId) {
|
|
149
132
|
const response = await this.httpClient.request("/graphql-organizations", {
|
|
150
|
-
query: print(
|
|
133
|
+
query: print(UpdateOrganizationUserPermissionsDocument),
|
|
151
134
|
variables: {
|
|
152
|
-
input
|
|
153
|
-
userId,
|
|
154
|
-
organizationId,
|
|
155
|
-
roleNames,
|
|
156
|
-
},
|
|
135
|
+
input,
|
|
157
136
|
},
|
|
158
137
|
}, organizationId);
|
|
159
|
-
if (!response.data?.
|
|
160
|
-
throw new Error("Failed to
|
|
138
|
+
if (!response.data?.updateOrganizationUserPermissions) {
|
|
139
|
+
throw new Error("Failed to update organization user permissions: No data returned");
|
|
161
140
|
}
|
|
162
|
-
return response.data.
|
|
141
|
+
return response.data.updateOrganizationUserPermissions;
|
|
163
142
|
}
|
|
164
|
-
async createApiKey(
|
|
143
|
+
async createApiKey(permissions, organizationId) {
|
|
165
144
|
const response = await this.httpClient.request("/graphql-organizations", {
|
|
166
145
|
query: print(CreateApiKeyDocument),
|
|
167
146
|
variables: {
|
|
168
147
|
input: {
|
|
169
|
-
|
|
148
|
+
permissions,
|
|
170
149
|
},
|
|
171
150
|
},
|
|
172
151
|
}, organizationId);
|
|
@@ -175,6 +154,18 @@ export class OrganizationsClient {
|
|
|
175
154
|
}
|
|
176
155
|
return response.data.createApiKey;
|
|
177
156
|
}
|
|
157
|
+
async deleteApiKey(apiKey, organizationId) {
|
|
158
|
+
const response = await this.httpClient.request("/graphql-organizations", {
|
|
159
|
+
query: print(DeleteApiKeyDocument),
|
|
160
|
+
variables: {
|
|
161
|
+
input: { apiKey, organizationId },
|
|
162
|
+
},
|
|
163
|
+
}, organizationId);
|
|
164
|
+
if (response.data?.deleteApiKey === undefined) {
|
|
165
|
+
throw new Error("Failed to delete API key: No data returned");
|
|
166
|
+
}
|
|
167
|
+
return response.data.deleteApiKey;
|
|
168
|
+
}
|
|
178
169
|
async listApiKeys(organizationId) {
|
|
179
170
|
const response = await this.httpClient.request("/graphql-organizations", {
|
|
180
171
|
query: print(ListApiKeysDocument),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationsClient.js","sourceRoot":"","sources":["../../../src/domains/organizations/OrganizationsClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"OrganizationsClient.js","sourceRoot":"","sources":["../../../src/domains/organizations/OrganizationsClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAGL,0BAA0B,EAI1B,uBAAuB,EAGvB,2BA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AAI,CAAC,WAAW,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,35 +1,50 @@
|
|
|
1
|
-
import { HttpClient } from
|
|
2
|
-
import {
|
|
1
|
+
import { HttpClient } from "../../clients/HttpClient";
|
|
2
|
+
import {
|
|
3
|
+
GetPlantQuery,
|
|
4
|
+
GetPlantByScientificNameQuery,
|
|
5
|
+
GetPlantsQuery,
|
|
6
|
+
GetPlantsQueryVariables,
|
|
7
|
+
} from "../../generated/graphql";
|
|
3
8
|
interface GetPlantNeedsPhotoResult {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
getPlantNeedsPhoto: {
|
|
10
|
+
id: string;
|
|
11
|
+
scientificName: string;
|
|
12
|
+
ediblePortion: string;
|
|
13
|
+
ediblePart: string;
|
|
14
|
+
ediblePartDesc: string;
|
|
15
|
+
monthsUntilFirstHarvest: number;
|
|
16
|
+
lifecycle: string;
|
|
17
|
+
indoorSmallSpaceFriendly: boolean;
|
|
18
|
+
type: string;
|
|
19
|
+
commonNames: string;
|
|
20
|
+
photo: string;
|
|
21
|
+
} | null;
|
|
17
22
|
}
|
|
18
23
|
interface SetPlantPhotoResult {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
setPlantPhoto: {
|
|
25
|
+
id: string;
|
|
26
|
+
scientificName: string;
|
|
27
|
+
photo: string;
|
|
28
|
+
} | null;
|
|
24
29
|
}
|
|
25
30
|
export declare class PlantsClient {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
private readonly httpClient;
|
|
32
|
+
constructor(httpClient: HttpClient);
|
|
33
|
+
getPlant(id: string): Promise<GetPlantQuery["getPlant"]>;
|
|
34
|
+
getPlantByScientificName(
|
|
35
|
+
scientificName: string,
|
|
36
|
+
): Promise<GetPlantByScientificNameQuery["getPlantByScientificName"]>;
|
|
37
|
+
getPlants(
|
|
38
|
+
variables?: GetPlantsQueryVariables,
|
|
39
|
+
): Promise<GetPlantsQuery["getPlants"]>;
|
|
40
|
+
getPlantNeedsPhoto(
|
|
41
|
+
type?: string,
|
|
42
|
+
grownInUS?: boolean,
|
|
43
|
+
): Promise<GetPlantNeedsPhotoResult["getPlantNeedsPhoto"]>;
|
|
44
|
+
setPlantPhoto(
|
|
45
|
+
id: string,
|
|
46
|
+
photo: string,
|
|
47
|
+
): Promise<SetPlantPhotoResult["setPlantPhoto"]>;
|
|
33
48
|
}
|
|
34
49
|
export {};
|
|
35
|
-
//# sourceMappingURL=PlantsClient.d.ts.map
|
|
50
|
+
//# sourceMappingURL=PlantsClient.d.ts.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { print, parse } from
|
|
2
|
-
import {
|
|
1
|
+
import { print, parse } from "graphql";
|
|
2
|
+
import {
|
|
3
|
+
GetPlantDocument,
|
|
4
|
+
GetPlantByScientificNameDocument,
|
|
5
|
+
GetPlantsDocument,
|
|
6
|
+
} from "../../generated/graphql";
|
|
3
7
|
const GetPlantNeedsPhotoDocument = parse(`
|
|
4
8
|
query GetPlantNeedsPhoto($type: String, $grownInUS: Boolean) {
|
|
5
9
|
getPlantNeedsPhoto(type: $type, grownInUS: $grownInUS) {
|
|
@@ -27,50 +31,50 @@ const SetPlantPhotoDocument = parse(`
|
|
|
27
31
|
}
|
|
28
32
|
`);
|
|
29
33
|
export class PlantsClient {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return response.data.setPlantPhoto;
|
|
34
|
+
constructor(httpClient) {
|
|
35
|
+
this.httpClient = httpClient;
|
|
36
|
+
}
|
|
37
|
+
async getPlant(id) {
|
|
38
|
+
const response = await this.httpClient.request("/graphql-plants", {
|
|
39
|
+
query: print(GetPlantDocument),
|
|
40
|
+
variables: {
|
|
41
|
+
id,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
return response.data?.getPlant ?? null;
|
|
45
|
+
}
|
|
46
|
+
async getPlantByScientificName(scientificName) {
|
|
47
|
+
const response = await this.httpClient.request("/graphql-plants", {
|
|
48
|
+
query: print(GetPlantByScientificNameDocument),
|
|
49
|
+
variables: {
|
|
50
|
+
scientificName,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
return response.data?.getPlantByScientificName ?? null;
|
|
54
|
+
}
|
|
55
|
+
async getPlants(variables) {
|
|
56
|
+
const response = await this.httpClient.request("/graphql-plants", {
|
|
57
|
+
query: print(GetPlantsDocument),
|
|
58
|
+
variables: variables ?? {},
|
|
59
|
+
});
|
|
60
|
+
return response.data?.getPlants ?? null;
|
|
61
|
+
}
|
|
62
|
+
async getPlantNeedsPhoto(type, grownInUS) {
|
|
63
|
+
const response = await this.httpClient.request("/graphql-plants", {
|
|
64
|
+
query: print(GetPlantNeedsPhotoDocument),
|
|
65
|
+
variables: { type, grownInUS },
|
|
66
|
+
});
|
|
67
|
+
return response.data?.getPlantNeedsPhoto ?? null;
|
|
68
|
+
}
|
|
69
|
+
async setPlantPhoto(id, photo) {
|
|
70
|
+
const response = await this.httpClient.request("/graphql-plants", {
|
|
71
|
+
query: print(SetPlantPhotoDocument),
|
|
72
|
+
variables: { id, photo },
|
|
73
|
+
});
|
|
74
|
+
if (!response.data?.setPlantPhoto) {
|
|
75
|
+
throw new Error("Failed to set plant photo: No data returned");
|
|
74
76
|
}
|
|
77
|
+
return response.data.setPlantPhoto;
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
|
-
//# sourceMappingURL=PlantsClient.js.map
|
|
80
|
+
//# sourceMappingURL=PlantsClient.js.map
|
|
@@ -1,14 +1,36 @@
|
|
|
1
|
-
import { HttpClient } from
|
|
2
|
-
import {
|
|
1
|
+
import { HttpClient } from "../../clients/HttpClient";
|
|
2
|
+
import {
|
|
3
|
+
ListProductCategoriesQuery,
|
|
4
|
+
SearchProductQuery,
|
|
5
|
+
GetProductByCategoryQuery,
|
|
6
|
+
GetProductQuery,
|
|
7
|
+
CreateProductMutation,
|
|
8
|
+
UpdateProductMutation,
|
|
9
|
+
CreateProductInput,
|
|
10
|
+
UpdateProductInput,
|
|
11
|
+
} from "../../generated/graphql";
|
|
3
12
|
export declare class ProductsClient {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
private readonly httpClient;
|
|
14
|
+
constructor(httpClient: HttpClient);
|
|
15
|
+
listProductCategories(): Promise<
|
|
16
|
+
ListProductCategoriesQuery["listProductCategories"]
|
|
17
|
+
>;
|
|
18
|
+
searchProduct(
|
|
19
|
+
name: string,
|
|
20
|
+
productCategoryId?: string,
|
|
21
|
+
isService?: boolean,
|
|
22
|
+
): Promise<SearchProductQuery["searchProduct"]>;
|
|
23
|
+
getProductByCategory(
|
|
24
|
+
productCategoryId: string,
|
|
25
|
+
): Promise<GetProductByCategoryQuery["getProductByCategory"]>;
|
|
26
|
+
getProduct(id: string): Promise<GetProductQuery["getProduct"]>;
|
|
27
|
+
createProduct(
|
|
28
|
+
input: CreateProductInput,
|
|
29
|
+
): Promise<CreateProductMutation["createProduct"]>;
|
|
30
|
+
updateProduct(
|
|
31
|
+
id: string,
|
|
32
|
+
input: UpdateProductInput,
|
|
33
|
+
): Promise<UpdateProductMutation["updateProduct"]>;
|
|
34
|
+
deleteProduct(id: string, hardDelete?: boolean): Promise<boolean>;
|
|
13
35
|
}
|
|
14
|
-
//# sourceMappingURL=ProductsClient.d.ts.map
|
|
36
|
+
//# sourceMappingURL=ProductsClient.d.ts.map
|