@proveanything/smartlinks 2.0.29 → 2.0.31

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/openapi.yaml CHANGED
@@ -4334,6 +4334,35 @@ paths:
4334
4334
  description: Unauthorized
4335
4335
  404:
4336
4336
  description: Not found
4337
+ /admin/collection/{collectionId}/getUsers:
4338
+ get:
4339
+ tags:
4340
+ - collection
4341
+ summary: List the users with access to a collection, each with their access level (admin only).
4342
+ operationId: collection_getUsers
4343
+ security:
4344
+ - bearerAuth: []
4345
+ parameters:
4346
+ - name: collectionId
4347
+ in: path
4348
+ required: true
4349
+ schema:
4350
+ type: string
4351
+ responses:
4352
+ 200:
4353
+ description: Success
4354
+ content:
4355
+ application/json:
4356
+ schema:
4357
+ type: array
4358
+ items:
4359
+ $ref: "#/components/schemas/CollectionUser"
4360
+ 400:
4361
+ description: Bad request
4362
+ 401:
4363
+ description: Unauthorized
4364
+ 404:
4365
+ description: Not found
4337
4366
  /admin/collection/{collectionId}/hub:
4338
4367
  post:
4339
4368
  tags:
@@ -4415,6 +4444,38 @@ paths:
4415
4444
  description: Unauthorized
4416
4445
  404:
4417
4446
  description: Not found
