@deepnote/database-integrations 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1018,15 +1018,19 @@ const apiIntegrationSchema = zod.z.object({
1018
1018
  name: zod.z.string(),
1019
1019
  type: zod.z.string(),
1020
1020
  metadata: zod.z.unknown(),
1021
- is_public: zod.z.boolean(),
1022
- created_at: zod.z.string(),
1023
- updated_at: zod.z.string(),
1024
- federated_auth_method: zod.z.string().nullable()
1021
+ is_public: zod.z.boolean().nullish(),
1022
+ created_at: zod.z.string().nullish(),
1023
+ updated_at: zod.z.string().nullish(),
1024
+ federated_auth_method: zod.z.string().nullish()
1025
1025
  }).passthrough();
1026
1026
  /**
1027
1027
  * Schema for the full API response.
1028
1028
  */
1029
1029
  const apiResponseSchema = zod.z.object({ integrations: zod.z.array(apiIntegrationSchema) }).passthrough();
1030
+ const REQUEST_TIMEOUT_MS = 3e4;
1031
+ function trimTrailingSlash(url) {
1032
+ return url.replace(/\/+$/, "");
1033
+ }
1030
1034
  /**
1031
1035
  * Fetch integrations from the Deepnote API.
1032
1036
  *
@@ -1039,7 +1043,7 @@ const apiResponseSchema = zod.z.object({ integrations: zod.z.array(apiIntegratio
1039
1043
  * @throws ApiError if the request fails
1040
1044
  */
1041
1045
  async function fetchIntegrations(baseUrl, token, integrationIds) {
1042
- const endpoint = new URL(`${baseUrl}/v2/integrations`);
1046
+ const endpoint = new URL(`${trimTrailingSlash(baseUrl)}/v2/integrations`);
1043
1047
  endpoint.searchParams.set("includeMetadata", "true");
1044
1048
  if (integrationIds && integrationIds.length > 0) endpoint.searchParams.set("integrationIds", integrationIds.join(","));
1045
1049
  const url = endpoint.toString();
@@ -1048,7 +1052,8 @@ async function fetchIntegrations(baseUrl, token, integrationIds) {
1048
1052
  headers: {
1049
1053
  Authorization: `Bearer ${token}`,
1050
1054
  "Content-Type": "application/json"
1051
- }
1055
+ },
1056
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
1052
1057
  });
