woodsportal-client-sdk 1.1.4-dev.6 → 1.1.4-dev.61

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.
@@ -0,0 +1,10 @@
1
+ // src/adapters/shared/bindStoreWithActions.ts
2
+ function bindStoreWithActions(store, actions) {
3
+ const getSnapshot = () => ({ ...store.getState(), ...actions });
4
+ const subscribe = (onStoreChange) => store.subscribe(() => onStoreChange());
5
+ return { getSnapshot, subscribe };
6
+ }
7
+
8
+ export { bindStoreWithActions };
9
+ //# sourceMappingURL=chunk-Y5MRAAGK.js.map
10
+ //# sourceMappingURL=chunk-Y5MRAAGK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/shared/bindStoreWithActions.ts"],"names":[],"mappings":";AAKO,SAAS,oBAAA,CAIZ,OACA,OAAA,EACF;AACE,EAAA,MAAM,WAAA,GAAc,OAAO,EAAE,GAAG,MAAM,QAAA,EAAS,EAAG,GAAG,OAAA,EAAQ,CAAA;AAE7D,EAAA,MAAM,YAAY,CAAC,aAAA,KACf,MAAM,SAAA,CAAU,MAAM,eAAe,CAAA;AAEzC,EAAA,OAAO,EAAE,aAAa,SAAA,EAAU;AACpC","file":"chunk-Y5MRAAGK.js","sourcesContent":["export interface SubscribableStore<TState> {\n getState(): TState;\n subscribe(listener: (state: TState) => void): () => void;\n}\n\nexport function bindStoreWithActions<\n TState extends object,\n TActions extends object,\n>(\n store: SubscribableStore<TState>,\n actions: TActions,\n) {\n const getSnapshot = () => ({ ...store.getState(), ...actions }) as TState & TActions;\n\n const subscribe = (onStoreChange: () => void) =>\n store.subscribe(() => onStoreChange());\n\n return { getSnapshot, subscribe };\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ interface Config {
2
2
  hubId: string;
3
3
  devPortalId: string;
4
4
  portalId: string;
5
+ devApiUrl: string;
5
6
  }
