Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alipay/faas-server-sdk

Package Overview
Dependencies
Maintainers
2
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alipay/faas-server-sdk - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

5

lib/Database/Collection.d.ts

@@ -1,3 +0,5 @@

import type { AddDocumentParam, QueryChainCommand, Sort } from '@alipay/faas-db-builder';
import type { AddDocumentParam, QueryChainCommand } from '@alipay/faas-db-builder';
import { Sort } from '@alipay/faas-db-builder';
import { CloudConfig } from '@alipay/faas-server-utils';
import { CountDocumentResult } from '../types';
import { Document } from './Document';

@@ -16,2 +18,3 @@ import { Query } from './Query';

get<T = any>(): Promise<Array<T>>;
count(): Promise<CountDocumentResult>;
}

@@ -18,0 +21,0 @@ export type AddDocumentResult = {

2

lib/Database/Collection.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Collection=void 0;const faas_db_builder_1=require("@alipay/faas-db-builder"),faas_server_utils_1=require("@alipay/faas-server-utils"),errors_1=require("../errors"),middlewares_1=require("../requester/middlewares"),Document_1=require("./Document"),Query_1=require("./Query");class Collection{#e;#t;#r;constructor(e,t){this.#t=t,this.#r=new faas_db_builder_1.CollectionBuilder(t),this.#e=e}async add(e){const{options:t}=this.#r.add(e),s="POST",i=this.#s(e.data._id),n=(0,faas_server_utils_1.getAlipayContext)();t._openid=t._openid||n.OPENID;const r=await middlewares_1.HttpRequester.database.request(s,i,t,{},{cloudConfig:this.#e});if(!r.succeed)throw errors_1.errors.SYS_ERR(r.errMsg);return r.data}doc(e){return new Document_1.Document(this.#t,e,this.#e)}limit(e){return new Query_1.Query(this.#t,this.#e).limit(e)}skip(e){return new Query_1.Query(this.#t,this.#e).skip(e)}where(e){return new Query_1.Query(this.#t,this.#e).where(e)}projection(e){return new Query_1.Query(this.#t,this.#e).projection(e)}orderBy(e,t){return new Query_1.Query(this.#t,this.#e).orderBy(e,t)}async get(){return await new Query_1.Query(this.#t,this.#e).get()}#s(e){return e||(e=""),`${this.#e.functionDatabaseEndpoint}/${this.#e.functionDatabaseName||"faas"}/${this.#t}?_id=${e}`}}exports.Collection=Collection;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Collection=void 0;const faas_db_builder_1=require("@alipay/faas-db-builder"),faas_server_utils_1=require("@alipay/faas-server-utils"),errors_1=require("../errors"),middlewares_1=require("../requester/middlewares"),Document_1=require("./Document"),Query_1=require("./Query");class Collection{#e;#t;#r;constructor(e,t){this.#t=t,this.#r=new faas_db_builder_1.CollectionBuilder(t),this.#e=e}async add(e){const{options:t}=this.#r.add(e),s="POST",i=this.#s(e.data._id),n=(0,faas_server_utils_1.getAlipayContext)();t._openid=t._openid||n.OPENID;const r=await middlewares_1.HttpRequester.database.request(s,i,t,{},{cloudConfig:this.#e});if(!r.succeed)throw errors_1.errors.SYS_ERR(r.errMsg);return r.data}doc(e){return new Document_1.Document(this.#t,e,this.#e)}limit(e){return new Query_1.Query(this.#t,this.#e).limit(e)}skip(e){return new Query_1.Query(this.#t,this.#e).skip(e)}where(e){return new Query_1.Query(this.#t,this.#e).where(e)}projection(e){return new Query_1.Query(this.#t,this.#e).projection(e)}orderBy(e,t){return new Query_1.Query(this.#t,this.#e).orderBy(e,t)}async get(){return await new Query_1.Query(this.#t,this.#e).get()}async count(){return await new Query_1.Query(this.#t,this.#e).count()}#s(e){return e||(e=""),`${this.#e.functionDatabaseEndpoint}/${this.#e.functionDatabaseName||"faas"}/${this.#t}?_id=${e}`}}exports.Collection=Collection;
import type { QueryChainCommand, UpdateData } from '@alipay/faas-db-builder';
import { Sort } from '@alipay/faas-db-builder';
import type { CloudConfig } from '@alipay/faas-server-utils';
import { DeleteResult, UpdateResult } from '../types';
import { CountDocumentResult, DeleteResult, UpdateResult } from '../types';
export declare class Query {

@@ -17,2 +17,3 @@ #private;

get<T = any>(): Promise<Array<T>>;
count(): Promise<CountDocumentResult>;
}

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Query=void 0;const faas_db_builder_1=require("@alipay/faas-db-builder"),errors_1=require("../errors"),middlewares_1=require("../requester/middlewares");class Query{#e;#r;#t;constructor(t,e){this.#r=t,this.#e=e,this.#t=new faas_db_builder_1.QueryBuilder(t)}limit(t){return this.#t.limit(t),this}skip(t){return this.#t.skip(t),this}where(t){return this.#t.where(t),this}projection(t){return this.#t.projection(t),this}orderBy(t,e){return this.#t.orderBy(t,e),this}async update(t){const e="POST",r=`${this.#s()}?update`,{options:s}=this.#t.update(t),o=await middlewares_1.HttpRequester.database.request(e,r,s,{},{cloudConfig:this.#e});if(!o.succeed)throw errors_1.errors.SYS_ERR(o.errMsg);return o.data}async set(t){const e="POST",r=`${this.#s()}?replace`,{options:s}=this.#t.set(t),o=await middlewares_1.HttpRequester.database.request(e,r,s,{},{cloudConfig:this.#e});if(!o.succeed)throw errors_1.errors.SYS_ERR(o.errMsg);return o.data}async remove(){const t="POST",e=`${this.#s()}?delete`,{options:r}=this.#t.remove(),s=await middlewares_1.HttpRequester.database.request(t,e,r,{},{cloudConfig:this.#e});if(!s.succeed)throw errors_1.errors.SYS_ERR(s.errMsg);return s.data}async get(){const t="POST",e=`${this.#s()}?query`,{options:r}=this.#t.get(),s=await middlewares_1.HttpRequester.database.request(t,e,r,{},{cloudConfig:this.#e});if(!s.succeed)throw errors_1.errors.SYS_ERR(s.errMsg);return s.data}#s(){return`${this.#e.functionDatabaseEndpoint}/${this.#e.functionDatabaseName||"faas"}/${this.#r}`}}exports.Query=Query;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Query=void 0;const faas_db_builder_1=require("@alipay/faas-db-builder"),errors_1=require("../errors"),middlewares_1=require("../requester/middlewares");class Query{#e;#r;#t;constructor(t,s){this.#r=t,this.#e=s,this.#t=new faas_db_builder_1.QueryBuilder(t)}limit(t){return this.#t.limit(t),this}skip(t){return this.#t.skip(t),this}where(t){return this.#t.where(t),this}projection(t){return this.#t.projection(t),this}orderBy(t,s){return this.#t.orderBy(t,s),this}async update(t){const s="POST",r=`${this.#s()}?update`,{options:e}=this.#t.update(t),o=await middlewares_1.HttpRequester.database.request(s,r,e,{},{cloudConfig:this.#e});if(!o.succeed)throw errors_1.errors.SYS_ERR(o.errMsg);return o.data}async set(t){const s="POST",r=`${this.#s()}?replace`,{options:e}=this.#t.set(t),o=await middlewares_1.HttpRequester.database.request(s,r,e,{},{cloudConfig:this.#e});if(!o.succeed)throw errors_1.errors.SYS_ERR(o.errMsg);return o.data}async remove(){const t="POST",s=`${this.#s()}?delete`,{options:r}=this.#t.remove(),e=await middlewares_1.HttpRequester.database.request(t,s,r,{},{cloudConfig:this.#e});if(!e.succeed)throw errors_1.errors.SYS_ERR(e.errMsg);return e.data}async get(){const t="POST",s=`${this.#s()}?query`,{options:r}=this.#t.get(),e=await middlewares_1.HttpRequester.database.request(t,s,r,{},{cloudConfig:this.#e});if(!e.succeed)throw errors_1.errors.SYS_ERR(e.errMsg);return e.data}async count(){const t="POST",s=`${this.#s()}?count`,{options:r}=this.#t.count(),e=await middlewares_1.HttpRequester.database.request(t,s,r,{},{cloudConfig:this.#e});if(!e.succeed)throw errors_1.errors.SYS_ERR(e.errMsg);return{total:e.data.count}}#s(){return`${this.#e.functionDatabaseEndpoint}/${this.#e.functionDatabaseName||"faas"}/${this.#r}`}}exports.Query=Query;

@@ -91,1 +91,4 @@ /// <reference types="node" />

}
export interface CountDocumentResult {
total: number;
}
{
"name": "@alipay/faas-server-sdk",
"version": "1.0.3",
"version": "1.0.4",
"description": "云函数服务 SDK",

@@ -33,4 +33,4 @@ "main": "lib/index.js",

"dependencies": {
"@alipay/faas-db-builder": "^1.0.3",
"@alipay/faas-server-utils": "^1.0.1",
"@alipay/faas-db-builder": "^1.0.4",
"@alipay/faas-server-utils": "^1.0.4",
"ali-rds": "^5.1.2",

@@ -37,0 +37,0 @@ "koa-compose": "^4.1.0",

@@ -16,5 +16,1 @@ # @alipay/faas-server-sdk

```
## 发布
代码合入 master 后,到 [antcode](https://code.alipay.com/alipay-sofa/cloudfunc-noderuntime/tags) 中新建 tag,此时触发的 aci 流水线将会执行 [npm 包](https://www.npmjs.com/package/@alipay/faas-server-sdk)发布任务。
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc