@airweave/sdk 0.1.28 → 0.2.1

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 (132) hide show
  1. package/Client.d.ts +3 -3
  2. package/Client.js +6 -6
  3. package/api/resources/connections/client/Client.d.ts +1 -43
  4. package/api/resources/connections/client/Client.js +11 -163
  5. package/api/resources/connections/client/requests/index.d.ts +0 -1
  6. package/api/resources/destinations/client/Client.js +2 -2
  7. package/api/resources/embeddingModels/client/Client.js +2 -2
  8. package/api/resources/entities/client/Client.js +8 -8
  9. package/api/resources/index.d.ts +2 -2
  10. package/api/resources/index.js +3 -3
  11. package/api/resources/search/client/Client.d.ts +55 -0
  12. package/api/resources/search/client/Client.js +147 -0
  13. package/api/resources/search/client/requests/SearchSearchGetRequest.d.ts +20 -0
  14. package/api/resources/search/client/requests/index.d.ts +1 -0
  15. package/api/resources/sources/client/Client.js +2 -2
  16. package/api/resources/sync/client/Client.js +11 -11
  17. package/api/resources/transformers/client/Client.js +3 -3
  18. package/api/resources/users/client/Client.js +1 -1
  19. package/api/resources/whiteLabels/client/Client.js +8 -8
  20. package/api/types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +7 -0
  21. package/api/types/SyncDagCreate.d.ts +14 -0
  22. package/{dist/api/resources/dag/client/requests → api/types}/SyncDagUpdate.d.ts +3 -7
  23. package/api/types/index.d.ts +3 -0
  24. package/api/types/index.js +3 -0
  25. package/dist/Client.d.ts +3 -3
  26. package/dist/Client.js +6 -6
  27. package/dist/api/resources/connections/client/Client.d.ts +1 -43
  28. package/dist/api/resources/connections/client/Client.js +11 -163
  29. package/dist/api/resources/connections/client/requests/index.d.ts +0 -1
  30. package/dist/api/resources/destinations/client/Client.js +2 -2
  31. package/dist/api/resources/embeddingModels/client/Client.js +2 -2
  32. package/dist/api/resources/entities/client/Client.js +8 -8
  33. package/dist/api/resources/index.d.ts +2 -2
  34. package/dist/api/resources/index.js +3 -3
  35. package/dist/api/resources/search/client/Client.d.ts +55 -0
  36. package/dist/api/resources/search/client/Client.js +147 -0
  37. package/dist/api/resources/search/client/requests/SearchSearchGetRequest.d.ts +20 -0
  38. package/dist/api/resources/search/client/requests/index.d.ts +1 -0
  39. package/dist/api/resources/sources/client/Client.js +2 -2
  40. package/dist/api/resources/sync/client/Client.js +11 -11
  41. package/dist/api/resources/transformers/client/Client.js +3 -3
  42. package/dist/api/resources/users/client/Client.js +1 -1
  43. package/dist/api/resources/whiteLabels/client/Client.js +8 -8
  44. package/dist/api/types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +7 -0
  45. package/dist/api/types/SyncDagCreate.d.ts +14 -0
  46. package/{api/resources/dag/client/requests → dist/api/types}/SyncDagUpdate.d.ts +3 -7
  47. package/dist/api/types/index.d.ts +3 -0
  48. package/dist/api/types/index.js +3 -0
  49. package/dist/serialization/resources/connections/client/index.d.ts +0 -1
  50. package/dist/serialization/resources/connections/client/index.js +1 -2
  51. package/dist/serialization/resources/index.d.ts +1 -2
  52. package/dist/serialization/resources/index.js +2 -3
  53. package/dist/serialization/resources/search/client/index.d.ts +1 -0
  54. package/dist/serialization/resources/search/client/index.js +37 -0
  55. package/dist/serialization/resources/{connections/client/getOauth2AuthUrl.d.ts → search/client/search.d.ts} +2 -2
  56. package/dist/serialization/resources/{connections/client/getOauth2AuthUrl.js → search/client/search.js} +1 -1
  57. package/dist/serialization/types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +13 -0
  58. package/dist/serialization/types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js +44 -0
  59. package/dist/serialization/types/SyncDagCreate.d.ts +18 -0
  60. package/{serialization/resources/dag/client/requests → dist/serialization/types}/SyncDagCreate.js +4 -4
  61. package/dist/serialization/types/SyncDagUpdate.d.ts +18 -0
  62. package/dist/serialization/{resources/dag/client/requests → types}/SyncDagUpdate.js +4 -4
  63. package/dist/serialization/types/index.d.ts +3 -0
  64. package/dist/serialization/types/index.js +3 -0
  65. package/dist/version.d.ts +1 -1
  66. package/dist/version.js +1 -1
  67. package/package.json +1 -1
  68. package/reference.md +80 -435
  69. package/serialization/resources/connections/client/index.d.ts +0 -1
  70. package/serialization/resources/connections/client/index.js +1 -2
  71. package/serialization/resources/index.d.ts +1 -2
  72. package/serialization/resources/index.js +2 -3
  73. package/serialization/resources/search/client/index.d.ts +1 -0
  74. package/serialization/resources/search/client/index.js +37 -0
  75. package/serialization/resources/{connections/client/getOauth2AuthUrl.d.ts → search/client/search.d.ts} +2 -2
  76. package/serialization/resources/{connections/client/getOauth2AuthUrl.js → search/client/search.js} +1 -1
  77. package/serialization/types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +13 -0
  78. package/serialization/types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js +44 -0
  79. package/serialization/types/SyncDagCreate.d.ts +18 -0
  80. package/{dist/serialization/resources/dag/client/requests → serialization/types}/SyncDagCreate.js +4 -4
  81. package/serialization/types/SyncDagUpdate.d.ts +18 -0
  82. package/serialization/{resources/dag/client/requests → types}/SyncDagUpdate.js +4 -4
  83. package/serialization/types/index.d.ts +3 -0
  84. package/serialization/types/index.js +3 -0
  85. package/version.d.ts +1 -1
  86. package/version.js +1 -1
  87. package/api/resources/connections/client/requests/GetOauth2AuthUrlConnectionsOauth2SourceAuthUrlGetRequest.d.ts +0 -12
  88. package/api/resources/dag/client/Client.d.ts +0 -95
  89. package/api/resources/dag/client/Client.js +0 -347
  90. package/api/resources/dag/client/requests/InitializeDagDagInitGetRequest.d.ts +0 -12
  91. package/api/resources/dag/client/requests/SyncDagCreate.d.ts +0 -26
  92. package/api/resources/dag/client/requests/index.d.ts +0 -3
  93. package/dist/api/resources/connections/client/requests/GetOauth2AuthUrlConnectionsOauth2SourceAuthUrlGetRequest.d.ts +0 -12
  94. package/dist/api/resources/dag/client/Client.d.ts +0 -95
  95. package/dist/api/resources/dag/client/Client.js +0 -347
  96. package/dist/api/resources/dag/client/requests/InitializeDagDagInitGetRequest.d.ts +0 -12
  97. package/dist/api/resources/dag/client/requests/SyncDagCreate.d.ts +0 -26
  98. package/dist/api/resources/dag/client/requests/index.d.ts +0 -3
  99. package/dist/serialization/resources/dag/client/index.d.ts +0 -1
  100. package/dist/serialization/resources/dag/client/index.js +0 -17
  101. package/dist/serialization/resources/dag/client/requests/SyncDagCreate.d.ts +0 -18
  102. package/dist/serialization/resources/dag/client/requests/SyncDagUpdate.d.ts +0 -18
  103. package/dist/serialization/resources/dag/client/requests/index.d.ts +0 -2
  104. package/dist/serialization/resources/dag/client/requests/index.js +0 -7
  105. package/serialization/resources/dag/client/index.d.ts +0 -1
  106. package/serialization/resources/dag/client/index.js +0 -17
  107. package/serialization/resources/dag/client/requests/SyncDagCreate.d.ts +0 -18
  108. package/serialization/resources/dag/client/requests/SyncDagUpdate.d.ts +0 -18
  109. package/serialization/resources/dag/client/requests/index.d.ts +0 -2
  110. package/serialization/resources/dag/client/requests/index.js +0 -7
  111. /package/api/resources/{dag → search}/client/index.d.ts +0 -0
  112. /package/api/resources/{dag → search}/client/index.js +0 -0
  113. /package/api/resources/{connections/client/requests/GetOauth2AuthUrlConnectionsOauth2SourceAuthUrlGetRequest.js → search/client/requests/SearchSearchGetRequest.js} +0 -0
  114. /package/api/resources/{dag → search}/client/requests/index.js +0 -0
  115. /package/api/resources/{dag → search}/index.d.ts +0 -0
  116. /package/api/resources/{dag → search}/index.js +0 -0
  117. /package/api/{resources/dag/client/requests/InitializeDagDagInitGetRequest.js → types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js} +0 -0
  118. /package/api/{resources/dag/client/requests → types}/SyncDagCreate.js +0 -0
  119. /package/api/{resources/dag/client/requests → types}/SyncDagUpdate.js +0 -0
  120. /package/dist/api/resources/{dag → search}/client/index.d.ts +0 -0
  121. /package/dist/api/resources/{dag → search}/client/index.js +0 -0
  122. /package/dist/api/resources/{connections/client/requests/GetOauth2AuthUrlConnectionsOauth2SourceAuthUrlGetRequest.js → search/client/requests/SearchSearchGetRequest.js} +0 -0
  123. /package/dist/api/resources/{dag → search}/client/requests/index.js +0 -0
  124. /package/dist/api/resources/{dag → search}/index.d.ts +0 -0
  125. /package/dist/api/resources/{dag → search}/index.js +0 -0
  126. /package/dist/api/{resources/dag/client/requests/InitializeDagDagInitGetRequest.js → types/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js} +0 -0
  127. /package/dist/api/{resources/dag/client/requests → types}/SyncDagCreate.js +0 -0
  128. /package/dist/api/{resources/dag/client/requests → types}/SyncDagUpdate.js +0 -0
  129. /package/dist/serialization/resources/{dag → search}/index.d.ts +0 -0
  130. /package/dist/serialization/resources/{dag → search}/index.js +0 -0
  131. /package/serialization/resources/{dag → search}/index.d.ts +0 -0
  132. /package/serialization/resources/{dag → search}/index.js +0 -0
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost = void 0;
40
+ const core = __importStar(require("../../core"));
41
+ exports.BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost = core.serialization.object({
42
+ token: core.serialization.string(),
43
+ name: core.serialization.string().optional(),
44
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as AirweaveSDK from "../../api/index";
6
+ import * as core from "../../core";
7
+ import { DagNodeCreate } from "./DagNodeCreate";
8
+ import { DagEdgeCreate } from "./DagEdgeCreate";
9
+ export declare const SyncDagCreate: core.serialization.ObjectSchema<serializers.SyncDagCreate.Raw, AirweaveSDK.SyncDagCreate>;
10
+ export declare namespace SyncDagCreate {
11
+ interface Raw {
12
+ name: string;
13
+ description?: string | null;
14
+ sync_id: string;
15
+ nodes: DagNodeCreate.Raw[];
16
+ edges: DagEdgeCreate.Raw[];
17
+ }
18
+ }
@@ -37,13 +37,13 @@ var __importStar = (this && this.__importStar) || (function () {
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.SyncDagCreate = void 0;
40
- const core = __importStar(require("../../../../../core"));
41
- const DagNodeCreate_1 = require("../../../../types/DagNodeCreate");
42
- const DagEdgeCreate_1 = require("../../../../types/DagEdgeCreate");
40
+ const core = __importStar(require("../../core"));
41
+ const DagNodeCreate_1 = require("./DagNodeCreate");
42
+ const DagEdgeCreate_1 = require("./DagEdgeCreate");
43
43
  exports.SyncDagCreate = core.serialization.object({
44
44
  name: core.serialization.string(),
45
45
  description: core.serialization.string().optional(),
46
- syncDagCreateSyncId: core.serialization.property("sync_id", core.serialization.string()),
46
+ syncId: core.serialization.property("sync_id", core.serialization.string()),
47
47
  nodes: core.serialization.list(DagNodeCreate_1.DagNodeCreate),
48
48
  edges: core.serialization.list(DagEdgeCreate_1.DagEdgeCreate),
49
49
  });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as AirweaveSDK from "../../api/index";
6
+ import * as core from "../../core";
7
+ import { DagNodeCreate } from "./DagNodeCreate";
8
+ import { DagEdgeCreate } from "./DagEdgeCreate";
9
+ export declare const SyncDagUpdate: core.serialization.ObjectSchema<serializers.SyncDagUpdate.Raw, AirweaveSDK.SyncDagUpdate>;
10
+ export declare namespace SyncDagUpdate {
11
+ interface Raw {
12
+ name: string;
13
+ description?: string | null;
14
+ sync_id: string;
15
+ nodes?: DagNodeCreate.Raw[] | null;
16
+ edges?: DagEdgeCreate.Raw[] | null;
17
+ }
18
+ }
@@ -37,13 +37,13 @@ var __importStar = (this && this.__importStar) || (function () {
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.SyncDagUpdate = void 0;
40
- const core = __importStar(require("../../../../../core"));
41
- const DagNodeCreate_1 = require("../../../../types/DagNodeCreate");
42
- const DagEdgeCreate_1 = require("../../../../types/DagEdgeCreate");
40
+ const core = __importStar(require("../../core"));
41
+ const DagNodeCreate_1 = require("./DagNodeCreate");
42
+ const DagEdgeCreate_1 = require("./DagEdgeCreate");
43
43
  exports.SyncDagUpdate = core.serialization.object({
44
44
  name: core.serialization.string(),
45
45
  description: core.serialization.string().optional(),
46
- syncDagUpdateSyncId: core.serialization.property("sync_id", core.serialization.string()),
46
+ syncId: core.serialization.property("sync_id", core.serialization.string()),
47
47
  nodes: core.serialization.list(DagNodeCreate_1.DagNodeCreate).optional(),
48
48
  edges: core.serialization.list(DagEdgeCreate_1.DagEdgeCreate).optional(),
49
49
  });
@@ -2,6 +2,7 @@ export * from "./ApiKey";
2
2
  export * from "./ApiKeyCreate";
3
3
  export * from "./ApiKeyWithPlainKey";
4
4
  export * from "./AuthType";
5
+ export * from "./BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost";
5
6
  export * from "./Chat";
6
7
  export * from "./ChatCreate";
7
8
  export * from "./ChatMessage";
@@ -30,6 +31,8 @@ export * from "./Source";
30
31
  export * from "./SourceWithConfigFields";
31
32
  export * from "./Sync";
32
33
  export * from "./SyncDag";
34
+ export * from "./SyncDagCreate";
35
+ export * from "./SyncDagUpdate";
33
36
  export * from "./SyncJob";
34
37
  export * from "./SyncJobStatus";
35
38
  export * from "./SyncStatus";
@@ -18,6 +18,7 @@ __exportStar(require("./ApiKey"), exports);
18
18
  __exportStar(require("./ApiKeyCreate"), exports);
19
19
  __exportStar(require("./ApiKeyWithPlainKey"), exports);
20
20
  __exportStar(require("./AuthType"), exports);
21
+ __exportStar(require("./BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost"), exports);
21
22
  __exportStar(require("./Chat"), exports);
22
23
  __exportStar(require("./ChatCreate"), exports);
23
24
  __exportStar(require("./ChatMessage"), exports);
@@ -46,6 +47,8 @@ __exportStar(require("./Source"), exports);
46
47
  __exportStar(require("./SourceWithConfigFields"), exports);
47
48
  __exportStar(require("./Sync"), exports);
48
49
  __exportStar(require("./SyncDag"), exports);
50
+ __exportStar(require("./SyncDagCreate"), exports);
51
+ __exportStar(require("./SyncDagUpdate"), exports);
49
52
  __exportStar(require("./SyncJob"), exports);
50
53
  __exportStar(require("./SyncJobStatus"), exports);
51
54
  __exportStar(require("./SyncStatus"), exports);
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.28";
1
+ export declare const SDK_VERSION = "0.2.1";
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.28";
4
+ exports.SDK_VERSION = "0.2.1";
@@ -1,12 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- /**
5
- * @example
6
- * {
7
- * shortName: "short_name"
8
- * }
9
- */
10
- export interface GetOauth2AuthUrlConnectionsOauth2SourceAuthUrlGetRequest {
11
- shortName: string;
12
- }
@@ -1,95 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../environments";
5
- import * as core from "../../../../core";
6
- import * as AirweaveSDK from "../../../index";
7
- export declare namespace Dag {
8
- interface Options {
9
- environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- /** Override the x-api-key header */
11
- apiKey?: core.Supplier<string | undefined>;
12
- }
13
- interface RequestOptions {
14
- /** The maximum time to wait for a response in seconds. */
15
- timeoutInSeconds?: number;
16
- /** The number of times to retry the request. Defaults to 2. */
17
- maxRetries?: number;
18
- /** A hook to abort the request. */
19
- abortSignal?: AbortSignal;
20
- /** Override the x-api-key header */
21
- apiKey?: string | undefined;
22
- /** Additional headers to include in the request. */
23
- headers?: Record<string, string>;
24
- }
25
- }
26
- export declare class Dag {
27
- protected readonly _options: Dag.Options;
28
- constructor(_options?: Dag.Options);
29
- /**
30
- * Get the DAG definition for a sync.
31
- *
32
- * @param {string} syncId
33
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
34
- *
35
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
36
- *
37
- * @example
38
- * await client.dag.getSyncDag("sync_id")
39
- */
40
- getSyncDag(syncId: string, requestOptions?: Dag.RequestOptions): Promise<AirweaveSDK.SyncDag>;
41
- /**
42
- * Create a new DAG definition for a sync.
43
- *
44
- * @param {string} syncId
45
- * @param {AirweaveSDK.SyncDagCreate} request
46
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
47
- *
48
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
49
- *
50
- * @example
51
- * await client.dag.createSyncDag("sync_id", {
52
- * name: "name",
53
- * syncDagCreateSyncId: "sync_id",
54
- * nodes: [{
55
- * type: "source",
56
- * name: "name"
57
- * }],
58
- * edges: [{
59
- * fromNodeId: "from_node_id",
60
- * toNodeId: "to_node_id"
61
- * }]
62
- * })
63
- */
64
- createSyncDag(syncId: string, request: AirweaveSDK.SyncDagCreate, requestOptions?: Dag.RequestOptions): Promise<AirweaveSDK.SyncDag>;
65
- /**
66
- * Update a DAG definition for a sync.
67
- *
68
- * @param {string} syncId
69
- * @param {AirweaveSDK.SyncDagUpdate} request
70
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
71
- *
72
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
73
- *
74
- * @example
75
- * await client.dag.updateSyncDag("sync_id", {
76
- * name: "name",
77
- * syncDagUpdateSyncId: "sync_id"
78
- * })
79
- */
80
- updateSyncDag(syncId: string, request: AirweaveSDK.SyncDagUpdate, requestOptions?: Dag.RequestOptions): Promise<AirweaveSDK.SyncDag>;
81
- /**
82
- * Initialize a new DAG with source, entities, and destination.
83
- *
84
- * @param {AirweaveSDK.InitializeDagDagInitGetRequest} request
85
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
86
- *
87
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
88
- *
89
- * @example
90
- * await client.dag.initializeDag({
91
- * syncId: "sync_id"
92
- * })
93
- */
94
- initializeDag(request: AirweaveSDK.InitializeDagDagInitGetRequest, requestOptions?: Dag.RequestOptions): Promise<AirweaveSDK.SyncDag>;
95
- }
@@ -1,347 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
- return new (P || (P = Promise))(function (resolve, reject) {
41
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
- step((generator = generator.apply(thisArg, _arguments || [])).next());
45
- });
46
- };
47
- var __importDefault = (this && this.__importDefault) || function (mod) {
48
- return (mod && mod.__esModule) ? mod : { "default": mod };
49
- };
50
- Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.Dag = void 0;
52
- const environments = __importStar(require("../../../../environments"));
53
- const core = __importStar(require("../../../../core"));
54
- const AirweaveSDK = __importStar(require("../../../index"));
55
- const url_join_1 = __importDefault(require("url-join"));
56
- const serializers = __importStar(require("../../../../serialization/index"));
57
- const errors = __importStar(require("../../../../errors/index"));
58
- class Dag {
59
- constructor(_options = {}) {
60
- this._options = _options;
61
- }
62
- /**
63
- * Get the DAG definition for a sync.
64
- *
65
- * @param {string} syncId
66
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
67
- *
68
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
69
- *
70
- * @example
71
- * await client.dag.getSyncDag("sync_id")
72
- */
73
- getSyncDag(syncId, requestOptions) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- var _a;
76
- const _response = yield core.fetcher({
77
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `dag/sync/${encodeURIComponent(syncId)}/dag/`),
78
- method: "GET",
79
- headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
80
- ? yield core.Supplier.get(this._options.apiKey)
81
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.28", "User-Agent": "@airweave/sdk/0.1.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
- contentType: "application/json",
83
- requestType: "json",
84
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
85
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
86
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
- });
88
- if (_response.ok) {
89
- return serializers.SyncDag.parseOrThrow(_response.body, {
90
- unrecognizedObjectKeys: "passthrough",
91
- allowUnrecognizedUnionMembers: true,
92
- allowUnrecognizedEnumValues: true,
93
- breadcrumbsPrefix: ["response"],
94
- });
95
- }
96
- if (_response.error.reason === "status-code") {
97
- switch (_response.error.statusCode) {
98
- case 422:
99
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
100
- unrecognizedObjectKeys: "passthrough",
101
- allowUnrecognizedUnionMembers: true,
102
- allowUnrecognizedEnumValues: true,
103
- breadcrumbsPrefix: ["response"],
104
- }));
105
- default:
106
- throw new errors.AirweaveSDKError({
107
- statusCode: _response.error.statusCode,
108
- body: _response.error.body,
109
- });
110
- }
111
- }
112
- switch (_response.error.reason) {
113
- case "non-json":
114
- throw new errors.AirweaveSDKError({
115
- statusCode: _response.error.statusCode,
116
- body: _response.error.rawBody,
117
- });
118
- case "timeout":
119
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /dag/sync/{sync_id}/dag/.");
120
- case "unknown":
121
- throw new errors.AirweaveSDKError({
122
- message: _response.error.errorMessage,
123
- });
124
- }
125
- });
126
- }
127
- /**
128
- * Create a new DAG definition for a sync.
129
- *
130
- * @param {string} syncId
131
- * @param {AirweaveSDK.SyncDagCreate} request
132
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
133
- *
134
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
135
- *
136
- * @example
137
- * await client.dag.createSyncDag("sync_id", {
138
- * name: "name",
139
- * syncDagCreateSyncId: "sync_id",
140
- * nodes: [{
141
- * type: "source",
142
- * name: "name"
143
- * }],
144
- * edges: [{
145
- * fromNodeId: "from_node_id",
146
- * toNodeId: "to_node_id"
147
- * }]
148
- * })
149
- */
150
- createSyncDag(syncId, request, requestOptions) {
151
- return __awaiter(this, void 0, void 0, function* () {
152
- var _a;
153
- const _response = yield core.fetcher({
154
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `dag/sync/${encodeURIComponent(syncId)}/dag/`),
155
- method: "POST",
156
- headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
157
- ? yield core.Supplier.get(this._options.apiKey)
158
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.28", "User-Agent": "@airweave/sdk/0.1.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
159
- contentType: "application/json",
160
- requestType: "json",
161
- body: serializers.SyncDagCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
162
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
163
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
164
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
165
- });
166
- if (_response.ok) {
167
- return serializers.SyncDag.parseOrThrow(_response.body, {
168
- unrecognizedObjectKeys: "passthrough",
169
- allowUnrecognizedUnionMembers: true,
170
- allowUnrecognizedEnumValues: true,
171
- breadcrumbsPrefix: ["response"],
172
- });
173
- }
174
- if (_response.error.reason === "status-code") {
175
- switch (_response.error.statusCode) {
176
- case 422:
177
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
178
- unrecognizedObjectKeys: "passthrough",
179
- allowUnrecognizedUnionMembers: true,
180
- allowUnrecognizedEnumValues: true,
181
- breadcrumbsPrefix: ["response"],
182
- }));
183
- default:
184
- throw new errors.AirweaveSDKError({
185
- statusCode: _response.error.statusCode,
186
- body: _response.error.body,
187
- });
188
- }
189
- }
190
- switch (_response.error.reason) {
191
- case "non-json":
192
- throw new errors.AirweaveSDKError({
193
- statusCode: _response.error.statusCode,
194
- body: _response.error.rawBody,
195
- });
196
- case "timeout":
197
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /dag/sync/{sync_id}/dag/.");
198
- case "unknown":
199
- throw new errors.AirweaveSDKError({
200
- message: _response.error.errorMessage,
201
- });
202
- }
203
- });
204
- }
205
- /**
206
- * Update a DAG definition for a sync.
207
- *
208
- * @param {string} syncId
209
- * @param {AirweaveSDK.SyncDagUpdate} request
210
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
211
- *
212
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
213
- *
214
- * @example
215
- * await client.dag.updateSyncDag("sync_id", {
216
- * name: "name",
217
- * syncDagUpdateSyncId: "sync_id"
218
- * })
219
- */
220
- updateSyncDag(syncId, request, requestOptions) {
221
- return __awaiter(this, void 0, void 0, function* () {
222
- var _a;
223
- const _response = yield core.fetcher({
224
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `dag/sync/${encodeURIComponent(syncId)}/dag/`),
225
- method: "PUT",
226
- headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
227
- ? yield core.Supplier.get(this._options.apiKey)
228
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.28", "User-Agent": "@airweave/sdk/0.1.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
229
- contentType: "application/json",
230
- requestType: "json",
231
- body: serializers.SyncDagUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
232
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
233
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
234
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
235
- });
236
- if (_response.ok) {
237
- return serializers.SyncDag.parseOrThrow(_response.body, {
238
- unrecognizedObjectKeys: "passthrough",
239
- allowUnrecognizedUnionMembers: true,
240
- allowUnrecognizedEnumValues: true,
241
- breadcrumbsPrefix: ["response"],
242
- });
243
- }
244
- if (_response.error.reason === "status-code") {
245
- switch (_response.error.statusCode) {
246
- case 422:
247
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
248
- unrecognizedObjectKeys: "passthrough",
249
- allowUnrecognizedUnionMembers: true,
250
- allowUnrecognizedEnumValues: true,
251
- breadcrumbsPrefix: ["response"],
252
- }));
253
- default:
254
- throw new errors.AirweaveSDKError({
255
- statusCode: _response.error.statusCode,
256
- body: _response.error.body,
257
- });
258
- }
259
- }
260
- switch (_response.error.reason) {
261
- case "non-json":
262
- throw new errors.AirweaveSDKError({
263
- statusCode: _response.error.statusCode,
264
- body: _response.error.rawBody,
265
- });
266
- case "timeout":
267
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling PUT /dag/sync/{sync_id}/dag/.");
268
- case "unknown":
269
- throw new errors.AirweaveSDKError({
270
- message: _response.error.errorMessage,
271
- });
272
- }
273
- });
274
- }
275
- /**
276
- * Initialize a new DAG with source, entities, and destination.
277
- *
278
- * @param {AirweaveSDK.InitializeDagDagInitGetRequest} request
279
- * @param {Dag.RequestOptions} requestOptions - Request-specific configuration.
280
- *
281
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
282
- *
283
- * @example
284
- * await client.dag.initializeDag({
285
- * syncId: "sync_id"
286
- * })
287
- */
288
- initializeDag(request, requestOptions) {
289
- return __awaiter(this, void 0, void 0, function* () {
290
- var _a;
291
- const { syncId } = request;
292
- const _queryParams = {};
293
- _queryParams["sync_id"] = syncId;
294
- const _response = yield core.fetcher({
295
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "dag/init"),
296
- method: "GET",
297
- headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
298
- ? yield core.Supplier.get(this._options.apiKey)
299
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.28", "User-Agent": "@airweave/sdk/0.1.28", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
300
- contentType: "application/json",
301
- queryParameters: _queryParams,
302
- requestType: "json",
303
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
304
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
305
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
306
- });
307
- if (_response.ok) {
308
- return serializers.SyncDag.parseOrThrow(_response.body, {
309
- unrecognizedObjectKeys: "passthrough",
310
- allowUnrecognizedUnionMembers: true,
311
- allowUnrecognizedEnumValues: true,
312
- breadcrumbsPrefix: ["response"],
313
- });
314
- }
315
- if (_response.error.reason === "status-code") {
316
- switch (_response.error.statusCode) {
317
- case 422:
318
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
319
- unrecognizedObjectKeys: "passthrough",
320
- allowUnrecognizedUnionMembers: true,
321
- allowUnrecognizedEnumValues: true,
322
- breadcrumbsPrefix: ["response"],
323
- }));
324
- default:
325
- throw new errors.AirweaveSDKError({
326
- statusCode: _response.error.statusCode,
327
- body: _response.error.body,
328
- });
329
- }
330
- }
331
- switch (_response.error.reason) {
332
- case "non-json":
333
- throw new errors.AirweaveSDKError({
334
- statusCode: _response.error.statusCode,
335
- body: _response.error.rawBody,
336
- });
337
- case "timeout":
338
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /dag/init.");
339
- case "unknown":
340
- throw new errors.AirweaveSDKError({
341
- message: _response.error.errorMessage,
342
- });
343
- }
344
- });
345
- }
346
- }
347
- exports.Dag = Dag;
@@ -1,12 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- /**
5
- * @example
6
- * {
7
- * syncId: "sync_id"
8
- * }
9
- */
10
- export interface InitializeDagDagInitGetRequest {
11
- syncId: string;
12
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as AirweaveSDK from "../../../../index";
5
- /**
6
- * @example
7
- * {
8
- * name: "name",
9
- * syncDagCreateSyncId: "sync_id",
10
- * nodes: [{
11
- * type: "source",
12
- * name: "name"
13
- * }],
14
- * edges: [{
15
- * fromNodeId: "from_node_id",
16
- * toNodeId: "to_node_id"
17
- * }]
18
- * }
19
- */
20
- export interface SyncDagCreate {
21
- name: string;
22
- description?: string;
23
- syncDagCreateSyncId: string;
24
- nodes: AirweaveSDK.DagNodeCreate[];
25
- edges: AirweaveSDK.DagEdgeCreate[];
26
- }