6
7
  interface MutationOptions<TSuccess, TError = unknown> {
7
8
  onSuccess?: (data: TSuccess, payload: any) => void | Promise<void>;
@@ -134,6 +135,11 @@ declare function list$3(options?: MutationOptions<any, any>): {
134
135
  getObjects: (payload?: any) => Promise<any>;
135
136
  isLoading: () => boolean;
136
137
  };
138
+ declare function sideBarList(options?: MutationOptions<any, any>): {
139
+ mutate: (payload?: any) => Promise<any>;
140
+ getSideBarObjects: (payload?: any) => Promise<any>;
141
+ isLoading: () => boolean;
142
+ };
137
143
  declare function form(options?: MutationOptions<any, any>): {
138
144
  mutate: (payload?: any) => Promise<any>;
139
145
  getObjectsForm: (payload?: any) => Promise<any>;
@@ -233,6 +239,22 @@ declare function addFile(options?: MutationOptions<any, any>): {
233
239
  addFile: (payload?: any) => Promise<any>;
234
240
  isLoading: () => boolean;
235
241
  };
242
+ declare function download(options?: MutationOptions<any, any>): {
243
+ mutate: (payload?: any) => Promise<any>;
244
+ downloadFile: (payload?: any) => Promise<any>;
245
+ isLoading: () => boolean;
246
+ };
247
+
248
+ declare function purge(options?: MutationOptions<unknown, unknown>): {
249
+ mutate: (payload?: Record<string, unknown> | undefined) => Promise<unknown>;
250
+ purgeCache: (payload?: Record<string, unknown> | undefined) => Promise<unknown>;
251
+ isLoading: () => boolean;
252
+ };
253
+ declare function purgeStatus(purgeJobId: string, options?: MutationOptions<unknown, unknown>): {
254
+ mutate: (payload?: string | undefined) => Promise<unknown>;
255
+ getPurgeStatus: () => Promise<unknown>;
256
+ isLoading: () => boolean;
257
+ };
236
258
 
237
259
  declare function getRefreshToken(): string | null;
238
260
 
@@ -263,6 +285,220 @@ declare function isAuthenticateApp(): boolean;
263
285
 
264
286
  declare function useTable(): any;
265
287
 
288
+ declare const DEFAULT_HUBSPOT_TIMEZONE = "Asia/Kolkata";
289
+ declare function getCurrentTimeZone(): string;
290
+ declare function normalizeToTimestamp(value: unknown): number | null;
291
+ declare function formatGmtOffset(timeZone?: string, date?: Date): string;
292
+ type HubSpotActivityDateTimeParts = {
293
+ date: string;
294
+ time: string;
295
+ gmtOffset: string;
296
+ formatted: string;
297
+ };
298
+ declare function formatHubSpotActivityDateTimeParts(timestamp: unknown, timeZone?: string): HubSpotActivityDateTimeParts | null;
299
+ declare function formatHubSpotActivityDateTime(timestamp: unknown, timeZone?: string): string;
300
+
301
+ type CachePurgeMode = "soft" | "hard";
302
+ type CachePurgeDomain = "crm_object_data" | "portal_object_config" | "user_session";
303
+ type CachePurgeView = "list" | "single" | "board" | "notes" | "emails" | "files";
304
+ type CachePurgeListQuery = {
305
+ sort?: string;
306
+ search?: string;
307
+ filterPropertyName?: string;
308
+ filterOperator?: string;
309
+ filterValue?: string;
310
+ page?: number;
311
+ limit?: number;
312
+ view?: "LIST" | "BOARD";
313
+ mediatorObjectTypeId?: string;
314
+ mediatorObjectRecordId?: string;
315
+ parentObjectTypeId?: string;
316
+ parentObjectRecordId?: string;
317
+ isPrimaryCompany?: boolean;
318
+ after?: string;
319
+ };
320
+ type CachePurgeTarget = {
321
+ domain: CachePurgeDomain;
322
+ objectTypeId?: string;
323
+ objectTypeIds?: string[];
324
+ recordIds?: string[];
325
+ engagementItemIds?: string[];
326
+ fileIds?: string[];
327
+ views?: CachePurgeView[];
328
+ listQuery?: CachePurgeListQuery;
329
+ };
330
+ type CachePurgeRequest = {
331
+ mode: CachePurgeMode;
332
+ warm?: boolean;
333
+ confirmPortalWide?: boolean;
334
+ includeShortOnHard?: boolean;
335
+ includeContactAccess?: boolean;
336
+ postCrmWrite?: boolean;
337
+ warmListDelayMs?: number;
338
+ targets: CachePurgeTarget[];
339
+ };
340
+ type CachePurgeJobStatus = "warming" | "completed" | "failed";
341
+ type PurgeResult = {
342
+ ok: boolean;
343
+ purgeJobId?: string;
344
+ status?: CachePurgeJobStatus;
345
+ evicted?: Record<string, string[]>;
346
+ warnings?: string[];
347
+ errorCode?: "PURGE_API_DISABLED" | "RATE_LIMITED" | "VALIDATION" | "WARM_FAILED" | "NETWORK" | "UNKNOWN";
348
+ message?: string;
349
+ };
350
+ type CreateCachePurgeJobOptions = {
351
+ idempotencyKey?: string;
352
+ waitForWarm?: boolean;
353
+ pollTimeoutMs?: number;
354
+ pollIntervalMs?: number;
355
+ };
356
+ type CrmCachePurgeOptions = {
357
+ objectTypeId: string;
358
+ objectTypeIds?: string[];
359
+ mode?: CachePurgeMode;
360
+ warm?: boolean;
361
+ listQuery?: CachePurgeListQuery;
362
+ views?: CachePurgeView[];
363
+ recordIds?: string[];
364
+ fileIds?: string[];
365
+ postCrmWrite?: boolean;
366
+ warmListDelayMs?: number;
367
+ engagementItemIds?: string[];
368
+ waitForWarm?: boolean;
369
+ idempotencyKey?: string;
370
+ };
371
+
372
+ declare function buildCrmListPurgeTarget(objectTypeId: string, listQuery?: CachePurgeListQuery, recordIds?: string[]): CachePurgeTarget;
373
+ declare function buildCrmSinglePurgeTarget(objectTypeId: string, recordIds: string[], listQuery?: CachePurgeListQuery): CachePurgeTarget;
374
+ declare function buildEngagementPurgeTarget(objectTypeId: string, recordIds: string[], views: Extract<CachePurgeView, "notes" | "emails" | "files">[], options?: {
375
+ fileIds?: string[];
376
+ listQuery?: CachePurgeListQuery;
377
+ engagementItemIds?: string[];
378
+ }): CachePurgeTarget;
379
+ declare function buildUserSessionPurgeTarget(): CachePurgeTarget;
380
+ declare function buildPortalConfigPurgeTarget(objectTypeIds: string[]): CachePurgeTarget;
381
+ declare function mergePurgeTargets(...targets: CachePurgeTarget[]): CachePurgeTarget[];
382
+ declare function buildCachePurgeRequest(targets: CachePurgeTarget[], options?: {
383
+ mode?: "soft" | "hard";
384
+ warm?: boolean;
385
+ includeContactAccess?: boolean;
386
+ includeShortOnHard?: boolean;
387
+ confirmPortalWide?: boolean;
388
+ postCrmWrite?: boolean;
389
+ warmListDelayMs?: number;
390
+ }): CachePurgeRequest;
391
+
392
+ declare function createCachePurgeJob(request: CachePurgeRequest, options?: CreateCachePurgeJobOptions): Promise<PurgeResult>;
393
+
394
+ declare function purgeCrmObjectDataCache(options: CrmCachePurgeOptions): Promise<boolean>;
395
+ declare function purgeCrmListCacheAfterCrmWrite(options: CrmCachePurgeOptions): Promise<PurgeResult>;
396
+ declare function purgeCrmDetailAndListAfterCrmWrite(options: CrmCachePurgeOptions & {
397
+ recordIds: string[];
398
+ }): Promise<PurgeResult>;
399
+ declare function purgeCrmListCache(options: CrmCachePurgeOptions): Promise<PurgeResult>;
400
+ declare function purgeCrmRecordCache(options: CrmCachePurgeOptions & {
401
+ recordIds: string[];
402
+ }): Promise<PurgeResult>;
403
+ declare function purgeEngagementCaches(options: CrmCachePurgeOptions & {
404
+ recordIds: string[];
405
+ views: ("notes" | "emails" | "files")[];
406
+ }): Promise<PurgeResult>;
407
+ declare function purgeEngagementCachesAfterCrmWrite(options: CrmCachePurgeOptions & {
408
+ recordIds: string[];
409
+ views: ("notes" | "emails")[];
410
+ engagementItemIds?: string[];
411
+ }): Promise<PurgeResult>;
412
+ declare function purgeCrmCombined(options: CrmCachePurgeOptions & {
413
+ targets: CachePurgeTarget[];
414
+ }): Promise<PurgeResult>;
415
+
416
+ declare function extractHubspotRecordIdFromWriteResponse(response: unknown): string | undefined;
417
+
418
+ declare function extractEngagementItemIdFromWriteResponse(response: unknown): string | undefined;
419
+
420
+ declare function toCachePurgeListQuery(raw: Record<string, unknown> | null | undefined): CachePurgeListQuery;
421
+ type ResolveCrmListPurgeQueryOptions = {
422
+ componentName?: string;
423
+ hubspotObjectTypeId?: string;
424
+ tableQueryParams?: Record<string, unknown> | null;
425
+ multiObjectsQueryParams?: Record<string, Record<string, unknown>>;
426
+ writeContext?: Record<string, string>;
427
+ };
428
+ declare function resolveCrmListPurgeQuery(options: ResolveCrmListPurgeQueryOptions): CachePurgeListQuery;
429
+
430
+ declare const Client: {
431
+ authentication: {
432
+ preLogin: (data: PreLoginPayload) => Promise<unknown>;
433
+ login: (data: LoginPayload) => Promise<unknown>;
434
+ verifyEmail: (data: VerifyEmailPayload) => Promise<unknown>;
435
+ resetPasswordVerifyToken: (data: ResetPasswordVerifyTokenPayload) => Promise<unknown>;
436
+ resetPassword: (data: ResetPasswordPayload) => Promise<unknown>;
437
+ forgetPassword: (data: ForgetPasswordPayload) => Promise<unknown>;
438
+ registerExistingUser: (data: any) => Promise<unknown>;
439
+ verifyEmailResend: (data: any) => Promise<unknown>;
440
+ resendEmail: (data: any) => Promise<unknown>;
441
+ logout: () => Promise<unknown>;
442
+ };
443
+ sso: {
444
+ getSsoDetails: () => Promise<unknown>;
445
+ generateSsoUrl: (payload: any) => Promise<unknown>;
446
+ ssoCallback: (payload: any) => Promise<unknown>;
447
+ };
448
+ user: {
449
+ me: () => Promise<unknown>;
450
+ profile: (payload: any) => Promise<unknown>;
451
+ changePassword: (data: ChangePasswordPayload) => Promise<unknown>;
452
+ };
453
+ pipeline: {
454
+ list: (payload?: any, param?: any) => Promise<unknown>;
455
+ };
456
+ stage: {
457
+ list: (props?: any) => Promise<unknown>;
458
+ };
459
+ object: {
460
+ list: (payload?: any, param?: any) => Promise<unknown>;
461
+ sideBarList: (payload?: any) => Promise<unknown>;
462
+ form: (payload?: any) => Promise<unknown>;
463
+ objectFormOptions: (payload?: any) => Promise<unknown>;
464
+ create: (props?: any) => Promise<unknown>;
465
+ createExisting: (props?: any) => Promise<unknown>;
466
+ removeExisting: (props?: any) => Promise<unknown>;
467
+ details: (props?: any) => Promise<unknown>;
468
+ update: (props?: any) => Promise<unknown>;
469
+ };
470
+ note: {
471
+ list: (props?: any) => Promise<unknown>;
472
+ create: (props?: any) => Promise<unknown>;
473
+ update: (props?: any) => Promise<unknown>;
474
+ image: (props?: any) => Promise<unknown>;
475
+ attachment: (props?: any) => Promise<unknown>;
476
+ };
477
+ email: {
478
+ list: (props?: any) => Promise<unknown>;
479
+ create: (props?: any) => Promise<unknown>;
480
+ update: (props?: any) => Promise<unknown>;
481
+ image: (props?: any) => Promise<unknown>;
482
+ attachment: (props?: any) => Promise<unknown>;
483
+ };
484
+ cache: {
485
+ purge: (body: Record<string, unknown>, headers?: Record<string, string>) => Promise<unknown>;
486
+ purgeStatus: (purgeJobId: string) => Promise<unknown>;
487
+ };
488
+ file: {
489
+ list: (props?: any) => Promise<unknown>;
490
+ details: (props?: any) => Promise<unknown>;
491
+ download: (props?: any) => Promise<unknown>;
492
+ addFolder: (props?: any) => Promise<unknown>;
493
+ addFile: (props?: any) => Promise<unknown>;
494
+ };
495
+ };
496
+
497
+ declare const index_Client: typeof Client;
498
+ declare namespace index {
499
+ export { index_Client as Client };
500
+ }
501
+
266
502
  declare const api: {
267
503
  preLogin: typeof preLogin;
268
504
  login: typeof login;
@@ -283,6 +519,7 @@ declare const api: {
283
519
  pipelines: typeof list$5;
284
520
  stages: typeof list$4;
285
521
  objects: typeof list$3;
522
+ sideBarObjects: typeof sideBarList;
286
523
  objectsForm: typeof form;
287
524
  createObject: typeof create$2;
288
525
  createExistingObject: typeof createExisting;
@@ -300,8 +537,11 @@ declare const api: {
300
537
  attachmentUpload: typeof attachmentUpload;
301
538
  files: typeof list;
302
539
  file: typeof details;
540
+ fileDownload: typeof download;
303
541
  addFolder: typeof addFolder;
304
542
  addFile: typeof addFile;
543
+ purgeCache: typeof purge;
544
+ cachePurgeStatus: typeof purgeStatus;
305
545
  getRefreshToken: typeof getRefreshToken;
306
546
  getAuthRefreshToken: typeof getAuthRefreshToken;
307
547
  isCookieExpired: (key: string) => boolean;
@@ -311,7 +551,7 @@ declare const api: {
311
551
  };
312
552
  declare const store: {
313
553
  storage: {
314
- set: (key: string, value: any) => void;
554
+ set: (key: string, value: unknown) => void;
315
555
  get: <T>(key: string) => T | null;
316
556
  remove: (key: string) => void;
317
557
  };
@@ -356,4 +596,4 @@ declare const routeParam: {
356
596
  };
357
597
  };
358
598
 
359
- export { type ChangePasswordPayload, type Config, type ForgetPasswordPayload, type HttpClientConfig, type LoginPayload, type MutationOptions, type PreLoginPayload, type ResetPasswordPayload, type ResetPasswordVerifyTokenPayload, type VerifyEmailPayload, api, breadcrumbsDetails, getFieldErrors, getFormErrors, initializeHttpClient, routeParam, store, url };
599
+ export { type CachePurgeDomain, type CachePurgeListQuery, type CachePurgeMode, type CachePurgeRequest, type CachePurgeTarget, type CachePurgeView, type ChangePasswordPayload, type Config, type CreateCachePurgeJobOptions, type CrmCachePurgeOptions, DEFAULT_HUBSPOT_TIMEZONE, type ForgetPasswordPayload, type HttpClientConfig, type HubSpotActivityDateTimeParts, type LoginPayload, type MutationOptions, type PreLoginPayload, type PurgeResult, type ResetPasswordPayload, type ResetPasswordVerifyTokenPayload, type VerifyEmailPayload, api, breadcrumbsDetails, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, index as clint, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getCurrentTimeZone, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, normalizeToTimestamp, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, routeParam, store, toCachePurgeListQuery, url };