Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
456 changes: 456 additions & 0 deletions src/providers/cartes/actions.ts

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions src/providers/cartes/definition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { ProviderDefinition } from "../../core/types.ts";

import { cartesActions } from "./actions.ts";

const service = "cartes";

export const provider: ProviderDefinition = {
service,
displayName: "Cartes.io",
categories: ["Data", "Developer Tools"],
authTypes: ["api_key"],
auth: [
{
type: "api_key",
label: "API Token",
placeholder: "CARTES_IO_API_TOKEN",
description:
"Cartes.io API token sent in the Authorization header. Create or view API tokens from the Cartes.io account API token page: https://app.cartes.io/account/api-token",
},
],
homepageUrl: "https://cartes.io",
actions: cartesActions,
};
27 changes: 27 additions & 0 deletions src/providers/cartes/executors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { CredentialValidators, ProviderExecutors, ProviderProxyExecutor } from "../../core/types.ts";

import { defineApiKeyProviderExecutors, defineProviderProxy } from "../provider-runtime.ts";
import { cartesActionHandlers, cartesApiBaseUrl, validateCartesCredential } from "./runtime.ts";

const service = "cartes";

export const executors: ProviderExecutors = defineApiKeyProviderExecutors(service, cartesActionHandlers, {
skipDnsValidation: true,
});

export const proxy: ProviderProxyExecutor = defineProviderProxy({
service,
baseUrl: cartesApiBaseUrl,
auth: { type: "api_key_header", name: "Authorization" },
customizeRequest({ headers }) {
headers.set("accept", "application/json");
headers.set("content-type", "application/json");
},
skipDnsValidation: true,
});

export const credentialValidators: CredentialValidators = {
apiKey(input, { fetcher, signal }) {
return validateCartesCredential(input.apiKey, fetcher, signal);
},
};
Loading
Loading