@adminide-stack/form-builder-core 5.1.8-alpha.98 → 5.1.9-alpha.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.
- package/lib/config/cdnConfig.d.ts +7 -3
- package/lib/config/cdnConfig.d.ts.map +1 -1
- package/lib/config/cdnConfig.js +17 -7
- package/lib/config/cdnConfig.js.map +1 -1
- package/lib/config/configTypes.d.ts +84 -1
- package/lib/config/configTypes.d.ts.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/authMetaDataSchema.d.ts +99 -2
- package/lib/utils/authMetaDataSchema.d.ts.map +1 -1
- package/lib/utils/authMetaDataSchema.js +290 -33
- package/lib/utils/authMetaDataSchema.js.map +1 -1
- package/lib/utils/connectorDefaultAuthMethod.d.ts +14 -0
- package/lib/utils/connectorDefaultAuthMethod.d.ts.map +1 -0
- package/lib/utils/connectorDefaultAuthMethod.js +16 -0
- package/lib/utils/connectorDefaultAuthMethod.js.map +1 -0
- package/lib/utils/connectorOAuthRequestKnobs.d.ts +24 -0
- package/lib/utils/connectorOAuthRequestKnobs.d.ts.map +1 -0
- package/lib/utils/connectorOAuthRequestKnobs.js +30 -0
- package/lib/utils/connectorOAuthRequestKnobs.js.map +1 -0
- package/lib/utils/connectorRedirectUri.d.ts +11 -0
- package/lib/utils/connectorRedirectUri.d.ts.map +1 -0
- package/lib/utils/connectorRedirectUri.js +10 -0
- package/lib/utils/connectorRedirectUri.js.map +1 -0
- package/lib/utils/integrationCommands.d.ts +14 -0
- package/lib/utils/integrationCommands.d.ts.map +1 -1
- package/lib/utils/integrationCommands.js +123 -11
- package/lib/utils/integrationCommands.js.map +1 -1
- package/package.json +3 -4
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CDN / asset-URL configuration.
|
|
2
|
+
* CDN / asset-URL configuration for connector artwork.
|
|
3
3
|
*
|
|
4
4
|
* Connector configs store only the *path* portion
|
|
5
5
|
* (e.g. `_side/thirdparty/logos/gmail.svg`); call `iurl(path)` to get the
|
|
6
6
|
* full URL at runtime.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Logos are served from the `cde-extensions` bucket (the same CDN that fronts
|
|
9
|
+
* the connector registry and pods), *not* from the tenant upload bucket that
|
|
10
|
+
* `AWS_CDN_URL` points at. Override with the `EXTENSION_CDN_URL` env var via
|
|
11
|
+
* `setCdnBase()`; browser packages do that at init time.
|
|
10
12
|
*/
|
|
13
|
+
/** `cde-extensions` bucket CDN — the default home for connector artwork. */
|
|
14
|
+
export declare const DEFAULT_EXTENSION_CDN_BASE = "https://cdn.yantra.app";
|
|
11
15
|
/** Set the CDN base URL (typically called once from env-config). */
|
|
12
16
|
export declare function setCdnBase(base: string): void;
|
|
13
17
|
/** Get the current CDN base URL. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdnConfig.d.ts","sourceRoot":"","sources":["../../src/config/cdnConfig.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cdnConfig.d.ts","sourceRoot":"","sources":["../../src/config/cdnConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAInE,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAS7C;AAED,oCAAoC;AACpC,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED,0DAA0D;AAC1D,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOzC"}
|
package/lib/config/cdnConfig.js
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CDN / asset-URL configuration.
|
|
2
|
+
* CDN / asset-URL configuration for connector artwork.
|
|
3
3
|
*
|
|
4
4
|
* Connector configs store only the *path* portion
|
|
5
5
|
* (e.g. `_side/thirdparty/logos/gmail.svg`); call `iurl(path)` to get the
|
|
6
6
|
* full URL at runtime.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Logos are served from the `cde-extensions` bucket (the same CDN that fronts
|
|
9
|
+
* the connector registry and pods), *not* from the tenant upload bucket that
|
|
10
|
+
* `AWS_CDN_URL` points at. Override with the `EXTENSION_CDN_URL` env var via
|
|
11
|
+
* `setCdnBase()`; browser packages do that at init time.
|
|
10
12
|
*/
|
|
11
|
-
|
|
13
|
+
/** `cde-extensions` bucket CDN — the default home for connector artwork. */
|
|
14
|
+
const DEFAULT_EXTENSION_CDN_BASE = 'https://cdn.yantra.app';
|
|
15
|
+
let _cdnBase = DEFAULT_EXTENSION_CDN_BASE;
|
|
12
16
|
/** Set the CDN base URL (typically called once from env-config). */
|
|
13
17
|
function setCdnBase(base) {
|
|
14
|
-
// Strip trailing slash for consistency.
|
|
15
|
-
|
|
18
|
+
// Strip trailing slash for consistency. Empty/blank resets to the default
|
|
19
|
+
// so an unset env var can never degrade logos to host-relative 404s.
|
|
20
|
+
const trimmed = (base || '').trim();
|
|
21
|
+
if (!trimmed) {
|
|
22
|
+
_cdnBase = DEFAULT_EXTENSION_CDN_BASE;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
_cdnBase = trimmed.endsWith('/') ? trimmed.slice(0, -1) : trimmed;
|
|
16
26
|
}
|
|
17
27
|
/** Get the current CDN base URL. */
|
|
18
28
|
function getCdnBase() {
|
|
@@ -26,4 +36,4 @@ function iurl(path) {
|
|
|
26
36
|
// Strip leading slash so we don't end up with a double-slash.
|
|
27
37
|
const clean = path.startsWith('/') ? path.slice(1) : path;
|
|
28
38
|
return _cdnBase ? `${_cdnBase}/${clean}` : clean;
|
|
29
|
-
}export{getCdnBase,iurl,setCdnBase};//# sourceMappingURL=cdnConfig.js.map
|
|
39
|
+
}export{DEFAULT_EXTENSION_CDN_BASE,getCdnBase,iurl,setCdnBase};//# sourceMappingURL=cdnConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdnConfig.js","sources":["../../src/config/cdnConfig.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cdnConfig.js","sources":["../../src/config/cdnConfig.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;AAWG;AAEH;AACA,MAAA,0BAAa,GAAA;AAIb,IAAA,QAAA,GAAA,0BAAA;AACA;AAWA,SAAA,UAAA,CAAA,IAAA,EAAA;AACA;AAIA;AACA,EAAA,MAAA,OAAA,GAAA,CAAA,IAAA,MAAqB,EAAA,IAAM,EAAA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -28,7 +28,7 @@ export type FieldType = 'string' | 'number' | 'integer' | 'boolean' | 'array' |
|
|
|
28
28
|
* - Credentials: username, password, email
|
|
29
29
|
* - Display-only: info, label_info
|
|
30
30
|
*/
|
|
31
|
-
export type GenericFieldType = 'api_key' | 'api_secret' | 'api_token' | 'access_token' | 'access_key' | 'bearer_token' | 'personal_access_token' | 'bot_token' | 'private_key' | 'secret_key' | 'jwt_token' | 'auth_token' | 'data_api_key' | 'public_api_key' | 'secret_access_key' | 'app_id' | 'app_key' | 'workspace_id' | 'project_id' | 'organization_id' | 'account_id' | 'space_id' | 'site_id' | 'dataset_id' | 'client_id' | 'tenant_id' | 'campaign_id' | 'public_id' | 'public_key' | 'user_id' | 'cloud_name' | 'business_id' | 'event_id' | 'store_id' | 'bucket_name' | 'index_name' | 'database_name' | 'collection_name' | 'table_name' | 'deployment_name' | 'base_url' | 'instance_url' | 'subdomain' | 'domain' | 'region' | 'connection_string' | 'endpoint' | 'environment' | 'username' | 'password' | 'email' | 'info' | 'label_info';
|
|
31
|
+
export type GenericFieldType = 'api_key' | 'api_secret' | 'api_token' | 'access_token' | 'access_key' | 'bearer_token' | 'personal_access_token' | 'bot_token' | 'private_key' | 'private_key_passphrase' | 'bastion_private_key' | 'secret_key' | 'jwt_token' | 'auth_token' | 'data_api_key' | 'public_api_key' | 'secret_access_key' | 'app_id' | 'app_key' | 'workspace_id' | 'project_id' | 'organization_id' | 'account_id' | 'space_id' | 'site_id' | 'dataset_id' | 'client_id' | 'tenant_id' | 'campaign_id' | 'public_id' | 'public_key' | 'user_id' | 'cloud_name' | 'business_id' | 'event_id' | 'store_id' | 'bucket_name' | 'index_name' | 'database_name' | 'collection_name' | 'table_name' | 'deployment_name' | 'base_url' | 'instance_url' | 'subdomain' | 'domain' | 'region' | 'connection_string' | 'endpoint' | 'environment' | 'port' | 'host_allowlist' | 'host_fingerprint' | 'host_verification_mode' | 'auth_method' | 'agent_socket' | 'bastion_host' | 'bastion_port' | 'bastion_host_fingerprint' | 'read_only' | 'command_denylist' | 'command_quota' | 'username' | 'password' | 'email' | 'bastion_username' | 'bastion_password' | 'info' | 'label_info';
|
|
32
32
|
/**
|
|
33
33
|
* Where the field value should be placed in the HTTP request at runtime.
|
|
34
34
|
* Standard third-party placement model for HTTP request field mapping.
|
|
@@ -89,6 +89,12 @@ export interface FormFieldConfig {
|
|
|
89
89
|
/** Custom header/query-param name when placement is 'header' or 'query'. */
|
|
90
90
|
placementKey?: string;
|
|
91
91
|
scope?: ConfigurationScope;
|
|
92
|
+
/**
|
|
93
|
+
* Tucks the field under a collapsed "Advanced settings" toggle in the connector form, for
|
|
94
|
+
* values with a working default most people never change (an IMAP host or port). The
|
|
95
|
+
* section opens by itself when one of its fields fails validation.
|
|
96
|
+
*/
|
|
97
|
+
advanced?: boolean;
|
|
92
98
|
}
|
|
93
99
|
export type ResourceSourceType = 'jsCode' | 'graphql' | 'rest-api';
|
|
94
100
|
export interface GraphQLResourceConfig {
|
|
@@ -170,6 +176,21 @@ export interface MCPProviderConfig {
|
|
|
170
176
|
categories: ConnectorCategoryTuple;
|
|
171
177
|
fields?: FormFieldConfig[];
|
|
172
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Where a provider that wraps its token response in an envelope keeps the token fields and the
|
|
181
|
+
* outcome. TikTok Business answers HTTP 200 with `{ code, message, data: { access_token, ... } }`,
|
|
182
|
+
* where `code` 0 is the only success. Paths are dot paths into the response body.
|
|
183
|
+
*/
|
|
184
|
+
export interface ConnectorTokenResponseEnvelope {
|
|
185
|
+
/** Path of the object holding `access_token` and the other token fields (e.g. `data`). */
|
|
186
|
+
dataPath: string;
|
|
187
|
+
/** Path of the provider's own status (e.g. `code`). When set, only `successStatus` is a success. */
|
|
188
|
+
statusPath?: string;
|
|
189
|
+
/** The status value that means success (e.g. `0`). */
|
|
190
|
+
successStatus?: string | number;
|
|
191
|
+
/** Path of the provider's error message, reported when the status is not a success (e.g. `message`). */
|
|
192
|
+
messagePath?: string;
|
|
193
|
+
}
|
|
173
194
|
export interface ConnectorConfig {
|
|
174
195
|
id: string;
|
|
175
196
|
title: string;
|
|
@@ -194,6 +215,53 @@ export interface ConnectorConfig {
|
|
|
194
215
|
usePKCE?: boolean;
|
|
195
216
|
/** OAuth client authentication method */
|
|
196
217
|
clientAuthMethod?: 'client_secret_basic' | 'client_secret_post';
|
|
218
|
+
/**
|
|
219
|
+
* Query/body parameter name the provider expects for the client id (e.g. TikTok uses
|
|
220
|
+
* `client_key`). Applies to custom OAuth endpoints only. Defaults to `client_id`.
|
|
221
|
+
*/
|
|
222
|
+
clientIdParamName?: string;
|
|
223
|
+
/** Join scopes with commas instead of spaces in the authorization request (e.g. TikTok). */
|
|
224
|
+
useCommaSeparatedScopes?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Extra headers the provider requires on its token, refresh and revocation requests, beyond
|
|
227
|
+
* client authentication (Stripe Link: `Authorization: Bearer <publishable key>`, with the
|
|
228
|
+
* client secret still in the body). Values take the same `{{KEY}}` templates as the OAuth
|
|
229
|
+
* URLs. Custom OAuth endpoints only.
|
|
230
|
+
*/
|
|
231
|
+
tokenEndpointHeaders?: Record<string, string>;
|
|
232
|
+
/**
|
|
233
|
+
* Parameter name the provider expects for the client secret on its token request (TikTok
|
|
234
|
+
* Business uses `secret`). Custom OAuth endpoints only. Defaults to `client_secret`.
|
|
235
|
+
*/
|
|
236
|
+
clientSecretParamName?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Parameter name that carries the authorization code, on the redirect back and in the token
|
|
239
|
+
* request (TikTok Business uses `auth_code`). Custom OAuth endpoints only. Defaults to `code`.
|
|
240
|
+
*/
|
|
241
|
+
authorizationCodeParamName?: string;
|
|
242
|
+
/**
|
|
243
|
+
* How the token request body is encoded: `form` (application/x-www-form-urlencoded, the
|
|
244
|
+
* OAuth 2.0 default) or `json` (TikTok Business). Custom OAuth endpoints only.
|
|
245
|
+
*/
|
|
246
|
+
tokenRequestEncoding?: 'form' | 'json';
|
|
247
|
+
/**
|
|
248
|
+
* Standard parameters left out of the token request because the provider rejects or does not
|
|
249
|
+
* take them (TikTok Business: `grant_type`, `redirect_uri`). Custom OAuth endpoints only.
|
|
250
|
+
*/
|
|
251
|
+
tokenRequestOmitParams?: string[];
|
|
252
|
+
/**
|
|
253
|
+
* Standard parameters left out of the authorization URL (TikTok Business takes only `app_id`,
|
|
254
|
+
* `redirect_uri` and `state`). Leaving out `scope` lets a connector authorize with no scopes.
|
|
255
|
+
*/
|
|
256
|
+
authorizationOmitParams?: string[];
|
|
257
|
+
/** The provider wraps its token response in an envelope (see ConnectorTokenResponseEnvelope). */
|
|
258
|
+
tokenResponseEnvelope?: ConnectorTokenResponseEnvelope;
|
|
259
|
+
/**
|
|
260
|
+
* Non-secret token-response fields kept on the credential after the exchange (TikTok Business:
|
|
261
|
+
* `advertiser_ids`, the ad accounts the token may manage). Read from the envelope's data when
|
|
262
|
+
* an envelope is set; the credential carries them as `formData.oauthProviderData`.
|
|
263
|
+
*/
|
|
264
|
+
tokenResponseMetadataFields?: string[];
|
|
197
265
|
/** Explicit OAuth Authorization URL (if useCustomOAuthEndpoints is true) */
|
|
198
266
|
authorizationUrl?: string;
|
|
199
267
|
/** Explicit OAuth Token URL (if useCustomOAuthEndpoints is true) */
|
|
@@ -202,10 +270,25 @@ export interface ConnectorConfig {
|
|
|
202
270
|
revocationUrl?: string;
|
|
203
271
|
/** Use HTTP Basic auth for token exchange (client_secret_basic). */
|
|
204
272
|
useBasicAuth?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Provider issues a developer token that every API call must carry in addition to
|
|
275
|
+
* the OAuth access token (Google Ads). Declared alongside clientId/clientSecret —
|
|
276
|
+
* same scope, same vault-backed defaultValueSource, read from
|
|
277
|
+
* `<PROVIDER>_DEVELOPER_TOKEN`.
|
|
278
|
+
*/
|
|
279
|
+
requiresDeveloperToken?: boolean;
|
|
205
280
|
/** MCP endpoint (if the provider supports MCP auth) */
|
|
206
281
|
mcpUrl?: string;
|
|
207
282
|
/** Authentication methods supported by this connector */
|
|
208
283
|
authMethods?: ['api_key'] | ['oauth2'] | ['api_key', 'oauth2'];
|
|
284
|
+
/**
|
|
285
|
+
* The method the credential form opens on when the connector offers both API key and OAuth.
|
|
286
|
+
* Unset, a connector with typeable key fields opens on API Key and any other on OAuth.
|
|
287
|
+
* TikTok Ads opens on OAuth; its key fields are the fallback for a manually issued token.
|
|
288
|
+
* Ignored unless `authMethods` holds the method. While the platform has OAuth switched off
|
|
289
|
+
* for a connector (`oAuthEnabled: false`), the form still opens on API Key.
|
|
290
|
+
*/
|
|
291
|
+
defaultAuthMethod?: 'oauth2' | 'api_key';
|
|
209
292
|
/** Connector categories */
|
|
210
293
|
categories: ConnectorCategoryTuple;
|
|
211
294
|
/** Form fields for API-key configuration (when api_key auth is selected) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configTypes.d.ts","sourceRoot":"","sources":["../../src/config/configTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEjG;;;;;;;;;GASG;AAMH,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,g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;IACvC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,iGAAiG;IACjG,qBAAqB,CAAC,EAAE,8BAA8B,CAAC;IACvD;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAC;IACvC,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,WAAW,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC/D;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACzC,2BAA2B;IAC3B,UAAU,EAAE,sBAAsB,CAAC;IACnC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACjC,mEAAmE;IACnE,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACrC,8EAA8E;IAC9E,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,10 @@ export * from './inngest/interfaces/types';
|
|
|
6
6
|
export * from './inngest/monacoAutocompleteIntegration';
|
|
7
7
|
export { extractFunctionBody, generateFromExtractedFunctions } from './inngest/stepGenerator';
|
|
8
8
|
export * from './utils/authMetaDataSchema';
|
|
9
|
+
export * from './utils/connectorDefaultAuthMethod';
|
|
9
10
|
export * from './utils/connectorFieldTokenResolver';
|
|
11
|
+
export * from './utils/connectorOAuthRequestKnobs';
|
|
12
|
+
export * from './utils/connectorRedirectUri';
|
|
10
13
|
export * from './utils/deepMergeFormSteps';
|
|
11
14
|
export * from './utils/json';
|
|
12
15
|
export * from './utils/schemaHelpers';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAC9F,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAC9F,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getCdnBase,iurl,setCdnBase}from'./config/cdnConfig.js';export{CONNECTOR_CATALOG_SAMPLE_CHUNK_SIZE,CONNECTOR_CATALOG_SAMPLE_ENTRIES,CONNECTOR_CATALOG_SAMPLE_ENTRY_BY_SCHEMA_ID}from'./config/connectorSampleOptions.generated.js';export{CONNECTOR_CATEGORIES}from'./config/configTypes.js';export{generateFunctionCode,generateHandlerBody,generateHandlerBodyWithReturn,generateStepFromFunction,generateStepFunctionsFromDB,wrapStepsInInngestFunction}from'./inngest/generateFunctionCode.js';export{getAvailableDefinitions,installLibraryForAutocomplete,setupMonacoAutocomplete,setupStepAutocomplete,updateAutocompleteConfig}from'./inngest/monacoAutocompleteIntegration.js';export{cleanStepCode,extractFunctionBody,extractStepVarName,generateFromExtractedFunctions}from'./inngest/stepGenerator.js';export{buildMetadataSchema,buildProviderConfig,buildProviderSeedFromConfig,buildProviderWithRefs,createOAuthSeedGenerator}from'./utils/authMetaDataSchema.js';export{resolveConnectorFieldTokensInString,resolveConnectorFieldTokensInValue}from'./utils/connectorFieldTokenResolver.js';export{deepMergeElements,deepMergeFormSteps}from'./utils/deepMergeFormSteps.js';export{flatten,unflatten}from'./utils/json.js';export{DatabaseType,FORM_METADATA_NODE_TYPE,FormType,SCHEMA_ID_OPTIONS,flattenSchemaWithUiContext,flattenSchemas,flattenUiSchema,isContributionSchemaId,parseSampleNodes}from'./utils/schemaHelpers.js';export{buildCommandsFromActions,buildMenusFromCommands,buildParamBindings,extractTemplateUserFields,extractUserFieldsFromStepperFormMetadata,parseInputTemplate,resolveInputTemplate}from'./utils/integrationCommands.js';//# sourceMappingURL=index.js.map
|
|
1
|
+
export{DEFAULT_EXTENSION_CDN_BASE,getCdnBase,iurl,setCdnBase}from'./config/cdnConfig.js';export{CONNECTOR_CATALOG_SAMPLE_CHUNK_SIZE,CONNECTOR_CATALOG_SAMPLE_ENTRIES,CONNECTOR_CATALOG_SAMPLE_ENTRY_BY_SCHEMA_ID}from'./config/connectorSampleOptions.generated.js';export{CONNECTOR_CATEGORIES}from'./config/configTypes.js';export{generateFunctionCode,generateHandlerBody,generateHandlerBodyWithReturn,generateStepFromFunction,generateStepFunctionsFromDB,wrapStepsInInngestFunction}from'./inngest/generateFunctionCode.js';export{getAvailableDefinitions,installLibraryForAutocomplete,setupMonacoAutocomplete,setupStepAutocomplete,updateAutocompleteConfig}from'./inngest/monacoAutocompleteIntegration.js';export{cleanStepCode,extractFunctionBody,extractStepVarName,generateFromExtractedFunctions}from'./inngest/stepGenerator.js';export{buildCredentialOAuthConfigKey,buildCredentialOAuthTokenVaultKeys,buildCredentialScopedSecretKey,buildMetadataSchema,buildNamespaceCredentialOAuthTokenVaultKeys,buildOAuthInstanceTokenVaultKeys,buildProviderConfig,buildProviderCredentialOAuthTokenVaultKeys,buildProviderSeedFromConfig,buildProviderWithRefs,createOAuthSeedGenerator,credentialIdFromOAuthConfigKey,credentialIdFromScopedSecretKey,isCredentialAccountConfigKey,isCredentialScopedSecretKey,namespaceFromOAuthConfigKey,stripCredentialAccountConfigKey,stripCredentialScopedSecretKey,toVaultPrefix}from'./utils/authMetaDataSchema.js';export{connectorDefaultAuthMethod}from'./utils/connectorDefaultAuthMethod.js';export{resolveConnectorFieldTokensInString,resolveConnectorFieldTokensInValue}from'./utils/connectorFieldTokenResolver.js';export{connectorOAuthRequestKnobSettings,pickConnectorOAuthRequestKnobs}from'./utils/connectorOAuthRequestKnobs.js';export{CONNECTOR_REDIRECT_URI_TEMPLATE}from'./utils/connectorRedirectUri.js';export{deepMergeElements,deepMergeFormSteps}from'./utils/deepMergeFormSteps.js';export{flatten,unflatten}from'./utils/json.js';export{DatabaseType,FORM_METADATA_NODE_TYPE,FormType,SCHEMA_ID_OPTIONS,flattenSchemaWithUiContext,flattenSchemas,flattenUiSchema,isContributionSchemaId,parseSampleNodes}from'./utils/schemaHelpers.js';export{buildCommandsFromActions,buildIntegrationConfigurationContribution,buildMenusFromCommands,buildParamBindings,extractTemplateUserFields,extractUserFieldsFromStepperFormMetadata,parseInputTemplate,resolveInputTemplate}from'./utils/integrationCommands.js';//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ConnectorType } from 'common';
|
|
2
2
|
import { ConnectorCategoryTuple, ConnectorConfig, CustomButtonConfig, FormFieldConfig, FormResourceConfig, MCPProviderConfig } from '../config/configTypes';
|
|
3
|
+
import { type ConnectorOAuthRequestKnobs } from './connectorOAuthRequestKnobs';
|
|
3
4
|
type SampleFormGenerator = (title?: string, formIcon?: string, formExtensionId?: string) => any[];
|
|
4
|
-
interface ProviderTemplateSeed {
|
|
5
|
+
export interface ProviderTemplateSeed extends ConnectorOAuthRequestKnobs {
|
|
5
6
|
key: string;
|
|
6
7
|
providerId: string;
|
|
7
8
|
title: string;
|
|
@@ -11,13 +12,20 @@ interface ProviderTemplateSeed {
|
|
|
11
12
|
useCustomOAuthEndpoints?: boolean;
|
|
12
13
|
usePKCE?: boolean;
|
|
13
14
|
clientAuthMethod?: 'client_secret_basic' | 'client_secret_post';
|
|
15
|
+
clientIdParamName?: string;
|
|
16
|
+
useCommaSeparatedScopes?: boolean;
|
|
17
|
+
tokenEndpointHeaders?: Record<string, string>;
|
|
14
18
|
authorizationUrl?: string;
|
|
15
19
|
tokenUrl?: string;
|
|
16
20
|
revocationUrl?: string;
|
|
17
21
|
useBasicAuth?: boolean;
|
|
22
|
+
/** Provider requires a developer token alongside the OAuth client credentials. */
|
|
23
|
+
requiresDeveloperToken?: boolean;
|
|
18
24
|
mcpUrl?: string;
|
|
19
25
|
connectorType: ConnectorType;
|
|
20
26
|
authMethods: string[];
|
|
27
|
+
/** The method the credential form opens on for a dual-auth connector (ConnectorConfig.defaultAuthMethod). */
|
|
28
|
+
defaultAuthMethod?: ConnectorConfig['defaultAuthMethod'];
|
|
21
29
|
fields: FormFieldConfig[];
|
|
22
30
|
resources: FormResourceConfig[];
|
|
23
31
|
customButtons: CustomButtonConfig[];
|
|
@@ -179,7 +187,96 @@ export declare const buildProviderConfig: (providerConfig: CustomProviderConfigI
|
|
|
179
187
|
}[];
|
|
180
188
|
};
|
|
181
189
|
export declare function buildProviderSeedFromConfig(provider: ConnectorConfig | MCPProviderConfig, connectorType: ConnectorType): ProviderTemplateSeed;
|
|
182
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Normalize a provider id or form namespace into a vault secret key prefix.
|
|
192
|
+
* e.g. `gmail-app-hk7zf7w9` → `GMAIL_APP_HK7ZF7W9`
|
|
193
|
+
*/
|
|
194
|
+
export declare const toVaultPrefix: (value: string) => string;
|
|
195
|
+
/**
|
|
196
|
+
* Per-form-instance vault keys for non-account-specific secrets (e.g. API key fields).
|
|
197
|
+
*
|
|
198
|
+
* Do NOT use these for OAuth access/refresh tokens when multiple accounts can share
|
|
199
|
+
* one published form — connecting account B would overwrite account A's vault entry.
|
|
200
|
+
* Access/refresh live under per-credential `configKey.accounts.{id}.*` and durable
|
|
201
|
+
* `CRED_<id>_*` vault keys via syncOAuthTokensToCredentialVault.
|
|
202
|
+
*
|
|
203
|
+
* Client id/secret stay provider-scoped (shared OAuth app credentials).
|
|
204
|
+
*/
|
|
205
|
+
export declare const buildOAuthInstanceTokenVaultKeys: (namespace: string) => {
|
|
206
|
+
/** @deprecated Do not wire access tokens to this shared key — use CRED_* instead. */
|
|
207
|
+
readonly accessToken: `${string}_ACCESS_TOKEN`;
|
|
208
|
+
/** @deprecated Do not wire refresh tokens to this shared key — use CRED_* instead. */
|
|
209
|
+
readonly refreshToken: `${string}_REFRESH_TOKEN`;
|
|
210
|
+
readonly apiKey: `${string}_API_KEY`;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Credential-scoped vault key: `{BASE_KEY}_{credentialId}`.
|
|
214
|
+
*
|
|
215
|
+
* This is the platform's own convention — `preferences-service` resolves a
|
|
216
|
+
* `format: 'secret'` config key to `${defaultValueSource.secretKey}_${credentialId}`
|
|
217
|
+
* on both read and write whenever the node context carries a `credentialId`.
|
|
218
|
+
* API-key connectors reuse the exact same shape so several credentials for one
|
|
219
|
+
* provider can coexist in a project/env instead of overwriting each other's
|
|
220
|
+
* shared `PROVIDER_API_KEY` entry (the same isolation OAuth gets from its
|
|
221
|
+
* per-account configKey).
|
|
222
|
+
*
|
|
223
|
+
* Idempotent when `baseSecretKey` is already scoped to the same credential.
|
|
224
|
+
*/
|
|
225
|
+
export declare const buildCredentialScopedSecretKey: (baseSecretKey: string, credentialId: string) => string;
|
|
226
|
+
/** True when a vault key already carries a `_{credentialId}` suffix. */
|
|
227
|
+
export declare const isCredentialScopedSecretKey: (secretKey: string) => boolean;
|
|
228
|
+
/** Strip `_{credentialId}` to recover the catalog/base vault key. */
|
|
229
|
+
export declare const stripCredentialScopedSecretKey: (secretKey: string) => string;
|
|
230
|
+
/** credentialId embedded in a scoped vault key, if any. */
|
|
231
|
+
export declare const credentialIdFromScopedSecretKey: (secretKey: string) => string | null;
|
|
232
|
+
/**
|
|
233
|
+
* Durable per-credential token vault keys. Used after OAuth connect so each
|
|
234
|
+
* FormBuilderCredential keeps its own token pair even when several credentials
|
|
235
|
+
* share the same published template/configKey staging path.
|
|
236
|
+
*/
|
|
237
|
+
export declare const buildCredentialOAuthTokenVaultKeys: (credentialId: string) => {
|
|
238
|
+
readonly accessToken: `${string}_ACCESS_TOKEN`;
|
|
239
|
+
readonly refreshToken: `${string}_REFRESH_TOKEN`;
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* Provider-scoped per-credential OAuth vault keys (e.g. OAuth callback writes
|
|
243
|
+
* `GOOGLE_GMAIL_ACCESS_TOKEN_{credentialId}` to Personal Vault).
|
|
244
|
+
*/
|
|
245
|
+
export declare const buildProviderCredentialOAuthTokenVaultKeys: (providerId: string, credentialId: string) => {
|
|
246
|
+
readonly accessToken: `${string}_ACCESS_TOKEN_${string}`;
|
|
247
|
+
readonly refreshToken: `${string}_REFRESH_TOKEN_${string}`;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Namespace-scoped per-credential OAuth vault keys (`google_gmail-app` → `GOOGLE_GMAIL_APP_*_{id}`).
|
|
251
|
+
*/
|
|
252
|
+
export declare const buildNamespaceCredentialOAuthTokenVaultKeys: (namespace: string, credentialId: string) => {
|
|
253
|
+
readonly accessToken: `${string}_ACCESS_TOKEN_${string}`;
|
|
254
|
+
readonly refreshToken: `${string}_REFRESH_TOKEN_${string}`;
|
|
255
|
+
};
|
|
256
|
+
/** True when configKey is already scoped to a FormBuilder credential account. */
|
|
257
|
+
export declare const isCredentialAccountConfigKey: (configKey: string) => boolean;
|
|
258
|
+
/** Strip `.accounts.{credentialId}` to recover the published template configKey. */
|
|
259
|
+
export declare const stripCredentialAccountConfigKey: (configKey: string) => string;
|
|
260
|
+
/** credentialId embedded in an account-scoped configKey, if any. */
|
|
261
|
+
export declare const credentialIdFromOAuthConfigKey: (configKey: string) => string | null;
|
|
262
|
+
/**
|
|
263
|
+
* Build the per-credential OAuth configKey used for connect / refresh / disconnect.
|
|
264
|
+
* Idempotent when `baseConfigKey` is already account-scoped for the same id.
|
|
265
|
+
*/
|
|
266
|
+
export declare const buildCredentialOAuthConfigKey: (baseConfigKey: string, credentialId: string) => string;
|
|
267
|
+
/** Extract the form namespace from an oauthConnector configKey path. */
|
|
268
|
+
export declare const namespaceFromOAuthConfigKey: (configKey: string) => string | null;
|
|
269
|
+
export interface SeedGeneratorOptions {
|
|
270
|
+
/**
|
|
271
|
+
* Exact namespace (== formId) per seed, aligned by index. Pass a published template's
|
|
272
|
+
* key to regenerate a form that is identity-compatible with it - same formId and the
|
|
273
|
+
* same `integrationSettings.settings.<type>.<ns>.oauthConnector` configuration keys -
|
|
274
|
+
* so stored credentials and OAuth writes keep resolving. Omitted entries fall back to
|
|
275
|
+
* the random-suffix default (new-form behavior).
|
|
276
|
+
*/
|
|
277
|
+
namespaces?: Array<string | undefined>;
|
|
278
|
+
}
|
|
279
|
+
export declare function createOAuthSeedGenerator(seeds: ProviderTemplateSeed[], options?: SeedGeneratorOptions): SampleFormGenerator;
|
|
183
280
|
export declare const buildProviderWithRefs: (provider: any, sampleNodes: any[]) => any;
|
|
184
281
|
export declare const buildMetadataSchema: (sampleNodes: any[]) => ({
|
|
185
282
|
schemaId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authMetaDataSchema.d.ts","sourceRoot":"","sources":["../../src/utils/authMetaDataSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAyD,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"authMetaDataSchema.d.ts","sourceRoot":"","sources":["../../src/utils/authMetaDataSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAyD,MAAM,QAAQ,CAAC;AAElH,OAAO,EAEH,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACH,KAAK,0BAA0B,EAGlC,MAAM,8BAA8B,CAAC;AAGtC,KAAK,mBAAmB,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;AAElG,MAAM,WAAW,oBAAqB,SAAQ,0BAA0B;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,o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