@joai/sdk 9.0.0 → 9.0.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 +38 -8
- package/dist/index.mjs +49 -4
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _$_joai_core0 from "@joai/core";
|
|
2
|
-
import { Address, AddressCreatePayload, AddressInput, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, ApiToken, AppEnv, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentBooking, AppointmentPolicy, AppointmentPolicyUpsert, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementVariation, EmbedStatus, Entity, Flow, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IHttpService, IRequestOptions, Inquiry, InquiryType, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, McpToolCall, Media, MediaAspectRatio, Meeting, MeetingJoinInfo, MeetingSpeakerAssignment, MeetingSummary, Memory, Message, MetricSource, MetricsResult, Mission, MissionCreatePayload, Notification, NotificationChannel, NotificationSetting, OfficeSnapshot, Order, Order as Order$1, OrderContext, OrderPriceMode, OrderPriceMode as OrderPriceMode$1, OrderStatus, OrderStatus as OrderStatus$1, OrderType, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, Plan, PlanFeature, Product, Product as Product$1, ProductDetailSection, ProductRelation, ProductVariation, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalPollOption, PublicFormResults, PurchaseResult, RampProviderInfo, Reactions, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomKind, Segment, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, Service, SetKvEntryResult, SharedSocialPost, ShippingCarrierOption, ShippingRate, ShippingRate as ShippingRate$1, ShippingZone, Shortcut, Site, SiteBrand, SiteType, Skill, SkillScopeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreData, StorePriceTier, StorePurchaseResult, Subscription, Swarm, Tag, TagType, Task, TaxClass, Team, TeamAccessConfig, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPrivate, TeamUsage, TerminalConnectionToken, TerminalPaymentIntent, ToggleKvFieldResult, TranslatableValue, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeStatus, UserPrivate, UserRole, UserSettings, VolumePrice, WarpBackend, WarpBackendStatus, WarpExecutionBackend, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceInfo, XIntegrationStatus } from "@joai/core";
|
|
2
|
+
import { Address, AddressCreatePayload, AddressInput, AddressType, AddressUpdatePayload, Affiliate, AffiliateTier, Agent, AgentActionHistoryEntry, AgentPrivate, AgentSettings, AgentTrustedActionRule, AiCostsResponse, Alert, ApiToken, AppEnv, AppIngestion, AppendKvEntryResult, AppointmentAvailability, AppointmentBooking, AppointmentPolicy, AppointmentPolicyUpsert, AppointmentRequest, Artifact, ArtifactCreatePayload, ArtifactDeliverPayload, ArtifactDelivery, ArtifactDeliveryPreview, ArtifactStatus, ArtifactType, ArtifactUpdatePayload, AuthUser, AuthUser as AuthUser$1, Automation, AutomationActionInput, AutomationAudiencePreview, AutomationCreatePayload, AutomationEnrollment, AutomationStats, AutomationUpdatePayload, Blueprint, BlueprintSettings, BrandBackend, BrandSiteConfig, BrandSourceConfig, CalendarStatus, Campaign, CampaignAudiencePreview, CampaignAudiencePreviewPayload, CampaignCreatePayload, CampaignRecipient, CampaignRecipientStatus, CampaignStats, CampaignUpdatePayload, Card, Cart, Cart as Cart$1, CartLine, ChangelogEntry, Character, CheckoutSnapshot, CheckoutSnapshot as CheckoutSnapshot$1, CheckoutSnapshotRequest, CommissionAgreement, Configuration, Contact, ContactActivity, ContactCreatePayload, ContactFormData, ContactRelation, ContactRelationPayload, ContactRelationUpdatePayload, Content, ContentVersion, Contract, ContractCategoryName, ContractVersion, Coupon, CouponCondition, CouponRestrictedItem, CreateContentInput, CreateHookPayload, CreateHookPayload as CreateHookPayload$1, CreateInboundHookPayload, CreateInternalHookPayload, CreateKvFieldPayload, CreateWarpLinkedHookPayload, CreateWebHookPayload, Document, EarnResponse, Element, ElementSpec, ElementVariation, EmbedStatus, Entity, Flow, Fulfillment, FulfillmentLocation, FulfillmentLocation as FulfillmentLocation$1, FulfillmentMethod, GamificationData, Goal, GoalCreatePayload, GuestBuyer, GuestBuyer as GuestBuyer$1, Hook, Hook as Hook$1, HookSample, HookSample as HookSample$1, HookTrigger, HookTriggerCondition, HookTriggerInput, IAppResponse, IHttpService, IRequestOptions, Inquiry, InquiryType, Integration, IntegrationType, Intent, Item, ItemCreatePayload, ItemUpdatePayload, JsonValue, KvEntryPayload, KvField, KvFieldWithEntries, Link, LinkCreatePayload, LinkStats, LinkUpdatePayload, LinkVariation, LinkVariationBatchCreatePayload, LinkVariationCreatePayload, LoyaltyAccount, LoyaltyCollectPointInput, LoyaltyCollectResponse, LoyaltyJoinResponse, LoyaltyMember, LoyaltyProgram, LoyaltyPromotion, LoyaltyReward, LoyaltyTier, LoyaltyTransaction, LoyaltyWalletAccount, McpToolCall, Media, MediaAspectRatio, Meeting, MeetingJoinInfo, MeetingSpeakerAssignment, MeetingSummary, Memory, Message, MetricSource, MetricsResult, Mission, MissionCreatePayload, Notification, NotificationChannel, NotificationSetting, OfficeSnapshot, Order, Order as Order$1, OrderContext, OrderPriceMode, OrderPriceMode as OrderPriceMode$1, OrderStatus, OrderStatus as OrderStatus$1, OrderType, PaginatedResponse, Pass, PatchContentInput, PaymentAccount, PaymentAccountOnboarding, PaymentProvider, Plan, PlanFeature, Product, Product as Product$1, ProductDetailSection, ProductRelation, ProductVariation, ProgramSettings, Project, ProjectExportResponse, ProjectInputAssistIntent, ProjectInputAssistResponse, ProjectMutation, ProjectOutputPreset, ProjectOutputType, ProjectStudioHistoryEntry, Proposal, ProposalAction, ProposalPollOption, PublicFormResults, PurchaseResult, RampProviderInfo, Reactions, RedeemResponse, Reminder, Return, ReturnStatus, Room, RoomKind, Segment, SegmentCountPayload, SegmentCountResult, SegmentCreatePayload, Service, SetKvEntryResult, SharedSocialPost, ShippingCarrierOption, ShippingRate, ShippingRate as ShippingRate$1, ShippingZone, Shortcut, Site, SiteBrand, SiteType, Skill, SkillScopeValue, SocialAuthProvider, SocialBot, SocialPlatform, SocialPost, SocialPostConnection, SocialPostCreatePayload, SocialPostGenerateCaptionPayload, SocialPostGeneratedCaption, SocialPostPlatform, SocialPostStatus, SocialPostUpdatePayload, StampResponse, StoreAgent, StoreData, StorePriceTier, StorePurchaseResult, Subscription, Swarm, Tag, TagType, Task, TaxClass, Team, TeamAccessConfig, TeamCategory, TeamEarning, TeamEarningsBalance, TeamFeature, TeamFeatureUsage, TeamMember, TeamMeta, TeamOrderStats, TeamPayout, TeamPayoutAddress, TeamPrivate, TeamUsage, TerminalConnectionToken, TerminalPaymentIntent, ToggleKvFieldResult, TranslatableValue, Update, UpdateCreatePayload, UpdateRelation, UpdateStats, UpdateType, UpdateUpdatePayload, Upgrade, UpgradeStatus, UserPrivate, UserRole, UserSettings, VolumePrice, WarpBackend, WarpBackendStatus, WarpExecutionBackend, WebHookTriggerEvent, WorkspaceCloudFile, WorkspaceInfo, XIntegrationStatus } from "@joai/core";
|
|
3
3
|
import { WarpChainName, WarpClient, WarpLocale, WarpText, WarpWalletProvider } from "@joai/warps";
|
|
4
4
|
|
|
5
5
|
//#region src/resources/agents.d.ts
|
|
@@ -135,10 +135,11 @@ declare class FulfillmentsResource {
|
|
|
135
135
|
declare class ReturnsResource {
|
|
136
136
|
private readonly http;
|
|
137
137
|
constructor(http: IHttpService);
|
|
138
|
+
listForTeam(team?: string): Promise<_$_joai_core0.IAppResponse<Return[]>>;
|
|
138
139
|
list(orderId: string, accessToken?: string): Promise<_$_joai_core0.IAppResponse<Return[]>>;
|
|
139
140
|
create(orderId: string, data: {
|
|
140
141
|
reason: string;
|
|
141
|
-
fulfillmentId?:
|
|
142
|
+
fulfillmentId?: string;
|
|
142
143
|
items: {
|
|
143
144
|
orderItemId: number;
|
|
144
145
|
quantity: number;
|
|
@@ -1143,12 +1144,37 @@ declare class LinksResource {
|
|
|
1143
1144
|
declare class LoyaltyResource {
|
|
1144
1145
|
private readonly http;
|
|
1145
1146
|
constructor(http: IHttpService);
|
|
1147
|
+
/**
|
|
1148
|
+
* Program of a team. Without `team` (staff, X-Team set): every collect point; daily ones include `codeToday` and
|
|
1149
|
+
* `codeValidUntil` for signed-in team members (never for agent auth keys). With `team`: public / customer view, active
|
|
1150
|
+
* points only and never today's code; a customer token adds `collected`, `collectedAt` and `nextAvailableAt`.
|
|
1151
|
+
*/
|
|
1146
1152
|
getProgram(params?: {
|
|
1147
1153
|
team?: string;
|
|
1148
1154
|
}): Promise<_$_joai_core0.IAppResponse<LoyaltyProgram>>;
|
|
1155
|
+
/** Customer: join a team's program with the signed-in user's own contact. Idempotent. */
|
|
1156
|
+
join(params: {
|
|
1157
|
+
team: string;
|
|
1158
|
+
}): Promise<_$_joai_core0.IAppResponse<LoyaltyJoinResponse>>;
|
|
1159
|
+
/** Customer: all loyalty accounts of the signed-in user across teams. */
|
|
1160
|
+
getWallet(): Promise<_$_joai_core0.IAppResponse<LoyaltyWalletAccount[]>>;
|
|
1161
|
+
/** Customer: the signed-in user's own transactions on a team's program. */
|
|
1162
|
+
getWalletHistory(params: {
|
|
1163
|
+
team: string;
|
|
1164
|
+
page?: number;
|
|
1165
|
+
}): Promise<_$_joai_core0.IAppResponse<LoyaltyTransaction[]>>;
|
|
1166
|
+
/** Customer: collect at a collect point. Joins the program if needed; replays return `already: true`. */
|
|
1167
|
+
collect(params: {
|
|
1168
|
+
team: string;
|
|
1169
|
+
key: string;
|
|
1170
|
+
code?: string;
|
|
1171
|
+
}): Promise<_$_joai_core0.IAppResponse<LoyaltyCollectResponse>>;
|
|
1172
|
+
/** Staff: update the program. `settings.collect_points` replaces the collect point list (see LoyaltyCollectPointInput). */
|
|
1149
1173
|
updateProgram(data: {
|
|
1150
1174
|
name?: string;
|
|
1151
|
-
settings?: ProgramSettings
|
|
1175
|
+
settings?: ProgramSettings & {
|
|
1176
|
+
collect_points?: LoyaltyCollectPointInput[];
|
|
1177
|
+
};
|
|
1152
1178
|
}): Promise<_$_joai_core0.IAppResponse<LoyaltyProgram>>;
|
|
1153
1179
|
getRewards(): Promise<_$_joai_core0.IAppResponse<LoyaltyReward[]>>;
|
|
1154
1180
|
createReward(data: {
|
|
@@ -1360,6 +1386,8 @@ declare class MessagesResource {
|
|
|
1360
1386
|
generateAudio(messageId: string): Promise<_$_joai_core0.IAppResponse<{
|
|
1361
1387
|
audioUrl: string;
|
|
1362
1388
|
}>>;
|
|
1389
|
+
attachMedia(messageId: string, file: File): Promise<_$_joai_core0.IAppResponse<Message>>;
|
|
1390
|
+
completeMediaImport(messageId: string, file?: File | null): Promise<_$_joai_core0.IAppResponse<Message>>;
|
|
1363
1391
|
storeFeedback(agent: string, message: string, positive: boolean, inquiry: Inquiry | null): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
1364
1392
|
toggleReaction(messageId: string, emoji: string): Promise<_$_joai_core0.IAppResponse<{
|
|
1365
1393
|
reactions: Reactions | null;
|
|
@@ -1651,8 +1679,9 @@ declare class ServicesResource {
|
|
|
1651
1679
|
taxClassId?: string | null;
|
|
1652
1680
|
pricingModel?: string;
|
|
1653
1681
|
settings?: Record<string, unknown> | null;
|
|
1682
|
+
order?: number | null;
|
|
1654
1683
|
}): Promise<_$_joai_core0.IAppResponse<Service>>;
|
|
1655
|
-
update(id: string, data: Partial<Pick<Service, 'name' | 'price' | 'description' | 'active' | 'digital' | 'public' | 'bookable' | 'taxClassId'>> & {
|
|
1684
|
+
update(id: string, data: Partial<Pick<Service, 'name' | 'price' | 'description' | 'active' | 'digital' | 'public' | 'bookable' | 'taxClassId' | 'order'>> & {
|
|
1656
1685
|
durationMinutes?: number | null;
|
|
1657
1686
|
settings?: Record<string, unknown> | null;
|
|
1658
1687
|
}): Promise<_$_joai_core0.IAppResponse<Service>>;
|
|
@@ -1883,6 +1912,7 @@ declare class TeamsResource {
|
|
|
1883
1912
|
}): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
1884
1913
|
inviteMember(teamSlug: string, email: string, role: UserRole): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
1885
1914
|
removeMember(teamSlug: string, memberId: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
1915
|
+
updateMemberRole(teamSlug: string, memberId: string, role: UserRole): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
1886
1916
|
listMembers(teamSlug: string): Promise<_$_joai_core0.IAppResponse<TeamMember[]>>;
|
|
1887
1917
|
updateLogo(teamSlug: string, logo: string[]): Promise<_$_joai_core0.IAppResponse<TeamPrivate>>;
|
|
1888
1918
|
updateCover(teamSlug: string, cover: string[]): Promise<_$_joai_core0.IAppResponse<TeamPrivate>>;
|
|
@@ -1922,6 +1952,7 @@ declare class ArtifactsResource {
|
|
|
1922
1952
|
update(id: string, payload: ArtifactUpdatePayload): Promise<_$_joai_core0.IAppResponse<Artifact>>;
|
|
1923
1953
|
delete(id: string): Promise<_$_joai_core0.IAppResponse<void>>;
|
|
1924
1954
|
deliver(payload: ArtifactDeliverPayload): Promise<_$_joai_core0.IAppResponse<ArtifactDelivery[]>>;
|
|
1955
|
+
previewDelivery(payload: ArtifactDeliverPayload): Promise<_$_joai_core0.IAppResponse<ArtifactDeliveryPreview>>;
|
|
1925
1956
|
}
|
|
1926
1957
|
//#endregion
|
|
1927
1958
|
//#region src/resources/campaigns.d.ts
|
|
@@ -2404,16 +2435,15 @@ type OpenPortalSessionOptions = {
|
|
|
2404
2435
|
client: PortalClient;
|
|
2405
2436
|
redirect: string;
|
|
2406
2437
|
allowedOrigins: string[];
|
|
2407
|
-
env?: AppEnv;
|
|
2408
|
-
fetcher?: typeof fetch;
|
|
2409
|
-
onNavigate?: (
|
|
2438
|
+
env?: AppEnv; /** @deprecated Unused — exchange happens via same-origin blade form after navigation. */
|
|
2439
|
+
fetcher?: typeof fetch; /** Receives the API callback URL (with fragment token), not the final portal redirect. */
|
|
2440
|
+
onNavigate?: (callbackUrl: string) => void;
|
|
2410
2441
|
};
|
|
2411
2442
|
declare const openPortalSession: ({
|
|
2412
2443
|
client,
|
|
2413
2444
|
redirect,
|
|
2414
2445
|
allowedOrigins,
|
|
2415
2446
|
env,
|
|
2416
|
-
fetcher,
|
|
2417
2447
|
onNavigate
|
|
2418
2448
|
}: OpenPortalSessionOptions) => Promise<boolean>;
|
|
2419
2449
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -180,6 +180,9 @@ var ReturnsResource = class {
|
|
|
180
180
|
constructor(http) {
|
|
181
181
|
this.http = http;
|
|
182
182
|
}
|
|
183
|
+
listForTeam(team) {
|
|
184
|
+
return this.http.get("returns", team ? { headers: { "X-Team": team } } : void 0);
|
|
185
|
+
}
|
|
183
186
|
list(orderId, accessToken) {
|
|
184
187
|
return this.http.get(`orders/${orderId}/returns`, orderAccessHeaders$2(accessToken));
|
|
185
188
|
}
|
|
@@ -1736,10 +1739,33 @@ var LoyaltyResource = class {
|
|
|
1736
1739
|
constructor(http) {
|
|
1737
1740
|
this.http = http;
|
|
1738
1741
|
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Program of a team. Without `team` (staff, X-Team set): every collect point; daily ones include `codeToday` and
|
|
1744
|
+
* `codeValidUntil` for signed-in team members (never for agent auth keys). With `team`: public / customer view, active
|
|
1745
|
+
* points only and never today's code; a customer token adds `collected`, `collectedAt` and `nextAvailableAt`.
|
|
1746
|
+
*/
|
|
1739
1747
|
getProgram(params) {
|
|
1740
1748
|
const query = params?.team ? `?team=${encodeURIComponent(params.team)}` : "";
|
|
1741
1749
|
return this.http.get(`loyalty/program${query}`);
|
|
1742
1750
|
}
|
|
1751
|
+
/** Customer: join a team's program with the signed-in user's own contact. Idempotent. */
|
|
1752
|
+
join(params) {
|
|
1753
|
+
return this.http.post("loyalty/join", { team: params.team });
|
|
1754
|
+
}
|
|
1755
|
+
/** Customer: all loyalty accounts of the signed-in user across teams. */
|
|
1756
|
+
getWallet() {
|
|
1757
|
+
return this.http.get("loyalty/wallet");
|
|
1758
|
+
}
|
|
1759
|
+
/** Customer: the signed-in user's own transactions on a team's program. */
|
|
1760
|
+
getWalletHistory(params) {
|
|
1761
|
+
const query = params.page ? `?page=${params.page}` : "";
|
|
1762
|
+
return this.http.get(`loyalty/wallet/${encodeURIComponent(params.team)}/history${query}`);
|
|
1763
|
+
}
|
|
1764
|
+
/** Customer: collect at a collect point. Joins the program if needed; replays return `already: true`. */
|
|
1765
|
+
collect(params) {
|
|
1766
|
+
return this.http.post("loyalty/collect", params);
|
|
1767
|
+
}
|
|
1768
|
+
/** Staff: update the program. `settings.collect_points` replaces the collect point list (see LoyaltyCollectPointInput). */
|
|
1743
1769
|
updateProgram(data) {
|
|
1744
1770
|
return this.http.patch("loyalty/program", data);
|
|
1745
1771
|
}
|
|
@@ -2067,6 +2093,17 @@ var MessagesResource = class {
|
|
|
2067
2093
|
generateAudio(messageId) {
|
|
2068
2094
|
return this.http.post(`messages/${messageId}/audio`, {});
|
|
2069
2095
|
}
|
|
2096
|
+
attachMedia(messageId, file) {
|
|
2097
|
+
const form = new FormData();
|
|
2098
|
+
form.append("file", file, file.name);
|
|
2099
|
+
return this.http.post(`messages/${messageId}/media`, form, { isJson: false });
|
|
2100
|
+
}
|
|
2101
|
+
completeMediaImport(messageId, file) {
|
|
2102
|
+
if (!file) return this.http.post(`messages/${messageId}/media-import`, {});
|
|
2103
|
+
const form = new FormData();
|
|
2104
|
+
form.append("file", file, file.name);
|
|
2105
|
+
return this.http.post(`messages/${messageId}/media-import`, form, { isJson: false });
|
|
2106
|
+
}
|
|
2070
2107
|
storeFeedback(agent, message, positive, inquiry) {
|
|
2071
2108
|
return this.http.post("feedback", {
|
|
2072
2109
|
agent,
|
|
@@ -2688,6 +2725,12 @@ var TeamsResource = class {
|
|
|
2688
2725
|
removeMember(teamSlug, memberId) {
|
|
2689
2726
|
return this.http.post(`teams/${teamSlug}/members/remove`, { member: memberId });
|
|
2690
2727
|
}
|
|
2728
|
+
updateMemberRole(teamSlug, memberId, role) {
|
|
2729
|
+
return this.http.post(`teams/${teamSlug}/members/role`, {
|
|
2730
|
+
member: memberId,
|
|
2731
|
+
role
|
|
2732
|
+
});
|
|
2733
|
+
}
|
|
2691
2734
|
listMembers(teamSlug) {
|
|
2692
2735
|
return this.http.get(`teams/${teamSlug}/members`);
|
|
2693
2736
|
}
|
|
@@ -2771,6 +2814,9 @@ var ArtifactsResource = class {
|
|
|
2771
2814
|
deliver(payload) {
|
|
2772
2815
|
return this.http.post("artifacts/deliver", payload);
|
|
2773
2816
|
}
|
|
2817
|
+
previewDelivery(payload) {
|
|
2818
|
+
return this.http.post("artifacts/preview-delivery", payload);
|
|
2819
|
+
}
|
|
2774
2820
|
};
|
|
2775
2821
|
//#endregion
|
|
2776
2822
|
//#region src/resources/campaigns.ts
|
|
@@ -3616,19 +3662,18 @@ const completePortalSession = async (callbackUrl, fetcher = fetch) => {
|
|
|
3616
3662
|
return false;
|
|
3617
3663
|
}
|
|
3618
3664
|
};
|
|
3619
|
-
const openPortalSession = async ({ client, redirect, allowedOrigins, env = "mainnet",
|
|
3665
|
+
const openPortalSession = async ({ client, redirect, allowedOrigins, env = "mainnet", onNavigate }) => {
|
|
3620
3666
|
if (!isAllowedRedirectUrl(redirect, allowedOrigins)) return false;
|
|
3621
3667
|
const response = await client.auth.createPortalSession(redirect);
|
|
3622
3668
|
const callbackUrl = sanitizePortalCallbackUrl(response.ok ? response.data?.url : null, env);
|
|
3623
3669
|
if (!callbackUrl) return false;
|
|
3624
|
-
if (!await completePortalSession(callbackUrl, fetcher)) return false;
|
|
3625
3670
|
if (!isAllowedRedirectUrl(redirect, allowedOrigins)) return false;
|
|
3626
3671
|
if (onNavigate) {
|
|
3627
|
-
onNavigate(
|
|
3672
|
+
onNavigate(callbackUrl);
|
|
3628
3673
|
return true;
|
|
3629
3674
|
}
|
|
3630
3675
|
if (typeof window !== "undefined") {
|
|
3631
|
-
window.location.assign(
|
|
3676
|
+
window.location.assign(callbackUrl);
|
|
3632
3677
|
return true;
|
|
3633
3678
|
}
|
|
3634
3679
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joai/sdk",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "JoAi public API SDK — build with your AI agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"test": "jest --config jest.config.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@joai/core": "^5.0.
|
|
38
|
+
"@joai/core": "^5.0.1",
|
|
39
39
|
"@joai/warps": "*"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@joai/core": "^5.0.
|
|
42
|
+
"@joai/core": "^5.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"tsdown": "^0.21.0",
|