4447
+ /admin/collection/{collectionId}/integrations/runs/entity/{entityId}:
4448
+ get:
4449
+ tags:
4450
+ - integrations
4451
+ summary: Every run touching an entity (e.g.
4452
+ operationId: integrations_listEntityRuns
4453
+ security:
4454
+ - bearerAuth: []
4455
+ parameters:
4456
+ - name: collectionId
4457
+ in: path
4458
+ required: true
4459
+ schema:
4460
+ type: string
4461
+ - name: entityId
4462
+ in: path
4463
+ required: true
4464
+ schema:
4465
+ type: string
4466
+ responses:
4467
+ 200:
4468
+ description: Success
4469
+ content:
4470
+ application/json:
4471
+ schema:
4472
+ $ref: "#/components/schemas/RunList"
4473
+ 400:
4474
+ description: Bad request
4475
+ 401:
4476
+ description: Unauthorized
4477
+ 404:
4478
+ description: Not found
4418
4479
  /admin/collection/{collectionId}/interactions:
4419
4480
  get:
4420
4481
  tags:
@@ -8694,6 +8755,38 @@ paths:
8694
8755
  application/json:
8695
8756
  schema:
8696
8757
  $ref: "#/components/schemas/TranslationUpdateRequest"
8758
+ /admin/collection/{collectionId}/updateUserAccess:
8759
+ post:
8760
+ tags:
8761
+ - collection
8762
+ summary: "Grant, change, or remove a user's access level on a collection (admin only)."
8763
+ operationId: collection_setUserAccess
8764
+ security:
8765
+ - bearerAuth: []
8766
+ parameters:
8767
+ - name: collectionId
8768
+ in: path
8769
+ required: true
8770
+ schema:
8771
+ type: string
8772
+ responses:
8773
+ 200:
8774
+ description: Success
8775
+ content:
8776
+ application/json:
8777
+ schema: {}
8778
+ 400:
8779
+ description: Bad request
8780
+ 401:
8781
+ description: Unauthorized
8782
+ 404:
8783
+ description: Not found
8784
+ requestBody:
8785
+ required: true
8786
+ content:
8787
+ application/json:
8788
+ schema:
8789
+ $ref: "#/components/schemas/CollectionAccessLevel"
8697
8790
  /admin/collection/{encodedCollectionId}/comm/send:
8698
8791
  post:
8699
8792
  tags:
@@ -22709,6 +22802,38 @@ components:
22709
22802
  $ref: "#/components/schemas/AppConfig"
22710
22803
  required:
22711
22804
  - apps
22805
+ CollectionUser:
22806
+ type: object
22807
+ properties:
22808
+ uid:
22809
+ type: string
22810
+ access:
22811
+ type: object
22812
+ additionalProperties: true
22813
+ name:
22814
+ type: string
22815
+ email:
22816
+ type: string
22817
+ required:
22818
+ - uid
22819
+ - access
22820
+ InviteUserInput:
22821
+ type: object
22822
+ properties:
22823
+ email:
22824
+ type: string
22825
+ name:
22826
+ type: string
22827
+ access:
22828
+ type: object
22829
+ additionalProperties: true
22830
+ loginCollectionId:
22831
+ type: string
22832
+ consoleOrigin:
22833
+ type: string
22834
+ required:
22835
+ - email
22836
+ - access
22712
22837
  CollectionResponse:
22713
22838
  $ref: "#/components/schemas/Collection"
22714
22839
  CollectionCreateRequest:
@@ -22718,6 +22843,15 @@ components:
22718
22843
  DomainTarget:
22719
22844
  type: object
22720
22845
  additionalProperties: true
22846
+ CollectionAccessLevel:
22847
+ type: string
22848
+ enum:
22849
+ - Owner
22850
+ - Admin
22851
+ - Assigner
22852
+ - Reporter
22853
+ - User
22854
+ - None
22721
22855
  IdField:
22722
22856
  type: string
22723
22857
  enum:
@@ -25148,6 +25282,8 @@ components:
25148
25282
  properties:
25149
25283
  entityId:
25150
25284
  type: string
25285
+ trigger:
25286
+ $ref: "#/components/schemas/RunTrigger"
25151
25287
  RunFlowSummary:
25152
25288
  type: object
25153
25289
  properties:
@@ -25163,6 +25299,8 @@ components:
25163
25299
  type: number
25164
25300
  status:
25165
25301
  $ref: "#/components/schemas/RunStatus"
25302
+ runId:
25303
+ type: string
25166
25304
  required:
25167
25305
  - flowId
25168
25306
  - direction
@@ -25170,6 +25308,209 @@ components:
25170
25308
  - sent
25171
25309
  - failed
25172
25310
  - status
25311
+ CapturedRequest:
25312
+ type: object
25313
+ properties:
25314
+ transport:
25315
+ type: string
25316
+ method:
25317
+ type: string
25318
+ url:
25319
+ type: string
25320
+ headers:
25321
+ type: object
25322
+ additionalProperties:
25323
+ type: string
25324
+ partitionKey:
25325
+ type: string
25326
+ body: {}
25327
+ bodyBytes:
25328
+ type: number
25329
+ truncated:
25330
+ type: boolean
25331
+ required:
25332
+ - transport
25333
+ - method
25334
+ - url
25335
+ - headers
25336
+ - body
25337
+ - bodyBytes
25338
+ - truncated
25339
+ CapturedResponse:
25340
+ type: object
25341
+ properties:
25342
+ status:
25343
+ type: number
25344
+ ok:
25345
+ type: boolean
25346
+ headers:
25347
+ type: object
25348
+ additionalProperties:
25349
+ type: string
25350
+ body: {}
25351
+ bodyBytes:
25352
+ type: number
25353
+ truncated:
25354
+ type: boolean
25355
+ error:
25356
+ type: string
25357
+ required:
25358
+ - status
25359
+ - ok
25360
+ - headers
25361
+ - body
25362
+ - bodyBytes
25363
+ - truncated
25364
+ - error
25365
+ FlowRun:
25366
+ type: object
25367
+ properties:
25368
+ id:
25369
+ type: string
25370
+ flowId:
25371
+ type: string
25372
+ connectionId:
25373
+ type: string
25374
+ trigger:
25375
+ $ref: "#/components/schemas/RunTrigger"
25376
+ triggerEvent:
25377
+ type: string
25378
+ triggerEntityId:
25379
+ type: string
25380
+ status:
25381
+ $ref: "#/components/schemas/FlowRunStatus"
25382
+ records:
25383
+ type: number
25384
+ sent:
25385
+ type: number
25386
+ failed:
25387
+ type: number
25388
+ error:
25389
+ type: string
25390
+ correlationId:
25391
+ type: string
25392
+ captureLevel:
25393
+ $ref: "#/components/schemas/CaptureLevel"
25394
+ bodiesPurged:
25395
+ type: boolean
25396
+ startedAt:
25397
+ type: string
25398
+ completedAt:
25399
+ type: string
25400
+ durationMs:
25401
+ type: number
25402
+ required:
25403
+ - id
25404
+ - flowId
25405
+ - trigger
25406
+ - status
25407
+ - records
25408
+ - sent
25409
+ - failed
25410
+ - captureLevel
25411
+ - bodiesPurged
25412
+ - startedAt
25413
+ FlowRunItem:
25414
+ type: object
25415
+ properties:
25416
+ id:
25417
+ type: string
25418
+ runId:
25419
+ type: string
25420
+ entityType:
25421
+ type: string
25422
+ entityId:
25423
+ type: string
25424
+ entityLabel:
25425
+ type: string
25426
+ status:
25427
+ $ref: "#/components/schemas/FlowRunItemStatus"
25428
+ skipReason:
25429
+ type: string
25430
+ request:
25431
+ $ref: "#/components/schemas/CapturedRequest"
25432
+ response:
25433
+ $ref: "#/components/schemas/CapturedResponse"
25434
+ attempt:
25435
+ type: number
25436
+ durationMs:
25437
+ type: number
25438
+ createdAt:
25439
+ type: string
25440
+ required:
25441
+ - id
25442
+ - runId
25443
+ - entityType
25444
+ - status
25445
+ - attempt
25446
+ - createdAt
25447
+ ListRunsQuery:
25448
+ type: object
25449
+ properties:
25450
+ status:
25451
+ $ref: "#/components/schemas/FlowRunStatus"
25452
+ trigger:
25453
+ $ref: "#/components/schemas/RunTrigger"
25454
+ entityId:
25455
+ type: string
25456
+ limit:
25457
+ type: number
25458
+ cursor:
25459
+ type: string
25460
+ RunList:
25461
+ type: object
25462
+ properties:
25463
+ runs:
25464
+ type: object
25465
+ additionalProperties: true
25466
+ required:
25467
+ - runs
25468
+ ListRunItemsQuery:
25469
+ type: object
25470
+ properties:
25471
+ status:
25472
+ type: object
25473
+ additionalProperties: true
25474
+ RunItemList:
25475
+ type: object
25476
+ properties:
25477
+ items:
25478
+ type: object
25479
+ additionalProperties: true
25480
+ required:
25481
+ - items
25482
+ LoggingWindow:
25483
+ type: object
25484
+ properties:
25485
+ id:
25486
+ type: string
25487
+ connectionId:
25488
+ type: string
25489
+ level:
25490
+ $ref: "#/components/schemas/CaptureLevel"
25491
+ enabledBy:
25492
+ type: string
25493
+ enabledAt:
25494
+ type: string
25495
+ expiresAt:
25496
+ type: string
25497
+ canceledAt:
25498
+ type: string
25499
+ required:
25500
+ - id
25501
+ - connectionId
25502
+ - level
25503
+ - enabledAt
25504
+ SetLoggingInput:
25505
+ type: object
25506
+ properties:
25507
+ ttlMinutes:
25508
+ type: number
25509
+ level:
25510
+ type: string
25511
+ enum:
25512
+ - full
25513
+ - errors_only
25173
25514
  RunFlowEnqueued:
25174
25515
  type: object
25175
25516
  properties:
@@ -25308,6 +25649,33 @@ components:
25308
25649
  - none
25309
25650
  UpdateFlowInput:
25310
25651
  $ref: "#/components/schemas/CreateFlowInput"
25652
+ RunTrigger:
25653
+ type: string
25654
+ enum:
25655
+ - manual
25656
+ - event
25657
+ - schedule
25658
+ - test
25659
+ FlowRunStatus:
25660
+ type: string
25661
+ enum:
25662
+ - running
25663
+ - success
25664
+ - partial
25665
+ - failed
25666
+ - skipped
25667
+ FlowRunItemStatus:
25668
+ type: string
25669
+ enum:
25670
+ - sent
25671
+ - failed
25672
+ - skipped
25673
+ CaptureLevel:
25674
+ type: string
25675
+ enum:
25676
+ - metadata
25677
+ - errors_only
25678
+ - full
25311
25679
  RunFlowResult:
25312
25680
  anyOf:
25313
25681
  - $ref: "#/components/schemas/RunFlowSummary"
@@ -153,3 +153,33 @@ export interface AppsConfigResponse extends Omit<AppConfigSettings, 'id' | 'apps
153
153
  /** Array of app catalog definitions for this collection. */
154
154
  apps: AppConfig[];
155
155
  }
