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

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,187 @@ 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
+ };
319
+ type CachePurgeTarget = {
320
+ domain: CachePurgeDomain;
321
+ objectTypeId?: string;
322
+ objectTypeIds?: string[];
323
+ recordIds?: string[];
324
+ fileIds?: string[];
325
+ views?: CachePurgeView[];
326
+ listQuery?: CachePurgeListQuery;
327
+ };
328
+ type CachePurgeRequest = {
329
+ mode: CachePurgeMode;
330
+ warm?: boolean;
331
+ confirmPortalWide?: boolean;
332
+ includeShortOnHard?: boolean;
333
+ includeContactAccess?: boolean;
334
+ targets: CachePurgeTarget[];
335
+ };
336
+ type CachePurgeJobStatus = "warming" | "completed" | "failed";
337
+ type PurgeResult = {
338
+ ok: boolean;
339
+ purgeJobId?: string;
340
+ status?: CachePurgeJobStatus;
341
+ evicted?: Record<string, string[]>;
342
+ warnings?: string[];
343
+ errorCode?: "PURGE_API_DISABLED" | "RATE_LIMITED" | "VALIDATION" | "WARM_FAILED" | "NETWORK" | "UNKNOWN";
344
+ message?: string;
345
+ };
346
+ type CreateCachePurgeJobOptions = {
347
+ idempotencyKey?: string;
348
+ waitForWarm?: boolean;
349
+ pollTimeoutMs?: number;
350
+ pollIntervalMs?: number;
351
+ };
352
+ type CrmCachePurgeOptions = {
353
+ objectTypeId: string;
354
+ objectTypeIds?: string[];
355
+ mode?: CachePurgeMode;
356
+ warm?: boolean;
357
+ listQuery?: CachePurgeListQuery;
358
+ views?: CachePurgeView[];
359
+ recordIds?: string[];
360
+ fileIds?: string[];
361
+ waitForWarm?: boolean;
362
+ idempotencyKey?: string;
363
+ };
364
+
365
+ declare function buildCrmListPurgeTarget(objectTypeId: string, listQuery?: CachePurgeListQuery): CachePurgeTarget;
366
+ declare function buildCrmSinglePurgeTarget(objectTypeId: string, recordIds: string[], listQuery?: CachePurgeListQuery): CachePurgeTarget;
367
+ declare function buildEngagementPurgeTarget(objectTypeId: string, recordIds: string[], views: Extract<CachePurgeView, "notes" | "emails" | "files">[], options?: {
368
+ fileIds?: string[];
369
+ listQuery?: CachePurgeListQuery;
370
+ }): CachePurgeTarget;
371
+ declare function buildUserSessionPurgeTarget(): CachePurgeTarget;
372
+ declare function buildPortalConfigPurgeTarget(objectTypeIds: string[]): CachePurgeTarget;
373
+ declare function mergePurgeTargets(...targets: CachePurgeTarget[]): CachePurgeTarget[];
374
+ declare function buildCachePurgeRequest(targets: CachePurgeTarget[], options?: {
375
+ mode?: "soft" | "hard";
376
+ warm?: boolean;
377
+ includeContactAccess?: boolean;
378
+ includeShortOnHard?: boolean;
379
+ confirmPortalWide?: boolean;
380
+ }): CachePurgeRequest;
381
+
382
+ declare function createCachePurgeJob(request: CachePurgeRequest, options?: CreateCachePurgeJobOptions): Promise<PurgeResult>;
383
+
384
+ declare function purgeCrmObjectDataCache(options: CrmCachePurgeOptions): Promise<boolean>;
385
+ declare function purgeCrmListCache(options: CrmCachePurgeOptions): Promise<PurgeResult>;
386
+ declare function purgeCrmRecordCache(options: CrmCachePurgeOptions & {
387
+ recordIds: string[];
388
+ }): Promise<PurgeResult>;
389
+ declare function purgeEngagementCaches(options: CrmCachePurgeOptions & {
390
+ recordIds: string[];
391
+ views: ("notes" | "emails" | "files")[];
392
+ }): Promise<PurgeResult>;
393
+ declare function purgeCrmCombined(options: CrmCachePurgeOptions & {
394
+ targets: CachePurgeTarget[];
395
+ }): Promise<PurgeResult>;
396
+
397
+ declare const Client: {
398
+ authentication: {
399
+ preLogin: (data: PreLoginPayload) => Promise<unknown>;
400
+ login: (data: LoginPayload) => Promise<unknown>;
401
+ verifyEmail: (data: VerifyEmailPayload) => Promise<unknown>;
402
+ resetPasswordVerifyToken: (data: ResetPasswordVerifyTokenPayload) => Promise<unknown>;
403
+ resetPassword: (data: ResetPasswordPayload) => Promise<unknown>;
404
+ forgetPassword: (data: ForgetPasswordPayload) => Promise<unknown>;
405
+ registerExistingUser: (data: any) => Promise<unknown>;
406
+ verifyEmailResend: (data: any) => Promise<unknown>;
407
+ resendEmail: (data: any) => Promise<unknown>;
408
+ logout: () => Promise<unknown>;
409
+ };
410
+ sso: {
411
+ getSsoDetails: () => Promise<unknown>;
412
+ generateSsoUrl: (payload: any) => Promise<unknown>;
413
+ ssoCallback: (payload: any) => Promise<unknown>;
414
+ };
415
+ user: {
416
+ me: () => Promise<unknown>;
417
+ profile: (payload: any) => Promise<unknown>;
418
+ changePassword: (data: ChangePasswordPayload) => Promise<unknown>;
419
+ };
420
+ pipeline: {
421
+ list: (payload?: any, param?: any) => Promise<unknown>;
422
+ };
423
+ stage: {
424
+ list: (props?: any) => Promise<unknown>;
425
+ };
426
+ object: {
427
+ list: (payload?: any, param?: any) => Promise<unknown>;
428
+ sideBarList: (payload?: any) => Promise<unknown>;
429
+ form: (payload?: any) => Promise<unknown>;
430
+ objectFormOptions: (payload?: any) => Promise<unknown>;
431
+ create: (props?: any) => Promise<unknown>;
432
+ createExisting: (props?: any) => Promise<unknown>;
433
+ removeExisting: (props?: any) => Promise<unknown>;
434
+ details: (props?: any) => Promise<unknown>;
435
+ update: (props?: any) => Promise<unknown>;
436
+ };
437
+ note: {
438
+ list: (props?: any) => Promise<unknown>;
439
+ create: (props?: any) => Promise<unknown>;
440
+ update: (props?: any) => Promise<unknown>;
441
+ image: (props?: any) => Promise<unknown>;
442
+ attachment: (props?: any) => Promise<unknown>;
443
+ };
444
+ email: {
445
+ list: (props?: any) => Promise<unknown>;
446
+ create: (props?: any) => Promise<unknown>;
447
+ update: (props?: any) => Promise<unknown>;
448
+ image: (props?: any) => Promise<unknown>;
449
+ attachment: (props?: any) => Promise<unknown>;
450
+ };
451
+ cache: {
452
+ purge: (body: Record<string, unknown>, headers?: Record<string, string>) => Promise<unknown>;
453
+ purgeStatus: (purgeJobId: string) => Promise<unknown>;
454
+ };
455
+ file: {
456
+ list: (props?: any) => Promise<unknown>;
457
+ details: (props?: any) => Promise<unknown>;
458
+ download: (props?: any) => Promise<unknown>;
459
+ addFolder: (props?: any) => Promise<unknown>;
460
+ addFile: (props?: any) => Promise<unknown>;
461
+ };
462
+ };
463
+
464
+ declare const index_Client: typeof Client;
465
+ declare namespace index {
466
+ export { index_Client as Client };
467
+ }
468
+
266
469
  declare const api: {
267
470
  preLogin: typeof preLogin;
268
471
  login: typeof login;
@@ -283,6 +486,7 @@ declare const api: {
283
486
  pipelines: typeof list$5;
284
487
  stages: typeof list$4;
285
488
  objects: typeof list$3;
489
+ sideBarObjects: typeof sideBarList;
286
490
  objectsForm: typeof form;
287
491
  createObject: typeof create$2;
288
492
  createExistingObject: typeof createExisting;
@@ -300,8 +504,11 @@ declare const api: {
300
504
  attachmentUpload: typeof attachmentUpload;
301
505
  files: typeof list;
302
506
  file: typeof details;
507
+ fileDownload: typeof download;
303
508
  addFolder: typeof addFolder;
304
509
  addFile: typeof addFile;
510
+ purgeCache: typeof purge;
511
+ cachePurgeStatus: typeof purgeStatus;
305
512
  getRefreshToken: typeof getRefreshToken;
306
513
  getAuthRefreshToken: typeof getAuthRefreshToken;
307
514
  isCookieExpired: (key: string) => boolean;
@@ -311,7 +518,7 @@ declare const api: {
311
518
  };
312
519
  declare const store: {
313
520
  storage: {
314
- set: (key: string, value: any) => void;
521
+ set: (key: string, value: unknown) => void;
315
522
  get: <T>(key: string) => T | null;
316
523
  remove: (key: string) => void;
317
524
  };
@@ -356,4 +563,4 @@ declare const routeParam: {
356
563
  };
357
564
  };
358
565
 
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 };
566
+ 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, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getCurrentTimeZone, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, normalizeToTimestamp, purgeCrmCombined, purgeCrmListCache, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, routeParam, store, url };