polytomic 0.1.2 → 1.0.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.
Files changed (211) hide show
  1. package/Client.d.ts +8 -6
  2. package/Client.js +27 -22
  3. package/api/errors/BadRequestError.d.ts +8 -0
  4. package/api/errors/BadRequestError.js +41 -0
  5. package/api/errors/ForbiddenError.d.ts +8 -0
  6. package/api/errors/ForbiddenError.js +41 -0
  7. package/api/errors/InternalServerError.d.ts +8 -0
  8. package/api/errors/InternalServerError.js +41 -0
  9. package/api/errors/NotFoundError.d.ts +8 -0
  10. package/api/errors/NotFoundError.js +41 -0
  11. package/api/errors/UnprocessableEntityError.d.ts +8 -0
  12. package/api/errors/UnprocessableEntityError.js +41 -0
  13. package/api/errors/index.d.ts +5 -0
  14. package/api/errors/index.js +5 -0
  15. package/api/resources/bulkSync/client/Client.d.ts +62 -46
  16. package/api/resources/bulkSync/client/Client.js +174 -184
  17. package/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
  18. package/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
  19. package/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +1 -4
  20. package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
  21. package/api/resources/bulkSync/client/requests/index.d.ts +3 -2
  22. package/api/resources/bulkSync/resources/executions/client/Client.d.ts +5 -14
  23. package/api/resources/bulkSync/resources/executions/client/Client.js +12 -74
  24. package/api/resources/bulkSync/resources/executions/client/index.d.ts +1 -1
  25. package/api/resources/bulkSync/resources/executions/client/index.js +0 -15
  26. package/api/resources/bulkSync/resources/index.d.ts +0 -1
  27. package/api/resources/bulkSync/resources/index.js +0 -1
  28. package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +20 -9
  29. package/api/resources/bulkSync/resources/schemas/client/Client.js +90 -24
  30. package/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +11 -0
  31. package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +1 -4
  32. package/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
  33. package/api/resources/connections/client/Client.d.ts +40 -49
  34. package/api/resources/connections/client/Client.js +113 -298
  35. package/api/resources/connections/client/requests/ConnectCardRequest.d.ts +18 -0
  36. package/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -4
  37. package/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +1 -4
  38. package/api/resources/connections/client/requests/index.d.ts +2 -4
  39. package/api/resources/events/client/Client.d.ts +9 -8
  40. package/api/resources/events/client/Client.js +16 -18
  41. package/{dist/api/resources/events/client/requests/EventsApiV2GetEventsRequest.d.ts → api/resources/events/client/requests/EventsListRequest.d.ts} +1 -1
  42. package/api/resources/events/client/requests/index.d.ts +1 -1
  43. package/api/resources/identity/client/Client.d.ts +29 -0
  44. package/api/resources/identity/client/Client.js +114 -0
  45. package/api/resources/identity/client/index.d.ts +1 -0
  46. package/api/resources/identity/index.d.ts +1 -0
  47. package/api/resources/identity/index.js +17 -0
  48. package/api/resources/index.d.ts +3 -2
  49. package/api/resources/index.js +4 -3
  50. package/api/resources/jobs/client/Client.d.ts +6 -4
  51. package/api/resources/jobs/client/Client.js +13 -10
  52. package/api/resources/modelSync/client/Client.d.ts +87 -53
  53. package/api/resources/modelSync/client/Client.js +405 -100
  54. package/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -21
  55. package/api/resources/{connections/client/requests/ModelFieldsRequest.d.ts → modelSync/client/requests/ModelSyncGetSourceRequest.d.ts} +2 -2
  56. package/{dist/api/resources/connections/client/requests/TargetRequest.d.ts → api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.d.ts} +4 -4
  57. package/{dist/api/resources/connections/client/requests/ConnectionsGetTargetRequest.d.ts → api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts} +2 -5
  58. package/api/resources/modelSync/client/requests/StartModelSyncRequest.d.ts +1 -0
  59. package/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -21
  60. package/api/resources/modelSync/client/requests/index.d.ts +3 -0
  61. package/api/resources/modelSync/resources/executions/client/Client.d.ts +16 -64
  62. package/api/resources/modelSync/resources/executions/client/Client.js +43 -476
  63. package/api/resources/models/client/Client.d.ts +22 -13
  64. package/api/resources/models/client/Client.js +67 -47
  65. package/api/resources/models/client/requests/CreateModelRequest.d.ts +0 -1
  66. package/api/resources/models/client/requests/UpdateModelRequest.d.ts +0 -1
  67. package/api/resources/organization/client/Client.d.ts +23 -26
  68. package/api/resources/organization/client/Client.js +53 -53
  69. package/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +1 -6
  70. package/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +1 -6
  71. package/api/resources/permissions/client/Client.d.ts +2 -3
  72. package/api/resources/permissions/client/Client.js +1 -1
  73. package/api/resources/permissions/resources/policies/client/Client.d.ts +24 -19
  74. package/api/resources/permissions/resources/policies/client/Client.js +66 -46
  75. package/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.d.ts +1 -5
  76. package/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.d.ts +1 -5
  77. package/api/resources/permissions/resources/roles/client/Client.d.ts +22 -10
  78. package/api/resources/permissions/resources/roles/client/Client.js +62 -37
  79. package/api/resources/schemas/client/Client.d.ts +39 -6
  80. package/api/resources/schemas/client/Client.js +208 -13
  81. package/api/resources/users/client/Client.d.ts +27 -19
  82. package/api/resources/users/client/Client.js +63 -48
  83. package/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +1 -2
  84. package/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +1 -2
  85. package/api/resources/webhooks/client/Client.d.ts +22 -15
  86. package/api/resources/webhooks/client/Client.js +56 -46
  87. package/api/types/ApiError.d.ts +8 -0
  88. package/api/types/GetModelSyncSourceMetaEnvelope.d.ts +7 -0
  89. package/api/types/ModelSyncSourceMetaResponse.d.ts +9 -0
  90. package/api/types/SourceMeta.d.ts +8 -0
  91. package/api/types/SourceMeta.js +5 -0
  92. package/api/types/index.d.ts +4 -0
  93. package/api/types/index.js +4 -0
  94. package/dist/Client.d.ts +8 -6
  95. package/dist/Client.js +27 -22
  96. package/dist/api/errors/BadRequestError.d.ts +8 -0
  97. package/dist/api/errors/BadRequestError.js +41 -0
  98. package/dist/api/errors/ForbiddenError.d.ts +8 -0
  99. package/dist/api/errors/ForbiddenError.js +41 -0
  100. package/dist/api/errors/InternalServerError.d.ts +8 -0
  101. package/dist/api/errors/InternalServerError.js +41 -0
  102. package/dist/api/errors/NotFoundError.d.ts +8 -0
  103. package/dist/api/errors/NotFoundError.js +41 -0
  104. package/dist/api/errors/UnprocessableEntityError.d.ts +8 -0
  105. package/dist/api/errors/UnprocessableEntityError.js +41 -0
  106. package/dist/api/errors/index.d.ts +5 -0
  107. package/dist/api/errors/index.js +5 -0
  108. package/dist/api/resources/bulkSync/client/Client.d.ts +62 -46
  109. package/dist/api/resources/bulkSync/client/Client.js +174 -184
  110. package/dist/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
  111. package/dist/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
  112. package/dist/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +1 -4
  113. package/dist/api/resources/bulkSync/client/requests/StartBulkSyncRequest.js +5 -0
  114. package/dist/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
  115. package/dist/api/resources/bulkSync/client/requests/index.d.ts +3 -2
  116. package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +5 -14
  117. package/dist/api/resources/bulkSync/resources/executions/client/Client.js +12 -74
  118. package/dist/api/resources/bulkSync/resources/executions/client/index.d.ts +1 -1
  119. package/dist/api/resources/bulkSync/resources/executions/client/index.js +0 -15
  120. package/dist/api/resources/bulkSync/resources/index.d.ts +0 -1
  121. package/dist/api/resources/bulkSync/resources/index.js +0 -1
  122. package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +20 -9
  123. package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +90 -24
  124. package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +11 -0
  125. package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.js +5 -0
  126. package/dist/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +1 -4
  127. package/dist/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
  128. package/dist/api/resources/connections/client/Client.d.ts +40 -49
  129. package/dist/api/resources/connections/client/Client.js +113 -298
  130. package/dist/api/resources/connections/client/requests/ConnectCardRequest.d.ts +18 -0
  131. package/dist/api/resources/connections/client/requests/ConnectCardRequest.js +5 -0
  132. package/dist/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -4
  133. package/dist/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +1 -4
  134. package/dist/api/resources/connections/client/requests/index.d.ts +2 -4
  135. package/dist/api/resources/events/client/Client.d.ts +9 -8
  136. package/dist/api/resources/events/client/Client.js +16 -18
  137. package/{api/resources/events/client/requests/EventsApiV2GetEventsRequest.d.ts → dist/api/resources/events/client/requests/EventsListRequest.d.ts} +1 -1
  138. package/dist/api/resources/events/client/requests/EventsListRequest.js +5 -0
  139. package/dist/api/resources/events/client/requests/index.d.ts +1 -1
  140. package/dist/api/resources/identity/client/Client.d.ts +29 -0
  141. package/dist/api/resources/identity/client/Client.js +114 -0
  142. package/dist/api/resources/identity/client/index.d.ts +1 -0
  143. package/dist/api/resources/identity/index.d.ts +1 -0
  144. package/dist/api/resources/identity/index.js +17 -0
  145. package/dist/api/resources/index.d.ts +3 -2
  146. package/dist/api/resources/index.js +4 -3
  147. package/dist/api/resources/jobs/client/Client.d.ts +6 -4
  148. package/dist/api/resources/jobs/client/Client.js +13 -10
  149. package/dist/api/resources/modelSync/client/Client.d.ts +87 -53
  150. package/dist/api/resources/modelSync/client/Client.js +405 -100
  151. package/dist/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -21
  152. package/dist/api/resources/{connections/client/requests/ModelFieldsRequest.d.ts → modelSync/client/requests/ModelSyncGetSourceRequest.d.ts} +2 -2
  153. package/dist/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.js +5 -0
  154. package/{api/resources/connections/client/requests/TargetRequest.d.ts → dist/api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.d.ts} +4 -4
  155. package/dist/api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js +5 -0
  156. package/{api/resources/connections/client/requests/ConnectionsGetTargetRequest.d.ts → dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts} +2 -5
  157. package/dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.js +5 -0
  158. package/dist/api/resources/modelSync/client/requests/StartModelSyncRequest.d.ts +1 -0
  159. package/dist/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -21
  160. package/dist/api/resources/modelSync/client/requests/index.d.ts +3 -0
  161. package/dist/api/resources/modelSync/resources/executions/client/Client.d.ts +16 -64
  162. package/dist/api/resources/modelSync/resources/executions/client/Client.js +43 -476
  163. package/dist/api/resources/models/client/Client.d.ts +22 -13
  164. package/dist/api/resources/models/client/Client.js +67 -47
  165. package/dist/api/resources/models/client/requests/CreateModelRequest.d.ts +0 -1
  166. package/dist/api/resources/models/client/requests/UpdateModelRequest.d.ts +0 -1
  167. package/dist/api/resources/organization/client/Client.d.ts +23 -26
  168. package/dist/api/resources/organization/client/Client.js +53 -53
  169. package/dist/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +1 -6
  170. package/dist/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +1 -6
  171. package/dist/api/resources/permissions/client/Client.d.ts +2 -3
  172. package/dist/api/resources/permissions/client/Client.js +1 -1
  173. package/dist/api/resources/permissions/resources/policies/client/Client.d.ts +24 -19
  174. package/dist/api/resources/permissions/resources/policies/client/Client.js +66 -46
  175. package/dist/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.d.ts +1 -5
  176. package/dist/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.d.ts +1 -5
  177. package/dist/api/resources/permissions/resources/roles/client/Client.d.ts +22 -10
  178. package/dist/api/resources/permissions/resources/roles/client/Client.js +62 -37
  179. package/dist/api/resources/schemas/client/Client.d.ts +39 -6
  180. package/dist/api/resources/schemas/client/Client.js +208 -13
  181. package/dist/api/resources/users/client/Client.d.ts +27 -19
  182. package/dist/api/resources/users/client/Client.js +63 -48
  183. package/dist/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +1 -2
  184. package/dist/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +1 -2
  185. package/dist/api/resources/webhooks/client/Client.d.ts +22 -15
  186. package/dist/api/resources/webhooks/client/Client.js +56 -46
  187. package/dist/api/types/ApiError.d.ts +8 -0
  188. package/dist/api/types/ApiError.js +5 -0
  189. package/dist/api/types/GetModelSyncSourceMetaEnvelope.d.ts +7 -0
  190. package/dist/api/types/GetModelSyncSourceMetaEnvelope.js +5 -0
  191. package/dist/api/types/ModelSyncSourceMetaResponse.d.ts +9 -0
  192. package/dist/api/types/ModelSyncSourceMetaResponse.js +5 -0
  193. package/dist/api/types/SourceMeta.d.ts +8 -0
  194. package/dist/api/types/SourceMeta.js +5 -0
  195. package/dist/api/types/index.d.ts +4 -0
  196. package/dist/api/types/index.js +4 -0
  197. package/package.json +2 -2
  198. package/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +0 -1
  199. package/dist/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +0 -1
  200. /package/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.js +0 -0
  201. /package/api/resources/{connections/client/requests/ConnectionsGetTargetRequest.js → bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.js} +0 -0
  202. /package/api/resources/connections/client/requests/{ModelFieldsRequest.js → ConnectCardRequest.js} +0 -0
  203. /package/api/resources/{connections/client/requests/TargetRequest.js → events/client/requests/EventsListRequest.js} +0 -0
  204. /package/api/resources/{bulkSync/resources/executions/client/requests → identity/client}/index.js +0 -0
  205. /package/api/resources/{events/client/requests/EventsApiV2GetEventsRequest.js → modelSync/client/requests/ModelSyncGetSourceRequest.js} +0 -0
  206. /package/{dist/api/resources/bulkSync/resources/executions/client/requests/StartBulkSyncRequest.js → api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js} +0 -0
  207. /package/{dist/api/resources/connections/client/requests/ConnectionsGetTargetRequest.js → api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.js} +0 -0
  208. /package/{dist/api/resources/connections/client/requests/ModelFieldsRequest.js → api/types/ApiError.js} +0 -0
  209. /package/{dist/api/resources/connections/client/requests/TargetRequest.js → api/types/GetModelSyncSourceMetaEnvelope.js} +0 -0
  210. /package/{dist/api/resources/events/client/requests/EventsApiV2GetEventsRequest.js → api/types/ModelSyncSourceMetaResponse.js} +0 -0
  211. /package/dist/api/resources/{bulkSync/resources/executions/client/requests → identity/client}/index.js +0 -0
