@airweave/sdk 0.1.19 → 0.1.21

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.
Files changed (32) hide show
  1. package/api/resources/connections/client/Client.d.ts +86 -5
  2. package/api/resources/connections/client/Client.js +98 -17
  3. package/api/resources/destinations/client/Client.d.ts +19 -0
  4. package/api/resources/destinations/client/Client.js +21 -2
  5. package/api/resources/embeddingModels/client/Client.js +2 -2
  6. package/api/resources/search/client/Client.js +2 -2
  7. package/api/resources/sources/client/Client.d.ts +6 -1
  8. package/api/resources/sources/client/Client.js +8 -3
  9. package/api/resources/sync/client/Client.d.ts +85 -0
  10. package/api/resources/sync/client/Client.js +93 -8
  11. package/api/resources/users/client/Client.js +1 -1
  12. package/api/resources/whiteLabels/client/Client.d.ts +81 -0
  13. package/api/resources/whiteLabels/client/Client.js +89 -8
  14. package/dist/api/resources/connections/client/Client.d.ts +86 -5
  15. package/dist/api/resources/connections/client/Client.js +98 -17
  16. package/dist/api/resources/destinations/client/Client.d.ts +19 -0
  17. package/dist/api/resources/destinations/client/Client.js +21 -2
  18. package/dist/api/resources/embeddingModels/client/Client.js +2 -2
  19. package/dist/api/resources/search/client/Client.js +2 -2
  20. package/dist/api/resources/sources/client/Client.d.ts +6 -1
  21. package/dist/api/resources/sources/client/Client.js +8 -3
  22. package/dist/api/resources/sync/client/Client.d.ts +85 -0
  23. package/dist/api/resources/sync/client/Client.js +93 -8
  24. package/dist/api/resources/users/client/Client.js +1 -1
  25. package/dist/api/resources/whiteLabels/client/Client.d.ts +81 -0
  26. package/dist/api/resources/whiteLabels/client/Client.js +89 -8
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/package.json +1 -1
  30. package/reference.md +307 -35
  31. package/version.d.ts +1 -1
  32. package/version.js +1 -1
package/reference.md CHANGED
@@ -154,6 +154,11 @@ await client.sources.readSource("short_name");
154
154
 
155
155
  Get all sources for the current user.
156
156
 
157
+ ## Args:
158
+
159
+ db: The database session
160
+ user: The current user
161
+
157
162
  ## Returns:
158
163
 
159
164
  list[schemas.Source]: The list of sources.
@@ -215,6 +220,15 @@ await client.sources.readSources();
215
220
 
216
221
  Get all available destinations.
217
222
 
223
+ ## Args:
224
+
225
+ db: The database session
226
+ user: The current user
227
+
228
+ ## Returns:
229
+
230
+ List[schemas.Destination]: A list of destinations
231
+
218
232
  </dd>
219
233
  </dl>
220
234
  </dd>
@@ -270,6 +284,16 @@ await client.destinations.listDestinations();
270
284
 
271
285
  Get destination by short name.
272
286
 
287
+ ## Args:
288
+
289
+ db: The database session
290
+ short_name: The short name of the destination
291
+ user: The current user
292
+
293
+ ## Returns:
294
+
295
+ destination (schemas.Destination): The destination
296
+
273
297
  </dd>
274
298
  </dl>
275
299
  </dd>
@@ -474,6 +498,16 @@ await client.embeddingModels.readEmbeddingModels();
474
498
 
475
499
  Get a specific connection.
476
500
 
501
+ ## Args:
502
+
503
+ connection_id: The ID of the connection to get.
504
+ db: The database session.
505
+ user: The current user.
506
+
507
+ ## Returns:
508
+
509
+ schemas.Connection: The connection.
510
+
477
511
  </dd>
478
512
  </dl>
479
513
  </dd>
@@ -537,6 +571,15 @@ await client.connections.getConnection("connection_id");
537
571
 
538
572
  Get all active connections for the current user across all integration types.
539
573
 
574
+ ## Args:
575
+
576
+ db: The database session.
577
+ user: The current user.
578
+
579
+ ## Returns:
580
+
581
+ list[schemas.Connection]: The list of connections.
582
+
540
583
  </dd>
