-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack.ts
34 lines (29 loc) · 910 Bytes
/
pack.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as coda from "@codahq/packs-sdk";
import {TranslateFormula} from "./src/formulas/translate/TranslateFormula";
import {UsageFormula} from "./src/formulas/UsageFormula";
import {PlainTranslateFormula} from "./src/formulas/translate/PlainTranslateFormula";
export const pack = coda.newPack();
pack.addNetworkDomain("deepl.com");
pack.setUserAuthentication({
type: coda.AuthenticationType.CustomHeaderToken,
headerName: "Authorization",
tokenPrefix: "DeepL-Auth-Key",
postSetup: [{
type: coda.PostSetupType.SetEndpoint,
name: "SelectAccountType",
description: "Select your account type:",
getOptions: async () => [
{
display: "Free",
value: "https://api-free.deepl.com/v2"
},
{
display: "Pro",
value: "https://api.deepl.com/v2"
}
],
}]
});
new UsageFormula().register(pack);
new TranslateFormula().register(pack);
new PlainTranslateFormula().register(pack);