@ptkl/sdk 0.10.2 → 1.0.0
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/dist/{index.iife.js → index.0.10.js} +393 -230
- package/dist/index.0.9.js +2849 -0
- package/dist/package.json +12 -7
- package/dist/v0.10/api/component.d.ts +128 -0
- package/dist/v0.10/api/index.d.ts +22 -0
- package/dist/{types → v0.10}/api/integrationsBaseClient.d.ts +3 -0
- package/dist/{types → v0.10}/api/platform.d.ts +2 -2
- package/dist/v0.10/apiUser.d.ts +9 -0
- package/dist/v0.10/apps.d.ts +8 -0
- package/dist/v0.10/baseClient.d.ts +6 -0
- package/dist/{types/api → v0.10}/component.d.ts +39 -4
- package/dist/v0.10/componentUtils.d.ts +7 -0
- package/dist/v0.10/config.d.ts +14 -0
- package/dist/v0.10/forge.d.ts +7 -0
- package/dist/v0.10/functions.d.ts +23 -0
- package/dist/{index.cjs.js → v0.10/index.cjs.js} +393 -230
- package/dist/v0.10/index.d.ts +21 -0
- package/dist/{index.esm.js → v0.10/index.esm.js} +392 -227
- package/dist/v0.10/integrations/dms.d.ts +469 -0
- package/dist/v0.10/integrations/invoicing.d.ts +6 -0
- package/dist/v0.10/integrations/minimax.d.ts +289 -0
- package/dist/v0.10/integrations/payments.d.ts +40 -0
- package/dist/v0.10/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.10/integrations/vpfr.d.ts +4 -0
- package/dist/v0.10/integrations.d.ts +22 -0
- package/dist/v0.10/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.10/platform.d.ts +34 -0
- package/dist/v0.10/platformBaseClient.d.ts +27 -0
- package/dist/v0.10/project.d.ts +146 -0
- package/dist/v0.10/ratchet.d.ts +196 -0
- package/dist/v0.10/sandbox.d.ts +14 -0
- package/dist/v0.10/system.d.ts +4 -0
- package/dist/v0.10/thunder.d.ts +13 -0
- package/dist/{types → v0.10}/types/component.d.ts +27 -1
- package/dist/v0.10/users.d.ts +69 -0
- package/dist/v0.10/workflow.d.ts +5 -0
- package/dist/v0.9/api/apiUser.d.ts +9 -0
- package/dist/v0.9/api/apps.d.ts +8 -0
- package/dist/v0.9/api/baseClient.d.ts +6 -0
- package/dist/v0.9/api/component.d.ts +136 -0
- package/dist/v0.9/api/componentUtils.d.ts +7 -0
- package/dist/v0.9/api/config.d.ts +14 -0
- package/dist/v0.9/api/forge.d.ts +7 -0
- package/dist/v0.9/api/functions.d.ts +23 -0
- package/dist/v0.9/api/index.d.ts +24 -0
- package/dist/v0.9/api/integrations/dms.d.ts +419 -0
- package/dist/v0.9/api/integrations/invoicing.d.ts +6 -0
- package/dist/v0.9/api/integrations/minimax.d.ts +289 -0
- package/dist/v0.9/api/integrations/payments.d.ts +40 -0
- package/dist/v0.9/api/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.9/api/integrations/vpfr.d.ts +4 -0
- package/dist/v0.9/api/integrations.d.ts +22 -0
- package/dist/v0.9/api/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.9/api/platform.d.ts +34 -0
- package/dist/v0.9/api/platformBaseClient.d.ts +27 -0
- package/dist/v0.9/api/project.d.ts +146 -0
- package/dist/v0.9/api/ratchet.d.ts +196 -0
- package/dist/v0.9/api/sandbox.d.ts +14 -0
- package/dist/v0.9/api/system.d.ts +4 -0
- package/dist/v0.9/api/thunder.d.ts +13 -0
- package/dist/v0.9/api/users.d.ts +69 -0
- package/dist/v0.9/api/workflow.d.ts +5 -0
- package/dist/v0.9/apiUser.d.ts +9 -0
- package/dist/v0.9/apps.d.ts +8 -0
- package/dist/v0.9/baseClient.d.ts +6 -0
- package/dist/v0.9/component.d.ts +128 -0
- package/dist/v0.9/componentUtils.d.ts +7 -0
- package/dist/v0.9/config.d.ts +14 -0
- package/dist/v0.9/forge.d.ts +7 -0
- package/dist/v0.9/functions.d.ts +23 -0
- package/dist/v0.9/index.cjs.js +21811 -0
- package/dist/v0.9/index.d.ts +21 -0
- package/dist/v0.9/index.esm.js +2820 -0
- package/dist/v0.9/integrations/dms.d.ts +469 -0
- package/dist/v0.9/integrations/invoicing.d.ts +6 -0
- package/dist/v0.9/integrations/minimax.d.ts +289 -0
- package/dist/v0.9/integrations/payments.d.ts +40 -0
- package/dist/v0.9/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.9/integrations/vpfr.d.ts +4 -0
- package/dist/v0.9/integrations.d.ts +22 -0
- package/dist/v0.9/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.9/platform.d.ts +34 -0
- package/dist/v0.9/platformBaseClient.d.ts +27 -0
- package/dist/v0.9/project.d.ts +146 -0
- package/dist/v0.9/ratchet.d.ts +196 -0
- package/dist/v0.9/sandbox.d.ts +14 -0
- package/dist/v0.9/system.d.ts +4 -0
- package/dist/v0.9/thunder.d.ts +13 -0
- package/dist/v0.9/types/component.d.ts +116 -0
- package/dist/v0.9/types/config.d.ts +11 -0
- package/dist/v0.9/types/integrations.d.ts +321 -0
- package/dist/v0.9/types/project.d.ts +64 -0
- package/dist/v0.9/types/ratchet.d.ts +38 -0
- package/dist/v0.9/types/users.d.ts +66 -0
- package/dist/v0.9/users.d.ts +69 -0
- package/dist/v0.9/util/detectEnv.d.ts +4 -0
- package/dist/v0.9/workflow.d.ts +5 -0
- package/package.json +12 -7
- package/dist/monaco.d.ts +0 -887
- package/dist/types/api/index.d.ts +0 -13
- package/dist/types/api/integrations/media.d.ts +0 -17
- package/dist/types/api/roles.d.ts +0 -9
- package/dist/types/index.d.ts +0 -29
- package/dist/types/types/media.d.ts +0 -103
- /package/dist/{types → v0.10}/api/apiUser.d.ts +0 -0
- /package/dist/{types → v0.10}/api/apps.d.ts +0 -0
- /package/dist/{types → v0.10}/api/baseClient.d.ts +0 -0
- /package/dist/{types → v0.10}/api/componentUtils.d.ts +0 -0
- /package/dist/{types → v0.10}/api/config.d.ts +0 -0
- /package/dist/{types → v0.10}/api/forge.d.ts +0 -0
- /package/dist/{types → v0.10}/api/functions.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/dms.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/invoicing.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/minimax.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/payments.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/serbiaUtil.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/vpfr.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations.d.ts +0 -0
- /package/dist/{types → v0.10}/api/platformBaseClient.d.ts +0 -0
- /package/dist/{types → v0.10}/api/project.d.ts +0 -0
- /package/dist/{types → v0.10}/api/ratchet.d.ts +0 -0
- /package/dist/{types → v0.10}/api/sandbox.d.ts +0 -0
- /package/dist/{types → v0.10}/api/system.d.ts +0 -0
- /package/dist/{types → v0.10}/api/thunder.d.ts +0 -0
- /package/dist/{types → v0.10}/api/users.d.ts +0 -0
- /package/dist/{types → v0.10}/api/workflow.d.ts +0 -0
- /package/dist/{types → v0.10}/types/config.d.ts +0 -0
- /package/dist/{types → v0.10}/types/integrations.d.ts +0 -0
- /package/dist/{types → v0.10}/types/project.d.ts +0 -0
- /package/dist/{types → v0.10}/types/ratchet.d.ts +0 -0
- /package/dist/{types → v0.10}/types/users.d.ts +0 -0
- /package/dist/{types → v0.10}/util/detectEnv.d.ts +0 -0
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ptkl/sdk",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "rollup -c",
|
|
6
6
|
"build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",
|
|
@@ -11,14 +11,19 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"import": "./dist/index.esm.js",
|
|
15
|
-
"require": "./dist/index.cjs.js",
|
|
16
|
-
"types": "./dist/
|
|
14
|
+
"import": "./dist/v0.9/index.esm.js",
|
|
15
|
+
"require": "./dist/v0.9/index.cjs.js",
|
|
16
|
+
"types": "./dist/v0.9/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./beta": {
|
|
19
|
+
"import": "./dist/v0.10/index.esm.js",
|
|
20
|
+
"require": "./dist/v0.10/index.cjs.js",
|
|
21
|
+
"types": "./dist/v0.10/index.d.ts"
|
|
17
22
|
}
|
|
18
23
|
},
|
|
19
|
-
"main": "./dist/index.cjs.js",
|
|
20
|
-
"module": "./dist/index.esm.js",
|
|
21
|
-
"types": "./dist/
|
|
24
|
+
"main": "./dist/v0.10/index.cjs.js",
|
|
25
|
+
"module": "./dist/v0.10/index.esm.js",
|
|
26
|
+
"types": "./dist/v0.10/index.d.ts",
|
|
22
27
|
"author": "protokol.io",
|
|
23
28
|
"license": "ISC",
|
|
24
29
|
"type": "module",
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, StreamHandler, AggregateChainable, ComponentOptions } from "../types/component";
|
|
2
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
3
|
+
import { AxiosResponse } from "axios";
|
|
4
|
+
export default class Component extends PlatformBaseClient {
|
|
5
|
+
private ref;
|
|
6
|
+
private version;
|
|
7
|
+
constructor(ref?: string | null, options?: ComponentOptions);
|
|
8
|
+
/**
|
|
9
|
+
* Get the base path for component API calls
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private getComponentPath;
|
|
13
|
+
/**
|
|
14
|
+
* Find method to search for models
|
|
15
|
+
*
|
|
16
|
+
* @param {FindParams} filters - The filters to apply to the search
|
|
17
|
+
* @param {FindOptions} opts - The options to apply to the search
|
|
18
|
+
*
|
|
19
|
+
* @returns {Promise<FindResponse>} - The result of the search
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* platform.component(name).find({
|
|
23
|
+
* currentPage: 1,
|
|
24
|
+
* perPage: 10,
|
|
25
|
+
* })
|
|
26
|
+
*
|
|
27
|
+
* // advanced search
|
|
28
|
+
* platform.component(name).find({
|
|
29
|
+
* $adv: {
|
|
30
|
+
* name: "John Doe",
|
|
31
|
+
* }
|
|
32
|
+
* )
|
|
33
|
+
**/
|
|
34
|
+
find(filters: FindParams, opts?: FindOptions): Promise<AxiosResponse<FindResponse>>;
|
|
35
|
+
/**
|
|
36
|
+
* FindOne method to search for a single model
|
|
37
|
+
*
|
|
38
|
+
* @param {FindAdvancedParams} filter - The filters to apply to the search
|
|
39
|
+
* @param {FindOptions} opts - The options to apply to the search
|
|
40
|
+
*
|
|
41
|
+
* @returns {Promise<?Model>} - The result of the search
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* platform.component(name).findOne({
|
|
45
|
+
* name: "John Doe",
|
|
46
|
+
* })
|
|
47
|
+
**/
|
|
48
|
+
findOne(filter: FindAdvancedParams, opts: FindOptions): Promise<Model | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Get model by uuid
|
|
51
|
+
*
|
|
52
|
+
* @param uuid string - The uuid of the model
|
|
53
|
+
* @returns (Promise<Model>)
|
|
54
|
+
*/
|
|
55
|
+
get(uuid: string): Promise<AxiosResponse<Model>>;
|
|
56
|
+
/**
|
|
57
|
+
* Update model by uuid
|
|
58
|
+
*
|
|
59
|
+
* @param uuid string - The uuid of the model
|
|
60
|
+
* @param data
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
update(uuid: string, data: Record<string, any>, options: UpdateOptions): Promise<AxiosResponse<any, any>>;
|
|
64
|
+
/**
|
|
65
|
+
* Update many models
|
|
66
|
+
*
|
|
67
|
+
* @param data
|
|
68
|
+
* @param options
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
updateMany(data: Record<string, any>[], options: UpdateOptions): Promise<AxiosResponse<any, any>>;
|
|
72
|
+
/**
|
|
73
|
+
* Modify models by filters
|
|
74
|
+
*
|
|
75
|
+
* @param data
|
|
76
|
+
* @param options
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
modify(filters: Record<string, any>, data: Record<string, any>, options: ModifyOptions): Promise<AxiosResponse<any, any>>;
|
|
80
|
+
/**
|
|
81
|
+
* Concurrent update model by uuid
|
|
82
|
+
*
|
|
83
|
+
* @param uuid string - The uuid of the model
|
|
84
|
+
* @param version number - The version of the model
|
|
85
|
+
* @param data
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
concurrentUpdate(uuid: string, version: number, data: Record<string, any>, options: UpdateOptions): Promise<AxiosResponse<any, any>>;
|
|
89
|
+
create(model: Record<string, any>): Promise<AxiosResponse<any, any>>;
|
|
90
|
+
delete(uuid: string): Promise<AxiosResponse<any, any>>;
|
|
91
|
+
/**
|
|
92
|
+
* Execute aggregate pipeline with optional streaming support
|
|
93
|
+
*
|
|
94
|
+
* Returns a chainable object that allows both buffered and streaming modes.
|
|
95
|
+
* Call .onData() to enable streaming mode, or await directly for buffered mode.
|
|
96
|
+
*
|
|
97
|
+
* @param {FindAggregateParams} pipeline - MongoDB aggregation pipeline
|
|
98
|
+
*
|
|
99
|
+
* @returns {AggregateChainable} Chainable object with streaming methods and Promise interface
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* // Buffered response (default, up to 5K documents)
|
|
104
|
+
* const result = await component.aggregate([{ $match: { status: 'active' } }]);
|
|
105
|
+
* console.log(result.data); // All results at once
|
|
106
|
+
*
|
|
107
|
+
* // Streaming response (up to 25K documents)
|
|
108
|
+
* await component.aggregate([{ $match: { status: 'active' } }])
|
|
109
|
+
* .onData((doc) => console.log('Received:', doc))
|
|
110
|
+
* .onError((err) => console.error('Error:', err))
|
|
111
|
+
* .onEnd(() => console.log('Stream complete'));
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
aggregate(pipeline: FindAggregateParams): AggregateChainable;
|
|
115
|
+
settings(): Promise<AxiosResponse<any, any>>;
|
|
116
|
+
saveSettings(settings: any, version: string): Promise<AxiosResponse<any, any>>;
|
|
117
|
+
saveTemplatesDist(version: string, sdkVersion: string, engine: string, dist: Record<string, string>): Promise<any>;
|
|
118
|
+
workflow(event: string, input: any): Promise<AxiosResponse<any, any>>;
|
|
119
|
+
function(name: string, input: any): Promise<AxiosResponse<any, any>>;
|
|
120
|
+
revisions(uuid: string): Promise<AxiosResponse<any, any>>;
|
|
121
|
+
/**
|
|
122
|
+
* Internal method to handle NDJSON streaming responses
|
|
123
|
+
*
|
|
124
|
+
* @private
|
|
125
|
+
*/
|
|
126
|
+
private _streamNDJSON;
|
|
127
|
+
}
|
|
128
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, StreamHandler, AggregateChainable, ComponentOptions, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as Component } from './component';
|
|
2
|
+
export { default as Platform } from './platform';
|
|
3
|
+
export { default as Functions } from './functions';
|
|
4
|
+
export { default as APIUser } from './apiUser';
|
|
5
|
+
export { default as Users } from './users';
|
|
6
|
+
export { default as Apps } from './apps';
|
|
7
|
+
export { default as ComponentUtils } from './componentUtils';
|
|
8
|
+
export { default as Thunder } from './thunder';
|
|
9
|
+
export { default as Ratchet } from './ratchet';
|
|
10
|
+
export { default as Sandbox } from './sandbox';
|
|
11
|
+
export { default as System } from './system';
|
|
12
|
+
export { default as Workflow } from './workflow';
|
|
13
|
+
export { default as Forge } from './forge';
|
|
14
|
+
export { default as Project } from './project';
|
|
15
|
+
export { default as Config } from './config';
|
|
16
|
+
export { default as Integrations } from './integrations';
|
|
17
|
+
export { default as Integration } from './integrations';
|
|
18
|
+
export { default as Payments } from './integrations/payments';
|
|
19
|
+
export { default as Invoicing } from './integrations/invoicing';
|
|
20
|
+
export { default as DMS } from './integrations/dms';
|
|
21
|
+
export { default as SerbiaUtil } from './integrations/serbiaUtil';
|
|
22
|
+
export { default as VPFR } from './integrations/vpfr';
|
|
@@ -3,7 +3,7 @@ import Functions from "./functions";
|
|
|
3
3
|
import APIUser from "./apiUser";
|
|
4
4
|
import Users from "./users";
|
|
5
5
|
import Apps from "./apps";
|
|
6
|
-
import Component from "./component";
|
|
6
|
+
import Component, { ComponentOptions } from "./component";
|
|
7
7
|
import ComponentUtils from "./componentUtils";
|
|
8
8
|
import Thunder from "./thunder";
|
|
9
9
|
import Ratchet from "./ratchet";
|
|
@@ -22,7 +22,7 @@ export default class Platform extends PlatformBaseClient {
|
|
|
22
22
|
user(): Users;
|
|
23
23
|
app(appType: string): Apps;
|
|
24
24
|
forge(): Forge;
|
|
25
|
-
component(ref: string): Component;
|
|
25
|
+
component(ref: string, options?: ComponentOptions): Component;
|
|
26
26
|
componentUtils(): ComponentUtils;
|
|
27
27
|
ratchet(): Ratchet;
|
|
28
28
|
sandbox(): Sandbox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class APIUser extends PlatformBaseClient {
|
|
3
|
+
auth(username: string, password: string, project: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
newSecret(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
revokeSecret(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
edit(uuid: string, roles: string[]): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
list(): Promise<any>;
|
|
8
|
+
get(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Apps extends PlatformBaseClient {
|
|
3
|
+
private appType;
|
|
4
|
+
constructor(appType?: string);
|
|
5
|
+
updateSettings(updateValues: any, ref: string): Promise<any>;
|
|
6
|
+
download(ref: string, version: string): Promise<any>;
|
|
7
|
+
upload(formData: FormData): Promise<any>;
|
|
8
|
+
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions } from "
|
|
1
|
+
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, StreamHandler, AggregateChainable, ComponentOptions } from "./types/component";
|
|
2
2
|
import PlatformBaseClient from "./platformBaseClient";
|
|
3
3
|
import { AxiosResponse } from "axios";
|
|
4
4
|
export default class Component extends PlatformBaseClient {
|
|
5
5
|
private ref;
|
|
6
|
-
|
|
6
|
+
private version;
|
|
7
|
+
constructor(ref?: string | null, options?: ComponentOptions);
|
|
8
|
+
/**
|
|
9
|
+
* Get the base path for component API calls
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
private getComponentPath;
|
|
7
13
|
/**
|
|
8
14
|
* Find method to search for models
|
|
9
15
|
*
|
|
@@ -82,12 +88,41 @@ export default class Component extends PlatformBaseClient {
|
|
|
82
88
|
concurrentUpdate(uuid: string, version: number, data: Record<string, any>, options: UpdateOptions): Promise<AxiosResponse<any, any>>;
|
|
83
89
|
create(model: Record<string, any>): Promise<AxiosResponse<any, any>>;
|
|
84
90
|
delete(uuid: string): Promise<AxiosResponse<any, any>>;
|
|
85
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Execute aggregate pipeline with optional streaming support
|
|
93
|
+
*
|
|
94
|
+
* Returns a chainable object that allows both buffered and streaming modes.
|
|
95
|
+
* Call .onData() to enable streaming mode, or await directly for buffered mode.
|
|
96
|
+
*
|
|
97
|
+
* @param {FindAggregateParams} pipeline - MongoDB aggregation pipeline
|
|
98
|
+
*
|
|
99
|
+
* @returns {AggregateChainable} Chainable object with streaming methods and Promise interface
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* // Buffered response (default, up to 5K documents)
|
|
104
|
+
* const result = await component.aggregate([{ $match: { status: 'active' } }]);
|
|
105
|
+
* console.log(result.data); // All results at once
|
|
106
|
+
*
|
|
107
|
+
* // Streaming response (up to 25K documents)
|
|
108
|
+
* await component.aggregate([{ $match: { status: 'active' } }])
|
|
109
|
+
* .onData((doc) => console.log('Received:', doc))
|
|
110
|
+
* .onError((err) => console.error('Error:', err))
|
|
111
|
+
* .onEnd(() => console.log('Stream complete'));
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
aggregate(pipeline: FindAggregateParams): AggregateChainable;
|
|
86
115
|
settings(): Promise<AxiosResponse<any, any>>;
|
|
87
116
|
saveSettings(settings: any, version: string): Promise<AxiosResponse<any, any>>;
|
|
88
117
|
saveTemplatesDist(version: string, sdkVersion: string, engine: string, dist: Record<string, string>): Promise<any>;
|
|
89
118
|
workflow(event: string, input: any): Promise<AxiosResponse<any, any>>;
|
|
90
119
|
function(name: string, input: any): Promise<AxiosResponse<any, any>>;
|
|
91
120
|
revisions(uuid: string): Promise<AxiosResponse<any, any>>;
|
|
121
|
+
/**
|
|
122
|
+
* Internal method to handle NDJSON streaming responses
|
|
123
|
+
*
|
|
124
|
+
* @private
|
|
125
|
+
*/
|
|
126
|
+
private _streamNDJSON;
|
|
92
127
|
}
|
|
93
|
-
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, };
|
|
128
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, StreamHandler, AggregateChainable, ComponentOptions, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AxiosResponse } from "axios";
|
|
2
|
+
import { ComponentListResponse } from "./types/component";
|
|
3
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
4
|
+
export default class ComponentUtils extends PlatformBaseClient {
|
|
5
|
+
list(): Promise<AxiosResponse<ComponentListResponse>>;
|
|
6
|
+
create(data: any): Promise<AxiosResponse<any, any>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
import { AxiosResponse } from "axios";
|
|
3
|
+
import { ConfigUpdateRequest, UserConfig } from './types/config';
|
|
4
|
+
export default class Config extends PlatformBaseClient {
|
|
5
|
+
/**
|
|
6
|
+
* Get user configuration
|
|
7
|
+
*/
|
|
8
|
+
getUserConfig(): Promise<AxiosResponse<UserConfig>>;
|
|
9
|
+
/**
|
|
10
|
+
* Update user configuration
|
|
11
|
+
* @param config Configuration data
|
|
12
|
+
*/
|
|
13
|
+
updateUserConfig(config: ConfigUpdateRequest): Promise<AxiosResponse<any>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Forge extends PlatformBaseClient {
|
|
3
|
+
bundleUpload(buffer: Buffer): Promise<any>;
|
|
4
|
+
getWorkspaceApps(): Promise<any>;
|
|
5
|
+
removeVersion(ref: string, version: string): Promise<any>;
|
|
6
|
+
list(): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Functions extends PlatformBaseClient {
|
|
3
|
+
list(): Promise<any>;
|
|
4
|
+
get(ref: string): Promise<any>;
|
|
5
|
+
update(uuid: string, update: any): Promise<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Run platform function
|
|
8
|
+
*
|
|
9
|
+
* @param id - Function ID
|
|
10
|
+
* @param input - Input data
|
|
11
|
+
* @param query - Query parameters
|
|
12
|
+
* @returns - Function result
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
|
|
16
|
+
*/
|
|
17
|
+
run(id: string, d: {
|
|
18
|
+
input?: Record<string, any>;
|
|
19
|
+
query?: Record<string, string>;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
}): Promise<any>;
|
|
22
|
+
generateSignature(ref: string, env: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
23
|
+
}
|