@c6o/kubeclient-contracts
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.0.15](https://github.com/c6o/kubeclient/compare/v0.0.14...v0.0.15) (2022-05-28) | ||
### ✨ Features | ||
* Added support for bulk watching and timeout handling ([#43](https://github.com/c6o/kubeclient/issues/43)) ([30dc7bc](https://github.com/c6o/kubeclient/commit/30dc7bc0fd6a0bc9518ee4ccfc4eb4bcace8ba58)) | ||
## [0.0.14](https://github.com/c6o/kubeclient/compare/v0.0.13...v0.0.14) (2022-05-04) | ||
@@ -8,0 +19,0 @@ |
@@ -10,20 +10,65 @@ /// <reference types="node" /> | ||
import { PartialDeep } from './helpers'; | ||
export interface listOptions { | ||
interface Options { | ||
headers?: keyValue; | ||
table?: boolean; | ||
fieldSelector?: string; | ||
bulkLoad?: boolean; | ||
impersonate?: string; | ||
subResource?: string; | ||
} | ||
export declare const splitOptions: (options?: AllOptions) => { | ||
qs: { | ||
labelSelector?: string | keyValue; | ||
fieldSelector?: string | keyValue; | ||
limit?: number; | ||
continue?: string; | ||
timeoutSeconds?: number; | ||
resourceVersionMatch?: 'Exact' | 'NotOlderThan'; | ||
resourceVersion?: string; | ||
watch?: boolean; | ||
allowWatchBookmarks?: boolean; | ||
dryRun?: boolean; | ||
fieldManager?: string; | ||
fieldValidation?: 'Ignore' | 'Warn' | 'Strict'; | ||
gracePeriodSeconds?: number; | ||
propagationPolicy?: 'Orphan' | 'Background' | 'Foreground'; | ||
}; | ||
headers: keyValue; | ||
table: boolean; | ||
impersonate: string; | ||
subResource: string; | ||
bulkLoad: boolean; | ||
}; | ||
interface WriteOptions { | ||
dryRun?: boolean; | ||
fieldManager?: string; | ||
fieldValidation?: 'Ignore' | 'Warn' | 'Strict'; | ||
} | ||
export interface ListOptions extends Options { | ||
labelSelector?: string | keyValue; | ||
fieldSelector?: string | keyValue; | ||
limit?: number; | ||
continue?: string; | ||
timeoutSeconds?: number; | ||
resourceVersionMatch?: 'Exact' | 'NotOlderThan'; | ||
resourceVersion?: string; | ||
watch?: boolean; | ||
allowWatchBookmarks?: boolean; | ||
} | ||
export interface logOptions { | ||
impersonate?: string; | ||
export interface LogOptions extends Options { | ||
} | ||
export interface readOptions { | ||
impersonate?: string; | ||
export interface ReadOptions extends Options { | ||
} | ||
export interface putOptions { | ||
subResource?: string; | ||
export interface PutOptions extends Options, WriteOptions { | ||
} | ||
export interface createOptions { | ||
impersonate?: string; | ||
export interface CreateOptions extends Options, WriteOptions { | ||
} | ||
export interface DeleteOptions extends Options { | ||
dryRun?: boolean; | ||
gracePeriodSeconds?: number; | ||
propagationPolicy?: 'Orphan' | 'Background' | 'Foreground'; | ||
} | ||
export interface PatchOptions extends Options, WriteOptions { | ||
force?: boolean; | ||
} | ||
export declare type AllOptions = ListOptions & LogOptions & ReadOptions & PutOptions & CreateOptions & DeleteOptions; | ||
export declare type Op = 'replace' | 'add' | 'remove' | 'test' | 'copy' | 'move'; | ||
@@ -36,5 +81,2 @@ export interface PatchOp { | ||
export declare type PatchOps = Array<PatchOp>; | ||
export interface PatchOptions { | ||
headers?: keyValue; | ||
} | ||
export interface Watcher { | ||
@@ -48,12 +90,12 @@ disposer: () => void; | ||
info: Version; | ||
list(resource: Resource, options?: listOptions): Promise<Result>; | ||
read(resource: Resource, options?: readOptions): Promise<Result>; | ||
create<R extends Resource = Resource>(resource: R, owners?: Array<Resource>, options?: createOptions): Promise<Result>; | ||
put<R extends Resource = Resource>(resource: R, newDoc: R, params?: putOptions): Promise<Result>; | ||
patch<R extends Resource = Resource>(resource: R, patch: PartialDeep<R> | PatchOps): Promise<Result>; | ||
delete<R extends Resource = Resource>(resource: R): Promise<Result>; | ||
list(resource: Resource, options?: ListOptions): Promise<Result>; | ||
read(resource: Resource, options?: ReadOptions): Promise<Result>; | ||
create<R extends Resource = Resource>(resource: R, owners?: Array<Resource>, options?: CreateOptions): Promise<Result>; | ||
put<R extends Resource = Resource>(resource: R, newDoc: R, params?: PutOptions): Promise<Result>; | ||
patch<R extends Resource = Resource>(resource: R, patch: PartialDeep<R> | PatchOps, options?: PatchOptions): Promise<Result>; | ||
delete<R extends Resource = Resource>(resource: R, options?: DeleteOptions): Promise<Result>; | ||
upsert<R extends Resource = Resource>(resource: R, owners?: Array<Resource>): Promise<Result>; | ||
toAddress(resource: Resource): Promise<ResourceAddress>; | ||
toString(resource: Resource): string; | ||
watch(resource: Resource, callback: watchCallback, error: watchDone): Promise<Result>; | ||
watch(resource: Resource, callback: watchCallback, error: watchDone, options?: ListOptions): Promise<Result>; | ||
exec(resource: Resource, command: string | string[], stdout?: Writable, stderr?: Writable, stdin?: Readable): Promise<Result>; | ||
@@ -65,1 +107,2 @@ logs(resource: Resource, follow?: boolean): Promise<Result>; | ||
} | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.splitOptions = void 0; | ||
exports.splitOptions = (options = {}) => { | ||
const { headers = {}, table, impersonate, subResource, bulkLoad, ...qs } = options; | ||
return { | ||
qs, | ||
headers, table, impersonate, subResource, bulkLoad | ||
}; | ||
}; | ||
//# sourceMappingURL=cluster.js.map |
@@ -1,2 +0,4 @@ | ||
export declare type watchCallback = (phase: string, obj: any) => void; | ||
export declare type watchDone = (err: any) => void; | ||
import { Resource } from './resource'; | ||
export declare type watchCallbackType = 'ADDED' | 'MODIFIED' | 'DELETED' | 'BOOKMARK'; | ||
export declare type watchCallback = (type: watchCallbackType, resource: Resource) => void | Promise<void>; | ||
export declare type watchDone = (err: any) => void | Promise<void>; |
@@ -15,2 +15,3 @@ export declare type keyValue = { | ||
resourceVersion?: string; | ||
continue?: string; | ||
labels?: keyValue; | ||
@@ -17,0 +18,0 @@ annotations?: keyValue; |
{ | ||
"name": "@c6o/kubeclient-contracts", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "A simple Kubernetes client", | ||
@@ -50,3 +50,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "78b5c50e9111eb5933178b23e674b580556100a4" | ||
"gitHead": "e56242aa04a8113fbef4befb41ab4ac10b889f6b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
49285
772