appknit-platform-sdk
Advanced tools
Comparing version 1.0.50-61 to 1.0.50-63
@@ -91,2 +91,3 @@ import { SdkHttpHeaders, SdkStopExecutionStatus, SdkLogLevel, SdkLogEntry, SdkHttpRequestOptions, SdkHttpRequestTrace, SdkHttpResponse, SdkAuthenticationCredentialType, SdkFlowProvider, SdkStorageProvider, SdkContext, SdkDataProvider } from './types'; | ||
getSdkMetadata(): ISdkMetadata; | ||
getFlowExecutionUrl(environmentFlowVersionId: string): string; | ||
} |
@@ -338,3 +338,3 @@ "use strict"; | ||
headers: { | ||
'Cookie': `jwt=${this.sdkMetadata.jwt}`, | ||
Cookie: `jwt=${this.sdkMetadata.jwt}`, | ||
}, | ||
@@ -370,4 +370,7 @@ }); | ||
} | ||
getFlowExecutionUrl(environmentFlowVersionId) { | ||
return `${this.getSdkMetadata().apiUrl}/${environmentFlowVersionId}`; | ||
} | ||
} | ||
exports.AppknitSDK = AppknitSDK; | ||
//# sourceMappingURL=sdk.js.map |
@@ -103,2 +103,3 @@ import { AppknitSDK } from '../sdk'; | ||
}; | ||
environmentFlowVersionId?: string; | ||
}, configuration: any) => Promise<any>; | ||
@@ -105,0 +106,0 @@ }; |
@@ -7,4 +7,24 @@ /// <reference types="node" /> | ||
import { SdkHttpMethod, SdkHttpResponse, SdkHttpHeaders } from './request'; | ||
export interface IS3Config { | ||
awsAccessKeyId: string; | ||
awsSecretAccessKey: string; | ||
region: string; | ||
apiVersion?: string; | ||
endpoint?: string | null; | ||
s3ForcePathStyle?: boolean; | ||
signatureVersion?: string; | ||
bucketNamePrefix?: string; | ||
} | ||
export interface IFileStorageSettings { | ||
acl?: string; | ||
bucketName: string; | ||
} | ||
export declare enum FileStorageProviderTypeEnum { | ||
awsS3 = "AWS_S3", | ||
oracleCloudObjectStorage = "ORACLE_CLOUD_OBJECT_STORAGE" | ||
} | ||
export interface IFileStorageCreateInput { | ||
systemKey: string; | ||
providerType: FileStorageProviderTypeEnum; | ||
providerSettings: IS3Config; | ||
settings: IFileStorageSettings; | ||
title: string; | ||
@@ -21,6 +41,2 @@ description?: string; | ||
} | ||
export interface IFindOneInputByIdOrSystemKey { | ||
id?: string; | ||
systemKey?: string; | ||
} | ||
export interface IRemoveOneInput { | ||
@@ -55,8 +71,10 @@ id: string; | ||
} | ||
export interface IFileStorage { | ||
export interface IFileStorage<ProviderSettings extends Record<string, any>, FileStorageSettings extends Record<string, any>> { | ||
id: string; | ||
organizationId: string; | ||
systemKey: string; | ||
providerType: FileStorageProviderTypeEnum; | ||
providerSettings: ProviderSettings; | ||
title: string; | ||
description?: string; | ||
settings: FileStorageSettings; | ||
createdAt: Date; | ||
@@ -115,3 +133,3 @@ createdBy: string; | ||
export declare type IStoredFileRemoveInput = Pick<IStoredFile, 'id' | 'removedBy' | 'removedAt'>; | ||
export declare type IFileStorageResult = IFileStorage; | ||
export declare type IFileStorageResult = IFileStorage<IS3Config, IFileStorageSettings>; | ||
export declare type IStoredFileResult = IStoredFile; | ||
@@ -209,3 +227,3 @@ export declare enum StoredFileListQuerySortByEnum { | ||
createStorage(input: IFileStorageCreateInput, requestOptions?: IStorageServiceRequestOptionsOverride): Promise<IFileStorageResult>; | ||
findOneStorage(input: IFindOneInputByIdOrSystemKey, requestOptions?: IStorageServiceRequestOptionsOverride): Promise<IFileStorageResult>; | ||
findOneStorage(input: IFileStorageFindOneInput, requestOptions?: IStorageServiceRequestOptionsOverride): Promise<IFileStorageResult>; | ||
listStorage(input: IFileStorageListInput): Promise<IFileStorageListResult>; | ||
@@ -212,0 +230,0 @@ removeStorage(input: IRemoveOneInput): Promise<IRemoveOneResult>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SdkStorageProvider = exports.StorageService = exports.StoredFileListQuerySortByEnum = exports.FileStorageListQuerySortByEnum = exports.SortOrder = void 0; | ||
exports.SdkStorageProvider = exports.StorageService = exports.StoredFileListQuerySortByEnum = exports.FileStorageListQuerySortByEnum = exports.SortOrder = exports.FileStorageProviderTypeEnum = void 0; | ||
const FormData = require("form-data"); | ||
@@ -8,2 +8,7 @@ const mime = require("mime-types"); | ||
const error_1 = require("./error"); | ||
var FileStorageProviderTypeEnum; | ||
(function (FileStorageProviderTypeEnum) { | ||
FileStorageProviderTypeEnum["awsS3"] = "AWS_S3"; | ||
FileStorageProviderTypeEnum["oracleCloudObjectStorage"] = "ORACLE_CLOUD_OBJECT_STORAGE"; | ||
})(FileStorageProviderTypeEnum = exports.FileStorageProviderTypeEnum || (exports.FileStorageProviderTypeEnum = {})); | ||
var SortOrder; | ||
@@ -55,9 +60,20 @@ (function (SortOrder) { | ||
async createStorage(input, requestOptions = {}) { | ||
const inputParams = ''; | ||
var _a, _b; | ||
let inputParams = ''; | ||
if ((_a = input.providerSettings) === null || _a === void 0 ? void 0 : _a.endpoint) { | ||
inputParams += `endpoint: "${(_b = input.providerSettings) === null || _b === void 0 ? void 0 : _b.endpoint}"`; | ||
} | ||
const mutationStr = `mutation { | ||
FileStorage_create( | ||
StorageCreate: { | ||
systemKey: "${input.systemKey}" | ||
title: "${input.title}" | ||
description: "${input.description}" | ||
providerType: ${input.providerType} | ||
providerSettings: { | ||
region: "${input.providerSettings.region}" | ||
awsAccessKeyId: "${input.providerSettings.awsAccessKeyId}" | ||
awsSecretAccessKey: "${input.providerSettings.awsSecretAccessKey}" | ||
${inputParams} | ||
} | ||
settings: { bucketName: "${input.settings.bucketName}" } | ||
} | ||
@@ -68,3 +84,2 @@ ) { | ||
organizationId | ||
systemKey | ||
title | ||
@@ -74,2 +89,6 @@ description | ||
createdAt | ||
providerType | ||
settings{ | ||
bucketName | ||
} | ||
updatedBy | ||
@@ -120,7 +139,7 @@ updatedAt | ||
const queryString = `query { | ||
FileStorage_findOne(query: { id: "${input.id}", systemKey: "${input.systemKey}" }) { | ||
FileStorage_findOne(query: { id: "${input.id}" }) { | ||
data { | ||
id | ||
organizationId | ||
systemKey | ||
providerType | ||
title | ||
@@ -132,2 +151,12 @@ description | ||
updatedAt | ||
settings { | ||
bucketName | ||
} | ||
providerSettings { | ||
apiVersion | ||
endpoint | ||
region | ||
s3ForcePathStyle | ||
signatureVersion | ||
} | ||
} | ||
@@ -189,5 +218,8 @@ errors { | ||
organizationId | ||
systemKey | ||
providerType | ||
title | ||
createdBy | ||
settings { | ||
bucketName | ||
} | ||
createdBy | ||
@@ -311,5 +343,7 @@ createdAt | ||
organizationId | ||
systemKey | ||
title | ||
description | ||
settings { | ||
bucketName | ||
} | ||
createdBy | ||
@@ -316,0 +350,0 @@ createdAt |
{ | ||
"name": "appknit-platform-sdk", | ||
"version": "1.0.50-61", | ||
"version": "1.0.50-63", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "homepage": "https://appknit.io", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
118681
2264