541
584
  </dl>
542
585
  </dd>
@@ -592,13 +635,15 @@ await client.connections.listAllConnectedIntegrations();
592
635
 
593
636
  Get all integrations of specified type connected to the current user.
594
637
 
595
- Args:
596
- integration_type (IntegrationType): The type of integration to get connections for.
597
- db (AsyncSession): The database session.
598
- user (schemas.User): The current user.
638
+ ## Args:
599
639
 
600
- Returns:
601
- list[schemas.Connection]: The list of connections.
640
+ integration_type (IntegrationType): The type of integration to get connections for.
641
+ db (AsyncSession): The database session.
642
+ user (schemas.User): The current user.
643
+
644
+ ## Returns:
645
+
646
+ list[schemas.Connection]: The list of connections.
602
647
 
603
648
  </dd>
604
649
  </dl>
@@ -672,6 +717,19 @@ Expects a POST body with:
672
717
  }
673
718
  ```
674
719
 
720
+ ## Args:
721
+
722
+ db: The database session.
723
+ integration_type: The type of integration to connect to.
724
+ short_name: The short name of the integration to connect to.
725
+ name: The name of the connection.
726
+ config_fields: The config fields for the integration.
727
+ user: The current user.
728
+
729
+ ## Returns:
730
+
731
+ schemas.Connection: The connection.
732
+
675
733
  </dd>
676
734
  </dl>
677
735
  </dd>
@@ -755,13 +813,15 @@ await client.connections.connectIntegration("source", "short_name", {
755
813
 
756
814
  Get the credentials for a connection.
757
815
 
758
- Args:
759
- connection_id (UUID): The ID of the connection to get credentials for
760
- db (AsyncSession): The database session
761
- user (schemas.User): The current user
816
+ ## Args:
762
817
 
763
- Returns:
764
- dict: The credentials for the connection
818
+ connection_id (UUID): The ID of the connection to get credentials for
819
+ db (AsyncSession): The database session
820
+ user (schemas.User): The current user
821
+
822
+ ## Returns:
823
+
824
+ decrypted_credentials (dict): The credentials for the connection
765
825
 
766
826
  </dd>
767
827
  </dl>
@@ -828,14 +888,15 @@ Delete a connection.
828
888
 
829
889
  Deletes the connection and integration credential.
830
890
 
831
- Args:
832
- db (AsyncSession): The database session
833
- connection_id (UUID): The ID of the connection to delete
834
- delete_syncs_and_data (bool): Whether to delete the associated syncs and data
835
- user (schemas.User): The current user
891
+ ## Args:
836
892
 
837
- Returns:
838
- schemas.Connection: The deleted connection
893
+ db (AsyncSession): The database session
894
+ connection_id (UUID): The ID of the connection to delete
895
+ user (schemas.User): The current user
896
+
897
+ ## Returns:
898
+
899
+ connection (schemas.Connection): The deleted connection
839
900
 
840
901
  </dd>
841
902
  </dl>
@@ -900,12 +961,15 @@ await client.connections.deleteConnection("connection_id");
900
961
 
901
962
  Disconnect from a source connection.
902
963
 
903
- Args:
904
- db (AsyncSession): The database session
905
- connection_id (UUID): The ID of the connection to disconnect
906
- user (schemas.User): The current user
907
- Returns:
908
- schemas.Connection: The disconnected connection
964
+ ## Args:
965
+
966
+ db (AsyncSession): The database session
967
+ connection_id (UUID): The ID of the connection to disconnect
968
+ user (schemas.User): The current user
969
+
970
+ ## Returns:
971
+
972
+ connection_schema (schemas.Connection): The disconnected connection
909
973
 
910
974
  </dd>
911
975
  </dl>
@@ -970,13 +1034,15 @@ await client.connections.disconnectSourceConnection("connection_id");
970
1034
 
971
1035
  Disconnect from a destination connection.
972
1036
 
973
- Args:
974
- db (AsyncSession): The database session
975
- connection_id (UUID): The ID of the connection to disconnect
976
- user (schemas.User): The current user
1037
+ ## Args:
1038
+
1039
+ db (AsyncSession): The database session
1040
+ connection_id (UUID): The ID of the connection to disconnect
1041
+ user (schemas.User): The current user
1042
+
1043
+ ## Returns:
977
1044
 
978
- Returns:
979
- schemas.Connection: The disconnected connection
1045
+ connection_schema (schemas.Connection): The disconnected connection
980
1046
 
981
1047
  </dd>
982
1048
  </dl>
@@ -1041,6 +1107,12 @@ await client.connections.disconnectDestinationConnection("connection_id");
1041
1107
 
1042
1108
  Get the OAuth2 authorization URL for a source.
1043
1109
 
1110
+ ## Args:
1111
+
1112
+ db: The database session
1113
+ short_name: The short name of the source
1114
+ user: The current user
1115
+
1044
1116
  </dd>
1045
1117
  </dl>
1046
1118
  </dd>
@@ -1111,10 +1183,22 @@ This will:
1111
1183
  1. Get the OAuth2 settings for the source
1112
1184
  2. Exchange the authorization code for a token
1113
1185
  3. Create an integration credential with the token
1114
- </dd>
1115
- </dl>
1116
- </dd>
1117
- </dl>
1186
+
1187
+ ## Args:
1188
+
1189
+ db: The database session
1190
+ short_name: The short name of the source
1191
+ code: The authorization code
1192
+ user: The current user
1193
+
1194
+ ## Returns:
1195
+
1196
+ connection (schemas.Connection): The created connection
1197
+
1198
+ </dd>
1199
+ </dl>
1200
+ </dd>
1201
+ </dl>
1118
1202
 
1119
1203
  #### 🔌 Usage
1120
1204
 
@@ -1177,6 +1261,18 @@ await client.connections.sendOauth2Code({
1177
1261
 
1178
1262
  Exchange the OAuth2 authorization code for a white label integration.
1179
1263
 
1264
+ ## Args:
1265
+
1266
+ db: The database session
1267
+ white_label_id: The ID of the white label integration
1268
+ code: The authorization code
1269
+ user: The current user
1270
+ background_tasks: The background tasks
1271
+
1272
+ ## Returns:
1273
+
1274
+ connection (schemas.Connection): The created connection
1275
+
1180
1276
  </dd>
1181
1277
  </dl>
1182
1278
  </dd>
@@ -1248,6 +1344,16 @@ await client.connections.sendOauth2WhiteLabelCode("white_label_id", "string");
1248
1344
 
1249
1345
  Get the OAuth2 authorization URL for a white label integration.
1250
1346
 
1347
+ ## Args:
1348
+
1349
+ db: The database session
1350
+ white_label_id: The ID of the white label integration
1351
+ user: The current user
1352
+
1353
+ ## Returns:
1354
+
1355
+ str: The OAuth2 authorization URL
1356
+
1251
1357
  </dd>
1252
1358
  </dl>
1253
1359
  </dd>
@@ -1313,6 +1419,18 @@ await client.connections.getOauth2WhiteLabelAuthUrl("white_label_id");
1313
1419
 
1314
1420
  List all syncs for the current user.
1315
1421
 
1422
+ ## Args:
1423
+
1424
+ db: The database session
1425
+ skip: The number of syncs to skip
1426
+ limit: The number of syncs to return
1427
+ with_source_connection: Whether to include the source connection in the response
1428
+ user: The current user
1429
+
1430
+ ## Returns:
1431
+
1432
+ list[schemas.Sync] | list[schemas.SyncWithSourceConnection]: A list of syncs
1433
+
1316
1434
  </dd>
1317
1435
  </dl>
1318
1436
  </dd>
@@ -1376,6 +1494,17 @@ await client.sync.listSyncs();
1376
1494
 
1377
1495
  Create a new sync configuration.
1378
1496
 
1497
+ ## Args:
1498
+
1499
+ db: The database session
1500
+ sync_in: The sync to create
1501
+ user: The current user
1502
+ background_tasks: The background tasks
1503
+
1504
+ ## Returns:
1505
+
1506
+ sync (schemas.Sync): The created sync
1507
+
1379
1508
  </dd>
1380
1509
  </dl>
1381
1510
  </dd>
@@ -1442,6 +1571,16 @@ await client.sync.createSync({
1442
1571
 
1443
1572
  Get a specific sync by ID.
1444
1573
 
1574
+ ## Args:
1575
+
1576
+ db: The database session
1577
+ sync_id: The ID of the sync to get
1578
+ user: The current user
1579
+
1580
+ ## Returns:
1581
+
1582
+ sync (schemas.Sync): The sync
1583
+
1445
1584
  </dd>
1446
1585
  </dl>
1447
1586
  </dd>
@@ -1505,6 +1644,17 @@ await client.sync.getSync("sync_id");
1505
1644
 
1506
1645
  Delete a sync configuration and optionally its associated data.
1507
1646
 
1647
+ ## Args:
1648
+
1649
+ db: The database session
1650
+ sync_id: The ID of the sync to delete
1651
+ delete_data: Whether to delete the data associated with the sync
1652
+ user: The current user
1653
+
1654
+ ## Returns:
1655
+
1656
+ sync (schemas.Sync): The deleted sync
1657
+
1508
1658
  </dd>
1509
1659
  </dl>
1510
1660
  </dd>
@@ -1576,6 +1726,17 @@ await client.sync.deleteSync("sync_id");
1576
1726
 
1577
1727
  Trigger a sync run.
1578
1728
 
1729
+ ## Args:
1730
+
1731
+ db: The database session
1732
+ sync_id: The ID of the sync to run
1733
+ user: The current user
1734
+ background_tasks: The background tasks
1735
+
1736
+ ## Returns:
1737
+
1738
+ sync_job (schemas.SyncJob): The sync job
1739
+
1579
1740
  </dd>
1580
1741
  </dl>
1581
1742
  </dd>
@@ -1639,6 +1800,16 @@ await client.sync.runSync("sync_id");
1639
1800
 
1640
1801
  List all jobs for a specific sync.
1641
1802
 
1803
+ ## Args:
1804
+
1805
+ db: The database session
1806
+ sync_id: The ID of the sync to list jobs for
1807
+ user: The current user
1808
+
1809
+ ## Returns:
1810
+
1811
+ list[schemas.SyncJob]: A list of sync jobs
1812
+
1642
1813
  </dd>
1643
1814
  </dl>
1644
1815
  </dd>
@@ -1702,6 +1873,17 @@ await client.sync.listSyncJobs("sync_id");
1702
1873
 
1703
1874
  Get details of a specific sync job.
1704
1875
 
1876
+ ## Args:
1877
+
1878
+ db: The database session
1879
+ sync_id: The ID of the sync to list jobs for
1880
+ job_id: The ID of the job to get
1881
+ user: The current user
1882
+
1883
+ ## Returns:
1884
+
1885
+ sync_job (schemas.SyncJob): The sync job
1886
+
1705
1887
  </dd>
1706
1888
  </dl>
1707
1889
  </dd>
@@ -1775,6 +1957,15 @@ await client.sync.getSyncJob("job_id", {
1775
1957
 
1776
1958
  Server-Sent Events (SSE) endpoint to subscribe to a sync job's progress.
1777
1959
 
1960
+ ## Args:
1961
+
1962
+ job_id: The ID of the job to subscribe to
1963
+ user: The current user
1964
+
1965
+ ## Returns:
1966
+
1967
+ StreamingResponse: The streaming response
1968
+
1778
1969
  </dd>
1779
1970
  </dl>
1780
1971
  </dd>
@@ -1840,6 +2031,15 @@ await client.sync.subscribeSyncJob("job_id");
1840
2031
 
1841
2032
  List all white labels for the current user's organization.
1842
2033
 
2034
+ ## Args:
2035
+
2036
+ db: The database session
2037
+ current_user: The current user
2038
+
2039
+ ## Returns:
2040
+
2041
+ list[schemas.WhiteLabel]: A list of white labels
2042
+
1843
2043
  </dd>
1844
2044
  </dl>
1845
2045
  </dd>
@@ -1895,6 +2095,16 @@ await client.whiteLabels.listWhiteLabels();
1895
2095
 
1896
2096
  Create new white label integration.
1897
2097
 
2098
+ ## Args:
2099
+
2100
+ db: The database session
2101
+ current_user: The current user
2102
+ white_label_in: The white label to create
2103
+
2104
+ ## Returns:
2105
+
2106
+ white_label (schemas.WhiteLabel): The created white label
2107
+
1898
2108
  </dd>
1899
2109
  </dl>
1900
2110
  </dd>
@@ -1964,6 +2174,16 @@ await client.whiteLabels.createWhiteLabel({
1964
2174
 
1965
2175
  Get a specific white label integration.
1966
2176
 
2177
+ ## Args:
2178
+
2179
+ db: The database session
2180
+ white_label_id: The ID of the white label to get
2181
+ current_user: The current user
2182
+
2183
+ ## Returns:
2184
+
2185
+ white_label (schemas.WhiteLabel): The white label
2186
+
1967
2187
  </dd>
1968
2188
  </dl>
1969
2189
  </dd>
@@ -2027,6 +2247,17 @@ await client.whiteLabels.getWhiteLabel("white_label_id");
2027
2247
 
2028
2248
  Update a white label integration.
2029
2249
 
2250
+ ## Args:
2251
+
2252
+ db: The database session
2253
+ current_user: The current user
2254
+ white_label_id: The ID of the white label to update
2255
+ white_label_in: The white label to update
2256
+
2257
+ ## Returns:
2258
+
2259
+ white_label (schemas.WhiteLabel): The updated white label
2260
+
2030
2261
  </dd>
2031
2262
  </dl>
2032
2263
  </dd>
@@ -2098,6 +2329,16 @@ await client.whiteLabels.updateWhiteLabel("white_label_id");
2098
2329
 
2099
2330
  Delete a white label integration.
2100
2331
 
2332
+ ## Args:
2333
+
2334
+ db: The database session
2335
+ current_user: The current user
2336
+ white_label_id: The ID of the white label to delete
2337
+
2338
+ ## Returns:
2339
+
2340
+ white_label (schemas.WhiteLabel): The deleted white label
2341
+
2101
2342
  </dd>
2102
2343
  </dl>
2103
2344
  </dd>
@@ -2161,6 +2402,16 @@ await client.whiteLabels.deleteWhiteLabel("white_label_id");
2161
2402
 
2162
2403
  Generate the OAuth2 authorization URL by delegating to oauth2_service.
2163
2404
 
2405
+ ## Args:
2406
+
2407
+ db: The database session
2408
+ white_label_id: The ID of the white label to get the auth URL for
2409
+ user: The current user
2410
+
2411
+ ## Returns:
2412
+
2413
+ str: The OAuth2 authorization URL
2414
+
2164
2415
  </dd>
2165
2416
  </dl>
2166
2417
  </dd>
@@ -2224,6 +2475,17 @@ await client.whiteLabels.getWhiteLabelOauth2AuthUrl("white_label_id");
2224
2475
 
2225
2476
  Exchange OAuth2 code for tokens and create connection.
2226
2477
 
2478
+ ## Args:
2479
+
2480
+ white_label_id: The ID of the white label to exchange the code for
2481
+ code: The OAuth2 code
2482
+ db: The database session
2483
+ user: The current user
2484
+
2485
+ ## Returns:
2486
+
2487
+ connection (schemas.Connection): The created connection
2488
+
2227
2489
  </dd>
2228
2490
  </dl>
2229
2491
  </dd>
@@ -2295,6 +2557,16 @@ await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", "string"
2295
2557
 
2296
2558
  List all syncs for a specific white label.
2297
2559
 
2560
+ ## Args:
2561
+
2562
+ white_label_id: The ID of the white label to list syncs for
2563
+ db: The database session
2564
+ current_user: The current user
2565
+
2566
+ ## Returns:
2567
+
2568
+ list[schemas.Sync]: A list of syncs
2569
+
2298
2570
  </dd>
2299
2571
  </dl>
2300
2572
  </dd>
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.19";
1
+ export declare const SDK_VERSION = "0.1.21";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.1.19";
4
+ exports.SDK_VERSION = "0.1.21";