@@ -45,11 +45,12 @@ const Polytomic = __importStar(require("../../.."));
45
45
  const url_join_1 = __importDefault(require("url-join"));
46
46
  const errors = __importStar(require("../../../../errors"));
47
47
  class Connections {
48
- constructor(_options = {}) {
48
+ constructor(_options) {
49
49
  this._options = _options;
50
50
  }
51
51
  /**
52
52
  * @throws {@link Polytomic.UnauthorizedError}
53
+ * @throws {@link Polytomic.InternalServerError}
53
54
  *
54
55
  * @example
55
56
  * await polytomic.connections.getTypes()
@@ -62,12 +63,10 @@ class Connections {
62
63
  method: "GET",
63
64
  headers: {
64
65
  Authorization: yield this._getAuthorizationHeader(),
65
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
66
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
67
- : undefined,
66
+ "X-Polytomic-Version": "2024-02-08",
68
67
  "X-Fern-Language": "JavaScript",
69
68
  "X-Fern-SDK-Name": "polytomic",
70
- "X-Fern-SDK-Version": "0.1.2",
69
+ "X-Fern-SDK-Version": "1.0.0",
71
70
  "X-Fern-Runtime": core.RUNTIME.type,
72
71
  "X-Fern-Runtime-Version": core.RUNTIME.version,
73
72
  },
@@ -82,6 +81,8 @@ class Connections {
82
81
  switch (_response.error.statusCode) {
83
82
  case 401:
84
83
  throw new Polytomic.UnauthorizedError(_response.error.body);
84
+ case 500:
85
+ throw new Polytomic.InternalServerError(_response.error.body);
85
86
  default:
86
87
  throw new errors.PolytomicError({
87
88
  statusCode: _response.error.statusCode,
@@ -106,6 +107,7 @@ class Connections {
106
107
  }
107
108
  /**
108
109
  * @throws {@link Polytomic.UnauthorizedError}
110
+ * @throws {@link Polytomic.InternalServerError}
109
111
  *
110
112
  * @example
111
113
  * await polytomic.connections.list()
@@ -118,12 +120,10 @@ class Connections {
118
120
  method: "GET",
119
121
  headers: {
120
122
  Authorization: yield this._getAuthorizationHeader(),
121
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
122
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
123
- : undefined,
123
+ "X-Polytomic-Version": "2024-02-08",
124
124
  "X-Fern-Language": "JavaScript",
125
125
  "X-Fern-SDK-Name": "polytomic",
126
- "X-Fern-SDK-Version": "0.1.2",
126
+ "X-Fern-SDK-Version": "1.0.0",
127
127
  "X-Fern-Runtime": core.RUNTIME.type,
128
128
  "X-Fern-Runtime-Version": core.RUNTIME.version,
129
129
  },
@@ -138,6 +138,8 @@ class Connections {
138
138
  switch (_response.error.statusCode) {
139
139
  case 401:
140
140
  throw new Polytomic.UnauthorizedError(_response.error.body);
141
+ case 500:
142
+ throw new Polytomic.InternalServerError(_response.error.body);
141
143
  default:
142
144
  throw new errors.PolytomicError({
143
145
  statusCode: _response.error.statusCode,
@@ -161,14 +163,16 @@ class Connections {
161
163
  });
162
164
  }
163
165
  /**
166
+ * @throws {@link Polytomic.BadRequestError}
164
167
  * @throws {@link Polytomic.UnauthorizedError}
168
+ * @throws {@link Polytomic.ForbiddenError}
169
+ * @throws {@link Polytomic.UnprocessableEntityError}
170
+ * @throws {@link Polytomic.InternalServerError}
165
171
  *
166
172
  * @example
167
173
  * await polytomic.connections.create({
168
- * name: "My Connection",
169
- * redirect_url: "https://example.com/oauth_redirect",
170
- * type: "s3",
171
- * validate: true
174
+ * name: "My Postgres Connection",
175
+ * type: "postgresql"
172
176
  * })
173
177
  */
174
178
  create(request, requestOptions) {
@@ -179,12 +183,10 @@ class Connections {
179
183
  method: "POST",
180
184
  headers: {
181
185
  Authorization: yield this._getAuthorizationHeader(),
182
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
183
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
184
- : undefined,
186
+ "X-Polytomic-Version": "2024-02-08",
185
187
  "X-Fern-Language": "JavaScript",
186
188
  "X-Fern-SDK-Name": "polytomic",
187
- "X-Fern-SDK-Version": "0.1.2",
189
+ "X-Fern-SDK-Version": "1.0.0",
188
190
  "X-Fern-Runtime": core.RUNTIME.type,
189
191
  "X-Fern-Runtime-Version": core.RUNTIME.version,
190
192
  },
@@ -198,8 +200,16 @@ class Connections {
198
200
  }
199
201
  if (_response.error.reason === "status-code") {
200
202
  switch (_response.error.statusCode) {
203
+ case 400:
204
+ throw new Polytomic.BadRequestError(_response.error.body);
201
205
  case 401:
202
206
  throw new Polytomic.UnauthorizedError(_response.error.body);
207
+ case 403:
208
+ throw new Polytomic.ForbiddenError(_response.error.body);
209
+ case 422:
210
+ throw new Polytomic.UnprocessableEntityError(_response.error.body);
211
+ case 500:
212
+ throw new Polytomic.InternalServerError(_response.error.body);
203
213
  default:
204
214
  throw new errors.PolytomicError({
205
215
  statusCode: _response.error.statusCode,
@@ -222,75 +232,35 @@ class Connections {
222
232
  }
223
233
  });
224
234
  }
225
- connect(requestOptions) {
226
- var _a;
227
- return __awaiter(this, void 0, void 0, function* () {
228
- const _response = yield core.fetcher({
229
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/connections/connect"),
230
- method: "POST",
231
- headers: {
232
- Authorization: yield this._getAuthorizationHeader(),
233
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
234
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
235
- : undefined,
236
- "X-Fern-Language": "JavaScript",
237
- "X-Fern-SDK-Name": "polytomic",
238
- "X-Fern-SDK-Version": "0.1.2",
239
- "X-Fern-Runtime": core.RUNTIME.type,
240
- "X-Fern-Runtime-Version": core.RUNTIME.version,
241
- },
242
- contentType: "application/json",
243
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
244
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
245
- });
246
- if (_response.ok) {
247
- return;
248
- }
249
- if (_response.error.reason === "status-code") {
250
- throw new errors.PolytomicError({
251
- statusCode: _response.error.statusCode,
252
- body: _response.error.body,
253
- });
254
- }
255
- switch (_response.error.reason) {
256
- case "non-json":
257
- throw new errors.PolytomicError({
258
- statusCode: _response.error.statusCode,
259
- body: _response.error.rawBody,
260
- });
261
- case "timeout":
262
- throw new errors.PolytomicTimeoutError();
263
- case "unknown":
264
- throw new errors.PolytomicError({
265
- message: _response.error.errorMessage,
266
- });
267
- }
268
- });
269
- }
270
235
  /**
271
236
  * @throws {@link Polytomic.UnauthorizedError}
237
+ * @throws {@link Polytomic.ForbiddenError}
238
+ * @throws {@link Polytomic.UnprocessableEntityError}
239
+ * @throws {@link Polytomic.InternalServerError}
272
240
  *
273
241
  * @example
274
- * await polytomic.connections.get("248df4b7-aa70-47b8-a036-33ac447e668d")
242
+ * await polytomic.connections.connect({
243
+ * name: "Salesforce Connection",
244
+ * redirect_url: "redirect_url"
245
+ * })
275
246
  */
276
- get(id, requestOptions) {
247
+ connect(request, requestOptions) {
277
248
  var _a;
278
249
  return __awaiter(this, void 0, void 0, function* () {
279
250
  const _response = yield core.fetcher({
280
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}`),
281
- method: "GET",
251
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/connections/connect/"),
252
+ method: "POST",
282
253
  headers: {
283
254
  Authorization: yield this._getAuthorizationHeader(),
284
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
285
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
286
- : undefined,
255
+ "X-Polytomic-Version": "2024-02-08",
287
256
  "X-Fern-Language": "JavaScript",
288
257
  "X-Fern-SDK-Name": "polytomic",
289
- "X-Fern-SDK-Version": "0.1.2",
258
+ "X-Fern-SDK-Version": "1.0.0",
290
259
  "X-Fern-Runtime": core.RUNTIME.type,
291
260
  "X-Fern-Runtime-Version": core.RUNTIME.version,
292
261
  },
293
262
  contentType: "application/json",
263
+ body: request,
294
264
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
295
265
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
296
266
  });
@@ -301,6 +271,12 @@ class Connections {
301
271
  switch (_response.error.statusCode) {
302
272
  case 401:
303
273
  throw new Polytomic.UnauthorizedError(_response.error.body);
274
+ case 403:
275
+ throw new Polytomic.ForbiddenError(_response.error.body);
276
+ case 422:
277
+ throw new Polytomic.UnprocessableEntityError(_response.error.body);
278
+ case 500:
279
+ throw new Polytomic.InternalServerError(_response.error.body);
304
280
  default:
305
281
  throw new errors.PolytomicError({
306
282
  statusCode: _response.error.statusCode,
@@ -325,46 +301,42 @@ class Connections {
325
301
  }
326
302
  /**
327
303
  * @throws {@link Polytomic.UnauthorizedError}
304
+ * @throws {@link Polytomic.NotFoundError}
305
+ * @throws {@link Polytomic.InternalServerError}
328
306
  *
329
307
  * @example
330
- * await polytomic.connections.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {
331
- * force: true
332
- * })
308
+ * await polytomic.connections.get("248df4b7-aa70-47b8-a036-33ac447e668d")
333
309
  */
334
- remove(id, request = {}, requestOptions) {
310
+ get(id, requestOptions) {
335
311
  var _a;
336
312
  return __awaiter(this, void 0, void 0, function* () {
337
- const { force } = request;
338
- const _queryParams = {};
339
- if (force != null) {
340
- _queryParams["force"] = force.toString();
341
- }
342
313
  const _response = yield core.fetcher({
343
314
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}`),
344
- method: "DELETE",
315
+ method: "GET",
345
316
  headers: {
346
317
  Authorization: yield this._getAuthorizationHeader(),
347
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
348
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
349
- : undefined,
318
+ "X-Polytomic-Version": "2024-02-08",
350
319
  "X-Fern-Language": "JavaScript",
351
320
  "X-Fern-SDK-Name": "polytomic",
352
- "X-Fern-SDK-Version": "0.1.2",
321
+ "X-Fern-SDK-Version": "1.0.0",
353
322
  "X-Fern-Runtime": core.RUNTIME.type,
354
323
  "X-Fern-Runtime-Version": core.RUNTIME.version,
355
324
  },
356
325
  contentType: "application/json",
357
- queryParameters: _queryParams,
358
326
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
359
327
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
360
328
  });
361
329
  if (_response.ok) {
362
- return;
330
+ return _response.body;
363
331
  }
364
332
  if (_response.error.reason === "status-code") {
365
333
  switch (_response.error.statusCode) {
366
334
  case 401:
367
335
  throw new Polytomic.UnauthorizedError(_response.error.body);
336
+ case 404:
337
+ throw new Polytomic.NotFoundError(_response.error.body);
338
+ case 500:
339
+ throw new Polytomic.InternalServerError(_response.error.body);
368
340
  default:
369
341
  throw new errors.PolytomicError({
370
342
  statusCode: _response.error.statusCode,
@@ -388,14 +360,16 @@ class Connections {
388
360
  });
389
361
  }
390
362
  /**
363
+ * @throws {@link Polytomic.BadRequestError}
391
364
  * @throws {@link Polytomic.UnauthorizedError}
365
+ * @throws {@link Polytomic.ForbiddenError}
366
+ * @throws {@link Polytomic.NotFoundError}
367
+ * @throws {@link Polytomic.UnprocessableEntityError}
368
+ * @throws {@link Polytomic.InternalServerError}
392
369
  *
393
370
  * @example
394
371
  * await polytomic.connections.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
395
- * name: "My Connection",
396
- * reconnect: false,
397
- * type: "s3",
398
- * validate: true
372
+ * name: "My Postgres Connection"
399
373
  * })
400
374
  */
401
375
  update(id, request, requestOptions) {
@@ -403,15 +377,13 @@ class Connections {
403
377
  return __awaiter(this, void 0, void 0, function* () {
404
378
  const _response = yield core.fetcher({
405
379
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}`),
406
- method: "PATCH",
380
+ method: "PUT",
407
381
  headers: {
408
382
  Authorization: yield this._getAuthorizationHeader(),
409
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
410
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
411
- : undefined,
383
+ "X-Polytomic-Version": "2024-02-08",
412
384
  "X-Fern-Language": "JavaScript",
413
385
  "X-Fern-SDK-Name": "polytomic",
414
- "X-Fern-SDK-Version": "0.1.2",
386
+ "X-Fern-SDK-Version": "1.0.0",
415
387
  "X-Fern-Runtime": core.RUNTIME.type,
416
388
  "X-Fern-Runtime-Version": core.RUNTIME.version,
417
389
  },
@@ -425,8 +397,18 @@ class Connections {
425
397
  }
426
398
  if (_response.error.reason === "status-code") {
427
399
  switch (_response.error.statusCode) {
400
+ case 400:
401
+ throw new Polytomic.BadRequestError(_response.error.body);
428
402
  case 401:
429
403
  throw new Polytomic.UnauthorizedError(_response.error.body);
404
+ case 403:
405
+ throw new Polytomic.ForbiddenError(_response.error.body);
406
+ case 404:
407
+ throw new Polytomic.NotFoundError(_response.error.body);
408
+ case 422:
409
+ throw new Polytomic.UnprocessableEntityError(_response.error.body);
410
+ case 500:
411
+ throw new Polytomic.InternalServerError(_response.error.body);
430
412
  default:
431
413
  throw new errors.PolytomicError({
432
414
  statusCode: _response.error.statusCode,
@@ -451,204 +433,33 @@ class Connections {
451
433
  }
452
434
  /**
453
435
  * @throws {@link Polytomic.UnauthorizedError}
436
+ * @throws {@link Polytomic.ForbiddenError}
437
+ * @throws {@link Polytomic.NotFoundError}
438
+ * @throws {@link Polytomic.UnprocessableEntityError}
439
+ * @throws {@link Polytomic.InternalServerError}
454
440
  *
455
441
  * @example
456
- * await polytomic.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668d")
457
- */
458
- getParameterValues(id, requestOptions) {
459
- var _a;
460
- return __awaiter(this, void 0, void 0, function* () {
461
- const _response = yield core.fetcher({
462
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}/parameter_values`),
463
- method: "GET",
464
- headers: {
465
- Authorization: yield this._getAuthorizationHeader(),
466
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
467
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
468
- : undefined,
469
- "X-Fern-Language": "JavaScript",
470
- "X-Fern-SDK-Name": "polytomic",
471
- "X-Fern-SDK-Version": "0.1.2",
472
- "X-Fern-Runtime": core.RUNTIME.type,
473
- "X-Fern-Runtime-Version": core.RUNTIME.version,
474
- },
475
- contentType: "application/json",
476
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
477
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
478
- });
479
- if (_response.ok) {
480
- return _response.body;
481
- }
482
- if (_response.error.reason === "status-code") {
483
- switch (_response.error.statusCode) {
484
- case 401:
485
- throw new Polytomic.UnauthorizedError(_response.error.body);
486
- default:
487
- throw new errors.PolytomicError({
488
- statusCode: _response.error.statusCode,
489
- body: _response.error.body,
490
- });
491
- }
492
- }
493
- switch (_response.error.reason) {
494
- case "non-json":
495
- throw new errors.PolytomicError({
496
- statusCode: _response.error.statusCode,
497
- body: _response.error.rawBody,
498
- });
499
- case "timeout":
500
- throw new errors.PolytomicTimeoutError();
501
- case "unknown":
502
- throw new errors.PolytomicError({
503
- message: _response.error.errorMessage,
504
- });
505
- }
506
- });
507
- }
508
- /**
509
- * @throws {@link Polytomic.UnauthorizedError}
510
- *
511
- * @example
512
- * await polytomic.connections.getSource("248df4b7-aa70-47b8-a036-33ac447e668d")
513
- */
514
- getSource(id, requestOptions) {
515
- var _a;
516
- return __awaiter(this, void 0, void 0, function* () {
517
- const _response = yield core.fetcher({
518
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}/source`),
519
- method: "GET",
520
- headers: {
521
- Authorization: yield this._getAuthorizationHeader(),
522
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
523
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
524
- : undefined,
525
- "X-Fern-Language": "JavaScript",
526
- "X-Fern-SDK-Name": "polytomic",
527
- "X-Fern-SDK-Version": "0.1.2",
528
- "X-Fern-Runtime": core.RUNTIME.type,
529
- "X-Fern-Runtime-Version": core.RUNTIME.version,
530
- },
531
- contentType: "application/json",
532
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
533
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
534
- });
535
- if (_response.ok) {
536
- return _response.body;
537
- }
538
- if (_response.error.reason === "status-code") {
539
- switch (_response.error.statusCode) {
540
- case 401:
541
- throw new Polytomic.UnauthorizedError(_response.error.body);
542
- default:
543
- throw new errors.PolytomicError({
544
- statusCode: _response.error.statusCode,
545
- body: _response.error.body,
546
- });
547
- }
548
- }
549
- switch (_response.error.reason) {
550
- case "non-json":
551
- throw new errors.PolytomicError({
552
- statusCode: _response.error.statusCode,
553
- body: _response.error.rawBody,
554
- });
555
- case "timeout":
556
- throw new errors.PolytomicTimeoutError();
557
- case "unknown":
558
- throw new errors.PolytomicError({
559
- message: _response.error.errorMessage,
560
- });
561
- }
562
- });
563
- }
564
- /**
565
- * @throws {@link Polytomic.UnauthorizedError}
566
- *
567
- * @example
568
- * await polytomic.connections.getSourceFields("248df4b7-aa70-47b8-a036-33ac447e668d", {})
569
- */
570
- getSourceFields(id, request = {}, requestOptions) {
571
- var _a;
572
- return __awaiter(this, void 0, void 0, function* () {
573
- const _response = yield core.fetcher({
574
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}/source/fields`),
575
- method: "POST",
576
- headers: {
577
- Authorization: yield this._getAuthorizationHeader(),
578
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
579
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
580
- : undefined,
581
- "X-Fern-Language": "JavaScript",
582
- "X-Fern-SDK-Name": "polytomic",
583
- "X-Fern-SDK-Version": "0.1.2",
584
- "X-Fern-Runtime": core.RUNTIME.type,
585
- "X-Fern-Runtime-Version": core.RUNTIME.version,
586
- },
587
- contentType: "application/json",
588
- body: request,
589
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
590
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
591
- });
592
- if (_response.ok) {
593
- return _response.body;
594
- }
595
- if (_response.error.reason === "status-code") {
596
- switch (_response.error.statusCode) {
597
- case 401:
598
- throw new Polytomic.UnauthorizedError(_response.error.body);
599
- default:
600
- throw new errors.PolytomicError({
601
- statusCode: _response.error.statusCode,
602
- body: _response.error.body,
603
- });
604
- }
605
- }
606
- switch (_response.error.reason) {
607
- case "non-json":
608
- throw new errors.PolytomicError({
609
- statusCode: _response.error.statusCode,
610
- body: _response.error.rawBody,
611
- });
612
- case "timeout":
613
- throw new errors.PolytomicTimeoutError();
614
- case "unknown":
615
- throw new errors.PolytomicError({
616
- message: _response.error.errorMessage,
617
- });
618
- }
619
- });
620
- }
621
- /**
622
- * @throws {@link Polytomic.UnauthorizedError}
623
- *
624
- * @example
625
- * await polytomic.connections.getTarget("248df4b7-aa70-47b8-a036-33ac447e668d", {
626
- * type: "table",
627
- * search: "public.users"
442
+ * await polytomic.connections.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {
443
+ * force: true
628
444
  * })
629
445
  */
630
- getTarget(id, request = {}, requestOptions) {
446
+ remove(id, request = {}, requestOptions) {
631
447
  var _a;
632
448
  return __awaiter(this, void 0, void 0, function* () {
633
- const { type: type_, search } = request;
449
+ const { force } = request;
634
450
  const _queryParams = {};
635
- if (type_ != null) {
636
- _queryParams["type"] = type_;
637
- }
638
- if (search != null) {
639
- _queryParams["search"] = search;
451
+ if (force != null) {
452
+ _queryParams["force"] = force.toString();
640
453
  }
641
454
  const _response = yield core.fetcher({
642
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}/target`),
643
- method: "GET",
455
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}`),
456
+ method: "DELETE",
644
457
  headers: {
645
458
  Authorization: yield this._getAuthorizationHeader(),
646
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
647
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
648
- : undefined,
459
+ "X-Polytomic-Version": "2024-02-08",
649
460
  "X-Fern-Language": "JavaScript",
650
461
  "X-Fern-SDK-Name": "polytomic",
651
- "X-Fern-SDK-Version": "0.1.2",
462
+ "X-Fern-SDK-Version": "1.0.0",
652
463
  "X-Fern-Runtime": core.RUNTIME.type,
653
464
  "X-Fern-Runtime-Version": core.RUNTIME.version,
654
465
  },
@@ -658,12 +469,20 @@ class Connections {
658
469
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
659
470
  });
660
471
  if (_response.ok) {
661
- return _response.body;
472
+ return;
662
473
  }
663
474
  if (_response.error.reason === "status-code") {
664
475
  switch (_response.error.statusCode) {
665
476
  case 401:
666
477
  throw new Polytomic.UnauthorizedError(_response.error.body);
478
+ case 403:
479
+ throw new Polytomic.ForbiddenError(_response.error.body);
480
+ case 404:
481
+ throw new Polytomic.NotFoundError(_response.error.body);
482
+ case 422:
483
+ throw new Polytomic.UnprocessableEntityError(_response.error.body);
484
+ case 500:
485
+ throw new Polytomic.InternalServerError(_response.error.body);
667
486
  default:
668
487
  throw new errors.PolytomicError({
669
488
  statusCode: _response.error.statusCode,
@@ -688,32 +507,28 @@ class Connections {
688
507
  }
689
508
  /**
690
509
  * @throws {@link Polytomic.UnauthorizedError}
510
+ * @throws {@link Polytomic.NotFoundError}
511
+ * @throws {@link Polytomic.InternalServerError}
691
512
  *
692
513
  * @example
693
- * await polytomic.connections.getTargetFields("248df4b7-aa70-47b8-a036-33ac447e668d", {
694
- * refresh: false,
695
- * target: "database.table"
696
- * })
514
+ * await polytomic.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668d")
697
515
  */
698
- getTargetFields(id, request, requestOptions) {
516
+ getParameterValues(id, requestOptions) {
699
517
  var _a;
700
518
  return __awaiter(this, void 0, void 0, function* () {
701
519
  const _response = yield core.fetcher({
702
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}/target/fields`),
703
- method: "POST",
520
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/connections/${id}/parameter_values`),
521
+ method: "GET",
704
522
  headers: {
705
523
  Authorization: yield this._getAuthorizationHeader(),
706
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
707
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
708
- : undefined,
524
+ "X-Polytomic-Version": "2024-02-08",
709
525
  "X-Fern-Language": "JavaScript",
710
526
  "X-Fern-SDK-Name": "polytomic",
711
- "X-Fern-SDK-Version": "0.1.2",
527
+ "X-Fern-SDK-Version": "1.0.0",
712
528
  "X-Fern-Runtime": core.RUNTIME.type,
713
529
  "X-Fern-Runtime-Version": core.RUNTIME.version,
714
530
  },
715
531
  contentType: "application/json",
716
- body: request,
717
532
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
718
533
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
719
534
  });
@@ -724,6 +539,10 @@ class Connections {
724
539
  switch (_response.error.statusCode) {
725
540
  case 401:
726
541
  throw new Polytomic.UnauthorizedError(_response.error.body);
542
+ case 404:
543
+ throw new Polytomic.NotFoundError(_response.error.body);
544
+ case 500:
545
+ throw new Polytomic.InternalServerError(_response.error.body);
727
546
  default:
728
547
  throw new errors.PolytomicError({
729
548
  statusCode: _response.error.statusCode,
@@ -748,11 +567,7 @@ class Connections {
748
567
  }
749
568
  _getAuthorizationHeader() {
750
569
  return __awaiter(this, void 0, void 0, function* () {
751
- const bearer = yield core.Supplier.get(this._options.token);
752
- if (bearer != null) {
753
- return `Bearer ${bearer}`;
754
- }
755
- return undefined;
570
+ return `Bearer ${yield core.Supplier.get(this._options.token)}`;
756
571
  });
757
572
  }
758
573
  }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * name: "Salesforce Connection",
8
+ * redirect_url: "redirect_url"
9
+ * }
10
+ */
11
+ export interface ConnectCardRequest {
12
+ connection?: string;
13
+ name: string;
14
+ organization_id?: string;
15
+ redirect_url: string;
16
+ type?: string;
17
+ whitelist?: string[];
18
+ }