@fluentcommerce/fc-connect-sdk 0.1.52 → 0.1.54
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/CHANGELOG.md +530 -506
- package/README.md +52 -3
- package/dist/cjs/auth/index.d.ts +3 -0
- package/dist/cjs/auth/index.js +13 -0
- package/dist/cjs/auth/profile-loader.d.ts +18 -0
- package/dist/cjs/auth/profile-loader.js +208 -0
- package/dist/cjs/client-factory.d.ts +4 -0
- package/dist/cjs/client-factory.js +10 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +8 -2
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/esm/auth/index.d.ts +3 -0
- package/dist/esm/auth/index.js +2 -0
- package/dist/esm/auth/profile-loader.d.ts +18 -0
- package/dist/esm/auth/profile-loader.js +169 -0
- package/dist/esm/client-factory.d.ts +4 -0
- package/dist/esm/client-factory.js +9 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/auth/index.d.ts +3 -0
- package/dist/types/auth/profile-loader.d.ts +18 -0
- package/dist/types/client-factory.d.ts +4 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/types/index.d.ts +1 -1
- package/docs/02-CORE-GUIDES/api-reference/cli-profile-integration.md +377 -0
- package/docs/02-CORE-GUIDES/api-reference/event-api-input-output-reference.md +24 -15
- package/docs/02-CORE-GUIDES/api-reference/modules/api-reference-01-client-api.md +38 -0
- package/docs/02-CORE-GUIDES/webhook-validation/modules/webhook-validation-09-rubix-event-vs-http-call.md +1 -1
- package/docs/03-PATTERN-GUIDES/multiple-connections/modules/multiple-connections-02-quick-start.md +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FluentClient } from './clients/fluent-client.js';
|
|
2
2
|
import { FluentVersoriClient } from './versori/fluent-versori-client.js';
|
|
3
|
+
import { loadFluentProfile } from './auth/profile-loader.js';
|
|
3
4
|
export async function createClient(context, options) {
|
|
4
5
|
const logger = 'log' in context ? context.log : 'logger' in context ? context.logger : undefined;
|
|
5
6
|
const validateConnection = options?.validateConnection ?? false;
|
|
@@ -101,3 +102,11 @@ export const isHttpContext = (context) => {
|
|
|
101
102
|
export const isDirectContext = (context) => {
|
|
102
103
|
return 'config' in context;
|
|
103
104
|
};
|
|
105
|
+
export async function createClientFromProfile(profileName, options) {
|
|
106
|
+
const config = loadFluentProfile(profileName, options);
|
|
107
|
+
const client = new FluentClient(config, options?.logger);
|
|
108
|
+
if (options?.validateConnection) {
|
|
109
|
+
await client.graphql({ query: 'query { me { ref } }' });
|
|
110
|
+
}
|
|
111
|
+
return client;
|
|
112
|
+
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createClient, isHttpContext, isDirectContext } from './client-factory.js';
|
|
1
|
+
export { createClient, createClientFromProfile, isHttpContext, isDirectContext, } from './client-factory.js';
|
|
2
2
|
export type { ClientContext, CreateClientOptions } from './client-factory.js';
|
|
3
3
|
export { FluentClient } from './clients/fluent-client.js';
|
|
4
4
|
export { FluentVersoriClient } from './versori/fluent-versori-client.js';
|
|
@@ -14,6 +14,8 @@ export { DataSourceType } from './types/index.js';
|
|
|
14
14
|
export { parseAndValidateCsv, detectFileType, parseWebhookRequest, validateFluentEvent, validateGraphQLPayload, generateFileName, generateTimestampedFileName, generateFilePath, generateDateSubdirectories, extractFileName, extractFileExtension, replaceFileExtension, type FileNamingOptions, } from './utils/index.js';
|
|
15
15
|
export { detectPaginationVariables, extractConnection, extractCursor, hasMorePages, buildPaginationVariables, type PaginationVariables, } from './utils/pagination-helpers.js';
|
|
16
16
|
export { OAuth2AuthProvider, BearerTokenAuthProvider, AuthManager, VersoriConnectionAdapter, type VersoriConnection, } from './auth/auth-provider.js';
|
|
17
|
+
export { loadFluentProfile, listFluentProfiles, getFluentProfileInfo, resolveProfileBaseDir, } from './auth/profile-loader.js';
|
|
18
|
+
export type { FluentProfileOptions, FluentProfileInfo } from './auth/profile-loader.js';
|
|
17
19
|
export { type FileDiscoveryStrategy, type FileDiscoveryContext, type FileParserStrategy, type TransformationStrategy, type TransformationContext, type IngestionValidationResult, type BatchSubmissionStrategy, type BatchSubmissionContext, type BatchSubmissionResult, type JobManagementStrategy, type JobContext, type JobStatus, type IngestionStrategy, type StrategyFactory, } from './services/orchestration/strategies/ingestion-strategies.js';
|
|
18
20
|
export * from './errors/index.js';
|
|
19
21
|
export { ConfigurationError, AggregateIngestionError, IngestionErrorFactory, } from './errors/ingestion-errors.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createClient, isHttpContext, isDirectContext } from './client-factory.js';
|
|
1
|
+
export { createClient, createClientFromProfile, isHttpContext, isDirectContext, } from './client-factory.js';
|
|
2
2
|
export { FluentClient } from './clients/fluent-client.js';
|
|
3
3
|
export { FluentVersoriClient } from './versori/fluent-versori-client.js';
|
|
4
4
|
export { VersoriFileTracker, VersoriKVAdapter, VersoriIndexedFileTracker, } from './versori/index.js';
|
|
@@ -12,6 +12,7 @@ export { DataSourceType } from './types/index.js';
|
|
|
12
12
|
export { parseAndValidateCsv, detectFileType, parseWebhookRequest, validateFluentEvent, validateGraphQLPayload, generateFileName, generateTimestampedFileName, generateFilePath, generateDateSubdirectories, extractFileName, extractFileExtension, replaceFileExtension, } from './utils/index.js';
|
|
13
13
|
export { detectPaginationVariables, extractConnection, extractCursor, hasMorePages, buildPaginationVariables, } from './utils/pagination-helpers.js';
|
|
14
14
|
export { OAuth2AuthProvider, BearerTokenAuthProvider, AuthManager, VersoriConnectionAdapter, } from './auth/auth-provider.js';
|
|
15
|
+
export { loadFluentProfile, listFluentProfiles, getFluentProfileInfo, resolveProfileBaseDir, } from './auth/profile-loader.js';
|
|
15
16
|
export * from './errors/index.js';
|
|
16
17
|
export { ConfigurationError, AggregateIngestionError, IngestionErrorFactory, } from './errors/ingestion-errors.js';
|
|
17
18
|
export { classifyError, classifyErrors } from './services/errors/index.js';
|