@joai/sdk 0.15.1 → 0.17.0
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 +171 -5
- package/dist/index.mjs +115 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -138,6 +138,15 @@ type Wallet = {
|
|
|
138
138
|
privateKey?: string;
|
|
139
139
|
mnemonic?: string;
|
|
140
140
|
};
|
|
141
|
+
type User = {
|
|
142
|
+
id: string;
|
|
143
|
+
name: string;
|
|
144
|
+
address: string;
|
|
145
|
+
balance: number | null;
|
|
146
|
+
hasProfileImage: boolean;
|
|
147
|
+
profileImageUrl: string;
|
|
148
|
+
swarmRole: string | null;
|
|
149
|
+
};
|
|
141
150
|
//#endregion
|
|
142
151
|
//#region src/billing/types.d.ts
|
|
143
152
|
type TranslatableValue = Partial<Record<WarpLocale, string>>;
|
|
@@ -157,6 +166,39 @@ type AppSubscription = {
|
|
|
157
166
|
createdAt: string;
|
|
158
167
|
updatedAt: string;
|
|
159
168
|
};
|
|
169
|
+
type PaymentProvider = 'xmoney' | 'lemonsqueezy' | 'stripe' | 'apple' | 'google' | 'blockchain' | 'offline';
|
|
170
|
+
type PlanFeature = 'general' | 'messages' | 'team-members' | 'teams' | 'support' | 'agent' | 'auto-mode' | 'cloud-sync' | 'wallet-cloud' | 'wallet-cloud-premium' | 'wallet-multi' | 'cards' | 'alerts' | 'advanced-commands' | 'tasks' | 'integrations' | 'message-history' | 'memory' | 'documents' | 'voice-input' | 'voice-live' | 'image-gen' | 'video-gen' | 'openclaw' | 'skills' | 'items' | 'context-length' | 'workspace-storage' | 'ingestions' | 'agent-email' | 'streak-freezes' | 'byok' | 'mcp' | 'phone-call' | 'phone-number' | 'custom-domain' | 'contacts' | 'links' | 'store-fee-rate' | 'store-fee-rate-physical';
|
|
171
|
+
type PlanBenefit = {
|
|
172
|
+
label: Partial<Record<WarpLocale, string>>;
|
|
173
|
+
tip?: Partial<Record<WarpLocale, string>>;
|
|
174
|
+
secondary?: boolean;
|
|
175
|
+
};
|
|
176
|
+
type PlanExtra = {
|
|
177
|
+
amount: number;
|
|
178
|
+
price: number;
|
|
179
|
+
unitName: string;
|
|
180
|
+
};
|
|
181
|
+
type PlanInterval = 'weekly' | 'monthly' | 'yearly' | 'lifetime';
|
|
182
|
+
type Plan = {
|
|
183
|
+
resource: 'plan';
|
|
184
|
+
sku: string;
|
|
185
|
+
name: TranslatableValue;
|
|
186
|
+
description: Partial<Record<WarpLocale, string>>;
|
|
187
|
+
price: number;
|
|
188
|
+
priceDisplay: string;
|
|
189
|
+
interval: PlanInterval;
|
|
190
|
+
intervalDisplay: PlanInterval;
|
|
191
|
+
features: PlanFeature[];
|
|
192
|
+
benefits: Record<PlanFeature, PlanBenefit>;
|
|
193
|
+
limits: Record<PlanFeature, string>;
|
|
194
|
+
extras: Record<PlanFeature, PlanExtra>;
|
|
195
|
+
meta: {
|
|
196
|
+
appleProductId: string | null;
|
|
197
|
+
googleProductId: string | null;
|
|
198
|
+
trialPeriodDays: number;
|
|
199
|
+
isLifetime: boolean;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
160
202
|
type ProductRating = {
|
|
161
203
|
average: number;
|
|
162
204
|
count: number;
|
|
@@ -288,6 +330,9 @@ type Coupon = {
|
|
|
288
330
|
percent: number;
|
|
289
331
|
expiresAt: string | null;
|
|
290
332
|
};
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/team/types.d.ts
|
|
335
|
+
type TeamCategory = 'general' | 'appointment' | 'restaurant' | 'service' | 'fitness' | 'beauty' | 'consultation';
|
|
291
336
|
type TeamFeature = 'shop' | 'appointments';
|
|
292
337
|
type TeamMeta = {
|
|
293
338
|
'extra.messages'?: number;
|
|
@@ -310,6 +355,7 @@ type Team = {
|
|
|
310
355
|
slug: string;
|
|
311
356
|
name: string;
|
|
312
357
|
personal: boolean;
|
|
358
|
+
category?: TeamCategory;
|
|
313
359
|
description: TranslatableValue | null;
|
|
314
360
|
locale: WarpLocale;
|
|
315
361
|
timezone: string;
|
|
@@ -337,6 +383,38 @@ type TeamBrand = {
|
|
|
337
383
|
invoiceZip?: string;
|
|
338
384
|
invoiceCountry?: string;
|
|
339
385
|
};
|
|
386
|
+
type TeamPrivate = {
|
|
387
|
+
slug: string;
|
|
388
|
+
name: string;
|
|
389
|
+
personal: boolean;
|
|
390
|
+
description: TranslatableValue | null;
|
|
391
|
+
tagline: TranslatableValue | null;
|
|
392
|
+
balance: number;
|
|
393
|
+
locale: WarpLocale;
|
|
394
|
+
timezone: string;
|
|
395
|
+
logo: string | null;
|
|
396
|
+
cover: string | null;
|
|
397
|
+
subscription: {
|
|
398
|
+
premium: boolean;
|
|
399
|
+
lifetime: boolean;
|
|
400
|
+
plan: Plan;
|
|
401
|
+
provider: PaymentProvider | null;
|
|
402
|
+
payer: User | null;
|
|
403
|
+
gracePeriod: boolean;
|
|
404
|
+
autoRenew: boolean;
|
|
405
|
+
uncapped: boolean;
|
|
406
|
+
cycleEndsAt: string | null;
|
|
407
|
+
resetsAt: string | null;
|
|
408
|
+
startedAt: string | null;
|
|
409
|
+
renewedAt: string | null;
|
|
410
|
+
expiresAt: string | null;
|
|
411
|
+
};
|
|
412
|
+
meta: TeamMeta;
|
|
413
|
+
branding: TeamBrand;
|
|
414
|
+
category?: TeamCategory;
|
|
415
|
+
createdAt: string;
|
|
416
|
+
justCreated: boolean;
|
|
417
|
+
};
|
|
340
418
|
type ByokProviderConfig = {
|
|
341
419
|
apiKey?: string;
|
|
342
420
|
accessKey?: string;
|
|
@@ -867,13 +945,14 @@ type Contact = {
|
|
|
867
945
|
locale?: string | null;
|
|
868
946
|
props?: Record<string, string> | null;
|
|
869
947
|
};
|
|
948
|
+
type ContactActivityType = 'note' | 'call' | 'meeting' | 'task' | 'update' | 'custom' | 'form';
|
|
870
949
|
type ContactActivityAuthor = {
|
|
871
950
|
name: string;
|
|
872
951
|
imageUrl: string | null;
|
|
873
952
|
};
|
|
874
953
|
type ContactActivity = {
|
|
875
954
|
id: string;
|
|
876
|
-
type:
|
|
955
|
+
type: ContactActivityType;
|
|
877
956
|
description: string | null;
|
|
878
957
|
meta: Record<string, any> | null;
|
|
879
958
|
agentName: string | null;
|
|
@@ -1043,6 +1122,13 @@ type BrandSiteConfig = {
|
|
|
1043
1122
|
};
|
|
1044
1123
|
//#endregion
|
|
1045
1124
|
//#region src/link/types.d.ts
|
|
1125
|
+
type LinkScanHistory = {
|
|
1126
|
+
daily: number[];
|
|
1127
|
+
geography: Record<string, number>;
|
|
1128
|
+
devices?: Record<string, number>;
|
|
1129
|
+
operatingSystems?: Record<string, number>;
|
|
1130
|
+
browsers?: Record<string, number>;
|
|
1131
|
+
};
|
|
1046
1132
|
type Link = {
|
|
1047
1133
|
id: string;
|
|
1048
1134
|
url: string;
|
|
@@ -1050,18 +1136,49 @@ type Link = {
|
|
|
1050
1136
|
status: 'active' | 'paused' | 'expired';
|
|
1051
1137
|
title: string | null;
|
|
1052
1138
|
scanCount: number;
|
|
1053
|
-
scanHistory:
|
|
1054
|
-
scanGeography: Record<string, number>;
|
|
1139
|
+
scanHistory: LinkScanHistory;
|
|
1055
1140
|
lastScannedAt: string | null;
|
|
1056
1141
|
createdAt: string;
|
|
1057
1142
|
updatedAt: string;
|
|
1058
1143
|
};
|
|
1144
|
+
type LinkVariation = {
|
|
1145
|
+
id: string;
|
|
1146
|
+
linkId: string;
|
|
1147
|
+
title: string | null;
|
|
1148
|
+
values: Record<string, string>;
|
|
1149
|
+
url: string;
|
|
1150
|
+
shortUrl: string;
|
|
1151
|
+
status: 'active' | 'paused' | 'expired';
|
|
1152
|
+
scanCount: number;
|
|
1153
|
+
lastScannedAt: string | null;
|
|
1154
|
+
createdAt: string;
|
|
1155
|
+
updatedAt: string;
|
|
1156
|
+
};
|
|
1157
|
+
type LinkVariationCreatePayload = {
|
|
1158
|
+
title?: string | null;
|
|
1159
|
+
values: Record<string, string>;
|
|
1160
|
+
};
|
|
1161
|
+
type LinkVariationBatchCreatePayload = {
|
|
1162
|
+
placeholder: string;
|
|
1163
|
+
labelTemplate?: string | null;
|
|
1164
|
+
from?: number | null;
|
|
1165
|
+
to?: number | null;
|
|
1166
|
+
values?: Array<{
|
|
1167
|
+
value: string;
|
|
1168
|
+
label?: string | null;
|
|
1169
|
+
}>;
|
|
1170
|
+
};
|
|
1059
1171
|
type LinkCreatePayload = {
|
|
1060
1172
|
url: string;
|
|
1061
1173
|
title: string;
|
|
1062
1174
|
};
|
|
1063
1175
|
type LinkUpdatePayload = Partial<LinkCreatePayload>;
|
|
1064
|
-
|
|
1176
|
+
type LinkStats = {
|
|
1177
|
+
totalLinks: number;
|
|
1178
|
+
activeLinks: number;
|
|
1179
|
+
totalScans: number;
|
|
1180
|
+
scanHistory: LinkScanHistory;
|
|
1181
|
+
}; //#endregion
|
|
1065
1182
|
//#region src/store/types.d.ts
|
|
1066
1183
|
type StoreVisibility = 'private' | 'team' | 'public';
|
|
1067
1184
|
type StoreEntry = {
|
|
@@ -1109,6 +1226,7 @@ type StoreToggleResult = {
|
|
|
1109
1226
|
//#region src/update/types.d.ts
|
|
1110
1227
|
type UpdateType = 'deal' | 'event' | 'update';
|
|
1111
1228
|
type UpdateStatus = 'draft' | 'published' | 'archived';
|
|
1229
|
+
type UpdateRelation = 'team';
|
|
1112
1230
|
type Update = {
|
|
1113
1231
|
id: string;
|
|
1114
1232
|
type: UpdateType;
|
|
@@ -1120,6 +1238,7 @@ type Update = {
|
|
|
1120
1238
|
linkUrl: string | null;
|
|
1121
1239
|
startsAt: string | null;
|
|
1122
1240
|
endsAt: string | null;
|
|
1241
|
+
team?: Team;
|
|
1123
1242
|
createdAt: string;
|
|
1124
1243
|
updatedAt: string;
|
|
1125
1244
|
};
|
|
@@ -1149,6 +1268,27 @@ type UpdateStats = {
|
|
|
1149
1268
|
//#region src/swarm/types.d.ts
|
|
1150
1269
|
//#endregion
|
|
1151
1270
|
//#region src/resources/appointments.d.ts
|
|
1271
|
+
declare const WEEKDAYS: readonly ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
|
1272
|
+
type Weekday = typeof WEEKDAYS[number];
|
|
1273
|
+
type OpeningHoursRange = string | {
|
|
1274
|
+
start: string;
|
|
1275
|
+
end: string;
|
|
1276
|
+
};
|
|
1277
|
+
type OpeningHoursAvailability = Partial<Record<Weekday | string, OpeningHoursRange[] | null | undefined>> | null | undefined;
|
|
1278
|
+
type OpeningHoursEntry = {
|
|
1279
|
+
days: string;
|
|
1280
|
+
time: string;
|
|
1281
|
+
};
|
|
1282
|
+
type OpeningHoursFormatOptions = {
|
|
1283
|
+
locale?: string;
|
|
1284
|
+
dayFormat?: 'narrow' | 'short' | 'long';
|
|
1285
|
+
dayLabels?: Partial<Record<Weekday, string>>;
|
|
1286
|
+
dayRangeSeparator?: string;
|
|
1287
|
+
dayListSeparator?: string;
|
|
1288
|
+
lastDayListSeparator?: string;
|
|
1289
|
+
timeRangeSeparator?: string;
|
|
1290
|
+
};
|
|
1291
|
+
declare const formatOpeningHours: (availability: OpeningHoursAvailability, options?: OpeningHoursFormatOptions) => OpeningHoursEntry[];
|
|
1152
1292
|
declare class AppointmentsResource {
|
|
1153
1293
|
private readonly http;
|
|
1154
1294
|
private readonly config;
|
|
@@ -1345,6 +1485,7 @@ declare class ContactsResource {
|
|
|
1345
1485
|
constructor(http: IHttpService);
|
|
1346
1486
|
list(params?: {
|
|
1347
1487
|
search?: string;
|
|
1488
|
+
page?: number;
|
|
1348
1489
|
}): Promise<IAppResponse<{
|
|
1349
1490
|
data: Contact[];
|
|
1350
1491
|
}>>;
|
|
@@ -1425,11 +1566,17 @@ type MediaUploadType = 'brand' | 'reference' | 'template' | 'output';
|
|
|
1425
1566
|
declare class MediaResource {
|
|
1426
1567
|
private readonly http;
|
|
1427
1568
|
constructor(http: IHttpService);
|
|
1569
|
+
listPublic(params?: {
|
|
1570
|
+
tags?: string;
|
|
1571
|
+
team?: string;
|
|
1572
|
+
mime?: string;
|
|
1573
|
+
}): Promise<IAppResponse<Media[]>>;
|
|
1428
1574
|
upload(data: {
|
|
1429
1575
|
team: string;
|
|
1430
1576
|
file: File;
|
|
1431
1577
|
type: MediaUploadType;
|
|
1432
1578
|
label?: string;
|
|
1579
|
+
tags?: string[];
|
|
1433
1580
|
}): Promise<IAppResponse<Media>>;
|
|
1434
1581
|
}
|
|
1435
1582
|
//#endregion
|
|
@@ -1465,12 +1612,18 @@ declare class MemoriesResource {
|
|
|
1465
1612
|
constructor(http: IHttpService);
|
|
1466
1613
|
list(params?: {
|
|
1467
1614
|
search?: string;
|
|
1615
|
+
contactId?: string;
|
|
1468
1616
|
}): Promise<IAppResponse<{
|
|
1469
1617
|
data: Memory[];
|
|
1470
1618
|
}>>;
|
|
1471
1619
|
add(payload: {
|
|
1472
1620
|
agentId: string;
|
|
1473
1621
|
content: string;
|
|
1622
|
+
contactId?: string;
|
|
1623
|
+
}): Promise<IAppResponse<Memory>>;
|
|
1624
|
+
update(id: string, data: {
|
|
1625
|
+
name: string;
|
|
1626
|
+
content: string;
|
|
1474
1627
|
}): Promise<IAppResponse<Memory>>;
|
|
1475
1628
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1476
1629
|
}
|
|
@@ -1577,6 +1730,8 @@ declare class TeamsResource {
|
|
|
1577
1730
|
email: string;
|
|
1578
1731
|
role: 'owner' | 'admin' | 'member';
|
|
1579
1732
|
}): Promise<IAppResponse<unknown>>;
|
|
1733
|
+
updateLogo(teamSlug: string, logo: MediaLibraryItems): Promise<IAppResponse<TeamPrivate>>;
|
|
1734
|
+
updateCover(teamSlug: string, cover: MediaLibraryItems): Promise<IAppResponse<TeamPrivate>>;
|
|
1580
1735
|
}
|
|
1581
1736
|
//#endregion
|
|
1582
1737
|
//#region src/resources/stores.d.ts
|
|
@@ -1606,12 +1761,14 @@ declare class UpdatesResource {
|
|
|
1606
1761
|
listPublic(params?: {
|
|
1607
1762
|
type?: string;
|
|
1608
1763
|
tags?: string;
|
|
1764
|
+
with?: UpdateRelation[];
|
|
1609
1765
|
}): Promise<IAppResponse<{
|
|
1610
1766
|
data: Update[];
|
|
1611
1767
|
}>>;
|
|
1612
1768
|
list(params?: {
|
|
1613
1769
|
type?: UpdateType;
|
|
1614
1770
|
active?: boolean;
|
|
1771
|
+
with?: UpdateRelation[];
|
|
1615
1772
|
}): Promise<IAppResponse<{
|
|
1616
1773
|
data: Update[];
|
|
1617
1774
|
}>>;
|
|
@@ -1634,6 +1791,15 @@ declare class LinksResource {
|
|
|
1634
1791
|
create(payload: LinkCreatePayload): Promise<IAppResponse<Link>>;
|
|
1635
1792
|
update(id: string, payload: LinkUpdatePayload): Promise<IAppResponse<Link>>;
|
|
1636
1793
|
delete(id: string): Promise<IAppResponse<unknown>>;
|
|
1794
|
+
stats(): Promise<IAppResponse<LinkStats>>;
|
|
1795
|
+
variations(linkId: string): Promise<IAppResponse<{
|
|
1796
|
+
data: LinkVariation[];
|
|
1797
|
+
}>>;
|
|
1798
|
+
createVariation(linkId: string, payload: LinkVariationCreatePayload): Promise<IAppResponse<LinkVariation>>;
|
|
1799
|
+
createVariationBatch(linkId: string, payload: LinkVariationBatchCreatePayload): Promise<IAppResponse<{
|
|
1800
|
+
data: LinkVariation[];
|
|
1801
|
+
}>>;
|
|
1802
|
+
deleteVariation(linkId: string, variationId: string): Promise<IAppResponse<unknown>>;
|
|
1637
1803
|
}
|
|
1638
1804
|
//#endregion
|
|
1639
1805
|
//#region src/resources/warps.d.ts
|
|
@@ -1773,4 +1939,4 @@ declare class DistributionResource {
|
|
|
1773
1939
|
private fetchDistribution;
|
|
1774
1940
|
}
|
|
1775
1941
|
//#endregion
|
|
1776
|
-
export { AppointmentsResource, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BlueprintsResource, type CacheConfig, CachedHttpService, CartsResource, ContactsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, MarketplaceResource, MeetingsResource, type Order, OrdersResource, type Product, type ProductVariation, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, WarpsResource, createClient };
|
|
1942
|
+
export { AppointmentsResource, AuthResource, type AuthSendCodeRequest, type AuthVerifyResponse, type BackendWarp, type BackendWarpBrand, BlueprintsResource, type CacheConfig, CachedHttpService, CartsResource, ContactsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, type JoAiClientConfig, LinksResource, MarketplaceResource, MeetingsResource, type OpeningHoursEntry, type OpeningHoursFormatOptions, type Order, OrdersResource, type Product, type ProductVariation, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, WarpsResource, createClient, formatOpeningHours };
|
package/dist/index.mjs
CHANGED
|
@@ -111,6 +111,83 @@ var HttpService = class {
|
|
|
111
111
|
};
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/resources/appointments.ts
|
|
114
|
+
const WEEKDAYS = [
|
|
115
|
+
"monday",
|
|
116
|
+
"tuesday",
|
|
117
|
+
"wednesday",
|
|
118
|
+
"thursday",
|
|
119
|
+
"friday",
|
|
120
|
+
"saturday",
|
|
121
|
+
"sunday"
|
|
122
|
+
];
|
|
123
|
+
const WEEKDAY_DATES = [
|
|
124
|
+
"2024-01-01",
|
|
125
|
+
"2024-01-02",
|
|
126
|
+
"2024-01-03",
|
|
127
|
+
"2024-01-04",
|
|
128
|
+
"2024-01-05",
|
|
129
|
+
"2024-01-06",
|
|
130
|
+
"2024-01-07"
|
|
131
|
+
];
|
|
132
|
+
const formatTimeRange = (range, separator) => {
|
|
133
|
+
if (typeof range === "string") return range.replace(/\s*-\s*/, ` ${separator} `);
|
|
134
|
+
return `${range.start} ${separator} ${range.end}`;
|
|
135
|
+
};
|
|
136
|
+
const labelForDay = (day, options) => {
|
|
137
|
+
if (options.dayLabels?.[day]) return options.dayLabels[day];
|
|
138
|
+
const date = /* @__PURE__ */ new Date(`${WEEKDAY_DATES[WEEKDAYS.indexOf(day)]}T12:00:00Z`);
|
|
139
|
+
return new Intl.DateTimeFormat(options.locale, {
|
|
140
|
+
weekday: options.dayFormat,
|
|
141
|
+
timeZone: "UTC"
|
|
142
|
+
}).format(date).replace(/\.$/, "");
|
|
143
|
+
};
|
|
144
|
+
const formatDayIndexes = (indexes, options) => {
|
|
145
|
+
const ranges = [];
|
|
146
|
+
let start = indexes[0];
|
|
147
|
+
let previous = indexes[0];
|
|
148
|
+
for (const index of indexes.slice(1)) {
|
|
149
|
+
if (index === previous + 1) {
|
|
150
|
+
previous = index;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
ranges.push(start === previous ? labelForDay(WEEKDAYS[start], options) : `${labelForDay(WEEKDAYS[start], options)} ${options.dayRangeSeparator} ${labelForDay(WEEKDAYS[previous], options)}`);
|
|
154
|
+
start = index;
|
|
155
|
+
previous = index;
|
|
156
|
+
}
|
|
157
|
+
ranges.push(start === previous ? labelForDay(WEEKDAYS[start], options) : `${labelForDay(WEEKDAYS[start], options)} ${options.dayRangeSeparator} ${labelForDay(WEEKDAYS[previous], options)}`);
|
|
158
|
+
if (ranges.length <= 1) return ranges[0] ?? "";
|
|
159
|
+
return `${ranges.slice(0, -1).join(options.dayListSeparator)}${options.lastDayListSeparator}${ranges.at(-1)}`;
|
|
160
|
+
};
|
|
161
|
+
const formatOpeningHours = (availability, options = {}) => {
|
|
162
|
+
if (!availability) return [];
|
|
163
|
+
const resolvedOptions = {
|
|
164
|
+
locale: options.locale ?? "en",
|
|
165
|
+
dayFormat: options.dayFormat ?? "short",
|
|
166
|
+
dayLabels: options.dayLabels ?? {},
|
|
167
|
+
dayRangeSeparator: options.dayRangeSeparator ?? "–",
|
|
168
|
+
dayListSeparator: options.dayListSeparator ?? ", ",
|
|
169
|
+
lastDayListSeparator: options.lastDayListSeparator ?? " & ",
|
|
170
|
+
timeRangeSeparator: options.timeRangeSeparator ?? "–"
|
|
171
|
+
};
|
|
172
|
+
const lines = [];
|
|
173
|
+
for (const [dayIndex, day] of WEEKDAYS.entries()) {
|
|
174
|
+
const ranges = availability[day];
|
|
175
|
+
if (!ranges?.length) continue;
|
|
176
|
+
for (const range of ranges) {
|
|
177
|
+
const time = formatTimeRange(range, resolvedOptions.timeRangeSeparator);
|
|
178
|
+
const existing = lines.find((line) => line.time === time);
|
|
179
|
+
if (existing) existing.dayIndexes.push(dayIndex);
|
|
180
|
+
else lines.push({
|
|
181
|
+
dayIndexes: [dayIndex],
|
|
182
|
+
time
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return lines.map((line) => ({
|
|
187
|
+
days: formatDayIndexes(line.dayIndexes, resolvedOptions),
|
|
188
|
+
time: line.time
|
|
189
|
+
}));
|
|
190
|
+
};
|
|
114
191
|
var AppointmentsResource = class {
|
|
115
192
|
constructor(http, config) {
|
|
116
193
|
this.http = http;
|
|
@@ -354,6 +431,7 @@ var ContactsResource = class {
|
|
|
354
431
|
list(params) {
|
|
355
432
|
const query = new URLSearchParams();
|
|
356
433
|
if (params?.search) query.set("search", params.search);
|
|
434
|
+
if (params?.page) query.set("page", String(params.page));
|
|
357
435
|
const qs = query.toString();
|
|
358
436
|
return this.http.get(`contacts${qs ? "?" + qs : ""}`);
|
|
359
437
|
}
|
|
@@ -467,11 +545,20 @@ var MediaResource = class {
|
|
|
467
545
|
constructor(http) {
|
|
468
546
|
this.http = http;
|
|
469
547
|
}
|
|
548
|
+
listPublic(params) {
|
|
549
|
+
const query = new URLSearchParams();
|
|
550
|
+
if (params?.tags) query.set("tags", params.tags);
|
|
551
|
+
if (params?.team) query.set("team", params.team);
|
|
552
|
+
if (params?.mime) query.set("mime", params.mime);
|
|
553
|
+
const qs = query.toString();
|
|
554
|
+
return this.http.get(`media/public${qs ? "?" + qs : ""}`);
|
|
555
|
+
}
|
|
470
556
|
upload(data) {
|
|
471
557
|
const formData = new FormData();
|
|
472
558
|
formData.append("file", data.file, data.file.name);
|
|
473
559
|
formData.append("type", data.type);
|
|
474
560
|
if (data.label) formData.append("label", data.label);
|
|
561
|
+
if (data.tags) data.tags.forEach((t) => formData.append("tags[]", t));
|
|
475
562
|
return this.http.post("media", formData, { headers: { "X-Team": data.team } });
|
|
476
563
|
}
|
|
477
564
|
};
|
|
@@ -525,12 +612,16 @@ var MemoriesResource = class {
|
|
|
525
612
|
list(params) {
|
|
526
613
|
const query = new URLSearchParams();
|
|
527
614
|
if (params?.search) query.set("search", params.search);
|
|
615
|
+
if (params?.contactId) query.set("contactId", params.contactId);
|
|
528
616
|
const qs = query.toString();
|
|
529
617
|
return this.http.get(`memories${qs ? "?" + qs : ""}`);
|
|
530
618
|
}
|
|
531
619
|
add(payload) {
|
|
532
620
|
return this.http.post("memories", payload);
|
|
533
621
|
}
|
|
622
|
+
update(id, data) {
|
|
623
|
+
return this.http.put(`memories/${id}`, data);
|
|
624
|
+
}
|
|
534
625
|
delete(id) {
|
|
535
626
|
return this.http.delete(`memories/${id}`);
|
|
536
627
|
}
|
|
@@ -645,6 +736,12 @@ var TeamsResource = class {
|
|
|
645
736
|
invite(teamSlug, payload) {
|
|
646
737
|
return this.http.post(`teams/${teamSlug}/invitations`, payload);
|
|
647
738
|
}
|
|
739
|
+
updateLogo(teamSlug, logo) {
|
|
740
|
+
return this.http.post(`teams/${teamSlug}/logo`, { logo });
|
|
741
|
+
}
|
|
742
|
+
updateCover(teamSlug, cover) {
|
|
743
|
+
return this.http.post(`teams/${teamSlug}/cover`, { cover });
|
|
744
|
+
}
|
|
648
745
|
};
|
|
649
746
|
//#endregion
|
|
650
747
|
//#region src/resources/stores.ts
|
|
@@ -690,6 +787,7 @@ var UpdatesResource = class {
|
|
|
690
787
|
const query = new URLSearchParams();
|
|
691
788
|
if (params?.type) query.set("type", params.type);
|
|
692
789
|
if (params?.tags) query.set("tags", params.tags);
|
|
790
|
+
if (params?.with?.length) query.set("with", params.with.join(","));
|
|
693
791
|
const qs = query.toString();
|
|
694
792
|
return this.http.get(`updates/public${qs ? "?" + qs : ""}`);
|
|
695
793
|
}
|
|
@@ -697,6 +795,7 @@ var UpdatesResource = class {
|
|
|
697
795
|
const query = new URLSearchParams();
|
|
698
796
|
if (params?.type) query.set("type", params.type);
|
|
699
797
|
if (params?.active != null) query.set("active", String(params.active));
|
|
798
|
+
if (params?.with?.length) query.set("with", params.with.join(","));
|
|
700
799
|
const qs = query.toString();
|
|
701
800
|
return this.http.get(`updates${qs ? "?" + qs : ""}`);
|
|
702
801
|
}
|
|
@@ -735,6 +834,21 @@ var LinksResource = class {
|
|
|
735
834
|
delete(id) {
|
|
736
835
|
return this.http.delete(`links/${id}`);
|
|
737
836
|
}
|
|
837
|
+
stats() {
|
|
838
|
+
return this.http.get("links/stats");
|
|
839
|
+
}
|
|
840
|
+
variations(linkId) {
|
|
841
|
+
return this.http.get(`links/${linkId}/variations`);
|
|
842
|
+
}
|
|
843
|
+
createVariation(linkId, payload) {
|
|
844
|
+
return this.http.post(`links/${linkId}/variations`, payload);
|
|
845
|
+
}
|
|
846
|
+
createVariationBatch(linkId, payload) {
|
|
847
|
+
return this.http.post(`links/${linkId}/variations/batch`, payload);
|
|
848
|
+
}
|
|
849
|
+
deleteVariation(linkId, variationId) {
|
|
850
|
+
return this.http.delete(`links/${linkId}/variations/${variationId}`);
|
|
851
|
+
}
|
|
738
852
|
};
|
|
739
853
|
//#endregion
|
|
740
854
|
//#region src/resources/warps.ts
|
|
@@ -979,4 +1093,4 @@ var DistributionResource = class {
|
|
|
979
1093
|
}
|
|
980
1094
|
};
|
|
981
1095
|
//#endregion
|
|
982
|
-
export { AppointmentsResource, AuthResource, BlueprintsResource, CachedHttpService, CartsResource, ContactsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, MarketplaceResource, MeetingsResource, OrdersResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, WarpsResource, createClient };
|
|
1096
|
+
export { AppointmentsResource, AuthResource, BlueprintsResource, CachedHttpService, CartsResource, ContactsResource, DistributionResource, FlowsResource, IngestionsResource, JoAiClient, LinksResource, MarketplaceResource, MeetingsResource, OrdersResource, ProductsResource, ServicesResource, SitesResource, SkillsResource, StoresResource, SubscriptionsResource, WarpsResource, createClient, formatOpeningHours };
|