156
+ /**
157
+ * A user's access level on a collection. Access is stored in the collection's `roles` map
158
+ * (userId → level). Server-enforced tiers are `User` < `Admin` < `Owner`; `Reporter` / `Assigner`
159
+ * are legacy values still accepted but not part of the enforced hierarchy. `None` removes access.
160
+ */
161
+ export type CollectionAccessLevel = 'Owner' | 'Admin' | 'Assigner' | 'Reporter' | 'User' | 'None';
162
+ /** A user who has access to a collection (as returned by {@link collection.getUsers}). */
163
+ export interface CollectionUser {
164
+ /** The user's id (auth uid). */
165
+ uid: string;
166
+ /** The user's access level on this collection. */
167
+ access: CollectionAccessLevel | string;
168
+ /** Display name, if known. */
169
+ name?: string;
170
+ /** Email address, if known. */
171
+ email?: string;
172
+ }
173
+ /** Input for {@link collection.inviteUser}. */
174
+ export interface InviteUserInput {
175
+ /** Email address to invite. */
176
+ email: string;
177
+ /** Optional display name (used when creating a brand-new account). */
178
+ name?: string;
179
+ /** Access level to grant on the collection. Apply it with {@link collection.setUserAccess} after inviting. */
180
+ access: CollectionAccessLevel | string;
181
+ /** The login / auth-kit collection the account lives in (for branding + where the login is created). Default `'global'`. */
182
+ loginCollectionId?: string;
183
+ /** Origin used to build the branded invite link. Defaults to `window.location.origin` in the browser. */
184
+ consoleOrigin?: string;
185
+ }
@@ -87,6 +87,8 @@ export interface FlowList {
87
87
  export interface RunFlowInput {
88
88
  /** Run for a single source entity; omit for the flow's scheduled gather. */
89
89
  entityId?: string;
90
+ /** Trigger label recorded on the run (e.g. 'test' for a test send). Default 'manual'. */
91
+ trigger?: RunTrigger;
90
92
  }
91
93
  /** Inline (synchronous) run summary. */
92
94
  export interface RunFlowSummary {
@@ -96,6 +98,104 @@ export interface RunFlowSummary {
96
98
  sent: number;
97
99
  failed: number;
98
100
  status: RunStatus;
101
+ /** Id of the persisted run row (deep-link into its detail). */
102
+ runId?: string;
103
+ }
104
+ export type RunTrigger = 'manual' | 'event' | 'schedule' | 'test';
105
+ export type FlowRunStatus = 'running' | 'success' | 'partial' | 'failed' | 'skipped';
106
+ export type FlowRunItemStatus = 'sent' | 'failed' | 'skipped';
107
+ export type CaptureLevel = 'metadata' | 'errors_only' | 'full';
108
+ /** A redacted outbound request as captured in a run item (secrets masked, body size-capped). */
109
+ export interface CapturedRequest {
110
+ transport: string;
111
+ method: string;
112
+ url: string;
113
+ headers: Record<string, string>;
114
+ partitionKey?: string;
115
+ body: unknown;
116
+ bodyBytes: number;
117
+ truncated: boolean;
118
+ }
119
+ /** A redacted response as captured in a run item. */
120
+ export interface CapturedResponse {
121
+ status: number | null;
122
+ ok: boolean | null;
123
+ headers: Record<string, string>;
124
+ body: unknown;
125
+ bodyBytes: number;
126
+ truncated: boolean;
127
+ error: string | null;
128
+ }
129
+ /** One run of a flow. */
130
+ export interface FlowRun {
131
+ id: string;
132
+ flowId: string;
133
+ connectionId?: string | null;
134
+ trigger: RunTrigger;
135
+ triggerEvent?: string | null;
136
+ triggerEntityId?: string | null;
137
+ status: FlowRunStatus;
138
+ records: number;
139
+ sent: number;
140
+ failed: number;
141
+ error?: string | null;
142
+ correlationId?: string | null;
143
+ captureLevel: CaptureLevel;
144
+ bodiesPurged: boolean;
145
+ startedAt: string;
146
+ completedAt?: string | null;
147
+ durationMs?: number | null;
148
+ }
149
+ /** One record's attempt within a run (request/response present only when captured at 'full'). */
150
+ export interface FlowRunItem {
151
+ id: string;
152
+ runId: string;
153
+ entityType: string;
154
+ entityId?: string | null;
155
+ entityLabel?: string | null;
156
+ status: FlowRunItemStatus;
157
+ skipReason?: string | null;
158
+ request?: CapturedRequest | null;
159
+ response?: CapturedResponse | null;
160
+ attempt: number;
161
+ durationMs?: number | null;
162
+ createdAt: string;
163
+ }
164
+ export interface ListRunsQuery {
165
+ status?: FlowRunStatus;
166
+ trigger?: RunTrigger;
167
+ entityId?: string;
168
+ limit?: number;
169
+ cursor?: string;
170
+ }
171
+ export interface RunList {
172
+ runs: FlowRun[];
173
+ nextCursor?: string;
174
+ }
175
+ export interface ListRunItemsQuery {
176
+ status?: FlowRunItemStatus;
177
+ limit?: number;
178
+ cursor?: string;
179
+ }
180
+ export interface RunItemList {
181
+ items: FlowRunItem[];
182
+ nextCursor?: string;
183
+ }
184
+ /** A per-connection enhanced-logging window (full capture) while active. */
185
+ export interface LoggingWindow {
186
+ id: string;
187
+ connectionId: string;
188
+ level: CaptureLevel;
189
+ enabledBy?: string | null;
190
+ enabledAt: string;
191
+ expiresAt?: string | null;
192
+ canceledAt?: string | null;
193
+ }
194
+ export interface SetLoggingInput {
195
+ /** Minutes until the window auto-expires; omit for on-until-cancelled. */
196
+ ttlMinutes?: number;
197
+ /** Capture level while active (default 'full'). */
198
+ level?: 'full' | 'errors_only';
99
199
  }
100
200
  /** Response when a run is enqueued (?async=true). */
101
201
  export interface RunFlowEnqueued {