@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,120 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../resource.js';
|
|
2
|
-
export class ExternalAPIKeysMixin {
|
|
3
|
-
prepareCreate(provider, api_key) {
|
|
4
|
-
const request = {
|
|
5
|
-
provider,
|
|
6
|
-
api_key,
|
|
7
|
-
};
|
|
8
|
-
return {
|
|
9
|
-
method: 'POST',
|
|
10
|
-
url: '/v1/secrets/external_api_keys',
|
|
11
|
-
data: request,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
prepareGet(provider) {
|
|
15
|
-
return {
|
|
16
|
-
method: 'GET',
|
|
17
|
-
url: `/v1/secrets/external_api_keys/${provider}`,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
prepareList() {
|
|
21
|
-
return {
|
|
22
|
-
method: 'GET',
|
|
23
|
-
url: '/v1/secrets/external_api_keys',
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
prepareDelete(provider) {
|
|
27
|
-
return {
|
|
28
|
-
method: 'DELETE',
|
|
29
|
-
url: `/v1/secrets/external_api_keys/${provider}`,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export class ExternalAPIKeys extends SyncAPIResource {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(...arguments);
|
|
36
|
-
this.mixin = new ExternalAPIKeysMixin();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Add or update an external API key.
|
|
40
|
-
*
|
|
41
|
-
* @param provider - The API provider (OpenAI, Anthropic, Gemini, xAI)
|
|
42
|
-
* @param api_key - The API key to store
|
|
43
|
-
* @returns Response indicating success
|
|
44
|
-
*/
|
|
45
|
-
create(provider, api_key) {
|
|
46
|
-
const request = this.mixin.prepareCreate(provider, api_key);
|
|
47
|
-
const response = this._client._preparedRequest(request);
|
|
48
|
-
return response;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get an external API key configuration.
|
|
52
|
-
*
|
|
53
|
-
* @param provider - The API provider to get the key for
|
|
54
|
-
* @returns The API key configuration
|
|
55
|
-
*/
|
|
56
|
-
get(provider) {
|
|
57
|
-
const request = this.mixin.prepareGet(provider);
|
|
58
|
-
const response = this._client._preparedRequest(request);
|
|
59
|
-
return response;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* List all configured external API keys.
|
|
63
|
-
*
|
|
64
|
-
* @returns List of API key configurations
|
|
65
|
-
*/
|
|
66
|
-
list() {
|
|
67
|
-
const request = this.mixin.prepareList();
|
|
68
|
-
const response = this._client._preparedRequest(request);
|
|
69
|
-
return response;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Delete an external API key configuration.
|
|
73
|
-
*
|
|
74
|
-
* @param provider - The API provider to delete the key for
|
|
75
|
-
* @returns Response indicating success
|
|
76
|
-
*/
|
|
77
|
-
delete(provider) {
|
|
78
|
-
const request = this.mixin.prepareDelete(provider);
|
|
79
|
-
const response = this._client._preparedRequest(request);
|
|
80
|
-
return response;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
export class AsyncExternalAPIKeys extends AsyncAPIResource {
|
|
84
|
-
constructor() {
|
|
85
|
-
super(...arguments);
|
|
86
|
-
this.mixin = new ExternalAPIKeysMixin();
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Add or update an external API key asynchronously.
|
|
90
|
-
*/
|
|
91
|
-
async create(provider, api_key) {
|
|
92
|
-
const request = this.mixin.prepareCreate(provider, api_key);
|
|
93
|
-
const response = await this._client._preparedRequest(request);
|
|
94
|
-
return response;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Get an external API key configuration asynchronously.
|
|
98
|
-
*/
|
|
99
|
-
async get(provider) {
|
|
100
|
-
const request = this.mixin.prepareGet(provider);
|
|
101
|
-
const response = await this._client._preparedRequest(request);
|
|
102
|
-
return response;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* List all configured external API keys asynchronously.
|
|
106
|
-
*/
|
|
107
|
-
async list() {
|
|
108
|
-
const request = this.mixin.prepareList();
|
|
109
|
-
const response = await this._client._preparedRequest(request);
|
|
110
|
-
return response;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Delete an external API key configuration asynchronously.
|
|
114
|
-
*/
|
|
115
|
-
async delete(provider) {
|
|
116
|
-
const request = this.mixin.prepareDelete(provider);
|
|
117
|
-
const response = await this._client._preparedRequest(request);
|
|
118
|
-
return response;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../resource.js';
|
|
2
|
-
import { ExternalAPIKeys, AsyncExternalAPIKeys } from './external_api_keys.js';
|
|
3
|
-
import { Webhooks, AsyncWebhooks } from './webhooks.js';
|
|
4
|
-
export declare class Secrets extends SyncAPIResource {
|
|
5
|
-
external_api_keys: ExternalAPIKeys;
|
|
6
|
-
webhooks: Webhooks;
|
|
7
|
-
constructor(client: any);
|
|
8
|
-
}
|
|
9
|
-
export declare class AsyncSecrets extends AsyncAPIResource {
|
|
10
|
-
external_api_keys: AsyncExternalAPIKeys;
|
|
11
|
-
webhooks: AsyncWebhooks;
|
|
12
|
-
constructor(client: any);
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/secrets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAExD,qBAAa,OAAQ,SAAQ,eAAe;IACnC,iBAAiB,EAAE,eAAe,CAAC;IACnC,QAAQ,EAAE,QAAQ,CAAC;gBAEd,MAAM,EAAE,GAAG;CAKxB;AAED,qBAAa,YAAa,SAAQ,gBAAgB;IACzC,iBAAiB,EAAE,oBAAoB,CAAC;IACxC,QAAQ,EAAE,aAAa,CAAC;gBAEnB,MAAM,EAAE,GAAG;CAKxB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../resource.js';
|
|
2
|
-
import { ExternalAPIKeys, AsyncExternalAPIKeys } from './external_api_keys.js';
|
|
3
|
-
import { Webhooks, AsyncWebhooks } from './webhooks.js';
|
|
4
|
-
export class Secrets extends SyncAPIResource {
|
|
5
|
-
constructor(client) {
|
|
6
|
-
super(client);
|
|
7
|
-
this.external_api_keys = new ExternalAPIKeys(client);
|
|
8
|
-
this.webhooks = new Webhooks(client);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export class AsyncSecrets extends AsyncAPIResource {
|
|
12
|
-
constructor(client) {
|
|
13
|
-
super(client);
|
|
14
|
-
this.external_api_keys = new AsyncExternalAPIKeys(client);
|
|
15
|
-
this.webhooks = new AsyncWebhooks(client);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../resource.js';
|
|
2
|
-
import { PreparedRequest } from '../../types/standards.js';
|
|
3
|
-
export interface WebhookSecret {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
secret: string;
|
|
7
|
-
algorithm: 'sha256' | 'sha1' | 'md5';
|
|
8
|
-
created_at: string;
|
|
9
|
-
updated_at: string;
|
|
10
|
-
}
|
|
11
|
-
export interface CreateWebhookSecretRequest {
|
|
12
|
-
name: string;
|
|
13
|
-
secret?: string;
|
|
14
|
-
algorithm?: 'sha256' | 'sha1' | 'md5';
|
|
15
|
-
}
|
|
16
|
-
export interface UpdateWebhookSecretRequest {
|
|
17
|
-
name?: string;
|
|
18
|
-
secret?: string;
|
|
19
|
-
algorithm?: 'sha256' | 'sha1' | 'md5';
|
|
20
|
-
}
|
|
21
|
-
export interface WebhookSignatureConfig {
|
|
22
|
-
secret: string;
|
|
23
|
-
algorithm: 'sha256' | 'sha1' | 'md5';
|
|
24
|
-
headerName?: string;
|
|
25
|
-
prefix?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare class WebhooksMixin {
|
|
28
|
-
prepareCreate(params: CreateWebhookSecretRequest): PreparedRequest;
|
|
29
|
-
prepareList(): PreparedRequest;
|
|
30
|
-
prepareGet(webhookId: string): PreparedRequest;
|
|
31
|
-
prepareUpdate(webhookId: string, params: UpdateWebhookSecretRequest): PreparedRequest;
|
|
32
|
-
prepareDelete(webhookId: string): PreparedRequest;
|
|
33
|
-
prepareRotate(webhookId: string): PreparedRequest;
|
|
34
|
-
}
|
|
35
|
-
export declare class Webhooks extends SyncAPIResource {
|
|
36
|
-
private mixin;
|
|
37
|
-
create(params: CreateWebhookSecretRequest): Promise<WebhookSecret>;
|
|
38
|
-
list(): Promise<{
|
|
39
|
-
data: WebhookSecret[];
|
|
40
|
-
}>;
|
|
41
|
-
get(webhookId: string): Promise<WebhookSecret>;
|
|
42
|
-
update(webhookId: string, params: UpdateWebhookSecretRequest): Promise<WebhookSecret>;
|
|
43
|
-
delete(webhookId: string): Promise<void>;
|
|
44
|
-
rotate(webhookId: string): Promise<WebhookSecret>;
|
|
45
|
-
/**
|
|
46
|
-
* Generate webhook signature for verification
|
|
47
|
-
*/
|
|
48
|
-
generateSignature(payload: string, config: WebhookSignatureConfig): string;
|
|
49
|
-
/**
|
|
50
|
-
* Verify webhook signature
|
|
51
|
-
*/
|
|
52
|
-
verifySignature(payload: string, receivedSignature: string, config: WebhookSignatureConfig): boolean;
|
|
53
|
-
}
|
|
54
|
-
export declare class AsyncWebhooks extends AsyncAPIResource {
|
|
55
|
-
private mixin;
|
|
56
|
-
create(params: CreateWebhookSecretRequest): Promise<WebhookSecret>;
|
|
57
|
-
list(): Promise<{
|
|
58
|
-
data: WebhookSecret[];
|
|
59
|
-
}>;
|
|
60
|
-
get(webhookId: string): Promise<WebhookSecret>;
|
|
61
|
-
update(webhookId: string, params: UpdateWebhookSecretRequest): Promise<WebhookSecret>;
|
|
62
|
-
delete(webhookId: string): Promise<void>;
|
|
63
|
-
rotate(webhookId: string): Promise<WebhookSecret>;
|
|
64
|
-
/**
|
|
65
|
-
* Generate webhook signature for verification
|
|
66
|
-
*/
|
|
67
|
-
generateSignature(payload: string, config: WebhookSignatureConfig): string;
|
|
68
|
-
/**
|
|
69
|
-
* Verify webhook signature
|
|
70
|
-
*/
|
|
71
|
-
verifySignature(payload: string, receivedSignature: string, config: WebhookSignatureConfig): boolean;
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/resources/secrets/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,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C,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKjD;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,GAAG,MAAM;IAW1E;;OAEG;IACH,eAAe,CACb,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,sBAAsB,GAC7B,OAAO;CAUX;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,OAAO,CAAC,KAAK,CAAuB;IAE9B,MAAM,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC;IAKlE,IAAI,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;IAK1C,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAK9C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrF,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKvD;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,GAAG,MAAM;IAW1E;;OAEG;IACH,eAAe,CACb,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,sBAAsB,GAC7B,OAAO;CAUX"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../../resource.js';
|
|
2
|
-
export class WebhooksMixin {
|
|
3
|
-
prepareCreate(params) {
|
|
4
|
-
return {
|
|
5
|
-
method: 'POST',
|
|
6
|
-
url: '/v1/secrets/webhooks',
|
|
7
|
-
data: {
|
|
8
|
-
name: params.name,
|
|
9
|
-
secret: params.secret,
|
|
10
|
-
algorithm: params.algorithm || 'sha256',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
prepareList() {
|
|
15
|
-
return {
|
|
16
|
-
method: 'GET',
|
|
17
|
-
url: '/v1/secrets/webhooks',
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
prepareGet(webhookId) {
|
|
21
|
-
return {
|
|
22
|
-
method: 'GET',
|
|
23
|
-
url: `/v1/secrets/webhooks/${webhookId}`,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
prepareUpdate(webhookId, params) {
|
|
27
|
-
return {
|
|
28
|
-
method: 'PATCH',
|
|
29
|
-
url: `/v1/secrets/webhooks/${webhookId}`,
|
|
30
|
-
data: params,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
prepareDelete(webhookId) {
|
|
34
|
-
return {
|
|
35
|
-
method: 'DELETE',
|
|
36
|
-
url: `/v1/secrets/webhooks/${webhookId}`,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
prepareRotate(webhookId) {
|
|
40
|
-
return {
|
|
41
|
-
method: 'POST',
|
|
42
|
-
url: `/v1/secrets/webhooks/${webhookId}/rotate`,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export class Webhooks extends SyncAPIResource {
|
|
47
|
-
constructor() {
|
|
48
|
-
super(...arguments);
|
|
49
|
-
this.mixin = new WebhooksMixin();
|
|
50
|
-
}
|
|
51
|
-
create(params) {
|
|
52
|
-
const preparedRequest = this.mixin.prepareCreate(params);
|
|
53
|
-
return this._client._preparedRequest(preparedRequest);
|
|
54
|
-
}
|
|
55
|
-
list() {
|
|
56
|
-
const preparedRequest = this.mixin.prepareList();
|
|
57
|
-
return this._client._preparedRequest(preparedRequest);
|
|
58
|
-
}
|
|
59
|
-
get(webhookId) {
|
|
60
|
-
const preparedRequest = this.mixin.prepareGet(webhookId);
|
|
61
|
-
return this._client._preparedRequest(preparedRequest);
|
|
62
|
-
}
|
|
63
|
-
update(webhookId, params) {
|
|
64
|
-
const preparedRequest = this.mixin.prepareUpdate(webhookId, params);
|
|
65
|
-
return this._client._preparedRequest(preparedRequest);
|
|
66
|
-
}
|
|
67
|
-
delete(webhookId) {
|
|
68
|
-
const preparedRequest = this.mixin.prepareDelete(webhookId);
|
|
69
|
-
return this._client._preparedRequest(preparedRequest);
|
|
70
|
-
}
|
|
71
|
-
rotate(webhookId) {
|
|
72
|
-
const preparedRequest = this.mixin.prepareRotate(webhookId);
|
|
73
|
-
return this._client._preparedRequest(preparedRequest);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Generate webhook signature for verification
|
|
77
|
-
*/
|
|
78
|
-
generateSignature(payload, config) {
|
|
79
|
-
const crypto = require('crypto');
|
|
80
|
-
const { secret, algorithm, prefix = '' } = config;
|
|
81
|
-
const hmac = crypto.createHmac(algorithm, secret);
|
|
82
|
-
hmac.update(payload);
|
|
83
|
-
const signature = hmac.digest('hex');
|
|
84
|
-
return prefix ? `${prefix}${signature}` : signature;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Verify webhook signature
|
|
88
|
-
*/
|
|
89
|
-
verifySignature(payload, receivedSignature, config) {
|
|
90
|
-
const expectedSignature = this.generateSignature(payload, config);
|
|
91
|
-
// Use timingSafeEqual to prevent timing attacks
|
|
92
|
-
const crypto = require('crypto');
|
|
93
|
-
return crypto.timingSafeEqual(Buffer.from(receivedSignature), Buffer.from(expectedSignature));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
export class AsyncWebhooks extends AsyncAPIResource {
|
|
97
|
-
constructor() {
|
|
98
|
-
super(...arguments);
|
|
99
|
-
this.mixin = new WebhooksMixin();
|
|
100
|
-
}
|
|
101
|
-
async create(params) {
|
|
102
|
-
const preparedRequest = this.mixin.prepareCreate(params);
|
|
103
|
-
return await this._client._preparedRequest(preparedRequest);
|
|
104
|
-
}
|
|
105
|
-
async list() {
|
|
106
|
-
const preparedRequest = this.mixin.prepareList();
|
|
107
|
-
return await this._client._preparedRequest(preparedRequest);
|
|
108
|
-
}
|
|
109
|
-
async get(webhookId) {
|
|
110
|
-
const preparedRequest = this.mixin.prepareGet(webhookId);
|
|
111
|
-
return await this._client._preparedRequest(preparedRequest);
|
|
112
|
-
}
|
|
113
|
-
async update(webhookId, params) {
|
|
114
|
-
const preparedRequest = this.mixin.prepareUpdate(webhookId, params);
|
|
115
|
-
return await this._client._preparedRequest(preparedRequest);
|
|
116
|
-
}
|
|
117
|
-
async delete(webhookId) {
|
|
118
|
-
const preparedRequest = this.mixin.prepareDelete(webhookId);
|
|
119
|
-
return await this._client._preparedRequest(preparedRequest);
|
|
120
|
-
}
|
|
121
|
-
async rotate(webhookId) {
|
|
122
|
-
const preparedRequest = this.mixin.prepareRotate(webhookId);
|
|
123
|
-
return await this._client._preparedRequest(preparedRequest);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Generate webhook signature for verification
|
|
127
|
-
*/
|
|
128
|
-
generateSignature(payload, config) {
|
|
129
|
-
const crypto = require('crypto');
|
|
130
|
-
const { secret, algorithm, prefix = '' } = config;
|
|
131
|
-
const hmac = crypto.createHmac(algorithm, secret);
|
|
132
|
-
hmac.update(payload);
|
|
133
|
-
const signature = hmac.digest('hex');
|
|
134
|
-
return prefix ? `${prefix}${signature}` : signature;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Verify webhook signature
|
|
138
|
-
*/
|
|
139
|
-
verifySignature(payload, receivedSignature, config) {
|
|
140
|
-
const expectedSignature = this.generateSignature(payload, config);
|
|
141
|
-
// Use timingSafeEqual to prevent timing attacks
|
|
142
|
-
const crypto = require('crypto');
|
|
143
|
-
return crypto.timingSafeEqual(Buffer.from(receivedSignature), Buffer.from(expectedSignature));
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { SyncAPIResource, AsyncAPIResource } from '../resource.js';
|
|
2
|
-
import { PreparedRequest } from '../types/standards.js';
|
|
3
|
-
import { Amount, MonthlyUsageResponse } from '../types/ai_models.js';
|
|
4
|
-
import { AutomationLog } from '../types/logs.js';
|
|
5
|
-
export declare class UsageMixin {
|
|
6
|
-
prepareMonthlyCreditsUsage(): PreparedRequest;
|
|
7
|
-
prepareTotal(params?: {
|
|
8
|
-
start_date?: Date;
|
|
9
|
-
end_date?: Date;
|
|
10
|
-
}): PreparedRequest;
|
|
11
|
-
prepareMailbox(params: {
|
|
12
|
-
email: string;
|
|
13
|
-
start_date?: Date;
|
|
14
|
-
end_date?: Date;
|
|
15
|
-
}): PreparedRequest;
|
|
16
|
-
prepareLink(params: {
|
|
17
|
-
link_id: string;
|
|
18
|
-
start_date?: Date;
|
|
19
|
-
end_date?: Date;
|
|
20
|
-
}): PreparedRequest;
|
|
21
|
-
prepareSchema(params: {
|
|
22
|
-
schema_id: string;
|
|
23
|
-
start_date?: Date;
|
|
24
|
-
end_date?: Date;
|
|
25
|
-
}): PreparedRequest;
|
|
26
|
-
prepareSchemaData(params: {
|
|
27
|
-
schema_data_id: string;
|
|
28
|
-
start_date?: Date;
|
|
29
|
-
end_date?: Date;
|
|
30
|
-
}): PreparedRequest;
|
|
31
|
-
prepareLog(params: {
|
|
32
|
-
response_format: any;
|
|
33
|
-
completion: any;
|
|
34
|
-
}): PreparedRequest;
|
|
35
|
-
}
|
|
36
|
-
export declare class Usage extends SyncAPIResource {
|
|
37
|
-
private mixin;
|
|
38
|
-
/**
|
|
39
|
-
* Get monthly credits usage information.
|
|
40
|
-
* Credits are calculated dynamically based on MIME type and consumption.
|
|
41
|
-
*
|
|
42
|
-
* @returns Monthly usage data including credits consumed and limits
|
|
43
|
-
* @throws RetabAPIError if the API request fails
|
|
44
|
-
*/
|
|
45
|
-
monthlyCreditsUsage(): Promise<MonthlyUsageResponse>;
|
|
46
|
-
/**
|
|
47
|
-
* Get the total usage cost within an optional date range.
|
|
48
|
-
*
|
|
49
|
-
* @param start_date - Start date for usage calculation
|
|
50
|
-
* @param end_date - End date for usage calculation
|
|
51
|
-
* @returns The total usage cost
|
|
52
|
-
*/
|
|
53
|
-
total(_params?: {
|
|
54
|
-
start_date?: Date;
|
|
55
|
-
end_date?: Date;
|
|
56
|
-
}): Amount;
|
|
57
|
-
/**
|
|
58
|
-
* Get the total usage cost for a mailbox within an optional date range.
|
|
59
|
-
*
|
|
60
|
-
* @param email - The email address of the mailbox
|
|
61
|
-
* @param start_date - Start date for usage calculation
|
|
62
|
-
* @param end_date - End date for usage calculation
|
|
63
|
-
* @returns The total usage cost
|
|
64
|
-
*/
|
|
65
|
-
mailbox(params: {
|
|
66
|
-
email: string;
|
|
67
|
-
start_date?: Date;
|
|
68
|
-
end_date?: Date;
|
|
69
|
-
}): Promise<Amount>;
|
|
70
|
-
/**
|
|
71
|
-
* Get the total usage cost for a link within an optional date range.
|
|
72
|
-
*
|
|
73
|
-
* @param link_id - The ID of the link
|
|
74
|
-
* @param start_date - Start date for usage calculation
|
|
75
|
-
* @param end_date - End date for usage calculation
|
|
76
|
-
* @returns The total usage cost
|
|
77
|
-
*/
|
|
78
|
-
link(params: {
|
|
79
|
-
link_id: string;
|
|
80
|
-
start_date?: Date;
|
|
81
|
-
end_date?: Date;
|
|
82
|
-
}): Promise<Amount>;
|
|
83
|
-
/**
|
|
84
|
-
* Get the total usage cost for a schema within an optional date range.
|
|
85
|
-
*
|
|
86
|
-
* @param schema_id - The ID of the schema
|
|
87
|
-
* @param start_date - Start date for usage calculation
|
|
88
|
-
* @param end_date - End date for usage calculation
|
|
89
|
-
* @returns The total usage cost
|
|
90
|
-
*/
|
|
91
|
-
schema(params: {
|
|
92
|
-
schema_id: string;
|
|
93
|
-
start_date?: Date;
|
|
94
|
-
end_date?: Date;
|
|
95
|
-
}): Promise<Amount>;
|
|
96
|
-
/**
|
|
97
|
-
* Get the total usage cost for a schema data within an optional date range.
|
|
98
|
-
*
|
|
99
|
-
* @param schema_data_id - The ID of the schema data
|
|
100
|
-
* @param start_date - Start date for usage calculation
|
|
101
|
-
* @param end_date - End date for usage calculation
|
|
102
|
-
* @returns The total usage cost
|
|
103
|
-
*/
|
|
104
|
-
schemaData(params: {
|
|
105
|
-
schema_data_id: string;
|
|
106
|
-
start_date?: Date;
|
|
107
|
-
end_date?: Date;
|
|
108
|
-
}): Promise<Amount>;
|
|
109
|
-
/**
|
|
110
|
-
* Logs an OpenAI request completion as an automation log to make usage calculation possible.
|
|
111
|
-
*
|
|
112
|
-
* Example:
|
|
113
|
-
* ```typescript
|
|
114
|
-
* const client = new OpenAI();
|
|
115
|
-
* const completion = await client.beta.chat.completions.parse({
|
|
116
|
-
* model: "gpt-4o-2024-08-06",
|
|
117
|
-
* messages: [
|
|
118
|
-
* {"role": "developer", "content": "Extract the event information."},
|
|
119
|
-
* {"role": "user", "content": "Alice and Bob are going to a science fair on Friday."},
|
|
120
|
-
* ],
|
|
121
|
-
* response_format: CalendarEvent,
|
|
122
|
-
* });
|
|
123
|
-
* reclient.usage.log({
|
|
124
|
-
* response_format: CalendarEvent,
|
|
125
|
-
* completion: completion
|
|
126
|
-
* });
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* @param response_format - The response format of the OpenAI request
|
|
130
|
-
* @param completion - The completion of the OpenAI request
|
|
131
|
-
* @returns The automation log
|
|
132
|
-
*/
|
|
133
|
-
log(params: {
|
|
134
|
-
response_format: any;
|
|
135
|
-
completion: any;
|
|
136
|
-
}): Promise<AutomationLog>;
|
|
137
|
-
}
|
|
138
|
-
export declare class AsyncUsage extends AsyncAPIResource {
|
|
139
|
-
private mixin;
|
|
140
|
-
/**
|
|
141
|
-
* Get monthly credits usage information asynchronously.
|
|
142
|
-
* Credits are calculated dynamically based on MIME type and consumption.
|
|
143
|
-
*
|
|
144
|
-
* @returns Monthly usage data including credits consumed and limits
|
|
145
|
-
* @throws RetabAPIError if the API request fails
|
|
146
|
-
*/
|
|
147
|
-
monthlyCreditsUsage(): Promise<MonthlyUsageResponse>;
|
|
148
|
-
/**
|
|
149
|
-
* Get the total usage cost within an optional date range.
|
|
150
|
-
*
|
|
151
|
-
* @param start_date - Start date for usage calculation
|
|
152
|
-
* @param end_date - End date for usage calculation
|
|
153
|
-
* @returns The total usage cost
|
|
154
|
-
*/
|
|
155
|
-
total(_params?: {
|
|
156
|
-
start_date?: Date;
|
|
157
|
-
end_date?: Date;
|
|
158
|
-
}): Promise<Amount>;
|
|
159
|
-
/**
|
|
160
|
-
* Get the total usage cost for a mailbox within an optional date range.
|
|
161
|
-
*
|
|
162
|
-
* @param email - The email address of the mailbox
|
|
163
|
-
* @param start_date - Start date for usage calculation
|
|
164
|
-
* @param end_date - End date for usage calculation
|
|
165
|
-
* @returns The total usage cost
|
|
166
|
-
*/
|
|
167
|
-
mailbox(params: {
|
|
168
|
-
email: string;
|
|
169
|
-
start_date?: Date;
|
|
170
|
-
end_date?: Date;
|
|
171
|
-
}): Promise<Amount>;
|
|
172
|
-
/**
|
|
173
|
-
* Get the total usage cost for a link within an optional date range.
|
|
174
|
-
*
|
|
175
|
-
* @param link_id - The ID of the link
|
|
176
|
-
* @param start_date - Start date for usage calculation
|
|
177
|
-
* @param end_date - End date for usage calculation
|
|
178
|
-
* @returns The total usage cost
|
|
179
|
-
*/
|
|
180
|
-
link(params: {
|
|
181
|
-
link_id: string;
|
|
182
|
-
start_date?: Date;
|
|
183
|
-
end_date?: Date;
|
|
184
|
-
}): Promise<Amount>;
|
|
185
|
-
/**
|
|
186
|
-
* Get the total usage cost for a schema within an optional date range.
|
|
187
|
-
*
|
|
188
|
-
* @param schema_id - The ID of the schema
|
|
189
|
-
* @param start_date - Start date for usage calculation
|
|
190
|
-
* @param end_date - End date for usage calculation
|
|
191
|
-
* @returns The total usage cost
|
|
192
|
-
*/
|
|
193
|
-
schema(params: {
|
|
194
|
-
schema_id: string;
|
|
195
|
-
start_date?: Date;
|
|
196
|
-
end_date?: Date;
|
|
197
|
-
}): Promise<Amount>;
|
|
198
|
-
/**
|
|
199
|
-
* Get the total usage cost for a schema data within an optional date range.
|
|
200
|
-
*
|
|
201
|
-
* @param schema_data_id - The ID of the schema data
|
|
202
|
-
* @param start_date - Start date for usage calculation
|
|
203
|
-
* @param end_date - End date for usage calculation
|
|
204
|
-
* @returns The total usage cost
|
|
205
|
-
*/
|
|
206
|
-
schemaData(params: {
|
|
207
|
-
schema_data_id: string;
|
|
208
|
-
start_date?: Date;
|
|
209
|
-
end_date?: Date;
|
|
210
|
-
}): Promise<Amount>;
|
|
211
|
-
/**
|
|
212
|
-
* Logs an OpenAI request completion as an automation log to make usage calculation possible.
|
|
213
|
-
*
|
|
214
|
-
* @param response_format - The response format of the OpenAI request
|
|
215
|
-
* @param completion - The completion of the OpenAI request
|
|
216
|
-
* @returns The automation log
|
|
217
|
-
*/
|
|
218
|
-
log(params: {
|
|
219
|
-
response_format: any;
|
|
220
|
-
completion: any;
|
|
221
|
-
}): Promise<AutomationLog>;
|
|
222
|
-
}
|
|
223
|
-
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/resources/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAwB,MAAM,kBAAkB,CAAC;AAKvE,qBAAa,UAAU;IACrB,0BAA0B,IAAI,eAAe;IAO7C,YAAY,CAAC,MAAM,GAAE;QACnB,UAAU,CAAC,EAAE,IAAI,CAAC;QAClB,QAAQ,CAAC,EAAE,IAAI,CAAC;KACZ,GAAG,eAAe;IAgBxB,cAAc,CAAC,MAAM,EAAE;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,IAAI,CAAC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