-
Notifications
You must be signed in to change notification settings - Fork 719
/
Secrets.d.ts
80 lines (68 loc) · 2.42 KB
/
Secrets.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
namespace Apps {
/**
* Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends.
*
* The primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control.
*
* All Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key.
*
* A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions.
*
* Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects).
*/
interface Secret {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'apps.secret';
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* If true, indicates that this secret has been deleted
*/
deleted?: boolean;
/**
* The Unix timestamp for the expiry time of the secret, after which the secret deletes.
*/
expires_at: number | null;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* A name for the secret that's unique within the scope.
*/
name: string;
/**
* The plaintext secret value to be stored.
*/
payload: string | null;
scope: Secret.Scope;
}
namespace Secret {
interface Scope {
/**
* The secret scope type.
*/
type: Scope.Type;
/**
* The user ID, if type is set to "user"
*/
user?: string;
}
namespace Scope {
type Type = 'account' | 'user';
}
}
}
}
}