1 | import { Bucket } from './bucket';
|
2 | import { NodeCallback } from './utilities';
|
3 | import { DesignDocumentNamespace } from './viewtypes';
|
4 | import { CppManagementViewsDesignDocument, CppManagementViewsDesignDocumentView } from './binding';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare class DesignDocumentView {
|
11 | |
12 |
|
13 |
|
14 | map: string | undefined;
|
15 | |
16 |
|
17 |
|
18 | reduce: string | undefined;
|
19 | constructor(data: {
|
20 | map?: string;
|
21 | reduce?: string;
|
22 | });
|
23 | /**
|
24 | * @deprecated
|
25 | */
|
26 | constructor(map?: string, reduce?: string);
|
27 | /**
|
28 | * @internal
|
29 | */
|
30 | static _toCppData(name: string, data: DesignDocumentView): CppManagementViewsDesignDocumentView;
|
31 | /**
|
32 | * @internal
|
33 | */
|
34 | static _fromCppData(data: CppManagementViewsDesignDocumentView): DesignDocumentView;
|
35 | }
|
36 | /**
|
37 | * Contains information about a design document.
|
38 | *
|
39 | * @category Management
|
40 | */
|
41 | export declare class DesignDocument {
|
42 | /**
|
43 | * Same as {@link DesignDocumentView}.
|
44 | *
|
45 | * @deprecated Use {@link DesignDocumentView} directly.
|
46 | */
|
47 | static get View(): any;
|
48 | |
49 |
|
50 |
|
51 | name: string;
|
52 | |
53 |
|
54 |
|
55 | views: {
|
56 | [viewName: string]: DesignDocumentView;
|
57 | };
|
58 | |
59 |
|
60 |
|
61 | namespace: DesignDocumentNamespace;
|
62 | |
63 |
|
64 |
|
65 | rev: string | undefined;
|
66 | constructor(data: {
|
67 | name: string;
|
68 | views?: {
|
69 | [viewName: string]: DesignDocumentView;
|
70 | };
|
71 | namespace?: DesignDocumentNamespace;
|
72 | rev?: string;
|
73 | });
|
74 | /**
|
75 | * @deprecated
|
76 | */
|
77 | constructor(name: string, views: {
|
78 | [viewName: string]: DesignDocumentView;
|
79 | });
|
80 | /**
|
81 | * @internal
|
82 | */
|
83 | static _fromNsData(ddocName: string, ddocData: any): DesignDocument;
|
84 | /**
|
85 | * @internal
|
86 | */
|
87 | static _toCppData(data: DesignDocument, namespace: DesignDocumentNamespace): CppManagementViewsDesignDocument;
|
88 | /**
|
89 | * @internal
|
90 | */
|
91 | static _fromCppData(ddoc: CppManagementViewsDesignDocument): DesignDocument;
|
92 | }
|
93 | /**
|
94 | * @category Management
|
95 | */
|
96 | export interface GetAllDesignDocumentOptions {
|
97 | /**
|
98 | * The timeout for this operation, represented in milliseconds.
|
99 | */
|
100 | timeout?: number;
|
101 | }
|
102 | /**
|
103 | * @category Management
|
104 | */
|
105 | export interface GetDesignDocumentOptions {
|
106 | |
107 |
|
108 |
|
109 | timeout?: number;
|
110 | }
|
111 |
|
112 |
|
113 |
|
114 | export interface UpsertDesignDocumentOptions {
|
115 | |
116 |
|
117 |
|
118 | timeout?: number;
|
119 | }
|
120 |
|
121 |
|
122 |
|
123 | export interface DropDesignDocumentOptions {
|
124 | |
125 |
|
126 |
|
127 | timeout?: number;
|
128 | }
|
129 |
|
130 |
|
131 |
|
132 | export interface PublishDesignDocumentOptions {
|
133 | |
134 |
|
135 |
|
136 | timeout?: number;
|
137 | }
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | export declare class ViewIndexManager {
|
145 | private _bucket;
|
146 | |
147 |
|
148 |
|
149 | constructor(bucket: Bucket);
|
150 | /**
|
151 | * @internal
|
152 | */
|
153 | private get _cluster();
|
154 | /**
|
155 | * Returns a list of all the design documents in this bucket.
|
156 | *
|
157 | * @param options Optional parameters for this operation.
|
158 | * @param callback A node-style callback to be invoked after execution.
|
159 | * @deprecated
|
160 | */
|
161 | getAllDesignDocuments(options?: GetAllDesignDocumentOptions, callback?: NodeCallback<DesignDocument[]>): Promise<DesignDocument[]>;
|
162 | /**
|
163 | * Returns a list of all the design documents in this bucket.
|
164 | *
|
165 | * @param namespace The DesignDocument namespace.
|
166 | * @param options Optional parameters for this operation.
|
167 | * @param callback A node-style callback to be invoked after execution.
|
168 | */
|
169 | getAllDesignDocuments(namespace: DesignDocumentNamespace, options?: GetAllDesignDocumentOptions, callback?: NodeCallback<DesignDocument[]>): Promise<DesignDocument[]>;
|
170 | /**
|
171 | * Returns the specified design document.
|
172 | *
|
173 | * @param designDocName The name of the design document to fetch.
|
174 | * @param options Optional parameters for this operation.
|
175 | * @param callback A node-style callback to be invoked after execution.
|
176 | * @deprecated
|
177 | */
|
178 | getDesignDocument(designDocName: string, options?: GetDesignDocumentOptions, callback?: NodeCallback<DesignDocument>): Promise<DesignDocument>;
|
179 | /**
|
180 | * Returns the specified design document.
|
181 | *
|
182 | * @param designDocName The name of the design document to fetch.
|
183 | * @param namespace The DesignDocument namespace.
|
184 | * @param options Optional parameters for this operation.
|
185 | * @param callback A node-style callback to be invoked after execution.
|
186 | */
|
187 | getDesignDocument(designDocName: string, namespace: DesignDocumentNamespace, options?: GetDesignDocumentOptions, callback?: NodeCallback<DesignDocument>): Promise<DesignDocument>;
|
188 | /**
|
189 | * Creates or updates a design document.
|
190 | *
|
191 | * @param designDoc The DesignDocument to upsert.
|
192 | * @param options Optional parameters for this operation.
|
193 | * @param callback A node-style callback to be invoked after execution.
|
194 | * @deprecated
|
195 | */
|
196 | upsertDesignDocument(designDoc: DesignDocument, options?: UpsertDesignDocumentOptions, callback?: NodeCallback<void>): Promise<void>;
|
197 | /**
|
198 | * Creates or updates a design document.
|
199 | *
|
200 | * @param designDoc The DesignDocument to upsert.
|
201 | * @param namespace The DesignDocument namespace.
|
202 | * @param options Optional parameters for this operation.
|
203 | * @param callback A node-style callback to be invoked after execution.
|
204 | */
|
205 | upsertDesignDocument(designDoc: DesignDocument, namespace?: DesignDocumentNamespace, options?: UpsertDesignDocumentOptions, callback?: NodeCallback<void>): Promise<void>;
|
206 | /**
|
207 | * Drops an existing design document.
|
208 | *
|
209 | * @param designDocName The name of the design document to drop.
|
210 | * @param options Optional parameters for this operation.
|
211 | * @param callback A node-style callback to be invoked after execution.
|
212 | * @deprecated
|
213 | */
|
214 | dropDesignDocument(designDocName: string, options?: DropDesignDocumentOptions, callback?: NodeCallback<void>): Promise<void>;
|
215 | /**
|
216 | * Drops an existing design document.
|
217 | *
|
218 | * @param designDocName The name of the design document to drop.
|
219 | * @param namespace The DesignDocument namespace.
|
220 | * @param options Optional parameters for this operation.
|
221 | * @param callback A node-style callback to be invoked after execution.
|
222 | */
|
223 | dropDesignDocument(designDocName: string, namespace: DesignDocumentNamespace, options?: DropDesignDocumentOptions, callback?: NodeCallback<void>): Promise<void>;
|
224 | /**
|
225 | * Publishes a development design document to be a production design document.
|
226 | * It does this by fetching the design document by the passed name with `dev_`
|
227 | * appended, and then performs an upsert of the production name (no `dev_`)
|
228 | * with the data which was just fetched.
|
229 | *
|
230 | * @param designDocName The name of the design document to publish.
|
231 | * @param options Optional parameters for this operation.
|
232 | * @param callback A node-style callback to be invoked after execution.
|
233 | */
|
234 | publishDesignDocument(designDocName: string, options?: PublishDesignDocumentOptions, callback?: NodeCallback<void>): Promise<void>;
|
235 | }
|