@squadbase/connectors 0.0.13 → 0.0.14

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.
@@ -0,0 +1,212 @@
1
+ // src/parameter-definition.ts
2
+ var ParameterDefinition = class {
3
+ slug;
4
+ name;
5
+ description;
6
+ envVarBaseKey;
7
+ type;
8
+ secret;
9
+ required;
10
+ constructor(config) {
11
+ this.slug = config.slug;
12
+ this.name = config.name;
13
+ this.description = config.description;
14
+ this.envVarBaseKey = config.envVarBaseKey;
15
+ this.type = config.type;
16
+ this.secret = config.secret;
17
+ this.required = config.required;
18
+ }
19
+ /**
20
+ * Get the parameter value from a ConnectorConnectionObject.
21
+ */
22
+ getValue(connection) {
23
+ const param = connection.parameters.find(
24
+ (p) => p.parameterSlug === this.slug
25
+ );
26
+ if (!param || param.value == null) {
27
+ throw new Error(
28
+ `Parameter "${this.slug}" not found or has no value in connection "${connection.id}"`
29
+ );
30
+ }
31
+ return param.value;
32
+ }
33
+ /**
34
+ * Try to get the parameter value. Returns undefined if not found (for optional params).
35
+ */
36
+ tryGetValue(connection) {
37
+ const param = connection.parameters.find(
38
+ (p) => p.parameterSlug === this.slug
39
+ );
40
+ if (!param || param.value == null) return void 0;
41
+ return param.value;
42
+ }
43
+ };
44
+
45
+ // src/connectors/airtable/parameters.ts
46
+ var parameters = {
47
+ baseId: new ParameterDefinition({
48
+ slug: "base-id",
49
+ name: "Airtable Base ID",
50
+ description: "The Airtable Base ID (e.g., appXXXXXXXXXXXXXX).",
51
+ envVarBaseKey: "AIRTABLE_BASE_ID",
52
+ type: "text",
53
+ secret: false,
54
+ required: true
55
+ }),
56
+ apiKey: new ParameterDefinition({
57
+ slug: "api-key",
58
+ name: "Airtable API Key",
59
+ description: "The Airtable API key or Personal Access Token for authentication. Required scopes: schema.bases:read, data.records:read.",
60
+ envVarBaseKey: "AIRTABLE_API_KEY",
61
+ type: "text",
62
+ secret: true,
63
+ required: true
64
+ })
65
+ };
66
+
67
+ // src/connectors/google-analytics/parameters.ts
68
+ var parameters2 = {
69
+ serviceAccountKeyJsonBase64: new ParameterDefinition({
70
+ slug: "service-account-key-json-base64",
71
+ name: "Google Cloud Service Account JSON",
72
+ description: "The service account JSON key used to authenticate with Google Cloud Platform. Ensure that the service account has the necessary permissions to access Google Analytics.",
73
+ envVarBaseKey: "GA_SERVICE_ACCOUNT_JSON_BASE64",
74
+ type: "base64EncodedJson",
75
+ secret: true,
76
+ required: true
77
+ }),
78
+ propertyId: new ParameterDefinition({
79
+ slug: "property-id",
80
+ name: "Google Analytics Property ID",
81
+ description: "The Google Analytics 4 property ID (e.g., 123456789).",
82
+ envVarBaseKey: "GA_PROPERTY_ID",
83
+ type: "text",
84
+ secret: false,
85
+ required: true
86
+ })
87
+ };
88
+
89
+ // src/connectors/kintone/parameters.ts
90
+ var parameters3 = {
91
+ baseUrl: new ParameterDefinition({
92
+ slug: "base-url",
93
+ name: "kintone Base URL",
94
+ description: "The base URL of your kintone environment (e.g., https://example.cybozu.com).",
95
+ envVarBaseKey: "KINTONE_BASE_URL",
96
+ type: "text",
97
+ secret: false,
98
+ required: true
99
+ }),
100
+ username: new ParameterDefinition({
101
+ slug: "username",
102
+ name: "kintone Username",
103
+ description: "The username (login name) for kintone authentication.",
104
+ envVarBaseKey: "KINTONE_USERNAME",
105
+ type: "text",
106
+ secret: false,
107
+ required: true
108
+ }),
109
+ password: new ParameterDefinition({
110
+ slug: "password",
111
+ name: "kintone Password",
112
+ description: "The password for kintone authentication.",
113
+ envVarBaseKey: "KINTONE_PASSWORD",
114
+ type: "text",
115
+ secret: true,
116
+ required: true
117
+ })
118
+ };
119
+
120
+ // src/connectors/wix-store/parameters.ts
121
+ var parameters4 = {
122
+ accountId: new ParameterDefinition({
123
+ slug: "account-id",
124
+ name: "Account ID",
125
+ description: "Account ID",
126
+ envVarBaseKey: "WIX_ACCOUNT_ID",
127
+ type: "text",
128
+ secret: false,
129
+ required: true
130
+ }),
131
+ siteId: new ParameterDefinition({
132
+ slug: "site-id",
133
+ name: "Site ID",
134
+ description: "Site ID for Wix Store Project",
135
+ envVarBaseKey: "WIX_SITE_ID",
136
+ type: "text",
137
+ secret: false,
138
+ required: true
139
+ }),
140
+ apiKey: new ParameterDefinition({
141
+ slug: "api-key",
142
+ name: "API Key",
143
+ description: "API Key to access the Wix store project",
144
+ envVarBaseKey: "WIX_API_KEY",
145
+ type: "text",
146
+ secret: true,
147
+ required: true
148
+ })
149
+ };
150
+
151
+ // src/connectors/dbt/parameters.ts
152
+ var parameters5 = {
153
+ host: new ParameterDefinition({
154
+ slug: "host",
155
+ name: "dbt Cloud Host",
156
+ description: "The dbt Cloud host URL (e.g., cloud.getdbt.com).",
157
+ envVarBaseKey: "DBT_HOST",
158
+ type: "text",
159
+ secret: false,
160
+ required: true
161
+ }),
162
+ accountId: new ParameterDefinition({
163
+ slug: "account-id",
164
+ name: "dbt Account ID",
165
+ description: "The dbt Cloud account ID.",
166
+ envVarBaseKey: "DBT_ACCOUNT_ID",
167
+ type: "text",
168
+ secret: false,
169
+ required: true
170
+ }),
171
+ prodEnvId: new ParameterDefinition({
172
+ slug: "prod-env-id",
173
+ name: "dbt Production Environment ID",
174
+ description: "The dbt Cloud production environment ID.",
175
+ envVarBaseKey: "DBT_PROD_ENV_ID",
176
+ type: "text",
177
+ secret: false,
178
+ required: true
179
+ }),
180
+ token: new ParameterDefinition({
181
+ slug: "token",
182
+ name: "dbt API Token",
183
+ description: "The API token for authenticating with dbt Cloud.",
184
+ envVarBaseKey: "DBT_TOKEN",
185
+ type: "text",
186
+ secret: true,
187
+ required: true
188
+ })
189
+ };
190
+
191
+ // src/connectors/openai/parameters.ts
192
+ var parameters6 = {
193
+ apiKey: new ParameterDefinition({
194
+ slug: "api-key",
195
+ name: "OpenAI API Key",
196
+ description: "The OpenAI API key for authentication (starts with sk-).",
197
+ envVarBaseKey: "OPENAI_API_KEY",
198
+ type: "text",
199
+ secret: true,
200
+ required: true
201
+ })
202
+ };
203
+
204
+ export {
205
+ ParameterDefinition,
206
+ parameters,
207
+ parameters2,
208
+ parameters3,
209
+ parameters4,
210
+ parameters5,
211
+ parameters6
212
+ };