learn-secrets-sdk 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -72
- package/bin/learn-secrets.js +20 -0
- package/dist/chunk-AS6G7JYX.mjs +1 -0
- package/dist/cli/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/cli/env-resolver-4ASC2IMR.mjs +66 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +838 -0
- package/dist/env-resolver-Y4SFGOKB.mjs +1 -0
- package/dist/index.d.mts +385 -0
- package/dist/index.d.ts +385 -5
- package/dist/index.global.js +7 -0
- package/dist/index.mjs +7 -0
- package/package.json +25 -7
- package/secrets.template.json +42 -0
- package/dist/client.d.ts +0 -65
- package/dist/client.js +0 -172
- package/dist/credentials.d.ts +0 -24
- package/dist/credentials.js +0 -86
- package/dist/env-resolver.d.ts +0 -23
- package/dist/env-resolver.js +0 -73
- package/dist/index.js +0 -4
- package/dist/management.d.ts +0 -51
- package/dist/management.js +0 -191
- package/dist/types.d.ts +0 -123
- package/dist/types.js +0 -29
package/dist/types.d.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export interface SecretsSDKOptions {
|
|
2
|
-
/**
|
|
3
|
-
* App ID from dashboard (optional in zero-config mode)
|
|
4
|
-
* If omitted, SDK uses origin-based authentication
|
|
5
|
-
*/
|
|
6
|
-
appId?: string;
|
|
7
|
-
/**
|
|
8
|
-
* SDK token (optional in zero-config mode)
|
|
9
|
-
* If omitted, SDK uses origin-based authentication
|
|
10
|
-
*/
|
|
11
|
-
token?: string;
|
|
12
|
-
sessionToken?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Base URL of the proxy server
|
|
15
|
-
* Default: https://ctklearn.carsontkempf.workers.dev
|
|
16
|
-
*/
|
|
17
|
-
baseUrl?: string;
|
|
18
|
-
timeout?: number;
|
|
19
|
-
retryOn429?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface ProxyRequest {
|
|
22
|
-
keyName: string;
|
|
23
|
-
endpoint: string;
|
|
24
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
25
|
-
body?: any;
|
|
26
|
-
headers?: Record<string, string>;
|
|
27
|
-
}
|
|
28
|
-
export interface ProxyResponse<T = any> {
|
|
29
|
-
success: boolean;
|
|
30
|
-
status: number;
|
|
31
|
-
data: T;
|
|
32
|
-
}
|
|
33
|
-
export interface RateLimitInfo {
|
|
34
|
-
limit: number;
|
|
35
|
-
remaining: number;
|
|
36
|
-
reset: number;
|
|
37
|
-
}
|
|
38
|
-
export declare class SecretsSDKError extends Error {
|
|
39
|
-
status: number;
|
|
40
|
-
response?: any | undefined;
|
|
41
|
-
constructor(message: string, status: number, response?: any | undefined);
|
|
42
|
-
}
|
|
43
|
-
export declare class OriginMismatchError extends SecretsSDKError {
|
|
44
|
-
constructor(message?: string);
|
|
45
|
-
}
|
|
46
|
-
export declare class RateLimitError extends SecretsSDKError {
|
|
47
|
-
retryAfter: number;
|
|
48
|
-
remaining: number;
|
|
49
|
-
limit: number;
|
|
50
|
-
constructor(message?: string, retryAfter?: number, remaining?: number, limit?: number);
|
|
51
|
-
}
|
|
52
|
-
export declare class InvalidTokenError extends SecretsSDKError {
|
|
53
|
-
constructor(message?: string);
|
|
54
|
-
}
|
|
55
|
-
export interface SecretsManagementOptions {
|
|
56
|
-
appId: string;
|
|
57
|
-
baseUrl?: string;
|
|
58
|
-
timeout?: number;
|
|
59
|
-
}
|
|
60
|
-
export interface SecretConfig {
|
|
61
|
-
name: string;
|
|
62
|
-
provider: string;
|
|
63
|
-
api_key: string;
|
|
64
|
-
base_url?: string;
|
|
65
|
-
auth_header?: string;
|
|
66
|
-
auth_prefix?: string;
|
|
67
|
-
}
|
|
68
|
-
export interface MaskedSecret {
|
|
69
|
-
id: string;
|
|
70
|
-
name: string;
|
|
71
|
-
provider: string;
|
|
72
|
-
api_key: string;
|
|
73
|
-
base_url?: string;
|
|
74
|
-
auth_header?: string;
|
|
75
|
-
auth_prefix?: string;
|
|
76
|
-
created?: string;
|
|
77
|
-
updated?: string;
|
|
78
|
-
}
|
|
79
|
-
export interface SyncOptions {
|
|
80
|
-
deleteMissing?: boolean;
|
|
81
|
-
dryRun?: boolean;
|
|
82
|
-
}
|
|
83
|
-
export interface SyncDiffItem {
|
|
84
|
-
name: string;
|
|
85
|
-
provider?: string;
|
|
86
|
-
changes?: string[];
|
|
87
|
-
}
|
|
88
|
-
export interface SyncResult {
|
|
89
|
-
success: boolean;
|
|
90
|
-
diff: {
|
|
91
|
-
created: SyncDiffItem[];
|
|
92
|
-
updated: SyncDiffItem[];
|
|
93
|
-
deleted: SyncDiffItem[];
|
|
94
|
-
unchanged: SyncDiffItem[];
|
|
95
|
-
};
|
|
96
|
-
summary: {
|
|
97
|
-
created: number;
|
|
98
|
-
updated: number;
|
|
99
|
-
deleted: number;
|
|
100
|
-
unchanged: number;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
export interface DeviceCodeResponse {
|
|
104
|
-
device_code: string;
|
|
105
|
-
user_code: string;
|
|
106
|
-
verification_uri: string;
|
|
107
|
-
verification_uri_complete: string;
|
|
108
|
-
expires_in: number;
|
|
109
|
-
interval: number;
|
|
110
|
-
}
|
|
111
|
-
export interface TokenResponse {
|
|
112
|
-
access_token: string;
|
|
113
|
-
refresh_token: string;
|
|
114
|
-
token_type: string;
|
|
115
|
-
expires_in: number;
|
|
116
|
-
user_id: string;
|
|
117
|
-
}
|
|
118
|
-
export interface CLICredentials {
|
|
119
|
-
access_token: string;
|
|
120
|
-
refresh_token: string;
|
|
121
|
-
expires_at: string;
|
|
122
|
-
user_id: string;
|
|
123
|
-
}
|
package/dist/types.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export class SecretsSDKError extends Error {
|
|
2
|
-
constructor(message, status, response) {
|
|
3
|
-
super(message);
|
|
4
|
-
this.status = status;
|
|
5
|
-
this.response = response;
|
|
6
|
-
this.name = 'SecretsSDKError';
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export class OriginMismatchError extends SecretsSDKError {
|
|
10
|
-
constructor(message = 'Origin not allowed for this token') {
|
|
11
|
-
super(message, 403);
|
|
12
|
-
this.name = 'OriginMismatchError';
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export class RateLimitError extends SecretsSDKError {
|
|
16
|
-
constructor(message = 'Rate limit exceeded', retryAfter = 60, remaining = 0, limit = 100) {
|
|
17
|
-
super(message, 429);
|
|
18
|
-
this.name = 'RateLimitError';
|
|
19
|
-
this.retryAfter = retryAfter;
|
|
20
|
-
this.remaining = remaining;
|
|
21
|
-
this.limit = limit;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export class InvalidTokenError extends SecretsSDKError {
|
|
25
|
-
constructor(message = 'Invalid or expired token') {
|
|
26
|
-
super(message, 401);
|
|
27
|
-
this.name = 'InvalidTokenError';
|
|
28
|
-
}
|
|
29
|
-
}
|