@wix/secrets 1.0.5 → 1.0.7
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/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +24 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/src/velo-secrets-vault-v1-secret.http.d.ts +12 -11
- package/build/cjs/src/velo-secrets-vault-v1-secret.http.js +12 -11
- package/build/cjs/src/velo-secrets-vault-v1-secret.http.js.map +1 -1
- package/build/cjs/src/velo-secrets-vault-v1-secret.universal.d.ts +18 -15
- package/build/cjs/src/velo-secrets-vault-v1-secret.universal.js +14 -13
- package/build/cjs/src/velo-secrets-vault-v1-secret.universal.js.map +1 -1
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/src/velo-secrets-vault-v1-secret.http.d.ts +12 -11
- package/build/es/src/velo-secrets-vault-v1-secret.http.js +12 -11
- package/build/es/src/velo-secrets-vault-v1-secret.http.js.map +1 -1
- package/build/es/src/velo-secrets-vault-v1-secret.universal.d.ts +18 -15
- package/build/es/src/velo-secrets-vault-v1-secret.universal.js +14 -13
- package/build/es/src/velo-secrets-vault-v1-secret.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as secrets from './src/velo-secrets-vault-v1-secret.universal';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.secrets = void 0;
|
|
23
|
+
exports.secrets = __importStar(require("./src/velo-secrets-vault-v1-secret.universal"));
|
|
24
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,wFAAwE"}
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
2
|
import { CreateSecretRequest, CreateSecretResponse, DeleteSecretRequest, DeleteSecretResponse, GetSecretValueRequest, GetSecretValueResponse, ListSecretInfoRequest, ListSecretInfoResponse, UpdateSecretRequest, UpdateSecretResponse } from './velo-secrets-vault-v1-secret.types';
|
|
3
3
|
/**
|
|
4
|
-
* Retrieves the secret value by the secret name.
|
|
4
|
+
* Retrieves the secret value specified by the secret name.
|
|
5
5
|
*
|
|
6
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
6
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
7
7
|
*
|
|
8
8
|
* >**Note:**
|
|
9
9
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
10
10
|
*/
|
|
11
11
|
export declare function getSecretValue(payload: GetSecretValueRequest): RequestOptionsFactory<GetSecretValueResponse>;
|
|
12
12
|
/**
|
|
13
|
-
* Retrieves a list of objects containing information about all secrets
|
|
13
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
14
14
|
*
|
|
15
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
15
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
16
16
|
*
|
|
17
|
-
* > **
|
|
17
|
+
* > **Note:**
|
|
18
18
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
19
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
20
19
|
*/
|
|
21
20
|
export declare function listSecretInfo(payload: ListSecretInfoRequest): RequestOptionsFactory<ListSecretInfoResponse>;
|
|
22
21
|
/**
|
|
23
22
|
* Creates a new secret.
|
|
24
23
|
*
|
|
25
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
24
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
26
25
|
*
|
|
27
26
|
* >**Notes:**
|
|
28
27
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
29
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
28
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
30
29
|
*/
|
|
31
30
|
export declare function createSecret(payload: CreateSecretRequest): RequestOptionsFactory<CreateSecretResponse>;
|
|
32
31
|
/**
|
|
33
32
|
* Deletes an existing secret by ID.
|
|
34
33
|
*
|
|
35
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
34
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
36
35
|
*
|
|
37
36
|
* >**Note:**
|
|
38
37
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -43,11 +42,13 @@ export declare function deleteSecret(payload: DeleteSecretRequest): RequestOptio
|
|
|
43
42
|
* Updates the specified fields of an existing secret by ID.
|
|
44
43
|
*
|
|
45
44
|
*
|
|
46
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
45
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
46
|
+
*
|
|
47
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
47
48
|
*
|
|
48
49
|
* > **Notes:**
|
|
49
50
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
50
51
|
* > - You can't rename the secret with a name of an existing secret.
|
|
51
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
52
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
52
53
|
*/
|
|
53
54
|
export declare function partiallyUpdateSecret(payload: UpdateSecretRequest): RequestOptionsFactory<UpdateSecretResponse>;
|
|
@@ -48,9 +48,9 @@ function resolveWixVeloSecretsVaultV1SecretsVaultServiceUrl(opts) {
|
|
|
48
48
|
return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* Retrieves the secret value by the secret name.
|
|
51
|
+
* Retrieves the secret value specified by the secret name.
|
|
52
52
|
*
|
|
53
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
53
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
54
54
|
*
|
|
55
55
|
* >**Note:**
|
|
56
56
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
@@ -79,13 +79,12 @@ function getSecretValue(payload) {
|
|
|
79
79
|
}
|
|
80
80
|
exports.getSecretValue = getSecretValue;
|
|
81
81
|
/**
|
|
82
|
-
* Retrieves a list of objects containing information about all secrets
|
|
82
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
83
83
|
*
|
|
84
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
84
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
85
85
|
*
|
|
86
|
-
* > **
|
|
86
|
+
* > **Note:**
|
|
87
87
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
88
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
89
88
|
*/
|
|
90
89
|
function listSecretInfo(payload) {
|
|
91
90
|
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_listSecretInfoRequest, {});
|
|
@@ -115,11 +114,11 @@ exports.listSecretInfo = listSecretInfo;
|
|
|
115
114
|
/**
|
|
116
115
|
* Creates a new secret.
|
|
117
116
|
*
|
|
118
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
117
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
119
118
|
*
|
|
120
119
|
* >**Notes:**
|
|
121
120
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
122
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
121
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
123
122
|
*/
|
|
124
123
|
function createSecret(payload) {
|
|
125
124
|
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createSecretRequest, { _secret });
|
|
@@ -147,7 +146,7 @@ exports.createSecret = createSecret;
|
|
|
147
146
|
/**
|
|
148
147
|
* Deletes an existing secret by ID.
|
|
149
148
|
*
|
|
150
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
149
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
151
150
|
*
|
|
152
151
|
* >**Note:**
|
|
153
152
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -180,12 +179,14 @@ exports.deleteSecret = deleteSecret;
|
|
|
180
179
|
* Updates the specified fields of an existing secret by ID.
|
|
181
180
|
*
|
|
182
181
|
*
|
|
183
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
182
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
183
|
+
*
|
|
184
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
184
185
|
*
|
|
185
186
|
* > **Notes:**
|
|
186
187
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
187
188
|
* > - You can't rename the secret with a name of an existing secret.
|
|
188
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
189
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
189
190
|
*/
|
|
190
191
|
function partiallyUpdateSecret(payload) {
|
|
191
192
|
const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_updateSecretRequest, { _secret });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"velo-secrets-vault-v1-secret.http.js","sourceRoot":"","sources":["../../../src/velo-secrets-vault-v1-secret.http.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AACvD,8DAA2D;AAC3D,sDAAgD;AAgBhD,MAAM,oBAAoB,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACnD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACvD,MAAM,OAAO,GAAG;IACd,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,2BAA2B;CACzC,CAAC;AACF,MAAM,oBAAoB,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACnD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,SAAS,kDAAkD,CACzD,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,EAAE;aACb;SACF;QACD,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,EAAE;aACb;SACF;QACD,sBAAsB,EAAE;YACtB;gBACE,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,EAAE;aACb;SACF;QACD,0BAA0B,EAAE;YAC1B;gBACE,OAAO,EAAE,kCAAkC;gBAC3C,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAA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AO,GAAG,OAAO,CAAC;IAE1C,OAAO,uBAAuB,CAAC;AACjC,CAAC;AA/BD,sDA+BC"}
|
|
@@ -11,13 +11,15 @@ export interface Secret {
|
|
|
11
11
|
*/
|
|
12
12
|
_id?: string | null;
|
|
13
13
|
/**
|
|
14
|
-
* A unique, meaningful name used for retrieving the secret at runtime with the [`getSecretValue`](#
|
|
14
|
+
* A unique, meaningful name used for retrieving the secret at runtime with the [`getSecretValue()`](#getsecretvalue) function. You can use alphanumeric characters and the following special characters: `_+=-@#$`. Spaces are not supported.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
name?: string | null;
|
|
18
18
|
/** An optional text describing the secret's purpose or any other notes about it. */
|
|
19
19
|
description?: string | null;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
* @internal */
|
|
21
23
|
value?: string | null;
|
|
22
24
|
/**
|
|
23
25
|
* The date and time the secreted was created.
|
|
@@ -76,9 +78,9 @@ export interface UpdateSecretRequest {
|
|
|
76
78
|
export interface UpdateSecretResponse {
|
|
77
79
|
}
|
|
78
80
|
/**
|
|
79
|
-
* Retrieves the secret value by the secret name.
|
|
81
|
+
* Retrieves the secret value specified by the secret name.
|
|
80
82
|
*
|
|
81
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
83
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
82
84
|
*
|
|
83
85
|
* >**Note:**
|
|
84
86
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
@@ -90,13 +92,12 @@ export interface UpdateSecretResponse {
|
|
|
90
92
|
*/
|
|
91
93
|
export declare function getSecretValue(name: string): Promise<GetSecretValueResponse>;
|
|
92
94
|
/**
|
|
93
|
-
* Retrieves a list of objects containing information about all secrets
|
|
95
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
94
96
|
*
|
|
95
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
97
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
96
98
|
*
|
|
97
|
-
* > **
|
|
99
|
+
* > **Note:**
|
|
98
100
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
99
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
100
101
|
* @public
|
|
101
102
|
* @documentationMaturity preview
|
|
102
103
|
* @returns Fulfilled - A list of objects containing information about your site's secrets. Rejected - Error message.
|
|
@@ -105,17 +106,17 @@ export declare function listSecretInfo(): Promise<ListSecretInfoResponse>;
|
|
|
105
106
|
/**
|
|
106
107
|
* Creates a new secret.
|
|
107
108
|
*
|
|
108
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
109
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
109
110
|
*
|
|
110
111
|
* >**Notes:**
|
|
111
112
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
112
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
113
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
113
114
|
* @public
|
|
114
115
|
* @documentationMaturity preview
|
|
115
116
|
* @requiredField secret
|
|
116
117
|
* @requiredField secret.name
|
|
117
118
|
* @requiredField secret.value
|
|
118
|
-
* @param secret -
|
|
119
|
+
* @param secret - Fields of a new secret.
|
|
119
120
|
* @returns Fulfilled - The ID of the created secret.
|
|
120
121
|
* Rejected - Error message.
|
|
121
122
|
*/
|
|
@@ -123,7 +124,7 @@ export declare function createSecret(secret: Secret): Promise<CreateSecretRespon
|
|
|
123
124
|
/**
|
|
124
125
|
* Deletes an existing secret by ID.
|
|
125
126
|
*
|
|
126
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
127
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
127
128
|
*
|
|
128
129
|
* >**Note:**
|
|
129
130
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -132,19 +133,21 @@ export declare function createSecret(secret: Secret): Promise<CreateSecretRespon
|
|
|
132
133
|
* @documentationMaturity preview
|
|
133
134
|
* @requiredField _id
|
|
134
135
|
* @param _id - The unique ID of the secret to be deleted.
|
|
135
|
-
* @returns Fulfilled - When the secret is successfully deleted
|
|
136
|
+
* @returns Fulfilled - When the secret is successfully deleted. Rejected - Error message.
|
|
136
137
|
*/
|
|
137
138
|
export declare function deleteSecret(_id: string): Promise<void>;
|
|
138
139
|
/**
|
|
139
140
|
* Updates the specified fields of an existing secret by ID.
|
|
140
141
|
*
|
|
141
142
|
*
|
|
142
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
143
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
144
|
+
*
|
|
145
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
143
146
|
*
|
|
144
147
|
* > **Notes:**
|
|
145
148
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
146
149
|
* > - You can't rename the secret with a name of an existing secret.
|
|
147
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
150
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
148
151
|
* @param _id - The unique ID of the secret to be updated.
|
|
149
152
|
* @param secret - The secret fields to update.
|
|
150
153
|
* @public
|
|
@@ -57,9 +57,9 @@ const _listSecretInfoResponse = {};
|
|
|
57
57
|
const _updateSecretRequest = {};
|
|
58
58
|
const _updateSecretResponse = {};
|
|
59
59
|
/**
|
|
60
|
-
* Retrieves the secret value by the secret name.
|
|
60
|
+
* Retrieves the secret value specified by the secret name.
|
|
61
61
|
*
|
|
62
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
62
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
63
63
|
*
|
|
64
64
|
* >**Note:**
|
|
65
65
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
@@ -114,13 +114,12 @@ function getSecretValue(name) {
|
|
|
114
114
|
}
|
|
115
115
|
exports.getSecretValue = getSecretValue;
|
|
116
116
|
/**
|
|
117
|
-
* Retrieves a list of objects containing information about all secrets
|
|
117
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
118
118
|
*
|
|
119
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
119
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
120
120
|
*
|
|
121
|
-
* > **
|
|
121
|
+
* > **Note:**
|
|
122
122
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
123
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
124
123
|
* @public
|
|
125
124
|
* @documentationMaturity preview
|
|
126
125
|
* @returns Fulfilled - A list of objects containing information about your site's secrets. Rejected - Error message.
|
|
@@ -170,17 +169,17 @@ exports.listSecretInfo = listSecretInfo;
|
|
|
170
169
|
/**
|
|
171
170
|
* Creates a new secret.
|
|
172
171
|
*
|
|
173
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
172
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
174
173
|
*
|
|
175
174
|
* >**Notes:**
|
|
176
175
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
177
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
176
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
178
177
|
* @public
|
|
179
178
|
* @documentationMaturity preview
|
|
180
179
|
* @requiredField secret
|
|
181
180
|
* @requiredField secret.name
|
|
182
181
|
* @requiredField secret.value
|
|
183
|
-
* @param secret -
|
|
182
|
+
* @param secret - Fields of a new secret.
|
|
184
183
|
* @returns Fulfilled - The ID of the created secret.
|
|
185
184
|
* Rejected - Error message.
|
|
186
185
|
*/
|
|
@@ -231,7 +230,7 @@ exports.createSecret = createSecret;
|
|
|
231
230
|
/**
|
|
232
231
|
* Deletes an existing secret by ID.
|
|
233
232
|
*
|
|
234
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
233
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
235
234
|
*
|
|
236
235
|
* >**Note:**
|
|
237
236
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -240,7 +239,7 @@ exports.createSecret = createSecret;
|
|
|
240
239
|
* @documentationMaturity preview
|
|
241
240
|
* @requiredField _id
|
|
242
241
|
* @param _id - The unique ID of the secret to be deleted.
|
|
243
|
-
* @returns Fulfilled - When the secret is successfully deleted
|
|
242
|
+
* @returns Fulfilled - When the secret is successfully deleted. Rejected - Error message.
|
|
244
243
|
*/
|
|
245
244
|
function deleteSecret(_id) {
|
|
246
245
|
var _a, _b, _c;
|
|
@@ -290,12 +289,14 @@ exports.deleteSecret = deleteSecret;
|
|
|
290
289
|
* Updates the specified fields of an existing secret by ID.
|
|
291
290
|
*
|
|
292
291
|
*
|
|
293
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
292
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
293
|
+
*
|
|
294
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
294
295
|
*
|
|
295
296
|
* > **Notes:**
|
|
296
297
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
297
298
|
* > - You can't rename the secret with a name of an existing secret.
|
|
298
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
299
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
299
300
|
* @param _id - The unique ID of the secret to be updated.
|
|
300
301
|
* @param secret - The secret fields to update.
|
|
301
302
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"velo-secrets-vault-v1-secret.universal.js","sourceRoot":"","sources":["../../../src/velo-secrets-vault-v1-secret.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,2GAA6F;AAE7F,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"velo-secrets-vault-v1-secret.universal.js","sourceRoot":"","sources":["../../../src/velo-secrets-vault-v1-secret.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,2GAA6F;AAE7F,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAmF5B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAE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,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,IAAA,qBAAc,EAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,KAAK;gBACL,QAAQ;aACT,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF;AApDD,oCAoDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as secrets from './src/velo-secrets-vault-v1-secret.universal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,8CAA8C,CAAC"}
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
2
|
import { CreateSecretRequest, CreateSecretResponse, DeleteSecretRequest, DeleteSecretResponse, GetSecretValueRequest, GetSecretValueResponse, ListSecretInfoRequest, ListSecretInfoResponse, UpdateSecretRequest, UpdateSecretResponse } from './velo-secrets-vault-v1-secret.types';
|
|
3
3
|
/**
|
|
4
|
-
* Retrieves the secret value by the secret name.
|
|
4
|
+
* Retrieves the secret value specified by the secret name.
|
|
5
5
|
*
|
|
6
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
6
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
7
7
|
*
|
|
8
8
|
* >**Note:**
|
|
9
9
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
10
10
|
*/
|
|
11
11
|
export declare function getSecretValue(payload: GetSecretValueRequest): RequestOptionsFactory<GetSecretValueResponse>;
|
|
12
12
|
/**
|
|
13
|
-
* Retrieves a list of objects containing information about all secrets
|
|
13
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
14
14
|
*
|
|
15
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
15
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
16
16
|
*
|
|
17
|
-
* > **
|
|
17
|
+
* > **Note:**
|
|
18
18
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
19
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
20
19
|
*/
|
|
21
20
|
export declare function listSecretInfo(payload: ListSecretInfoRequest): RequestOptionsFactory<ListSecretInfoResponse>;
|
|
22
21
|
/**
|
|
23
22
|
* Creates a new secret.
|
|
24
23
|
*
|
|
25
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
24
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
26
25
|
*
|
|
27
26
|
* >**Notes:**
|
|
28
27
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
29
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
28
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
30
29
|
*/
|
|
31
30
|
export declare function createSecret(payload: CreateSecretRequest): RequestOptionsFactory<CreateSecretResponse>;
|
|
32
31
|
/**
|
|
33
32
|
* Deletes an existing secret by ID.
|
|
34
33
|
*
|
|
35
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
34
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
36
35
|
*
|
|
37
36
|
* >**Note:**
|
|
38
37
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -43,11 +42,13 @@ export declare function deleteSecret(payload: DeleteSecretRequest): RequestOptio
|
|
|
43
42
|
* Updates the specified fields of an existing secret by ID.
|
|
44
43
|
*
|
|
45
44
|
*
|
|
46
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
45
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
46
|
+
*
|
|
47
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
47
48
|
*
|
|
48
49
|
* > **Notes:**
|
|
49
50
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
50
51
|
* > - You can't rename the secret with a name of an existing secret.
|
|
51
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
52
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
52
53
|
*/
|
|
53
54
|
export declare function partiallyUpdateSecret(payload: UpdateSecretRequest): RequestOptionsFactory<UpdateSecretResponse>;
|
|
@@ -45,9 +45,9 @@ function resolveWixVeloSecretsVaultV1SecretsVaultServiceUrl(opts) {
|
|
|
45
45
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Retrieves the secret value by the secret name.
|
|
48
|
+
* Retrieves the secret value specified by the secret name.
|
|
49
49
|
*
|
|
50
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
50
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
51
51
|
*
|
|
52
52
|
* >**Note:**
|
|
53
53
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
@@ -75,13 +75,12 @@ export function getSecretValue(payload) {
|
|
|
75
75
|
return __getSecretValue;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
* Retrieves a list of objects containing information about all secrets
|
|
78
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
79
79
|
*
|
|
80
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
80
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
81
81
|
*
|
|
82
|
-
* > **
|
|
82
|
+
* > **Note:**
|
|
83
83
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
84
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
85
84
|
*/
|
|
86
85
|
export function listSecretInfo(payload) {
|
|
87
86
|
const { toJSON: toReq, fromJSON: fromReq } = serializer(_listSecretInfoRequest, {});
|
|
@@ -110,11 +109,11 @@ export function listSecretInfo(payload) {
|
|
|
110
109
|
/**
|
|
111
110
|
* Creates a new secret.
|
|
112
111
|
*
|
|
113
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
112
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
114
113
|
*
|
|
115
114
|
* >**Notes:**
|
|
116
115
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
117
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
116
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
118
117
|
*/
|
|
119
118
|
export function createSecret(payload) {
|
|
120
119
|
const { toJSON: toReq, fromJSON: fromReq } = serializer(_createSecretRequest, { _secret });
|
|
@@ -141,7 +140,7 @@ export function createSecret(payload) {
|
|
|
141
140
|
/**
|
|
142
141
|
* Deletes an existing secret by ID.
|
|
143
142
|
*
|
|
144
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
143
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
145
144
|
*
|
|
146
145
|
* >**Note:**
|
|
147
146
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -173,12 +172,14 @@ export function deleteSecret(payload) {
|
|
|
173
172
|
* Updates the specified fields of an existing secret by ID.
|
|
174
173
|
*
|
|
175
174
|
*
|
|
176
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
175
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
176
|
+
*
|
|
177
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
177
178
|
*
|
|
178
179
|
* > **Notes:**
|
|
179
180
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
180
181
|
* > - You can't rename the secret with a name of an existing secret.
|
|
181
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
182
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
182
183
|
*/
|
|
183
184
|
export function partiallyUpdateSecret(payload) {
|
|
184
185
|
const { toJSON: toReq, fromJSON: fromReq } = serializer(_updateSecretRequest, { _secret });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"velo-secrets-vault-v1-secret.http.js","sourceRoot":"","sources":["../../../src/velo-secrets-vault-v1-secret.http.ts"],"names":[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14
|
-
* A unique, meaningful name used for retrieving the secret at runtime with the [`getSecretValue`](#
|
|
14
|
+
* A unique, meaningful name used for retrieving the secret at runtime with the [`getSecretValue()`](#getsecretvalue) function. You can use alphanumeric characters and the following special characters: `_+=-@#$`. Spaces are not supported.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
name?: string | null;
|
|
18
18
|
/** An optional text describing the secret's purpose or any other notes about it. */
|
|
19
19
|
description?: string | null;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
* @internal */
|
|
21
23
|
value?: string | null;
|
|
22
24
|
/**
|
|
23
25
|
* The date and time the secreted was created.
|
|
@@ -76,9 +78,9 @@ export interface UpdateSecretRequest {
|
|
|
76
78
|
export interface UpdateSecretResponse {
|
|
77
79
|
}
|
|
78
80
|
/**
|
|
79
|
-
* Retrieves the secret value by the secret name.
|
|
81
|
+
* Retrieves the secret value specified by the secret name.
|
|
80
82
|
*
|
|
81
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
83
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
82
84
|
*
|
|
83
85
|
* >**Note:**
|
|
84
86
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
@@ -90,13 +92,12 @@ export interface UpdateSecretResponse {
|
|
|
90
92
|
*/
|
|
91
93
|
export declare function getSecretValue(name: string): Promise<GetSecretValueResponse>;
|
|
92
94
|
/**
|
|
93
|
-
* Retrieves a list of objects containing information about all secrets
|
|
95
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
94
96
|
*
|
|
95
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
97
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
96
98
|
*
|
|
97
|
-
* > **
|
|
99
|
+
* > **Note:**
|
|
98
100
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
99
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
100
101
|
* @public
|
|
101
102
|
* @documentationMaturity preview
|
|
102
103
|
* @returns Fulfilled - A list of objects containing information about your site's secrets. Rejected - Error message.
|
|
@@ -105,17 +106,17 @@ export declare function listSecretInfo(): Promise<ListSecretInfoResponse>;
|
|
|
105
106
|
/**
|
|
106
107
|
* Creates a new secret.
|
|
107
108
|
*
|
|
108
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
109
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
109
110
|
*
|
|
110
111
|
* >**Notes:**
|
|
111
112
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
112
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
113
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
113
114
|
* @public
|
|
114
115
|
* @documentationMaturity preview
|
|
115
116
|
* @requiredField secret
|
|
116
117
|
* @requiredField secret.name
|
|
117
118
|
* @requiredField secret.value
|
|
118
|
-
* @param secret -
|
|
119
|
+
* @param secret - Fields of a new secret.
|
|
119
120
|
* @returns Fulfilled - The ID of the created secret.
|
|
120
121
|
* Rejected - Error message.
|
|
121
122
|
*/
|
|
@@ -123,7 +124,7 @@ export declare function createSecret(secret: Secret): Promise<CreateSecretRespon
|
|
|
123
124
|
/**
|
|
124
125
|
* Deletes an existing secret by ID.
|
|
125
126
|
*
|
|
126
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
127
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
127
128
|
*
|
|
128
129
|
* >**Note:**
|
|
129
130
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -132,19 +133,21 @@ export declare function createSecret(secret: Secret): Promise<CreateSecretRespon
|
|
|
132
133
|
* @documentationMaturity preview
|
|
133
134
|
* @requiredField _id
|
|
134
135
|
* @param _id - The unique ID of the secret to be deleted.
|
|
135
|
-
* @returns Fulfilled - When the secret is successfully deleted
|
|
136
|
+
* @returns Fulfilled - When the secret is successfully deleted. Rejected - Error message.
|
|
136
137
|
*/
|
|
137
138
|
export declare function deleteSecret(_id: string): Promise<void>;
|
|
138
139
|
/**
|
|
139
140
|
* Updates the specified fields of an existing secret by ID.
|
|
140
141
|
*
|
|
141
142
|
*
|
|
142
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
143
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
144
|
+
*
|
|
145
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
143
146
|
*
|
|
144
147
|
* > **Notes:**
|
|
145
148
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
146
149
|
* > - You can't rename the secret with a name of an existing secret.
|
|
147
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
150
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
148
151
|
* @param _id - The unique ID of the secret to be updated.
|
|
149
152
|
* @param secret - The secret fields to update.
|
|
150
153
|
* @public
|
|
@@ -35,9 +35,9 @@ const _listSecretInfoResponse = {};
|
|
|
35
35
|
const _updateSecretRequest = {};
|
|
36
36
|
const _updateSecretResponse = {};
|
|
37
37
|
/**
|
|
38
|
-
* Retrieves the secret value by the secret name.
|
|
38
|
+
* Retrieves the secret value specified by the secret name.
|
|
39
39
|
*
|
|
40
|
-
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret
|
|
40
|
+
* The `getSecretValue()` function returns a Promise that resolves to the value of the secret with the specified given name.
|
|
41
41
|
*
|
|
42
42
|
* >**Note:**
|
|
43
43
|
* > Only use a secret's value in the backend code. Returning the secret value in the frontend is a security risk.
|
|
@@ -91,13 +91,12 @@ export function getSecretValue(name) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
|
-
* Retrieves a list of objects containing information about all secrets
|
|
94
|
+
* Retrieves a list of objects containing information about all secrets.
|
|
95
95
|
*
|
|
96
|
-
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all
|
|
96
|
+
* The `listSecretInfo()` function returns a Promise that resolves to a list containing information about all secrets stored on your site.
|
|
97
97
|
*
|
|
98
|
-
* > **
|
|
98
|
+
* > **Note:**
|
|
99
99
|
* > - The secret's value does not get returned for security reasons. To retrieve a secret's value, use the [`getSecretValue()`](#getSecretValue) function.
|
|
100
|
-
* > - Do not use `listSecretInfo()` in a **.jsw** file with anonymous permissions! This is a serious security risk which exposes your secrets to potential leaks. To prevent this, implement `listSecretInfo()` in a separate **.js** file to block frontend access. If you must include `listSecretInfo()` in a **.jsw** file, make sure the exported function has [permissions set](https://support.wix.com/en/article/velo-about-web-module-permissions) to **Admin**.
|
|
101
100
|
* @public
|
|
102
101
|
* @documentationMaturity preview
|
|
103
102
|
* @returns Fulfilled - A list of objects containing information about your site's secrets. Rejected - Error message.
|
|
@@ -146,17 +145,17 @@ export function listSecretInfo() {
|
|
|
146
145
|
/**
|
|
147
146
|
* Creates a new secret.
|
|
148
147
|
*
|
|
149
|
-
* The `createSecret()` function returns a Promise that resolves
|
|
148
|
+
* The `createSecret()` function returns a Promise that resolves secret ID when the secret is created.
|
|
150
149
|
*
|
|
151
150
|
* >**Notes:**
|
|
152
151
|
* > - The secret's name cannot start with `'wix'` or be identical to an existing secret's name.
|
|
153
|
-
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()
|
|
152
|
+
* > - Don't leave private keys in your code. Leaving them in your code is a security risk. Make sure to delete the keys from the code after running `createSecret()`.
|
|
154
153
|
* @public
|
|
155
154
|
* @documentationMaturity preview
|
|
156
155
|
* @requiredField secret
|
|
157
156
|
* @requiredField secret.name
|
|
158
157
|
* @requiredField secret.value
|
|
159
|
-
* @param secret -
|
|
158
|
+
* @param secret - Fields of a new secret.
|
|
160
159
|
* @returns Fulfilled - The ID of the created secret.
|
|
161
160
|
* Rejected - Error message.
|
|
162
161
|
*/
|
|
@@ -206,7 +205,7 @@ export function createSecret(secret) {
|
|
|
206
205
|
/**
|
|
207
206
|
* Deletes an existing secret by ID.
|
|
208
207
|
*
|
|
209
|
-
* The `deleteSecret()` function returns a Promise that resolves when
|
|
208
|
+
* The `deleteSecret()` function returns a Promise that resolves when the secret is deleted. You can retrieve the secret `_id` using the [`listSecretInfo()`](#listsecretinfo) function.
|
|
210
209
|
*
|
|
211
210
|
* >**Note:**
|
|
212
211
|
* > Deleting a secret is irreversible and will break all code using the secret.
|
|
@@ -215,7 +214,7 @@ export function createSecret(secret) {
|
|
|
215
214
|
* @documentationMaturity preview
|
|
216
215
|
* @requiredField _id
|
|
217
216
|
* @param _id - The unique ID of the secret to be deleted.
|
|
218
|
-
* @returns Fulfilled - When the secret is successfully deleted
|
|
217
|
+
* @returns Fulfilled - When the secret is successfully deleted. Rejected - Error message.
|
|
219
218
|
*/
|
|
220
219
|
export function deleteSecret(_id) {
|
|
221
220
|
var _a, _b, _c;
|
|
@@ -264,12 +263,14 @@ export function deleteSecret(_id) {
|
|
|
264
263
|
* Updates the specified fields of an existing secret by ID.
|
|
265
264
|
*
|
|
266
265
|
*
|
|
267
|
-
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more
|
|
266
|
+
* The `updateSecret()` function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the `secret` object will be updated. All other properties will remain unchanged.
|
|
267
|
+
*
|
|
268
|
+
* You can retrieve the `_id` parameter from the [`listSecretInfo()`](#listsecretinfo) function. The secret `_id` is different from the secret `name` used by the [`getSecretValue()`](#getsecretvalue) function.
|
|
268
269
|
*
|
|
269
270
|
* > **Notes:**
|
|
270
271
|
* > - Changing a secret's name or value will break all code using the secret.
|
|
271
272
|
* > - You can't rename the secret with a name of an existing secret.
|
|
272
|
-
* > - Don't leave private keys in your code! Leaving them in is a security risk.
|
|
273
|
+
* > - Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running `updateSecret()`.
|
|
273
274
|
* @param _id - The unique ID of the secret to be updated.
|
|
274
275
|
* @param secret - The secret fields to update.
|
|
275
276
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"velo-secrets-vault-v1-secret.universal.js","sourceRoot":"","sources":["../../../src/velo-secrets-vault-v1-secret.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,qCAAqC,MAAM,qCAAqC,CAAC;AAE7F,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"velo-secrets-vault-v1-secret.universal.js","sourceRoot":"","sources":["../../../src/velo-secrets-vault-v1-secret.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,qCAAqC,MAAM,qCAAqC,CAAC;AAE7F,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAmF5B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAgB,cAAc,CAClC,IAAY;;;QAEZ,MAAM,qBAAq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E,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/secrets",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"groupId": "com.wixpress.public-sdk-autogen"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"falconPackageHash": "
|
|
36
|
+
"falconPackageHash": "5df45d21cfc0500eab1592e84b1916397f18079f0731d673f4956f3a"
|
|
37
37
|
}
|