@wix/secrets 1.0.28 → 1.0.29
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/context/package.json +2 -1
- package/meta/package.json +2 -1
- package/package.json +11 -5
- package/type-bundles/context.bundle.d.ts +197 -0
- package/type-bundles/index.bundle.d.ts +332 -0
- package/type-bundles/meta.bundle.d.ts +183 -0
package/context/package.json
CHANGED
package/meta/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/secrets",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -9,21 +9,27 @@
|
|
|
9
9
|
"module": "build/es/index.js",
|
|
10
10
|
"main": "build/cjs/index.js",
|
|
11
11
|
"typings": "./build/cjs/index.d.ts",
|
|
12
|
+
"typesBundle": "./type-bundles/index.bundle.d.ts",
|
|
12
13
|
"files": [
|
|
13
14
|
"build",
|
|
14
15
|
"frontend/package.json",
|
|
15
16
|
"meta",
|
|
16
|
-
"context"
|
|
17
|
+
"context",
|
|
18
|
+
"type-bundles"
|
|
17
19
|
],
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"@wix/secrets_secrets": "1.0.
|
|
21
|
+
"@wix/secrets_secrets": "1.0.18"
|
|
20
22
|
},
|
|
21
23
|
"devDependencies": {
|
|
22
24
|
"@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
|
|
25
|
+
"glob": "^10.4.1",
|
|
26
|
+
"rollup": "^4.18.0",
|
|
27
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
23
28
|
"typescript": "^5.3.2"
|
|
24
29
|
},
|
|
25
30
|
"scripts": {
|
|
26
|
-
"build": "tsc -b tsconfig.json tsconfig.esm.json",
|
|
31
|
+
"build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles",
|
|
32
|
+
"build:dts-bundles": "test -f config/rollup-config.js && rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'",
|
|
27
33
|
"test": ":"
|
|
28
34
|
},
|
|
29
35
|
"wix": {
|
|
@@ -37,5 +43,5 @@
|
|
|
37
43
|
"fqdn": ""
|
|
38
44
|
}
|
|
39
45
|
},
|
|
40
|
-
"falconPackageHash": "
|
|
46
|
+
"falconPackageHash": "15db40068ee7e861b05e074b871f1ddde3db310f3c69f356a51d9259"
|
|
41
47
|
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
interface Secret {
|
|
2
|
+
/**
|
|
3
|
+
* The secret's unique ID.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
6
|
+
_id?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* A unique, meaningful name used for retrieving the secret at runtime with the `getSecretValue()` function. You can use alphanumeric characters and the following special characters: `_+=-@#$`. Spaces are not supported.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
name?: string | null;
|
|
12
|
+
/** An optional text describing the secret's purpose or any other notes about it. */
|
|
13
|
+
description?: string | null;
|
|
14
|
+
/** The confidential value to protect, such as an API key. */
|
|
15
|
+
value?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* The date and time the secreted was created.
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
_createdDate?: Date;
|
|
21
|
+
/**
|
|
22
|
+
* The date and time the secret was last updated.
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
25
|
+
_updatedDate?: Date;
|
|
26
|
+
}
|
|
27
|
+
interface GetSecretValueResponse {
|
|
28
|
+
/**
|
|
29
|
+
* The plaintext, unencrypted value of the secret.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
value?: string;
|
|
33
|
+
}
|
|
34
|
+
interface ListSecretInfoResponse {
|
|
35
|
+
/** Object containing information for each secret. */
|
|
36
|
+
secrets?: Secret[];
|
|
37
|
+
}
|
|
38
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
39
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
40
|
+
anonymousVisitorId?: string;
|
|
41
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
42
|
+
memberId?: string;
|
|
43
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
44
|
+
wixUserId?: string;
|
|
45
|
+
/** ID of an app. */
|
|
46
|
+
appId?: string;
|
|
47
|
+
/** @readonly */
|
|
48
|
+
identityType?: WebhookIdentityType;
|
|
49
|
+
}
|
|
50
|
+
/** @oneof */
|
|
51
|
+
interface IdentificationDataIdOneOf {
|
|
52
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
53
|
+
anonymousVisitorId?: string;
|
|
54
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
55
|
+
memberId?: string;
|
|
56
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
57
|
+
wixUserId?: string;
|
|
58
|
+
/** ID of an app. */
|
|
59
|
+
appId?: string;
|
|
60
|
+
}
|
|
61
|
+
declare enum WebhookIdentityType {
|
|
62
|
+
UNKNOWN = "UNKNOWN",
|
|
63
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
64
|
+
MEMBER = "MEMBER",
|
|
65
|
+
WIX_USER = "WIX_USER",
|
|
66
|
+
APP = "APP"
|
|
67
|
+
}
|
|
68
|
+
interface GetSecretValueResponseNonNullableFields {
|
|
69
|
+
value: string;
|
|
70
|
+
}
|
|
71
|
+
interface ListSecretInfoResponseNonNullableFields {
|
|
72
|
+
secrets: Secret[];
|
|
73
|
+
}
|
|
74
|
+
interface BaseEventMetadata {
|
|
75
|
+
/** App instance ID. */
|
|
76
|
+
instanceId?: string | null;
|
|
77
|
+
/** Event type. */
|
|
78
|
+
eventType?: string;
|
|
79
|
+
/** The identification type and identity data. */
|
|
80
|
+
identity?: IdentificationData;
|
|
81
|
+
}
|
|
82
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
83
|
+
/**
|
|
84
|
+
* Unique event ID.
|
|
85
|
+
* Allows clients to ignore duplicate webhooks.
|
|
86
|
+
*/
|
|
87
|
+
_id?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Assumes actions are also always typed to an entity_type
|
|
90
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
91
|
+
*/
|
|
92
|
+
entityFqdn?: string;
|
|
93
|
+
/**
|
|
94
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
95
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
96
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
97
|
+
*/
|
|
98
|
+
slug?: string;
|
|
99
|
+
/** ID of the entity associated with the event. */
|
|
100
|
+
entityId?: string;
|
|
101
|
+
/** Event timestamp. */
|
|
102
|
+
eventTime?: Date;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
105
|
+
* (for example, GDPR).
|
|
106
|
+
*/
|
|
107
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
108
|
+
/** If present, indicates the action that triggered the event. */
|
|
109
|
+
originatedFrom?: string | null;
|
|
110
|
+
/**
|
|
111
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
112
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
113
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
114
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
115
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
116
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
117
|
+
*/
|
|
118
|
+
entityEventSequence?: string | null;
|
|
119
|
+
}
|
|
120
|
+
interface SecretCreatedEnvelope {
|
|
121
|
+
entity: Secret;
|
|
122
|
+
metadata: EventMetadata;
|
|
123
|
+
}
|
|
124
|
+
interface SecretDeletedEnvelope {
|
|
125
|
+
metadata: EventMetadata;
|
|
126
|
+
}
|
|
127
|
+
interface SecretUpdatedEnvelope {
|
|
128
|
+
entity: Secret;
|
|
129
|
+
metadata: EventMetadata;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
133
|
+
interface HttpClient {
|
|
134
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
135
|
+
}
|
|
136
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
137
|
+
type HttpResponse<T = any> = {
|
|
138
|
+
data: T;
|
|
139
|
+
status: number;
|
|
140
|
+
statusText: string;
|
|
141
|
+
headers: any;
|
|
142
|
+
request?: any;
|
|
143
|
+
};
|
|
144
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
145
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
146
|
+
url: string;
|
|
147
|
+
data?: Data;
|
|
148
|
+
params?: URLSearchParams;
|
|
149
|
+
} & APIMetadata;
|
|
150
|
+
type APIMetadata = {
|
|
151
|
+
methodFqn?: string;
|
|
152
|
+
entityFqdn?: string;
|
|
153
|
+
packageName?: string;
|
|
154
|
+
};
|
|
155
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
156
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
157
|
+
__type: 'event-definition';
|
|
158
|
+
type: Type;
|
|
159
|
+
isDomainEvent?: boolean;
|
|
160
|
+
transformations?: unknown;
|
|
161
|
+
__payload: Payload;
|
|
162
|
+
};
|
|
163
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
164
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
165
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
166
|
+
|
|
167
|
+
declare function getSecretValue$1(httpClient: HttpClient): (name: string) => Promise<GetSecretValueResponse & GetSecretValueResponseNonNullableFields>;
|
|
168
|
+
declare function listSecretInfo$1(httpClient: HttpClient): () => Promise<ListSecretInfoResponse & ListSecretInfoResponseNonNullableFields>;
|
|
169
|
+
declare function createSecret$1(httpClient: HttpClient): (secret: Secret) => Promise<string>;
|
|
170
|
+
declare function deleteSecret$1(httpClient: HttpClient): (_id: string) => Promise<void>;
|
|
171
|
+
declare function updateSecret$1(httpClient: HttpClient): (_id: string, secret: Secret) => Promise<void>;
|
|
172
|
+
declare const onSecretCreated$1: EventDefinition<SecretCreatedEnvelope, "wix.velo.secrets_vault.v1.secret_created">;
|
|
173
|
+
declare const onSecretDeleted$1: EventDefinition<SecretDeletedEnvelope, "wix.velo.secrets_vault.v1.secret_deleted">;
|
|
174
|
+
declare const onSecretUpdated$1: EventDefinition<SecretUpdatedEnvelope, "wix.velo.secrets_vault.v1.secret_updated">;
|
|
175
|
+
|
|
176
|
+
declare const getSecretValue: BuildRESTFunction<typeof getSecretValue$1>;
|
|
177
|
+
declare const listSecretInfo: BuildRESTFunction<typeof listSecretInfo$1>;
|
|
178
|
+
declare const createSecret: BuildRESTFunction<typeof createSecret$1>;
|
|
179
|
+
declare const deleteSecret: BuildRESTFunction<typeof deleteSecret$1>;
|
|
180
|
+
declare const updateSecret: BuildRESTFunction<typeof updateSecret$1>;
|
|
181
|
+
declare const onSecretCreated: BuildEventDefinition<typeof onSecretCreated$1>;
|
|
182
|
+
declare const onSecretDeleted: BuildEventDefinition<typeof onSecretDeleted$1>;
|
|
183
|
+
declare const onSecretUpdated: BuildEventDefinition<typeof onSecretUpdated$1>;
|
|
184
|
+
|
|
185
|
+
declare const context_createSecret: typeof createSecret;
|
|
186
|
+
declare const context_deleteSecret: typeof deleteSecret;
|
|
187
|
+
declare const context_getSecretValue: typeof getSecretValue;
|
|
188
|
+
declare const context_listSecretInfo: typeof listSecretInfo;
|
|
189
|
+
declare const context_onSecretCreated: typeof onSecretCreated;
|
|
190
|
+
declare const context_onSecretDeleted: typeof onSecretDeleted;
|
|
191
|
+
declare const context_onSecretUpdated: typeof onSecretUpdated;
|
|
192
|
+
declare const context_updateSecret: typeof updateSecret;
|
|
193
|
+
declare namespace context {
|
|
194
|
+
export { context_createSecret as createSecret, context_deleteSecret as deleteSecret, context_getSecretValue as getSecretValue, context_listSecretInfo as listSecretInfo, context_onSecretCreated as onSecretCreated, context_onSecretDeleted as onSecretDeleted, context_onSecretUpdated as onSecretUpdated, context_updateSecret as updateSecret };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export { context as secrets };
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
interface Secret {
|
|
2
|
+
/**
|
|
3
|
+
* The secret's unique ID.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
6
|
+
_id?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* A unique, meaningful name used for retrieving the secret at runtime with the `getSecretValue()` function. You can use alphanumeric characters and the following special characters: `_+=-@#$`. Spaces are not supported.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
name?: string | null;
|
|
12
|
+
/** An optional text describing the secret's purpose or any other notes about it. */
|
|
13
|
+
description?: string | null;
|
|
14
|
+
/** The confidential value to protect, such as an API key. */
|
|
15
|
+
value?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* The date and time the secreted was created.
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
_createdDate?: Date;
|
|
21
|
+
/**
|
|
22
|
+
* The date and time the secret was last updated.
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
25
|
+
_updatedDate?: Date;
|
|
26
|
+
}
|
|
27
|
+
interface GetSecretValueRequest {
|
|
28
|
+
/** The name of the secret to get the value of. */
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
interface GetSecretValueResponse {
|
|
32
|
+
/**
|
|
33
|
+
* The plaintext, unencrypted value of the secret.
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
value?: string;
|
|
37
|
+
}
|
|
38
|
+
interface ListSecretInfoRequest {
|
|
39
|
+
}
|
|
40
|
+
interface ListSecretInfoResponse {
|
|
41
|
+
/** Object containing information for each secret. */
|
|
42
|
+
secrets?: Secret[];
|
|
43
|
+
}
|
|
44
|
+
interface CreateSecretRequest {
|
|
45
|
+
/** The object including the fields of a new secret. */
|
|
46
|
+
secret: Secret;
|
|
47
|
+
}
|
|
48
|
+
interface CreateSecretResponse {
|
|
49
|
+
/**
|
|
50
|
+
* The globally-unique ID assigned to the secret.
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
_id?: string;
|
|
54
|
+
}
|
|
55
|
+
interface DeleteSecretRequest {
|
|
56
|
+
/**
|
|
57
|
+
* The unique ID of the secret to be deleted.
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
_id: string;
|
|
61
|
+
}
|
|
62
|
+
interface DeleteSecretResponse {
|
|
63
|
+
}
|
|
64
|
+
interface UpdateSecretRequest {
|
|
65
|
+
/** The unique ID of the secret to be updated. */
|
|
66
|
+
_id: string;
|
|
67
|
+
/** The secret fields to update. */
|
|
68
|
+
secret: Secret;
|
|
69
|
+
}
|
|
70
|
+
interface UpdateSecretResponse {
|
|
71
|
+
}
|
|
72
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
73
|
+
createdEvent?: EntityCreatedEvent;
|
|
74
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
75
|
+
deletedEvent?: EntityDeletedEvent;
|
|
76
|
+
actionEvent?: ActionEvent;
|
|
77
|
+
/**
|
|
78
|
+
* Unique event ID.
|
|
79
|
+
* Allows clients to ignore duplicate webhooks.
|
|
80
|
+
*/
|
|
81
|
+
_id?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Assumes actions are also always typed to an entity_type
|
|
84
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
85
|
+
*/
|
|
86
|
+
entityFqdn?: string;
|
|
87
|
+
/**
|
|
88
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
89
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
90
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
91
|
+
*/
|
|
92
|
+
slug?: string;
|
|
93
|
+
/** ID of the entity associated with the event. */
|
|
94
|
+
entityId?: string;
|
|
95
|
+
/** Event timestamp. */
|
|
96
|
+
eventTime?: Date;
|
|
97
|
+
/**
|
|
98
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
99
|
+
* (for example, GDPR).
|
|
100
|
+
*/
|
|
101
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
102
|
+
/** If present, indicates the action that triggered the event. */
|
|
103
|
+
originatedFrom?: string | null;
|
|
104
|
+
/**
|
|
105
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
106
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
107
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
108
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
109
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
110
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
111
|
+
*/
|
|
112
|
+
entityEventSequence?: string | null;
|
|
113
|
+
}
|
|
114
|
+
/** @oneof */
|
|
115
|
+
interface DomainEventBodyOneOf {
|
|
116
|
+
createdEvent?: EntityCreatedEvent;
|
|
117
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
118
|
+
deletedEvent?: EntityDeletedEvent;
|
|
119
|
+
actionEvent?: ActionEvent;
|
|
120
|
+
}
|
|
121
|
+
interface EntityCreatedEvent {
|
|
122
|
+
entity?: string;
|
|
123
|
+
}
|
|
124
|
+
interface EntityUpdatedEvent {
|
|
125
|
+
/**
|
|
126
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
127
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
128
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
129
|
+
*/
|
|
130
|
+
currentEntity?: string;
|
|
131
|
+
}
|
|
132
|
+
interface EntityDeletedEvent {
|
|
133
|
+
/** Entity that was deleted */
|
|
134
|
+
deletedEntity?: string | null;
|
|
135
|
+
}
|
|
136
|
+
interface ActionEvent {
|
|
137
|
+
body?: string;
|
|
138
|
+
}
|
|
139
|
+
interface MessageEnvelope {
|
|
140
|
+
/** App instance ID. */
|
|
141
|
+
instanceId?: string | null;
|
|
142
|
+
/** Event type. */
|
|
143
|
+
eventType?: string;
|
|
144
|
+
/** The identification type and identity data. */
|
|
145
|
+
identity?: IdentificationData;
|
|
146
|
+
/** Stringify payload. */
|
|
147
|
+
data?: string;
|
|
148
|
+
}
|
|
149
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
150
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
151
|
+
anonymousVisitorId?: string;
|
|
152
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
153
|
+
memberId?: string;
|
|
154
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
155
|
+
wixUserId?: string;
|
|
156
|
+
/** ID of an app. */
|
|
157
|
+
appId?: string;
|
|
158
|
+
/** @readonly */
|
|
159
|
+
identityType?: WebhookIdentityType;
|
|
160
|
+
}
|
|
161
|
+
/** @oneof */
|
|
162
|
+
interface IdentificationDataIdOneOf {
|
|
163
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
164
|
+
anonymousVisitorId?: string;
|
|
165
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
166
|
+
memberId?: string;
|
|
167
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
168
|
+
wixUserId?: string;
|
|
169
|
+
/** ID of an app. */
|
|
170
|
+
appId?: string;
|
|
171
|
+
}
|
|
172
|
+
declare enum WebhookIdentityType {
|
|
173
|
+
UNKNOWN = "UNKNOWN",
|
|
174
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
175
|
+
MEMBER = "MEMBER",
|
|
176
|
+
WIX_USER = "WIX_USER",
|
|
177
|
+
APP = "APP"
|
|
178
|
+
}
|
|
179
|
+
interface GetSecretValueResponseNonNullableFields {
|
|
180
|
+
value: string;
|
|
181
|
+
}
|
|
182
|
+
interface ListSecretInfoResponseNonNullableFields {
|
|
183
|
+
secrets: Secret[];
|
|
184
|
+
}
|
|
185
|
+
interface CreateSecretResponseNonNullableFields {
|
|
186
|
+
_id: string;
|
|
187
|
+
}
|
|
188
|
+
interface BaseEventMetadata {
|
|
189
|
+
/** App instance ID. */
|
|
190
|
+
instanceId?: string | null;
|
|
191
|
+
/** Event type. */
|
|
192
|
+
eventType?: string;
|
|
193
|
+
/** The identification type and identity data. */
|
|
194
|
+
identity?: IdentificationData;
|
|
195
|
+
}
|
|
196
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
197
|
+
/**
|
|
198
|
+
* Unique event ID.
|
|
199
|
+
* Allows clients to ignore duplicate webhooks.
|
|
200
|
+
*/
|
|
201
|
+
_id?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Assumes actions are also always typed to an entity_type
|
|
204
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
205
|
+
*/
|
|
206
|
+
entityFqdn?: string;
|
|
207
|
+
/**
|
|
208
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
209
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
210
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
211
|
+
*/
|
|
212
|
+
slug?: string;
|
|
213
|
+
/** ID of the entity associated with the event. */
|
|
214
|
+
entityId?: string;
|
|
215
|
+
/** Event timestamp. */
|
|
216
|
+
eventTime?: Date;
|
|
217
|
+
/**
|
|
218
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
219
|
+
* (for example, GDPR).
|
|
220
|
+
*/
|
|
221
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
222
|
+
/** If present, indicates the action that triggered the event. */
|
|
223
|
+
originatedFrom?: string | null;
|
|
224
|
+
/**
|
|
225
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
226
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
227
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
228
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
229
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
230
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
231
|
+
*/
|
|
232
|
+
entityEventSequence?: string | null;
|
|
233
|
+
}
|
|
234
|
+
interface SecretCreatedEnvelope {
|
|
235
|
+
entity: Secret;
|
|
236
|
+
metadata: EventMetadata;
|
|
237
|
+
}
|
|
238
|
+
interface SecretDeletedEnvelope {
|
|
239
|
+
metadata: EventMetadata;
|
|
240
|
+
}
|
|
241
|
+
interface SecretUpdatedEnvelope {
|
|
242
|
+
entity: Secret;
|
|
243
|
+
metadata: EventMetadata;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface HttpClient {
|
|
247
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
248
|
+
}
|
|
249
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
250
|
+
type HttpResponse<T = any> = {
|
|
251
|
+
data: T;
|
|
252
|
+
status: number;
|
|
253
|
+
statusText: string;
|
|
254
|
+
headers: any;
|
|
255
|
+
request?: any;
|
|
256
|
+
};
|
|
257
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
258
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
259
|
+
url: string;
|
|
260
|
+
data?: Data;
|
|
261
|
+
params?: URLSearchParams;
|
|
262
|
+
} & APIMetadata;
|
|
263
|
+
type APIMetadata = {
|
|
264
|
+
methodFqn?: string;
|
|
265
|
+
entityFqdn?: string;
|
|
266
|
+
packageName?: string;
|
|
267
|
+
};
|
|
268
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
269
|
+
__type: 'event-definition';
|
|
270
|
+
type: Type;
|
|
271
|
+
isDomainEvent?: boolean;
|
|
272
|
+
transformations?: unknown;
|
|
273
|
+
__payload: Payload;
|
|
274
|
+
};
|
|
275
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
276
|
+
|
|
277
|
+
declare const __metadata: {
|
|
278
|
+
PACKAGE_NAME: string;
|
|
279
|
+
};
|
|
280
|
+
declare function getSecretValue(httpClient: HttpClient): (name: string) => Promise<GetSecretValueResponse & GetSecretValueResponseNonNullableFields>;
|
|
281
|
+
declare function listSecretInfo(httpClient: HttpClient): () => Promise<ListSecretInfoResponse & ListSecretInfoResponseNonNullableFields>;
|
|
282
|
+
declare function createSecret(httpClient: HttpClient): (secret: Secret) => Promise<string>;
|
|
283
|
+
declare function deleteSecret(httpClient: HttpClient): (_id: string) => Promise<void>;
|
|
284
|
+
declare function updateSecret(httpClient: HttpClient): (_id: string, secret: Secret) => Promise<void>;
|
|
285
|
+
declare const onSecretCreated: EventDefinition<SecretCreatedEnvelope, "wix.velo.secrets_vault.v1.secret_created">;
|
|
286
|
+
declare const onSecretDeleted: EventDefinition<SecretDeletedEnvelope, "wix.velo.secrets_vault.v1.secret_deleted">;
|
|
287
|
+
declare const onSecretUpdated: EventDefinition<SecretUpdatedEnvelope, "wix.velo.secrets_vault.v1.secret_updated">;
|
|
288
|
+
|
|
289
|
+
type index_d_ActionEvent = ActionEvent;
|
|
290
|
+
type index_d_BaseEventMetadata = BaseEventMetadata;
|
|
291
|
+
type index_d_CreateSecretRequest = CreateSecretRequest;
|
|
292
|
+
type index_d_CreateSecretResponse = CreateSecretResponse;
|
|
293
|
+
type index_d_CreateSecretResponseNonNullableFields = CreateSecretResponseNonNullableFields;
|
|
294
|
+
type index_d_DeleteSecretRequest = DeleteSecretRequest;
|
|
295
|
+
type index_d_DeleteSecretResponse = DeleteSecretResponse;
|
|
296
|
+
type index_d_DomainEvent = DomainEvent;
|
|
297
|
+
type index_d_DomainEventBodyOneOf = DomainEventBodyOneOf;
|
|
298
|
+
type index_d_EntityCreatedEvent = EntityCreatedEvent;
|
|
299
|
+
type index_d_EntityDeletedEvent = EntityDeletedEvent;
|
|
300
|
+
type index_d_EntityUpdatedEvent = EntityUpdatedEvent;
|
|
301
|
+
type index_d_EventMetadata = EventMetadata;
|
|
302
|
+
type index_d_GetSecretValueRequest = GetSecretValueRequest;
|
|
303
|
+
type index_d_GetSecretValueResponse = GetSecretValueResponse;
|
|
304
|
+
type index_d_GetSecretValueResponseNonNullableFields = GetSecretValueResponseNonNullableFields;
|
|
305
|
+
type index_d_IdentificationData = IdentificationData;
|
|
306
|
+
type index_d_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
|
|
307
|
+
type index_d_ListSecretInfoRequest = ListSecretInfoRequest;
|
|
308
|
+
type index_d_ListSecretInfoResponse = ListSecretInfoResponse;
|
|
309
|
+
type index_d_ListSecretInfoResponseNonNullableFields = ListSecretInfoResponseNonNullableFields;
|
|
310
|
+
type index_d_MessageEnvelope = MessageEnvelope;
|
|
311
|
+
type index_d_Secret = Secret;
|
|
312
|
+
type index_d_SecretCreatedEnvelope = SecretCreatedEnvelope;
|
|
313
|
+
type index_d_SecretDeletedEnvelope = SecretDeletedEnvelope;
|
|
314
|
+
type index_d_SecretUpdatedEnvelope = SecretUpdatedEnvelope;
|
|
315
|
+
type index_d_UpdateSecretRequest = UpdateSecretRequest;
|
|
316
|
+
type index_d_UpdateSecretResponse = UpdateSecretResponse;
|
|
317
|
+
type index_d_WebhookIdentityType = WebhookIdentityType;
|
|
318
|
+
declare const index_d_WebhookIdentityType: typeof WebhookIdentityType;
|
|
319
|
+
declare const index_d___metadata: typeof __metadata;
|
|
320
|
+
declare const index_d_createSecret: typeof createSecret;
|
|
321
|
+
declare const index_d_deleteSecret: typeof deleteSecret;
|
|
322
|
+
declare const index_d_getSecretValue: typeof getSecretValue;
|
|
323
|
+
declare const index_d_listSecretInfo: typeof listSecretInfo;
|
|
324
|
+
declare const index_d_onSecretCreated: typeof onSecretCreated;
|
|
325
|
+
declare const index_d_onSecretDeleted: typeof onSecretDeleted;
|
|
326
|
+
declare const index_d_onSecretUpdated: typeof onSecretUpdated;
|
|
327
|
+
declare const index_d_updateSecret: typeof updateSecret;
|
|
328
|
+
declare namespace index_d {
|
|
329
|
+
export { type index_d_ActionEvent as ActionEvent, type index_d_BaseEventMetadata as BaseEventMetadata, type index_d_CreateSecretRequest as CreateSecretRequest, type index_d_CreateSecretResponse as CreateSecretResponse, type index_d_CreateSecretResponseNonNullableFields as CreateSecretResponseNonNullableFields, type index_d_DeleteSecretRequest as DeleteSecretRequest, type index_d_DeleteSecretResponse as DeleteSecretResponse, type index_d_DomainEvent as DomainEvent, type index_d_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d_EntityCreatedEvent as EntityCreatedEvent, type index_d_EntityDeletedEvent as EntityDeletedEvent, type index_d_EntityUpdatedEvent as EntityUpdatedEvent, type index_d_EventMetadata as EventMetadata, type index_d_GetSecretValueRequest as GetSecretValueRequest, type index_d_GetSecretValueResponse as GetSecretValueResponse, type index_d_GetSecretValueResponseNonNullableFields as GetSecretValueResponseNonNullableFields, type index_d_IdentificationData as IdentificationData, type index_d_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d_ListSecretInfoRequest as ListSecretInfoRequest, type index_d_ListSecretInfoResponse as ListSecretInfoResponse, type index_d_ListSecretInfoResponseNonNullableFields as ListSecretInfoResponseNonNullableFields, type index_d_MessageEnvelope as MessageEnvelope, type index_d_Secret as Secret, type index_d_SecretCreatedEnvelope as SecretCreatedEnvelope, type index_d_SecretDeletedEnvelope as SecretDeletedEnvelope, type index_d_SecretUpdatedEnvelope as SecretUpdatedEnvelope, type index_d_UpdateSecretRequest as UpdateSecretRequest, type index_d_UpdateSecretResponse as UpdateSecretResponse, index_d_WebhookIdentityType as WebhookIdentityType, index_d___metadata as __metadata, index_d_createSecret as createSecret, index_d_deleteSecret as deleteSecret, index_d_getSecretValue as getSecretValue, index_d_listSecretInfo as listSecretInfo, index_d_onSecretCreated as onSecretCreated, index_d_onSecretDeleted as onSecretDeleted, index_d_onSecretUpdated as onSecretUpdated, index_d_updateSecret as updateSecret };
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export { index_d as secrets };
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
interface Secret$1 {
|
|
2
|
+
/**
|
|
3
|
+
* A globally-unique, immutable identifier assigned to the secret upon creation.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
6
|
+
id?: string | null;
|
|
7
|
+
/** A unique, human-friendly name for the secret. Used for retrieving the secret easily at runtime. */
|
|
8
|
+
name?: string | null;
|
|
9
|
+
/** An optional text describing the secret's purpose or any other notes about it. */
|
|
10
|
+
description?: string | null;
|
|
11
|
+
/** The confidential value that is intended to be stored encrypted. */
|
|
12
|
+
value?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* The creation timestamp of the secret.
|
|
15
|
+
* @readonly
|
|
16
|
+
*/
|
|
17
|
+
createdDate?: Date;
|
|
18
|
+
/**
|
|
19
|
+
* The last-update timestamp of the secret.
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
updatedDate?: Date;
|
|
23
|
+
}
|
|
24
|
+
interface GetSecretValueRequest$1 {
|
|
25
|
+
/** The name of the secret to get the value of. */
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
28
|
+
interface GetSecretValueResponse$1 {
|
|
29
|
+
/** The plaintext, unencrypted value of the secret. */
|
|
30
|
+
value?: string;
|
|
31
|
+
}
|
|
32
|
+
interface ListSecretInfoRequest$1 {
|
|
33
|
+
}
|
|
34
|
+
interface ListSecretInfoResponse$1 {
|
|
35
|
+
/** A list of info object for each secret, without the secret value itself */
|
|
36
|
+
secrets?: Secret$1[];
|
|
37
|
+
}
|
|
38
|
+
interface CreateSecretRequest$1 {
|
|
39
|
+
/** A set of fields including info and the actual value to protect. */
|
|
40
|
+
secret: Secret$1;
|
|
41
|
+
}
|
|
42
|
+
interface CreateSecretResponse$1 {
|
|
43
|
+
/** The globally-unique ID assigned to the secret by the service. */
|
|
44
|
+
id?: string;
|
|
45
|
+
}
|
|
46
|
+
interface DeleteSecretRequest$1 {
|
|
47
|
+
/** The unique ID of the secret to be deleted. */
|
|
48
|
+
id: string;
|
|
49
|
+
}
|
|
50
|
+
interface DeleteSecretResponse$1 {
|
|
51
|
+
}
|
|
52
|
+
interface UpdateSecretRequest$1 {
|
|
53
|
+
/** The unique ID of the secret to be updated. */
|
|
54
|
+
id: string;
|
|
55
|
+
/** The secret fields to update. */
|
|
56
|
+
secret: Secret$1;
|
|
57
|
+
}
|
|
58
|
+
interface UpdateSecretResponse$1 {
|
|
59
|
+
}
|
|
60
|
+
interface GetSecretValueResponseNonNullableFields$1 {
|
|
61
|
+
value: string;
|
|
62
|
+
}
|
|
63
|
+
interface ListSecretInfoResponseNonNullableFields$1 {
|
|
64
|
+
secrets: Secret$1[];
|
|
65
|
+
}
|
|
66
|
+
interface CreateSecretResponseNonNullableFields$1 {
|
|
67
|
+
id: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface Secret {
|
|
71
|
+
/**
|
|
72
|
+
* The secret's unique ID.
|
|
73
|
+
* @readonly
|
|
74
|
+
*/
|
|
75
|
+
_id?: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* A unique, meaningful name used for retrieving the secret at runtime with the `getSecretValue()` function. You can use alphanumeric characters and the following special characters: `_+=-@#$`. Spaces are not supported.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
name?: string | null;
|
|
81
|
+
/** An optional text describing the secret's purpose or any other notes about it. */
|
|
82
|
+
description?: string | null;
|
|
83
|
+
/** The confidential value to protect, such as an API key. */
|
|
84
|
+
value?: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* The date and time the secreted was created.
|
|
87
|
+
* @readonly
|
|
88
|
+
*/
|
|
89
|
+
_createdDate?: Date;
|
|
90
|
+
/**
|
|
91
|
+
* The date and time the secret was last updated.
|
|
92
|
+
* @readonly
|
|
93
|
+
*/
|
|
94
|
+
_updatedDate?: Date;
|
|
95
|
+
}
|
|
96
|
+
interface GetSecretValueRequest {
|
|
97
|
+
/** The name of the secret to get the value of. */
|
|
98
|
+
name: string;
|
|
99
|
+
}
|
|
100
|
+
interface GetSecretValueResponse {
|
|
101
|
+
/**
|
|
102
|
+
* The plaintext, unencrypted value of the secret.
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
value?: string;
|
|
106
|
+
}
|
|
107
|
+
interface ListSecretInfoRequest {
|
|
108
|
+
}
|
|
109
|
+
interface ListSecretInfoResponse {
|
|
110
|
+
/** Object containing information for each secret. */
|
|
111
|
+
secrets?: Secret[];
|
|
112
|
+
}
|
|
113
|
+
interface CreateSecretRequest {
|
|
114
|
+
/** The object including the fields of a new secret. */
|
|
115
|
+
secret: Secret;
|
|
116
|
+
}
|
|
117
|
+
interface CreateSecretResponse {
|
|
118
|
+
/**
|
|
119
|
+
* The globally-unique ID assigned to the secret.
|
|
120
|
+
*
|
|
121
|
+
*/
|
|
122
|
+
_id?: string;
|
|
123
|
+
}
|
|
124
|
+
interface DeleteSecretRequest {
|
|
125
|
+
/**
|
|
126
|
+
* The unique ID of the secret to be deleted.
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
_id: string;
|
|
130
|
+
}
|
|
131
|
+
interface DeleteSecretResponse {
|
|
132
|
+
}
|
|
133
|
+
interface UpdateSecretRequest {
|
|
134
|
+
/** The unique ID of the secret to be updated. */
|
|
135
|
+
_id: string;
|
|
136
|
+
/** The secret fields to update. */
|
|
137
|
+
secret: Secret;
|
|
138
|
+
}
|
|
139
|
+
interface UpdateSecretResponse {
|
|
140
|
+
}
|
|
141
|
+
interface GetSecretValueResponseNonNullableFields {
|
|
142
|
+
value: string;
|
|
143
|
+
}
|
|
144
|
+
interface ListSecretInfoResponseNonNullableFields {
|
|
145
|
+
secrets: Secret[];
|
|
146
|
+
}
|
|
147
|
+
interface CreateSecretResponseNonNullableFields {
|
|
148
|
+
_id: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
152
|
+
getUrl: (context: any) => string;
|
|
153
|
+
httpMethod: K;
|
|
154
|
+
path: string;
|
|
155
|
+
pathParams: M;
|
|
156
|
+
__requestType: T;
|
|
157
|
+
__originalRequestType: S;
|
|
158
|
+
__responseType: Q;
|
|
159
|
+
__originalResponseType: R;
|
|
160
|
+
};
|
|
161
|
+
declare function getSecretValue(): __PublicMethodMetaInfo<'GET', {
|
|
162
|
+
name: string;
|
|
163
|
+
}, GetSecretValueRequest, GetSecretValueRequest$1, GetSecretValueResponse & GetSecretValueResponseNonNullableFields, GetSecretValueResponse$1 & GetSecretValueResponseNonNullableFields$1>;
|
|
164
|
+
declare function listSecretInfo(): __PublicMethodMetaInfo<'GET', {}, ListSecretInfoRequest, ListSecretInfoRequest$1, ListSecretInfoResponse & ListSecretInfoResponseNonNullableFields, ListSecretInfoResponse$1 & ListSecretInfoResponseNonNullableFields$1>;
|
|
165
|
+
declare function createSecret(): __PublicMethodMetaInfo<'POST', {}, CreateSecretRequest, CreateSecretRequest$1, CreateSecretResponse & CreateSecretResponseNonNullableFields, CreateSecretResponse$1 & CreateSecretResponseNonNullableFields$1>;
|
|
166
|
+
declare function deleteSecret(): __PublicMethodMetaInfo<'DELETE', {
|
|
167
|
+
id: string;
|
|
168
|
+
}, DeleteSecretRequest, DeleteSecretRequest$1, DeleteSecretResponse, DeleteSecretResponse$1>;
|
|
169
|
+
declare function updateSecret(): __PublicMethodMetaInfo<'PATCH', {
|
|
170
|
+
id: string;
|
|
171
|
+
}, UpdateSecretRequest, UpdateSecretRequest$1, UpdateSecretResponse, UpdateSecretResponse$1>;
|
|
172
|
+
|
|
173
|
+
type meta___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
|
|
174
|
+
declare const meta_createSecret: typeof createSecret;
|
|
175
|
+
declare const meta_deleteSecret: typeof deleteSecret;
|
|
176
|
+
declare const meta_getSecretValue: typeof getSecretValue;
|
|
177
|
+
declare const meta_listSecretInfo: typeof listSecretInfo;
|
|
178
|
+
declare const meta_updateSecret: typeof updateSecret;
|
|
179
|
+
declare namespace meta {
|
|
180
|
+
export { type meta___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_createSecret as createSecret, meta_deleteSecret as deleteSecret, meta_getSecretValue as getSecretValue, meta_listSecretInfo as listSecretInfo, meta_updateSecret as updateSecret };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export { meta as secrets };
|