@shipstatic/types 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +47 -0
- package/package.json +1 -1
- package/src/index.ts +55 -0
package/dist/index.d.ts
CHANGED
|
@@ -103,6 +103,45 @@ export interface DeploymentRemoveResponse {
|
|
|
103
103
|
/** Human-readable message */
|
|
104
104
|
message?: string;
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Deployment token for automated deployments
|
|
108
|
+
*/
|
|
109
|
+
export interface Token {
|
|
110
|
+
/** The token hash (not the actual token value) */
|
|
111
|
+
readonly token: string;
|
|
112
|
+
/** The account this token belongs to */
|
|
113
|
+
readonly account: string;
|
|
114
|
+
/** Optional IP address binding for security */
|
|
115
|
+
readonly ip?: string;
|
|
116
|
+
/** Optional array of tags for categorization and filtering (lowercase, alphanumeric with separators) */
|
|
117
|
+
tags?: string[];
|
|
118
|
+
/** Unix timestamp (seconds) when token was created */
|
|
119
|
+
readonly created: number;
|
|
120
|
+
/** Unix timestamp (seconds) when token expires, or null for never */
|
|
121
|
+
readonly expires?: number;
|
|
122
|
+
/** Unix timestamp (seconds) when token was last used */
|
|
123
|
+
readonly used?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Response for listing tokens
|
|
127
|
+
*/
|
|
128
|
+
export interface TokenListResponse {
|
|
129
|
+
/** Array of tokens */
|
|
130
|
+
tokens: Token[];
|
|
131
|
+
/** Total count of tokens */
|
|
132
|
+
count?: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Response for token creation
|
|
136
|
+
*/
|
|
137
|
+
export interface TokenCreateResponse {
|
|
138
|
+
/** The actual token value (only returned on creation) */
|
|
139
|
+
token: string;
|
|
140
|
+
/** Unix timestamp (seconds) when token expires, or null for never */
|
|
141
|
+
expires?: number;
|
|
142
|
+
/** Success message */
|
|
143
|
+
message?: string;
|
|
144
|
+
}
|
|
106
145
|
/**
|
|
107
146
|
* Account plan constants
|
|
108
147
|
*/
|
|
@@ -372,6 +411,14 @@ export interface AliasResource {
|
|
|
372
411
|
export interface AccountResource {
|
|
373
412
|
get: () => Promise<Account>;
|
|
374
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Token resource interface - the contract all implementations must follow
|
|
416
|
+
*/
|
|
417
|
+
export interface TokenResource {
|
|
418
|
+
create: (ttl?: number, tags?: string[]) => Promise<TokenCreateResponse>;
|
|
419
|
+
list: () => Promise<TokenListResponse>;
|
|
420
|
+
remove: (token: string) => Promise<void>;
|
|
421
|
+
}
|
|
375
422
|
/**
|
|
376
423
|
* Keys resource interface - the contract all implementations must follow
|
|
377
424
|
*/
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -122,6 +122,52 @@ export interface DeploymentRemoveResponse {
|
|
|
122
122
|
message?: string;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// =============================================================================
|
|
126
|
+
// TOKEN TYPES
|
|
127
|
+
// =============================================================================
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Deployment token for automated deployments
|
|
131
|
+
*/
|
|
132
|
+
export interface Token {
|
|
133
|
+
/** The token hash (not the actual token value) */
|
|
134
|
+
readonly token: string;
|
|
135
|
+
/** The account this token belongs to */
|
|
136
|
+
readonly account: string;
|
|
137
|
+
/** Optional IP address binding for security */
|
|
138
|
+
readonly ip?: string;
|
|
139
|
+
/** Optional array of tags for categorization and filtering (lowercase, alphanumeric with separators) */
|
|
140
|
+
tags?: string[];
|
|
141
|
+
/** Unix timestamp (seconds) when token was created */
|
|
142
|
+
readonly created: number;
|
|
143
|
+
/** Unix timestamp (seconds) when token expires, or null for never */
|
|
144
|
+
readonly expires?: number;
|
|
145
|
+
/** Unix timestamp (seconds) when token was last used */
|
|
146
|
+
readonly used?: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Response for listing tokens
|
|
151
|
+
*/
|
|
152
|
+
export interface TokenListResponse {
|
|
153
|
+
/** Array of tokens */
|
|
154
|
+
tokens: Token[];
|
|
155
|
+
/** Total count of tokens */
|
|
156
|
+
count?: number;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Response for token creation
|
|
161
|
+
*/
|
|
162
|
+
export interface TokenCreateResponse {
|
|
163
|
+
/** The actual token value (only returned on creation) */
|
|
164
|
+
token: string;
|
|
165
|
+
/** Unix timestamp (seconds) when token expires, or null for never */
|
|
166
|
+
expires?: number;
|
|
167
|
+
/** Success message */
|
|
168
|
+
message?: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
125
171
|
// =============================================================================
|
|
126
172
|
// ACCOUNT TYPES
|
|
127
173
|
// =============================================================================
|
|
@@ -609,6 +655,15 @@ export interface AccountResource {
|
|
|
609
655
|
get: () => Promise<Account>;
|
|
610
656
|
}
|
|
611
657
|
|
|
658
|
+
/**
|
|
659
|
+
* Token resource interface - the contract all implementations must follow
|
|
660
|
+
*/
|
|
661
|
+
export interface TokenResource {
|
|
662
|
+
create: (ttl?: number, tags?: string[]) => Promise<TokenCreateResponse>;
|
|
663
|
+
list: () => Promise<TokenListResponse>;
|
|
664
|
+
remove: (token: string) => Promise<void>;
|
|
665
|
+
}
|
|
666
|
+
|
|
612
667
|
/**
|
|
613
668
|
* Keys resource interface - the contract all implementations must follow
|
|
614
669
|
*/
|