@joai/sdk 1.4.0 → 1.4.1
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/index.d.mts +12 -17
- package/dist/index.mjs +8 -20
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -740,7 +740,7 @@ type CartItem = {
|
|
|
740
740
|
name: TranslatableValue;
|
|
741
741
|
price: number;
|
|
742
742
|
quantity: number;
|
|
743
|
-
type: 'service' | 'product';
|
|
743
|
+
type: 'service' | 'product' | 'coupon';
|
|
744
744
|
sku: string | null;
|
|
745
745
|
badge: string | null;
|
|
746
746
|
configuration?: Configuration;
|
|
@@ -1047,10 +1047,10 @@ type WarpBackend = {
|
|
|
1047
1047
|
creator: string;
|
|
1048
1048
|
status: WarpBackendStatus;
|
|
1049
1049
|
active: boolean;
|
|
1050
|
-
category: WarpBackendCategory;
|
|
1051
1050
|
featured: boolean;
|
|
1052
1051
|
form: boolean;
|
|
1053
1052
|
store: boolean;
|
|
1053
|
+
public: boolean;
|
|
1054
1054
|
executions: number;
|
|
1055
1055
|
price?: number | null;
|
|
1056
1056
|
primaryAddress: string | null;
|
|
@@ -1065,7 +1065,6 @@ type WarpBackend = {
|
|
|
1065
1065
|
executionHistory?: number[] | null;
|
|
1066
1066
|
};
|
|
1067
1067
|
type WarpBackendStatus = 'unverified' | 'verified' | 'blacklisted';
|
|
1068
|
-
type WarpBackendCategory = 'none';
|
|
1069
1068
|
type WarpExecutionBackend = {
|
|
1070
1069
|
id: string;
|
|
1071
1070
|
room: string | null;
|
|
@@ -3091,8 +3090,8 @@ declare class CartsResource {
|
|
|
3091
3090
|
constructor(http: IHttpService);
|
|
3092
3091
|
get(): Promise<IAppResponse<Cart>>;
|
|
3093
3092
|
add(type: 'product' | 'service' | 'coupon', id: string, quantity?: number, configuration?: Configuration): Promise<IAppResponse<Cart>>;
|
|
3094
|
-
remove(type: 'product' | 'service', id: string): Promise<IAppResponse<Cart>>;
|
|
3095
|
-
updateQuantity(type: 'product' | 'service', id: string, quantity: number): Promise<IAppResponse<Cart>>;
|
|
3093
|
+
remove(type: 'product' | 'service' | 'coupon', id: string): Promise<IAppResponse<Cart>>;
|
|
3094
|
+
updateQuantity(type: 'product' | 'service' | 'coupon', id: string, quantity: number): Promise<IAppResponse<Cart>>;
|
|
3096
3095
|
clear(): Promise<IAppResponse<Cart>>;
|
|
3097
3096
|
applyCoupon(code: string): Promise<IAppResponse<void>>;
|
|
3098
3097
|
}
|
|
@@ -3114,7 +3113,9 @@ type CouponPayload = {
|
|
|
3114
3113
|
declare class CouponsResource {
|
|
3115
3114
|
private readonly http;
|
|
3116
3115
|
constructor(http: IHttpService);
|
|
3117
|
-
list(team: string
|
|
3116
|
+
list(team: string, options?: {
|
|
3117
|
+
public?: boolean;
|
|
3118
|
+
}): Promise<IAppResponse<Coupon[]>>;
|
|
3118
3119
|
create(team: string, data: CouponPayload): Promise<IAppResponse<Coupon>>;
|
|
3119
3120
|
update(id: string, data: Partial<CouponPayload> & {
|
|
3120
3121
|
clearExpiry?: boolean;
|
|
@@ -4001,12 +4002,10 @@ type TeamMutationPayload = {
|
|
|
4001
4002
|
declare class TeamsResource {
|
|
4002
4003
|
private readonly http;
|
|
4003
4004
|
constructor(http: IHttpService);
|
|
4004
|
-
list(
|
|
4005
|
-
listPublic(params?: {
|
|
4005
|
+
list(params?: {
|
|
4006
4006
|
tags?: string;
|
|
4007
4007
|
}): Promise<IAppResponse<Team[]>>;
|
|
4008
4008
|
get(slug: string): Promise<IAppResponse<Team>>;
|
|
4009
|
-
getPublic(slug: string): Promise<IAppResponse<Team>>;
|
|
4010
4009
|
create(data: TeamMutationPayload & {
|
|
4011
4010
|
name: string;
|
|
4012
4011
|
}): Promise<IAppResponse<TeamPrivate>>;
|
|
@@ -4060,16 +4059,12 @@ declare class SegmentsResource {
|
|
|
4060
4059
|
declare class UpdatesResource {
|
|
4061
4060
|
private readonly http;
|
|
4062
4061
|
constructor(http: IHttpService);
|
|
4063
|
-
listPublic(params?: {
|
|
4064
|
-
type?: string;
|
|
4065
|
-
tags?: string;
|
|
4066
|
-
team?: string;
|
|
4067
|
-
active?: boolean;
|
|
4068
|
-
with?: UpdateRelation[];
|
|
4069
|
-
}): Promise<IAppResponse<Update[]>>;
|
|
4070
4062
|
list(params?: {
|
|
4071
|
-
|
|
4063
|
+
team?: string;
|
|
4064
|
+
type?: UpdateType | string;
|
|
4065
|
+
status?: string;
|
|
4072
4066
|
active?: boolean;
|
|
4067
|
+
tags?: string;
|
|
4073
4068
|
with?: UpdateRelation[];
|
|
4074
4069
|
}): Promise<IAppResponse<Update[]>>;
|
|
4075
4070
|
create(payload: UpdateCreatePayload): Promise<IAppResponse<Update>>;
|
package/dist/index.mjs
CHANGED
|
@@ -697,8 +697,9 @@ var CouponsResource = class {
|
|
|
697
697
|
constructor(http) {
|
|
698
698
|
this.http = http;
|
|
699
699
|
}
|
|
700
|
-
list(team) {
|
|
701
|
-
|
|
700
|
+
list(team, options) {
|
|
701
|
+
const qs = options?.public ? `?team=${encodeURIComponent(team)}` : "";
|
|
702
|
+
return this.http.get(`coupons${qs}`, options?.public ? {} : { headers: { "X-Team": team } });
|
|
702
703
|
}
|
|
703
704
|
create(team, data) {
|
|
704
705
|
return this.http.post("coupons", data, { headers: { "X-Team": team } });
|
|
@@ -1968,19 +1969,13 @@ var TeamsResource = class {
|
|
|
1968
1969
|
constructor(http) {
|
|
1969
1970
|
this.http = http;
|
|
1970
1971
|
}
|
|
1971
|
-
list() {
|
|
1972
|
-
return this.http.get("teams");
|
|
1973
|
-
}
|
|
1974
|
-
listPublic(params) {
|
|
1972
|
+
list(params) {
|
|
1975
1973
|
const qs = params?.tags ? `?tags=${encodeURIComponent(params.tags)}` : "";
|
|
1976
|
-
return this.http.get(`teams
|
|
1974
|
+
return this.http.get(`teams${qs}`);
|
|
1977
1975
|
}
|
|
1978
1976
|
get(slug) {
|
|
1979
1977
|
return this.http.get(`teams/${encodeURIComponent(slug)}`);
|
|
1980
1978
|
}
|
|
1981
|
-
getPublic(slug) {
|
|
1982
|
-
return this.http.get(`teams/public/${encodeURIComponent(slug)}`);
|
|
1983
|
-
}
|
|
1984
1979
|
create(data) {
|
|
1985
1980
|
return this.http.post("teams", data);
|
|
1986
1981
|
}
|
|
@@ -2095,20 +2090,13 @@ var UpdatesResource = class {
|
|
|
2095
2090
|
constructor(http) {
|
|
2096
2091
|
this.http = http;
|
|
2097
2092
|
}
|
|
2098
|
-
listPublic(params) {
|
|
2099
|
-
const query = new URLSearchParams();
|
|
2100
|
-
if (params?.type) query.set("type", params.type);
|
|
2101
|
-
if (params?.tags) query.set("tags", params.tags);
|
|
2102
|
-
if (params?.team) query.set("team", params.team);
|
|
2103
|
-
if (params?.active != null) query.set("active", String(params.active));
|
|
2104
|
-
if (params?.with?.length) query.set("with", params.with.join(","));
|
|
2105
|
-
const qs = query.toString();
|
|
2106
|
-
return this.http.get(`updates/public${qs ? "?" + qs : ""}`);
|
|
2107
|
-
}
|
|
2108
2093
|
list(params) {
|
|
2109
2094
|
const query = new URLSearchParams();
|
|
2095
|
+
if (params?.team) query.set("team", params.team);
|
|
2110
2096
|
if (params?.type) query.set("type", params.type);
|
|
2097
|
+
if (params?.status) query.set("status", params.status);
|
|
2111
2098
|
if (params?.active != null) query.set("active", String(params.active));
|
|
2099
|
+
if (params?.tags) query.set("tags", params.tags);
|
|
2112
2100
|
if (params?.with?.length) query.set("with", params.with.join(","));
|
|
2113
2101
|
const qs = query.toString();
|
|
2114
2102
|
return this.http.get(`updates${qs ? "?" + qs : ""}`);
|