1053
1058
  if (!response.ok) {
1054
1059
  if (response.status === 401) throw new ApiError(401, "Authentication failed. Please check your API token.");
@@ -1140,7 +1145,8 @@ const SECRET_PATHS = {
1140
1145
  "password",
1141
1146
  "clientSecret",
1142
1147
  "privateKey",
1143
- "privateKeyPassphrase"
1148
+ "privateKeyPassphrase",
1149
+ "dbtServiceToken"
1144
1150
  ],
1145
1151
  redshift: ["password", "caCertificateText"],
1146
1152
  trino: [
@@ -1157,7 +1163,7 @@ const SECRET_PATHS = {
1157
1163
  *
1158
1164
  * @example
1159
1165
  * getSecretFieldPaths('pgsql') // => ['password', 'caCertificateText']
1160
- * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase']
1166
+ * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase', 'dbtServiceToken']
1161
1167
  */
1162
1168
  function getSecretFieldPaths(type) {
1163
1169
  return SECRET_PATHS[type] ?? [];
package/dist/index.d.cts CHANGED
@@ -3137,28 +3137,28 @@ declare const apiIntegrationSchema: z$1.ZodObject<{
3137
3137
  name: z$1.ZodString;
3138
3138
  type: z$1.ZodString;
3139
3139
  metadata: z$1.ZodUnknown;
3140
- is_public: z$1.ZodBoolean;
3141
- created_at: z$1.ZodString;
3142
- updated_at: z$1.ZodString;
3143
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3140
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3141
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3142
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3143
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3144
3144
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3145
3145
  id: z$1.ZodString;
3146
3146
  name: z$1.ZodString;
3147
3147
  type: z$1.ZodString;
3148
3148
  metadata: z$1.ZodUnknown;
3149
- is_public: z$1.ZodBoolean;
3150
- created_at: z$1.ZodString;
3151
- updated_at: z$1.ZodString;
3152
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3149
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3150
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3151
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3152
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3153
3153
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3154
3154
  id: z$1.ZodString;
3155
3155
  name: z$1.ZodString;
3156
3156
  type: z$1.ZodString;
3157
3157
  metadata: z$1.ZodUnknown;
3158
- is_public: z$1.ZodBoolean;
3159
- created_at: z$1.ZodString;
3160
- updated_at: z$1.ZodString;
3161
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3158
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3159
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3160
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3161
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3162
3162
  }, z$1.ZodTypeAny, "passthrough">>;
3163
3163
  type ApiIntegration = z$1.infer<typeof apiIntegrationSchema>;
3164
3164
  /**
@@ -3170,28 +3170,28 @@ declare const apiResponseSchema: z$1.ZodObject<{
3170
3170
  name: z$1.ZodString;
3171
3171
  type: z$1.ZodString;
3172
3172
  metadata: z$1.ZodUnknown;
3173
- is_public: z$1.ZodBoolean;
3174
- created_at: z$1.ZodString;
3175
- updated_at: z$1.ZodString;
3176
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3173
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3174
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3175
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3176
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3177
3177
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3178
3178
  id: z$1.ZodString;
3179
3179
  name: z$1.ZodString;
3180
3180
  type: z$1.ZodString;
3181
3181
  metadata: z$1.ZodUnknown;
3182
- is_public: z$1.ZodBoolean;
3183
- created_at: z$1.ZodString;
3184
- updated_at: z$1.ZodString;
3185
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3182
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3183
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3184
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3185
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3186
3186
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3187
3187
  id: z$1.ZodString;
3188
3188
  name: z$1.ZodString;
3189
3189
  type: z$1.ZodString;
3190
3190
  metadata: z$1.ZodUnknown;
3191
- is_public: z$1.ZodBoolean;
3192
- created_at: z$1.ZodString;
3193
- updated_at: z$1.ZodString;
3194
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3191
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3192
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3193
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3194
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3195
3195
  }, z$1.ZodTypeAny, "passthrough">>, "many">;
3196
3196
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3197
3197
  integrations: z$1.ZodArray<z$1.ZodObject<{
@@ -3199,28 +3199,28 @@ declare const apiResponseSchema: z$1.ZodObject<{
3199
3199
  name: z$1.ZodString;
3200
3200
  type: z$1.ZodString;
3201
3201
  metadata: z$1.ZodUnknown;
3202
- is_public: z$1.ZodBoolean;
3203
- created_at: z$1.ZodString;
3204
- updated_at: z$1.ZodString;
3205
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3202
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3203
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3204
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3205
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3206
3206
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3207
3207
  id: z$1.ZodString;
3208
3208
  name: z$1.ZodString;
3209
3209
  type: z$1.ZodString;
3210
3210
  metadata: z$1.ZodUnknown;
3211
- is_public: z$1.ZodBoolean;
3212
- created_at: z$1.ZodString;
3213
- updated_at: z$1.ZodString;
3214
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3211
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3212
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3213
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3214
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3215
3215
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3216
3216
  id: z$1.ZodString;
3217
3217
  name: z$1.ZodString;
3218
3218
  type: z$1.ZodString;
3219
3219
  metadata: z$1.ZodUnknown;
3220
- is_public: z$1.ZodBoolean;
3221
- created_at: z$1.ZodString;
3222
- updated_at: z$1.ZodString;
3223
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3220
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3221
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3222
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3223
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3224
3224
  }, z$1.ZodTypeAny, "passthrough">>, "many">;
3225
3225
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3226
3226
  integrations: z$1.ZodArray<z$1.ZodObject<{
@@ -3228,28 +3228,28 @@ declare const apiResponseSchema: z$1.ZodObject<{
3228
3228
  name: z$1.ZodString;
3229
3229
  type: z$1.ZodString;
3230
3230
  metadata: z$1.ZodUnknown;
3231
- is_public: z$1.ZodBoolean;
3232
- created_at: z$1.ZodString;
3233
- updated_at: z$1.ZodString;
3234
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3231
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3232
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3233
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3234
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3235
3235
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3236
3236
  id: z$1.ZodString;
3237
3237
  name: z$1.ZodString;
3238
3238
  type: z$1.ZodString;
3239
3239
  metadata: z$1.ZodUnknown;
3240
- is_public: z$1.ZodBoolean;
3241
- created_at: z$1.ZodString;
3242
- updated_at: z$1.ZodString;
3243
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3240
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3241
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3242
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3243
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3244
3244
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3245
3245
  id: z$1.ZodString;
3246
3246
  name: z$1.ZodString;
3247
3247
  type: z$1.ZodString;
3248
3248
  metadata: z$1.ZodUnknown;
3249
- is_public: z$1.ZodBoolean;
3250
- created_at: z$1.ZodString;
3251
- updated_at: z$1.ZodString;
3252
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3249
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3250
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3251
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3252
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3253
3253
  }, z$1.ZodTypeAny, "passthrough">>, "many">;
3254
3254
  }, z$1.ZodTypeAny, "passthrough">>;
3255
3255
  type ApiResponse = z$1.infer<typeof apiResponseSchema>;
@@ -6175,7 +6175,7 @@ type MetadataKey<T extends DatabaseIntegrationType> = AllKeysOf<DatabaseIntegrat
6175
6175
  *
6176
6176
  * @example
6177
6177
  * getSecretFieldPaths('pgsql') // => ['password', 'caCertificateText']
6178
- * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase']
6178
+ * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase', 'dbtServiceToken']
6179
6179
  */
6180
6180
  declare function getSecretFieldPaths(type: DatabaseIntegrationType): readonly string[];
6181
6181
  //#endregion
package/dist/index.d.ts CHANGED
@@ -3137,28 +3137,28 @@ declare const apiIntegrationSchema: z$1.ZodObject<{
3137
3137
  name: z$1.ZodString;
3138
3138
  type: z$1.ZodString;
3139
3139
  metadata: z$1.ZodUnknown;
3140
- is_public: z$1.ZodBoolean;
3141
- created_at: z$1.ZodString;
3142
- updated_at: z$1.ZodString;
3143
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3140
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3141
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3142
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3143
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3144
3144
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3145
3145
  id: z$1.ZodString;
3146
3146
  name: z$1.ZodString;
3147
3147
  type: z$1.ZodString;
3148
3148
  metadata: z$1.ZodUnknown;
3149
- is_public: z$1.ZodBoolean;
3150
- created_at: z$1.ZodString;
3151
- updated_at: z$1.ZodString;
3152
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3149
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3150
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3151
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3152
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3153
3153
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3154
3154
  id: z$1.ZodString;
3155
3155
  name: z$1.ZodString;
3156
3156
  type: z$1.ZodString;
3157
3157
  metadata: z$1.ZodUnknown;
3158
- is_public: z$1.ZodBoolean;
3159
- created_at: z$1.ZodString;
3160
- updated_at: z$1.ZodString;
3161
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3158
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3159
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3160
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3161
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3162
3162
  }, z$1.ZodTypeAny, "passthrough">>;
3163
3163
  type ApiIntegration = z$1.infer<typeof apiIntegrationSchema>;
3164
3164
  /**
@@ -3170,28 +3170,28 @@ declare const apiResponseSchema: z$1.ZodObject<{
3170
3170
  name: z$1.ZodString;
3171
3171
  type: z$1.ZodString;
3172
3172
  metadata: z$1.ZodUnknown;
3173
- is_public: z$1.ZodBoolean;
3174
- created_at: z$1.ZodString;
3175
- updated_at: z$1.ZodString;
3176
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3173
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3174
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3175
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3176
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3177
3177
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3178
3178
  id: z$1.ZodString;
3179
3179
  name: z$1.ZodString;
3180
3180
  type: z$1.ZodString;
3181
3181
  metadata: z$1.ZodUnknown;
3182
- is_public: z$1.ZodBoolean;
3183
- created_at: z$1.ZodString;
3184
- updated_at: z$1.ZodString;
3185
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3182
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3183
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3184
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3185
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3186
3186
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3187
3187
  id: z$1.ZodString;
3188
3188
  name: z$1.ZodString;
3189
3189
  type: z$1.ZodString;
3190
3190
  metadata: z$1.ZodUnknown;
3191
- is_public: z$1.ZodBoolean;
3192
- created_at: z$1.ZodString;
3193
- updated_at: z$1.ZodString;
3194
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3191
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3192
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3193
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3194
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3195
3195
  }, z$1.ZodTypeAny, "passthrough">>, "many">;
3196
3196
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3197
3197
  integrations: z$1.ZodArray<z$1.ZodObject<{
@@ -3199,28 +3199,28 @@ declare const apiResponseSchema: z$1.ZodObject<{
3199
3199
  name: z$1.ZodString;
3200
3200
  type: z$1.ZodString;
3201
3201
  metadata: z$1.ZodUnknown;
3202
- is_public: z$1.ZodBoolean;
3203
- created_at: z$1.ZodString;
3204
- updated_at: z$1.ZodString;
3205
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3202
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3203
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3204
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3205
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3206
3206
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3207
3207
  id: z$1.ZodString;
3208
3208
  name: z$1.ZodString;
3209
3209
  type: z$1.ZodString;
3210
3210
  metadata: z$1.ZodUnknown;
3211
- is_public: z$1.ZodBoolean;
3212
- created_at: z$1.ZodString;
3213
- updated_at: z$1.ZodString;
3214
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3211
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3212
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3213
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3214
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3215
3215
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3216
3216
  id: z$1.ZodString;
3217
3217
  name: z$1.ZodString;
3218
3218
  type: z$1.ZodString;
3219
3219
  metadata: z$1.ZodUnknown;
3220
- is_public: z$1.ZodBoolean;
3221
- created_at: z$1.ZodString;
3222
- updated_at: z$1.ZodString;
3223
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3220
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3221
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3222
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3223
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3224
3224
  }, z$1.ZodTypeAny, "passthrough">>, "many">;
3225
3225
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3226
3226
  integrations: z$1.ZodArray<z$1.ZodObject<{
@@ -3228,28 +3228,28 @@ declare const apiResponseSchema: z$1.ZodObject<{
3228
3228
  name: z$1.ZodString;
3229
3229
  type: z$1.ZodString;
3230
3230
  metadata: z$1.ZodUnknown;
3231
- is_public: z$1.ZodBoolean;
3232
- created_at: z$1.ZodString;
3233
- updated_at: z$1.ZodString;
3234
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3231
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3232
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3233
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3234
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3235
3235
  }, "passthrough", z$1.ZodTypeAny, z$1.objectOutputType<{
3236
3236
  id: z$1.ZodString;
3237
3237
  name: z$1.ZodString;
3238
3238
  type: z$1.ZodString;
3239
3239
  metadata: z$1.ZodUnknown;
3240
- is_public: z$1.ZodBoolean;
3241
- created_at: z$1.ZodString;
3242
- updated_at: z$1.ZodString;
3243
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3240
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3241
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3242
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3243
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3244
3244
  }, z$1.ZodTypeAny, "passthrough">, z$1.objectInputType<{
3245
3245
  id: z$1.ZodString;
3246
3246
  name: z$1.ZodString;
3247
3247
  type: z$1.ZodString;
3248
3248
  metadata: z$1.ZodUnknown;
3249
- is_public: z$1.ZodBoolean;
3250
- created_at: z$1.ZodString;
3251
- updated_at: z$1.ZodString;
3252
- federated_auth_method: z$1.ZodNullable<z$1.ZodString>;
3249
+ is_public: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodBoolean>>;
3250
+ created_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3251
+ updated_at: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3252
+ federated_auth_method: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
3253
3253
  }, z$1.ZodTypeAny, "passthrough">>, "many">;
3254
3254
  }, z$1.ZodTypeAny, "passthrough">>;
3255
3255
  type ApiResponse = z$1.infer<typeof apiResponseSchema>;
@@ -6175,7 +6175,7 @@ type MetadataKey<T extends DatabaseIntegrationType> = AllKeysOf<DatabaseIntegrat
6175
6175
  *
6176
6176
  * @example
6177
6177
  * getSecretFieldPaths('pgsql') // => ['password', 'caCertificateText']
6178
- * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase']
6178
+ * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase', 'dbtServiceToken']
6179
6179
  */
6180
6180
  declare function getSecretFieldPaths(type: DatabaseIntegrationType): readonly string[];
6181
6181
  //#endregion
package/dist/index.js CHANGED
@@ -992,15 +992,19 @@ const apiIntegrationSchema = z$1.object({
992
992
  name: z$1.string(),
993
993
  type: z$1.string(),
994
994
  metadata: z$1.unknown(),
995
- is_public: z$1.boolean(),
996
- created_at: z$1.string(),
997
- updated_at: z$1.string(),
998
- federated_auth_method: z$1.string().nullable()
995
+ is_public: z$1.boolean().nullish(),
996
+ created_at: z$1.string().nullish(),
997
+ updated_at: z$1.string().nullish(),
998
+ federated_auth_method: z$1.string().nullish()
999
999
  }).passthrough();
1000
1000
  /**
1001
1001
  * Schema for the full API response.
1002
1002
  */
1003
1003
  const apiResponseSchema = z$1.object({ integrations: z$1.array(apiIntegrationSchema) }).passthrough();
1004
+ const REQUEST_TIMEOUT_MS = 3e4;
1005
+ function trimTrailingSlash(url) {
1006
+ return url.replace(/\/+$/, "");
1007
+ }
1004
1008
  /**
1005
1009
  * Fetch integrations from the Deepnote API.
1006
1010
  *
@@ -1013,7 +1017,7 @@ const apiResponseSchema = z$1.object({ integrations: z$1.array(apiIntegrationSch
1013
1017
  * @throws ApiError if the request fails
1014
1018
  */
1015
1019
  async function fetchIntegrations(baseUrl, token, integrationIds) {
1016
- const endpoint = new URL(`${baseUrl}/v2/integrations`);
1020
+ const endpoint = new URL(`${trimTrailingSlash(baseUrl)}/v2/integrations`);
1017
1021
  endpoint.searchParams.set("includeMetadata", "true");
1018
1022
  if (integrationIds && integrationIds.length > 0) endpoint.searchParams.set("integrationIds", integrationIds.join(","));
1019
1023
  const url = endpoint.toString();
@@ -1022,7 +1026,8 @@ async function fetchIntegrations(baseUrl, token, integrationIds) {
1022
1026
  headers: {
1023
1027
  Authorization: `Bearer ${token}`,
1024
1028
  "Content-Type": "application/json"
1025
- }
1029
+ },
1030
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
1026
1031
  });
1027
1032
  if (!response.ok) {
1028
1033
  if (response.status === 401) throw new ApiError(401, "Authentication failed. Please check your API token.");
@@ -1114,7 +1119,8 @@ const SECRET_PATHS = {
1114
1119
  "password",
1115
1120
  "clientSecret",
1116
1121
  "privateKey",
1117
- "privateKeyPassphrase"
1122
+ "privateKeyPassphrase",
1123
+ "dbtServiceToken"
1118
1124
  ],
1119
1125
  redshift: ["password", "caCertificateText"],
1120
1126
  trino: [
@@ -1131,7 +1137,7 @@ const SECRET_PATHS = {
1131
1137
  *
1132
1138
  * @example
1133
1139
  * getSecretFieldPaths('pgsql') // => ['password', 'caCertificateText']
1134
- * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase']
1140
+ * getSecretFieldPaths('snowflake') // => ['password', 'clientSecret', 'privateKey', 'privateKeyPassphrase', 'dbtServiceToken']
1135
1141
  */
1136
1142
  function getSecretFieldPaths(type) {
1137
1143
  return SECRET_PATHS[type] ?? [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnote/database-integrations",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Deepnote database integration definitions",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "yaml": "^2.8.3",
31
31
  "zod": "3.25.76",
32
- "@deepnote/blocks": "4.6.0"
32
+ "@deepnote/blocks": "4.7.0"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public",