appknit-platform-sdk
Advanced tools
Comparing version 1.0.50-58 to 1.0.50-60
@@ -7,24 +7,4 @@ /// <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 { | ||
providerType: FileStorageProviderTypeEnum; | ||
providerSettings: IS3Config; | ||
settings: IFileStorageSettings; | ||
systemKey: string; | ||
title: string; | ||
@@ -41,2 +21,6 @@ description?: string; | ||
} | ||
export interface IFindOneInputByIdOrSystemKey { | ||
id: string; | ||
systemKey: string; | ||
} | ||
export interface IRemoveOneInput { | ||
@@ -71,10 +55,8 @@ id: string; | ||
} | ||
export interface IFileStorage<ProviderSettings extends Record<string, any>, FileStorageSettings extends Record<string, any>> { | ||
export interface IFileStorage { | ||
id: string; | ||
organizationId: string; | ||
providerType: FileStorageProviderTypeEnum; | ||
providerSettings: ProviderSettings; | ||
systemKey: string; | ||
title: string; | ||
description?: string; | ||
settings: FileStorageSettings; | ||
createdAt: Date; | ||
@@ -133,3 +115,3 @@ createdBy: string; | ||
export declare type IStoredFileRemoveInput = Pick<IStoredFile, 'id' | 'removedBy' | 'removedAt'>; | ||
export declare type IFileStorageResult = IFileStorage<IS3Config, IFileStorageSettings>; | ||
export declare type IFileStorageResult = IFileStorage; | ||
export declare type IStoredFileResult = IStoredFile; | ||
@@ -227,3 +209,3 @@ export declare enum StoredFileListQuerySortByEnum { | ||
createStorage(input: IFileStorageCreateInput, requestOptions?: IStorageServiceRequestOptionsOverride): Promise<IFileStorageResult>; | ||
findOneStorage(input: IFileStorageFindOneInput, requestOptions?: IStorageServiceRequestOptionsOverride): Promise<IFileStorageResult>; | ||
findOneStorage(input: IFindOneInputByIdOrSystemKey, requestOptions?: IStorageServiceRequestOptionsOverride): Promise<IFileStorageResult>; | ||
listStorage(input: IFileStorageListInput): Promise<IFileStorageListResult>; | ||
@@ -230,0 +212,0 @@ removeStorage(input: IRemoveOneInput): Promise<IRemoveOneResult>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SdkStorageProvider = exports.StorageService = exports.StoredFileListQuerySortByEnum = exports.FileStorageListQuerySortByEnum = exports.SortOrder = exports.FileStorageProviderTypeEnum = void 0; | ||
exports.SdkStorageProvider = exports.StorageService = exports.StoredFileListQuerySortByEnum = exports.FileStorageListQuerySortByEnum = exports.SortOrder = void 0; | ||
const FormData = require("form-data"); | ||
@@ -8,7 +8,2 @@ 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; | ||
@@ -60,20 +55,9 @@ (function (SortOrder) { | ||
async createStorage(input, requestOptions = {}) { | ||
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 inputParams = ''; | ||
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}" } | ||
} | ||
@@ -84,2 +68,3 @@ ) { | ||
organizationId | ||
systemKey | ||
title | ||
@@ -89,6 +74,2 @@ description | ||
createdAt | ||
providerType | ||
settings{ | ||
bucketName | ||
} | ||
updatedBy | ||
@@ -139,7 +120,7 @@ updatedAt | ||
const queryString = `query { | ||
FileStorage_findOne(query: { id: "${input.id}" }) { | ||
FileStorage_findOne(query: { id: "${input.id}", systemKey: "${input.systemKey}" }) { | ||
data { | ||
id | ||
organizationId | ||
providerType | ||
systemKey | ||
title | ||
@@ -151,12 +132,2 @@ description | ||
updatedAt | ||
settings { | ||
bucketName | ||
} | ||
providerSettings { | ||
apiVersion | ||
endpoint | ||
region | ||
s3ForcePathStyle | ||
signatureVersion | ||
} | ||
} | ||
@@ -218,8 +189,5 @@ errors { | ||
organizationId | ||
providerType | ||
systemKey | ||
title | ||
createdBy | ||
settings { | ||
bucketName | ||
} | ||
createdBy | ||
@@ -343,7 +311,5 @@ createdAt | ||
organizationId | ||
systemKey | ||
title | ||
description | ||
settings { | ||
bucketName | ||
} | ||
createdBy | ||
@@ -350,0 +316,0 @@ createdAt |
{ | ||
"name": "appknit-platform-sdk", | ||
"version": "1.0.50-58", | ||
"version": "1.0.50-60", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "homepage": "https://appknit.io", |
Sorry, the diff of this file is not supported yet
116033
2207