@retab/node 0.0.48 → 0.0.52
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/README.md +8 -215
- package/dist/api/client.d.ts +2 -2
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +2 -2
- package/dist/api/documents/client.d.ts +3 -3
- package/dist/api/documents/client.d.ts.map +1 -1
- package/dist/api/documents/client.js +3 -3
- package/dist/api/projects/client.d.ts +15 -0
- package/dist/api/projects/client.d.ts.map +1 -0
- package/dist/api/projects/client.js +43 -0
- package/dist/api/projects/documents/client.d.ts +12 -0
- package/dist/api/projects/documents/client.d.ts.map +1 -0
- package/dist/api/projects/documents/client.js +39 -0
- package/dist/api/projects/iterations/client.d.ts +17 -0
- package/dist/api/projects/iterations/client.d.ts.map +1 -0
- package/dist/api/projects/iterations/client.js +64 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -1
- package/dist/generated_types.d.ts +17837 -40090
- package/dist/generated_types.d.ts.map +1 -1
- package/dist/generated_types.js +309 -979
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +188 -80
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +22 -1
- package/package.json +6 -9
- package/dist/api/consensus/client.d.ts +0 -7
- package/dist/api/consensus/client.d.ts.map +0 -1
- package/dist/api/consensus/client.js +0 -14
- package/dist/errors.d.ts +0 -34
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -53
- package/dist/resource.d.ts +0 -12
- package/dist/resource.d.ts.map +0 -1
- package/dist/resource.js +0 -19
- package/dist/resources/consensus/completions.d.ts +0 -66
- package/dist/resources/consensus/completions.d.ts.map +0 -1
- package/dist/resources/consensus/completions.js +0 -84
- package/dist/resources/consensus/index.d.ts +0 -72
- package/dist/resources/consensus/index.d.ts.map +0 -1
- package/dist/resources/consensus/index.js +0 -76
- package/dist/resources/consensus/responses.d.ts +0 -69
- package/dist/resources/consensus/responses.d.ts.map +0 -1
- package/dist/resources/consensus/responses.js +0 -99
- package/dist/resources/documents/extractions.d.ts +0 -74
- package/dist/resources/documents/extractions.d.ts.map +0 -1
- package/dist/resources/documents/extractions.js +0 -196
- package/dist/resources/documents/index.d.ts +0 -21
- package/dist/resources/documents/index.d.ts.map +0 -1
- package/dist/resources/documents/index.js +0 -55
- package/dist/resources/evaluations/documents.d.ts +0 -40
- package/dist/resources/evaluations/documents.d.ts.map +0 -1
- package/dist/resources/evaluations/documents.js +0 -123
- package/dist/resources/evaluations/index.d.ts +0 -14
- package/dist/resources/evaluations/index.d.ts.map +0 -1
- package/dist/resources/evaluations/index.js +0 -17
- package/dist/resources/evaluations/iterations.d.ts +0 -50
- package/dist/resources/evaluations/iterations.d.ts.map +0 -1
- package/dist/resources/evaluations/iterations.js +0 -156
- package/dist/resources/files.d.ts +0 -82
- package/dist/resources/files.d.ts.map +0 -1
- package/dist/resources/files.js +0 -150
- package/dist/resources/finetuning.d.ts +0 -105
- package/dist/resources/finetuning.d.ts.map +0 -1
- package/dist/resources/finetuning.js +0 -181
- package/dist/resources/index.d.ts +0 -11
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/resources/index.js +0 -10
- package/dist/resources/models.d.ts +0 -57
- package/dist/resources/models.d.ts.map +0 -1
- package/dist/resources/models.js +0 -72
- package/dist/resources/processors/automations/endpoints.d.ts +0 -90
- package/dist/resources/processors/automations/endpoints.d.ts.map +0 -1
- package/dist/resources/processors/automations/endpoints.js +0 -145
- package/dist/resources/processors/automations/index.d.ts +0 -7
- package/dist/resources/processors/automations/index.d.ts.map +0 -1
- package/dist/resources/processors/automations/index.js +0 -6
- package/dist/resources/processors/automations/links.d.ts +0 -90
- package/dist/resources/processors/automations/links.d.ts.map +0 -1
- package/dist/resources/processors/automations/links.js +0 -149
- package/dist/resources/processors/automations/logs.d.ts +0 -35
- package/dist/resources/processors/automations/logs.d.ts.map +0 -1
- package/dist/resources/processors/automations/logs.js +0 -60
- package/dist/resources/processors/automations/mailboxes.d.ts +0 -102
- package/dist/resources/processors/automations/mailboxes.d.ts.map +0 -1
- package/dist/resources/processors/automations/mailboxes.js +0 -157
- package/dist/resources/processors/automations/outlook.d.ts +0 -114
- package/dist/resources/processors/automations/outlook.d.ts.map +0 -1
- package/dist/resources/processors/automations/outlook.js +0 -170
- package/dist/resources/processors/automations/tests.d.ts +0 -58
- package/dist/resources/processors/automations/tests.d.ts.map +0 -1
- package/dist/resources/processors/automations/tests.js +0 -90
- package/dist/resources/processors/index.d.ts +0 -303
- package/dist/resources/processors/index.d.ts.map +0 -1
- package/dist/resources/processors/index.js +0 -261
- package/dist/resources/schemas.d.ts +0 -63
- package/dist/resources/schemas.d.ts.map +0 -1
- package/dist/resources/schemas.js +0 -183
- package/dist/resources/secrets/external_api_keys.d.ts +0 -61
- package/dist/resources/secrets/external_api_keys.d.ts.map +0 -1
- package/dist/resources/secrets/external_api_keys.js +0 -120
- package/dist/resources/secrets/index.d.ts +0 -14
- package/dist/resources/secrets/index.d.ts.map +0 -1
- package/dist/resources/secrets/index.js +0 -17
- package/dist/resources/secrets/webhooks.d.ts +0 -73
- package/dist/resources/secrets/webhooks.d.ts.map +0 -1
- package/dist/resources/secrets/webhooks.js +0 -145
- package/dist/resources/usage.d.ts +0 -223
- package/dist/resources/usage.d.ts.map +0 -1
- package/dist/resources/usage.js +0 -310
- package/dist/types/ai_models.d.ts +0 -389
- package/dist/types/ai_models.d.ts.map +0 -1
- package/dist/types/ai_models.js +0 -145
- package/dist/types/automations/cron.d.ts +0 -28
- package/dist/types/automations/cron.d.ts.map +0 -1
- package/dist/types/automations/cron.js +0 -1
- package/dist/types/automations/endpoints.d.ts +0 -13
- package/dist/types/automations/endpoints.d.ts.map +0 -1
- package/dist/types/automations/endpoints.js +0 -1
- package/dist/types/automations/index.d.ts +0 -7
- package/dist/types/automations/index.d.ts.map +0 -1
- package/dist/types/automations/index.js +0 -6
- package/dist/types/automations/links.d.ts +0 -15
- package/dist/types/automations/links.d.ts.map +0 -1
- package/dist/types/automations/links.js +0 -1
- package/dist/types/automations/mailboxes.d.ts +0 -18
- package/dist/types/automations/mailboxes.d.ts.map +0 -1
- package/dist/types/automations/mailboxes.js +0 -1
- package/dist/types/automations/outlook.d.ts +0 -37
- package/dist/types/automations/outlook.d.ts.map +0 -1
- package/dist/types/automations/outlook.js +0 -1
- package/dist/types/automations/webhooks.d.ts +0 -13
- package/dist/types/automations/webhooks.d.ts.map +0 -1
- package/dist/types/automations/webhooks.js +0 -1
- package/dist/types/browser_canvas.d.ts +0 -4
- package/dist/types/browser_canvas.d.ts.map +0 -1
- package/dist/types/browser_canvas.js +0 -2
- package/dist/types/chat.d.ts +0 -99
- package/dist/types/chat.d.ts.map +0 -1
- package/dist/types/chat.js +0 -20
- package/dist/types/consensus.d.ts +0 -10
- package/dist/types/consensus.d.ts.map +0 -1
- package/dist/types/consensus.js +0 -1
- package/dist/types/db/annotations.d.ts +0 -108
- package/dist/types/db/annotations.d.ts.map +0 -1
- package/dist/types/db/annotations.js +0 -6
- package/dist/types/db/files.d.ts +0 -133
- package/dist/types/db/files.d.ts.map +0 -1
- package/dist/types/db/files.js +0 -5
- package/dist/types/documents/extractions.d.ts +0 -1849
- package/dist/types/documents/extractions.d.ts.map +0 -1
- package/dist/types/documents/extractions.js +0 -211
- package/dist/types/documents/processing.d.ts +0 -249
- package/dist/types/documents/processing.d.ts.map +0 -1
- package/dist/types/documents/processing.js +0 -6
- package/dist/types/evaluations/iterations.d.ts +0 -41
- package/dist/types/evaluations/iterations.d.ts.map +0 -1
- package/dist/types/evaluations/iterations.js +0 -1
- package/dist/types/jobs/base.d.ts +0 -162
- package/dist/types/jobs/base.d.ts.map +0 -1
- package/dist/types/jobs/base.js +0 -6
- package/dist/types/jobs/specialized.d.ts +0 -200
- package/dist/types/jobs/specialized.d.ts.map +0 -1
- package/dist/types/jobs/specialized.js +0 -37
- package/dist/types/logs.d.ts +0 -92
- package/dist/types/logs.d.ts.map +0 -1
- package/dist/types/logs.js +0 -1
- package/dist/types/mime.d.ts +0 -426
- package/dist/types/mime.d.ts.map +0 -1
- package/dist/types/mime.js +0 -48
- package/dist/types/modalities.d.ts +0 -31
- package/dist/types/modalities.d.ts.map +0 -1
- package/dist/types/modalities.js +0 -109
- package/dist/types/pagination.d.ts +0 -5
- package/dist/types/pagination.d.ts.map +0 -1
- package/dist/types/pagination.js +0 -1
- package/dist/types/schemas/enhancement.d.ts +0 -250
- package/dist/types/schemas/enhancement.d.ts.map +0 -1
- package/dist/types/schemas/enhancement.js +0 -6
- package/dist/types/schemas/generate.d.ts +0 -160
- package/dist/types/schemas/generate.d.ts.map +0 -1
- package/dist/types/schemas/generate.js +0 -19
- package/dist/types/schemas/object.d.ts +0 -116
- package/dist/types/schemas/object.d.ts.map +0 -1
- package/dist/types/schemas/object.js +0 -861
- package/dist/types/secrets/external_api_keys.d.ts +0 -27
- package/dist/types/secrets/external_api_keys.d.ts.map +0 -1
- package/dist/types/secrets/external_api_keys.js +0 -11
- package/dist/types/secrets/index.d.ts +0 -2
- package/dist/types/secrets/index.d.ts.map +0 -1
- package/dist/types/secrets/index.js +0 -1
- package/dist/types/standards.d.ts +0 -37
- package/dist/types/standards.d.ts.map +0 -1
- package/dist/types/standards.js +0 -1
- package/dist/utils/ai_models.d.ts +0 -10
- package/dist/utils/ai_models.d.ts.map +0 -1
- package/dist/utils/ai_models.js +0 -183
- package/dist/utils/batch_processing.d.ts +0 -227
- package/dist/utils/batch_processing.d.ts.map +0 -1
- package/dist/utils/batch_processing.js +0 -268
- package/dist/utils/benchmarking.d.ts +0 -115
- package/dist/utils/benchmarking.d.ts.map +0 -1
- package/dist/utils/benchmarking.js +0 -355
- package/dist/utils/chat.d.ts +0 -70
- package/dist/utils/chat.d.ts.map +0 -1
- package/dist/utils/chat.js +0 -79
- package/dist/utils/cost_calculation.d.ts +0 -26
- package/dist/utils/cost_calculation.d.ts.map +0 -1
- package/dist/utils/cost_calculation.js +0 -99
- package/dist/utils/datasets.d.ts +0 -135
- package/dist/utils/datasets.d.ts.map +0 -1
- package/dist/utils/datasets.js +0 -359
- package/dist/utils/display.d.ts +0 -108
- package/dist/utils/display.d.ts.map +0 -1
- package/dist/utils/display.js +0 -244
- package/dist/utils/hash.d.ts +0 -18
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/hash.js +0 -31
- package/dist/utils/hashing.d.ts +0 -18
- package/dist/utils/hashing.d.ts.map +0 -1
- package/dist/utils/hashing.js +0 -28
- package/dist/utils/index.d.ts +0 -8
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -10
- package/dist/utils/json_schema.d.ts +0 -18
- package/dist/utils/json_schema.d.ts.map +0 -1
- package/dist/utils/json_schema.js +0 -334
- package/dist/utils/json_schema_utils.d.ts +0 -42
- package/dist/utils/json_schema_utils.d.ts.map +0 -1
- package/dist/utils/json_schema_utils.js +0 -212
- package/dist/utils/jsonl.d.ts +0 -60
- package/dist/utils/jsonl.d.ts.map +0 -1
- package/dist/utils/jsonl.js +0 -259
- package/dist/utils/mime.d.ts +0 -6
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/mime.js +0 -129
- package/dist/utils/model_cards.d.ts +0 -219
- package/dist/utils/model_cards.d.ts.map +0 -1
- package/dist/utils/model_cards.js +0 -462
- package/dist/utils/prompt_optimization.d.ts +0 -96
- package/dist/utils/prompt_optimization.d.ts.map +0 -1
- package/dist/utils/prompt_optimization.js +0 -275
- package/dist/utils/responses.d.ts +0 -35
- package/dist/utils/responses.d.ts.map +0 -1
- package/dist/utils/responses.js +0 -37
- package/dist/utils/stream.d.ts +0 -13
- package/dist/utils/stream.d.ts.map +0 -1
- package/dist/utils/stream.js +0 -64
- package/dist/utils/stream_context_managers.d.ts +0 -147
- package/dist/utils/stream_context_managers.d.ts.map +0 -1
- package/dist/utils/stream_context_managers.js +0 -380
- package/dist/utils/usage.d.ts +0 -57
- package/dist/utils/usage.d.ts.map +0 -1
- package/dist/utils/usage.js +0 -97
- package/dist/utils/webhook_secrets.d.ts +0 -59
- package/dist/utils/webhook_secrets.d.ts.map +0 -1
- package/dist/utils/webhook_secrets.js +0 -107
- package/dist/utils/zod_to_json_schema.d.ts +0 -11
- package/dist/utils/zod_to_json_schema.d.ts.map +0 -1
- package/dist/utils/zod_to_json_schema.js +0 -123
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { Consensus, AsyncConsensus } from './consensus/index.js';
|
|
2
|
-
export { Documents, AsyncDocuments } from './documents/index.js';
|
|
3
|
-
export { Evaluations, AsyncEvaluations } from './evaluations/index.js';
|
|
4
|
-
export { Files, AsyncFiles } from './files.js';
|
|
5
|
-
export { FineTuning, AsyncFineTuning } from './finetuning.js';
|
|
6
|
-
export { Models, AsyncModels } from './models.js';
|
|
7
|
-
export { Processors, AsyncProcessors } from './processors/index.js';
|
|
8
|
-
export { Schemas, AsyncSchemas } from './schemas.js';
|
|
9
|
-
export { Secrets, AsyncSecrets } from './secrets/index.js';
|
|
10
|
-
export { Usage, AsyncUsage } from './usage.js';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/resources/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { Consensus, AsyncConsensus } from './consensus/index.js';
|
|
2
|
-
export { Documents, AsyncDocuments } from './documents/index.js';
|
|
3
|
-
export { Evaluations, AsyncEvaluations } from './evaluations/index.js';
|
|
4
|
-
export { Files, AsyncFiles } from './files.js';
|
|
5
|
-
export { FineTuning, AsyncFineTuning } from './finetuning.js';
|
|
6
|
-
export { Models, AsyncModels } from './models.js';
|
|
7
|
-
export { Processors, AsyncProcessors } from './processors/index.js';
|
|
8
|
-
export { Schemas, AsyncSchemas } from './schemas.js';
|
|
9
|
-
export { Secrets, AsyncSecrets } from './secrets/index.js';
|
|
10
|
-
export { Usage, AsyncUsage } from './usage.js';
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../resource.js';
|
|
2
|
-
import { PreparedRequest } from '../types/standards.js';
|
|
3
|
-
export interface Model {
|
|
4
|
-
id: string;
|
|
5
|
-
object: 'model';
|
|
6
|
-
created: number;
|
|
7
|
-
owned_by: string;
|
|
8
|
-
permission?: any[];
|
|
9
|
-
root?: string;
|
|
10
|
-
parent?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ModelListResponse {
|
|
13
|
-
data: Model[];
|
|
14
|
-
object: 'list';
|
|
15
|
-
}
|
|
16
|
-
export declare class ModelsMixin {
|
|
17
|
-
prepareList(params?: {
|
|
18
|
-
supports_finetuning?: boolean;
|
|
19
|
-
supports_image?: boolean;
|
|
20
|
-
include_finetuned_models?: boolean;
|
|
21
|
-
}): PreparedRequest;
|
|
22
|
-
}
|
|
23
|
-
export declare class Models extends SyncAPIResource {
|
|
24
|
-
private mixin;
|
|
25
|
-
/**
|
|
26
|
-
* List all available models.
|
|
27
|
-
*
|
|
28
|
-
* @param supports_finetuning - Filter for models that support fine-tuning
|
|
29
|
-
* @param supports_image - Filter for models that support image inputs
|
|
30
|
-
* @param include_finetuned_models - Include fine-tuned models in results
|
|
31
|
-
* @returns Promise<Model[]> - List of available models
|
|
32
|
-
* @throws HTTPException if the request fails
|
|
33
|
-
*/
|
|
34
|
-
list(params?: {
|
|
35
|
-
supports_finetuning?: boolean;
|
|
36
|
-
supports_image?: boolean;
|
|
37
|
-
include_finetuned_models?: boolean;
|
|
38
|
-
}): Promise<Model[]>;
|
|
39
|
-
}
|
|
40
|
-
export declare class AsyncModels extends AsyncAPIResource {
|
|
41
|
-
private mixin;
|
|
42
|
-
/**
|
|
43
|
-
* List all available models asynchronously.
|
|
44
|
-
*
|
|
45
|
-
* @param supports_finetuning - Filter for models that support fine-tuning
|
|
46
|
-
* @param supports_image - Filter for models that support image inputs
|
|
47
|
-
* @param include_finetuned_models - Include fine-tuned models in results
|
|
48
|
-
* @returns Promise<Model[]> - List of available models
|
|
49
|
-
* @throws HTTPException if the request fails
|
|
50
|
-
*/
|
|
51
|
-
list(params?: {
|
|
52
|
-
supports_finetuning?: boolean;
|
|
53
|
-
supports_image?: boolean;
|
|
54
|
-
include_finetuned_models?: boolean;
|
|
55
|
-
}): Promise<Model[]>;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/resources/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,WAAW;IACtB,WAAW,CAAC,MAAM,GAAE;QAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;KAC/B,GAAG,eAAe;CAmBzB;AAED,qBAAa,MAAO,SAAQ,eAAe;IACzC,OAAO,CAAC,KAAK,CAAqB;IAElC;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,GAAE;QACX,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;KAC/B,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAa1B;AAED,qBAAa,WAAY,SAAQ,gBAAgB;IAC/C,OAAO,CAAC,KAAK,CAAqB;IAElC;;;;;;;;OAQG;IACG,IAAI,CAAC,MAAM,GAAE;QACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;KAC/B,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAa1B"}
|
package/dist/resources/models.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../resource.js';
|
|
2
|
-
export class ModelsMixin {
|
|
3
|
-
prepareList(params = {}) {
|
|
4
|
-
const { supports_finetuning = false, supports_image = false, include_finetuned_models = true, } = params;
|
|
5
|
-
const queryParams = {
|
|
6
|
-
supports_finetuning,
|
|
7
|
-
supports_image,
|
|
8
|
-
include_finetuned_models,
|
|
9
|
-
};
|
|
10
|
-
return {
|
|
11
|
-
method: 'GET',
|
|
12
|
-
url: '/v1/models',
|
|
13
|
-
params: queryParams,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export class Models extends SyncAPIResource {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.mixin = new ModelsMixin();
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* List all available models.
|
|
24
|
-
*
|
|
25
|
-
* @param supports_finetuning - Filter for models that support fine-tuning
|
|
26
|
-
* @param supports_image - Filter for models that support image inputs
|
|
27
|
-
* @param include_finetuned_models - Include fine-tuned models in results
|
|
28
|
-
* @returns Promise<Model[]> - List of available models
|
|
29
|
-
* @throws HTTPException if the request fails
|
|
30
|
-
*/
|
|
31
|
-
list(params = {}) {
|
|
32
|
-
const request = this.mixin.prepareList(params);
|
|
33
|
-
const response = this._client._preparedRequest(request);
|
|
34
|
-
return response.then(output => output.data.map(model => ({
|
|
35
|
-
id: model.id,
|
|
36
|
-
object: 'model',
|
|
37
|
-
created: model.created,
|
|
38
|
-
owned_by: model.owned_by,
|
|
39
|
-
permission: model.permission,
|
|
40
|
-
root: model.root,
|
|
41
|
-
parent: model.parent,
|
|
42
|
-
})));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export class AsyncModels extends AsyncAPIResource {
|
|
46
|
-
constructor() {
|
|
47
|
-
super(...arguments);
|
|
48
|
-
this.mixin = new ModelsMixin();
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* List all available models asynchronously.
|
|
52
|
-
*
|
|
53
|
-
* @param supports_finetuning - Filter for models that support fine-tuning
|
|
54
|
-
* @param supports_image - Filter for models that support image inputs
|
|
55
|
-
* @param include_finetuned_models - Include fine-tuned models in results
|
|
56
|
-
* @returns Promise<Model[]> - List of available models
|
|
57
|
-
* @throws HTTPException if the request fails
|
|
58
|
-
*/
|
|
59
|
-
async list(params = {}) {
|
|
60
|
-
const request = this.mixin.prepareList(params);
|
|
61
|
-
const output = await this._client._preparedRequest(request);
|
|
62
|
-
return output.data.map(model => ({
|
|
63
|
-
id: model.id,
|
|
64
|
-
object: 'model',
|
|
65
|
-
created: model.created,
|
|
66
|
-
owned_by: model.owned_by,
|
|
67
|
-
permission: model.permission,
|
|
68
|
-
root: model.root,
|
|
69
|
-
parent: model.parent,
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../../resource.js';
|
|
2
|
-
import { Endpoint, ListEndpoints } from '../../../types/automations/endpoints.js';
|
|
3
|
-
export declare class EndpointsMixin {
|
|
4
|
-
prepareCreate(params: {
|
|
5
|
-
processor_id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
webhook_url: string;
|
|
8
|
-
model?: string;
|
|
9
|
-
webhook_headers?: Record<string, string>;
|
|
10
|
-
need_validation?: boolean;
|
|
11
|
-
}): any;
|
|
12
|
-
prepareList(params: {
|
|
13
|
-
processor_id: string;
|
|
14
|
-
before?: string;
|
|
15
|
-
after?: string;
|
|
16
|
-
limit?: number;
|
|
17
|
-
order?: 'asc' | 'desc';
|
|
18
|
-
name?: string;
|
|
19
|
-
webhook_url?: string;
|
|
20
|
-
}): any;
|
|
21
|
-
prepareGet(endpoint_id: string): any;
|
|
22
|
-
prepareUpdate(params: {
|
|
23
|
-
endpoint_id: string;
|
|
24
|
-
name?: string;
|
|
25
|
-
default_language?: string;
|
|
26
|
-
webhook_url?: string;
|
|
27
|
-
webhook_headers?: Record<string, string>;
|
|
28
|
-
need_validation?: boolean;
|
|
29
|
-
}): any;
|
|
30
|
-
prepareDelete(endpoint_id: string): any;
|
|
31
|
-
}
|
|
32
|
-
export declare class Endpoints extends SyncAPIResource {
|
|
33
|
-
mixin: EndpointsMixin;
|
|
34
|
-
create(params: {
|
|
35
|
-
processor_id: string;
|
|
36
|
-
name: string;
|
|
37
|
-
webhook_url: string;
|
|
38
|
-
webhook_headers?: Record<string, string>;
|
|
39
|
-
need_validation?: boolean;
|
|
40
|
-
}): Promise<Endpoint>;
|
|
41
|
-
list(params: {
|
|
42
|
-
processor_id: string;
|
|
43
|
-
before?: string;
|
|
44
|
-
after?: string;
|
|
45
|
-
limit?: number;
|
|
46
|
-
order?: 'asc' | 'desc';
|
|
47
|
-
name?: string;
|
|
48
|
-
webhook_url?: string;
|
|
49
|
-
}): Promise<ListEndpoints>;
|
|
50
|
-
get(endpoint_id: string): Promise<Endpoint>;
|
|
51
|
-
update(params: {
|
|
52
|
-
endpoint_id: string;
|
|
53
|
-
name?: string;
|
|
54
|
-
default_language?: string;
|
|
55
|
-
webhook_url?: string;
|
|
56
|
-
webhook_headers?: Record<string, string>;
|
|
57
|
-
need_validation?: boolean;
|
|
58
|
-
}): Promise<Endpoint>;
|
|
59
|
-
delete(endpoint_id: string): Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
export declare class AsyncEndpoints extends AsyncAPIResource {
|
|
62
|
-
mixin: EndpointsMixin;
|
|
63
|
-
create(params: {
|
|
64
|
-
processor_id: string;
|
|
65
|
-
name: string;
|
|
66
|
-
webhook_url: string;
|
|
67
|
-
webhook_headers?: Record<string, string>;
|
|
68
|
-
need_validation?: boolean;
|
|
69
|
-
}): Promise<Endpoint>;
|
|
70
|
-
list(params: {
|
|
71
|
-
processor_id: string;
|
|
72
|
-
before?: string;
|
|
73
|
-
after?: string;
|
|
74
|
-
limit?: number;
|
|
75
|
-
order?: 'asc' | 'desc';
|
|
76
|
-
name?: string;
|
|
77
|
-
webhook_url?: string;
|
|
78
|
-
}): Promise<ListEndpoints>;
|
|
79
|
-
get(endpoint_id: string): Promise<Endpoint>;
|
|
80
|
-
update(params: {
|
|
81
|
-
endpoint_id: string;
|
|
82
|
-
name?: string;
|
|
83
|
-
default_language?: string;
|
|
84
|
-
webhook_url?: string;
|
|
85
|
-
webhook_headers?: Record<string, string>;
|
|
86
|
-
need_validation?: boolean;
|
|
87
|
-
}): Promise<Endpoint>;
|
|
88
|
-
delete(endpoint_id: string): Promise<void>;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../../src/resources/processors/automations/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAElF,qBAAa,cAAc;IACzB,aAAa,CAAC,MAAM,EAAE;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,GAAG,GAAG;IA+BP,WAAW,CAAC,MAAM,EAAE;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,GAAG;IA6BP,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG;IAOpC,aAAa,CAAC,MAAM,EAAE;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,gBAAgB,C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ncAPIResource, AsyncAPIResource } from '../../../resource.js';
|
|
2
|
-
export class EndpointsMixin {
|
|
3
|
-
prepareCreate(params) {
|
|
4
|
-
const { processor_id, name, webhook_url, model = 'gpt-4o-mini', webhook_headers, need_validation, } = params;
|
|
5
|
-
const endpointDict = {
|
|
6
|
-
processor_id,
|
|
7
|
-
name,
|
|
8
|
-
webhook_url,
|
|
9
|
-
model,
|
|
10
|
-
};
|
|
11
|
-
if (webhook_headers !== undefined) {
|
|
12
|
-
endpointDict.webhook_headers = webhook_headers;
|
|
13
|
-
}
|
|
14
|
-
if (need_validation !== undefined) {
|
|
15
|
-
endpointDict.need_validation = need_validation;
|
|
16
|
-
}
|
|
17
|
-
return {
|
|
18
|
-
method: 'POST',
|
|
19
|
-
url: '/v1/processors/automations/endpoints',
|
|
20
|
-
data: endpointDict,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
prepareList(params) {
|
|
24
|
-
const { processor_id, before, after, limit = 10, order = 'desc', name, webhook_url, } = params;
|
|
25
|
-
const queryParams = {
|
|
26
|
-
processor_id,
|
|
27
|
-
};
|
|
28
|
-
if (before !== undefined)
|
|
29
|
-
queryParams.before = before;
|
|
30
|
-
if (after !== undefined)
|
|
31
|
-
queryParams.after = after;
|
|
32
|
-
if (limit !== undefined)
|
|
33
|
-
queryParams.limit = limit;
|
|
34
|
-
if (order !== undefined)
|
|
35
|
-
queryParams.order = order;
|
|
36
|
-
if (name !== undefined)
|
|
37
|
-
queryParams.name = name;
|
|
38
|
-
if (webhook_url !== undefined)
|
|
39
|
-
queryParams.webhook_url = webhook_url;
|
|
40
|
-
return {
|
|
41
|
-
method: 'GET',
|
|
42
|
-
url: '/v1/processors/automations/endpoints',
|
|
43
|
-
params: queryParams,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
prepareGet(endpoint_id) {
|
|
47
|
-
return {
|
|
48
|
-
method: 'GET',
|
|
49
|
-
url: `/v1/processors/automations/endpoints/${endpoint_id}`,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
prepareUpdate(params) {
|
|
53
|
-
const { endpoint_id, name, default_language, webhook_url, webhook_headers, need_validation, } = params;
|
|
54
|
-
const updateDict = {};
|
|
55
|
-
if (name !== undefined)
|
|
56
|
-
updateDict.name = name;
|
|
57
|
-
if (default_language !== undefined)
|
|
58
|
-
updateDict.default_language = default_language;
|
|
59
|
-
if (webhook_url !== undefined)
|
|
60
|
-
updateDict.webhook_url = webhook_url;
|
|
61
|
-
if (webhook_headers !== undefined)
|
|
62
|
-
updateDict.webhook_headers = webhook_headers;
|
|
63
|
-
if (need_validation !== undefined)
|
|
64
|
-
updateDict.need_validation = need_validation;
|
|
65
|
-
return {
|
|
66
|
-
method: 'PUT',
|
|
67
|
-
url: `/v1/processors/automations/endpoints/${endpoint_id}`,
|
|
68
|
-
data: updateDict,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
prepareDelete(endpoint_id) {
|
|
72
|
-
return {
|
|
73
|
-
method: 'DELETE',
|
|
74
|
-
url: `/v1/processors/automations/endpoints/${endpoint_id}`,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
export class Endpoints extends SyncAPIResource {
|
|
79
|
-
constructor() {
|
|
80
|
-
super(...arguments);
|
|
81
|
-
this.mixin = new EndpointsMixin();
|
|
82
|
-
}
|
|
83
|
-
create(params) {
|
|
84
|
-
const preparedRequest = this.mixin.prepareCreate(params);
|
|
85
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
86
|
-
// Note: response is a Promise, access id after awaiting
|
|
87
|
-
response.then((r) => {
|
|
88
|
-
console.log(`Endpoint Created. Url: https://www.retab.com/dashboard/processors/automations/${r?.id || 'unknown'}`);
|
|
89
|
-
}).catch(() => { });
|
|
90
|
-
return response;
|
|
91
|
-
}
|
|
92
|
-
list(params) {
|
|
93
|
-
const preparedRequest = this.mixin.prepareList(params);
|
|
94
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
95
|
-
return response;
|
|
96
|
-
}
|
|
97
|
-
get(endpoint_id) {
|
|
98
|
-
const preparedRequest = this.mixin.prepareGet(endpoint_id);
|
|
99
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
100
|
-
return response;
|
|
101
|
-
}
|
|
102
|
-
update(params) {
|
|
103
|
-
const preparedRequest = this.mixin.prepareUpdate(params);
|
|
104
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
105
|
-
return response;
|
|
106
|
-
}
|
|
107
|
-
delete(endpoint_id) {
|
|
108
|
-
const preparedRequest = this.mixin.prepareDelete(endpoint_id);
|
|
109
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
110
|
-
console.log(`Endpoint Deleted. ID: ${endpoint_id}`);
|
|
111
|
-
return response;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
export class AsyncEndpoints extends AsyncAPIResource {
|
|
115
|
-
constructor() {
|
|
116
|
-
super(...arguments);
|
|
117
|
-
this.mixin = new EndpointsMixin();
|
|
118
|
-
}
|
|
119
|
-
async create(params) {
|
|
120
|
-
const preparedRequest = this.mixin.prepareCreate(params);
|
|
121
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
122
|
-
console.log(`Endpoint Created. Url: https://www.retab.com/dashboard/processors/automations/${response?.id || 'unknown'}`);
|
|
123
|
-
return response;
|
|
124
|
-
}
|
|
125
|
-
async list(params) {
|
|
126
|
-
const preparedRequest = this.mixin.prepareList(params);
|
|
127
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
128
|
-
return response;
|
|
129
|
-
}
|
|
130
|
-
async get(endpoint_id) {
|
|
131
|
-
const preparedRequest = this.mixin.prepareGet(endpoint_id);
|
|
132
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
133
|
-
return response;
|
|
134
|
-
}
|
|
135
|
-
async update(params) {
|
|
136
|
-
const preparedRequest = this.mixin.prepareUpdate(params);
|
|
137
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
138
|
-
return response;
|
|
139
|
-
}
|
|
140
|
-
async delete(endpoint_id) {
|
|
141
|
-
const preparedRequest = this.mixin.prepareDelete(endpoint_id);
|
|
142
|
-
await this._client._preparedRequest(preparedRequest);
|
|
143
|
-
console.log(`Endpoint Deleted. ID: ${endpoint_id}`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { Endpoints, AsyncEndpoints } from './endpoints.js';
|
|
2
|
-
export { Links, AsyncLinks } from './links.js';
|
|
3
|
-
export { Mailboxes, AsyncMailboxes } from './mailboxes.js';
|
|
4
|
-
export { OutlookAutomations, AsyncOutlookAutomations } from './outlook.js';
|
|
5
|
-
export { Tests, AsyncTests } from './tests.js';
|
|
6
|
-
export { Logs, AsyncLogs } from './logs.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/processors/automations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { Endpoints, AsyncEndpoints } from './endpoints.js';
|
|
2
|
-
export { Links, AsyncLinks } from './links.js';
|
|
3
|
-
export { Mailboxes, AsyncMailboxes } from './mailboxes.js';
|
|
4
|
-
export { OutlookAutomations, AsyncOutlookAutomations } from './outlook.js';
|
|
5
|
-
export { Tests, AsyncTests } from './tests.js';
|
|
6
|
-
export { Logs, AsyncLogs } from './logs.js';
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../../resource.js';
|
|
2
|
-
import { Link, ListLinks } from '../../../types/automations/links.js';
|
|
3
|
-
export declare class LinksMixin {
|
|
4
|
-
readonly linksBaseUrl = "/v1/processors/automations/links";
|
|
5
|
-
prepareCreate(params: {
|
|
6
|
-
processor_id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
webhook_url: string;
|
|
9
|
-
webhook_headers?: Record<string, string>;
|
|
10
|
-
need_validation?: boolean;
|
|
11
|
-
password?: string;
|
|
12
|
-
}): any;
|
|
13
|
-
prepareList(params?: {
|
|
14
|
-
before?: string;
|
|
15
|
-
after?: string;
|
|
16
|
-
limit?: number;
|
|
17
|
-
order?: 'asc' | 'desc';
|
|
18
|
-
processor_id?: string;
|
|
19
|
-
name?: string;
|
|
20
|
-
}): any;
|
|
21
|
-
prepareGet(link_id: string): any;
|
|
22
|
-
prepareUpdate(params: {
|
|
23
|
-
link_id: string;
|
|
24
|
-
name?: string;
|
|
25
|
-
webhook_url?: string;
|
|
26
|
-
webhook_headers?: Record<string, string>;
|
|
27
|
-
need_validation?: boolean;
|
|
28
|
-
password?: string;
|
|
29
|
-
}): any;
|
|
30
|
-
prepareDelete(link_id: string): any;
|
|
31
|
-
}
|
|
32
|
-
export declare class Links extends SyncAPIResource {
|
|
33
|
-
mixin: LinksMixin;
|
|
34
|
-
create(params: {
|
|
35
|
-
processor_id: string;
|
|
36
|
-
name: string;
|
|
37
|
-
webhook_url: string;
|
|
38
|
-
webhook_headers?: Record<string, string>;
|
|
39
|
-
need_validation?: boolean;
|
|
40
|
-
password?: string;
|
|
41
|
-
}): Promise<Link>;
|
|
42
|
-
list(params?: {
|
|
43
|
-
before?: string;
|
|
44
|
-
after?: string;
|
|
45
|
-
limit?: number;
|
|
46
|
-
order?: 'asc' | 'desc';
|
|
47
|
-
processor_id?: string;
|
|
48
|
-
name?: string;
|
|
49
|
-
}): Promise<ListLinks>;
|
|
50
|
-
get(link_id: string): Promise<Link>;
|
|
51
|
-
update(params: {
|
|
52
|
-
link_id: string;
|
|
53
|
-
name?: string;
|
|
54
|
-
webhook_url?: string;
|
|
55
|
-
webhook_headers?: Record<string, string>;
|
|
56
|
-
password?: string;
|
|
57
|
-
need_validation?: boolean;
|
|
58
|
-
}): Promise<Link>;
|
|
59
|
-
delete(link_id: string): Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
export declare class AsyncLinks extends AsyncAPIResource {
|
|
62
|
-
mixin: LinksMixin;
|
|
63
|
-
create(params: {
|
|
64
|
-
processor_id: string;
|
|
65
|
-
name: string;
|
|
66
|
-
webhook_url: string;
|
|
67
|
-
webhook_headers?: Record<string, string>;
|
|
68
|
-
need_validation?: boolean;
|
|
69
|
-
password?: string;
|
|
70
|
-
}): Promise<Link>;
|
|
71
|
-
list(params?: {
|
|
72
|
-
before?: string;
|
|
73
|
-
after?: string;
|
|
74
|
-
limit?: number;
|
|
75
|
-
order?: 'asc' | 'desc';
|
|
76
|
-
processor_id?: string;
|
|
77
|
-
name?: string;
|
|
78
|
-
}): Promise<ListLinks>;
|
|
79
|
-
get(link_id: string): Promise<Link>;
|
|
80
|
-
update(params: {
|
|
81
|
-
link_id: string;
|
|
82
|
-
name?: string;
|
|
83
|
-
webhook_url?: string;
|
|
84
|
-
webhook_headers?: Record<string, string>;
|
|
85
|
-
password?: string;
|
|
86
|
-
need_validation?: boolean;
|
|
87
|
-
}): Promise<Link>;
|
|
88
|
-
delete(link_id: string): Promise<void>;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=links.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../src/resources/processors/automations/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC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AAC;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOX,IAAI,CAAC,MAAM,GAAE;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;KACV,GAAG,OAAO,CAAC,SAAS,CAAC;IAMrB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMnC,MAAM,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC;IAMX,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7C"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../../resource.js';
|
|
2
|
-
export class LinksMixin {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.linksBaseUrl = '/v1/processors/automations/links';
|
|
5
|
-
}
|
|
6
|
-
prepareCreate(params) {
|
|
7
|
-
const { processor_id, name, webhook_url, webhook_headers, need_validation, password, } = params;
|
|
8
|
-
const linkDict = {
|
|
9
|
-
processor_id,
|
|
10
|
-
name,
|
|
11
|
-
webhook_url,
|
|
12
|
-
};
|
|
13
|
-
if (webhook_headers !== undefined) {
|
|
14
|
-
linkDict.webhook_headers = webhook_headers;
|
|
15
|
-
}
|
|
16
|
-
if (need_validation !== undefined) {
|
|
17
|
-
linkDict.need_validation = need_validation;
|
|
18
|
-
}
|
|
19
|
-
if (password !== undefined) {
|
|
20
|
-
linkDict.password = password;
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
method: 'POST',
|
|
24
|
-
url: this.linksBaseUrl,
|
|
25
|
-
data: linkDict,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
prepareList(params = {}) {
|
|
29
|
-
const { before, after, limit = 10, order = 'desc', processor_id, name, } = params;
|
|
30
|
-
const queryParams = {};
|
|
31
|
-
if (before !== undefined)
|
|
32
|
-
queryParams.before = before;
|
|
33
|
-
if (after !== undefined)
|
|
34
|
-
queryParams.after = after;
|
|
35
|
-
if (limit !== undefined)
|
|
36
|
-
queryParams.limit = limit;
|
|
37
|
-
if (order !== undefined)
|
|
38
|
-
queryParams.order = order;
|
|
39
|
-
if (processor_id !== undefined)
|
|
40
|
-
queryParams.processor_id = processor_id;
|
|
41
|
-
if (name !== undefined)
|
|
42
|
-
queryParams.name = name;
|
|
43
|
-
return {
|
|
44
|
-
method: 'GET',
|
|
45
|
-
url: this.linksBaseUrl,
|
|
46
|
-
params: queryParams,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
prepareGet(link_id) {
|
|
50
|
-
return {
|
|
51
|
-
method: 'GET',
|
|
52
|
-
url: `${this.linksBaseUrl}/${link_id}`,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
prepareUpdate(params) {
|
|
56
|
-
const { link_id, name, webhook_url, webhook_headers, need_validation, password, } = params;
|
|
57
|
-
const updateDict = {};
|
|
58
|
-
if (name !== undefined)
|
|
59
|
-
updateDict.name = name;
|
|
60
|
-
if (webhook_url !== undefined)
|
|
61
|
-
updateDict.webhook_url = webhook_url;
|
|
62
|
-
if (webhook_headers !== undefined)
|
|
63
|
-
updateDict.webhook_headers = webhook_headers;
|
|
64
|
-
if (need_validation !== undefined)
|
|
65
|
-
updateDict.need_validation = need_validation;
|
|
66
|
-
if (password !== undefined)
|
|
67
|
-
updateDict.password = password;
|
|
68
|
-
return {
|
|
69
|
-
method: 'PUT',
|
|
70
|
-
url: `${this.linksBaseUrl}/${link_id}`,
|
|
71
|
-
data: updateDict,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
prepareDelete(link_id) {
|
|
75
|
-
return {
|
|
76
|
-
method: 'DELETE',
|
|
77
|
-
url: `${this.linksBaseUrl}/${link_id}`,
|
|
78
|
-
raiseForStatus: true,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
export class Links extends SyncAPIResource {
|
|
83
|
-
constructor() {
|
|
84
|
-
super(...arguments);
|
|
85
|
-
this.mixin = new LinksMixin();
|
|
86
|
-
}
|
|
87
|
-
create(params) {
|
|
88
|
-
const preparedRequest = this.mixin.prepareCreate(params);
|
|
89
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
90
|
-
// Note: response is a Promise, access id after awaiting
|
|
91
|
-
response.then((r) => {
|
|
92
|
-
console.log(`Link Created. Url: https://www.retab.com/dashboard/processors/automations/${r?.id || 'unknown'}`);
|
|
93
|
-
}).catch(() => {
|
|
94
|
-
// Ignore console logging errors - main response still valid
|
|
95
|
-
});
|
|
96
|
-
return response;
|
|
97
|
-
}
|
|
98
|
-
list(params = {}) {
|
|
99
|
-
const preparedRequest = this.mixin.prepareList(params);
|
|
100
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
101
|
-
return response;
|
|
102
|
-
}
|
|
103
|
-
get(link_id) {
|
|
104
|
-
const preparedRequest = this.mixin.prepareGet(link_id);
|
|
105
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
106
|
-
return response;
|
|
107
|
-
}
|
|
108
|
-
update(params) {
|
|
109
|
-
const preparedRequest = this.mixin.prepareUpdate(params);
|
|
110
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
111
|
-
return response;
|
|
112
|
-
}
|
|
113
|
-
delete(link_id) {
|
|
114
|
-
const preparedRequest = this.mixin.prepareDelete(link_id);
|
|
115
|
-
const response = this._client._preparedRequest(preparedRequest);
|
|
116
|
-
return response;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
export class AsyncLinks extends AsyncAPIResource {
|
|
120
|
-
constructor() {
|
|
121
|
-
super(...arguments);
|
|
122
|
-
this.mixin = new LinksMixin();
|
|
123
|
-
}
|
|
124
|
-
async create(params) {
|
|
125
|
-
const preparedRequest = this.mixin.prepareCreate(params);
|
|
126
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
127
|
-
console.log(`Link Created. Url: https://www.retab.com/dashboard/processors/automations/${response.id}`);
|
|
128
|
-
return response;
|
|
129
|
-
}
|
|
130
|
-
async list(params = {}) {
|
|
131
|
-
const preparedRequest = this.mixin.prepareList(params);
|
|
132
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
133
|
-
return response;
|
|
134
|
-
}
|
|
135
|
-
async get(link_id) {
|
|
136
|
-
const preparedRequest = this.mixin.prepareGet(link_id);
|
|
137
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
138
|
-
return response;
|
|
139
|
-
}
|
|
140
|
-
async update(params) {
|
|
141
|
-
const preparedRequest = this.mixin.prepareUpdate(params);
|
|
142
|
-
const response = await this._client._preparedRequest(preparedRequest);
|
|
143
|
-
return response;
|
|
144
|
-
}
|
|
145
|
-
async delete(link_id) {
|
|
146
|
-
const preparedRequest = this.mixin.prepareDelete(link_id);
|
|
147
|
-
await this._client._preparedRequest(preparedRequest);
|
|
148
|
-
}
|
|
149
|
-
}
|