memorysync-sdk 1.3.0 → 1.5.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 CHANGED
@@ -64,8 +64,20 @@ declare class SlackNamespace extends Namespace {
64
64
  availableChannels(connectionId: string, query?: Json): Promise<Json>;
65
65
  /** Channels currently selected for syncing. */
66
66
  channels(connectionId: string): Promise<Json>;
67
- /** Select channels for syncing. */
68
- addChannels(connectionId: string, channelIds: string[]): Promise<Json>;
67
+ /**
68
+ * Select channels for syncing.
69
+ *
70
+ * Accepts bare channel ids, which is the common case, or objects carrying the
71
+ * name and type across so the server does not have to look them up again:
72
+ *
73
+ * ```ts
74
+ * await client.connections.slack.addChannels("c1", ["C0123", "C0456"]);
75
+ * await client.connections.slack.addChannels("c1", [
76
+ * { id: "C0123", name: "support", is_private: false },
77
+ * ]);
78
+ * ```
79
+ */
80
+ addChannels(connectionId: string, channels: Array<string | Json>): Promise<Json>;
69
81
  /** Stop syncing one channel. */
70
82
  removeChannel(connectionId: string, channelId: string): Promise<Json>;
71
83
  /**
@@ -100,15 +112,38 @@ declare class S3Namespace extends Namespace {
100
112
  availablePrefixes(connectionId: string, query?: Json): Promise<Json>;
101
113
  /** Prefixes currently selected for syncing. */
102
114
  prefixes(connectionId: string): Promise<Json>;
103
- /** Select prefixes for syncing. */
104
- addPrefixes(connectionId: string, prefixes: string[]): Promise<Json>;
105
115
  /**
106
- * Stop syncing the given prefixes.
116
+ * Select prefixes for syncing.
117
+ *
118
+ * Accepts bare prefixes, or objects carrying `bucket` and `label`:
107
119
  *
108
- * The prefixes travel in the body rather than the path because they contain
109
- * slashes, which is why this DELETE carries one.
120
+ * ```ts
121
+ * await client.connections.s3.addPrefixes("c1", ["handbook/", "policies/"]);
122
+ * await client.connections.s3.addPrefixes("c1", [
123
+ * { prefix: "handbook/", label: "Handbook" },
124
+ * ]);
125
+ * ```
126
+ *
127
+ * An empty string means the bucket root. The bucket defaults to the one the
128
+ * connection's credentials were validated against, and the API rejects any
129
+ * other bucket rather than indexing one nobody proved access to.
110
130
  */
111
- removePrefixes(connectionId: string, prefixes: string[]): Promise<Json>;
131
+ addPrefixes(connectionId: string, prefixes: Array<string | Json>): Promise<Json>;
132
+ /**
133
+ * Revoke one prefix approval, optionally purging what it produced.
134
+ *
135
+ * The prefix travels as a query parameter, not in the body and not as a path
136
+ * segment: prefixes contain slashes, which a path segment cannot carry
137
+ * unambiguously, and this endpoint reads no body at all.
138
+ *
139
+ * Pass `purge: true` to also delete the memories already derived from the
140
+ * prefix. The default leaves them in place, so revoking an approval does not
141
+ * silently destroy knowledge.
142
+ */
143
+ removePrefix(connectionId: string, prefix?: string, options?: {
144
+ bucket?: string;
145
+ purge?: boolean;
146
+ }): Promise<Json>;
112
147
  /** Keys and patterns this connection will never sync. */
113
148
  exclusionPolicy(connectionId: string): Promise<Json>;
114
149
  /** Replace this connection's additions to the exclusion policy. */
@@ -134,8 +169,14 @@ declare class GranolaNamespace extends Namespace {
134
169
  identities(connectionId: string): Promise<Json>;
135
170
  /** Map a participant to a MemorySync end user. */
136
171
  linkIdentity(connectionId: string, body: Json): Promise<Json>;
137
- /** Move an existing mapping to a different end user. */
138
- relinkIdentity(connectionId: string, body: Json): Promise<Json>;
172
+ /**
173
+ * Re-run identity matching for this connection.
174
+ *
175
+ * Takes no arguments: the route reads no body and re-matches the whole roster.
176
+ * `body` is kept optional only so a forward-compatible field can be passed
177
+ * once the route grows one.
178
+ */
179
+ relinkIdentity(connectionId: string, body?: Json): Promise<Json>;
139
180
  /** Effective Granola settings for this connection. */
140
181
  settings(connectionId: string): Promise<Json>;
141
182
  /** Update Granola settings for this connection. */
@@ -171,6 +212,12 @@ declare class ConnectionsNamespace extends Namespace {
171
212
  /** One connection, including its status and last sync. */
172
213
  get(connectionId: string): Promise<Json>;
173
214
  /** Connect a provider that authenticates with an API key or bot token. */
215
+ /**
216
+ * Connect a provider that authenticates with an API key or bot token.
217
+ *
218
+ * The wire field is `provider_id`; the argument is named `provider` because
219
+ * that is what the rest of this namespace calls it.
220
+ */
174
221
  createWithApiKey(provider: string, apiKey: string, body?: Json): Promise<Json>;
175
222
  /** Connect a provider that needs a credential bundle, such as S3 keys. */
176
223
  createWithCredentials(provider: string, credentials: Json, body?: Json): Promise<Json>;
@@ -399,20 +446,6 @@ interface CurrentPlanResponse {
399
446
  scheduledPlanId: string | null;
400
447
  cancelAtPeriodEnd: boolean;
401
448
  }
402
- interface TeamMember {
403
- id: string;
404
- name: string;
405
- email: string;
406
- role: string;
407
- status: string;
408
- lastActive?: string | null;
409
- mfaEnabled: boolean;
410
- authMethod: string;
411
- loginProvider?: string;
412
- devices?: number;
413
- sessions: number;
414
- isScimManaged?: boolean;
415
- }
416
449
  interface Session {
417
450
  id: number;
418
451
  isCurrent: boolean;
@@ -430,58 +463,6 @@ interface SessionListResponse {
430
463
  sessions: Session[];
431
464
  currentSessionId: number | null;
432
465
  }
433
- type AuditSortDirection = "asc" | "desc";
434
- interface AuditEventQuery {
435
- limit?: number;
436
- cursor?: number;
437
- skip?: number;
438
- sortDirection?: AuditSortDirection;
439
- tenantId?: string;
440
- actor?: string;
441
- actorEmail?: string;
442
- ip?: string;
443
- action?: string;
444
- resourceType?: string;
445
- resourceId?: string;
446
- severity?: string;
447
- category?: string;
448
- start?: string;
449
- end?: string;
450
- success?: boolean;
451
- source?: string;
452
- ingestMethod?: string;
453
- search?: string;
454
- includeStats?: boolean;
455
- }
456
- interface AuditActor {
457
- id: string;
458
- email: string | null;
459
- name: string | null;
460
- type: string;
461
- }
462
- interface AuditResource {
463
- type: string;
464
- id: string;
465
- label: string | null;
466
- }
467
- interface AuditEvent {
468
- id: number;
469
- eventId: string;
470
- timestamp: string;
471
- category: string;
472
- actor: AuditActor;
473
- action: string;
474
- resource: AuditResource;
475
- severity: string;
476
- success: boolean;
477
- metadata?: Record<string, unknown> | null;
478
- }
479
- interface AuditEventListResponse {
480
- events: AuditEvent[];
481
- nextCursor: number | null;
482
- stats?: Record<string, unknown> | null;
483
- sort: AuditSortDirection;
484
- }
485
466
  interface IntegrationQuery {
486
467
  category?: string;
487
468
  }
@@ -505,28 +486,6 @@ interface OrganizationMembership {
505
486
  organizationId: number;
506
487
  role: string;
507
488
  }
508
- interface OrganizationSettingsQuery {
509
- tenantId?: string;
510
- }
511
- interface OrganizationSettings {
512
- tenantId: string;
513
- tenantName: string;
514
- tenantSlug: string;
515
- description: string | null;
516
- plan: string;
517
- status: string;
518
- createdAt: string;
519
- contactEmail: string | null;
520
- customDomain: string | null;
521
- customDomainVerified: boolean;
522
- logoUrl: string | null;
523
- totalMemories: number;
524
- activeUsers: number;
525
- organizationName: string;
526
- scheduledDeletionAt: string | null;
527
- mfaEnrolled: boolean;
528
- passwordEnabled: boolean;
529
- }
530
489
  interface Project {
531
490
  id: string;
532
491
  name: string;
@@ -537,6 +496,12 @@ interface Project {
537
496
  createdAt: string;
538
497
  updatedAt: string;
539
498
  }
499
+ interface CreateProjectRequest {
500
+ name: string;
501
+ }
502
+ interface RenameProjectRequest {
503
+ name: string;
504
+ }
540
505
  interface WebhookRetryConfig {
541
506
  enabled?: boolean;
542
507
  maxRetries?: number;
@@ -666,6 +631,81 @@ interface WebhookDeliveryListResponse {
666
631
  page: number;
667
632
  pageSize: number;
668
633
  }
634
+ interface WebhookEventTypesResponse {
635
+ eventTypes: string[];
636
+ categories: Record<string, string[]>;
637
+ }
638
+ interface WebhookHealth {
639
+ activeWebhooks: number;
640
+ totalWebhooks: number;
641
+ totalDeliveriesAllTime: number;
642
+ totalDeliveries24h: number;
643
+ successRate7d: number;
644
+ failingEndpoints: number;
645
+ pendingRetries: number;
646
+ deadLetterCount: number;
647
+ }
648
+ interface RecentWebhookDeliveryQuery extends WebhookDeliveryQuery {
649
+ endpointId?: number;
650
+ }
651
+ type ExportFormat = "csv" | "jsonl";
652
+ type ExportScope = "filtered" | "all" | "date_range";
653
+ type ExportJobStatus = "queued" | "processing" | "generating" | "completed" | "failed" | "cancelled" | "expired";
654
+ interface ExportFilters {
655
+ q?: string | null;
656
+ userId?: string | null;
657
+ isSummary?: boolean | null;
658
+ tier?: string | null;
659
+ source?: string | null;
660
+ timeRange?: string | null;
661
+ dateFrom?: string | null;
662
+ dateTo?: string | null;
663
+ includeSoftDeleted?: boolean;
664
+ }
665
+ interface CreateExportRequest {
666
+ format?: ExportFormat;
667
+ scope?: ExportScope;
668
+ filters?: ExportFilters | null;
669
+ }
670
+ interface ExportJob {
671
+ id: string;
672
+ projectId: string | null;
673
+ environment: string;
674
+ format: ExportFormat;
675
+ scope: ExportScope;
676
+ filters: ExportFilters;
677
+ status: ExportJobStatus;
678
+ errorMessage: string | null;
679
+ retryCount: number;
680
+ totalRows: number | null;
681
+ processedRows: number;
682
+ progressPercentage: number;
683
+ fileSizeBytes: number | null;
684
+ sha256Hash: string | null;
685
+ downloadCount: number;
686
+ createdAt: string | null;
687
+ startedAt: string | null;
688
+ completedAt: string | null;
689
+ expiresAt: string | null;
690
+ downloadUrl: string | null;
691
+ }
692
+ interface CreateExportResponse {
693
+ job: ExportJob;
694
+ estimatedTotal: number | null;
695
+ }
696
+ interface ExportListQuery {
697
+ limit?: number;
698
+ }
699
+ interface ExportJobListResponse {
700
+ jobs: ExportJob[];
701
+ total: number;
702
+ }
703
+ interface ExportDownloadUrl {
704
+ downloadUrl: string;
705
+ expiresAt: string | null;
706
+ fileSizeBytes: number | null;
707
+ filename: string;
708
+ }
669
709
  declare class ControlPlaneClient {
670
710
  private readonly baseUrl;
671
711
  private readonly accessToken?;
@@ -679,25 +719,40 @@ declare class ControlPlaneClient {
679
719
  testApiKey(keyId: number, options?: ControlPlaneRequestOptions): Promise<ApiKeyTestResponse>;
680
720
  login(request: LoginRequest, options?: ControlPlaneRequestOptions): Promise<LoginResponse>;
681
721
  getCurrentPlan(options?: ControlPlaneRequestOptions): Promise<CurrentPlanResponse>;
682
- listTeamMembers(options?: ControlPlaneRequestOptions): Promise<TeamMember[]>;
683
- suspendTeamMember(memberId: number, options?: ControlPlaneRequestOptions): Promise<TeamMember>;
684
- removeTeamMember(memberId: number, options?: ControlPlaneRequestOptions): Promise<void>;
685
722
  listSessions(options?: ControlPlaneRequestOptions): Promise<SessionListResponse>;
686
723
  revokeSession(sessionId: number, options?: ControlPlaneRequestOptions): Promise<void>;
687
- listAuditEvents(query?: AuditEventQuery, options?: ControlPlaneRequestOptions): Promise<AuditEventListResponse>;
688
724
  listIntegrations(query?: IntegrationQuery, options?: ControlPlaneRequestOptions): Promise<Integration[]>;
689
725
  createOrganization(request: CreateOrganizationRequest, options?: ControlPlaneRequestOptions): Promise<OrganizationMembership>;
690
726
  listOrganizations(options?: ControlPlaneRequestOptions): Promise<OrganizationMembership[]>;
691
- listOrganizationMembers(options?: ControlPlaneRequestOptions): Promise<TeamMember[]>;
692
- getOrganizationSettings(query?: OrganizationSettingsQuery, options?: ControlPlaneRequestOptions): Promise<OrganizationSettings>;
693
727
  listProjects(options?: ControlPlaneRequestOptions): Promise<Project[]>;
728
+ createProject(request: CreateProjectRequest, options?: ControlPlaneRequestOptions): Promise<Project>;
729
+ renameProject(projectId: string, request: RenameProjectRequest, options?: ControlPlaneRequestOptions): Promise<Project>;
730
+ archiveProject(projectId: string, options?: ControlPlaneRequestOptions): Promise<Project>;
731
+ unarchiveProject(projectId: string, options?: ControlPlaneRequestOptions): Promise<Project>;
732
+ deleteProject(projectId: string, options?: ControlPlaneRequestOptions): Promise<void>;
694
733
  createWebhook(request: CreateWebhookRequest, options?: ControlPlaneRequestOptions): Promise<CreatedWebhook>;
695
734
  listWebhooks(options?: ControlPlaneRequestOptions): Promise<WebhookListResponse>;
735
+ getWebhook(endpointId: number, options?: ControlPlaneRequestOptions): Promise<Webhook>;
736
+ getWebhookEventTypes(options?: ControlPlaneRequestOptions): Promise<WebhookEventTypesResponse>;
737
+ getWebhookHealth(options?: ControlPlaneRequestOptions): Promise<WebhookHealth>;
738
+ pauseWebhook(endpointId: number, options?: ControlPlaneRequestOptions): Promise<Webhook>;
739
+ resumeWebhook(endpointId: number, options?: ControlPlaneRequestOptions): Promise<Webhook>;
740
+ rotateWebhookSecret(endpointId: number, options?: ControlPlaneRequestOptions): Promise<CreatedWebhook>;
696
741
  updateWebhook(endpointId: number, request: UpdateWebhookRequest, options?: ControlPlaneRequestOptions): Promise<Webhook>;
697
742
  deleteWebhook(endpointId: number, options?: ControlPlaneRequestOptions): Promise<void>;
698
743
  testWebhook(endpointId: number, request?: TestWebhookRequest, options?: ControlPlaneRequestOptions): Promise<TestWebhookResponse>;
699
744
  replayWebhookDeliveries(endpointId: number, request?: ReplayWebhookDeliveriesRequest, options?: ControlPlaneRequestOptions): Promise<ReplayWebhookDeliveriesResponse>;
700
745
  listWebhookDeliveries(endpointId: number, query?: WebhookDeliveryQuery, options?: ControlPlaneRequestOptions): Promise<WebhookDeliveryListResponse>;
746
+ getLatestWebhookDelivery(endpointId: number, options?: ControlPlaneRequestOptions): Promise<WebhookDelivery | null>;
747
+ listRecentWebhookDeliveries(query?: RecentWebhookDeliveryQuery, options?: ControlPlaneRequestOptions): Promise<WebhookDeliveryListResponse>;
748
+ getWebhookDelivery(deliveryId: number, options?: ControlPlaneRequestOptions): Promise<WebhookDelivery>;
749
+ retryWebhookDelivery(deliveryId: number, options?: ControlPlaneRequestOptions): Promise<WebhookDelivery>;
750
+ createExport(request: CreateExportRequest, options?: ControlPlaneRequestOptions): Promise<CreateExportResponse>;
751
+ listExports(query?: ExportListQuery, options?: ControlPlaneRequestOptions): Promise<ExportJobListResponse>;
752
+ getExport(jobId: string, options?: ControlPlaneRequestOptions): Promise<ExportJob>;
753
+ cancelExport(jobId: string, options?: ControlPlaneRequestOptions): Promise<ExportJob>;
754
+ retryExport(jobId: string, options?: ControlPlaneRequestOptions): Promise<CreateExportResponse>;
755
+ getExportDownloadUrl(jobId: string, options?: ControlPlaneRequestOptions): Promise<ExportDownloadUrl>;
701
756
  }
702
757
 
703
758
  /**
@@ -1173,4 +1228,4 @@ declare class MemorySyncClient {
1173
1228
  }): Promise<Record<string, unknown>>;
1174
1229
  }
1175
1230
 
1176
- export { type AddRequest, type AddResponse, type AddSkippedResponse, type ApiKeyTestResponse, type ApiKeyTestStatus, type AuditActor, type AuditEvent, type AuditEventListResponse, type AuditEventQuery, type AuditResource, type AuditSortDirection, AuthError, type BatchUpdateItem, type BatchUpdateItemResult, type BatchUpdateResponse, type BulkAddItem, type BulkAddItemResult, type BulkAddResponse, type BulkRevokeApiKeyResult, type BulkRevokeApiKeysRequest, type BulkRevokeApiKeysResponse, type ComposeRequest, type ComposeResponse, ConnectionOAuthNamespace, ConnectionsNamespace, ControlPlaneClient, type ControlPlaneConfig, type ControlPlaneRequestOptions, type CreateOrganizationRequest, type CreateWebhookRequest, type CreatedWebhook, type CurrentPlanResponse, type ExportResponse, type FeedbackResponse, type FeedbackSignal, type FeedbackSummary, type FeedbackTrend, type ForgetFilters, type ForgetRequest, GoogleDriveNamespace, GranolaNamespace, type HistoryResponse, type Integration, type IntegrationQuery, IntegrationsNamespace, type LoginRequest, type LoginResponse, type MemoryRecord, MemorySyncClient, type MemorySyncConfig, MemorySyncError, NotFoundError, ObjectsNamespace, type Ontology, type OntologyUpdateRequest, type OrganizationMembership, type OrganizationSettings, type OrganizationSettingsQuery, type Plan, type PlanLimits, type Project, ProvidersNamespace, type QueryFilters, type QueryRequest, type QueryResponse, RateLimitError, type RelationCreateRequest, type RelationRecord, type RelationshipType, type ReplayWebhookDeliveriesRequest, type ReplayWebhookDeliveriesResponse, type RevisionEntry, type RevisionEvent, S3Namespace, ServerError, type Session, type SessionListResponse, SlackNamespace, type SummarizeRequest, SyncJobsNamespace, type TeamMember, type TestWebhookRequest, type TestWebhookResponse, type UpdateRequest, type UpdateWebhookRequest, type UploadRequest, ValidationError, WebCrawlerNamespace, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQuery, type WebhookListResponse, type WebhookRetryConfig, type WebhookSignatureConfig };
1231
+ export { type AddRequest, type AddResponse, type AddSkippedResponse, type ApiKeyTestResponse, type ApiKeyTestStatus, AuthError, type BatchUpdateItem, type BatchUpdateItemResult, type BatchUpdateResponse, type BulkAddItem, type BulkAddItemResult, type BulkAddResponse, type BulkRevokeApiKeyResult, type BulkRevokeApiKeysRequest, type BulkRevokeApiKeysResponse, type ComposeRequest, type ComposeResponse, ConnectionOAuthNamespace, ConnectionsNamespace, ControlPlaneClient, type ControlPlaneConfig, type ControlPlaneRequestOptions, type CreateExportRequest, type CreateExportResponse, type CreateOrganizationRequest, type CreateProjectRequest, type CreateWebhookRequest, type CreatedWebhook, type CurrentPlanResponse, type ExportDownloadUrl, type ExportFilters, type ExportFormat, type ExportJob, type ExportJobListResponse, type ExportJobStatus, type ExportListQuery, type ExportResponse, type ExportScope, type FeedbackResponse, type FeedbackSignal, type FeedbackSummary, type FeedbackTrend, type ForgetFilters, type ForgetRequest, GoogleDriveNamespace, GranolaNamespace, type HistoryResponse, type Integration, type IntegrationQuery, IntegrationsNamespace, type LoginRequest, type LoginResponse, type MemoryRecord, MemorySyncClient, type MemorySyncConfig, MemorySyncError, NotFoundError, ObjectsNamespace, type Ontology, type OntologyUpdateRequest, type OrganizationMembership, type Plan, type PlanLimits, type Project, ProvidersNamespace, type QueryFilters, type QueryRequest, type QueryResponse, RateLimitError, type RecentWebhookDeliveryQuery, type RelationCreateRequest, type RelationRecord, type RelationshipType, type RenameProjectRequest, type ReplayWebhookDeliveriesRequest, type ReplayWebhookDeliveriesResponse, type RevisionEntry, type RevisionEvent, S3Namespace, ServerError, type Session, type SessionListResponse, SlackNamespace, type SummarizeRequest, SyncJobsNamespace, type TestWebhookRequest, type TestWebhookResponse, type UpdateRequest, type UpdateWebhookRequest, type UploadRequest, ValidationError, WebCrawlerNamespace, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryQuery, type WebhookEventTypesResponse, type WebhookHealth, type WebhookListResponse, type WebhookRetryConfig, type WebhookSignatureConfig };