@giteeteam/apps-proxima-api
Advanced tools
Comparing version 0.1.3 to 0.1.4
import { ItemObjectProps, WorkflowObjectProps, UserObjectProps, ancestorOption, returnFlag, RequestCoreResponse, SupportRequestMethod } from './types'; | ||
import { ParseObject } from '../parse/object'; | ||
import { ParseObjectSubclassType } from '../parse/types'; | ||
import { ParseObjectSubclassType, ParseFileData } from '../parse/types'; | ||
/** | ||
@@ -109,2 +109,10 @@ * 获取界面数据 | ||
/** | ||
* 获取Parse File对象 | ||
* @param name | ||
* @param data | ||
* @param type | ||
* @returns | ||
*/ | ||
export declare const getParseFile: (name: string, data: ParseFileData, type?: string) => import("../parse/file").default; | ||
/** | ||
* 保存多个parse对象,由于对象已经进行了appKey处理所以,保存不需要区分。 | ||
@@ -111,0 +119,0 @@ * 传入由getParseObject或者getParseModel生成的对象 |
@@ -377,2 +377,12 @@ import { workflow2Json, getCoreApi, postCoreApi, putCoreApi, patchCoreApi, getClassName } from './utils'; | ||
/** | ||
* 获取Parse File对象 | ||
* @param name | ||
* @param data | ||
* @param type | ||
* @returns | ||
*/ | ||
export const getParseFile = (name, data, type) => { | ||
return new Parse.File(name, data, type); | ||
}; | ||
/** | ||
* 保存多个parse对象,由于对象已经进行了appKey处理所以,保存不需要区分。 | ||
@@ -379,0 +389,0 @@ * 传入由getParseObject或者getParseModel生成的对象 |
import { axios } from '../axios'; | ||
const pluginClassPrefix = 'plugin'; | ||
const pluginClassPrefix = global.pluginClassPrefix || ''; | ||
export const getClassName = (isAppClass, className) => { | ||
const { appKey } = global; | ||
return isAppClass ? `${pluginClassPrefix}_${appKey}_${className}` : className; | ||
return isAppClass ? `${pluginClassPrefix}${appKey}_${className}` : className; | ||
}; | ||
@@ -7,0 +7,0 @@ // 获取工作流动作 |
/* eslint-disable no-var */ | ||
import type { AxiosRequestConfig } from 'axios'; | ||
import type { ParseFileData, ObjectDestroyOptions, FileSaveOptions } from './parse/types'; | ||
@@ -10,9 +11,17 @@ export interface ParseQueryOptions { | ||
export interface ParseDestroyObjectOptions { | ||
export interface ParseObjectDestroyOptions { | ||
className: string; | ||
applicationId?: string; | ||
id: string; | ||
destroyOptions?: Record<string, any>; | ||
destroyOptions?: ObjectDestroyOptions; | ||
} | ||
export interface ParseFileSaveOptions { | ||
name: string; | ||
data: ParseFileData; | ||
type?: string; | ||
applicationId?: string; | ||
saveOptions: FileSaveOptions; | ||
} | ||
declare global { | ||
@@ -24,26 +33,11 @@ var axios: (config: AxiosRequestConfig) => any; | ||
var appKey: string; | ||
var pluginClassPrefix: string; | ||
var parse: { | ||
query: (opts: ParseQueryOptions) => Promise<any>; | ||
saveAll: (objList: any[], opts?: Record<string, any>) => Promise<Record<string, any>[]>; | ||
destroyObject: (opts: ParseDestroyObjectOptions) => Promise<void>; | ||
objectDestroy: (opts: ParseObjectDestroyOptions) => Promise<void>; | ||
fileSave: (opts: ParseFileSaveOptions) => Promise<{ _url: string }>; | ||
}; | ||
// var schema: { | ||
// newSchema: (className: string) => void; | ||
// get: (className: string) => Promise<any>; | ||
// purge: (className: string) => Promise<any>; | ||
// delete: (className: string) => Promise<any>; | ||
// setCLP: (className: string, clp: any) => void; | ||
// update: (className: string) => Promise<any>; | ||
// save: (className: string) => Promise<any>; | ||
// addPointer: (className: string, key: string, targetClass: string, options?: any) => void; | ||
// addRelation: (className: string, key: string, targetClass: string, options?: any) => void; | ||
// addString: (className: string, key: string, options?: any) => void; | ||
// addNumber: (className: string, key: string, options?: any) => void; | ||
// addArray: (className: string, key: string, options?: any) => void; | ||
// addObject: (className: string, key: string, options?: any) => void; | ||
// addBoolean: (className: string, key: string, options?: any) => void; | ||
// addDate: (className: string, key: string, options?: any) => void; | ||
// }; | ||
} | ||
export {}; |
import Query from './query'; | ||
import { ParseObject } from './object'; | ||
import File from './file'; | ||
/** | ||
@@ -10,3 +11,4 @@ * parse的简单实现,只支持parse的部分功能 | ||
Object: typeof ParseObject; | ||
File: typeof File; | ||
}; | ||
export default Parse; |
import Query from './query'; | ||
import { ParseObject } from './object'; | ||
import File from './file'; | ||
const User = 'User'; | ||
@@ -7,3 +8,3 @@ /** | ||
*/ | ||
const Parse = { Query, User, Object: ParseObject }; | ||
const Parse = { Query, User, Object: ParseObject, File }; | ||
export default Parse; |
import Base from './base'; | ||
import type { ParseObjectSubclassType } from './types'; | ||
import type { ParseObjectSubclassType, ObjectDestroyOptions } from './types'; | ||
export declare class ParseObject extends Base { | ||
@@ -24,3 +24,3 @@ attributes?: Record<string, any>; | ||
*/ | ||
destroy(destroyOptions: Record<string, any>): Promise<void>; | ||
destroy(destroyOptions: ObjectDestroyOptions): Promise<void>; | ||
} |
@@ -68,3 +68,3 @@ import Base from './base'; | ||
return; | ||
return await global.parse.destroyObject({ | ||
return await global.parse.objectDestroy({ | ||
className: this.className, | ||
@@ -71,0 +71,0 @@ applicationId: this.applicationId, |
import Base from './base'; | ||
export interface Options { | ||
sessionToken?: string | undefined; | ||
context?: Record<string, unknown>; | ||
} | ||
import type { QueryResultOptions } from './types'; | ||
export default class Query extends Base { | ||
@@ -18,5 +15,5 @@ constructor(className: string, applicationId?: string); | ||
private result; | ||
find(opts: Options): Promise<any>; | ||
findAll(opts: Options): Promise<any>; | ||
first(opts: Options): Promise<any>; | ||
find(opts: QueryResultOptions): Promise<any>; | ||
findAll(opts: QueryResultOptions): Promise<any>; | ||
first(opts: QueryResultOptions): Promise<any>; | ||
} |
@@ -18,1 +18,23 @@ export interface Operate { | ||
} | ||
export interface ContextOption { | ||
context?: { [key: string]: any }; | ||
} | ||
export interface SessionTokenOption { | ||
sessionToken?: string | undefined; | ||
} | ||
export interface UseMasterKeyOption { | ||
/** | ||
* In Cloud Code and Node only, causes the Master Key to be used for this request. | ||
*/ | ||
useMasterKey?: boolean | undefined; | ||
} | ||
export interface QueryResultOptions extends SessionTokenOption, UseMasterKeyOption, ContextOption {} | ||
export interface ObjectDestroyOptions extends SessionTokenOption, UseMasterKeyOption {} | ||
export interface FileSaveOptions extends SessionTokenOption, UseMasterKeyOption {} | ||
export type ParseFileData = number[] | { base64: string } | { size: number; type: string } | { uri: string }; |
{ | ||
"name": "@giteeteam/apps-proxima-api", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Apps Proxima API", | ||
@@ -35,4 +35,3 @@ "keywords": [ | ||
"axios": "^0.27.2" | ||
}, | ||
"gitHead": "e8ff083e6503afb82f52d17d3fcfcb348bccb014" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35780
23
980