@coveo/platform-client 56.2.0 → 56.4.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/cjs/resources/ApiKeys/ApiKeys.js +6 -0
- package/dist/cjs/resources/ApiKeys/ApiKeys.js.map +1 -1
- package/dist/esm/resources/ApiKeys/ApiKeys.js +6 -0
- package/dist/esm/resources/ApiKeys/ApiKeys.js.map +1 -1
- package/dist/types/resources/ApiKeys/ApiKeys.d.ts +4 -3
- package/dist/types/resources/ApiKeys/ApiKeysInterfaces.d.ts +72 -51
- package/package.json +1 -1
|
@@ -24,6 +24,12 @@ class ApiKey extends Resource_js_1.default {
|
|
|
24
24
|
delete(apiKeyId) {
|
|
25
25
|
return this.api.delete(`${ApiKey.baseUrl}/${apiKeyId}`);
|
|
26
26
|
}
|
|
27
|
+
extend(apiKeyId) {
|
|
28
|
+
return this.api.put(`${ApiKey.baseUrl}/${apiKeyId}/activation/extend`);
|
|
29
|
+
}
|
|
30
|
+
duplicate(apiKeyId, options) {
|
|
31
|
+
return this.api.put(this.buildPath(`${ApiKey.baseUrl}/${apiKeyId}/duplicate`), options);
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
34
|
exports.default = ApiKey;
|
|
29
35
|
//# sourceMappingURL=ApiKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKeys.js","sourceRoot":"","sources":["../../../../src/resources/ApiKeys/ApiKeys.ts"],"names":[],"mappings":";;;AAAA,0EAAmC;
|
|
1
|
+
{"version":3,"file":"ApiKeys.js","sourceRoot":"","sources":["../../../../src/resources/ApiKeys/ApiKeys.ts"],"names":[],"mappings":";;;AAAA,0EAAmC;AACnC,yEAAsC;AAGtC,MAAqB,MAAO,SAAQ,qBAAQ;IACxC,MAAM,CAAC,OAAO,GAAG,uBAAuB,oBAAG,CAAC,cAAc,UAAU,CAAC;IAErE,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC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AI,QAAQ,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;IACzG,CAAC;;AAnCL,yBAoCC"}
|
|
@@ -21,5 +21,11 @@ export default class ApiKey extends Resource {
|
|
|
21
21
|
delete(apiKeyId) {
|
|
22
22
|
return this.api.delete(`${ApiKey.baseUrl}/${apiKeyId}`);
|
|
23
23
|
}
|
|
24
|
+
extend(apiKeyId) {
|
|
25
|
+
return this.api.put(`${ApiKey.baseUrl}/${apiKeyId}/activation/extend`);
|
|
26
|
+
}
|
|
27
|
+
duplicate(apiKeyId, options) {
|
|
28
|
+
return this.api.put(this.buildPath(`${ApiKey.baseUrl}/${apiKeyId}/duplicate`), options);
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
//# sourceMappingURL=ApiKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiKeys.js","sourceRoot":"","sources":["../../../../src/resources/ApiKeys/ApiKeys.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ApiKeys.js","sourceRoot":"","sources":["../../../../src/resources/ApiKeys/ApiKeys.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,kBAAkB,CAAC;AACnC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAGtC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,QAAQ;IACxC,MAAM,CAAC,OAAO,GAAG,uBAAuB,GAAG,CAAC,cAAc,UAAU,CAAC;IAErE,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAgB,MAAM,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,CAAC,MAAyB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAc,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;IACvF,CAAC;IAED,GAAG,CAAC,QAAgB;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAc,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,MAAmB;QACtB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,MAAmB;QACtB,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAEzF,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,QAAgB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,QAAgB;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAO,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,oBAAoB,CAAC,CAAC;IACjF,CAAC;IAED,SAAS,CAAC,QAAgB,EAAE,OAA+B;QACvD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAc,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,IAAI,QAAQ,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;IACzG,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { New } from '../BaseInterfaces.js';
|
|
2
1
|
import Resource from '../Resource.js';
|
|
3
|
-
import { ApiKeyModel, CreateApiKeyOptions } from './ApiKeysInterfaces.js';
|
|
2
|
+
import { ApiKeyModel, CreateApiKeyModel, CreateApiKeyOptions, DuplicateApiKeyOptions } from './ApiKeysInterfaces.js';
|
|
4
3
|
export default class ApiKey extends Resource {
|
|
5
4
|
static baseUrl: string;
|
|
6
5
|
list(): Promise<ApiKeyModel[]>;
|
|
7
|
-
create(apiKey:
|
|
6
|
+
create(apiKey: CreateApiKeyModel, options?: CreateApiKeyOptions): Promise<ApiKeyModel>;
|
|
8
7
|
get(apiKeyId: string): Promise<ApiKeyModel>;
|
|
9
8
|
update(apiKey: ApiKeyModel): Promise<Record<string, unknown>>;
|
|
10
9
|
toggle(apiKey: ApiKeyModel): Promise<Record<string, unknown>>;
|
|
11
10
|
delete(apiKeyId: string): Promise<Record<string, unknown>>;
|
|
11
|
+
extend(apiKeyId: string): Promise<void>;
|
|
12
|
+
duplicate(apiKeyId: string, options: DuplicateApiKeyOptions): Promise<ApiKeyModel>;
|
|
12
13
|
}
|
|
@@ -1,14 +1,51 @@
|
|
|
1
1
|
import { GranularResource, PrivilegeModel } from '../BaseInterfaces.js';
|
|
2
2
|
import { ApiKeyStatus } from '../Enums.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ApiKeyBaseModel extends GranularResource {
|
|
4
|
+
/**
|
|
5
|
+
* The display name for the API key.
|
|
6
|
+
* @example PushApiKey
|
|
7
|
+
*/
|
|
8
|
+
displayName?: string;
|
|
9
|
+
/**
|
|
10
|
+
* A brief description of the API key.
|
|
11
|
+
* @example API key used for managing sources.
|
|
12
|
+
*/
|
|
13
|
+
description?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A set of IP addresses allowed to use the API key.
|
|
16
|
+
*
|
|
17
|
+
* Notes:
|
|
18
|
+
* - IP ranges using CIDR notation are also supported.
|
|
19
|
+
* - If an IP address is included in both the `allowedIps` and the `deniedIps`, the IP address will be denied.
|
|
20
|
+
* @example ["192.168.0.0/16", "29.186.225.13"]
|
|
21
|
+
*/
|
|
22
|
+
allowedIps?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* A set of IP addresses that will be denied access when attempting to use the API key.
|
|
25
|
+
*
|
|
26
|
+
* Notes:
|
|
27
|
+
* - IP ranges using CIDR notation are also supported.
|
|
28
|
+
* - If an IP address is included in both the `allowedIps` as well as the `deniedIps`, the IP address will be denied.
|
|
29
|
+
* @example [`"192.168.0.0/16"`, `"29.186.225.13"`]
|
|
30
|
+
*/
|
|
31
|
+
deniedIps?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* A set of privileges.
|
|
34
|
+
*/
|
|
35
|
+
privileges?: PrivilegeModel[];
|
|
36
|
+
/**
|
|
37
|
+
* Additional configuration to be included in an API key. [to be revised]
|
|
38
|
+
*/
|
|
39
|
+
additionalConfiguration?: AdditionalConfigurationModel;
|
|
40
|
+
}
|
|
41
|
+
export interface ApiKeyModel extends ApiKeyBaseModel {
|
|
4
42
|
/**
|
|
5
43
|
* The unique identifier of the [organization](https://docs.coveo.com/en/222/) the API key was created for.
|
|
6
44
|
*/
|
|
7
45
|
organizationId?: string;
|
|
8
46
|
/**
|
|
9
47
|
* The unique identifier of the API key.
|
|
10
|
-
*
|
|
11
|
-
* **Example:** t4hk287bfj5sg6wskg64ckk5a
|
|
48
|
+
* @example t4hk287bfj5sg6wskg64ckk5a
|
|
12
49
|
*/
|
|
13
50
|
id: string;
|
|
14
51
|
/**
|
|
@@ -17,72 +54,28 @@ export interface ApiKeyModel extends GranularResource {
|
|
|
17
54
|
enabled?: boolean;
|
|
18
55
|
/**
|
|
19
56
|
* The value of the API key.
|
|
20
|
-
*
|
|
21
|
-
* **Example:** xx65151ec3-7b30-4772-a99a-09b4c0f71343
|
|
57
|
+
* @example xx65151ec3-7b30-4772-a99a-09b4c0f71343
|
|
22
58
|
*/
|
|
23
59
|
value?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The display name for the API key.
|
|
26
|
-
*
|
|
27
|
-
* **Example:** PushApiKey
|
|
28
|
-
*/
|
|
29
|
-
displayName?: string;
|
|
30
|
-
/**
|
|
31
|
-
* A brief description of the API key.
|
|
32
|
-
*
|
|
33
|
-
* **Example:** API key used for managing sources.
|
|
34
|
-
*/
|
|
35
|
-
description?: string;
|
|
36
60
|
/**
|
|
37
61
|
* The username or the email address that was used to create this API key.
|
|
38
62
|
*/
|
|
39
63
|
createdBy?: any;
|
|
40
64
|
/**
|
|
41
65
|
* The API key creation date in Unix timestamp in milliseconds.
|
|
42
|
-
*
|
|
43
|
-
* **Example:** 1614969486000
|
|
66
|
+
* @example 1614969486000
|
|
44
67
|
*/
|
|
45
68
|
createdDate?: number;
|
|
46
69
|
/**
|
|
47
70
|
* The approximate API key last used date in Unix timestamp in milliseconds.
|
|
48
|
-
*
|
|
49
|
-
* **Example:** 1624575600000
|
|
71
|
+
* @example 1624575600000
|
|
50
72
|
*/
|
|
51
73
|
lastUsedDate?: number;
|
|
52
|
-
/**
|
|
53
|
-
* A set of IP addresses allowed to use the API key.
|
|
54
|
-
*
|
|
55
|
-
* **Notes:**
|
|
56
|
-
* - IP ranges using CIDR notation are also supported.
|
|
57
|
-
* - If an IP address is included in both the `allowedIps` as well as the `deniedIps`, the IP address will be denied.
|
|
58
|
-
*
|
|
59
|
-
* **Example:** [`"192.168.0.0/16"`, `"29.186.225.13"`]
|
|
60
|
-
*/
|
|
61
|
-
allowedIps?: string[];
|
|
62
|
-
/**
|
|
63
|
-
* A set of IP addresses that will be denied access when attempting to use the API key.
|
|
64
|
-
*
|
|
65
|
-
* **Notes:**
|
|
66
|
-
* - IP ranges using CIDR notation are also supported.
|
|
67
|
-
* - If an IP address is included in both the `allowedIps` as well as the `deniedIps`, the IP address will be denied.
|
|
68
|
-
*
|
|
69
|
-
* **Example:** [`"192.168.0.0/16"`, `"29.186.225.13"`]
|
|
70
|
-
*/
|
|
71
|
-
deniedIps?: string[];
|
|
72
|
-
/**
|
|
73
|
-
* A set of privileges.
|
|
74
|
-
*/
|
|
75
|
-
privileges?: PrivilegeModel[];
|
|
76
74
|
/**
|
|
77
75
|
* The unique identifier of the API key.
|
|
78
|
-
*
|
|
79
|
-
* **Example:** t4hk287bfj5sg6wskg64ckk5a
|
|
76
|
+
* @example t4hk287bfj5sg6wskg64ckk5a
|
|
80
77
|
*/
|
|
81
78
|
resourceId?: string;
|
|
82
|
-
/**
|
|
83
|
-
* Additional configuration to be included in an API key. [to be revised]
|
|
84
|
-
*/
|
|
85
|
-
additionalConfiguration?: AdditionalConfigurationModel;
|
|
86
79
|
/**
|
|
87
80
|
* The expiration date of the API key.
|
|
88
81
|
*/
|
|
@@ -104,12 +97,40 @@ export interface ApiKeyModel extends GranularResource {
|
|
|
104
97
|
*/
|
|
105
98
|
disabledDate?: number;
|
|
106
99
|
}
|
|
100
|
+
export interface CreateApiKeyModel extends ApiKeyBaseModel {
|
|
101
|
+
/**
|
|
102
|
+
* The duration of the API key in ISO-8601 format. Once the duration is reached the key expires and cannot be used anymore.
|
|
103
|
+
* @example
|
|
104
|
+
* 'P1Y' for 1 year
|
|
105
|
+
* 'P14D' for 14 days
|
|
106
|
+
* 'P1M' for 1 month.
|
|
107
|
+
* 'P1Y3M14D' for 1 year, 3 months, and 14 days.
|
|
108
|
+
*/
|
|
109
|
+
lifetimeDuration?: string;
|
|
110
|
+
}
|
|
107
111
|
export interface CreateApiKeyOptions {
|
|
108
112
|
/**
|
|
109
113
|
* The unique identifier of the template on which to base the API key.
|
|
110
114
|
*/
|
|
111
115
|
apiKeyTemplateId?: string;
|
|
112
116
|
}
|
|
117
|
+
export interface DuplicateApiKeyOptions {
|
|
118
|
+
/**
|
|
119
|
+
* The display name for the API key.
|
|
120
|
+
*
|
|
121
|
+
*/
|
|
122
|
+
displayName?: string;
|
|
123
|
+
/**
|
|
124
|
+
* A brief description of the API key.
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
description?: string;
|
|
128
|
+
/**
|
|
129
|
+
* The lifetime duration of the API key (iso8601 format).
|
|
130
|
+
* @example 'P1M'
|
|
131
|
+
*/
|
|
132
|
+
lifetimeDuration: string;
|
|
133
|
+
}
|
|
113
134
|
interface AdditionalConfigurationModel {
|
|
114
135
|
/**
|
|
115
136
|
* Configuration specific to commerce organization. [to be revised]
|